From 88974bce2ae7cff52dc1c4d186f508f583789e15 Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Mon, 7 Aug 2023 17:37:42 -0700 Subject: [PATCH] feat: implement .env usage --- .env.example | 7 ++++--- .env.production | 4 ++++ .env.staging | 4 ++++ _data/serverState.ts | 2 +- components/UserProfile/Promo.vue | 3 +-- helpers/urls.ts | 10 ++++++---- store/callback.ts | 4 +++- 7 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 .env.production create mode 100644 .env.staging diff --git a/.env.example b/.env.example index 86316d515..3fe854eb2 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,4 @@ -NUXT_PUBLIC_CALLBACK_KEY=aNotSoSecretKeyUsedToObfuscateQueryParams -NUXT_PUBLIC_UNRAID_NET=https://unraid.ddev.site -NUXT_PUBLIC_ACCOUNT=https://localhost:8008 +VITE_ACCOUNT=https://localhost:8008 +VITE_CONNECT=https://connect.myunraid.net +VITE_UNRAID_NET=https://unraid.ddev.site +VITE_CALLBACK_KEY=aNotSoSecretKeyUsedToObfuscateQueryParams diff --git a/.env.production b/.env.production new file mode 100644 index 000000000..4452aa6b8 --- /dev/null +++ b/.env.production @@ -0,0 +1,4 @@ +VITE_ACCOUNT=https://account.unraid.net +VITE_CONNECT=https://connect.myunraid.net +VITE_UNRAID_NET=https://unraid.net +VITE_CALLBACK_KEY=Uyv2o8e*FiQe8VeLekTqyX6Z*8XonB diff --git a/.env.staging b/.env.staging new file mode 100644 index 000000000..5b443b9cf --- /dev/null +++ b/.env.staging @@ -0,0 +1,4 @@ +VITE_ACCOUNT=https://account.unraid.net +VITE_CONNECT=https://connect.myunraid.net +VITE_UNRAID_NET=https://staging.unraid.net +VITE_CALLBACK_KEY=Uyv2o8e*FiQe8VeLekTqyX6Z*8XonB diff --git a/_data/serverState.ts b/_data/serverState.ts index 098cdfcde..f9b1663fb 100644 --- a/_data/serverState.ts +++ b/_data/serverState.ts @@ -29,7 +29,7 @@ const randomGuid = `1111-1111-${makeid(4)}-123412341234`; // this guid is regist // EBLACKLISTED1 // EBLACKLISTED2 // ENOCONN -const state: ServerState = 'ENOCONN'; +const state: ServerState = 'TRIAL'; const uptime = Date.now() - 60 * 60 * 1000; // 1 hour ago let expireTime = 0; diff --git a/components/UserProfile/Promo.vue b/components/UserProfile/Promo.vue index e914c82c7..593fe353a 100644 --- a/components/UserProfile/Promo.vue +++ b/components/UserProfile/Promo.vue @@ -96,8 +96,7 @@ const { install } = useInstallPlugin();