updates to deployment
authorShane Jaroch <chown_tee@proton.me>
Wed, 21 Jan 2026 20:35:13 +0000 (15:35 -0500)
committerShane Jaroch <chown_tee@proton.me>
Wed, 21 Jan 2026 20:35:13 +0000 (15:35 -0500)
Makefile
etc/nginx/conf.d/stalwart.dev.conf
scripts/deploy.sh
scripts/gen_services_map.py
scripts/homepage.html

index eca9152df4161ef002051af1ef2f4ea7a27787bc..7a2ebdd33f2044c89305c847b2313872010284e4 100644 (file)
--- 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
index ebf2e29cb4ffe9583ba6ba08f5738551f7f684e2..6a6c1a7b1de1bc432504cd115e9ed3a7b6464c0a 100644 (file)
@@ -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
index afedceb63d4dab4186ba5e8a530ea26986fc5e69..1789e2fd2230b3a4ad57053fdce3f148c0e67a65 100755 (executable)
@@ -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
index a70e823472f52b9e5e2f47f9429a90cf9396ed4f..66f22474924a470feee208d49e0c313e8c3f7ec1 100755 (executable)
@@ -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'<div class="intro">{intro_html}</div>'
+
     for header, services in groups:
         if header:
             content_html += f'<h2 class="group-header">{header}</h2>'
@@ -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 = """
+    <p>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.</p>
+    <p>Please see the services we have online below during our extensive rebuild process (Jan 2026).</p>
+    """
+
+    home_html = generate_html(
+        "All Services", all_groups, intro_html=construction_notice
+    )
 
     with open(OUTPUT_HTML_HOME, "w") as f:
         f.write(home_html)
index bdf09dc1af355f7f7027f235de268270c2434c5d..b4d5927fc5460e283dd3229ddbc9e1923796e480 100644 (file)
     <h1>All Services</h1>
     <p class="meta">Generated automatically from Nginx configuration.</p>
 
-    <h2 class="group-header">Core Services</h2><h2 class="group-header">Git Services</h2>
+    <div class="intro">
+    <p>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.</p>
+    <p>Please see the services we have online below during our extensive rebuild process (Jan 2026).</p>
+    </div><h2 class="group-header">Core Services</h2>
+        <div class="service">
+            <h3><a href="https://api.dev.nutra.tk">https://api.dev.nutra.tk</a></h3>
+            <div class="desc">API</div>
+        </div>
+        <div class="service">
+            <h3><a href="https://mail.nutra.tk">https://mail.nutra.tk</a></h3>
+            <div class="desc">Mail Server (Stalwart)</div>
+        </div>
+        <div class="service">
+            <h3><a href="https://chat.nutra.tk">https://chat.nutra.tk</a></h3>
+            <div class="desc">Matrix Chat</div>
+        </div>
+        <div class="service">
+            <h3><a href="https://store.nutra.tk">https://store.nutra.tk</a></h3>
+            <div class="desc">Store</div>
+        </div>
+        <div class="service">
+            <h3><a href="https://store-admin-8b56411b.nutra.tk">https://store-admin-8b56411b.nutra.tk</a></h3>
+            <div class="desc">Store Admin</div>
+        </div><h2 class="group-header">Git Services</h2>
         <div class="service">
             <h3><a href="https://git.nutra.tk/v1">https://git.nutra.tk/v1</a></h3>
             <div class="desc">Original Gitweb (Basic)</div>