Giter VIP home page Giter VIP logo

syncthing-java's Introduction

This project was merged into syncthing-lite. The repository only exists for historic reasons.

MPLv2 License

This project is an java client implementation of Syncthing protocols. It is made of several modules, providing:

  1. a command line utility for accessing a Syncthing network (ie a network of devices that speak Syncthing protocols)'

  2. a service implementation for the 'http-relay' protocol (that proxies 'relay' protocol over an http connection);

  3. a client library for Syncthing protocol, that can be used by third-party applications (such as mobile apps) to integrate with Syncthing.

Care is taken to make sure the client library is compatible with android (min sdk 19), so it can be used for the syncthing-lite project.

This is a client-oriented implementation, designed to work online by downloading and uploading files from an active device on the network (instead of synchronizing a local copy of the entire repository). This is quite different from the way the syncthing-android app works, and its useful from those implementations that cannot or wish not to download the entire repository (for example, mobile devices with limited storage available, wishing to access a syncthing share).

Building

The project uses a standard gradle build. After installing gradle, simply run gradle assemble to compile, or gradle install to add it to your local maven repository.

Running

To use the command line client, run gradle run -Pargs="-h".

License

All code is licensed under the MPLv2 License.

syncthing-java's People

Contributors

audriusbutkevicius avatar davide-imbriaco avatar imsodin avatar l-jonas avatar nutomic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

syncthing-java's Issues

Hide internal classes

Only very few classes need to be visible to clients, eg SyncthingClient and IndexHandler. Other classes should be hidden.

Implement ALPN

Unfortunately, there seems to be no simple, cross-platform way to implement this. Anyway this is not required, and will only print a warning on Syncthing devices.

Reduce binary size

The apk currently has 7 MB, and requires multidex (which slows down the build). We should reduce the number of dependencies.

Largest packages according to du -sch on extracted a-sync-client-1.3-executable.jar:

Bouncycastle: 17MB
Google Common: 8.7 MB
Apache Commons: 6.3MB
H2 Database: 5.1MB

Improve Index handling

The index should be handled entirely by the library. There is no reason that the app should have to trigger index updates. Eg whenever we connect to a device.

Client discovery: Error receiving datagram

I run ./gradlew run -Pargs="-d BPDFDTU-..." on 1f1bb33, which results in the following error:

15:09:40.955 [pool-7-thread-1] WARN net.syncthing.java.discovery.protocol.LocalDiscoveryHandler - Error receiving datagram
java.net.SocketException: Socket closed
	at java.net.PlainDatagramSocketImpl.receive0(Native Method)
	at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:143)
	at java.net.DatagramSocket.receive(DatagramSocket.java:812)
	at net.syncthing.java.discovery.protocol.LocalDiscoveryHandler$2.run(LocalDiscoveryHandler.java:151)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Entire log: https://gist.github.com/imsodin/6b640daf58cc490ce40e185a259a9219

Might be related to #5

I haven't looked into it at all yet, as I tried to find out how debugging in Android Studio or linux command line works for a java gradle project - I got a little annoyed in the process. If you have the inclination to tell me a bit about your workflow and/or answer a few questions, ping me in IRC.

Fix Connection Problems

Sometimes connecting works fine, but other times (under the same circumstances) nothing works.

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.