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
@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
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
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
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>'
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)
<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>