-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add details about USER_UID and USER_GID environment variables #4301
Conversation
@@ -245,6 +245,8 @@ You can configure some of Gitea's settings via environment variables: | |||
* `SECRET_KEY`: **""**: Global secret key. This should be changed. If this has a value and `INSTALL_LOCK` is empty, `INSTALL_LOCK` will automatically set to `true`. | |||
* `DISABLE_REGISTRATION`: **false**: Disable registration, after which only admin can create accounts for users. | |||
* `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page. | |||
* `USER_UID`: **1000**: The UID (Unix user ID) of the user that runs Gitea within the container. Match this to the UID of the owner of the `/data` volume if using host volumes (this is not necessary with named volumes). | |||
* `USER_GID`: **1000**: The GID (Unix group ID) of the user that runs Gitea within the container. Match this to the GID of the owner of the `/data` volume if using host volumes (this is not necessary with named volumes). | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add an explanation of the USER
variable? By default Gitea runs as the git
user, but by changing the USER
variable it can actually run with a different username. Note RUN_USER
in app.ini will need to be changed to match this, unsure if the docker image does this by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I know enough about it to do that. I can see that the environment variable is declared in the Dockerfile with ENV USER git
but I don't know how that's used (I'm not familiar with the codebase).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can find more info about this at #3961 but what is does it renames the user that runs Gitea, as you saw in the dockerfile is where the default is set, but then in the PR I linked actually renames the user. I use this functionality so that I can have USER=code
and my SSH clone URLS look like: code@example.com:test/repo.git
.
Although if you still don't feel comfortable adding that in, that's ok. I'll change my review to a pass, as your PR as it stands is great, and I don't want to be a blocker to improved documentation.
Codecov Report
@@ Coverage Diff @@
## master #4301 +/- ##
=======================================
Coverage 20.09% 20.09%
=======================================
Files 153 153
Lines 30696 30696
=======================================
Hits 6168 6168
Misses 23586 23586
Partials 942 942 Continue to review full report at Codecov.
|
In the Docker installation doc, explanation of the
USER_UID
andUSER_GID
variables seems to be missing so I added it.