Git Product home page Git Product logo

Comments (9)

jpjp avatar jpjp commented on May 19, 2024

How about monitoring .config/syncthing/ for changes to .idx.gz files? (or monitoring that directory for any changes at all)

from syncthing-android.

Nutomic avatar Nutomic commented on May 19, 2024

I was just about to edit something like that in :P

I'm not sure what those files do, but I assume they are not directly tied to the web interface (rather to syncing, so when pause is added, this might break).

from syncthing-android.

calmh avatar calmh commented on May 19, 2024

So, the index files are a cache of the state of the local repository: file metadata and hashes. When syncthing starts up it reads the indexes and compares the local repository to them. Files that have changed are rehashed, files that are no longer there are marked as deleted, etc.

When syncthing is up and running it will periodically save a new index, if there have been any changes (i.e. changes detected locally, or we synced something).

I actually think polling the GUI port until it responds is the cleanest way, or just reading stdout from syncthing and looking for the pattern "Starting web GUI on "...

Or a new log line could be added before https://github.com/calmh/syncthing/blob/master/cmd/syncthing/main.go#L274 if you want to be really sure that the webserver is listening, not just that it will be in a few clock cycles. Practically, I think you will need to be very fast indeed to notice the difference.

from syncthing-android.

Nutomic avatar Nutomic commented on May 19, 2024

Okay so index files aren't the way to go for this.

I only read the syncthing output on shutdown right now, so I can't do that (and it doesn't feel good).

So I'll just poll the port (but without a full-blown browser running).

from syncthing-android.

calmh avatar calmh commented on May 19, 2024

(/rest/version should be the most lightweight URL to poll repeatedly and the response is something you can know if it's correct, but really anything should work)

from syncthing-android.

Nutomic avatar Nutomic commented on May 19, 2024

I just do a Head request and check for http status 200. I also stop polling after the first successful try.

from syncthing-android.

bsidhom avatar bsidhom commented on May 19, 2024

I don't know if this should be considered related or a distinct issue, but when the web UI port is manually changed and the server is reset (all through the integrated web UI), the UI is not found in the web view. Exiting the application at this point does not appear to close down the server either. I was able to view the UI using an external browser, but this may have been due to the browser cache storing old information.

from syncthing-android.

Nutomic avatar Nutomic commented on May 19, 2024

The address is read from the config.xml on start. It should work if you restart the app (menu->exit and then open it again). I just noticed that you'll get the same problem if you change the API key and do a restart through the web GUI.

Feel free to make that a new issue, I'll have to think about how to avoid those problems properly.

from syncthing-android.

Nutomic avatar Nutomic commented on May 19, 2024

I just noticed this is a problem that I will have to fix with #5. (Config changes show a notification starting from 0.4.0, and we use that to update the repos, nodes, gui address, and api key).

from syncthing-android.

Related Issues (20)

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.