Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncthing-Fork v2.0 beta #1333

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft

Syncthing-Fork v2.0 beta #1333

wants to merge 23 commits into from

Conversation

Catfriend1
Copy link
Owner

@Catfriend1 Catfriend1 commented Apr 2, 2025

@Catfriend1 Catfriend1 self-assigned this Apr 2, 2025
@Catfriend1
Copy link
Owner Author

So far looks good :-).
image

@Catfriend1
Copy link
Owner Author

getLocalDeviceIDfromPref: Local device ID unavailable, trying to retrieve it from syncthing ...
2025-04-02 23:25:17.452 10142-10142 SyncthingNativeCode     com...riend1.syncthingandroid.debug  I  2025/04/02 21:25:17 WARNING: Error reading device ID: open /storage/emulated/0/.local/state/syncthing/cert.pem: no such file or directory
2025-04-02 23:25:17.454 10142-10142 SyncthingRunnable       com...riend1.syncthingandroid.debug  W  exit reason = exitError. Another Syncthing instance may be already running.
2025-04-02 23:25:17.463 10142-10142 ConfigXml               com...riend1.syncthingandroid.debug  W  getLocalDeviceIDandStoreToPref: Syncthing core returned a bad formatted device ID "2025/04/02 21:25:17 WARNING: Error reading device ID: open /storage/emulated/0/.local/state/syncthing/cert.pem: no such file or directory"
2025-04-02 23:25:17.463 10142-10142 ConfigXml               com...riend1.syncthingandroid.debug  E  getLocalDeviceIDfromPref: Local device ID unavailable

@Catfriend1
Copy link
Owner Author

Catfriend1 commented Apr 2, 2025

I've built it for Android and currently looking for changes that need to be done to the wrapper. Meanwhilst, I did upgrade the command line using the non-two-dash commands and set STHOMEDIR=... instead of using the --"--home=" parameter which is no longer supported on the commands the wrapper used before.

Feedback:

  1. Could the "device-id" please respect the STHOMEDIR variable? I see in the log it is accessing the wrong path on android despite STHOMEDIR being set. This can be reproduced from shell.
emu64xa:/tmp $ ./libsyncthingnative.so generate --no-default-folder
2025/04/02 21:28:45 INFO: Generating ECDSA key and certificate for syncthing...
2025/04/02 21:28:45 INFO: Device ID: MMVWVES-PH4ESZL-PERSOMR-G54BYO2-DYMSTFC-XT2LZXQ-O3TU4VR-34MWMAO
2025/04/02 21:28:45 INFO: We will skip creation of a default folder on first start
emu64xa:/tmp $ ./libsyncthingnative.so device-id
2025/04/02 21:28:58 WARNING: Error reading device ID: open /.local/state/syncthing/cert.pem: no such file or directory
  1. What is the equivalent to "reset-database"?
    "serve", "--reset-database", "--logflags=0" does not work.

ref: https://forum.syncthing.net/t/syncthing-2-0-0-beta-3/24095/28

@marbens-arch
Copy link
Contributor

marbens-arch commented Apr 2, 2025

public static final String INDEX_DB_FOLDER = "index-v0.14.0.db";
Does this need to be changed? Also it seems the database is not a seperate directory anymore.

@marbens-arch

This comment was marked as resolved.

@Catfriend1 Catfriend1 added this to the v2.0.0 milestone Apr 2, 2025
@Catfriend1
Copy link
Owner Author

Catfriend1 commented Apr 2, 2025

public static final String INDEX_DB_FOLDER = "index-v0.14.0.db";

Does this need to be changed? Also it seems the database is not a seperate directory anymore.

Thanks, I'll note this for review during my next dev session :-).

Update: used in SyncthingService/importConfig, exportConfig

@Catfriend1 Catfriend1 marked this pull request as draft April 2, 2025 21:48
@marbens-arch
Copy link
Contributor

marbens-arch commented Apr 2, 2025

Not sure what these files are, but they also seem to contain the old database path. They also seem to be related to the backup feature.

https://github.com/Catfriend1/syncthing-android/blob/0f6993ea11f2909d78f26c89aaf1ea6b02d91870/app/src/main/res/xml/backup_rules.xml
https://github.com/Catfriend1/syncthing-android/blob/0f6993ea11f2909d78f26c89aaf1ea6b02d91870/app/src/main/res/xml/backup_rules_legacy.xml

@Catfriend1
Copy link
Owner Author

DONE:
syncthing/syncthing#10030

export STDBDELETERETENTIONINTERVAL=8766h

&

Launch error:

04-02 20:50:09.167  7161  7271 W SyncthingRunnable: Syncthing exited unexpectedly. Exit code = 80

@Catfriend1
Copy link
Owner Author

Catfriend1 commented Apr 3, 2025

image

image

@Catfriend1
Copy link
Owner Author

New folder structure:

emu64x:/data/data/com.github.catfriend1.syncthingandroid.debug/files # find .
.
./profileInstalled
./cert.pem
./key.pem
./index-v2.db
./config.xml
./index-v2.db-wal
./index-v2.db-shm
./https-cert.pem
./https-key.pem

@Catfriend1
Copy link
Owner Author

public static final String INDEX_DB_FOLDER = "index-v0.14.0.db";

Does this need to be changed? Also it seems the database is not a seperate directory anymore.

DONE

@Catfriend1
Copy link
Owner Author

Folder stopped with filesystemType empty error:
I’ve fixed this by ensuring the wrapper always writes “filesystemType” = “basic” into the config.xml for “folder” tags.

@Catfriend1
Copy link
Owner Author

So far looks good:
image

image

image

@Catfriend1
Copy link
Owner Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants