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

Add details about USER_UID and USER_GID environment variables #4301

Merged
merged 1 commit into from
Jun 24, 2018

Conversation

microbug
Copy link
Contributor

@microbug microbug commented Jun 22, 2018

In the Docker installation doc, explanation of the USER_UID and USER_GID variables seems to be missing so I added it.

@@ -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).

Copy link
Member

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.

Copy link
Contributor Author

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).

Copy link
Member

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.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 22, 2018
@codecov-io
Copy link

Codecov Report

Merging #4301 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2721b6...a3b6156. Read the comment docs.

@techknowlogick techknowlogick added the type/docs This PR mainly updates/creates documentation label Jun 23, 2018
@bkcsoft bkcsoft added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 24, 2018
@bkcsoft bkcsoft added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 24, 2018
@techknowlogick techknowlogick added this to the 1.5.0 milestone Jun 24, 2018
@techknowlogick techknowlogick merged commit 212fef0 into go-gitea:master Jun 24, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/docs This PR mainly updates/creates documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants