feat: Additional instance configuration (#260)

pull/262/head
Matthew Phillips 2022-11-30 16:17:20 -05:00 zatwierdzone przez GitHub
rodzic 2bfa9dc476
commit c505543a73
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -39,6 +39,10 @@ export async function loginTo(user?: Omit<UserLogin, 'account'> & { account?: Ac
const masto = await loginMasto({
url: `https://${user?.server || DEFAULT_SERVER}`,
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) {

Wyświetl plik

@ -60,6 +60,10 @@ export default defineNuxtConfig({
public: {
translateApi: '',
},
storage: {
driver: process.env.ELK_STORAGE_DRIVER || 'cloudflare', // 'cloudflare' | 'fs'
fsBase: process.env.ELK_STORAGE_PATH ?? 'node_modules/.cache/servers',
},
},
nitro: {
prerender: {

Wyświetl plik

@ -21,8 +21,8 @@ const kv = _kv as typeof import('unstorage/dist/drivers/cloudflare-kv-http')['de
const storage = useStorage() as Storage
if (config.env === 'local') {
storage.mount('servers', fs({ base: 'node_modules/.cache/servers' }))
if (config.env === 'local' || config.storage.driver === 'fs') {
storage.mount('servers', fs({ base: config.storage.fsBase }))
}
else {
storage.mount('servers', cached(kv({
@ -31,6 +31,7 @@ else {
apiToken: config.cloudflare.apiToken,
})))
}
export function getRedirectURI(server: string) {
return `${HOST_URL}/api/${server}/oauth`
}