From 876e661a7337fbea919419f422b4cef56eca4e09 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Tue, 4 Aug 2026 13:04:24 +0200 Subject: [PATCH] feat(assets): add assets environment variables Added the environment variables VITE_ASSETS_BUILD_ID for the ID of the used build and VITE_ASSETS_BASE_URL for the base URL of the assets. A script for reading this configuration was also added. --- .env | 2 ++ src/config/env.js | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .env create mode 100644 src/config/env.js diff --git a/.env b/.env new file mode 100644 index 0000000..1338704 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +VITE_ASSETS_BUILD_ID=2026-08-04-76a067e +VITE_ASSETS_BASE_URL=https://assets.seekra.jcloud-services.ddns.net diff --git a/src/config/env.js b/src/config/env.js new file mode 100644 index 0000000..c8418f0 --- /dev/null +++ b/src/config/env.js @@ -0,0 +1,22 @@ +/* +Copyright 2026 Seekra + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +export const getAssetsUrl = function getAssetsUrl () { + return new URL( + `${import.meta.env.VITE_ASSETS_BUILD_ID}/`, + import.meta.env.VITE_ASSETS_BASE_URL + ).href; +};