|
14 | 14 |
|
15 | 15 | * https://docs.gitlab.com/omnibus/settings/configuration.html |
16 | 16 |
|
| 17 | +Reference: https://docs.gitlab.com/omnibus/settings/smtp.html |
| 18 | + |
| 19 | +== SMTP |
| 20 | + |
| 21 | +[source] |
| 22 | +---- |
| 23 | +gitlab_rails['smtp_enable'] = true |
| 24 | +gitlab_rails['smtp_address'] = "smtp.server" |
| 25 | +gitlab_rails['smtp_port'] = 465 |
| 26 | +gitlab_rails['smtp_user_name'] = "smtp user" |
| 27 | +gitlab_rails['smtp_password'] = "smtp password" |
| 28 | +gitlab_rails['smtp_domain'] = "example.com" |
| 29 | +gitlab_rails['smtp_authentication'] = "login" |
| 30 | +gitlab_rails['smtp_enable_starttls_auto'] = true |
| 31 | +gitlab_rails['smtp_openssl_verify_mode'] = 'peer' |
| 32 | +
|
| 33 | +# If your SMTP server does not like the default 'From: gitlab@localhost' you |
| 34 | +# can change the 'From' with this setting. |
| 35 | +gitlab_rails['gitlab_email_from'] = 'gitlab@example.com' |
| 36 | +gitlab_rails['gitlab_email_reply_to'] = 'noreply@example.com' |
| 37 | +
|
| 38 | +# If your SMTP server is using self signed certificates you can specify a custom ca file |
| 39 | +#gitlab_rails['smtp_ca_file'] = '/path/to/your/cacert.pem' |
| 40 | +---- |
| 41 | + |
| 42 | +GMAIL |
| 43 | + |
| 44 | +[source,ruby] |
| 45 | +---- |
| 46 | +gitlab_rails['smtp_enable'] = true |
| 47 | +gitlab_rails['smtp_address'] = "smtp.gmail.com" |
| 48 | +gitlab_rails['smtp_port'] = 587 |
| 49 | +gitlab_rails['smtp_user_name'] = "my.email@gmail.com" |
| 50 | +gitlab_rails['smtp_password'] = "my-gmail-password" |
| 51 | +gitlab_rails['smtp_domain'] = "smtp.gmail.com" |
| 52 | +gitlab_rails['smtp_authentication'] = "login" |
| 53 | +gitlab_rails['smtp_enable_starttls_auto'] = true |
| 54 | +gitlab_rails['smtp_tls'] = false |
| 55 | +gitlab_rails['smtp_openssl_verify_mode'] = 'peer' # Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert', see http://api.rubyonrails.org/classes/ActionMailer/Base.html |
| 56 | +---- |
| 57 | + |
| 58 | +== OpenID Connect |
| 59 | + |
| 60 | +References: https://docs.gitlab.com/administration/auth/oidc/ |
| 61 | + |
| 62 | +[source,rails] |
| 63 | +---- |
| 64 | +gitlab_rails['omniauth_enabled'] = true |
| 65 | +gitlab_rails['omniauth_block_auto_created_users'] = true |
| 66 | +gitlab_rails['omniauth_allow_single_sign_on'] = ['openid_connect'] |
| 67 | +gitlab_rails['omniauth_auto_link_ldap_user'] = true |
| 68 | +gitlab_rails['omniauth_providers'] = [ |
| 69 | + { |
| 70 | + name: "openid_connect", # do not change this parameter |
| 71 | + label: "Keycloak", # optional label for login button, defaults to "Openid Connect" |
| 72 | + icon: "<custom_provider_icon>", |
| 73 | + args: { |
| 74 | + name: "openid_connect", |
| 75 | + scope: ["openid","profile","email"], |
| 76 | + response_type: "code", |
| 77 | + issuer: "http://keycloak.localdomain/", |
| 78 | + discovery: true, |
| 79 | + client_auth_method: "query", |
| 80 | + uid_field: "preferred_username", |
| 81 | + send_scope_to_token_endpoint: "false", |
| 82 | + pkce: true, |
| 83 | + client_options: { |
| 84 | + identifier: "<your_oidc_client_id>", |
| 85 | + secret: "<your_oidc_client_secret>", |
| 86 | + redirect_uri: "http://gitlab.localdomain/users/auth/openid_connect/callback" |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | +] |
| 91 | +---- |
0 commit comments