summaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rw-r--r--install.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/install.sh b/install.sh
index 60ff4fe..96f1b4e 100644
--- a/install.sh
+++ b/install.sh
@@ -1,11 +1,11 @@
ssh-keygen -f /opt/autopeer/id_autopeer
-echo "You need to add your new SSH key (/opt/autopeer/id_autopeer) to dn42 git to clone the repo:"
+echo "You need to add your new SSH key (/opt/autopeer/id_autopeer) to dn42 gitea to clone the repo:"
cat /opt/autopeer/id_autopeer.pub
echo
read -p "Press enter once you've done that..."
-apt install git
+apt install git wireguard-tools
ln -s /opt/autopeer/sshd_config /etc/ssh/sshd_config.d/autopeer.conf
addgroup autopeer
adduser --disabled-password --comment '' new
@@ -16,6 +16,11 @@ echo '*/5 * * * * root /opt/autopeer/cronjob.py' >>/etc/cron.d/autopeer
mkdir /opt/autopeer/db
echo 'CREATE TABLE peers (name, asn, ipll, endpoint, port, pubkey, creator_ip, creator_name, creator_date, primary key (name, asn));' | python -m sqlite3 /opt/autopeer/db/sqlite3.db
-chgrp -R users /opt/autopeer/db/
+chgrp -R autopeer /opt/autopeer/db/
chmod 770 /opt/autopeer/db/
chmod 660 /opt/autopeer/db/sqlite3.db
+
+umask 0077
+wg genkey >/etc/wireguard/privkey
+umask 0022
+wg pubkey </etc/wireguard/privkey >/etc/wireguard/pubkey