@@ -68,3 +68,108 @@ module.exports = {
6868 } ,
6969 } ,
7070} ;
71+
72+ const frontendConfigs = {
73+ "local" :{
74+ "JWT_V3_NAME" :"v3jwt" ,
75+ "JWT_V2_NAME" :"tcjwt" ,
76+ "COOKIES_SECURE" :false ,
77+ "TC_LOGIN_URL" : "https://accounts.topcoder-dev.com/member" ,
78+ "TC_USER_PROFILE_URL" : "http://api.topcoder-dev.com/v2/user/profile" ,
79+ "API_URL" : "https://127.0.0.1:8443" ,
80+ "ADMIN_TOOL_URL" : "http://localhost:8080/api/v2" ,
81+ "ACCOUNTS_CONNECTOR_URL" : "https://accounts.topcoder-dev.com/connector.html" ,
82+ "DIRECT_URL_BASE" : "https://www.topcoder-dev/direct/projectOverview?formData.projectId=" ,
83+ "OWNER_LOGIN_GITHUB_URL" :"/api/v1/github/owneruser/login" ,
84+ "OWNER_LOGIN_GITLAB_URL" :"/api/v1/gitlab/owneruser/login" ,
85+ "TOPCODER_URL" : "https://topcoder-dev.com" ,
86+ "GITHUB_TEAM_URL" : "https://github.com/orgs/" ,
87+ "GITLAB_GROUP_URL" : "https://gitlab.com/groups/"
88+
89+ } ,
90+ "heroku" :{
91+ "JWT_V3_NAME" :"v3jwt" ,
92+ "JWT_V2_NAME" :"tcjwt" ,
93+ "COOKIES_SECURE" :false ,
94+ "TC_LOGIN_URL" : "https://accounts.topcoder-dev.com/member" ,
95+ "TC_USER_PROFILE_URL" : "https://api.topcoder-dev.com/v2/user/profile" ,
96+ "API_URL" : "https://api.topcoder-dev.com" ,
97+ "ADMIN_TOOL_URL" : "https://api.topcoder-dev.com/v2" ,
98+ "ACCOUNTS_CONNECTOR_URL" : "https://accounts.topcoder-dev.com/connector.html" ,
99+ "DIRECT_URL_BASE" : "https://www.topcoder-dev.com/direct/projectOverview?formData.projectId=" ,
100+ "OWNER_LOGIN_GITHUB_URL" :"/api/v1/github/owneruser/login" ,
101+ "OWNER_LOGIN_GITLAB_URL" :"/api/v1/gitlab/owneruser/login" ,
102+ "TOPCODER_URL" : "https://topcoder-dev.com" ,
103+ "GITHUB_TEAM_URL" : "https://github.com/orgs/" ,
104+ "GITLAB_GROUP_URL" : "https://gitlab.com/groups/"
105+ } ,
106+ "dev" :{
107+ "JWT_V3_NAME" :"v3jwt" ,
108+ "JWT_V2_NAME" :"tcjwt" ,
109+ "COOKIES_SECURE" :false ,
110+ "TC_LOGIN_URL" : "https://accounts.topcoder-dev.com/member" ,
111+ "TC_USER_PROFILE_URL" : "https://api.topcoder-dev.com/v2/user/profile" ,
112+ "API_URL" : "https://api.topcoder-dev.com" ,
113+ "ADMIN_TOOL_URL" : "https://api.topcoder-dev.com/v2" ,
114+ "ACCOUNTS_CONNECTOR_URL" : "https://accounts.topcoder-dev.com/connector.html" ,
115+ "DIRECT_URL_BASE" : "https://www.topcoder-dev.com/direct/projectOverview?formData.projectId=" ,
116+ "OWNER_LOGIN_GITHUB_URL" :"/api/v1/github/owneruser/login" ,
117+ "OWNER_LOGIN_GITLAB_URL" :"/api/v1/gitlab/owneruser/login" ,
118+ "TOPCODER_URL" : "https://topcoder-dev.com" ,
119+ "GITHUB_TEAM_URL" : "https://github.com/orgs/" ,
120+ "GITLAB_GROUP_URL" : "https://gitlab.com/groups/"
121+ } ,
122+ "qa" :{
123+ "JWT_V3_NAME" :"v3jwt" ,
124+ "JWT_V2_NAME" :"tcjwt" ,
125+ "COOKIES_SECURE" :false ,
126+ "TC_LOGIN_URL" : "https://accounts.topcoder-dev.com/member" ,
127+ "TC_USER_PROFILE_URL" : "https://api.topcoder-dev.com/v2/user/profile" ,
128+ "API_URL" : "https://api.topcoder-qa.com" ,
129+ "ADMIN_TOOL_URL" : "https://api.topcoder-qa.com/v2" ,
130+ "ACCOUNTS_CONNECTOR_URL" : "https://accounts.topcoder-qa.com/connector.html" ,
131+ "DIRECT_URL_BASE" : "https://www.topcoder-dev.com/direct/projectOverview?formData.projectId=" ,
132+ "OWNER_LOGIN_GITHUB_URL" :"/api/v1/github/owneruser/login" ,
133+ "OWNER_LOGIN_GITLAB_URL" :"/api/v1/gitlab/owneruser/login" ,
134+ "TOPCODER_URL" : "https://topcoder-dev.com" ,
135+ "GITHUB_TEAM_URL" : "https://github.com/orgs/" ,
136+ "GITLAB_GROUP_URL" : "https://gitlab.com/groups/"
137+ } ,
138+ "prod" :{
139+ "JWT_V3_NAME" :"v3jwt" ,
140+ "JWT_V2_NAME" :"tcjwt" ,
141+ "COOKIES_SECURE" :false ,
142+ "TC_LOGIN_URL" : "https://accounts.topcoder.com/member" ,
143+ "TC_USER_PROFILE_URL" : "https://api.topcoder.com/v2/user/profile" ,
144+ "API_URL" : "https://api.topcoder.com" ,
145+ "ADMIN_TOOL_URL" : "https://api.topcoder.com/v2" ,
146+ "ACCOUNTS_CONNECTOR_URL" : "https://accounts.topcoder.com/connector.html" ,
147+ "DIRECT_URL_BASE" : "https://www.topcoder.com/direct/projectOverview?formData.projectId=" ,
148+ "OWNER_LOGIN_GITHUB_URL" :"/api/v1/github/owneruser/login" ,
149+ "OWNER_LOGIN_GITLAB_URL" :"/api/v1/gitlab/owneruser/login" ,
150+ "TOPCODER_URL" : "https://topcoder-dev.com" ,
151+ "GITHUB_TEAM_URL" : "https://github.com/orgs/" ,
152+ "GITLAB_GROUP_URL" : "https://gitlab.com/groups/"
153+ }
154+ } ;
155+
156+ const activeEnv = module . exports . TOPCODER_ENV ;
157+ module . exports . frontendConfigs = {
158+ helpLink : module . exports . HELP_LINK ,
159+ copilotRole : module . exports . COPILOT_ROLE ,
160+ administratorRoles : module . exports . ADMINISTRATOR_ROLES ,
161+ JWT_V3_NAME : process . env . JWT_V3_NAME || frontendConfigs [ activeEnv ] . JWT_V3_NAME ,
162+ JWT_V2_NAME : process . env . JWT_V2_NAME || frontendConfigs [ activeEnv ] . JWT_V2_NAME ,
163+ COOKIES_SECURE : process . env . COOKIES_SECURE || frontendConfigs [ activeEnv ] . COOKIES_SECURE ,
164+ TC_LOGIN_URL : process . env . TC_LOGIN_URL || frontendConfigs [ activeEnv ] . TC_LOGIN_URL ,
165+ TC_USER_PROFILE_URL : process . env . TC_USER_PROFILE_URL || frontendConfigs [ activeEnv ] . TC_USER_PROFILE_URL ,
166+ API_URL : process . env . API_URL || frontendConfigs [ activeEnv ] . API_URL ,
167+ ADMIN_TOOL_URL : process . env . ADMIN_TOOL_URL || frontendConfigs [ activeEnv ] . ADMIN_TOOL_URL ,
168+ ACCOUNTS_CONNECTOR_URL : process . env . ACCOUNTS_CONNECTOR_URL || frontendConfigs [ activeEnv ] . ACCOUNTS_CONNECTOR_URL ,
169+ DIRECT_URL_BASE : process . env . DIRECT_URL_BASE || frontendConfigs [ activeEnv ] . DIRECT_URL_BASE ,
170+ OWNER_LOGIN_GITHUB_URL : process . env . OWNER_LOGIN_GITHUB_URL || frontendConfigs [ activeEnv ] . OWNER_LOGIN_GITHUB_URL ,
171+ OWNER_LOGIN_GITLAB_URL : process . env . OWNER_LOGIN_GITLAB_URL || frontendConfigs [ activeEnv ] . OWNER_LOGIN_GITLAB_URL ,
172+ TOPCODER_URL : process . env . TOPCODER_URL || frontendConfigs [ activeEnv ] . TOPCODER_URL ,
173+ GITHUB_TEAM_URL : process . env . GITHUB_TEAM_URL || frontendConfigs [ activeEnv ] . GITHUB_TEAM_URL ,
174+ GITLAB_GROUP_URL : process . env . GITLAB_GROUP_URL || frontendConfigs [ activeEnv ] . GITLAB_GROUP_URL
175+ } ;
0 commit comments