Skip to content

cmd/tailscale/cli: Add CLI command to update certs on Synology devices. - #10994

Merged
bradfitz merged 1 commit into
tailscale:mainfrom
WillMorrison:WillMorrison/issue4674
Apr 5, 2024
Merged

bradfitz merged 1 commit into
tailscale:mainfrom
WillMorrison:WillMorrison/issue4674

Conversation

@WillMorrison

Copy link
Copy Markdown

Fixes #4674

@WillMorrison

Copy link
Copy Markdown
Author

A note about testing: I do not have a Synology device that I can install a new version of tailscale on to test this. I have tested that the commands used by this code work on my Synology device, but since the only access I have to it is via tailscale, I don't want to risk losing that access by reinstalling the tailscale package. If there are Synology devices that could be used to test this new command on (with different DSM versions perhaps), please let me know how to go about doing that testing.

@WillMorrison

Copy link
Copy Markdown
Author

@DentonGentry I don't have permissions to assign a reviewer in this repository, and nobody has picked up this PR in the last week. Could you tell me what I need to do to get this PR progressing?

@WillMorrison

Copy link
Copy Markdown
Author

@sailorfrag Could you please let me know what is needed to get this PR reviewed and merged?

@sailorfrag

Copy link
Copy Markdown
Member

I'm not able to test out Synology changes because I don't have any devices but I've asked internally for someone to take a look

@WillMorrison

Copy link
Copy Markdown
Author

@sailorfrag This PR seems to have fallen through the cracks again. @sailorfrag can you let me know who was doing the testing so I can follow up with them directly?

@WillMorrison

Copy link
Copy Markdown
Author

@bradfitz @danderson This PR has gotten no review for over 2 months now. Please let me know who is responsible for reviewing open source contributions to tailscale, (or better yet update the contributions section of the README), so that I don't have to ping the fine members of the Tailscale GitHub org at random hoping for a response. :)

@bradfitz bradfitz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@bradfitz
bradfitz merged commit 306bacc into tailscale:main Apr 5, 2024
@jovobe

jovobe commented Apr 14, 2024

Copy link
Copy Markdown

Thanks so much for merging this! I've waited a long time for this 🙏🏻 But just to things right: This is not included in 1.64.0, right? When will this be released?

@bradfitz

Copy link
Copy Markdown
Member

It's in 1.64.0.

@jovobe

jovobe commented Apr 14, 2024 •

Copy link
Copy Markdown

I'm on 1.64.0 (Synology DSM 7.2.1-69057 Update 4) and the subcommand does not exist. What am I doing wrong?

ash-4.4# tailscale synology-cert
The easiest, most secure way to use WireGuard.

USAGE
  tailscale [flags] <subcommand> [command flags]

For help on subcommands, add --help after: "tailscale status --help".

This CLI is still under active development. Commands and flags will
change in the future.

SUBCOMMANDS
  up              Connect to Tailscale, logging in if needed
  down            Disconnect from Tailscale
  set             Change specified preferences
  login           Log in to a Tailscale account
  logout          Disconnect from Tailscale and expire current node key
  switch          Switches to a different Tailscale account
  configure       [ALPHA] Configure the host to enable more Tailscale features
  netcheck        Print an analysis of local network conditions
  ip              Show Tailscale IP addresses
  status          Show state of tailscaled and its connections
  ping            Ping a host at the Tailscale layer, see how it routed
  nc              Connect to a port on a host, connected to stdin/stdout
  ssh             SSH to a Tailscale machine
  funnel          Serve content and local servers on the internet
  serve           Serve content and local servers on your tailnet
  version         Print Tailscale version
  web             Run a web server for controlling Tailscale
  file            Send or receive files
  bugreport       Print a shareable identifier to help diagnose issues
  cert            Get TLS certs
  lock            Manage tailnet lock
  licenses        Get open source license information
  exit-node       Show machines on your tailnet configured as exit nodes
  update          Update Tailscale to the latest/different version
  whois           Show the machine and user associated with a Tailscale IP (v4 or v6)
  drive           Share a directory with your tailnet
  configure-host  Configure Synology to enable outbound connections

