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

Not portable between PCs? #272

Closed
leaumar opened this issue May 27, 2016 · 14 comments
Closed

Not portable between PCs? #272

leaumar opened this issue May 27, 2016 · 14 comments

Comments

@leaumar
Copy link

leaumar commented May 27, 2016

Does synctrayzor by any chance encrypt its data with a unique OS-generated key or something? Like how vivaldi encrypts sensitive browser profile data with such a key to secure it and prevent copying?

Today I clean reinstalled windows, and copied over all my stuff, but synctrayzor (portable version) is now broken: it now loads the default config instead of my old config that I copied over along with it.

Does synctrayzor purposefully prevent itself from just being copied like that, or is the problem likely to be something else, related to my particular setup/data?

@norgeous
Copy link

norgeous commented May 27, 2016

  • When you run SyncTrayzor (non-portable) for the first time a some folders are created in various parts of your system
  • When you run SyncTrayzor Portable for the first time a folder called data is created in the same folder as the SyncTrayzor.exe.

Normally this data folder contains all the config info (device identitiy, folders, remote devices, etc), but looking at #271 you have customised your config.xml while attempting to switch from the installer version to the portable version.

For SyncTrayzor Portable to work with the data folder beside the exe, you must have SyncthingPath and SyncthingCustomHomePath set as follows:

  <SyncthingPath>%EXEPATH%\data\syncthing.exe</SyncthingPath>
  <SyncthingCustomHomePath>%EXEPATH%\data\syncthing</SyncthingCustomHomePath>

I believe in your case you have got SyncTrayzor Portable 'working' by misconfiguring it to take setting from %LOCALAPPDATA% - the installer versions folder.

If you started with the installer version and have formatted recently, you should have retained a copy %APPDATA%. For me this is at C:\Users\norgeous\AppData\. If you have these it may be possible to fix it. If you only have your broken portable version, then you should just start fresh with an unmodified portable version (with the default configuration).

norgeous added a commit to norgeous/SyncTrayzor that referenced this issue May 28, 2016
@leaumar
Copy link
Author

leaumar commented May 28, 2016

But as you can see further down in that issue, I also fixed the config as you described there. If those 2 paths are the only difference between a portable and installed copy, then my data is fully patched to be portable now.

Those paths also refer to syncthing, not to my data. If they were broken, synctrayzor wouldn't start syncthing. It does start syncthing, it just doesn't load my data anymore.

Is the data in the data-folder tied to the host OS in any way? For example the unique key syncthing generates for each pc, can it be re-used after creation or does it need to match the current host? Does synctrayzor protect the data folder with an OS-derived unique key for security?

Edit: come to think of it, it's starting to sound more like a syncthing issue than a synctrayzor issue.

@canton7
Copy link
Owner

canton7 commented May 28, 2016

Does synctrayzor by any chance encrypt its data with a unique OS-generated key or something?

No, it doesn't. The portable version can be moved between machines. Whatever's going on is something else.

it now loads the default config instead of my old config that I copied over along with it.

What's "it" here? Syncthing's config, or SyncTrayzor's config?

SyncTrayzor loads the config that's in the config file. The location of the config file is specified in SyncTrayzor.exe.config, in <ConfigurationFilePath>. If the config file does not exist, it's created from the defaults. This location is in data\ for the portable version, or AppData for the installed version.

The portable version tells Syncthing to puts its configuration in data\ by default, although there's a setting to let Syncthing use its default location, which is in AppData. The installed version tells Syncthing to use its default location in AppData by default.

Is the data in the data-folder tied to the host OS in any way?

No.

For example the unique key syncthing generates for each pc, can it be re-used after creation or does it need to match the current host?

This is stored in the same location as Syncthing's config, which is described above.

It sounds like you tried to convert from the installed version to the portable version, by copying your config.xml. This will have left Syncthing using its default database location in AppData, rather than using a folder in data\ (which is the default for new portable installations). This won't have been copied when you copied the SyncTrayzor portable directory.

@leaumar
Copy link
Author

leaumar commented May 28, 2016

No, it doesn't. The portable version can be moved between machines. Whatever's going on is something else.

Ok, good

Did you always use the portable version, or has there been some version there? What's the whole story?

No, I used the installed version first. Then I downloaded the portable version, copied over the data folder, and fixed the 2 mentioned paths in config.xml. Does more need to change to make an installed version's data folder portable?

SyncTrayzor.exe.config

<PathConfiguration>
        <LogFilePath>%EXEPATH%\logs</LogFilePath>
        <ConfigurationFilePath>%EXEPATH%\data\config.xml</ConfigurationFilePath>
        <ConfigurationFileBackupPath>%EXEPATH%\data\config-backups</ConfigurationFileBackupPath>
        <CefCachePath>%EXEPATH%\data\cef\cache</CefCachePath>
      </PathConfiguration>

config.xml

  <SyncthingPath>%EXEPATH%\data\syncthing.exe</SyncthingPath>
  <SyncthingCustomHomePath>%EXEPATH%\data\syncthing</SyncthingCustomHomePath>

I tried to run synctrayzor straight from the external disk to which I had copied it for my windows reinstall. It did the exact same thing: loaded the default config instead of the existing one.

Short of sending you my whole synctrayzor copy with data folder and everything, is there something else I can check? Something else that differs between the data folders of an installed version and a portable version that would cause this?

@canton7
Copy link
Owner

canton7 commented May 28, 2016

Does more need to change to make an installed version's data folder portable?

Yes.

Now that we know what the problem is, there are two other things you need to check:

  • <SyncthingUseCustomHome> should be true.
  • You need to copy the contents of C:\Users\<You>\AppData\Local\Syncthing into data\syncthing (overwriting the default configuration that Syncthing created there). This will actually move Syncthing's configuration into the place that's used by the portable copy of SyncTrayzor.

EDIT: Aah, you're the guy who opened #271: that provides a lot of context around your setup that I hadn't realised.

@leaumar
Copy link
Author

leaumar commented May 28, 2016

I took a fresh copy from my ext disk (which has the fixed paths) and copied my original AppData\Local\Syncthing into its data\syncthing, overwriting what was there: same result :/

@canton7
Copy link
Owner

canton7 commented May 28, 2016

Right, post data\config.xml and data\syncthing\config.xml, please.

@leaumar
Copy link
Author

leaumar commented May 28, 2016

Is the SyncthingApiKey in config.xml supposed to be secret? I don't mind posting even a zip of my whole thing here, but I'd rather not just give away free access to my stuff by including the auth keys and whatnot :) Not that I don't trust you, but this is publicly visible...

@canton7
Copy link
Owner

canton7 commented May 28, 2016

If you want, you can email them: my email's on my profile page.

The API key will only matter if you've told Syncthing to listen on something other than localhost.

@canton7
Copy link
Owner

canton7 commented May 28, 2016

You need to change <SyncthingUseCustomHome>false</SyncthingUseCustomHome> to <SyncthingUseCustomHome>true</SyncthingUseCustomHome>, as I said earlier.

(Alternatively, there's a checkbox for this in the settings: uncheck "Use Syncthing's default database location").

@leaumar
Copy link
Author

leaumar commented May 28, 2016

Ah, it was in config.xml too? I was looking at that same key but in SyncTrayzor.exe.config, where it already was true. Sorry I missed that, I didn't think it'd be in 2 places

Just ran it and yes, now it works :) Thanks

Perhaps all these pitfalls could be put onto a wiki page for future reference?

@canton7
Copy link
Owner

canton7 commented May 28, 2016

SyncTrayzor.exe.config just contains the template for the default configuration, and some things which aren't user-editable: you should never edit it yourself (unless you're a network admin setting up default installs for your users).

Converting from Installed -> Portable is not something that's currently supported: it's not documented, and you're (in theory) on your own. The minute I start documenting something, it's then something that I need to support and cannot break.

I'm having a think about what can be done to make it possible for the average user.

@canton7
Copy link
Owner

canton7 commented May 30, 2016

The next version will support copying the config between the portable and installed version, and the README will have instructions on how to copy Syncthing's config around.

@leaumar
Copy link
Author

leaumar commented May 30, 2016

Awesome, thanks

@canton7 canton7 closed this as completed Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants