Skip to content

Commit

Permalink
chore: remove https in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vieiralucas committed Sep 16, 2024
1 parent 4c89b1a commit 80933df
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 31 deletions.
11 changes: 0 additions & 11 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,6 @@ After submitting a pull request, please make sure to sign [our CLA (Contributor

Below are some common errors and their possible fixes. Please feel free to open an issue if none of these suggested fixes work.

<details>
<summary>`ERR_CERT_AUTHORITY_INVALID` in the browser's console</summary>

This error happens when content is not loaded and the browser's console displays the `ERR_CERT_AUTHORITY_INVALID` error message.

It usually happens because you're using a self-signed certificate for development and your browser probably does not allow those yet.

If you're using Chrome, open a new tab and access `chrome://flags/#allow-insecure-localhost`. Then enable this flag. If you're using another browser, please look for similar options if needed.

</details>

<details>
<summary>Jupyter permissions issue on Linux/WSL</summary>

Expand Down
13 changes: 1 addition & 12 deletions apps/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import https from 'https'
import fs from 'fs'
import qs from 'querystring'
import bodyParser from 'body-parser'
import express, { NextFunction, Request, Response } from 'express'
Expand Down Expand Up @@ -51,16 +49,7 @@ async function main() {
db.init(dbUrl)

const app = express()
const server =
config().NODE_ENV === 'development'
? https.createServer(
{
key: fs.readFileSync('../web/certificates/localhost-key.pem'),
cert: fs.readFileSync('../web/certificates/localhost.pem'),
},
app
)
: http.createServer(app)
const server = http.createServer(app)

let shutdownFunctions: (() => Promise<void> | void)[] = []
const socketServer = createSocketServer(server)
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.14",
"private": true,
"scripts": {
"dev": "next dev -p 4000 --experimental-https && local-ssl-proxy --key",
"dev": "next dev -p 4000",
"build": "next build",
"start": "node dist/server.js",
"lint": "next lint",
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
services:
postgres:
container_name: briefer_postgres_dev
image: postgres
ports:
- '5432:5432'
Expand Down Expand Up @@ -30,7 +29,6 @@ services:
condition: service_healthy

jupyter_server:
container_name: briefer_jupyter_server_dev
labels:
'cloud.briefer.jupyter-container': 'true'
build:
Expand Down
10 changes: 5 additions & 5 deletions start-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -e
if [ ! -f ./apps/api/.env ]; then
echo "NODE_ENV=development" > ./apps/api/.env
echo "LOG_LEVEL=debug" >> ./apps/api/.env
echo "API_URL='https://localhost:8080'" >> ./apps/api/.env
echo "FRONTEND_URL='https://localhost:4000'" >> ./apps/api/.env
echo "API_URL='http://localhost:8080'" >> ./apps/api/.env
echo "FRONTEND_URL='http://localhost:4000'" >> ./apps/api/.env
echo "TLD=localhost" >> ./apps/api/.env
echo "LOGIN_JWT_SECRET=$(openssl rand -hex 24)" >> ./apps/api/.env
echo "AUTH_JWT_SECRET=$(openssl rand -hex 24)" >> ./apps/api/.env
Expand Down Expand Up @@ -34,9 +34,9 @@ fi
# if there is no .env file in WEB, create one
if [ ! -f ./apps/web/.env ]; then
echo "NODE_ENV=development" > ./apps/web/.env
echo "NEXT_PUBLIC_API_URL='https://localhost:8080'" >> ./apps/web/.env
echo "NEXT_PUBLIC_API_WS_URL='wss://localhost:8080'" >> ./apps/web/.env
echo "NEXT_PUBLIC_PUBLIC_URL='https://localhost:4000'" >> ./apps/web/.env
echo "NEXT_PUBLIC_API_URL='http://localhost:8080'" >> ./apps/web/.env
echo "NEXT_PUBLIC_API_WS_URL='ws://localhost:8080'" >> ./apps/web/.env
echo "NEXT_PUBLIC_PUBLIC_URL='http://localhost:4000'" >> ./apps/web/.env

echo "Generated a new ./apps/eb/.env file with default values"
fi
Expand Down

0 comments on commit 80933df

Please sign in to comment.