From a908281602deed8014b205e2993e4d98e9b8ee66 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Fri, 20 Dec 2024 10:28:20 -0800 Subject: [PATCH] moving my init script to a public repo because lazy --- lxc-init.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 lxc-init.sh diff --git a/lxc-init.sh b/lxc-init.sh new file mode 100644 index 0000000..8fdc9e0 --- /dev/null +++ b/lxc-init.sh @@ -0,0 +1,39 @@ +apt update +apt install curl -y + +echo "> Installing Docker" +curl -fsSL https://get.docker.com -o get-docker.sh +sh get-docker.sh +docker run hello-world + +echo "> Installing tailscale" +curl -fsSL https://tailscale.com/install.sh | sh + +echo Installing Syncthing +apt update +apt install syncthing -y + +# Update the systemd service to use root +# I think a better way exists but idk +echo Updating systemd service to run as root +cp /usr/lib/systemd/system/syncthing@.service ~/syncthing.service +sed -i 's/%i/root/' ~/syncthing.service +cp ~/syncthing.service /usr/lib/systemd/system/syncthing.service +rm ~/syncthing.service + +echo "Generating Syncthing config" +syncthing generate + +# Allow access to the portal and api +echo Allowing access to the portal and api +cp ~/.config/syncthing/config.xml ~/.config/syncthing/config.backup.xml +sed -i 's/127.0.0.1:8384/0.0.0.0:8384/' ~/.config/syncthing/config.xml + +echo enabling systemd service +systemctl daemon-reload +systemctl enable syncthing +systemctl start syncthing + +echo service should now be running! +echo Syncthing web should now be available from ::8384 +echo You can always run 'systemcld status syncthing' to see how its going \ No newline at end of file