{"action":"created","issue":{"url":"https://api.github.com/repos/gogits/gogs/issues/3682","repository_url":"https://api.github.com/repos/gogits/gogs","labels_url":"https://api.github.com/repos/gogits/gogs/issues/3682/labels{/name}","comments_url":"https://api.github.com/repos/gogits/gogs/issues/3682/comments","events_url":"https://api.github.com/repos/gogits/gogs/issues/3682/events","html_url":"https://github.com/gogits/gogs/issues/3682","id":178505264,"number":3682,"title":"Configuration via environment variables","user":{"login":"ivlis","id":332942,"avatar_url":"https://avatars1.githubusercontent.com/u/332942?v=4","gravatar_id":"","url":"https://api.github.com/users/ivlis","html_url":"https://github.com/ivlis","followers_url":"https://api.github.com/users/ivlis/followers","following_url":"https://api.github.com/users/ivlis/following{/other_user}","gists_url":"https://api.github.com/users/ivlis/gists{/gist_id}","starred_url":"https://api.github.com/users/ivlis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivlis/subscriptions","organizations_url":"https://api.github.com/users/ivlis/orgs","repos_url":"https://api.github.com/users/ivlis/repos","events_url":"https://api.github.com/users/ivlis/events{/privacy}","received_events_url":"https://api.github.com/users/ivlis/received_events","type":"User","site_admin":false},"labels":[{"id":80068184,"url":"https://api.github.com/repos/gogits/gogs/labels/kind/enhancement","name":"kind/enhancement","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-22T02:26:24Z","updated_at":"2017-12-08T12:43:08Z","closed_at":null,"author_association":"NONE","body":"- Gogs version (or commit ref): 0.9.99.0915\n- Git version: \n- Operating system: Docker \n- Database (use `[x]`):\n  - [X] PostgreSQL\n  - [X] MySQL\n  - [X] SQLite\n- Can you reproduce the bug at https://try.gogs.io:\n  - [ ] Yes (provide example URL)\n  - [ ] No\n  - [X] Not relevant\n- Log gist:\n## Description\n\nNow Gogs is configured via the app.ini file. This is not container-friendly, as containers like to be configured externally via environment variables. Database configurations, caching servers, virtual host names etc play nicely with other containers if they are defined by the environment.\n\nNow I'm migrating from Gitlab (as a majority of users, I think) and I really miss this feature. Have a look: https://github.com/sameersbn/docker-gitlab\n\nI started to implement somewhat similar (but less monstrous, as Gogs is super-simple comparing to Gitlab, thanks @Unknwon !!! ) here: https://github.com/ivlis/docker-gogs\n\nI understand, that you don't want a docker-compose file in the repo, but it would be nice to have a have the environment substitution feature in the official container. Something similar to this: https://github.com/ivlis/docker-gogs/blob/master/gogs/set_settings.sh . This is the simplest example, of course.\n\nIf you agree, I can implement this. \n"},"comment":{"url":"https://api.github.com/repos/gogits/gogs/issues/comments/350254497","html_url":"https://github.com/gogits/gogs/issues/3682#issuecomment-350254497","issue_url":"https://api.github.com/repos/gogits/gogs/issues/3682","id":350254497,"user":{"login":"discordianfish","id":275966,"avatar_url":"https://avatars1.githubusercontent.com/u/275966?v=4","gravatar_id":"","url":"https://api.github.com/users/discordianfish","html_url":"https://github.com/discordianfish","followers_url":"https://api.github.com/users/discordianfish/followers","following_url":"https://api.github.com/users/discordianfish/following{/other_user}","gists_url":"https://api.github.com/users/discordianfish/gists{/gist_id}","starred_url":"https://api.github.com/users/discordianfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discordianfish/subscriptions","organizations_url":"https://api.github.com/users/discordianfish/orgs","repos_url":"https://api.github.com/users/discordianfish/repos","events_url":"https://api.github.com/users/discordianfish/events{/privacy}","received_events_url":"https://api.github.com/users/discordianfish/received_events","type":"User","site_admin":false},"created_at":"2017-12-08T12:43:08Z","updated_at":"2017-12-08T12:43:08Z","author_association":"NONE","body":"Grafana would be another example: http://docs.grafana.org/installation/configuration/#using-environment-variables\r\nWithout support for this, things get tedious in container environments and you need to render the config dynamically from some templates like here for example: https://github.com/stevenaldinger/k8s-gogs/blob/master/k8s/03-gogs-statefulset.yaml#L44\r\n\r\n@Unknwon What do you mean by priorities? Precedence of config vs env variables? I think the common way and what I would propose is overriding the config with env variables, so if a env variable is set it always takes precedence.\r\n\r\nSo if this something that you would be accept PRs for? Might be easier for me to change this in gogs than working around it with lots of glue code on my side :)"}}
{"actor":{"display_login":"discordianfish"}}