You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make persistent storage default to fix most struggles with Zerotier
Setting up ZeroTier on TrueNAS Scale is uniquely odd and difficult. Unlike other platforms where you just:
install the app
add your network id
and that client's setup is done,
With the Scale version, you have to
generate the identity.secret and identity.public strings from another ZeroTier installation
generate an API key from the Zerotier One website
Install the app with these strings and your network id
Still run into the app being stuck on "deploying" and other issues
This is because the SCALE implementation of ZT's Docker container has no persistent storage by default and instead attempts to do it entirely statelessly through the optional environment variables the container exposes.
Doing it this way is non-standard and leads to many more issues and headaches, like discussions here and here trying to figure it out with only partial success, or the fact that if storage is borked ZeroTier used to just generate a random new identity on each container restart, or the fact that on the latest SCALE install I'm still getting a Fatal error: invalid identity loaded from disk. Please remove identity.public and identity.secret from /var/lib/zerotier-one and try againdespite the container not even having that directory. Not to mention that users shouldn't be forced to manually generate client secrets off of another ZT instance, just to install another client.
The simple solution is to make the optional data volume the default selection, as this allows the ZeroTier container to both generate and persist its own identity, and sidestep all of the above issues. In addition to fixing the above issues with having to manually generate client identities, and random regeneration, it also resolves the issue of the ZeroTier container showing "Deploying" while actively running. I also found it fixes the invalid identity loaded from disk issue. It seems the ZeroTier client is still partially built with the expectation of persistent storage, optional flags notwithstanding.
To implement this, we just need to map /var/ on the container by default to a new volume/location, creating a "ZeroTier Data Storage" volume like the other containers that require persistent storage. I’d be happy to take a shot at this, but I noticed a warning on the front page suggesting to hold off for now so I figured I'd wait before writing a possible implementation.
The text was updated successfully, but these errors were encountered:
Looks like the docs for containerized ZT do not mention alternative ways for the identities.
And the only thing it has even now is the env vars.
Poking some issues around, I found that we just have to mount /var/lib/zerotier-one
I'll make the fields optional and mount a storage to that location by default.
If inputs are field, a mount will still happen but ZT will use the envs.
Make persistent storage default to fix most struggles with Zerotier
Setting up ZeroTier on TrueNAS Scale is uniquely odd and difficult. Unlike other platforms where you just:
and that client's setup is done,
With the Scale version, you have to
identity.secret
andidentity.public
strings from another ZeroTier installationThis is because the SCALE implementation of ZT's Docker container has no persistent storage by default and instead attempts to do it entirely statelessly through the optional environment variables the container exposes.
Doing it this way is non-standard and leads to many more issues and headaches, like discussions here and here trying to figure it out with only partial success, or the fact that if storage is borked ZeroTier used to just generate a random new identity on each container restart, or the fact that on the latest SCALE install I'm still getting a
Fatal error: invalid identity loaded from disk. Please remove identity.public and identity.secret from /var/lib/zerotier-one and try again
despite the container not even having that directory. Not to mention that users shouldn't be forced to manually generate client secrets off of another ZT instance, just to install another client.The simple solution is to make the optional data volume the default selection, as this allows the ZeroTier container to both generate and persist its own identity, and sidestep all of the above issues. In addition to fixing the above issues with having to manually generate client identities, and random regeneration, it also resolves the issue of the ZeroTier container showing "Deploying" while actively running. I also found it fixes the
invalid identity loaded from disk
issue. It seems the ZeroTier client is still partially built with the expectation of persistent storage, optional flags notwithstanding.To implement this, we just need to map
/var/
on the container by default to a new volume/location, creating a "ZeroTier Data Storage" volume like the other containers that require persistent storage. I’d be happy to take a shot at this, but I noticed a warning on the front page suggesting to hold off for now so I figured I'd wait before writing a possible implementation.The text was updated successfully, but these errors were encountered: