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

Create a Portable Version #371

Closed
starfishpatkhoo opened this issue Apr 24, 2024 · 11 comments
Closed

Create a Portable Version #371

starfishpatkhoo opened this issue Apr 24, 2024 · 11 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@starfishpatkhoo
Copy link

Just a asking for an enhancement - if it would be possible to create a portable version.

It would be nice if on startup, the executable would search for the the config files located next to the executable, or in a predefined folder next to the executable, before searching $HOME, %AppData% and friends..

^_^

@dweymouth
Copy link
Owner

I'm guessing the portable mode should also not save the password? Because saving it in the system keyring is not portable and saving it in plaintext isn't secure. Also, should the image cache be in a directory called "cache" right next to the executable in portable mode?

@dweymouth dweymouth added the enhancement New feature or request label Apr 24, 2024
@starfishpatkhoo
Copy link
Author

starfishpatkhoo commented Apr 24, 2024

I'm guessing the portable mode should also not save the password? Because saving it in the system keyring is not portable and saving it in plaintext isn't secure. Also, should the image cache be in a directory called "cache" right next to the executable in portable mode?

Yep.. basically on a USB drive out of the box.. ^_^

Plaintext passwords is fine I feel.. People who want it portable should not be asking too much for security. This ain't a configuration method for NSA certification.. But yeah, if people wanted such a thing (insecure, messy, no cleanups, or etc etc..), They take responsibility and then they can do so if they wish.. ^_^

Maybe a "portable" folder next to the executable, if it exists and the file "config.toml" exists inside, then everything else is thrown in there too..

./supersonic
./portable
./portable/config.toml
./portable/themes
./portable/cache
./portable/server_name.password

Or something like that.. nothing too fancy, nothing too complex.. ^_^

@accforgithubtest
Copy link

Would love to see a portable version as well

@dweymouth
Copy link
Owner

This shouldn't be too hard to add, but I'm not too familiar with how portable apps are usually setup. How will it know if it should be running in portable mode? Would it make sense to have a single directory next to the EXe where it stores everything (eg supersonic_portable)? Would it run in portable mode if and only if it sees that directory exists? (In which you need to manually create it before running Supersonic for the first time to avoid it storing config in the system dirs?

@accforgithubtest
Copy link

accforgithubtest commented May 7, 2024

Just looking at few other portable softwares for linux distros, it looks like a common practice for the application files to be in places like

  1. Similar to firefox - create a hidden folder in the users home directory - ~/.supersonic/
  2. Similar to DBeaver, telegram and many others - create a folder in local/share - ~/.local/share/supersonic/

I am no expert in this subject, however the reason to have it as a dotfile / dotfolder is to allow for the user settings to be persisted/preserved even if the portable version is moved / replaced with a updated version of the software. This also allows for sharing the settings across systems using git, etc.

So I would suggest to pick a somewhat standard approach of dotfiles in users home directory or ~/.local/share/.
So my opinion would be to have it in ~/.local/share/supersonic/.

Irrespective of where the user runs the application from, check for the existing settings files in that location, and if its there use them, else assume fresh install and create new settings files / force user to enter the details to save in that location.

@starfishpatkhoo
Copy link
Author

This shouldn't be too hard to add, but I'm not too familiar with how portable apps are usually setup. How will it know if it should be running in portable mode? Would it make sense to have a single directory next to the EXe where it stores everything (eg supersonic_portable)? Would it run in portable mode if and only if it sees that directory exists? (In which you need to manually create it before running Supersonic for the first time to avoid it storing config in the system dirs?

Yes, a supersonic_portable folder next to the executable is good. Everything in there, and in "portable mode" if that folder exists.

Yes, user is responsible for creating that folder. And yes, no encrypted strings/text files/etc - user is responsible for security.

Putting things in $HOME is not really "portable mode" because there are situations that $HOME is inaccessible. The idea again is that if "portable mode" is used on a USB drive, nothing touches the main root/FS/drive etc and you can... portably... bring that USB around to different machines and it works the way you have it set up. Like a roaming profile, but without the network mounted folder... On a USB stick you carry in your pocket. 😄

@dweymouth dweymouth added this to the 0.11.0 milestone May 24, 2024
@dweymouth
Copy link
Owner

The way that this will be implemented is that the app will run in portable mode if a directory supersonic_portable exists next to the executable. It will automatically enter portable mode in this case and save its config and cache inside that directory. It will not save the password and you will need to input it on launch since it is not possible to do so securely.

@dweymouth dweymouth self-assigned this May 25, 2024
@starfishpatkhoo
Copy link
Author

starfishpatkhoo commented Jun 12, 2024

Works Perfect, Thank You! ^_^

Just wanted to add a note, in case other people come here:

  • [version 0.11.0] Put your custom themes inside supersonic_portable/config/themes and the settings will pick it up and let you choose it as your theme - However, in config.toml, the theme file will be saved as a full path. So depending on your situation, it may or may not break. If you're on Linux, you should probably manually set the path according to your mount point via ID instead. Not to sure what the equivalent would be on Windows - I guess if your USB is usually mounted in the same drive letter, it should work just fine...

@dweymouth
Copy link
Owner

However, in config.toml, the theme file will be saved as a full path. So depending on your situation, it may or may not break. If you're on Linux, you should probably manually set the path according to your mount point via ID instead. Not to sure what the equivalent would be on Windows - I guess if your USB is usually mounted in the same drive letter, it should work just fine...

I would consider this a bug .. I'll open an issue to track this. Theme files should be saved with relative paths in config.toml so that it will continue to work in portable mode even if the absolute path changes

@dweymouth
Copy link
Owner

#404

@dweymouth
Copy link
Owner

dweymouth commented Jun 15, 2024

@starfishpatkhoo Sorry but I can't reproduce #404 here - can you double-check that the theme files are indeed referenced in the config.toml by full file paths? In mine it's only the filename itself and looking at the code I don't see where the full file path would be coming from

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

No branches or pull requests

3 participants