From 019ba282117513fab52c155f46ea5596ff9c920f Mon Sep 17 00:00:00 2001 From: Shane Date: Sun, 11 Jan 2026 01:00:01 +0000 Subject: [PATCH] trim --- Makefile | 24 +++++++++++++++++------- etc/gitweb.conf | 16 ++++++++-------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 3b3e6ff..acb16ca 100644 --- a/Makefile +++ b/Makefile @@ -67,8 +67,9 @@ certbot/nginx: ##H @Remote Run certbot on remote VPS @echo "Running certbot on $(VPS_HOST)..." ssh -t $(VPS) "sudo certbot --nginx" -.PHONY: stage/local -stage/local: ##H @Local Stage files locally (supports SUDO_USER) +# Internal caching/staging target (not intended for direct user use) +.PHONY: _stage/local +_stage/local: ifdef SUDO_USER @echo "Staging files locally for user $(SUDO_USER)..." rm -rf /tmp/nginx-staging && mkdir -p /tmp/nginx-staging @@ -85,14 +86,23 @@ ifdef SUDO_USER cp scripts/deploy.sh /tmp/nginx-staging/ chmod -R a+rX /tmp/nginx-staging else - @echo "Staging files locally..." - rm -rf ~/.nginx-staging && mkdir -p ~/.nginx-staging - cp -r etc/nginx/conf.d/*.conf ~/.nginx-staging/ - cp scripts/deploy.sh ~/.nginx-staging/ + @echo "Staging files locally (current user)..." + mkdir -p $(HOME)/.nginx-staging + rm -rf $(HOME)/.nginx-staging/* + cp -r etc/nginx/conf.d/*.conf $(HOME)/.nginx-staging/ + # Only copy secrets.conf if it is decrypted (not binary) + @if grep -qI . etc/nginx/conf.d/secrets.conf; then \ + echo "secrets.conf is decrypted, including it."; \ + else \ + echo "secrets.conf is ENCRYPTED, skipping."; \ + rm -f $(HOME)/.nginx-staging/secrets.conf; \ + fi + [ -f etc/gitweb.conf ] && cp etc/gitweb.conf $(HOME)/.nginx-staging/ + cp scripts/deploy.sh $(HOME)/.nginx-staging/ endif .PHONY: diff/local -diff/local: stage/local ##H @Local Show diff locally (supports SUDO_USER) +diff/local: _stage/local ##H @Local Show diff locally (supports SUDO_USER) ifdef SUDO_USER @echo "Checking diff locally as $(SUDO_USER)..." su -P $(SUDO_USER) -c "bash /tmp/nginx-staging/deploy.sh diff" diff --git a/etc/gitweb.conf b/etc/gitweb.conf index 9559e09..b14c28e 100644 --- a/etc/gitweb.conf +++ b/etc/gitweb.conf @@ -1,29 +1,29 @@ # path to git projects (.git) -$projectroot = "/srv/git"; +$projectroot = "/srv/git"; # [CUSTOM: VPS git root] # directory to use for temp files -$git_temp = "/tmp"; +$git_temp = "/tmp"; # [CUSTOM] # target of the home link on top of all pages -$home_link = $my_uri || "/"; +$home_link = $my_uri || "/"; # [CUSTOM: Link to root] # html text to include at home page -$home_text = "indextext.html"; +$home_text = "indextext.html"; # [CUSTOM] # file with project list; by default, simply scan the projectroot dir. #$projects_list = $projectroot; # stylesheet to use -@stylesheets = ("/static/gitweb.css"); +@stylesheets = ("/static/gitweb.css"); # [CUSTOM] # javascript code for gitweb -$javascript = "static/gitweb.js"; +$javascript = "static/gitweb.js"; # [CUSTOM] # logo to use -$logo = "/static/git-logo.png"; +$logo = "/static/git-logo.png"; # [CUSTOM] # the 'favicon' -$favicon = "/static/git-favicon.png"; +$favicon = "/static/git-favicon.png"; # [CUSTOM] # git-diff-tree(1) options to use for generated patches #@diff_opts = ("-M"); -- 2.52.0