feat: switch to dynamic env for Umami to allow runtime configuration
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 4m41s
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 4m41s
This commit is contained in:
@@ -6,9 +6,8 @@ SvelteKit's `PUBLIC_*` environment variables are **baked into the JavaScript** a
|
|||||||
|
|
||||||
1. ✅ Changing `PUBLIC_API_URL`
|
1. ✅ Changing `PUBLIC_API_URL`
|
||||||
2. ✅ Changing `PUBLIC_URL`
|
2. ✅ Changing `PUBLIC_URL`
|
||||||
3. ✅ Changing `PUBLIC_UMAMI_ID`
|
3. ❌ NOT needed for `PUBLIC_UMAMI_ID` or `PUBLIC_UMAMI_SCRIPT` (those are runtime)
|
||||||
4. ✅ Changing `PUBLIC_UMAMI_SCRIPT`
|
4. ❌ NOT needed for Directus env vars (those are runtime)
|
||||||
5. ❌ NOT needed for Directus env vars (those are runtime)
|
|
||||||
|
|
||||||
## Quick Rebuild Process
|
## Quick Rebuild Process
|
||||||
|
|
||||||
@@ -24,6 +23,7 @@ Set your production values:
|
|||||||
```bash
|
```bash
|
||||||
PUBLIC_API_URL=https://sexy.pivoine.art/api
|
PUBLIC_API_URL=https://sexy.pivoine.art/api
|
||||||
PUBLIC_URL=https://sexy.pivoine.art
|
PUBLIC_URL=https://sexy.pivoine.art
|
||||||
|
# Note: PUBLIC_UMAMI_* can also be set at runtime in docker-compose
|
||||||
PUBLIC_UMAMI_ID=your-umami-id
|
PUBLIC_UMAMI_ID=your-umami-id
|
||||||
PUBLIC_UMAMI_SCRIPT=https://umami.pivoine.art/script.js
|
PUBLIC_UMAMI_SCRIPT=https://umami.pivoine.art/script.js
|
||||||
```
|
```
|
||||||
@@ -251,8 +251,7 @@ These are runtime environment variables and can be changed in docker-compose.
|
|||||||
|--------|----------------|--------------|
|
|--------|----------------|--------------|
|
||||||
| `PUBLIC_API_URL` | ✅ Yes | Rebuild image |
|
| `PUBLIC_API_URL` | ✅ Yes | Rebuild image |
|
||||||
| `PUBLIC_URL` | ✅ Yes | Rebuild image |
|
| `PUBLIC_URL` | ✅ Yes | Rebuild image |
|
||||||
| `PUBLIC_UMAMI_ID` | ✅ Yes | Rebuild image |
|
| `PUBLIC_UMAMI_*` | ❌ No | Restart container |
|
||||||
| `PUBLIC_UMAMI_SCRIPT` | ✅ Yes | Rebuild image |
|
|
||||||
| `SEXY_DIRECTUS_*` | ❌ No | Restart container |
|
| `SEXY_DIRECTUS_*` | ❌ No | Restart container |
|
||||||
| `DB_*` | ❌ No | Restart container |
|
| `DB_*` | ❌ No | Restart container |
|
||||||
| `EMAIL_*` | ❌ No | Restart container |
|
| `EMAIL_*` | ❌ No | Restart container |
|
||||||
|
|||||||
53
packages/buttplug/Cargo.lock
generated
53
packages/buttplug/Cargo.lock
generated
@@ -177,7 +177,7 @@ checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "buttplug_core"
|
name = "buttplug_core"
|
||||||
version = "10.0.0"
|
version = "10.0.0"
|
||||||
source = "git+https://github.com/valknarthing/buttplug.git#c569409c51ad15f343c3f97a57711cdaa358f2ea"
|
source = "git+https://github.com/valknarthing/buttplug.git?rev=fad6c9d#fad6c9d97895218b01ceb55fd4a872a89043194a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-stream",
|
"async-stream",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
@@ -203,7 +203,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "buttplug_server"
|
name = "buttplug_server"
|
||||||
version = "10.0.0"
|
version = "10.0.0"
|
||||||
source = "git+https://github.com/valknarthing/buttplug.git#c569409c51ad15f343c3f97a57711cdaa358f2ea"
|
source = "git+https://github.com/valknarthing/buttplug.git?rev=fad6c9d#fad6c9d97895218b01ceb55fd4a872a89043194a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes",
|
"aes",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -243,8 +243,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "buttplug_server_device_config"
|
name = "buttplug_server_device_config"
|
||||||
version = "10.0.0"
|
version = "10.0.1"
|
||||||
source = "git+https://github.com/valknarthing/buttplug.git#c569409c51ad15f343c3f97a57711cdaa358f2ea"
|
source = "git+https://github.com/valknarthing/buttplug.git?rev=fad6c9d#fad6c9d97895218b01ceb55fd4a872a89043194a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"buttplug_core",
|
"buttplug_core",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
@@ -913,9 +913,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
version = "0.3.80"
|
version = "0.3.87"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "852f13bec5eba4ba9afbeb93fd7c13fe56147f055939ae21c43a29a0ecb2702e"
|
checksum = "93f0862381daaec758576dcc22eb7bbf4d7efd67328553f3b45a412a51a3fb21"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
@@ -1860,9 +1860,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen"
|
name = "wasm-bindgen"
|
||||||
version = "0.2.103"
|
version = "0.2.110"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ab10a69fbd0a177f5f649ad4d8d3305499c42bab9aef2f7ff592d0ec8f833819"
|
checksum = "1de241cdc66a9d91bd84f097039eb140cdc6eec47e0cdbaf9d932a1dd6c35866"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
@@ -1873,27 +1873,14 @@ dependencies = [
|
|||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasm-bindgen-backend"
|
|
||||||
version = "0.2.103"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0bb702423545a6007bbc368fde243ba47ca275e549c8a28617f56f6ba53b1d1c"
|
|
||||||
dependencies = [
|
|
||||||
"bumpalo",
|
|
||||||
"log",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
"wasm-bindgen-shared",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-futures"
|
name = "wasm-bindgen-futures"
|
||||||
version = "0.4.53"
|
version = "0.4.60"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a0b221ff421256839509adbb55998214a70d829d3a28c69b4a6672e9d2a42f67"
|
checksum = "a42e96ea38f49b191e08a1bab66c7ffdba24b06f9995b39a9dd60222e5b6f1da"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
"futures-util",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
@@ -1902,9 +1889,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro"
|
name = "wasm-bindgen-macro"
|
||||||
version = "0.2.103"
|
version = "0.2.110"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fc65f4f411d91494355917b605e1480033152658d71f722a90647f56a70c88a0"
|
checksum = "e12fdf6649048f2e3de6d7d5ff3ced779cdedee0e0baffd7dff5cdfa3abc8a52"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"wasm-bindgen-macro-support",
|
"wasm-bindgen-macro-support",
|
||||||
@@ -1912,22 +1899,22 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro-support"
|
name = "wasm-bindgen-macro-support"
|
||||||
version = "0.2.103"
|
version = "0.2.110"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ffc003a991398a8ee604a401e194b6b3a39677b3173d6e74495eb51b82e99a32"
|
checksum = "0e63d1795c565ac3462334c1e396fd46dbf481c40f51f5072c310717bc4fb309"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"bumpalo",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
"wasm-bindgen-backend",
|
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-shared"
|
name = "wasm-bindgen-shared"
|
||||||
version = "0.2.103"
|
version = "0.2.110"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "293c37f4efa430ca14db3721dfbe48d8c33308096bd44d80ebaa775ab71ba1cf"
|
checksum = "e9f9cdac23a5ce71f6bf9f8824898a501e511892791ea2a0c6b8568c68b9cb53"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
@@ -1948,9 +1935,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "web-sys"
|
name = "web-sys"
|
||||||
version = "0.3.80"
|
version = "0.3.87"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fbe734895e869dc429d78c4b433f8d17d95f8d05317440b4fad5ab2d33e596dc"
|
checksum = "f2c7c5718134e770ee62af3b6b4a84518ec10101aad610c024b64d6ff29bb1ff"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import Footer from "$lib/components/footer/footer.svelte";
|
|||||||
import { Toaster } from "$lib/components/ui/sonner";
|
import { Toaster } from "$lib/components/ui/sonner";
|
||||||
import Header from "$lib/components/header/header.svelte";
|
import Header from "$lib/components/header/header.svelte";
|
||||||
import AgeVerificationDialog from "$lib/components/age-verification-dialog/age-verification-dialog.svelte";
|
import AgeVerificationDialog from "$lib/components/age-verification-dialog/age-verification-dialog.svelte";
|
||||||
import { PUBLIC_UMAMI_ID, PUBLIC_UMAMI_SCRIPT } from "$env/static/public";
|
import { env } from "$env/dynamic/public";
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
await waitLocale();
|
await waitLocale();
|
||||||
@@ -17,11 +17,11 @@ let { children, data } = $props();
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
{#if import.meta.env.PROD && PUBLIC_UMAMI_ID && PUBLIC_UMAMI_SCRIPT}
|
{#if import.meta.env.PROD && env.PUBLIC_UMAMI_ID && env.PUBLIC_UMAMI_SCRIPT}
|
||||||
<script
|
<script
|
||||||
defer
|
defer
|
||||||
src={PUBLIC_UMAMI_SCRIPT}
|
src={env.PUBLIC_UMAMI_SCRIPT}
|
||||||
data-website-id={PUBLIC_UMAMI_ID}
|
data-website-id={env.PUBLIC_UMAMI_ID}
|
||||||
></script>
|
></script>
|
||||||
{/if}
|
{/if}
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|||||||
Reference in New Issue
Block a user