From e1f05acd03c2632fe3456f95cc161b91eee813e8 Mon Sep 17 00:00:00 2001 From: Shane Date: Sun, 11 Jan 2026 00:15:36 +0000 Subject: [PATCH] update with git-http.conf and dns-records.csv --- .env | 2 ++ Makefile | 22 ++++++++++++++++++++++ dns-records.csv | 17 +++++++++++++++++ etc/nginx/conf.d/git-http.conf | 23 +++++++++++++++++++++++ scripts/dns-records.csv | 17 +++++++++++++++++ 5 files changed, 81 insertions(+) create mode 100644 .env create mode 100644 dns-records.csv create mode 100644 etc/nginx/conf.d/git-http.conf create mode 100644 scripts/dns-records.csv diff --git a/.env b/.env new file mode 100644 index 0000000..64ff8ba --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +VPS_HOST=dev.nutra.tk +VPS_USER=gg diff --git a/Makefile b/Makefile index 811c9ad..b9fc6ee 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,11 @@ .SHELL := /bin/bash # .ONESHELL: +ifneq (,$(wildcard ./.env)) + include .env + export +endif + VPS_HOST ?= dev.nutra.tk VPS_USER ?= gg @@ -20,3 +25,20 @@ diff/nginx: deploy/nginx: @echo "Deploying checked-in nginx config to $(VPS_HOST)..." ssh -t $(VPS_USER)@$(VPS_HOST) "bash ~/nginx-staging/deploy.sh" + +.PHONY: stage/local +stage/local: + @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/ + +.PHONY: diff/local +diff/local: stage/local + @echo "Checking diff locally..." + bash ~/nginx-staging/deploy.sh diff + +.PHONY: deploy/local +deploy/local: stage/local + @echo "Deploying locally..." + bash ~/nginx-staging/deploy.sh diff --git a/dns-records.csv b/dns-records.csv new file mode 100644 index 0000000..b9ed3b4 --- /dev/null +++ b/dns-records.csv @@ -0,0 +1,17 @@ +Name,Type,TTL,Target +,A,3600,216.218.216.163 +API,A,3600,216.218.216.163 +API-DEV,A,3600,216.218.228.93 +API.DEV,A,3600,216.218.228.93 +CHAT,A,3600,216.218.228.93 +DEV,A,3600,216.218.228.93 +GIT,A,3600,216.218.228.93 +MATRIX,A,3600,216.218.228.93 +S3,A,3600,216.218.228.93 +S3-ADMIN,A,3600,216.218.228.93 +STORE,A,3600,216.218.228.93 +STORE-ADMIN-8B56411B,A,3600,216.218.228.93 +STORE-API,A,3600,216.218.228.93 +WWW,A,3600,216.218.216.163 +WWW.DEV,A,3600,216.218.228.93 +,TXT,3600,google-site-verification=kxGS8ZR9OjzDU8gXJoXOYZ5CdVSpfZkgEHxdsQIOwf0 diff --git a/etc/nginx/conf.d/git-http.conf b/etc/nginx/conf.d/git-http.conf new file mode 100644 index 0000000..a61ff48 --- /dev/null +++ b/etc/nginx/conf.d/git-http.conf @@ -0,0 +1,23 @@ +server { + listen 80; + server_name git.nutra.tk; + + # Define the root directory for non-Git content (optional) + root /var/www/html; + index index.html; + + # Directory for Git repositories + set $git_root /srv/git; + + # Serve Git repositories under /git/ + location ~ ^/git/([^/]+\.git)(/.*)?$ { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; + fastcgi_param GIT_PROJECT_ROOT $git_root; + fastcgi_param GIT_HTTP_EXPORT_ALL "1"; # Allow access without git-daemon-export-ok + fastcgi_param PATH_INFO /$1$2; # Repo name + subpath (e.g., /myrepo.git/info/refs) + fastcgi_param REQUEST_METHOD $request_method; + fastcgi_param QUERY_STRING $query_string; + fastcgi_pass unix:/var/run/fcgiwrap.socket; + } +} diff --git a/scripts/dns-records.csv b/scripts/dns-records.csv new file mode 100644 index 0000000..7da5614 --- /dev/null +++ b/scripts/dns-records.csv @@ -0,0 +1,17 @@ +Name,Type,TTL,Target +@,A,3600,216.218.216.163 +API,A,3600,216.218.216.163 +API-DEV,A,3600,216.218.228.93 +API.DEV,A,3600,216.218.228.93 +CHAT,A,3600,216.218.228.93 +DEV,A,3600,216.218.228.93 +GIT,A,3600,216.218.228.93 +MATRIX,A,3600,216.218.228.93 +S3,A,3600,216.218.228.93 +S3-ADMIN,A,3600,216.218.228.93 +STORE,A,3600,216.218.228.93 +STORE-ADMIN-8B56411B,A,3600,216.218.228.93 +STORE-API,A,3600,216.218.228.93 +WWW,A,3600,216.218.216.163 +WWW.DEV,A,3600,216.218.228.93 +@,TXT,3600,google-site-verification=kxGS8ZR9OjzDU8gXJoXOYZ5CdVSpfZkgEHxdsQIOwf0 -- 2.52.0