Skip to content

Commit ab43862

Browse files
author
James Cori
committed
Merge remote-tracking branch 'origin/master'
2 parents b9e99b4 + 9f8004b commit ab43862

File tree

9 files changed

+5640
-145
lines changed

9 files changed

+5640
-145
lines changed

config/vanilla/bootstrap.early.php

Lines changed: 1 addition & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,5 @@
11
<?php if (!defined('APPLICATION')) exit();
22

33
if (c('Garden.Installed')) {
4-
$Database = Gdn::database();
5-
$SQL = $Database->sql();
6-
7-
// Cache Settings
8-
saveToConfig('Cache.Enabled', getenv('CACHE_ENABLED'), true);
9-
saveToConfig('Cache.Method', getenv('CACHE_METHOD'), 'dirtycache');
10-
saveToConfig('memcached.Store', getenv('MEMCACHED_SERVER'), 'localhost:11211');
11-
12-
saveToConfig('Garden.Email.SupportName', getenv('MAIL_FROM_NAME') );
13-
saveToConfig('Garden.Email.SupportAddress', getenv('MAIL_FROM_ADDRESS'));
14-
saveToConfig('Garden.Email.UseSmtp', getenv('MAIL_USE_SMTP'));
15-
saveToConfig('Garden.Email.SmtpHost', getenv('MAIL_SMTP_HOSTNAME'));
16-
saveToConfig('Garden.Email.SmtpUser', getenv('MAIL_SMTP_USERNAME'));
17-
saveToConfig('Garden.Email.SmtpPassword', getenv('MAIL_SMTP_PASSWORD'));
18-
saveToConfig('Garden.Email.SmtpPort', getenv('MAIL_SMTP_PORT'));
19-
saveToConfig('Garden.Email.SmtpSecurity', getenv('MAIL_SMTP_SECURITY'));
20-
21-
// Appearance
22-
saveToConfig('Garden.Theme', 'topcoder-theme', false);
23-
saveToConfig('Garden.MobileTheme', 'topcoder-theme', false);
24-
saveToConfig('Feature.NewFlyouts.Enabled', true);
25-
26-
// Feature
27-
saveToConfig('Garden.EditContentTimeout', -1, false);
28-
29-
// Profile settings
30-
saveToConfig('Garden.Profile.EditPhotos', false);
31-
32-
// Add settings for the Topcoder plugin
33-
saveToConfig('Plugins.Topcoder.BaseApiURL', getenv('TOPCODER_PLUGIN_BASE_API_URL'),false);
34-
saveToConfig('Plugins.Topcoder.MemberApiURI', getenv('TOPCODER_PLUGIN_MEMBER_API_URI'),false);
35-
saveToConfig('Plugins.Topcoder.RoleApiURI', getenv('TOPCODER_PLUGIN_ROLE_API_URI'),false);
36-
saveToConfig('Plugins.Topcoder.ResourceRolesApiURI', '/v5/resource-roles', false);
37-
saveToConfig('Plugins.Topcoder.ResourcesApiURI', '/v5/resources', false);
38-
saveToConfig('Plugins.Topcoder.MemberProfileURL', getenv('TOPCODER_PLUGIN_MEMBER_PROFILE_URL'), false); // prod:
39-
saveToConfig('Plugins.Topcoder.UseTopcoderAuthToken', getenv('TOPCODER_PLUGIN_USE_AUTH_TOKEN'), false);
40-
41-
saveToConfig('Plugins.Topcoder.ValidIssuers', str_replace(["[", "]", "\\", "\"", " "], '', getenv('VALID_ISSUERS')));
42-
43-
//Add settings for Topcoder M2M Auth0
44-
saveToConfig('Plugins.Topcoder.M2M.Auth0Audience', getenv('AUTH0_AUDIENCE'));
45-
saveToConfig('Plugins.Topcoder.M2M.Auth0ClientId', getenv('AUTH0_CLIENT_ID'));
46-
saveToConfig('Plugins.Topcoder.M2M.Auth0ClientSecret', getenv('AUTH0_CLIENT_SECRET'));
47-
saveToConfig('Plugins.Topcoder.M2M.Auth0Url', getenv('AUTH0_URL'));
48-
saveToConfig('Plugins.Topcoder.M2M.Auth0ProxyServerUrl', getenv('AUTH0_PROXY_SERVER_URL'));
49-
50-
//Add settings for Topcoder SSO Auth0
51-
saveToConfig('Plugins.Topcoder.SSO.Auth0Domain', getenv('TOPCODER_PLUGIN_SSO_AUTH0DOMAIN'));
52-
saveToConfig('Plugins.Topcoder.SSO.AuthorizationURI', '/v3/authorizations/1');
53-
saveToConfig('Plugins.Topcoder.SSO.CookieName', 'v3jwt',false);
54-
saveToConfig('Plugins.Topcoder.SSO.TopcoderRS256.ID', getenv('TOPCODER_PLUGIN_SSO_TOPCODER_RS256_ID'), false);
55-
saveToConfig('Plugins.Topcoder.SSO.TopcoderHS256.ID', getenv('TOPCODER_PLUGIN_SSO_TOPCODER_HS256_ID'), false);
56-
57-
saveToConfig('Plugins.Topcoder.SSO.TopcoderHS256.Secret', getenv('TOPCODER_HS256_SECRET') );
58-
saveToConfig('Plugins.Topcoder.SSO.TopcoderRS256.UsernameClaim', 'nickname',false);
59-
saveToConfig('Plugins.Topcoder.SSO.TopcoderHS256.UsernameClaim', 'handle',false);
60-
$topcoderSSOAuth0Url = getenv('TOPCODER_PLUGIN_SSO_REFRESHTOKENURL');
61-
saveToConfig('Plugins.Topcoder.SSO.RefreshTokenURL', $topcoderSSOAuth0Url,false);
62-
$signInUrl = getenv('TOPCODER_PLUGIN_SIGNIN_URL');
63-
$signOutUrl = getenv('TOPCODER_PLUGIN_SIGNOUT_URL');
64-
if($signInUrl === false) {
65-
$signInUrl =$topcoderSSOAuth0Url.'?retUrl='.urlencode('https://'.$_SERVER['SERVER_NAME'].'/');
66-
}
67-
if($signOutUrl === false) {
68-
$signOutUrl =$topcoderSSOAuth0Url.'?logout=true&retUrl='.urlencode('https://'.$_SERVER['SERVER_NAME'].'/');
69-
}
70-
saveToConfig('Plugins.Topcoder.AuthenticationProvider.SignInUrl', $signInUrl,false);
71-
saveToConfig('Plugins.Topcoder.AuthenticationProvider.SignOutUrl', $signOutUrl,false);
72-
saveToConfig('Plugins.Topcoder.AuthenticationProvider.RegisterUrl', getenv('TOPCODER_PLUGIN_AUTHENTICATIONPROVIDER_REGISTERURL'),false);
73-
74-
// Filestack
75-
saveToConfig('Plugins.Filestack.ApiKey', getenv('FILESTACK_API_KEY'),false);
76-
77-
// SumoLogic
78-
saveToConfig('Plugins.Sumologic.HttpSourceURL', '',false);
79-
saveToConfig('Plugins.Sumologic.BatchSize', '10',false);
80-
81-
// Add settings for the Editor plugin
82-
if(c('Plugins.editor.ForceWysiwyg') === false) {
83-
saveToConfig('Plugins.editor.ForceWysiwyg', false);
84-
}
85-
86-
// Add settings for the Syntax Prettifier plugin
87-
if(c('Plugins.GooglePrettify.LineNumbers') === false) {
88-
saveToConfig('Plugins.GooglePrettify.LineNumbers', '');
89-
saveToConfig('Plugins.GooglePrettify.NoCssFile', '');
90-
saveToConfig('Plugins.GooglePrettify.UseTabby', '');
91-
saveToConfig('Plugins.GooglePrettify.Language', '');
92-
}
93-
94-
// Add settings for the Recaptcha plugin
95-
if(c('Recaptcha.PrivateKey') === false) {
96-
saveToConfig('Recaptcha.PrivateKey', getenv('RECAPTCHA_PLUGIN_PRIVATE_KEY'), false);
97-
saveToConfig('Recaptcha.PublicKey', getenv('RECAPTCHA_PLUGIN_PUBLIC_KEY'), false);
98-
}
99-
100-
101-
// Fix: OAuth 2 SSO should be inactive and not by default. It should be removed later.
102-
if ($SQL->getWhere('UserAuthenticationProvider', ['AuthenticationKey' => 'oauth2'])->numRows() > 0) {
103-
$SQL->update('UserAuthenticationProvider')
104-
->set('Active', 0)
105-
->set('IsDefault',0)
106-
->where('AuthenticationKey' , 'oauth2')->put();
107-
}
108-
109-
// Add Topcoder User Authentication Provider.
110-
// SignInUrl/SignOutUrl should be set in Topcoder plugin's setup; otherwise they couldn't be updated in DB
111-
if ($SQL->getWhere('UserAuthenticationProvider', ['AuthenticationKey' => 'topcoder'])->numRows() == 0) {
112-
$SQL->insert('UserAuthenticationProvider', [
113-
'AuthenticationKey' => 'topcoder',
114-
'AuthenticationSchemeAlias' => 'topcoder',
115-
'Name' => 'topcoder',
116-
'Active' => 1,
117-
'IsDefault' => 1
118-
]);
119-
}
120-
121-
// Fix: Add the 'topcoder' role type in Role Table. It should be removed after upgrading existing DB.
122-
// The Topcoder plugin's setup method will upgrade DB during Vanilla installation
123-
$SQL->query('alter table GDN_Role modify Type enum(\'topcoder\', \'guest\', \'unconfirmed\', \'applicant\', \'member\', \'moderator\', \'administrator\')');
124-
4+
// Only for update in future
1255
}

