Skip to content
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

Fix: empty publicRuntimeEnvironment in docker and Kubernetes #662

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
7 changes: 2 additions & 5 deletions client/consts/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import getConfig from "next/config";

const { publicRuntimeConfig } = getConfig();

export const DISALLOW_ANONYMOUS_LINKS =
publicRuntimeConfig.DISALLOW_ANONYMOUS_LINKS === "true";

export const DISALLOW_REGISTRATION =
publicRuntimeConfig.DISALLOW_REGISTRATION === "true";
export const { DISALLOW_ANONYMOUS_LINKS } = publicRuntimeConfig;
export const { DISALLOW_REGISTRATION } = publicRuntimeConfig;
Comment on lines +5 to +6
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer necessary to compare the value with 'true'


export enum APIv2 {
AuthLogin = "/api/v2/auth/login",
Expand Down
17 changes: 9 additions & 8 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
const { parsed: localEnv } = require("dotenv").config();
require("dotenv").config();
const env = process.env || {};

module.exports = {
publicRuntimeConfig: {
CONTACT_EMAIL: localEnv && localEnv.CONTACT_EMAIL,
SITE_NAME: localEnv && localEnv.SITE_NAME,
DEFAULT_DOMAIN: localEnv && localEnv.DEFAULT_DOMAIN,
RECAPTCHA_SITE_KEY: localEnv && localEnv.RECAPTCHA_SITE_KEY,
REPORT_EMAIL: localEnv && localEnv.REPORT_EMAIL,
DISALLOW_ANONYMOUS_LINKS: localEnv && localEnv.DISALLOW_ANONYMOUS_LINKS,
DISALLOW_REGISTRATION: localEnv && localEnv.DISALLOW_REGISTRATION
CONTACT_EMAIL: env.CONTACT_EMAIL,
SITE_NAME: env.SITE_NAME,
DEFAULT_DOMAIN: env.DEFAULT_DOMAIN,
RECAPTCHA_SITE_KEY: env.RECAPTCHA_SITE_KEY,
REPORT_EMAIL: env.REPORT_EMAIL,
DISALLOW_ANONYMOUS_LINKS: env.DISALLOW_ANONYMOUS_LINKS === "true",
DISALLOW_REGISTRATION: env.DISALLOW_REGISTRATION === "true"
}
};