File tree 6 files changed +37
-17
lines changed
6 files changed +37
-17
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,17 @@ import tailwindcss from "@tailwindcss/vite";
2
2
3
3
// https://nuxt.com/docs/api/configuration/nuxt-config
4
4
export default defineNuxtConfig ( {
5
+ extends : [ "./drop-base" ] ,
6
+
7
+ // Module config from here down
8
+ modules : [
9
+ "vue3-carousel-nuxt" ,
10
+ "nuxt-security" ,
11
+ // "@nuxt/image",
12
+ "@nuxt/fonts" ,
13
+ "@nuxt/eslint" ,
14
+ ] ,
15
+
5
16
// Nuxt-only config
6
17
telemetry : false ,
7
18
compatibilityDate : "2024-04-03" ,
@@ -21,6 +32,10 @@ export default defineNuxtConfig({
21
32
viewTransition : true ,
22
33
} ,
23
34
35
+ // future: {
36
+ // compatibilityVersion: 4,
37
+ // },
38
+
24
39
vite : {
25
40
plugins : [ tailwindcss ( ) ] ,
26
41
} ,
@@ -76,17 +91,6 @@ export default defineNuxtConfig({
76
91
} ,
77
92
} ,
78
93
79
- extends : [ "./drop-base" ] ,
80
-
81
- // Module config from here down
82
- modules : [
83
- "vue3-carousel-nuxt" ,
84
- "nuxt-security" ,
85
- // "@nuxt/image",
86
- "@nuxt/fonts" ,
87
- "@nuxt/eslint" ,
88
- ] ,
89
-
90
94
carousel : {
91
95
prefix : "Vue" ,
92
96
} ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import path from "path";
2
2
import fs from "fs" ;
3
3
import type { CertificateBundle } from "./ca" ;
4
4
import prisma from "../db/database" ;
5
+ import { systemConfig } from "../config/sys-conf" ;
5
6
6
7
export type CertificateStore = {
7
8
store ( name : string , data : CertificateBundle ) : Promise < void > ;
@@ -10,7 +11,8 @@ export type CertificateStore = {
10
11
checkBlacklistCertificate ( name : string ) : Promise < boolean > ;
11
12
} ;
12
13
13
- export const fsCertificateStore = ( base : string ) => {
14
+ export const fsCertificateStore = ( ) => {
15
+ const base = path . join ( systemConfig . getDataFolder ( ) , "certs" ) ;
14
16
const blacklist = path . join ( base , ".blacklist" ) ;
15
17
fs . mkdirSync ( blacklist , { recursive : true } ) ;
16
18
const store : CertificateStore = {
Original file line number Diff line number Diff line change
1
+ class SystemConfig {
2
+ private libraryFolder = process . env . LIBRARY ?? "./.data/library" ;
3
+ private dataFolder = process . env . DATA ?? "./.data/data" ;
4
+
5
+ getLibraryFolder ( ) {
6
+ return this . libraryFolder ;
7
+ }
8
+
9
+ getDataFolder ( ) {
10
+ return this . dataFolder ;
11
+ }
12
+ }
13
+
14
+ export const systemConfig = new SystemConfig ( ) ;
Original file line number Diff line number Diff line change @@ -15,12 +15,13 @@ import taskHandler from "../tasks";
15
15
import { parsePlatform } from "../utils/parseplatform" ;
16
16
import droplet from "@drop-oss/droplet" ;
17
17
import notificationSystem from "../notifications" ;
18
+ import { systemConfig } from "../config/sys-conf" ;
18
19
19
20
class LibraryManager {
20
21
private basePath : string ;
21
22
22
23
constructor ( ) {
23
- this . basePath = process . env . LIBRARY ?? "./.data/library" ;
24
+ this . basePath = systemConfig . getLibraryFolder ( ) ;
24
25
fs . mkdirSync ( this . basePath , { recursive : true } ) ;
25
26
}
26
27
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { Readable } from "stream";
7
7
import { createHash } from "crypto" ;
8
8
import prisma from "../db/database" ;
9
9
import cacheHandler from "../cache" ;
10
+ import { systemConfig } from "../config/sys-conf" ;
10
11
11
12
export class FsObjectBackend extends ObjectBackend {
12
13
private baseObjectPath : string ;
@@ -16,7 +17,7 @@ export class FsObjectBackend extends ObjectBackend {
16
17
17
18
constructor ( ) {
18
19
super ( ) ;
19
- const basePath = process . env . FS_BACKEND_PATH ?? "./.data/ objects";
20
+ const basePath = path . join ( systemConfig . getDataFolder ( ) , " objects") ;
20
21
this . baseObjectPath = path . join ( basePath , "objects" ) ;
21
22
this . baseMetadataPath = path . join ( basePath , "metadata" ) ;
22
23
Original file line number Diff line number Diff line change @@ -9,9 +9,7 @@ export const useCertificateAuthority = () => {
9
9
} ;
10
10
11
11
export default defineNitroPlugin ( async ( ) => {
12
- // const basePath = process.env.CLIENT_CERTIFICATES ?? "./certs";
13
- // fs.mkdirSync(basePath, { recursive: true });
14
- // const store = fsCertificateStore(basePath);
12
+ // const store = fsCertificateStore();
15
13
16
14
ca = await CertificateAuthority . new ( dbCertificateStore ( ) ) ;
17
15
} ) ;
You can’t perform that action at this time.
0 commit comments