tailscale / tailscale-qpkg

Package Tailscale client in QPKG
MIT License
459 stars 38 forks source link

Taildrop file sharing support? #38

Closed d5aqoep closed 2 years ago

d5aqoep commented 2 years ago

When is Taildrop support expected for Qnap Devices?

ivokub commented 2 years ago

Hi @d5aqoep - in general it should work. You receive the files similarly as with Linux client: ./tailscale -socket var/run/tailscale/tailscaled.sock file get $LOCATION. As far as I have understood, it is still not possible to assign a specific directory for incoming files in Tailscale, so you should run this command manually to receive (move files from Tailscale temporary incoming directory to target directory) files.

I see that this is not convenient option, but I'd prefer not to add additional functionality on top of upstream Tailscale package. I guess what you could do, is to have a scheduled script which runs the command to move the files to target directory.

d5aqoep commented 2 years ago

Thanks it worked. I made a share folder called Taildrop from Qnap Settings

Then ran these 2 commands in ssh

cd /share/CACHEDEV1_DATA/.qpkg/Tailscale ./tailscale -socket var/run/tailscale/tailscaled.sock file get $LOCATION /share/Taildrop

All my transferred files were moved (or copied ?????) to the share Taildrop

Does this command delete those files in temp location or is it just a copy command?

I think Tailscale should make it easy to specify an incoming folder for Qnap. Such functionality is present on Synology.

ivokub commented 2 years ago

I agree, there should be an easy option. Tailscale Linux client does not yet implement it (https://github.com/tailscale/tailscale/issues/2312) and as this QNAP package is light wrapper of upstream Tailscale client, then also we do not support it yet. Hopefully Tailscale implement soon the feature to specify the input directory.

I understand that if you run tailscale file get, then the files are moved from the temporary directory.

tuxpowered commented 1 year ago

Stumbled across this with looking for the same thing (still not supported in 1.48) But this might help users....

./tailscale file get --verbose=true --loop=true /share/Taildrop

verbose so you can obviously see whats going on, and the loop just keeps this running in the background so it just stays working.

To make this start everytime with your Qnap. (https://www.qnap.com/en/how-to/faq/article/running-your-own-application-at-startup)

Essentially you mount the built in flashrom and will create the autorun.sh file and set it to execute. In that file you would put up your standard bash scripting

create a new file vi taildrop_loop.sh and put the following in to it.

#!/bin/sh

TS_HOME=/share/CACHEDEV1_DATA/.qpkg/Tailscale/
TS_DROP=/share/Taildrop

cd ${TS_HOME}

echo "Starting Taildrop listening"
./tailscale file get --verbose=true --loop=true ${TS_DROP} > /share/Taildrop/.taildrop.log
echo "Terminating Taildrop"

Make it executable chmod +x taildrop_loop.sh

Then set autorun.sh to call this on start up.

echo "./taildrop_loop.sh &" >> autorun.sh

Test your taildrop_loop.sh script ./taildrop_loop.sh

Unfortunately the qnap does not link the nohup command from busy shell by default.

If you want to go thru that adventure you could. nohup would be appended to the line in your autorun.sh If you do not want the log file, or wish to store it someplace else change the redirect or remove it. (Note this will not be auto rotated, so you should clear it out if it gets to big. A simple echo > .taildrop.log will do the dead w/o having to restart anything.