Skip to content

Instantly share code, notes, and snippets.

@fibasile
Last active September 25, 2019 14:35
Show Gist options
  • Save fibasile/9fea8f664e180df69fe124cc2ecb6314 to your computer and use it in GitHub Desktop.
Save fibasile/9fea8f664e180df69fe124cc2ecb6314 to your computer and use it in GitHub Desktop.
Docker compose file for a Gitlab instance with Fablabs.io login
# Fill in your fablabs.io app_id and secret from the fablabs.io developer console
# set the callback_url as http://yourhost/users/auth/fablabs/callback
# if you replace localhost with a public hostname, comment out the let's encrypt line
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'localhost'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://localhost'
# comment the line below to enable let's encrypt certificates, will fail with localhost
letsencrypt['enable'] = false
# Add any other gitlab.rb configuration here, each on its own line
gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['fablabs']
gitlab_rails['omniauth_block_auto_created_users'] = false
gitlab_rails['omniauth_providers'] = [
{
"name" => "fablabs",
"app_id" => "your_fablabs_io_app_id",
"app_secret" => "your_fablabs_io_app_secret",
"args" => {
client_options: {
'site' => 'https://api.fablabs.io',
'user_info_url' => '/2/users/me.json'
},
user_response_structure: {
root_path: ['data', 'attributes'],
attributes: { nickname: 'username' }
},
redirect_url: 'https://localhost/users/auth/fablabs/callback',
name: 'fablabs',
strategy_class: "OmniAuth::Strategies::OAuth2Generic"
}
}
]
ports:
- '80:80'
- '443:443'
- '22:22'
volumes:
- '/srv/gitlab/config:/etc/gitlab'
- '/srv/gitlab/logs:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment