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

Allow running without root #12

Merged
merged 6 commits into from
Nov 21, 2019
Merged

Allow running without root #12

merged 6 commits into from
Nov 21, 2019

Conversation

sharkwouter
Copy link
Contributor

This allows steam-buddy to be started as a regular user. When not running as root, you may notice the following differences:

  • Flatpak runs in user mode, installing software only for the current user.
  • The port which is used by the web server changes from 80 to 8080.
  • Banners and shortcuts are saved in ~/.local/share/steam-buddy. This one will require a small change to steam-shortcuts.

To start steam-buddy as a regular user, you can either just run the application directly or use the newly included steam-buddy@service file. Once installed in /etc/systemd/system/ this file can be used with systemctl start steam-buddy@username. Enabling it as the gamer user would be done with sudo systemctl enable steam-buddy@gamer.

This pull request fixes issue #9

steam-buddy Outdated
DATA_DIR = '/var/lib/steam-buddy'
else:
HOST_PORT = 8080
DATA_DIR = os.path.join(os.path.expanduser('~'), '.local/share/steam-buddy')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to honour the XDG_DATA_HOME environment variable as well. ~/.local/share is only the default location. See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, it now uses the XDG_DATA_HOME when possible, otherwise it falls back to ~/.local/share.

@@ -0,0 +1,16 @@
[Unit]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need the other service file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Possibly not, but if you still want to be able to run as root you may want to keep it. I haven't really tested running the new service file as root and running it as steam-buddy@root is a bit weird. It probably does work, though.

@alkazar alkazar merged commit d56db9f into ChimeraOS:master Nov 21, 2019
@sharkwouter sharkwouter deleted the feature/run-without-root branch December 21, 2019 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants