Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2021-02-02 07:11:38 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-02-03 05:35:07 +0300
commit803743e6c83cb95d992a7d9ac9632815450f38d1 (patch)
tree3af8f4c73d7b4eaf9024f871df18078164606c3b
parentec16301b72b5d8370ccdcd86088440cca409cd8b (diff)
Add access control dev guide
-rw-r--r--doc/development.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/development.md b/doc/development.md
index e329b105..49a0476f 100644
--- a/doc/development.md
+++ b/doc/development.md
@@ -43,6 +43,43 @@ This is because `/etc/hosts` does not support wildcard hostnames.
An alternative is to use [`dnsmasq`](https://wiki.debian.org/dnsmasq) to handle wildcard hostnames.
+### Enable access control
+
+Pages access control is disabled by default. To enable it:
+
+1. Modify your config/gitlab.yml file:
+
+```rb
+pages:
+ access_control: true
+```
+
+2. Restart GitLab (if running via GDK run: `gdk restart`)
+
+**NOTE**:
+Running `gdk reconfigure` will overwrite the value of `access_control` in `config/gitlab.yml`.
+
+3. In your local GitLab instance, navigate to `/admin/applications`
+4. Create an [OAuth application](https://docs.gitlab.com/ee/integration/oauth_provider.html#add-an-application-through-the-profile)
+5. Set the value of your redirect-uri to the `pages-domain` authorization endpoint, for example `http://192.168.1.135.nip.io:8090/auth`
+6. Add the following lines to your `gitlab-pages.conf` file
+
+```conf
+## the following are only needed if you want to test auth for private projects
+auth-client-id=$CLIENT_ID # generate a new OAuth application in http://127.0.0.1:3000/admin/applications
+auth-client-secret=$CLIENT_SECRET # obtained when generating an OAuth application
+auth-secret= $SOME_RANDOM_STRING # should be at least 32 bytes long
+auth-redirect-uri=http://192.168.1.135.nip.io:8090/auth
+```
+
+7. If running Pages inside the GDK, you can add the `gitlab-pages.conf` file to the `protected_config_files` section under `gdk` in your `gdk.yml` file
+
+```yaml
+gdk:
+ protected_config_files:
+ - 'gitlab-pages/gitlab-pages.conf'
+```
+
## Linting
```sh