From: Shane Jaroch Date: Wed, 21 Jan 2026 20:35:13 +0000 (-0500) Subject: updates to deployment X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=89055890ad6d9cec876b874f73e68d54b15dcb30;p=nutratech%2Fvps-root.git updates to deployment --- diff --git a/Makefile b/Makefile index eca9152..7a2ebdd 100644 --- a/Makefile +++ b/Makefile @@ -67,9 +67,9 @@ stage/nginx: ##H @Remote Stage files on the remote VPS scripts/deploy.sh \ scripts/gen_services_map.py \ scripts/homepage.html | \ - ssh $(VPS) "rm -rf ~/.nginx-staging \ - && mkdir -p ~/.nginx-staging \ - && tar xz -C ~/.nginx-staging" + ssh $(VPS) "rm -rf ~/.nginx-ops/staging \ + && mkdir -p ~/.nginx-ops/staging \ + && tar xz -C ~/.nginx-ops/staging" .PHONY: deploy/nginx @@ -78,8 +78,8 @@ deploy/nginx: stage/nginx @echo "Connecting to $(VPS_HOST)..." @# We chain test && diff && deploy in ONE SSH session. @# This preserves the sudo timestamp so you only type your password once. - ssh -t $(VPS) "bash ~/.nginx-staging/scripts/deploy.sh test $(ENV) && \ - bash ~/.nginx-staging/scripts/deploy.sh $(ENV)" + ssh -t $(VPS) "bash ~/.nginx-ops/staging/scripts/deploy.sh test $(ENV) && \ + bash ~/.nginx-ops/staging/scripts/deploy.sh $(ENV)" .PHONY: deploy/klaus diff --git a/etc/nginx/conf.d/stalwart.dev.conf b/etc/nginx/conf.d/stalwart.dev.conf index ebf2e29..6a6c1a7 100644 --- a/etc/nginx/conf.d/stalwart.dev.conf +++ b/etc/nginx/conf.d/stalwart.dev.conf @@ -8,6 +8,7 @@ server { # Main Server (HTTPS + HTTP/3) server { + # Service: Mail Server (Stalwart) | https://mail.nutra.tk server_name mail.nutra.tk; # HTTP/3 (QUIC) - UDP diff --git a/scripts/deploy.sh b/scripts/deploy.sh index afedceb..1789e2f 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -43,11 +43,11 @@ show_diff() { fi if [ -f "$TARGET_FILE" ]; then - diff -u --color=always "$TARGET_FILE" "$FILE" || true + diff -u --color=always "$TARGET_FILE" "$FILE" || true else - echo "New file: $BASENAME" - # Show content of new file as diff (dev null vs new) - diff -u --color=always /dev/null "$FILE" || true + echo "New file: $BASENAME" + # Show content of new file as diff (dev null vs new) + diff -u --color=always /dev/null "$FILE" || true fi done @@ -114,7 +114,7 @@ if [ "$1" = "test" ]; then fi # Create timestamped backup -BACKUP_DIR=~/nginx_backup_$(date +%s) +BACKUP_DIR=~/.nginx-ops/backups/nginx_backup_$(date +%s) echo "Creating backup at $BACKUP_DIR..." mkdir -p "$BACKUP_DIR" if sudo ls "$DEST_CONF_DIR"/*.conf >/dev/null 2>&1; then diff --git a/scripts/gen_services_map.py b/scripts/gen_services_map.py index a70e823..66f2247 100755 --- a/scripts/gen_services_map.py +++ b/scripts/gen_services_map.py @@ -75,40 +75,41 @@ def get_all_services(custom_config_path=None): services_git = parse_file(NGINX_CONF, version_pattern, is_version=True) - DEFAULT_CONF = None - if custom_config_path: - p = Path(custom_config_path) - if p.exists(): - DEFAULT_CONF = p - print(f"Using custom config: {DEFAULT_CONF}") - else: - print(f"Error: Custom config not found at {p}") - sys.exit(1) + NGINX_CONF_DIR = REPO_ROOT / "etc/nginx/conf.d" + + # Always scan all .conf files in the directory + if NGINX_CONF_DIR.exists(): + conf_files = list(NGINX_CONF_DIR.glob("*.conf")) + print(f"Scanning {len(conf_files)} config files in {NGINX_CONF_DIR}...") else: - # Locate default.conf fallback (old logic) - # On Server: Read the live deployed config - live_default = Path("/etc/nginx/conf.d/default.conf") - # On Local: Read default.dev.conf - local_dev = REPO_ROOT / "etc/nginx/conf.d/default.dev.conf" - - if live_default.exists(): - DEFAULT_CONF = live_default - print(f"Using live config: {DEFAULT_CONF}") - else: - DEFAULT_CONF = local_dev - print(f"Using local config: {DEFAULT_CONF}") + print(f"Warning: Config directory not found at {NGINX_CONF_DIR}") + conf_files = [] + + services_other = [] + for conf_file in conf_files: + # Skip the git-http conf as it's parsed separately + if conf_file.name == "git-http.dev.conf": + continue + + print(f" Parsing {conf_file.name}...") + services_other.extend(parse_file(conf_file, service_pattern, is_version=False)) - services_other = parse_file(DEFAULT_CONF, service_pattern, is_version=False) + # Sort services by ID for consistent output + services_other.sort(key=lambda x: x["id"]) return services_git, services_other -def generate_html(title, groups): +def generate_html(title, groups, intro_html=None): """ groups: list of tuples (header_name, services_list) + intro_html: optional HTML string to insert before groups """ content_html = "" + if intro_html: + content_html += f'
{intro_html}
' + for header, services in groups: if header: content_html += f'

{header}

' @@ -162,7 +163,15 @@ def main(): total_items = sum(len(g[1]) for g in all_groups) print(f"Generating Homepage map with {total_items} items...") - home_html = generate_html("All Services", all_groups) + # Construction Notice + construction_notice = """ +

The site is under construction/rebuild... all the services are run from two VPS servers, one with 1 GB and another with 2 GB of RAM.

+

Please see the services we have online below during our extensive rebuild process (Jan 2026).

+ """ + + home_html = generate_html( + "All Services", all_groups, intro_html=construction_notice + ) with open(OUTPUT_HTML_HOME, "w") as f: f.write(home_html) diff --git a/scripts/homepage.html b/scripts/homepage.html index bdf09dc..b4d5927 100644 --- a/scripts/homepage.html +++ b/scripts/homepage.html @@ -19,7 +19,30 @@

All Services

Generated automatically from Nginx configuration.

-

Core Services

Git Services

+
+

The site is under construction/rebuild... all the services are run from two VPS servers, one with 1 GB and another with 2 GB of RAM.

+

Please see the services we have online below during our extensive rebuild process (Jan 2026).

+

Core Services

+
+

https://api.dev.nutra.tk

+
API
+
+
+

https://mail.nutra.tk

+
Mail Server (Stalwart)
+
+
+

https://chat.nutra.tk

+
Matrix Chat
+
+
+

https://store.nutra.tk

+
Store
+
+
+

https://store-admin-8b56411b.nutra.tk

+
Store Admin
+

Git Services

https://git.nutra.tk/v1

Original Gitweb (Basic)