lasthourcloud/apps/api/src/lib/templates.ts

227 lines
9.3 KiB
TypeScript
Raw Normal View History

2022-10-14 15:48:37 +02:00
export default [
{
"templateVersion": "1.0.0",
"serviceDefaultVersion": "0.198.1",
"name": "n8n",
"displayName": "n8n.io",
"description": "n8n is a free and open node based Workflow Automation Tool.",
"services": {
"$$id": {
2022-10-17 15:43:57 +02:00
"name": "N8n",
2022-10-14 15:48:37 +02:00
"documentation": "Taken from https://hub.docker.com/r/n8nio/n8n",
"depends_on": [],
"image": "n8nio/n8n:$$core_version",
"volumes": [
"$$id-data:/root/.n8n",
"$$id-data-write:/files",
"/var/run/docker.sock:/var/run/docker.sock"
],
"environment": [
2022-10-17 15:43:57 +02:00
"WEBHOOK_URL=$$config_webhook_url"
2022-10-14 15:48:37 +02:00
],
"ports": [
"5678"
]
}
},
2022-10-17 15:43:57 +02:00
"variables": [
{
"id": "$$config_webhook_url",
"name": "WEBHOOK_URL",
"label": "Webhook URL",
"defaultValue": "$$generate_fqdn",
"description": "",
}]
2022-10-14 15:48:37 +02:00
},
{
"templateVersion": "1.0.0",
"serviceDefaultVersion": "stable",
"name": "plausibleanalytics",
"displayName": "PlausibleAnalytics",
"description": "Plausible is a lightweight and open-source website analytics tool.",
"services": {
"$$id": {
2022-10-17 15:43:57 +02:00
"name": "Plausible Analytics",
2022-10-14 15:48:37 +02:00
"documentation": "Taken from https://plausible.io/",
2022-10-18 11:32:38 +02:00
"command": 'sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"',
2022-10-14 15:48:37 +02:00
"depends_on": [
"$$id-postgresql",
"$$id-clickhouse"
],
"image": "plausible/analytics:$$core_version",
"environment": [
2022-10-17 15:43:57 +02:00
"ADMIN_USER_EMAIL=$$config_admin_user_email",
"ADMIN_USER_NAME=$$config_admin_user_name",
2022-10-18 11:32:38 +02:00
"ADMIN_USER_PWD=$$secret_admin_user_pwd",
2022-10-17 15:43:57 +02:00
"BASE_URL=$$config_base_url",
"SECRET_KEY_BASE=$$secret_secret_key_base",
"DISABLE_AUTH=$$config_disable_auth",
"DISABLE_REGISTRATION=$$config_disable_registration",
"DATABASE_URL=$$secret_database_url",
"CLICKHOUSE_DATABASE_URL=$$secret_clickhouse_database_url",
2022-10-14 15:48:37 +02:00
],
"ports": [
"8000"
],
},
"$$id-postgresql": {
2022-10-17 15:43:57 +02:00
"name": "PostgreSQL",
2022-10-14 15:48:37 +02:00
"documentation": "Taken from https://plausible.io/",
"image": "bitnami/postgresql:13.2.0",
2022-10-18 11:32:38 +02:00
"volumes": [
2022-10-18 12:02:09 +02:00
'$$id-postgresql-data:/bitnami/postgresql',
2022-10-18 11:32:38 +02:00
],
2022-10-14 15:48:37 +02:00
"environment": [
"POSTGRESQL_PASSWORD=$$secret_postgresql_password",
2022-10-17 15:43:57 +02:00
"POSTGRESQL_USERNAME=$$config_postgresql_username",
"POSTGRESQL_DATABASE=$$config_postgresql_database",
2022-10-14 15:48:37 +02:00
],
},
"$$id-clickhouse": {
2022-10-17 15:43:57 +02:00
"name": "Clickhouse",
2022-10-14 15:48:37 +02:00
"documentation": "Taken from https://plausible.io/",
2022-10-18 11:32:38 +02:00
"build": {
context: "$$workdir",
dockerfile: "Dockerfile.$$id-clickhouse"
},
"volumes": [
'$$id-clickhouse-data:/var/lib/clickhouse',
],
2022-10-14 15:48:37 +02:00
"image": "yandex/clickhouse-server:21.3.2.5",
"ulimits": {
"nofile": {
"soft": 262144,
"hard": 262144
}
},
"extras": {
2022-10-18 11:32:38 +02:00
"files": [
2022-10-14 15:48:37 +02:00
{
2022-10-18 11:32:38 +02:00
source: "$$workdir/clickhouse-config.xml",
destination: '/etc/clickhouse-server/users.d/logging.xml',
2022-10-14 15:48:37 +02:00
content: '<yandex><logger><level>warning</level><console>true</console></logger><query_thread_log remove="remove"/><query_log remove="remove"/><text_log remove="remove"/><trace_log remove="remove"/><metric_log remove="remove"/><asynchronous_metric_log remove="remove"/><session_log remove="remove"/><part_log remove="remove"/></yandex>'
},
{
2022-10-18 11:32:38 +02:00
source: "$$workdir/clickhouse-user-config.xml",
destination: '/etc/clickhouse-server/config.d/logging.xml',
2022-10-14 15:48:37 +02:00
content: '<yandex><profiles><default><log_queries>0</log_queries><log_query_threads>0</log_query_threads></default></profiles></yandex>'
},
{
2022-10-18 11:32:38 +02:00
source: "$$workdir/init.query",
destination: '/docker-entrypoint-initdb.d/init.query',
2022-10-14 15:48:37 +02:00
content: 'CREATE DATABASE IF NOT EXISTS plausible;'
},
{
2022-10-18 11:32:38 +02:00
source: "$$workdir/init-db.sh",
destination: '/docker-entrypoint-initdb.d/init-db.sh',
2022-10-14 15:48:37 +02:00
content: 'clickhouse client --queries-file /docker-entrypoint-initdb.d/init.query'
}
]
}
},
},
"variables": [
{
2022-10-17 15:43:57 +02:00
"id": "$$config_base_url",
"name": "BASE_URL",
"label": "Base URL",
"defaultValue": "$$generate_fqdn",
"description": "You must set this to the FQDN of the Plausible Analytics instance. This is used to generate the links to the Plausible Analytics instance.",
},
{
"id": "$$secret_database_url",
"name": "DATABASE_URL",
"label": "Database URL for PostgreSQL",
"defaultValue": "postgresql://$$config_postgresql_username:$$secret_postgresql_password@$$id-postgresql:5432/$$config_postgresql_database",
"description": "",
},
{
"id": "$$secret_clickhouse_database_url",
"name": "CLICKHOUSE_DATABASE_URL",
"label": "Database URL for Clickhouse",
"defaultValue": "http://$$id-clickhouse:8123/plausible",
"description": "",
},
{
"id": "$$config_admin_user_email",
"name": "ADMIN_USER_EMAIL",
"label": "Admin Email Address",
2022-10-14 15:48:37 +02:00
"defaultValue": "admin@example.com",
"description": "This is the admin email. Please change it.",
},
{
2022-10-17 15:43:57 +02:00
"id": "$$config_admin_user_name",
"name": "ADMIN_USER_NAME",
"label": "Admin User Name",
2022-10-14 15:54:19 +02:00
"defaultValue": "$$generate_username",
2022-10-14 15:48:37 +02:00
"description": "This is the admin username. Please change it.",
},
{
2022-10-18 11:32:38 +02:00
"id": "$$secret_admin_user_pwd",
"name": "ADMIN_USER_PWD",
2022-10-17 15:43:57 +02:00
"label": "Admin User Password",
"defaultValue": "$$generate_password",
2022-10-14 15:48:37 +02:00
"description": "This is the admin password. Please change it.",
2022-10-18 11:32:38 +02:00
"extras": {
"isVisibleOnUI": true
}
2022-10-14 15:48:37 +02:00
},
{
"id": "$$secret_secret_key_base",
2022-10-17 15:43:57 +02:00
"name": "SECRET_KEY_BASE",
2022-10-14 15:48:37 +02:00
"label": "Secret Key Base",
2022-10-17 15:43:57 +02:00
"defaultValue": "$$generate_passphrase",
2022-10-14 15:48:37 +02:00
"description": "",
2022-10-18 11:32:38 +02:00
"extras": {
"length": 64
2022-10-17 14:55:28 +00:00
}
2022-10-14 15:48:37 +02:00
},
{
2022-10-17 15:43:57 +02:00
"id": "$$config_disable_auth",
"name": "DISABLE_AUTH",
"label": "Disable Authentication",
2022-10-14 15:48:37 +02:00
"defaultValue": "false",
"description": "",
},
{
2022-10-17 15:43:57 +02:00
"id": "$$config_disable_registration",
"name": "DISABLE_REGISTRATION",
2022-10-14 15:48:37 +02:00
"label": "Disable Registration",
"defaultValue": "true",
"description": "",
},
{
2022-10-17 15:43:57 +02:00
"id": "$$config_postgresql_username",
"name": "POSTGRESQL_USERNAME",
2022-10-14 15:48:37 +02:00
"label": "PostgreSQL Username",
"defaultValue": "postgresql",
"description": "",
},
{
"id": "$$secret_postgresql_password",
2022-10-17 15:43:57 +02:00
"name": "POSTGRESQL_PASSWORD",
2022-10-14 15:48:37 +02:00
"label": "PostgreSQL Password",
2022-10-14 15:54:19 +02:00
"defaultValue": "$$generate_password",
2022-10-14 15:48:37 +02:00
"description": "",
}
,
{
2022-10-17 15:43:57 +02:00
"id": "$$config_postgresql_database",
"name": "POSTGRESQL_DATABASE",
2022-10-14 15:48:37 +02:00
"label": "PostgreSQL Database",
"defaultValue": "plausible",
"description": "",
2022-10-17 15:43:57 +02:00
},
{
"id": "$$config_scriptName",
"name": "SCRIPT_NAME",
"label": "Custom Script Name",
"defaultValue": "plausible.js",
"description": "This is the default script name.",
},
2022-10-14 15:48:37 +02:00
]
}
]