Skip to content

TCA-517 Port 443 Default Config -> develop #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ You can verify the versions of `nvm`, `node`, and `npm` using the commands below
| `% nvm current` | v15.15.0 |


>**NOTE:** The `yarn start` command requires the `NVM_DIR` env variable is set.

```zsh
export NVM_DIR=~/.nvm
```

If you don't have this set globally, you can create your own [personal config](#personal-config) to define your local nvm dir.

### Hosting
You will need to add the following line to your hosts file. The hosts file is normally located at `/etc/hosts` (Mac). Do not overwrite the existing localhost entry also pointing to 127.0.0.1.

Expand All @@ -81,9 +89,9 @@ You will need to add the following line to your hosts file. The hosts file is no

>% yarn start

3. Go to https://local.topcoder-dev.com:3000
3. Go to https://local.topcoder-dev.com

>**NOTE**: The default port is 3000, but you can override it in your [personal config](#personal-config).
>**NOTE**: The site must run on port 443 in order for auth0 to work and for the site to load properly. Mac users will need to run the app with elevated permissions.

### Local SSL

Expand All @@ -102,7 +110,7 @@ Otherwise, you will need to override the exception each time you load the site.
### Personal Config

1. Add [hostname] to [`/src-ts/config/environments/app-host-environment.type.ts`](/src-ts/config/environments/app-host-environment.type.ts)
2. Copy an existing config from [`/src-ts/config/environments/environment.*.config.ts`](/src-ts/config/environments/environment.bsouza.config.ts)
2. Copy an existing config from [`/src-ts/config/environments/environment.*.config.ts`](/src-ts/config/environments/environment.brooke.config.ts)
3. Rename new config `environment.[hostname].config.ts`
4. Rename config variable to `EnvironmentConfig[HostName]`
5. Set the `ENV` variable to `[hostname]`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"dev": "yarn react-app-rewired start",
"start": "sh start-ssl.sh",
"start:bsouza": "sudo sh start-ssl-bsouza.sh",
"start:brooke": "sudo sh start-ssl-brooke.sh",
"build": "yarn react-app-rewired build",
"lint": "tslint 'src-ts/**/*.{ts,tsx}' && eslint 'src*/**/*.{js,jsx,ts,tsx}'",
"lint:fix": "tslint 'src-ts/**/*.{ts,tsx}' --fix && eslint 'src*/**/*.{js,jsx,ts,tsx}' --fix",
Expand Down
2 changes: 1 addition & 1 deletion src-ts/config/environments/app-host-environment.type.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type AppHostEnvironmentType = 'bsouza' | 'default' | 'dev' | 'prod'
export type AppHostEnvironmentType = 'brooke' | 'default' | 'dev' | 'prod'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EnvironmentConfigModel } from './environment-config.model'
import { EnvironmentConfigDefault } from './environment.default.config'

export const EnvironmentConfigBsouza: EnvironmentConfigModel = {
export const EnvironmentConfigBrooke: EnvironmentConfigModel = {
...EnvironmentConfigDefault,
ENV: 'bsouza',
ENV: 'brooke',
}
6 changes: 3 additions & 3 deletions src-ts/config/environments/environment.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AppHostEnvironmentType } from './app-host-environment.type'
import { EnvironmentConfigModel } from './environment-config.model'
import { EnvironmentConfigBsouza } from './environment.bsouza.config'
import { EnvironmentConfigBrooke } from './environment.brooke.config'
import { EnvironmentConfigDefault } from './environment.default.config'
import { EnvironmentConfigDev } from './environment.dev.config'
import { EnvironmentConfigProd } from './environment.prod.config'
Expand All @@ -12,8 +12,8 @@ function getEnvironmentConfig(): EnvironmentConfigModel {

switch (environment) {

case 'bsouza':
return EnvironmentConfigBsouza
case 'brooke':
return EnvironmentConfigBrooke

case 'default':
return EnvironmentConfigDefault
Expand Down
2 changes: 1 addition & 1 deletion src-ts/tools/learn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Learn tool has its own configuration defined in the [/src-ts/tools/learn/lea

The default configuration expects both the FCC Client and API to be running locally. In most cases, developers probably won't want to run both locally.

>**See** [/src-ts/tools/learn/learn-config/learn.bsouza.config.ts](/src-ts/tools/learn/learn-config/learn.bsouza.config.ts) for an example of how to override the FCC source URLs to use the dev env config.
>**See** [/src-ts/tools/learn/learn-config/learn.brooke.config.ts](/src-ts/tools/learn/learn-config/learn.brooke.config.ts) for an example of how to override the FCC source URLs to use the dev env config.

>**See** the [main app README](/README.md#personal-config) for instructions for creating a personal config.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { LearnConfigModel } from './learn-config.model'
import { LearnConfigDefault } from './learn.default.config'
import { LearnConfigDev } from './learn.dev.config'

export const LearnConfigBsouza: LearnConfigModel = {
export const LearnConfigBrooke: LearnConfigModel = {
...LearnConfigDev,
// API: LearnConfigDefault.API,
CLIENT: LearnConfigDefault.CLIENT,
Expand Down
6 changes: 3 additions & 3 deletions src-ts/tools/learn/learn-config/learn.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EnvironmentConfig } from '../../../config'

import { LearnConfigModel } from './learn-config.model'
import { LearnConfigBsouza } from './learn.bsouza.config'
import { LearnConfigBrooke } from './learn.brooke.config'
import { LearnConfigDefault } from './learn.default.config'
import { LearnConfigDev } from './learn.dev.config'
import { LearnConfigProd } from './learn.prod.config'
Expand All @@ -10,8 +10,8 @@ function getConfig(): LearnConfigModel {

switch (EnvironmentConfig.ENV) {

case 'bsouza':
return LearnConfigBsouza
case 'brooke':
return LearnConfigBrooke

case 'dev':
return LearnConfigDev
Expand Down
3 changes: 3 additions & 0 deletions start-ssl-brooke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export REACT_APP_HOST_ENV=brooke
export NVM_DIR=~/.nvm
sh ./start-ssl.sh
4 changes: 0 additions & 4 deletions start-ssl-bsouza.sh

This file was deleted.

1 change: 1 addition & 0 deletions start-ssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export HTTPS=true
export SSL_CRT_FILE=ssl/server.crt
export SSL_KEY_FILE=ssl/server.key
export HOST=local.topcoder-dev.com
export PORT=443
source $NVM_DIR/nvm.sh
nvm use
yarn react-app-rewired start