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

[WIP] Rootless docker #4749

Closed
wants to merge 1 commit into from
Closed

Conversation

sapk
Copy link
Member

@sapk sapk commented Aug 20, 2018

This would be breaking some configs for docker.
So I will keep it as WIP because I may haven't done the good choices and this PR need changes to be merge. For examples, new config where introduce and need to be configured via env var. And maybe some people would be opposed to those changes.

To do rootless :

  • It listen on 2222 for ssh
  • It use the internal ssh server

With that change, we lost :

  • The configuration of uid via USER_UID USER_GID (Because we are not root we can not change the passwd file)

I will search if there is any solution around to allow to setup the uid user of the container.

Related: #1190

@codecov-io
Copy link

Codecov Report

Merging #4749 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4749      +/-   ##
==========================================
+ Coverage    20.7%   20.71%   +<.01%     
==========================================
  Files         167      167              
  Lines       32359    32359              
==========================================
+ Hits         6699     6702       +3     
+ Misses      24678    24676       -2     
+ Partials      982      981       -1
Impacted Files Coverage Δ
modules/process/manager.go 73.91% <0%> (+4.34%) ⬆️

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 fa93857...21e5043. Read the comment docs.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 20, 2018
@pittar
Copy link

pittar commented Aug 21, 2018

@sapk , this is great! Is there a build I could test? If not, when one is available let me know and I can try it out on OpenShift.

@techknowlogick techknowlogick added topic/deployment pr/wip This PR is not ready for review labels Aug 22, 2018
@lafriks lafriks added pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! type/changelog Adds the changelog for a new Gitea version labels Aug 22, 2018
@pittar
Copy link

pittar commented Sep 2, 2018

Hey all, any progress on this? I see merging is blocked.

@sapk
Copy link
Member Author

sapk commented Sep 3, 2018

@pittar it should already work but I will be careful before changing how the container works 😈. It will add some security but we loose container configuration. If I remember it is possible to change uid/gid and more with option (--group-add and --user) and keep the same flexibility as before but I haven't tested those (yet).

and the merge is blocked because this PR doesn't have LGT-M validation

@pittar
Copy link

pittar commented Sep 8, 2018

Hey @sapk , thanks for this.

So, I built a new image based on your fork and it let me start Gitea (sweet!).

My problem now is that I hit the main page just fine, but as soon as I hit "Register" it asks me for install info. This is fine, except it also wants a "Run as" user. OpenShift seems to be saying the user is "unknown" and with a random id.

/app/gitea $ whoami whoami: unknown uid 1000500000

I can't put in a valid "Run as" user, so I can't complete the install. Any guidance would be greatly appreciated.

Thanks!

@sapk
Copy link
Member Author

sapk commented Sep 8, 2018

@pittar did you try to put the uid in the runas field ? (1000500000)

@pittar
Copy link

pittar commented Sep 8, 2018

@sapk , thanks for the suggestion, but that doesn't work. It wouldn't do much good, since OpenShift assigns random UIDs on start.

I've made some progress by locking the install and switching the USER command to 1000 instead of git. My issue now is that it says permission denied on the .gitconfig file:

2018/09/08 22:11:01 [...gitea/models/repo.go:144 NewRepoContext()] [E] Failed to set git user.name(exec(2:NewRepoContext(set user.name)) failed: exit status 255(<nil>) stdout:  stderr: error: could not lock config file //.gitconfig: Permission denied
--
  | ): error: could not lock config file //.gitconfig: Permission denied

I'm assuming the git user (1000) doesn't have access to wherever that file is?

@stale
Copy link

stale bot commented Jan 5, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Jan 5, 2019
@stale
Copy link

stale bot commented Jan 19, 2019

This pull request has been automatically closed because of inactivity. You can re-open it if needed.

@stale stale bot closed this Jan 19, 2019
sapk added a commit to sapk-fork/gitea that referenced this pull request Jan 19, 2019
Like the comment that is posted.

Ex: go-gitea#4749 is closed after 2 weeks and not 2 months
techknowlogick pushed a commit that referenced this pull request Jan 19, 2019
Like the comment that is posted.

Ex: #4749 is closed after 2 weeks and not 2 months
@sapk sapk mentioned this pull request Jun 5, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@delvh delvh removed the type/changelog Adds the changelog for a new Gitea version label Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/stale lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! pr/wip This PR is not ready for review topic/deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants