-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.mjs
72 lines (64 loc) · 2.07 KB
/
config.mjs
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
import path from "node:path";
export const root = path.resolve(process.cwd()); // project root directory (./)
const port = process.env.PORT;
const domain = `http://127.0.0.1:${port}`; // remove process.env.PORT in production
export const config = {
/* Server */
port: port,
domain: domain,
/* Config Website */
website_name: process.env.WEBSITE_NAME,
preview: `/images/preview-kanz.jpg`,
/* Helmet */
helmet: {
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
scriptSrc: ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
styleSrc: ["'self'", "'unsafe-inline'"],
imgSrc: ["'self'", "data:", "*"],
fontSrc: ["'self'", "*"],
objectSrc: ["'none'"],
mediaSrc: ["'self'", "*"],
frameSrc: ["'self'", "https://www.youtube.com"],
childSrc: ["'self'"],
connectSrc: ["'self'", "*"],
workerSrc: ["'self'", "blob:"],
manifestSrc: ["'self'"],
},
},
crossOriginOpenerPolicy: true,
crossOriginResourcePolicy: false,
originAgentCluster: true,
referrerPolicy: { policy: "strict-origin-when-cross-origin" },
strictTransportSecurity: { maxAge: 63072000, includeSubDomains: true },
xContentTypeOptions: true,
xDnsPrefetchControl: { allow: true },
xDownloadOptions: true,
xFrameOptions: { action: "sameorigin" },
xPermittedCrossDomainPolicies: { permittedPolicies: "none" },
xXssProtection: false,
},
/* Body Parser */
bodyParser: {
extended: true,
limit: "50kb", // body limit
},
/* Paths */
paths: {
root: root,
logs: path.join(root, "src", "logs"),
views: path.join(root, "src", "views"),
public: path.join(root, "src", "public"),
favicon: path.join(root, "src", "public", "favicon.ico"),
json: path.join(root, "src", "data", "json"),
},
// وسائل التواصل
contact: {
email: process.env.CONTACT_EMAIL,
tiktok: process.env.CONTACT_TIKTOK,
instagram: process.env.CONTACT_INSTAGRAM,
telegram: process.env.CONTACT_TELEGRAM,
phone: process.env.CONTACT_PHONE,
},
};