Giter VIP home page Giter VIP logo

Comments (4)

adyanth avatar adyanth commented on June 14, 2024

Hey @dieterplex Currently the state file is explicitly being set to /etc/config so that the state can be backed up with OpenWRT. Can you confirm if --statedir works with --state as well?

https://github.com/adyanth/openwrt-tailscale-enabler/blob/98e126ecb731737a2cc072f74c1be71981683188/etc/init.d/tailscale#LL21

from openwrt-tailscale-enabler.

adyanth avatar adyanth commented on June 14, 2024

Also, using /tmp as your stateDir does not persist on reboots. What gets generated there (like certs) and would you need them to persist?

from openwrt-tailscale-enabler.

dieterplex avatar dieterplex commented on June 14, 2024

--statedir is passed into as VarRoot, from the comment of VarRoot:

VarRoot is the Tailscale daemon's private writable
directory (usually "/var/lib/tailscale" on Linux) that
contains the "tailscaled.state" file, the "certs" directory
for TLS certs, and the "files" directory for incoming
Taildrop files before they're moved to a user directory.
If empty, Taildrop and TLS certs don't function.

And according to this behavior

If an absolute --state is provided but not --statedir, try to derive a state directory.

Maybe just change the state file to /etc/tailscale/tailscaled.state in /etc/init.d/tailscale if we want to keep Taildrop files and cert files?
Or append statedir param for a separate /var/lib/tailscale dir? Since another copy of crt & key files are save to current working directory when exec tailscale cert <my-tsnet-domain>.

When using /etc/tailscale/tailscaled.state, listing files would like this:

root@OpenWrt:/etc/tailscale# ls -1 *
derpmap.cached.json
tailscaled.log.conf
tailscaled.log1.txt
tailscaled.log2.txt
tailscaled.state

certs:
acme-account.key.pem
openwrt.mydomain.ts.net.crt
openwrt.mydomain.ts.net.key

files:
dieterplex-gmail.com-uid-00000000000000000/

Appending both params also works. But to persist on reboots, using /etc/tailscale do the trick I think. wdyt?

from openwrt-tailscale-enabler.

adyanth avatar adyanth commented on June 14, 2024

Ah makes sense. I think we can keep the state file as it is (in /etc/config so that it is backed up by openwrt) and set the stateDir to /etc/tailscale so that it persists.

Would you like to send a quick PR?

from openwrt-tailscale-enabler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.