You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the first two, could not the android "wrapper" simply pre-generate the config file with the desired GUI port etc and start syncthing with the appropriate -home option? Note that you can start with a config like the following:
(i.e. without mentioning any nodes). Syncthing will create it's keys when starting up, and will do the right thing with the config when you add nodes etc in the GUI.
For the last three,
Pass host/port - yep, this will need something dynamic (don't want to change the config and restart for every change). Easy to add.
Can already be done Could actually be done in a previous version. I'll add it back in, as a HTTP POST to /rest/shutdown (similar to /rest/restart that already exists).
Can already be done - you can GET, edit then POST /rest/config.
Does it matter that globalAnnounceServer is announce.syncthing.net:22025 in your config, but syncthing.nym.se:22025 in my autogenerated one?
Also, how should I check that the shutdown is completed? Just poll until the webserver is unavailable?
Edit: passing -home doesn't work, as I use System.loadLibrary() which doesn't pass command line parameters. This guy got it running from the command line, but I didn't manage that right now. Anyway this isn't really important, as the data folder should really be the same across all Android versions (I just don't like hardcoding it).
How exactly do I call shutdown? When I request http://127.0.0.1:8080/rest/shutdown, that just gives me a page with "404 page not found".
I did check out HEAD (abbb40) and run ./build.sh assets.
You need to make a POST, not a GET. I.e. curl -X POST http://.../rest/shutdown.
Ok it took me a while to figure it out (I tried to pass rest/shutdown as parameter, stupid me).
The thing is now, rest/shutdown does nothing, while rest/restart works. I did go clean, deleted golang/bin and golang/pkg, but that didn't help. The call returns 200, but the web ui keeps running.
^ that adds the ability to give hints to the discovery mechanism. Use like this:
curl -X POST 'http://localhost:8080/rest/discovery/hint?node=ABCDEFGHIJKLMNOPQRSTUVXYZ&addr=10.2.3.4:22000'
It would also be nice if there was a "pause" and "unpause" API call, so we don't have any traffic on mobile data (I can make that a seperate issue if you wish).
Activity
calmh commentedon May 11, 2014
For the first two, could not the android "wrapper" simply pre-generate the config file with the desired GUI port etc and start syncthing with the appropriate
-homeoption? Note that you can start with a config like the following:(i.e. without mentioning any nodes). Syncthing will create it's keys when starting up, and will do the right thing with the config when you add nodes etc in the GUI.
For the last three,
Can already be doneCould actually be done in a previous version. I'll add it back in, as a HTTP POST to /rest/shutdown (similar to /rest/restart that already exists).Shutdown from GUI (ref #192)
Nutomic commentedon May 11, 2014
That looks pretty simple actually, awesome!
Nutomic commentedon May 12, 2014
Does it matter that globalAnnounceServer is
announce.syncthing.net:22025in your config, butsyncthing.nym.se:22025in my autogenerated one?Also, how should I check that the shutdown is completed? Just poll until the webserver is unavailable?
Edit: passing
-homedoesn't work, as I useSystem.loadLibrary()which doesn't pass command line parameters. This guy got it running from the command line, but I didn't manage that right now. Anyway this isn't really important, as the data folder should really be the same across all Android versions (I just don't like hardcoding it).Nutomic commentedon May 12, 2014
How exactly do I call shutdown? When I request
http://127.0.0.1:8080/rest/shutdown, that just gives me a page with "404 page not found".I did check out HEAD (abbb40) and run
./build.sh assets.calmh commentedon May 12, 2014
You need to make a POST, not a GET. I.e.
curl -X POST http://.../rest/shutdown.Nutomic commentedon May 12, 2014
Ok it took me a while to figure it out (I tried to pass
rest/shutdownas parameter, stupid me).The thing is now,
rest/shutdowndoes nothing, whilerest/restartworks. I didgo clean, deletedgolang/binandgolang/pkg, but that didn't help. The call returns 200, but the web ui keeps running.calmh commentedon May 12, 2014
Certainly shuts down for me, when running the integration test on darwin-amd64 and linux-amd64...
Nutomic commentedon May 13, 2014
Ok it isn't actually a restart, it just crashes when accessing
os.Args[0].How does
stop(set inshutdown()) work, so I can see where it's going wrong?calmh commentedon May 13, 2014
It simply lets syncthing return from main(); the last line in main() is a read from the stop channel.
Provide discovery hint from the outside (ref #192)
calmh commentedon May 13, 2014
^ that adds the ability to give hints to the discovery mechanism. Use like this:
curl -X POST 'http://localhost:8080/rest/discovery/hint?node=ABCDEFGHIJKLMNOPQRSTUVXYZ&addr=10.2.3.4:22000'calmh commentedon May 13, 2014
Added some docs on this: http://discourse.syncthing.net/t/the-rest-interface/85
Nutomic commentedon May 13, 2014
So it does return from main, but the web interface is still accessible.
Edit: maybe this happens because memory isn't released, I'll look into that.
Edit 2: I solved this by explicitly stopping the Java VM. Not a beautiful solution, but the only one I could find.
Nutomic commentedon May 14, 2014
It would also be nice if there was a "pause" and "unpause" API call, so we don't have any traffic on mobile data (I can make that a seperate issue if you wish).
calmh commentedon May 14, 2014
Please do; it makes sense to add.
calmh commentedon May 14, 2014
I'm closing this "mixed bag" issue, please reopen issues on stuff that remain and/or is problematic. :)