mirror of
https://github.com/tailscale-dev/deck-tailscale.git
synced 2025-10-22 15:38:15 +00:00
use provided files, override
This commit is contained in:
2
override.conf
Normal file
2
override.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[Service]
|
||||||
|
ExtensionDirectories=/var/lib/extensions/tailscale
|
@@ -13,10 +13,9 @@ connect through the standard SSH server instead. Suggestions for how to fix this
|
|||||||
are welcomed.
|
are welcomed.
|
||||||
|
|
||||||
1. Clone this repo to your Deck.
|
1. Clone this repo to your Deck.
|
||||||
2. Copy the `tailscaled.service` file to `/etc/systemd/system/`.
|
2. Run `sudo bash tailscale.sh` to install Tailscale (or update the existing
|
||||||
3. Run `sudo bash tailscale.sh` to install Tailscale (or update the existing
|
|
||||||
installation).
|
installation).
|
||||||
4. Run `sudo tailscale up --qr --operator=deck --ssh` to have Tailscale generate
|
3. Run `sudo tailscale up --qr --operator=deck --ssh` to have Tailscale generate
|
||||||
a login QR code. Scan the code with your phone and authenticate with
|
a login QR code. Scan the code with your phone and authenticate with
|
||||||
Tailscale to bring your Deck onto your network.
|
Tailscale to bring your Deck onto your network.
|
||||||
|
|
||||||
|
19
tailscale.sh
19
tailscale.sh
@@ -53,10 +53,23 @@ mkdir -p /var/lib/extensions
|
|||||||
rm -rf /var/lib/extensions/tailscale
|
rm -rf /var/lib/extensions/tailscale
|
||||||
cp -rf tailscale /var/lib/extensions/
|
cp -rf tailscale /var/lib/extensions/
|
||||||
|
|
||||||
|
# copy the systemd files into place
|
||||||
|
cp -rf $tar_dir/systemd/tailscaled.service /etc/systemd/system
|
||||||
|
|
||||||
|
# copy in the defaults file if it doesn't already exist
|
||||||
|
if ! test -f /etc/default/tailscaled; then
|
||||||
|
cp -rf $tar_dir/systemd/tailscaled.defaults /etc/default/tailscaled
|
||||||
|
fi
|
||||||
|
|
||||||
# return to our original directory (silently) and clean up
|
# return to our original directory (silently) and clean up
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
rm -rf "${dir}"
|
rm -rf "${dir}"
|
||||||
|
|
||||||
|
# copy in our overrides file if it doesn't already exist
|
||||||
|
if ! test -f /etc/systemd/system/tailscaled.service.d/override.conf; then
|
||||||
|
cp -rf override.conf /etc/systemd/system/tailscaled.service.d/override.conf
|
||||||
|
fi
|
||||||
|
|
||||||
echo "done."
|
echo "done."
|
||||||
|
|
||||||
echo -n "Starting services..."
|
echo -n "Starting services..."
|
||||||
@@ -71,12 +84,10 @@ systemd-sysext refresh > /dev/null 2>&1
|
|||||||
systemctl daemon-reload > /dev/null
|
systemctl daemon-reload > /dev/null
|
||||||
|
|
||||||
if systemctl is-enabled --quiet tailscaled && systemctl is-active --quiet tailscaled; then
|
if systemctl is-enabled --quiet tailscaled && systemctl is-active --quiet tailscaled; then
|
||||||
echo "tailscaled is already enabled and active"
|
echo "tailscaled is already enabled and active; restarting it..."
|
||||||
|
systemctl restart tailscaled
|
||||||
else
|
else
|
||||||
systemctl enable tailscaled --now
|
systemctl enable tailscaled --now
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "done."
|
echo "done."
|
||||||
|
|
||||||
|
|
||||||
echo "If updating, reboot or run the following to finish the process: sudo systemctl restart tailscaled"
|
|
||||||
|
@@ -1,25 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Tailscale node agent
|
|
||||||
Documentation=https://tailscale.com/kb/
|
|
||||||
Wants=network-pre.target
|
|
||||||
After=network-pre.target NetworkManager.service systemd-resolved.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExtensionDirectories=/var/lib/extensions/tailscale
|
|
||||||
|
|
||||||
ExecStartPre=/usr/sbin/tailscaled --cleanup
|
|
||||||
ExecStart=/usr/sbin/tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/run/tailscale/tailscaled.sock
|
|
||||||
ExecStopPost=/usr/sbin/tailscaled --cleanup
|
|
||||||
|
|
||||||
Restart=on-failure
|
|
||||||
|
|
||||||
RuntimeDirectory=tailscale
|
|
||||||
RuntimeDirectoryMode=0755
|
|
||||||
StateDirectory=tailscale
|
|
||||||
StateDirectoryMode=0700
|
|
||||||
CacheDirectory=tailscale
|
|
||||||
CacheDirectoryMode=0750
|
|
||||||
Type=notify
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
Reference in New Issue
Block a user