Skip to content

Commit

Permalink
feat: disable auto https for reverse proxy (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffroy Empain committed Dec 17, 2020
1 parent 19815a8 commit 449faa8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/caddy/generate-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const sitesUrl = new URL(env.MELI_SITES_URL);
export async function generateConfig(): Promise<any> {
const sites = await Sites().find().toArray();

const sslDisabled = sitesUrl.protocol === 'http:';
const sslDisabled = sitesUrl.protocol === 'http:' && env.MELI_HTTPS_AUTO;
return {
logging: {
logs: {
Expand Down
4 changes: 4 additions & 0 deletions src/env/env-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export const envSpec: EnvSpec<Env> = {
MELI_SITES_URL: {
schema: string().optional().custom(isUrl).default(process.env.MELI_URL || null),
},
MELI_HTTPS_AUTO: {
transform: stringToBoolean(),
schema: boolean().optional().default(true),
},
MELI_STANDALONE: {
transform: stringToBoolean(),
schema: boolean().optional().default(false),
Expand Down
1 change: 1 addition & 0 deletions src/env/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface Env {
MELI_UI_URL: string;
MELI_UI_URL_INTERNAL: string;
MELI_SITES_URL: string;
MELI_HTTPS_AUTO: string;
MELI_STANDALONE: boolean;
MELI_UI_DIR: string;
MELI_JWT_SECRET: string;
Expand Down

0 comments on commit 449faa8

Please sign in to comment.