Coder Social home page Coder Social logo

yasutakatou / doukie2 Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 506 KB

multi platform, one binary, automated file transfer util by Golang. Version 2!

License: BSD 3-Clause "New" or "Revised" License

Go 100.00%
golang file-sharing multiplatform ecosystem

doukie2's Introduction

doukie2

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.

attention!

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.

this version support additional features following.

  • recursive folder copy.
  • save options to file when exit.
  • sync progress is display.

demo

auto sync.

autosync

sync deleted.

nodelete

sync https

https

solution

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!).

features

  • 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.

what auto sync mode?

  • normal mode call following.
  1. 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.

  2. 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.
  1. you set client and server AES encrypt key when tool running.
    note) -auto and -autoDst option.

  2. server encrypt access details and send to multicast udp(ex: 224.0.0.1).

  3. client get this packet, decrypt data. If client decrypt success, get access url, port, token.

  4. then, normal mode starting.

I mean, You don't need to know the server's IP address!

usecase

case1: PC Client and PC Server (or vice versa)

  • 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.

case2: PC Server and Android Client

  • 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.

case3: Android(server) to PC(client)

This feature is not implemented.

installation

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.

uninstall

delete that binary. del or rm command. (it's simple!)

usecase details

case1: PC(server) to PC(client)

  • 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

You want to use another feature.

  • 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

See here for other options.

case2: PC(server) to Android(client)

  • QR code scan and access to server

(WIP)

Interesting uses.

doukie spray

server can connected many client.

party

If your team access one server, can transfer same file.

doukie relay.

doukie can running more than one on diffrent port number.

relay

Therefore, first process as a server, second process as a client, can file transfer relay.

doukie over ssh.

doukie use http transfer, so can over ssh forwarding.

ssh

your remote server easy sync.

options

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.

save options to file when exit. ".doukie" file.

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.

TIPS

I want to use http(s) proxy to client.

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}

LICENSE

BSD-3-Clause License

doukie2's People

Contributors

yasutakatou avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.