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

[docker] support for custom GITEA_CUSTOM env var #6608

Merged
merged 8 commits into from
May 13, 2019

Conversation

das7pad
Copy link
Contributor

@das7pad das7pad commented Apr 13, 2019

This PR adds support for a custom GITEA_CUSTOM environment variable in a docker container.

The current version has this path hardcoded to /data/gitea.

Environment changes trigger a recreation of the container and reset the profile script in /etc/profile.d/gitea.sh. It is safe to replace the default path instead of the full line.

The additional ssh-environment in /data/git/.ssh/environment is located in the users volume. Environment changes do not reset this file. This patch keeps additional variables a user may have placed there.

The additional chown on the initial config is needed to support paths like /etc/gitea and such, which are not writable by the git/run-user by default.

NOTE: The default value for GITEA_CUSTOM is `/data/gitea`.
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
@codecov-io
Copy link

codecov-io commented Apr 13, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #6608      +/-   ##
=========================================
- Coverage    41.4%   41.4%   -0.01%     
=========================================
  Files         441     441              
  Lines       59736   59736              
=========================================
- Hits        24734   24733       -1     
- Misses      31762   31764       +2     
+ Partials     3240    3239       -1
Impacted Files Coverage Δ
models/unit.go 62.16% <0%> (-5.41%) ⬇️
routers/repo/view.go 42.02% <0%> (-1.02%) ⬇️
models/repo_list.go 67.89% <0%> (+1.05%) ⬆️
modules/log/event.go 65.98% <0%> (+1.52%) ⬆️

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 597ac06...0d509f2. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 13, 2019
@lunny lunny added the type/enhancement An improvement of existing functionality label Apr 14, 2019
@sapk
Copy link
Member

sapk commented Apr 17, 2019

@das7pad sorry I didn't see your PR previously. I will look at it.

Copy link
Member

@sapk sapk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work the first time you change GITEA_CUSTOM but not later

docker/etc/s6/openssh/setup Outdated Show resolved Hide resolved
@GiteaBot GiteaBot 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 Apr 17, 2019
das7pad and others added 4 commits April 17, 2019 14:54
The `GITEA_CUSTOM` environment variable is set globally in the
 `Dockerfile` and for ssh-sessions in `/data/git/.ssh/environment`.

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
…-custom

# Conflicts:
#	docker/root/etc/profile.d/gitea.sh
@GiteaBot GiteaBot 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 May 8, 2019
@techknowlogick techknowlogick merged commit 36b68fd into go-gitea:master May 13, 2019
@techknowlogick techknowlogick added this to the 1.9.0 milestone May 13, 2019
@das7pad das7pad deleted the misc/docker-gitea-custom branch May 13, 2019 23:37
@lafriks lafriks mentioned this pull request May 15, 2019
7 tasks
@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/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants