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

support running with custom non-root user #1193

Merged
merged 4 commits into from
Nov 15, 2024

Conversation

coffee-cup
Copy link
Contributor

@coffee-cup coffee-cup commented Sep 22, 2024

This PR adds support for running the start command as a non-root user. The user is frist created with useradd.

This is a very simply implementation of custom user support and if you have a another use case that requires additonal user configuration, please leave a comment or create an issue to open up a discussion.

Closes #449, #990

Configuration

user is added as a field to the start phase and can be configured with a nixpacks.toml file like this

# ...

[start]
user = "myuser"

or via the command line by passing custom config. For example

$ nixpacks build examples/custom-user --name user --json-plan '{ "start": { "user": "myuser2" } }'

@coffee-cup coffee-cup added the release/minor Author minor release label Sep 22, 2024
@fattila16
Copy link
Contributor

fattila16 commented Oct 10, 2024

When it comes to serving static assets, nginx is used. With the introduction of the custom non-root user, would this break that? As nginx needs root access to write /var/log/nginx, /var/cache/nginx and for whatever else I'm not 100% familiar what nginx needs to run so I might be wrong

@coffee-cup
Copy link
Contributor Author

This will not change anything by default so nothing should break when nginx is used unless a non-root user is manually specified.

Copy link
Contributor

This pull request is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions github-actions bot added the stale The pull request is stale label Oct 26, 2024
@coffee-cup coffee-cup removed the stale The pull request is stale label Oct 26, 2024
Copy link
Contributor

github-actions bot commented Nov 6, 2024

This pull request is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions github-actions bot added the stale The pull request is stale label Nov 6, 2024
@coffee-cup coffee-cup removed the stale The pull request is stale label Nov 8, 2024
@coffee-cup coffee-cup merged commit ab24441 into main Nov 15, 2024
101 checks passed
@coffee-cup coffee-cup deleted the jr/support-running-with-custom-user branch November 15, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/minor Author minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Final start command is run as root
2 participants