Browse Source

Updated configuration for OIDC

added app.php as template, bc now we need the app key set by default
on hiera.

Change-Id: I2d4678f36af911df33d0c334a76eb759aa2f725b
Sebastian Marcet 3 years ago
parent
commit
bd1f2efd39
4 changed files with 204 additions and 1 deletions
  1. 2
    0
      files/functions
  2. 0
    1
      manifests/deploy.pp
  3. 16
    0
      manifests/init.pp
  4. 186
    0
      templates/app.php.erb

+ 2
- 0
files/functions View File

@@ -54,6 +54,7 @@ function site_init {
54 54
     ln -sf /etc/openstackid/environment.php $target_dir/bootstrap/environment.php
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
+    ln -sf /etc/openstackid/app.php $target_dir/app/config/$LARAVEL_ENV/app.php
57 58
     ln -sf /etc/openstackid/log.php $target_dir/app/config/$LARAVEL_ENV/log.php
58 59
     ln -sf /etc/openstackid/server.php $target_dir/app/config/$LARAVEL_ENV/server.php
59 60
     # convert app/storage into symlink and set permissions
@@ -164,6 +165,7 @@ function site_update {
164 165
     ln -sf /etc/openstackid/environment.php $target_dir/bootstrap/environment.php
165 166
     ln -sf /etc/openstackid/recaptcha.php $target_dir/app/config/packages/greggilbert/recaptcha/$LARAVEL_ENV/config.php
166 167
     ln -sf /etc/openstackid/database.php $target_dir/app/config/$LARAVEL_ENV/database.php
168
+    ln -sf /etc/openstackid/app.php $target_dir/app/config/$LARAVEL_ENV/app.php
167 169
     ln -sf /etc/openstackid/log.php $target_dir/app/config/$LARAVEL_ENV/log.php
168 170
     ln -sf /etc/openstackid/server.php $target_dir/app/config/$LARAVEL_ENV/server.php
169 171
     # link shared app/storage directory

+ 0
- 1
manifests/deploy.pp View File

@@ -51,4 +51,3 @@ define openstackid::deploy (
51 51
     require => File[$deploy_dirs],
52 52
   }
53 53
 }
54
-

+ 16
- 0
manifests/init.pp View File

@@ -51,6 +51,9 @@ class openstackid (
51 51
   $openstackid_release = 'latest',
52 52
   $ssl_enable = true,
53 53
   $oauth2_enable = true,
54
+  $app_url = '',
55
+  $app_key = '',
56
+  $app_timezone = 'UTC'
54 57
 ) {
55 58
 
56 59
   # php packages needed for openid server
@@ -102,6 +105,17 @@ class openstackid (
102 105
     ]
103 106
   }
104 107
 
108
+  file { '/etc/openstackid/app.php':
109
+    ensure  => present,
110
+    content => template('openstackid/app.php.erb'),
111
+    owner   => 'root',
112
+    group   => 'www-data',
113
+    mode    => '0640',
114
+    require => [
115
+      File['/etc/openstackid'],
116
+    ]
117
+  }
118
+
105 119
   file { '/etc/openstackid/log.php':
106 120
       ensure  => present,
107 121
       content => template('openstackid/log.php.erb'),
@@ -230,6 +244,7 @@ class openstackid (
230 244
       File['/etc/openstackid/log.php'],
231 245
       File['/etc/openstackid/environment.php'],
232 246
       File['/etc/openstackid/server.php'],
247
+      File['/etc/openstackid/app.php'],
233 248
       Package['curl'],
234 249
       Package[$php5_packages] ],
235 250
   }
@@ -244,6 +259,7 @@ class openstackid (
244 259
       Httpd::Vhost[$vhost_name],
245 260
       File['/etc/openstackid/recaptcha.php'],
246 261
       File['/etc/openstackid/database.php'],
262
+      File['/etc/openstackid/app.php'],
247 263
       File['/etc/openstackid/log.php'],
248 264
       File['/etc/openstackid/environment.php'],
249 265
       File['/etc/openstackid/server.php'],

+ 186
- 0
templates/app.php.erb View File

@@ -0,0 +1,186 @@
1
+<?php
2
+
3
+return array(
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Application Debug Mode
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | When your application is in debug mode, detailed error messages with
11
+    | stack traces will be shown on every error that occurs within your
12
+    | application. If disabled, a simple generic error page is shown.
13
+    |
14
+    */
15
+
16
+    'debug' => false,
17
+
18
+    /*
19
+    |--------------------------------------------------------------------------
20
+    | Application URL
21
+    |--------------------------------------------------------------------------
22
+    |
23
+    | This URL is used by the console to properly generate URLs when using
24
+    | the Artisan command line tool. You should set this to the root of
25
+    | your application so that it is used when running Artisan tasks.
26
+    |
27
+    */
28
+
29
+    'url' => '<%= @app_url %>',
30
+
31
+    /*
32
+    |--------------------------------------------------------------------------
33
+    | Application Timezone
34
+    |--------------------------------------------------------------------------
35
+    |
36
+    | Here you may specify the default timezone for your application, which
37
+    | will be used by the PHP date and date-time functions. We have gone
38
+    | ahead and set this to a sensible default for you out of the box.
39
+    |
40
+    */
41
+
42
+    'timezone' => '<%= @app_timezone %>',
43
+
44
+    /*
45
+    |--------------------------------------------------------------------------
46
+    | Application Locale Configuration
47
+    |--------------------------------------------------------------------------
48
+    |
49
+    | The application locale determines the default locale that will be used
50
+    | by the translation service provider. You are free to set this value
51
+    | to any of the locales which will be supported by the application.
52
+    |
53
+    */
54
+
55
+    'locale' => 'en',
56
+
57
+    /*
58
+    |--------------------------------------------------------------------------
59
+    | Encryption Key
60
+    |--------------------------------------------------------------------------
61
+    |
62
+    | This key is used by the Illuminate encrypter service and should be set
63
+    | to a random, 32 character string, otherwise these encrypted strings
64
+    | will not be safe. Please do this before deploying an application!
65
+    |
66
+    */
67
+
68
+    'key' => '<%= @app_key %>',
69
+
70
+    /*
71
+    |--------------------------------------------------------------------------
72
+    | Autoloaded Service Providers
73
+    |--------------------------------------------------------------------------
74
+    |
75
+    | The service providers listed here will be automatically loaded on the
76
+    | request to your application. Feel free to add your own services to
77
+    | this array to grant expanded functionality to your applications.
78
+    |
79
+    */
80
+
81
+    'providers' => array(
82
+        'Illuminate\Foundation\Providers\ArtisanServiceProvider',
83
+        'Illuminate\Auth\AuthServiceProvider',
84
+        'Illuminate\Cache\CacheServiceProvider',
85
+        'Illuminate\Session\CommandsServiceProvider',
86
+        'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
87
+        'Illuminate\Routing\ControllerServiceProvider',
88
+        'Illuminate\Cookie\CookieServiceProvider',
89
+        'Illuminate\Database\DatabaseServiceProvider',
90
+        'Illuminate\Encryption\EncryptionServiceProvider',
91
+        'Illuminate\Filesystem\FilesystemServiceProvider',
92
+        'Illuminate\Hashing\HashServiceProvider',
93
+        'Illuminate\Html\HtmlServiceProvider',
94
+        'Illuminate\Log\LogServiceProvider',
95
+        'Illuminate\Mail\MailServiceProvider',
96
+        'Illuminate\Database\MigrationServiceProvider',
97
+        'Illuminate\Pagination\PaginationServiceProvider',
98
+        'Illuminate\Queue\QueueServiceProvider',
99
+        'Illuminate\Remote\RemoteServiceProvider',
100
+        'Illuminate\Auth\Reminders\ReminderServiceProvider',
101
+        'Illuminate\Database\SeedServiceProvider',
102
+        'Illuminate\Session\SessionServiceProvider',
103
+        'Illuminate\Translation\TranslationServiceProvider',
104
+        'Illuminate\Validation\ValidationServiceProvider',
105
+        'Illuminate\View\ViewServiceProvider',
106
+        'Illuminate\Workbench\WorkbenchServiceProvider',
107
+        'Illuminate\Redis\RedisServiceProvider',
108
+        'services\utils\UtilsProvider',
109
+        'repositories\RepositoriesProvider',
110
+        'services\oauth2\OAuth2ServiceProvider',
111
+        'services\openid\OpenIdProvider',
112
+        'auth\AuthenticationServiceProvider',
113
+        'services\ServicesProvider',
114
+        'strategies\StrategyProvider',
115
+        'oauth2\OAuth2ServiceProvider',
116
+        'openid\OpenIdServiceProvider',
117
+        'Greggilbert\Recaptcha\RecaptchaServiceProvider',
118
+        'services\oauth2\CORS\CORSProvider',
119
+    ),
120
+
121
+    /*
122
+    |--------------------------------------------------------------------------
123
+    | Service Provider Manifest
124
+    |--------------------------------------------------------------------------
125
+    |
126
+    | The service provider manifest is used by Laravel to lazy load service
127
+    | providers which are not needed for each request, as well to keep a
128
+    | list of all of the services. Here, you may set its storage spot.
129
+    |
130
+    */
131
+
132
+    'manifest' => storage_path().'/meta',
133
+
134
+    /*
135
+    |--------------------------------------------------------------------------
136
+    | Class Aliases
137
+    |--------------------------------------------------------------------------
138
+    |
139
+    | This array of class aliases will be registered when this application
140
+    | is started. However, feel free to register as many as you wish as
141
+    | the aliases are "lazy" loaded so they don't hinder performance.
142
+    |
143
+    */
144
+
145
+    'aliases' => array(
146
+
147
+        'App'             => 'Illuminate\Support\Facades\App',
148
+        'Artisan'         => 'Illuminate\Support\Facades\Artisan',
149
+        'Auth'            => 'Illuminate\Support\Facades\Auth',
150
+        'Blade'           => 'Illuminate\Support\Facades\Blade',
151
+        'Cache'           => 'Illuminate\Support\Facades\Cache',
152
+        'ClassLoader'     => 'Illuminate\Support\ClassLoader',
153
+        'Config'          => 'Illuminate\Support\Facades\Config',
154
+        'Controller'      => 'Illuminate\Routing\Controller',
155
+        'Cookie'          => 'Illuminate\Support\Facades\Cookie',
156
+        'Crypt'           => 'Illuminate\Support\Facades\Crypt',
157
+        'DB'              => 'Illuminate\Support\Facades\DB',
158
+        'Eloquent'        => 'Illuminate\Database\Eloquent\Model',
159
+        'Event'           => 'Illuminate\Support\Facades\Event',
160
+        'File'            => 'Illuminate\Support\Facades\File',
161
+        'Form'            => 'Illuminate\Support\Facades\Form',
162
+        'Hash'            => 'Illuminate\Support\Facades\Hash',
163
+        'HTML'            => 'Illuminate\Support\Facades\HTML',
164
+        'Input'           => 'Illuminate\Support\Facades\Input',
165
+        'Lang'            => 'Illuminate\Support\Facades\Lang',
166
+        'Log'             => 'Illuminate\Support\Facades\Log',
167
+        'Mail'            => 'Illuminate\Support\Facades\Mail',
168
+        'Paginator'       => 'Illuminate\Support\Facades\Paginator',
169
+        'Password'        => 'Illuminate\Support\Facades\Password',
170
+        'Queue'           => 'Illuminate\Support\Facades\Queue',
171
+        'Redirect'        => 'Illuminate\Support\Facades\Redirect',
172
+        'Request'         => 'Illuminate\Support\Facades\Request',
173
+        'Response'        => 'Illuminate\Support\Facades\Response',
174
+        'Route'           => 'Illuminate\Support\Facades\Route',
175
+        'Schema'          => 'Illuminate\Support\Facades\Schema',
176
+        'Seeder'          => 'Illuminate\Database\Seeder',
177
+        'Session'         => 'Illuminate\Support\Facades\Session',
178
+        'SSH'             => 'Illuminate\Support\Facades\SSH',
179
+        'Str'             => 'Illuminate\Support\Str',
180
+        'URL'             => 'Illuminate\Support\Facades\URL',
181
+        'Validator'       => 'Illuminate\Support\Facades\Validator',
182
+        'View'            => 'Illuminate\Support\Facades\View',
183
+        'RedisLV4'        => 'Illuminate\Support\Facades\Redis',
184
+     ),
185
+
186
+);

Loading…
Cancel
Save