From 6d5fd8afb04f1a5e6d9da7bd5e638104f1d23733 Mon Sep 17 00:00:00 2001 From: Michal Galet Date: Sun, 25 Jan 2015 22:07:26 +0100 Subject: [PATCH] Adding configuration options for default project features: issues, merge_requests, wiki, snippets --- README.md | 4 ++++ assets/config/gitlabhq/gitlab.yml | 8 ++++---- assets/init | 18 +++++++++++++++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a1a4582d..863ae774 100644 --- a/README.md +++ b/README.md @@ -721,6 +721,10 @@ Below is the complete list of available options that can be used to customize yo - **GITLAB_PROJECTS_LIMIT**: Set default projects limit. Defaults to `100`. - **GITLAB_USERNAME_CHANGE**: Enable or disable ability for users to change their username. Defaults is `true`. - **GITLAB_CREATE_GROUP**: Enable or disable ability for users to create groups. Defaults is `true`. +- **GITLAB_PROJECTS_ISSUES**: Set if *issues* feature should be enabled by default for new projects. Defaults is `true`. +- **GITLAB_PROJECTS_MERGE_REQUESTS**: Set if *merge requests* feature should be enabled by default for new projects. Defaults is `true`. +- **GITLAB_PROJECTS_WIKI**: Set if *wiki* feature should be enabled by default for new projects. Defaults is `true`. +- **GITLAB_PROJECTS_SNIPPETS**: Set if *snippets* feature should be enabled by default for new projects. Defaults is `false`. - **GITLAB_PROJECTS_VISIBILITY**: Set default projects visibility level. Possible values `public`, `private` and `internal`. Defaults to `private`. - **GITLAB_RESTRICTED_VISIBILITY**: Comma separated list of visibility levels to restrict non-admin users to set. Possible visibility options are `public`, `private` and `internal`. - **GITLAB_WEBHOOK_TIMEOUT**: Sets the timeout for webhooks. Defaults to `10` seconds. diff --git a/assets/config/gitlabhq/gitlab.yml b/assets/config/gitlabhq/gitlab.yml index e6b4601b..a08db7bc 100644 --- a/assets/config/gitlabhq/gitlab.yml +++ b/assets/config/gitlabhq/gitlab.yml @@ -81,10 +81,10 @@ production: &base ## Default project features settings default_projects_features: - issues: true - merge_requests: true - wiki: true - snippets: false + issues: {{GITLAB_PROJECTS_ISSUES}} + merge_requests: {{GITLAB_PROJECTS_MERGE_REQUESTS}} + wiki: {{GITLAB_PROJECTS_WIKI}} + snippets: {{GITLAB_PROJECTS_SNIPPETS}} visibility_level: "{{GITLAB_PROJECTS_VISIBILITY}}" # can be "private" | "internal" | "public" ## Webhook settings diff --git a/assets/init b/assets/init index 3377fb16..deb5f61d 100755 --- a/assets/init +++ b/assets/init @@ -25,6 +25,10 @@ GITLAB_SIGNIN=${GITLAB_SIGNIN:-true} GITLAB_PROJECTS_LIMIT=${GITLAB_PROJECTS_LIMIT:-100} GITLAB_USERNAME_CHANGE=${GITLAB_USERNAME_CHANGE:-true} GITLAB_CREATE_GROUP=${GITLAB_CREATE_GROUP:-true} +GITLAB_PROJECTS_ISSUES=${GITLAB_PROJECTS_ISSUES:-true} +GITLAB_PROJECTS_MERGE_REQUESTS=${GITLAB_PROJECTS_MERGE_REQUESTS:-true} +GITLAB_PROJECTS_WIKI=${GITLAB_PROJECTS_WIKI:-true} +GITLAB_PROJECTS_SNIPPETS=${GITLAB_PROJECTS_SNIPPETS:-false} GITLAB_PROJECTS_VISIBILITY=${GITLAB_PROJECTS_VISIBILITY:-private} GITLAB_RELATIVE_URL_ROOT=${GITLAB_RELATIVE_URL_ROOT:-} GITLAB_RESTRICTED_VISIBILITY=${GITLAB_RESTRICTED_VISIBILITY:-} @@ -398,7 +402,19 @@ sudo -u git -H sed 's/{{GITLAB_USERNAME_CHANGE}}/'"${GITLAB_USERNAME_CHANGE}"'/' # configure gitlab default_can_create_group sudo -u git -H sed 's/{{GITLAB_CREATE_GROUP}}/'"${GITLAB_CREATE_GROUP}"'/' -i config/gitlab.yml -# configure gitlab default visibility_level +# configure gitlab default project feature: issues +sudo -u git -H sed 's/{{GITLAB_PROJECTS_ISSUES}}/'"${GITLAB_PROJECTS_ISSUES}"'/' -i config/gitlab.yml + +# configure gitlab default project feature: merge_requests +sudo -u git -H sed 's/{{GITLAB_PROJECTS_MERGE_REQUESTS}}/'"${GITLAB_PROJECTS_MERGE_REQUESTS}"'/' -i config/gitlab.yml + +# configure gitlab default project feature: wiki +sudo -u git -H sed 's/{{GITLAB_PROJECTS_WIKI}}/'"${GITLAB_PROJECTS_WIKI}"'/' -i config/gitlab.yml + +# configure gitlab default project feature: snippets +sudo -u git -H sed 's/{{GITLAB_PROJECTS_SNIPPETS}}/'"${GITLAB_PROJECTS_SNIPPETS}"'/' -i config/gitlab.yml + +# configure gitlab default project feature: visibility_level sudo -u git -H sed 's/{{GITLAB_PROJECTS_VISIBILITY}}/'"${GITLAB_PROJECTS_VISIBILITY}"'/' -i config/gitlab.yml # configure gitlab restricted_visibility_levels