Skip to content

Commit 44b8577

Browse files
committed
Added initial configuration in bootstrap
1 parent 6bf0c8b commit 44b8577

File tree

3 files changed

+63
-186
lines changed

3 files changed

+63
-186
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ RUN chmod -R 777 /vanillapp
1111

1212
# Clone the forum-plugins repository
1313
RUN git clone https://github.com/topcoder-platform/forums-plugins.git /tmp/forums-plugins
14-
RUN cp /tmp/forums-plugins/config/vanilla.config-defaults.php /vanillapp/conf/config-defaults.php
14+
# Copy all plugins to the Vanilla plugins folder
1515
RUN cp -r /tmp/forums-plugins/. /vanillapp/plugins
16+
# Copy Vanilla boostrap file
17+
COPY ./config/vanilla/bootstrap.early.php /vanillapp/conf/bootstrap.early.php

config/vanilla.config-defaults.php

Lines changed: 0 additions & 185 deletions
This file was deleted.

config/vanilla/bootstrap.early.php

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php if (!defined('APPLICATION')) exit();
2+
3+
$Database = Gdn::database();
4+
$SQL = $Database->sql();
5+
6+
// use Vanilla\Web\CacheControlMiddleware;
7+
8+
if (c('Garden.Installed')) {
9+
//Disable plugins
10+
saveToConfig('EnabledPlugins.stubcontent', false);
11+
12+
//Enable plugins
13+
saveToConfig('EnabledPlugins.Topcoder', true);
14+
saveToConfig('EnabledPlugins.rich-editor',true);
15+
saveToConfig('EnabledPlugins.recaptcha', true);
16+
saveToConfig('EnabledPlugins.editor', true);
17+
saveToConfig('EnabledPlugins.emojiextender', true);
18+
saveToConfig('EnabledPlugins.GooglePrettify', true);
19+
saveToConfig('EnabledPlugins.Quotes', true);
20+
saveToConfig('EnabledPlugins.swagger-ui', true);
21+
saveToConfig('EnabledPlugins.oauth2', true);
22+
23+
// Set Theme Options
24+
saveToConfig('Garden.ThemeOptions.Styles.Key', 'Coral');
25+
saveToConfig('Garden.ThemeOptions.Styles.Value', '%s_coral');
26+
saveToConfig('Garden.ThemeOptions.Options.panelToLeft',true);
27+
28+
// Add settings for the Topcoder plugin
29+
saveToConfig('Plugins.Topcoder.BaseApiURL', 'https://api.topcoder-dev.com');
30+
saveToConfig('Plugins.Topcoder.MemberApiURI', '/v3/members');
31+
saveToConfig('Plugins.Topcoder.MemberProfileURL', 'https://www.topcoder.com/members');
32+
33+
// Add settings for the Editor plugin
34+
saveToConfig('Plugins.editor.ForceWysiwyg', false);
35+
36+
// Add settings for the Syntax Prettifier plugin
37+
saveToConfig('Plugins.GooglePrettify.LineNumbers', '');
38+
saveToConfig('Plugins.GooglePrettify.NoCssFile', '');
39+
saveToConfig('Plugins.GooglePrettify.UseTabby', '');
40+
saveToConfig('Plugins.GooglePrettify.Language','');
41+
42+
//Add settings for the OAuth 2 SSO plugin
43+
if ($SQL->getWhere('UserAuthenticationProvider', ['AuthenticationKey' => 'oauth2'])->numRows() == 0) {
44+
$SQL->insert('UserAuthenticationProvider', [
45+
'AuthenticationKey' => 'oauth2',
46+
'AuthenticationSchemeAlias' => 'oauth2',
47+
'Name' => 'oauth2',
48+
'AssociationSecret' => 'yvaegnvYhFhWUwL3s0nObhZz76ZVYE4qVms3z75ngm3ubHu1ZmwyKStML7N_i9nE',
49+
'RegisterUrl' => '',
50+
'SignInUrl' => 'https://topcoder-dev.auth0.com',
51+
'SignOutUrl' => '',
52+
'ProfileUrl' => 'https://topcoder-dev.auth0.com/userinfo',
53+
'Attributes' => '{"AssociationKey":"Q9iRXM0QzGRidhcUK8MSTXxBRrmvrjA4","AuthorizeUrl":"https://topcoder-dev.auth0.com/authorize","TokenUrl":"https://topcoder-dev.auth0.com/oauth/token","AcceptedScope":"openid email profile","ProfileKeyEmail":"email","ProfileKeyPhoto":"picture","ProfileKeyName":"nickname","ProfileKeyFullName":"name","ProfileKeyUniqueID":"sub","Prompt":"login","BearerToken":false,"BaseUrl":"https://topcoder-dev.auth0.com"}',
54+
'Active' => 1,
55+
'IsDefault' => 1
56+
]);
57+
}
58+
}
59+
60+

0 commit comments

Comments
 (0)