Omniauth Support

This commit is contained in:
Florian Unglaub 2012-08-03 17:27:39 +02:00
parent 4ce034ca65
commit a64aff2f1c
20 changed files with 195 additions and 61 deletions

View file

@ -1,4 +1,4 @@
# # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # #
# Gitlab application config file #
# # # # # # # # # # # # # # # # # #
@ -19,14 +19,14 @@ email:
# Application specific settings
# Like default project limit for user etc
app:
default_projects_limit: 10
app:
default_projects_limit: 10
# backup_path: "/vol/backups" # default: Rails.root + backups/
# backup_keep_time: 604800 # default: 0 (forever) (in seconds)
#
# 2. Advanced settings:
#
# 2. Advanced settings:
# ==========================
# Git Hosting configuration
@ -49,3 +49,15 @@ git:
git_max_size: 5242880 # 5.megabytes
# Git timeout to read commit, in seconds
git_timeout: 10
# Omniauth configuration
# omniauth:
# enabled: true
# providers:
# - { name: 'google_oauth2', app_id: 'YOUR APP ID',
# app_secret: 'YOUR APP SECRET',
# args: { access_type: 'offline', approval_prompt: '' } }
# - { name: 'twitter', app_id: 'YOUR APP ID',
# app_secret: 'YOUR APP SECRET'}
# - { name: 'github', app_id: 'YOUR APP ID',
# app_secret: 'YOUR APP SECRET' }

View file

@ -6,7 +6,7 @@ class Settings < Settingslogic
self.web['protocol'] ||= web.https ? "https" : "http"
end
def web_host
def web_host
self.web['host'] ||= 'localhost'
end
@ -14,11 +14,11 @@ class Settings < Settingslogic
self.email['from'] ||= ("notify@" + web_host)
end
def url
def url
self['url'] ||= build_url
end
end
def web_port
def web_port
if web.https
web['port'] = 443
else
@ -36,7 +36,7 @@ class Settings < Settingslogic
raw_url << web_host
if web_custom_port?
raw_url << ":#{web_port}"
raw_url << ":#{web_port}"
end
raw_url
@ -111,5 +111,14 @@ class Settings < Settingslogic
def backup_keep_time
app['backup_keep_time'] || 0
end
def omniauth_enabled?
omniauth['enabled'] || false
end
def omniauth_providers
omniauth['providers'] || []
end
end
end