Skip to content

Commit

Permalink
+= .env - kamangir/bolt#1234
Browse files Browse the repository at this point in the history
  • Loading branch information
kamangir committed Mar 2, 2024
1 parent e4e0b09 commit 8844188
Show file tree
Hide file tree
Showing 36 changed files with 422 additions and 478 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To see the list of `abcli` commands type in:
abcli ?
```

To configure `abcli` follow [these instructions](./bash/bootstrap/config/README.md).
To configure `abcli` complete the [.env](./.env) file using this [sample](./sample.env).

## branches

Expand Down
2 changes: 1 addition & 1 deletion abcli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

NAME = "abcli"

VERSION = "7.2818.1"
VERSION = "7.2834.1"

DESCRIPTION = "🚀 a language to speak AI."

Expand Down
70 changes: 70 additions & 0 deletions abcli/env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import os
from dotenv import load_dotenv

load_dotenv()

abcli_aws_ec2_default_image_name = os.getenv("abcli_aws_ec2_default_image_name", "")
abcli_aws_ec2_default_instance_type = os.getenv(
"abcli_aws_ec2_default_instance_type", ""
)
abcli_aws_ec2_default_template = os.getenv("abcli_aws_ec2_default_template", "")
abcli_aws_ec2_image_id_abcli = os.getenv("abcli_aws_ec2_image_id_abcli", "")
abcli_aws_ec2_image_id_abcli_g4dn = os.getenv("abcli_aws_ec2_image_id_abcli_g4dn", "")
abcli_aws_ec2_image_id_bolt = os.getenv("abcli_aws_ec2_image_id_bolt", "")
abcli_aws_ec2_key_name = os.getenv("abcli_aws_ec2_key_name", "")
abcli_aws_ec2_security_group_ids = os.getenv("abcli_aws_ec2_security_group_ids", "")
abcli_aws_ec2_subnet_id = os.getenv("abcli_aws_ec2_subnet_id", "")
abcli_aws_ec2_templates_bolt = os.getenv("abcli_aws_ec2_templates_bolt", "")
abcli_aws_ec2_templates_bolt_gpu = os.getenv("abcli_aws_ec2_templates_bolt_gpu", "")

abcli_aws_rds_db = os.getenv("abcli_aws_rds_db", "")
abcli_aws_rds_host = os.getenv("abcli_aws_rds_host", "")
abcli_aws_rds_password = os.getenv("abcli_aws_rds_password", "")
abcli_aws_rds_port = os.getenv("abcli_aws_rds_port", "")
abcli_aws_rds_user = os.getenv("abcli_aws_rds_user", "")

abcli_aws_region = os.getenv("abcli_aws_region", "")
abcli_aws_s3_bucket_name = os.getenv("abcli_aws_s3_bucket_name", "")
abcli_aws_s3_prefix = os.getenv("abcli_aws_s3_prefix", "")
abcli_aws_s3_public_bucket_name = os.getenv("abcli_aws_s3_public_bucket_name", "")

abcli_blue_sbc_application = os.getenv("abcli_blue_sbc_application", "")

abcli_camera_diff = os.getenv("abcli_camera_diff", "")
abcli_camera_hi_res = os.getenv("abcli_camera_hi_res", "")
abcli_camera_rotation = os.getenv("abcli_camera_rotation", "")

abcli_display_fullscreen = os.getenv("abcli_display_fullscreen", "")

abcli_git_ssh_key_name = os.getenv("abcli_git_ssh_key_name", "")

abcli_gpu = os.getenv("abcli_gpu", "")

abcli_hardware_kind = os.getenv("abcli_hardware_kind", "")

abcli_messenger_recipients = os.getenv("abcli_messenger_recipients", "")

abcli_papertrail_dest_host = os.getenv("abcli_papertrail_dest_host", "")
abcli_papertrail_dest_port = os.getenv("abcli_papertrail_dest_port", "")

abcli_plugins = os.getenv("abcli_plugins", "")

abcli_session_auto_upload = os.getenv("abcli_session_auto_upload", "")
abcli_session_imager_diff = os.getenv("abcli_session_imager_diff", "")
abcli_session_imager_enabled = os.getenv("abcli_session_imager_enabled", "")
abcli_session_imager_period = os.getenv("abcli_session_imager_period", "")
abcli_session_imager = os.getenv("abcli_session_imager", "")
abcli_session_messenger_period = os.getenv("abcli_session_messenger_period", "")
abcli_session_monitor_enabled = os.getenv("abcli_session_monitor_enabled", "")
abcli_session_object_tags = os.getenv("abcli_session_object_tags", "")
abcli_session_outbound_queue = os.getenv("abcli_session_outbound_queue", "")
abcli_session_reboot_period = os.getenv("abcli_session_reboot_period", "")
abcli_session_screen_period = os.getenv("abcli_session_screen_period", "")
abcli_session_temperature_period = os.getenv("abcli_session_temperature_period", "")
abcli_session = os.getenv("abcli_session", "")
abcli_ultralytics_api_key = os.getenv("abcli_ultralytics_api_key", "")
abcli_youtube_api_key = os.getenv("abcli_youtube_api_key", "")

OPENAI_API_KEY = os.getenv("OPENAI_API_KEY", "")

STABILITY_KEY = os.getenv("STABILITY_KEY", "")
21 changes: 0 additions & 21 deletions abcli/modules/cookie/__init__.py

This file was deleted.

42 changes: 0 additions & 42 deletions abcli/modules/cookie/__main__.py

This file was deleted.

24 changes: 0 additions & 24 deletions abcli/plugins/aws.py

This file was deleted.

11 changes: 2 additions & 9 deletions abcli/plugins/message/messenger/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from abcli import env
from abcli.modules import host
from abcli.modules.cookie import cookie
from abcli.plugins.message.messenger.classes import Messenger


Expand All @@ -11,14 +11,7 @@
host.get_name(),
]
+ host.get_tags()
+ [
thing
for thing in cookie.get(
"messenger.recipients",
"",
).split(",")
if thing
]
+ [thing for thing in env.abcli_messenger_recipients.split(",") if thing]
)
)
)
19 changes: 7 additions & 12 deletions abcli/table/classes.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
import os
import os.path
import pymysql
from abcli import env
from abcli import file
from . import NAME
from abcli.table import NAME
from abcli.logging import logger, crash_report


class Table:
def __init__(self, name):
self.name = name

_, info = file.load_json(
os.path.join(
os.getenv("abcli_path_bash", ""),
"bootstrap/config/aws.json",
)
)
self.db = info["rds"]["db"]
self.host = info["rds"]["host"]
self.password = info["rds"]["password"]
self.port = info["rds"]["port"]
self.user = info["rds"]["user"]
self.db = env.abcli_aws_rds_db
self.host = env.abcli_aws_rds_host
self.password = env.abcli_aws_rds_password
self.port = env.abcli_aws_rds_port
self.user = env.abcli_aws_rds_user

self.connection = None

Expand Down
2 changes: 1 addition & 1 deletion bash/abcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function abcli_main() {
fi
}

if [ -f "$abcli_path_bash/bootstrap/cookie/disabled" ]; then
if [ -f "$abcli_path_ignore/disabled" ]; then
printf "abcli is \033[0;31mdisabled\033[0m.\n"
else
abcli_main "$@"
Expand Down
3 changes: 0 additions & 3 deletions bash/bootstrap/config/.gitignore

This file was deleted.

38 changes: 0 additions & 38 deletions bash/bootstrap/config/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions bash/bootstrap/config/template/.gitignore

This file was deleted.

32 changes: 0 additions & 32 deletions bash/bootstrap/config/template/aws.json

This file was deleted.

3 changes: 0 additions & 3 deletions bash/bootstrap/config/template/git.sh

This file was deleted.

4 changes: 0 additions & 4 deletions bash/bootstrap/config/template/kaggle.json

This file was deleted.

5 changes: 0 additions & 5 deletions bash/bootstrap/config/template/papertrail.sh

This file was deleted.

Loading

0 comments on commit 8844188

Please sign in to comment.