From 89cd35adc64c9415de7588a946259c1eae66483f Mon Sep 17 00:00:00 2001 From: Andrey Kucherenko Date: Thu, 1 Aug 2024 11:34:09 +0300 Subject: [PATCH 1/8] chore(gitignore): add .idea folder to gitignore file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a94fd2772..368c5ed01 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ yarn-error.log* # Editor .vscode +.idea # Misc .DS_Store From 533a5e490f2c6354898e17823eb44b1175b3d6da Mon Sep 17 00:00:00 2001 From: Andrey Kucherenko Date: Thu, 1 Aug 2024 12:13:36 +0300 Subject: [PATCH 2/8] feat(template): add teable template (one more no/low-code database) --- apps/dokploy/public/templates/teable.png | Bin 0 -> 757 bytes .../templates/teable/docker-compose.yml | 83 ++++++++++++++++++ apps/dokploy/templates/teable/index.ts | 41 +++++++++ apps/dokploy/templates/templates.ts | 15 ++++ 4 files changed, 139 insertions(+) create mode 100644 apps/dokploy/public/templates/teable.png create mode 100644 apps/dokploy/templates/teable/docker-compose.yml create mode 100644 apps/dokploy/templates/teable/index.ts diff --git a/apps/dokploy/public/templates/teable.png b/apps/dokploy/public/templates/teable.png new file mode 100644 index 0000000000000000000000000000000000000000..f2b938d857f69ba412fe2509ffd68c30726b6bb6 GIT binary patch literal 757 zcmV)-jS%h4S%8NY!rZ{p5s95X(Fwc=oP;X)ZfT@IB zf*WlX05cD{6!h2}0A?3*DJo+I0J9yrlvY?305b%+lvh>-08@m^|6WZE0LOl*Q_cV| zH@NV>HaJ%Rj{UQKp#kK}XI%)OUxVNPm~&jLsG^|(oGfMlfCT}-jNmf!UkHFTTx3?A z$rfOL4j*=se_hjI%Az-dbG5V%Fy7dbgMV^r7C?WAK@grI7tyDz0J!`}guBA?$^p3i zNQBR_bISp^{D|bAB@-Ytz^aJzzt9G#uD>YVzXf3c_@|!$1RwwbFy;U9I>%8n0^|mu zH*yh;Ab=u(Zvp{y0p_F!fB*y_009U<00Iy|&}T&e0{BYk0ubPkE&u_X9smIdKmY>N zC^!HDEJbzy6+aK)Ct?I3009U<00I!e8o+K{00PX?1t36mEdT=e^Z^Kv(FGtt3&Q|C z13lXdn*ct;02LJ8WJ3jDs5t;%K!EBt0epr5K8AlbYXClT0KPN)_5pl) z0MRKtmkK~dt%C~gFt{Rku9^A(!Z0iK0mN^y-wd_$)wcPGm>~X^qyj(ygo*@^0|Z4# z`0`t60F)*GLiss=s2A?0dlQ9zm<`B9bg3Y3QOXk_oJrX7o8|X!f9MBUAVAofkmc7v zP9MOB*(N}^8}sG27o2rLcz|%1{1lGi@*hdgsBxF%0_2kLw;{k+0h+4Zriz(@T*|wx zdYvt%S(*XN+$YTCD+73h4FB0t1n>yU6TbY``ZsE)^Io!LvAk0rGb6@J&!9$$xzrz1 n6jd@@MfneKnFU}3AOQOcNlc^c!FH9n00000NkvXXu0mjf import("./jellyfin/index").then((m) => m.generate), }, + { + id: "teable", + name: "teable", + version: "v1.2.0-beta", + description: + "Teable is a Super fast, Real-time, Professional, Developer friendly, No-code database built on Postgres. It uses a simple, spreadsheet-like interface to create complex enterprise-level database applications. Unlock efficient app development with no-code, free from the hurdles of data security and scalability.", + logo: "teable.png", + links: { + github: "https://github.com/teableio/teable", + website: "https://teable.io/", + docs: "https://help.teable.io/", + }, + tags: ["database", "spreadsheet", "low-code", "nocode"], + load: () => import("./teable/index").then((m) => m.generate), + }, ]; From dc626f1a946698e906a189836602ec9882e2388c Mon Sep 17 00:00:00 2001 From: Andrey Kucherenko Date: Thu, 1 Aug 2024 13:00:03 +0300 Subject: [PATCH 3/8] chore(lint): fix formating --- apps/dokploy/templates/teable/index.ts | 71 +++++++++++++------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/apps/dokploy/templates/teable/index.ts b/apps/dokploy/templates/teable/index.ts index e35819589..aeccc9e3c 100644 --- a/apps/dokploy/templates/teable/index.ts +++ b/apps/dokploy/templates/teable/index.ts @@ -1,41 +1,42 @@ import { - type Schema, - type Template, - generateHash, - generateRandomDomain, generatePassword, + type Schema, + type Template, + generateHash, + generatePassword, + generateRandomDomain, } from "../utils"; export function generate(schema: Schema): Template { - const mainServiceHash = generateHash(schema.projectName); - const password = generatePassword(); - const randomDomain = generateRandomDomain(schema); - const envs = [ - `TEABLE_HOST=${randomDomain}`, - `TEABLE_PORT=3000`, - `HASH=${mainServiceHash}`, - `TIMEZONE=UTC`, - `# Postgres`, - `POSTGRES_HOST=teable-db`, - `POSTGRES_PORT=5432`, - `POSTGRES_DB=teable`, - `POSTGRES_USER=teable`, - `POSTGRES_PASSWORD=${password}`, - `# App`, - `PUBLIC_ORIGIN=https://\${TABLE_HOST}`, - `PRISMA_DATABASE_URL=postgresql://\${POSTGRES_USER}:\${POSTGRES_PASSWORD}@\${POSTGRES_HOST}:\${POSTGRES_PORT}/\${POSTGRES_DB}`, - `PUBLIC_DATABASE_PROXY=127.0.0.1:42345`, - `# Need to support sending emails to enable the following configurations`, - `# You need to modify the configuration according to the actual situation, otherwise it will not be able to send emails correctly.`, - `#BACKEND_MAIL_HOST=smtp.teable.io`, - `#BACKEND_MAIL_PORT=465`, - `#BACKEND_MAIL_SECURE=true`, - `#BACKEND_MAIL_SENDER=noreply.teable.io`, - `#BACKEND_MAIL_SENDER_NAME=Teable`, - `#BACKEND_MAIL_AUTH_USER=username`, - `#BACKEND_MAIL_AUTH_PASS=password`, - ]; + const mainServiceHash = generateHash(schema.projectName); + const password = generatePassword(); + const randomDomain = generateRandomDomain(schema); + const envs = [ + `TEABLE_HOST=${randomDomain}`, + "TEABLE_PORT=3000", + `HASH=${mainServiceHash}`, + "TIMEZONE=UTC", + "# Postgres", + "POSTGRES_HOST=teable-db", + "POSTGRES_PORT=5432", + "POSTGRES_DB=teable", + "POSTGRES_USER=teable", + `POSTGRES_PASSWORD=${password}`, + "# App", + "PUBLIC_ORIGIN=https://${TABLE_HOST}", + "PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}", + "PUBLIC_DATABASE_PROXY=127.0.0.1:42345", + "# Need to support sending emails to enable the following configurations", + "# You need to modify the configuration according to the actual situation, otherwise it will not be able to send emails correctly.", + "#BACKEND_MAIL_HOST=smtp.teable.io", + "#BACKEND_MAIL_PORT=465", + "#BACKEND_MAIL_SECURE=true", + "#BACKEND_MAIL_SENDER=noreply.teable.io", + "#BACKEND_MAIL_SENDER_NAME=Teable", + "#BACKEND_MAIL_AUTH_USER=username", + "#BACKEND_MAIL_AUTH_PASS=password", + ]; - return { - envs, - }; + return { + envs, + }; } From 06355ff08929a0b4dd32e7ae6f5a00d765177942 Mon Sep 17 00:00:00 2001 From: Andrey Kucherenko Date: Thu, 1 Aug 2024 19:27:07 +0300 Subject: [PATCH 4/8] fix(taeble): version and env variables --- apps/dokploy/templates/teable/docker-compose.yml | 2 +- apps/dokploy/templates/teable/index.ts | 2 +- apps/dokploy/templates/templates.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dokploy/templates/teable/docker-compose.yml b/apps/dokploy/templates/teable/docker-compose.yml index 13bf69642..62de19a11 100644 --- a/apps/dokploy/templates/teable/docker-compose.yml +++ b/apps/dokploy/templates/teable/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.9' services: teable: - image: ghcr.io/teableio/teable:1.2.0-beta + image: ghcr.io/teableio/teable:1.3.1-alpha-build.460 restart: always ports: - ${TEABLE_PORT} diff --git a/apps/dokploy/templates/teable/index.ts b/apps/dokploy/templates/teable/index.ts index aeccc9e3c..598a34df4 100644 --- a/apps/dokploy/templates/teable/index.ts +++ b/apps/dokploy/templates/teable/index.ts @@ -22,7 +22,7 @@ export function generate(schema: Schema): Template { "POSTGRES_USER=teable", `POSTGRES_PASSWORD=${password}`, "# App", - "PUBLIC_ORIGIN=https://${TABLE_HOST}", + "PUBLIC_ORIGIN=https://${TAEBLE_HOST}", "PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}", "PUBLIC_DATABASE_PROXY=127.0.0.1:42345", "# Need to support sending emails to enable the following configurations", diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index ed8b720d3..6e4867ba9 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -396,7 +396,7 @@ export const templates: TemplateData[] = [ { id: "teable", name: "teable", - version: "v1.2.0-beta", + version: "v1.3.1-alpha-build.460", description: "Teable is a Super fast, Real-time, Professional, Developer friendly, No-code database built on Postgres. It uses a simple, spreadsheet-like interface to create complex enterprise-level database applications. Unlock efficient app development with no-code, free from the hurdles of data security and scalability.", logo: "teable.png", From 4bf44b32756585666cd1a0e4d062743022ec2aa3 Mon Sep 17 00:00:00 2001 From: apk Date: Thu, 1 Aug 2024 22:05:36 +0300 Subject: [PATCH 5/8] fix(docker-compose): issue with volumes, issue with database connection --- apps/dokploy/templates/teable/docker-compose.yml | 14 +++++++++----- apps/dokploy/templates/teable/index.ts | 5 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/apps/dokploy/templates/teable/docker-compose.yml b/apps/dokploy/templates/teable/docker-compose.yml index 62de19a11..9be0b4d32 100644 --- a/apps/dokploy/templates/teable/docker-compose.yml +++ b/apps/dokploy/templates/teable/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.9' +version: "3.9" services: teable: @@ -7,7 +7,7 @@ services: ports: - ${TEABLE_PORT} volumes: - - teable-data:/app/.assets:rw + - teable-data:/app/.assets # you may use a bind-mounted host directory instead, # so that it is harder to accidentally remove the volume and lose all your data! # - ./docker/teable/data:/app/.assets:rw @@ -39,9 +39,9 @@ services: image: postgres:15.4 restart: always ports: - - '42345:5432' + - "${TEABLE_DB_PORT}:${POSTGRES_PORT}" volumes: - - teable-db:/var/lib/postgresql/data:rw + - teable-db:/var/lib/postgresql/data # you may use a bind-mounted host directory instead, # so that it is harder to accidentally remove the volume and lose all your data! # - ./docker/db/data:/var/lib/postgresql/data:rw @@ -54,7 +54,11 @@ services: - dokploy-network - teable-standalone healthcheck: - test: ['CMD-SHELL', "sh -c 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'"] + test: + [ + "CMD-SHELL", + "sh -c 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'", + ] interval: 10s timeout: 3s retries: 3 diff --git a/apps/dokploy/templates/teable/index.ts b/apps/dokploy/templates/teable/index.ts index 598a34df4..3eb3ca603 100644 --- a/apps/dokploy/templates/teable/index.ts +++ b/apps/dokploy/templates/teable/index.ts @@ -13,6 +13,7 @@ export function generate(schema: Schema): Template { const envs = [ `TEABLE_HOST=${randomDomain}`, "TEABLE_PORT=3000", + "TEABLE_DB_PORT=42345", `HASH=${mainServiceHash}`, "TIMEZONE=UTC", "# Postgres", @@ -22,9 +23,9 @@ export function generate(schema: Schema): Template { "POSTGRES_USER=teable", `POSTGRES_PASSWORD=${password}`, "# App", - "PUBLIC_ORIGIN=https://${TAEBLE_HOST}", + "PUBLIC_ORIGIN=https://${TEABLE_HOST}", "PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}", - "PUBLIC_DATABASE_PROXY=127.0.0.1:42345", + "PUBLIC_DATABASE_PROXY=${TEABLE_HOST}:${TEABLE_DB_PORT}", "# Need to support sending emails to enable the following configurations", "# You need to modify the configuration according to the actual situation, otherwise it will not be able to send emails correctly.", "#BACKEND_MAIL_HOST=smtp.teable.io", From bce1eb8907bb7d2ea447cf445f6aa00282ee0f11 Mon Sep 17 00:00:00 2001 From: apk Date: Fri, 2 Aug 2024 08:27:17 +0300 Subject: [PATCH 6/8] fix(teable): port for public database --- apps/dokploy/templates/teable/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/templates/teable/index.ts b/apps/dokploy/templates/teable/index.ts index 3eb3ca603..5446903ac 100644 --- a/apps/dokploy/templates/teable/index.ts +++ b/apps/dokploy/templates/teable/index.ts @@ -10,10 +10,15 @@ export function generate(schema: Schema): Template { const mainServiceHash = generateHash(schema.projectName); const password = generatePassword(); const randomDomain = generateRandomDomain(schema); + + const publicDbPort = ((min: number, max: number) => { + return Math.random() * (max - min) + min; + })(32769, 65534); + const envs = [ `TEABLE_HOST=${randomDomain}`, "TEABLE_PORT=3000", - "TEABLE_DB_PORT=42345", + `TEABLE_DB_PORT=${publicDbPort}`, `HASH=${mainServiceHash}`, "TIMEZONE=UTC", "# Postgres", From 9440fd89ae96f1c4be7b105ec0b839318291e3fe Mon Sep 17 00:00:00 2001 From: apk Date: Fri, 2 Aug 2024 08:29:53 +0300 Subject: [PATCH 7/8] fix(teable): round port for public database --- apps/dokploy/templates/teable/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dokploy/templates/teable/index.ts b/apps/dokploy/templates/teable/index.ts index 5446903ac..a4b9b7ed0 100644 --- a/apps/dokploy/templates/teable/index.ts +++ b/apps/dokploy/templates/teable/index.ts @@ -12,7 +12,7 @@ export function generate(schema: Schema): Template { const randomDomain = generateRandomDomain(schema); const publicDbPort = ((min: number, max: number) => { - return Math.random() * (max - min) + min; + return Math.round(Math.random() * (max - min) + min); })(32769, 65534); const envs = [ From 610f8fa5bcbae26c70838500d0759f56ce63b0ca Mon Sep 17 00:00:00 2001 From: apk Date: Fri, 2 Aug 2024 09:57:36 +0300 Subject: [PATCH 8/8] fix(teable): remove network --- apps/dokploy/templates/teable/docker-compose.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/apps/dokploy/templates/teable/docker-compose.yml b/apps/dokploy/templates/teable/docker-compose.yml index 9be0b4d32..478a73be0 100644 --- a/apps/dokploy/templates/teable/docker-compose.yml +++ b/apps/dokploy/templates/teable/docker-compose.yml @@ -26,7 +26,6 @@ services: - BACKEND_MAIL_AUTH_PASS=${BACKEND_MAIL_AUTH_PASS} networks: - dokploy-network - - teable-standalone labels: - "traefik.enable=true" - "traefik.http.routers.${HASH}.rule=Host(`${TEABLE_HOST}`)" @@ -52,7 +51,6 @@ services: - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} networks: - dokploy-network - - teable-standalone healthcheck: test: [ @@ -69,16 +67,12 @@ services: - TZ=${TIMEZONE} - PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} networks: - - teable-standalone - dokploy-network depends_on: teable-db: condition: service_healthy networks: - teable-standalone: - name: teable-standalone-network - driver: bridge dokploy-network: external: true