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

In order to relieve permission issues, switch FTS to user-space #113

Open
4 of 5 tasks
phreed opened this issue Mar 27, 2024 · 5 comments
Open
4 of 5 tasks

In order to relieve permission issues, switch FTS to user-space #113

phreed opened this issue Mar 27, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@phreed
Copy link
Contributor

phreed commented Mar 27, 2024

Currently FTS installs as root into a root owned directory and FTS processes run as root.

This makes it difficult to administer the services as the base user.
It is possible to perform most administration tasks via sudo.
e.g.

  • edit the main FTS configuration: sudo vi /opt/FTSConfig.yaml
  • stop the FTS service: sudo systemctl stop fts.service
  • edit the FTS UI configuration: sudo vi /root/fts.venv/lib/python3.11/site-packages/FreeTAKServer-UI/config.py
  • become root: sudo su -

This works but it requires working as root which is generally discouraged.
To reduce the need to use sudo the following changes will be made:

  • create an fts user and fts group
  • install fts files with fts:fts ownership into /opt (see Install FTS into /opt instead of /root #112)
  • run (via systemd) processes with fts permissions
  • cause the installer to not need to be run with sudo
  • add the base user (probably ubuntu) to the fts group so it can perform FTS maintenance tasks
@phreed phreed self-assigned this Mar 27, 2024
@phreed phreed added the enhancement New feature or request label Mar 27, 2024
@phreed phreed changed the title Switch to user-space In order to relieve permission issues, switch FTS to user-space Mar 28, 2024
@phreed
Copy link
Contributor Author

phreed commented Mar 28, 2024

It is not completely possible to eliminate the need to run the installer with sudo.

That said, reducing the need to run any step as root is a good thing.

@brothercorvo
Copy link
Contributor

we can run the installer with SUDO but then run FTS with the new created user

@phreed phreed mentioned this issue Apr 22, 2024
@phreed
Copy link
Contributor Author

phreed commented Jul 1, 2024

I had the opportunity to study up on systemd. Rather than running the installer as root the application can use 'systemctl --user ...' as the 'fts' user, rather than 'sudo systemctl ...'.

@brothercorvo
Copy link
Contributor

Have you tested that?

@phreed
Copy link
Contributor Author

phreed commented Jul 2, 2024

I have tested the approach on another similar system.

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

2 participants