config/vanilla/config.php

Lines changed: 73 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
$Configuration['Garden']['Installed'] = true;
44

5-
$Configuration['Garden']['SignIn']['Popup'] = false; // Should the sign-in link pop up or go to it's own page
6-
7-
// Conversations
8-
$Configuration['Conversations']['Version'] = '3.0';
9-
$Configuration['Conversations']['Moderation']['Allow'] = true;
10-
11-
// Database
125
$Configuration['Database']['Name'] = getenv('MYSQL_DATABASE');
136
$Configuration['Database']['Host'] = getenv('MYSQL_HOST');
147
$Configuration['Database']['User'] = getenv('MYSQL_ROOT_USER');
158
$Configuration['Database']['Password'] = getenv('MYSQL_ROOT_PASSWORD');
169

10+
// Cache
11+
$Configuration['Cache']['Enabled'] = getenv('CACHE_ENABLED');
12+
$Configuration['Cache']['Method'] = getenv('CACHE_METHOD');
13+
14+
// Conversations
15+
$Configuration['Conversations']['Version'] = '3.0';
16+
$Configuration['Conversations']['Moderation']['Allow'] = true;
17+
1718
// EnabledApplications
1819
$Configuration['EnabledApplications']['Conversations'] = 'conversations';
1920
$Configuration['EnabledApplications']['Vanilla'] = 'vanilla';
@@ -33,35 +34,39 @@
3334
$Configuration['EnabledPlugins']['Groups'] = true;
3435
$Configuration['EnabledPlugins']['Filestack'] = true;
3536
$Configuration['EnabledPlugins']['Sumologic'] = true;
36-
$Configuration['EnabledPlugins']['ReplyTo'] = true; //Uncomment it after upgrading DB
37-
38-
// Debug
39-
$Configuration['Debug'] = FALSE;
40-
$Configuration['Vanilla']['SSO']['Debug'] = TRUE;
41-
42-
// Email contents
43-
$Configuration['Vanilla']['Activity']['ShowDiscussionBody'] = true;
37+
$Configuration['EnabledPlugins']['ReplyTo'] = true;
4438

4539
// Feature
4640
$Configuration['Feature']['NewFlyouts']['Enabled'] = true;
47-
$Configuration['Vanilla']['EnableCategoryFollowing'] = true;
48-
$Configuration['Garden']['EditContentTimeout'] = -1;
4941

5042
// Garden
43+
$Configuration['Garden']['SignIn']['Popup'] = false;
44+
$Configuration['Garden']['EditContentTimeout'] = -1;
5145
$Configuration['Garden']['Title'] = 'Vanilla';
5246
$Configuration['Garden']['Cookie']['Salt'] = 'rLpGSLgZD1AGdJ4n';
5347
$Configuration['Garden']['Cookie']['Domain'] = '';
5448
$Configuration['Garden']['Registration']['ConfirmEmail'] = true;
55-
$Configuration['Garden']['Email']['SupportName'] = 'Vanilla';
49+
$Configuration['Garden']['Email']['SupportName'] = getenv('MAIL_FROM_NAME');
5650
$Configuration['Garden']['Email']['Format'] = 'text';
57-
$Configuration['Garden']['SystemUserID'] = '1';
58-
$Configuration['Garden']['UpdateToken'] = 'c3988cd76f721f1a03d2c347ab6655609a548425';
51+
$Configuration['Garden']['Email']['SupportAddress'] = getenv('MAIL_FROM_ADDRESS');
52+
$Configuration['Garden']['Email']['UseSmtp'] = getenv('MAIL_USE_SMTP');
53+
$Configuration['Garden']['Email']['SmtpHost'] = getenv('MAIL_SMTP_HOSTNAME');
54+
$Configuration['Garden']['Email']['SmtpUser'] = getenv('MAIL_SMTP_USERNAME');
55+
$Configuration['Garden']['Email']['SmtpPassword'] = getenv('MAIL_SMTP_PASSWORD');
56+
$Configuration['Garden']['Email']['SmtpPort'] = getenv('MAIL_SMTP_PORT');
57+
$Configuration['Garden']['Email']['SmtpSecurity'] = getenv('MAIL_SMTP_SECURITY');
58+
$Configuration['Garden']['UpdateToken'] = '105e786dc643fd20143d3c137b593af168560c13';
5959
$Configuration['Garden']['InputFormatter'] = 'Rich';
6060
$Configuration['Garden']['Version'] = 'Undefined';
6161
$Configuration['Garden']['CanProcessImages'] = true;
6262
$Configuration['Garden']['Theme'] = 'topcoder-theme';
6363
$Configuration['Garden']['MobileTheme'] = 'topcoder-theme';
6464
$Configuration['Garden']['Profile']['EditPhotos'] = false;
65+
$Configuration['Garden']['SystemUserID'] = '1';
66+
$Configuration['Garden']['MobileInputFormatter'] = 'Rich';
67+
$Configuration['Garden']['AllowFileUploads'] = true;
68+
$Configuration['Garden']['EditContentTimeout'] = -1;
69+
$Configuration['Garden']['Profile']['EditPhotos'] = false;
6570

