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

Improve xmage work from read only folders (split app's files and user's data, steam deck support) #7025

Open
catern opened this issue Aug 30, 2020 · 6 comments

Comments

@catern
Copy link

catern commented Aug 30, 2020

Right now plugins are hardcoded to be loaded out of the current working directory. The database and logs are also written to CWD. This means the plugins, and xmage in general, can't be installed somewhere read-only.

@JayDi85
Copy link
Member

JayDi85 commented Aug 30, 2020

XMage uses relative paths, so you can install it in read only folder but run from any working folders. It require scripts and some folders copy.

Example:
shot_200830_232242

Client run script from user's folder:

java -Xmx512m -Dfile.encoding=UTF-8 -jar W:\test\xmage_restrict\mage-client\lib\mage-client-1.4.45.jar

Server run script from user's folder:

java -Xmx512m -Dfile.encoding=UTF-8 -jar W:\test\xmage_restrict\mage-server\lib\mage-server-1.4.45.jar

@JayDi85 JayDi85 added the support Questions from users, help and support label Aug 30, 2020
@JayDi85
Copy link
Member

JayDi85 commented Aug 30, 2020

If that's is not solution then provide use cases and examples (what you want to do).

@catern
Copy link
Author

catern commented Aug 30, 2020

In a read-only installation setup, both the plugins and the main xmage JAR would be loaded from a read-only directory. I don't understand how your example achieves that.

If the writable "plugins" directory shown in your example is empty, then (in my experimentation and from looking at the code), xmage will not run properly, because it won't be able to load the plugins.

Alternatively, if the writable "plugins" directory shown in your example actually contains the plugins, and xmage loads them from there, then it's not actually a read-only installation, because the plugins are writable.

There are multiple benefits of read-only installations. Two specific benefits are improved security (if xmage is compromised it can't rewrite its plugins to permanently add a backdoor) and multi-user use (multiple users can run xmage from the same install directory with different configurations and databases).

@JayDi85
Copy link
Member

JayDi85 commented Aug 30, 2020

Alternatively, if the writable "plugins" directory shown in your example actually contains the plugins, and xmage loads them from there, then it's not actually a read-only installation, because the plugins are writable.

Plugins folder is part of configuration (e.g. it can be modified by users or server's owner). Well, the original plugins idea was -- users can delete or add third party plugins to improve xmage's features like new themes, card images, graphics, game modes, etc. BUT this idea was abandoned by time. Currently, xmage has only its own libraries and plugins.

I agree that it must be improved to fetch all additional resources from app's folder (related to main app library, not working dir). I'll review and fix paths in one of the next versions.

Anyway, if you want to support xmage's packages then you must write additional install and run scripts (e.g. prepare server's folder or config files).

@JayDi85 JayDi85 added enhancement and removed support Questions from users, help and support labels Aug 30, 2020
@JayDi85 JayDi85 self-assigned this Aug 30, 2020
@JayDi85 JayDi85 changed the title Add a way to override the plugins directory Improve xmage work from read only folders (split app's files and user's data) Aug 30, 2020
@JayDi85
Copy link
Member

JayDi85 commented Aug 30, 2020

BTW, you can change default images folder by settings (from app's main menu or by registry in Windows and preferences file in linux/macos). More details here.

@JayDi85 JayDi85 changed the title Improve xmage work from read only folders (split app's files and user's data) Improve xmage work from read only folders (split app's files and user's data, steam deck support) Feb 27, 2024
@JayDi85
Copy link
Member

JayDi85 commented Feb 27, 2024

Steam Deck uses read only file system, so read only mode can be good for xmage to support such systems (instruction example to run java 8 app on steam deck, and another one version for jar launcher):

  • no updates;
  • no symbols and images download;
  • no temp files or css styles workarounds (if exists);
  • no logs on disk;
  • instruction how to prepare read only files from existing install (prepared images and symbols);

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

2 participants