mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-26 20:49:29 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c365a44e01 | ||
|
|
e94f450bf0 | ||
|
|
d5efc9ddde | ||
|
|
68895ba4a5 | ||
|
|
139aa7a0fc | ||
|
|
4955157e13 | ||
|
|
2ad634dbc6 | ||
|
|
de13f65a24 |
@@ -1664,7 +1664,6 @@
|
|||||||
services:
|
services:
|
||||||
$$id:
|
$$id:
|
||||||
name: Umami
|
name: Umami
|
||||||
documentation: "Official docs are [here](https://umami.is/docs/getting-started)"
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- $$id-postgresql
|
- $$id-postgresql
|
||||||
image: "ghcr.io/umami-software/umami:$$core_version"
|
image: "ghcr.io/umami-software/umami:$$core_version"
|
||||||
@@ -1678,7 +1677,213 @@
|
|||||||
- "3000"
|
- "3000"
|
||||||
$$id-postgresql:
|
$$id-postgresql:
|
||||||
name: PostgreSQL
|
name: PostgreSQL
|
||||||
documentation: "Official docs are [here](https://umami.is/docs/getting-started)"
|
depends_on: []
|
||||||
|
image: "postgres:12-alpine"
|
||||||
|
volumes:
|
||||||
|
- "$$id-postgresql-data:/var/lib/postgresql/data"
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=$$config_postgres_user
|
||||||
|
- POSTGRES_PASSWORD=$$secret_postgres_password
|
||||||
|
- POSTGRES_DB=$$config_postgres_db
|
||||||
|
ports: []
|
||||||
|
files:
|
||||||
|
- location: /docker-entrypoint-initdb.d/schema.postgresql.sql
|
||||||
|
content: |2-
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "account" (
|
||||||
|
"user_id" SERIAL NOT NULL,
|
||||||
|
"username" VARCHAR(255) NOT NULL,
|
||||||
|
"password" VARCHAR(60) NOT NULL,
|
||||||
|
"is_admin" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"created_at" TIMESTAMPTZ(6) DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ(6) DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
|
||||||
|
PRIMARY KEY ("user_id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "event" (
|
||||||
|
"event_id" SERIAL NOT NULL,
|
||||||
|
"website_id" INTEGER NOT NULL,
|
||||||
|
"session_id" INTEGER NOT NULL,
|
||||||
|
"created_at" TIMESTAMPTZ(6) DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"url" VARCHAR(500) NOT NULL,
|
||||||
|
"event_type" VARCHAR(50) NOT NULL,
|
||||||
|
"event_value" VARCHAR(50) NOT NULL,
|
||||||
|
|
||||||
|
PRIMARY KEY ("event_id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "pageview" (
|
||||||
|
"view_id" SERIAL NOT NULL,
|
||||||
|
"website_id" INTEGER NOT NULL,
|
||||||
|
"session_id" INTEGER NOT NULL,
|
||||||
|
"created_at" TIMESTAMPTZ(6) DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"url" VARCHAR(500) NOT NULL,
|
||||||
|
"referrer" VARCHAR(500),
|
||||||
|
|
||||||
|
PRIMARY KEY ("view_id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "session" (
|
||||||
|
"session_id" SERIAL NOT NULL,
|
||||||
|
"session_uuid" UUID NOT NULL,
|
||||||
|
"website_id" INTEGER NOT NULL,
|
||||||
|
"created_at" TIMESTAMPTZ(6) DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"hostname" VARCHAR(100),
|
||||||
|
"browser" VARCHAR(20),
|
||||||
|
"os" VARCHAR(20),
|
||||||
|
"device" VARCHAR(20),
|
||||||
|
"screen" VARCHAR(11),
|
||||||
|
"language" VARCHAR(35),
|
||||||
|
"country" CHAR(2),
|
||||||
|
|
||||||
|
PRIMARY KEY ("session_id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "website" (
|
||||||
|
"website_id" SERIAL NOT NULL,
|
||||||
|
"website_uuid" UUID NOT NULL,
|
||||||
|
"user_id" INTEGER NOT NULL,
|
||||||
|
"name" VARCHAR(100) NOT NULL,
|
||||||
|
"domain" VARCHAR(500),
|
||||||
|
"share_id" VARCHAR(64),
|
||||||
|
"created_at" TIMESTAMPTZ(6) DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
|
||||||
|
PRIMARY KEY ("website_id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "account.username_unique" ON "account"("username");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "event_created_at_idx" ON "event"("created_at");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "event_session_id_idx" ON "event"("session_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "event_website_id_idx" ON "event"("website_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "pageview_created_at_idx" ON "pageview"("created_at");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "pageview_session_id_idx" ON "pageview"("session_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "pageview_website_id_created_at_idx" ON "pageview"("website_id", "created_at");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "pageview_website_id_idx" ON "pageview"("website_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "pageview_website_id_session_id_created_at_idx" ON "pageview"("website_id", "session_id", "created_at");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "session.session_uuid_unique" ON "session"("session_uuid");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "session_created_at_idx" ON "session"("created_at");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "session_website_id_idx" ON "session"("website_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "website.website_uuid_unique" ON "website"("website_uuid");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "website.share_id_unique" ON "website"("share_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "website_user_id_idx" ON "website"("user_id");
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "event" ADD FOREIGN KEY ("session_id") REFERENCES "session"("session_id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "event" ADD FOREIGN KEY ("website_id") REFERENCES "website"("website_id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "pageview" ADD FOREIGN KEY ("session_id") REFERENCES "session"("session_id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "pageview" ADD FOREIGN KEY ("website_id") REFERENCES "website"("website_id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "session" ADD FOREIGN KEY ("website_id") REFERENCES "website"("website_id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "website" ADD FOREIGN KEY ("user_id") REFERENCES "account"("user_id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
insert into account (username, password, is_admin) values ('admin', '$$hashed$$secret_admin_password', true);
|
||||||
|
variables:
|
||||||
|
- id: $$secret_database_url
|
||||||
|
name: DATABASE_URL
|
||||||
|
label: Database URL for PostgreSQL
|
||||||
|
defaultValue: >-
|
||||||
|
postgresql://$$config_postgres_user:$$secret_postgres_password@$$id-postgresql:5432/$$config_postgres_db
|
||||||
|
description: ""
|
||||||
|
- id: $$secret_hash_salt
|
||||||
|
name: HASH_SALT
|
||||||
|
label: Hash Salt
|
||||||
|
defaultValue: $$generate_hex(64)
|
||||||
|
description: ""
|
||||||
|
- id: $$config_database_type
|
||||||
|
name: DATABASE_TYPE
|
||||||
|
label: Database Type
|
||||||
|
defaultValue: "postgresql"
|
||||||
|
description: ""
|
||||||
|
- id: $$config_postgres_user
|
||||||
|
name: POSTGRES_USER
|
||||||
|
label: PostgreSQL User
|
||||||
|
defaultValue: $$generate_username
|
||||||
|
description: ""
|
||||||
|
- id: $$secret_postgres_password
|
||||||
|
name: POSTGRES_PASSWORD
|
||||||
|
label: PostgreSQL Password
|
||||||
|
defaultValue: $$generate_password
|
||||||
|
description: ""
|
||||||
|
- id: $$config_postgres_db
|
||||||
|
name: POSTGRES_DB
|
||||||
|
label: PostgreSQL Database
|
||||||
|
defaultValue: umami
|
||||||
|
description: ""
|
||||||
|
- id: $$secret_admin_password
|
||||||
|
name: ADMIN_PASSWORD
|
||||||
|
label: Initial Admin Password
|
||||||
|
defaultValue: $$generate_password
|
||||||
|
description: ""
|
||||||
|
showOnConfiguration: true
|
||||||
|
- templateVersion: 1.0.0
|
||||||
|
ignore: true
|
||||||
|
defaultVersion: postgresql-v1.38.0
|
||||||
|
documentation: https://umami.is/docs/getting-started
|
||||||
|
type: umami
|
||||||
|
name: Umami
|
||||||
|
subname: (PostgreSQL)
|
||||||
|
description: >-
|
||||||
|
A simple, easy to use, self-hosted web analytics solution.
|
||||||
|
services:
|
||||||
|
$$id:
|
||||||
|
name: Umami
|
||||||
|
depends_on:
|
||||||
|
- $$id-postgresql
|
||||||
|
image: "ghcr.io/umami-software/umami:$$core_version"
|
||||||
|
volumes: []
|
||||||
|
environment:
|
||||||
|
- ADMIN_PASSWORD=$$secret_admin_password
|
||||||
|
- DATABASE_URL=$$secret_database_url
|
||||||
|
- DATABASE_TYPE=$$config_database_type
|
||||||
|
- HASH_SALT=$$secret_hash_salt
|
||||||
|
ports:
|
||||||
|
- "3000"
|
||||||
|
$$id-postgresql:
|
||||||
|
name: PostgreSQL
|
||||||
depends_on: []
|
depends_on: []
|
||||||
image: "postgres:12-alpine"
|
image: "postgres:12-alpine"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -1871,7 +2076,7 @@
|
|||||||
services:
|
services:
|
||||||
$$id:
|
$$id:
|
||||||
name: MeiliSearch
|
name: MeiliSearch
|
||||||
documentation: "https://docs.meilisearch.com/"
|
documentation: https://docs.meilisearch.com/
|
||||||
depends_on: []
|
depends_on: []
|
||||||
image: "getmeili/meilisearch:$$core_version"
|
image: "getmeili/meilisearch:$$core_version"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -1893,7 +2098,7 @@
|
|||||||
- templateVersion: 1.0.0
|
- templateVersion: 1.0.0
|
||||||
ignore: true
|
ignore: true
|
||||||
defaultVersion: latest
|
defaultVersion: latest
|
||||||
documentation: https://ghost.org/resources/
|
documentation: https://docs.ghost.org
|
||||||
type: ghost-mariadb
|
type: ghost-mariadb
|
||||||
name: Ghost
|
name: Ghost
|
||||||
subname: (MariaDB)
|
subname: (MariaDB)
|
||||||
@@ -1905,7 +2110,6 @@
|
|||||||
services:
|
services:
|
||||||
$$id:
|
$$id:
|
||||||
name: Ghost
|
name: Ghost
|
||||||
documentation: "Taken from https://docs.ghost.org/"
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- $$id-mariadb
|
- $$id-mariadb
|
||||||
image: "bitnami/ghost:$$core_version"
|
image: "bitnami/ghost:$$core_version"
|
||||||
@@ -2011,7 +2215,7 @@
|
|||||||
description: ""
|
description: ""
|
||||||
- templateVersion: 1.0.0
|
- templateVersion: 1.0.0
|
||||||
defaultVersion: "5.22"
|
defaultVersion: "5.22"
|
||||||
documentation: https://ghost.org/resources/
|
documentation: https://docs.ghost.org
|
||||||
type: ghost-only
|
type: ghost-only
|
||||||
name: Ghost
|
name: Ghost
|
||||||
subname: (without Database)
|
subname: (without Database)
|
||||||
@@ -2020,7 +2224,6 @@
|
|||||||
services:
|
services:
|
||||||
$$id:
|
$$id:
|
||||||
name: Ghost
|
name: Ghost
|
||||||
documentation: "Taken from https://docs.ghost.org/"
|
|
||||||
image: "ghost:$$core_version"
|
image: "ghost:$$core_version"
|
||||||
volumes:
|
volumes:
|
||||||
- "$$id-ghost:/var/lib/ghost/content"
|
- "$$id-ghost:/var/lib/ghost/content"
|
||||||
@@ -2076,7 +2279,7 @@
|
|||||||
required: true
|
required: true
|
||||||
- templateVersion: 1.0.0
|
- templateVersion: 1.0.0
|
||||||
defaultVersion: "5.22"
|
defaultVersion: "5.22"
|
||||||
documentation: https://ghost.org/resources/
|
documentation: https://docs.ghost.org
|
||||||
type: ghost-mysql
|
type: ghost-mysql
|
||||||
name: Ghost
|
name: Ghost
|
||||||
subname: (MySQL)
|
subname: (MySQL)
|
||||||
@@ -2085,7 +2288,6 @@
|
|||||||
services:
|
services:
|
||||||
$$id:
|
$$id:
|
||||||
name: Ghost
|
name: Ghost
|
||||||
documentation: "Taken from https://docs.ghost.org/"
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- $$id-mysql
|
- $$id-mysql
|
||||||
image: "ghost:$$core_version"
|
image: "ghost:$$core_version"
|
||||||
@@ -2166,7 +2368,6 @@
|
|||||||
services:
|
services:
|
||||||
$$id:
|
$$id:
|
||||||
name: WordPress
|
name: WordPress
|
||||||
documentation: " Taken from https://docs.docker.com/compose/wordpress/"
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- $$id-mysql
|
- $$id-mysql
|
||||||
image: "wordpress:$$core_version"
|
image: "wordpress:$$core_version"
|
||||||
@@ -2257,7 +2458,6 @@
|
|||||||
services:
|
services:
|
||||||
$$id:
|
$$id:
|
||||||
name: WordPress
|
name: WordPress
|
||||||
documentation: "Taken from https://docs.docker.com/compose/wordpress/"
|
|
||||||
image: "wordpress:$$core_version"
|
image: "wordpress:$$core_version"
|
||||||
volumes:
|
volumes:
|
||||||
- "$$id-wordpress-data:/var/www/html"
|
- "$$id-wordpress-data:/var/www/html"
|
||||||
@@ -2331,7 +2531,6 @@
|
|||||||
services:
|
services:
|
||||||
$$id:
|
$$id:
|
||||||
name: VSCode Server
|
name: VSCode Server
|
||||||
documentation: "Taken from https://github.com/coder/code-server/. "
|
|
||||||
depends_on: []
|
depends_on: []
|
||||||
image: "codercom/code-server:$$core_version"
|
image: "codercom/code-server:$$core_version"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -2363,7 +2562,6 @@
|
|||||||
$$id:
|
$$id:
|
||||||
name: MinIO
|
name: MinIO
|
||||||
command: "server /data --console-address :9001"
|
command: "server /data --console-address :9001"
|
||||||
documentation: "Taken from https://docs.min.io/docs/minio-docker-quickstart-guide.html"
|
|
||||||
depends_on: []
|
depends_on: []
|
||||||
image: "minio/minio:$$core_version"
|
image: "minio/minio:$$core_version"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -2423,7 +2621,6 @@
|
|||||||
$$id:
|
$$id:
|
||||||
name: Fider
|
name: Fider
|
||||||
image: "getfider/fider:$$core_version"
|
image: "getfider/fider:$$core_version"
|
||||||
documentation: "Taken from https://hub.docker.com/r/getfider/fider/"
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- $$id-postgresql
|
- $$id-postgresql
|
||||||
environment:
|
environment:
|
||||||
@@ -2443,7 +2640,6 @@
|
|||||||
- "3000"
|
- "3000"
|
||||||
$$id-postgresql:
|
$$id-postgresql:
|
||||||
name: PostgreSQL
|
name: PostgreSQL
|
||||||
documentation: "Taken from https://hub.docker.com/r/getfider/fider/"
|
|
||||||
depends_on: []
|
depends_on: []
|
||||||
image: "postgres:12-alpine"
|
image: "postgres:12-alpine"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -2546,7 +2742,6 @@
|
|||||||
services:
|
services:
|
||||||
$$id:
|
$$id:
|
||||||
name: N8n
|
name: N8n
|
||||||
documentation: "Taken from https://hub.docker.com/r/n8nio/n8n"
|
|
||||||
depends_on: []
|
depends_on: []
|
||||||
image: "n8nio/n8n:$$core_version"
|
image: "n8nio/n8n:$$core_version"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -2579,7 +2774,6 @@
|
|||||||
services:
|
services:
|
||||||
$$id:
|
$$id:
|
||||||
name: Plausible Analytics
|
name: Plausible Analytics
|
||||||
documentation: "Taken from https://plausible.io/"
|
|
||||||
command: >-
|
command: >-
|
||||||
sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db
|
sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db
|
||||||
migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"
|
migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"
|
||||||
@@ -2601,7 +2795,6 @@
|
|||||||
- "8000"
|
- "8000"
|
||||||
$$id-postgresql:
|
$$id-postgresql:
|
||||||
name: PostgreSQL
|
name: PostgreSQL
|
||||||
documentation: "Taken from https://plausible.io/"
|
|
||||||
image: "bitnami/postgresql:13.2.0"
|
image: "bitnami/postgresql:13.2.0"
|
||||||
volumes:
|
volumes:
|
||||||
- "$$id-postgresql-data:/bitnami/postgresql"
|
- "$$id-postgresql-data:/bitnami/postgresql"
|
||||||
@@ -2611,7 +2804,6 @@
|
|||||||
- POSTGRESQL_DATABASE=$$config_postgresql_database
|
- POSTGRESQL_DATABASE=$$config_postgresql_database
|
||||||
$$id-clickhouse:
|
$$id-clickhouse:
|
||||||
name: Clickhouse
|
name: Clickhouse
|
||||||
documentation: "Taken from https://plausible.io/"
|
|
||||||
volumes:
|
volumes:
|
||||||
- "$$id-clickhouse-data:/var/lib/clickhouse"
|
- "$$id-clickhouse-data:/var/lib/clickhouse"
|
||||||
image: "yandex/clickhouse-server:21.3.2.5"
|
image: "yandex/clickhouse-server:21.3.2.5"
|
||||||
|
|||||||
@@ -238,7 +238,6 @@ async function hasura(service: any, template: any) {
|
|||||||
async function umami(service: any, template: any) {
|
async function umami(service: any, template: any) {
|
||||||
const { postgresqlUser, postgresqlPassword, postgresqlDatabase, umamiAdminPassword, hashSalt } = service.umami
|
const { postgresqlUser, postgresqlPassword, postgresqlDatabase, umamiAdminPassword, hashSalt } = service.umami
|
||||||
const { id } = service
|
const { id } = service
|
||||||
|
|
||||||
const secrets = [
|
const secrets = [
|
||||||
`HASH_SALT@@@${hashSalt}`,
|
`HASH_SALT@@@${hashSalt}`,
|
||||||
`POSTGRES_PASSWORD@@@${postgresqlPassword}`,
|
`POSTGRES_PASSWORD@@@${postgresqlPassword}`,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { day } from './dayjs';
|
|||||||
import { saveBuildLog } from './buildPacks/common';
|
import { saveBuildLog } from './buildPacks/common';
|
||||||
import { scheduler } from './scheduler';
|
import { scheduler } from './scheduler';
|
||||||
|
|
||||||
export const version = '3.11.2';
|
export const version = '3.11.4';
|
||||||
export const isDev = process.env.NODE_ENV === 'development';
|
export const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
const algorithm = 'aes-256-ctr';
|
const algorithm = 'aes-256-ctr';
|
||||||
|
|||||||
@@ -1,145 +1,12 @@
|
|||||||
import { isDev } from "./common";
|
import { isDev } from "./common";
|
||||||
import fs from 'fs/promises';
|
import fs from 'fs/promises';
|
||||||
export async function getTemplates() {
|
export async function getTemplates() {
|
||||||
let templates: any = [];
|
const templatePath = isDev ? './templates.json' : '/app/templates.json';
|
||||||
if (isDev) {
|
const ts = await fs.readFile(templatePath, 'utf8')
|
||||||
templates = JSON.parse(await (await fs.readFile('./templates.json')).toString())
|
if (ts) {
|
||||||
} else {
|
return JSON.parse(ts);
|
||||||
templates = JSON.parse(await (await fs.readFile('/app/templates.json')).toString())
|
|
||||||
}
|
}
|
||||||
// if (!isDev) {
|
return [];
|
||||||
// templates.push({
|
|
||||||
// "templateVersion": "1.0.0",
|
|
||||||
// "defaultVersion": "latest",
|
|
||||||
// "name": "Test-Fake-Service",
|
|
||||||
// "description": "",
|
|
||||||
// "services": {
|
|
||||||
// "$$id": {
|
|
||||||
// "name": "Test-Fake-Service",
|
|
||||||
// "depends_on": [
|
|
||||||
// "$$id-postgresql",
|
|
||||||
// "$$id-redis"
|
|
||||||
// ],
|
|
||||||
// "image": "weblate/weblate:$$core_version",
|
|
||||||
// "volumes": [
|
|
||||||
// "$$id-data:/app/data",
|
|
||||||
// ],
|
|
||||||
// "environment": [
|
|
||||||
// `POSTGRES_SECRET=$$secret_postgres_secret`,
|
|
||||||
// `WEBLATE_SITE_DOMAIN=$$config_weblate_site_domain`,
|
|
||||||
// `WEBLATE_ADMIN_PASSWORD=$$secret_weblate_admin_password`,
|
|
||||||
// `POSTGRES_PASSWORD=$$secret_postgres_password`,
|
|
||||||
// `POSTGRES_USER=$$config_postgres_user`,
|
|
||||||
// `POSTGRES_DATABASE=$$config_postgres_db`,
|
|
||||||
// `POSTGRES_HOST=$$id-postgresql`,
|
|
||||||
// `POSTGRES_PORT=5432`,
|
|
||||||
// `REDIS_HOST=$$id-redis`,
|
|
||||||
// ],
|
|
||||||
// "ports": [
|
|
||||||
// "8080"
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
// "$$id-postgresql": {
|
|
||||||
// "name": "PostgreSQL",
|
|
||||||
// "depends_on": [],
|
|
||||||
// "image": "postgres:14-alpine",
|
|
||||||
// "volumes": [
|
|
||||||
// "$$id-postgresql-data:/var/lib/postgresql/data",
|
|
||||||
// ],
|
|
||||||
// "environment": [
|
|
||||||
// "POSTGRES_USER=$$config_postgres_user",
|
|
||||||
// "POSTGRES_PASSWORD=$$secret_postgres_password",
|
|
||||||
// "POSTGRES_DB=$$config_postgres_db",
|
|
||||||
// ],
|
|
||||||
// "ports": []
|
|
||||||
// },
|
|
||||||
// "$$id-redis": {
|
|
||||||
// "name": "Redis",
|
|
||||||
// "depends_on": [],
|
|
||||||
// "image": "redis:7-alpine",
|
|
||||||
// "volumes": [
|
|
||||||
// "$$id-redis-data:/data",
|
|
||||||
// ],
|
|
||||||
// "environment": [],
|
|
||||||
// "ports": [],
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// "variables": [
|
|
||||||
// {
|
|
||||||
// "id": "$$config_weblate_site_domain",
|
|
||||||
// "main": "$$id",
|
|
||||||
// "name": "WEBLATE_SITE_DOMAIN",
|
|
||||||
// "label": "Weblate Domain",
|
|
||||||
// "defaultValue": "$$generate_domain",
|
|
||||||
// "description": "",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "id": "$$secret_weblate_admin_password",
|
|
||||||
// "main": "$$id",
|
|
||||||
// "name": "WEBLATE_ADMIN_PASSWORD",
|
|
||||||
// "label": "Weblate Admin Password",
|
|
||||||
// "defaultValue": "$$generate_password",
|
|
||||||
// "description": "",
|
|
||||||
// "extras": {
|
|
||||||
// "isVisibleOnUI": true,
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "id": "$$secret_weblate_admin_password2",
|
|
||||||
// "name": "WEBLATE_ADMIN_PASSWORD2",
|
|
||||||
// "label": "Weblate Admin Password2",
|
|
||||||
// "defaultValue": "$$generate_password",
|
|
||||||
// "description": "",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "id": "$$config_postgres_user",
|
|
||||||
// "main": "$$id-postgresql",
|
|
||||||
// "name": "POSTGRES_USER",
|
|
||||||
// "label": "PostgreSQL User",
|
|
||||||
// "defaultValue": "$$generate_username",
|
|
||||||
// "description": "",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "id": "$$secret_postgres_password",
|
|
||||||
// "main": "$$id-postgresql",
|
|
||||||
// "name": "POSTGRES_PASSWORD",
|
|
||||||
// "label": "PostgreSQL Password",
|
|
||||||
// "defaultValue": "$$generate_password(32)",
|
|
||||||
// "description": "",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "id": "$$secret_postgres_password_hex32",
|
|
||||||
// "name": "POSTGRES_PASSWORD_hex32",
|
|
||||||
// "label": "PostgreSQL Password hex32",
|
|
||||||
// "defaultValue": "$$generate_hex(32)",
|
|
||||||
// "description": "",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "id": "$$config_postgres_something_hex32",
|
|
||||||
// "name": "POSTGRES_SOMETHING_HEX32",
|
|
||||||
// "label": "PostgreSQL Something hex32",
|
|
||||||
// "defaultValue": "$$generate_hex(32)",
|
|
||||||
// "description": "",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "id": "$$config_postgres_db",
|
|
||||||
// "main": "$$id-postgresql",
|
|
||||||
// "name": "POSTGRES_DB",
|
|
||||||
// "label": "PostgreSQL Database",
|
|
||||||
// "defaultValue": "weblate",
|
|
||||||
// "description": "",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "id": "$$secret_postgres_secret",
|
|
||||||
// "name": "POSTGRES_SECRET",
|
|
||||||
// "label": "PostgreSQL Secret",
|
|
||||||
// "defaultValue": "",
|
|
||||||
// "description": "",
|
|
||||||
// },
|
|
||||||
// ]
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
return templates
|
|
||||||
}
|
}
|
||||||
const compareSemanticVersions = (a: string, b: string) => {
|
const compareSemanticVersions = (a: string, b: string) => {
|
||||||
const a1 = a.split('.');
|
const a1 = a.split('.');
|
||||||
@@ -156,15 +23,14 @@ const compareSemanticVersions = (a: string, b: string) => {
|
|||||||
};
|
};
|
||||||
export async function getTags(type: string) {
|
export async function getTags(type: string) {
|
||||||
if (type) {
|
if (type) {
|
||||||
let tags: any = [];
|
const tagsPath = isDev ? './tags.json' : '/app/tags.json';
|
||||||
if (isDev) {
|
const data = await fs.readFile(tagsPath, 'utf8')
|
||||||
tags = JSON.parse(await (await fs.readFile('./tags.json')).toString())
|
let tags = JSON.parse(data)
|
||||||
} else {
|
if (tags) {
|
||||||
tags = JSON.parse(await (await fs.readFile('/app/tags.json')).toString())
|
tags = tags.find((tag: any) => tag.name.includes(type))
|
||||||
|
tags.tags = tags.tags.sort(compareSemanticVersions).reverse();
|
||||||
|
return tags
|
||||||
}
|
}
|
||||||
tags = tags.find((tag: any) => tag.name.includes(type))
|
|
||||||
tags.tags = tags.tags.sort(compareSemanticVersions).reverse();
|
|
||||||
return tags
|
|
||||||
}
|
}
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,9 +149,11 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
parsedTemplate[realKey] = {
|
parsedTemplate[realKey] = {
|
||||||
|
value,
|
||||||
name,
|
name,
|
||||||
documentation: value.documentation || foundTemplate.documentation || 'https://docs.coollabs.io',
|
documentation: value.documentation || foundTemplate.documentation || 'https://docs.coollabs.io',
|
||||||
image: value.image,
|
image: value.image,
|
||||||
|
files: value?.files,
|
||||||
environment: [],
|
environment: [],
|
||||||
fqdns: [],
|
fqdns: [],
|
||||||
proxy: {}
|
proxy: {}
|
||||||
@@ -189,7 +191,7 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
|
|||||||
const variable = foundTemplate.variables.find(v => v.id === proxyValue.domain)
|
const variable = foundTemplate.variables.find(v => v.id === proxyValue.domain)
|
||||||
if (variable) {
|
if (variable) {
|
||||||
const { id, name, label, description, defaultValue, required = false } = variable
|
const { id, name, label, description, defaultValue, required = false } = variable
|
||||||
const found = await prisma.serviceSetting.findFirst({ where: { serviceId: service.id , variableName: proxyValue.domain } })
|
const found = await prisma.serviceSetting.findFirst({ where: { serviceId: service.id, variableName: proxyValue.domain } })
|
||||||
parsedTemplate[realKey].fqdns.push(
|
parsedTemplate[realKey].fqdns.push(
|
||||||
{ id, name, value: found?.value || '', label, description, defaultValue, required }
|
{ id, name, value: found?.value || '', label, description, defaultValue, required }
|
||||||
)
|
)
|
||||||
@@ -208,7 +210,7 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
|
|||||||
strParsedTemplate = strParsedTemplate.replaceAll('$$id', service.id)
|
strParsedTemplate = strParsedTemplate.replaceAll('$$id', service.id)
|
||||||
strParsedTemplate = strParsedTemplate.replaceAll('$$core_version', service.version || foundTemplate.defaultVersion)
|
strParsedTemplate = strParsedTemplate.replaceAll('$$core_version', service.version || foundTemplate.defaultVersion)
|
||||||
|
|
||||||
// replace $$fqdn
|
// replace $$workdir
|
||||||
if (workdir) {
|
if (workdir) {
|
||||||
strParsedTemplate = strParsedTemplate.replaceAll('$$workdir', workdir)
|
strParsedTemplate = strParsedTemplate.replaceAll('$$workdir', workdir)
|
||||||
}
|
}
|
||||||
@@ -217,15 +219,15 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
|
|||||||
if (service.serviceSetting.length > 0) {
|
if (service.serviceSetting.length > 0) {
|
||||||
for (const setting of service.serviceSetting) {
|
for (const setting of service.serviceSetting) {
|
||||||
const { value, variableName } = setting
|
const { value, variableName } = setting
|
||||||
const regex = new RegExp(`\\$\\$config_${variableName.replace('$$config_', '')}\\"`, 'gi')
|
const regex = new RegExp(`\\$\\$config_${variableName.replace('$$config_', '')}`, 'gi')
|
||||||
if (value === '$$generate_fqdn') {
|
if (value === '$$generate_fqdn') {
|
||||||
strParsedTemplate = strParsedTemplate.replaceAll(regex, service.fqdn + "\"" || '' + "\"")
|
strParsedTemplate = strParsedTemplate.replaceAll(regex, service.fqdn || '')
|
||||||
} else if (value === '$$generate_domain') {
|
} else if (value === '$$generate_domain') {
|
||||||
strParsedTemplate = strParsedTemplate.replaceAll(regex, getDomain(service.fqdn) + "\"")
|
strParsedTemplate = strParsedTemplate.replaceAll(regex, getDomain(service.fqdn))
|
||||||
} else if (service.destinationDocker?.network && value === '$$generate_network') {
|
} else if (service.destinationDocker?.network && value === '$$generate_network') {
|
||||||
strParsedTemplate = strParsedTemplate.replaceAll(regex, service.destinationDocker.network + "\"")
|
strParsedTemplate = strParsedTemplate.replaceAll(regex, service.destinationDocker.network)
|
||||||
} else {
|
} else {
|
||||||
strParsedTemplate = strParsedTemplate.replaceAll(regex, value + "\"")
|
strParsedTemplate = strParsedTemplate.replaceAll(regex, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -233,15 +235,13 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
|
|||||||
// replace $$secret
|
// replace $$secret
|
||||||
if (service.serviceSecret.length > 0) {
|
if (service.serviceSecret.length > 0) {
|
||||||
for (const secret of service.serviceSecret) {
|
for (const secret of service.serviceSecret) {
|
||||||
const { name, value } = secret
|
let { name, value } = secret
|
||||||
const regexHashed = new RegExp(`\\$\\$hashed\\$\\$secret_${name}\\"`, 'gi')
|
name = name.toLowerCase()
|
||||||
const regex = new RegExp(`\\$\\$secret_${name}\\"`, 'gi')
|
const regexHashed = new RegExp(`\\$\\$hashed\\$\\$secret_${name}`, 'gi')
|
||||||
|
const regex = new RegExp(`\\$\\$secret_${name}`, 'gi')
|
||||||
if (value) {
|
if (value) {
|
||||||
strParsedTemplate = strParsedTemplate.replaceAll(regexHashed, bcrypt.hashSync(value.replaceAll("\"", "\\\""), 10) + "\"")
|
strParsedTemplate = strParsedTemplate.replaceAll(regexHashed, bcrypt.hashSync(value.replaceAll("\"", "\\\""), 10))
|
||||||
strParsedTemplate = strParsedTemplate.replaceAll(regex, value.replaceAll("\"", "\\\"") + "\"")
|
strParsedTemplate = strParsedTemplate.replaceAll(regex, value.replaceAll("\"", "\\\""))
|
||||||
} else {
|
|
||||||
strParsedTemplate = strParsedTemplate.replaceAll(regexHashed, "\"")
|
|
||||||
strParsedTemplate = strParsedTemplate.replaceAll(regex, "\"")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,11 +287,10 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
|
|||||||
if (
|
if (
|
||||||
!runningContainers[destinationDockerId] ||
|
!runningContainers[destinationDockerId] ||
|
||||||
runningContainers[destinationDockerId].length === 0 ||
|
runningContainers[destinationDockerId].length === 0 ||
|
||||||
!runningContainers[destinationDockerId].includes(id)
|
runningContainers[destinationDockerId].filter((container) => container.startsWith(id)).length === 0
|
||||||
) {
|
) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildPack === 'compose') {
|
if (buildPack === 'compose') {
|
||||||
const services = Object.entries(JSON.parse(dockerComposeConfiguration))
|
const services = Object.entries(JSON.parse(dockerComposeConfiguration))
|
||||||
if (services.length > 0) {
|
if (services.length > 0) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "coolify",
|
"name": "coolify",
|
||||||
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
||||||
"version": "3.11.2",
|
"version": "3.11.4",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": "github:coollabsio/coolify",
|
"repository": "github:coollabsio/coolify",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user