diff --git a/components/nav/NavTitle.vue b/components/nav/NavTitle.vue
index acb8d9cc..ceda93f7 100644
--- a/components/nav/NavTitle.vue
+++ b/components/nav/NavTitle.vue
@@ -1,5 +1,5 @@
diff --git a/composables/setups.ts b/composables/setups.ts
index 367e43e6..9d9012ad 100644
--- a/composables/setups.ts
+++ b/composables/setups.ts
@@ -1,9 +1,9 @@
import { APP_NAME, STORAGE_KEY_LANG } from '~/constants'
-const isDev = process.dev
-const isPreview = window.location.hostname.includes('deploy-preview')
-
export function setupPageHeader() {
+ const isDev = process.dev
+ const isPreview = useRuntimeConfig().public.env === 'staging'
+
const i18n = useI18n()
useHeadFixed({
diff --git a/nuxt.config.ts b/nuxt.config.ts
index 635f75db..385cdf92 100644
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@ -48,7 +48,6 @@ export default defineNuxtConfig({
},
},
runtimeConfig: {
- env: isCI ? 'deployed' : 'local',
deployUrl: !isCI
? 'http://localhost:5314'
: process.env.PULL_REQUEST === 'true'
@@ -60,6 +59,7 @@ export default defineNuxtConfig({
apiToken: '',
},
public: {
+ env: isCI ? process.env.PULL_REQUEST === 'true' ? 'production' : 'staging' : 'local',
translateApi: '',
// Masto uses Mastodon version checks to see what features are enabled.
// Mastodon alternatives like GoToSocial will always fail these checks, so
@@ -67,7 +67,7 @@ export default defineNuxtConfig({
disableVersionCheck: false,
},
storage: {
- driver: 'cloudflare',
+ driver: isCI ? 'cloudflare' : 'fs',
fsBase: 'node_modules/.cache/servers',
},
},
diff --git a/server/shared.ts b/server/shared.ts
index bd099646..71c686c6 100644
--- a/server/shared.ts
+++ b/server/shared.ts
@@ -21,7 +21,7 @@ const kv = _kv as typeof import('unstorage/dist/drivers/cloudflare-kv-http')['de
const storage = useStorage() as Storage
-if (config.env === 'local' || config.storage.driver === 'fs') {
+if (config.storage.driver === 'fs') {
storage.mount('servers', fs({ base: config.storage.fsBase }))
}
else {
@@ -40,7 +40,7 @@ async function fetchAppInfo(server: string) {
const app: AppInfo = await $fetch(`https://${server}/api/v1/apps`, {
method: 'POST',
body: {
- client_name: APP_NAME + (config.env === 'local' ? ' (dev)' : ''),
+ client_name: APP_NAME + (config.public.env === 'local' ? ' (dev)' : ''),
website: 'https://elk.zone',
redirect_uris: getRedirectURI(server),
scopes: 'read write follow push',