11<?php if (!defined ('APPLICATION ' )) exit ();
22
33if (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- // Fix: Add the 'topcoder' role type in Role Table. It should be removed after upgrading existing DB.
101- // The Topcoder plugin's setup method will upgrade DB during Vanilla installation
102- $ SQL ->query ('alter table GDN_Role modify Type enum( \'topcoder \', \'guest \', \'unconfirmed \', \'applicant \', \'member \', \'moderator \', \'administrator \') ' );
103-
4+ // Only for update in future
1045}
0 commit comments