Browse Source

Enable oauth2 in openstackid configuration

Add oauth2_enable and ssl_enable options to openstackid's server.php
configuration file.

Change-Id: Ib613ffeb550b682940e67273fbeaa8a101796f57
Marton Kiss 4 years ago
parent
commit
65255adaf0
3 changed files with 22 additions and 0 deletions
  1. 2
    0
      files/functions
  2. 15
    0
      manifests/init.pp
  3. 5
    0
      templates/server.php.erb

+ 2
- 0
files/functions View File

@@ -55,6 +55,7 @@ function site_init {
55 55
     ln -sf /etc/openstackid/recaptcha.php $target_dir/app/config/packages/greggilbert/recaptcha/$LARAVEL_ENV/config.php
56 56
     ln -sf /etc/openstackid/database.php $target_dir/app/config/$LARAVEL_ENV/database.php
57 57
     ln -sf /etc/openstackid/log.php $target_dir/app/config/$LARAVEL_ENV/log.php
58
+    ln -sf /etc/openstackid/server.php $target_dir/app/config/$LARAVEL_ENV/server.php
58 59
     # convert app/storage into symlink and set permissions
59 60
     mv $target_dir/app/storage $SITE_ROOT/
60 61
     chmod 02770 $SITE_ROOT/storage
@@ -164,6 +165,7 @@ function site_update {
164 165
     ln -sf /etc/openstackid/recaptcha.php $target_dir/app/config/packages/greggilbert/recaptcha/$LARAVEL_ENV/config.php
165 166
     ln -sf /etc/openstackid/database.php $target_dir/app/config/$LARAVEL_ENV/database.php
166 167
     ln -sf /etc/openstackid/log.php $target_dir/app/config/$LARAVEL_ENV/log.php
168
+    ln -sf /etc/openstackid/server.php $target_dir/app/config/$LARAVEL_ENV/server.php
167 169
     # link shared app/storage directory
168 170
     rm -rf $target_dir/app/storage
169 171
     ln -s $SITE_ROOT/storage $target_dir/app

+ 15
- 0
manifests/init.pp View File

@@ -49,6 +49,8 @@ class openstackid (
49 49
   $id_recaptcha_private_key = '',
50 50
   $id_recaptcha_template = '',
51 51
   $openstackid_release = 'latest',
52
+  $ssl_enable = 'true',
53
+  $oauth2_enable = 'true',
52 54
 ) {
53 55
 
54 56
   # php packages needed for openid server
@@ -133,6 +135,17 @@ class openstackid (
133 135
         ]
134 136
   }
135 137
 
138
+  file { '/etc/openstackid/server.php':
139
+        ensure  => present,
140
+        content => template('openstackid/server.php.erb'),
141
+        owner   => 'root',
142
+        group   => 'www-data',
143
+        mode    => '0640',
144
+        require => [
145
+          File['/etc/openstackid'],
146
+        ]
147
+  }
148
+
136 149
   $docroot_dirs = [ '/srv/openstackid' ]
137 150
 
138 151
   file { $docroot_dirs:
@@ -216,6 +229,7 @@ class openstackid (
216 229
       File['/etc/openstackid/database.php'],
217 230
       File['/etc/openstackid/log.php'],
218 231
       File['/etc/openstackid/environment.php'],
232
+      File['/etc/openstackid/server.php'],
219 233
       Package['curl'],
220 234
       Package[$php5_packages] ],
221 235
   }
@@ -232,6 +246,7 @@ class openstackid (
232 246
       File['/etc/openstackid/database.php'],
233 247
       File['/etc/openstackid/log.php'],
234 248
       File['/etc/openstackid/environment.php'],
249
+      File['/etc/openstackid/server.php'],
235 250
       Package[$php5_packages] ],
236 251
   }
237 252
 

+ 5
- 0
templates/server.php.erb View File

@@ -0,0 +1,5 @@
1
+<?php
2
+return array(
3
+  'SSL_Enable' => <%= @ssl_enable %>,
4
+  'OAuth2_Enable' => <%= @oauth2_enable %>,
5
+);

Loading…
Cancel
Save