From ab2cffb703931f296e737323198f90fa53187b5a Mon Sep 17 00:00:00 2001
From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com>
Date: Sat, 1 Mar 2025 00:51:59 -0600
Subject: [PATCH] Create index.ts
---
templates/plausible/index.ts | 71 ++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
create mode 100644 templates/plausible/index.ts
diff --git a/templates/plausible/index.ts b/templates/plausible/index.ts
new file mode 100644
index 0000000..2bd1212
--- /dev/null
+++ b/templates/plausible/index.ts
@@ -0,0 +1,71 @@
+import {
+ type DomainSchema,
+ type Schema,
+ type Template,
+ generateBase64,
+ generateRandomDomain,
+} from "../utils";
+
+export function generate(schema: Schema): Template {
+ const mainDomain = generateRandomDomain(schema);
+ const secretBase = generateBase64(64);
+ const toptKeyBase = generateBase64(32);
+
+ const domains: DomainSchema[] = [
+ {
+ host: mainDomain,
+ port: 8000,
+ serviceName: "plausible",
+ },
+ ];
+
+ const envs = [
+ `BASE_URL=http://${mainDomain}`,
+ `SECRET_KEY_BASE=${secretBase}`,
+ `TOTP_VAULT_KEY=${toptKeyBase}`,
+ ];
+
+ const mounts: Template["mounts"] = [
+ {
+ filePath: "/clickhouse/clickhouse-config.xml",
+ content: `
+
+
+ warning
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `,
+ },
+ {
+ filePath: "/clickhouse/clickhouse-user-config.xml",
+ content: `
+
+
+
+ 0
+ 0
+
+
+
+ `,
+ },
+ ];
+
+ return {
+ envs,
+ mounts,
+ domains,
+ };
+}