Skip to content

Commit

Permalink
fix: change ssl proxy port
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed Sep 15, 2024
1 parent 6a6bbda commit 2280a71
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/pages/_app.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function MyApp({ Component, pageProps }: AppProps) {
loginWith: {
email: true,
oauth: {
domain: 'localhost:5052',
domain: defaults.oauthDomain,
scopes: ['openid'],
redirectSignIn: [location.origin],
redirectSignOut: [location.origin],
Expand Down
2 changes: 2 additions & 0 deletions server/api/public/defaults/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
DEFAULT_USER_POOL_ID,
REGION,
SECRET_KEY,
SSL_PORT,
} from 'service/envValues';
import { defineController } from './$relay';

Expand All @@ -16,6 +17,7 @@ export default defineController(() => ({
region: REGION,
accessKey: ACCESS_KEY,
secretKey: SECRET_KEY,
oauthDomain: `localhost:${SSL_PORT}`,
},
}),
}));
1 change: 1 addition & 0 deletions server/common/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export type DefaultConfigs = {
region: string;
accessKey: string;
secretKey: string;
oauthDomain: string;
};
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"start": "npm run start:client & npm run start:server & npm run start:ssl",
"start:client": "serve ../client/out -l $CLIENT_PORT",
"start:server": "prisma migrate deploy && node --enable-source-maps prisma/seed.js && node --enable-source-maps index.js",
"start:ssl": "local-ssl-proxy --key ./certificates/server.key --cert ./certificates/server.crt --source $SSL_PORT --target $CLIENT_PORT",
"start:ssl": "local-ssl-proxy --key ./certificates/server.key --cert ./certificates/server.crt --source $SSL_PORT --target $PORT",
"test": "vitest run --coverage",
"typecheck": "tsc --noEmit"
},
Expand Down
2 changes: 2 additions & 0 deletions server/service/envValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dotenv.config();

const APP_VERSION = `v${z.string().parse(rootPackage.version)}`;
const PORT = +z.string().regex(/^\d+$/).parse(process.env.PORT);
const SSL_PORT = +z.string().regex(/^\d+$/).parse(process.env.SSL_PORT);
const SMTP_HOST = z.string().parse(process.env.SMTP_HOST);
const SMTP_PASS = z.string().parse(process.env.SMTP_PASS);
const SMTP_PORT = +z.string().regex(/^\d+$/).parse(process.env.SMTP_PORT);
Expand All @@ -31,4 +32,5 @@ export {
SMTP_PASS,
SMTP_PORT,
SMTP_USER,
SSL_PORT,
};

0 comments on commit 2280a71

Please sign in to comment.