Skip to content

Conversation

@kazan417
Copy link

Add support for getting password from file.
This is good feature for using docker secrets

Add support for getting password from file.
This is good feature for using docker secrets
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 15, 2024
@wxiaoguang
Copy link
Contributor

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Dec 15, 2024

And Gitea has general "file to env" suppport in "environment-to-ini" https://github.com/go-gitea/gitea/blob/main/contrib/environment-to-ini/environment-to-ini.go

	Environment variables of the form "GITEA__SECTION_NAME__KEY_NAME__FILE"
	will be mapped to the ini section "[section_name]" and the key
	"KEY_NAME" with the value loaded from the specified file.

It is also packed into the docker image. So I think it doesn't need to add a new environment here?

environment-to-ini --config ${GITEA_CUSTOM}/conf/app.ini

@wxiaoguang wxiaoguang added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Dec 15, 2024
INSTALL_LOCK=true
fi
if [ "$DB_PASSWD_FILE" ]; then
DB_PASSWD=`cat $DB_PASSWD_FILE`;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
DB_PASSWD=`cat $DB_PASSWD_FILE`;
DB_PASSWD="$(cat $DB_PASSWD_FILE)";

backtick syntax is legacy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Before making more changes, I would suggest to use existing mechanisms. See my comments above.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I guess there are better solutions than to introduce _FILE variables for every variable.

@kazan417
Copy link
Author

kazan417 commented Dec 15, 2024

@kazan417
Copy link
Author

kazan417 commented Dec 15, 2024

And Gitea has general "file to env" suppport in "environment-to-ini" https://github.com/go-gitea/gitea/blob/main/contrib/environment-to-ini/environment-to-ini.go

	Environment variables of the form "GITEA__SECTION_NAME__KEY_NAME__FILE"
	will be mapped to the ini section "[section_name]" and the key
	"KEY_NAME" with the value loaded from the specified file.

It is also packed into the docker image. So I think it doesn't need to add a new environment here?

environment-to-ini --config ${GITEA_CUSTOM}/conf/app.ini

Thats what i am looking for, but there is no such example in wiki. We need to add it into wiki exemple

@kazan417 kazan417 closed this Dec 15, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Mar 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/internal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants