diff --git a/client/tailscale/apitype/apitype.go b/client/tailscale/apitype/apitype.go index 6458f510b..3089486a0 100644 --- a/client/tailscale/apitype/apitype.go +++ b/client/tailscale/apitype/apitype.go @@ -30,9 +30,16 @@ type FileTarget struct { PeerAPIURL string } +// WaitingFiles represent taildrop files sent to the node, ready to be +// copied to their permenant location by the client. The client may +// opt to handle these these using either the /files GET and DELETE +// endpoints or by moving the file if the client has read/write +// access to the AbsolutePath. The client is responsible for removing +// the file when they have finished processing it. type WaitingFile struct { - Name string - Size int64 + Name string + Size int64 + AbsolutePath string } // SetPushDeviceTokenRequest is the body POSTed to the LocalAPI endpoint /set-device-token. diff --git a/taildrop/retrieve.go b/taildrop/retrieve.go index 3e37b492a..96a7d2111 100644 --- a/taildrop/retrieve.go +++ b/taildrop/retrieve.go @@ -80,8 +80,9 @@ func (m *Manager) WaitingFiles() (ret []apitype.WaitingFile, err error) { return true } ret = append(ret, apitype.WaitingFile{ - Name: filepath.Base(name), - Size: fi.Size(), + AbsolutePath: filepath.Join(m.opts.Dir, name), + Name: filepath.Base(name), + Size: fi.Size(), }) } return true