Compare commits

..

41 Commits

Author SHA1 Message Date
Andras Bacsai
087e7b9311 Merge pull request #724 from coollabsio/next
v3.11.6
2022-11-11 11:58:46 +01:00
Andras Bacsai
39ba498293 ui: fix 2022-11-11 10:39:01 +01:00
Andras Bacsai
fe7390bd4d fix: update on mobile 2022-11-11 10:38:30 +01:00
Andras Bacsai
75af551435 ui: secrets on apps 2022-11-11 09:33:45 +01:00
Andras Bacsai
ae2d3ebb48 fix: no tags error 2022-11-11 09:25:02 +01:00
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
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
36 changed files with 680 additions and 363 deletions

View File

@@ -6,6 +6,34 @@ on:
- next
jobs:
arm64:
runs-on: [self-hosted, arm64]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: "next"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get current package version
uses: martinbeentjes/npm-get-version-action@v1.2.3
id: package-version
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/arm64
push: true
tags: coollabsio/coolify:next-arm64
cache-from: type=registry,ref=coollabsio/coolify:buildcache-next-arm64
cache-to: type=registry,ref=coollabsio/coolify:buildcache-next-arm64,mode=max
amd64:
runs-on: ubuntu-latest
steps:
@@ -36,7 +64,7 @@ jobs:
cache-to: type=registry,ref=coollabsio/coolify:buildcache-next-amd64,mode=max
merge-manifest:
runs-on: ubuntu-latest
needs: [amd64]
needs: [arm64, amd64]
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -51,7 +79,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create & publish manifest
run: |
docker manifest create coollabsio/coolify:next --amend coollabsio/coolify:next-amd64
docker manifest create coollabsio/coolify:next --amend coollabsio/coolify:next-amd64 --amend coollabsio/coolify:next-arm64
docker manifest push coollabsio/coolify:next
- uses: sarisia/actions-status-discord@v1
if: always()

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
### 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.
You'll need a set of skills to [get started](docs/contribution/GettingStarted.md).
### 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
1. Use [container based development flow](#container-based-development-flow-easiest)
2. Or setup your workspace manually:
## 2) Basic requirements
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
> At the moment, Coolify `doesn't support Windows`. You must use `Linux` or `MacOS` or consider using Gitpod or Github Codespaces.
- Copy `apps/api/.env.example` to `apps/api/.env`
- 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!
- 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.
## 4) Start Coding
Optional:
- To test Heroku buildpacks, you need [pack](https://github.com/buildpacks/pack) binary installed locally.
You should be able to access `http://localhost:3000`.
### Inside a Docker container
`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)
1. Click `Register` and setup your first user.

View File

@@ -93,18 +93,20 @@ Deploy your resource to:
- [Fider](https://fider.io)
- [Hasura](https://hasura.io)
- [GlitchTip](https://glitchtip.com)
## Migration from v1
A fresh installation is necessary. v2 and v3 are not compatible with v1.
- And more...
## Support
- Twitter: [@andrasbacsai](https://twitter.com/andrasbacsai)
- Mastodon: [@andrasbacsai@fosstodon.org](https://fosstodon.org/@andrasbacsai)
- Telegram: [@andrasbacsai](https://t.me/andrasbacsai)
- Twitter: [@andrasbacsai](https://twitter.com/andrasbacsai)
- Email: [andras@coollabs.io](mailto:andras@coollabs.io)
- 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
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
defaultVersion: v1.8.6
documentation: https://docs.appsmith.com/getting-started/setup/instance-configuration/
@@ -1664,7 +1726,6 @@
services:
$$id:
name: Umami
documentation: "Official docs are [here](https://umami.is/docs/getting-started)"
depends_on:
- $$id-postgresql
image: "ghcr.io/umami-software/umami:$$core_version"
@@ -1678,7 +1739,213 @@
- "3000"
$$id-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: []
image: "postgres:12-alpine"
volumes:
@@ -1871,7 +2138,7 @@
services:
$$id:
name: MeiliSearch
documentation: "https://docs.meilisearch.com/"
documentation: https://docs.meilisearch.com/
depends_on: []
image: "getmeili/meilisearch:$$core_version"
volumes:
@@ -1891,8 +2158,9 @@
description: ""
showOnConfiguration: true
- templateVersion: 1.0.0
ignore: true
defaultVersion: latest
documentation: https://ghost.org/resources/
documentation: https://docs.ghost.org
type: ghost-mariadb
name: Ghost
subname: (MariaDB)
@@ -1904,7 +2172,6 @@
services:
$$id:
name: Ghost
documentation: "Taken from https://docs.ghost.org/"
depends_on:
- $$id-mariadb
image: "bitnami/ghost:$$core_version"
@@ -2010,7 +2277,7 @@
description: ""
- templateVersion: 1.0.0
defaultVersion: "5.22"
documentation: https://ghost.org/resources/
documentation: https://docs.ghost.org
type: ghost-only
name: Ghost
subname: (without Database)
@@ -2019,7 +2286,6 @@
services:
$$id:
name: Ghost
documentation: "Taken from https://docs.ghost.org/"
image: "ghost:$$core_version"
volumes:
- "$$id-ghost:/var/lib/ghost/content"
@@ -2075,7 +2341,7 @@
required: true
- templateVersion: 1.0.0
defaultVersion: "5.22"
documentation: https://ghost.org/resources/
documentation: https://docs.ghost.org
type: ghost-mysql
name: Ghost
subname: (MySQL)
@@ -2084,7 +2350,6 @@
services:
$$id:
name: Ghost
documentation: "Taken from https://docs.ghost.org/"
depends_on:
- $$id-mysql
image: "ghost:$$core_version"
@@ -2165,7 +2430,6 @@
services:
$$id:
name: WordPress
documentation: " Taken from https://docs.docker.com/compose/wordpress/"
depends_on:
- $$id-mysql
image: "wordpress:$$core_version"
@@ -2183,7 +2447,7 @@
name: MySQL
depends_on: []
image: "bitnami/mysql:5.7"
imageArm: "mysql:5.7"
imageArm: "mysql:8.0"
volumes:
- "$$id-mysql-data:/bitnami/mysql/data"
volumesArm:
@@ -2256,7 +2520,6 @@
services:
$$id:
name: WordPress
documentation: "Taken from https://docs.docker.com/compose/wordpress/"
image: "wordpress:$$core_version"
volumes:
- "$$id-wordpress-data:/var/www/html"
@@ -2330,7 +2593,6 @@
services:
$$id:
name: VSCode Server
documentation: "Taken from https://github.com/coder/code-server/. "
depends_on: []
image: "codercom/code-server:$$core_version"
volumes:
@@ -2362,7 +2624,6 @@
$$id:
name: MinIO
command: "server /data --console-address :9001"
documentation: "Taken from https://docs.min.io/docs/minio-docker-quickstart-guide.html"
depends_on: []
image: "minio/minio:$$core_version"
volumes:
@@ -2422,7 +2683,6 @@
$$id:
name: Fider
image: "getfider/fider:$$core_version"
documentation: "Taken from https://hub.docker.com/r/getfider/fider/"
depends_on:
- $$id-postgresql
environment:
@@ -2442,7 +2702,6 @@
- "3000"
$$id-postgresql:
name: PostgreSQL
documentation: "Taken from https://hub.docker.com/r/getfider/fider/"
depends_on: []
image: "postgres:12-alpine"
volumes:
@@ -2545,7 +2804,6 @@
services:
$$id:
name: N8n
documentation: "Taken from https://hub.docker.com/r/n8nio/n8n"
depends_on: []
image: "n8nio/n8n:$$core_version"
volumes:
@@ -2578,7 +2836,6 @@
services:
$$id:
name: Plausible Analytics
documentation: "Taken from https://plausible.io/"
command: >-
sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db
migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"
@@ -2600,7 +2857,6 @@
- "8000"
$$id-postgresql:
name: PostgreSQL
documentation: "Taken from https://plausible.io/"
image: "bitnami/postgresql:13.2.0"
volumes:
- "$$id-postgresql-data:/bitnami/postgresql"
@@ -2610,7 +2866,6 @@
- POSTGRESQL_DATABASE=$$config_postgresql_database
$$id-clickhouse:
name: Clickhouse
documentation: "Taken from https://plausible.io/"
volumes:
- "$$id-clickhouse-data:/var/lib/clickhouse"
image: "yandex/clickhouse-server:21.3.2.5"

View File

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

View File

@@ -1,5 +1,5 @@
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";
export async function migrateServicesToNewTemplate() {
@@ -238,7 +238,6 @@ async function hasura(service: any, template: any) {
async function umami(service: any, template: any) {
const { postgresqlUser, postgresqlPassword, postgresqlDatabase, umamiAdminPassword, hashSalt } = service.umami
const { id } = service
const secrets = [
`HASH_SALT@@@${hashSalt}`,
`POSTGRES_PASSWORD@@@${postgresqlPassword}`,
@@ -253,6 +252,8 @@ async function umami(service: any, template: any) {
await migrateSettings(settings, service, template);
await migrateSecrets(secrets, service);
await prisma.service.update({ where: { id: service.id }, data: { type: "umami-postgresql" } })
// Disconnect old service data
// await prisma.service.update({ where: { id: service.id }, data: { umami: { disconnect: true } } })
}
@@ -440,33 +441,41 @@ async function plausibleAnalytics(service: any, template: any) {
async function migrateSettings(settings: any[], service: any, template: any) {
for (const setting of settings) {
if (!setting) continue;
let [name, value] = setting.split('@@@')
let minio = name
if (name === 'MINIO_SERVER_URL') {
name = 'coolify_fqdn_minio_console'
try {
if (!setting) continue;
let [name, value] = setting.split('@@@')
let minio = name
if (name === 'MINIO_SERVER_URL') {
name = 'coolify_fqdn_minio_console'
}
if (!value || value === 'null') {
continue;
}
let variableName = template.variables.find((v: any) => v.name === name)?.id
if (!variableName) {
variableName = `$$config_${name.toLowerCase()}`
}
// 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 } } } })
} catch(error) {
console.log(error)
}
if (!value || value === 'null') {
continue;
}
let variableName = template.variables.find((v: any) => v.name === name)?.id
if (!variableName) {
variableName = `$$config_${name.toLowerCase()}`
}
// 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 } } } })
}
}
async function migrateSecrets(secrets: any[], service: any) {
for (const secret of secrets) {
if (!secret) continue;
let [name, value] = secret.split('@@@')
if (!value || value === 'null') {
continue
try {
if (!secret) continue;
let [name, value] = secret.split('@@@')
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) {

View File

@@ -17,7 +17,7 @@ import { day } from './dayjs';
import { saveBuildLog } from './buildPacks/common';
import { scheduler } from './scheduler';
export const version = '3.11.1';
export const version = '3.11.6';
export const isDev = process.env.NODE_ENV === 'development';
const algorithm = 'aes-256-ctr';
@@ -972,7 +972,7 @@ export function generateDatabaseConfiguration(database: any, arch: string): Data
}
}
export function isARM(arch: string) {
if (arch === 'arm' || arch === 'arm64') {
if (arch === 'arm' || arch === 'arm64' || arch === 'aarch' || arch === 'aarch64') {
return true;
}
return false;

View File

@@ -1,145 +1,12 @@
import { isDev } from "./common";
import fs from 'fs/promises';
export async function getTemplates() {
let templates: any = [];
if (isDev) {
templates = JSON.parse(await (await fs.readFile('./templates.json')).toString())
} else {
templates = JSON.parse(await (await fs.readFile('/app/templates.json')).toString())
const templatePath = isDev ? './templates.json' : '/app/templates.json';
const ts = await fs.readFile(templatePath, 'utf8')
if (ts) {
return JSON.parse(ts);
}
// if (!isDev) {
// 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
return [];
}
const compareSemanticVersions = (a: string, b: string) => {
const a1 = a.split('.');
@@ -155,16 +22,22 @@ const compareSemanticVersions = (a: string, b: string) => {
return b1.length - a1.length;
};
export async function getTags(type: string) {
if (type) {
let tags: any = [];
if (isDev) {
tags = JSON.parse(await (await fs.readFile('./tags.json')).toString())
} else {
tags = JSON.parse(await (await fs.readFile('/app/tags.json')).toString())
try {
if (type) {
const tagsPath = isDev ? './tags.json' : '/app/tags.json';
const data = await fs.readFile(tagsPath, 'utf8')
let tags = JSON.parse(data)
if (tags) {
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
} catch (error) {
return []
}
return []
}

View File

@@ -34,7 +34,8 @@ export async function startService(request: FastifyRequest<ServiceStartStop>, fa
const { id } = request.params;
const teamId = request.user.teamId;
const service = await getServiceFromDB({ id, teamId });
const arm = isARM(service.arch)
console.log({service})
const arm = isARM(service.arch);
const { type, destinationDockerId, destinationDocker, persistentStorage, exposePort } =
service;
@@ -103,15 +104,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] = {
container_name: s,
build: template.services[s].build || undefined,
command: template.services[s].command,
entrypoint: template.services[s]?.entrypoint,
image: arm ? template.services[s].imageArm : template.services[s].image,
image,
expose: template.services[s].ports,
...(exposePort ? { ports: [`${exposePort}:${exposePort}`] } : {}),
...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
volumes: Array.from(volumes),
environment: newEnvironments,
depends_on: template.services[s]?.depends_on,

View File

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

View File

@@ -1,5 +1,5 @@
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';
export interface Update {
@@ -52,10 +52,6 @@ const root: FastifyPluginAsync = async (fastify): Promise<void> => {
fastify.post('/internal/cleanup', {
onRequest: [fastify.authenticate]
}, async (request) => await cleanupManually(request));
fastify.post('/internal/refreshTemplates', {
onRequest: [fastify.authenticate]
}, async () => await refreshTemplates());
};
export default root;

View File

@@ -149,9 +149,11 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
}
}
parsedTemplate[realKey] = {
value,
name,
documentation: value.documentation || foundTemplate.documentation || 'https://docs.coollabs.io',
image: value.image,
files: value?.files,
environment: [],
fqdns: [],
proxy: {}
@@ -189,7 +191,7 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
const variable = foundTemplate.variables.find(v => v.id === proxyValue.domain)
if (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(
{ 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('$$core_version', service.version || foundTemplate.defaultVersion)
// replace $$fqdn
// replace $$workdir
if (workdir) {
strParsedTemplate = strParsedTemplate.replaceAll('$$workdir', workdir)
}
@@ -217,15 +219,15 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin
if (service.serviceSetting.length > 0) {
for (const setting of service.serviceSetting) {
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') {
strParsedTemplate = strParsedTemplate.replaceAll(regex, service.fqdn + "\"" || '' + "\"")
strParsedTemplate = strParsedTemplate.replaceAll(regex, service.fqdn || '')
} 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') {
strParsedTemplate = strParsedTemplate.replaceAll(regex, service.destinationDocker.network + "\"")
strParsedTemplate = strParsedTemplate.replaceAll(regex, service.destinationDocker.network)
} 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
if (service.serviceSecret.length > 0) {
for (const secret of service.serviceSecret) {
const { name, value } = secret
const regexHashed = new RegExp(`\\$\\$hashed\\$\\$secret_${name}\\"`, 'gi')
const regex = new RegExp(`\\$\\$secret_${name}\\"`, 'gi')
let { name, value } = secret
name = name.toLowerCase()
const regexHashed = new RegExp(`\\$\\$hashed\\$\\$secret_${name}`, 'gi')
const regex = new RegExp(`\\$\\$secret_${name}`, 'gi')
if (value) {
strParsedTemplate = strParsedTemplate.replaceAll(regexHashed, bcrypt.hashSync(value.replaceAll("\"", "\\\""), 10) + "\"")
strParsedTemplate = strParsedTemplate.replaceAll(regex, value.replaceAll("\"", "\\\"") + "\"")
} else {
strParsedTemplate = strParsedTemplate.replaceAll(regexHashed, "\"")
strParsedTemplate = strParsedTemplate.replaceAll(regex, "\"")
strParsedTemplate = strParsedTemplate.replaceAll(regexHashed, bcrypt.hashSync(value.replaceAll("\"", "\\\""), 10))
strParsedTemplate = strParsedTemplate.replaceAll(regex, value.replaceAll("\"", "\\\""))
}
}
}

