Future work on this repository has moved to the monorepo valera-rozuvan/bash-scripts. This repo is archived for historic purposes (to preserve commit history). Navigate over to bash-scripts/cgit-server-setup to see updates (if any).
A bunch of shell scripts and config files to make life easier when setting up a cgit server.
A public git repo is available at git.rozuvan.net/cgit-server-setup. Several mirrors exist: mirror 1, mirror 2.
You can get a local copy by running the command:
git clone https://git.rozuvan.net/cgit-server-setup
This section is a work in progress.
To setup a cgit server:
./setup-00.sh > ./setup-00.log 2>&1
You can watch the logs during the setup:
tail -f ./setup-00.log
To setup server:
sudo aptitude install --without-recommends \
ufw \
fail2ban \
cgit \
git \
nginx \
fcgiwrap \
certbot \
python3 \
python3-pygments \
python3-markdown \
python3-certbot-nginx \
lighttpd \
lighttpd-doc \
pv \
rsync
To make backup of LE certs:
sudo tar zpcvf /home/valera/le-bckp-20210613.tar.gz /etc/letsencrypt/
To get LE certs from backup:
sudo tar zxvf le-bckp-20210613.tar.gz -C /
To fetch new certs for new domains:
sudo certbot --nginx -d git.rozuvan.net --post-hook "/usr/sbin/service nginx restart"
sudo certbot --nginx -d test.rozuvan.net --post-hook "/usr/sbin/service nginx restart"
...
To renew certs:
sudo certbot renew
That's it!
This project is licensed under the MIT License. See LICENSE for more details.