fix: move config into `nuxt.config`
parent
c505543a73
commit
81c5a1c4f0
|
@ -4,3 +4,9 @@ NUXT_PUBLIC_TRANSLATE_API=
|
||||||
NUXT_CLOUDFLARE_ACCOUNT_ID=
|
NUXT_CLOUDFLARE_ACCOUNT_ID=
|
||||||
NUXT_CLOUDFLARE_NAMESPACE_ID=
|
NUXT_CLOUDFLARE_NAMESPACE_ID=
|
||||||
NUXT_CLOUDFLARE_API_TOKEN=
|
NUXT_CLOUDFLARE_API_TOKEN=
|
||||||
|
|
||||||
|
# 'cloudflare' | 'fs'
|
||||||
|
NUXT_STORAGE_DRIVER=
|
||||||
|
NUXT_STORAGE_FS_BASE=
|
||||||
|
|
||||||
|
NUXT_PUBLIC_DISABLE_VERSION_CHECK=
|
||||||
|
|
|
@ -36,13 +36,11 @@ export async function loginTo(user?: Omit<UserLogin, 'account'> & { account?: Ac
|
||||||
currentUserId.value = user.account?.id
|
currentUserId.value = user.account?.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const config = useRuntimeConfig()
|
||||||
const masto = await loginMasto({
|
const masto = await loginMasto({
|
||||||
url: `https://${user?.server || DEFAULT_SERVER}`,
|
url: `https://${user?.server || DEFAULT_SERVER}`,
|
||||||
accessToken: user?.token,
|
accessToken: user?.token,
|
||||||
// Masto uses Mastodon version checks to see what features are enabled.
|
disableVersionCheck: !!config.public.disableVersionCheck,
|
||||||
// Mastodon alternatives like GoToSocial will always fail these checks, so
|
|
||||||
// provide a way to disable them.
|
|
||||||
disableVersionCheck: process.env.MASTO_DISABLE_VERSION_CHECK === 'true',
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!user?.token) {
|
if (!user?.token) {
|
||||||
|
|
|
@ -59,10 +59,14 @@ export default defineNuxtConfig({
|
||||||
},
|
},
|
||||||
public: {
|
public: {
|
||||||
translateApi: '',
|
translateApi: '',
|
||||||
|
// Masto uses Mastodon version checks to see what features are enabled.
|
||||||
|
// Mastodon alternatives like GoToSocial will always fail these checks, so
|
||||||
|
// provide a way to disable them.
|
||||||
|
disableVersionCheck: false,
|
||||||
},
|
},
|
||||||
storage: {
|
storage: {
|
||||||
driver: process.env.ELK_STORAGE_DRIVER || 'cloudflare', // 'cloudflare' | 'fs'
|
driver: 'cloudflare',
|
||||||
fsBase: process.env.ELK_STORAGE_PATH ?? 'node_modules/.cache/servers',
|
fsBase: 'node_modules/.cache/servers',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
nitro: {
|
nitro: {
|
||||||
|
|
Loading…
Reference in New Issue