docs / build (push) Canceled after 0s
docs / deploy (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
Update Cap login verification so hashwx challenges solve, while older SHA-256 keys still work.
94 lines
1.8 KiB
TypeScript
94 lines
1.8 KiB
TypeScript
import { readFileSync } from 'node:fs'
|
|
import { dirname, join } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const rootDir = dirname(fileURLToPath(import.meta.url))
|
|
const pkg = JSON.parse(readFileSync(join(rootDir, 'package.json'), 'utf8')) as {
|
|
version: string
|
|
}
|
|
|
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
export default defineNuxtConfig({
|
|
modules: [
|
|
'@nuxt/eslint',
|
|
'@nuxt/ui',
|
|
'@nuxtjs/i18n'
|
|
],
|
|
|
|
devtools: {
|
|
enabled: true
|
|
},
|
|
|
|
css: ['~/assets/css/main.css'],
|
|
|
|
vue: {
|
|
compilerOptions: {
|
|
isCustomElement: tag => tag.startsWith('cap-')
|
|
}
|
|
},
|
|
|
|
colorMode: {
|
|
preference: 'system',
|
|
fallback: 'light'
|
|
},
|
|
|
|
runtimeConfig: {
|
|
appVersion: pkg.version,
|
|
devBypassAccess: process.env.DEV_BYPASS_ACCESS === 'true',
|
|
adminSecret: '',
|
|
siteBaseUrl: '',
|
|
imageBaseUrl: '',
|
|
apiUploadToken: ''
|
|
},
|
|
|
|
devServer: {
|
|
host: '127.0.0.1',
|
|
port: 3000
|
|
},
|
|
|
|
compatibilityDate: '2026-06-30',
|
|
|
|
nitro: {
|
|
preset: 'node-server',
|
|
publicAssets: [
|
|
{
|
|
baseURL: '/cap',
|
|
dir: join(rootDir, 'node_modules/@cap.js/wasm/browser'),
|
|
maxAge: 60 * 60 * 24 * 30
|
|
}
|
|
],
|
|
scheduledTasks: {
|
|
'0 3 * * *': ['auto-delete']
|
|
}
|
|
},
|
|
|
|
vite: {
|
|
server: {
|
|
allowedHosts: true
|
|
}
|
|
},
|
|
|
|
eslint: {
|
|
config: {
|
|
stylistic: {
|
|
commaDangle: 'never',
|
|
braceStyle: '1tbs'
|
|
}
|
|
}
|
|
},
|
|
|
|
i18n: {
|
|
locales: [
|
|
{ code: 'zh-CN', name: '简体中文', language: 'zh-CN', file: 'zh-CN.json' },
|
|
{ code: 'en', name: 'English', language: 'en', file: 'en.json' }
|
|
],
|
|
defaultLocale: 'zh-CN',
|
|
langDir: 'locales',
|
|
strategy: 'no_prefix',
|
|
detectBrowserLanguage: {
|
|
cookieKey: 'pic_locale',
|
|
fallbackLocale: 'zh-CN'
|
|
}
|
|
}
|
|
})
|