From 48117039c0df6fe0689550f188bb39db2b6ae733 Mon Sep 17 00:00:00 2001 From: David Angel Date: Sat, 15 Jul 2023 00:26:53 -0400 Subject: [PATCH 1/2] Allow custom logo via ENV variable --- Dockerfile | 1 + docker/injector.sh | 1 + index.html | 4 +++- src/components/home/Logo.vue | 10 ++++++++-- src/main.ts | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 275913525..bfd46086c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,6 +57,7 @@ ENV VIKUNJA_SENTRY_ENABLED false ENV VIKUNJA_SENTRY_DSN https://85694a2d757547cbbc90cd4b55c5a18d@o1047380.ingest.sentry.io/6024480 ENV VIKUNJA_PROJECT_INFINITE_NESTING_ENABLED false ENV VIKUNJA_ALLOW_ICON_CHANGES true +ENV VIKUNJA_CUSTOM_LOGO_URL "" COPY docker/injector.sh /docker-entrypoint.d/50-injector.sh COPY docker/ipv6-disable.sh /docker-entrypoint.d/60-ipv6-disable.sh diff --git a/docker/injector.sh b/docker/injector.sh index 9aa1efadf..244e211dd 100755 --- a/docker/injector.sh +++ b/docker/injector.sh @@ -13,5 +13,6 @@ sed -ri "s:^(\s*window.SENTRY_ENABLED\s*=)\s*.+:\1 ${VIKUNJA_SENTRY_ENABLED}:g" sed -ri "s:^(\s*window.SENTRY_DSN\s*=)\s*.+:\1 '${VIKUNJA_SENTRY_DSN}':g" /usr/share/nginx/html/index.html sed -ri "s:^(\s*window.PROJECT_INFINITE_NESTING_ENABLED\s*=)\s*.+:\1 '${VIKUNJA_PROJECT_INFINITE_NESTING_ENABLED}':g" /usr/share/nginx/html/index.html sed -ri "s:^(\s*window.ALLOW_ICON_CHANGES\s*=)\s*.+:\1 ${VIKUNJA_ALLOW_ICON_CHANGES}:g" /usr/share/nginx/html/index.html +sed -ri "s:^(\s*window.CUSTOM_LOGO_URL\s*=)\s*.+:\1 ${VIKUNJA_CUSTOM_LOGO_URL}:g" /usr/share/nginx/html/index.html date -uIseconds | xargs echo 'info: started at' diff --git a/index.html b/index.html index c89f02cf5..05542c48e 100644 --- a/index.html +++ b/index.html @@ -31,7 +31,9 @@ // This setting might change in the future or be removed completely. window.PROJECT_INFINITE_NESTING_ENABLED = false // Allow changing the logo and other icons based on various occasions throughout the year. - window.ALLOW_ICON_CHANGES = true + window.ALLOW_ICON_CHANGES = false + // Allow using a custom logo via external URL. + window.CUSTOM_LOGO_URL = '' diff --git a/src/components/home/Logo.vue b/src/components/home/Logo.vue index 2eca10696..10a1753a2 100644 --- a/src/components/home/Logo.vue +++ b/src/components/home/Logo.vue @@ -9,15 +9,21 @@ import {MILLISECONDS_A_HOUR} from '@/constants/date' const now = useNow({ interval: MILLISECONDS_A_HOUR, }) -const Logo = computed(() => window.ALLOW_ICON_CHANGES && now.value.getMonth() === 5 ? LogoFullPride : LogoFull) +const Logo = computed(() => window.ALLOW_ICON_CHANGES && now.value.getMonth() === 6 ? LogoFullPride : LogoFull) +const CustomLogo = computed(() => window.CUSTOM_LOGO_URL) \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 7be385544..5999d8d8b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -23,6 +23,7 @@ declare global { SENTRY_DSN: string; PROJECT_INFINITE_NESTING_ENABLED: boolean; ALLOW_ICON_CHANGES: boolean; + CUSTOM_LOGO_URL?: string; } } -- 2.40.1 From 71d811064fa0c6f88d6857026c0f7d95e1e42429 Mon Sep 17 00:00:00 2001 From: davidangel Date: Sun, 16 Jul 2023 10:58:17 +0000 Subject: [PATCH 2/2] Revert unintentional change --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 05542c48e..700a8bc3e 100644 --- a/index.html +++ b/index.html @@ -31,7 +31,7 @@ // This setting might change in the future or be removed completely. window.PROJECT_INFINITE_NESTING_ENABLED = false // Allow changing the logo and other icons based on various occasions throughout the year. - window.ALLOW_ICON_CHANGES = false + window.ALLOW_ICON_CHANGES = true // Allow using a custom logo via external URL. window.CUSTOM_LOGO_URL = '' -- 2.40.1