stagit

- static git page generator
git clone git://git.acid.vegas/stagit.git
Log | Files | Refs | Archive | README | LICENSE

deploy-git (1443B)

      1 #!/bin/sh
      2 
      3 apt-get install -y git
      4 
      5 [ ! $(grep -q /usr/bin/git-shell /etc/shells) ] && echo "/usr/bin/git-shell" >> /etc/shells
      6 [ ! $(getent passwd git)                      ] && userdel -f git
      7 
      8 useradd -d /srv/git -k /dev/null -m -s /usr/bin/git-shell -U git
      9 
     10 mkdir -p /srv/git/git-shell-commands && wget -O /srv/git/git-shell-commands https://raw.githubusercontent.com/acidvegas/stagit/master/assets/repo
     11 chmod +x /srv/git/git-shell-commands/* && chown -R git:git /srv/git/git-shell-commands
     12 
     13 usermod -p '*' git
     14 
     15 printf "[Unit]\nDescription=Start Git Daemon\n\n[Service]\nExecStart=/usr/bin/git daemon --reuseaddr --base-path=/srv/git/ /srv/git/\n\nRestart=always\nRestartSec=500ms\nUser=git\nGroup=git\n\n[Install]\nWantedBy=multi-user.target\n" > /etc/systemd/system/git-daemon.service
     16 systemctl start git-daemon && systemctl enable git-daemon
     17 
     18 echo "Be sure to use 'AuthorizedKeysFile /etc/ssh/authorized_keys/%u' in your /etc/ssh/sshd_config"
     19 echo "Add your public key to /etc/ssh/authorized_keys/git prefixed with 'no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty'"
     20 
     21 apt-get install libmd4c-dev libmd4c-html0 libmd4c-html0-dev libmd4c0
     22 apt-get install libgit2-dev
     23 
     24 certbot --nginx -d example.com -d www.example.com
     25 
     26 git config --system init.defaultBranch main # <- THIS MOTHER FUCKER
     27 
     28 # Not finished yet
     29 git clone https://github.com/acidvegas/stagit
     30 #STAGIT_CFLAGS += -DGIT_OPT_SET_OWNER_VALIDATION=-1
     31 Makefile uncomment
     32