FLAGS
  --socket string
    	path to tailscaled socket (default /var/packages/Tailscale/var/tailscaled.sock)
ash-4.4# tailscale --version
1.64.0
  tailscale commit: 7e9bebdb2470dfbb6e08a3f12a289a7d88128dfb
  other commit: f314c5be5350431460b89f703275de6b89a30460
  go version: go1.22.2

@bradfitz

Copy link
Copy Markdown
Member

It's a configure subcommand: tailscale configure synology-cert

@cheesegrits

cheesegrits commented May 15, 2024 •

Copy link
Copy Markdown

@WillMorrison thank you for your persistence in getting this merged. :)

Couple of quick questions.

Is this analogous to a certbot renew, in that I should run it twice a day and it will only renew a cert when needed, or should I only run it every 90 days?

Does the API call that uploads the cert trigger a restart / reload of services configured in DSM to use it?

@WillMorrison

Copy link
Copy Markdown
Author

Is this analogous to a certbot renew, in that I should run it twice a day and it will only renew a cert when needed, or should I only run it every 90 days?

I believe that tailscale caches certificates and won't request a new one if the old one is still valid.

Does the API call that uploads the cert trigger a restart / reload of services configured in DSM to use it?

I know the DSM will restart the web server, but I have no idea if anything else will happen for services that are configured to use the cert.

@galettof

galettof commented Aug 6, 2024

Copy link
Copy Markdown

I came across this discussion while looking for ways to renew certificates that are used with Tailscale on synology NAS. I report on my experience hoping it might help others.

I set up a task to run tailscale configure synology-cert. Maybe it is because I set it to run as root, but it didn't do anything until I added sudo in front; after that it renewed the certificate as expected.

After renewal, the login page for the NAS immediately worked. Synology Drive (for syncing files between computer and NAS) also worked right away. However, Hyperbackup (that I use to back up one NAS to another) did not work until I restarted both units; before restarting I was getting an error that the target for the backup was offline and when trying to reconnect it said failed to reach destination.

@sim642

sim642 commented Aug 11, 2024

Copy link
Copy Markdown

I set up a task to run tailscale configure synology-cert. Maybe it is because I set it to run as root, but it didn't do anything until I added sudo in front; after that it renewed the certificate as expected.

It worked for me for the root user without sudo in the scheduled task user-defined script.

For some reason the new command is nowhere documented (except for this PR), so I wrote my own guide here: https://sim642.eu/blog/2024/08/11/tailscale-https-certificate-on-synology-nas/. Hopefully, it also gets mentioned in the official Tailscale documentation at some point.

@rory-brenan

Copy link
Copy Markdown

I set up a task to run tailscale configure synology-cert. Maybe it is because I set it to run as root, but it didn't do anything until I added sudo in front; after that it renewed the certificate as expected.

It worked for me for the root user without sudo in the scheduled task user-defined script.

For some reason the new command is nowhere documented (except for this PR), so I wrote my own guide here: https://sim642.eu/blog/2024/08/11/tailscale-https-certificate-on-synology-nas/. Hopefully, it also gets mentioned in the official Tailscale documentation at some point.

Hi Simmo, unfortunately your guide didn't work for me... any further pointers? I have detailed my steps so far on reddit.

@sim642

sim642 commented Aug 14, 2024

Copy link
Copy Markdown

The output sounds like you might need to update Tailscale on your Synology because it doesn't seem to have the synology-cert configuration command.

@mback2k

mback2k commented Aug 28, 2024

Copy link
Copy Markdown

There is currently also an issue with the certificate generated, please see: #12762

@ukanuk ukanuk mentioned this pull request Dec 29, 2024
5 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: Automatically configure Synology with tailscale cert in Settings : Security/Certificate

9 participants