mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-24 18:26:17 +03:00
feat: Additional instance configuration (#260)
This commit is contained in:
parent
2bfa9dc476
commit
c505543a73
3 changed files with 11 additions and 2 deletions
|
@ -39,6 +39,10 @@ export async function loginTo(user?: Omit<UserLogin, 'account'> & { account?: Ac
|
||||||
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.
|
||||||
|
// 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) {
|
||||||
|
|
|
@ -60,6 +60,10 @@ export default defineNuxtConfig({
|
||||||
public: {
|
public: {
|
||||||
translateApi: '',
|
translateApi: '',
|
||||||
},
|
},
|
||||||
|
storage: {
|
||||||
|
driver: process.env.ELK_STORAGE_DRIVER || 'cloudflare', // 'cloudflare' | 'fs'
|
||||||
|
fsBase: process.env.ELK_STORAGE_PATH ?? 'node_modules/.cache/servers',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
nitro: {
|
nitro: {
|
||||||
prerender: {
|
prerender: {
|
||||||
|
|
|
@ -21,8 +21,8 @@ const kv = _kv as typeof import('unstorage/dist/drivers/cloudflare-kv-http')['de
|
||||||
|
|
||||||
const storage = useStorage() as Storage
|
const storage = useStorage() as Storage
|
||||||
|
|
||||||
if (config.env === 'local') {
|
if (config.env === 'local' || config.storage.driver === 'fs') {
|
||||||
storage.mount('servers', fs({ base: 'node_modules/.cache/servers' }))
|
storage.mount('servers', fs({ base: config.storage.fsBase }))
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
storage.mount('servers', cached(kv({
|
storage.mount('servers', cached(kv({
|
||||||
|
@ -31,6 +31,7 @@ else {
|
||||||
apiToken: config.cloudflare.apiToken,
|
apiToken: config.cloudflare.apiToken,
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getRedirectURI(server: string) {
|
export function getRedirectURI(server: string) {
|
||||||
return `${HOST_URL}/api/${server}/oauth`
|
return `${HOST_URL}/api/${server}/oauth`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue