Compare commits

...

45 Commits

Author SHA1 Message Date
Andras Bacsai
5ff6c53715 Merge pull request #723 from coollabsio/next
v3.11.5
2022-11-11 08:28:37 +01:00
Andras Bacsai
3c94723b23 fix: show rollback button loading 2022-11-10 15:43:28 +01:00
Andras Bacsai
c6a2e3e328 update tags 2022-11-10 15:34:33 +01:00
Andras Bacsai
2dc5e10878 update tags 2022-11-10 15:33:57 +01:00
Andras Bacsai
4086dfcf56 rename lavalink 2022-11-10 15:32:13 +01:00
Andras Bacsai
7937c2bab0 Merge pull request #717 from kaname-png/next
chore: add jda icon for lavalink service
2022-11-10 15:31:37 +01:00
Andras Bacsai
5ffa8e9936 update templates 2022-11-10 15:29:44 +01:00
Andras Bacsai
c431cee517 fix: wp + mysql on arm 2022-11-10 15:01:03 +01:00
Andras Bacsai
375f17e728 debug 2022-11-10 14:52:37 +01:00
Andras Bacsai
d3f658c874 Readme fix 2022-11-10 14:17:20 +01:00
Andras Bacsai
5e340a4cdd fix: expose ports for services 2022-11-10 14:13:58 +01:00
Andras Bacsai
409a5b9f99 fix: n8n and weblate icon 2022-11-10 14:08:02 +01:00
Andras Bacsai
fba305020b fix: for rollback 2022-11-10 14:00:01 +01:00
Andras Bacsai
bd4ce3ac45 feat: rollback coolify 2022-11-10 13:57:34 +01:00
Andras Bacsai
c365a44e01 Merge pull request #719 from coollabsio/next
v3.11.4
2022-11-09 14:20:23 +01:00
Andras Bacsai
e94f450bf0 fix: doc links 2022-11-09 13:50:29 +01:00
Andras Bacsai
d5efc9ddde chore: version++ 2022-11-09 13:50:20 +01:00
Andras Bacsai
68895ba4a5 fix: variable replacements 2022-11-09 13:50:11 +01:00
Andras Bacsai
139aa7a0fc Merge pull request #718 from coollabsio/next
v3.11.3
2022-11-09 13:05:58 +01:00
Andras Bacsai
4955157e13 fix: compose webhooks fixed 2022-11-09 13:02:42 +01:00
Kaname
f2dd5cc75e chore: add jda icon for lavalink service 2022-11-08 12:39:41 -06:00
Andras Bacsai
2ad634dbc6 refactor: code 2022-11-08 15:51:07 +01:00
Andras Bacsai
de13f65a24 fix: umami template 2022-11-08 15:23:18 +01:00
Andras Bacsai
8994dde8f0 Merge pull request #715 from coollabsio/next
v3.11.2
2022-11-08 14:55:51 +01:00
Andras Bacsai
b7303a0828 fix: remove contribution docs 2022-11-08 14:44:54 +01:00
Andras Bacsai
5bc330162a Merge pull request #709 from gabrielengel/g-contribute
Organizing Contribution.md
2022-11-08 14:43:57 +01:00
Andras Bacsai
0ebc0217f3 fix: umami + ghost issues 2022-11-08 14:42:04 +01:00
Andras Bacsai
95c810b80a Merge pull request #714 from coollabsio/next
v3.11.2
2022-11-08 12:09:09 +01:00
Andras Bacsai
82d7fb883d fix: more simplified webhooks 2022-11-08 11:54:22 +01:00
Andras Bacsai
b96e710543 fix: remove ghost-mariadb from the list 2022-11-08 11:30:41 +01:00
Andras Bacsai
24e5e85225 revert staging release 2022-11-08 11:22:53 +01:00
Andras Bacsai
7b8f81f1b2 Merge pull request #713 from coollabsio/next
fixes
2022-11-08 11:21:41 +01:00
Andras Bacsai
62e60fc7ab fix: simplify webhooks 2022-11-08 11:15:56 +01:00
Andras Bacsai
ccd3d4aded fix: preview webhooks 2022-11-08 10:40:11 +01:00
Andras Bacsai
f0cf155b5c Merge pull request #712 from coollabsio/next
fix: migrate template
2022-11-08 10:33:20 +01:00
Andras Bacsai
b66f67d889 fix: migrate template 2022-11-08 10:19:02 +01:00
Andras Bacsai
e5dc07bde1 Merge pull request #711 from coollabsio/next
Quick fixes
2022-11-08 10:09:16 +01:00
Andras Bacsai
a955eb0fec fix: coolify instance proxy 2022-11-08 10:08:47 +01:00
Andras Bacsai
c070af9681 Merge pull request #710 from coollabsio/next
v3.11.1
2022-11-08 09:55:03 +01:00
Andras Bacsai
c15e060ef2 fix: appwrite webhook 2022-11-08 09:54:25 +01:00
Gabriel Engel
6d6f2454a7 Link Contribution on Readme 2022-11-07 19:02:59 -03:00
Gabriel Engel
9ff44ed46b Fix Typo 2022-11-07 18:58:54 -03:00
Gabriel Engel
adf3ef61b8 Link GettingStarted.md 2022-11-07 18:58:06 -03:00
Gabriel Engel
832107e0b8 Requirements 2022-11-07 18:56:14 -03:00
Gabriel Engel
0ea1e71808 Organizing contributing 2022-11-07 18:44:47 -03:00
31 changed files with 696 additions and 414 deletions

View File

@@ -1,5 +1,6 @@
.DS_Store .DS_Store
node_modules node_modules
.pnpm-store
build build
.svelte-kit .svelte-kit
package package
@@ -10,3 +11,7 @@ dist
client client
apps/api/db/*.db apps/api/db/*.db
local-serve local-serve
apps/api/db/migration.db-journal
apps/api/core*
logs
others/certificates

View File

@@ -1,57 +1,48 @@
# Contribution # Contributing
First, thanks for considering to contribute to my project. It really means a lot! :) > "First, thanks for considering to contribute to my project.
It really means a lot! 😁" - [@andrasbacsai](https://github.com/andrasbacsai)
You can ask for guidance anytime on our Discord server in the #contribution channel. You can ask for guidance anytime on our
[Discord server](https://coollabs.io/discord) in the `#contribution` channel.
## Setup your development environment You'll need a set of skills to [get started](docs/contribution/GettingStarted.md).
### Container based development flow (recommended and the easiest)
All you need is to intall [Docker Engine 20.11+](https://docs.docker.com/engine/install/) on your local machine and run `pnpm dev:container`. It will build the base image for Coolify and start the development server inside Docker. All required ports (3000, 3001) will be exposed to your host.
### Github codespaces ## 1) Setup your development environment
If you have github codespaces enabled then you can just create a codespace and run `pnpm dev` to run your the dev environment. All the required dependencies and packages has been configured for you already. - 🌟 [Container based](docs/dev_setup/Container.md) ← *Recomended*
- 📦 [DockerContainer](docs/dev_setup/DockerContiner.md) *WIP
- 🐙 [Github Codespaces](docs/dev_setup/GithubCodespaces.md)
- ☁️ [GitPod](docs/dev_setup/GitPod.md)
- 🍏 [Local Mac](docs/dev_setup/Mac.md)
### Gitpod ## 2) Basic requirements
1. Use [container based development flow](#container-based-development-flow-easiest)
2. Or setup your workspace manually:
Create a workspace from this repository, run `pnpm install && pnpm db:push && pnpm db:seed` and then `pnpm dev`. All the required dependencies and packages has been configured for you already. - [Install Pnpm](https://pnpm.io/installation)
- [Install Docker Engine](https://docs.docker.com/engine/install/)
- [Setup Docker Compose Plugin](https://docs.docker.com/compose/install/compose-plugin/)
- [Setup GIT LFS Support](https://git-lfs.github.com/)
> Some packages, just `pack` are not installed in this way. You cannot test all the features. Please use the [container based development flow](#container-based-development-flow-easiest). ## 3) Setup Coolify
### Local Machine - Copy `apps/api/.env.example` to `apps/api/.env`
> At the moment, Coolify `doesn't support Windows`. You must use `Linux` or `MacOS` or consider using Gitpod or Github Codespaces. - Edit `apps/api/.env`, set the `COOLIFY_APP_ID` environment variable to something cool.
- Run `pnpm install` to install dependencies.
- Run `pnpm db:push` to o create a local SQlite database. This will apply all migrations at `db/dev.db`.
- Run `pnpm db:seed` seed the database.
- Run `pnpm dev` start coding.
Install all the prerequisites manually to your host system. If you would not like to install anything, I suggest to use the [container based development flow](#container-based-development-flow-easiest). ```sh
# Or... Copy and paste commands bellow:
cp apps/api/.env.example apps/api.env
pnpm install
pnpm db:push
pnpm db:seed
pnpm dev
```
- Due to the lock file, this repository is best with [pnpm](https://pnpm.io). I recommend you try and use `pnpm` because it is cool and efficient! ## 4) Start Coding
- You need to have [Docker Engine](https://docs.docker.com/engine/install/) installed locally.
- You need to have [Docker Compose Plugin](https://docs.docker.com/compose/install/compose-plugin/) installed locally.
- You need to have [GIT LFS Support](https://git-lfs.github.com/) installed locally.
Optional: You should be able to access `http://localhost:3000`.
- To test Heroku buildpacks, you need [pack](https://github.com/buildpacks/pack) binary installed locally.
### Inside a Docker container 1. Click `Register` and setup your first user.
`WIP`
## Setup Coolify
- Copy `apps/api/.env.template` to `apps/api/.env.template` and set the `COOLIFY_APP_ID` environment variable to something cool.
- `pnpm install` to install dependencies.
- `pnpm db:push` to o create a local SQlite database.
This will apply all migrations at `db/dev.db`.
- `pnpm db:seed` seed the database.
- `pnpm dev` start coding.
## Technical skills required
- **Languages**: Node.js / Javascript / Typescript
- **Framework JS/TS**: [SvelteKit](https://kit.svelte.dev/) & [Fastify](https://www.fastify.io/)
- **Database ORM**: [Prisma.io](https://www.prisma.io/)
- **Docker Engine API**
## How to add a new service?
You can find all details [here](https://github.com/coollabsio/coolify-community-templates)

View File

@@ -93,18 +93,20 @@ Deploy your resource to:
- [Fider](https://fider.io) - [Fider](https://fider.io)
- [Hasura](https://hasura.io) - [Hasura](https://hasura.io)
- [GlitchTip](https://glitchtip.com) - [GlitchTip](https://glitchtip.com)
- And more...
## Migration from v1
A fresh installation is necessary. v2 and v3 are not compatible with v1.
## Support ## Support
- Twitter: [@andrasbacsai](https://twitter.com/andrasbacsai) - Mastodon: [@andrasbacsai@fosstodon.org](https://fosstodon.org/@andrasbacsai)
- Telegram: [@andrasbacsai](https://t.me/andrasbacsai) - Telegram: [@andrasbacsai](https://t.me/andrasbacsai)
- Twitter: [@andrasbacsai](https://twitter.com/andrasbacsai)
- Email: [andras@coollabs.io](mailto:andras@coollabs.io) - Email: [andras@coollabs.io](mailto:andras@coollabs.io)
- Discord: [Invitation](https://coollabs.io/discord) - Discord: [Invitation](https://coollabs.io/discord)
## Development Contributions
Coolify is developed under the Apache License and you can help to make it grow → [Start coding!](./CONTRIBUTION.md)
## Financial Contributors ## Financial Contributors
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/coollabsio/contribute)] Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/coollabsio/contribute)]

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,65 @@
- templateVersion: 1.0.0
defaultVersion: v3.6
documentation: https://github.com/freyacodes/Lavalink
description: Standalone audio sending node based on Lavaplayer.
type: lavalink
name: Lavalink
labels:
- discord
- discord bot
- audio
- lavalink
- jda
services:
$$id:
name: Lavalink
image: fredboat/lavalink:$$core_version
environment: []
volumes:
- $$id-lavalink:/lavalink
ports:
- "2333"
files:
- location: /opt/Lavalink/application.yml
content: >-
server:
port: $$config_port
address: 0.0.0.0
lavalink:
server:
password: "$$secret_password"
sources:
youtube: true
bandcamp: true
soundcloud: true
twitch: true
vimeo: true
http: true
local: false
logging:
file:
path: ./logs/
level:
root: INFO
lavalink: INFO
logback:
rollingpolicy:
max-file-size: 1GB
max-history: 30
variables:
- id: $$config_port
name: PORT
label: Port
defaultValue: '2333'
required: true
- id: $$secret_password
name: PASSWORD
label: Password
defaultValue: $$generate_password
required: true
- templateVersion: 1.0.0 - templateVersion: 1.0.0
defaultVersion: v1.8.6 defaultVersion: v1.8.6
documentation: https://docs.appsmith.com/getting-started/setup/instance-configuration/ documentation: https://docs.appsmith.com/getting-started/setup/instance-configuration/
@@ -786,6 +848,11 @@
label: MariaDB | _APP_DB_USER label: MariaDB | _APP_DB_USER
defaultValue: user defaultValue: user
description: MariaDB server user name. description: MariaDB server user name.
- id: "$$secret__app_db_root_pass"
name: MARIADB_ROOT_PASSWORD
label: MariaDB | MARIADB_ROOT_PASSWORD
defaultValue: "$$generate_hex(16)"
description: MariaDB server root user password.
- id: "$$secret__app_db_pass" - id: "$$secret__app_db_pass"
name: _APP_DB_PASS name: _APP_DB_PASS
label: MariaDB | _APP_DB_PASS label: MariaDB | _APP_DB_PASS
@@ -1659,7 +1726,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"
@@ -1673,7 +1739,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:
@@ -1866,7 +2138,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:
@@ -1886,8 +2158,9 @@
description: "" description: ""
showOnConfiguration: true showOnConfiguration: true
- templateVersion: 1.0.0 - templateVersion: 1.0.0
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)
@@ -1899,7 +2172,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"
@@ -2005,7 +2277,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)
@@ -2014,7 +2286,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"
@@ -2070,7 +2341,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)
@@ -2079,7 +2350,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"
@@ -2160,7 +2430,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"
@@ -2178,7 +2447,7 @@
name: MySQL name: MySQL
depends_on: [] depends_on: []
image: "bitnami/mysql:5.7" image: "bitnami/mysql:5.7"
imageArm: "mysql:5.7" imageArm: "mysql:8.0"
volumes: volumes:
- "$$id-mysql-data:/bitnami/mysql/data" - "$$id-mysql-data:/bitnami/mysql/data"
volumesArm: volumesArm:
@@ -2251,7 +2520,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"
@@ -2325,7 +2593,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:
@@ -2357,7 +2624,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:
@@ -2417,7 +2683,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:
@@ -2437,7 +2702,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:
@@ -2540,7 +2804,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:
@@ -2573,7 +2836,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"
@@ -2595,7 +2857,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"
@@ -2605,7 +2866,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"

View File

@@ -173,7 +173,13 @@ const host = '0.0.0.0';
// Refresh and check templates // Refresh and check templates
setInterval(async () => { setInterval(async () => {
await refreshTemplates() await refreshTemplates()
}, 60000)
setInterval(async () => {
await refreshTags() await refreshTags()
}, 60000)
setInterval(async () => {
await migrateServicesToNewTemplate() await migrateServicesToNewTemplate()
}, 60000) }, 60000)

View File

@@ -1,5 +1,5 @@
import cuid from "cuid"; import cuid from "cuid";
import { decrypt, encrypt, fixType, generatePassword, getDomain, prisma } from "./lib/common"; import { decrypt, encrypt, fixType, generatePassword, prisma } from "./lib/common";
import { getTemplates } from "./lib/services"; import { getTemplates } from "./lib/services";
export async function migrateServicesToNewTemplate() { export async function migrateServicesToNewTemplate() {
@@ -30,85 +30,92 @@ export async function migrateServicesToNewTemplate() {
} }
}) })
for (const service of services) { for (const service of services) {
const { id } = service try {
if (!service.type) { const { id } = service
continue; if (!service.type) {
} continue;
let template = templates.find(t => fixType(t.type) === fixType(service.type)); }
if (template) { let template = templates.find(t => fixType(t.type) === fixType(service.type));
template = JSON.parse(JSON.stringify(template).replaceAll('$$id', service.id)) if (template) {
if (service.type === 'plausibleanalytics' && service.plausibleAnalytics) await plausibleAnalytics(service, template) template = JSON.parse(JSON.stringify(template).replaceAll('$$id', service.id))
if (service.type === 'fider' && service.fider) await fider(service, template) if (service.type === 'plausibleanalytics' && service.plausibleAnalytics) await plausibleAnalytics(service, template)
if (service.type === 'minio' && service.minio) await minio(service, template) if (service.type === 'fider' && service.fider) await fider(service, template)
if (service.type === 'vscodeserver' && service.vscodeserver) await vscodeserver(service, template) if (service.type === 'minio' && service.minio) await minio(service, template)
if (service.type === 'wordpress' && service.wordpress) await wordpress(service, template) if (service.type === 'vscodeserver' && service.vscodeserver) await vscodeserver(service, template)
if (service.type === 'ghost' && service.ghost) await ghost(service, template) if (service.type === 'wordpress' && service.wordpress) await wordpress(service, template)
if (service.type === 'meilisearch' && service.meiliSearch) await meilisearch(service, template) if (service.type === 'ghost' && service.ghost) await ghost(service, template)
if (service.type === 'umami' && service.umami) await umami(service, template) if (service.type === 'meilisearch' && service.meiliSearch) await meilisearch(service, template)
if (service.type === 'hasura' && service.hasura) await hasura(service, template) if (service.type === 'umami' && service.umami) await umami(service, template)
if (service.type === 'glitchTip' && service.glitchTip) await glitchtip(service, template) if (service.type === 'hasura' && service.hasura) await hasura(service, template)
if (service.type === 'searxng' && service.searxng) await searxng(service, template) if (service.type === 'glitchTip' && service.glitchTip) await glitchtip(service, template)
if (service.type === 'weblate' && service.weblate) await weblate(service, template) if (service.type === 'searxng' && service.searxng) await searxng(service, template)
if (service.type === 'appwrite' && service.appwrite) await appwrite(service, template) if (service.type === 'weblate' && service.weblate) await weblate(service, template)
if (service.type === 'appwrite' && service.appwrite) await appwrite(service, template)
await createVolumes(service, template); try {
await createVolumes(service, template);
} catch (error) {
console.log(error)
}
if (template.variables.length > 0) { if (template.variables.length > 0) {
for (const variable of template.variables) {
const { defaultValue } = variable;
const regex = /^\$\$.*\((\d+)\)$/g;
const length = Number(regex.exec(defaultValue)?.[1]) || undefined
if (variable.defaultValue.startsWith('$$generate_password')) {
variable.value = generatePassword({ length });
} else if (variable.defaultValue.startsWith('$$generate_hex')) {
variable.value = generatePassword({ length, isHex: true });
} else if (variable.defaultValue.startsWith('$$generate_username')) {
variable.value = cuid();
} else {
variable.value = variable.defaultValue || '';
}
}
}
for (const variable of template.variables) { for (const variable of template.variables) {
const { defaultValue } = variable; if (variable.id.startsWith('$$secret_')) {
const regex = /^\$\$.*\((\d+)\)$/g; const found = await prisma.serviceSecret.findFirst({ where: { name: variable.name, serviceId: id } })
const length = Number(regex.exec(defaultValue)?.[1]) || undefined if (!found) {
if (variable.defaultValue.startsWith('$$generate_password')) { await prisma.serviceSecret.create({
variable.value = generatePassword({ length }); data: { name: variable.name, value: encrypt(variable.value) || '', service: { connect: { id } } }
} else if (variable.defaultValue.startsWith('$$generate_hex')) { })
variable.value = generatePassword({ length, isHex: true }); }
} else if (variable.defaultValue.startsWith('$$generate_username')) {
variable.value = cuid();
} else {
variable.value = variable.defaultValue || '';
}
}
}
for (const variable of template.variables) {
if (variable.id.startsWith('$$secret_')) {
const found = await prisma.serviceSecret.findFirst({ where: { name: variable.name, serviceId: id } })
if (!found) {
await prisma.serviceSecret.create({
data: { name: variable.name, value: encrypt(variable.value) || '', service: { connect: { id } } }
})
}
} }
if (variable.id.startsWith('$$config_')) { if (variable.id.startsWith('$$config_')) {
const found = await prisma.serviceSetting.findFirst({ where: { name: variable.name, serviceId: id } }) const found = await prisma.serviceSetting.findFirst({ where: { name: variable.name, serviceId: id } })
if (!found) { if (!found) {
await prisma.serviceSetting.create({ await prisma.serviceSetting.create({
data: { name: variable.name, value: variable.value.toString(), variableName: variable.id, service: { connect: { id } } } data: { name: variable.name, value: variable.value.toString(), variableName: variable.id, service: { connect: { id } } }
}) })
}
} }
} }
} for (const s of Object.keys(template.services)) {
for (const s of Object.keys(template.services)) { if (service.type === 'plausibleanalytics') {
if (service.type === 'plausibleanalytics') { continue;
continue; }
} if (template.services[s].volumes) {
if (template.services[s].volumes) { for (const volume of template.services[s].volumes) {
for (const volume of template.services[s].volumes) { const [volumeName, path] = volume.split(':')
const [volumeName, path] = volume.split(':') if (!volumeName.startsWith('/')) {
if (!volumeName.startsWith('/')) { const found = await prisma.servicePersistentStorage.findFirst({ where: { volumeName, serviceId: id } })
const found = await prisma.servicePersistentStorage.findFirst({ where: { volumeName, serviceId: id } }) if (!found) {
if (!found) { await prisma.servicePersistentStorage.create({
await prisma.servicePersistentStorage.create({ data: { volumeName, path, containerId: s, predefined: true, service: { connect: { id } } }
data: { volumeName, path, containerId: s, predefined: true, service: { connect: { id } } } });
}); }
} }
} }
} }
} }
await prisma.service.update({ where: { id }, data: { templateVersion: template.templateVersion } })
} }
await prisma.service.update({ where: { id }, data: { templateVersion: template.templateVersion } }) } catch (error) {
console.log(error)
} }
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error)
@@ -231,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}`,
@@ -246,6 +252,8 @@ async function umami(service: any, template: any) {
await migrateSettings(settings, service, template); await migrateSettings(settings, service, template);
await migrateSecrets(secrets, service); await migrateSecrets(secrets, service);
await prisma.service.update({ where: { id: service.id }, data: { type: "umami-postgresql" } })
// Disconnect old service data // Disconnect old service data
// await prisma.service.update({ where: { id: service.id }, data: { umami: { disconnect: true } } }) // await prisma.service.update({ where: { id: service.id }, data: { umami: { disconnect: true } } })
} }
@@ -433,33 +441,41 @@ async function plausibleAnalytics(service: any, template: any) {
async function migrateSettings(settings: any[], service: any, template: any) { async function migrateSettings(settings: any[], service: any, template: any) {
for (const setting of settings) { for (const setting of settings) {
if (!setting) continue; try {
let [name, value] = setting.split('@@@') if (!setting) continue;
let minio = name let [name, value] = setting.split('@@@')
if (name === 'MINIO_SERVER_URL') { let minio = name
name = 'coolify_fqdn_minio_console' if (name === 'MINIO_SERVER_URL') {
} name = 'coolify_fqdn_minio_console'
if (!value || value === 'null') { }
continue; if (!value || value === 'null') {
} continue;
let variableName = template.variables.find((v: any) => v.name === name)?.id }
if (!variableName) { let variableName = template.variables.find((v: any) => v.name === name)?.id
variableName = `$$config_${name.toLowerCase()}` if (!variableName) {
} variableName = `$$config_${name.toLowerCase()}`
// console.log('Migrating setting', name, value, 'for service', service.id, ', service name:', service.name, 'variableName: ', variableName) }
// console.log('Migrating setting', name, value, 'for service', service.id, ', service name:', service.name, 'variableName: ', variableName)
await prisma.serviceSetting.findFirst({ where: { name: minio, serviceId: service.id } }) || await prisma.serviceSetting.create({ data: { name: minio, value, variableName, service: { connect: { id: service.id } } } }) await prisma.serviceSetting.findFirst({ where: { name: minio, serviceId: service.id } }) || await prisma.serviceSetting.create({ data: { name: minio, value, variableName, service: { connect: { id: service.id } } } })
} catch(error) {
console.log(error)
}
} }
} }
async function migrateSecrets(secrets: any[], service: any) { async function migrateSecrets(secrets: any[], service: any) {
for (const secret of secrets) { for (const secret of secrets) {
if (!secret) continue; try {
let [name, value] = secret.split('@@@') if (!secret) continue;
if (!value || value === 'null') { let [name, value] = secret.split('@@@')
continue if (!value || value === 'null') {
continue
}
// console.log('Migrating secret', name, value, 'for service', service.id, ', service name:', service.name)
await prisma.serviceSecret.findFirst({ where: { name, serviceId: service.id } }) || await prisma.serviceSecret.create({ data: { name, value, service: { connect: { id: service.id } } } })
} catch(error) {
console.log(error)
} }
// console.log('Migrating secret', name, value, 'for service', service.id, ', service name:', service.name)
await prisma.serviceSecret.findFirst({ where: { name, serviceId: service.id } }) || await prisma.serviceSecret.create({ data: { name, value, service: { connect: { id: service.id } } } })
} }
} }
async function createVolumes(service: any, template: any) { async function createVolumes(service: any, template: any) {

View File

@@ -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.0'; export const version = '3.11.5';
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';
@@ -972,7 +972,7 @@ export function generateDatabaseConfiguration(database: any, arch: string): Data
} }
} }
export function isARM(arch: string) { export function isARM(arch: string) {
if (arch === 'arm' || arch === 'arm64') { if (arch === 'arm' || arch === 'arm64' || arch === 'aarch' || arch === 'aarch64') {
return true; return true;
} }
return false; return false;

View File

@@ -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 []
} }

View File

@@ -34,7 +34,7 @@ export async function startService(request: FastifyRequest<ServiceStartStop>, fa
const { id } = request.params; const { id } = request.params;
const teamId = request.user.teamId; const teamId = request.user.teamId;
const service = await getServiceFromDB({ id, teamId }); const service = await getServiceFromDB({ id, teamId });
const arm = isARM(service.arch) const arm = isARM(process.arch);
const { type, destinationDockerId, destinationDocker, persistentStorage, exposePort } = const { type, destinationDockerId, destinationDocker, persistentStorage, exposePort } =
service; service;
@@ -103,15 +103,22 @@ export async function startService(request: FastifyRequest<ServiceStartStop>, fa
} }
} }
} }
let port = null
if (template.services[s].ports?.length > 0) {
port = template.services[s].ports[0]
}
let image = template.services[s].image
if (arm && template.services[s].imageArm) {
image = template.services[s].imageArm
}
config[s] = { config[s] = {
container_name: s, container_name: s,
build: template.services[s].build || undefined, build: template.services[s].build || undefined,
command: template.services[s].command, command: template.services[s].command,
entrypoint: template.services[s]?.entrypoint, entrypoint: template.services[s]?.entrypoint,
image: arm ? template.services[s].imageArm : template.services[s].image, image,
expose: template.services[s].ports, expose: template.services[s].ports,
...(exposePort ? { ports: [`${exposePort}:${exposePort}`] } : {}), ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
volumes: Array.from(volumes), volumes: Array.from(volumes),
environment: newEnvironments, environment: newEnvironments,
depends_on: template.services[s]?.depends_on, depends_on: template.services[s]?.depends_on,
@@ -121,6 +128,7 @@ export async function startService(request: FastifyRequest<ServiceStartStop>, fa
labels: makeLabelForServices(type), labels: makeLabelForServices(type),
...defaultComposeConfiguration(network), ...defaultComposeConfiguration(network),
} }
console.log(config[s].image)
// Generate files for builds // Generate files for builds
if (template.services[s]?.files?.length > 0) { if (template.services[s]?.files?.length > 0) {

View File

@@ -49,10 +49,6 @@ export async function refreshTags() {
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error)
throw {
status: 500,
message: 'Could not fetch templates from get.coollabs.io'
};
} }
return {}; return {};
@@ -73,12 +69,7 @@ export async function refreshTemplates() {
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error)
throw {
status: 500,
message: 'Could not fetch templates from get.coollabs.io'
};
} }
return {}; return {};
} catch ({ status, message }) { } catch ({ status, message }) {
return errorHandler({ status, message }); return errorHandler({ status, message });

View File

@@ -1,5 +1,5 @@
import { FastifyPluginAsync } from 'fastify'; import { FastifyPluginAsync } from 'fastify';
import { checkUpdate, login, showDashboard, update, resetQueue, getCurrentUser, cleanupManually, restartCoolify, refreshTemplates } from './handlers'; import { checkUpdate, login, showDashboard, update, resetQueue, getCurrentUser, cleanupManually, restartCoolify } from './handlers';
import { GetCurrentUser } from './types'; import { GetCurrentUser } from './types';
export interface Update { export interface Update {
@@ -52,10 +52,6 @@ const root: FastifyPluginAsync = async (fastify): Promise<void> => {
fastify.post('/internal/cleanup', { fastify.post('/internal/cleanup', {
onRequest: [fastify.authenticate] onRequest: [fastify.authenticate]
}, async (request) => await cleanupManually(request)); }, async (request) => await cleanupManually(request));
fastify.post('/internal/refreshTemplates', {
onRequest: [fastify.authenticate]
}, async () => await refreshTemplates());
}; };
export default root; export default root;

View File

@@ -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, "\"")
} }
} }
} }

View File

@@ -3,9 +3,9 @@ import { errorHandler, getDomain, isDev, prisma, executeDockerCmd, fixType } fro
import { getTemplates } from "../../../lib/services"; import { getTemplates } from "../../../lib/services";
import { OnlyId } from "../../../types"; import { OnlyId } from "../../../types";
function generateServices(id, containerId, port) { function generateServices(serviceId, containerId, port) {
return { return {
[`${id}-${port || 'default'}`]: { [serviceId]: {
loadbalancer: { loadbalancer: {
servers: [ servers: [
{ {
@@ -16,18 +16,18 @@ function generateServices(id, containerId, port) {
} }
} }
} }
function generateRouters(id, domain, nakedDomain, pathPrefix, isHttps, isWWW, isDualCerts, isCustomSSL) { function generateRouters(serviceId, domain, nakedDomain, pathPrefix, isHttps, isWWW, isDualCerts, isCustomSSL) {
let http: any = { let http: any = {
entrypoints: ['web'], entrypoints: ['web'],
rule: `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`, rule: `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${serviceId}`,
priority: 2, priority: 2,
middlewares: [] middlewares: []
} }
let https: any = { let https: any = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`, rule: `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${serviceId}`,
priority: 2, priority: 2,
tls: { tls: {
certresolver: 'letsencrypt' certresolver: 'letsencrypt'
@@ -37,14 +37,14 @@ function generateRouters(id, domain, nakedDomain, pathPrefix, isHttps, isWWW, is
let httpWWW: any = { let httpWWW: any = {
entrypoints: ['web'], entrypoints: ['web'],
rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`, rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${serviceId}`,
priority: 2, priority: 2,
middlewares: [] middlewares: []
} }
let httpsWWW: any = { let httpsWWW: any = {
entrypoints: ['websecure'], entrypoints: ['websecure'],
rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`, rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,
service: `${id}`, service: `${serviceId}`,
priority: 2, priority: 2,
tls: { tls: {
certresolver: 'letsencrypt' certresolver: 'letsencrypt'
@@ -129,10 +129,10 @@ function generateRouters(id, domain, nakedDomain, pathPrefix, isHttps, isWWW, is
} }
} }
return { return {
[id]: { ...http }, [`${serviceId}-${pathPrefix}`]: { ...http },
[`${id}-secure`]: { ...https }, [`${serviceId}-${pathPrefix}-secure`]: { ...https },
[`${id}-www`]: { ...httpWWW }, [`${serviceId}-${pathPrefix}-www`]: { ...httpWWW },
[`${id}-secure-www`]: { ...httpsWWW }, [`${serviceId}-${pathPrefix}-secure-www`]: { ...httpsWWW },
} }
} }
export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote: boolean = false) { export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote: boolean = false) {
@@ -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) {
@@ -310,9 +309,10 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const pathPrefix = '/' const pathPrefix = '/'
const isCustomSSL = false; const isCustomSSL = false;
const dualCerts = false; const dualCerts = false;
const serviceId = `${id}-${port || 'default'}`
traefik.http.routers = { ...traefik.http.routers, ...generateRouters(`${id}-${port || 'default'}`, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) } traefik.http.routers = { ...traefik.http.routers, ...generateRouters(serviceId, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) }
traefik.http.services = { ...traefik.http.services, ...generateServices(id, containerId, port) } traefik.http.services = { ...traefik.http.services, ...generateServices(serviceId, containerId, port) }
} }
} }
} }
@@ -328,9 +328,9 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const isHttps = fqdn.startsWith('https://'); const isHttps = fqdn.startsWith('https://');
const isWWW = fqdn.includes('www.'); const isWWW = fqdn.includes('www.');
const pathPrefix = '/' const pathPrefix = '/'
const serviceId = `${id}-${port || 'default'}`
traefik.http.routers = { ...traefik.http.routers, ...generateRouters(`${id}-${port || 'default'}`, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) } traefik.http.routers = { ...traefik.http.routers, ...generateRouters(serviceId, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) }
traefik.http.services = { ...traefik.http.services, ...generateServices(id, id, port) } traefik.http.services = { ...traefik.http.services, ...generateServices(serviceId, id, port) }
if (previews) { if (previews) {
const { stdout } = await executeDockerCmd({ dockerId, command: `docker container ls --filter="status=running" --filter="network=${network}" --filter="name=${id}-" --format="{{json .Names}}"` }) const { stdout } = await executeDockerCmd({ dockerId, command: `docker container ls --filter="status=running" --filter="network=${network}" --filter="name=${id}-" --format="{{json .Names}}"` })
const containers = stdout const containers = stdout
@@ -343,9 +343,9 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const previewDomain = `${container.split('-')[1]}.${domain}`; const previewDomain = `${container.split('-')[1]}.${domain}`;
const nakedDomain = previewDomain.replace(/^www\./, ''); const nakedDomain = previewDomain.replace(/^www\./, '');
const pathPrefix = '/' const pathPrefix = '/'
const serviceId = `${container}-${port || 'default'}`
traefik.http.routers = { ...traefik.http.routers, ...generateRouters(`${container}-${port || 'default'}`, previewDomain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) } traefik.http.routers = { ...traefik.http.routers, ...generateRouters(serviceId, previewDomain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) }
traefik.http.services = { ...traefik.http.services, ...generateServices(container, container, port) } traefik.http.services = { ...traefik.http.services, ...generateServices(serviceId, container, port) }
} }
} }
} }
@@ -412,7 +412,7 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
let port, pathPrefix, customDomain; let port, pathPrefix, customDomain;
if (configuration) { if (configuration) {
port = configuration?.port; port = configuration?.port;
pathPrefix = configuration?.pathPrefix || null; pathPrefix = configuration?.pathPrefix || '/';
customDomain = configuration?.domain customDomain = configuration?.domain
} }
if (customDomain) { if (customDomain) {
@@ -425,8 +425,9 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const isHttps = fqdn.startsWith('https://'); const isHttps = fqdn.startsWith('https://');
const isWWW = fqdn.includes('www.'); const isWWW = fqdn.includes('www.');
const isCustomSSL = false; const isCustomSSL = false;
traefik.http.routers = { ...traefik.http.routers, ...generateRouters(`${id}-${port || 'default'}`, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) } const serviceId = `${oneService}-${port || 'default'}`
traefik.http.services = { ...traefik.http.services, ...generateServices(id, id, port) } traefik.http.routers = { ...traefik.http.routers, ...generateRouters(serviceId, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) }
traefik.http.services = { ...traefik.http.services, ...generateServices(serviceId, oneService, port) }
} }
} else { } else {
if (found.services[oneService].ports && found.services[oneService].ports.length > 0) { if (found.services[oneService].ports && found.services[oneService].ports.length > 0) {
@@ -441,9 +442,9 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const isWWW = fqdn.includes('www.'); const isWWW = fqdn.includes('www.');
const pathPrefix = '/' const pathPrefix = '/'
const isCustomSSL = false const isCustomSSL = false
const serviceId = `${oneService}-${port || 'default'}`
traefik.http.routers = { ...traefik.http.routers, ...generateRouters(`${id}-${port || 'default'}`, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) } traefik.http.routers = { ...traefik.http.routers, ...generateRouters(serviceId, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) }
traefik.http.services = { ...traefik.http.services, ...generateServices(id, id, port) } traefik.http.services = { ...traefik.http.services, ...generateServices(serviceId, id, port) }
} }
} }
} }
@@ -466,9 +467,9 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const port = 3000 const port = 3000
const pathPrefix = '/' const pathPrefix = '/'
const isCustomSSL = false const isCustomSSL = false
const serviceId = `${id}-${port || 'default'}`
traefik.http.routers = { ...traefik.http.routers, ...generateRouters(`${id}-${port || 'default'}`, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) } traefik.http.routers = { ...traefik.http.routers, ...generateRouters(serviceId, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) }
traefik.http.services = { ...traefik.http.services, ...generateServices(id, container, port) } traefik.http.services = { ...traefik.http.services, ...generateServices(serviceId, container, port) }
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -16,9 +16,11 @@
updateStatus.loading = true; updateStatus.loading = true;
try { try {
if (dev) { if (dev) {
await asyncSleep(4000); localStorage.setItem('lastVersion', $appSession.version);
await asyncSleep(1000);
return window.location.reload(); return window.location.reload();
} else { } else {
localStorage.setItem('lastVersion', $appSession.version);
await post(`/update`, { type: 'update', latestVersion }); await post(`/update`, { type: 'update', latestVersion });
addToast({ addToast({
message: 'Update completed.<br><br>Waiting for the new version to start...', message: 'Update completed.<br><br>Waiting for the new version to start...',

View File

@@ -1,7 +1,6 @@
<script lang="ts"> <script lang="ts">
export let type: string; export let type: string;
export let isAbsolute = false; export let isAbsolute = false;
let extension = 'png'; let extension = 'png';
let svgs = [ let svgs = [
'languagetool', 'languagetool',
@@ -31,8 +30,14 @@
function generateClass() { function generateClass() {
switch (name) { switch (name) {
case 'n8n': case 'n8n':
if (isAbsolute) {
return 'w-12 h-12 absolute -m-9 -mt-12';
}
return 'w-12 h-12 -mt-3'; return 'w-12 h-12 -mt-3';
case 'weblate': case 'weblate':
if (isAbsolute) {
return 'w-12 h-12 absolute -m-9 -mt-12';
}
return 'w-12 h-12 -mt-3'; return 'w-12 h-12 -mt-3';
default: default:
return isAbsolute ? 'w-10 h-10 absolute -m-4 -mt-9 left-0' : 'w-10 h-10'; return isAbsolute ? 'w-10 h-10 absolute -m-4 -mt-9 left-0' : 'w-10 h-10';

View File

@@ -79,9 +79,7 @@
$isDeploymentEnabled = checkIfDeploymentEnabledServices($appSession.isAdmin, service); $isDeploymentEnabled = checkIfDeploymentEnabledServices($appSession.isAdmin, service);
let statusInterval: any; let statusInterval: any;
let loading = {
refreshTemplates: false
};
async function deleteService() { async function deleteService() {
const sure = confirm($t('application.confirm_to_delete', { name: service.name })); const sure = confirm($t('application.confirm_to_delete', { name: service.name }));
@@ -106,20 +104,6 @@
await startService(); await startService();
} }
} }
async function refreshTemplate() {
try {
loading.refreshTemplates = true;
await post(`/internal/refreshTemplates`, {});
addToast({
message: 'Services refreshed.',
type: 'success'
});
} catch (error) {
return errorNotification(error);
} finally {
loading.refreshTemplates = false;
}
}
async function stopService(skip = false) { async function stopService(skip = false) {
if (skip) { if (skip) {
$status.service.initialLoading = true; $status.service.initialLoading = true;
@@ -278,14 +262,6 @@
Delete Service Delete Service
</button> </button>
{/if} {/if}
{#if $page.url.pathname === `/services/${id}/configuration/type` && dev}
<button
disabled={loading.refreshTemplates}
class:loading={loading.refreshTemplates}
class="btn btn-sm btn-primary text-sm"
on:click={refreshTemplate}>Refresh Services List</button
>
{/if}
</div> </div>
</nav> </nav>
<div <div

View File

@@ -116,7 +116,7 @@
</div> </div>
<div class=" lg:pt-20 lg:p-0 px-8 pt-20"> <div class=" lg:pt-20 lg:p-0 px-8 pt-20">
<div class="grid grid-flow-rows grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8"> <div class="grid grid-flow-rows grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8">
{#each sortMe(filteredServices) as service} {#each sortMe(filteredServices).filter(s=> !s.ignore) as service}
{#key service.name} {#key service.name}
<button <button
on:click={() => handleSubmit(service)} on:click={() => handleSubmit(service)}

View File

@@ -24,6 +24,7 @@
import { addToast, appSession, features } from '$lib/store'; import { addToast, appSession, features } from '$lib/store';
import { asyncSleep, errorNotification, getDomain } from '$lib/common'; import { asyncSleep, errorNotification, getDomain } from '$lib/common';
import Explainer from '$lib/components/Explainer.svelte'; import Explainer from '$lib/components/Explainer.svelte';
import { dev } from '$app/env';
let isAPIDebuggingEnabled = settings.isAPIDebuggingEnabled; let isAPIDebuggingEnabled = settings.isAPIDebuggingEnabled;
let isRegistrationEnabled = settings.isRegistrationEnabled; let isRegistrationEnabled = settings.isRegistrationEnabled;
@@ -45,9 +46,61 @@
save: false, save: false,
remove: false, remove: false,
proxyMigration: false, proxyMigration: false,
restart: false restart: false,
rollback: false
}; };
let rollbackVersion = localStorage.getItem('lastVersion');
async function rollback() {
if (rollbackVersion) {
const sure = confirm(`Are you sure you want rollback Coolify to ${rollbackVersion}?`);
if (sure) {
try {
loading.rollback = true;
console.log('loading.rollback', loading.rollback);
if (dev) {
console.log('rolling back to', rollbackVersion);
await asyncSleep(4000);
return window.location.reload();
} else {
addToast({
message: 'Rollback started...',
type: 'success'
});
await post(`/update`, { type: 'update', latestVersion: rollbackVersion });
addToast({
message: 'Rollback completed.<br><br>Waiting for the new version to start...',
type: 'success'
});
let reachable = false;
let tries = 0;
do {
await asyncSleep(4000);
try {
await get(`/undead`);
reachable = true;
} catch (error) {
reachable = false;
}
if (reachable) break;
tries++;
} while (!reachable || tries < 120);
addToast({
message: 'New version reachable. Reloading...',
type: 'success'
});
await asyncSleep(3000);
return window.location.reload();
}
} catch (error) {
return errorNotification(error);
} finally {
loading.rollback = false;
}
}
}
}
async function removeFqdn() { async function removeFqdn() {
if (fqdn) { if (fqdn) {
loading.remove = true; loading.remove = true;
@@ -281,6 +334,17 @@
</div> </div>
{/if} {/if}
</div> </div>
<div class="grid grid-cols-2 items-center">
<Setting
id="dualCerts"
dataTooltip={$t('setting.must_remove_domain_before_changing')}
disabled={isFqdnSet}
bind:setting={dualCerts}
title={$t('application.ssl_www_and_non_www')}
description={$t('setting.generate_www_non_www_ssl')}
on:click={() => !isFqdnSet && changeSettings('dualCerts')}
/>
</div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<div> <div>
Default Redirect URL Default Redirect URL
@@ -300,16 +364,29 @@
placeholder="{$t('forms.eg')}: https://coolify.io" placeholder="{$t('forms.eg')}: https://coolify.io"
/> />
</div> </div>
<div class="grid grid-cols-2 items-center">
<Setting <div class="grid grid-cols-4 items-center">
id="dualCerts" <div class="col-span-2">
dataTooltip={$t('setting.must_remove_domain_before_changing')} Rollback to a specific version
disabled={isFqdnSet} <Explainer
bind:setting={dualCerts} position="dropdown-bottom"
title={$t('application.ssl_www_and_non_www')} explanation="You can rollback to a specific version of Coolify. This will not affect your current running resources.<br><br><a href='https://github.com/coollabsio/coolify/releases' target='_blank'>See available versions</a>"
description={$t('setting.generate_www_non_www_ssl')} />
on:click={() => !isFqdnSet && changeSettings('dualCerts')} </div>
<input
class="w-full"
bind:value={rollbackVersion}
readonly={!$appSession.isAdmin}
disabled={!$appSession.isAdmin}
name="rollbackVersion"
id="rollbackVersion"
/> />
<button
class:loading={loading.rollback}
class="btn btn-primary ml-2"
disabled={!rollbackVersion || loading.rollback}
on:click|preventDefault|stopPropagation={rollback}>Rollback</button
>
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<div> <div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,21 @@
## Getting Started
To contribute to `Coolify` development, you'll benefit from knowing the following:
- **Languages**
- [Node.js]() - 📚 [Introduction](https://nodejs.dev/en/learn/introduction-to-nodejs/)
- Javascript - 📚 [Learn Javascript](https://learnjavascript.online/)
- Typescript - 📚 [Learn@FreecodeCamp](https://www.freecodecamp.org/news/learn-typescript-beginners-guide/)
- **Framework JS/TS**
- [SvelteKit](https://kit.svelte.dev/) - 📚 [Tutorial](https://svelte.dev/tutorial/basics)
- [Fastify](https://www.fastify.io/)
- **Database ORM**
- [Prisma.io](https://www.prisma.io/) - 📚 [Quickstart](https://www.prisma.io/docs/getting-started/quickstart)
- **Docker**
- [Docker Engine API](https://docs.docker.com/engine/api/)
## How to add a new service?
You can find all details [here](https://github.com/coollabsio/coolify-community-templates)

View File

@@ -0,0 +1,10 @@
### Container based development flow (recommended and the easiest)
All you need is to
1. Install [Docker Engine 20.11+](https://docs.docker.com/engine/install/) on your local machine
2. Run `pnpm dev:container`.
It will build the base image for Coolify and start the development server inside Docker.
All required ports (3000, 3001) will be exposed to your host.

View File

@@ -0,0 +1,2 @@
### Inside a Docker container
# `WIP`

19
docs/dev_setup/GitPod.md Normal file
View File

@@ -0,0 +1,19 @@
### Gitpod
#### Option 1 - Prefered:
Follow the same steps as [container based development flow](./Container.md)
#### Option 2 - Manual setup:
1. Create a workspace from this repository,
1. run `pnpm install && pnpm db:push && pnpm db:seed`
1. and then `pnpm dev`.
All the required dependencies and packages has been configured for you already.
---
> Some packages, just `pack` are not installed in this way.
You cannot test all the features.
Please use the [container based development flow](./Container.md).

View File

@@ -0,0 +1,8 @@
### Github codespaces
If you have github codespaces enabled then you can just:
1. create a codespace and
2. run `pnpm dev` to run your the dev environment.
All the required dependencies and packages has been configured for you already.

View File

@@ -0,0 +1,17 @@
### Local Machine
At the moment, Coolify `doesn't support Windows`.
You must use `Linux` or `MacOS` or consider using Gitpod or Github Codespaces.
Install all the prerequisites manually to your host system.
If you would not like to install anything,
I suggest to use the [container based development flow](#container-based-development-flow-easiest).
- Due to the lock file, this repository is best with [pnpm](https://pnpm.io). I recommend you try and use `pnpm` because it is cool and efficient!
- You need to have [Docker Engine](https://docs.docker.com/engine/install/) installed locally.
- You need to have [Docker Compose Plugin](https://docs.docker.com/compose/install/compose-plugin/) installed locally.
- You need to have [GIT LFS Support](https://git-lfs.github.com/) installed locally.
Optional:
- To test Heroku buildpacks, you need [pack](https://github.com/buildpacks/pack) binary installed locally.

2
docs/dev_setup/Mac.md Normal file
View File

@@ -0,0 +1,2 @@
### Mac Setup

1
docs/dev_setup/MacArm.md Normal file
View File

@@ -0,0 +1 @@
### Mac Setup

View File

@@ -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.0", "version": "3.11.5",
"license": "Apache-2.0", "license": "Apache-2.0",
"repository": "github:coollabsio/coolify", "repository": "github:coollabsio/coolify",
"scripts": { "scripts": {
@@ -25,7 +25,7 @@
"build:api": "NODE_ENV=production pnpm run --filter api build", "build:api": "NODE_ENV=production pnpm run --filter api build",
"build:ui": "NODE_ENV=production pnpm run --filter ui build", "build:ui": "NODE_ENV=production pnpm run --filter ui build",
"dockerlogin": "echo $DOCKER_PASS | docker login --username=$DOCKER_USER --password-stdin", "dockerlogin": "echo $DOCKER_PASS | docker login --username=$DOCKER_USER --password-stdin",
"release:staging:amd": "cross-var docker buildx build --platform linux/amd64 -t coollabsio/coolify:$npm_package_version --push .", "release:staging:amd": "docker build -t coollabsio/coolify:next . && docker push coollabsio/coolify:next",
"release:local": "rm -fr ./local-serve && mkdir ./local-serve && pnpm build && cp -Rp apps/api/build/* ./local-serve && cp -Rp apps/ui/build/ ./local-serve/public && cp -Rp apps/api/prisma/ ./local-serve/prisma && cp -Rp apps/api/package.json ./local-serve && env | grep '^COOLIFY_' > ./local-serve/.env && cd ./local-serve && pnpm install . && pnpm start" "release:local": "rm -fr ./local-serve && mkdir ./local-serve && pnpm build && cp -Rp apps/api/build/* ./local-serve && cp -Rp apps/ui/build/ ./local-serve/public && cp -Rp apps/api/prisma/ ./local-serve/prisma && cp -Rp apps/api/package.json ./local-serve && env | grep '^COOLIFY_' > ./local-serve/.env && cd ./local-serve && pnpm install . && pnpm start"
}, },
"devDependencies": { "devDependencies": {