multi platform, one binary, automated file transfer util by Golang. Version 2!
doukie is meaned japanese word is "sync", and green day's album "dookie" anagramed.
this repository is not compatible previous version.
If you use to this repository, you can't use previous version.
Android client can't use previous, too.
- recursive folder copy.
- save options to file when exit.
- sync progress is display.
AirDrop is very useful file transfer method.
But, It's not what I'd expect opened economy method.
on not supported computers, is require support by official or OSS comunity effort.
We know universal protocol, is HTTP.
I think to want implement easy file transfer method by HTTP.
and, I realize file transfer on multi platform (include Smart phone!).
- multi platform suppoted
- run by one binary file
- Android supported (it's not perfect)
- automated file transfer.
- file exists check (use md5 hash)
- recursive folder copy.
- save options to file when exit.
- sync progress is display.
- normal mode call following.
-
client call server's api on static ip. call "http(s)://{server ip address}:{port}/{token}/list/{integer}"
note) static ip can be defined -dst option.
note) {integer} is number of in syncing files. this value used to syncing status at server. -
If client can get lists, downloading files on static ip.
call "http(s)://{server ip address}:{port}/{token}/download/{filename}"
- but, auto sync mode is.
-
you set client and server AES encrypt key when tool running.
note) -auto and -autoDst option. -
server encrypt access details and send to multicast udp(ex: 224.0.0.1).
-
client get this packet, decrypt data. If client decrypt success, get access url, port, token.
-
then, normal mode starting.
I mean, You don't need to know the server's IP address!
-
use static token authentication
this mode, you set static token when tool running, and client side same token.
client access to server by static token.
in case of authentication success, client copy files from server. -
auto sync mode
server send multicast udp packet periodically include authentication detail.
when client receive this packet, decrypt packet, client start to access to server.
I mean, You don't need to know the server's IP address!
in case of authentication success, client copy files from server.
- QR code scan and access to server
When start application, QR code scan displayed.
server console display QR code and scan by Android.
in case of authentication success, Android copy files from server.
This feature is not implemented.
If you want to put it under the path, you can use the following.
go get github.com/yasutakatou/doukie2
If you want to create a binary and copy it yourself, use the following.
git clone https://github.com/yasutakatou/doukie2
cd doukie2
go build doukie.go
or download binary from release page.
save binary file, copy to entryed execute path directory.
delete that binary. del or rm command. (it's simple!)
- use static token authentication
when static token mode, you set static token when running.
this following token is "test".
doukie -token=test
note) If not set static token, tool create and use random 8 character.
next, client side, set server ip address and token.
doukie -token=test -dst=192.168.0.1
note) server's ip is must examine before running.
- auto sync mode
this mode only set token used encrypt and decrypt.
note ) If can decrypt udp packet from server, access server data.
this mode danger and recommend in home and trust network use only.
doukie -auto=test
next, set same token to client, too.
doukie -autoDst=test
- transfer by HTTPS.
doukie -https=yes -cert=localhost.pem -key=localhost-key.pem -token=test
note) you have to prepare certs.
- change target directory.
doukie -dir=myDir -token=test -dst=192.168.0.1
- by default if some file exists client, but not exists server, that file delete on client.
when enable -notDelete option, not delete.
doukie -notDelete=yes-token=test -dst=192.168.0.1
- QR code scan and access to server
(WIP)
server can connected many client.
If your team access one server, can transfer same file.
doukie can running more than one on diffrent port number.
Therefore, first process as a server, second process as a client, can file transfer relay.
doukie use http transfer, so can over ssh forwarding.
your remote server easy sync.
this options enable on only PC. Android not useful.
option name | default value | detail |
---|---|---|
-auto | auto sync server mode enable and set encrypt token. | |
-autoPort | 9999 | port number for ato sync mode. |
-autoCast | 224.0.0.1 | multicast address define. If you want to use global scope, change this. |
-autoDst | auto sync client mode enable and set decrypt token. | |
-dst | client mode enable and set access url. | |
-wait | 10 | sync duration. (Second) |
-dir | data | sync target directory |
-debug | false | debug mode (true is enable) |
-https | no | https mode (yes is enable) ※1 |
-token | authentication token (if this value is null, is set random) | |
-port | 8080 | port number |
-cert | localhost.pem | ssl_certificate file path (if you don't use https, haven't to use this option) |
-key | localhost-key.pem | ssl_certificate_key file path (if you don't use https, haven't to use this option) |
-notDelete | no | not delete mode (yes is enable) ※1 |
※1 If you set invalid value to this option, value set "no" force.
this tool can exit to Escape key and save options to file.
note) file is save named ".doukie" at current folder.
If you run again this tool at no options, tool read that file, set options.
If exists ".doukie" file and you set option, override you seted options.
If you want to reset all options, delete ".doukie" file.
Here's some information.
FYI: Setting up proxy for HTTP client
windows's exsample)
set HTTP_PROXY=http://{Proxy address:{Proxy port}
If you use to require basic authenticate.
set HTTP_PROXY=http://{Auth User name}:{Auth User Password}@{Proxy address:{Proxy port}
BSD-3-Clause License