From be6623dc9f05a1db0f63a574235d10652b7e69f7 Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Sun, 5 Jul 2026 15:22:39 -0400 Subject: start redoing configuration --- TODO | 10 ++++--- configuration/homepage.conf | 69 +++++++++++++++++++++++++++++++++++++++++++++ nginx/homepage.conf | 69 --------------------------------------------- scripts/deploy.sh | 11 ++++---- 4 files changed, 81 insertions(+), 78 deletions(-) create mode 100644 configuration/homepage.conf delete mode 100644 nginx/homepage.conf diff --git a/TODO b/TODO index 42d1a97..048e4b5 100644 --- a/TODO +++ b/TODO @@ -5,10 +5,12 @@ https://www.omarpolo.com/post/cgit-gitolite.html https://matejamaric.com/blog/git-server/ https://0x42.sh/cgit-nginx-gitolite-a-personal-git-server/ -- [ ] cgit don't show .git, show about -- [ ] cgit and gitolite configurations in repo -- [ ] auto deploy website repo -- [ ] cgit dark mode, better tab layout +- [x] cgit don't show .git +- [ ] cgit and gitoliterc config in repo +- [ ] get rid of gitolite admin repo +- [ ] cgit dark mode, better tab layout, about page + https://mitjafelicijan.com/making-cgit-look-nicer.html + https://www.hackitu.de/cgithub/ - [ ] backup Revamp diff --git a/configuration/homepage.conf b/configuration/homepage.conf new file mode 100644 index 0000000..1095107 --- /dev/null +++ b/configuration/homepage.conf @@ -0,0 +1,69 @@ +# https server +server { + server_name jackjamison.net www.jackjamison.net; + + error_page 404 = /404.html; + location = /404.html { + internal; + root /var/www/homepage/404.html; + } + + location /interactive { + alias /var/www/interactive/; + } + + location / { + root /var/www/homepage; + index index.html; + } + + listen [::]:443 ssl; + listen 443 ssl; + ssl_certificate /etc/letsencrypt/live/jackjamison.net/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/jackjamison.net/privkey.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; +} + +# git server +server { + server_name git.jackjamison.net; + root /usr/share/cgit; + try_files $uri @cgit; + + # http cloning + location ~ /.+/(info/refs|git-upload-pack) { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; + fastcgi_param PATH_INFO $uri; + fastcgi_param GIT_PROJECT_ROOT /var/git/repositories; + fastcgi_param HOME /var/git/repositories; + fastcgi_pass unix:/run/fcgiwrap.socket; + } + + # else + location @cgit { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi; + fastcgi_param PATH_INFO $uri; + fastcgi_param QUERY_STRING $args; + fastcgi_param HTTP_HOST $server_name; + fastcgi_pass unix:/run/fcgiwrap.socket; + } + + listen [::]:443 ssl; + listen 443 ssl; + ssl_certificate /etc/letsencrypt/live/git.jackjamison.net/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/git.jackjamison.net/privkey.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; +} + +# http redirect +server { + listen [::]:80 default_server; + listen 80 default_server; + server_name _; + + return 301 https://$host$request_uri; +} \ No newline at end of file diff --git a/nginx/homepage.conf b/nginx/homepage.conf deleted file mode 100644 index 1095107..0000000 --- a/nginx/homepage.conf +++ /dev/null @@ -1,69 +0,0 @@ -# https server -server { - server_name jackjamison.net www.jackjamison.net; - - error_page 404 = /404.html; - location = /404.html { - internal; - root /var/www/homepage/404.html; - } - - location /interactive { - alias /var/www/interactive/; - } - - location / { - root /var/www/homepage; - index index.html; - } - - listen [::]:443 ssl; - listen 443 ssl; - ssl_certificate /etc/letsencrypt/live/jackjamison.net/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/jackjamison.net/privkey.pem; - include /etc/letsencrypt/options-ssl-nginx.conf; - ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; -} - -# git server -server { - server_name git.jackjamison.net; - root /usr/share/cgit; - try_files $uri @cgit; - - # http cloning - location ~ /.+/(info/refs|git-upload-pack) { - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; - fastcgi_param PATH_INFO $uri; - fastcgi_param GIT_PROJECT_ROOT /var/git/repositories; - fastcgi_param HOME /var/git/repositories; - fastcgi_pass unix:/run/fcgiwrap.socket; - } - - # else - location @cgit { - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi; - fastcgi_param PATH_INFO $uri; - fastcgi_param QUERY_STRING $args; - fastcgi_param HTTP_HOST $server_name; - fastcgi_pass unix:/run/fcgiwrap.socket; - } - - listen [::]:443 ssl; - listen 443 ssl; - ssl_certificate /etc/letsencrypt/live/git.jackjamison.net/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/git.jackjamison.net/privkey.pem; - include /etc/letsencrypt/options-ssl-nginx.conf; - ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; -} - -# http redirect -server { - listen [::]:80 default_server; - listen 80 default_server; - server_name _; - - return 301 https://$host$request_uri; -} \ No newline at end of file diff --git a/scripts/deploy.sh b/scripts/deploy.sh index d846429..210984d 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,12 +1,13 @@ #!/bin/bash +set -e -# setup nginx -cp ./nginx/homepage.conf /etc/nginx/sites-enabled/homepage.conf +# symlink configs +ln -sf $(realpath ./configuration/homepage.conf) /etc/nginx/sites-enabled/homepage.conf -# build and sync zola +# build and sync zola static site (cd zola-static && zola build) -mkdir /var/www/homepage/ +mkdir -p /var/www/homepage/ rsync -av --delete ./zola-static/public/ /var/www/homepage/ -# sync interactive +# sync interactive site rsync -av --delete ./interactive/ /var/www/interactive/ -- cgit v1.2.3