View File

@@ -129,10 +129,10 @@ function generateRouters(serviceId, domain, nakedDomain, pathPrefix, isHttps, is
}
}
return {
[serviceId]: { ...http },
[`${serviceId}-secure`]: { ...https },
[`${serviceId}-www`]: { ...httpWWW },
[`${serviceId}-secure-www`]: { ...httpsWWW },
[`${serviceId}-${pathPrefix}`]: { ...http },
[`${serviceId}-${pathPrefix}-secure`]: { ...https },
[`${serviceId}-${pathPrefix}-www`]: { ...httpWWW },
[`${serviceId}-${pathPrefix}-secure-www`]: { ...httpsWWW },
}
}
export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote: boolean = false) {
@@ -287,11 +287,10 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
if (
!runningContainers[destinationDockerId] ||
runningContainers[destinationDockerId].length === 0 ||
!runningContainers[destinationDockerId].includes(id)
runningContainers[destinationDockerId].filter((container) => container.startsWith(id)).length === 0
) {
continue
}
if (buildPack === 'compose') {
const services = Object.entries(JSON.parse(dockerComposeConfiguration))
if (services.length > 0) {
@@ -310,7 +309,7 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const pathPrefix = '/'
const isCustomSSL = false;
const dualCerts = false;
const serviceId = `${id}-${port || 'default'}-${pathPrefix}`
const serviceId = `${id}-${port || 'default'}`
traefik.http.routers = { ...traefik.http.routers, ...generateRouters(serviceId, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) }
traefik.http.services = { ...traefik.http.services, ...generateServices(serviceId, containerId, port) }
@@ -329,7 +328,7 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const isHttps = fqdn.startsWith('https://');
const isWWW = fqdn.includes('www.');
const pathPrefix = '/'
const serviceId = `${id}-${port || 'default'}-${pathPrefix}`
const serviceId = `${id}-${port || 'default'}`
traefik.http.routers = { ...traefik.http.routers, ...generateRouters(serviceId, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) }
traefik.http.services = { ...traefik.http.services, ...generateServices(serviceId, id, port) }
if (previews) {
@@ -344,7 +343,7 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const previewDomain = `${container.split('-')[1]}.${domain}`;
const nakedDomain = previewDomain.replace(/^www\./, '');
const pathPrefix = '/'
const serviceId = `${container}-${port || 'default'}-${pathPrefix}`
const serviceId = `${container}-${port || 'default'}`
traefik.http.routers = { ...traefik.http.routers, ...generateRouters(serviceId, previewDomain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) }
traefik.http.services = { ...traefik.http.services, ...generateServices(serviceId, container, port) }
}
@@ -426,7 +425,7 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const isHttps = fqdn.startsWith('https://');
const isWWW = fqdn.includes('www.');
const isCustomSSL = false;
const serviceId = `${oneService}-${port || 'default'}-${pathPrefix}`
const serviceId = `${oneService}-${port || 'default'}`
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) }
}
@@ -443,7 +442,7 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const isWWW = fqdn.includes('www.');
const pathPrefix = '/'
const isCustomSSL = false
const serviceId = `${oneService}-${port || 'default'}-${pathPrefix}`
const serviceId = `${oneService}-${port || 'default'}`
traefik.http.routers = { ...traefik.http.routers, ...generateRouters(serviceId, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) }
traefik.http.services = { ...traefik.http.services, ...generateServices(serviceId, id, port) }
}
@@ -468,7 +467,7 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
const port = 3000
const pathPrefix = '/'
const isCustomSSL = false
const serviceId = `${id}-${port || 'default'}-${pathPrefix}`
const serviceId = `${id}-${port || 'default'}`
traefik.http.routers = { ...traefik.http.routers, ...generateRouters(serviceId, domain, nakedDomain, pathPrefix, isHttps, isWWW, dualCerts, isCustomSSL) }
traefik.http.services = { ...traefik.http.services, ...generateServices(serviceId, container, port) }
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,14 @@
<script lang="ts">
import { dev } from '$app/env';
import { get, post } from '$lib/api';
import { addToast, appSession, features, updateLoading, isUpdateAvailable } from '$lib/store';
import {
addToast,
appSession,
features,
updateLoading,
isUpdateAvailable,
latestVersion
} from '$lib/store';
import { asyncSleep, errorNotification } from '$lib/common';
import { onMount } from 'svelte';
import Tooltip from './Tooltip.svelte';
@@ -11,15 +18,17 @@
loading: false,
success: null
};
let latestVersion = 'latest';
async function update() {
updateStatus.loading = true;
try {
if (dev) {
await asyncSleep(4000);
localStorage.setItem('lastVersion', $appSession.version);
await asyncSleep(1000);
updateStatus.loading = false;
return window.location.reload();
} else {
await post(`/update`, { type: 'update', latestVersion });
localStorage.setItem('lastVersion', $appSession.version);
await post(`/update`, { type: 'update', latestVersion: $latestVersion });
addToast({
message: 'Update completed.<br><br>Waiting for the new version to start...',
type: 'success'
@@ -62,7 +71,7 @@
$updateLoading = true;
const data = await get(`/update`);
if (overrideVersion || data?.isUpdateAvailable) {
latestVersion = overrideVersion || data.latestVersion;
$latestVersion = overrideVersion || data.latestVersion;
if (overrideVersion) {
$isUpdateAvailable = true;
} else {
@@ -91,7 +100,7 @@
{#if updateStatus.loading}
<svg
xmlns="http://www.w3.org/2000/svg"
class="lds-heart h-8 w-8"
class="lds-heart h-8 w-8 mx-auto"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"

View File

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

View File

@@ -32,6 +32,7 @@ interface AddToast {
}
export const updateLoading: Writable<boolean> = writable(false);
export const isUpdateAvailable: Writable<boolean> = writable(false);
export const latestVersion: Writable<string> = writable('latest');
export const search: any = writable('')
export const loginEmail: Writable<string | undefined> = writable()
export const appSession: Writable<AppSession> = writable({

View File

@@ -32,10 +32,10 @@
}
</script>
<div class="w-full font-bold grid grid-cols-1 lg:grid-cols-4 gap-2 pb-2">
<div class="w-full grid grid-cols-1 lg:grid-cols-4 gap-2 pb-2">
<div class="flex flex-col">
{#if index === 0 || length === 0}
<label for="name" class="pb-2 uppercase">name</label>
<label for="name" class="pb-2 uppercase font-bold">name</label>
{/if}
<input
@@ -50,7 +50,7 @@
</div>
<div class="flex flex-col">
{#if index === 0 || length === 0}
<label for="value" class="pb-2 uppercase">value</label>
<label for="value" class="pb-2 uppercase font-bold">value</label>
{/if}
<CopyPasswordField
@@ -63,9 +63,12 @@
</div>
<div class="flex lg:flex-col flex-row justify-start items-center pt-3 lg:pt-0">
{#if index === 0 || length === 0}
<label for="name" class="pb-2 uppercase lg:block hidden">Need during buildtime?</label>
<label for="name" class="pb-2 uppercase lg:block hidden font-bold"
>Need during buildtime?</label
>
{/if}
<label for="name" class="pb-2 uppercase lg:hidden block">Need during buildtime?</label>
<label for="name" class="pb-2 uppercase lg:hidden block font-bold">Need during buildtime?</label
>
<div class="flex justify-center h-full items-center pt-0 lg:pt-0 pl-4 lg:pl-0">
<button
@@ -114,7 +117,7 @@
</div>
<div class="flex flex-row lg:flex-col lg:items-center items-start">
{#if index === 0 || length === 0}
<label for="name" class="pb-2 uppercase lg:block hidden">Actions</label>
<label for="name" class="pb-5 uppercase lg:block hidden font-bold" />
{/if}
<div class="flex justify-center h-full items-center pt-3">

View File

@@ -79,10 +79,10 @@
}
</script>
<div class="w-full font-bold grid grid-cols-1 lg:grid-cols-4 gap-2 pb-2">
<div class="w-full grid grid-cols-1 lg:grid-cols-4 gap-2 pb-2">
<div class="flex flex-col">
{#if (index === 0 && !isNewSecret) || length === 0}
<label for="name" class="pb-2 uppercase">name</label>
<label for="name" class="pb-2 uppercase font-bold">name</label>
{/if}
<input
@@ -101,7 +101,7 @@
</div>
<div class="flex flex-col">
{#if (index === 0 && !isNewSecret) || length === 0}
<label for="value" class="pb-2 uppercase">value</label>
<label for="value" class="pb-2 uppercase font-bold">value</label>
{/if}
<CopyPasswordField
@@ -114,9 +114,12 @@
</div>
<div class="flex lg:flex-col flex-row justify-start items-center pt-3 lg:pt-0">
{#if (index === 0 && !isNewSecret) || length === 0}
<label for="name" class="pb-2 uppercase lg:block hidden">Need during buildtime?</label>
<label for="name" class="pb-2 uppercase lg:block hidden font-bold"
>Need during buildtime?</label
>
{/if}
<label for="name" class="pb-2 uppercase lg:hidden block">Need during buildtime?</label>
<label for="name" class="pb-2 uppercase lg:hidden block font-bold">Need during buildtime?</label
>
<div class="flex justify-center h-full items-center pt-0 lg:pt-0 pl-4 lg:pl-0">
<button
@@ -166,7 +169,7 @@
</div>
<div class="flex flex-row lg:flex-col lg:items-center items-start">
{#if (index === 0 && !isNewSecret) || length === 0}
<label for="name" class="pb-2 uppercase lg:block hidden">Action</label>
<label for="name" class="pb-5 uppercase lg:block hidden font-bold" />
{/if}
<div class="flex justify-center h-full items-center pt-3">

View File

@@ -8,7 +8,7 @@
</script>
{#if linkToDocs}
<DocLink url={template[service.id].documentation} text={`Documentation`} isExternal={true} />
<DocLink url={template[service.id]?.documentation || 'https://docs.coollabs.io'} text={`Documentation`} isExternal={true} />
{:else}
<ServiceIcons type={service.type} />
{/if}

View File

@@ -79,9 +79,7 @@
$isDeploymentEnabled = checkIfDeploymentEnabledServices($appSession.isAdmin, service);
let statusInterval: any;
let loading = {
refreshTemplates: false
};
async function deleteService() {
const sure = confirm($t('application.confirm_to_delete', { name: service.name }));
@@ -106,20 +104,6 @@
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) {
if (skip) {
$status.service.initialLoading = true;
@@ -278,14 +262,6 @@
Delete Service
</button>
{/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>
</nav>
<div

View File

@@ -116,7 +116,7 @@
</div>
<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">
{#each sortMe(filteredServices) as service}
{#each sortMe(filteredServices).filter(s=> !s.ignore) as service}
{#key service.name}
<button
on:click={() => handleSubmit(service)}

View File

@@ -276,20 +276,25 @@
</div>
<div class="grid grid-cols-2 items-center">
<label for="version">Version / Tag</label>
<div class="custom-select-wrapper w-full">
<Select
form="saveForm"
containerClasses={isDisabled && containerClass()}
{isDisabled}
id="version"
showIndicator={!isDisabled}
items={[...tags.tags]}
on:select={selectTag}
value={service.version}
isClearable={false}
/>
</div>
{#if tags.tags?.length > 0}
<div class="custom-select-wrapper w-full">
<Select
form="saveForm"
containerClasses={isDisabled && containerClass()}
{isDisabled}
id="version"
showIndicator={!isDisabled}
items={[...tags.tags]}
on:select={selectTag}
value={service.version}
isClearable={false}
/>
</div>
{:else}
<input class="w-full border-red-500" disabled placeholder="Error getting tags...">
{/if}
</div>
<div class="grid grid-cols-2 items-center">
<label for="destination">{$t('application.destination')}</label>
<div>

View File

@@ -24,6 +24,7 @@
import { addToast, appSession, features } from '$lib/store';
import { asyncSleep, errorNotification, getDomain } from '$lib/common';
import Explainer from '$lib/components/Explainer.svelte';
import { dev } from '$app/env';
let isAPIDebuggingEnabled = settings.isAPIDebuggingEnabled;
let isRegistrationEnabled = settings.isRegistrationEnabled;
@@ -45,9 +46,61 @@
save: false,
remove: 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() {
if (fqdn) {
loading.remove = true;
@@ -281,6 +334,17 @@
</div>
{/if}
</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>
Default Redirect URL
@@ -300,16 +364,29 @@
placeholder="{$t('forms.eg')}: https://coolify.io"
/>
</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 class="grid grid-cols-4 items-center">
<div class="col-span-2">
Rollback to a specific version
<Explainer
position="dropdown-bottom"
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>"
/>
</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 class="grid grid-cols-2 items-center">
<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",
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
"version": "3.11.1",
"version": "3.11.6",
"license": "Apache-2.0",
"repository": "github:coollabsio/coolify",
"scripts": {
@@ -25,7 +25,7 @@
"build:api": "NODE_ENV=production pnpm run --filter api build",
"build:ui": "NODE_ENV=production pnpm run --filter ui build",
"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:next --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"
},
"devDependencies": {