-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
51 lines (47 loc) · 1.27 KB
/
main.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
import start from "./src/server.ts";
import {
filterIncludesKey,
parseParameters,
} from "./src/routes/keys/filter.ts";
import { parseEnvironmentVariables } from "./src/environment/environment.ts";
import { Sentry } from "./deps.ts";
import loadConfig from "./src/config/load_config.ts";
import {
getPGPTarget,
servePGPKey,
servePGPKeyList,
} from "./src/routes/pgp/serve_pgp.ts";
import { serveKeys } from "./src/routes/keys/serve-keys.ts";
import { serveHome } from "./src/routes/serve-home.ts";
import { serveKnownHosts } from "./src/routes/known_hosts/serve-known-hosts.ts";
const environment = parseEnvironmentVariables(Deno.env.toObject());
if (environment.SENTRY_DSN) {
Sentry.init({
dsn: environment.SENTRY_DSN,
environment: environment.DOPPLER_ENVIRONMENT,
tracesSampleRate: 1.0,
release: environment.KEYS_VERSION,
});
}
const { "ssh-keys": sshKeys, "pgp-keys": pgpKeys, "known-hosts": knownHosts } =
await loadConfig(
environment.CONFIG_PATH,
);
start(
environment.PORT,
{
filterIncludesKey,
parseParameters,
serveHome,
serveKeys,
getPGPTarget,
servePGPKey,
servePGPKeyList,
serveKnownHosts,
sshKeys,
pgpKeys,
knownHosts,
instanceName: environment.INSTANCE_NAME,
},
environment.KEYS_VERSION,
);