da232c6b03
TODOs: - figure out how to keep the mail password in app.ini during install - mount volumes to persist data between droplet redeploys - set up HTTPS
29 lines
608 B
Bash
29 lines
608 B
Bash
#!/usr/bin/env bash
|
|
|
|
set -ex
|
|
|
|
adduser \
|
|
--system \
|
|
--shell /bin/bash \
|
|
--gecos 'Git Version Control' \
|
|
--group \
|
|
--disabled-password \
|
|
--home /home/git \
|
|
git
|
|
|
|
mkdir -p /var/lib/gitea/{custom,data,log}
|
|
chown -R git:git /var/lib/gitea/
|
|
chmod -R 750 /var/lib/gitea/
|
|
mkdir /etc/gitea
|
|
mv /tmp/app.ini /etc/gitea/app.ini
|
|
chown -R root:git /etc/gitea
|
|
chmod 770 /etc/gitea
|
|
chmod 660 /etc/gitea/app.ini
|
|
|
|
wget -O gitea https://dl.gitea.io/gitea/1.13.1/gitea-1.13.1-linux-amd64
|
|
chmod +x gitea
|
|
mv gitea /usr/local/bin/
|
|
|
|
mv /tmp/gitea.service /etc/systemd/system/gitea.service
|
|
systemctl enable gitea
|