6671
// Plugins
6772
$Configuration['Plugins']['editor']['ForceWysiwyg'] = false;
@@ -72,6 +77,43 @@
7277
$Configuration['Plugins']['GettingStarted']['Dashboard'] = '1';
7378
$Configuration['Plugins']['GettingStarted']['Plugins'] = '1';
7479

80+
81+
$Configuration['Plugins']['Topcoder']['BaseApiURL'] = getenv('TOPCODER_PLUGIN_BASE_API_URL');
82+
$Configuration['Plugins']['Topcoder']['MemberApiURI'] = getenv('TOPCODER_PLUGIN_MEMBER_API_URI');
83+
$Configuration['Plugins']['Topcoder']['RoleApiURI'] = getenv('TOPCODER_PLUGIN_ROLE_API_URI');
84+
$Configuration['Plugins']['Topcoder']['ResourceRolesApiURI'] = '/v5/resource-roles';
85+
$Configuration['Plugins']['Topcoder']['ResourcesApiURI'] = '/v5/resources';
86+
$Configuration['Plugins']['Topcoder']['MemberProfileURL'] = getenv('TOPCODER_PLUGIN_MEMBER_PROFILE_URL');
87+
$Configuration['Plugins']['Topcoder']['UseTopcoderAuthToken'] = getenv('TOPCODER_PLUGIN_USE_AUTH_TOKEN');
88+
89+
90+
$Configuration['Plugins']['Topcoder']['ValidIssuers'] = str_replace(["[", "]", "\\", "\"", " "], '', getenv('VALID_ISSUERS'));
91+
$Configuration['Plugins']['Topcoder']['M2M']['Auth0Audience'] = getenv('AUTH0_AUDIENCE');
92+
$Configuration['Plugins']['Topcoder']['M2M']['Auth0ClientId'] = getenv('AUTH0_CLIENT_ID');
93+
$Configuration['Plugins']['Topcoder']['M2M']['Auth0ClientSecret'] = getenv('AUTH0_CLIENT_SECRET');
94+
$Configuration['Plugins']['Topcoder']['M2M']['Auth0Url'] = getenv('AUTH0_URL');
95+
$Configuration['Plugins']['Topcoder']['M2M']['Auth0ProxyServerUrl'] = getenv('AUTH0_PROXY_SERVER_URL');
96+
$Configuration['Plugins']['Topcoder']['SSO']['Auth0Domain'] = getenv('TOPCODER_PLUGIN_SSO_AUTH0DOMAIN');
97+
$Configuration['Plugins']['Topcoder']['SSO']['AuthorizationURI'] = '/v3/authorizations/1';
98+
$Configuration['Plugins']['Topcoder']['SSO']['CookieName'] = 'v3jwt';
99+
$Configuration['Plugins']['Topcoder']['SSO']['TopcoderRS256']['ID'] = getenv('TOPCODER_PLUGIN_SSO_TOPCODER_RS256_ID');
100+
$Configuration['Plugins']['Topcoder']['SSO']['TopcoderHS256']['ID'] = getenv('TOPCODER_PLUGIN_SSO_TOPCODER_HS256_ID');
101+
$Configuration['Plugins']['Topcoder']['SSO']['TopcoderHS256']['Secret'] = getenv('TOPCODER_HS256_SECRET');
102+
$Configuration['Plugins']['Topcoder']['SSO']['TopcoderRS256']['UsernameClaim'] = 'nickname';
103+
$Configuration['Plugins']['Topcoder']['SSO']['TopcoderHS256']['UsernameClaim'] = 'handle';
104+
$Configuration['Plugins']['Topcoder']['SSO']['RefreshTokenURL' ] = getenv('TOPCODER_PLUGIN_SSO_REFRESHTOKENURL');
105+
106+
// Filestack
107+
$Configuration['Plugins']['Filestack']['ApiKey'] = getenv('FILESTACK_API_KEY');
108+
109+
// SumoLogic
110+
$Configuration['Plugins']['Sumologic']['HttpSourceURL'] = '';
111+
$Configuration['Plugins']['Sumologic']['BatchSize'] = 10;
112+
113+
114+
// RichEditor
115+
$Configuration['RichEditor']['Quote']['Enable'] = true;
116+
75117
// Routes
76118
$Configuration['Routes']['YXBwbGUtdG91Y2gtaWNvbi5wbmc='] = array (
77119
0 => 'utility/showtouchicon',
@@ -90,8 +132,18 @@
90132
1 => 'Internal',
91133
);
92134
$Configuration['Routes']['DefaultController'] = 'discussions';
135+
$Configuration['Routes']['XmZpbGVzdGFjaygvLiopPyQ='] = array (
136+
0 => 'vanilla/filestack$1',
137+
1 => 'Internal',
138+
);
93139

94140
// Vanilla
141+
$Configuration['Vanilla']['SSO']['Debug'] = true;
142+
$Configuration['Vanilla']['Activity']['ShowDiscussionBody'] = true;
143+
$Configuration['Vanilla']['EnableCategoryFollowing'] = true;
95144
$Configuration['Vanilla']['Version'] = '3.0';
96145

97-
// Last edited by admin (172.26.0.1) 2020-09-03 13:16:33
146+
// memcached
147+
$Configuration['memcached']['Store'] = getenv('MEMCACHED_SERVER');
148+
149+
// Initial setup config

docker-compose.dev.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ services:
77
- 3306:3306
88
env_file:
99
- ./mysql.env
10+
security_opt:
11+
- seccomp:unconfined
1012
command: --default-authentication-plugin=mysql_native_password
1113
vanilla-forums:
1214
links:

0 commit comments

Comments
 (0)