-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
90 lines (88 loc) · 2.23 KB
/
nuxt.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import fs from "fs";
function get_from_env(field: string): string {
const env = process.env[field];
if (!env) {
// console.error(field, "ENV VARIABLE ISN'T SET !!!");
}
return env || "";
}
export default defineNuxtConfig({
compatibilityDate: "2024-04-03",
modules: [
"@nuxtjs/tailwindcss",
"@nuxt/icon",
"@sidebase/nuxt-auth",
"@nuxtjs/i18n",
],
plugins: ["~/plugins/eventBus.ts"],
runtimeConfig: {
debug: true,
moviesDir: "./downloaded",
opensubtitles_key: get_from_env("OPENSUBTITLES_KEY"),
opensubtitles_username: get_from_env("OPENSUBTITLES_USERNAME"),
opensubtitles_password: get_from_env("OPENSUBTITLES_PASSWORD"),
tmdbApiKey: get_from_env("TMDB_API_KEY"),
jackettApiKey: get_from_env("JACKETT_API_KEY"),
jackettUrl: process.env.JACKETT_URL || "localhost",
},
auth: {
isEnabled: true,
disableServerSideAuth: false,
originEnvKey: "AUTH_ORIGIN",
baseURL: process.env.AUTH_BASE_URL || "http://localhost:3000/api/auth",
sessionRefresh: {
enablePeriodically: true,
enableOnWindowFocus: true,
},
},
i18n: {
strategy: "no_prefix",
langDir: "locales/",
defaultLocale: "en",
detectBrowserLanguage: false,
locales: [
{ code: "fr", name: "Français", language: "fr-FR", file: "fr.json" },
{ code: "en", name: "English", language: "en-US", file: "en.json" },
],
},
hooks: {
"nitro:build:public-assets": () => {
fs.cpSync(
"node_modules/node-datachannel/build",
".output/server/node_modules/node-datachannel/build",
{ recursive: true },
);
},
},
nitro: {
experimental: {
tasks: true,
openAPI: true,
},
openAPI: {
production: "prerender",
ui: {
scalar: {
servers: [
{
url: "http://localhost:3000",
description: "dev server",
},
{
url: "https://mirsella.mooo.com/hypertube",
description: "Production server",
},
],
},
},
},
scheduledTasks: {
"0 * * * *": ["remove_old_movies"],
},
hooks: {
"dev:reload": () => {
require("node-datachannel");
},
},
},
});