Cleanup env variables
This commit is contained in:
parent
fb74ffeeb2
commit
6ab8be4e58
|
|
@ -74,6 +74,10 @@ def main(app_name, image_name, environment_file):
|
||||||
environment_variables={
|
environment_variables={
|
||||||
# 'DJANGO_SETTINGS_MODULE': 'config.settings.base',
|
# 'DJANGO_SETTINGS_MODULE': 'config.settings.base',
|
||||||
"VITE_APP_ENVIRONMENT": env.str("VITE_APP_ENVIRONMENT", "dev-feature"),
|
"VITE_APP_ENVIRONMENT": env.str("VITE_APP_ENVIRONMENT", "dev-feature"),
|
||||||
|
"VITE_LOGOUT_REDIRECT": env.str(
|
||||||
|
"VITE_LOGOUT_REDIRECT",
|
||||||
|
"https://vbvdev.b2clogin.com/vbvdev.onmicrosoft.com/b2c_1_signupandsignin/oauth2/v2.0/logout/?post_logout_redirect_uri=https://vbv-lernwelt.control.iterativ.ch",
|
||||||
|
),
|
||||||
"IT_DEFAULT_ADMIN_PASSWORD": env.str("fWwoQzreIS5uztLOyF8jJpS9M"),
|
"IT_DEFAULT_ADMIN_PASSWORD": env.str("fWwoQzreIS5uztLOyF8jJpS9M"),
|
||||||
"POSTGRES_HOST": f"srv-captain--{app_name}-postgres",
|
"POSTGRES_HOST": f"srv-captain--{app_name}-postgres",
|
||||||
"POSTGRES_PORT": 5432,
|
"POSTGRES_PORT": 5432,
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,6 @@ function generate_default_app_name() {
|
||||||
# take app name as first argument or use the default generated app name
|
# take app name as first argument or use the default generated app name
|
||||||
APP_NAME=${1:-$(generate_default_app_name)}
|
APP_NAME=${1:-$(generate_default_app_name)}
|
||||||
|
|
||||||
VITE_SENTRY_ENV="development"
|
|
||||||
|
|
||||||
if [[ "$APP_NAME" == "myvbv" ]]; then
|
if [[ "$APP_NAME" == "myvbv" ]]; then
|
||||||
VITE_LOGOUT_REDIRECT="https://edumgr.b2clogin.com/edumgr.onmicrosoft.com/b2c_1_signupandsignin/oauth2/v2.0/logout/?post_logout_redirect_uri=https://myvbv.iterativ.ch/"
|
VITE_LOGOUT_REDIRECT="https://edumgr.b2clogin.com/edumgr.onmicrosoft.com/b2c_1_signupandsignin/oauth2/v2.0/logout/?post_logout_redirect_uri=https://myvbv.iterativ.ch/"
|
||||||
VITE_SENTRY_ENV="production"
|
VITE_SENTRY_ENV="production"
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import * as log from "loglevel";
|
||||||
log.debug("AppFooter created");
|
log.debug("AppFooter created");
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const hideVersion = import.meta.env.VITE_SENTRY_ENV === "production";
|
const hideVersion = import.meta.env.VITE_APP_ENVIRONMENT.startsWith("prod");
|
||||||
|
|
||||||
async function changeLocale(language: AvailableLanguages) {
|
async function changeLocale(language: AvailableLanguages) {
|
||||||
userStore.setUserLanguages(language);
|
userStore.setUserLanguages(language);
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,12 @@ const app = createApp(App);
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
app,
|
app,
|
||||||
environment: import.meta.env.VITE_SENTRY_ENV || "development",
|
environment: import.meta.env.VITE_APP_ENVIRONMENT || "local",
|
||||||
dsn: "https://2df6096a4fd94bd6b4802124d10e4b8d@o8544.ingest.sentry.io/4504157846372352",
|
dsn: "https://2df6096a4fd94bd6b4802124d10e4b8d@o8544.ingest.sentry.io/4504157846372352",
|
||||||
tracesSampleRate: 0.0,
|
tracesSampleRate: 0.0,
|
||||||
enabled:
|
enabled:
|
||||||
import.meta.env.VITE_SENTRY_ENV == "production" ||
|
import.meta.env.VITE_APP_ENVIRONMENT.startsWith("prod") ||
|
||||||
import.meta.env.VITE_SENTRY_ENV == "stage",
|
import.meta.env.VITE_APP_ENVIRONMENT.startsWith("stage"),
|
||||||
});
|
});
|
||||||
|
|
||||||
// todo: define lang setup
|
// todo: define lang setup
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ export const updateLoggedIn: NavigationGuard = async () => {
|
||||||
export const redirectToLoginIfRequired: NavigationGuard = (to) => {
|
export const redirectToLoginIfRequired: NavigationGuard = (to) => {
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
if (loginRequired(to) && !userStore.loggedIn) {
|
if (loginRequired(to) && !userStore.loggedIn) {
|
||||||
const sentryEnv = import.meta.env.VITE_SENTRY_ENV;
|
const sentryEnv = import.meta.env.VITE_APP_ENVIRONMENT;
|
||||||
const ssoLogin = sentryEnv === "production" || sentryEnv === "staging";
|
const ssoLogin = sentryEnv.startsWith("prod") || sentryEnv.startsWith("stage");
|
||||||
return ssoLogin ? `/login?next=${to.fullPath}` : `/login-local?next=${to.fullPath}`;
|
return ssoLogin ? `/login?next=${to.fullPath}` : `/login-local?next=${to.fullPath}`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -5,6 +5,4 @@
|
||||||
encrypted: env_secrets/local_daniel.env
|
encrypted: env_secrets/local_daniel.env
|
||||||
encrypted: env_secrets/local_elia.env
|
encrypted: env_secrets/local_elia.env
|
||||||
encrypted: env_secrets/local_lorenz.env
|
encrypted: env_secrets/local_lorenz.env
|
||||||
encrypted: env_secrets/pg_backup_local.env
|
encrypted: env_secrets/prod-azure.json
|
||||||
encrypted: env_secrets/production.env
|
|
||||||
encrypted: env_secrets/production_azure.json
|
|
||||||
|
|
|
||||||
|
|
@ -503,7 +503,7 @@ SPECTACULAR_SETTINGS = {
|
||||||
# Your stuff...
|
# Your stuff...
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
if DEBUG:
|
if APP_ENVIRONMENT == "local":
|
||||||
SECRET_KEY = env(
|
SECRET_KEY = env(
|
||||||
"IT_DJANGO_SECRET_KEY",
|
"IT_DJANGO_SECRET_KEY",
|
||||||
default="J9FiYN31FuY7lHrmx9Mpai3GGpTVCxakEclOfCLretDe7bTf2DtTsgazJ0aIMtbq",
|
default="J9FiYN31FuY7lHrmx9Mpai3GGpTVCxakEclOfCLretDe7bTf2DtTsgazJ0aIMtbq",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue