-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ts
32 lines (30 loc) · 1.09 KB
/
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
import { assertEnv } from "./deps.ts";
export const isProduction = true;
const port = isProduction ? 8083 : 8083;
// const https = "https:";
// const http = "http:";
// const protocol = isProduction ? https : http;
const domain = isProduction ? "zaubrik.de" : "localhost";
const subdomain = "members";
export const hostname = `${subdomain}.${domain}`;
export const [home] = isProduction ? assertEnv(["HOME"]) : [""];
export const serveOptions = isProduction
? {
port,
// cert: await Deno.readTextFile(`${home}/.certs/fullchain.pem`),
// key: await Deno.readTextFile(`${home}/.certs/key.pem`),
}
: { port };
export const urlPatternHostnameDevelopment =
`{:subdomain.}*:secondLevelDomain(localhost)`;
export const urlPatternHostnameProduction =
`{:subdomain.}*:secondLevelDomain.:topLevelDomain`;
export const urlPatternHostname = isProduction
? urlPatternHostnameProduction
: urlPatternHostnameDevelopment;
export const nginxConfigSitesAvailable = new URL(
"file:///etc/nginx/sites-available/",
);
export const nginxConfigSitesEnabled = new URL(
"file:///etc/nginx/sites-enabled/",
);