Auto-update: Tue Aug 13 17:24:06 PDT 2024

This commit is contained in:
sanj 2024-08-13 17:24:06 -07:00
parent 426844f928
commit 69deab63d3
3 changed files with 77 additions and 75 deletions

View file

@ -5,6 +5,7 @@ from pathlib import Path
from dotenv import load_dotenv from dotenv import load_dotenv
from .logs import L, get_logger from .logs import L, get_logger
# Initialize logger before loading any other dependencies
BASE_DIR = Path(__file__).resolve().parent BASE_DIR = Path(__file__).resolve().parent
CONFIG_DIR = BASE_DIR / "config" CONFIG_DIR = BASE_DIR / "config"
ENV_PATH = CONFIG_DIR / ".env" ENV_PATH = CONFIG_DIR / ".env"
@ -21,13 +22,12 @@ from pathlib import Path
from .database import Database from .database import Database
from .classes import Config, SysConfig, DirConfig, Geocoder from .classes import Config, SysConfig, DirConfig, Geocoder
# API essentials # Load core configurations
Sys = SysConfig.init('sys', 'secrets') Sys = SysConfig.init('sys', 'secrets') # load configuration from config/sys.yaml and config/secrets.yaml
Dir = DirConfig.init('dirs') Db = Database.init('sys') # load configuration from config/sys.yaml
l.debug(f"Dir configuration initialized: {Dir}") Dir = DirConfig.init('dirs') # load configuration from config/dirs.yaml
l.debug(f"ROUTER path: {Dir.ROUTER}")
Db = Database.init('db')
# Load module configurations
Img = Config.init('img', 'secrets', Dir) Img = Config.init('img', 'secrets', Dir)
Llm = Config.init('llm', 'secrets', Dir) Llm = Config.init('llm', 'secrets', Dir)
News = Config.init('news', 'secrets', Dir) News = Config.init('news', 'secrets', Dir)

View file

@ -1,69 +0,0 @@
POOL:
- ts_id: 'server1'
ts_ip: '192.168.0.10'
app_port: 4444
db_port: 5432
db_name: mydb
db_user: dbuser
db_pass: 'password123'
ssh_port: 22
ssh_user: sshuser
ssh_pass: 'password456'
path: '/Users/sij/workshop/sijapi'
tmux: '/opt/homebrew/bin/tmux'
tailscale: '/usr/local/bin/tailscale'
conda: '/Users/sij/miniforge3/bin/mamba'
conda_env: '/Users/sij/miniforge3/envs/sijapi'
vitals: '/Users/sij/workshop/scripts/gitea/pathScripts/vitals'
vpn: '/Users/sij/workshop/scripts/gitea/pathScripts/vpn'
- ts_id: 'server2'
ts_ip: '192.168.0.11'
app_port: 4444
db_port: 5432
db_name: mydb
db_user: dbuser
db_pass: 'password123'
ssh_port: 22
ssh_user: sshuser
ssh_pass: 'password456'
path: '/Users/sij/workshop/sijapi'
tmux: '/opt/homebrew/bin/tmux'
tailscale: '/usr/local/bin/tailscale'
conda: '/Users/sij/miniforge3/bin/mamba'
conda_env: '/Users/sij/miniforge3/envs/sijapi'
vitals: '/Users/sij/workshop/scripts/gitea/pathScripts/vitals'
vpn: '/Users/sij/workshop/scripts/gitea/pathScripts/vpn'
- ts_id: 'server3'
ts_ip: '192.168.0.12'
app_port: 4444
db_port: 5432
db_name: mydb
db_user: dbuser
db_pass: 'password123'
ssh_port: 22
ssh_user: sshuser
ssh_pass: 'password456'
path: '/Users/sij/workshop/sijapi'
tmux: '/opt/homebrew/bin/tmux'
tailscale: '/usr/local/bin/tailscale'
conda: '/Users/sij/miniforge3/bin/mamba'
conda_env: '/Users/sij/miniforge3/envs/sijapi'
vitals: '/Users/sij/workshop/scripts/gitea/pathScripts/vitals'
vpn: '/Users/sij/workshop/scripts/gitea/pathScripts/vpn'
TABLES:
locations:
primary_key: id
use_guid: true
dailyweather:
primary_key: id
use_guid: true
hourlyweather:
primary_key: id
use_guid: true
click_logs:
primary_key: id
use_guid: true
short_urls:
primary_key: id
use_guid: true

View file

@ -90,3 +90,74 @@ TZ: "America/Los_Angeles"
GARBAGE: GARBAGE:
COLLECTION_INTERVAL: 60 * 60 COLLECTION_INTERVAL: 60 * 60
TTL: 60 * 60 * 24 TTL: 60 * 60 * 24
# Database configuration
POOL:
- ts_id: 'server1'
ts_ip: '192.168.0.10'
app_port: 4444
db_port: 5432
db_name: mydb
db_user: dbuser
db_pass: 'password123'
ssh_port: 22
ssh_user: sshuser
ssh_pass: 'password456'
path: '/Users/sij/workshop/sijapi'
tmux: '/opt/homebrew/bin/tmux'
tailscale: '/usr/local/bin/tailscale'
conda: '/Users/sij/miniforge3/bin/mamba'
conda_env: '/Users/sij/miniforge3/envs/sijapi'
vitals: '/Users/sij/workshop/scripts/gitea/pathScripts/vitals'
vpn: '/Users/sij/workshop/scripts/gitea/pathScripts/vpn'
- ts_id: 'server2'
ts_ip: '192.168.0.11'
app_port: 4444
db_port: 5432
db_name: mydb
db_user: dbuser
db_pass: 'password123'
ssh_port: 22
ssh_user: sshuser
ssh_pass: 'password456'
path: '/Users/sij/workshop/sijapi'
tmux: '/opt/homebrew/bin/tmux'
tailscale: '/usr/local/bin/tailscale'
conda: '/Users/sij/miniforge3/bin/mamba'
conda_env: '/Users/sij/miniforge3/envs/sijapi'
vitals: '/Users/sij/workshop/scripts/gitea/pathScripts/vitals'
vpn: '/Users/sij/workshop/scripts/gitea/pathScripts/vpn'
- ts_id: 'server3'
ts_ip: '192.168.0.12'
app_port: 4444
db_port: 5432
db_name: mydb
db_user: dbuser
db_pass: 'password123'
ssh_port: 22
ssh_user: sshuser
ssh_pass: 'password456'
path: '/Users/sij/workshop/sijapi'
tmux: '/opt/homebrew/bin/tmux'
tailscale: '/usr/local/bin/tailscale'
conda: '/Users/sij/miniforge3/bin/mamba'
conda_env: '/Users/sij/miniforge3/envs/sijapi'
vitals: '/Users/sij/workshop/scripts/gitea/pathScripts/vitals'
vpn: '/Users/sij/workshop/scripts/gitea/pathScripts/vpn'
TABLES:
locations:
primary_key: id
use_guid: true
dailyweather:
primary_key: id
use_guid: true
hourlyweather:
primary_key: id
use_guid: true
click_logs:
primary_key: id
use_guid: true
short_urls:
primary_key: id
use_guid: true