Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

v3.0.0 (#476)

Andras Bacsai87ba4560ad13
diff --git a/.dockerignore b/.dockerignore
index a6e626b0df..62248479b2 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,16 +1,11 @@
.DS_Store
node_modules
-/build
-/.svelte-kit
-/package
-/yarn.lock
-/.pnpm-store
-/ssl
-
+build
+.svelte-kit
+package
.env
-.env.prod
-.env.stag
-/db/*.db
-/db/*.db-journal
-/data/haproxy/haproxy.cfg
-/data/haproxy/haproxy.cfg.lkg
\ No newline at end of file
+.env.*
+!.env.example
+dist
+client
+apps/api/db/*.db
\ No newline at end of file
diff --git a/.env.template b/.env.template
deleted file mode 100644
index 3237d9b2ce..0000000000
--- a/.env.template
+++ /dev/null
@@ -1,8 +0,0 @@
-COOLIFY_APP_ID=
-COOLIFY_SECRET_KEY=12341234123412341234123412341234
-COOLIFY_DATABASE_URL=file:../db/dev.db
-COOLIFY_SENTRY_DSN=
-COOLIFY_IS_ON=docker
-COOLIFY_WHITE_LABELED=false
-COOLIFY_WHITE_LABELED_ICON=
-COOLIFY_AUTO_UPDATE=false
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index e8abfd8332..62248479b2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,16 +1,11 @@
.DS_Store
node_modules
-/build
-/.svelte-kit
-/package
-/yarn.lock
-/.pnpm-store
-/ssl
-
+build
+.svelte-kit
+package
.env
-.env.prod
-.env.stag
-/db/*.db
-/db/*.db-journal
-/data/haproxy/haproxy.cfg
-/data/haproxy/haproxy.cfg.lkg
+.env.*
+!.env.example
+dist
+client
+apps/api/db/*.db
\ No newline at end of file
diff --git a/.husky/_/.gitignore b/.husky/_/.gitignore
deleted file mode 100644
index f59ec20aab..0000000000
--- a/.husky/_/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*
\ No newline at end of file
diff --git a/.husky/pre-commit b/.husky/pre-commit
deleted file mode 100755
index fab6428a1a..0000000000
--- a/.husky/pre-commit
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-. "$(dirname "$0")/_/husky.sh"
-
-pnpm lint-staged
diff --git a/.lintstagedrc.json b/.lintstagedrc.json
deleted file mode 100644
index f56aabfecd..0000000000
--- a/.lintstagedrc.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "**/*.{js,jsx,ts,tsx,cjs,svelte,json,css,scss,md,yaml}": [
- "prettier --ignore-path .gitignore --write --plugin-search-dir=."
- ]
-}
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 62f919153a..99c5433bf9 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,6 +2,8 @@
First of all, thank you for considering contributing to my project! It means a lot πŸ’œ.
+Contribution guide is for v2, not applicable for v3
+
## πŸ™‹ Want to help?
If you begin in GitHub contribution, you can find the [first contribution](https://github.com/firstcontributions/first-contributions) and follow this guide.
diff --git a/Dockerfile b/Dockerfile
index 87c4d54c9e..1a2ced9736 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,17 +1,18 @@
-FROM node:16.14.2-alpine as install
+FROM node:18-alpine as build
WORKDIR /app
RUN apk add --no-cache curl
-RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6
-RUN pnpm add -g pnpm
+RUN curl -sL https://unpkg.com/@pnpm/self-installer | node
-COPY package*.json .
+COPY . .
RUN pnpm install
+RUN pnpm build
-FROM node:16.14.2-alpine
-ARG TARGETPLATFORM
-
+# Production build
+FROM node:18-alpine
WORKDIR /app
+ENV NODE_ENV production
+ARG TARGETPLATFORM
ENV PRISMA_QUERY_ENGINE_BINARY=/app/prisma-engines/query-engine \
PRISMA_MIGRATION_ENGINE_BINARY=/app/prisma-engines/migration-engine \
@@ -19,24 +20,24 @@ ENV PRISMA_QUERY_ENGINE_BINARY=/app/prisma-engines/query-engine \
PRISMA_FMT_BINARY=/app/prisma-engines/prisma-fmt \
PRISMA_CLI_QUERY_ENGINE_TYPE=binary \
PRISMA_CLIENT_ENGINE_TYPE=binary
-
-COPY --from=coollabsio/prisma-engine:latest /prisma-engines/query-engine /prisma-engines/migration-engine /prisma-engines/introspection-engine /prisma-engines/prisma-fmt /app/prisma-engines/
-COPY --from=install /app/node_modules ./node_modules
-COPY . .
+COPY --from=coollabsio/prisma-engine:3.15 /prisma-engines/query-engine /prisma-engines/migration-engine /prisma-engines/introspection-engine /prisma-engines/prisma-fmt /app/prisma-engines/
RUN apk add --no-cache git git-lfs openssh-client curl jq cmake sqlite openssl
-RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6
-RUN pnpm add -g pnpm
+RUN curl -sL https://unpkg.com/@pnpm/self-installer | node
+
RUN mkdir -p ~/.docker/cli-plugins/
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-20.10.9 -o /usr/bin/docker
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-2.3.4 -o ~/.docker/cli-plugins/docker-compose
RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker
-RUN pnpm prisma generate
-RUN pnpm build
-
+COPY --from=build /app/apps/api/build/ .
+COPY --from=build /app/apps/ui/build/ ./public
+COPY --from=build /app/apps/api/prisma/ ./prisma
+COPY --from=build /app/apps/api/package.json .
+COPY --from=build /app/docker-compose.yaml .
+RUN pnpm install -p
EXPOSE 3000
-CMD ["pnpm", "start"]
\ No newline at end of file
+CMD pnpm start
\ No newline at end of file
diff --git a/README.md b/README.md
index da200223aa..b08d7dfa6e 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ An open-source & self-hostable Heroku / Netlify alternative.
https://demo.coolify.io/
-(If it is unresponsive, that means someone overloaded the server. πŸ™ƒ)
+(If it is unresponsive, that means someone overloaded the server. πŸ˜„)
## Feedback
@@ -30,6 +30,8 @@ For more details goto the [docs](https://docs.coollabs.io/coolify/installation).
## Features
+ARM support is in beta!
+
### Git Sources
You can use the following Git Sources to be auto-deployed to your Coolifyt instance! (Self-hosted versions are also supported.)
@@ -97,7 +99,7 @@ You can host cool open-source services as well:
## Migration from v1
-A fresh installation is necessary. v2 is not compatible with v1.
+A fresh installation is necessary. v2 and v3 are not compatible with v1.
## Support
diff --git a/apps/api/.eslintignore b/apps/api/.eslintignore
new file mode 100644
index 0000000000..70dc23b710
--- /dev/null
+++ b/apps/api/.eslintignore
@@ -0,0 +1,9 @@
+seed.js
+.DS_Store
+node_modules
+build
+.env
+.env.*
+!.env.example
+dist
+dev.db
\ No newline at end of file
diff --git a/apps/api/.eslintrc b/apps/api/.eslintrc
new file mode 100644
index 0000000000..92583263b8
--- /dev/null
+++ b/apps/api/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint", "prettier"],
+ "extends": [
+ "eslint:recommended",
+ "plugin:@typescript-eslint/eslint-recommended",
+ "plugin:@typescript-eslint/recommended",
+ "prettier"
+ ]
+}
diff --git a/apps/api/.gitignore b/apps/api/.gitignore
new file mode 100644
index 0000000000..9d4e0d4e8c
--- /dev/null
+++ b/apps/api/.gitignore
@@ -0,0 +1,11 @@
+.DS_Store
+node_modules
+build
+.svelte-kit
+package
+.env
+.env.*
+!.env.example
+dist
+dev.db
+client
\ No newline at end of file
diff --git a/db/.gitkeep b/apps/api/.prettierignore
similarity index 100%
rename from db/.gitkeep
rename to apps/api/.prettierignore
diff --git a/.prettierrc b/apps/api/.prettierrc
similarity index 100%
rename from .prettierrc
rename to apps/api/.prettierrc
diff --git a/apps/api/db/.gitkeep b/apps/api/db/.gitkeep
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/apps/api/nodemon.json b/apps/api/nodemon.json
new file mode 100644
index 0000000000..b19da37f0f
--- /dev/null
+++ b/apps/api/nodemon.json
@@ -0,0 +1,7 @@
+{
+ "watch": ["src"],
+ "ignore": ["src/**/*.test.ts"],
+ "ext": "ts,mjs,json,graphql",
+ "exec": "rimraf build && esbuild `find src \\( -name '*.ts' \\) | grep -v client/` --platform=node --outdir=build --format=cjs && node build",
+ "legacyWatch": true
+ }
\ No newline at end of file
diff --git a/apps/api/package.json b/apps/api/package.json
new file mode 100644
index 0000000000..aac907a281
--- /dev/null
+++ b/apps/api/package.json
@@ -0,0 +1,67 @@
+{
+ "name": "coolify-api",
+ "description": "Coolify's Fastify API",
+ "license": "AGPL-3.0",
+ "scripts": {
+ "db:push": "prisma db push && prisma generate",
+ "db:seed": "prisma db seed",
+ "db:studio": "prisma studio",
+ "dev": "nodemon",
+ "build": "rimraf build && esbuild `find src \\( -name '*.ts' \\)| grep -v client/` --platform=node --outdir=build --format=cjs",
+ "format": "prettier --write 'src/**/*.{js,ts,json,md}'",
+ "lint": "prettier --check 'src/**/*.{js,ts,json,md}' && eslint --ignore-path .eslintignore .",
+ "start": "NODE_ENV=production npx -y prisma migrate deploy && npx prisma generate && npx prisma db seed && node index.js"
+ },
+ "dependencies": {
+ "@breejs/ts-worker": "2.0.0",
+ "@fastify/autoload": "5.0.0",
+ "@fastify/cookie": "7.0.0",
+ "@fastify/cors": "8.0.0",
+ "@fastify/env": "4.0.0",
+ "@fastify/jwt": "6.2.0",
+ "@fastify/static": "6.4.0",
+ "@iarna/toml": "2.2.5",
+ "@prisma/client": "3.15.2",
+ "axios": "0.27.2",
+ "bcryptjs": "2.4.3",
+ "bree": "9.1.1",
+ "cabin": "9.1.2",
+ "compare-versions": "4.1.3",
+ "cuid": "2.1.8",
+ "dayjs": "1.11.3",
+ "dockerode": "3.3.2",
+ "dotenv-extended": "2.9.0",
+ "fastify": "4.2.0",
+ "fastify-plugin": "3.0.1",
+ "generate-password": "1.7.0",
+ "get-port": "6.1.2",
+ "got": "12.1.0",
+ "is-ip": "4.0.0",
+ "js-yaml": "4.1.0",
+ "jsonwebtoken": "8.5.1",
+ "node-forge": "1.3.1",
+ "node-os-utils": "1.3.7",
+ "p-queue": "7.2.0",
+ "strip-ansi": "7.0.1",
+ "unique-names-generator": "4.7.1"
+ },
+ "devDependencies": {
+ "@types/node": "18.0.3",
+ "@types/node-os-utils": "1.3.0",
+ "@typescript-eslint/eslint-plugin": "5.30.5",
+ "@typescript-eslint/parser": "5.30.5",
+ "esbuild": "0.14.48",
+ "eslint": "8.19.0",
+ "eslint-config-prettier": "8.5.0",
+ "eslint-plugin-prettier": "4.2.1",
+ "nodemon": "2.0.19",
+ "prettier": "2.7.1",
+ "prisma": "3.15.2",
+ "rimraf": "3.0.2",
+ "tsconfig-paths": "4.0.0",
+ "typescript": "4.7.4"
+ },
+ "prisma": {
+ "seed": "node prisma/seed.js"
+ }
+}
\ No newline at end of file
diff --git a/prisma/migrations/20220131142425_init/migration.sql b/apps/api/prisma/migrations/20220131142425_init/migration.sql
similarity index 100%
rename from prisma/migrations/20220131142425_init/migration.sql
rename to apps/api/prisma/migrations/20220131142425_init/migration.sql
diff --git a/prisma/migrations/20220210104005_redis_aol/migration.sql b/apps/api/prisma/migrations/20220210104005_redis_aol/migration.sql
similarity index 100%
rename from prisma/migrations/20220210104005_redis_aol/migration.sql
rename to apps/api/prisma/migrations/20220210104005_redis_aol/migration.sql
diff --git a/prisma/migrations/20220212142309_unique_secret_by_application/migration.sql b/apps/api/prisma/migrations/20220212142309_unique_secret_by_application/migration.sql
similarity index 100%
rename from prisma/migrations/20220212142309_unique_secret_by_application/migration.sql
rename to apps/api/prisma/migrations/20220212142309_unique_secret_by_application/migration.sql
diff --git a/prisma/migrations/20220217211304_dualcerts/migration.sql b/apps/api/prisma/migrations/20220217211304_dualcerts/migration.sql
similarity index 100%
rename from prisma/migrations/20220217211304_dualcerts/migration.sql
rename to apps/api/prisma/migrations/20220217211304_dualcerts/migration.sql
diff --git a/prisma/migrations/20220219231255_prmr_secrets/migration.sql b/apps/api/prisma/migrations/20220219231255_prmr_secrets/migration.sql
similarity index 100%
rename from prisma/migrations/20220219231255_prmr_secrets/migration.sql
rename to apps/api/prisma/migrations/20220219231255_prmr_secrets/migration.sql
diff --git a/prisma/migrations/20220220141136_public_portrange/migration.sql b/apps/api/prisma/migrations/20220220141136_public_portrange/migration.sql
similarity index 100%
rename from prisma/migrations/20220220141136_public_portrange/migration.sql
rename to apps/api/prisma/migrations/20220220141136_public_portrange/migration.sql
diff --git a/prisma/migrations/20220301101928_proxyhash/migration.sql b/apps/api/prisma/migrations/20220301101928_proxyhash/migration.sql
similarity index 100%
rename from prisma/migrations/20220301101928_proxyhash/migration.sql
rename to apps/api/prisma/migrations/20220301101928_proxyhash/migration.sql
diff --git a/prisma/migrations/20220304141408_service_secrets/migration.sql b/apps/api/prisma/migrations/20220304141408_service_secrets/migration.sql
similarity index 100%
rename from prisma/migrations/20220304141408_service_secrets/migration.sql
rename to apps/api/prisma/migrations/20220304141408_service_secrets/migration.sql
diff --git a/prisma/migrations/20220311213422_autodeploy/migration.sql b/apps/api/prisma/migrations/20220311213422_autodeploy/migration.sql
similarity index 100%
rename from prisma/migrations/20220311213422_autodeploy/migration.sql
rename to apps/api/prisma/migrations/20220311213422_autodeploy/migration.sql
diff --git a/prisma/migrations/20220320141424_phpmodules/migration.sql b/apps/api/prisma/migrations/20220320141424_phpmodules/migration.sql
similarity index 100%
rename from prisma/migrations/20220320141424_phpmodules/migration.sql
rename to apps/api/prisma/migrations/20220320141424_phpmodules/migration.sql
diff --git a/prisma/migrations/20220322135800_persistent_storage/migration.sql b/apps/api/prisma/migrations/20220322135800_persistent_storage/migration.sql
similarity index 100%
rename from prisma/migrations/20220322135800_persistent_storage/migration.sql
rename to apps/api/prisma/migrations/20220322135800_persistent_storage/migration.sql
diff --git a/prisma/migrations/20220327180323_ghost/migration.sql b/apps/api/prisma/migrations/20220327180323_ghost/migration.sql
similarity index 100%
rename from prisma/migrations/20220327180323_ghost/migration.sql
rename to apps/api/prisma/migrations/20220327180323_ghost/migration.sql
diff --git a/prisma/migrations/20220402135305_python/migration.sql b/apps/api/prisma/migrations/20220402135305_python/migration.sql
similarity index 100%
rename from prisma/migrations/20220402135305_python/migration.sql
rename to apps/api/prisma/migrations/20220402135305_python/migration.sql
diff --git a/prisma/migrations/20220402210645_meilisearch/migration.sql b/apps/api/prisma/migrations/20220402210645_meilisearch/migration.sql
similarity index 100%
rename from prisma/migrations/20220402210645_meilisearch/migration.sql
rename to apps/api/prisma/migrations/20220402210645_meilisearch/migration.sql
diff --git a/prisma/migrations/20220405151428_wordpress_sftp/migration.sql b/apps/api/prisma/migrations/20220405151428_wordpress_sftp/migration.sql
similarity index 100%
rename from prisma/migrations/20220405151428_wordpress_sftp/migration.sql
rename to apps/api/prisma/migrations/20220405151428_wordpress_sftp/migration.sql
diff --git a/prisma/migrations/20220407220809_unique_storage_fix/migration.sql b/apps/api/prisma/migrations/20220407220809_unique_storage_fix/migration.sql
similarity index 100%
rename from prisma/migrations/20220407220809_unique_storage_fix/migration.sql
rename to apps/api/prisma/migrations/20220407220809_unique_storage_fix/migration.sql
diff --git a/prisma/migrations/20220408070805_added_expose_port/migration.sql b/apps/api/prisma/migrations/20220408070805_added_expose_port/migration.sql
similarity index 100%
rename from prisma/migrations/20220408070805_added_expose_port/migration.sql
rename to apps/api/prisma/migrations/20220408070805_added_expose_port/migration.sql
diff --git a/prisma/migrations/20220418214843_persistent_storage_services/migration.sql b/apps/api/prisma/migrations/20220418214843_persistent_storage_services/migration.sql
similarity index 100%
rename from prisma/migrations/20220418214843_persistent_storage_services/migration.sql
rename to apps/api/prisma/migrations/20220418214843_persistent_storage_services/migration.sql
diff --git a/prisma/migrations/20220419203408_multiply_dockerfile_locations/migration.sql b/apps/api/prisma/migrations/20220419203408_multiply_dockerfile_locations/migration.sql
similarity index 100%
rename from prisma/migrations/20220419203408_multiply_dockerfile_locations/migration.sql
rename to apps/api/prisma/migrations/20220419203408_multiply_dockerfile_locations/migration.sql
diff --git a/prisma/migrations/20220420202031_deno_configurations/migration.sql b/apps/api/prisma/migrations/20220420202031_deno_configurations/migration.sql
similarity index 100%
rename from prisma/migrations/20220420202031_deno_configurations/migration.sql
rename to apps/api/prisma/migrations/20220420202031_deno_configurations/migration.sql
diff --git a/prisma/migrations/20220420210057_branch_for_builds/migration.sql b/apps/api/prisma/migrations/20220420210057_branch_for_builds/migration.sql
similarity index 100%
rename from prisma/migrations/20220420210057_branch_for_builds/migration.sql
rename to apps/api/prisma/migrations/20220420210057_branch_for_builds/migration.sql
diff --git a/prisma/migrations/20220425071132_umami/migration.sql b/apps/api/prisma/migrations/20220425071132_umami/migration.sql
similarity index 100%
rename from prisma/migrations/20220425071132_umami/migration.sql
rename to apps/api/prisma/migrations/20220425071132_umami/migration.sql
diff --git a/prisma/migrations/20220425075326_auto_update_coolify/migration.sql b/apps/api/prisma/migrations/20220425075326_auto_update_coolify/migration.sql
similarity index 100%
rename from prisma/migrations/20220425075326_auto_update_coolify/migration.sql
rename to apps/api/prisma/migrations/20220425075326_auto_update_coolify/migration.sql
diff --git a/prisma/migrations/20220426125053_select_base_image/migration.sql b/apps/api/prisma/migrations/20220426125053_select_base_image/migration.sql
similarity index 100%
rename from prisma/migrations/20220426125053_select_base_image/migration.sql
rename to apps/api/prisma/migrations/20220426125053_select_base_image/migration.sql
diff --git a/prisma/migrations/20220427133656_hasura/migration.sql b/apps/api/prisma/migrations/20220427133656_hasura/migration.sql
similarity index 100%
rename from prisma/migrations/20220427133656_hasura/migration.sql
rename to apps/api/prisma/migrations/20220427133656_hasura/migration.sql
diff --git a/prisma/migrations/20220429202516_fider/migration.sql b/apps/api/prisma/migrations/20220429202516_fider/migration.sql
similarity index 100%
rename from prisma/migrations/20220429202516_fider/migration.sql
rename to apps/api/prisma/migrations/20220429202516_fider/migration.sql
diff --git a/prisma/migrations/20220429214112_fider_correction/migration.sql b/apps/api/prisma/migrations/20220429214112_fider_correction/migration.sql
similarity index 100%
rename from prisma/migrations/20220429214112_fider_correction/migration.sql
rename to apps/api/prisma/migrations/20220429214112_fider_correction/migration.sql
diff --git a/prisma/migrations/20220430111953_ssl_dns_check_settings/migration.sql b/apps/api/prisma/migrations/20220430111953_ssl_dns_check_settings/migration.sql
similarity index 100%
rename from prisma/migrations/20220430111953_ssl_dns_check_settings/migration.sql
rename to apps/api/prisma/migrations/20220430111953_ssl_dns_check_settings/migration.sql
diff --git a/prisma/migrations/20220430124553_expose_port_for_services/migration.sql b/apps/api/prisma/migrations/20220430124553_expose_port_for_services/migration.sql
similarity index 100%
rename from prisma/migrations/20220430124553_expose_port_for_services/migration.sql
rename to apps/api/prisma/migrations/20220430124553_expose_port_for_services/migration.sql
diff --git a/prisma/migrations/20220509130501_custom_plausible_script/migration.sql b/apps/api/prisma/migrations/20220509130501_custom_plausible_script/migration.sql
similarity index 100%
rename from prisma/migrations/20220509130501_custom_plausible_script/migration.sql
rename to apps/api/prisma/migrations/20220509130501_custom_plausible_script/migration.sql
diff --git a/prisma/migrations/20220510081125_custom_wordpress_db/migration.sql b/apps/api/prisma/migrations/20220510081125_custom_wordpress_db/migration.sql
similarity index 100%
rename from prisma/migrations/20220510081125_custom_wordpress_db/migration.sql
rename to apps/api/prisma/migrations/20220510081125_custom_wordpress_db/migration.sql
diff --git a/prisma/migrations/20220517081328_traefik/migration.sql b/apps/api/prisma/migrations/20220517081328_traefik/migration.sql
similarity index 100%
rename from prisma/migrations/20220517081328_traefik/migration.sql
rename to apps/api/prisma/migrations/20220517081328_traefik/migration.sql
diff --git a/prisma/migrations/20220519095648_minio_apifqdn/migration.sql b/apps/api/prisma/migrations/20220519095648_minio_apifqdn/migration.sql
similarity index 100%
rename from prisma/migrations/20220519095648_minio_apifqdn/migration.sql
rename to apps/api/prisma/migrations/20220519095648_minio_apifqdn/migration.sql
diff --git a/prisma/migrations/migration_lock.toml b/apps/api/prisma/migrations/migration_lock.toml
similarity index 100%
rename from prisma/migrations/migration_lock.toml
rename to apps/api/prisma/migrations/migration_lock.toml
diff --git a/prisma/schema.prisma b/apps/api/prisma/schema.prisma
similarity index 100%
rename from prisma/schema.prisma
rename to apps/api/prisma/schema.prisma
diff --git a/apps/api/prisma/seed.js b/apps/api/prisma/seed.js
new file mode 100644
index 0000000000..0113596827
--- /dev/null
+++ b/apps/api/prisma/seed.js
@@ -0,0 +1,75 @@
+const dotEnvExtended = require('dotenv-extended');
+dotEnvExtended.load();
+const crypto = require('crypto');
+const generator = require('generate-password');
+const cuid = require('cuid');
+const { PrismaClient } = require('@prisma/client');
+const prisma = new PrismaClient();
+
+function generatePassword(length = 24) {
+ return generator.generate({
+ length,
+ numbers: true,
+ strict: true
+ });
+}
+const algorithm = 'aes-256-ctr';
+
+async function main() {
+ // Enable registration for the first user
+ // Set initial HAProxy password
+ const settingsFound = await prisma.setting.findFirst({});
+ if (!settingsFound) {
+ await prisma.setting.create({
+ data: {
+ isRegistrationEnabled: true,
+ isTraefikUsed: true,
+ }
+ });
+ } else {
+ await prisma.setting.update({
+ where: {
+ id: settingsFound.id
+ },
+ data: {
+ isTraefikUsed: true,
+ proxyHash: null
+ }
+ });
+ }
+ const localDocker = await prisma.destinationDocker.findFirst({
+ where: { engine: '/var/run/docker.sock' }
+ });
+ if (!localDocker) {
+ await prisma.destinationDocker.create({
+ data: {
+ engine: '/var/run/docker.sock',
+ name: 'Local Docker',
+ isCoolifyProxyUsed: true,
+ network: 'coolify'
+ }
+ });
+ }
+
+ // Set auto-update based on env variable
+ const isAutoUpdateEnabled = process.env['COOLIFY_AUTO_UPDATE'] === 'true';
+ const settings = await prisma.setting.findFirst({});
+ if (settings) {
+ await prisma.setting.update({
+ where: {
+ id: settings.id
+ },
+ data: {
+ isAutoUpdateEnabled
+ }
+ });
+ }
+}
+main()
+ .catch((e) => {
+ console.error(e);
+ process.exit(1);
+ })
+ .finally(async () => {
+ await prisma.$disconnect();
+ });
\ No newline at end of file
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
new file mode 100644
index 0000000000..362049263f
--- /dev/null
+++ b/apps/api/src/index.ts
@@ -0,0 +1,132 @@
+import Fastify from 'fastify';
+import cors from '@fastify/cors';
+import serve from '@fastify/static';
+import env from '@fastify/env';
+import cookie from '@fastify/cookie';
+import path, { join } from 'path';
+import autoLoad from '@fastify/autoload';
+import { asyncExecShell, isDev, prisma } from './lib/common';
+import { scheduler } from './lib/scheduler';
+
+declare module 'fastify' {
+ interface FastifyInstance {
+ config: {
+ COOLIFY_APP_ID: string,
+ COOLIFY_SECRET_KEY: string,
+ COOLIFY_DATABASE_URL: string,
+ COOLIFY_SENTRY_DSN: string,
+ COOLIFY_IS_ON: string,
+ COOLIFY_WHITE_LABELED: boolean,
+ COOLIFY_WHITE_LABELED_ICON: string | null,
+ COOLIFY_AUTO_UPDATE: boolean,
+ };
+ }
+}
+
+const port = isDev ? 3001 : 3000;
+const host = '0.0.0.0';
+const fastify = Fastify({
+ logger: false
+});
+const schema = {
+ type: 'object',
+ required: ['COOLIFY_SECRET_KEY', 'COOLIFY_DATABASE_URL', 'COOLIFY_IS_ON'],
+ properties: {
+ COOLIFY_APP_ID: {
+ type: 'string',
+ },
+ COOLIFY_SECRET_KEY: {
+ type: 'string',
+ },
+ COOLIFY_DATABASE_URL: {
+ type: 'string',
+ default: 'file:../db/dev.db'
+ },
+ COOLIFY_SENTRY_DSN: {
+ type: 'string',
+ default: null
+ },
+ COOLIFY_IS_ON: {
+ type: 'string',
+ default: 'docker'
+ },
+ COOLIFY_WHITE_LABELED: {
+ type: 'boolean',
+ default: false
+ },
+ COOLIFY_WHITE_LABELED_ICON: {
+ type: 'string',
+ default: null
+ },
+ COOLIFY_AUTO_UPDATE: {
+ type: 'boolean',
+ default: false
+ },
+
+ }
+};
+
+const options = {
+ schema
+};
+fastify.register(env, options);
+if (!isDev) {
+ fastify.register(serve, {
+ root: path.join(__dirname, './public'),
+ preCompressed: true
+ });
+ fastify.setNotFoundHandler(function (request, reply) {
+ if (request.raw.url && request.raw.url.startsWith('/api')) {
+ return reply.status(404).send({
+ success: false
+ });
+ }
+ return reply.status(200).sendFile('index.html');
+ });
+}
+fastify.register(autoLoad, {
+ dir: join(__dirname, 'plugins')
+});
+fastify.register(autoLoad, {
+ dir: join(__dirname, 'routes')
+});
+
+fastify.register(cookie)
+fastify.register(cors);
+fastify.listen({ port, host }, async (err: any, address: any) => {
+ if (err) {
+ console.error(err);
+ process.exit(1);
+ }
+ console.log(`Coolify's API is listening on ${host}:${port}`);
+ await initServer()
+ await scheduler.start('deployApplication');
+ await scheduler.start('cleanupStorage');
+ await scheduler.start('checkProxies')
+
+ // Check if no build is running, try to autoupdate.
+ setInterval(async () => {
+ const { isAutoUpdateEnabled } = await prisma.setting.findFirst();
+ if (isAutoUpdateEnabled) {
+ if (scheduler.workers.has('deployApplication')) {
+ scheduler.workers.get('deployApplication').postMessage("status");
+ }
+ }
+ }, 30000 * 10)
+
+ scheduler.on('worker deleted', async (name) => {
+ if (name === 'autoUpdater') {
+ await scheduler.start('deployApplication');
+ }
+
+ });
+
+});
+
+async function initServer() {
+ try {
+ await asyncExecShell(`docker network create --attachable coolify`);
+ } catch (error) { }
+}
+
+
diff --git a/apps/api/src/jobs/autoUpdater.ts b/apps/api/src/jobs/autoUpdater.ts
new file mode 100644
index 0000000000..566ffea295
--- /dev/null
+++ b/apps/api/src/jobs/autoUpdater.ts
@@ -0,0 +1,43 @@
+import axios from 'axios';
+import compareVersions from 'compare-versions';
+import { parentPort } from 'node:worker_threads';
+import { asyncExecShell, asyncSleep, isDev, prisma, version } from '../lib/common';
+
+(async () => {
+ if (parentPort) {
+ try {
+ const currentVersion = version;
+ const { data: versions } = await axios
+ .get(
+ `https://get.coollabs.io/versions.json`
+ , {
+ params: {
+ appId: process.env['COOLIFY_APP_ID'] || undefined,
+ version: currentVersion
+ }
+ })
+ const latestVersion = versions['coolify'].main.version;
+ const isUpdateAvailable = compareVersions(latestVersion, currentVersion);
+ if (isUpdateAvailable === 1) {
+ const activeCount = 0
+ if (activeCount === 0) {
+ if (!isDev) {
+ console.log(`Updating Coolify to ${latestVersion}.`);
+ await asyncExecShell(`docker pull coollabsio/coolify:${latestVersion}`);
+ await asyncExecShell(`env | grep COOLIFY > .env`);
+ await asyncExecShell(
+ `docker run --rm -tid --env-file .env -v /var/run/docker.sock:/var/run/docker.sock -v coolify-db coollabsio/coolify:${latestVersion} /bin/sh -c "env | grep COOLIFY > .env && echo 'TAG=${latestVersion}' >> .env && docker stop -t 0 coolify && docker rm coolify && docker compose up -d --force-recreate"`
+ );
+ } else {
+ console.log('Updating (not really in dev mode).');
+ }
+ }
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ await prisma.$disconnect();
+ }
+
+ } else process.exit(0);
+})();
diff --git a/apps/api/src/jobs/checkProxies.ts b/apps/api/src/jobs/checkProxies.ts
new file mode 100644
index 0000000000..6168baf5a5
--- /dev/null
+++ b/apps/api/src/jobs/checkProxies.ts
@@ -0,0 +1,88 @@
+import { parentPort } from 'node:worker_threads';
+import { prisma, startTraefikTCPProxy, generateDatabaseConfiguration, startTraefikProxy, asyncExecShell } from '../lib/common';
+import { checkContainer, getEngine } from '../lib/docker';
+
+(async () => {
+ if (parentPort) {
+ // Coolify Proxy
+ const engine = '/var/run/docker.sock';
+ const localDocker = await prisma.destinationDocker.findFirst({
+ where: { engine, network: 'coolify' }
+ });
+ if (localDocker && localDocker.isCoolifyProxyUsed) {
+ // Remove HAProxy
+ const found = await checkContainer(engine, 'coolify-haproxy');
+ const host = getEngine(engine);
+ if (found) {
+ await asyncExecShell(
+ `DOCKER_HOST="${host}" docker stop -t 0 coolify-haproxy && docker rm coolify-haproxy`
+ );
+ }
+ await startTraefikProxy(engine);
+
+ }
+
+ // TCP Proxies
+ const databasesWithPublicPort = await prisma.database.findMany({
+ where: { publicPort: { not: null } },
+ include: { settings: true, destinationDocker: true }
+ });
+ for (const database of databasesWithPublicPort) {
+ const { destinationDockerId, destinationDocker, publicPort, id } = database;
+ if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
+ const { privatePort } = generateDatabaseConfiguration(database);
+ // Remove HAProxy
+ const found = await checkContainer(engine, `haproxy-for-${publicPort}`);
+ const host = getEngine(engine);
+ if (found) {
+ await asyncExecShell(
+ `DOCKER_HOST="${host}" docker stop -t 0 haproxy-for-${publicPort} && docker rm haproxy-for-${publicPort}`
+ );
+ }
+ await startTraefikTCPProxy(destinationDocker, id, publicPort, privatePort);
+
+ }
+ }
+ const wordpressWithFtp = await prisma.wordpress.findMany({
+ where: { ftpPublicPort: { not: null } },
+ include: { service: { include: { destinationDocker: true } } }
+ });
+ for (const ftp of wordpressWithFtp) {
+ const { service, ftpPublicPort } = ftp;
+ const { destinationDockerId, destinationDocker, id } = service;
+ if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
+ // Remove HAProxy
+ const found = await checkContainer(engine, `haproxy-for-${ftpPublicPort}`);
+ const host = getEngine(engine);
+ if (found) {
+ await asyncExecShell(
+ `DOCKER_HOST="${host}" docker stop -t 0 haproxy-for-${ftpPublicPort} && docker rm haproxy-for-${ftpPublicPort} `
+ );
+ }
+ await startTraefikTCPProxy(destinationDocker, id, ftpPublicPort, 22, 'wordpressftp');
+ }
+ }
+
+ // HTTP Proxies
+ const minioInstances = await prisma.minio.findMany({
+ where: { publicPort: { not: null } },
+ include: { service: { include: { destinationDocker: true } } }
+ });
+ for (const minio of minioInstances) {
+ const { service, publicPort } = minio;
+ const { destinationDockerId, destinationDocker, id } = service;
+ if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
+ // Remove HAProxy
+ const found = await checkContainer(engine, `${id}-${publicPort}`);
+ const host = getEngine(engine);
+ if (found) {
+ await asyncExecShell(
+ `DOCKER_HOST="${host}" docker stop -t 0 ${id}-${publicPort} && docker rm ${id}-${publicPort}`
+ );
+ }
+ await startTraefikTCPProxy(destinationDocker, id, publicPort, 9000);
+ }
+ }
+ await prisma.$disconnect();
+ } else process.exit(0);
+})();
diff --git a/apps/api/src/jobs/cleanupStorage.ts b/apps/api/src/jobs/cleanupStorage.ts
new file mode 100644
index 0000000000..5cb04bdab7
--- /dev/null
+++ b/apps/api/src/jobs/cleanupStorage.ts
@@ -0,0 +1,90 @@
+import { parentPort } from 'node:worker_threads';
+import { asyncExecShell, isDev, prisma, version } from '../lib/common';
+import { getEngine } from '../lib/docker';
+
+(async () => {
+ if (parentPort) {
+ const destinationDockers = await prisma.destinationDocker.findMany();
+ const engines = [...new Set(destinationDockers.map(({ engine }) => engine))];
+ for (const engine of engines) {
+ let lowDiskSpace = false;
+ const host = getEngine(engine);
+ // try {
+ // let stdout = null
+ // if (!isDev) {
+ // const output = await asyncExecShell(
+ // `DOCKER_HOST=${host} docker exec coolify sh -c 'df -kPT /'`
+ // );
+ // stdout = output.stdout;
+ // } else {
+ // const output = await asyncExecShell(
+ // `df -kPT /`
+ // );
+ // stdout = output.stdout;
+ // }
+ // let lines = stdout.trim().split('\n');
+ // let header = lines[0];
+ // let regex =
+ // /^Filesystem\s+|Type\s+|1024-blocks|\s+Used|\s+Available|\s+Capacity|\s+Mounted on\s*$/g;
+ // const boundaries = [];
+ // let match;
+
+ // while ((match = regex.exec(header))) {
+ // boundaries.push(match[0].length);
+ // }
+
+ // boundaries[boundaries.length - 1] = -1;
+ // const data = lines.slice(1).map((line) => {
+ // const cl = boundaries.map((boundary) => {
+ // const column = boundary > 0 ? line.slice(0, boundary) : line;
+ // line = line.slice(boundary);
+ // return column.trim();
+ // });
+ // return {
+ // capacity: Number.parseInt(cl[5], 10) / 100
+ // };
+ // });
+ // if (data.length > 0) {
+ // const { capacity } = data[0];
+ // if (capacity > 0.6) {
+ // lowDiskSpace = true;
+ // }
+ // }
+ // } catch (error) {
+ // console.log(error);
+ // }
+ if (!isDev) {
+ // Cleanup old coolify images
+ try {
+ let { stdout: images } = await asyncExecShell(
+ `DOCKER_HOST=${host} docker images coollabsio/coolify --filter before="coollabsio/coolify:${version}" -q | xargs `
+ );
+ images = images.trim();
+ if (images) {
+ await asyncExecShell(`DOCKER_HOST=${host} docker rmi -f ${images}`);
+ }
+ } catch (error) {
+ //console.log(error);
+ }
+ try {
+ await asyncExecShell(`DOCKER_HOST=${host} docker container prune -f`);
+ } catch (error) {
+ //console.log(error);
+ }
+ try {
+ await asyncExecShell(`DOCKER_HOST=${host} docker image prune -f`);
+ } catch (error) {
+ //console.log(error);
+ }
+ try {
+ await asyncExecShell(`DOCKER_HOST=${host} docker image prune -a -f`);
+ } catch (error) {
+ //console.log(error);
+ }
+ } else {
+ console.log(`[DEV MODE] Low disk space: ${lowDiskSpace}`);
+ }
+ }
+ await prisma.$disconnect();
+ } else process.exit(0);
+})();
diff --git a/apps/api/src/jobs/deployApplication.ts b/apps/api/src/jobs/deployApplication.ts
new file mode 100644
index 0000000000..10703a105f
--- /dev/null
+++ b/apps/api/src/jobs/deployApplication.ts
@@ -0,0 +1,352 @@
+import { parentPort } from 'node:worker_threads';
+import crypto from 'crypto';
+import fs from 'fs/promises';
+import yaml from 'js-yaml';
+
+import { copyBaseConfigurationFiles, makeLabelForStandaloneApplication, saveBuildLog, setDefaultConfiguration } from '../lib/buildPacks/common';
+import { asyncExecShell, createDirectories, decrypt, getDomain, prisma } from '../lib/common';
+import { dockerInstance, getEngine } from '../lib/docker';
+import * as importers from '../lib/importers';
+import * as buildpacks from '../lib/buildPacks';
+
+(async () => {
+ if (parentPort) {
+ const concurrency = 1
+ const PQueue = await import('p-queue');
+ const queue = new PQueue.default({ concurrency });
+ parentPort.on('message', async (message) => {
+ if (parentPort) {
+ if (message === 'error') throw new Error('oops');
+ if (message === 'cancel') {
+ parentPort.postMessage('cancelled');
+ return;
+ }
+ if (message === 'status') {
+ parentPort.postMessage({ size: queue.size, pending: queue.pending });
+ return;
+ }
+
+ await queue.add(async () => {
+ const {
+ id: applicationId,
+ repository,
+ name,
+ destinationDocker,
+ destinationDockerId,
+ gitSource,
+ build_id: buildId,
+ configHash,
+ fqdn,
+ projectId,
+ secrets,
+ phpModules,
+ type,
+ pullmergeRequestId = null,
+ sourceBranch = null,
+ settings,
+ persistentStorage,
+ pythonWSGI,
+ pythonModule,
+ pythonVariable,
+ denoOptions,
+ exposePort,
+ baseImage,
+ baseBuildImage
+ } = message
+ let {
+ branch,
+ buildPack,
+ port,
+ installCommand,
+ buildCommand,
+ startCommand,
+ baseDirectory,
+ publishDirectory,
+ dockerFileLocation,
+ denoMainFile
+ } = message
+ try {
+ const { debug } = settings;
+ if (concurrency === 1) {
+ await prisma.build.updateMany({
+ where: {
+ status: { in: ['queued', 'running'] },
+ id: { not: buildId },
+ applicationId,
+ createdAt: { lt: new Date(new Date().getTime() - 10 * 1000) }
+ },
+ data: { status: 'failed' }
+ });
+ }
+ let imageId = applicationId;
+ let domain = getDomain(fqdn);
+ const volumes =
+ persistentStorage?.map((storage) => {
+ return `${applicationId}${storage.path.replace(/\//gi, '-')}:${buildPack !== 'docker' ? '/app' : ''
+ }${storage.path}`;
+ }) || [];
+ // Previews, we need to get the source branch and set subdomain
+ if (pullmergeRequestId) {
+ branch = sourceBranch;
+ domain = `${pullmergeRequestId}.${domain}`;
+ imageId = `${applicationId}-${pullmergeRequestId}`;
+ }
+
+ let deployNeeded = true;
+ let destinationType;
+
+ if (destinationDockerId) {
+ destinationType = 'docker';
+ }
+ if (destinationType === 'docker') {
+ const docker = dockerInstance({ destinationDocker });
+ const host = getEngine(destinationDocker.engine);
+
+ await prisma.build.update({ where: { id: buildId }, data: { status: 'running' } });
+ const { workdir, repodir } = await createDirectories({ repository, buildId });
+ const configuration = await setDefaultConfiguration(message);
+
+ buildPack = configuration.buildPack;
+ port = configuration.port;
+ installCommand = configuration.installCommand;
+ startCommand = configuration.startCommand;
+ buildCommand = configuration.buildCommand;
+ publishDirectory = configuration.publishDirectory;
+ baseDirectory = configuration.baseDirectory;
+ dockerFileLocation = configuration.dockerFileLocation;
+ denoMainFile = configuration.denoMainFile;
+ const commit = await importers[gitSource.type]({
+ applicationId,
+ debug,
+ workdir,
+ repodir,
+ githubAppId: gitSource.githubApp?.id,
+ gitlabAppId: gitSource.gitlabApp?.id,
+ repository,
+ branch,
+ buildId,
+ apiUrl: gitSource.apiUrl,
+ htmlUrl: gitSource.htmlUrl,
+ projectId,
+ deployKeyId: gitSource.gitlabApp?.deployKeyId || null,
+ privateSshKey: decrypt(gitSource.gitlabApp?.privateSshKey) || null
+ });
+ if (!commit) {
+ throw new Error('No commit found?');
+ }
+ let tag = commit.slice(0, 7);
+ if (pullmergeRequestId) {
+ tag = `${commit.slice(0, 7)}-${pullmergeRequestId}`;
+ }
+
+ try {
+ await prisma.build.update({ where: { id: buildId }, data: { commit } });
+ } catch (err) {
+ console.log(err);
+ }
+ if (!pullmergeRequestId) {
+ const currentHash = crypto
+ //@ts-ignore
+ .createHash('sha256')
+ .update(
+ JSON.stringify({
+ buildPack,
+ port,
+ exposePort,
+ installCommand,
+ buildCommand,
+ startCommand,
+ secrets,
+ branch,
+ repository,
+ fqdn
+ })
+ )
+ .digest('hex');
+
+ if (configHash !== currentHash) {
+ await prisma.application.update({
+ where: { id: applicationId },
+ data: { configHash: currentHash }
+ });
+ deployNeeded = true;
+ if (configHash) {
+ await saveBuildLog({ line: 'Configuration changed.', buildId, applicationId });
+ }
+ } else {
+ deployNeeded = false;
+ }
+ } else {
+ deployNeeded = true;
+ }
+ const image = await docker.engine.getImage(`${applicationId}:${tag}`);
+ let imageFound = false;
+ try {
+ await image.inspect();
+ imageFound = false;
+ } catch (error) {
+ //
+ }
+ if (!imageFound || deployNeeded) {
+ await copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId, baseImage);
+ if (buildpacks[buildPack])
+ await buildpacks[buildPack]({
+ buildId,
+ applicationId,
+ domain,
+ name,
+ type,
+ pullmergeRequestId,
+ buildPack,
+ repository,
+ branch,
+ projectId,
+ publishDirectory,
+ debug,
+ commit,
+ tag,
+ workdir,
+ docker,
+ port: exposePort ? `${exposePort}:${port}` : port,
+ installCommand,
+ buildCommand,
+ startCommand,
+ baseDirectory,
+ secrets,
+ phpModules,
+ pythonWSGI,
+ pythonModule,
+ pythonVariable,
+ dockerFileLocation,
+ denoMainFile,
+ denoOptions,
+ baseImage,
+ baseBuildImage
+ });
+ else {
+ await saveBuildLog({ line: `Build pack ${buildPack} not found`, buildId, applicationId });
+ throw new Error(`Build pack ${buildPack} not found.`);
+ }
+ } else {
+ await saveBuildLog({ line: 'Nothing changed.', buildId, applicationId });
+ }
+ try {
+ await asyncExecShell(`DOCKER_HOST=${host} docker stop -t 0 ${imageId}`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker rm ${imageId}`);
+ } catch (error) {
+ //
+ }
+ const envs = [];
+ if (secrets.length > 0) {
+ secrets.forEach((secret) => {
+ if (pullmergeRequestId) {
+ if (secret.isPRMRSecret) {
+ envs.push(`${secret.name}=${secret.value}`);
+ }
+ } else {
+ if (!secret.isPRMRSecret) {
+ envs.push(`${secret.name}=${secret.value}`);
+ }
+ }
+ });
+ }
+ await fs.writeFile(`${workdir}/.env`, envs.join('\n'));
+ const labels = makeLabelForStandaloneApplication({
+ applicationId,
+ fqdn,
+ name,
+ type,
+ pullmergeRequestId,
+ buildPack,
+ repository,
+ branch,
+ projectId,
+ port: exposePort ? `${exposePort}:${port}` : port,
+ commit,
+ installCommand,
+ buildCommand,
+ startCommand,
+ baseDirectory,
+ publishDirectory
+ });
+ let envFound = false;
+ try {
+ envFound = !!(await fs.stat(`${workdir}/.env`));
+ } catch (error) {
+ //
+ }
+ try {
+ await saveBuildLog({ line: 'Deployment started.', buildId, applicationId });
+ const composeVolumes = volumes.map((volume) => {
+ return {
+ [`${volume.split(':')[0]}`]: {
+ name: volume.split(':')[0]
+ }
+ };
+ });
+ const composeFile = {
+ version: '3.8',
+ services: {
+ [imageId]: {
+ image: `${applicationId}:${tag}`,
+ container_name: imageId,
+ volumes,
+ env_file: envFound ? [`${workdir}/.env`] : [],
+ networks: [docker.network],
+ labels,
+ depends_on: [],
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ // logging: {
+ // driver: 'fluentd',
+ // },
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [docker.network]: {
+ external: true
+ }
+ },
+ volumes: Object.assign({}, ...composeVolumes)
+ };
+ await fs.writeFile(`${workdir}/docker-compose.yml`, yaml.dump(composeFile));
+ await asyncExecShell(
+ `DOCKER_HOST=${host} docker compose --project-directory ${workdir} up -d`
+ );
+ await saveBuildLog({ line: 'Deployment successful!', buildId, applicationId });
+ } catch (error) {
+ await saveBuildLog({ line: error, buildId, applicationId });
+ await prisma.build.update({
+ where: { id: message.build_id },
+ data: { status: 'failed' }
+ });
+ throw new Error(error);
+ }
+ await saveBuildLog({ line: 'Proxy will be updated shortly.', buildId, applicationId });
+ await prisma.build.update({ where: { id: message.build_id }, data: { status: 'success' } });
+ }
+
+ }
+ catch (error) {
+ await prisma.build.update({
+ where: { id: message.build_id },
+ data: { status: 'failed' }
+ });
+ await saveBuildLog({ line: error, buildId, applicationId });
+ } finally {
+ await prisma.$disconnect();
+ }
+ });
+ await prisma.$disconnect();
+ }
+ });
+ } else process.exit(0);
+})();
diff --git a/src/lib/buildPacks/common.ts b/apps/api/src/lib/buildPacks/common.ts
similarity index 62%
rename from src/lib/buildPacks/common.ts
rename to apps/api/src/lib/buildPacks/common.ts
index c6f1f75f89..a2330cf522 100644
--- a/src/lib/buildPacks/common.ts
+++ b/apps/api/src/lib/buildPacks/common.ts
@@ -1,10 +1,7 @@
-import { base64Encode } from '$lib/crypto';
-import { getDomain, saveBuildLog, version } from '$lib/common';
-import * as db from '$lib/database';
-import { scanningTemplates } from '$lib/components/templates';
+import { asyncExecShell, base64Encode, generateTimestamp, getDomain, isDev, prisma, version } from "../common";
+import { scheduler } from "../scheduler";
import { promises as fs } from 'fs';
-import { staticDeployments } from '$lib/components/common';
-
+import { day } from "../dayjs";
const staticApps = ['static', 'react', 'vuejs', 'svelte', 'gatsby', 'astro', 'eleventy'];
const nodeBased = [
'react',
@@ -20,223 +17,7 @@ const nodeBased = [
'nextjs'
];
-export function makeLabelForStandaloneApplication({
- applicationId,
- fqdn,
- name,
- type,
- pullmergeRequestId = null,
- buildPack,
- repository,
- branch,
- projectId,
- port,
- commit,
- installCommand,
- buildCommand,
- startCommand,
- baseDirectory,
- publishDirectory
-}) {
- if (pullmergeRequestId) {
- const protocol = fqdn.startsWith('https://') ? 'https' : 'http';
- const domain = getDomain(fqdn);
- fqdn = `${protocol}://${pullmergeRequestId}.${domain}`;
- }
- return [
- 'coolify.managed=true',
- `coolify.version=${version}`,
- `coolify.type=standalone-application`,
- `coolify.configuration=${base64Encode(
- JSON.stringify({
- applicationId,
- fqdn,
- name,
- type,
- pullmergeRequestId,
- buildPack,
- repository,
- branch,
- projectId,
- port,
- commit,
- installCommand,
- buildCommand,
- startCommand,
- baseDirectory,
- publishDirectory
- })
- )}`
- ];
-}
-export async function makeLabelForStandaloneDatabase({ id, image, volume }) {
- const database = await db.prisma.database.findFirst({ where: { id } });
- delete database.destinationDockerId;
- delete database.createdAt;
- delete database.updatedAt;
- return [
- 'coolify.managed=true',
- `coolify.version=${version}`,
- `coolify.type=standalone-database`,
- `coolify.configuration=${base64Encode(
- JSON.stringify({
- version,
- image,
- volume,
- ...database
- })
- )}`
- ];
-}
-
-export function makeLabelForServices(type) {
- return [
- 'coolify.managed=true',
- `coolify.version=${version}`,
- `coolify.type=service`,
- `coolify.service.type=${type}`
- ];
-}
-
-export const setDefaultConfiguration = async (data) => {
- let {
- buildPack,
- port,
- installCommand,
- startCommand,
- buildCommand,
- publishDirectory,
- baseDirectory,
- dockerFileLocation,
- denoMainFile
- } = data;
- const template = scanningTemplates[buildPack];
- if (!port) {
- port = template?.port || 3000;
-
- if (buildPack === 'static') port = 80;
- else if (buildPack === 'node') port = 3000;
- else if (buildPack === 'php') port = 80;
- else if (buildPack === 'python') port = 8000;
- }
- if (!installCommand && buildPack !== 'static' && buildPack !== 'laravel')
- installCommand = template?.installCommand || 'yarn install';
- if (!startCommand && buildPack !== 'static' && buildPack !== 'laravel')
- startCommand = template?.startCommand || 'yarn start';
- if (!buildCommand && buildPack !== 'static' && buildPack !== 'laravel')
- buildCommand = template?.buildCommand || null;
- if (!publishDirectory) publishDirectory = template?.publishDirectory || null;
- if (baseDirectory) {
- if (!baseDirectory.startsWith('/')) baseDirectory = `/${baseDirectory}`;
- if (!baseDirectory.endsWith('/')) baseDirectory = `${baseDirectory}/`;
- }
- if (dockerFileLocation) {
- if (!dockerFileLocation.startsWith('/')) dockerFileLocation = `/${dockerFileLocation}`;
- if (dockerFileLocation.endsWith('/')) dockerFileLocation = dockerFileLocation.slice(0, -1);
- } else {
- dockerFileLocation = '/Dockerfile';
- }
- if (!denoMainFile) {
- denoMainFile = 'main.ts';
- }
-
- return {
- buildPack,
- port,
- installCommand,
- startCommand,
- buildCommand,
- publishDirectory,
- baseDirectory,
- dockerFileLocation,
- denoMainFile
- };
-};
-
-export async function copyBaseConfigurationFiles(
- buildPack,
- workdir,
- buildId,
- applicationId,
- baseImage
-) {
- try {
- if (buildPack === 'php') {
- await fs.writeFile(`${workdir}/entrypoint.sh`, `chown -R 1000 /app`);
- await saveBuildLog({
- line: 'Copied default configuration file for PHP.',
- buildId,
- applicationId
- });
- } else if (staticDeployments.includes(buildPack) && baseImage.includes('nginx')) {
- await fs.writeFile(
- `${workdir}/nginx.conf`,
- `user nginx;
- worker_processes auto;
-
- error_log /docker.stdout;
- pid /run/nginx.pid;
-
- events {
- worker_connections 1024;
- }
-
- http {
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
-
- access_log /docker.stdout main;
-
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- keepalive_timeout 65;
- types_hash_max_size 2048;
-
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
-
- server {
- listen 80;
- server_name localhost;
-
- location / {
- root /app;
- index index.html;
- try_files $uri $uri/index.html $uri/ /index.html =404;
- }
-
- error_page 404 /50x.html;
-
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /app;
- }
-
- }
-
- }
- `
- );
- }
- } catch (error) {
- console.log(error);
- throw new Error(error);
- }
-}
-
-export function checkPnpm(installCommand = null, buildCommand = null, startCommand = null) {
- return (
- installCommand?.includes('pnpm') ||
- buildCommand?.includes('pnpm') ||
- startCommand?.includes('pnpm')
- );
-}
-
-export function setDefaultBaseImage(buildPack) {
+export function setDefaultBaseImage(buildPack: string | null) {
const nodeVersions = [
{
value: 'node:lts',
@@ -471,7 +252,7 @@ export function setDefaultBaseImage(buildPack) {
label: 'python:3.7-slim-bullseye'
}
];
- let payload = {
+ let payload: any = {
baseImage: null,
baseBuildImage: null,
baseImages: [],
@@ -513,3 +294,421 @@ export function setDefaultBaseImage(buildPack) {
}
return payload;
}
+
+export const setDefaultConfiguration = async (data: any) => {
+ let {
+ buildPack,
+ port,
+ installCommand,
+ startCommand,
+ buildCommand,
+ publishDirectory,
+ baseDirectory,
+ dockerFileLocation,
+ denoMainFile
+ } = data;
+ //@ts-ignore
+ const template = scanningTemplates[buildPack];
+ if (!port) {
+ port = template?.port || 3000;
+
+ if (buildPack === 'static') port = 80;
+ else if (buildPack === 'node') port = 3000;
+ else if (buildPack === 'php') port = 80;
+ else if (buildPack === 'python') port = 8000;
+ }
+ if (!installCommand && buildPack !== 'static' && buildPack !== 'laravel')
+ installCommand = template?.installCommand || 'yarn install';
+ if (!startCommand && buildPack !== 'static' && buildPack !== 'laravel')
+ startCommand = template?.startCommand || 'yarn start';
+ if (!buildCommand && buildPack !== 'static' && buildPack !== 'laravel')
+ buildCommand = template?.buildCommand || null;
+ if (!publishDirectory) publishDirectory = template?.publishDirectory || null;
+ if (baseDirectory) {
+ if (!baseDirectory.startsWith('/')) baseDirectory = `/${baseDirectory}`;
+ if (!baseDirectory.endsWith('/')) baseDirectory = `${baseDirectory}/`;
+ }
+ if (dockerFileLocation) {
+ if (!dockerFileLocation.startsWith('/')) dockerFileLocation = `/${dockerFileLocation}`;
+ if (dockerFileLocation.endsWith('/')) dockerFileLocation = dockerFileLocation.slice(0, -1);
+ } else {
+ dockerFileLocation = '/Dockerfile';
+ }
+ if (!denoMainFile) {
+ denoMainFile = 'main.ts';
+ }
+
+ return {
+ buildPack,
+ port,
+ installCommand,
+ startCommand,
+ buildCommand,
+ publishDirectory,
+ baseDirectory,
+ dockerFileLocation,
+ denoMainFile
+ };
+};
+
+export const scanningTemplates = {
+ '@sveltejs/kit': {
+ buildPack: 'nodejs'
+ },
+ astro: {
+ buildPack: 'astro'
+ },
+ '@11ty/eleventy': {
+ buildPack: 'eleventy'
+ },
+ svelte: {
+ buildPack: 'svelte'
+ },
+ '@nestjs/core': {
+ buildPack: 'nestjs'
+ },
+ next: {
+ buildPack: 'nextjs'
+ },
+ nuxt: {
+ buildPack: 'nuxtjs'
+ },
+ 'react-scripts': {
+ buildPack: 'react'
+ },
+ 'parcel-bundler': {
+ buildPack: 'static'
+ },
+ '@vue/cli-service': {
+ buildPack: 'vuejs'
+ },
+ vuejs: {
+ buildPack: 'vuejs'
+ },
+ gatsby: {
+ buildPack: 'gatsby'
+ },
+ 'preact-cli': {
+ buildPack: 'react'
+ }
+};
+
+
+export const saveBuildLog = async ({
+ line,
+ buildId,
+ applicationId
+}: {
+ line: string;
+ buildId: string;
+ applicationId: string;
+}): Promise<any> => {
+ if (line && typeof line === 'string' && line.includes('ghs_')) {
+ const regex = /ghs_.*@/g;
+ line = line.replace(regex, '<SENSITIVE_DATA_DELETED>@');
+ }
+ const addTimestamp = `[${generateTimestamp()}] ${line}`;
+ if (isDev) console.debug(`[${applicationId}] ${addTimestamp}`);
+ return await prisma.buildLog.create({
+ data: {
+ line: addTimestamp, buildId, time: Number(day().valueOf()), applicationId
+ }
+ });
+};
+
+export async function copyBaseConfigurationFiles(
+ buildPack,
+ workdir,
+ buildId,
+ applicationId,
+ baseImage
+) {
+ try {
+ if (buildPack === 'php') {
+ await fs.writeFile(`${workdir}/entrypoint.sh`, `chown -R 1000 /app`);
+ await saveBuildLog({
+ line: 'Copied default configuration file for PHP.',
+ buildId,
+ applicationId
+ });
+ } else if (staticApps.includes(buildPack) && baseImage.includes('nginx')) {
+ await fs.writeFile(
+ `${workdir}/nginx.conf`,
+ `user nginx;
+ worker_processes auto;
+
+ error_log /docker.stdout;
+ pid /run/nginx.pid;
+
+ events {
+ worker_connections 1024;
+ }
+
+ http {
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ '$status $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+
+ access_log /docker.stdout main;
+
+ sendfile on;
+ tcp_nopush on;
+ tcp_nodelay on;
+ keepalive_timeout 65;
+ types_hash_max_size 2048;
+
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+ server {
+ listen 80;
+ server_name localhost;
+
+ location / {
+ root /app;
+ index index.html;
+ try_files $uri $uri/index.html $uri/ /index.html =404;
+ }
+
+ error_page 404 /50x.html;
+
+ # redirect server error pages to the static page /50x.html
+ #
+ error_page 500 502 503 504 /50x.html;
+ location = /50x.html {
+ root /app;
+ }
+
+ }
+
+ }
+ `
+ );
+ }
+ } catch (error) {
+ console.log(error);
+ throw new Error(error);
+ }
+}
+
+export function checkPnpm(installCommand = null, buildCommand = null, startCommand = null) {
+ return (
+ installCommand?.includes('pnpm') ||
+ buildCommand?.includes('pnpm') ||
+ startCommand?.includes('pnpm')
+ );
+}
+
+
+export async function buildImage({
+ applicationId,
+ tag,
+ workdir,
+ docker,
+ buildId,
+ isCache = false,
+ debug = false,
+ dockerFileLocation = '/Dockerfile'
+}) {
+ if (isCache) {
+ await saveBuildLog({ line: `Building cache image started.`, buildId, applicationId });
+ } else {
+ await saveBuildLog({ line: `Building image started.`, buildId, applicationId });
+ }
+ if (!debug && isCache) {
+ await saveBuildLog({
+ line: `Debug turned off. To see more details, allow it in the configuration.`,
+ buildId,
+ applicationId
+ });
+ }
+
+ const stream = await docker.engine.buildImage(
+ { src: ['.'], context: workdir },
+ {
+ dockerfile: isCache ? `${dockerFileLocation}-cache` : dockerFileLocation,
+ t: `${applicationId}:${tag}${isCache ? '-cache' : ''}`
+ }
+ );
+ await streamEvents({ stream, docker, buildId, applicationId, debug });
+ await saveBuildLog({ line: `Building image successful!`, buildId, applicationId });
+}
+
+export async function streamEvents({ stream, docker, buildId, applicationId, debug }) {
+ await new Promise((resolve, reject) => {
+ docker.engine.modem.followProgress(stream, onFinished, onProgress);
+ function onFinished(err, res) {
+ if (err) reject(err);
+ resolve(res);
+ }
+ async function onProgress(event) {
+ if (event.error) {
+ reject(event.error);
+ } else if (event.stream) {
+ if (event.stream !== '\n') {
+ if (debug)
+ await saveBuildLog({
+ line: `${event.stream.replace('\n', '')}`,
+ buildId,
+ applicationId
+ });
+ }
+ }
+ }
+ });
+}
+
+export function makeLabelForStandaloneApplication({
+ applicationId,
+ fqdn,
+ name,
+ type,
+ pullmergeRequestId = null,
+ buildPack,
+ repository,
+ branch,
+ projectId,
+ port,
+ commit,
+ installCommand,
+ buildCommand,
+ startCommand,
+ baseDirectory,
+ publishDirectory
+}) {
+ if (pullmergeRequestId) {
+ const protocol = fqdn.startsWith('https://') ? 'https' : 'http';
+ const domain = getDomain(fqdn);
+ fqdn = `${protocol}://${pullmergeRequestId}.${domain}`;
+ }
+ return [
+ 'coolify.managed=true',
+ `coolify.version=${version}`,
+ `coolify.type=standalone-application`,
+ `coolify.configuration=${base64Encode(
+ JSON.stringify({
+ applicationId,
+ fqdn,
+ name,
+ type,
+ pullmergeRequestId,
+ buildPack,
+ repository,
+ branch,
+ projectId,
+ port,
+ commit,
+ installCommand,
+ buildCommand,
+ startCommand,
+ baseDirectory,
+ publishDirectory
+ })
+ )}`
+ ];
+}
+
+export async function buildCacheImageWithNode(data, imageForBuild) {
+ const {
+ applicationId,
+ tag,
+ workdir,
+ docker,
+ buildId,
+ baseDirectory,
+ installCommand,
+ buildCommand,
+ debug,
+ secrets,
+ pullmergeRequestId
+ } = data;
+ const isPnpm = checkPnpm(installCommand, buildCommand);
+ const Dockerfile: Array<string> = [];
+ Dockerfile.push(`FROM ${imageForBuild}`);
+ Dockerfile.push('WORKDIR /app');
+ Dockerfile.push(`LABEL coolify.buildId=${buildId}`);
+ if (secrets.length > 0) {
+ secrets.forEach((secret) => {
+ if (secret.isBuildSecret) {
+ if (pullmergeRequestId) {
+ if (secret.isPRMRSecret) {
+ Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
+ }
+ } else {
+ if (!secret.isPRMRSecret) {
+ Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
+ }
+ }
+ }
+ });
+ }
+ if (isPnpm) {
+ Dockerfile.push('RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7');
+ }
+ if (installCommand) {
+ Dockerfile.push(`COPY .${baseDirectory || ''}/package.json ./`);
+ Dockerfile.push(`RUN ${installCommand}`);
+ }
+ Dockerfile.push(`COPY .${baseDirectory || ''} ./`);
+ Dockerfile.push(`RUN ${buildCommand}`);
+ await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));
+ await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });
+}
+
+export async function buildCacheImageForLaravel(data, imageForBuild) {
+ const { applicationId, tag, workdir, docker, buildId, debug, secrets, pullmergeRequestId } = data;
+ const Dockerfile: Array<string> = [];
+ Dockerfile.push(`FROM ${imageForBuild}`);
+ Dockerfile.push('WORKDIR /app');
+ Dockerfile.push(`LABEL coolify.buildId=${buildId}`);
+ if (secrets.length > 0) {
+ secrets.forEach((secret) => {
+ if (secret.isBuildSecret) {
+ if (pullmergeRequestId) {
+ if (secret.isPRMRSecret) {
+ Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
+ }
+ } else {
+ if (!secret.isPRMRSecret) {
+ Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
+ }
+ }
+ }
+ });
+ }
+ Dockerfile.push(`COPY *.json *.mix.js /app/`);
+ Dockerfile.push(`COPY resources /app/resources`);
+ Dockerfile.push(`RUN yarn install && yarn production`);
+ await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));
+ await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });
+}
+
+export async function buildCacheImageWithCargo(data, imageForBuild) {
+ const {
+ applicationId,
+ tag,
+ workdir,
+ docker,
+ buildId,
+ baseDirectory,
+ installCommand,
+ buildCommand,
+ debug,
+ secrets
+ } = data;
+ const Dockerfile: Array<string> = [];
+ Dockerfile.push(`FROM ${imageForBuild} as planner-${applicationId}`);
+ Dockerfile.push(`LABEL coolify.buildId=${buildId}`);
+ Dockerfile.push('WORKDIR /app');
+ Dockerfile.push('RUN cargo install cargo-chef');
+ Dockerfile.push('COPY . .');
+ Dockerfile.push('RUN cargo chef prepare --recipe-path recipe.json');
+ Dockerfile.push(`FROM ${imageForBuild}`);
+ Dockerfile.push(`LABEL coolify.buildId=${buildId}`);
+ Dockerfile.push('WORKDIR /app');
+ Dockerfile.push('RUN cargo install cargo-chef');
+ Dockerfile.push(`COPY --from=planner-${applicationId} /app/recipe.json recipe.json`);
+ Dockerfile.push('RUN cargo chef cook --release --recipe-path recipe.json');
+ await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));
+ await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });
+}
\ No newline at end of file
diff --git a/src/lib/buildPacks/deno.ts b/apps/api/src/lib/buildPacks/deno.ts
similarity index 97%
rename from src/lib/buildPacks/deno.ts
rename to apps/api/src/lib/buildPacks/deno.ts
index b593596f7a..3b35641bc4 100644
--- a/src/lib/buildPacks/deno.ts
+++ b/apps/api/src/lib/buildPacks/deno.ts
@@ -1,5 +1,5 @@
-import { buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
+import { buildImage } from './common';
const createDockerfile = async (data, image): Promise<void> => {
const {
diff --git a/src/lib/buildPacks/docker.ts b/apps/api/src/lib/buildPacks/docker.ts
similarity index 96%
rename from src/lib/buildPacks/docker.ts
rename to apps/api/src/lib/buildPacks/docker.ts
index 3b032fc4b1..88d900c383 100644
--- a/src/lib/buildPacks/docker.ts
+++ b/apps/api/src/lib/buildPacks/docker.ts
@@ -1,5 +1,5 @@
-import { buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
+import { buildImage } from './common';
export default async function ({
applicationId,
diff --git a/src/lib/buildPacks/gatsby.ts b/apps/api/src/lib/buildPacks/gatsby.ts
similarity index 93%
rename from src/lib/buildPacks/gatsby.ts
rename to apps/api/src/lib/buildPacks/gatsby.ts
index dc1c7d0e80..c0b76b2a52 100644
--- a/src/lib/buildPacks/gatsby.ts
+++ b/apps/api/src/lib/buildPacks/gatsby.ts
@@ -1,5 +1,5 @@
-import { buildCacheImageWithNode, buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
+import { buildCacheImageWithNode, buildImage } from './common';
const createDockerfile = async (data, imageforBuild): Promise<void> => {
const { applicationId, tag, workdir, publishDirectory, baseImage, buildId, port } = data;
diff --git a/src/lib/buildPacks/index.ts b/apps/api/src/lib/buildPacks/index.ts
similarity index 100%
rename from src/lib/buildPacks/index.ts
rename to apps/api/src/lib/buildPacks/index.ts
diff --git a/src/lib/buildPacks/laravel.ts b/apps/api/src/lib/buildPacks/laravel.ts
similarity index 95%
rename from src/lib/buildPacks/laravel.ts
rename to apps/api/src/lib/buildPacks/laravel.ts
index 4912a772f4..9a00eff087 100644
--- a/src/lib/buildPacks/laravel.ts
+++ b/apps/api/src/lib/buildPacks/laravel.ts
@@ -1,5 +1,5 @@
-import { buildCacheImageForLaravel, buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
+import { buildCacheImageForLaravel, buildImage } from './common';
const createDockerfile = async (data, image): Promise<void> => {
const { workdir, applicationId, tag, buildId, port } = data;
diff --git a/src/lib/buildPacks/nestjs.ts b/apps/api/src/lib/buildPacks/nestjs.ts
similarity index 93%
rename from src/lib/buildPacks/nestjs.ts
rename to apps/api/src/lib/buildPacks/nestjs.ts
index 9486c9e8e5..90c99301b7 100644
--- a/src/lib/buildPacks/nestjs.ts
+++ b/apps/api/src/lib/buildPacks/nestjs.ts
@@ -1,5 +1,5 @@
-import { buildCacheImageWithNode, buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
+import { buildCacheImageWithNode, buildImage } from './common';
const createDockerfile = async (data, image): Promise<void> => {
const { buildId, applicationId, tag, port, startCommand, workdir, baseDirectory } = data;
diff --git a/src/lib/buildPacks/nextjs.ts b/apps/api/src/lib/buildPacks/nextjs.ts
similarity index 94%
rename from src/lib/buildPacks/nextjs.ts
rename to apps/api/src/lib/buildPacks/nextjs.ts
index 5ebb304104..e7cc692909 100644
--- a/src/lib/buildPacks/nextjs.ts
+++ b/apps/api/src/lib/buildPacks/nextjs.ts
@@ -1,6 +1,5 @@
-import { buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
-import { checkPnpm } from './common';
+import { buildImage, checkPnpm } from './common';
const createDockerfile = async (data, image): Promise<void> => {
const {
diff --git a/src/lib/buildPacks/node.ts b/apps/api/src/lib/buildPacks/node.ts
similarity index 91%
rename from src/lib/buildPacks/node.ts
rename to apps/api/src/lib/buildPacks/node.ts
index 46043593b6..ad234aed17 100644
--- a/src/lib/buildPacks/node.ts
+++ b/apps/api/src/lib/buildPacks/node.ts
@@ -1,6 +1,5 @@
-import { buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
-import { checkPnpm } from './common';
+import { buildImage, checkPnpm } from './common';
const createDockerfile = async (data, image): Promise<void> => {
const {
@@ -50,7 +49,7 @@ const createDockerfile = async (data, image): Promise<void> => {
export default async function (data) {
try {
- const { baseImage, baseBuildImage } = data;
+ const { baseImage } = data;
await createDockerfile(data, baseImage);
await buildImage(data);
} catch (error) {
diff --git a/src/lib/buildPacks/nuxtjs.ts b/apps/api/src/lib/buildPacks/nuxtjs.ts
similarity index 94%
rename from src/lib/buildPacks/nuxtjs.ts
rename to apps/api/src/lib/buildPacks/nuxtjs.ts
index e1fded7f27..e7b4ee0b7c 100644
--- a/src/lib/buildPacks/nuxtjs.ts
+++ b/apps/api/src/lib/buildPacks/nuxtjs.ts
@@ -1,6 +1,5 @@
-import { buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
-import { checkPnpm } from './common';
+import { buildImage, checkPnpm } from './common';
const createDockerfile = async (data, image): Promise<void> => {
const {
diff --git a/src/lib/buildPacks/php.ts b/apps/api/src/lib/buildPacks/php.ts
similarity index 71%
rename from src/lib/buildPacks/php.ts
rename to apps/api/src/lib/buildPacks/php.ts
index d04e86712b..e6dc1699ff 100644
--- a/src/lib/buildPacks/php.ts
+++ b/apps/api/src/lib/buildPacks/php.ts
@@ -1,8 +1,8 @@
-import { buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
+import { buildImage } from './common';
const createDockerfile = async (data, image, htaccessFound): Promise<void> => {
- const { workdir, baseDirectory, buildId, port } = data;
+ const { workdir, baseDirectory, buildId, port, secrets, pullmergeRequestId } = data;
const Dockerfile: Array<string> = [];
let composerFound = false;
try {
@@ -12,6 +12,21 @@ const createDockerfile = async (data, image, htaccessFound): Promise<void> => {
Dockerfile.push(`FROM ${image}`);
Dockerfile.push(`LABEL coolify.buildId=${buildId}`);
+ if (secrets.length > 0) {
+ secrets.forEach((secret) => {
+ if (secret.isBuildSecret) {
+ if (pullmergeRequestId) {
+ if (secret.isPRMRSecret) {
+ Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
+ }
+ } else {
+ if (!secret.isPRMRSecret) {
+ Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
+ }
+ }
+ }
+ });
+ }
Dockerfile.push('WORKDIR /app');
Dockerfile.push(`COPY .${baseDirectory || ''} /app`);
if (htaccessFound) {
diff --git a/src/lib/buildPacks/python.ts b/apps/api/src/lib/buildPacks/python.ts
similarity index 98%
rename from src/lib/buildPacks/python.ts
rename to apps/api/src/lib/buildPacks/python.ts
index cd42d6fd63..1104711792 100644
--- a/src/lib/buildPacks/python.ts
+++ b/apps/api/src/lib/buildPacks/python.ts
@@ -1,5 +1,5 @@
-import { buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
+import { buildImage } from './common';
const createDockerfile = async (data, image): Promise<void> => {
const {
diff --git a/src/lib/buildPacks/react.ts b/apps/api/src/lib/buildPacks/react.ts
similarity index 93%
rename from src/lib/buildPacks/react.ts
rename to apps/api/src/lib/buildPacks/react.ts
index 5217e8f965..169af33cc7 100644
--- a/src/lib/buildPacks/react.ts
+++ b/apps/api/src/lib/buildPacks/react.ts
@@ -1,5 +1,5 @@
-import { buildCacheImageWithNode, buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
+import { buildCacheImageWithNode, buildImage } from './common';
const createDockerfile = async (data, image): Promise<void> => {
const { applicationId, tag, workdir, publishDirectory, baseImage, buildId, port } = data;
diff --git a/src/lib/buildPacks/rust.ts b/apps/api/src/lib/buildPacks/rust.ts
similarity index 93%
rename from src/lib/buildPacks/rust.ts
rename to apps/api/src/lib/buildPacks/rust.ts
index 72f0c62731..1af2158699 100644
--- a/src/lib/buildPacks/rust.ts
+++ b/apps/api/src/lib/buildPacks/rust.ts
@@ -1,7 +1,7 @@
-import { asyncExecShell } from '$lib/common';
-import { buildCacheImageWithCargo, buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
import TOML from '@iarna/toml';
+import { asyncExecShell } from '../common';
+import { buildCacheImageWithCargo, buildImage } from './common';
const createDockerfile = async (data, image, name): Promise<void> => {
const { workdir, port, applicationId, tag, buildId } = data;
diff --git a/src/lib/buildPacks/static.ts b/apps/api/src/lib/buildPacks/static.ts
similarity index 95%
rename from src/lib/buildPacks/static.ts
rename to apps/api/src/lib/buildPacks/static.ts
index 79647ae935..67f85b4f4f 100644
--- a/src/lib/buildPacks/static.ts
+++ b/apps/api/src/lib/buildPacks/static.ts
@@ -1,5 +1,5 @@
-import { buildCacheImageWithNode, buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
+import { buildCacheImageWithNode, buildImage } from './common';
const createDockerfile = async (data, image): Promise<void> => {
const {
diff --git a/src/lib/buildPacks/svelte.ts b/apps/api/src/lib/buildPacks/svelte.ts
similarity index 93%
rename from src/lib/buildPacks/svelte.ts
rename to apps/api/src/lib/buildPacks/svelte.ts
index bede0e8064..4933d10ffb 100644
--- a/src/lib/buildPacks/svelte.ts
+++ b/apps/api/src/lib/buildPacks/svelte.ts
@@ -1,5 +1,5 @@
-import { buildCacheImageWithNode, buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
+import { buildCacheImageWithNode, buildImage } from './common';
const createDockerfile = async (data, image): Promise<void> => {
const { applicationId, tag, workdir, publishDirectory, baseImage, buildId, port } = data;
diff --git a/src/lib/buildPacks/vuejs.ts b/apps/api/src/lib/buildPacks/vuejs.ts
similarity index 93%
rename from src/lib/buildPacks/vuejs.ts
rename to apps/api/src/lib/buildPacks/vuejs.ts
index bede0e8064..4933d10ffb 100644
--- a/src/lib/buildPacks/vuejs.ts
+++ b/apps/api/src/lib/buildPacks/vuejs.ts
@@ -1,5 +1,5 @@
-import { buildCacheImageWithNode, buildImage } from '$lib/docker';
import { promises as fs } from 'fs';
+import { buildCacheImageWithNode, buildImage } from './common';
const createDockerfile = async (data, image): Promise<void> => {
const { applicationId, tag, workdir, publishDirectory, baseImage, buildId, port } = data;
diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts
new file mode 100644
index 0000000000..9690025ea0
--- /dev/null
+++ b/apps/api/src/lib/common.ts
@@ -0,0 +1,1480 @@
+import child from 'child_process';
+import util from 'util';
+import fs from 'fs/promises';
+import yaml from 'js-yaml';
+import forge from 'node-forge';
+import { uniqueNamesGenerator, adjectives, colors, animals } from 'unique-names-generator';
+import type { Config } from 'unique-names-generator';
+import generator from 'generate-password';
+import crypto from 'crypto';
+import { promises as dns } from 'dns';
+import { PrismaClient } from '@prisma/client';
+import cuid from 'cuid';
+
+import { checkContainer, getEngine, removeContainer } from './docker';
+import { day } from './dayjs';
+import * as serviceFields from './serviceFields'
+
+const algorithm = 'aes-256-ctr';
+const customConfig: Config = {
+ dictionaries: [adjectives, colors, animals],
+ style: 'capital',
+ separator: ' ',
+ length: 3
+};
+export const isDev = process.env.NODE_ENV === 'development';
+export const version = '3.0.0';
+
+export const defaultProxyImage = `coolify-haproxy-alpine:latest`;
+export const defaultProxyImageTcp = `coolify-haproxy-tcp-alpine:latest`;
+export const defaultProxyImageHttp = `coolify-haproxy-http-alpine:latest`;
+export const defaultTraefikImage = `traefik:v2.6`;
+
+const mainTraefikEndpoint = isDev
+ ? 'http://host.docker.internal:3001/webhooks/traefik/main.json'
+ : 'http://coolify:3000/webhooks/traefik/main.json';
+
+const otherTraefikEndpoint = isDev
+ ? 'http://host.docker.internal:3001/webhooks/traefik/other.json'
+ : 'http://coolify:3000/webhooks/traefik/other.json';
+
+
+export const include: any = {
+ destinationDocker: true,
+ persistentStorage: true,
+ serviceSecret: true,
+ minio: true,
+ plausibleAnalytics: true,
+ vscodeserver: true,
+ wordpress: true,
+ ghost: true,
+ meiliSearch: true,
+ umami: true,
+ hasura: true,
+ fider: true
+};
+
+export const uniqueName = (): string => uniqueNamesGenerator(customConfig);
+export const asyncExecShell = util.promisify(child.exec);
+export const asyncSleep = (delay: number): Promise<unknown> =>
+ new Promise((resolve) => setTimeout(resolve, delay));
+export const prisma = new PrismaClient({
+ errorFormat: 'minimal'
+});
+
+export const base64Encode = (text: string): string => {
+ return Buffer.from(text).toString('base64');
+};
+export const base64Decode = (text: string): string => {
+ return Buffer.from(text, 'base64').toString('ascii');
+};
+export const decrypt = (hashString: string) => {
+ if (hashString) {
+ const hash = JSON.parse(hashString);
+ const decipher = crypto.createDecipheriv(
+ algorithm,
+ process.env['COOLIFY_SECRET_KEY'],
+ Buffer.from(hash.iv, 'hex')
+ );
+ const decrpyted = Buffer.concat([
+ decipher.update(Buffer.from(hash.content, 'hex')),
+ decipher.final()
+ ]);
+ return decrpyted.toString();
+ }
+};
+export const encrypt = (text: string) => {
+ if (text) {
+ const iv = crypto.randomBytes(16);
+ const cipher = crypto.createCipheriv(algorithm, process.env['COOLIFY_SECRET_KEY'], iv);
+ const encrypted = Buffer.concat([cipher.update(text), cipher.final()]);
+ return JSON.stringify({
+ iv: iv.toString('hex'),
+ content: encrypted.toString('hex')
+ });
+ }
+};
+export async function checkDoubleBranch(branch: string, projectId: number): Promise<boolean> {
+ const applications = await prisma.application.findMany({ where: { branch, projectId } });
+ return applications.length > 1;
+}
+export async function isDNSValid(hostname: any, domain: string): Promise<any> {
+ const { isIP } = await import('is-ip');
+ let resolves = [];
+ try {
+ if (isIP(hostname)) {
+ resolves = [hostname];
+ } else {
+ resolves = await dns.resolve4(hostname);
+ }
+ } catch (error) {
+ throw 'Invalid DNS.'
+ }
+
+ try {
+ let ipDomainFound = false;
+ dns.setServers(['1.1.1.1', '8.8.8.8']);
+ const dnsResolve = await dns.resolve4(domain);
+ if (dnsResolve.length > 0) {
+ for (const ip of dnsResolve) {
+ if (resolves.includes(ip)) {
+ ipDomainFound = true;
+ }
+ }
+ }
+ if (!ipDomainFound) throw false;
+ } catch (error) {
+ throw 'DNS not set'
+ }
+}
+
+
+export function getDomain(domain: string): string {
+ return domain?.replace('https://', '').replace('http://', '');
+}
+
+export async function isDomainConfigured({
+ id,
+ fqdn,
+ checkOwn = false
+}: {
+ id: string;
+ fqdn: string;
+ checkOwn?: boolean;
+}): Promise<boolean> {
+ const domain = getDomain(fqdn);
+ const nakedDomain = domain.replace('www.', '');
+ const foundApp = await prisma.application.findFirst({
+ where: {
+ OR: [
+ { fqdn: { endsWith: `//${nakedDomain}` } },
+ { fqdn: { endsWith: `//www.${nakedDomain}` } }
+ ],
+ id: { not: id }
+ },
+ select: { fqdn: true }
+ });
+ const foundService = await prisma.service.findFirst({
+ where: {
+ OR: [
+ { fqdn: { endsWith: `//${nakedDomain}` } },
+ { fqdn: { endsWith: `//www.${nakedDomain}` } },
+ { minio: { apiFqdn: { endsWith: `//${nakedDomain}` } } },
+ { minio: { apiFqdn: { endsWith: `//www.${nakedDomain}` } } }
+ ],
+ id: { not: checkOwn ? undefined : id }
+ },
+ select: { fqdn: true }
+ });
+
+ const coolifyFqdn = await prisma.setting.findFirst({
+ where: {
+ OR: [
+ { fqdn: { endsWith: `//${nakedDomain}` } },
+ { fqdn: { endsWith: `//www.${nakedDomain}` } }
+ ],
+ id: { not: id }
+ },
+ select: { fqdn: true }
+ });
+ return !!(foundApp || foundService || coolifyFqdn);
+}
+
+export async function getContainerUsage(engine: string, container: string): Promise<any> {
+ const host = getEngine(engine);
+ try {
+ const { stdout } = await asyncExecShell(
+ `DOCKER_HOST="${host}" docker container stats ${container} --no-stream --no-trunc --format "{{json .}}"`
+ );
+ return JSON.parse(stdout);
+ } catch (err) {
+ return {
+ MemUsage: 0,
+ CPUPerc: 0,
+ NetIO: 0
+ };
+ }
+}
+
+export async function checkDomainsIsValidInDNS({ hostname, fqdn, dualCerts }): Promise<any> {
+ const { isIP } = await import('is-ip');
+ const domain = getDomain(fqdn);
+ const domainDualCert = domain.includes('www.') ? domain.replace('www.', '') : `www.${domain}`;
+ dns.setServers(['1.1.1.1', '8.8.8.8']);
+ let resolves = [];
+ try {
+ if (isIP(hostname)) {
+ resolves = [hostname];
+ } else {
+ resolves = await dns.resolve4(hostname);
+ }
+ } catch (error) {
+ throw `DNS not set correctly or propogated.<br>Please check your DNS settings.`
+ }
+
+ if (dualCerts) {
+ try {
+ const ipDomain = await dns.resolve4(domain);
+ const ipDomainDualCert = await dns.resolve4(domainDualCert);
+
+ let ipDomainFound = false;
+ let ipDomainDualCertFound = false;
+
+ for (const ip of ipDomain) {
+ if (resolves.includes(ip)) {
+ ipDomainFound = true;
+ }
+ }
+ for (const ip of ipDomainDualCert) {
+ if (resolves.includes(ip)) {
+ ipDomainDualCertFound = true;
+ }
+ }
+ if (ipDomainFound && ipDomainDualCertFound) return { status: 200 };
+ throw false;
+ } catch (error) {
+ throw `DNS not set correctly or propogated.<br>Please check your DNS settings.`
+ }
+ } else {
+ try {
+ const ipDomain = await dns.resolve4(domain);
+ let ipDomainFound = false;
+ for (const ip of ipDomain) {
+ if (resolves.includes(ip)) {
+ ipDomainFound = true;
+ }
+ }
+ if (ipDomainFound) return { status: 200 };
+ throw false;
+ } catch (error) {
+ throw `DNS not set correctly or propogated.<br>Please check your DNS settings.`
+ }
+ }
+}
+export function generateTimestamp(): string {
+ return `${day().format('HH:mm:ss.SSS')}`;
+}
+
+export async function listServicesWithIncludes(): Promise<any> {
+ return await prisma.service.findMany({
+ include,
+ orderBy: { createdAt: 'desc' }
+ });
+}
+
+export const supportedDatabaseTypesAndVersions = [
+ {
+ name: 'mongodb',
+ fancyName: 'MongoDB',
+ baseImage: 'bitnami/mongodb',
+ versions: ['5.0', '4.4', '4.2']
+ },
+ { name: 'mysql', fancyName: 'MySQL', baseImage: 'bitnami/mysql', versions: ['8.0', '5.7'] },
+ {
+ name: 'mariadb',
+ fancyName: 'MariaDB',
+ baseImage: 'bitnami/mariadb',
+ versions: ['10.7', '10.6', '10.5', '10.4', '10.3', '10.2']
+ },
+ {
+ name: 'postgresql',
+ fancyName: 'PostgreSQL',
+ baseImage: 'bitnami/postgresql',
+ versions: ['14.4.0', '13.6.0', '12.10.0', '11.15.0', '10.20.0']
+ },
+ {
+ name: 'redis',
+ fancyName: 'Redis',
+ baseImage: 'bitnami/redis',
+ versions: ['6.2', '6.0', '5.0']
+ },
+ { name: 'couchdb', fancyName: 'CouchDB', baseImage: 'bitnami/couchdb', versions: ['3.2.1'] }
+];
+export const supportedServiceTypesAndVersions = [
+ {
+ name: 'plausibleanalytics',
+ fancyName: 'Plausible Analytics',
+ baseImage: 'plausible/analytics',
+ images: ['bitnami/postgresql:13.2.0', 'yandex/clickhouse-server:21.3.2.5'],
+ versions: ['latest', 'stable'],
+ recommendedVersion: 'stable',
+ ports: {
+ main: 8000
+ }
+ },
+ {
+ name: 'nocodb',
+ fancyName: 'NocoDB',
+ baseImage: 'nocodb/nocodb',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 8080
+ }
+ },
+ {
+ name: 'minio',
+ fancyName: 'MinIO',
+ baseImage: 'minio/minio',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 9001
+ }
+ },
+ {
+ name: 'vscodeserver',
+ fancyName: 'VSCode Server',
+ baseImage: 'codercom/code-server',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 8080
+ }
+ },
+ {
+ name: 'wordpress',
+ fancyName: 'Wordpress',
+ baseImage: 'wordpress',
+ images: ['bitnami/mysql:5.7'],
+ versions: ['latest', 'php8.1', 'php8.0', 'php7.4', 'php7.3'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 80
+ }
+ },
+ {
+ name: 'vaultwarden',
+ fancyName: 'Vaultwarden',
+ baseImage: 'vaultwarden/server',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 80
+ }
+ },
+ {
+ name: 'languagetool',
+ fancyName: 'LanguageTool',
+ baseImage: 'silviof/docker-languagetool',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 8010
+ }
+ },
+ {
+ name: 'n8n',
+ fancyName: 'n8n',
+ baseImage: 'n8nio/n8n',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 5678
+ }
+ },
+ {
+ name: 'uptimekuma',
+ fancyName: 'Uptime Kuma',
+ baseImage: 'louislam/uptime-kuma',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 3001
+ }
+ },
+ {
+ name: 'ghost',
+ fancyName: 'Ghost',
+ baseImage: 'bitnami/ghost',
+ images: ['bitnami/mariadb'],
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 2368
+ }
+ },
+ {
+ name: 'meilisearch',
+ fancyName: 'Meilisearch',
+ baseImage: 'getmeili/meilisearch',
+ images: [],
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 7700
+ }
+ },
+ {
+ name: 'umami',
+ fancyName: 'Umami',
+ baseImage: 'ghcr.io/mikecao/umami',
+ images: ['postgres:12-alpine'],
+ versions: ['postgresql-latest'],
+ recommendedVersion: 'postgresql-latest',
+ ports: {
+ main: 3000
+ }
+ },
+ {
+ name: 'hasura',
+ fancyName: 'Hasura',
+ baseImage: 'hasura/graphql-engine',
+ images: ['postgres:12-alpine'],
+ versions: ['latest', 'v2.8.3'],
+ recommendedVersion: 'v2.8.3',
+ ports: {
+ main: 8080
+ }
+ },
+ {
+ name: 'fider',
+ fancyName: 'Fider',
+ baseImage: 'getfider/fider',
+ images: ['postgres:12-alpine'],
+ versions: ['stable'],
+ recommendedVersion: 'stable',
+ ports: {
+ main: 3000
+ }
+ // },
+ // {
+ // name: 'appwrite',
+ // fancyName: 'AppWrite',
+ // baseImage: 'appwrite/appwrite',
+ // images: ['appwrite/influxdb', 'appwrite/telegraf', 'mariadb:10.7', 'redis:6.0-alpine3.12'],
+ // versions: ['latest', '0.13.0'],
+ // recommendedVersion: '0.13.0',
+ // ports: {
+ // main: 3000
+ // }
+ // }
+ }
+];
+
+export async function startTraefikProxy(engine: string): Promise<void> {
+ const host = getEngine(engine);
+ const found = await checkContainer(engine, 'coolify-proxy', true);
+ const { proxyPassword, proxyUser, id } = await listSettings();
+ if (!found) {
+ const { stdout: Config } = await asyncExecShell(
+ `DOCKER_HOST="${host}" docker network inspect bridge --format '{{json .IPAM.Config }}'`
+ );
+ const ip = JSON.parse(Config)[0].Gateway;
+ await asyncExecShell(
+ `DOCKER_HOST="${host}" docker run --restart always \
+ --add-host 'host.docker.internal:host-gateway' \
+ --add-host 'host.docker.internal:${ip}' \
+ -v coolify-traefik-letsencrypt:/etc/traefik/acme \
+ -v /var/run/docker.sock:/var/run/docker.sock \
+ --network coolify-infra \
+ -p "80:80" \
+ -p "443:443" \
+ --name coolify-proxy \
+ -d ${defaultTraefikImage} \
+ --entrypoints.web.address=:80 \
+ --entrypoints.web.forwardedHeaders.insecure=true \
+ --entrypoints.websecure.address=:443 \
+ --entrypoints.websecure.forwardedHeaders.insecure=true \
+ --providers.docker=true \
+ --providers.docker.exposedbydefault=false \
+ --providers.http.endpoint=${mainTraefikEndpoint} \
+ --providers.http.pollTimeout=5s \
+ --certificatesresolvers.letsencrypt.acme.httpchallenge=true \
+ --certificatesresolvers.letsencrypt.acme.storage=/etc/traefik/acme/acme.json \
+ --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web \
+ --log.level=error`
+ );
+ await prisma.setting.update({ where: { id }, data: { proxyHash: null } });
+ await prisma.destinationDocker.updateMany({
+ where: { engine },
+ data: { isCoolifyProxyUsed: true }
+ });
+ }
+ await configureNetworkTraefikProxy(engine);
+}
+
+export async function configureNetworkTraefikProxy(engine: string): Promise<void> {
+ const host = getEngine(engine);
+ const destinations = await prisma.destinationDocker.findMany({ where: { engine } });
+ const { stdout: networks } = await asyncExecShell(
+ `DOCKER_HOST="${host}" docker ps -a --filter name=coolify-proxy --format '{{json .Networks}}'`
+ );
+ const configuredNetworks = networks.replace(/"/g, '').replace('\n', '').split(',');
+ for (const destination of destinations) {
+ if (!configuredNetworks.includes(destination.network)) {
+ await asyncExecShell(
+ `DOCKER_HOST="${host}" docker network connect ${destination.network} coolify-proxy`
+ );
+ }
+ }
+}
+
+export async function stopTraefikProxy(
+ engine: string
+): Promise<{ stdout: string; stderr: string } | Error> {
+ const host = getEngine(engine);
+ const found = await checkContainer(engine, 'coolify-proxy');
+ await prisma.destinationDocker.updateMany({
+ where: { engine },
+ data: { isCoolifyProxyUsed: false }
+ });
+ const { id } = await prisma.setting.findFirst({});
+ await prisma.setting.update({ where: { id }, data: { proxyHash: null } });
+ try {
+ if (found) {
+ await asyncExecShell(
+ `DOCKER_HOST="${host}" docker stop -t 0 coolify-proxy && docker rm coolify-proxy`
+ );
+ }
+ } catch (error) {
+ return error;
+ }
+}
+
+export async function startCoolifyProxy(engine: string): Promise<void> {
+ const host = getEngine(engine);
+ const found = await checkContainer(engine, 'coolify-haproxy', true);
+ const { proxyPassword, proxyUser, id } = await listSettings();
+ if (!found) {
+ const { stdout: Config } = await asyncExecShell(
+ `DOCKER_HOST="${host}" docker network inspect bridge --format '{{json .IPAM.Config }}'`
+ );
+ const ip = JSON.parse(Config)[0].Gateway;
+ await asyncExecShell(
+ `DOCKER_HOST="${host}" docker run -e HAPROXY_USERNAME=${proxyUser} -e HAPROXY_PASSWORD=${proxyPassword} --restart always --add-host 'host.docker.internal:host-gateway' --add-host 'host.docker.internal:${ip}' -v coolify-ssl-certs:/usr/local/etc/haproxy/ssl --network coolify-infra -p "80:80" -p "443:443" -p "8404:8404" -p "5555:5555" -p "5000:5000" --name coolify-haproxy -d coollabsio/${defaultProxyImage}`
+ );
+ await prisma.setting.update({ where: { id }, data: { proxyHash: null } });
+ await prisma.destinationDocker.updateMany({
+ where: { engine },
+ data: { isCoolifyProxyUsed: true }
+ });
+ }
+ await configureNetworkCoolifyProxy(engine);
+}
+
+export async function configureNetworkCoolifyProxy(engine: string): Promise<void> {
+ const host = getEngine(engine);
+ const destinations = await prisma.destinationDocker.findMany({ where: { engine } });
+ const { stdout: networks } = await asyncExecShell(
+ `DOCKER_HOST="${host}" docker ps -a --filter name=coolify-haproxy --format '{{json .Networks}}'`
+ );
+ const configuredNetworks = networks.replace(/"/g, '').replace('\n', '').split(',');
+ for (const destination of destinations) {
+ if (!configuredNetworks.includes(destination.network)) {
+ await asyncExecShell(
+ `DOCKER_HOST="${host}" docker network connect ${destination.network} coolify-haproxy`
+ );
+ }
+ }
+}
+export async function listSettings(): Promise<any> {
+ const settings = await prisma.setting.findFirst({});
+ if (settings.proxyPassword) settings.proxyPassword = decrypt(settings.proxyPassword);
+ return settings;
+}
+
+
+
+// export async function stopCoolifyProxy(
+// engine: string
+// ): Promise<{ stdout: string; stderr: string } | Error> {
+// const host = getEngine(engine);
+// const found = await checkContainer(engine, 'coolify-haproxy');
+// await prisma.destinationDocker.updateMany({
+// where: { engine },
+// data: { isCoolifyProxyUsed: false }
+// });
+// const { id } = await prisma.setting.findFirst({});
+// await prisma.setting.update({ where: { id }, data: { proxyHash: null } });
+// try {
+// if (found) {
+// await asyncExecShell(
+// `DOCKER_HOST="${host}" docker stop -t 0 coolify-haproxy && docker rm coolify-haproxy`
+// );
+// }
+// } catch (error) {
+// return error;
+// }
+// }
+
+export function generatePassword(length = 24, symbols = false): string {
+ return generator.generate({
+ length,
+ numbers: true,
+ strict: true,
+ symbols
+ });
+}
+
+export function generateDatabaseConfiguration(database: any):
+ | {
+ volume: string;
+ image: string;
+ ulimits: Record<string, unknown>;
+ privatePort: number;
+ environmentVariables: {
+ MYSQL_DATABASE: string;
+ MYSQL_PASSWORD: string;
+ MYSQL_ROOT_USER: string;
+ MYSQL_USER: string;
+ MYSQL_ROOT_PASSWORD: string;
+ };
+ }
+ | {
+ volume: string;
+ image: string;
+ ulimits: Record<string, unknown>;
+ privatePort: number;
+ environmentVariables: {
+ MONGODB_ROOT_USER: string;
+ MONGODB_ROOT_PASSWORD: string;
+ };
+ }
+ | {
+ volume: string;
+ image: string;
+ ulimits: Record<string, unknown>;
+ privatePort: number;
+ environmentVariables: {
+ MARIADB_ROOT_USER: string;
+ MARIADB_ROOT_PASSWORD: string;
+ MARIADB_USER: string;
+ MARIADB_PASSWORD: string;
+ MARIADB_DATABASE: string;
+ };
+ }
+ | {
+ volume: string;
+ image: string;
+ ulimits: Record<string, unknown>;
+ privatePort: number;
+ environmentVariables: {
+ POSTGRESQL_POSTGRES_PASSWORD: string;
+ POSTGRESQL_USERNAME: string;
+ POSTGRESQL_PASSWORD: string;
+ POSTGRESQL_DATABASE: string;
+ };
+ }
+ | {
+ volume: string;
+ image: string;
+ ulimits: Record<string, unknown>;
+ privatePort: number;
+ environmentVariables: {
+ REDIS_AOF_ENABLED: string;
+ REDIS_PASSWORD: string;
+ };
+ }
+ | {
+ volume: string;
+ image: string;
+ ulimits: Record<string, unknown>;
+ privatePort: number;
+ environmentVariables: {
+ COUCHDB_PASSWORD: string;
+ COUCHDB_USER: string;
+ };
+ } {
+ const {
+ id,
+ dbUser,
+ dbUserPassword,
+ rootUser,
+ rootUserPassword,
+ defaultDatabase,
+ version,
+ type,
+ settings: { appendOnly }
+ } = database;
+ const baseImage = getDatabaseImage(type);
+ if (type === 'mysql') {
+ return {
+ privatePort: 3306,
+ environmentVariables: {
+ MYSQL_USER: dbUser,
+ MYSQL_PASSWORD: dbUserPassword,
+ MYSQL_ROOT_PASSWORD: rootUserPassword,
+ MYSQL_ROOT_USER: rootUser,
+ MYSQL_DATABASE: defaultDatabase
+ },
+ image: `${baseImage}:${version}`,
+ volume: `${id}-${type}-data:/bitnami/mysql/data`,
+ ulimits: {}
+ };
+ } else if (type === 'mariadb') {
+ return {
+ privatePort: 3306,
+ environmentVariables: {
+ MARIADB_ROOT_USER: rootUser,
+ MARIADB_ROOT_PASSWORD: rootUserPassword,
+ MARIADB_USER: dbUser,
+ MARIADB_PASSWORD: dbUserPassword,
+ MARIADB_DATABASE: defaultDatabase
+ },
+ image: `${baseImage}:${version}`,
+ volume: `${id}-${type}-data:/bitnami/mariadb`,
+ ulimits: {}
+ };
+ } else if (type === 'mongodb') {
+ return {
+ privatePort: 27017,
+ environmentVariables: {
+ MONGODB_ROOT_USER: rootUser,
+ MONGODB_ROOT_PASSWORD: rootUserPassword
+ },
+ image: `${baseImage}:${version}`,
+ volume: `${id}-${type}-data:/bitnami/mongodb`,
+ ulimits: {}
+ };
+ } else if (type === 'postgresql') {
+ return {
+ privatePort: 5432,
+ environmentVariables: {
+ POSTGRESQL_POSTGRES_PASSWORD: rootUserPassword,
+ POSTGRESQL_PASSWORD: dbUserPassword,
+ POSTGRESQL_USERNAME: dbUser,
+ POSTGRESQL_DATABASE: defaultDatabase
+ },
+ image: `${baseImage}:${version}`,
+ volume: `${id}-${type}-data:/bitnami/postgresql`,
+ ulimits: {}
+ };
+ } else if (type === 'redis') {
+ return {
+ privatePort: 6379,
+ environmentVariables: {
+ REDIS_PASSWORD: dbUserPassword,
+ REDIS_AOF_ENABLED: appendOnly ? 'yes' : 'no'
+ },
+ image: `${baseImage}:${version}`,
+ volume: `${id}-${type}-data:/bitnami/redis/data`,
+ ulimits: {}
+ };
+ } else if (type === 'couchdb') {
+ return {
+ privatePort: 5984,
+ environmentVariables: {
+ COUCHDB_PASSWORD: dbUserPassword,
+ COUCHDB_USER: dbUser
+ },
+ image: `${baseImage}:${version}`,
+ volume: `${id}-${type}-data:/bitnami/couchdb`,
+ ulimits: {}
+ };
+ }
+}
+
+export function getDatabaseImage(type: string): string {
+ const found = supportedDatabaseTypesAndVersions.find((t) => t.name === type);
+ if (found) {
+ return found.baseImage;
+ }
+ return '';
+}
+
+export function getDatabaseVersions(type: string): string[] {
+ const found = supportedDatabaseTypesAndVersions.find((t) => t.name === type);
+ if (found) {
+ return found.versions;
+ }
+ return [];
+}
+
+
+export type ComposeFile = {
+ version: ComposerFileVersion;
+ services: Record<string, ComposeFileService>;
+ networks: Record<string, ComposeFileNetwork>;
+ volumes?: Record<string, ComposeFileVolume>;
+};
+
+export type ComposeFileService = {
+ container_name: string;
+ image?: string;
+ networks: string[];
+ environment?: Record<string, unknown>;
+ volumes?: string[];
+ ulimits?: unknown;
+ labels?: string[];
+ env_file?: string[];
+ extra_hosts?: string[];
+ restart: ComposeFileRestartOption;
+ depends_on?: string[];
+ command?: string;
+ ports?: string[];
+ build?: {
+ context: string;
+ dockerfile: string;
+ args?: Record<string, unknown>;
+ };
+ deploy?: {
+ restart_policy?: {
+ condition?: string;
+ delay?: string;
+ max_attempts?: number;
+ window?: string;
+ };
+ };
+};
+
+export type ComposerFileVersion =
+ | '3.8'
+ | '3.7'
+ | '3.6'
+ | '3.5'
+ | '3.4'
+ | '3.3'
+ | '3.2'
+ | '3.1'
+ | '3.0'
+ | '2.4'
+ | '2.3'
+ | '2.2'
+ | '2.1'
+ | '2.0';
+
+export type ComposeFileRestartOption = 'no' | 'always' | 'on-failure' | 'unless-stopped';
+
+export type ComposeFileNetwork = {
+ external: boolean;
+};
+
+export type ComposeFileVolume = {
+ external?: boolean;
+ name?: string;
+};
+
+export async function makeLabelForStandaloneDatabase({ id, image, volume }) {
+ const database = await prisma.database.findFirst({ where: { id } });
+ delete database.destinationDockerId;
+ delete database.createdAt;
+ delete database.updatedAt;
+ return [
+ 'coolify.managed=true',
+ `coolify.version=${version}`,
+ `coolify.type=standalone-database`,
+ `coolify.configuration=${base64Encode(
+ JSON.stringify({
+ version,
+ image,
+ volume,
+ ...database
+ })
+ )}`
+ ];
+}
+export const createDirectories = async ({
+ repository,
+ buildId
+}: {
+ repository: string;
+ buildId: string;
+}): Promise<{ workdir: string; repodir: string }> => {
+ const repodir = `/tmp/build-sources/${repository}/`;
+ const workdir = `/tmp/build-sources/${repository}/${buildId}`;
+
+ await asyncExecShell(`mkdir -p ${workdir}`);
+
+ return {
+ workdir,
+ repodir
+ };
+};
+
+export async function startTcpProxy(
+ destinationDocker: any,
+ id: string,
+ publicPort: number,
+ privatePort: number
+): Promise<{ stdout: string; stderr: string } | Error> {
+ const { network, engine } = destinationDocker;
+ const host = getEngine(engine);
+
+ const containerName = `haproxy-for-${publicPort}`;
+ const found = await checkContainer(engine, containerName, true);
+ const foundDependentContainer = await checkContainer(engine, id, true);
+ try {
+ if (foundDependentContainer && !found) {
+ const { stdout: Config } = await asyncExecShell(
+ `DOCKER_HOST="${host}" docker network inspect bridge --format '{{json .IPAM.Config }}'`
+ );
+ const ip = JSON.parse(Config)[0].Gateway;
+ return await asyncExecShell(
+ `DOCKER_HOST=${host} docker run --restart always -e PORT=${publicPort} -e APP=${id} -e PRIVATE_PORT=${privatePort} --add-host 'host.docker.internal:host-gateway' --add-host 'host.docker.internal:${ip}' --network ${network} -p ${publicPort}:${publicPort} --name ${containerName} -d coollabsio/${defaultProxyImageTcp}`
+ );
+ }
+ if (!foundDependentContainer && found) {
+ return await asyncExecShell(
+ `DOCKER_HOST=${host} docker stop -t 0 ${containerName} && docker rm ${containerName}`
+ );
+ }
+ } catch (error) {
+ return error;
+ }
+}
+
+
+export async function stopDatabaseContainer(
+ database: any
+): Promise<boolean> {
+ let everStarted = false;
+ const {
+ id,
+ destinationDockerId,
+ destinationDocker: { engine }
+ } = database;
+ if (destinationDockerId) {
+ try {
+ const host = getEngine(engine);
+ const { stdout } = await asyncExecShell(
+ `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`
+ );
+ if (stdout) {
+ everStarted = true;
+ await removeContainer({ id, engine });
+ }
+ } catch (error) {
+ //
+ }
+ }
+ return everStarted;
+}
+
+
+export async function stopTcpHttpProxy(
+ id: string,
+ destinationDocker: any,
+ publicPort: number,
+ forceName: string = null
+): Promise<{ stdout: string; stderr: string } | Error> {
+ const { engine } = destinationDocker;
+ const host = getEngine(engine);
+ const settings = await listSettings();
+ let containerName = `${id}-${publicPort}`;
+ if (!settings.isTraefikUsed) {
+ containerName = `haproxy-for-${publicPort}`;
+ }
+ if (forceName) containerName = forceName;
+ const found = await checkContainer(engine, containerName);
+
+ try {
+ if (found) {
+ return await asyncExecShell(
+ `DOCKER_HOST=${host} docker stop -t 0 ${containerName} && docker rm ${containerName}`
+ );
+ }
+ } catch (error) {
+ return error;
+ }
+}
+
+
+export async function updatePasswordInDb(database, user, newPassword, isRoot) {
+ const {
+ id,
+ type,
+ rootUser,
+ rootUserPassword,
+ dbUser,
+ dbUserPassword,
+ defaultDatabase,
+ destinationDockerId,
+ destinationDocker: { engine }
+ } = database;
+ if (destinationDockerId) {
+ const host = getEngine(engine);
+ if (type === 'mysql') {
+ await asyncExecShell(
+ `DOCKER_HOST=${host} docker exec ${id} mysql -u ${rootUser} -p${rootUserPassword} -e \"ALTER USER '${user}'@'%' IDENTIFIED WITH caching_sha2_password BY '${newPassword}';\"`
+ );
+ } else if (type === 'mariadb') {
+ await asyncExecShell(
+ `DOCKER_HOST=${host} docker exec ${id} mysql -u ${rootUser} -p${rootUserPassword} -e \"SET PASSWORD FOR '${user}'@'%' = PASSWORD('${newPassword}');\"`
+ );
+ } else if (type === 'postgresql') {
+ if (isRoot) {
+ await asyncExecShell(
+ `DOCKER_HOST=${host} docker exec ${id} psql postgresql://postgres:${rootUserPassword}@${id}:5432/${defaultDatabase} -c "ALTER role postgres WITH PASSWORD '${newPassword}'"`
+ );
+ } else {
+ await asyncExecShell(
+ `DOCKER_HOST=${host} docker exec ${id} psql postgresql://${dbUser}:${dbUserPassword}@${id}:5432/${defaultDatabase} -c "ALTER role ${user} WITH PASSWORD '${newPassword}'"`
+ );
+ }
+ } else if (type === 'mongodb') {
+ await asyncExecShell(
+ `DOCKER_HOST=${host} docker exec ${id} mongo 'mongodb://${rootUser}:${rootUserPassword}@${id}:27017/admin?readPreference=primary&ssl=false' --eval "db.changeUserPassword('${user}','${newPassword}')"`
+ );
+ } else if (type === 'redis') {
+ await asyncExecShell(
+ `DOCKER_HOST=${host} docker exec ${id} redis-cli -u redis://${dbUserPassword}@${id}:6379 --raw CONFIG SET requirepass ${newPassword}`
+ );
+ }
+ }
+}
+
+export async function getFreePort() {
+ const { default: getPort, portNumbers } = await import('get-port');
+ const data = await prisma.setting.findFirst();
+ const { minPort, maxPort } = data;
+
+ const dbUsed = await (
+ await prisma.database.findMany({
+ where: { publicPort: { not: null } },
+ select: { publicPort: true }
+ })
+ ).map((a) => a.publicPort);
+ const wpFtpUsed = await (
+ await prisma.wordpress.findMany({
+ where: { ftpPublicPort: { not: null } },
+ select: { ftpPublicPort: true }
+ })
+ ).map((a) => a.ftpPublicPort);
+ const wpUsed = await (
+ await prisma.wordpress.findMany({
+ where: { mysqlPublicPort: { not: null } },
+ select: { mysqlPublicPort: true }
+ })
+ ).map((a) => a.mysqlPublicPort);
+ const minioUsed = await (
+ await prisma.minio.findMany({
+ where: { publicPort: { not: null } },
+ select: { publicPort: true }
+ })
+ ).map((a) => a.publicPort);
+ const usedPorts = [...dbUsed, ...wpFtpUsed, ...wpUsed, ...minioUsed];
+ return await getPort({ port: portNumbers(minPort, maxPort), exclude: usedPorts });
+}
+
+
+export async function startTraefikTCPProxy(
+ destinationDocker: any,
+ id: string,
+ publicPort: number,
+ privatePort: number,
+ type?: string
+): Promise<{ stdout: string; stderr: string } | Error> {
+ const { network, engine } = destinationDocker;
+ const host = getEngine(engine);
+ const containerName = `${id}-${publicPort}`;
+ const found = await checkContainer(engine, containerName, true);
+ let dependentId = id;
+ if (type === 'wordpressftp') dependentId = `${id}-ftp`;
+ const foundDependentContainer = await checkContainer(engine, dependentId, true);
+ try {
+ if (foundDependentContainer && !found) {
+ const { stdout: Config } = await asyncExecShell(
+ `DOCKER_HOST="${host}" docker network inspect bridge --format '{{json .IPAM.Config }}'`
+ );
+ const ip = JSON.parse(Config)[0].Gateway;
+ const tcpProxy = {
+ version: '3.5',
+ services: {
+ [`${id}-${publicPort}`]: {
+ container_name: containerName,
+ image: 'traefik:v2.6',
+ command: [
+ `--entrypoints.tcp.address=:${publicPort}`,
+ `--entryPoints.tcp.forwardedHeaders.insecure=true`,
+ `--providers.http.endpoint=${otherTraefikEndpoint}?id=${id}&privatePort=${privatePort}&publicPort=${publicPort}&type=tcp&address=${dependentId}`,
+ '--providers.http.pollTimeout=2s',
+ '--log.level=error'
+ ],
+ ports: [`${publicPort}:${publicPort}`],
+ extra_hosts: ['host.docker.internal:host-gateway', `host.docker.internal:${ip}`],
+ volumes: ['/var/run/docker.sock:/var/run/docker.sock'],
+ networks: ['coolify-infra', network]
+ }
+ },
+ networks: {
+ [network]: {
+ external: false,
+ name: network
+ },
+ 'coolify-infra': {
+ external: false,
+ name: 'coolify-infra'
+ }
+ }
+ };
+ await fs.writeFile(`/tmp/docker-compose-${id}.yaml`, yaml.dump(tcpProxy));
+ await asyncExecShell(
+ `DOCKER_HOST=${host} docker compose -f /tmp/docker-compose-${id}.yaml up -d`
+ );
+ await fs.rm(`/tmp/docker-compose-${id}.yaml`);
+ }
+ if (!foundDependentContainer && found) {
+ return await asyncExecShell(
+ `DOCKER_HOST=${host} docker stop -t 0 ${containerName} && docker rm ${containerName}`
+ );
+ }
+ } catch (error) {
+ console.log(error);
+ return error;
+ }
+}
+
+export async function getServiceFromDB({ id, teamId }: { id: string; teamId: string }): Promise<any> {
+ const settings = await prisma.setting.findFirst();
+ const body = await prisma.service.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include
+ });
+ let { type } = body
+ type = fixType(type)
+
+ if (body?.serviceSecret.length > 0) {
+ body.serviceSecret = body.serviceSecret.map((s) => {
+ s.value = decrypt(s.value);
+ return s;
+ });
+ }
+ body[type] = { ...body[type], ...getUpdateableFields(type, body[type]) }
+ return { ...body, settings };
+}
+
+export function getServiceImage(type: string): string {
+ const found = supportedServiceTypesAndVersions.find((t) => t.name === type);
+ if (found) {
+ return found.baseImage;
+ }
+ return '';
+}
+
+export function getServiceImages(type: string): string[] {
+ const found = supportedServiceTypesAndVersions.find((t) => t.name === type);
+ if (found) {
+ return found.images;
+ }
+ return [];
+}
+
+export async function configureServiceType({
+ id,
+ type
+}: {
+ id: string;
+ type: string;
+}): Promise<void> {
+ if (type === 'plausibleanalytics') {
+ const password = encrypt(generatePassword());
+ const postgresqlUser = cuid();
+ const postgresqlPassword = encrypt(generatePassword());
+ const postgresqlDatabase = 'plausibleanalytics';
+ const secretKeyBase = encrypt(generatePassword(64));
+
+ await prisma.service.update({
+ where: { id },
+ data: {
+ type,
+ plausibleAnalytics: {
+ create: {
+ postgresqlDatabase,
+ postgresqlUser,
+ postgresqlPassword,
+ password,
+ secretKeyBase
+ }
+ }
+ }
+ });
+ } else if (type === 'nocodb') {
+ await prisma.service.update({
+ where: { id },
+ data: { type }
+ });
+ } else if (type === 'minio') {
+ const rootUser = cuid();
+ const rootUserPassword = encrypt(generatePassword());
+ await prisma.service.update({
+ where: { id },
+ data: { type, minio: { create: { rootUser, rootUserPassword } } }
+ });
+ } else if (type === 'vscodeserver') {
+ const password = encrypt(generatePassword());
+ await prisma.service.update({
+ where: { id },
+ data: { type, vscodeserver: { create: { password } } }
+ });
+ } else if (type === 'wordpress') {
+ const mysqlUser = cuid();
+ const mysqlPassword = encrypt(generatePassword());
+ const mysqlRootUser = cuid();
+ const mysqlRootUserPassword = encrypt(generatePassword());
+ await prisma.service.update({
+ where: { id },
+ data: {
+ type,
+ wordpress: { create: { mysqlPassword, mysqlRootUserPassword, mysqlRootUser, mysqlUser } }
+ }
+ });
+ } else if (type === 'vaultwarden') {
+ await prisma.service.update({
+ where: { id },
+ data: {
+ type
+ }
+ });
+ } else if (type === 'languagetool') {
+ await prisma.service.update({
+ where: { id },
+ data: {
+ type
+ }
+ });
+ } else if (type === 'n8n') {
+ await prisma.service.update({
+ where: { id },
+ data: {
+ type
+ }
+ });
+ } else if (type === 'uptimekuma') {
+ await prisma.service.update({
+ where: { id },
+ data: {
+ type
+ }
+ });
+ } else if (type === 'ghost') {
+ const defaultEmail = `${cuid()}@example.com`;
+ const defaultPassword = encrypt(generatePassword());
+ const mariadbUser = cuid();
+ const mariadbPassword = encrypt(generatePassword());
+ const mariadbRootUser = cuid();
+ const mariadbRootUserPassword = encrypt(generatePassword());
+
+ await prisma.service.update({
+ where: { id },
+ data: {
+ type,
+ ghost: {
+ create: {
+ defaultEmail,
+ defaultPassword,
+ mariadbUser,
+ mariadbPassword,
+ mariadbRootUser,
+ mariadbRootUserPassword
+ }
+ }
+ }
+ });
+ } else if (type === 'meilisearch') {
+ const masterKey = encrypt(generatePassword(32));
+ await prisma.service.update({
+ where: { id },
+ data: {
+ type,
+ meiliSearch: { create: { masterKey } }
+ }
+ });
+ } else if (type === 'umami') {
+ const umamiAdminPassword = encrypt(generatePassword());
+ const postgresqlUser = cuid();
+ const postgresqlPassword = encrypt(generatePassword());
+ const postgresqlDatabase = 'umami';
+ const hashSalt = encrypt(generatePassword(64));
+ await prisma.service.update({
+ where: { id },
+ data: {
+ type,
+ umami: {
+ create: {
+ umamiAdminPassword,
+ postgresqlDatabase,
+ postgresqlPassword,
+ postgresqlUser,
+ hashSalt
+ }
+ }
+ }
+ });
+ } else if (type === 'hasura') {
+ const postgresqlUser = cuid();
+ const postgresqlPassword = encrypt(generatePassword());
+ const postgresqlDatabase = 'hasura';
+ const graphQLAdminPassword = encrypt(generatePassword());
+ await prisma.service.update({
+ where: { id },
+ data: {
+ type,
+ hasura: {
+ create: {
+ postgresqlDatabase,
+ postgresqlPassword,
+ postgresqlUser,
+ graphQLAdminPassword
+ }
+ }
+ }
+ });
+ } else if (type === 'fider') {
+ const postgresqlUser = cuid();
+ const postgresqlPassword = encrypt(generatePassword());
+ const postgresqlDatabase = 'fider';
+ const jwtSecret = encrypt(generatePassword(64, true));
+ await prisma.service.update({
+ where: { id },
+ data: {
+ type,
+ fider: {
+ create: {
+ postgresqlDatabase,
+ postgresqlPassword,
+ postgresqlUser,
+ jwtSecret
+ }
+ }
+ }
+ });
+ }
+}
+
+export async function removeService({ id }: { id: string }): Promise<void> {
+ await prisma.servicePersistentStorage.deleteMany({ where: { serviceId: id } });
+ await prisma.meiliSearch.deleteMany({ where: { serviceId: id } });
+ await prisma.fider.deleteMany({ where: { serviceId: id } });
+ await prisma.ghost.deleteMany({ where: { serviceId: id } });
+ await prisma.umami.deleteMany({ where: { serviceId: id } });
+ await prisma.hasura.deleteMany({ where: { serviceId: id } });
+ await prisma.plausibleAnalytics.deleteMany({ where: { serviceId: id } });
+ await prisma.minio.deleteMany({ where: { serviceId: id } });
+ await prisma.vscodeserver.deleteMany({ where: { serviceId: id } });
+ await prisma.wordpress.deleteMany({ where: { serviceId: id } });
+ await prisma.serviceSecret.deleteMany({ where: { serviceId: id } });
+
+ await prisma.service.delete({ where: { id } });
+}
+
+export function saveUpdateableFields(type: string, data: any) {
+ let update = {};
+ if (type && serviceFields[type]) {
+ serviceFields[type].map((k) => {
+ let temp = data[k.name]
+ if (temp) {
+ if (k.isEncrypted) {
+ temp = encrypt(temp)
+ }
+ if (k.isLowerCase) {
+ temp = temp.toLowerCase()
+ }
+ if (k.isNumber) {
+ temp = Number(temp)
+ }
+ if (k.isBoolean) {
+ temp = Boolean(temp)
+ }
+ }
+ update[k.name] = temp
+ });
+ }
+ return update
+}
+
+export function getUpdateableFields(type: string, data: any) {
+ let update = {};
+ if (type && serviceFields[type]) {
+ serviceFields[type].map((k) => {
+ let temp = data[k.name]
+ if (temp) {
+ if (k.isEncrypted) {
+ temp = decrypt(temp)
+ }
+ update[k.name] = temp
+ }
+ update[k.name] = temp
+ });
+ }
+ return update
+}
+
+export function fixType(type) {
+ // Hack to fix the type case sensitivity...
+ if (type === 'plausibleanalytics') type = 'plausibleAnalytics';
+ if (type === 'meilisearch') type = 'meiliSearch';
+ return type
+}
+
+export const getServiceMainPort = (service: string) => {
+ const serviceType = supportedServiceTypesAndVersions.find((s) => s.name === service);
+ if (serviceType) {
+ return serviceType.ports.main;
+ }
+ return null;
+};
+
+
+export function makeLabelForServices(type) {
+ return [
+ 'coolify.managed=true',
+ `coolify.version=${version}`,
+ `coolify.type=service`,
+ `coolify.service.type=${type}`
+ ];
+}
+export function errorHandler({ status = 500, message = 'Unknown error.' }: { status: number, message: string | any }) {
+ if (message.message) message = message.message
+ throw { status, message };
+}
+export async function generateSshKeyPair(): Promise<{ publicKey: string; privateKey: string }> {
+ return await new Promise((resolve, reject) => {
+ forge.pki.rsa.generateKeyPair({ bits: 4096, workers: -1 }, function (err, keys) {
+ if (keys) {
+ resolve({
+ publicKey: forge.ssh.publicKeyToOpenSSH(keys.publicKey),
+ privateKey: forge.ssh.privateKeyToOpenSSH(keys.privateKey)
+ });
+ } else {
+ reject(keys);
+ }
+ });
+ });
+}
+
+export async function stopBuild(buildId, applicationId) {
+ let count = 0;
+ await new Promise<void>(async (resolve, reject) => {
+ const { destinationDockerId, status } = await prisma.build.findFirst({ where: { id: buildId } });
+ const { engine } = await prisma.destinationDocker.findFirst({ where: { id: destinationDockerId } });
+ const host = getEngine(engine);
+ let interval = setInterval(async () => {
+ try {
+ if (status === 'failed') {
+ clearInterval(interval);
+ return resolve();
+ }
+ if (count > 100) {
+ clearInterval(interval);
+ return reject(new Error('Build canceled'));
+ }
+
+ const { stdout: buildContainers } = await asyncExecShell(
+ `DOCKER_HOST=${host} docker container ls --filter "label=coolify.buildId=${buildId}" --format '{{json .}}'`
+ );
+ if (buildContainers) {
+ const containersArray = buildContainers.trim().split('\n');
+ for (const container of containersArray) {
+ const containerObj = JSON.parse(container);
+ const id = containerObj.ID;
+ if (!containerObj.Names.startsWith(`${applicationId}`)) {
+ await removeContainer({ id, engine });
+ await cleanupDB(buildId);
+ clearInterval(interval);
+ return resolve();
+ }
+ }
+ }
+ count++;
+ } catch (error) { }
+ }, 100);
+ });
+}
+
+async function cleanupDB(buildId: string) {
+ const data = await prisma.build.findUnique({ where: { id: buildId } });
+ if (data?.status === 'queued' || data?.status === 'running') {
+ await prisma.build.update({ where: { id: buildId }, data: { status: 'failed' } });
+ }
+}
\ No newline at end of file
diff --git a/src/lib/dayjs.ts b/apps/api/src/lib/dayjs.ts
similarity index 87%
rename from src/lib/dayjs.ts
rename to apps/api/src/lib/dayjs.ts
index 49859a8c61..9ff5b0a1a0 100644
--- a/src/lib/dayjs.ts
+++ b/apps/api/src/lib/dayjs.ts
@@ -4,4 +4,4 @@ import relativeTime from 'dayjs/plugin/relativeTime.js';
dayjs.extend(utc);
dayjs.extend(relativeTime);
-export { dayjs };
+export { dayjs as day };
diff --git a/apps/api/src/lib/docker.ts b/apps/api/src/lib/docker.ts
new file mode 100644
index 0000000000..730666590e
--- /dev/null
+++ b/apps/api/src/lib/docker.ts
@@ -0,0 +1,78 @@
+import { asyncExecShell } from './common';
+import Dockerode from 'dockerode';
+export function getEngine(engine: string): string {
+ return engine === '/var/run/docker.sock' ? 'unix:///var/run/docker.sock' : engine;
+}
+export function dockerInstance({ destinationDocker }): { engine: Dockerode; network: string } {
+ return {
+ engine: new Dockerode({
+ socketPath: destinationDocker.engine
+ }),
+ network: destinationDocker.network
+ };
+}
+
+export async function checkContainer(engine: string, container: string, remove = false): Promise<boolean> {
+ const host = getEngine(engine);
+ let containerFound = false;
+
+ try {
+ const { stdout } = await asyncExecShell(
+ `DOCKER_HOST="${host}" docker inspect --format '{{json .State}}' ${container}`
+ );
+ const parsedStdout = JSON.parse(stdout);
+ const status = parsedStdout.Status;
+ const isRunning = status === 'running';
+ if (status === 'created') {
+ await asyncExecShell(`DOCKER_HOST="${host}" docker rm ${container}`);
+ }
+ if (remove && status === 'exited') {
+ await asyncExecShell(`DOCKER_HOST="${host}" docker rm ${container}`);
+ }
+ if (isRunning) {
+ containerFound = true;
+ }
+ } catch (err) {
+ // Container not found
+ }
+ return containerFound;
+}
+
+export async function isContainerExited(engine: string, containerName: string): Promise<boolean> {
+ let isExited = false;
+ const host = getEngine(engine);
+ try {
+ const { stdout } = await asyncExecShell(
+ `DOCKER_HOST="${host}" docker inspect -f '{{.State.Status}}' ${containerName}`
+ );
+ if (stdout.trim() === 'exited') {
+ isExited = true;
+ }
+ } catch (error) {
+ //
+ }
+
+ return isExited;
+}
+
+export async function removeContainer({
+ id,
+ engine
+}: {
+ id: string;
+ engine: string;
+}): Promise<void> {
+ const host = getEngine(engine);
+ try {
+ const { stdout } = await asyncExecShell(
+ `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`
+ );
+ if (JSON.parse(stdout).Running) {
+ await asyncExecShell(`DOCKER_HOST=${host} docker stop -t 0 ${id}`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker rm ${id}`);
+ }
+ } catch (error) {
+ console.log(error);
+ throw error;
+ }
+}
diff --git a/src/lib/importers/github.ts b/apps/api/src/lib/importers/github.ts
similarity index 80%
rename from src/lib/importers/github.ts
rename to apps/api/src/lib/importers/github.ts
index a08fb87b47..76aee1398e 100644
--- a/src/lib/importers/github.ts
+++ b/apps/api/src/lib/importers/github.ts
@@ -1,7 +1,7 @@
-import { asyncExecShell, saveBuildLog } from '$lib/common';
-import got from 'got';
+
import jsonwebtoken from 'jsonwebtoken';
-import * as db from '$lib/database';
+import { saveBuildLog } from '../buildPacks/common';
+import { asyncExecShell, decrypt, prisma } from '../common';
export default async function ({
applicationId,
@@ -22,9 +22,14 @@ export default async function ({
branch: string;
buildId: string;
}): Promise<string> {
+ const { default: got } = await import('got')
const url = htmlUrl.replace('https://', '').replace('http://', '');
await saveBuildLog({ line: 'GitHub importer started.', buildId, applicationId });
- const { privateKey, appId, installationId } = await db.getUniqueGithubApp({ githubAppId });
+
+ const body = await prisma.githubApp.findUnique({ where: { id: githubAppId } });
+ if (body.privateKey) body.privateKey = decrypt(body.privateKey);
+ const { privateKey, appId, installationId } = body
+
const githubPrivateKey = privateKey.replace(/\\n/g, '\n').replace(/"/g, '');
const payload = {
diff --git a/src/lib/importers/gitlab.ts b/apps/api/src/lib/importers/gitlab.ts
similarity index 91%
rename from src/lib/importers/gitlab.ts
rename to apps/api/src/lib/importers/gitlab.ts
index 966b22c969..d5366303ea 100644
--- a/src/lib/importers/gitlab.ts
+++ b/apps/api/src/lib/importers/gitlab.ts
@@ -1,4 +1,5 @@
-import { asyncExecShell, saveBuildLog } from '$lib/common';
+import { saveBuildLog } from "../buildPacks/common";
+import { asyncExecShell } from "../common";
export default async function ({
applicationId,
diff --git a/src/lib/importers/index.ts b/apps/api/src/lib/importers/index.ts
similarity index 100%
rename from src/lib/importers/index.ts
rename to apps/api/src/lib/importers/index.ts
diff --git a/apps/api/src/lib/scheduler.ts b/apps/api/src/lib/scheduler.ts
new file mode 100644
index 0000000000..929016570f
--- /dev/null
+++ b/apps/api/src/lib/scheduler.ts
@@ -0,0 +1,44 @@
+import Bree from 'bree';
+import path from 'path';
+import Cabin from 'cabin';
+import TSBree from '@breejs/ts-worker';
+import { isDev } from './common';
+
+Bree.extend(TSBree);
+
+const options: any = {
+ defaultExtension: 'js',
+ logger: false,
+ workerMessageHandler: async ({ name, message }) => {
+ if (name === 'deployApplication') {
+ if (message.pending === 0) {
+ if (!scheduler.workers.has('autoUpdater')) {
+ await scheduler.stop('deployApplication');
+ await scheduler.run('autoUpdater')
+ }
+ }
+ }
+ },
+ jobs: [
+ {
+ name: 'deployApplication'
+ },
+ {
+ name: 'cleanupStorage',
+ interval: '10m'
+ },
+ {
+ name: 'checkProxies',
+ interval: '10s'
+ },
+ {
+ name: 'autoUpdater',
+ }
+ ],
+};
+if (isDev) options.root = path.join(__dirname, '../jobs');
+
+
+export const scheduler = new Bree(options);
+
+
diff --git a/apps/api/src/lib/serviceFields.ts b/apps/api/src/lib/serviceFields.ts
new file mode 100644
index 0000000000..01f628be23
--- /dev/null
+++ b/apps/api/src/lib/serviceFields.ts
@@ -0,0 +1,407 @@
+// Example:
+// export const nocodb = [{
+// name: 'postgreslUser',
+// isEditable: false,
+// isLowerCase: false,
+// isNumber: false,
+// isBoolean: false,
+// isEncrypted: false
+// }]
+
+export const plausibleAnalytics = [{
+ name: 'email',
+ isEditable: true,
+ isLowerCase: true,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},{
+ name: 'username',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'password',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'postgresqlUser',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'postgresqlPassword',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'postgresqlDatabase',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'postgresqlPublicPort',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: true,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'secretKeyBase',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'scriptName',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+}]
+export const minio = [{
+ name: 'apiFqdn',
+ isEditable: true,
+ isLowerCase: true,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},{
+ name: 'rootUser',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'rootUserPassword',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+}]
+export const vscodeserver = [{
+ name: 'password',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+}]
+export const wordpress = [{
+ name: 'extraConfig',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'mysqlHost',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'mysqlPort',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: true,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'mysqlUser',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'mysqlPassword',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'mysqlRootUser',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'mysqlRootUserPassword',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'mysqlDatabase',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+}]
+export const ghost = [{
+ name: 'defaultEmail',
+ isEditable: false,
+ isLowerCase: true,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'defaultPassword',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'mariadbUser',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'mariadbPassword',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'mariadbRootUser',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'mariadbRootUserPassword',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'mariadbDatabase',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+}]
+export const meiliSearch = [{
+ name: 'masterKey',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+}]
+export const umami = [{
+ name: 'postgresqlUser',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'postgresqlPassword',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'postgresqlDatabase',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'umamiAdminPassword',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'hashSalt',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+}]
+export const hasura = [{
+ name: 'postgresqlUser',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'postgresqlPassword',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'postgresqlDatabase',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'graphQLAdminPassword',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+}]
+export const fider = [{
+ name: 'jwtSecret',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},{
+ name: 'postgreslUser',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'postgresqlPassword',
+ isEditable: false,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'emailNoreply',
+ isEditable: true,
+ isLowerCase: true,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'emailSmtpHost',
+ isEditable: true,
+ isLowerCase: true,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'emailSmtpPassword',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'emailSmtpPort',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: true,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'emailSmtpUser',
+ isEditable: true,
+ isLowerCase: true,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'emailSmtpEnableStartTls',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: true,
+ isEncrypted: false
+},
+{
+ name: 'emailMailgunApiKey',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: true
+},
+{
+ name: 'emailMailgunDomain',
+ isEditable: true,
+ isLowerCase: true,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+},
+{
+ name: 'emailMailgunRegion',
+ isEditable: true,
+ isLowerCase: false,
+ isNumber: false,
+ isBoolean: false,
+ isEncrypted: false
+}]
\ No newline at end of file
diff --git a/apps/api/src/plugins/jwt.ts b/apps/api/src/plugins/jwt.ts
new file mode 100644
index 0000000000..54dd1b72d7
--- /dev/null
+++ b/apps/api/src/plugins/jwt.ts
@@ -0,0 +1,34 @@
+import fp from 'fastify-plugin'
+import fastifyJwt, { FastifyJWTOptions } from '@fastify/jwt'
+
+declare module "@fastify/jwt" {
+ interface FastifyJWT {
+ user: {
+ userId: string,
+ teamId: string,
+ permission: string,
+ isAdmin: boolean
+ }
+ }
+}
+
+export default fp<FastifyJWTOptions>(async (fastify, opts) => {
+ fastify.register(fastifyJwt, {
+ secret: fastify.config.COOLIFY_SECRET_KEY
+ })
+
+ fastify.decorate("authenticate", async function (request, reply) {
+ try {
+ await request.jwtVerify()
+ } catch (err) {
+ console.log(err)
+ reply.send(err)
+ }
+ })
+})
+
+declare module 'fastify' {
+ export interface FastifyInstance {
+ authenticate(): Promise<void>
+ }
+}
diff --git a/apps/api/src/routes/api/v1/applications/handlers.ts b/apps/api/src/routes/api/v1/applications/handlers.ts
new file mode 100644
index 0000000000..3b7ec835a7
--- /dev/null
+++ b/apps/api/src/routes/api/v1/applications/handlers.ts
@@ -0,0 +1,871 @@
+import cuid from 'cuid';
+import crypto from 'node:crypto'
+import jsonwebtoken from 'jsonwebtoken';
+import axios from 'axios';
+import { day } from '../../../../lib/dayjs';
+
+
+import type { FastifyRequest } from 'fastify';
+import { FastifyReply } from 'fastify';
+
+import { CheckDNS, DeleteApplication, DeployApplication, GetApplication, SaveApplication, SaveApplicationSettings } from '.';
+import { setDefaultBaseImage, setDefaultConfiguration } from '../../../../lib/buildPacks/common';
+import { asyncExecShell, checkDomainsIsValidInDNS, checkDoubleBranch, decrypt, encrypt, errorHandler, generateSshKeyPair, getContainerUsage, getDomain, isDev, isDomainConfigured, prisma, stopBuild, uniqueName } from '../../../../lib/common';
+import { checkContainer, dockerInstance, getEngine, isContainerExited, removeContainer } from '../../../../lib/docker';
+import { scheduler } from '../../../../lib/scheduler';
+
+
+export async function listApplications(request: FastifyRequest) {
+ try {
+ const { teamId } = request.user
+ const applications = await prisma.application.findMany({
+ where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: { teams: true }
+ });
+ const settings = await prisma.setting.findFirst()
+ return {
+ applications,
+ settings
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getApplication(request: FastifyRequest<GetApplication>) {
+ try {
+ const { id } = request.params
+ const { teamId } = request.user
+ const appId = process.env['COOLIFY_APP_ID'];
+ let isRunning = false;
+ let isExited = false;
+ const application = await getApplicationFromDB(id, teamId);
+ if (application?.destinationDockerId && application.destinationDocker?.engine) {
+ isRunning = await checkContainer(application.destinationDocker.engine, id);
+ isExited = await isContainerExited(application.destinationDocker.engine, id);
+ }
+ return {
+ isQueueActive: scheduler.workers.has('deployApplication'),
+ isRunning,
+ isExited,
+ application,
+ appId
+ };
+
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function newApplication(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const name = uniqueName();
+ const { teamId } = request.user
+ const { id } = await prisma.application.create({
+ data: {
+ name,
+ teams: { connect: { id: teamId } },
+ settings: { create: { debug: false, previews: false } }
+ }
+ });
+ return reply.code(201).send({ id });
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+function decryptApplication(application: any) {
+ if (application) {
+ if (application?.gitSource?.githubApp?.clientSecret) {
+ application.gitSource.githubApp.clientSecret = decrypt(application.gitSource.githubApp.clientSecret) || null;
+ }
+ if (application?.gitSource?.githubApp?.webhookSecret) {
+ application.gitSource.githubApp.webhookSecret = decrypt(application.gitSource.githubApp.webhookSecret) || null;
+ }
+ if (application?.gitSource?.githubApp?.privateKey) {
+ application.gitSource.githubApp.privateKey = decrypt(application.gitSource.githubApp.privateKey) || null;
+ }
+ if (application?.gitSource?.gitlabApp?.appSecret) {
+ application.gitSource.gitlabApp.appSecret = decrypt(application.gitSource.gitlabApp.appSecret) || null;
+ }
+ if (application?.secrets.length > 0) {
+ application.secrets = application.secrets.map((s: any) => {
+ s.value = decrypt(s.value) || null
+ return s;
+ });
+ }
+
+ return application;
+ }
+}
+export async function getApplicationFromDB(id: string, teamId: string) {
+ try {
+ let application = await prisma.application.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: {
+ destinationDocker: true,
+ settings: true,
+ gitSource: { include: { githubApp: true, gitlabApp: true } },
+ secrets: true,
+ persistentStorage: true
+ }
+ });
+ if (!application) {
+ throw { status: 404, message: 'Application not found.' };
+ }
+ application = decryptApplication(application);
+ const buildPack = application?.buildPack || null;
+ const { baseImage, baseBuildImage, baseBuildImages, baseImages } = setDefaultBaseImage(
+ buildPack
+ );
+
+ // Set default build images
+ if (!application.baseImage) {
+ application.baseImage = baseImage;
+ }
+ if (!application.baseBuildImage) {
+ application.baseBuildImage = baseBuildImage;
+ }
+ return { ...application, baseBuildImages, baseImages };
+
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getApplicationFromDBWebhook(projectId: number, branch: string) {
+ try {
+ let application = await prisma.application.findFirst({
+ where: { projectId, branch, settings: { autodeploy: true } },
+ include: {
+ destinationDocker: true,
+ settings: true,
+ gitSource: { include: { githubApp: true, gitlabApp: true } },
+ secrets: true,
+ persistentStorage: true
+ }
+ });
+ if (!application) {
+ throw { status: 500, message: 'Application not configured.' }
+ }
+ application = decryptApplication(application);
+ const { baseImage, baseBuildImage, baseBuildImages, baseImages } = setDefaultBaseImage(
+ application.buildPack
+ );
+
+ // Set default build images
+ if (!application.baseImage) {
+ application.baseImage = baseImage;
+ }
+ if (!application.baseBuildImage) {
+ application.baseBuildImage = baseBuildImage;
+ }
+ return { ...application, baseBuildImages, baseImages };
+
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveApplication(request: FastifyRequest<SaveApplication>, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ let {
+ name,
+ buildPack,
+ fqdn,
+ port,
+ exposePort,
+ installCommand,
+ buildCommand,
+ startCommand,
+ baseDirectory,
+ publishDirectory,
+ pythonWSGI,
+ pythonModule,
+ pythonVariable,
+ dockerFileLocation,
+ denoMainFile,
+ denoOptions,
+ baseImage,
+ baseBuildImage
+ } = request.body
+
+ if (port) port = Number(port);
+ if (exposePort) {
+ exposePort = Number(exposePort);
+ }
+ if (denoOptions) denoOptions = denoOptions.trim();
+ const defaultConfiguration = await setDefaultConfiguration({
+ buildPack,
+ port,
+ installCommand,
+ startCommand,
+ buildCommand,
+ publishDirectory,
+ baseDirectory,
+ dockerFileLocation,
+ denoMainFile
+ });
+ await prisma.application.update({
+ where: { id },
+ data: {
+ name,
+ fqdn,
+ exposePort,
+ pythonWSGI,
+ pythonModule,
+ pythonVariable,
+ denoOptions,
+ baseImage,
+ baseBuildImage,
+ ...defaultConfiguration
+ }
+ });
+ return reply.code(201).send();
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+
+}
+
+export async function saveApplicationSettings(request: FastifyRequest<SaveApplicationSettings>, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { debug, previews, dualCerts, autodeploy, branch, projectId } = request.body
+ const isDouble = await checkDoubleBranch(branch, projectId);
+ if (isDouble && autodeploy) {
+ throw { status: 500, message: 'Application not configured.' }
+ }
+ await prisma.application.update({
+ where: { id },
+ data: { settings: { update: { debug, previews, dualCerts, autodeploy } } },
+ include: { destinationDocker: true }
+ });
+ return reply.code(201).send();
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function stopApplication(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { teamId } = request.user
+ const application = await getApplicationFromDB(id, teamId);
+ if (application?.destinationDockerId && application.destinationDocker?.engine) {
+ const { engine } = application.destinationDocker;
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ }
+ return reply.code(201).send();
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function deleteApplication(request: FastifyRequest<DeleteApplication>, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { teamId } = request.user
+ const application = await prisma.application.findUnique({
+ where: { id },
+ include: { destinationDocker: true }
+ });
+ if (application?.destinationDockerId && application.destinationDocker?.engine && application.destinationDocker?.network) {
+ const host = getEngine(application.destinationDocker.engine);
+ const { stdout: containers } = await asyncExecShell(
+ `DOCKER_HOST=${host} docker ps -a --filter network=${application.destinationDocker.network} --filter name=${id} --format '{{json .}}'`
+ );
+ if (containers) {
+ const containersArray = containers.trim().split('\n');
+ for (const container of containersArray) {
+ const containerObj = JSON.parse(container);
+ const id = containerObj.ID;
+ await removeContainer({ id, engine: application.destinationDocker.engine });
+ }
+ }
+ }
+ await prisma.applicationSettings.deleteMany({ where: { application: { id } } });
+ await prisma.buildLog.deleteMany({ where: { applicationId: id } });
+ await prisma.build.deleteMany({ where: { applicationId: id } });
+ await prisma.secret.deleteMany({ where: { applicationId: id } });
+ await prisma.applicationPersistentStorage.deleteMany({ where: { applicationId: id } });
+ if (teamId === '0') {
+ await prisma.application.deleteMany({ where: { id } });
+ } else {
+ await prisma.application.deleteMany({ where: { id, teams: { some: { id: teamId } } } });
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function checkDNS(request: FastifyRequest<CheckDNS>) {
+ try {
+ const { id } = request.params
+
+ let { exposePort, fqdn, forceSave, dualCerts } = request.body
+ fqdn = fqdn.toLowerCase();
+
+ const { isDNSCheckEnabled } = await prisma.setting.findFirst({});
+ const found = await isDomainConfigured({ id, fqdn });
+ if (found) {
+ throw { status: 500, message: `Domain ${getDomain(fqdn).replace('www.', '')} is already in use!` }
+ }
+ if (exposePort) {
+ exposePort = Number(exposePort);
+
+ if (exposePort < 1024 || exposePort > 65535) {
+ throw { status: 500, message: `Exposed Port needs to be between 1024 and 65535.` }
+ }
+ const { default: getPort } = await import('get-port');
+ const publicPort = await getPort({ port: exposePort });
+ if (publicPort !== exposePort) {
+ throw { status: 500, message: `Port ${exposePort} is already in use.` }
+ }
+ }
+ if (isDNSCheckEnabled && !isDev && !forceSave) {
+ return await checkDomainsIsValidInDNS({ hostname: request.hostname, fqdn, dualCerts });
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function getUsage(request) {
+ try {
+ const { id } = request.params
+ const teamId = request.user?.teamId;
+ const application = await getApplicationFromDB(id, teamId);
+ let usage = {};
+ if (application.destinationDockerId) {
+ [usage] = await Promise.all([getContainerUsage(application.destinationDocker.engine, id)]);
+ }
+ return {
+ usage
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function deployApplication(request: FastifyRequest<DeployApplication>) {
+ try {
+ const { id } = request.params
+ const teamId = request.user?.teamId;
+
+ const { pullmergeRequestId = null, branch } = request.body
+ const buildId = cuid();
+ const application = await getApplicationFromDB(id, teamId);
+ if (application) {
+ if (!application?.configHash) {
+ const configHash = crypto.createHash('sha256')
+ .update(
+ JSON.stringify({
+ buildPack: application.buildPack,
+ port: application.port,
+ exposePort: application.exposePort,
+ installCommand: application.installCommand,
+ buildCommand: application.buildCommand,
+ startCommand: application.startCommand
+ })
+ )
+ .digest('hex');
+ await prisma.application.update({ where: { id }, data: { configHash } });
+ }
+ await prisma.application.update({ where: { id }, data: { updatedAt: new Date() } });
+ await prisma.build.create({
+ data: {
+ id: buildId,
+ applicationId: id,
+ branch: application.branch,
+ destinationDockerId: application.destinationDocker?.id,
+ gitSourceId: application.gitSource?.id,
+ githubAppId: application.gitSource?.githubApp?.id,
+ gitlabAppId: application.gitSource?.gitlabApp?.id,
+ status: 'queued',
+ type: 'manual'
+ }
+ });
+ if (pullmergeRequestId) {
+ scheduler.workers.get('deployApplication').postMessage({
+ build_id: buildId,
+ type: 'manual',
+ ...application,
+ sourceBranch: branch,
+ pullmergeRequestId
+ });
+ } else {
+ scheduler.workers.get('deployApplication').postMessage({
+ build_id: buildId,
+ type: 'manual',
+ ...application
+ });
+
+ }
+ return {
+ buildId
+ };
+ }
+ throw { status: 500, message: 'Application not found!' }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+
+export async function saveApplicationSource(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { gitSourceId } = request.body
+ await prisma.application.update({
+ where: { id },
+ data: { gitSource: { connect: { id: gitSourceId } } }
+ });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function getGitHubToken(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { teamId } = request.user
+ const application = await getApplicationFromDB(id, teamId);
+ const payload = {
+ iat: Math.round(new Date().getTime() / 1000),
+ exp: Math.round(new Date().getTime() / 1000 + 60),
+ iss: application.gitSource.githubApp.appId
+ };
+ const githubToken = jsonwebtoken.sign(payload, application.gitSource.githubApp.privateKey, {
+ algorithm: 'RS256'
+ });
+ const { data } = await axios.post(`${application.gitSource.apiUrl}/app/installations/${application.gitSource.githubApp.installationId}/access_tokens`, {}, {
+ headers: {
+ Authorization: `Bearer ${githubToken}`
+ }
+ })
+ return reply.code(201).send({
+ token: data.token
+ })
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function checkRepository(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const { repository, branch } = request.query
+ const application = await prisma.application.findUnique({
+ where: { id },
+ include: { gitSource: true }
+ });
+ const found = await prisma.application.findFirst({
+ where: { branch, repository, gitSource: { type: application.gitSource.type }, id: { not: id } }
+ });
+ return {
+ used: found ? true : false
+ };
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveRepository(request, reply) {
+ try {
+ const { id } = request.params
+ let { repository, branch, projectId, autodeploy, webhookToken } = request.body
+
+ repository = repository.toLowerCase();
+ branch = branch.toLowerCase();
+ projectId = Number(projectId);
+ if (webhookToken) {
+ await prisma.application.update({
+ where: { id },
+ data: { repository, branch, projectId, gitSource: { update: { gitlabApp: { update: { webhookToken: webhookToken ? webhookToken : undefined } } } }, settings: { update: { autodeploy } } }
+ });
+ } else {
+ await prisma.application.update({
+ where: { id },
+ data: { repository, branch, projectId, settings: { update: { autodeploy } } }
+ });
+ }
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function saveDestination(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { destinationId } = request.body
+ await prisma.application.update({
+ where: { id },
+ data: { destinationDocker: { connect: { id: destinationId } } }
+ });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function getBuildPack(request) {
+ try {
+ const { id } = request.params
+ const teamId = request.user?.teamId;
+ const application = await getApplicationFromDB(id, teamId);
+ return {
+ type: application.gitSource.type,
+ projectId: application.projectId,
+ repository: application.repository,
+ branch: application.branch,
+ apiUrl: application.gitSource.apiUrl
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function saveBuildPack(request, reply) {
+ try {
+ const { id } = request.params
+ const { buildPack } = request.body
+ await prisma.application.update({ where: { id }, data: { buildPack } });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function getSecrets(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ let secrets = await prisma.secret.findMany({
+ where: { applicationId: id },
+ orderBy: { createdAt: 'desc' }
+ });
+ secrets = secrets.map((secret) => {
+ secret.value = decrypt(secret.value);
+ return secret;
+ });
+ secrets = secrets.filter((secret) => !secret.isPRMRSecret).sort((a, b) => {
+ return ('' + a.name).localeCompare(b.name);
+ })
+ return {
+ secrets
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function saveSecret(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ let { name, value, isBuildSecret, isPRMRSecret, isNew } = request.body
+
+ if (isNew) {
+ const found = await prisma.secret.findFirst({ where: { name, applicationId: id, isPRMRSecret } });
+ if (found) {
+ throw { status: 500, message: `Secret ${name} already exists.` }
+ } else {
+ value = encrypt(value);
+ await prisma.secret.create({
+ data: { name, value, isBuildSecret, isPRMRSecret, application: { connect: { id } } }
+ });
+ }
+ } else {
+ value = encrypt(value);
+ const found = await prisma.secret.findFirst({ where: { applicationId: id, name, isPRMRSecret } });
+
+ if (found) {
+ await prisma.secret.updateMany({
+ where: { applicationId: id, name, isPRMRSecret },
+ data: { value, isBuildSecret, isPRMRSecret }
+ });
+ } else {
+ await prisma.secret.create({
+ data: { name, value, isBuildSecret, isPRMRSecret, application: { connect: { id } } }
+ });
+ }
+ }
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function deleteSecret(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const { name } = request.body
+ await prisma.secret.deleteMany({ where: { applicationId: id, name } });
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function getStorages(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const persistentStorages = await prisma.applicationPersistentStorage.findMany({ where: { applicationId: id } });
+ return {
+ persistentStorages
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function saveStorage(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { path, newStorage, storageId } = request.body
+
+ if (newStorage) {
+ await prisma.applicationPersistentStorage.create({
+ data: { path, application: { connect: { id } } }
+ });
+ } else {
+ await prisma.applicationPersistentStorage.update({
+ where: { id: storageId },
+ data: { path }
+ });
+ }
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function deleteStorage(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const { path } = request.body
+ await prisma.applicationPersistentStorage.deleteMany({ where: { applicationId: id, path } });
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function getPreviews(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const { teamId } = request.user
+ let secrets = await prisma.secret.findMany({
+ where: { applicationId: id },
+ orderBy: { createdAt: 'desc' }
+ });
+ secrets = secrets.map((secret) => {
+ secret.value = decrypt(secret.value);
+ return secret;
+ });
+ const applicationSecrets = secrets.filter((secret) => !secret.isPRMRSecret);
+ const PRMRSecrets = secrets.filter((secret) => secret.isPRMRSecret);
+ const destinationDocker = await prisma.destinationDocker.findFirst({
+ where: { application: { some: { id } }, teams: { some: { id: teamId } } }
+ });
+ const docker = dockerInstance({ destinationDocker });
+ const listContainers = await docker.engine.listContainers({
+ filters: { network: [destinationDocker.network], name: [id] }
+ });
+ const containers = listContainers.filter((container) => {
+ return (
+ container.Labels['coolify.configuration'] &&
+ container.Labels['coolify.type'] === 'standalone-application'
+ );
+ });
+ const jsonContainers = containers
+ .map((container) =>
+ JSON.parse(Buffer.from(container.Labels['coolify.configuration'], 'base64').toString())
+ )
+ .filter((container) => {
+ return container.pullmergeRequestId && container.applicationId === id;
+ });
+ return {
+ containers: jsonContainers,
+ applicationSecrets: applicationSecrets.sort((a, b) => {
+ return ('' + a.name).localeCompare(b.name);
+ }),
+ PRMRSecrets: PRMRSecrets.sort((a, b) => {
+ return ('' + a.name).localeCompare(b.name);
+ })
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function getApplicationLogs(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ let { since = 0 } = request.query
+ if (since !== 0) {
+ since = day(since).unix();
+ }
+ const { destinationDockerId, destinationDocker } = await prisma.application.findUnique({
+ where: { id },
+ include: { destinationDocker: true }
+ });
+ if (destinationDockerId) {
+ const docker = dockerInstance({ destinationDocker });
+ try {
+ const container = await docker.engine.getContainer(id);
+ if (container) {
+ const { default: ansi } = await import('strip-ansi')
+ const logs = (
+ await container.logs({
+ stdout: true,
+ stderr: true,
+ timestamps: true,
+ since,
+ tail: 5000
+ })
+ )
+ .toString()
+ .split('\n')
+ .map((l) => ansi(l.slice(8)))
+ .filter((a) => a);
+ return {
+ logs
+ };
+ }
+ } catch (error) {
+ return {
+ logs: []
+ };
+ }
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getBuildLogs(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ let { buildId, skip = 0 } = request.query
+ if (typeof skip !== 'number') {
+ skip = Number(skip)
+ }
+
+ let builds = [];
+
+ const buildCount = await prisma.build.count({ where: { applicationId: id } });
+ if (buildId) {
+ builds = await prisma.build.findMany({ where: { applicationId: id, id: buildId } });
+ } else {
+ builds = await prisma.build.findMany({
+ where: { applicationId: id },
+ orderBy: { createdAt: 'desc' },
+ take: 5,
+ skip
+ });
+ }
+
+ builds = builds.map((build) => {
+ const updatedAt = day(build.updatedAt).utc();
+ build.took = updatedAt.diff(day(build.createdAt)) / 1000;
+ build.since = updatedAt.fromNow();
+ return build;
+ });
+ return {
+ builds,
+ buildCount
+ };
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function getBuildIdLogs(request: FastifyRequest) {
+ try {
+ const { id, buildId } = request.params
+ let { sequence = 0 } = request.query
+ if (typeof sequence !== 'number') {
+ sequence = Number(sequence)
+ }
+ let logs = await prisma.buildLog.findMany({
+ where: { buildId, time: { gt: sequence } },
+ orderBy: { time: 'asc' }
+ });
+ const data = await prisma.build.findFirst({ where: { id: buildId } });
+ return {
+ logs,
+ status: data?.status || 'queued'
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function getGitLabSSHKey(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const application = await prisma.application.findUnique({
+ where: { id },
+ include: { gitSource: { include: { gitlabApp: true } } }
+ });
+ return { publicKey: application.gitSource.gitlabApp.publicSshKey };
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function saveGitLabSSHKey(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const application = await prisma.application.findUnique({
+ where: { id },
+ include: { gitSource: { include: { gitlabApp: true } } }
+ });
+ if (!application.gitSource?.gitlabApp?.privateSshKey) {
+ const keys = await generateSshKeyPair();
+ const encryptedPrivateKey = encrypt(keys.privateKey);
+ await prisma.gitlabApp.update({
+ where: { id: application.gitSource.gitlabApp.id },
+ data: { privateSshKey: encryptedPrivateKey, publicSshKey: keys.publicKey }
+ });
+ return reply.code(201).send({ publicKey: keys.publicKey })
+ }
+ return { message: 'SSH key already exists' }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function saveDeployKey(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ let { deployKeyId } = request.body;
+
+ deployKeyId = Number(deployKeyId);
+ const application = await prisma.application.findUnique({
+ where: { id },
+ include: { gitSource: { include: { gitlabApp: true } } }
+ });
+ await prisma.gitlabApp.update({
+ where: { id: application.gitSource.gitlabApp.id },
+ data: { deployKeyId }
+ });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function cancelDeployment(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { buildId, applicationId } = request.body;
+ if (!buildId) {
+ throw { status: 500, message: 'buildId is required' }
+
+ }
+ await stopBuild(buildId, applicationId);
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
\ No newline at end of file
diff --git a/apps/api/src/routes/api/v1/applications/index.ts b/apps/api/src/routes/api/v1/applications/index.ts
new file mode 100644
index 0000000000..74a481358e
--- /dev/null
+++ b/apps/api/src/routes/api/v1/applications/index.ts
@@ -0,0 +1,89 @@
+import { FastifyPluginAsync } from 'fastify';
+import { cancelDeployment, checkDNS, checkRepository, deleteApplication, deleteSecret, deleteStorage, deployApplication, getApplication, getApplicationLogs, getBuildIdLogs, getBuildLogs, getBuildPack, getGitHubToken, getGitLabSSHKey, getPreviews, getSecrets, getStorages, getUsage, listApplications, newApplication, saveApplication, saveApplicationSettings, saveApplicationSource, saveBuildPack, saveDeployKey, saveDestination, saveGitLabSSHKey, saveRepository, saveSecret, saveStorage, stopApplication } from './handlers';
+
+export interface GetApplication {
+ Params: { id: string; }
+}
+
+export interface SaveApplication {
+ Params: { id: string; },
+ Body: any
+}
+
+export interface SaveApplicationSettings {
+ Params: { id: string; };
+ Querystring: { domain: string; };
+ Body: { debug: boolean; previews: boolean; dualCerts: boolean; autodeploy: boolean; branch: string; projectId: number; };
+}
+
+export interface DeleteApplication {
+ Params: { id: string; };
+ Querystring: { domain: string; };
+}
+
+export interface CheckDNS {
+ Params: { id: string; };
+ Querystring: { domain: string; };
+}
+
+export interface DeployApplication {
+ Params: { id: string },
+ Querystring: { domain: string }
+ Body: { pullmergeRequestId: string | null, branch: string }
+}
+
+const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
+ fastify.addHook('onRequest', async (request, reply) => {
+ return await request.jwtVerify()
+ })
+ fastify.get('/', async (request) => await listApplications(request));
+
+ fastify.post('/new', async (request, reply) => await newApplication(request, reply));
+
+ fastify.get<GetApplication>('/:id', async (request) => await getApplication(request));
+ fastify.post<SaveApplication>('/:id', async (request, reply) => await saveApplication(request, reply));
+ fastify.delete<DeleteApplication>('/:id', async (request, reply) => await deleteApplication(request, reply));
+
+ fastify.post('/:id/stop', async (request, reply) => await stopApplication(request, reply));
+
+ fastify.post<SaveApplicationSettings>('/:id/settings', async (request, reply) => await saveApplicationSettings(request, reply));
+ fastify.post<SaveApplicationSettings>('/:id/check', async (request) => await checkDNS(request));
+
+ fastify.get('/:id/secrets', async (request) => await getSecrets(request));
+ fastify.post('/:id/secrets', async (request, reply) => await saveSecret(request, reply));
+ fastify.delete('/:id/secrets', async (request) => await deleteSecret(request));
+
+ fastify.get('/:id/storages', async (request) => await getStorages(request));
+ fastify.post('/:id/storages', async (request, reply) => await saveStorage(request, reply));
+ fastify.delete('/:id/storages', async (request) => await deleteStorage(request));
+
+ fastify.get('/:id/previews', async (request) => await getPreviews(request));
+
+ fastify.get('/:id/logs', async (request) => await getApplicationLogs(request));
+ fastify.get('/:id/logs/build', async (request) => await getBuildLogs(request));
+ fastify.get('/:id/logs/build/:buildId', async (request) => await getBuildIdLogs(request));
+
+ fastify.get<DeployApplication>('/:id/usage', async (request) => await getUsage(request))
+
+ fastify.post<DeployApplication>('/:id/deploy', async (request) => await deployApplication(request))
+ fastify.post('/:id/cancel', async (request, reply) => await cancelDeployment(request, reply));
+
+ fastify.post('/:id/configuration/source', async (request, reply) => await saveApplicationSource(request, reply));
+
+ fastify.get('/:id/configuration/repository', async (request) => await checkRepository(request));
+ fastify.post('/:id/configuration/repository', async (request, reply) => await saveRepository(request, reply));
+ fastify.post('/:id/configuration/destination', async (request, reply) => await saveDestination(request, reply));
+ fastify.get('/:id/configuration/buildpack', async (request) => await getBuildPack(request));
+ fastify.post('/:id/configuration/buildpack', async (request, reply) => await saveBuildPack(request, reply));
+
+ fastify.get('/:id/configuration/sshkey', async (request) => await getGitLabSSHKey(request));
+ fastify.post('/:id/configuration/sshkey', async (request, reply) => await saveGitLabSSHKey(request, reply));
+
+ fastify.post('/:id/configuration/deploykey', async (request, reply) => await saveDeployKey(request, reply));
+
+
+
+ fastify.get('/:id/configuration/githubToken', async (request, reply) => await getGitHubToken(request, reply));
+};
+
+export default root;
diff --git a/apps/api/src/routes/api/v1/databases/handlers.ts b/apps/api/src/routes/api/v1/databases/handlers.ts
new file mode 100644
index 0000000000..52110b8b7f
--- /dev/null
+++ b/apps/api/src/routes/api/v1/databases/handlers.ts
@@ -0,0 +1,471 @@
+import cuid from 'cuid';
+import type { FastifyRequest } from 'fastify';
+import { FastifyReply } from 'fastify';
+import yaml from 'js-yaml';
+import fs from 'fs/promises';
+import { asyncExecShell, ComposeFile, createDirectories, decrypt, encrypt, errorHandler, generateDatabaseConfiguration, generatePassword, getContainerUsage, getDatabaseImage, getDatabaseVersions, getFreePort, listSettings, makeLabelForStandaloneDatabase, prisma, startTcpProxy, startTraefikTCPProxy, stopDatabaseContainer, stopTcpHttpProxy, supportedDatabaseTypesAndVersions, uniqueName, updatePasswordInDb } from '../../../../lib/common';
+import { dockerInstance, getEngine } from '../../../../lib/docker';
+import { day } from '../../../../lib/dayjs';
+
+export async function listDatabases(request: FastifyRequest) {
+ try {
+ const userId = request.user.userId;
+ const teamId = request.user.teamId;
+ let databases = []
+ if (teamId === '0') {
+ databases = await prisma.database.findMany({ include: { teams: true } });
+ } else {
+ databases = await prisma.database.findMany({
+ where: { teams: { some: { id: teamId } } },
+ include: { teams: true }
+ });
+ }
+ return {
+ databases
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function newDatabase(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const teamId = request.user.teamId;
+
+ const name = uniqueName();
+ const dbUser = cuid();
+ const dbUserPassword = encrypt(generatePassword());
+ const rootUser = cuid();
+ const rootUserPassword = encrypt(generatePassword());
+ const defaultDatabase = cuid();
+
+ const { id } = await prisma.database.create({
+ data: {
+ name,
+ defaultDatabase,
+ dbUser,
+ dbUserPassword,
+ rootUser,
+ rootUserPassword,
+ teams: { connect: { id: teamId } },
+ settings: { create: { isPublic: false } }
+ }
+ });
+ return reply.code(201).send({ id })
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getDatabase(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const database = await prisma.database.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: { destinationDocker: true, settings: true }
+ });
+ if (!database) {
+ throw { status: 404, message: 'Database not found.' }
+ }
+ if (database.dbUserPassword) database.dbUserPassword = decrypt(database.dbUserPassword);
+ if (database.rootUserPassword) database.rootUserPassword = decrypt(database.rootUserPassword);
+ const { destinationDockerId, destinationDocker } = database;
+ let isRunning = false;
+ if (destinationDockerId) {
+ const host = getEngine(destinationDocker.engine);
+
+ try {
+ const { stdout } = await asyncExecShell(
+ `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`
+ );
+
+ if (JSON.parse(stdout).Running) {
+ isRunning = true;
+ }
+ } catch (error) {
+ //
+ }
+ }
+ const configuration = generateDatabaseConfiguration(database);
+ const settings = await listSettings();
+ return {
+ privatePort: configuration?.privatePort,
+ database,
+ isRunning,
+ versions: await getDatabaseVersions(database.type),
+ settings
+ };
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getDatabaseTypes(request: FastifyRequest) {
+ try {
+ return {
+ types: supportedDatabaseTypesAndVersions
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveDatabaseType(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params;
+ const { type } = request.body;
+ await prisma.database.update({
+ where: { id },
+ data: { type }
+ });
+ return reply.code(201).send({})
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getVersions(request: FastifyRequest) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ const { type } = await prisma.database.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: { destinationDocker: true, settings: true }
+ });
+ return {
+ versions: supportedDatabaseTypesAndVersions.find((name) => name.name === type).versions
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveVersion(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params;
+ const { version } = request.body;
+
+ await prisma.database.update({
+ where: { id },
+ data: {
+ version,
+
+ }
+ });
+ return reply.code(201).send({})
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveDatabaseDestination(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params;
+ const { destinationId } = request.body;
+
+ await prisma.database.update({
+ where: { id },
+ data: { destinationDocker: { connect: { id: destinationId } } }
+ });
+
+ const {
+ destinationDockerId,
+ destinationDocker: { engine },
+ version,
+ type
+ } = await prisma.database.findUnique({ where: { id }, include: { destinationDocker: true } });
+
+ if (destinationDockerId) {
+ const host = getEngine(engine);
+ if (type && version) {
+ const baseImage = getDatabaseImage(type);
+ asyncExecShell(`DOCKER_HOST=${host} docker pull ${baseImage}:${version}`);
+ }
+ }
+ return reply.code(201).send({})
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getDatabaseUsage(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ let usage = {};
+
+ const database = await prisma.database.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: { destinationDocker: true, settings: true }
+ });
+ if (database.dbUserPassword) database.dbUserPassword = decrypt(database.dbUserPassword);
+ if (database.rootUserPassword) database.rootUserPassword = decrypt(database.rootUserPassword);
+ if (database.destinationDockerId) {
+ [usage] = await Promise.all([getContainerUsage(database.destinationDocker.engine, id)]);
+ }
+ return {
+ usage
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function startDatabase(request: FastifyRequest) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+
+ const database = await prisma.database.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: { destinationDocker: true, settings: true }
+ });
+ if (database.dbUserPassword) database.dbUserPassword = decrypt(database.dbUserPassword);
+ if (database.rootUserPassword) database.rootUserPassword = decrypt(database.rootUserPassword);
+ const {
+ type,
+ destinationDockerId,
+ destinationDocker,
+ publicPort,
+ settings: { isPublic }
+ } = database;
+ const { privatePort, environmentVariables, image, volume, ulimits } =
+ generateDatabaseConfiguration(database);
+
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const engine = destinationDocker.engine;
+ const volumeName = volume.split(':')[0];
+ const labels = await makeLabelForStandaloneDatabase({ id, image, volume });
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image,
+ networks: [network],
+ environment: environmentVariables,
+ volumes: [volume],
+ ulimits,
+ labels,
+ restart: 'always',
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [volumeName]: {
+ external: true
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+ try {
+ await asyncExecShell(`DOCKER_HOST=${host} docker volume create ${volumeName}`);
+ } catch (error) {
+ console.log(error);
+ }
+ try {
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ if (isPublic) await startTcpProxy(destinationDocker, id, publicPort, privatePort);
+ return {};
+ } catch (error) {
+ throw {
+ error
+ };
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function stopDatabase(request: FastifyRequest) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ const database = await prisma.database.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: { destinationDocker: true, settings: true }
+ });
+ if (database.dbUserPassword) database.dbUserPassword = decrypt(database.dbUserPassword);
+ if (database.rootUserPassword) database.rootUserPassword = decrypt(database.rootUserPassword);
+ const everStarted = await stopDatabaseContainer(database);
+ if (everStarted) await stopTcpHttpProxy(id, database.destinationDocker, database.publicPort);
+ await prisma.database.update({
+ where: { id },
+ data: {
+ settings: { upsert: { update: { isPublic: false }, create: { isPublic: false } } }
+ }
+ });
+ await prisma.database.update({ where: { id }, data: { publicPort: null } });
+ return {};
+
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getDatabaseLogs(request: FastifyRequest) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ let { since = 0 } = request.query
+ if (since !== 0) {
+ since = day(since).unix();
+ }
+ const { destinationDockerId, destinationDocker } = await prisma.database.findUnique({
+ where: { id },
+ include: { destinationDocker: true }
+ });
+ if (destinationDockerId) {
+ const docker = dockerInstance({ destinationDocker });
+ try {
+ const container = await docker.engine.getContainer(id);
+ if (container) {
+ const { default: ansi } = await import('strip-ansi')
+ const logs = (
+ await container.logs({
+ stdout: true,
+ stderr: true,
+ timestamps: true,
+ since,
+ tail: 5000
+ })
+ )
+ .toString()
+ .split('\n')
+ .map((l) => ansi(l.slice(8)))
+ .filter((a) => a);
+ return {
+ logs
+ };
+ }
+ } catch (error) {
+ const { statusCode } = error;
+ if (statusCode === 404) {
+ return {
+ logs: []
+ };
+ }
+ }
+ }
+ return {
+ message: 'No logs found.'
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function deleteDatabase(request: FastifyRequest) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ const database = await prisma.database.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: { destinationDocker: true, settings: true }
+ });
+ if (database.dbUserPassword) database.dbUserPassword = decrypt(database.dbUserPassword);
+ if (database.rootUserPassword) database.rootUserPassword = decrypt(database.rootUserPassword);
+ if (database.destinationDockerId) {
+ const everStarted = await stopDatabaseContainer(database);
+ if (everStarted) await stopTcpHttpProxy(id, database.destinationDocker, database.publicPort);
+ }
+ await prisma.databaseSettings.deleteMany({ where: { databaseId: id } });
+ await prisma.database.delete({ where: { id } });
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveDatabase(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ const {
+ name,
+ defaultDatabase,
+ dbUser,
+ dbUserPassword,
+ rootUser,
+ rootUserPassword,
+ version,
+ isRunning
+ } = request.body;
+ const database = await prisma.database.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: { destinationDocker: true, settings: true }
+ });
+ if (database.dbUserPassword) database.dbUserPassword = decrypt(database.dbUserPassword);
+ if (database.rootUserPassword) database.rootUserPassword = decrypt(database.rootUserPassword);
+ if (isRunning) {
+ if (database.dbUserPassword !== dbUserPassword) {
+ await updatePasswordInDb(database, dbUser, dbUserPassword, false);
+ } else if (database.rootUserPassword !== rootUserPassword) {
+ await updatePasswordInDb(database, rootUser, rootUserPassword, true);
+ }
+ }
+ const encryptedDbUserPassword = dbUserPassword && encrypt(dbUserPassword);
+ const encryptedRootUserPassword = rootUserPassword && encrypt(rootUserPassword);
+ await prisma.database.update({
+ where: { id },
+ data: {
+ name,
+ defaultDatabase,
+ dbUser,
+ dbUserPassword: encryptedDbUserPassword,
+ rootUser,
+ rootUserPassword: encryptedRootUserPassword,
+ version
+ }
+ });
+ return reply.code(201).send({})
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveDatabaseSettings(request: FastifyRequest) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ const { isPublic, appendOnly = true } = request.body;
+ const publicPort = await getFreePort();
+ const settings = await listSettings();
+ await prisma.database.update({
+ where: { id },
+ data: {
+ settings: { upsert: { update: { isPublic, appendOnly }, create: { isPublic, appendOnly } } }
+ }
+ });
+ const database = await prisma.database.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: { destinationDocker: true, settings: true }
+ });
+ if (database.dbUserPassword) database.dbUserPassword = decrypt(database.dbUserPassword);
+ if (database.rootUserPassword) database.rootUserPassword = decrypt(database.rootUserPassword);
+
+ const { destinationDockerId, destinationDocker, publicPort: oldPublicPort } = database;
+ const { privatePort } = generateDatabaseConfiguration(database);
+
+ if (destinationDockerId) {
+ if (isPublic) {
+ await prisma.database.update({ where: { id }, data: { publicPort } });
+ if (settings.isTraefikUsed) {
+ await startTraefikTCPProxy(destinationDocker, id, publicPort, privatePort);
+ } else {
+ await startTcpProxy(destinationDocker, id, publicPort, privatePort);
+ }
+ } else {
+ await prisma.database.update({ where: { id }, data: { publicPort: null } });
+ await stopTcpHttpProxy(id, destinationDocker, oldPublicPort);
+ }
+ }
+ return { publicPort }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
\ No newline at end of file
diff --git a/apps/api/src/routes/api/v1/databases/index.ts b/apps/api/src/routes/api/v1/databases/index.ts
new file mode 100644
index 0000000000..cd4a8c159c
--- /dev/null
+++ b/apps/api/src/routes/api/v1/databases/index.ts
@@ -0,0 +1,32 @@
+import { FastifyPluginAsync } from 'fastify';
+import { deleteDatabase, getDatabase, getDatabaseLogs, getDatabaseTypes, getDatabaseUsage, getVersions, listDatabases, newDatabase, saveDatabase, saveDatabaseDestination, saveDatabaseSettings, saveDatabaseType, saveVersion, startDatabase, stopDatabase } from './handlers';
+
+const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
+ fastify.addHook('onRequest', async (request, reply) => {
+ return await request.jwtVerify()
+ })
+ fastify.get('/', async (request) => await listDatabases(request));
+ fastify.post('/new', async (request, reply) => await newDatabase(request, reply));
+
+ fastify.get('/:id', async (request) => await getDatabase(request));
+ fastify.post('/:id', async (request, reply) => await saveDatabase(request, reply));
+ fastify.delete('/:id', async (request) => await deleteDatabase(request));
+
+ fastify.post('/:id/settings', async (request) => await saveDatabaseSettings(request));
+
+ fastify.get('/:id/configuration/type', async (request) => await getDatabaseTypes(request));
+ fastify.post('/:id/configuration/type', async (request, reply) => await saveDatabaseType(request, reply));
+
+ fastify.get('/:id/configuration/version', async (request) => await getVersions(request));
+ fastify.post('/:id/configuration/version', async (request, reply) => await saveVersion(request, reply));
+
+ fastify.post('/:id/configuration/destination', async (request, reply) => await saveDatabaseDestination(request, reply));
+
+ fastify.get('/:id/usage', async (request) => await getDatabaseUsage(request));
+ fastify.get('/:id/logs', async (request) => await getDatabaseLogs(request));
+
+ fastify.post('/:id/start', async (request) => await startDatabase(request));
+ fastify.post('/:id/stop', async (request) => await stopDatabase(request));
+};
+
+export default root;
diff --git a/apps/api/src/routes/api/v1/destinations/handlers.ts b/apps/api/src/routes/api/v1/destinations/handlers.ts
new file mode 100644
index 0000000000..36e7f7aa4c
--- /dev/null
+++ b/apps/api/src/routes/api/v1/destinations/handlers.ts
@@ -0,0 +1,200 @@
+import type { FastifyRequest } from 'fastify';
+import { FastifyReply } from 'fastify';
+import { asyncExecShell, errorHandler, listSettings, prisma, startCoolifyProxy, startTraefikProxy, stopTraefikProxy } from '../../../../lib/common';
+import { checkContainer, dockerInstance, getEngine } from '../../../../lib/docker';
+
+export async function listDestinations(request: FastifyRequest) {
+ try {
+ const teamId = request.user.teamId;
+ let destinations = []
+ if (teamId === '0') {
+ destinations = await prisma.destinationDocker.findMany({ include: { teams: true } });
+ } else {
+ destinations = await prisma.destinationDocker.findMany({
+ where: { teams: { some: { id: teamId } } },
+ include: { teams: true }
+ });
+ }
+ return {
+ destinations
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function checkDestination(request: FastifyRequest) {
+ try {
+ const { network } = request.body;
+ const found = await prisma.destinationDocker.findFirst({ where: { network } });
+ if (found) {
+ throw {
+ message: `Network already exists: ${network}`
+ };
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getDestination(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const teamId = request.user?.teamId;
+ const destination = await prisma.destinationDocker.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } }
+ });
+ if (!destination) {
+ throw { status: 404, message: `Destination not found.` };
+ }
+ const settings = await listSettings();
+ let payload = {
+ destination,
+ settings,
+ state: false
+ };
+
+ if (destination?.remoteEngine) {
+ // const { stdout } = await asyncExecShell(
+ // `ssh -p ${destination.port} ${destination.user}@${destination.ipAddress} "docker ps -a"`
+ // );
+ // console.log(stdout)
+ // const engine = await generateRemoteEngine(destination);
+ // // await saveSshKey(destination);
+ // payload.state = await checkContainer(engine, 'coolify-haproxy');
+ } else {
+ let containerName = 'coolify-proxy';
+ if (!settings.isTraefikUsed) {
+ containerName = 'coolify-haproxy';
+ }
+ payload.state =
+ destination?.engine && (await checkContainer(destination.engine, containerName));
+ }
+ return {
+ ...payload
+ };
+
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function newDestination(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ let { name, network, engine, isCoolifyProxyUsed } = request.body
+ const teamId = request.user.teamId;
+ if (id === 'new') {
+ const host = getEngine(engine);
+ const docker = dockerInstance({ destinationDocker: { engine, network } });
+ const found = await docker.engine.listNetworks({ filters: { name: [`^${network}$`] } });
+ if (found.length === 0) {
+ await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable ${network}`);
+ }
+ await prisma.destinationDocker.create({
+ data: { name, teams: { connect: { id: teamId } }, engine, network, isCoolifyProxyUsed }
+ });
+ const destinations = await prisma.destinationDocker.findMany({ where: { engine } });
+ const destination = destinations.find((destination) => destination.network === network);
+
+ if (destinations.length > 0) {
+ const proxyConfigured = destinations.find(
+ (destination) => destination.network !== network && destination.isCoolifyProxyUsed === true
+ );
+ if (proxyConfigured) {
+ isCoolifyProxyUsed = !!proxyConfigured.isCoolifyProxyUsed;
+ }
+ await prisma.destinationDocker.updateMany({ where: { engine }, data: { isCoolifyProxyUsed } });
+ }
+ if (isCoolifyProxyUsed) {
+ const settings = await prisma.setting.findFirst();
+ if (settings?.isTraefikUsed) {
+ await startTraefikProxy(engine);
+ } else {
+ await startCoolifyProxy(engine);
+ }
+ }
+ return reply.code(201).send({ id: destination.id });
+ } else {
+ await prisma.destinationDocker.update({ where: { id }, data: { name, engine, network } });
+ return reply.code(201).send();
+ }
+
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function deleteDestination(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const destination = await prisma.destinationDocker.delete({ where: { id } });
+ if (destination.isCoolifyProxyUsed) {
+ const host = getEngine(destination.engine);
+ const { network } = destination;
+ const settings = await prisma.setting.findFirst();
+ const containerName = settings.isTraefikUsed ? 'coolify-proxy' : 'coolify-haproxy';
+ const { stdout: found } = await asyncExecShell(
+ `DOCKER_HOST=${host} docker ps -a --filter network=${network} --filter name=${containerName} --format '{{.}}'`
+ );
+ if (found) {
+ await asyncExecShell(
+ `DOCKER_HOST="${host}" docker network disconnect ${network} ${containerName}`
+ );
+ await asyncExecShell(`DOCKER_HOST="${host}" docker network rm ${network}`);
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveDestinationSettings(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { engine, isCoolifyProxyUsed } = request.body;
+ await prisma.destinationDocker.updateMany({
+ where: { engine },
+ data: { isCoolifyProxyUsed }
+ });
+
+ return {
+ status: 202
+ }
+ // return reply.code(201).send();
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function startProxy(request: FastifyRequest, reply: FastifyReply) {
+ const { engine } = request.body;
+ try {
+ await startTraefikProxy(engine);
+ return {}
+ } catch ({ status, message }) {
+ await stopTraefikProxy(engine);
+ return errorHandler({ status, message })
+ }
+}
+export async function stopProxy(request: FastifyRequest, reply: FastifyReply) {
+ const settings = await prisma.setting.findFirst({});
+ const { engine } = request.body;
+ try {
+ await stopTraefikProxy(engine);
+
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function restartProxy(request: FastifyRequest, reply: FastifyReply) {
+ const settings = await prisma.setting.findFirst({});
+ const { engine } = request.body;
+ try {
+ await stopTraefikProxy(engine);
+ await startTraefikProxy(engine);
+ await prisma.destinationDocker.updateMany({
+ where: { engine },
+ data: { isCoolifyProxyUsed: true }
+ });
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
diff --git a/apps/api/src/routes/api/v1/destinations/index.ts b/apps/api/src/routes/api/v1/destinations/index.ts
new file mode 100644
index 0000000000..0e395a7871
--- /dev/null
+++ b/apps/api/src/routes/api/v1/destinations/index.ts
@@ -0,0 +1,24 @@
+import { FastifyPluginAsync } from 'fastify';
+import { checkDestination, deleteDestination, getDestination, listDestinations, newDestination, restartProxy, saveDestinationSettings, startProxy, stopProxy } from './handlers';
+
+const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
+ fastify.addHook('onRequest', async (request, reply) => {
+ return await request.jwtVerify()
+ })
+ fastify.get('/', async (request) => await listDestinations(request));
+ fastify.post('/check', async (request) => await checkDestination(request));
+
+ fastify.get('/:id', async (request) => await getDestination(request));
+ fastify.post('/:id', async (request, reply) => await newDestination(request, reply));
+ fastify.delete('/:id', async (request) => await deleteDestination(request));
+
+ fastify.post('/:id/settings', async (request, reply) => await saveDestinationSettings(request, reply));
+ fastify.post('/:id/start', async (request, reply) => await startProxy(request, reply));
+ fastify.post('/:id/stop', async (request, reply) => await stopProxy(request, reply));
+ fastify.post('/:id/restart', async (request, reply) => await restartProxy(request, reply));
+
+
+
+};
+
+export default root;
diff --git a/apps/api/src/routes/api/v1/handlers.ts b/apps/api/src/routes/api/v1/handlers.ts
new file mode 100644
index 0000000000..b998fd4b5a
--- /dev/null
+++ b/apps/api/src/routes/api/v1/handlers.ts
@@ -0,0 +1,280 @@
+import os from 'node:os';
+import osu from 'node-os-utils';
+import axios from 'axios';
+import compare from 'compare-versions';
+import cuid from 'cuid';
+import bcrypt from 'bcryptjs';
+import { asyncExecShell, asyncSleep, errorHandler, isDev, prisma, uniqueName, version } from '../../../lib/common';
+
+import type { FastifyReply, FastifyRequest } from 'fastify';
+import type { Login, Update } from '.';
+
+
+export async function hashPassword(password: string): Promise<string> {
+ const saltRounds = 15;
+ return bcrypt.hash(password, saltRounds);
+}
+
+
+export async function checkUpdate(request: FastifyRequest) {
+ try {
+ const currentVersion = version;
+ const { data: versions } = await axios.get(
+ `https://get.coollabs.io/versions.json?appId=${process.env['COOLIFY_APP_ID']}&version=${currentVersion}`
+ );
+ const latestVersion =
+ request.hostname === 'staging.coolify.io'
+ ? versions['coolify'].next.version
+ : versions['coolify'].main.version;
+ const isUpdateAvailable = compare(latestVersion, currentVersion);
+ return {
+ isUpdateAvailable: isUpdateAvailable === 1,
+ latestVersion
+ };
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function update(request: FastifyRequest<Update>) {
+ const { latestVersion } = request.body;
+ try {
+ if (!isDev) {
+ const { isAutoUpdateEnabled } = (await prisma.setting.findFirst()) || {
+ isAutoUpdateEnabled: false
+ };
+ await asyncExecShell(`docker pull coollabsio/coolify:${latestVersion}`);
+ await asyncExecShell(`env | grep COOLIFY > .env`);
+ await asyncExecShell(
+ `sed -i '/COOLIFY_AUTO_UPDATE=/cCOOLIFY_AUTO_UPDATE=${isAutoUpdateEnabled}' .env`
+ );
+ await asyncExecShell(
+ `docker run --rm -tid --env-file .env -v /var/run/docker.sock:/var/run/docker.sock -v coolify-db coollabsio/coolify:${latestVersion} /bin/sh -c "env | grep COOLIFY > .env && echo 'TAG=${latestVersion}' >> .env && docker stop -t 0 coolify && docker rm coolify && docker compose up -d --force-recreate"`
+ );
+ return {};
+ } else {
+ console.log(latestVersion);
+ await asyncSleep(2000);
+ return {};
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function showUsage() {
+ try {
+ return {
+ usage: {
+ uptime: os.uptime(),
+ memory: await osu.mem.info(),
+ cpu: {
+ load: os.loadavg(),
+ usage: await osu.cpu.usage(),
+ count: os.cpus().length
+ },
+ disk: await osu.drive.info('/')
+ }
+
+ };
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function showDashboard(request: FastifyRequest) {
+ try {
+ const userId = request.user.userId;
+ const teamId = request.user.teamId;
+ const applicationsCount = await prisma.application.count({
+ where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } }
+ });
+ const sourcesCount = await prisma.gitSource.count({
+ where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } }
+ });
+ const destinationsCount = await prisma.destinationDocker.count({
+ where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } }
+ });
+ const teamsCount = await prisma.permission.count({ where: { userId } });
+ const databasesCount = await prisma.database.count({
+ where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } }
+ });
+ const servicesCount = await prisma.service.count({
+ where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } }
+ });
+ const teams = await prisma.permission.findMany({
+ where: { userId },
+ include: { team: { include: { _count: { select: { users: true } } } } }
+ });
+ return {
+ teams,
+ applicationsCount,
+ sourcesCount,
+ destinationsCount,
+ teamsCount,
+ databasesCount,
+ servicesCount,
+ };
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function login(request: FastifyRequest<Login>, reply: FastifyReply) {
+ if (request.user) {
+ return reply.redirect('/dashboard');
+ } else {
+ const { email, password, isLogin } = request.body || {};
+ if (!email || !password) {
+ throw { status: 500, message: 'Email and password are required.' };
+ }
+ const users = await prisma.user.count();
+ const userFound = await prisma.user.findUnique({
+ where: { email },
+ include: { teams: true, permission: true },
+ rejectOnNotFound: false
+ });
+ if (!userFound && isLogin) {
+ throw { status: 500, message: 'User not found.' };
+ }
+ const { isRegistrationEnabled, id } = await prisma.setting.findFirst()
+ let uid = cuid();
+ let permission = 'read';
+ let isAdmin = false;
+
+ if (users === 0) {
+ await prisma.setting.update({ where: { id }, data: { isRegistrationEnabled: false } });
+ uid = '0';
+ }
+ if (userFound) {
+ if (userFound.type === 'email') {
+ // TODO: Review this one
+ if (userFound.password === 'RESETME') {
+ const hashedPassword = await hashPassword(password);
+ if (userFound.updatedAt < new Date(Date.now() - 1000 * 60 * 10)) {
+ await prisma.user.update({
+ where: { email: userFound.email },
+ data: { password: 'RESETTIMEOUT' }
+ });
+ throw {
+ status: 500,
+ message: 'Password reset link has expired. Please request a new one.'
+ };
+ } else {
+ await prisma.user.update({
+ where: { email: userFound.email },
+ data: { password: hashedPassword }
+ });
+ return {
+ userId: userFound.id,
+ teamId: userFound.id,
+ permission: userFound.permission,
+ isAdmin: true
+ };
+ }
+ }
+
+ const passwordMatch = await bcrypt.compare(password, userFound.password);
+ if (!passwordMatch) {
+ throw {
+ status: 500,
+ message: 'Wrong password or email address.'
+ };
+ }
+ uid = userFound.id;
+ isAdmin = true;
+ }
+ } else {
+ permission = 'owner';
+ isAdmin = true;
+ if (!isRegistrationEnabled) {
+ throw {
+ status: 404,
+ message: 'Registration disabled by administrator.'
+ };
+ }
+ const hashedPassword = await hashPassword(password);
+ if (users === 0) {
+ await prisma.user.create({
+ data: {
+ id: uid,
+ email,
+ password: hashedPassword,
+ type: 'email',
+ teams: {
+ create: {
+ id: uid,
+ name: uniqueName(),
+ destinationDocker: { connect: { network: 'coolify' } }
+ }
+ },
+ permission: { create: { teamId: uid, permission: 'owner' } }
+ },
+ include: { teams: true }
+ });
+ } else {
+ await prisma.user.create({
+ data: {
+ id: uid,
+ email,
+ password: hashedPassword,
+ type: 'email',
+ teams: {
+ create: {
+ id: uid,
+ name: uniqueName()
+ }
+ },
+ permission: { create: { teamId: uid, permission: 'owner' } }
+ },
+ include: { teams: true }
+ });
+ }
+ }
+ return {
+ userId: uid,
+ teamId: uid,
+ permission,
+ isAdmin
+ };
+ }
+}
+
+export async function getCurrentUser(request: FastifyRequest, fastify) {
+ let token = null
+
+ try {
+ const user = await prisma.user.findUnique({
+ where: { id: request.user.userId }
+ })
+ if (!user) {
+ throw "User not found";
+ }
+ } catch (error) {
+ throw { status: 401, message: error };
+ }
+ if (request.query.teamId) {
+ try {
+ const user = await prisma.user.findFirst({
+ where: { id: request.user.userId, teams: { some: { id: request.query.teamId } } },
+ include: { teams: true, permission: true }
+ })
+ if (user) {
+ const payload = {
+ ...request.user,
+ teamId: request.query.teamId,
+ permission: user.permission.find(p => p.teamId === request.query.teamId).permission || null,
+ isAdmin: user.permission.find(p => p.teamId === request.query.teamId).permission === 'owner'
+
+ }
+ token = fastify.jwt.sign(payload)
+ }
+
+ } catch (error) {
+ // No new token -> not switching teams
+ }
+ }
+ return {
+ settings: await prisma.setting.findFirst(),
+ token,
+ ...request.user
+ }
+}
diff --git a/apps/api/src/routes/api/v1/iam/handlers.ts b/apps/api/src/routes/api/v1/iam/handlers.ts
new file mode 100644
index 0000000000..12095c26db
--- /dev/null
+++ b/apps/api/src/routes/api/v1/iam/handlers.ts
@@ -0,0 +1,453 @@
+import cuid from 'cuid';
+import type { FastifyRequest } from 'fastify';
+import { FastifyReply } from 'fastify';
+import { decrypt, errorHandler, prisma, uniqueName } from '../../../../lib/common';
+import { day } from '../../../../lib/dayjs';
+export async function listTeams(request: FastifyRequest) {
+ try {
+ const userId = request.user.userId;
+ const teamId = request.user.teamId;
+ const account = await prisma.user.findUnique({
+ where: { id: userId },
+ select: { id: true, email: true, teams: true }
+ });
+ let accounts = [];
+ let allTeams = [];
+ if (teamId === '0') {
+ accounts = await prisma.user.findMany({ select: { id: true, email: true, teams: true } });
+ allTeams = await prisma.team.findMany({
+ where: { users: { none: { id: userId } } },
+ include: { permissions: true }
+ });
+ }
+ const ownTeams = await prisma.team.findMany({
+ where: { users: { some: { id: userId } } },
+ include: { permissions: true }
+ });
+ const invitations = await prisma.teamInvitation.findMany({ where: { uid: userId } });
+ return {
+ ownTeams,
+ allTeams,
+ invitations,
+ account,
+ accounts
+ };
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function deleteTeam(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const userId = request.user.userId;
+ const { id } = request.params;
+
+ const aloneInTeams = await prisma.team.findMany({ where: { users: { every: { id: userId } }, id } });
+ if (aloneInTeams.length > 0) {
+ for (const team of aloneInTeams) {
+ const applications = await prisma.application.findMany({
+ where: { teams: { every: { id: team.id } } }
+ });
+ if (applications.length > 0) {
+ for (const application of applications) {
+ await prisma.application.update({
+ where: { id: application.id },
+ data: { teams: { connect: { id: '0' } } }
+ });
+ }
+ }
+ const services = await prisma.service.findMany({
+ where: { teams: { every: { id: team.id } } }
+ });
+ if (services.length > 0) {
+ for (const service of services) {
+ await prisma.service.update({
+ where: { id: service.id },
+ data: { teams: { connect: { id: '0' } } }
+ });
+ }
+ }
+ const databases = await prisma.database.findMany({
+ where: { teams: { every: { id: team.id } } }
+ });
+ if (databases.length > 0) {
+ for (const database of databases) {
+ await prisma.database.update({
+ where: { id: database.id },
+ data: { teams: { connect: { id: '0' } } }
+ });
+ }
+ }
+ const sources = await prisma.gitSource.findMany({
+ where: { teams: { every: { id: team.id } } }
+ });
+ if (sources.length > 0) {
+ for (const source of sources) {
+ await prisma.gitSource.update({
+ where: { id: source.id },
+ data: { teams: { connect: { id: '0' } } }
+ });
+ }
+ }
+ const destinations = await prisma.destinationDocker.findMany({
+ where: { teams: { every: { id: team.id } } }
+ });
+ if (destinations.length > 0) {
+ for (const destination of destinations) {
+ await prisma.destinationDocker.update({
+ where: { id: destination.id },
+ data: { teams: { connect: { id: '0' } } }
+ });
+ }
+ }
+ await prisma.teamInvitation.deleteMany({ where: { teamId: team.id } });
+ await prisma.permission.deleteMany({ where: { teamId: team.id } });
+ // await prisma.user.delete({ where: { id } });
+ await prisma.team.delete({ where: { id: team.id } });
+ }
+ }
+
+ const notAloneInTeams = await prisma.team.findMany({ where: { users: { some: { id: userId } } } });
+ if (notAloneInTeams.length > 0) {
+ for (const team of notAloneInTeams) {
+ await prisma.team.update({
+ where: { id: team.id },
+ data: { users: { disconnect: { id } } }
+ });
+ }
+ }
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function newTeam(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const userId = request.user?.userId;
+ const name = uniqueName();
+ const { id } = await prisma.team.create({
+ data: {
+ name,
+ permissions: { create: { user: { connect: { id: userId } }, permission: 'owner' } },
+ users: { connect: { id: userId } }
+ }
+ });
+ return reply.code(201).send({ id })
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getTeam(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const userId = request.user.userId;
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+
+ const user = await prisma.user.findFirst({
+ where: { id: userId, teams: teamId === '0' ? undefined : { some: { id } } },
+ include: { permission: true }
+ });
+ if (!user) return reply.code(401).send()
+
+ const permissions = await prisma.permission.findMany({
+ where: { teamId: id },
+ include: { user: { select: { id: true, email: true } } }
+ });
+ const team = await prisma.team.findUnique({ where: { id }, include: { permissions: true } });
+ const invitations = await prisma.teamInvitation.findMany({ where: { teamId: team.id } });
+ return {
+ team,
+ permissions,
+ invitations
+ };
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveTeam(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params;
+ const { name } = request.body;
+
+ await prisma.team.update({ where: { id }, data: { name: { set: name } } });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+// export async function deleteUser(request: FastifyRequest, reply: FastifyReply) {
+// try {
+// const userId = request.user.userId;
+// const { id } = request.params;
+
+// const aloneInTeams = await prisma.team.findMany({ where: { users: { every: { id: userId } }, id } });
+// if (aloneInTeams.length > 0) {
+// for (const team of aloneInTeams) {
+// const applications = await prisma.application.findMany({
+// where: { teams: { every: { id: team.id } } }
+// });
+// if (applications.length > 0) {
+// for (const application of applications) {
+// await prisma.application.update({
+// where: { id: application.id },
+// data: { teams: { connect: { id: '0' } } }
+// });
+// }
+// }
+// const services = await prisma.service.findMany({
+// where: { teams: { every: { id: team.id } } }
+// });
+// if (services.length > 0) {
+// for (const service of services) {
+// await prisma.service.update({
+// where: { id: service.id },
+// data: { teams: { connect: { id: '0' } } }
+// });
+// }
+// }
+// const databases = await prisma.database.findMany({
+// where: { teams: { every: { id: team.id } } }
+// });
+// if (databases.length > 0) {
+// for (const database of databases) {
+// await prisma.database.update({
+// where: { id: database.id },
+// data: { teams: { connect: { id: '0' } } }
+// });
+// }
+// }
+// const sources = await prisma.gitSource.findMany({
+// where: { teams: { every: { id: team.id } } }
+// });
+// if (sources.length > 0) {
+// for (const source of sources) {
+// await prisma.gitSource.update({
+// where: { id: source.id },
+// data: { teams: { connect: { id: '0' } } }
+// });
+// }
+// }
+// const destinations = await prisma.destinationDocker.findMany({
+// where: { teams: { every: { id: team.id } } }
+// });
+// if (destinations.length > 0) {
+// for (const destination of destinations) {
+// await prisma.destinationDocker.update({
+// where: { id: destination.id },
+// data: { teams: { connect: { id: '0' } } }
+// });
+// }
+// }
+// await prisma.teamInvitation.deleteMany({ where: { teamId: team.id } });
+// await prisma.permission.deleteMany({ where: { teamId: team.id } });
+// await prisma.user.delete({ where: { id: userId } });
+// await prisma.team.delete({ where: { id: team.id } });
+
+// }
+// }
+
+// const notAloneInTeams = await prisma.team.findMany({ where: { users: { some: { id: userId } } } });
+// if (notAloneInTeams.length > 0) {
+// for (const team of notAloneInTeams) {
+// await prisma.team.update({
+// where: { id: team.id },
+// data: { users: { disconnect: { id } } }
+// });
+// }
+// }
+
+// return reply.code(201).send()
+// } catch (error) {
+// console.log(error)
+// throw { status: 500, message: error }
+// }
+// }
+
+export async function inviteToTeam(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const userId = request.user.userId;
+ const { email, permission, teamId, teamName } = request.body;
+ const userFound = await prisma.user.findUnique({ where: { email } });
+ if (!userFound) {
+ throw `No user found with '${email}' email address.`
+ }
+ const uid = userFound.id;
+ if (uid === userId) {
+ throw `Invitation to yourself? Whaaaaat?`
+ }
+ const alreadyInTeam = await prisma.team.findFirst({
+ where: { id: teamId, users: { some: { id: uid } } }
+ });
+ if (alreadyInTeam) {
+ throw {
+ message: `Already in the team.`
+ };
+ }
+ const invitationFound = await prisma.teamInvitation.findFirst({ where: { uid, teamId } });
+ if (invitationFound) {
+ if (day().toDate() < day(invitationFound.createdAt).add(1, 'day').toDate()) {
+ throw 'Invitiation already pending on user confirmation.'
+ } else {
+ await prisma.teamInvitation.delete({ where: { id: invitationFound.id } });
+ await prisma.teamInvitation.create({
+ data: { email, uid, teamId, teamName, permission }
+ });
+ return reply.code(201).send({ message: 'Invitiation sent.' })
+ }
+ } else {
+ await prisma.teamInvitation.create({
+ data: { email, uid, teamId, teamName, permission }
+ });
+ return reply.code(201).send({ message: 'Invitiation sent.' })
+
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function acceptInvitation(request: FastifyRequest) {
+ try {
+ const userId = request.user.userId;
+ const { id } = request.body;
+ const invitation = await prisma.teamInvitation.findFirst({
+ where: { uid: userId },
+ rejectOnNotFound: true
+ });
+ await prisma.team.update({
+ where: { id: invitation.teamId },
+ data: { users: { connect: { id: userId } } }
+ });
+ await prisma.permission.create({
+ data: {
+ user: { connect: { id: userId } },
+ permission: invitation.permission,
+ team: { connect: { id: invitation.teamId } }
+ }
+ });
+ await prisma.teamInvitation.delete({ where: { id } });
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function revokeInvitation(request: FastifyRequest) {
+ try {
+ const { id } = request.body
+ await prisma.teamInvitation.delete({ where: { id } });
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function removeUser(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { uid } = request.body;
+ const user = await prisma.user.findUnique({ where: { id: uid }, include: { teams: true, permission: true } });
+ if (user) {
+ const permissions = user.permission;
+ if (permissions.length > 0) {
+ for (const permission of permissions) {
+ await prisma.permission.deleteMany({ where: { id: permission.id, userId: uid } });
+ }
+ }
+ const teams = user.teams;
+ if (teams.length > 0) {
+ for (const team of teams) {
+ const newTeam = await prisma.team.update({
+ where: { id: team.id },
+ data: { users: { disconnect: { id: uid } } },
+ include: { applications: true, database: true, gitHubApps: true, gitLabApps: true, gitSources: true, destinationDocker: true, service: true, users: true }
+ });
+ if (newTeam.users.length === 0) {
+ if (newTeam.applications.length > 0) {
+ for (const application of newTeam.applications) {
+ await prisma.application.update({
+ where: { id: application.id },
+ data: { teams: { disconnect: { id: team.id }, connect: { id: '0' } } }
+ });
+ }
+ }
+ if (newTeam.database.length > 0) {
+ for (const database of newTeam.database) {
+ await prisma.database.update({
+ where: { id: database.id },
+ data: { teams: { disconnect: { id: team.id }, connect: { id: '0' } } }
+ });
+ }
+ }
+ if (newTeam.service.length > 0) {
+ for (const service of newTeam.service) {
+ await prisma.service.update({
+ where: { id: service.id },
+ data: { teams: { disconnect: { id: team.id }, connect: { id: '0' } } }
+ });
+ }
+ }
+ if (newTeam.gitHubApps.length > 0) {
+ for (const gitHubApp of newTeam.gitHubApps) {
+ await prisma.githubApp.update({
+ where: { id: gitHubApp.id },
+ data: { teams: { disconnect: { id: team.id }, connect: { id: '0' } } }
+ });
+ }
+ }
+ if (newTeam.gitLabApps.length > 0) {
+ for (const gitLabApp of newTeam.gitLabApps) {
+ await prisma.gitlabApp.update({
+ where: { id: gitLabApp.id },
+ data: { teams: { disconnect: { id: team.id }, connect: { id: '0' } } }
+ });
+ }
+ }
+ if (newTeam.gitSources.length > 0) {
+ for (const gitSource of newTeam.gitSources) {
+ await prisma.gitSource.update({
+ where: { id: gitSource.id },
+ data: { teams: { disconnect: { id: team.id }, connect: { id: '0' } } }
+ });
+ }
+ }
+ if (newTeam.destinationDocker.length > 0) {
+ for (const destinationDocker of newTeam.destinationDocker) {
+ await prisma.destinationDocker.update({
+ where: { id: destinationDocker.id },
+ data: { teams: { disconnect: { id: team.id }, connect: { id: '0' } } }
+ });
+ }
+ }
+ await prisma.team.delete({ where: { id: team.id } });
+ }
+ }
+ }
+ }
+ await prisma.user.delete({ where: { id: uid } });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function setPermission(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { userId, newPermission, permissionId } = request.body;
+ await prisma.permission.updateMany({
+ where: { id: permissionId, userId },
+ data: { permission: { set: newPermission } }
+ });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function changePassword(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.body;
+ await prisma.user.update({ where: { id: undefined }, data: { password: 'RESETME' } });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
\ No newline at end of file
diff --git a/apps/api/src/routes/api/v1/iam/index.ts b/apps/api/src/routes/api/v1/iam/index.ts
new file mode 100644
index 0000000000..d82c398787
--- /dev/null
+++ b/apps/api/src/routes/api/v1/iam/index.ts
@@ -0,0 +1,29 @@
+import { FastifyPluginAsync } from 'fastify';
+import { acceptInvitation, changePassword, deleteTeam, getTeam, inviteToTeam, listTeams, newTeam, removeUser, revokeInvitation, saveTeam, setPermission } from './handlers';
+
+
+const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
+ fastify.addHook('onRequest', async (request, reply) => {
+ return await request.jwtVerify()
+ })
+ fastify.get('/', async (request) => await listTeams(request));
+ fastify.post('/new', async (request, reply) => await newTeam(request, reply));
+
+ fastify.get('/team/:id', async (request, reply) => await getTeam(request, reply));
+ fastify.post('/team/:id', async (request, reply) => await saveTeam(request, reply));
+ fastify.delete('/team/:id', async (request, reply) => await deleteTeam(request, reply));
+
+ fastify.post('/team/:id/invitation/invite', async (request, reply) => await inviteToTeam(request, reply))
+ fastify.post('/team/:id/invitation/accept', async (request) => await acceptInvitation(request));
+ fastify.post('/team/:id/invitation/revoke', async (request) => await revokeInvitation(request));
+
+
+ fastify.post('/team/:id/permission', async (request, reply) => await setPermission(request, reply));
+
+ fastify.delete('/user/remove', async (request, reply) => await removeUser(request, reply));
+ fastify.post('/user/password', async (request, reply) => await changePassword(request, reply));
+ // fastify.delete('/user', async (request, reply) => await deleteUser(request, reply));
+
+};
+
+export default root;
diff --git a/apps/api/src/routes/api/v1/index.ts b/apps/api/src/routes/api/v1/index.ts
new file mode 100644
index 0000000000..c8438cffe0
--- /dev/null
+++ b/apps/api/src/routes/api/v1/index.ts
@@ -0,0 +1,51 @@
+import { FastifyPluginAsync } from 'fastify';
+import { scheduler } from '../../../lib/scheduler';
+import { checkUpdate, login, showDashboard, update, showUsage, getCurrentUser } from './handlers';
+
+export interface Update {
+ Body: { latestVersion: string }
+}
+export interface Login {
+ Body: { email: string, password: string, isLogin: boolean }
+}
+
+const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
+ fastify.get('/', async function (_request, reply) {
+ return reply.redirect(302, '/');
+ });
+ fastify.post<Login>('/login', async (request, reply) => {
+ const payload = await login(request, reply)
+ const token = fastify.jwt.sign(payload)
+ return { token, payload }
+ });
+
+ fastify.get('/user', {
+ onRequest: [fastify.authenticate]
+ }, async (request) => await getCurrentUser(request, fastify));
+
+ fastify.get('/undead', {
+ onRequest: [fastify.authenticate]
+ }, async function () {
+ return { message: 'nope' };
+ });
+
+ fastify.get('/update', {
+ onRequest: [fastify.authenticate]
+ }, async (request) => await checkUpdate(request));
+
+ fastify.post<Update>(
+ '/update', {
+ onRequest: [fastify.authenticate]
+ },
+ async (request) => await update(request)
+ );
+ fastify.get('/resources', {
+ onRequest: [fastify.authenticate]
+ }, async (request) => await showDashboard(request));
+
+ fastify.get('/usage', {
+ onRequest: [fastify.authenticate]
+ }, async () => await showUsage());
+};
+
+export default root;
diff --git a/apps/api/src/routes/api/v1/services/handlers.ts b/apps/api/src/routes/api/v1/services/handlers.ts
new file mode 100644
index 0000000000..832e2b630d
--- /dev/null
+++ b/apps/api/src/routes/api/v1/services/handlers.ts
@@ -0,0 +1,2417 @@
+import type { FastifyReply, FastifyRequest } from 'fastify';
+import fs from 'fs/promises';
+import yaml from 'js-yaml';
+import bcrypt from 'bcryptjs';
+import { prisma, uniqueName, asyncExecShell, getServiceImage, getServiceImages, configureServiceType, getServiceFromDB, getContainerUsage, removeService, isDomainConfigured, saveUpdateableFields, fixType, decrypt, encrypt, getServiceMainPort, createDirectories, ComposeFile, makeLabelForServices, getFreePort, getDomain, errorHandler, supportedServiceTypesAndVersions } from '../../../../lib/common';
+import { day } from '../../../../lib/dayjs';
+import { checkContainer, dockerInstance, getEngine, removeContainer } from '../../../../lib/docker';
+
+export async function listServices(request: FastifyRequest) {
+ try {
+ const userId = request.user.userId;
+ const teamId = request.user.teamId;
+ let services = []
+ if (teamId === '0') {
+ services = await prisma.service.findMany({ include: { teams: true } });
+ } else {
+ services = await prisma.service.findMany({
+ where: { teams: { some: { id: teamId } } },
+ include: { teams: true }
+ });
+ }
+ return {
+ services
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function newService(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const teamId = request.user.teamId;
+ const name = uniqueName();
+
+ const { id } = await prisma.service.create({ data: { name, teams: { connect: { id: teamId } } } });
+ return reply.status(201).send({ id });
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getService(request: FastifyRequest) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ const service = await getServiceFromDB({ id, teamId });
+
+ if (!service) {
+ throw { status: 404, message: 'Service not found.' }
+ }
+
+ const { destinationDockerId, destinationDocker, type, version, settings } = service;
+ let isRunning = false;
+ if (destinationDockerId) {
+ const host = getEngine(destinationDocker.engine);
+ const docker = dockerInstance({ destinationDocker });
+ const baseImage = getServiceImage(type);
+ const images = getServiceImages(type);
+ docker.engine.pull(`${baseImage}:${version}`);
+ if (images?.length > 0) {
+ for (const image of images) {
+ docker.engine.pull(`${image}:latest`);
+ }
+ }
+ try {
+ const { stdout } = await asyncExecShell(
+ `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`
+ );
+
+ if (JSON.parse(stdout).Running) {
+ isRunning = true;
+ }
+ } catch (error) {
+ //
+ }
+ }
+ return {
+ isRunning,
+ service,
+ settings
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getServiceType(request: FastifyRequest) {
+ try {
+ return {
+ types: supportedServiceTypesAndVersions
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveServiceType(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ const { type } = request.body;
+ await configureServiceType({ id, type });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getServiceVersions(request: FastifyRequest) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ const { type } = await getServiceFromDB({ id, teamId });
+ return {
+ type,
+ versions: supportedServiceTypesAndVersions.find((name) => name.name === type).versions
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveServiceVersion(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ const { version } = request.body;
+ await prisma.service.update({
+ where: { id },
+ data: { version }
+ });
+ return reply.code(201).send({})
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveServiceDestination(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ const { destinationId } = request.body;
+ await prisma.service.update({
+ where: { id },
+ data: { destinationDocker: { connect: { id: destinationId } } }
+ });
+ return reply.code(201).send({})
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getServiceUsage(request: FastifyRequest) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ let usage = {};
+
+ const service = await getServiceFromDB({ id, teamId });
+ if (service.destinationDockerId) {
+ [usage] = await Promise.all([getContainerUsage(service.destinationDocker.engine, id)]);
+ }
+ return {
+ usage
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+
+}
+export async function getServiceLogs(request: FastifyRequest) {
+ try {
+ const teamId = request.user.teamId;
+ const { id } = request.params;
+ let { since = 0 } = request.query
+ if (since !== 0) {
+ since = day(since).unix();
+ }
+ const { destinationDockerId, destinationDocker } = await prisma.service.findUnique({
+ where: { id },
+ include: { destinationDocker: true }
+ });
+ if (destinationDockerId) {
+ const docker = dockerInstance({ destinationDocker });
+ try {
+ const container = await docker.engine.getContainer(id);
+ if (container) {
+ const { default: ansi } = await import('strip-ansi')
+ const logs = (
+ await container.logs({
+ stdout: true,
+ stderr: true,
+ timestamps: true,
+ since,
+ tail: 5000
+ })
+ )
+ .toString()
+ .split('\n')
+ .map((l) => ansi(l.slice(8)))
+ .filter((a) => a);
+ return {
+ logs
+ };
+ }
+ } catch (error) {
+ const { statusCode } = error;
+ if (statusCode === 404) {
+ return {
+ logs: []
+ };
+ }
+ }
+ }
+ return {
+ message: 'No logs found.'
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function deleteService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ await removeService({ id });
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveServiceSettings(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params;
+ const { dualCerts } = request.body;
+ await prisma.service.update({
+ where: { id },
+ data: { dualCerts }
+ });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function checkService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ let { fqdn, exposePort, otherFqdns } = request.body;
+ if (fqdn) fqdn = fqdn.toLowerCase();
+ if (otherFqdns && otherFqdns.length > 0) otherFqdns = otherFqdns.map((f) => f.toLowerCase());
+ if (exposePort) exposePort = Number(exposePort);
+ let found = await isDomainConfigured({ id, fqdn });
+ if (found) {
+ throw `Domain already configured.`
+ }
+ if (otherFqdns && otherFqdns.length > 0) {
+ for (const ofqdn of otherFqdns) {
+ found = await isDomainConfigured({ id, fqdn: ofqdn, checkOwn: true });
+ if (found) {
+ throw "Domain already configured."
+ }
+ }
+ }
+ if (exposePort) {
+ const { default: getPort } = await import('get-port');
+ exposePort = Number(exposePort);
+
+ if (exposePort < 1024 || exposePort > 65535) {
+ throw `Exposed Port needs to be between 1024 and 65535.`
+ }
+
+ const publicPort = await getPort({ port: exposePort });
+ if (publicPort !== exposePort) {
+ throw `Port ${exposePort} is already in use.`
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveService(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params;
+ let { name, fqdn, exposePort, type } = request.body;
+
+ if (fqdn) fqdn = fqdn.toLowerCase();
+ if (exposePort) exposePort = Number(exposePort);
+
+ type = fixType(type)
+
+ const update = saveUpdateableFields(type, request.body[type])
+ const data = {
+ fqdn,
+ name,
+ exposePort,
+ }
+ if (Object.keys(update).length > 0) {
+ data[type] = { update: update }
+ }
+ await prisma.service.update({
+ where: { id }, data
+ });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function getServiceSecrets(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ let secrets = await prisma.serviceSecret.findMany({
+ where: { serviceId: id },
+ orderBy: { createdAt: 'desc' }
+ });
+ secrets = secrets.map((secret) => {
+ secret.value = decrypt(secret.value);
+ return secret;
+ });
+
+ return {
+ secrets
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function saveServiceSecret(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ let { name, value, isBuildSecret, isPRMRSecret, isNew } = request.body
+
+ if (isNew) {
+ const found = await prisma.serviceSecret.findFirst({ where: { name, serviceId: id } });
+ if (found) {
+ throw `Secret ${name} already exists.`
+ } else {
+ value = encrypt(value);
+ await prisma.serviceSecret.create({
+ data: { name, value, service: { connect: { id } } }
+ });
+ }
+ } else {
+ value = encrypt(value);
+ const found = await prisma.serviceSecret.findFirst({ where: { serviceId: id, name } });
+
+ if (found) {
+ await prisma.serviceSecret.updateMany({
+ where: { serviceId: id, name },
+ data: { value }
+ });
+ } else {
+ await prisma.serviceSecret.create({
+ data: { name, value, service: { connect: { id } } }
+ });
+ }
+ }
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function deleteServiceSecret(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const { name } = request.body
+ await prisma.serviceSecret.deleteMany({ where: { serviceId: id, name } });
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function getServiceStorages(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const persistentStorages = await prisma.servicePersistentStorage.findMany({
+ where: { serviceId: id }
+ });
+ return {
+ persistentStorages
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function saveServiceStorage(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { path, newStorage, storageId } = request.body
+
+ if (newStorage) {
+ await prisma.servicePersistentStorage.create({
+ data: { path, service: { connect: { id } } }
+ });
+ } else {
+ await prisma.servicePersistentStorage.update({
+ where: { id: storageId },
+ data: { path }
+ });
+ }
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function deleteServiceStorage(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const { path } = request.body
+ await prisma.servicePersistentStorage.deleteMany({ where: { serviceId: id, path } });
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function startService(request: FastifyRequest,) {
+ try {
+ const { type } = request.params
+ if (type === 'plausibleanalytics') {
+ return await startPlausibleAnalyticsService(request)
+ }
+ if (type === 'nocodb') {
+ return await startNocodbService(request)
+ }
+ if (type === 'minio') {
+ return await startMinioService(request)
+ }
+ if (type === 'vscodeserver') {
+ return await startVscodeService(request)
+ }
+ if (type === 'wordpress') {
+ return await startWordpressService(request)
+ }
+ if (type === 'vaultwarden') {
+ return await startVaultwardenService(request)
+ }
+ if (type === 'languagetool') {
+ return await startLanguageToolService(request)
+ }
+ if (type === 'n8n') {
+ return await startN8nService(request)
+ }
+ if (type === 'uptimekuma') {
+ return await startUptimekumaService(request)
+ }
+ if (type === 'ghost') {
+ return await startGhostService(request)
+ }
+ if (type === 'meilisearch') {
+ return await startMeilisearchService(request)
+ }
+ if (type === 'umami') {
+ return await startUmamiService(request)
+ }
+ if (type === 'hasura') {
+ return await startHasuraService(request)
+ }
+ if (type === 'fider') {
+ return await startFiderService(request)
+ }
+ throw `Service type ${type} not supported.`
+ } catch (error) {
+ throw { status: 500, message: error?.message || error }
+ }
+}
+export async function stopService(request: FastifyRequest) {
+ try {
+ const { type } = request.params
+ if (type === 'plausibleanalytics') {
+ return await stopPlausibleAnalyticsService(request)
+ }
+ if (type === 'nocodb') {
+ return await stopNocodbService(request)
+ }
+ if (type === 'minio') {
+ return await stopMinioService(request)
+ }
+ if (type === 'vscodeserver') {
+ return await stopVscodeService(request)
+ }
+ if (type === 'wordpress') {
+ return await stopWordpressService(request)
+ }
+ if (type === 'vaultwarden') {
+ return await stopVaultwardenService(request)
+ }
+ if (type === 'languagetool') {
+ return await stopLanguageToolService(request)
+ }
+ if (type === 'n8n') {
+ return await stopN8nService(request)
+ }
+ if (type === 'uptimekuma') {
+ return await stopUptimekumaService(request)
+ }
+ if (type === 'ghost') {
+ return await stopGhostService(request)
+ }
+ if (type === 'meilisearch') {
+ return await stopMeilisearchService(request)
+ }
+ if (type === 'umami') {
+ return await stopUmamiService(request)
+ }
+ if (type === 'hasura') {
+ return await stopHasuraService(request)
+ }
+ if (type === 'fider') {
+ return await stopFiderService(request)
+ }
+ throw `Service type ${type} not supported.`
+ } catch (error) {
+ throw { status: 500, message: error?.message || error }
+ }
+}
+export async function setSettingsService(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { type } = request.params
+ if (type === 'wordpress') {
+ return await setWordpressSettings(request, reply)
+ }
+ throw `Service type ${type} not supported.`
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function setWordpressSettings(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { ownMysql } = request.body
+ await prisma.wordpress.update({
+ where: { serviceId: id },
+ data: { ownMysql }
+ });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startPlausibleAnalyticsService(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const {
+ type,
+ version,
+ fqdn,
+ destinationDockerId,
+ destinationDocker,
+ serviceSecret,
+ exposePort,
+ plausibleAnalytics: {
+ id: plausibleDbId,
+ username,
+ email,
+ password,
+ postgresqlDatabase,
+ postgresqlPassword,
+ postgresqlUser,
+ secretKeyBase
+ }
+ } = service;
+ const image = getServiceImage(type);
+
+ const config = {
+ plausibleAnalytics: {
+ image: `${image}:${version}`,
+ environmentVariables: {
+ ADMIN_USER_EMAIL: email,
+ ADMIN_USER_NAME: username,
+ ADMIN_USER_PWD: password,
+ BASE_URL: fqdn,
+ SECRET_KEY_BASE: secretKeyBase,
+ DISABLE_AUTH: 'false',
+ DISABLE_REGISTRATION: 'true',
+ DATABASE_URL: `postgresql://${postgresqlUser}:${postgresqlPassword}@${id}-postgresql:5432/${postgresqlDatabase}`,
+ CLICKHOUSE_DATABASE_URL: `http://${id}-clickhouse:8123/plausible`
+ }
+ },
+ postgresql: {
+ volume: `${plausibleDbId}-postgresql-data:/bitnami/postgresql/`,
+ image: 'bitnami/postgresql:13.2.0',
+ environmentVariables: {
+ POSTGRESQL_PASSWORD: postgresqlPassword,
+ POSTGRESQL_USERNAME: postgresqlUser,
+ POSTGRESQL_DATABASE: postgresqlDatabase
+ }
+ },
+ clickhouse: {
+ volume: `${plausibleDbId}-clickhouse-data:/var/lib/clickhouse`,
+ image: 'yandex/clickhouse-server:21.3.2.5',
+ environmentVariables: {},
+ ulimits: {
+ nofile: {
+ soft: 262144,
+ hard: 262144
+ }
+ }
+ }
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.plausibleAnalytics.environmentVariables[secret.name] = secret.value;
+ });
+ }
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('plausibleanalytics');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+
+ const clickhouseConfigXml = `
+ <yandex>
+ <logger>
+ <level>warning</level>
+ <console>true</console>
+ </logger>
+
+ <!-- Stop all the unnecessary logging -->
+ <query_thread_log remove="remove"/>
+ <query_log remove="remove"/>
+ <text_log remove="remove"/>
+ <trace_log remove="remove"/>
+ <metric_log remove="remove"/>
+ <asynchronous_metric_log remove="remove"/>
+ </yandex>`;
+ const clickhouseUserConfigXml = `
+ <yandex>
+ <profiles>
+ <default>
+ <log_queries>0</log_queries>
+ <log_query_threads>0</log_query_threads>
+ </default>
+ </profiles>
+ </yandex>`;
+
+ const initQuery = 'CREATE DATABASE IF NOT EXISTS plausible;';
+ const initScript = 'clickhouse client --queries-file /docker-entrypoint-initdb.d/init.query';
+ await fs.writeFile(`${workdir}/clickhouse-config.xml`, clickhouseConfigXml);
+ await fs.writeFile(`${workdir}/clickhouse-user-config.xml`, clickhouseUserConfigXml);
+ await fs.writeFile(`${workdir}/init.query`, initQuery);
+ await fs.writeFile(`${workdir}/init-db.sh`, initScript);
+
+ const Dockerfile = `
+FROM ${config.clickhouse.image}
+COPY ./clickhouse-config.xml /etc/clickhouse-server/users.d/logging.xml
+COPY ./clickhouse-user-config.xml /etc/clickhouse-server/config.d/logging.xml
+COPY ./init.query /docker-entrypoint-initdb.d/init.query
+COPY ./init-db.sh /docker-entrypoint-initdb.d/init-db.sh`;
+
+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile);
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.plausibleAnalytics.image,
+ command:
+ 'sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"',
+ networks: [network],
+ environment: config.plausibleAnalytics.environmentVariables,
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ depends_on: [`${id}-postgresql`, `${id}-clickhouse`],
+ labels: makeLabelForServices('plausibleAnalytics'),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '10s',
+ max_attempts: 5,
+ window: '120s'
+ }
+ }
+ },
+ [`${id}-postgresql`]: {
+ container_name: `${id}-postgresql`,
+ image: config.postgresql.image,
+ networks: [network],
+ environment: config.postgresql.environmentVariables,
+ volumes: [config.postgresql.volume],
+ restart: 'always',
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '10s',
+ max_attempts: 5,
+ window: '120s'
+ }
+ }
+ },
+ [`${id}-clickhouse`]: {
+ build: workdir,
+ container_name: `${id}-clickhouse`,
+ networks: [network],
+ environment: config.clickhouse.environmentVariables,
+ volumes: [config.clickhouse.volume],
+ restart: 'always',
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '10s',
+ max_attempts: 5,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.postgresql.volume.split(':')[0]]: {
+ name: config.postgresql.volume.split(':')[0]
+ },
+ [config.clickhouse.volume.split(':')[0]]: {
+ name: config.clickhouse.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(
+ `DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up --build -d`
+ );
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopPlausibleAnalyticsService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+
+ let found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ found = await checkContainer(engine, `${id}-postgresql`);
+ if (found) {
+ await removeContainer({ id: `${id}-postgresql`, engine });
+ }
+ found = await checkContainer(engine, `${id}-clickhouse`);
+ if (found) {
+ await removeContainer({ id: `${id}-clickhouse`, engine });
+ }
+ }
+
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startNocodbService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
+ service;
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('nocodb');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+
+ const config = {
+ image: `${image}:${version}`,
+ volume: `${id}-nc:/usr/app/data`,
+ environmentVariables: {}
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.environmentVariables[secret.name] = secret.value;
+ });
+ }
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.image,
+ networks: [network],
+ volumes: [config.volume],
+ environment: config.environmentVariables,
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ labels: makeLabelForServices('nocodb'),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.volume.split(':')[0]]: {
+ name: config.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopNocodbService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startMinioService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const {
+ type,
+ version,
+ fqdn,
+ destinationDockerId,
+ destinationDocker,
+ exposePort,
+ minio: { rootUser, rootUserPassword },
+ serviceSecret
+ } = service;
+
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('minio');
+
+ const publicPort = await getFreePort();
+
+ const consolePort = 9001;
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+
+ const config = {
+ image: `${image}:${version}`,
+ volume: `${id}-minio-data:/data`,
+ environmentVariables: {
+ MINIO_ROOT_USER: rootUser,
+ MINIO_ROOT_PASSWORD: rootUserPassword,
+ MINIO_BROWSER_REDIRECT_URL: fqdn
+ }
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.environmentVariables[secret.name] = secret.value;
+ });
+ }
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.image,
+ command: `server /data --console-address ":${consolePort}"`,
+ environment: config.environmentVariables,
+ networks: [network],
+ volumes: [config.volume],
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ labels: makeLabelForServices('minio'),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.volume.split(':')[0]]: {
+ name: config.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ await prisma.minio.update({ where: { serviceId: id }, data: { publicPort } });
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopMinioService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ await prisma.minio.update({ where: { serviceId: id }, data: { publicPort: null } })
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startVscodeService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const {
+ type,
+ version,
+ destinationDockerId,
+ destinationDocker,
+ serviceSecret,
+ persistentStorage,
+ exposePort,
+ vscodeserver: { password }
+ } = service;
+
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('vscodeserver');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+
+ const config = {
+ image: `${image}:${version}`,
+ volume: `${id}-vscodeserver-data:/home/coder`,
+ environmentVariables: {
+ PASSWORD: password
+ }
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.environmentVariables[secret.name] = secret.value;
+ });
+ }
+
+ const volumes =
+ persistentStorage?.map((storage) => {
+ return `${id}${storage.path.replace(/\//gi, '-')}:${storage.path}`;
+ }) || [];
+
+ const composeVolumes = volumes.map((volume) => {
+ return {
+ [`${volume.split(':')[0]}`]: {
+ name: volume.split(':')[0]
+ }
+ };
+ });
+ const volumeMounts = Object.assign(
+ {},
+ {
+ [config.volume.split(':')[0]]: {
+ name: config.volume.split(':')[0]
+ }
+ },
+ ...composeVolumes
+ );
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.image,
+ environment: config.environmentVariables,
+ networks: [network],
+ volumes: [config.volume, ...volumes],
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ labels: makeLabelForServices('vscodeServer'),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: volumeMounts
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+
+ const changePermissionOn = persistentStorage.map((p) => p.path);
+ if (changePermissionOn.length > 0) {
+ await asyncExecShell(
+ `DOCKER_HOST=${host} docker exec -u root ${id} chown -R 1000:1000 ${changePermissionOn.join(
+ ' '
+ )}`
+ );
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopVscodeService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startWordpressService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const {
+ type,
+ version,
+ fqdn,
+ destinationDockerId,
+ serviceSecret,
+ destinationDocker,
+ exposePort,
+ wordpress: {
+ mysqlDatabase,
+ mysqlHost,
+ mysqlPort,
+ mysqlUser,
+ mysqlPassword,
+ extraConfig,
+ mysqlRootUser,
+ mysqlRootUserPassword,
+ ownMysql
+ }
+ } = service;
+
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const image = getServiceImage(type);
+ const port = getServiceMainPort('wordpress');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const config = {
+ wordpress: {
+ image: `${image}:${version}`,
+ volume: `${id}-wordpress-data:/var/www/html`,
+ environmentVariables: {
+ WORDPRESS_DB_HOST: ownMysql ? `${mysqlHost}:${mysqlPort}` : `${id}-mysql`,
+ WORDPRESS_DB_USER: mysqlUser,
+ WORDPRESS_DB_PASSWORD: mysqlPassword,
+ WORDPRESS_DB_NAME: mysqlDatabase,
+ WORDPRESS_CONFIG_EXTRA: extraConfig
+ }
+ },
+ mysql: {
+ image: `bitnami/mysql:5.7`,
+ volume: `${id}-mysql-data:/bitnami/mysql/data`,
+ environmentVariables: {
+ MYSQL_ROOT_PASSWORD: mysqlRootUserPassword,
+ MYSQL_ROOT_USER: mysqlRootUser,
+ MYSQL_USER: mysqlUser,
+ MYSQL_PASSWORD: mysqlPassword,
+ MYSQL_DATABASE: mysqlDatabase
+ }
+ }
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.wordpress.environmentVariables[secret.name] = secret.value;
+ });
+ }
+ let composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.wordpress.image,
+ environment: config.wordpress.environmentVariables,
+ volumes: [config.wordpress.volume],
+ networks: [network],
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ labels: makeLabelForServices('wordpress'),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.wordpress.volume.split(':')[0]]: {
+ name: config.wordpress.volume.split(':')[0]
+ }
+ }
+ };
+ if (!ownMysql) {
+ composeFile.services[id].depends_on = [`${id}-mysql`];
+ composeFile.services[`${id}-mysql`] = {
+ container_name: `${id}-mysql`,
+ image: config.mysql.image,
+ volumes: [config.mysql.volume],
+ environment: config.mysql.environmentVariables,
+ networks: [network],
+ restart: 'always',
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ };
+
+ composeFile.volumes[config.mysql.volume.split(':')[0]] = {
+ name: config.mysql.volume.split(':')[0]
+ };
+ }
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopWordpressService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const {
+ destinationDockerId,
+ destinationDocker,
+ wordpress: { ftpEnabled }
+ } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+ try {
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ try {
+ const found = await checkContainer(engine, `${id}-mysql`);
+ if (found) {
+ await removeContainer({ id: `${id}-mysql`, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ try {
+ if (ftpEnabled) {
+ const found = await checkContainer(engine, `${id}-ftp`);
+ if (found) {
+ await removeContainer({ id: `${id}-ftp`, engine });
+ }
+ await prisma.wordpress.update({
+ where: { serviceId: id },
+ data: { ftpEnabled: false }
+ });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startVaultwardenService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
+ service;
+
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('vaultwarden');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+
+ const config = {
+ image: `${image}:${version}`,
+ volume: `${id}-vaultwarden-data:/data/`,
+ environmentVariables: {}
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.environmentVariables[secret.name] = secret.value;
+ });
+ }
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.image,
+ environment: config.environmentVariables,
+ networks: [network],
+ volumes: [config.volume],
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ labels: makeLabelForServices('vaultWarden'),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.volume.split(':')[0]]: {
+ name: config.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopVaultwardenService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+
+ try {
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startLanguageToolService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
+ service;
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('languagetool');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+
+ const config = {
+ image: `${image}:${version}`,
+ volume: `${id}-ngrams:/ngrams`,
+ environmentVariables: {}
+ };
+
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.environmentVariables[secret.name] = secret.value;
+ });
+ }
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.image,
+ networks: [network],
+ environment: config.environmentVariables,
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ volumes: [config.volume],
+ labels: makeLabelForServices('languagetool'),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.volume.split(':')[0]]: {
+ name: config.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopLanguageToolService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+
+ try {
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startN8nService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
+ service;
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('n8n');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+
+ const config = {
+ image: `${image}:${version}`,
+ volume: `${id}-n8n:/root/.n8n`,
+ environmentVariables: {
+ WEBHOOK_URL: `${service.fqdn}`
+ }
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.environmentVariables[secret.name] = secret.value;
+ });
+ }
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.image,
+ networks: [network],
+ volumes: [config.volume],
+ environment: config.environmentVariables,
+ restart: 'always',
+ labels: makeLabelForServices('n8n'),
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.volume.split(':')[0]]: {
+ name: config.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopN8nService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+
+ try {
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startUptimekumaService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
+ service;
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('uptimekuma');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+
+ const config = {
+ image: `${image}:${version}`,
+ volume: `${id}-uptimekuma:/app/data`,
+ environmentVariables: {}
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.environmentVariables[secret.name] = secret.value;
+ });
+ }
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.image,
+ networks: [network],
+ volumes: [config.volume],
+ environment: config.environmentVariables,
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ labels: makeLabelForServices('uptimekuma'),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.volume.split(':')[0]]: {
+ name: config.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopUptimekumaService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+
+ try {
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startGhostService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const {
+ type,
+ version,
+ destinationDockerId,
+ destinationDocker,
+ serviceSecret,
+ exposePort,
+ fqdn,
+ ghost: {
+ defaultEmail,
+ defaultPassword,
+ mariadbRootUser,
+ mariadbRootUserPassword,
+ mariadbDatabase,
+ mariadbPassword,
+ mariadbUser
+ }
+ } = service;
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+ const domain = getDomain(fqdn);
+ const isHttps = fqdn.startsWith('https://');
+ const config = {
+ ghost: {
+ image: `${image}:${version}`,
+ volume: `${id}-ghost:/bitnami/ghost`,
+ environmentVariables: {
+ url: fqdn,
+ GHOST_HOST: domain,
+ GHOST_ENABLE_HTTPS: isHttps ? 'yes' : 'no',
+ GHOST_EMAIL: defaultEmail,
+ GHOST_PASSWORD: defaultPassword,
+ GHOST_DATABASE_HOST: `${id}-mariadb`,
+ GHOST_DATABASE_USER: mariadbUser,
+ GHOST_DATABASE_PASSWORD: mariadbPassword,
+ GHOST_DATABASE_NAME: mariadbDatabase,
+ GHOST_DATABASE_PORT_NUMBER: 3306
+ }
+ },
+ mariadb: {
+ image: `bitnami/mariadb:latest`,
+ volume: `${id}-mariadb:/bitnami/mariadb`,
+ environmentVariables: {
+ MARIADB_USER: mariadbUser,
+ MARIADB_PASSWORD: mariadbPassword,
+ MARIADB_DATABASE: mariadbDatabase,
+ MARIADB_ROOT_USER: mariadbRootUser,
+ MARIADB_ROOT_PASSWORD: mariadbRootUserPassword
+ }
+ }
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.ghost.environmentVariables[secret.name] = secret.value;
+ });
+ }
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.ghost.image,
+ networks: [network],
+ volumes: [config.ghost.volume],
+ environment: config.ghost.environmentVariables,
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ labels: makeLabelForServices('ghost'),
+ depends_on: [`${id}-mariadb`],
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ },
+ [`${id}-mariadb`]: {
+ container_name: `${id}-mariadb`,
+ image: config.mariadb.image,
+ networks: [network],
+ volumes: [config.mariadb.volume],
+ environment: config.mariadb.environmentVariables,
+ restart: 'always',
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.ghost.volume.split(':')[0]]: {
+ name: config.ghost.volume.split(':')[0]
+ },
+ [config.mariadb.volume.split(':')[0]]: {
+ name: config.mariadb.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopGhostService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+
+ try {
+ let found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ found = await checkContainer(engine, `${id}-mariadb`);
+ if (found) {
+ await removeContainer({ id: `${id}-mariadb`, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startMeilisearchService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const {
+ meiliSearch: { masterKey }
+ } = service;
+ const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
+ service;
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('meilisearch');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+
+ const config = {
+ image: `${image}:${version}`,
+ volume: `${id}-datams:/data.ms`,
+ environmentVariables: {
+ MEILI_MASTER_KEY: masterKey
+ }
+ };
+
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.environmentVariables[secret.name] = secret.value;
+ });
+ }
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.image,
+ networks: [network],
+ environment: config.environmentVariables,
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ volumes: [config.volume],
+ labels: makeLabelForServices('meilisearch'),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.volume.split(':')[0]]: {
+ name: config.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopMeilisearchService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+
+ try {
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startUmamiService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const {
+ type,
+ version,
+ destinationDockerId,
+ destinationDocker,
+ serviceSecret,
+ exposePort,
+ umami: {
+ umamiAdminPassword,
+ postgresqlUser,
+ postgresqlPassword,
+ postgresqlDatabase,
+ hashSalt
+ }
+ } = service;
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('umami');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+
+ const config = {
+ umami: {
+ image: `${image}:${version}`,
+ environmentVariables: {
+ DATABASE_URL: `postgresql://${postgresqlUser}:${postgresqlPassword}@${id}-postgresql:5432/${postgresqlDatabase}`,
+ DATABASE_TYPE: 'postgresql',
+ HASH_SALT: hashSalt
+ }
+ },
+ postgresql: {
+ image: 'postgres:12-alpine',
+ volume: `${id}-postgresql-data:/var/lib/postgresql/data`,
+ environmentVariables: {
+ POSTGRES_USER: postgresqlUser,
+ POSTGRES_PASSWORD: postgresqlPassword,
+ POSTGRES_DB: postgresqlDatabase
+ }
+ }
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.umami.environmentVariables[secret.name] = secret.value;
+ });
+ }
+
+ const initDbSQL = `
+ drop table if exists event;
+ drop table if exists pageview;
+ drop table if exists session;
+ drop table if exists website;
+ drop table if exists account;
+
+ create table account (
+ user_id serial primary key,
+ username varchar(255) unique not null,
+ password varchar(60) not null,
+ is_admin bool not null default false,
+ created_at timestamp with time zone default current_timestamp,
+ updated_at timestamp with time zone default current_timestamp
+ );
+
+ create table website (
+ website_id serial primary key,
+ website_uuid uuid unique not null,
+ user_id int not null references account(user_id) on delete cascade,
+ name varchar(100) not null,
+ domain varchar(500),
+ share_id varchar(64) unique,
+ created_at timestamp with time zone default current_timestamp
+ );
+
+ create table session (
+ session_id serial primary key,
+ session_uuid uuid unique not null,
+ website_id int not null references website(website_id) on delete cascade,
+ created_at timestamp with time zone default current_timestamp,
+ hostname varchar(100),
+ browser varchar(20),
+ os varchar(20),
+ device varchar(20),
+ screen varchar(11),
+ language varchar(35),
+ country char(2)
+ );
+
+ create table pageview (
+ view_id serial primary key,
+ website_id int not null references website(website_id) on delete cascade,
+ session_id int not null references session(session_id) on delete cascade,
+ created_at timestamp with time zone default current_timestamp,
+ url varchar(500) not null,
+ referrer varchar(500)
+ );
+
+ create table event (
+ event_id serial primary key,
+ website_id int not null references website(website_id) on delete cascade,
+ session_id int not null references session(session_id) on delete cascade,
+ created_at timestamp with time zone default current_timestamp,
+ url varchar(500) not null,
+ event_type varchar(50) not null,
+ event_value varchar(50) not null
+ );
+
+ create index website_user_id_idx on website(user_id);
+
+ create index session_created_at_idx on session(created_at);
+ create index session_website_id_idx on session(website_id);
+
+ create index pageview_created_at_idx on pageview(created_at);
+ create index pageview_website_id_idx on pageview(website_id);
+ create index pageview_session_id_idx on pageview(session_id);
+ create index pageview_website_id_created_at_idx on pageview(website_id, created_at);
+ create index pageview_website_id_session_id_created_at_idx on pageview(website_id, session_id, created_at);
+
+ create index event_created_at_idx on event(created_at);
+ create index event_website_id_idx on event(website_id);
+ create index event_session_id_idx on event(session_id);
+
+ insert into account (username, password, is_admin) values ('admin', '${bcrypt.hashSync(
+ umamiAdminPassword,
+ 10
+ )}', true);`;
+ await fs.writeFile(`${workdir}/schema.postgresql.sql`, initDbSQL);
+ const Dockerfile = `
+ FROM ${config.postgresql.image}
+ COPY ./schema.postgresql.sql /docker-entrypoint-initdb.d/schema.postgresql.sql`;
+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile);
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.umami.image,
+ environment: config.umami.environmentVariables,
+ networks: [network],
+ volumes: [],
+ restart: 'always',
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ labels: makeLabelForServices('umami'),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ },
+ depends_on: [`${id}-postgresql`]
+ },
+ [`${id}-postgresql`]: {
+ build: workdir,
+ container_name: `${id}-postgresql`,
+ environment: config.postgresql.environmentVariables,
+ networks: [network],
+ volumes: [config.postgresql.volume],
+ restart: 'always',
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.postgresql.volume.split(':')[0]]: {
+ name: config.postgresql.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopUmamiService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+
+ try {
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ try {
+ const found = await checkContainer(engine, `${id}-postgresql`);
+ if (found) {
+ await removeContainer({ id: `${id}-postgresql`, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startHasuraService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const {
+ type,
+ version,
+ destinationDockerId,
+ destinationDocker,
+ serviceSecret,
+ exposePort,
+ hasura: { postgresqlUser, postgresqlPassword, postgresqlDatabase }
+ } = service;
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('hasura');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+
+ const config = {
+ hasura: {
+ image: `${image}:${version}`,
+ environmentVariables: {
+ HASURA_GRAPHQL_METADATA_DATABASE_URL: `postgresql://${postgresqlUser}:${postgresqlPassword}@${id}-postgresql:5432/${postgresqlDatabase}`
+ }
+ },
+ postgresql: {
+ image: 'postgres:12-alpine',
+ volume: `${id}-postgresql-data:/var/lib/postgresql/data`,
+ environmentVariables: {
+ POSTGRES_USER: postgresqlUser,
+ POSTGRES_PASSWORD: postgresqlPassword,
+ POSTGRES_DB: postgresqlDatabase
+ }
+ }
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.hasura.environmentVariables[secret.name] = secret.value;
+ });
+ }
+
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.hasura.image,
+ environment: config.hasura.environmentVariables,
+ networks: [network],
+ volumes: [],
+ restart: 'always',
+ labels: makeLabelForServices('hasura'),
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ },
+ depends_on: [`${id}-postgresql`]
+ },
+ [`${id}-postgresql`]: {
+ image: config.postgresql.image,
+ container_name: `${id}-postgresql`,
+ environment: config.postgresql.environmentVariables,
+ networks: [network],
+ volumes: [config.postgresql.volume],
+ restart: 'always',
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.postgresql.volume.split(':')[0]]: {
+ name: config.postgresql.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopHasuraService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+
+ try {
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ try {
+ const found = await checkContainer(engine, `${id}-postgresql`);
+ if (found) {
+ await removeContainer({ id: `${id}-postgresql`, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+async function startFiderService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const {
+ type,
+ version,
+ fqdn,
+ destinationDockerId,
+ destinationDocker,
+ serviceSecret,
+ exposePort,
+ fider: {
+ postgresqlUser,
+ postgresqlPassword,
+ postgresqlDatabase,
+ jwtSecret,
+ emailNoreply,
+ emailMailgunApiKey,
+ emailMailgunDomain,
+ emailMailgunRegion,
+ emailSmtpHost,
+ emailSmtpPort,
+ emailSmtpUser,
+ emailSmtpPassword,
+ emailSmtpEnableStartTls
+ }
+ } = service;
+ const network = destinationDockerId && destinationDocker.network;
+ const host = getEngine(destinationDocker.engine);
+ const port = getServiceMainPort('fider');
+
+ const { workdir } = await createDirectories({ repository: type, buildId: id });
+ const image = getServiceImage(type);
+ const domain = getDomain(fqdn);
+ const config = {
+ fider: {
+ image: `${image}:${version}`,
+ environmentVariables: {
+ BASE_URL: domain,
+ DATABASE_URL: `postgresql://${postgresqlUser}:${postgresqlPassword}@${id}-postgresql:5432/${postgresqlDatabase}?sslmode=disable`,
+ JWT_SECRET: `${jwtSecret.replace(/\$/g, '$$$')}`,
+ EMAIL_NOREPLY: emailNoreply,
+ EMAIL_MAILGUN_API: emailMailgunApiKey,
+ EMAIL_MAILGUN_REGION: emailMailgunRegion,
+ EMAIL_MAILGUN_DOMAIN: emailMailgunDomain,
+ EMAIL_SMTP_HOST: emailSmtpHost,
+ EMAIL_SMTP_PORT: emailSmtpPort,
+ EMAIL_SMTP_USER: emailSmtpUser,
+ EMAIL_SMTP_PASSWORD: emailSmtpPassword,
+ EMAIL_SMTP_ENABLE_STARTTLS: emailSmtpEnableStartTls
+ }
+ },
+ postgresql: {
+ image: 'postgres:12-alpine',
+ volume: `${id}-postgresql-data:/var/lib/postgresql/data`,
+ environmentVariables: {
+ POSTGRES_USER: postgresqlUser,
+ POSTGRES_PASSWORD: postgresqlPassword,
+ POSTGRES_DB: postgresqlDatabase
+ }
+ }
+ };
+ if (serviceSecret.length > 0) {
+ serviceSecret.forEach((secret) => {
+ config.fider.environmentVariables[secret.name] = secret.value;
+ });
+ }
+
+ const composeFile: ComposeFile = {
+ version: '3.8',
+ services: {
+ [id]: {
+ container_name: id,
+ image: config.fider.image,
+ environment: config.fider.environmentVariables,
+ networks: [network],
+ volumes: [],
+ restart: 'always',
+ labels: makeLabelForServices('fider'),
+ ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ },
+ depends_on: [`${id}-postgresql`]
+ },
+ [`${id}-postgresql`]: {
+ image: config.postgresql.image,
+ container_name: `${id}-postgresql`,
+ environment: config.postgresql.environmentVariables,
+ networks: [network],
+ volumes: [config.postgresql.volume],
+ restart: 'always',
+ deploy: {
+ restart_policy: {
+ condition: 'on-failure',
+ delay: '5s',
+ max_attempts: 3,
+ window: '120s'
+ }
+ }
+ }
+ },
+ networks: {
+ [network]: {
+ external: true
+ }
+ },
+ volumes: {
+ [config.postgresql.volume.split(':')[0]]: {
+ name: config.postgresql.volume.split(':')[0]
+ }
+ }
+ };
+ const composeFileDestination = `${workdir}/docker-compose.yaml`;
+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
+
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
+
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+async function stopFiderService(request: FastifyRequest) {
+ try {
+ const { id } = request.params;
+ const teamId = request.user.teamId;
+ const service = await getServiceFromDB({ id, teamId });
+ const { destinationDockerId, destinationDocker, fqdn } = service;
+ if (destinationDockerId) {
+ const engine = destinationDocker.engine;
+
+ try {
+ const found = await checkContainer(engine, id);
+ if (found) {
+ await removeContainer({ id, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ try {
+ const found = await checkContainer(engine, `${id}-postgresql`);
+ if (found) {
+ await removeContainer({ id: `${id}-postgresql`, engine });
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function activatePlausibleUsers(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const teamId = request.user.teamId;
+ const {
+ destinationDockerId,
+ destinationDocker,
+ plausibleAnalytics: { postgresqlUser, postgresqlPassword, postgresqlDatabase }
+ } = await getServiceFromDB({ id, teamId });
+ if (destinationDockerId) {
+ const docker = dockerInstance({ destinationDocker });
+ const container = await docker.engine.getContainer(id);
+ const command = await container.exec({
+ Cmd: [
+ `psql -H postgresql://${postgresqlUser}:${postgresqlPassword}@localhost:5432/${postgresqlDatabase} -c "UPDATE users SET email_verified = true;"`
+ ]
+ });
+ await command.start();
+ return await reply.code(201).send()
+ }
+ throw { status: 500, message: 'Could not activate users.' }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
\ No newline at end of file
diff --git a/apps/api/src/routes/api/v1/services/index.ts b/apps/api/src/routes/api/v1/services/index.ts
new file mode 100644
index 0000000000..2a6d8dff7e
--- /dev/null
+++ b/apps/api/src/routes/api/v1/services/index.ts
@@ -0,0 +1,70 @@
+import { FastifyPluginAsync } from 'fastify';
+import {
+ activatePlausibleUsers,
+ checkService,
+ deleteService,
+ deleteServiceSecret,
+ deleteServiceStorage,
+ getService,
+ getServiceLogs,
+ getServiceSecrets,
+ getServiceStorages,
+ getServiceType,
+ getServiceUsage,
+ getServiceVersions,
+ listServices,
+ newService,
+ saveService,
+ saveServiceDestination,
+ saveServiceSecret,
+ saveServiceSettings,
+ saveServiceStorage,
+ saveServiceType,
+ saveServiceVersion,
+ setSettingsService,
+ startService,
+ stopService
+} from './handlers';
+
+const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
+ fastify.addHook('onRequest', async (request, reply) => {
+ return await request.jwtVerify()
+ })
+ fastify.get('/', async (request) => await listServices(request));
+ fastify.post('/new', async (request, reply) => await newService(request, reply));
+
+ fastify.get('/:id', async (request) => await getService(request));
+ fastify.post('/:id', async (request, reply) => await saveService(request, reply));
+ fastify.delete('/:id', async (request) => await deleteService(request));
+
+ fastify.post('/:id/check', async (request) => await checkService(request));
+
+ fastify.post('/:id/settings', async (request, reply) => await saveServiceSettings(request, reply));
+
+ fastify.get('/:id/secrets', async (request) => await getServiceSecrets(request));
+ fastify.post('/:id/secrets', async (request, reply) => await saveServiceSecret(request, reply));
+ fastify.delete('/:id/secrets', async (request) => await deleteServiceSecret(request));
+
+ fastify.get('/:id/storages', async (request) => await getServiceStorages(request));
+ fastify.post('/:id/storages', async (request, reply) => await saveServiceStorage(request, reply));
+ fastify.delete('/:id/storages', async (request) => await deleteServiceStorage(request));
+
+ fastify.get('/:id/configuration/type', async (request) => await getServiceType(request));
+ fastify.post('/:id/configuration/type', async (request, reply) => await saveServiceType(request, reply));
+
+ fastify.get('/:id/configuration/version', async (request) => await getServiceVersions(request));
+ fastify.post('/:id/configuration/version', async (request, reply) => await saveServiceVersion(request, reply));
+
+ fastify.post('/:id/configuration/destination', async (request, reply) => await saveServiceDestination(request, reply));
+
+ fastify.get('/:id/usage', async (request) => await getServiceUsage(request));
+ fastify.get('/:id/logs', async (request) => await getServiceLogs(request));
+
+ fastify.post('/:id/:type/start', async (request) => await startService(request));
+ fastify.post('/:id/:type/stop', async (request) => await stopService(request));
+ fastify.post('/:id/:type/settings', async (request, reply) => await setSettingsService(request, reply));
+
+ fastify.post('/:id/plausibleanalytics/activate', async (request, reply) => await activatePlausibleUsers(request, reply));
+};
+
+export default root;
diff --git a/apps/api/src/routes/api/v1/settings/handlers.ts b/apps/api/src/routes/api/v1/settings/handlers.ts
new file mode 100644
index 0000000000..d60ef7b6aa
--- /dev/null
+++ b/apps/api/src/routes/api/v1/settings/handlers.ts
@@ -0,0 +1,85 @@
+import { promises as dns } from 'dns';
+
+import type { FastifyReply, FastifyRequest } from 'fastify';
+import { checkDomainsIsValidInDNS, errorHandler, getDomain, isDNSValid, isDomainConfigured, listSettings, prisma } from '../../../../lib/common';
+
+
+export async function listAllSettings(request: FastifyRequest) {
+ try {
+ const settings = await listSettings();
+ return {
+ settings
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveSettings(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const {
+ fqdn,
+ isRegistrationEnabled,
+ dualCerts,
+ minPort,
+ maxPort,
+ isAutoUpdateEnabled,
+ isDNSCheckEnabled
+ } = request.body
+ const { id } = await listSettings();
+ await prisma.setting.update({
+ where: { id },
+ data: { isRegistrationEnabled, dualCerts, isAutoUpdateEnabled, isDNSCheckEnabled }
+ });
+ if (fqdn) {
+ await prisma.setting.update({ where: { id }, data: { fqdn } });
+ }
+ if (minPort && maxPort) {
+ await prisma.setting.update({ where: { id }, data: { minPort, maxPort } });
+ }
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function deleteDomain(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { fqdn } = request.body
+ let ip;
+ try {
+ ip = await dns.resolve(fqdn);
+ } catch (error) {
+ // Do not care.
+ }
+ await prisma.setting.update({ where: { fqdn }, data: { fqdn: null } });
+ return reply.redirect(302, ip ? `http://${ip[0]}:3000/settings` : undefined)
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function checkDomain(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params;
+ let { fqdn, forceSave, dualCerts, isDNSCheckEnabled } = request.body
+ if (fqdn) fqdn = fqdn.toLowerCase();
+ const found = await isDomainConfigured({ id, fqdn });
+ if (found) {
+ throw "Domain already configured";
+ }
+ if (isDNSCheckEnabled && !forceSave) {
+ return await checkDomainsIsValidInDNS({ hostname: request.hostname, fqdn, dualCerts });
+ }
+ return {};
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function checkDNS(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id, domain } = request.params;
+ await isDNSValid(request.hostname, domain);
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
\ No newline at end of file
diff --git a/apps/api/src/routes/api/v1/settings/index.ts b/apps/api/src/routes/api/v1/settings/index.ts
new file mode 100644
index 0000000000..2c7a697382
--- /dev/null
+++ b/apps/api/src/routes/api/v1/settings/index.ts
@@ -0,0 +1,17 @@
+import { FastifyPluginAsync } from 'fastify';
+import { checkDNS, checkDomain, deleteDomain, listAllSettings, saveSettings } from './handlers';
+
+
+const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
+ fastify.addHook('onRequest', async (request, reply) => {
+ return await request.jwtVerify()
+ })
+ fastify.get('/', async (request) => await listAllSettings(request));
+ fastify.post('/', async (request, reply) => await saveSettings(request, reply));
+ fastify.delete('/', async (request, reply) => await deleteDomain(request, reply));
+
+ fastify.get('/check', async (request, reply) => await checkDNS(request, reply));
+ fastify.post('/check', async (request, reply) => await checkDomain(request, reply));
+};
+
+export default root;
diff --git a/apps/api/src/routes/api/v1/sources/handlers.ts b/apps/api/src/routes/api/v1/sources/handlers.ts
new file mode 100644
index 0000000000..d81a27d1e9
--- /dev/null
+++ b/apps/api/src/routes/api/v1/sources/handlers.ts
@@ -0,0 +1,182 @@
+import cuid from 'cuid';
+import type { FastifyRequest } from 'fastify';
+import { FastifyReply } from 'fastify';
+import { decrypt, encrypt, errorHandler, prisma } from '../../../../lib/common';
+
+export async function listSources(request: FastifyRequest) {
+ try {
+ const teamId = request.user?.teamId;
+ const sources = await prisma.gitSource.findMany({
+ where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: { teams: true, githubApp: true, gitlabApp: true }
+ });
+ return {
+ sources
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveSource(request, reply) {
+ try {
+ const { id } = request.params
+ const { name, htmlUrl, apiUrl } = request.body
+ await prisma.gitSource.update({
+ where: { id },
+ data: { name, htmlUrl, apiUrl }
+ });
+ return reply.code(201).send()
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function getSource(request: FastifyRequest) {
+ try {
+ const { id } = request.params
+ const { teamId } = request.user
+
+ const settings = await prisma.setting.findFirst({});
+ if (settings.proxyPassword) settings.proxyPassword = decrypt(settings.proxyPassword);
+
+ if (id === 'new') {
+ return {
+ source: {
+ name: null,
+ type: null,
+ htmlUrl: null,
+ apiUrl: null,
+ organization: null
+ },
+ settings
+ }
+ }
+
+ const source = await prisma.gitSource.findFirst({
+ where: { id, teams: { some: { id: teamId === '0' ? undefined : teamId } } },
+ include: { githubApp: true, gitlabApp: true }
+ });
+ if (!source) {
+ throw { status: 404, message: 'Source not found.' }
+ }
+
+ if (source?.githubApp?.clientSecret)
+ source.githubApp.clientSecret = decrypt(source.githubApp.clientSecret);
+ if (source?.githubApp?.webhookSecret)
+ source.githubApp.webhookSecret = decrypt(source.githubApp.webhookSecret);
+ if (source?.githubApp?.privateKey) source.githubApp.privateKey = decrypt(source.githubApp.privateKey);
+ if (source?.gitlabApp?.appSecret) source.gitlabApp.appSecret = decrypt(source.gitlabApp.appSecret);
+
+ return {
+ source,
+ settings
+ };
+
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function deleteSource(request) {
+ try {
+ const { id } = request.params
+ const source = await prisma.gitSource.delete({
+ where: { id },
+ include: { githubApp: true, gitlabApp: true }
+ });
+ if (source.githubAppId) {
+ await prisma.githubApp.delete({ where: { id: source.githubAppId } });
+ }
+ if (source.gitlabAppId) {
+ await prisma.gitlabApp.delete({ where: { id: source.gitlabAppId } });
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+
+}
+export async function saveGitHubSource(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { name, type, htmlUrl, apiUrl, organization } = request.body
+ const { teamId } = request.user
+ if (id === 'new') {
+ const newId = cuid()
+ await prisma.gitSource.create({
+ data: {
+ id: newId,
+ name,
+ htmlUrl,
+ apiUrl,
+ organization,
+ type: 'github',
+ teams: { connect: { id: teamId } }
+ }
+ });
+ return {
+ id: newId
+ }
+ }
+ throw { status: 500, message: 'Wrong request.' }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function saveGitLabSource(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { id } = request.params
+ const { teamId } = request.user
+ let { type, name, htmlUrl, apiUrl, oauthId, appId, appSecret, groupName } =
+ request.body
+
+ oauthId = Number(oauthId);
+ const encryptedAppSecret = encrypt(appSecret);
+
+ if (id === 'new') {
+ const newId = cuid()
+ await prisma.gitSource.create({ data: { id: newId, type, apiUrl, htmlUrl, name, teams: { connect: { id: teamId } } } });
+ await prisma.gitlabApp.create({
+ data: {
+ teams: { connect: { id: teamId } },
+ appId,
+ oauthId,
+ groupName,
+ appSecret: encryptedAppSecret,
+ gitSource: { connect: { id: newId } }
+ }
+ });
+ return {
+ status: 201,
+ id: newId
+ }
+ } else {
+ await prisma.gitSource.update({ where: { id }, data: { type, apiUrl, htmlUrl, name } });
+ await prisma.gitlabApp.update({
+ where: { id },
+ data: {
+ appId,
+ oauthId,
+ groupName,
+ appSecret: encryptedAppSecret,
+ }
+ });
+ }
+ return { status: 201 };
+
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function checkGitLabOAuthID(request: FastifyRequest) {
+ try {
+ const { oauthId } = request.body
+ const found = await prisma.gitlabApp.findFirst({ where: { oauthId: Number(oauthId) } });
+ if (found) {
+ throw { status: 500, message: 'OAuthID already configured in Coolify.' }
+ }
+ return {}
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
\ No newline at end of file
diff --git a/apps/api/src/routes/api/v1/sources/index.ts b/apps/api/src/routes/api/v1/sources/index.ts
new file mode 100644
index 0000000000..f741627f35
--- /dev/null
+++ b/apps/api/src/routes/api/v1/sources/index.ts
@@ -0,0 +1,21 @@
+import { FastifyPluginAsync } from 'fastify';
+import { checkGitLabOAuthID, deleteSource, getSource, listSources, saveGitHubSource, saveGitLabSource, saveSource } from './handlers';
+
+
+const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
+ fastify.addHook('onRequest', async (request, reply) => {
+ return await request.jwtVerify()
+ })
+ fastify.get('/', async (request) => await listSources(request));
+
+ fastify.get('/:id', async (request) => await getSource(request));
+ fastify.post('/:id', async (request, reply) => await saveSource(request, reply));
+ fastify.delete('/:id', async (request) => await deleteSource(request));
+
+ fastify.post('/:id/check', async (request) => await checkGitLabOAuthID(request));
+ fastify.post('/:id/github', async (request, reply) => await saveGitHubSource(request, reply));
+ fastify.post('/:id/gitlab', async (request, reply) => await saveGitLabSource(request, reply));
+
+};
+
+export default root;
diff --git a/apps/api/src/routes/webhooks/github/handlers.ts b/apps/api/src/routes/webhooks/github/handlers.ts
new file mode 100644
index 0000000000..1ff6731ea9
--- /dev/null
+++ b/apps/api/src/routes/webhooks/github/handlers.ts
@@ -0,0 +1,222 @@
+import axios from "axios";
+import cuid from "cuid";
+import crypto from "crypto";
+import type { FastifyReply, FastifyRequest } from "fastify";
+import { encrypt, errorHandler, isDev, prisma } from "../../../lib/common";
+import { checkContainer, removeContainer } from "../../../lib/docker";
+import { scheduler } from "../../../lib/scheduler";
+import { getApplicationFromDB, getApplicationFromDBWebhook } from "../../api/v1/applications/handlers";
+
+export async function installGithub(request: FastifyRequest, reply: FastifyReply): Promise<any> {
+ try {
+ const { gitSourceId, installation_id } = request.query;
+ const source = await prisma.gitSource.findUnique({
+ where: { id: gitSourceId },
+ include: { githubApp: true }
+ });
+ await prisma.githubApp.update({
+ where: { id: source.githubAppId },
+ data: { installationId: Number(installation_id) }
+ });
+ if (isDev) {
+ return reply.redirect(`http://localhost:3000/sources/${gitSourceId}`)
+ } else {
+ return reply.redirect(`/sources/${gitSourceId}`)
+ }
+
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+
+}
+export async function configureGitHubApp(request, reply) {
+ try {
+ const { code, state } = request.query;
+ const { apiUrl } = await prisma.gitSource.findFirst({
+ where: { id: state },
+ include: { githubApp: true, gitlabApp: true }
+ });
+
+ const { data }: any = await axios.post(`${apiUrl}/app-manifests/${code}/conversions`);
+ const { id, client_id, slug, client_secret, pem, webhook_secret } = data
+
+ const encryptedClientSecret = encrypt(client_secret);
+ const encryptedWebhookSecret = encrypt(webhook_secret);
+ const encryptedPem = encrypt(pem);
+ await prisma.githubApp.create({
+ data: {
+ appId: id,
+ name: slug,
+ clientId: client_id,
+ clientSecret: encryptedClientSecret,
+ webhookSecret: encryptedWebhookSecret,
+ privateKey: encryptedPem,
+ gitSource: { connect: { id: state } }
+ }
+ });
+ if (isDev) {
+ return reply.redirect(`http://localhost:3000/sources/${state}`)
+ } else {
+ return reply.redirect(`/sources/${state}`)
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+export async function gitHubEvents(request: FastifyRequest, reply: FastifyReply): Promise<any> {
+ try {
+ const buildId = cuid();
+ const allowedGithubEvents = ['push', 'pull_request'];
+ const allowedActions = ['opened', 'reopened', 'synchronize', 'closed'];
+ const githubEvent = request.headers['x-github-event']?.toString().toLowerCase();
+ const githubSignature = request.headers['x-hub-signature-256']?.toString().toLowerCase();
+ if (!allowedGithubEvents.includes(githubEvent)) {
+ throw { status: 500, message: 'Event not allowed.' }
+ }
+ let repository, projectId, branch;
+ const body = request.body
+ if (githubEvent === 'push') {
+ repository = body.repository;
+ projectId = repository.id;
+ branch = body.ref.split('/')[2];
+ } else if (githubEvent === 'pull_request') {
+ repository = body.pull_request.head.repo;
+ projectId = repository.id;
+ branch = body.pull_request.head.ref.split('/')[2];
+ }
+
+ const applicationFound = await getApplicationFromDBWebhook(projectId, branch);
+ if (applicationFound) {
+ const webhookSecret = applicationFound.gitSource.githubApp.webhookSecret || null;
+ //@ts-ignore
+ const hmac = crypto.createHmac('sha256', webhookSecret);
+ const digest = Buffer.from(
+ 'sha256=' + hmac.update(JSON.stringify(body)).digest('hex'),
+ 'utf8'
+ );
+ if (!isDev) {
+ const checksum = Buffer.from(githubSignature, 'utf8');
+ //@ts-ignore
+ if (checksum.length !== digest.length || !crypto.timingSafeEqual(digest, checksum)) {
+ throw { status: 500, message: 'SHA256 checksum failed. Are you doing something fishy?' }
+ };
+ }
+
+
+ if (githubEvent === 'push') {
+ if (!applicationFound.configHash) {
+ const configHash = crypto
+ //@ts-ignore
+ .createHash('sha256')
+ .update(
+ JSON.stringify({
+ buildPack: applicationFound.buildPack,
+ port: applicationFound.port,
+ exposePort: applicationFound.exposePort,
+ installCommand: applicationFound.installCommand,
+ buildCommand: applicationFound.buildCommand,
+ startCommand: applicationFound.startCommand
+ })
+ )
+ .digest('hex');
+ await prisma.application.updateMany({
+ where: { branch, projectId },
+ data: { configHash }
+ });
+ }
+ await prisma.application.update({
+ where: { id: applicationFound.id },
+ data: { updatedAt: new Date() }
+ });
+ await prisma.build.create({
+ data: {
+ id: buildId,
+ applicationId: applicationFound.id,
+ destinationDockerId: applicationFound.destinationDocker.id,
+ gitSourceId: applicationFound.gitSource.id,
+ githubAppId: applicationFound.gitSource.githubApp?.id,
+ gitlabAppId: applicationFound.gitSource.gitlabApp?.id,
+ status: 'queued',
+ type: 'webhook_commit'
+ }
+ });
+ scheduler.workers.get('deployApplication').postMessage({
+ build_id: buildId,
+ type: 'webhook_commit',
+ ...applicationFound
+ });
+
+ return {
+ message: 'Queued. Thank you!'
+ };
+ } else if (githubEvent === 'pull_request') {
+ const pullmergeRequestId = body.number;
+ const pullmergeRequestAction = body.action;
+ const sourceBranch = body.pull_request.head.ref;
+ if (!allowedActions.includes(pullmergeRequestAction)) {
+ throw { status: 500, message: 'Action not allowed.' }
+ }
+
+ if (applicationFound.settings.previews) {
+ if (applicationFound.destinationDockerId) {
+ const isRunning = await checkContainer(
+ applicationFound.destinationDocker.engine,
+ applicationFound.id
+ );
+ if (!isRunning) {
+ throw { status: 500, message: 'Application not running.' }
+ }
+ }
+ if (
+ pullmergeRequestAction === 'opened' ||
+ pullmergeRequestAction === 'reopened' ||
+ pullmergeRequestAction === 'synchronize'
+ ) {
+ await prisma.application.update({
+ where: { id: applicationFound.id },
+ data: { updatedAt: new Date() }
+ });
+ await prisma.build.create({
+ data: {
+ id: buildId,
+ applicationId: applicationFound.id,
+ destinationDockerId: applicationFound.destinationDocker.id,
+ gitSourceId: applicationFound.gitSource.id,
+ githubAppId: applicationFound.gitSource.githubApp?.id,
+ gitlabAppId: applicationFound.gitSource.gitlabApp?.id,
+ status: 'queued',
+ type: 'webhook_pr'
+ }
+ });
+ scheduler.workers.get('deployApplication').postMessage({
+ build_id: buildId,
+ type: 'webhook_pr',
+ ...applicationFound,
+ sourceBranch,
+ pullmergeRequestId
+ });
+
+ return {
+ message: 'Queued. Thank you!'
+ };
+ } else if (pullmergeRequestAction === 'closed') {
+ if (applicationFound.destinationDockerId) {
+ const id = `${applicationFound.id}-${pullmergeRequestId}`;
+ const engine = applicationFound.destinationDocker.engine;
+ await removeContainer({ id, engine });
+ }
+ return {
+ message: 'Removed preview. Thank you!'
+ };
+ }
+ } else {
+ throw { status: 500, message: 'Pull request previews are not enabled.' }
+ }
+ }
+ }
+ throw { status: 500, message: 'Not handled event.' }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+
+}
\ No newline at end of file
diff --git a/apps/api/src/routes/webhooks/github/index.ts b/apps/api/src/routes/webhooks/github/index.ts
new file mode 100644
index 0000000000..2af33366a6
--- /dev/null
+++ b/apps/api/src/routes/webhooks/github/index.ts
@@ -0,0 +1,10 @@
+import { FastifyPluginAsync } from 'fastify';
+import { configureGitHubApp, gitHubEvents, installGithub } from './handlers';
+
+const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
+ fastify.get('/', async (request, reply) => configureGitHubApp(request, reply));
+ fastify.get('/install', async (request, reply) => installGithub(request, reply));
+ fastify.post('/events', async (request, reply) => gitHubEvents(request, reply));
+};
+
+export default root;
diff --git a/apps/api/src/routes/webhooks/gitlab/handlers.ts b/apps/api/src/routes/webhooks/gitlab/handlers.ts
new file mode 100644
index 0000000000..9b1dd3e3c5
--- /dev/null
+++ b/apps/api/src/routes/webhooks/gitlab/handlers.ts
@@ -0,0 +1,178 @@
+import axios from "axios";
+import cuid from "cuid";
+import crypto from "crypto";
+import type { FastifyReply, FastifyRequest } from "fastify";
+import { encrypt, errorHandler, isDev, listSettings, prisma } from "../../../lib/common";
+import { checkContainer, removeContainer } from "../../../lib/docker";
+import { scheduler } from "../../../lib/scheduler";
+import { getApplicationFromDB, getApplicationFromDBWebhook } from "../../api/v1/applications/handlers";
+
+export async function configureGitLabApp(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const { code, state } = request.query;
+ const { fqdn } = await listSettings();
+ const { gitSource: { gitlabApp: { appId, appSecret }, htmlUrl } } = await getApplicationFromDB(state, undefined);
+
+ let domain = `http://${request.hostname}`;
+ if (fqdn) domain = fqdn;
+ if (isDev) {
+ domain = `http://localhost:3001`;
+ }
+ const params = new URLSearchParams({
+ client_id: appId,
+ client_secret: appSecret,
+ code,
+ state,
+ grant_type: 'authorization_code',
+ redirect_uri: `${domain}/webhooks/gitlab`
+ });
+ const { data } = await axios.post(`${htmlUrl}/oauth/token`, params)
+ if (isDev) {
+ return reply.redirect(`http://localhost:3000/webhooks/success?token=${data.access_token}`)
+ }
+ return reply.redirect(`/webhooks/success?token=${data.access_token}`)
+ } catch ({ status, message, ...other }) {
+ console.log(other)
+ return errorHandler({ status, message })
+ }
+}
+export async function gitLabEvents(request: FastifyRequest, reply: FastifyReply) {
+ try {
+ const buildId = cuid();
+
+ const allowedActions = ['opened', 'reopen', 'close', 'open', 'update'];
+ const { object_kind: objectKind, ref, project_id } = request.body
+ const webhookToken = request.headers['x-gitlab-token'];
+ if (!webhookToken) {
+ throw { status: 500, message: 'Invalid webhookToken.' }
+ }
+ if (objectKind === 'push') {
+ const projectId = Number(project_id);
+ const branch = ref.split('/')[2];
+ const applicationFound = await getApplicationFromDBWebhook(projectId, branch);
+ if (applicationFound) {
+ if (!applicationFound.configHash) {
+ const configHash = crypto
+ .createHash('sha256')
+ .update(
+ JSON.stringify({
+ buildPack: applicationFound.buildPack,
+ port: applicationFound.port,
+ exposePort: applicationFound.exposePort,
+ installCommand: applicationFound.installCommand,
+ buildCommand: applicationFound.buildCommand,
+ startCommand: applicationFound.startCommand
+ })
+ )
+ .digest('hex');
+ await prisma.application.updateMany({
+ where: { branch, projectId },
+ data: { configHash }
+ });
+ }
+ await prisma.application.update({
+ where: { id: applicationFound.id },
+ data: { updatedAt: new Date() }
+ });
+ await prisma.build.create({
+ data: {
+ id: buildId,
+ applicationId: applicationFound.id,
+ destinationDockerId: applicationFound.destinationDocker.id,
+ gitSourceId: applicationFound.gitSource.id,
+ githubAppId: applicationFound.gitSource.githubApp?.id,
+ gitlabAppId: applicationFound.gitSource.gitlabApp?.id,
+ status: 'queued',
+ type: 'webhook_commit'
+ }
+ });
+
+ scheduler.workers.get('deployApplication').postMessage({
+ build_id: buildId,
+ type: 'webhook_commit',
+ ...applicationFound
+ });
+
+ return {
+ message: 'Queued. Thank you!'
+ };
+
+ }
+ } else if (objectKind === 'merge_request') {
+ const { object_attributes: { work_in_progress: isDraft, action, source_branch: sourceBranch, target_branch: targetBranch, iid: pullmergeRequestId }, project: { id } } = request.body
+
+ const projectId = Number(id);
+ if (!allowedActions.includes(action)) {
+ throw { status: 500, message: 'Action not allowed.' }
+ }
+ if (isDraft) {
+ throw { status: 500, message: 'Draft MR, do nothing.' }
+ }
+
+ const applicationFound = await getApplicationFromDBWebhook(projectId, targetBranch);
+ if (applicationFound) {
+ if (applicationFound.settings.previews) {
+ if (applicationFound.destinationDockerId) {
+ const isRunning = await checkContainer(
+ applicationFound.destinationDocker.engine,
+ applicationFound.id
+ );
+ if (!isRunning) {
+ throw { status: 500, message: 'Application not running.' }
+ }
+ }
+ if (!isDev && applicationFound.gitSource.gitlabApp.webhookToken !== webhookToken) {
+ throw { status: 500, message: 'Invalid webhookToken. Are you doing something nasty?!' }
+ }
+ if (
+ action === 'opened' ||
+ action === 'reopen' ||
+ action === 'open' ||
+ action === 'update'
+ ) {
+ await prisma.application.update({
+ where: { id: applicationFound.id },
+ data: { updatedAt: new Date() }
+ });
+ await prisma.build.create({
+ data: {
+ id: buildId,
+ applicationId: applicationFound.id,
+ destinationDockerId: applicationFound.destinationDocker.id,
+ gitSourceId: applicationFound.gitSource.id,
+ githubAppId: applicationFound.gitSource.githubApp?.id,
+ gitlabAppId: applicationFound.gitSource.gitlabApp?.id,
+ status: 'queued',
+ type: 'webhook_mr'
+ }
+ });
+ scheduler.workers.get('deployApplication').postMessage({
+ build_id: buildId,
+ type: 'webhook_mr',
+ ...applicationFound,
+ sourceBranch,
+ pullmergeRequestId
+ });
+
+ return {
+ message: 'Queued. Thank you!'
+ };
+ } else if (action === 'close') {
+ if (applicationFound.destinationDockerId) {
+ const id = `${applicationFound.id}-${pullmergeRequestId}`;
+ const engine = applicationFound.destinationDocker.engine;
+ await removeContainer({ id, engine });
+ }
+ return {
+ message: 'Removed preview. Thank you!'
+ };
+ }
+ }
+ throw { status: 500, message: 'Merge request previews are not enabled.' }
+ }
+ }
+ throw { status: 500, message: 'Not handled event.' }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
\ No newline at end of file
diff --git a/apps/api/src/routes/webhooks/gitlab/index.ts b/apps/api/src/routes/webhooks/gitlab/index.ts
new file mode 100644
index 0000000000..22badd03fc
--- /dev/null
+++ b/apps/api/src/routes/webhooks/gitlab/index.ts
@@ -0,0 +1,9 @@
+import { FastifyPluginAsync } from 'fastify';
+import { configureGitLabApp, gitLabEvents } from './handlers';
+
+const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
+ fastify.get('/', async (request, reply) => configureGitLabApp(request, reply));
+ fastify.post('/events', async (request, reply) => gitLabEvents(request, reply));
+};
+
+export default root;
diff --git a/apps/api/src/routes/webhooks/traefik/handlers.ts b/apps/api/src/routes/webhooks/traefik/handlers.ts
new file mode 100644
index 0000000000..2c91c851d7
--- /dev/null
+++ b/apps/api/src/routes/webhooks/traefik/handlers.ts
@@ -0,0 +1,489 @@
+import { FastifyRequest } from "fastify";
+import { asyncExecShell, errorHandler, getDomain, isDev, listServicesWithIncludes, prisma, supportedServiceTypesAndVersions } from "../../../lib/common";
+import { getEngine } from "../../../lib/docker";
+
+function configureMiddleware(
+ { id, container, port, domain, nakedDomain, isHttps, isWWW, isDualCerts, scriptName, type },
+ traefik
+) {
+ if (isHttps) {
+ traefik.http.routers[id] = {
+ entrypoints: ['web'],
+ rule: `Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`)`,
+ service: `${id}`,
+ middlewares: ['redirect-to-https']
+ };
+
+ traefik.http.services[id] = {
+ loadbalancer: {
+ servers: [
+ {
+ url: `http://${container}:${port}`
+ }
+ ]
+ }
+ };
+
+ if (isDualCerts) {
+ traefik.http.routers[`${id}-secure`] = {
+ entrypoints: ['websecure'],
+ rule: `Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`)`,
+ service: `${id}`,
+ tls: {
+ certresolver: 'letsencrypt'
+ },
+ middlewares: []
+ };
+ } else {
+ if (isWWW) {
+ traefik.http.routers[`${id}-secure-www`] = {
+ entrypoints: ['websecure'],
+ rule: `Host(\`www.${nakedDomain}\`)`,
+ service: `${id}`,
+ tls: {
+ certresolver: 'letsencrypt'
+ },
+ middlewares: []
+ };
+ traefik.http.routers[`${id}-secure`] = {
+ entrypoints: ['websecure'],
+ rule: `Host(\`${nakedDomain}\`)`,
+ service: `${id}`,
+ tls: {
+ domains: {
+ main: `${domain}`
+ }
+ },
+ middlewares: ['redirect-to-www']
+ };
+ traefik.http.routers[`${id}`].middlewares.push('redirect-to-www');
+ } else {
+ traefik.http.routers[`${id}-secure-www`] = {
+ entrypoints: ['websecure'],
+ rule: `Host(\`www.${nakedDomain}\`)`,
+ service: `${id}`,
+ tls: {
+ domains: {
+ main: `${domain}`
+ }
+ },
+ middlewares: ['redirect-to-non-www']
+ };
+ traefik.http.routers[`${id}-secure`] = {
+ entrypoints: ['websecure'],
+ rule: `Host(\`${domain}\`)`,
+ service: `${id}`,
+ tls: {
+ certresolver: 'letsencrypt'
+ },
+ middlewares: []
+ };
+ traefik.http.routers[`${id}`].middlewares.push('redirect-to-non-www');
+ }
+ }
+ } else {
+ traefik.http.routers[id] = {
+ entrypoints: ['web'],
+ rule: `Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`)`,
+ service: `${id}`,
+ middlewares: []
+ };
+
+ traefik.http.routers[`${id}-secure`] = {
+ entrypoints: ['websecure'],
+ rule: `Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`)`,
+ service: `${id}`,
+ tls: {
+ domains: {
+ main: `${nakedDomain}`
+ }
+ },
+ middlewares: ['redirect-to-http']
+ };
+
+ traefik.http.services[id] = {
+ loadbalancer: {
+ servers: [
+ {
+ url: `http://${container}:${port}`
+ }
+ ]
+ }
+ };
+
+ if (!isDualCerts) {
+ if (isWWW) {
+ traefik.http.routers[`${id}`].middlewares.push('redirect-to-www');
+ traefik.http.routers[`${id}-secure`].middlewares.push('redirect-to-www');
+ } else {
+ traefik.http.routers[`${id}`].middlewares.push('redirect-to-non-www');
+ traefik.http.routers[`${id}-secure`].middlewares.push('redirect-to-non-www');
+ }
+ }
+ }
+
+ if (type === 'plausibleanalytics' && scriptName && scriptName !== 'plausible.js') {
+ if (!traefik.http.routers[`${id}`].middlewares.includes(`${id}-redir`)) {
+ traefik.http.routers[`${id}`].middlewares.push(`${id}-redir`);
+ }
+ if (!traefik.http.routers[`${id}-secure`].middlewares.includes(`${id}-redir`)) {
+ traefik.http.routers[`${id}-secure`].middlewares.push(`${id}-redir`);
+ }
+ }
+}
+
+
+export async function traefikConfiguration(request, reply) {
+ try {
+ const traefik = {
+ http: {
+ routers: {},
+ services: {},
+ middlewares: {
+ 'redirect-to-https': {
+ redirectscheme: {
+ scheme: 'https'
+ }
+ },
+ 'redirect-to-http': {
+ redirectscheme: {
+ scheme: 'http'
+ }
+ },
+ 'redirect-to-non-www': {
+ redirectregex: {
+ regex: '^https?://www\\.(.+)',
+ replacement: 'http://${1}'
+ }
+ },
+ 'redirect-to-www': {
+ redirectregex: {
+ regex: '^https?://(?:www\\.)?(.+)',
+ replacement: 'http://www.${1}'
+ }
+ }
+ }
+ }
+ };
+ const applications = await prisma.application.findMany({
+ include: { destinationDocker: true, settings: true }
+ });
+ const data = {
+ applications: [],
+ services: [],
+ coolify: []
+ };
+ for (const application of applications) {
+ const {
+ fqdn,
+ id,
+ port,
+ destinationDocker,
+ destinationDockerId,
+ settings: { previews, dualCerts }
+ } = application;
+ if (destinationDockerId) {
+ const { engine, network } = destinationDocker;
+ const isRunning = true;
+ if (fqdn) {
+ const domain = getDomain(fqdn);
+ const nakedDomain = domain.replace(/^www\./, '');
+ const isHttps = fqdn.startsWith('https://');
+ const isWWW = fqdn.includes('www.');
+ if (isRunning) {
+ data.applications.push({
+ id,
+ container: id,
+ port: port || 3000,
+ domain,
+ nakedDomain,
+ isRunning,
+ isHttps,
+ isWWW,
+ isDualCerts: dualCerts
+ });
+ }
+ if (previews) {
+ const host = getEngine(engine);
+ const { stdout } = await asyncExecShell(
+ `DOCKER_HOST=${host} docker container ls --filter="status=running" --filter="network=${network}" --filter="name=${id}-" --format="{{json .Names}}"`
+ );
+ const containers = stdout
+ .trim()
+ .split('\n')
+ .filter((a) => a)
+ .map((c) => c.replace(/"/g, ''));
+ if (containers.length > 0) {
+ for (const container of containers) {
+ const previewDomain = `${container.split('-')[1]}.${domain}`;
+ const nakedDomain = previewDomain.replace(/^www\./, '');
+ data.applications.push({
+ id: container,
+ container,
+ port: port || 3000,
+ domain: previewDomain,
+ isRunning,
+ nakedDomain,
+ isHttps,
+ isWWW,
+ isDualCerts: dualCerts
+ });
+ }
+ }
+ }
+ }
+ }
+ }
+ const services = await listServicesWithIncludes();
+
+ for (const service of services) {
+ const {
+ fqdn,
+ id,
+ type,
+ destinationDocker,
+ destinationDockerId,
+ dualCerts,
+ plausibleAnalytics
+ } = service;
+ if (destinationDockerId) {
+ const { engine } = destinationDocker;
+ const found = supportedServiceTypesAndVersions.find((a) => a.name === type);
+ if (found) {
+ const port = found.ports.main;
+ const publicPort = service[type]?.publicPort;
+ const isRunning = true;
+ if (fqdn) {
+ const domain = getDomain(fqdn);
+ const nakedDomain = domain.replace(/^www\./, '');
+ const isHttps = fqdn.startsWith('https://');
+ const isWWW = fqdn.includes('www.');
+ if (isRunning) {
+ // Plausible Analytics custom script
+ let scriptName = false;
+ if (type === 'plausibleanalytics' && plausibleAnalytics.scriptName !== 'plausible.js') {
+ scriptName = plausibleAnalytics.scriptName;
+ }
+
+ let container = id;
+ let otherDomain = null;
+ let otherNakedDomain = null;
+ let otherIsHttps = null;
+ let otherIsWWW = null;
+
+ if (type === 'minio' && service.minio.apiFqdn) {
+ otherDomain = getDomain(service.minio.apiFqdn);
+ otherNakedDomain = otherDomain.replace(/^www\./, '');
+ otherIsHttps = service.minio.apiFqdn.startsWith('https://');
+ otherIsWWW = service.minio.apiFqdn.includes('www.');
+ }
+ data.services.push({
+ id,
+ container,
+ type,
+ otherDomain,
+ otherNakedDomain,
+ otherIsHttps,
+ otherIsWWW,
+ port,
+ publicPort,
+ domain,
+ nakedDomain,
+ isRunning,
+ isHttps,
+ isWWW,
+ isDualCerts: dualCerts,
+ scriptName
+ });
+ }
+ }
+ }
+ }
+ }
+
+ const { fqdn, dualCerts } = await prisma.setting.findFirst();
+ if (fqdn) {
+ const domain = getDomain(fqdn);
+ const nakedDomain = domain.replace(/^www\./, '');
+ const isHttps = fqdn.startsWith('https://');
+ const isWWW = fqdn.includes('www.');
+ data.coolify.push({
+ id: isDev ? 'host.docker.internal' : 'coolify',
+ container: isDev ? 'host.docker.internal' : 'coolify',
+ port: 3000,
+ domain,
+ nakedDomain,
+ isHttps,
+ isWWW,
+ isDualCerts: dualCerts
+ });
+ }
+ for (const application of data.applications) {
+ configureMiddleware(application, traefik);
+ }
+ for (const service of data.services) {
+ const { id, scriptName } = service;
+
+ configureMiddleware(service, traefik);
+ if (service.type === 'minio') {
+ service.id = id + '-minio';
+ service.container = id;
+ service.domain = service.otherDomain;
+ service.nakedDomain = service.otherNakedDomain;
+ service.isHttps = service.otherIsHttps;
+ service.isWWW = service.otherIsWWW;
+ service.port = 9000;
+ configureMiddleware(service, traefik);
+ }
+
+ if (scriptName) {
+ traefik.http.middlewares[`${id}-redir`] = {
+ replacepathregex: {
+ regex: `/js/${scriptName}`,
+ replacement: '/js/plausible.js'
+ }
+ };
+ }
+ }
+ for (const coolify of data.coolify) {
+ configureMiddleware(coolify, traefik);
+ }
+ if (Object.keys(traefik.http.routers).length === 0) {
+ traefik.http.routers = null;
+ }
+ if (Object.keys(traefik.http.services).length === 0) {
+ traefik.http.services = null;
+ }
+ return {
+ ...traefik
+ }
+ } catch ({ status, message }) {
+ return errorHandler({ status, message })
+ }
+}
+
+export async function traefikOtherConfiguration(request: FastifyRequest, reply) {
+ try {
+ const { id } = request.query
+ if (id) {
+ const { privatePort, publicPort, type, address = id } = request.query
+ let traefik = {};
+ if (publicPort && type && privatePort) {
+ if (type === 'tcp') {
+ traefik = {
+ [type]: {
+ routers: {
+ [id]: {
+ entrypoints: [type],
+ rule: `HostSNI(\`*\`)`,
+ service: id
+ }
+ },
+ services: {
+ [id]: {
+ loadbalancer: {
+ servers: [{ address: `${address}:${privatePort}` }]
+ }
+ }
+ }
+ }
+ };
+ } else if (type === 'http') {
+ const service = await prisma.service.findFirst({
+ where: { id },
+ include: { minio: true }
+ });
+ if (service) {
+ if (service.type === 'minio') {
+ if (service?.minio?.apiFqdn) {
+ const {
+ minio: { apiFqdn }
+ } = service;
+ const domain = getDomain(apiFqdn);
+ const isHttps = apiFqdn.startsWith('https://');
+ traefik = {
+ [type]: {
+ routers: {
+ [id]: {
+ entrypoints: [type],
+ rule: `Host(\`${domain}\`)`,
+ service: id
+ }
+ },
+ services: {
+ [id]: {
+ loadbalancer: {
+ servers: [{ url: `http://${id}:${privatePort}` }]
+ }
+ }
+ }
+ }
+ };
+ if (isHttps) {
+ if (isDev) {
+ traefik[type].routers[id].tls = {
+ domains: {
+ main: `${domain}`
+ }
+ };
+ } else {
+ traefik[type].routers[id].tls = {
+ certresolver: 'letsencrypt'
+ };
+ }
+ }
+ }
+ } else {
+ if (service?.fqdn) {
+ const domain = getDomain(service.fqdn);
+ const isHttps = service.fqdn.startsWith('https://');
+ traefik = {
+ [type]: {
+ routers: {
+ [id]: {
+ entrypoints: [type],
+ rule: `Host(\`${domain}:${privatePort}\`)`,
+ service: id
+ }
+ },
+ services: {
+ [id]: {
+ loadbalancer: {
+ servers: [{ url: `http://${id}:${privatePort}` }]
+ }
+ }
+ }
+ }
+ };
+ if (isHttps) {
+ if (isDev) {
+ traefik[type].routers[id].tls = {
+ domains: {
+ main: `${domain}`
+ }
+ };
+ } else {
+ traefik[type].routers[id].tls = {
+ certresolver: 'letsencrypt'
+ };
+ }
+ }
+ }
+ }
+ } else {
+ throw { status: 500 }
+ }
+ }
+ } else {
+ throw { status: 500 }
+ }
+ return {
+ ...traefik
+ };
+ }
+ throw { status: 500 }
+ } catch ({ status, message }) {
+ console.log(status, message);
+ return errorHandler({ status, message })
+ }
+}
\ No newline at end of file
diff --git a/apps/api/src/routes/webhooks/traefik/index.ts b/apps/api/src/routes/webhooks/traefik/index.ts
new file mode 100644
index 0000000000..bb79c6b054
--- /dev/null
+++ b/apps/api/src/routes/webhooks/traefik/index.ts
@@ -0,0 +1,9 @@
+import { FastifyPluginAsync } from 'fastify';
+import { traefikConfiguration, traefikOtherConfiguration } from './handlers';
+
+const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
+ fastify.get('/main.json', async (request, reply) => traefikConfiguration(request, reply));
+ fastify.get('/other.json', async (request, reply) => traefikOtherConfiguration(request, reply));
+};
+
+export default root;
diff --git a/apps/api/tsconfig.json b/apps/api/tsconfig.json
new file mode 100644
index 0000000000..8900da4f09
--- /dev/null
+++ b/apps/api/tsconfig.json
@@ -0,0 +1,7 @@
+{
+ "compilerOptions": {
+ "esModuleInterop": true,
+ "resolveJsonModule":true,
+ "downlevelIteration": true
+ }
+ }
\ No newline at end of file
diff --git a/apps/ui/.eslintignore b/apps/ui/.eslintignore
new file mode 100644
index 0000000000..38972655fa
--- /dev/null
+++ b/apps/ui/.eslintignore
@@ -0,0 +1,13 @@
+.DS_Store
+node_modules
+/build
+/.svelte-kit
+/package
+.env
+.env.*
+!.env.example
+
+# Ignore files for PNPM, NPM and YARN
+pnpm-lock.yaml
+package-lock.json
+yarn.lock
diff --git a/.eslintrc.cjs b/apps/ui/.eslintrc.cjs
similarity index 100%
rename from .eslintrc.cjs
rename to apps/ui/.eslintrc.cjs
diff --git a/apps/ui/.npmrc b/apps/ui/.npmrc
new file mode 100644
index 0000000000..b6f27f1359
--- /dev/null
+++ b/apps/ui/.npmrc
@@ -0,0 +1 @@
+engine-strict=true
diff --git a/apps/ui/.prettierignore b/apps/ui/.prettierignore
new file mode 100644
index 0000000000..38972655fa
--- /dev/null
+++ b/apps/ui/.prettierignore
@@ -0,0 +1,13 @@
+.DS_Store
+node_modules
+/build
+/.svelte-kit
+/package
+.env
+.env.*
+!.env.example
+
+# Ignore files for PNPM, NPM and YARN
+pnpm-lock.yaml
+package-lock.json
+yarn.lock
diff --git a/apps/ui/.prettierrc b/apps/ui/.prettierrc
new file mode 100644
index 0000000000..ff2677efde
--- /dev/null
+++ b/apps/ui/.prettierrc
@@ -0,0 +1,6 @@
+{
+ "useTabs": true,
+ "singleQuote": true,
+ "trailingComma": "none",
+ "printWidth": 100
+}
diff --git a/apps/ui/README.md b/apps/ui/README.md
new file mode 100644
index 0000000000..374efec4c1
--- /dev/null
+++ b/apps/ui/README.md
@@ -0,0 +1,38 @@
+# create-svelte
+
+Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
+
+## Creating a project
+
+If you're seeing this, you've probably already done this step. Congrats!
+
+```bash
+# create a new project in the current directory
+npm init svelte
+
+# create a new project in my-app
+npm init svelte my-app
+```
+
+## Developing
+
+Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
+
+```bash
+npm run dev
+
+# or start the server and open the app in a new browser tab
+npm run dev -- --open
+```
+
+## Building
+
+To create a production version of your app:
+
+```bash
+npm run build
+```
+
+You can preview the production build with `npm run preview`.
+
+> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
diff --git a/apps/ui/package.json b/apps/ui/package.json
new file mode 100644
index 0000000000..5e069312fc
--- /dev/null
+++ b/apps/ui/package.json
@@ -0,0 +1,50 @@
+{
+ "name": "coolify-ui",
+ "description": "Coolify's SvelteKit UI",
+ "license": "AGPL-3.0",
+ "scripts": {
+ "dev": "vite dev",
+ "build": "vite build",
+ "package": "svelte-kit package",
+ "preview": "svelte-kit preview",
+ "prepare": "svelte-kit sync",
+ "test": "playwright test",
+ "check": "svelte-check --tsconfig ./tsconfig.json",
+ "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
+ "lint": "prettier --check --plugin-search-dir=. . && eslint .",
+ "format": "prettier --write --plugin-search-dir=. ."
+ },
+ "devDependencies": {
+ "@playwright/test": "1.23.1",
+ "@sveltejs/adapter-auto": "1.0.0-next.53",
+ "@sveltejs/kit": "1.0.0-next.359",
+ "@types/js-cookie": "3.0.2",
+ "@typescript-eslint/eslint-plugin": "5.30.5",
+ "@typescript-eslint/parser": "5.30.5",
+ "autoprefixer": "10.4.7",
+ "eslint": "8.19.0",
+ "eslint-config-prettier": "8.5.0",
+ "eslint-plugin-svelte3": "4.0.0",
+ "postcss": "8.4.14",
+ "prettier": "2.7.1",
+ "prettier-plugin-svelte": "2.7.0",
+ "svelte": "3.48.0",
+ "svelte-check": "2.8.0",
+ "svelte-preprocess": "4.10.7",
+ "tailwindcss": "3.1.4",
+ "tailwindcss-scrollbar": "0.1.0",
+ "tslib": "2.4.0",
+ "typescript": "4.7.4",
+ "vite": "^2.9.13"
+ },
+ "type": "module",
+ "dependencies": {
+ "@sveltejs/adapter-static": "1.0.0-next.34",
+ "@zerodevx/svelte-toast": "0.7.2",
+ "cuid": "2.1.8",
+ "js-cookie": "3.0.1",
+ "p-limit": "4.0.0",
+ "svelte-select": "4.4.7",
+ "sveltekit-i18n": "2.2.2"
+ }
+}
\ No newline at end of file
diff --git a/apps/ui/playwright.config.ts b/apps/ui/playwright.config.ts
new file mode 100644
index 0000000000..87c293e5a1
--- /dev/null
+++ b/apps/ui/playwright.config.ts
@@ -0,0 +1,10 @@
+import type { PlaywrightTestConfig } from '@playwright/test';
+
+const config: PlaywrightTestConfig = {
+ webServer: {
+ command: 'npm run build && npm run preview',
+ port: 3000
+ }
+};
+
+export default config;
diff --git a/postcss.config.cjs b/apps/ui/postcss.config.cjs
similarity index 100%
rename from postcss.config.cjs
rename to apps/ui/postcss.config.cjs
diff --git a/apps/ui/src/app.d.ts b/apps/ui/src/app.d.ts
new file mode 100644
index 0000000000..c743bfaf6a
--- /dev/null
+++ b/apps/ui/src/app.d.ts
@@ -0,0 +1,21 @@
+/// <reference types="@sveltejs/kit" />
+
+// See https://kit.svelte.dev/docs/types#app
+// for information about these interfaces
+declare namespace App {
+ // interface Locals {}
+ // interface Platform {}
+ // interface Session {}
+ interface Stuff {
+ service: any;
+ application: any;
+ isRunning: boolean;
+ appId: string;
+ readOnly: boolean;
+ source: string;
+ settings: string;
+ database: Record<string, any>;
+ versions: string;
+ privatePort: string;
+ }
+}
diff --git a/src/app.html b/apps/ui/src/app.html
similarity index 59%
rename from src/app.html
rename to apps/ui/src/app.html
index ab9a75726e..af82b3042d 100644
--- a/src/app.html
+++ b/apps/ui/src/app.html
@@ -2,10 +2,11 @@
<html lang="en">
<head>
<meta charset="utf-8" />
+ <link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- %svelte.head%
+ %sveltekit.head%
</head>
<body>
- <div id="svelte">%svelte.body%</div>
+ <div id="svelte">%sveltekit.body%</div>
</body>
</html>
diff --git a/apps/ui/src/hooks.ts b/apps/ui/src/hooks.ts
new file mode 100644
index 0000000000..30c352baa5
--- /dev/null
+++ b/apps/ui/src/hooks.ts
@@ -0,0 +1,4 @@
+export async function handle({ event, resolve }) {
+ const response = await resolve(event, { ssr: false });
+ return response;
+}
\ No newline at end of file
diff --git a/src/lib/api.ts b/apps/ui/src/lib/api.ts
similarity index 59%
rename from src/lib/api.ts
rename to apps/ui/src/lib/api.ts
index ab145a2f79..2244d79d3c 100644
--- a/src/lib/api.ts
+++ b/apps/ui/src/lib/api.ts
@@ -1,13 +1,27 @@
+import { browser, dev } from '$app/env';
+import Cookies from 'js-cookie';
+import { toast } from '@zerodevx/svelte-toast';
+
+export function getAPIUrl() {
+ return dev ? 'http://localhost:3001' : 'http://localhost:3000';
+}
async function send({
method,
path,
data = {},
headers,
timeout = 120000
+}: {
+ method: string;
+ path: string;
+ data?: any;
+ headers?: any;
+ timeout?: number;
}): Promise<Record<string, unknown>> {
+ const token = Cookies.get('token');
const controller = new AbortController();
const id = setTimeout(() => controller.abort(), timeout);
- const opts = { method, headers: {}, body: null, signal: controller.signal };
+ const opts: any = { method, headers: {}, body: null, signal: controller.signal };
if (Object.keys(data).length > 0) {
const parsedData = data;
for (const [key, value] of Object.entries(data)) {
@@ -27,6 +41,20 @@ async function send({
...headers
};
}
+ if (token && !path.startsWith('https://')) {
+ opts.headers = {
+ ...opts.headers,
+ Authorization: `Bearer ${token}`
+ };
+ }
+ if (!path.startsWith('https://')) {
+ path = `/api/v1${path}`;
+ }
+
+ if (dev && !path.startsWith('https://')) {
+ path = `http://localhost:3001${path}`;
+ }
+
const response = await fetch(`${path}`, opts);
clearTimeout(id);
@@ -45,14 +73,17 @@ async function send({
} else {
return {};
}
- if (!response.ok) throw responseData;
+ if (!response.ok) {
+ if (response.status === 401 && !path.startsWith('https://api.github')) {
+ Cookies.remove('token');
+ }
+
+ throw responseData;
+ }
return responseData;
}
-export function get(
- path: string,
- headers?: Record<string, unknown>
-): Promise<Record<string, unknown>> {
+export function get(path: string, headers?: Record<string, unknown>): Promise<Record<string, any>> {
return send({ method: 'GET', path, headers });
}
@@ -60,7 +91,7 @@ export function del(
path: string,
data: Record<string, unknown>,
headers?: Record<string, unknown>
-): Promise<Record<string, unknown>> {
+): Promise<Record<string, any>> {
return send({ method: 'DELETE', path, data, headers });
}
@@ -68,7 +99,7 @@ export function post(
path: string,
data: Record<string, unknown>,
headers?: Record<string, unknown>
-): Promise<Record<string, unknown>> {
+): Promise<Record<string, any>> {
return send({ method: 'POST', path, data, headers });
}
@@ -76,6 +107,6 @@ export function put(
path: string,
data: Record<string, unknown>,
headers?: Record<string, unknown>
-): Promise<Record<string, unknown>> {
+): Promise<Record<string, any>> {
return send({ method: 'PUT', path, data, headers });
}
diff --git a/apps/ui/src/lib/common.ts b/apps/ui/src/lib/common.ts
new file mode 100644
index 0000000000..288dab9865
--- /dev/null
+++ b/apps/ui/src/lib/common.ts
@@ -0,0 +1,420 @@
+import { toast } from '@zerodevx/svelte-toast';
+export const asyncSleep = (delay: number) =>
+ new Promise((resolve) => setTimeout(resolve, delay));
+
+export function errorNotification(error: any): void {
+ if (error.message) {
+ toast.push(error.message);
+ } else {
+ toast.push('Ooops, something is not okay, are you okay?');
+ }
+ console.error(JSON.stringify(error));
+}
+
+export function getDomain(domain: string) {
+ return domain?.replace('https://', '').replace('http://', '');
+}
+export function dashify(str: string, options?: any): string {
+ if (typeof str !== 'string') return str;
+ return str
+ .trim()
+ .replace(/\W/g, (m) => (/[Γ€-ΕΎ]/.test(m) ? m : '-'))
+ .replace(/^-+|-+$/g, '')
+ .replace(/-{2,}/g, (m) => (options && options.condense ? '-' : m))
+ .toLowerCase();
+}
+
+export const dateOptions: any = {
+ year: 'numeric',
+ month: 'short',
+ day: '2-digit',
+ hour: 'numeric',
+ minute: 'numeric',
+ second: 'numeric',
+ hour12: false
+};
+
+export const staticDeployments = [
+ 'react',
+ 'vuejs',
+ 'static',
+ 'svelte',
+ 'gatsby',
+ 'php',
+ 'astro',
+ 'eleventy'
+];
+export const notNodeDeployments = ['php', 'docker', 'rust', 'python', 'deno', 'laravel'];
+
+
+export function generateRemoteEngine(destination: any) {
+ return `ssh://${destination.user}@${destination.ipAddress}:${destination.port}`;
+}
+
+export function changeQueryParams(buildId: string) {
+ const queryParams = new URLSearchParams(window.location.search);
+ queryParams.set('buildId', buildId);
+ // @ts-ignore
+ return history.pushState(null, null, '?' + queryParams.toString());
+}
+
+// export const supportedDatabaseTypesAndVersions = [
+// {
+// name: 'mongodb',
+// fancyName: 'MongoDB',
+// baseImage: 'bitnami/mongodb',
+// versions: ['5.0', '4.4', '4.2']
+// },
+// { name: 'mysql', fancyName: 'MySQL', baseImage: 'bitnami/mysql', versions: ['8.0', '5.7'] },
+// {
+// name: 'mariadb',
+// fancyName: 'MariaDB',
+// baseImage: 'bitnami/mariadb',
+// versions: ['10.7', '10.6', '10.5', '10.4', '10.3', '10.2']
+// },
+// {
+// name: 'postgresql',
+// fancyName: 'PostgreSQL',
+// baseImage: 'bitnami/postgresql',
+// versions: ['14.2.0', '13.6.0', '12.10.0 ', '11.15.0', '10.20.0']
+// },
+// {
+// name: 'redis',
+// fancyName: 'Redis',
+// baseImage: 'bitnami/redis',
+// versions: ['6.2', '6.0', '5.0']
+// },
+// { name: 'couchdb', fancyName: 'CouchDB', baseImage: 'bitnami/couchdb', versions: ['3.2.1'] }
+// ];
+// export const supportedServiceTypesAndVersions = [
+// {
+// name: 'plausibleanalytics',
+// fancyName: 'Plausible Analytics',
+// baseImage: 'plausible/analytics',
+// images: ['bitnami/postgresql:13.2.0', 'yandex/clickhouse-server:21.3.2.5'],
+// versions: ['latest', 'stable'],
+// recommendedVersion: 'stable',
+// ports: {
+// main: 8000
+// }
+// },
+// {
+// name: 'nocodb',
+// fancyName: 'NocoDB',
+// baseImage: 'nocodb/nocodb',
+// versions: ['latest'],
+// recommendedVersion: 'latest',
+// ports: {
+// main: 8080
+// }
+// },
+// {
+// name: 'minio',
+// fancyName: 'MinIO',
+// baseImage: 'minio/minio',
+// versions: ['latest'],
+// recommendedVersion: 'latest',
+// ports: {
+// main: 9001
+// }
+// },
+// {
+// name: 'vscodeserver',
+// fancyName: 'VSCode Server',
+// baseImage: 'codercom/code-server',
+// versions: ['latest'],
+// recommendedVersion: 'latest',
+// ports: {
+// main: 8080
+// }
+// },
+// {
+// name: 'wordpress',
+// fancyName: 'Wordpress',
+// baseImage: 'wordpress',
+// images: ['bitnami/mysql:5.7'],
+// versions: ['latest', 'php8.1', 'php8.0', 'php7.4', 'php7.3'],
+// recommendedVersion: 'latest',
+// ports: {
+// main: 80
+// }
+// },
+// {
+// name: 'vaultwarden',
+// fancyName: 'Vaultwarden',
+// baseImage: 'vaultwarden/server',
+// versions: ['latest'],
+// recommendedVersion: 'latest',
+// ports: {
+// main: 80
+// }
+// },
+// {
+// name: 'languagetool',
+// fancyName: 'LanguageTool',
+// baseImage: 'silviof/docker-languagetool',
+// versions: ['latest'],
+// recommendedVersion: 'latest',
+// ports: {
+// main: 8010
+// }
+// },
+// {
+// name: 'n8n',
+// fancyName: 'n8n',
+// baseImage: 'n8nio/n8n',
+// versions: ['latest'],
+// recommendedVersion: 'latest',
+// ports: {
+// main: 5678
+// }
+// },
+// {
+// name: 'uptimekuma',
+// fancyName: 'Uptime Kuma',
+// baseImage: 'louislam/uptime-kuma',
+// versions: ['latest'],
+// recommendedVersion: 'latest',
+// ports: {
+// main: 3001
+// }
+// },
+// {
+// name: 'ghost',
+// fancyName: 'Ghost',
+// baseImage: 'bitnami/ghost',
+// images: ['bitnami/mariadb'],
+// versions: ['latest'],
+// recommendedVersion: 'latest',
+// ports: {
+// main: 2368
+// }
+// },
+// {
+// name: 'meilisearch',
+// fancyName: 'Meilisearch',
+// baseImage: 'getmeili/meilisearch',
+// images: [],
+// versions: ['latest'],
+// recommendedVersion: 'latest',
+// ports: {
+// main: 7700
+// }
+// },
+// {
+// name: 'umami',
+// fancyName: 'Umami',
+// baseImage: 'ghcr.io/mikecao/umami',
+// images: ['postgres:12-alpine'],
+// versions: ['postgresql-latest'],
+// recommendedVersion: 'postgresql-latest',
+// ports: {
+// main: 3000
+// }
+// },
+// {
+// name: 'hasura',
+// fancyName: 'Hasura',
+// baseImage: 'hasura/graphql-engine',
+// images: ['postgres:12-alpine'],
+// versions: ['latest', 'v2.5.1'],
+// recommendedVersion: 'v2.5.1',
+// ports: {
+// main: 8080
+// }
+// },
+// {
+// name: 'fider',
+// fancyName: 'Fider',
+// baseImage: 'getfider/fider',
+// images: ['postgres:12-alpine'],
+// versions: ['stable'],
+// recommendedVersion: 'stable',
+// ports: {
+// main: 3000
+// }
+// // },
+// // {
+// // name: 'appwrite',
+// // fancyName: 'AppWrite',
+// // baseImage: 'appwrite/appwrite',
+// // images: ['appwrite/influxdb', 'appwrite/telegraf', 'mariadb:10.7', 'redis:6.0-alpine3.12'],
+// // versions: ['latest', '0.13.0'],
+// // recommendedVersion: '0.13.0',
+// // ports: {
+// // main: 3000
+// // }
+// // }
+// }
+// ];
+
+export const getServiceMainPort = (service: string) => {
+ const serviceType = supportedServiceTypesAndVersions.find((s) => s.name === service);
+ if (serviceType) {
+ return serviceType.ports.main;
+ }
+ return null;
+};
+
+export const supportedServiceTypesAndVersions = [
+ {
+ name: 'plausibleanalytics',
+ fancyName: 'Plausible Analytics',
+ baseImage: 'plausible/analytics',
+ images: ['bitnami/postgresql:13.2.0', 'yandex/clickhouse-server:21.3.2.5'],
+ versions: ['latest', 'stable'],
+ recommendedVersion: 'stable',
+ ports: {
+ main: 8000
+ }
+ },
+ {
+ name: 'nocodb',
+ fancyName: 'NocoDB',
+ baseImage: 'nocodb/nocodb',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 8080
+ }
+ },
+ {
+ name: 'minio',
+ fancyName: 'MinIO',
+ baseImage: 'minio/minio',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 9001
+ }
+ },
+ {
+ name: 'vscodeserver',
+ fancyName: 'VSCode Server',
+ baseImage: 'codercom/code-server',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 8080
+ }
+ },
+ {
+ name: 'wordpress',
+ fancyName: 'Wordpress',
+ baseImage: 'wordpress',
+ images: ['bitnami/mysql:5.7'],
+ versions: ['latest', 'php8.1', 'php8.0', 'php7.4', 'php7.3'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 80
+ }
+ },
+ {
+ name: 'vaultwarden',
+ fancyName: 'Vaultwarden',
+ baseImage: 'vaultwarden/server',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 80
+ }
+ },
+ {
+ name: 'languagetool',
+ fancyName: 'LanguageTool',
+ baseImage: 'silviof/docker-languagetool',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 8010
+ }
+ },
+ {
+ name: 'n8n',
+ fancyName: 'n8n',
+ baseImage: 'n8nio/n8n',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 5678
+ }
+ },
+ {
+ name: 'uptimekuma',
+ fancyName: 'Uptime Kuma',
+ baseImage: 'louislam/uptime-kuma',
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 3001
+ }
+ },
+ {
+ name: 'ghost',
+ fancyName: 'Ghost',
+ baseImage: 'bitnami/ghost',
+ images: ['bitnami/mariadb'],
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 2368
+ }
+ },
+ {
+ name: 'meilisearch',
+ fancyName: 'Meilisearch',
+ baseImage: 'getmeili/meilisearch',
+ images: [],
+ versions: ['latest'],
+ recommendedVersion: 'latest',
+ ports: {
+ main: 7700
+ }
+ },
+ {
+ name: 'umami',
+ fancyName: 'Umami',
+ baseImage: 'ghcr.io/mikecao/umami',
+ images: ['postgres:12-alpine'],
+ versions: ['postgresql-latest'],
+ recommendedVersion: 'postgresql-latest',
+ ports: {
+ main: 3000
+ }
+ },
+ {
+ name: 'hasura',
+ fancyName: 'Hasura',
+ baseImage: 'hasura/graphql-engine',
+ images: ['postgres:12-alpine'],
+ versions: ['latest', 'v2.5.1'],
+ recommendedVersion: 'v2.5.1',
+ ports: {
+ main: 8080
+ }
+ },
+ {
+ name: 'fider',
+ fancyName: 'Fider',
+ baseImage: 'getfider/fider',
+ images: ['postgres:12-alpine'],
+ versions: ['stable'],
+ recommendedVersion: 'stable',
+ ports: {
+ main: 3000
+ }
+ }
+];
+
+export function handlerNotFoundLoad(error: any, url: URL) {
+ if (error?.status === 404) {
+ return {
+ status: 302,
+ redirect: '/'
+ };
+ }
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
+}
\ No newline at end of file
diff --git a/src/lib/components/CopyPasswordField.svelte b/apps/ui/src/lib/components/CopyPasswordField.svelte
similarity index 95%
rename from src/lib/components/CopyPasswordField.svelte
rename to apps/ui/src/lib/components/CopyPasswordField.svelte
index 88199f6ab5..1030656018 100644
--- a/src/lib/components/CopyPasswordField.svelte
+++ b/apps/ui/src/lib/components/CopyPasswordField.svelte
@@ -1,17 +1,17 @@
-<script>
+<script lang="ts">
import { browser } from '$app/env';
import { toast } from '@zerodevx/svelte-toast';
let showPassword = false;
- export let value;
+ export let value: string;
export let disabled = false;
export let isPasswordField = false;
export let readonly = false;
export let textarea = false;
export let required = false;
- export let pattern = null;
- export let id;
- export let name;
+ export let pattern: string|null|undefined = null;
+ export let id: string;
+ export let name: string;
export let placeholder = '';
let disabledClass = 'bg-coolback disabled:bg-coolblack';
diff --git a/src/lib/components/DeleteIcon.svelte b/apps/ui/src/lib/components/DeleteIcon.svelte
similarity index 100%
rename from src/lib/components/DeleteIcon.svelte
rename to apps/ui/src/lib/components/DeleteIcon.svelte
diff --git a/src/lib/components/Explainer.svelte b/apps/ui/src/lib/components/Explainer.svelte
similarity index 73%
rename from src/lib/components/Explainer.svelte
rename to apps/ui/src/lib/components/Explainer.svelte
index 5d4e208f91..813220c674 100644
--- a/src/lib/components/Explainer.svelte
+++ b/apps/ui/src/lib/components/Explainer.svelte
@@ -1,5 +1,5 @@
-<script>
- export let text;
+<script lang="ts">
+ export let text: string;
export let customClass = 'max-w-[24rem]';
</script>
diff --git a/src/lib/components/Loading.svelte b/apps/ui/src/lib/components/Loading.svelte
similarity index 100%
rename from src/lib/components/Loading.svelte
rename to apps/ui/src/lib/components/Loading.svelte
diff --git a/src/routes/applications/[id]/logs/_Loading.svelte b/apps/ui/src/lib/components/LoadingLogs.svelte
similarity index 100%
rename from src/routes/applications/[id]/logs/_Loading.svelte
rename to apps/ui/src/lib/components/LoadingLogs.svelte
diff --git a/src/lib/components/PageLoader.svelte b/apps/ui/src/lib/components/PageLoader.svelte
similarity index 91%
rename from src/lib/components/PageLoader.svelte
rename to apps/ui/src/lib/components/PageLoader.svelte
index edbbcd80cc..2b52fd9176 100644
--- a/src/lib/components/PageLoader.svelte
+++ b/apps/ui/src/lib/components/PageLoader.svelte
@@ -1,9 +1,9 @@
-<script>
+<script lang="ts">
import { onMount, onDestroy } from 'svelte';
import { tweened } from 'svelte/motion';
import { cubicOut } from 'svelte/easing';
- let timeout;
+ let timeout: NodeJS.Timeout | undefined;
const progress = tweened(0, {
duration: 2000,
easing: cubicOut
diff --git a/src/lib/components/Setting.svelte b/apps/ui/src/lib/components/Setting.svelte
similarity index 95%
rename from src/lib/components/Setting.svelte
rename to apps/ui/src/lib/components/Setting.svelte
index d7b028861d..d1cf55dc09 100644
--- a/src/lib/components/Setting.svelte
+++ b/apps/ui/src/lib/components/Setting.svelte
@@ -1,12 +1,12 @@
<script lang="ts">
import Explainer from '$lib/components/Explainer.svelte';
- export let setting;
- export let title;
- export let description;
+ export let setting: any;
+ export let title: any;
+ export let description: any;
export let isCenter = true;
export let disabled = false;
- export let dataTooltip = null;
+ export let dataTooltip: any = null;
export let loading = false;
</script>
diff --git a/src/routes/_Trend.svelte b/apps/ui/src/lib/components/Trend.svelte
similarity index 97%
rename from src/routes/_Trend.svelte
rename to apps/ui/src/lib/components/Trend.svelte
index 723ba2a394..cdc363516e 100644
--- a/src/routes/_Trend.svelte
+++ b/apps/ui/src/lib/components/Trend.svelte
@@ -1,5 +1,5 @@
<script lang="ts">
- export let trend;
+ export let trend: string;
</script>
{#if trend === 'up'}
diff --git a/apps/ui/src/lib/components/UpdateAvailable.svelte b/apps/ui/src/lib/components/UpdateAvailable.svelte
new file mode 100644
index 0000000000..4171a1c5f7
--- /dev/null
+++ b/apps/ui/src/lib/components/UpdateAvailable.svelte
@@ -0,0 +1,183 @@
+<script lang="ts">
+ import { dev } from '$app/env';
+ import { get, post } from '$lib/api';
+ import { appSession, features } from '$lib/store';
+ import { toast } from '@zerodevx/svelte-toast';
+ import { asyncSleep, errorNotification } from '$lib/common';
+ import { onMount } from 'svelte';
+
+ let isUpdateAvailable = false;
+ let updateStatus: any = {
+ found: false,
+ loading: false,
+ success: null
+ };
+ let latestVersion = 'latest';
+ async function update() {
+ updateStatus.loading = true;
+ try {
+ if (dev) {
+ console.log(`updating to ${latestVersion}`);
+ await asyncSleep(4000);
+ return window.location.reload();
+ } else {
+ await post(`/update`, { type: 'update', latestVersion });
+ toast.push('Update completed.<br><br>Waiting for the new version to start...');
+ 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);
+ toast.push('New version reachable. Reloading...');
+ updateStatus.loading = false;
+ updateStatus.success = true;
+ await asyncSleep(3000);
+ return window.location.reload();
+ }
+ } catch (error) {
+ updateStatus.success = false;
+ updateStatus.loading = false;
+ return errorNotification(error);
+ }
+ }
+ onMount(async () => {
+ if ($appSession.userId) {
+ const overrideVersion = $features.latestVersion;
+ if ($appSession.teamId === '0') {
+ try {
+ const data = await get(`/update`);
+ if (overrideVersion || data?.isUpdateAvailable) {
+ latestVersion = overrideVersion || data.latestVersion;
+ if (overrideVersion) {
+ isUpdateAvailable = true;
+ } else {
+ isUpdateAvailable = data.isUpdateAvailable;
+ }
+ }
+ } catch (error) {
+ return errorNotification(error);
+ }
+ }
+ }
+ });
+</script>
+
+<div class="flex flex-col space-y-4 py-2">
+ {#if $appSession.teamId === '0'}
+ {#if isUpdateAvailable}
+ <button
+ disabled={updateStatus.success === false}
+ title="Update available"
+ on:click={update}
+ class="icons tooltip-right bg-gradient-to-r from-purple-500 via-pink-500 to-red-500 text-white duration-75 hover:scale-105"
+ >
+ {#if updateStatus.loading}
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="lds-heart h-9 w-8"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path
+ d="M19.5 13.572l-7.5 7.428l-7.5 -7.428m0 0a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572"
+ />
+ </svg>
+ {:else if updateStatus.success === null}
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="h-9 w-8"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <circle cx="12" cy="12" r="9" />
+ <line x1="12" y1="8" x2="8" y2="12" />
+ <line x1="12" y1="8" x2="12" y2="16" />
+ <line x1="16" y1="12" x2="12" y2="8" />
+ </svg>
+ {:else if updateStatus.success}
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" class="h-9 w-8"
+ ><path
+ fill="#DD2E44"
+ d="M11.626 7.488c-.112.112-.197.247-.268.395l-.008-.008L.134 33.141l.011.011c-.208.403.14 1.223.853 1.937.713.713 1.533 1.061 1.936.853l.01.01L28.21 24.735l-.008-.009c.147-.07.282-.155.395-.269 1.562-1.562-.971-6.627-5.656-11.313-4.687-4.686-9.752-7.218-11.315-5.656z"
+ /><path
+ fill="#EA596E"
+ d="M13 12L.416 32.506l-.282.635.011.011c-.208.403.14 1.223.853 1.937.232.232.473.408.709.557L17 17l-4-5z"
+ /><path
+ fill="#A0041E"
+ d="M23.012 13.066c4.67 4.672 7.263 9.652 5.789 11.124-1.473 1.474-6.453-1.118-11.126-5.788-4.671-4.672-7.263-9.654-5.79-11.127 1.474-1.473 6.454 1.119 11.127 5.791z"
+ /><path
+ fill="#AA8DD8"
+ d="M18.59 13.609c-.199.161-.459.245-.734.215-.868-.094-1.598-.396-2.109-.873-.541-.505-.808-1.183-.735-1.862.128-1.192 1.324-2.286 3.363-2.066.793.085 1.147-.17 1.159-.292.014-.121-.277-.446-1.07-.532-.868-.094-1.598-.396-2.11-.873-.541-.505-.809-1.183-.735-1.862.13-1.192 1.325-2.286 3.362-2.065.578.062.883-.057 1.012-.134.103-.063.144-.123.148-.158.012-.121-.275-.446-1.07-.532-.549-.06-.947-.552-.886-1.102.059-.549.55-.946 1.101-.886 2.037.219 2.973 1.542 2.844 2.735-.13 1.194-1.325 2.286-3.364 2.067-.578-.063-.88.057-1.01.134-.103.062-.145.123-.149.157-.013.122.276.446 1.071.532 2.037.22 2.973 1.542 2.844 2.735-.129 1.192-1.324 2.286-3.362 2.065-.578-.062-.882.058-1.012.134-.104.064-.144.124-.148.158-.013.121.276.446 1.07.532.548.06.947.553.886 1.102-.028.274-.167.511-.366.671z"
+ /><path
+ fill="#77B255"
+ d="M30.661 22.857c1.973-.557 3.334.323 3.658 1.478.324 1.154-.378 2.615-2.35 3.17-.77.216-1.001.584-.97.701.034.118.425.312 1.193.095 1.972-.555 3.333.325 3.657 1.479.326 1.155-.378 2.614-2.351 3.17-.769.216-1.001.585-.967.702.033.117.423.311 1.192.095.53-.149 1.084.16 1.233.691.148.532-.161 1.084-.693 1.234-1.971.555-3.333-.323-3.659-1.479-.324-1.154.379-2.613 2.353-3.169.77-.217 1.001-.584.967-.702-.032-.117-.422-.312-1.19-.096-1.974.556-3.334-.322-3.659-1.479-.325-1.154.378-2.613 2.351-3.17.768-.215.999-.585.967-.701-.034-.118-.423-.312-1.192-.096-.532.15-1.083-.16-1.233-.691-.149-.53.161-1.082.693-1.232z"
+ /><path
+ fill="#AA8DD8"
+ d="M23.001 20.16c-.294 0-.584-.129-.782-.375-.345-.432-.274-1.061.156-1.406.218-.175 5.418-4.259 12.767-3.208.547.078.927.584.849 1.131-.078.546-.58.93-1.132.848-6.493-.922-11.187 2.754-11.233 2.791-.186.148-.406.219-.625.219z"
+ /><path
+ fill="#77B255"
+ d="M5.754 16c-.095 0-.192-.014-.288-.042-.529-.159-.829-.716-.67-1.245 1.133-3.773 2.16-9.794.898-11.364-.141-.178-.354-.353-.842-.316-.938.072-.849 2.051-.848 2.071.042.551-.372 1.031-.922 1.072-.559.034-1.031-.372-1.072-.923-.103-1.379.326-4.035 2.692-4.214 1.056-.08 1.933.287 2.552 1.057 2.371 2.951-.036 11.506-.542 13.192-.13.433-.528.712-.958.712z"
+ /><circle fill="#5C913B" cx="25.5" cy="9.5" r="1.5" /><circle
+ fill="#9266CC"
+ cx="2"
+ cy="18"
+ r="2"
+ /><circle fill="#5C913B" cx="32.5" cy="19.5" r="1.5" /><circle
+ fill="#5C913B"
+ cx="23.5"
+ cy="31.5"
+ r="1.5"
+ /><circle fill="#FFCC4D" cx="28" cy="4" r="2" /><circle
+ fill="#FFCC4D"
+ cx="32.5"
+ cy="8.5"
+ r="1.5"
+ /><circle fill="#FFCC4D" cx="29.5" cy="12.5" r="1.5" /><circle
+ fill="#FFCC4D"
+ cx="7.5"
+ cy="23.5"
+ r="1.5"
+ /></svg
+ >
+ {:else}
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" class="h-9 w-8"
+ ><path
+ fill="#FFCC4D"
+ d="M36 18c0 9.941-8.059 18-18 18S0 27.941 0 18 8.059 0 18 0s18 8.059 18 18"
+ /><path
+ fill="#664500"
+ d="M22 27c0 2.763-1.791 3-4 3-2.21 0-4-.237-4-3 0-2.761 1.79-6 4-6 2.209 0 4 3.239 4 6zm8-12c-.124 0-.25-.023-.371-.072-5.229-2.091-7.372-5.241-7.461-5.374-.307-.46-.183-1.081.277-1.387.459-.306 1.077-.184 1.385.274.019.027 1.93 2.785 6.541 4.629.513.206.763.787.558 1.3-.157.392-.533.63-.929.63zM6 15c-.397 0-.772-.238-.929-.629-.205-.513.044-1.095.557-1.3 4.612-1.844 6.523-4.602 6.542-4.629.308-.456.929-.577 1.387-.27.457.308.581.925.275 1.383-.089.133-2.232 3.283-7.46 5.374C6.25 14.977 6.124 15 6 15z"
+ /><path fill="#5DADEC" d="M24 16h4v19l-4-.046V16zM8 35l4-.046V16H8v19z" /><path
+ fill="#664500"
+ d="M14.999 18c-.15 0-.303-.034-.446-.105-3.512-1.756-7.07-.018-7.105 0-.495.249-1.095.046-1.342-.447-.247-.494-.047-1.095.447-1.342.182-.09 4.498-2.197 8.895 0 .494.247.694.848.447 1.342-.176.35-.529.552-.896.552zm14 0c-.15 0-.303-.034-.446-.105-3.513-1.756-7.07-.018-7.105 0-.494.248-1.094.047-1.342-.447-.247-.494-.047-1.095.447-1.342.182-.09 4.501-2.196 8.895 0 .494.247.694.848.447 1.342-.176.35-.529.552-.896.552z"
+ /><ellipse fill="#5DADEC" cx="18" cy="34" rx="18" ry="2" /><ellipse
+ fill="#E75A70"
+ cx="18"
+ cy="27"
+ rx="3"
+ ry="2"
+ /></svg
+ >
+ {/if}
+ </button>
+ {/if}
+ {/if}
+</div>
diff --git a/apps/ui/src/lib/components/Usage.svelte b/apps/ui/src/lib/components/Usage.svelte
new file mode 100644
index 0000000000..cd4105c60e
--- /dev/null
+++ b/apps/ui/src/lib/components/Usage.svelte
@@ -0,0 +1,147 @@
+<script lang="ts">
+ let usage = {
+ cpu: {
+ load: [0, 0, 0],
+ count: 0,
+ usage: 0
+ },
+ memory: {
+ totalMemMb: 0,
+ freeMemMb: 0,
+ usedMemMb: 0,
+ freeMemPercentage: 0
+ },
+ disk: {
+ freePercentage: 0,
+ totalGb: 0,
+ usedGb: 0
+ }
+ };
+ let usageInterval: any;
+ let loading = {
+ usage: false
+ };
+ import { appSession } from '$lib/store';
+ import { onDestroy, onMount } from 'svelte';
+ import { get } from '$lib/api';
+ import { errorNotification } from '$lib/common';
+ import Trend from './Trend.svelte';
+ async function getStatus() {
+ if (loading.usage) return;
+ loading.usage = true;
+ const data = await get('/usage');
+ usage = data.usage;
+ loading.usage = false;
+ }
+ onDestroy(() => {
+ clearInterval(usageInterval);
+ });
+ onMount(async () => {
+ try {
+ if ($appSession.teamId === '0') {
+ await getStatus();
+ usageInterval = setInterval(async () => {
+ await getStatus();
+ }, 1000);
+ }
+ } catch (error) {
+ return errorNotification(error);
+ }
+ });
+
+ let warning = {
+ memory: false,
+ cpu: false,
+ disk: false
+ };
+ let trends = {
+ memory: 'stable',
+ cpu: 'stable',
+ disk: 'stable'
+ };
+</script>
+
+{#if $appSession.teamId === '0'}
+ <div class="px-6 text-2xl font-bold">Server Usage</div>
+ <dl class="relative mt-5 grid grid-cols-1 gap-5 sm:grid-cols-3">
+ <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
+ <dt class="truncate text-sm font-medium text-white">Total Memory</dt>
+ <dd class="mt-1 text-3xl font-semibold text-white">
+ {(usage?.memory.totalMemMb).toFixed(0)}<span class="text-sm">MB</span>
+ </dd>
+ </div>
+
+ <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
+ <dt class="truncate text-sm font-medium text-white">Used Memory</dt>
+ <dd class="mt-1 text-3xl font-semibold text-white ">
+ {(usage?.memory.usedMemMb).toFixed(0)}<span class="text-sm">MB</span>
+ </dd>
+ </div>
+
+ <div
+ class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left"
+ class:bg-red-500={warning.memory}
+ >
+ <dt class="truncate text-sm font-medium text-white">Free Memory</dt>
+ <dd class="mt-1 text-3xl font-semibold text-white">
+ {usage?.memory.freeMemPercentage}<span class="text-sm">%</span>
+ {#if !warning.memory}
+ <Trend trend={trends.memory} />
+ {/if}
+ </dd>
+ </div>
+ </dl>
+ <dl class="relative mt-5 grid grid-cols-1 gap-5 sm:grid-cols-3">
+ <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
+ <dt class="truncate text-sm font-medium text-white">Total CPUs</dt>
+ <dd class="mt-1 text-3xl font-semibold text-white">
+ {usage?.cpu.count}
+ </dd>
+ </div>
+ <div
+ class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left"
+ class:bg-red-500={warning.cpu}
+ >
+ <dt class="truncate text-sm font-medium text-white">CPU Usage</dt>
+ <dd class="mt-1 text-3xl font-semibold text-white">
+ {usage?.cpu.usage}<span class="text-sm">%</span>
+ {#if !warning.cpu}
+ <Trend trend={trends.cpu} />
+ {/if}
+ </dd>
+ </div>
+ <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
+ <dt class="truncate text-sm font-medium text-white">Load Average (5/10/30mins)</dt>
+ <dd class="mt-1 text-3xl font-semibold text-white">
+ {usage?.cpu.load.join('/')}
+ </dd>
+ </div>
+ </dl>
+ <dl class="relative mt-5 grid grid-cols-1 gap-5 sm:grid-cols-3">
+ <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
+ <dt class="truncate text-sm font-medium text-white">Total Disk</dt>
+ <dd class="mt-1 text-3xl font-semibold text-white">
+ {usage?.disk.totalGb}<span class="text-sm">GB</span>
+ </dd>
+ </div>
+ <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
+ <dt class="truncate text-sm font-medium text-white">Used Disk</dt>
+ <dd class="mt-1 text-3xl font-semibold text-white">
+ {usage?.disk.usedGb}<span class="text-sm">GB</span>
+ </dd>
+ </div>
+ <div
+ class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left"
+ class:bg-red-500={warning.disk}
+ >
+ <dt class="truncate text-sm font-medium text-white">Free Disk</dt>
+ <dd class="mt-1 text-3xl font-semibold text-white">
+ {usage?.disk.freePercentage}<span class="text-sm">%</span>
+ {#if !warning.disk}
+ <Trend trend={trends.disk} />
+ {/if}
+ </dd>
+ </div>
+ </dl>
+ <div class="px-6 pt-20 text-2xl font-bold">Resources</div>
+{/if}
diff --git a/src/lib/components/svg/applications/Astro.svelte b/apps/ui/src/lib/components/svg/applications/Astro.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Astro.svelte
rename to apps/ui/src/lib/components/svg/applications/Astro.svelte
diff --git a/src/lib/components/svg/applications/Deno.svelte b/apps/ui/src/lib/components/svg/applications/Deno.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Deno.svelte
rename to apps/ui/src/lib/components/svg/applications/Deno.svelte
diff --git a/src/lib/components/svg/applications/Docker.svelte b/apps/ui/src/lib/components/svg/applications/Docker.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Docker.svelte
rename to apps/ui/src/lib/components/svg/applications/Docker.svelte
diff --git a/src/lib/components/svg/applications/Eleventy.svelte b/apps/ui/src/lib/components/svg/applications/Eleventy.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Eleventy.svelte
rename to apps/ui/src/lib/components/svg/applications/Eleventy.svelte
diff --git a/src/lib/components/svg/applications/Gatsby.svelte b/apps/ui/src/lib/components/svg/applications/Gatsby.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Gatsby.svelte
rename to apps/ui/src/lib/components/svg/applications/Gatsby.svelte
diff --git a/src/lib/components/svg/applications/Laravel.svelte b/apps/ui/src/lib/components/svg/applications/Laravel.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Laravel.svelte
rename to apps/ui/src/lib/components/svg/applications/Laravel.svelte
diff --git a/src/lib/components/svg/applications/Nestjs.svelte b/apps/ui/src/lib/components/svg/applications/Nestjs.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Nestjs.svelte
rename to apps/ui/src/lib/components/svg/applications/Nestjs.svelte
diff --git a/src/lib/components/svg/applications/Nextjs.svelte b/apps/ui/src/lib/components/svg/applications/Nextjs.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Nextjs.svelte
rename to apps/ui/src/lib/components/svg/applications/Nextjs.svelte
diff --git a/src/lib/components/svg/applications/Nodejs.svelte b/apps/ui/src/lib/components/svg/applications/Nodejs.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Nodejs.svelte
rename to apps/ui/src/lib/components/svg/applications/Nodejs.svelte
diff --git a/src/lib/components/svg/applications/Nuxtjs.svelte b/apps/ui/src/lib/components/svg/applications/Nuxtjs.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Nuxtjs.svelte
rename to apps/ui/src/lib/components/svg/applications/Nuxtjs.svelte
diff --git a/src/lib/components/svg/applications/PHP.svelte b/apps/ui/src/lib/components/svg/applications/PHP.svelte
similarity index 100%
rename from src/lib/components/svg/applications/PHP.svelte
rename to apps/ui/src/lib/components/svg/applications/PHP.svelte
diff --git a/src/lib/components/svg/applications/Python.svelte b/apps/ui/src/lib/components/svg/applications/Python.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Python.svelte
rename to apps/ui/src/lib/components/svg/applications/Python.svelte
diff --git a/src/lib/components/svg/applications/React.svelte b/apps/ui/src/lib/components/svg/applications/React.svelte
similarity index 100%
rename from src/lib/components/svg/applications/React.svelte
rename to apps/ui/src/lib/components/svg/applications/React.svelte
diff --git a/src/lib/components/svg/applications/Rust.svelte b/apps/ui/src/lib/components/svg/applications/Rust.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Rust.svelte
rename to apps/ui/src/lib/components/svg/applications/Rust.svelte
diff --git a/src/lib/components/svg/applications/Static.svelte b/apps/ui/src/lib/components/svg/applications/Static.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Static.svelte
rename to apps/ui/src/lib/components/svg/applications/Static.svelte
diff --git a/src/lib/components/svg/applications/Svelte.svelte b/apps/ui/src/lib/components/svg/applications/Svelte.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Svelte.svelte
rename to apps/ui/src/lib/components/svg/applications/Svelte.svelte
diff --git a/src/lib/components/svg/applications/Vuejs.svelte b/apps/ui/src/lib/components/svg/applications/Vuejs.svelte
similarity index 100%
rename from src/lib/components/svg/applications/Vuejs.svelte
rename to apps/ui/src/lib/components/svg/applications/Vuejs.svelte
diff --git a/src/lib/components/svg/databases/Clickhouse.svelte b/apps/ui/src/lib/components/svg/databases/Clickhouse.svelte
similarity index 100%
rename from src/lib/components/svg/databases/Clickhouse.svelte
rename to apps/ui/src/lib/components/svg/databases/Clickhouse.svelte
diff --git a/src/lib/components/svg/databases/CouchDB.svelte b/apps/ui/src/lib/components/svg/databases/CouchDB.svelte
similarity index 100%
rename from src/lib/components/svg/databases/CouchDB.svelte
rename to apps/ui/src/lib/components/svg/databases/CouchDB.svelte
diff --git a/src/lib/components/svg/databases/MariaDB.svelte b/apps/ui/src/lib/components/svg/databases/MariaDB.svelte
similarity index 100%
rename from src/lib/components/svg/databases/MariaDB.svelte
rename to apps/ui/src/lib/components/svg/databases/MariaDB.svelte
diff --git a/src/lib/components/svg/databases/MongoDB.svelte b/apps/ui/src/lib/components/svg/databases/MongoDB.svelte
similarity index 100%
rename from src/lib/components/svg/databases/MongoDB.svelte
rename to apps/ui/src/lib/components/svg/databases/MongoDB.svelte
diff --git a/src/lib/components/svg/databases/MySQL.svelte b/apps/ui/src/lib/components/svg/databases/MySQL.svelte
similarity index 100%
rename from src/lib/components/svg/databases/MySQL.svelte
rename to apps/ui/src/lib/components/svg/databases/MySQL.svelte
diff --git a/src/lib/components/svg/databases/PostgreSQL.svelte b/apps/ui/src/lib/components/svg/databases/PostgreSQL.svelte
similarity index 100%
rename from src/lib/components/svg/databases/PostgreSQL.svelte
rename to apps/ui/src/lib/components/svg/databases/PostgreSQL.svelte
diff --git a/src/lib/components/svg/databases/Redis.svelte b/apps/ui/src/lib/components/svg/databases/Redis.svelte
similarity index 100%
rename from src/lib/components/svg/databases/Redis.svelte
rename to apps/ui/src/lib/components/svg/databases/Redis.svelte
diff --git a/src/lib/components/svg/services/Fider.svelte b/apps/ui/src/lib/components/svg/services/Fider.svelte
similarity index 100%
rename from src/lib/components/svg/services/Fider.svelte
rename to apps/ui/src/lib/components/svg/services/Fider.svelte
diff --git a/src/lib/components/svg/services/Ghost.svelte b/apps/ui/src/lib/components/svg/services/Ghost.svelte
similarity index 100%
rename from src/lib/components/svg/services/Ghost.svelte
rename to apps/ui/src/lib/components/svg/services/Ghost.svelte
diff --git a/src/lib/components/svg/services/Hasura.svelte b/apps/ui/src/lib/components/svg/services/Hasura.svelte
similarity index 100%
rename from src/lib/components/svg/services/Hasura.svelte
rename to apps/ui/src/lib/components/svg/services/Hasura.svelte
diff --git a/src/lib/components/svg/services/LanguageTool.svelte b/apps/ui/src/lib/components/svg/services/LanguageTool.svelte
similarity index 100%
rename from src/lib/components/svg/services/LanguageTool.svelte
rename to apps/ui/src/lib/components/svg/services/LanguageTool.svelte
diff --git a/src/lib/components/svg/services/MeiliSearch.svelte b/apps/ui/src/lib/components/svg/services/MeiliSearch.svelte
similarity index 100%
rename from src/lib/components/svg/services/MeiliSearch.svelte
rename to apps/ui/src/lib/components/svg/services/MeiliSearch.svelte
diff --git a/src/lib/components/svg/services/MinIO.svelte b/apps/ui/src/lib/components/svg/services/MinIO.svelte
similarity index 100%
rename from src/lib/components/svg/services/MinIO.svelte
rename to apps/ui/src/lib/components/svg/services/MinIO.svelte
diff --git a/src/lib/components/svg/services/N8n.svelte b/apps/ui/src/lib/components/svg/services/N8n.svelte
similarity index 100%
rename from src/lib/components/svg/services/N8n.svelte
rename to apps/ui/src/lib/components/svg/services/N8n.svelte
diff --git a/src/lib/components/svg/services/NocoDB.svelte b/apps/ui/src/lib/components/svg/services/NocoDB.svelte
similarity index 100%
rename from src/lib/components/svg/services/NocoDB.svelte
rename to apps/ui/src/lib/components/svg/services/NocoDB.svelte
diff --git a/src/lib/components/svg/services/PlausibleAnalytics.svelte b/apps/ui/src/lib/components/svg/services/PlausibleAnalytics.svelte
similarity index 100%
rename from src/lib/components/svg/services/PlausibleAnalytics.svelte
rename to apps/ui/src/lib/components/svg/services/PlausibleAnalytics.svelte
diff --git a/src/lib/components/svg/services/Umami.svelte b/apps/ui/src/lib/components/svg/services/Umami.svelte
similarity index 100%
rename from src/lib/components/svg/services/Umami.svelte
rename to apps/ui/src/lib/components/svg/services/Umami.svelte
diff --git a/src/lib/components/svg/services/UptimeKuma.svelte b/apps/ui/src/lib/components/svg/services/UptimeKuma.svelte
similarity index 100%
rename from src/lib/components/svg/services/UptimeKuma.svelte
rename to apps/ui/src/lib/components/svg/services/UptimeKuma.svelte
diff --git a/src/lib/components/svg/services/VSCodeServer.svelte b/apps/ui/src/lib/components/svg/services/VSCodeServer.svelte
similarity index 100%
rename from src/lib/components/svg/services/VSCodeServer.svelte
rename to apps/ui/src/lib/components/svg/services/VSCodeServer.svelte
diff --git a/src/lib/components/svg/services/VaultWarden.svelte b/apps/ui/src/lib/components/svg/services/VaultWarden.svelte
similarity index 100%
rename from src/lib/components/svg/services/VaultWarden.svelte
rename to apps/ui/src/lib/components/svg/services/VaultWarden.svelte
diff --git a/src/lib/components/svg/services/Wordpress.svelte b/apps/ui/src/lib/components/svg/services/Wordpress.svelte
similarity index 100%
rename from src/lib/components/svg/services/Wordpress.svelte
rename to apps/ui/src/lib/components/svg/services/Wordpress.svelte
diff --git a/src/lib/lang.json b/apps/ui/src/lib/lang.json
similarity index 100%
rename from src/lib/lang.json
rename to apps/ui/src/lib/lang.json
diff --git a/src/lib/locales/en.json b/apps/ui/src/lib/locales/en.json
similarity index 98%
rename from src/lib/locales/en.json
rename to apps/ui/src/lib/locales/en.json
index c455523afd..2805130d26 100644
--- a/src/lib/locales/en.json
+++ b/apps/ui/src/lib/locales/en.json
@@ -124,7 +124,7 @@
"no_branches_found": "No branches found",
"configure_build_pack": "Configure Build Pack",
"scanning_repository_suggest_build_pack": "Scanning repository to suggest a build pack for you...",
- "found_lock_file": "Found lock file for <span class=\"font-bold text-orange-500 px-1\"> {{packageManager}}</span>.Using it for predefined commands commands.",
+ "found_lock_file": "Found lock file for {{packageManager}}.<br>Using it for predefined commands commands.",
"configure_destination": "Configure Destination",
"no_configurable_destination": "No configurable Destination found",
"select_a_repository_project": "Select a Repository / Project",
@@ -289,7 +289,7 @@
}
},
"services": {
- "all_email_verified": "All email verified. You can login now.",
+ "all_email_verified": "All emails are verified. You can login now.",
"generate_www_non_www_ssl": "It will generate certificates for both www and non-www. <br>You need to have <span class='font-bold text-pink-600'>both DNS entries</span> set in advance.<br><br>Service needs to be restarted."
},
"service": {
@@ -334,7 +334,7 @@
"pending_invitation": "Pending invitation",
"invite_new_member": "Invite new member",
"send_invitation": "Send invitation",
- "invite_only_register_explainer": "You can only invite registered users at the moment - will be extended soon.",
+ "invite_only_register_explainer": "You can only invite registered users.",
"admin": "Admin",
"read": "Read"
}
diff --git a/src/lib/locales/fr.json b/apps/ui/src/lib/locales/fr.json
similarity index 100%
rename from src/lib/locales/fr.json
rename to apps/ui/src/lib/locales/fr.json
diff --git a/apps/ui/src/lib/store.ts b/apps/ui/src/lib/store.ts
new file mode 100644
index 0000000000..01aa74f4a9
--- /dev/null
+++ b/apps/ui/src/lib/store.ts
@@ -0,0 +1,60 @@
+import { browser } from '$app/env';
+import { writable, readable, type Writable, type Readable } from 'svelte/store';
+// import { version as currentVersion } from '../../package.json';
+interface AppSession {
+ version: string
+ userId: string | null,
+ teamId: string | null,
+ permission: string,
+ isAdmin: boolean,
+ whiteLabeled: boolean,
+ whiteLabeledDetails: {
+ icon: string | null,
+ },
+ tokens: {
+ github: string | null,
+ gitlab: string | null,
+ }
+}
+export const loginEmail: Writable<string | undefined> = writable()
+export const appSession: Writable<AppSession> = writable({
+ version: '3.0.0',
+ userId: null,
+ teamId: null,
+ permission: 'read',
+ isAdmin: false,
+ whiteLabeled: false,
+ whiteLabeledDetails: {
+ icon: null
+ },
+ tokens: {
+ github: null,
+ gitlab: null
+ }
+});
+export const isTraefikUsed: Writable<boolean> = writable(false);
+export const disabledButton: Writable<boolean> = writable(false);
+export const status: Writable<any> = writable({
+ application: {
+ isRunning: false,
+ isExited: false,
+ loading: false,
+ initialLoading: true
+ },
+ service: {
+ initialLoading: true,
+ loading: false,
+ isRunning: false
+ },
+ database: {
+ initialLoading: true,
+ loading: false,
+ isRunning: false
+ }
+
+});
+
+export const features = readable({
+ beta: window.localStorage.getItem('beta') === 'true',
+ latestVersion: window.localStorage.getItem('latestVersion')
+});
diff --git a/src/lib/components/templates.ts b/apps/ui/src/lib/templates.ts
similarity index 97%
rename from src/lib/components/templates.ts
rename to apps/ui/src/lib/templates.ts
index aa1ed9528c..7b81dbadde 100644
--- a/src/lib/components/templates.ts
+++ b/apps/ui/src/lib/templates.ts
@@ -1,4 +1,4 @@
-function defaultBuildAndDeploy(packageManager) {
+function defaultBuildAndDeploy(packageManager: string) {
return {
installCommand:
packageManager === 'npm' ? `${packageManager} install` : `${packageManager} install`,
@@ -8,7 +8,7 @@ function defaultBuildAndDeploy(packageManager) {
packageManager === 'npm' ? `${packageManager} run start` : `${packageManager} start`
};
}
-export function findBuildPack(pack, packageManager = 'npm') {
+export function findBuildPack(pack: string, packageManager = 'npm') {
const metaData = buildPacks.find((b) => b.name === pack);
if (pack === 'node') {
return {
diff --git a/src/lib/translations.ts b/apps/ui/src/lib/translations.ts
similarity index 100%
rename from src/lib/translations.ts
rename to apps/ui/src/lib/translations.ts
diff --git a/src/routes/__error.svelte b/apps/ui/src/routes/__error.svelte
similarity index 79%
rename from src/routes/__error.svelte
rename to apps/ui/src/routes/__error.svelte
index 1ac61d6bf2..ac32b098ec 100644
--- a/src/routes/__error.svelte
+++ b/apps/ui/src/routes/__error.svelte
@@ -1,6 +1,5 @@
-<script context="module">
- /** @type {import('@sveltejs/kit').ErrorLoad} */
- export function load({ error, status }) {
+<script context="module" lang="ts">
+ export function load({ error, status }: { error: any; status: any }) {
console.log(error);
return {
props: {
@@ -11,11 +10,11 @@
}
</script>
-<script>
+<script lang="ts">
import { t } from '$lib/translations';
- export let status;
- export let error;
+ export let status: string;
+ export let error: any;
</script>
<div class="mx-auto flex h-screen flex-col items-center justify-center px-4">
diff --git a/src/routes/__layout.svelte b/apps/ui/src/routes/__layout.svelte
similarity index 50%
rename from src/routes/__layout.svelte
rename to apps/ui/src/routes/__layout.svelte
index 492673a28b..68b624cae2 100644
--- a/src/routes/__layout.svelte
+++ b/apps/ui/src/routes/__layout.svelte
@@ -1,132 +1,81 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- import { publicPaths } from '$lib/settings';
- import { locale, loadTranslations } from '$lib/translations';
- export const load: Load = async ({ fetch, url, session }) => {
- const { pathname } = url;
-
- const defaultLocale = 'en';
- const sessionLocale = session.lang;
- const initLocale = sessionLocale || locale.get() || defaultLocale;
- await loadTranslations(initLocale, pathname);
-
- if (!session.userId && !publicPaths.includes(url.pathname)) {
- return {
- status: 302,
- redirect: '/login'
- };
- }
- if (!session.userId) {
- return {};
- }
- const endpoint = `/dashboard.json`;
- const res = await fetch(endpoint);
-
- if (res.ok) {
- return {
- props: {
- ...(await res.json())
+ export const load: Load = async ({ url }) => {
+ try {
+ if (Cookies.get('token')) {
+ const response = await get(`/user`);
+ return {
+ props: {
+ ...response
+ },
+ stuff: {
+ ...response
+ }
+ };
+ } else {
+ if (url.pathname !== '/login' && url.pathname !== '/register') {
+ return {
+ status: 302,
+ redirect: '/login'
+ };
+ }
+ return {};
+ }
+ } catch (error: any) {
+ if (error?.code?.startsWith('FAST_JWT') || error.status === 401) {
+ Cookies.remove('token');
+ if (url.pathname !== '/login') {
+ return {
+ status: 302,
+ redirect: '/login'
+ };
}
+ }
+ if (url.pathname !== '/login') {
+ return {
+ status: 302,
+ redirect: '/login'
+ };
+ }
+ return {
+ status: 500,
+ error: new Error(error)
};
}
- return {};
};
</script>
-<script>
- export let settings;
+<script lang="ts">
+ export let settings: any;
+ export let userId: string;
+ export let teamId: string;
+ export let permission: string;
+ export let isAdmin: boolean;
import '../tailwind.css';
- import { SvelteToast, toast } from '@zerodevx/svelte-toast';
- import { page, session } from '$app/stores';
+ import Cookies from 'js-cookie';
import { fade } from 'svelte/transition';
- import { onMount } from 'svelte';
- import { errorNotification } from '$lib/form';
- import { asyncSleep } from '$lib/components/common';
- import { del, get, post } from '$lib/api';
- import { dev } from '$app/env';
- import { features, isTraefikUsed } from '$lib/store';
- import { navigating } from '$app/stores';
- import PageLoader from '$lib/components/PageLoader.svelte';
- $isTraefikUsed = settings?.isTraefikUsed || false;
+ import { SvelteToast } from '@zerodevx/svelte-toast';
+ import { navigating, page } from '$app/stores';
- let isUpdateAvailable = false;
- let updateStatus = {
- found: false,
- loading: false,
- success: null
- };
- let latestVersion = 'latest';
+ import { get } from '$lib/api';
+ import UpdateAvailable from '$lib/components/UpdateAvailable.svelte';
+ import PageLoader from '$lib/components/PageLoader.svelte';
+ import { errorNotification } from '$lib/common';
+ import { appSession, isTraefikUsed } from '$lib/store';
- onMount(async () => {
- if ($session.userId) {
- const overrideVersion = $features.latestVersion;
- try {
- await get(`/login.json`);
- } catch ({ error }) {
- await del(`/logout.json`, {});
- window.location.reload();
- return errorNotification(error);
- }
- if ($session.teamId === '0') {
- try {
- const data = await get(`/update.json`);
- if (overrideVersion || data?.isUpdateAvailable) {
- latestVersion = overrideVersion || data.latestVersion;
- if (overrideVersion) {
- isUpdateAvailable = true;
- } else {
- isUpdateAvailable = data.isUpdateAvailable;
- }
- }
- } catch (error) {
- } finally {
- }
- }
- }
- });
+ if (userId) $appSession.userId = userId;
+ if (teamId) $appSession.teamId = teamId;
+ if (permission) $appSession.permission = permission;
+ if (isAdmin) $appSession.isAdmin = isAdmin;
- async function logout() {
- try {
- await del(`/logout.json`, {});
- return window.location.reload();
- } catch ({ error }) {
- return errorNotification(error);
- }
- }
+ $isTraefikUsed = settings?.isTraefikUsed || false;
- async function update() {
- updateStatus.loading = true;
+ async function logout() {
try {
- if (dev) {
- console.log(`updating to ${latestVersion}`);
- await asyncSleep(4000);
- return window.location.reload();
- } else {
- await post(`/update.json`, { type: 'update', latestVersion });
- toast.push('Update completed.<br><br>Waiting for the new version to start...');
- let reachable = false;
- let tries = 0;
- do {
- await asyncSleep(4000);
- try {
- await get(`/undead.json`);
- reachable = true;
- } catch (error) {
- reachable = false;
- }
- if (reachable) break;
- tries++;
- } while (!reachable || tries < 120);
- toast.push('New version reachable. Reloading...');
- updateStatus.loading = false;
- updateStatus.success = true;
- await asyncSleep(3000);
- return window.location.reload();
- }
- } catch ({ error }) {
- updateStatus.success = false;
- updateStatus.loading = false;
+ Cookies.remove('token');
+ return window.location.replace('/login');
+ } catch (error) {
return errorNotification(error);
}
}
@@ -134,10 +83,10 @@
<svelte:head>
<title>Coolify</title>
- {#if !$session.whiteLabeled}
+ {#if !$appSession.whiteLabeled}
<link rel="icon" href="/favicon.png" />
- {:else if $session.whiteLabelDetails.icon}
- <link rel="icon" href={$session.whiteLabelDetails.icon} />
+ {:else if $appSession.whiteLabeledDetails.icon}
+ <link rel="icon" href={$appSession.whiteLabeledDetails.icon} />
{/if}
</svelte:head>
<SvelteToast options={{ intro: { y: -64 }, duration: 3000, pausable: true }} />
@@ -146,13 +95,13 @@
<PageLoader />
</div>
{/if}
-{#if $session.userId}
+{#if $appSession.userId}
<nav class="nav-main">
<div class="flex h-screen w-full flex-col items-center transition-all duration-100">
- {#if !$session.whiteLabeled}
+ {#if !$appSession.whiteLabeled}
<div class="my-4 h-10 w-10"><img src="/favicon.png" alt="coolLabs logo" /></div>
{/if}
- <div class="flex flex-col space-y-2 py-2" class:mt-2={$session.whiteLabeled}>
+ <div class="flex flex-col space-y-2 py-2" class:mt-2={$appSession.whiteLabeled}>
<a
sveltekit:prefetch
href="/"
@@ -325,117 +274,7 @@
</div>
<div class="flex-1" />
- <div class="flex flex-col space-y-4 py-2">
- {#if $session.teamId === '0'}
- {#if isUpdateAvailable}
- <button
- disabled={updateStatus.success === false}
- title="Update available"
- on:click={update}
- class="icons tooltip-right bg-gradient-to-r from-purple-500 via-pink-500 to-red-500 text-white duration-75 hover:scale-105"
- >
- {#if updateStatus.loading}
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="lds-heart h-9 w-8"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentColor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path
- d="M19.5 13.572l-7.5 7.428l-7.5 -7.428m0 0a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572"
- />
- </svg>
- {:else if updateStatus.success === null}
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="h-9 w-8"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentColor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <circle cx="12" cy="12" r="9" />
- <line x1="12" y1="8" x2="8" y2="12" />
- <line x1="12" y1="8" x2="12" y2="16" />
- <line x1="16" y1="12" x2="12" y2="8" />
- </svg>
- {:else if updateStatus.success}
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" class="h-9 w-8"
- ><path
- fill="#DD2E44"
- d="M11.626 7.488c-.112.112-.197.247-.268.395l-.008-.008L.134 33.141l.011.011c-.208.403.14 1.223.853 1.937.713.713 1.533 1.061 1.936.853l.01.01L28.21 24.735l-.008-.009c.147-.07.282-.155.395-.269 1.562-1.562-.971-6.627-5.656-11.313-4.687-4.686-9.752-7.218-11.315-5.656z"
- /><path
- fill="#EA596E"
- d="M13 12L.416 32.506l-.282.635.011.011c-.208.403.14 1.223.853 1.937.232.232.473.408.709.557L17 17l-4-5z"
- /><path
- fill="#A0041E"
- d="M23.012 13.066c4.67 4.672 7.263 9.652 5.789 11.124-1.473 1.474-6.453-1.118-11.126-5.788-4.671-4.672-7.263-9.654-5.79-11.127 1.474-1.473 6.454 1.119 11.127 5.791z"
- /><path
- fill="#AA8DD8"
- d="M18.59 13.609c-.199.161-.459.245-.734.215-.868-.094-1.598-.396-2.109-.873-.541-.505-.808-1.183-.735-1.862.128-1.192 1.324-2.286 3.363-2.066.793.085 1.147-.17 1.159-.292.014-.121-.277-.446-1.07-.532-.868-.094-1.598-.396-2.11-.873-.541-.505-.809-1.183-.735-1.862.13-1.192 1.325-2.286 3.362-2.065.578.062.883-.057 1.012-.134.103-.063.144-.123.148-.158.012-.121-.275-.446-1.07-.532-.549-.06-.947-.552-.886-1.102.059-.549.55-.946 1.101-.886 2.037.219 2.973 1.542 2.844 2.735-.13 1.194-1.325 2.286-3.364 2.067-.578-.063-.88.057-1.01.134-.103.062-.145.123-.149.157-.013.122.276.446 1.071.532 2.037.22 2.973 1.542 2.844 2.735-.129 1.192-1.324 2.286-3.362 2.065-.578-.062-.882.058-1.012.134-.104.064-.144.124-.148.158-.013.121.276.446 1.07.532.548.06.947.553.886 1.102-.028.274-.167.511-.366.671z"
- /><path
- fill="#77B255"
- d="M30.661 22.857c1.973-.557 3.334.323 3.658 1.478.324 1.154-.378 2.615-2.35 3.17-.77.216-1.001.584-.97.701.034.118.425.312 1.193.095 1.972-.555 3.333.325 3.657 1.479.326 1.155-.378 2.614-2.351 3.17-.769.216-1.001.585-.967.702.033.117.423.311 1.192.095.53-.149 1.084.16 1.233.691.148.532-.161 1.084-.693 1.234-1.971.555-3.333-.323-3.659-1.479-.324-1.154.379-2.613 2.353-3.169.77-.217 1.001-.584.967-.702-.032-.117-.422-.312-1.19-.096-1.974.556-3.334-.322-3.659-1.479-.325-1.154.378-2.613 2.351-3.17.768-.215.999-.585.967-.701-.034-.118-.423-.312-1.192-.096-.532.15-1.083-.16-1.233-.691-.149-.53.161-1.082.693-1.232z"
- /><path
- fill="#AA8DD8"
- d="M23.001 20.16c-.294 0-.584-.129-.782-.375-.345-.432-.274-1.061.156-1.406.218-.175 5.418-4.259 12.767-3.208.547.078.927.584.849 1.131-.078.546-.58.93-1.132.848-6.493-.922-11.187 2.754-11.233 2.791-.186.148-.406.219-.625.219z"
- /><path
- fill="#77B255"
- d="M5.754 16c-.095 0-.192-.014-.288-.042-.529-.159-.829-.716-.67-1.245 1.133-3.773 2.16-9.794.898-11.364-.141-.178-.354-.353-.842-.316-.938.072-.849 2.051-.848 2.071.042.551-.372 1.031-.922 1.072-.559.034-1.031-.372-1.072-.923-.103-1.379.326-4.035 2.692-4.214 1.056-.08 1.933.287 2.552 1.057 2.371 2.951-.036 11.506-.542 13.192-.13.433-.528.712-.958.712z"
- /><circle fill="#5C913B" cx="25.5" cy="9.5" r="1.5" /><circle
- fill="#9266CC"
- cx="2"
- cy="18"
- r="2"
- /><circle fill="#5C913B" cx="32.5" cy="19.5" r="1.5" /><circle
- fill="#5C913B"
- cx="23.5"
- cy="31.5"
- r="1.5"
- /><circle fill="#FFCC4D" cx="28" cy="4" r="2" /><circle
- fill="#FFCC4D"
- cx="32.5"
- cy="8.5"
- r="1.5"
- /><circle fill="#FFCC4D" cx="29.5" cy="12.5" r="1.5" /><circle
- fill="#FFCC4D"
- cx="7.5"
- cy="23.5"
- r="1.5"
- /></svg
- >
- {:else}
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" class="h-9 w-8"
- ><path
- fill="#FFCC4D"
- d="M36 18c0 9.941-8.059 18-18 18S0 27.941 0 18 8.059 0 18 0s18 8.059 18 18"
- /><path
- fill="#664500"
- d="M22 27c0 2.763-1.791 3-4 3-2.21 0-4-.237-4-3 0-2.761 1.79-6 4-6 2.209 0 4 3.239 4 6zm8-12c-.124 0-.25-.023-.371-.072-5.229-2.091-7.372-5.241-7.461-5.374-.307-.46-.183-1.081.277-1.387.459-.306 1.077-.184 1.385.274.019.027 1.93 2.785 6.541 4.629.513.206.763.787.558 1.3-.157.392-.533.63-.929.63zM6 15c-.397 0-.772-.238-.929-.629-.205-.513.044-1.095.557-1.3 4.612-1.844 6.523-4.602 6.542-4.629.308-.456.929-.577 1.387-.27.457.308.581.925.275 1.383-.089.133-2.232 3.283-7.46 5.374C6.25 14.977 6.124 15 6 15z"
- /><path fill="#5DADEC" d="M24 16h4v19l-4-.046V16zM8 35l4-.046V16H8v19z" /><path
- fill="#664500"
- d="M14.999 18c-.15 0-.303-.034-.446-.105-3.512-1.756-7.07-.018-7.105 0-.495.249-1.095.046-1.342-.447-.247-.494-.047-1.095.447-1.342.182-.09 4.498-2.197 8.895 0 .494.247.694.848.447 1.342-.176.35-.529.552-.896.552zm14 0c-.15 0-.303-.034-.446-.105-3.513-1.756-7.07-.018-7.105 0-.494.248-1.094.047-1.342-.447-.247-.494-.047-1.095.447-1.342.182-.09 4.501-2.196 8.895 0 .494.247.694.848.447 1.342-.176.35-.529.552-.896.552z"
- /><ellipse fill="#5DADEC" cx="18" cy="34" rx="18" ry="2" /><ellipse
- fill="#E75A70"
- cx="18"
- cy="27"
- rx="3"
- ry="2"
- /></svg
- >
- {/if}
- </button>
- {/if}
- {/if}
- </div>
+ <UpdateAvailable />
<div class="flex flex-col space-y-2 py-2">
<a
sveltekit:prefetch
@@ -461,7 +300,7 @@
<path d="M21 21v-2a4 4 0 0 0 -3 -3.85" />
</svg>
</a>
- {#if $session.teamId === '0'}
+ {#if $appSession.teamId === '0'}
<a
sveltekit:prefetch
href="/settings"
@@ -516,14 +355,14 @@
>
<a
class="text-[10px] no-underline"
- href={`https://github.com/coollabsio/coolify/releases/tag/v${$session.version}`}
- target="_blank">v{$session.version}</a
+ href={`https://github.com/coollabsio/coolify/releases/tag/v${$appSession.version}`}
+ target="_blank">v{$appSession.version}</a
>
</div>
</div>
</div>
</nav>
- {#if $session.whiteLabeled}
+ {#if $appSession.whiteLabeled}
<span class="fixed bottom-0 left-[50px] z-50 m-2 px-4 text-xs text-stone-700"
>Powered by <a href="https://coolify.io" target="_blank">Coolify</a></span
>
diff --git a/src/routes/applications/[id]/secrets/_Secret.svelte b/apps/ui/src/routes/applications/[id]/_Secret.svelte
similarity index 86%
rename from src/routes/applications/[id]/secrets/_Secret.svelte
rename to apps/ui/src/routes/applications/[id]/_Secret.svelte
index 18ed868cec..52a2e2e77f 100644
--- a/src/routes/applications/[id]/secrets/_Secret.svelte
+++ b/apps/ui/src/routes/applications/[id]/_Secret.svelte
@@ -1,17 +1,17 @@
-<script>
+<script lang="ts">
export let name = '';
export let value = '';
export let isBuildSecret = false;
export let isNewSecret = false;
export let isPRMRSecret = false;
- export let PRMRSecret = {};
+ export let PRMRSecret: any = {};
if (isPRMRSecret) value = PRMRSecret.value;
import { page } from '$app/stores';
import { del } from '$lib/api';
+ import { errorNotification } from '$lib/common';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
- import { errorNotification } from '$lib/form';
import { t } from '$lib/translations';
import { toast } from '@zerodevx/svelte-toast';
import { createEventDispatcher } from 'svelte';
@@ -21,35 +21,41 @@
const { id } = $page.params;
async function removeSecret() {
try {
- await del(`/applications/${id}/secrets.json`, { name });
+ await del(`/applications/${id}/secrets`, { name });
dispatch('refresh');
if (isNewSecret) {
name = '';
value = '';
isBuildSecret = false;
}
- } catch ({ error }) {
+ toast.push('Secret removed.');
+ } catch (error) {
return errorNotification(error);
}
}
- async function createSecret(isNew) {
- await saveSecret({
- isNew,
- name,
- value,
- isBuildSecret,
- isPRMRSecret,
- isNewSecret,
- applicationId: id
- });
- if (isNewSecret) {
- name = '';
- value = '';
- isBuildSecret = false;
+ async function createSecret(isNew: any) {
+ try {
+ await saveSecret({
+ isNew,
+ name,
+ value,
+ isBuildSecret,
+ isPRMRSecret,
+ isNewSecret,
+ applicationId: id
+ });
+ if (isNewSecret) {
+ name = '';
+ value = '';
+ isBuildSecret = false;
+ }
+ dispatch('refresh');
+ toast.push('Secret saved.');
+ } catch (error) {
+ console.log(error)
+ return errorNotification(error);
}
- dispatch('refresh');
- toast.push('Secret saved');
}
async function setSecretValue() {
@@ -65,7 +71,7 @@
isNewSecret,
applicationId: id
});
- toast.push('Secret saved');
+ toast.push('Secret saved.');
}
}
}
diff --git a/apps/ui/src/routes/applications/[id]/_Setting.svelte b/apps/ui/src/routes/applications/[id]/_Setting.svelte
new file mode 100644
index 0000000000..d1cf55dc09
--- /dev/null
+++ b/apps/ui/src/routes/applications/[id]/_Setting.svelte
@@ -0,0 +1,73 @@
+<script lang="ts">
+ import Explainer from '$lib/components/Explainer.svelte';
+
+ export let setting: any;
+ export let title: any;
+ export let description: any;
+ export let isCenter = true;
+ export let disabled = false;
+ export let dataTooltip: any = null;
+ export let loading = false;
+</script>
+
+<div class="flex items-center py-4 pr-8">
+ <div class="flex w-96 flex-col">
+ <div class="text-xs font-bold text-stone-100 md:text-base">{title}</div>
+ <Explainer text={description} />
+ </div>
+</div>
+<div
+ class:tooltip={dataTooltip}
+ class:text-center={isCenter}
+ data-tooltip={dataTooltip}
+ class="flex justify-center"
+>
+ <div
+ type="button"
+ on:click
+ aria-pressed="false"
+ class="relative mx-20 inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out"
+ class:opacity-50={disabled || loading}
+ class:bg-green-600={!loading && setting}
+ class:bg-stone-700={!loading && !setting}
+ class:bg-yellow-500={loading}
+ >
+ <span class="sr-only">Use setting</span>
+ <span
+ class="pointer-events-none relative inline-block h-5 w-5 transform rounded-full bg-white shadow transition duration-200 ease-in-out"
+ class:translate-x-5={setting}
+ class:translate-x-0={!setting}
+ >
+ <span
+ class=" absolute inset-0 flex h-full w-full items-center justify-center transition-opacity duration-200 ease-in"
+ class:opacity-0={setting}
+ class:opacity-100={!setting}
+ class:animate-spin={loading}
+ aria-hidden="true"
+ >
+ <svg class="h-3 w-3 bg-white text-red-600" fill="none" viewBox="0 0 12 12">
+ <path
+ d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ />
+ </svg>
+ </span>
+ <span
+ class="absolute inset-0 flex h-full w-full items-center justify-center transition-opacity duration-100 ease-out"
+ aria-hidden="true"
+ class:opacity-100={setting}
+ class:opacity-0={!setting}
+ class:animate-spin={loading}
+ >
+ <svg class="h-3 w-3 bg-white text-green-600" fill="currentColor" viewBox="0 0 12 12">
+ <path
+ d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"
+ />
+ </svg>
+ </span>
+ </span>
+ </div>
+</div>
diff --git a/src/routes/applications/[id]/storage/_Storage.svelte b/apps/ui/src/routes/applications/[id]/_Storage.svelte
similarity index 91%
rename from src/routes/applications/[id]/storage/_Storage.svelte
rename to apps/ui/src/routes/applications/[id]/_Storage.svelte
index 363c933900..868f95e547 100644
--- a/src/routes/applications/[id]/storage/_Storage.svelte
+++ b/apps/ui/src/routes/applications/[id]/_Storage.svelte
@@ -1,6 +1,6 @@
<script lang="ts">
export let isNew = false;
- export let storage = {
+ export let storage: any = {
id: null,
path: null
};
@@ -8,9 +8,9 @@
import { page } from '$app/stores';
import { createEventDispatcher } from 'svelte';
- import { errorNotification } from '$lib/form';
import { toast } from '@zerodevx/svelte-toast';
import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
const { id } = $page.params;
const dispatch = createEventDispatcher();
@@ -20,7 +20,7 @@
storage.path = storage.path.startsWith('/') ? storage.path : `/${storage.path}`;
storage.path = storage.path.endsWith('/') ? storage.path.slice(0, -1) : storage.path;
storage.path.replace(/\/\//g, '/');
- await post(`/applications/${id}/storage.json`, {
+ await post(`/applications/${id}/storages`, {
path: storage.path,
storageId: storage.id,
newStorage
@@ -38,7 +38,7 @@
}
async function removeStorage() {
try {
- await del(`/applications/${id}/storage.json`, { path: storage.path });
+ await del(`/applications/${id}/storages`, { path: storage.path });
dispatch('refresh');
toast.push($t('application.storage.storage_deleted'));
} catch ({ error }) {
diff --git a/src/routes/applications/[id]/__layout.svelte b/apps/ui/src/routes/applications/[id]/__layout.svelte
similarity index 78%
rename from src/routes/applications/[id]/__layout.svelte
rename to apps/ui/src/routes/applications/[id]/__layout.svelte
index 3662f289ac..49ac65b911 100644
--- a/src/routes/applications/[id]/__layout.svelte
+++ b/apps/ui/src/routes/applications/[id]/__layout.svelte
@@ -1,6 +1,6 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- function checkConfiguration(application): string {
+ function checkConfiguration(application: any): string | null {
let configurationPhase = null;
if (!application.gitSourceId) {
configurationPhase = 'source';
@@ -14,23 +14,15 @@
return configurationPhase;
}
export const load: Load = async ({ fetch, url, params }) => {
- const endpoint = `/applications/${params.id}.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
- let { application, appId, githubToken, gitlabToken } = await res.json();
+ try {
+ const response = await get(`/applications/${params.id}`);
+ let { application, appId, settings, isQueueActive } = response;
if (!application || Object.entries(application).length === 0) {
return {
status: 302,
redirect: '/applications'
};
}
- if (application.gitSource?.githubAppId && !githubToken) {
- const response = await fetch(`/applications/${params.id}/configuration/githubToken.json`);
- if (response.ok) {
- const { token } = await response.json();
- githubToken = token;
- }
- }
const configurationPhase = checkConfiguration(application);
if (
configurationPhase &&
@@ -44,47 +36,40 @@
return {
props: {
- application,
- githubToken,
- gitlabToken
+ isQueueActive,
+ application
},
stuff: {
application,
- appId
+ appId,
+ settings
}
};
+ } catch (error) {
+ return handlerNotFoundLoad(error, url);
}
-
- return {
- status: 302,
- redirect: '/applications'
- };
};
</script>
<script lang="ts">
- export let application;
- export let githubToken;
- export let gitlabToken;
- import { page, session } from '$app/stores';
- import { errorNotification } from '$lib/form';
+ export let application: any;
+ export let isQueueActive: any;
+
+ import { page } from '$app/stores';
import DeleteIcon from '$lib/components/DeleteIcon.svelte';
- import Loading from '$lib/components/Loading.svelte';
import { del, get, post } from '$lib/api';
import { goto } from '$app/navigation';
- import { gitTokens, status } from '$lib/store';
import { toast } from '@zerodevx/svelte-toast';
- import { disabledButton } from '$lib/store';
import { onDestroy, onMount } from 'svelte';
import { t } from '$lib/translations';
-
- if (githubToken) $gitTokens.githubToken = githubToken;
- if (gitlabToken) $gitTokens.gitlabToken = gitlabToken;
+ import { appSession, disabledButton, status } from '$lib/store';
+ import { errorNotification, handlerNotFoundLoad } from '$lib/common';
+ import Loading from '$lib/components/Loading.svelte';
let loading = false;
- let statusInterval;
+ let statusInterval: any;
$disabledButton =
- !$session.isAdmin ||
+ !$appSession.isAdmin ||
!application.fqdn ||
!application.gitSource ||
!application.repository ||
@@ -94,7 +79,7 @@
async function handleDeploySubmit() {
try {
- const { buildId } = await post(`/applications/${id}/deploy.json`, { ...application });
+ const { buildId } = await post(`/applications/${id}/deploy`, { ...application });
toast.push($t('application.deployment_queued'));
if ($page.url.pathname.startsWith(`/applications/${id}/logs/build`)) {
return window.location.assign(`/applications/${id}/logs/build?buildId=${buildId}`);
@@ -103,19 +88,19 @@
replaceState: true
});
}
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
- async function deleteApplication(name) {
+ async function deleteApplication(name: string) {
const sure = confirm($t('application.confirm_to_delete', { name }));
if (sure) {
loading = true;
try {
- await del(`/applications/${id}/delete.json`, { id });
+ await del(`/applications/${id}`, { id });
return await goto(`/applications`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
@@ -123,7 +108,7 @@
async function stopApplication() {
try {
loading = true;
- await post(`/applications/${id}/stop.json`, {});
+ await post(`/applications/${id}/stop`, {});
return window.location.reload();
} catch ({ error }) {
return errorNotification(error);
@@ -132,7 +117,7 @@
async function getStatus() {
if ($status.application.loading) return;
$status.application.loading = true;
- const data = await get(`/applications/${id}/status.json`);
+ const data = await get(`/applications/${id}`);
$status.application.isRunning = data.isRunning;
$status.application.isExited = data.isExited;
$status.application.loading = false;
@@ -143,17 +128,14 @@
clearInterval(statusInterval);
});
onMount(async () => {
- if (!application.gitSourceId || !application.destinationDockerId || !application.fqdn) {
- $status.application.initialLoading = false;
- $status.application.isRunning = false;
- $status.application.isExited = false;
- $status.application.loading = false;
- return;
- } else {
+ $status.application.isRunning = false;
+ $status.application.isExited = false;
+ $status.application.loading = false;
+ if (application.gitSourceId && application.destinationDockerId && application.fqdn) {
await getStatus();
statusInterval = setInterval(async () => {
await getStatus();
- }, 1000);
+ }, 2000);
}
});
</script>
@@ -165,13 +147,13 @@
{#if $status.application.isExited}
<a
href={!$disabledButton ? `/applications/${id}/logs` : null}
- class=" icons tooltip-bottom tooltip-red-500 flex items-center bg-transparent text-sm text-red-500"
+ class=" icons bg-transparent tooltip-bottom text-sm flex items-center text-red-500 tooltip-red-500"
data-tooltip="Application exited with an error!"
sveltekit:prefetch
>
<svg
xmlns="http://www.w3.org/2000/svg"
- class="h-6 w-6"
+ class="w-6 h-6"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentcolor"
@@ -217,14 +199,14 @@
title="Stop application"
type="submit"
disabled={$disabledButton}
- class="icons tooltip-bottom flex items-center space-x-2 bg-transparent text-sm text-red-500"
- data-tooltip={$session.isAdmin
+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-red-500"
+ data-tooltip={$appSession.isAdmin
? $t('application.stop_application')
: $t('application.permission_denied_stop_application')}
>
<svg
xmlns="http://www.w3.org/2000/svg"
- class="h-6 w-6"
+ class="w-6 h-6"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
@@ -241,15 +223,18 @@
<button
title="Rebuild application"
type="submit"
- disabled={$disabledButton}
- class="icons tooltip-bottom flex items-center space-x-2 bg-transparent text-sm hover:text-green-500"
- data-tooltip={$session.isAdmin
- ? 'Rebuild application'
+ disabled={$disabledButton || !isQueueActive}
+ class:hover:text-green-500={isQueueActive}
+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2"
+ data-tooltip={$appSession.isAdmin
+ ? isQueueActive
+ ? 'Rebuild application'
+ : 'Autoupdate inprogress. Cannot rebuild application.'
: 'You do not have permission to rebuild application.'}
>
<svg
xmlns="http://www.w3.org/2000/svg"
- class="h-6 w-6"
+ class="w-6 h-6"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
@@ -271,14 +256,14 @@
title="Build and start application"
type="submit"
disabled={$disabledButton}
- class="icons tooltip-bottom flex items-center space-x-2 bg-transparent text-sm text-green-500"
- data-tooltip={$session.isAdmin
+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-green-500"
+ data-tooltip={$appSession.isAdmin
? 'Build and start application'
: 'You do not have permission to Build and start application.'}
>
<svg
xmlns="http://www.w3.org/2000/svg"
- class="h-6 w-6"
+ class="w-6 h-6"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
@@ -293,18 +278,18 @@
</form>
{/if}
- <div class="h-8 border border-coolgray-500" />
+ <div class="border border-coolgray-500 h-8" />
<a
href={!$disabledButton ? `/applications/${id}` : null}
sveltekit:prefetch
- class="rounded hover:text-yellow-500"
+ class="hover:text-yellow-500 rounded"
class:text-yellow-500={$page.url.pathname === `/applications/${id}`}
class:bg-coolgray-500={$page.url.pathname === `/applications/${id}`}
>
<button
title="Configurations"
disabled={$disabledButton}
- class="icons tooltip-bottom bg-transparent text-sm"
+ class="icons bg-transparent tooltip-bottom text-sm"
data-tooltip="Configurations"
>
<svg
@@ -333,19 +318,19 @@
<a
href={!$disabledButton ? `/applications/${id}/secrets` : null}
sveltekit:prefetch
- class="rounded hover:text-pink-500"
+ class="hover:text-pink-500 rounded"
class:text-pink-500={$page.url.pathname === `/applications/${id}/secrets`}
class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/secrets`}
>
<button
title="Secret"
disabled={$disabledButton}
- class="icons tooltip-bottom bg-transparent text-sm"
+ class="icons bg-transparent tooltip-bottom text-sm"
data-tooltip="Secret"
>
<svg
xmlns="http://www.w3.org/2000/svg"
- class="h-6 w-6"
+ class="w-6 h-6"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
@@ -363,21 +348,21 @@
></a
>
<a
- href={!$disabledButton ? `/applications/${id}/storage` : null}
+ href={!$disabledButton ? `/applications/${id}/storages` : null}
sveltekit:prefetch
- class="rounded hover:text-pink-500"
- class:text-pink-500={$page.url.pathname === `/applications/${id}/storage`}
- class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/storage`}
+ class="hover:text-pink-500 rounded"
+ class:text-pink-500={$page.url.pathname === `/applications/${id}/storages`}
+ class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/storages`}
>
<button
- title="Persistent Storage"
+ title="Persistent Storages"
disabled={$disabledButton}
- class="icons tooltip-bottom bg-transparent text-sm"
- data-tooltip="Persistent Storage"
+ class="icons bg-transparent tooltip-bottom text-sm"
+ data-tooltip="Persistent Storages"
>
<svg
xmlns="http://www.w3.org/2000/svg"
- class="h-6 w-6"
+ class="w-6 h-6"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
@@ -395,19 +380,19 @@
<a
href={!$disabledButton ? `/applications/${id}/previews` : null}
sveltekit:prefetch
- class="rounded hover:text-orange-500"
+ class="hover:text-orange-500 rounded"
class:text-orange-500={$page.url.pathname === `/applications/${id}/previews`}
class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/previews`}
>
<button
title="Previews"
disabled={$disabledButton}
- class="icons tooltip-bottom bg-transparent text-sm"
+ class="icons bg-transparent tooltip-bottom text-sm"
data-tooltip="Previews"
>
<svg
xmlns="http://www.w3.org/2000/svg"
- class="h-6 w-6"
+ class="w-6 h-6"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
@@ -424,18 +409,18 @@
</svg></button
></a
>
- <div class="h-8 border border-coolgray-500" />
+ <div class="border border-coolgray-500 h-8" />
<a
href={!$disabledButton && $status.application.isRunning ? `/applications/${id}/logs` : null}
sveltekit:prefetch
- class="rounded hover:text-sky-500"
+ class="hover:text-sky-500 rounded"
class:text-sky-500={$page.url.pathname === `/applications/${id}/logs`}
class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/logs`}
>
<button
title={$t('application.logs')}
disabled={$disabledButton || !$status.application.isRunning}
- class="icons tooltip-bottom bg-transparent text-sm"
+ class="icons bg-transparent tooltip-bottom text-sm"
data-tooltip={$t('application.logs')}
>
<svg
@@ -460,14 +445,14 @@
<a
href={!$disabledButton ? `/applications/${id}/logs/build` : null}
sveltekit:prefetch
- class="rounded hover:text-red-500"
+ class="hover:text-red-500 rounded"
class:text-red-500={$page.url.pathname === `/applications/${id}/logs/build`}
class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/logs/build`}
>
<button
title="Build Logs"
disabled={$disabledButton}
- class="icons tooltip-bottom bg-transparent text-sm"
+ class="icons bg-transparent tooltip-bottom text-sm"
data-tooltip="Build Logs"
>
<svg
@@ -492,16 +477,16 @@
</svg>
</button></a
>
- <div class="h-8 border border-coolgray-500" />
+ <div class="border border-coolgray-500 h-8" />
<button
on:click={() => deleteApplication(application.name)}
title={$t('application.delete_application')}
type="submit"
- disabled={!$session.isAdmin}
- class:hover:text-red-500={$session.isAdmin}
- class="icons tooltip-bottom bg-transparent text-sm"
- data-tooltip={$session.isAdmin
+ disabled={!$appSession.isAdmin}
+ class:hover:text-red-500={$appSession.isAdmin}
+ class="icons bg-transparent tooltip-bottom text-sm"
+ data-tooltip={$appSession.isAdmin
? $t('application.delete_application')
: $t('application.permission_denied_delete_application')}
>
diff --git a/src/routes/applications/[id]/configuration/_BuildPack.svelte b/apps/ui/src/routes/applications/[id]/configuration/_BuildPack.svelte
similarity index 73%
rename from src/routes/applications/[id]/configuration/_BuildPack.svelte
rename to apps/ui/src/routes/applications/[id]/configuration/_BuildPack.svelte
index 80dac57665..93e336dc60 100644
--- a/src/routes/applications/[id]/configuration/_BuildPack.svelte
+++ b/apps/ui/src/routes/applications/[id]/configuration/_BuildPack.svelte
@@ -3,19 +3,19 @@
import { page } from '$app/stores';
import { post } from '$lib/api';
- import { findBuildPack } from '$lib/components/templates';
- import { errorNotification } from '$lib/form';
+ import { errorNotification } from '$lib/common';
+ import { findBuildPack } from '$lib/templates';
import { t } from '$lib/translations';
const { id } = $page.params;
const from = $page.url.searchParams.get('from');
- export let buildPack;
- export let foundConfig;
- export let scanning;
- export let packageManager;
+ export let buildPack: any;
+ export let foundConfig: any;
+ export let scanning: any;
+ export let packageManager: any;
- async function handleSubmit(name) {
+ async function handleSubmit(name: string) {
try {
const tempBuildPack = JSON.parse(
JSON.stringify(findBuildPack(buildPack.name, packageManager))
@@ -27,11 +27,11 @@
delete tempBuildPack.hoverColor;
if (foundConfig.buildPack !== name) {
- await post(`/applications/${id}.json`, { ...tempBuildPack, buildPack: name });
+ await post(`/applications/${id}`, { ...tempBuildPack, buildPack: name });
}
- await post(`/applications/${id}/configuration/buildpack.json`, { buildPack: name });
+ await post(`/applications/${id}/configuration/buildpack`, { buildPack: name });
return await goto(from || `/applications/${id}`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
diff --git a/src/routes/applications/[id]/configuration/_GithubRepositories.svelte b/apps/ui/src/routes/applications/[id]/configuration/_GithubRepositories.svelte
similarity index 71%
rename from src/routes/applications/[id]/configuration/_GithubRepositories.svelte
rename to apps/ui/src/routes/applications/[id]/configuration/_GithubRepositories.svelte
index 8b5b932cdb..b0efbfac2c 100644
--- a/src/routes/applications/[id]/configuration/_GithubRepositories.svelte
+++ b/apps/ui/src/routes/applications/[id]/configuration/_GithubRepositories.svelte
@@ -1,13 +1,14 @@
<script lang="ts">
- export let application;
+ export let application: any;
+ //@ts-ignore
import Select from 'svelte-select';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { get, post } from '$lib/api';
- import { errorNotification } from '$lib/form';
import { onMount } from 'svelte';
- import { gitTokens } from '$lib/store';
+ import { appSession } from '$lib/store';
import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
const { id } = $page.params;
const from = $page.url.searchParams.get('from');
@@ -20,8 +21,8 @@
repositories: true,
branches: false
};
- let repositories = [];
- let branches = [];
+ let repositories: any = [];
+ let branches: any = [];
let selected = {
projectId: undefined,
@@ -33,18 +34,18 @@
async function loadRepositoriesByPage(page = 0) {
return await get(`${apiUrl}/installation/repositories?per_page=100&page=${page}`, {
- Authorization: `token ${$gitTokens.githubToken}`
+ Authorization: `token ${$appSession.tokens.github}`
});
}
async function loadBranchesByPage(page = 0) {
return await get(`${apiUrl}/repos/${selected.repository}/branches?per_page=100&page=${page}`, {
- Authorization: `token ${$gitTokens.githubToken}`
+ Authorization: `token ${$appSession.tokens.github}`
});
}
- let reposSelectOptions;
- let branchSelectOptions;
+ let reposSelectOptions: any;
+ let branchSelectOptions: any;
async function loadRepositories() {
let page = 1;
@@ -60,15 +61,17 @@
}
}
loading.repositories = false;
- reposSelectOptions = repositories.map((repo) => ({
+ reposSelectOptions = repositories.map((repo: any) => ({
value: repo.full_name,
label: repo.name
}));
}
- async function loadBranches(event) {
+ async function loadBranches(event: any) {
branches = [];
selected.repository = event.detail.value;
- selected.projectId = repositories.find((repo) => repo.full_name === selected.repository).id;
+ selected.projectId = repositories.find(
+ (repo: any) => repo.full_name === selected.repository
+ ).id;
let page = 1;
let branchCount = 0;
loading.branches = true;
@@ -84,16 +87,16 @@
}
}
loading.branches = false;
- branchSelectOptions = branches.map((branch) => ({
+ branchSelectOptions = branches.map((branch: any) => ({
value: branch.name,
label: branch.name
}));
}
- async function isBranchAlreadyUsed(event) {
+ async function isBranchAlreadyUsed(event: any) {
selected.branch = event.detail.value;
try {
const data = await get(
- `/applications/${id}/configuration/repository.json?repository=${selected.repository}&branch=${selected.branch}`
+ `/applications/${id}/configuration/repository?repository=${selected.repository}&branch=${selected.branch}`
);
if (data.used) {
const sure = confirm($t('application.configuration.branch_already_in_use'));
@@ -114,42 +117,15 @@
onMount(async () => {
try {
- if (!$gitTokens.githubToken) {
- const { token } = await get(`/applications/${id}/configuration/githubToken.json`);
- $gitTokens.githubToken = token;
+ if (!$appSession.tokens.github) {
+ const { token } = await get(`/applications/${id}/configuration/githubToken`);
+ $appSession.tokens.github = token;
}
await loadRepositories();
- } catch (error) {
- if (
- error.error === 'invalid_token' ||
- error.error_description ===
- 'Token is expired. You can either do re-authorization or token refresh.' ||
- error.message === '401 Unauthorized'
- ) {
- if (application.gitSource.gitlabAppId) {
- let htmlUrl = application.gitSource.htmlUrl;
- const left = screen.width / 2 - 1020 / 2;
- const top = screen.height / 2 - 618 / 2;
- const newWindow = open(
- `${htmlUrl}/oauth/authorize?client_id=${application.gitSource.gitlabApp.appId}&redirect_uri=${window.location.origin}/webhooks/gitlab&response_type=code&scope=api+email+read_repository&state=${$page.params.id}`,
- 'GitLab',
- 'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' +
- top +
- ', left=' +
- left +
- ', toolbar=0, menubar=0, status=0'
- );
- const timer = setInterval(() => {
- if (newWindow?.closed) {
- clearInterval(timer);
- window.location.reload();
- }
- }, 100);
- }
- }
+ } catch (error: any) {
if (error.message === 'Bad credentials') {
- const { token } = await get(`/applications/${id}/configuration/githubToken.json`);
- $gitTokens.githubToken = token;
+ const { token } = await get(`/applications/${id}/configuration/githubToken`);
+ $appSession.tokens.github = token;
return await loadRepositories();
}
return errorNotification(error);
@@ -157,7 +133,7 @@
});
async function handleSubmit() {
try {
- await post(`/applications/${id}/configuration/repository.json`, { ...selected });
+ await post(`/applications/${id}/configuration/repository`, { ...selected });
if (to) {
return await goto(`${to}?from=${from}`);
}
@@ -178,7 +154,7 @@
{:else}
<form on:submit|preventDefault={handleSubmit} class="flex flex-col justify-center text-center">
<div class="flex-col space-y-3 md:space-y-0 space-x-1">
- <div class="flex-col md:flex gap-4">
+ <div class="flex-row md:flex gap-4">
<div class="custom-select-wrapper">
<Select
placeholder={loading.repositories
diff --git a/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte b/apps/ui/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte
similarity index 67%
rename from src/routes/applications/[id]/configuration/_GitlabRepositories.svelte
rename to apps/ui/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte
index f517c14b4a..453a866769 100644
--- a/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte
+++ b/apps/ui/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte
@@ -1,21 +1,26 @@
<script lang="ts">
- export let application;
- export let appId;
- import Select from 'svelte-select';
- import { page, session } from '$app/stores';
+ export let application: any;
+ export let appId: any;
+ export let settings: any;
+ //@ts-ignore
+ import cuid from 'cuid';
+ import { page } from '$app/stores';
import { onMount } from 'svelte';
- import { errorNotification } from '$lib/form';
import { dev } from '$app/env';
- import cuid from 'cuid';
import { goto } from '$app/navigation';
- import { del, get, post, put } from '$lib/api';
- import { gitTokens } from '$lib/store';
+ import { del, get, post } from '$lib/api';
import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
+ import { appSession } from '$lib/store';
+ import Select from 'svelte-select';
const { id } = $page.params;
const from = $page.url.searchParams.get('from');
- const updateDeployKeyIdUrl = `/applications/${id}/configuration/deploykey.json`;
+ let url = settings?.fqdn ? settings.fqdn : window.location.origin;
+ if (dev) url = `http://localhost:3001`;
+
+ const updateDeployKeyIdUrl = `/applications/${id}/configuration/deploykey`;
let loading = {
base: true,
@@ -27,167 +32,156 @@
let htmlUrl = application.gitSource.htmlUrl;
let apiUrl = application.gitSource.apiUrl;
- let username = null;
- let groups = [];
- let projects = [];
- let branches = [];
+ let username: any = null;
+ let groups: any = [];
+ let projects: any = [];
+ let branches: any = [];
let showSave = false;
let autodeploy = application.settings.autodeploy || true;
- let search = {
- project: '',
- branch: ''
- };
- let selected = {
+ let selected: any = {
group: undefined,
project: undefined,
branch: undefined
};
+ let search = {
+ project: '',
+ branch: ''
+ };
onMount(async () => {
- if (!$gitTokens.gitlabToken) {
- getGitlabToken();
- } else {
- loading.base = true;
- try {
- const user = await get(`${apiUrl}/v4/user`, {
- Authorization: `Bearer ${$gitTokens.gitlabToken}`
- });
- username = user.username;
- } catch (error) {
- return getGitlabToken();
- }
- try {
- groups = await get(`${apiUrl}/v4/groups?per_page=5000`, {
- Authorization: `Bearer ${$gitTokens.gitlabToken}`
- });
- } catch (error) {
- errorNotification(error);
- throw new Error(error);
- } finally {
- loading.base = false;
- }
+ if (!$appSession.tokens.gitlab) {
+ await getGitlabToken();
+ }
+ loading.base = true;
+ try {
+ const user = await get(`${apiUrl}/v4/user`, {
+ Authorization: `Bearer ${$appSession.tokens.gitlab}`
+ });
+ username = user.username;
+ } catch (error) {
+ return await getGitlabToken();
+ }
+ try {
+ groups = await get(`${apiUrl}/v4/groups?per_page=5000`, {
+ Authorization: `Bearer ${$appSession.tokens.gitlab}`
+ });
+ } catch (error: any) {
+ errorNotification(error);
+ throw new Error(error);
+ } finally {
+ loading.base = false;
}
});
-
- function getGitlabToken() {
- const left = screen.width / 2 - 1020 / 2;
- const top = screen.height / 2 - 618 / 2;
- const newWindow = open(
- `${htmlUrl}/oauth/authorize?client_id=${application.gitSource.gitlabApp.appId}&redirect_uri=${window.location.origin}/webhooks/gitlab&response_type=code&scope=api+email+read_repository&state=${$page.params.id}`,
- 'GitLab',
- 'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' +
- top +
- ', left=' +
- left +
- ', toolbar=0, menubar=0, status=0'
- );
- const timer = setInterval(() => {
- if (newWindow?.closed) {
- clearInterval(timer);
- window.location.reload();
- }
- }, 100);
- }
-
- function selectGroup(event) {
+ function selectGroup(event: any) {
selected.group = event.detail;
selected.project = null;
selected.branch = null;
showSave = false;
loadProjects();
}
-
- async function searchProjects(searchText) {
+ async function searchProjects(searchText: any) {
if (!selected.group) {
return;
}
-
search.project = searchText;
await loadProjects();
return projects;
}
-
- function selectProject(event) {
+ function selectProject(event: any) {
selected.project = event.detail;
selected.branch = null;
showSave = false;
loadBranches();
}
+ async function getGitlabToken() {
+ return await new Promise<void>((resolve, reject) => {
+ const left = screen.width / 2 - 1020 / 2;
+ const top = screen.height / 2 - 618 / 2;
+ const newWindow = open(
+ `${htmlUrl}/oauth/authorize?client_id=${application.gitSource.gitlabApp.appId}&redirect_uri=${url}/webhooks/gitlab&response_type=code&scope=api+email+read_repository&state=${$page.params.id}`,
+ 'GitLab',
+ 'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' +
+ top +
+ ', left=' +
+ left +
+ ', toolbar=0, menubar=0, status=0'
+ );
+ const timer = setInterval(() => {
+ if (newWindow?.closed) {
+ clearInterval(timer);
+ $appSession.tokens.gitlab = localStorage.getItem('gitLabToken');
+ localStorage.removeItem('gitLabToken');
+ resolve();
+ }
+ }, 100);
+ });
+ }
async function loadProjects() {
- const params = new URLSearchParams({
+ //@ts-ignore
+ const params: any = new URLSearchParams({
page: 1,
per_page: 25,
archived: false
});
-
if (search.project) {
params.append('search', search.project);
}
-
loading.projects = true;
if (username === selected.group.name) {
try {
params.append('min_access_level', 40);
projects = await get(`${apiUrl}/v4/users/${selected.group.name}/projects?${params}`, {
- Authorization: `Bearer ${$gitTokens.gitlabToken}`
+ Authorization: `Bearer ${$appSession.tokens.gitlab}`
});
} catch (error) {
- errorNotification(error);
- throw new Error(error);
+ return errorNotification(error);
} finally {
loading.projects = false;
}
} else {
try {
projects = await get(`${apiUrl}/v4/groups/${selected.group.id}/projects?${params}`, {
- Authorization: `Bearer ${$gitTokens.gitlabToken}`
+ Authorization: `Bearer ${$appSession.tokens.gitlab}`
});
} catch (error) {
- errorNotification(error);
- throw new Error(error);
+ return errorNotification(error);
} finally {
loading.projects = false;
}
}
}
-
- async function searchBranches(searchText) {
+ async function searchBranches(searchText: any) {
if (!selected.project) {
return;
}
-
search.branch = searchText;
await loadBranches();
return branches;
}
-
- function selectBranch(event) {
+ function selectBranch(event: any) {
selected.branch = event.detail;
isBranchAlreadyUsed();
}
-
async function loadBranches() {
+ //@ts-ignore
const params = new URLSearchParams({
page: 1,
per_page: 100
});
-
if (search.branch) {
params.append('search', search.branch);
}
-
loading.branches = true;
try {
branches = await get(
`${apiUrl}/v4/projects/${selected.project.id}/repository/branches?${params}`,
{
- Authorization: `Bearer ${$gitTokens.gitlabToken}`
+ Authorization: `Bearer ${$appSession.tokens.gitlab}`
}
);
} catch (error) {
- errorNotification(error);
- throw new Error(error);
+ return errorNotification(error);
} finally {
loading.branches = false;
}
@@ -196,7 +190,7 @@
async function isBranchAlreadyUsed() {
try {
const data = await get(
- `/applications/${id}/configuration/repository.json?repository=${selected.project.path_with_namespace}&branch=${selected.branch.name}`
+ `/applications/${id}/configuration/repository?repository=${selected.project.path_with_namespace}&branch=${selected.branch.name}`
);
if (data.used) {
const sure = confirm($t('application.configuration.branch_already_in_use'));
@@ -213,15 +207,14 @@
return errorNotification(error);
}
}
- async function checkSSHKey(sshkeyUrl) {
+ async function checkSSHKey(sshkeyUrl: any) {
try {
return await post(sshkeyUrl, {});
} catch (error) {
- errorNotification(error);
- throw new Error(error);
+ return errorNotification(error);
}
}
- async function setWebhook(url, webhookToken) {
+ async function setWebhook(url: any, webhookToken: any) {
const host = dev
? 'https://webhook.site/0e5beb2c-4e9b-40e2-a89e-32295e570c21'
: `${window.location.origin}/webhooks/gitlab/events`;
@@ -237,12 +230,11 @@
merge_requests_events: true
},
{
- Authorization: `Bearer ${$gitTokens.gitlabToken}`
+ Authorization: `Bearer ${$appSession.tokens.gitlab}`
}
);
} catch (error) {
- errorNotification(error);
- throw error;
+ return errorNotification(error);
}
}
async function save() {
@@ -251,26 +243,28 @@
let publicSshKey = application.gitSource.gitlabApp.publicSshKey;
const deployKeyUrl = `${apiUrl}/v4/projects/${selected.project.id}/deploy_keys`;
- const sshkeyUrl = `/applications/${id}/configuration/sshkey.json`;
+ const sshkeyUrl = `/applications/${id}/configuration/sshkey`;
const webhookUrl = `${apiUrl}/v4/projects/${selected.project.id}/hooks`;
const webhookToken = cuid();
try {
if (!privateSshKey || !publicSshKey) {
- const { publicKey } = await checkSSHKey(sshkeyUrl);
- publicSshKey = publicKey;
+ const data: any = await checkSSHKey(sshkeyUrl);
+ publicSshKey = data.publicKey;
}
const deployKeys = await get(deployKeyUrl, {
- Authorization: `Bearer ${$gitTokens.gitlabToken}`
+ Authorization: `Bearer ${$appSession.tokens.gitlab}`
});
- const deployKeyFound = deployKeys.filter((dk) => dk.title === `${appId}-coolify-deploy-key`);
+ const deployKeyFound = deployKeys.filter(
+ (dk: any) => dk.title === `${appId}-coolify-deploy-key`
+ );
if (deployKeyFound.length > 0) {
for (const deployKey of deployKeyFound) {
await del(
`${deployKeyUrl}/${deployKey.id}`,
{},
{
- Authorization: `Bearer ${$gitTokens.gitlabToken}`
+ Authorization: `Bearer ${$appSession.tokens.gitlab}`
}
);
}
@@ -283,23 +277,25 @@
can_push: false
},
{
- Authorization: `Bearer ${$gitTokens.gitlabToken}`
+ Authorization: `Bearer ${$appSession.tokens.gitlab}`
}
);
await post(updateDeployKeyIdUrl, { deployKeyId: id });
} catch (error) {
- console.log(error);
- throw new Error(error);
+ return errorNotification(error);
+ } finally {
+ loading.save = false;
}
try {
await setWebhook(webhookUrl, webhookToken);
- } catch (err) {
- console.log(err);
- if (!dev) throw new Error(err);
+ } catch (error) {
+ return errorNotification(error);
+ } finally {
+ loading.save = false;
}
- const url = `/applications/${id}/configuration/repository.json`;
+ const url = `/applications/${id}/configuration/repository`;
try {
const repository = selected.project.path_with_namespace;
await post(url, {
@@ -310,15 +306,17 @@
webhookToken
});
return await goto(from || `/applications/${id}/configuration/buildpack`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
+ } finally {
+ loading.save = false;
}
}
async function handleSubmit() {
try {
- await post(`/applications/{id}/configuration/repository.json`, { ...selected });
+ await post(`/applications/${id}/configuration/repository`, { ...selected });
return await goto(from || `/applications/${id}/configuration/destination`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
diff --git a/src/routes/applications/[id]/configuration/buildpack.svelte b/apps/ui/src/routes/applications/[id]/configuration/buildpack.svelte
similarity index 58%
rename from src/routes/applications/[id]/configuration/buildpack.svelte
rename to apps/ui/src/routes/applications/[id]/configuration/buildpack.svelte
index 7fe2c95ad1..8515bc2bd8 100644
--- a/src/routes/applications/[id]/configuration/buildpack.svelte
+++ b/apps/ui/src/routes/applications/[id]/configuration/buildpack.svelte
@@ -1,60 +1,58 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- const { application } = stuff;
- if (application?.buildPack && !url.searchParams.get('from')) {
- return {
- status: 302,
- redirect: `/applications/${params.id}`
- };
- }
- const endpoint = `/applications/${params.id}/configuration/buildpack.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
+ try {
+ const { application } = stuff;
+ if (application?.buildPack && !url.searchParams.get('from')) {
+ return {
+ status: 302,
+ redirect: `/applications/${params.id}`
+ };
+ }
+ const response = await get(`/applications/${params.id}/configuration/buildpack`);
return {
props: {
- ...(await res.json()),
- application
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
import { onMount } from 'svelte';
- import { buildPacks, findBuildPack, scanningTemplates } from '$lib/components/templates';
- import BuildPack from './_BuildPack.svelte';
import { page } from '$app/stores';
import { get } from '$lib/api';
- import { errorNotification } from '$lib/form';
- import { gitTokens } from '$lib/store';
+ import { appSession } from '$lib/store';
import { browser } from '$app/env';
import { t } from '$lib/translations';
+ import { buildPacks, findBuildPack, scanningTemplates } from '$lib/templates';
+ import { errorNotification } from '$lib/common';
+ import BuildPack from './_BuildPack.svelte';
const { id } = $page.params;
let scanning = true;
- let foundConfig = null;
+ let foundConfig: any = null;
let packageManager = 'npm';
- export let apiUrl;
- export let projectId;
- export let repository;
- export let branch;
- export let type;
- export let application;
+ export let apiUrl: any;
+ export let projectId: any;
+ export let repository: any;
+ export let branch: any;
+ export let type: any;
+ export let application: any;
- function checkPackageJSONContents({ key, json }) {
+ function checkPackageJSONContents({ key, json }: { key: any; json: any }) {
return json?.dependencies?.hasOwnProperty(key) || json?.devDependencies?.hasOwnProperty(key);
}
- function checkTemplates({ json, packageManager }) {
+ function checkTemplates({ json, packageManager }: { json: any; packageManager: any }) {
for (const [key, value] of Object.entries(scanningTemplates)) {
if (checkPackageJSONContents({ key, json })) {
foundConfig = findBuildPack(value.buildPack, packageManager);
@@ -66,26 +64,47 @@
try {
if (type === 'gitlab') {
const files = await get(`${apiUrl}/v4/projects/${projectId}/repository/tree`, {
- Authorization: `Bearer ${$gitTokens.gitlabToken}`
+ Authorization: `Bearer ${$appSession.tokens.gitlab}`
});
const packageJson = files.find(
- (file) => file.name === 'package.json' && file.type === 'blob'
+ (file: { name: string; type: string }) =>
+ file.name === 'package.json' && file.type === 'blob'
+ );
+ const yarnLock = files.find(
+ (file: { name: string; type: string }) =>
+ file.name === 'yarn.lock' && file.type === 'blob'
);
- const yarnLock = files.find((file) => file.name === 'yarn.lock' && file.type === 'blob');
const pnpmLock = files.find(
- (file) => file.name === 'pnpm-lock.yaml' && file.type === 'blob'
+ (file: { name: string; type: string }) =>
+ file.name === 'pnpm-lock.yaml' && file.type === 'blob'
+ );
+ const dockerfile = files.find(
+ (file: { name: string; type: string }) =>
+ file.name === 'Dockerfile' && file.type === 'blob'
+ );
+ const cargoToml = files.find(
+ (file: { name: string; type: string }) =>
+ file.name === 'Cargo.toml' && file.type === 'blob'
);
- const dockerfile = files.find((file) => file.name === 'Dockerfile' && file.type === 'blob');
- const cargoToml = files.find((file) => file.name === 'Cargo.toml' && file.type === 'blob');
const requirementsTxt = files.find(
- (file) => file.name === 'requirements.txt' && file.type === 'blob'
+ (file: { name: string; type: string }) =>
+ file.name === 'requirements.txt' && file.type === 'blob'
+ );
+ const indexHtml = files.find(
+ (file: { name: string; type: string }) =>
+ file.name === 'index.html' && file.type === 'blob'
+ );
+ const indexPHP = files.find(
+ (file: { name: string; type: string }) =>
+ file.name === 'index.php' && file.type === 'blob'
);
- const indexHtml = files.find((file) => file.name === 'index.html' && file.type === 'blob');
- const indexPHP = files.find((file) => file.name === 'index.php' && file.type === 'blob');
const composerPHP = files.find(
- (file) => file.name === 'composer.json' && file.type === 'blob'
+ (file: { name: string; type: string }) =>
+ file.name === 'composer.json' && file.type === 'blob'
+ );
+ const laravel = files.find(
+ (file: { name: string; type: string }) => file.name === 'artisan' && file.type === 'blob'
);
- const laravel = files.find((file) => file.name === 'artisan' && file.type === 'blob');
if (yarnLock) packageManager = 'yarn';
if (pnpmLock) packageManager = 'pnpm';
@@ -94,10 +113,10 @@
foundConfig = findBuildPack('docker', packageManager);
} else if (packageJson && !laravel) {
const path = packageJson.path;
- const data = await get(
+ const data: any = await get(
`${apiUrl}/v4/projects/${projectId}/repository/files/${path}/raw?ref=${branch}`,
{
- Authorization: `Bearer ${$gitTokens.gitlabToken}`
+ Authorization: `Bearer ${$appSession.tokens.gitlab}`
}
);
const json = JSON.parse(data) || {};
@@ -117,27 +136,48 @@
}
} else if (type === 'github') {
const files = await get(`${apiUrl}/repos/${repository}/contents?ref=${branch}`, {
- Authorization: `Bearer ${$gitTokens.githubToken}`,
+ Authorization: `Bearer ${$appSession.tokens.github}`,
Accept: 'application/vnd.github.v2.json'
});
const packageJson = files.find(
- (file) => file.name === 'package.json' && file.type === 'file'
+ (file: { name: string; type: string }) =>
+ file.name === 'package.json' && file.type === 'file'
+ );
+ const yarnLock = files.find(
+ (file: { name: string; type: string }) =>
+ file.name === 'yarn.lock' && file.type === 'file'
);
- const yarnLock = files.find((file) => file.name === 'yarn.lock' && file.type === 'file');
const pnpmLock = files.find(
- (file) => file.name === 'pnpm-lock.yaml' && file.type === 'file'
+ (file: { name: string; type: string }) =>
+ file.name === 'pnpm-lock.yaml' && file.type === 'file'
+ );
+ const dockerfile = files.find(
+ (file: { name: string; type: string }) =>
+ file.name === 'Dockerfile' && file.type === 'file'
+ );
+ const cargoToml = files.find(
+ (file: { name: string; type: string }) =>
+ file.name === 'Cargo.toml' && file.type === 'file'
);
- const dockerfile = files.find((file) => file.name === 'Dockerfile' && file.type === 'file');
- const cargoToml = files.find((file) => file.name === 'Cargo.toml' && file.type === 'file');
const requirementsTxt = files.find(
- (file) => file.name === 'requirements.txt' && file.type === 'file'
+ (file: { name: string; type: string }) =>
+ file.name === 'requirements.txt' && file.type === 'file'
+ );
+ const indexHtml = files.find(
+ (file: { name: string; type: string }) =>
+ file.name === 'index.html' && file.type === 'file'
+ );
+ const indexPHP = files.find(
+ (file: { name: string; type: string }) =>
+ file.name === 'index.php' && file.type === 'file'
);
- const indexHtml = files.find((file) => file.name === 'index.html' && file.type === 'file');
- const indexPHP = files.find((file) => file.name === 'index.php' && file.type === 'file');
const composerPHP = files.find(
- (file) => file.name === 'composer.json' && file.type === 'file'
+ (file: { name: string; type: string }) =>
+ file.name === 'composer.json' && file.type === 'file'
+ );
+ const laravel = files.find(
+ (file: { name: string; type: string }) => file.name === 'artisan' && file.type === 'file'
);
- const laravel = files.find((file) => file.name === 'artisan' && file.type === 'file');
if (yarnLock) packageManager = 'yarn';
if (pnpmLock) packageManager = 'pnpm';
@@ -145,8 +185,8 @@
if (dockerfile) {
foundConfig = findBuildPack('docker', packageManager);
} else if (packageJson && !laravel) {
- const data = await get(`${packageJson.git_url}`, {
- Authorization: `Bearer ${$gitTokens.githubToken}`,
+ const data: any = await get(`${packageJson.git_url}`, {
+ Authorization: `Bearer ${$appSession.tokens.github}`,
Accept: 'application/vnd.github.v2.raw'
});
const json = JSON.parse(data) || {};
@@ -165,7 +205,7 @@
foundConfig = findBuildPack('node', packageManager);
}
}
- } catch (error) {
+ } catch (error: any) {
scanning = true;
if (
error.error === 'invalid_token' ||
@@ -195,9 +235,9 @@
}
}
if (error.message === 'Bad credentials') {
- const { token } = await get(`/applications/${id}/configuration/githubToken.json`);
- $gitTokens.githubToken = token;
- browser && window.location.reload();
+ const { token } = await get(`/applications/${id}/configuration/githubToken`);
+ $appSession.tokens.github = token;
+ return await scanRepository()
}
return errorNotification(error);
} finally {
@@ -223,11 +263,6 @@
</div>
</div>
{:else}
- {#if packageManager === 'yarn' || packageManager === 'pnpm'}
- <div class="flex justify-center p-6">
- {@html $t('application.configuration.found_lock_file', { packageManager })}
- </div>
- {/if}
<div class="max-w-7xl mx-auto flex flex-wrap justify-center">
{#each buildPacks as buildPack}
<div class="p-2">
diff --git a/src/routes/applications/[id]/configuration/destination.svelte b/apps/ui/src/routes/applications/[id]/configuration/destination.svelte
similarity index 71%
rename from src/routes/applications/[id]/configuration/destination.svelte
rename to apps/ui/src/routes/applications/[id]/configuration/destination.svelte
index 2e68d658c4..3e14a4c1e4 100644
--- a/src/routes/applications/[id]/configuration/destination.svelte
+++ b/apps/ui/src/routes/applications/[id]/configuration/destination.svelte
@@ -1,58 +1,55 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- const { application } = stuff;
- if (application?.destinationDockerId && !url.searchParams.get('from')) {
- return {
- status: 302,
- redirect: `/applications/${params.id}`
- };
- }
- const endpoint = `/destinations.json`;
- const res = await fetch(endpoint);
-
- if (res.ok) {
+ try {
+ const { application } = stuff;
+ if (application?.destinationDockerId && !url.searchParams.get('from')) {
+ return {
+ status: 302,
+ redirect: `/applications/${params.id}`
+ };
+ }
+ const response = await get(`/destinations`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
- import type Prisma from '@prisma/client';
-
- import { page, session } from '$app/stores';
- import { errorNotification } from '$lib/form';
+ import { page } from '$app/stores';
import { goto } from '$app/navigation';
- import { post } from '$lib/api';
+ import { get, post } from '$lib/api';
import { t } from '$lib/translations';
+ import { appSession } from '$lib/store';
+ import { errorNotification } from '$lib/common';
const { id } = $page.params;
const from = $page.url.searchParams.get('from');
- export let destinations: Prisma.DestinationDocker[];
+ export let destinations: any;
- const ownDestinations = destinations.filter((destination) => {
- if (destination.teams[0].id === $session.teamId) {
+ const ownDestinations = destinations.filter((destination: any) => {
+ if (destination.teams[0].id === $appSession.teamId) {
return destination;
}
});
- const otherDestinations = destinations.filter((destination) => {
- if (destination.teams[0].id !== $session.teamId) {
+ const otherDestinations = destinations.filter((destination: any) => {
+ if (destination.teams[0].id !== $appSession.teamId) {
return destination;
}
});
- async function handleSubmit(destinationId) {
+ async function handleSubmit(destinationId: any) {
try {
- await post(`/applications/${id}/configuration/destination.json`, { destinationId });
+ await post(`/applications/${id}/configuration/destination`, { destinationId });
return await goto(from || `/applications/${id}/configuration/buildpack`);
} catch ({ error }) {
return errorNotification(error);
@@ -100,7 +97,7 @@
</div>
{/each}
</div>
- {#if otherDestinations.length > 0 && $session.teamId === '0'}
+ {#if otherDestinations.length > 0 && $appSession.teamId === '0'}
<div class="px-6 pb-5 pt-10 text-xl font-bold">Other Destinations</div>
{/if}
<div class="flex flex-col flex-wrap justify-center px-2 md:flex-row">
diff --git a/src/routes/applications/[id]/configuration/repository.svelte b/apps/ui/src/routes/applications/[id]/configuration/repository.svelte
similarity index 58%
rename from src/routes/applications/[id]/configuration/repository.svelte
rename to apps/ui/src/routes/applications/[id]/configuration/repository.svelte
index 5b28097518..edbed59162 100644
--- a/src/routes/applications/[id]/configuration/repository.svelte
+++ b/apps/ui/src/routes/applications/[id]/configuration/repository.svelte
@@ -1,30 +1,36 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ params, url, stuff }) => {
- const { application, appId } = stuff;
- if (application?.branch && application?.repository && !url.searchParams.get('from')) {
+ try {
+ const { application, appId, settings } = stuff;
+ if (application?.branch && application?.repository && !url.searchParams.get('from')) {
+ return {
+ status: 302,
+ redirect: `/applications/${params.id}`
+ };
+ }
+ return {
+ props: {
+ application,
+ appId,
+ settings
+ }
+ };
+ } catch (error) {
return {
- status: 302,
- redirect: `/applications/${params.id}`
+ status: 500,
+ error: new Error(`Could not load ${url}`)
};
}
- return {
- props: {
- application,
- appId
- }
- };
};
</script>
<script lang="ts">
import { t } from '$lib/translations';
- import { gitTokens } from '$lib/store';
-
- export let application;
- export let appId;
- $gitTokens.githubToken = null;
+ export let application: any;
+ export let appId: string;
+ export let settings: any;
import GithubRepositories from './_GithubRepositories.svelte';
import GitlabRepositories from './_GitlabRepositories.svelte';
@@ -39,6 +45,6 @@
{#if application.gitSource.type === 'github'}
<GithubRepositories {application} />
{:else if application.gitSource.type === 'gitlab'}
- <GitlabRepositories {application} {appId} />
+ <GitlabRepositories {application} {appId} {settings} />
{/if}
</div>
diff --git a/src/routes/applications/[id]/configuration/source.svelte b/apps/ui/src/routes/applications/[id]/configuration/source.svelte
similarity index 73%
rename from src/routes/applications/[id]/configuration/source.svelte
rename to apps/ui/src/routes/applications/[id]/configuration/source.svelte
index 95d29a81a6..1eba2c5ef5 100644
--- a/src/routes/applications/[id]/configuration/source.svelte
+++ b/apps/ui/src/routes/applications/[id]/configuration/source.svelte
@@ -1,68 +1,62 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- const { application } = stuff;
- if (application?.gitSourceId && !url.searchParams.get('from')) {
- return {
- status: 302,
- redirect: `/applications/${params.id}`
- };
- }
- const endpoint = `/sources.json`;
- const res = await fetch(endpoint);
-
- if (res.ok) {
+ try {
+ const { application } = stuff;
+ if (application?.gitSourceId && !url.searchParams.get('from')) {
+ return {
+ status: 302,
+ redirect: `/applications/${params.id}`
+ };
+ }
+ const response = await get(`/sources`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
- import type Prisma from '@prisma/client';
-
import { page, session } from '$app/stores';
- import { errorNotification } from '$lib/form';
import { goto } from '$app/navigation';
- import { post } from '$lib/api';
+ import { get, post } from '$lib/api';
import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
+ import { appSession } from '$lib/store';
const { id } = $page.params;
- const from = $page.url.searchParams.get('from');
+ const from = $page.url.searchParams.get('from')
- export let sources: Prisma.GitSource[] & {
- gitlabApp: Prisma.GitlabApp;
- githubApp: Prisma.GithubApp;
- };
+ export let sources: any;
const filteredSources = sources.filter(
- (source) =>
+ (source: any) =>
(source.type === 'github' && source.githubAppId && source.githubApp.installationId) ||
(source.type === 'gitlab' && source.gitlabAppId)
);
- const ownSources = filteredSources.filter((source) => {
- if (source.teams[0].id === $session.teamId) {
+ const ownSources = filteredSources.filter((source: any) => {
+ if (source.teams[0].id === $appSession.teamId) {
return source;
}
});
- const otherSources = filteredSources.filter((source) => {
- if (source.teams[0].id !== $session.teamId) {
+ const otherSources = filteredSources.filter((source: any) => {
+ if (source.teams[0].id !== $appSession.teamId) {
return source;
}
});
- async function handleSubmit(gitSourceId) {
+ async function handleSubmit(gitSourceId: string) {
try {
- await post(`/applications/${id}/configuration/source.json`, { gitSourceId });
+ await post(`/applications/${id}/configuration/source`, { gitSourceId });
return await goto(from || `/applications/${id}/configuration/repository`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
@@ -80,9 +74,9 @@
<div class="flex flex-col justify-center">
{#if !filteredSources || ownSources.length === 0}
<div class="flex-col">
- <div class="pb-2 text-center">{$t('application.configuration.no_configurable_git')}</div>
+ <div class="pb-2 text-center font-bold">{$t('application.configuration.no_configurable_git')}</div>
<div class="flex justify-center">
- <button on:click={newSource} class="add-icon bg-orange-600 hover:bg-orange-500">
+ <a href="/sources/new?from={$page.url.pathname}" class="add-icon bg-orange-600 hover:bg-orange-500">
<svg
class="w-6"
xmlns="http://www.w3.org/2000/svg"
@@ -96,7 +90,7 @@
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
/></svg
>
- </button>
+ </a>
</div>
</div>
{:else}
@@ -124,7 +118,7 @@
{/each}
</div>
- {#if otherSources.length > 0 && $session.teamId === '0'}
+ {#if otherSources.length > 0 && $appSession.teamId === '0'}
<div class="px-6 pb-5 pt-10 text-xl font-bold">Other Sources</div>
{/if}
<div class="flex flex-col flex-wrap justify-center px-2 md:flex-row">
diff --git a/src/routes/applications/[id]/index.svelte b/apps/ui/src/routes/applications/[id]/index.svelte
similarity index 90%
rename from src/routes/applications/[id]/index.svelte
rename to apps/ui/src/routes/applications/[id]/index.svelte
index 9c7c86435e..fdc4e803fa 100644
--- a/src/routes/applications/[id]/index.svelte
+++ b/apps/ui/src/routes/applications/[id]/index.svelte
@@ -1,54 +1,48 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params, stuff }) => {
- if (stuff?.application?.id) {
+ export const load: Load = async ({ fetch, params, stuff, url }) => {
+ try {
+ if (stuff?.application?.id) {
+ return {
+ props: {
+ application: stuff.application
+ }
+ };
+ }
+ const response = await get(`/applications/${params.id}`);
return {
props: {
- application: stuff.application
+ ...response
}
};
- }
- const endpoint = `/applications/${params.id}.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
+ } catch (error) {
return {
- props: {
- ...(await res.json())
- }
+ status: 500,
+ error: new Error(`Could not load ${url}`)
};
}
- return {
- status: res.status,
- error: new Error(`Could not load ${endpoint}`)
- };
};
</script>
<script lang="ts">
- export let application: Prisma.Application & {
- settings: Prisma.ApplicationSettings;
- gitlabApp: Prisma.GitlabApp;
- gitSource: Prisma.GitSource;
- destinationDocker: Prisma.DestinationDocker;
- baseImages: Array<{ value: string; label: string }>;
- baseBuildImages: Array<{ value: string; label: string }>;
- };
- import { page, session } from '$app/stores';
- import { errorNotification } from '$lib/form';
+ export let application: any;
+ import { page } from '$app/stores';
import { onDestroy, onMount } from 'svelte';
import Select from 'svelte-select';
+
import Explainer from '$lib/components/Explainer.svelte';
- import Setting from '$lib/components/Setting.svelte';
- import type Prisma from '@prisma/client';
- import { getDomain, notNodeDeployments, staticDeployments } from '$lib/components/common';
import { toast } from '@zerodevx/svelte-toast';
import { get, post } from '$lib/api';
import cuid from 'cuid';
import { browser } from '$app/env';
- import { disabledButton, status } from '$lib/store';
+ import { appSession, disabledButton, status } from '$lib/store';
import { t } from '$lib/translations';
+ import { errorNotification, getDomain, notNodeDeployments, staticDeployments } from '$lib/common';
+ import Setting from './_Setting.svelte';
const { id } = $page.params;
+
let domainEl: HTMLInputElement;
+
let loading = false;
let usageLoading = false;
@@ -57,19 +51,19 @@
CPUPerc: 0,
NetIO: 0
};
- let usageInterval;
+ let usageInterval: any;
let forceSave = false;
let debug = application.settings.debug;
let previews = application.settings.previews;
let dualCerts = application.settings.dualCerts;
let autodeploy = application.settings.autodeploy;
+
let nonWWWDomain = application.fqdn && getDomain(application.fqdn).replace(/^www\./, '');
let isNonWWWDomainOK = false;
let isWWWDomainOK = false;
- $: isDisabled = !$session.isAdmin || $status.application.isRunning;
-
+ $: isDisabled = !$appSession.isAdmin || $status.application.isRunning;
let wsgis = [
{
value: 'None',
@@ -90,8 +84,9 @@
async function getUsage() {
if (usageLoading) return;
+ if (!$status.application.isRunning) return;
usageLoading = true;
- const data = await get(`/applications/${id}/usage.json`);
+ const data = await get(`/applications/${id}/usage`);
usage = data.usage;
usageLoading = false;
}
@@ -99,7 +94,7 @@
clearInterval(usageInterval);
});
onMount(async () => {
- if (browser && window.location.hostname === 'demo.coolify.io' && !application.fqdn) {
+ if (window.location.hostname === 'demo.coolify.io' && !application.fqdn) {
application.fqdn = `http://${cuid()}.demo.coolify.io`;
await handleSubmit();
}
@@ -109,7 +104,8 @@
await getUsage();
}, 1000);
});
- async function changeSettings(name) {
+
+ async function changeSettings(name: any) {
if (name === 'debug') {
debug = !debug;
}
@@ -123,7 +119,7 @@
autodeploy = !autodeploy;
}
try {
- await post(`/applications/${id}/settings.json`, {
+ await post(`/applications/${id}/settings`, {
previews,
debug,
dualCerts,
@@ -132,7 +128,7 @@
projectId: application.projectId
});
return toast.push($t('application.settings_saved'));
- } catch ({ error }) {
+ } catch (error) {
if (name === 'debug') {
debug = !debug;
}
@@ -153,18 +149,20 @@
loading = true;
try {
nonWWWDomain = application.fqdn && getDomain(application.fqdn).replace(/^www\./, '');
- await post(`/applications/${id}/check.json`, {
+ await post(`/applications/${id}/check`, {
fqdn: application.fqdn,
forceSave,
dualCerts,
exposePort: application.exposePort
});
- await post(`/applications/${id}.json`, { ...application });
+ await post(`/applications/${id}`, { ...application });
$disabledButton = false;
forceSave = false;
return toast.push('Configurations saved.');
- } catch ({ error }) {
- if (error?.startsWith($t('application.dns_not_set_partial_error'))) {
+ } catch (error) {
+ console.log(error);
+ //@ts-ignore
+ if (error?.message.startsWith($t('application.dns_not_set_partial_error'))) {
forceSave = true;
if (dualCerts) {
isNonWWWDomainOK = await isDNSValid(getDomain(nonWWWDomain), false);
@@ -183,20 +181,21 @@
loading = false;
}
}
- async function selectWSGI(event) {
+ async function selectWSGI(event: any) {
application.pythonWSGI = event.detail.value;
}
- async function selectBaseImage(event) {
+ async function selectBaseImage(event: any) {
application.baseImage = event.detail.value;
await handleSubmit();
}
- async function selectBaseBuildImage(event) {
+ async function selectBaseBuildImage(event: any) {
application.baseBuildImage = event.detail.value;
await handleSubmit();
}
- async function isDNSValid(domain, isWWW) {
+
+ async function isDNSValid(domain: any, isWWW: any) {
try {
- await get(`/applications/${id}/check.json?domain=${domain}`);
+ await get(`/applications/${id}/check?domain=${domain}`);
toast.push('DNS configuration is valid.');
isWWW ? (isWWWDomainOK = true) : (isNonWWWDomainOK = true);
return true;
@@ -215,6 +214,7 @@
</div>
<span class="text-xs">{application.name} </span>
</div>
+
{#if application.fqdn}
<a
href={application.fqdn}
@@ -312,7 +312,7 @@
<form on:submit|preventDefault={handleSubmit} class="py-4">
<div class="flex space-x-1 pb-5 font-bold">
<div class="title">{$t('general')}</div>
- {#if $session.isAdmin}
+ {#if $appSession.isAdmin}
<button
type="submit"
class:bg-green-600={!loading}
@@ -332,7 +332,7 @@
<div class="mt-2 grid grid-cols-2 items-center">
<label for="name" class="text-base font-bold text-stone-100">{$t('forms.name')}</label>
<input
- readonly={!$session.isAdmin}
+ readonly={!isDisabled}
name="name"
id="name"
bind:value={application.name}
@@ -344,7 +344,7 @@
>{$t('application.git_source')}</label
>
<a
- href={$session.isAdmin
+ href={!isDisabled
? `/applications/${id}/configuration/source?from=/applications/${id}`
: ''}
class="no-underline"
@@ -361,7 +361,7 @@
>{$t('application.git_repository')}</label
>
<a
- href={$session.isAdmin
+ href={!isDisabled
? `/applications/${id}/configuration/repository?from=/applications/${id}&to=/applications/${id}/configuration/buildpack`
: ''}
class="no-underline"
@@ -378,7 +378,7 @@
>{$t('application.build_pack')}</label
>
<a
- href={$session.isAdmin
+ href={!isDisabled
? `/applications/${id}/configuration/buildpack?from=/applications/${id}`
: ''}
class="no-underline "
@@ -429,6 +429,7 @@
<label for="baseBuildImage" class="text-base font-bold text-stone-100"
>{$t('application.base_build_image')}</label
>
+
<div class="custom-select-wrapper">
<Select
{isDisabled}
@@ -530,10 +531,11 @@
<Select id="wsgi" items={wsgis} on:select={selectWSGI} value={application.pythonWSGI} />
</div>
</div>
+
<div class="grid grid-cols-2 items-center">
<label for="pythonModule" class="text-base font-bold text-stone-100">Module</label>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="pythonModule"
id="pythonModule"
required
@@ -545,7 +547,7 @@
<div class="grid grid-cols-2 items-center">
<label for="pythonVariable" class="text-base font-bold text-stone-100">Variable</label>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="pythonVariable"
id="pythonVariable"
required
@@ -558,7 +560,7 @@
<div class="grid grid-cols-2 items-center">
<label for="pythonVariable" class="text-base font-bold text-stone-100">Variable</label>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="pythonVariable"
id="pythonVariable"
required
@@ -572,7 +574,7 @@
<div class="grid grid-cols-2 items-center">
<label for="port" class="text-base font-bold text-stone-100">{$t('forms.port')}</label>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="port"
id="port"
bind:value={application.port}
@@ -584,7 +586,7 @@
<div class="grid grid-cols-2 items-center">
<label for="exposePort" class="text-base font-bold text-stone-100">Exposed Port</label>
<input
- readonly={!$session.isAdmin && !$status.application.isRunning}
+ readonly={!$appSession.isAdmin && !$status.application.isRunning}
disabled={isDisabled}
name="exposePort"
id="exposePort"
@@ -602,7 +604,7 @@
>{$t('application.install_command')}</label
>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="installCommand"
id="installCommand"
bind:value={application.installCommand}
@@ -614,7 +616,7 @@
>{$t('application.build_command')}</label
>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="buildCommand"
id="buildCommand"
bind:value={application.buildCommand}
@@ -626,7 +628,7 @@
>{$t('application.start_command')}</label
>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="startCommand"
id="startCommand"
bind:value={application.startCommand}
@@ -640,7 +642,7 @@
>Dockerfile Location</label
>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="dockerFileLocation"
id="dockerFileLocation"
bind:value={application.dockerFileLocation}
@@ -655,7 +657,7 @@
<div class="grid grid-cols-2 items-center">
<label for="denoMainFile" class="text-base font-bold text-stone-100">Main File</label>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="denoMainFile"
id="denoMainFile"
bind:value={application.denoMainFile}
@@ -665,7 +667,7 @@
<div class="grid grid-cols-2 items-center">
<label for="denoOptions" class="text-base font-bold text-stone-100">Arguments</label>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="denoOptions"
id="denoOptions"
bind:value={application.denoOptions}
@@ -685,7 +687,7 @@
<Explainer text={$t('application.directory_to_use_explainer')} />
</div>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="baseDirectory"
id="baseDirectory"
bind:value={application.baseDirectory}
@@ -701,8 +703,9 @@
>
<Explainer text={$t('application.publish_directory_explainer')} />
</div>
+
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="publishDirectory"
id="publishDirectory"
bind:value={application.publishDirectory}
diff --git a/src/routes/applications/[id]/logs/build/_BuildLog.svelte b/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte
similarity index 71%
rename from src/routes/applications/[id]/logs/build/_BuildLog.svelte
rename to apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte
index b95e295f13..86e5405d49 100644
--- a/src/routes/applications/[id]/logs/build/_BuildLog.svelte
+++ b/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte
@@ -1,5 +1,5 @@
<script lang="ts">
- export let buildId;
+ export let buildId: any;
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
const dispatch = createEventDispatcher();
@@ -7,18 +7,18 @@
import { page } from '$app/stores';
import Loading from '$lib/components/Loading.svelte';
- import LoadingLogs from '../_Loading.svelte';
import { get, post } from '$lib/api';
- import { errorNotification } from '$lib/form';
import { t } from '$lib/translations';
+ import LoadingLogs from '$lib/components/LoadingLogs.svelte';
+ import { errorNotification } from '$lib/common';
- let logs = [];
+ let logs: any = [];
let loading = true;
- let currentStatus;
- let streamInterval;
- let followingBuild;
- let followingInterval;
- let logsEl;
+ let currentStatus: any;
+ let streamInterval: any;
+ let followingBuild: any;
+ let followingInterval: any;
+ let logsEl: any;
let cancelInprogress = false;
@@ -40,10 +40,12 @@
async function streamLogs(sequence = 0) {
try {
let { logs: responseLogs, status } = await get(
- `/applications/${id}/logs/build/build.json?buildId=${buildId}&sequence=${sequence}`
+ `/applications/${id}/logs/build/${buildId}?sequence=${sequence}`
);
currentStatus = status;
- logs = logs.concat(responseLogs.map((log) => ({ ...log, line: cleanAnsiCodes(log.line) })));
+ logs = logs.concat(
+ responseLogs.map((log: any) => ({ ...log, line: cleanAnsiCodes(log.line) }))
+ );
loading = false;
streamInterval = setInterval(async () => {
if (status !== 'running' && status !== 'queued') {
@@ -53,18 +55,20 @@
const nextSequence = logs[logs.length - 1]?.time || 0;
try {
const data = await get(
- `/applications/${id}/logs/build/build.json?buildId=${buildId}&sequence=${nextSequence}`
+ `/applications/${id}/logs/build/${buildId}?sequence=${nextSequence}`
);
status = data.status;
currentStatus = status;
- logs = logs.concat(data.logs.map((log) => ({ ...log, line: cleanAnsiCodes(log.line) })));
+ logs = logs.concat(
+ data.logs.map((log: any) => ({ ...log, line: cleanAnsiCodes(log.line) }))
+ );
dispatch('updateBuildStatus', { status });
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}, 1000);
- } catch ({ error }) {
+ } catch (error) {
console.log(error);
return errorNotification(error);
}
@@ -73,7 +77,7 @@
if (cancelInprogress) return;
try {
cancelInprogress = true;
- await post(`/applications/${id}/cancel.json`, {
+ await post(`/applications/${id}/cancel`, {
buildId,
applicationId: id
});
@@ -154,15 +158,22 @@
</button>
{/if}
</div>
-
- <div
- class="font-mono leading-6 text-left text-md tracking-tighter rounded bg-coolgray-200 py-5 px-6 whitespace-pre-wrap break-words overflow-auto max-h-[80vh] -mt-12 overflow-y-scroll scrollbar-w-1 scrollbar-thumb-coollabs scrollbar-track-coolgray-200"
- bind:this={logsEl}
- >
- {#each logs as log}
- <div>{log.line + '\n'}</div>
- {/each}
- </div>
+ {#if logs.length > 0}
+ <div
+ class="font-mono leading-6 text-left text-md tracking-tighter rounded bg-coolgray-200 py-5 px-6 whitespace-pre-wrap break-words overflow-auto max-h-[80vh] -mt-12 overflow-y-scroll scrollbar-w-1 scrollbar-thumb-coollabs scrollbar-track-coolgray-200"
+ bind:this={logsEl}
+ >
+ {#each logs as log}
+ <div>{log.line + '\n'}</div>
+ {/each}
+ </div>
+ {:else}
+ <div
+ class="font-mono leading-6 text-left text-md tracking-tighter rounded bg-coolgray-200 py-5 px-6 whitespace-pre-wrap break-words overflow-auto max-h-[80vh] -mt-12 overflow-y-scroll scrollbar-w-1 scrollbar-thumb-coollabs scrollbar-track-coolgray-200"
+ >
+ No logs found.
+ </div>
+ {/if}
{/if}
</div>
{/if}
diff --git a/src/routes/applications/[id]/logs/build/index.svelte b/apps/ui/src/routes/applications/[id]/logs/build.svelte
similarity index 89%
rename from src/routes/applications/[id]/logs/build/index.svelte
rename to apps/ui/src/routes/applications/[id]/logs/build.svelte
index 8c91a2f7f7..dd6b35eaba 100644
--- a/src/routes/applications/[id]/logs/build/index.svelte
+++ b/apps/ui/src/routes/applications/[id]/logs/build.svelte
@@ -1,38 +1,35 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- let endpoint = `/applications/${params.id}/logs/build.json?skip=0`;
- const res = await fetch(endpoint);
- if (res.ok) {
+ try {
+ const response = await get(`/applications/${params.id}/logs/build?skip=0`);
return {
props: {
application: stuff.application,
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
+ export let builds: any;
+ export let application: any;
+ export let buildCount: any;
import { page } from '$app/stores';
- import { changeQueryParams, dateOptions } from '$lib/components/common';
import BuildLog from './_BuildLog.svelte';
import { get } from '$lib/api';
- import { errorNotification } from '$lib/form';
import { t } from '$lib/translations';
+ import { changeQueryParams, dateOptions, errorNotification } from '$lib/common';
- export let builds;
- export let application;
- export let buildCount;
-
- let buildId;
+ let buildId: any;
let skip = 0;
let noMoreBuilds = buildCount < 5 || buildCount <= skip;
@@ -40,25 +37,24 @@
let preselectedBuildId = $page.url.searchParams.get('buildId');
if (preselectedBuildId) buildId = preselectedBuildId;
- async function updateBuildStatus({ detail }) {
+ async function updateBuildStatus({ detail }: { detail: any }) {
const { status } = detail;
if (status !== 'running') {
try {
- const data = await get(`/applications/${id}/logs/build.json?buildId=${buildId}`);
- builds = builds.filter((build) => {
+ const data = await get(`/applications/${id}/logs/build?buildId=${buildId}`);
+ builds = builds.filter((build: any) => {
if (build.id === data.builds[0].id) {
build.status = data.builds[0].status;
build.took = data.builds[0].took;
build.since = data.builds[0].since;
}
-
return build;
});
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
} else {
- builds = builds.filter((build) => {
+ builds = builds.filter((build: any) => {
if (build.id === buildId) build.status = status;
return build;
});
@@ -69,7 +65,7 @@
skip = skip + 5;
noMoreBuilds = buildCount >= skip;
try {
- const data = await get(`/applications/${id}/logs/build.json?skip=${skip}`);
+ const data = await get(`/applications/${id}/logs/build?skip=${skip}`);
builds = builds.concat(data.builds);
return;
} catch ({ error }) {
@@ -79,7 +75,7 @@
noMoreBuilds = true;
}
}
- function loadBuild(build) {
+ function loadBuild(build: any) {
buildId = build;
return changeQueryParams(buildId);
}
@@ -168,7 +164,7 @@
on:click={() => loadBuild(build.id)}
class:rounded-tr={index === 0}
class:rounded-br={index === builds.length - 1}
- class="tooltip-top flex cursor-pointer items-center justify-center border-l-2 border-transparent py-4 no-underline transition-all duration-100 hover:bg-coolgray-400 hover:shadow-xl "
+ class="tooltip-top flex cursor-pointer items-center justify-center border-l-2 py-4 no-underline transition-all duration-100 hover:bg-coolgray-400 hover:shadow-xl "
class:bg-coolgray-400={buildId === build.id}
class:border-red-500={build.status === 'failed'}
class:border-green-500={build.status === 'success'}
diff --git a/src/routes/applications/[id]/logs/index.svelte b/apps/ui/src/routes/applications/[id]/logs/index.svelte
similarity index 92%
rename from src/routes/applications/[id]/logs/index.svelte
rename to apps/ui/src/routes/applications/[id]/logs/index.svelte
index 23fafc80fe..e327442bd0 100644
--- a/src/routes/applications/[id]/logs/index.svelte
+++ b/apps/ui/src/routes/applications/[id]/logs/index.svelte
@@ -2,38 +2,37 @@
import type { Load } from '@sveltejs/kit';
import { onDestroy, onMount } from 'svelte';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- let endpoint = `/applications/${params.id}/logs.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
+ try {
+ const response = await get(`/applications/${params.id}/logs`);
return {
props: {
application: stuff.application,
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
- export let application;
+ export let application: any;
import { page } from '$app/stores';
- import LoadingLogs from './_Loading.svelte';
import { get } from '$lib/api';
- import { errorNotification } from '$lib/form';
import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
+ import LoadingLogs from '$lib/components/LoadingLogs.svelte';
- let loadLogsInterval = null;
- let logs = [];
- let lastLog = null;
- let followingInterval;
- let followingLogs;
- let logsEl;
+ let loadLogsInterval: any = null;
+ let logs: any = [];
+ let lastLog: any = null;
+ let followingInterval: any;
+ let followingLogs: any;
+ let logsEl: any;
let position = 0;
const { id } = $page.params;
@@ -49,7 +48,7 @@
});
async function loadAllLogs() {
try {
- const data: any = await get(`/applications/${id}/logs.json`);
+ const data: any = await get(`/applications/${id}/logs`);
if (data?.logs) {
lastLog = data.logs[data.logs.length - 1];
logs = data.logs;
@@ -62,7 +61,7 @@
async function loadLogs() {
try {
const newLogs: any = await get(
- `/applications/${id}/logs.json?since=${lastLog?.split(' ')[0] || 0}`
+ `/applications/${id}/logs?since=${lastLog?.split(' ')[0] || 0}`
);
if (newLogs?.logs && newLogs.logs[newLogs.logs.length - 1] !== logs[logs.length - 1]) {
diff --git a/src/routes/applications/[id]/previews/index.svelte b/apps/ui/src/routes/applications/[id]/previews.svelte
similarity index 89%
rename from src/routes/applications/[id]/previews/index.svelte
rename to apps/ui/src/routes/applications/[id]/previews.svelte
index bde24d1346..bc1db63cb9 100644
--- a/src/routes/applications/[id]/previews/index.svelte
+++ b/apps/ui/src/routes/applications/[id]/previews.svelte
@@ -1,50 +1,49 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params, stuff }) => {
- let endpoint = `/applications/${params.id}/previews.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
+ export const load: Load = async ({ fetch, params, stuff, url }) => {
+ try {
+ const response = await get(`/applications/${params.id}/previews`);
return {
props: {
application: stuff.application,
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
- return {
- status: res.status,
- error: new Error(`Could not load ${endpoint}`)
- };
};
</script>
<script lang="ts">
- export let containers;
- export let application;
- export let PRMRSecrets;
- export let applicationSecrets;
- import { getDomain } from '$lib/components/common';
- import Secret from '../secrets/_Secret.svelte';
+ export let containers: any;
+ export let application: any;
+ export let PRMRSecrets: any;
+ export let applicationSecrets: any;
+ import Secret from './_Secret.svelte';
import { get, post } from '$lib/api';
import { page } from '$app/stores';
import Explainer from '$lib/components/Explainer.svelte';
- import { errorNotification } from '$lib/form';
import { toast } from '@zerodevx/svelte-toast';
import { t } from '$lib/translations';
import { goto } from '$app/navigation';
+ import { errorNotification, getDomain } from '$lib/common';
const { id } = $page.params;
async function refreshSecrets() {
- const data = await get(`/applications/${id}/secrets.json`);
+ const data = await get(`/applications/${id}/secrets`);
PRMRSecrets = [...data.secrets];
}
- async function redeploy(container) {
+ async function redeploy(container: any) {
try {
- const { buildId } = await post(`/applications/${id}/deploy.json`, {
+ const { buildId } = await post(`/applications/${id}/deploy`, {
pullmergeRequestId: container.pullmergeRequestId,
branch: container.branch
});
- toast.push('Application redeployed queued.');
+ toast.push('Deployment queued');
if ($page.url.pathname.startsWith(`/applications/${id}/logs/build`)) {
return window.location.assign(`/applications/${id}/logs/build?buildId=${buildId}`);
} else {
@@ -52,7 +51,7 @@
replaceState: true
});
}
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
@@ -188,7 +187,7 @@
{/each}
{:else}
<div class="flex-col">
- <div class="text-center text-xl font-bold">
+ <div class="text-center font-bold text-xl">
{$t('application.preview.no_previews_available')}
</div>
</div>
diff --git a/src/routes/applications/[id]/secrets/index.svelte b/apps/ui/src/routes/applications/[id]/secrets.svelte
similarity index 91%
rename from src/routes/applications/[id]/secrets/index.svelte
rename to apps/ui/src/routes/applications/[id]/secrets.svelte
index b7105fe48d..1206681e26 100644
--- a/src/routes/applications/[id]/secrets/index.svelte
+++ b/apps/ui/src/routes/applications/[id]/secrets.svelte
@@ -1,27 +1,26 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params, stuff }) => {
- let endpoint = `/applications/${params.id}/secrets.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
+ export const load: Load = async ({ fetch, params, stuff, url }) => {
+ try {
+ const response = await get(`/applications/${params.id}/secrets`);
return {
props: {
- application: stuff.application,
- ...(await res.json())
+ application: stuff.application,
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${endpoint}`)
- };
};
</script>
<script lang="ts">
- export let secrets;
- export let application;
+ export let secrets: any;
+ export let application: any;
import pLimit from 'p-limit';
import Secret from './_Secret.svelte';
import { page } from '$app/stores';
@@ -35,10 +34,10 @@
let batchSecrets = '';
async function refreshSecrets() {
- const data = await get(`/applications/${id}/secrets.json`);
+ const data = await get(`/applications/${id}/secrets`);
secrets = [...data.secrets];
}
- async function getValues(e) {
+ async function getValues(e: any) {
e.preventDefault();
const eachValuePair = batchSecrets.split('\n');
const batchSecretsPairs = eachValuePair
@@ -49,7 +48,7 @@
return {
name,
value: cleanValue,
- isNew: !secrets.find((secret) => name === secret.name)
+ isNew: !secrets.find((secret: any) => name === secret.name)
};
});
@@ -60,7 +59,7 @@
);
batchSecrets = '';
await refreshSecrets();
- toast.push('Secrets saved');
+ toast.push('Secrets saved.');
}
</script>
diff --git a/src/routes/applications/[id]/storage/index.svelte b/apps/ui/src/routes/applications/[id]/storages.svelte
similarity index 91%
rename from src/routes/applications/[id]/storage/index.svelte
rename to apps/ui/src/routes/applications/[id]/storages.svelte
index 9ea667b450..d2184e914f 100644
--- a/src/routes/applications/[id]/storage/index.svelte
+++ b/apps/ui/src/routes/applications/[id]/storages.svelte
@@ -1,29 +1,26 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params, stuff }) => {
- let endpoint = `/applications/${params.id}/storage.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
+ export const load: Load = async ({ params, stuff, url }) => {
+ try {
+ const response = await get(`/applications/${params.id}/storages`);
return {
props: {
application: stuff.application,
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${endpoint}`)
- };
};
</script>
<script lang="ts">
- export let application;
-
- export let persistentStorages;
- import { getDomain } from '$lib/components/common';
+ export let application: any;
+ export let persistentStorages: any;
import { page } from '$app/stores';
import Storage from './_Storage.svelte';
import { get } from '$lib/api';
@@ -32,7 +29,7 @@
const { id } = $page.params;
async function refreshStorage() {
- const data = await get(`/applications/${id}/storage.json`);
+ const data = await get(`/applications/${id}/storages`);
persistentStorages = [...data.persistentStorages];
}
</script>
diff --git a/src/routes/applications/[id]/secrets/utils.ts b/apps/ui/src/routes/applications/[id]/utils.ts
similarity index 82%
rename from src/routes/applications/[id]/secrets/utils.ts
rename to apps/ui/src/routes/applications/[id]/utils.ts
index 965802d8cd..7fca470b3b 100644
--- a/src/routes/applications/[id]/secrets/utils.ts
+++ b/apps/ui/src/routes/applications/[id]/utils.ts
@@ -1,7 +1,7 @@
import { toast } from '@zerodevx/svelte-toast';
-import { errorNotification } from '$lib/form';
import { post } from '$lib/api';
import { t } from '$lib/translations';
+import { errorNotification } from '$lib/common';
type Props = {
isNew: boolean;
@@ -25,7 +25,7 @@ export async function saveSecret({
if (!name) return errorNotification(`${t.get('forms.name')} ${t.get('forms.is_required')}`);
if (!value) return errorNotification(`${t.get('forms.value')} ${t.get('forms.is_required')}`);
try {
- await post(`/applications/${applicationId}/secrets.json`, {
+ await post(`/applications/${applicationId}/secrets`, {
name,
value,
isBuildSecret,
@@ -37,7 +37,7 @@ export async function saveSecret({
value = '';
isBuildSecret = false;
}
- } catch ({ error }) {
- return errorNotification(error);
+ } catch (error) {
+ throw error
}
}
diff --git a/src/routes/applications/index.svelte b/apps/ui/src/routes/applications/index.svelte
similarity index 81%
rename from src/routes/applications/index.svelte
rename to apps/ui/src/routes/applications/index.svelte
index 1eed20ad90..7effdbb470 100644
--- a/src/routes/applications/index.svelte
+++ b/apps/ui/src/routes/applications/index.svelte
@@ -1,10 +1,31 @@
+<script context="module" lang="ts">
+ import type { Load } from '@sveltejs/kit';
+ export const load: Load = async () => {
+ try {
+ const response = await get(`/applications`);
+ return {
+ props: {
+ ...response
+ }
+ };
+ } catch (error: any) {
+ return {
+ status: 500,
+ error: new Error(error)
+ };
+ }
+ };
+</script>
+
<script lang="ts">
- export let applications: Array<Application>;
- import { session } from '$app/stores';
- import { post } from '$lib/api';
+ export let applications: Array<any> = [];
+ let ownApplications: Array<any> = [];
+ let otherApplications: Array<any> = [];
+ import { get, post } from '$lib/api';
import { goto } from '$app/navigation';
import { t } from '$lib/translations';
- import { getDomain } from '$lib/components/common';
+ import { getDomain } from '$lib/common';
+ import { appSession } from '$lib/store';
import Rust from '$lib/components/svg/applications/Rust.svelte';
import Nodejs from '$lib/components/svg/applications/Nodejs.svelte';
@@ -23,27 +44,29 @@
import Eleventy from '$lib/components/svg/applications/Eleventy.svelte';
import Deno from '$lib/components/svg/applications/Deno.svelte';
import Laravel from '$lib/components/svg/applications/Laravel.svelte';
-
- async function newApplication() {
- const { id } = await post('/applications/new', {});
- return await goto(`/applications/${id}`, { replaceState: true });
- }
- const ownApplications = applications.filter((application) => {
- if (application.teams[0].id === $session.teamId) {
+ ownApplications = applications.filter((application) => {
+ if (application.teams[0].id === $appSession.teamId) {
return application;
}
});
- const otherApplications = applications.filter((application) => {
- if (application.teams[0].id !== $session.teamId) {
+ otherApplications = applications.filter((application) => {
+ if (application.teams[0].id !== $appSession.teamId) {
return application;
}
});
+ async function newApplication() {
+ const { id } = await post('/applications/new', {});
+ return await goto(`/applications/${id}`, { replaceState: true });
+ }
</script>
<div class="flex space-x-1 p-6 font-bold">
<div class="mr-4 text-2xl ">{$t('index.applications')}</div>
- {#if $session.isAdmin}
- <div on:click={newApplication} class="add-icon cursor-pointer bg-green-600 hover:bg-green-500">
+ {#if $appSession.isAdmin}
+ <button
+ on:click={newApplication}
+ class="add-icon cursor-pointer bg-green-600 hover:bg-green-500"
+ >
<svg
class="w-6"
xmlns="http://www.w3.org/2000/svg"
@@ -57,7 +80,7 @@
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
/></svg
>
- </div>
+ </button>
{/if}
</div>
<div class="flex-col justify-center">
@@ -111,22 +134,30 @@
{/if}
<div class="truncate text-center text-xl font-bold">{application.name}</div>
- {#if $session.teamId === '0' && otherApplications.length > 0}
+ {#if $appSession.teamId === '0' && otherApplications.length > 0}
<div class="truncate text-center">Team {application.teams[0].name}</div>
{/if}
{#if application.fqdn}
<div class="truncate text-center">{getDomain(application.fqdn) || ''}</div>
{/if}
- {#if !application.gitSourceId || !application.destinationDockerId || !application.fqdn}
+ {#if !application.gitSourceId}
+ <div class="truncate text-center font-bold text-red-500 group-hover:text-white">
+ Git Source Missing
+ </div>
+ {:else if !application.destinationDockerId}
+ <div class="truncate text-center font-bold text-red-500 group-hover:text-white">
+ Destination Missing
+ </div>
+ {:else if !application.fqdn}
<div class="truncate text-center font-bold text-red-500 group-hover:text-white">
- Configuration missing
+ URL Missing
</div>
{/if}
</div>
</a>
{/each}
</div>
- {#if otherApplications.length > 0 && $session.teamId === '0'}
+ {#if otherApplications.length > 0 && $appSession.teamId === '0'}
<div class="px-6 pb-5 pt-10 text-xl font-bold">Other Applications</div>
<div class="flex flex-col flex-wrap justify-center px-2 md:flex-row">
{#each otherApplications as application}
@@ -171,7 +202,7 @@
{/if}
<div class="truncate text-center text-xl font-bold">{application.name}</div>
- {#if $session.teamId === '0'}
+ {#if $appSession.teamId === '0'}
<div class="truncate text-center">Team {application.teams[0].name}</div>
{/if}
{#if application.fqdn}
diff --git a/apps/ui/src/routes/databases/[id]/_DatabaseLinks.svelte b/apps/ui/src/routes/databases/[id]/_DatabaseLinks.svelte
new file mode 100644
index 0000000000..50eed98b2c
--- /dev/null
+++ b/apps/ui/src/routes/databases/[id]/_DatabaseLinks.svelte
@@ -0,0 +1,29 @@
+<script lang="ts">
+ export let database: any;
+
+ import Clickhouse from '$lib/components/svg/databases/Clickhouse.svelte';
+ import CouchDb from '$lib/components/svg/databases/CouchDB.svelte';
+ import MariaDb from '$lib/components/svg/databases/MariaDB.svelte';
+ import MongoDb from '$lib/components/svg/databases/MongoDB.svelte';
+ import MySql from '$lib/components/svg/databases/MySQL.svelte';
+ import PostgreSql from '$lib/components/svg/databases/PostgreSQL.svelte';
+ import Redis from '$lib/components/svg/databases/Redis.svelte';
+</script>
+
+<span class="relative">
+ {#if database.type === 'clickhouse'}
+ <Clickhouse />
+ {:else if database.type === 'couchdb'}
+ <CouchDb />
+ {:else if database.type === 'mongodb'}
+ <MongoDb />
+ {:else if database.type === 'mysql'}
+ <MySql />
+ {:else if database.type === 'mariadb'}
+ <MariaDb />
+ {:else if database.type === 'postgresql'}
+ <PostgreSql />
+ {:else if database.type === 'redis'}
+ <Redis />
+ {/if}
+</span>
diff --git a/src/routes/databases/[id]/_Databases/_CouchDb.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_CouchDb.svelte
similarity index 97%
rename from src/routes/databases/[id]/_Databases/_CouchDb.svelte
rename to apps/ui/src/routes/databases/[id]/_Databases/_CouchDb.svelte
index f8f9ebc10f..ee4c433feb 100644
--- a/src/routes/databases/[id]/_Databases/_CouchDb.svelte
+++ b/apps/ui/src/routes/databases/[id]/_Databases/_CouchDb.svelte
@@ -1,5 +1,5 @@
-<script>
- export let database;
+<script lang="ts">
+ export let database: any;
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import { t } from '$lib/translations';
</script>
diff --git a/src/routes/databases/[id]/_Databases/_Databases.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_Databases.svelte
similarity index 79%
rename from src/routes/databases/[id]/_Databases/_Databases.svelte
rename to apps/ui/src/routes/databases/[id]/_Databases/_Databases.svelte
index 8e02393a53..598c7b62d7 100644
--- a/src/routes/databases/[id]/_Databases/_Databases.svelte
+++ b/apps/ui/src/routes/databases/[id]/_Databases/_Databases.svelte
@@ -1,13 +1,11 @@
<script lang="ts">
- export let database;
- export let privatePort;
- export let settings;
- export let isRunning;
+ export let database: any;
+ export let privatePort: any;
+ export let settings: any;
- import { page, session } from '$app/stores';
+ import { page } from '$app/stores';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import Setting from '$lib/components/Setting.svelte';
- import { errorNotification } from '$lib/form';
import MySql from './_MySQL.svelte';
import MongoDb from './_MongoDB.svelte';
@@ -15,11 +13,11 @@
import PostgreSql from './_PostgreSQL.svelte';
import Redis from './_Redis.svelte';
import CouchDb from './_CouchDb.svelte';
- import { browser } from '$app/env';
import { post } from '$lib/api';
- import { getDomain } from '$lib/components/common';
import { toast } from '@zerodevx/svelte-toast';
import { t } from '$lib/translations';
+ import { errorNotification, getDomain } from '$lib/common';
+ import { appSession, status } from '$lib/store';
const { id } = $page.params;
@@ -29,9 +27,9 @@
let isPublic = database.settings.isPublic || false;
let appendOnly = database.settings.appendOnly;
- let databaseDefault;
- let databaseDbUser;
- let databaseDbUserPassword;
+ let databaseDefault: any;
+ let databaseDbUser: any;
+ let databaseDbUserPassword: any;
generateDbDetails();
@@ -48,24 +46,17 @@
databaseDbUser = '';
}
}
- $: databaseUrl = generateUrl();
- function generateUrl() {
- return (databaseUrl = browser
- ? `${database.type}://${
- databaseDbUser ? databaseDbUser + ':' : ''
- }${databaseDbUserPassword}@${
- isPublic
- ? settings.fqdn
- ? getDomain(settings.fqdn)
- : window.location.hostname
- : database.id
- }:${isPublic ? database.publicPort : privatePort}/${databaseDefault}`
- : $t('forms.loading'));
+ function generateUrl(): string {
+ return `${database.type}://${
+ databaseDbUser ? databaseDbUser + ':' : ''
+ }${databaseDbUserPassword}@${
+ isPublic ? (settings.fqdn ? getDomain(settings.fqdn) : window.location.hostname) : database.id
+ }:${isPublic ? database.publicPort : privatePort}/${databaseDefault}`;
}
- async function changeSettings(name) {
- if (publicLoading || !isRunning) return;
+ async function changeSettings(name: any) {
+ if (publicLoading || !$status.database.isRunning) return;
publicLoading = true;
let data = {
isPublic,
@@ -78,17 +69,16 @@
data.appendOnly = !appendOnly;
}
try {
- const { publicPort } = await post(`/databases/${id}/settings.json`, {
+ const { publicPort } = await post(`/databases/${id}/settings`, {
isPublic: data.isPublic,
appendOnly: data.appendOnly
});
isPublic = data.isPublic;
appendOnly = data.appendOnly;
- databaseUrl = generateUrl();
if (isPublic) {
database.publicPort = publicPort;
}
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
} finally {
publicLoading = false;
@@ -97,11 +87,10 @@
async function handleSubmit() {
try {
loading = true;
- await post(`/databases/${id}.json`, { ...database, isRunning });
+ await post(`/databases/${id}`, { ...database, isRunning: $status.database.isRunning });
generateDbDetails();
- databaseUrl = generateUrl();
toast.push('Settings saved.');
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
} finally {
loading = false;
@@ -113,7 +102,7 @@
<form on:submit|preventDefault={handleSubmit} class="py-4">
<div class="flex space-x-1 pb-5 font-bold">
<div class="title">{$t('general')}</div>
- {#if $session.isAdmin}
+ {#if $appSession.isAdmin}
<button
type="submit"
class:bg-purple-600={!loading}
@@ -127,7 +116,7 @@
<div class="grid grid-cols-2 items-center">
<label for="name" class="text-base font-bold text-stone-100">{$t('forms.name')}</label>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="name"
id="name"
bind:value={database.name}
@@ -154,15 +143,15 @@
<div class="grid grid-cols-2 items-center">
<label for="version" class="text-base font-bold text-stone-100">Version / Tag</label>
<a
- href={$session.isAdmin && !isRunning
+ href={$appSession.isAdmin && !$status.database.isRunning
? `/databases/${id}/configuration/version?from=/databases/${id}`
: ''}
class="no-underline"
>
<input
value={database.version}
- disabled={isRunning}
- class:cursor-pointer={!isRunning}
+ disabled={$status.database.isRunning}
+ class:cursor-pointer={!$status.database.isRunning}
/></a
>
</div>
@@ -196,15 +185,15 @@
</div>
<div class="grid grid-flow-row gap-2">
{#if database.type === 'mysql'}
- <MySql bind:database {isRunning} />
+ <MySql bind:database />
{:else if database.type === 'postgresql'}
- <PostgreSql bind:database {isRunning} />
+ <PostgreSql bind:database />
{:else if database.type === 'mongodb'}
- <MongoDb bind:database {isRunning} />
+ <MongoDb bind:database />
{:else if database.type === 'mariadb'}
- <MariaDb bind:database {isRunning} />
+ <MariaDb bind:database />
{:else if database.type === 'redis'}
- <Redis bind:database {isRunning} />
+ <Redis bind:database />
{:else if database.type === 'couchdb'}
<CouchDb {database} />
{/if}
@@ -236,7 +225,7 @@
on:click={() => changeSettings('isPublic')}
title={$t('database.set_public')}
description={$t('database.warning_database_public')}
- disabled={!isRunning}
+ disabled={!$status.database.isRunning}
/>
</div>
{#if database.type === 'redis'}
diff --git a/src/routes/databases/[id]/_Databases/_MariaDB.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_MariaDB.svelte
similarity index 89%
rename from src/routes/databases/[id]/_Databases/_MariaDB.svelte
rename to apps/ui/src/routes/databases/[id]/_Databases/_MariaDB.svelte
index 3bb135421f..3b138bb32f 100644
--- a/src/routes/databases/[id]/_Databases/_MariaDB.svelte
+++ b/apps/ui/src/routes/databases/[id]/_Databases/_MariaDB.svelte
@@ -1,6 +1,6 @@
-<script>
- export let database;
- export let isRunning;
+<script lang="ts">
+ export let database: any;
+ import { status } from '$lib/store';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import Explainer from '$lib/components/Explainer.svelte';
import { t } from '$lib/translations';
@@ -40,8 +40,8 @@
>{$t('forms.password')}</label
>
<CopyPasswordField
- disabled={!isRunning}
- readonly={!isRunning}
+ disabled={!$status.database.isRunning}
+ readonly={!$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField
id="dbUserPassword"
@@ -66,8 +66,8 @@
>{$t('forms.roots_password')}</label
>
<CopyPasswordField
- disabled={!isRunning}
- readonly={!isRunning}
+ disabled={!$status.database.isRunning}
+ readonly={!$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField
id="rootUserPassword"
diff --git a/src/routes/databases/[id]/_Databases/_MongoDB.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_MongoDB.svelte
similarity index 86%
rename from src/routes/databases/[id]/_Databases/_MongoDB.svelte
rename to apps/ui/src/routes/databases/[id]/_Databases/_MongoDB.svelte
index a732556d29..1d5626cca2 100644
--- a/src/routes/databases/[id]/_Databases/_MongoDB.svelte
+++ b/apps/ui/src/routes/databases/[id]/_Databases/_MongoDB.svelte
@@ -1,6 +1,6 @@
-<script>
- export let database;
- export let isRunning;
+<script lang="ts">
+ export let database: any;
+ import { status } from '$lib/store';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import Explainer from '$lib/components/Explainer.svelte';
import { t } from '$lib/translations';
@@ -26,8 +26,8 @@
>{$t('forms.roots_password')}</label
>
<CopyPasswordField
- disabled={!isRunning}
- readonly={!isRunning}
+ disabled={!$status.database.isRunning}
+ readonly={!$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField={true}
id="rootUserPassword"
diff --git a/src/routes/databases/[id]/_Databases/_MySQL.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_MySQL.svelte
similarity index 89%
rename from src/routes/databases/[id]/_Databases/_MySQL.svelte
rename to apps/ui/src/routes/databases/[id]/_Databases/_MySQL.svelte
index 3e96e276d7..13f42a6c9b 100644
--- a/src/routes/databases/[id]/_Databases/_MySQL.svelte
+++ b/apps/ui/src/routes/databases/[id]/_Databases/_MySQL.svelte
@@ -1,6 +1,6 @@
-<script>
- export let database;
- export let isRunning;
+<script lang="ts">
+ export let database: any;
+ import { status } from '$lib/store';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import Explainer from '$lib/components/Explainer.svelte';
import { t } from '$lib/translations';
@@ -40,8 +40,8 @@
>{$t('forms.password')}</label
>
<CopyPasswordField
- disabled={!isRunning}
- readonly={!isRunning}
+ disabled={!$status.database.isRunning}
+ readonly={!$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField
id="dbUserPassword"
@@ -66,8 +66,8 @@
>{$t('forms.roots_password')}</label
>
<CopyPasswordField
- disabled={!isRunning}
- readonly={!isRunning}
+ disabled={!$status.database.isRunning}
+ readonly={!$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField
id="rootUserPassword"
diff --git a/src/routes/databases/[id]/_Databases/_PostgreSQL.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_PostgreSQL.svelte
similarity index 88%
rename from src/routes/databases/[id]/_Databases/_PostgreSQL.svelte
rename to apps/ui/src/routes/databases/[id]/_Databases/_PostgreSQL.svelte
index c6bacd4ec1..788d17d56d 100644
--- a/src/routes/databases/[id]/_Databases/_PostgreSQL.svelte
+++ b/apps/ui/src/routes/databases/[id]/_Databases/_PostgreSQL.svelte
@@ -1,6 +1,6 @@
-<script>
- export let database;
- export let isRunning;
+<script lang="ts">
+ export let database: any;
+ import { status } from '$lib/store';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import Explainer from '$lib/components/Explainer.svelte';
import { t } from '$lib/translations';
@@ -29,8 +29,8 @@
>Root (postgres) User Password</label
>
<CopyPasswordField
- disabled={!isRunning}
- readonly={!isRunning}
+ disabled={!$status.database.isRunning}
+ readonly={!$status.database.isRunning}
placeholder="Generated automatically after start"
isPasswordField
id="rootUserPassword"
@@ -55,8 +55,8 @@
>{$t('forms.password')}</label
>
<CopyPasswordField
- disabled={!isRunning}
- readonly={!isRunning}
+ disabled={!$status.database.isRunning}
+ readonly={!$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField
id="dbUserPassword"
diff --git a/src/routes/databases/[id]/_Databases/_Redis.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_Redis.svelte
similarity index 81%
rename from src/routes/databases/[id]/_Databases/_Redis.svelte
rename to apps/ui/src/routes/databases/[id]/_Databases/_Redis.svelte
index 1005943433..d0deeb1581 100644
--- a/src/routes/databases/[id]/_Databases/_Redis.svelte
+++ b/apps/ui/src/routes/databases/[id]/_Databases/_Redis.svelte
@@ -1,6 +1,6 @@
-<script>
- export let database;
- export let isRunning;
+<script lang="ts">
+ export let database: any;
+ import { status } from '$lib/store';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import Explainer from '$lib/components/Explainer.svelte';
import { t } from '$lib/translations';
@@ -15,8 +15,8 @@
>{$t('forms.password')}</label
>
<CopyPasswordField
- disabled={!isRunning}
- readonly={!isRunning}
+ disabled={!$status.database.isRunning}
+ readonly={!$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField
id="dbUserPassword"
diff --git a/apps/ui/src/routes/databases/[id]/__layout.svelte b/apps/ui/src/routes/databases/[id]/__layout.svelte
new file mode 100644
index 0000000000..8de94b3443
--- /dev/null
+++ b/apps/ui/src/routes/databases/[id]/__layout.svelte
@@ -0,0 +1,297 @@
+<script context="module" lang="ts">
+ import type { Load } from '@sveltejs/kit';
+ function checkConfiguration(database: any): any {
+ let configurationPhase = null;
+ if (!database.type) {
+ configurationPhase = 'type';
+ } else if (!database.version) {
+ configurationPhase = 'version';
+ } else if (!database.destinationDockerId) {
+ configurationPhase = 'destination';
+ }
+ return configurationPhase;
+ }
+ export const load: Load = async ({ fetch, url, params }) => {
+ try {
+ const { id } = params;
+ const response = await get(`/databases/${id}`);
+ const { database, versions, privatePort, settings } = response;
+ if (id !== 'new' && (!database || Object.entries(database).length === 0)) {
+ return {
+ status: 302,
+ redirect: '/databases'
+ };
+ }
+ const configurationPhase = checkConfiguration(database);
+ if (
+ configurationPhase &&
+ url.pathname !== `/databases/${params.id}/configuration/${configurationPhase}`
+ ) {
+ return {
+ status: 302,
+ redirect: `/databases/${params.id}/configuration/${configurationPhase}`
+ };
+ }
+ return {
+ props: {
+ database,
+ versions,
+ privatePort
+ },
+ stuff: {
+ database,
+ versions,
+ privatePort,
+ settings
+ }
+ };
+ } catch (error) {
+ return handlerNotFoundLoad(error, url);
+ }
+ };
+</script>
+
+<script lang="ts">
+ export let database: any;
+ import { del, get, post } from '$lib/api';
+ import { t } from '$lib/translations';
+ import { goto } from '$app/navigation';
+ import { page } from '$app/stores';
+ import { errorNotification, handlerNotFoundLoad } from '$lib/common';
+ import { appSession, status } from '$lib/store';
+ import DeleteIcon from '$lib/components/DeleteIcon.svelte';
+ import Loading from '$lib/components/Loading.svelte';
+ import { onDestroy, onMount } from 'svelte';
+ const { id } = $page.params;
+
+ let loading = false;
+ let statusInterval: any = false;
+ async function deleteDatabase() {
+ const sure = confirm(`Are you sure you would like to delete '${database.name}'?`);
+ if (sure) {
+ loading = true;
+ try {
+ await del(`/databases/${database.id}`, { id: database.id });
+ return await goto('/databases');
+ } catch ({ error }) {
+ return errorNotification(error);
+ } finally {
+ loading = false;
+ }
+ }
+ }
+ async function stopDatabase() {
+ const sure = confirm($t('database.confirm_stop', { name: database.name }));
+ if (sure) {
+ loading = true;
+ try {
+ await post(`/databases/${database.id}/stop`, {});
+ return window.location.reload();
+ } catch ({ error }) {
+ return errorNotification(error);
+ }
+ }
+ }
+ async function startDatabase() {
+ loading = true;
+ try {
+ await post(`/databases/${database.id}/start`, {});
+ return window.location.reload();
+ } catch ({ error }) {
+ return errorNotification(error);
+ }
+ }
+ async function getStatus() {
+ if ($status.database.loading) return;
+ $status.database.loading = true;
+ const data = await get(`/databases/${id}`);
+ $status.database.isRunning = data.isRunning;
+ $status.database.initialLoading = false;
+ $status.database.loading = false;
+ }
+ onDestroy(() => {
+ $status.database.initialLoading = true;
+ clearInterval(statusInterval);
+ });
+ onMount(async () => {
+ $status.database.isRunning = false;
+ $status.database.loading = false;
+ if (
+ database.type &&
+ database.destinationDockerId &&
+ database.version &&
+ database.defaultDatabase
+ ) {
+ await getStatus();
+ statusInterval = setInterval(async () => {
+ await getStatus();
+ }, 2000);
+ }
+ });
+</script>
+
+{#if id !== 'new'}
+ <nav class="nav-side">
+ {#if loading}
+ <Loading fullscreen cover />
+ {:else}
+ {#if database.type && database.destinationDockerId && database.version && database.defaultDatabase}
+ {#if $status.database.initialLoading}
+ <button
+ class="icons tooltip-bottom flex animate-spin items-center space-x-2 bg-transparent text-sm duration-500 ease-in-out"
+ >
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="h-6 w-6"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path d="M9 4.55a8 8 0 0 1 6 14.9m0 -4.45v5h5" />
+ <line x1="5.63" y1="7.16" x2="5.63" y2="7.17" />
+ <line x1="4.06" y1="11" x2="4.06" y2="11.01" />
+ <line x1="4.63" y1="15.1" x2="4.63" y2="15.11" />
+ <line x1="7.16" y1="18.37" x2="7.16" y2="18.38" />
+ <line x1="11" y1="19.94" x2="11" y2="19.95" />
+ </svg>
+ </button>
+ {:else if $status.database.isRunning}
+ <button
+ on:click={stopDatabase}
+ title={$t('database.stop_database')}
+ type="submit"
+ disabled={!$appSession.isAdmin}
+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-red-500"
+ data-tooltip={$appSession.isAdmin
+ ? $t('database.stop_database')
+ : $t('database.permission_denied_stop_database')}
+ >
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="w-6 h-6"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <rect x="6" y="5" width="4" height="14" rx="1" />
+ <rect x="14" y="5" width="4" height="14" rx="1" />
+ </svg>
+ </button>
+ {:else}
+ <button
+ on:click={startDatabase}
+ title={$t('database.start_database')}
+ type="submit"
+ disabled={!$appSession.isAdmin}
+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-green-500"
+ data-tooltip={$appSession.isAdmin
+ ? $t('database.start_database')
+ : $t('database.permission_denied_start_database')}
+ ><svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="w-6 h-6"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path d="M7 4v16l13 -8z" />
+ </svg>
+ </button>
+ {/if}
+ {/if}
+ <div class="border border-stone-700 h-8" />
+ <a
+ href="/databases/{id}"
+ sveltekit:prefetch
+ class="hover:text-yellow-500 rounded"
+ class:text-yellow-500={$page.url.pathname === `/databases/${id}`}
+ class:bg-coolgray-500={$page.url.pathname === `/databases/${id}`}
+ >
+ <button
+ title={$t('application.configurations')}
+ class="icons bg-transparent tooltip-bottom text-sm disabled:text-red-500"
+ data-tooltip={$t('application.configurations')}
+ >
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="h-6 w-6"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <rect x="4" y="8" width="4" height="4" />
+ <line x1="6" y1="4" x2="6" y2="8" />
+ <line x1="6" y1="12" x2="6" y2="20" />
+ <rect x="10" y="14" width="4" height="4" />
+ <line x1="12" y1="4" x2="12" y2="14" />
+ <line x1="12" y1="18" x2="12" y2="20" />
+ <rect x="16" y="5" width="4" height="4" />
+ <line x1="18" y1="4" x2="18" y2="5" />
+ <line x1="18" y1="9" x2="18" y2="20" />
+ </svg></button
+ ></a
+ >
+ <div class="border border-stone-700 h-8" />
+ <a
+ href={$status.database.isRunning ? `/databases/${id}/logs` : null}
+ sveltekit:prefetch
+ class="hover:text-pink-500 rounded"
+ class:text-pink-500={$page.url.pathname === `/databases/${id}/logs`}
+ class:bg-coolgray-500={$page.url.pathname === `/databases/${id}/logs`}
+ >
+ <button
+ title={$t('database.logs')}
+ disabled={!$status.database.isRunning}
+ class="icons bg-transparent tooltip-bottom text-sm"
+ data-tooltip={$t('database.logs')}
+ >
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="h-6 w-6"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path d="M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />
+ <path d="M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />
+ <line x1="3" y1="6" x2="3" y2="19" />
+ <line x1="12" y1="6" x2="12" y2="19" />
+ <line x1="21" y1="6" x2="21" y2="19" />
+ </svg></button
+ ></a
+ >
+ <button
+ on:click={deleteDatabase}
+ title={$t('database.delete_database')}
+ type="submit"
+ disabled={!$appSession.isAdmin}
+ class:hover:text-red-500={$appSession.isAdmin}
+ class="icons bg-transparent tooltip-bottom text-sm"
+ data-tooltip={$appSession.isAdmin
+ ? $t('database.delete_database')
+ : $t('database.permission_denied_delete_database')}><DeleteIcon /></button
+ >
+ {/if}
+ </nav>
+{/if}
+<slot />
diff --git a/src/routes/databases/[id]/configuration/destination.svelte b/apps/ui/src/routes/databases/[id]/configuration/destination.svelte
similarity index 73%
rename from src/routes/databases/[id]/configuration/destination.svelte
rename to apps/ui/src/routes/databases/[id]/configuration/destination.svelte
index a7c96c1453..5f0b78c259 100644
--- a/src/routes/databases/[id]/configuration/destination.svelte
+++ b/apps/ui/src/routes/databases/[id]/configuration/destination.svelte
@@ -1,52 +1,47 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- const { database } = stuff;
- if (database?.destinationDockerId && !url.searchParams.get('from')) {
- return {
- status: 302,
- redirect: `/database/${params.id}`
- };
- }
-
- const endpoint = `/destinations.json`;
- const res = await fetch(endpoint);
-
- if (res.ok) {
+ try {
+ const { database } = stuff;
+ if (database?.destinationDockerId && !url.searchParams.get('from')) {
+ return {
+ status: 302,
+ redirect: `/database/${params.id}`
+ };
+ }
+ const response = await get(`/destinations`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
- import type Prisma from '@prisma/client';
-
import { page } from '$app/stores';
- import { errorNotification } from '$lib/form';
import { goto } from '$app/navigation';
- import { post } from '$lib/api';
+ import { get, post } from '$lib/api';
import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
const { id } = $page.params;
const from = $page.url.searchParams.get('from');
- export let destinations: Prisma.DestinationDocker[];
- async function handleSubmit(destinationId) {
+ export let destinations: any;
+ async function handleSubmit(destinationId: any) {
try {
- await post(`/databases/${id}/configuration/destination.json`, {
+ await post(`/databases/${id}/configuration/destination`, {
destinationId
});
return await goto(from || `/databases/${id}`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
diff --git a/src/routes/databases/[id]/configuration/type.svelte b/apps/ui/src/routes/databases/[id]/configuration/type.svelte
similarity index 76%
rename from src/routes/databases/[id]/configuration/type.svelte
rename to apps/ui/src/routes/databases/[id]/configuration/type.svelte
index fadba13658..48666f3917 100644
--- a/src/routes/databases/[id]/configuration/type.svelte
+++ b/apps/ui/src/routes/databases/[id]/configuration/type.svelte
@@ -1,39 +1,37 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- const { database } = stuff;
- if (database?.type && !url.searchParams.get('from')) {
- return {
- status: 302,
- redirect: `/databases/${params.id}`
- };
- }
- const endpoint = `/databases/${params.id}/configuration/type.json`;
- const res = await fetch(endpoint);
-
- if (res.ok) {
+ try {
+ const { database } = stuff;
+ if (database?.type && !url.searchParams.get('from')) {
+ return {
+ status: 302,
+ redirect: `/database/${params.id}`
+ };
+ }
+ const response = await get(`/databases/${params.id}/configuration/type`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
+ export let types: any;
+
import { page } from '$app/stores';
- import { errorNotification } from '$lib/form';
const { id } = $page.params;
const from = $page.url.searchParams.get('from');
- export let types;
import Clickhouse from '$lib/components/svg/databases/Clickhouse.svelte';
import CouchDB from '$lib/components/svg/databases/CouchDB.svelte';
import MongoDB from '$lib/components/svg/databases/MongoDB.svelte';
@@ -42,13 +40,14 @@
import PostgreSQL from '$lib/components/svg/databases/PostgreSQL.svelte';
import Redis from '$lib/components/svg/databases/Redis.svelte';
import { goto } from '$app/navigation';
- import { post } from '$lib/api';
+ import { get, post } from '$lib/api';
import { t } from '$lib/translations';
- async function handleSubmit(type) {
+ import { errorNotification } from '$lib/common';
+ async function handleSubmit(type: any) {
try {
- await post(`/databases/${id}/configuration/type.json`, { type });
+ await post(`/databases/${id}/configuration/type`, { type });
return await goto(from || `/databases/${id}/configuration/version`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
diff --git a/src/routes/databases/[id]/configuration/version.svelte b/apps/ui/src/routes/databases/[id]/configuration/version.svelte
similarity index 68%
rename from src/routes/databases/[id]/configuration/version.svelte
rename to apps/ui/src/routes/databases/[id]/configuration/version.svelte
index c5cbc171f0..b052903bb4 100644
--- a/src/routes/databases/[id]/configuration/version.svelte
+++ b/apps/ui/src/routes/databases/[id]/configuration/version.svelte
@@ -1,47 +1,46 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- const { database } = stuff;
- if (database?.version && !url.searchParams.get('from')) {
- return {
- status: 302,
- redirect: `/databases/${params.id}`
- };
- }
- const endpoint = `/databases/${params.id}/configuration/version.json`;
- const res = await fetch(endpoint);
-
- if (res.ok) {
+ try {
+ const { database } = stuff;
+ if (database?.version && !url.searchParams.get('from')) {
+ return {
+ status: 302,
+ redirect: `/database/${params.id}`
+ };
+ }
+ const response = await get(`/databases/${params.id}/configuration/version`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
+ export let versions: any;
+
import { page } from '$app/stores';
- import { enhance, errorNotification } from '$lib/form';
import { goto } from '$app/navigation';
- import { post } from '$lib/api';
+ import { get, post } from '$lib/api';
import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
const { id } = $page.params;
const from = $page.url.searchParams.get('from');
- export let versions;
- async function handleSubmit(version) {
+ async function handleSubmit(version: any) {
try {
- await post(`/databases/${id}/configuration/version.json`, { version });
+ await post(`/databases/${id}/configuration/version`, { version });
return await goto(from || `/databases/${id}/configuration/destination`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
diff --git a/src/routes/databases/[id]/index.svelte b/apps/ui/src/routes/databases/[id]/index.svelte
similarity index 66%
rename from src/routes/databases/[id]/index.svelte
rename to apps/ui/src/routes/databases/[id]/index.svelte
index c9eb7a4ffa..30bc242ceb 100644
--- a/src/routes/databases/[id]/index.svelte
+++ b/apps/ui/src/routes/databases/[id]/index.svelte
@@ -1,61 +1,41 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- import Databases from './_Databases/_Databases.svelte';
- export const load: Load = async ({ fetch, params, stuff }) => {
- if (stuff?.database?.id) {
- return {
- props: {
- database: stuff.database,
- versions: stuff.versions,
- privatePort: stuff.privatePort,
- settings: stuff.settings,
- isRunning: stuff.isRunning
- }
- };
- }
- const endpoint = `/databases/${params.id}.json`;
- const res = await fetch(endpoint);
-
- if (res.ok) {
- return {
- props: {
- ...(await res.json())
- }
- };
- }
-
+ export const load: Load = async ({ stuff }) => {
return {
- status: res.status,
- error: new Error(`Could not load ${endpoint}`)
+ props: { ...stuff }
};
};
</script>
<script lang="ts">
- import DatabaseLinks from '$lib/components/DatabaseLinks.svelte';
import { page } from '$app/stores';
import { get } from '$lib/api';
import { onDestroy, onMount } from 'svelte';
- export let database;
- export let settings;
- export let privatePort;
- export let isRunning;
+ import DatabaseLinks from './_DatabaseLinks.svelte';
+ import Databases from './_Databases/_Databases.svelte';
+ import { status } from '$lib/store';
+ export let database: any;
+ export let settings: any;
+ export let privatePort: any;
const { id } = $page.params;
- let usageLoading = false;
+ let loading = {
+ usage: false
+ };
let usage = {
MemUsage: 0,
CPUPerc: 0,
NetIO: 0
};
- let usageInterval;
+ let usageInterval: any;
async function getUsage() {
- if (usageLoading) return;
- usageLoading = true;
- const data = await get(`/databases/${id}/usage.json`);
+ if (loading.usage) return;
+ if (!$status.database.isRunning) return;
+ loading.usage = true;
+ const data = await get(`/databases/${id}/usage`);
usage = data.usage;
- usageLoading = false;
+ loading.usage = false;
}
onDestroy(() => {
@@ -65,7 +45,7 @@
await getUsage();
usageInterval = setInterval(async () => {
await getUsage();
- }, 1000);
+ }, 1500);
});
</script>
@@ -106,4 +86,4 @@
</dl>
</div>
</div>
-<Databases bind:database {privatePort} {settings} {isRunning} />
+<Databases bind:database {privatePort} {settings} />
diff --git a/src/routes/databases/[id]/logs/_Loading.svelte b/apps/ui/src/routes/databases/[id]/logs/_Loading.svelte
similarity index 100%
rename from src/routes/databases/[id]/logs/_Loading.svelte
rename to apps/ui/src/routes/databases/[id]/logs/_Loading.svelte
diff --git a/src/routes/databases/[id]/logs/index.svelte b/apps/ui/src/routes/databases/[id]/logs/index.svelte
similarity index 88%
rename from src/routes/databases/[id]/logs/index.svelte
rename to apps/ui/src/routes/databases/[id]/logs/index.svelte
index 107100503f..a84ae45624 100644
--- a/src/routes/databases/[id]/logs/index.svelte
+++ b/apps/ui/src/routes/databases/[id]/logs/index.svelte
@@ -2,38 +2,37 @@
import type { Load } from '@sveltejs/kit';
import { onDestroy, onMount } from 'svelte';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- let endpoint = `/databases/${params.id}/logs.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
+ try {
+ const response = await get(`/databases/${params.id}/logs`);
return {
props: {
database: stuff.database,
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
- export let database;
+ export let database: any;
import { page } from '$app/stores';
import LoadingLogs from './_Loading.svelte';
import { get } from '$lib/api';
- import { errorNotification } from '$lib/form';
import { t } from '$lib/translations';
+import { errorNotification } from '$lib/common';
- let loadLogsInterval = null;
- let logs = [];
- let lastLog = null;
- let followingInterval;
- let followingLogs;
- let logsEl;
+ let loadLogsInterval: any = null;
+ let logs: any = [];
+ let lastLog: any = null;
+ let followingInterval: any;
+ let followingLogs: any;
+ let logsEl: any;
let position = 0;
const { id } = $page.params;
@@ -49,7 +48,7 @@
});
async function loadAllLogs() {
try {
- const data: any = await get(`/databases/${id}/logs.json`);
+ const data: any = await get(`/databases/${id}/logs`);
if (data?.logs) {
lastLog = data.logs[data.logs.length - 1];
logs = data.logs;
@@ -62,7 +61,7 @@
async function loadLogs() {
try {
const newLogs: any = await get(
- `/databases/${id}/logs.json?since=${lastLog?.split(' ')[0] || 0}`
+ `/databases/${id}/logs?since=${lastLog?.split(' ')[0] || 0}`
);
if (newLogs?.logs && newLogs.logs[newLogs.logs.length - 1] !== logs[logs.length - 1]) {
diff --git a/src/routes/databases/index.svelte b/apps/ui/src/routes/databases/index.svelte
similarity index 83%
rename from src/routes/databases/index.svelte
rename to apps/ui/src/routes/databases/index.svelte
index 7939910ae2..e7881343cc 100644
--- a/src/routes/databases/index.svelte
+++ b/apps/ui/src/routes/databases/index.svelte
@@ -1,5 +1,24 @@
+<script context="module" lang="ts">
+ import type { Load } from '@sveltejs/kit';
+ export const load: Load = async () => {
+ try {
+ const response = await get(`/databases`);
+ return {
+ props: {
+ ...response
+ }
+ };
+ } catch (error: any) {
+ return {
+ status: 500,
+ error: new Error(error)
+ };
+ }
+ };
+</script>
+
<script lang="ts">
- export let databases;
+ export let databases: any = [];
import Clickhouse from '$lib/components/svg/databases/Clickhouse.svelte';
import CouchDB from '$lib/components/svg/databases/CouchDB.svelte';
import MongoDB from '$lib/components/svg/databases/MongoDB.svelte';
@@ -7,22 +26,23 @@
import MySQL from '$lib/components/svg/databases/MySQL.svelte';
import PostgreSQL from '$lib/components/svg/databases/PostgreSQL.svelte';
import Redis from '$lib/components/svg/databases/Redis.svelte';
- import { post } from '$lib/api';
- import { goto } from '$app/navigation';
- import { session } from '$app/stores';
+ import { get, post } from '$lib/api';
import { t } from '$lib/translations';
+ import { appSession } from '$lib/store';
+ import { goto } from '$app/navigation';
async function newDatabase() {
const { id } = await post('/databases/new', {});
return await goto(`/databases/${id}`, { replaceState: true });
}
- const ownDatabases = databases.filter((database) => {
- if (database.teams[0].id === $session.teamId) {
+
+ const ownDatabases = databases.filter((database: any) => {
+ if (database.teams[0].id === $appSession.teamId) {
return database;
}
});
- const otherDatabases = databases.filter((database) => {
- if (database.teams[0].id !== $session.teamId) {
+ const otherDatabases = databases.filter((database: any) => {
+ if (database.teams[0].id !== $appSession.teamId) {
return database;
}
});
@@ -77,7 +97,7 @@
<div class="truncate text-center text-xl font-bold">
{database.name}
</div>
- {#if $session.teamId === '0' && otherDatabases.length > 0}
+ {#if $appSession.teamId === '0' && otherDatabases.length > 0}
<div class="truncate text-center">{database.teams[0].name}</div>
{/if}
{#if !database.type}
@@ -89,7 +109,7 @@
</a>
{/each}
</div>
- {#if otherDatabases.length > 0 && $session.teamId === '0'}
+ {#if otherDatabases.length > 0 && $appSession.teamId === '0'}
<div class="px-6 pb-5 pt-10 text-xl font-bold">Other Databases</div>
<div class="flex flex-col flex-wrap justify-center px-2 md:flex-row">
{#each otherDatabases as database}
@@ -113,7 +133,7 @@
<div class="truncate text-center text-xl font-bold">
{database.name}
</div>
- {#if $session.teamId === '0'}
+ {#if $appSession.teamId === '0'}
<div class="truncate text-center">{database.teams[0].name}</div>
{/if}
{#if !database.type}
diff --git a/apps/ui/src/routes/destinations/[id]/_Destination.svelte b/apps/ui/src/routes/destinations/[id]/_Destination.svelte
new file mode 100644
index 0000000000..19d1e662ac
--- /dev/null
+++ b/apps/ui/src/routes/destinations/[id]/_Destination.svelte
@@ -0,0 +1,25 @@
+
+<script lang="ts">
+ export let destination: any;
+ export let settings: any;
+ export let state: any;
+ import LocalDocker from './_LocalDocker.svelte';
+ import RemoteDocker from './_RemoteDocker.svelte';
+</script>
+
+<div class="flex h-20 items-center space-x-2 p-5 px-6 font-bold">
+ <div class="-mb-5 flex-col">
+ <div class="md:max-w-64 truncate text-base tracking-tight md:text-2xl lg:block">
+ Configuration
+ </div>
+ <span class="text-xs">{destination.name}</span>
+ </div>
+</div>
+
+<div class="mx-auto max-w-4xl px-6">
+ {#if destination.remoteEngine}
+ <RemoteDocker bind:destination {settings} {state} />
+ {:else}
+ <LocalDocker bind:destination {settings} {state} />
+ {/if}
+</div>
\ No newline at end of file
diff --git a/src/routes/destinations/[id]/_LocalDocker.svelte b/apps/ui/src/routes/destinations/[id]/_LocalDocker.svelte
similarity index 87%
rename from src/routes/destinations/[id]/_LocalDocker.svelte
rename to apps/ui/src/routes/destinations/[id]/_LocalDocker.svelte
index 30112eec84..e034b736e4 100644
--- a/src/routes/destinations/[id]/_LocalDocker.svelte
+++ b/apps/ui/src/routes/destinations/[id]/_LocalDocker.svelte
@@ -1,16 +1,17 @@
<script lang="ts">
- export let destination;
- export let settings;
- export let state;
+ export let destination: any;
+ export let settings: any;
+ export let state: any;
import { toast } from '@zerodevx/svelte-toast';
- import { page, session } from '$app/stores';
- import Setting from '$lib/components/Setting.svelte';
- import { errorNotification } from '$lib/form';
+ import { page } from '$app/stores';
import { post } from '$lib/api';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import { onMount } from 'svelte';
import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
+ import { appSession } from '$lib/store';
+ import Setting from '$lib/components/Setting.svelte';
const { id } = $page.params;
let cannotDisable = settings.fqdn && destination.engine === '/var/run/docker.sock';
let loading = false;
@@ -19,8 +20,8 @@
async function handleSubmit() {
loading = true;
try {
- return await post(`/destinations/${id}.json`, { ...destination });
- } catch ({ error }) {
+ return await post(`/destinations/${id}`, { ...destination });
+ } catch (error) {
return errorNotification(error);
} finally {
loading = false;
@@ -30,23 +31,23 @@
if (state === false && destination.isCoolifyProxyUsed === true) {
destination.isCoolifyProxyUsed = !destination.isCoolifyProxyUsed;
try {
- await post(`/destinations/${id}/settings.json`, {
+ await post(`/destinations/${id}/settings`, {
isCoolifyProxyUsed: destination.isCoolifyProxyUsed,
engine: destination.engine
});
await stopProxy();
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
} else if (state === true && destination.isCoolifyProxyUsed === false) {
destination.isCoolifyProxyUsed = !destination.isCoolifyProxyUsed;
try {
- await post(`/destinations/${id}/settings.json`, {
+ await post(`/destinations/${id}/settings`, {
isCoolifyProxyUsed: destination.isCoolifyProxyUsed,
engine: destination.engine
});
await startProxy();
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
@@ -67,7 +68,7 @@
destination.isCoolifyProxyUsed = !destination.isCoolifyProxyUsed;
try {
loadingProxy = true;
- await post(`/destinations/${id}/settings.json`, {
+ await post(`/destinations/${id}/settings`, {
isCoolifyProxyUsed: destination.isCoolifyProxyUsed,
engine: destination.engine
});
@@ -85,7 +86,7 @@
}
async function stopProxy() {
try {
- await post(`/destinations/${id}/stop.json`, { engine: destination.engine });
+ await post(`/destinations/${id}/stop`, { engine: destination.engine });
return toast.push($t('destination.coolify_proxy_stopped'));
} catch ({ error }) {
return errorNotification(error);
@@ -93,7 +94,7 @@
}
async function startProxy() {
try {
- await post(`/destinations/${id}/start.json`, { engine: destination.engine });
+ await post(`/destinations/${id}/start`, { engine: destination.engine });
return toast.push($t('destination.coolify_proxy_started'));
} catch ({ error }) {
return errorNotification(error);
@@ -105,7 +106,7 @@
try {
restarting = true;
toast.push($t('destination.coolify_proxy_restarting'));
- await post(`/destinations/${id}/restart.json`, {
+ await post(`/destinations/${id}/restart`, {
engine: destination.engine,
fqdn: settings.fqdn
});
@@ -123,7 +124,7 @@
<form on:submit|preventDefault={handleSubmit} class="grid grid-flow-row gap-2 py-4">
<div class="flex space-x-1 pb-5">
<div class="title font-bold">{$t('forms.configuration')}</div>
- {#if $session.isAdmin}
+ {#if $appSession.isAdmin}
<button
type="submit"
class="bg-sky-600 hover:bg-sky-500"
@@ -150,8 +151,8 @@
<input
name="name"
placeholder={$t('forms.name')}
- disabled={!$session.isAdmin}
- readonly={!$session.isAdmin}
+ disabled={!$appSession.isAdmin}
+ readonly={!$appSession.isAdmin}
bind:value={destination.name}
/>
</div>
@@ -182,7 +183,7 @@
value={destination.network}
/>
</div>
- {#if $session.teamId === '0'}
+ {#if $appSession.teamId === '0'}
<div class="grid grid-cols-2 items-center">
<Setting
loading={loadingProxy}
diff --git a/src/routes/new/destination/index.svelte b/apps/ui/src/routes/destinations/[id]/_New.svelte
similarity index 81%
rename from src/routes/new/destination/index.svelte
rename to apps/ui/src/routes/destinations/[id]/_New.svelte
index 9641ed72f1..6617fd965d 100644
--- a/src/routes/new/destination/index.svelte
+++ b/apps/ui/src/routes/destinations/[id]/_New.svelte
@@ -1,12 +1,11 @@
-<script>
- import LocalDocker from './_LocalDocker.svelte';
+<script lang="ts">
import cuid from 'cuid';
- import RemoteDocker from './_RemoteDocker.svelte';
import { t } from '$lib/translations';
+ import NewLocalDocker from './_NewLocalDocker.svelte';
+ import NewRemoteDocker from './_NewRemoteDocker.svelte';
let payload = {};
let selected = 'localDocker';
-
- function setPredefined(type) {
+ function setPredefined(type: any) {
selected = type;
switch (type) {
case 'localDocker':
@@ -46,13 +45,13 @@
>{$t('sources.local_docker')}</button
>
<!-- <button class="w-32" on:click={() => setPredefined('remoteDocker')}>Remote Docker</button> -->
- <button class="w-32" on:click={() => setPredefined('kubernetes')}>Kubernetes</button>
+ <!-- <button class="w-32" on:click={() => setPredefined('kubernetes')}>Kubernetes</button> -->
</div>
</div>
{#if selected === 'localDocker'}
- <LocalDocker {payload} />
+ <NewLocalDocker {payload} />
{:else if selected === 'remoteDocker'}
- <RemoteDocker {payload} />
+ <NewRemoteDocker {payload} />
{:else}
<div class="text-center font-bold text-4xl py-10">{$t('index.not_implemented_yet')}</div>
{/if}
diff --git a/src/routes/new/destination/_LocalDocker.svelte b/apps/ui/src/routes/destinations/[id]/_NewLocalDocker.svelte
similarity index 84%
rename from src/routes/new/destination/_LocalDocker.svelte
rename to apps/ui/src/routes/destinations/[id]/_NewLocalDocker.svelte
index dc08ea0531..595cefd8b6 100644
--- a/src/routes/new/destination/_LocalDocker.svelte
+++ b/apps/ui/src/routes/destinations/[id]/_NewLocalDocker.svelte
@@ -1,12 +1,12 @@
<script lang="ts">
- import { goto } from '$app/navigation';
- import { session } from '$app/stores';
+ export let payload: any;
- export let payload;
+ import { goto } from '$app/navigation';
import { post } from '$lib/api';
+ import { errorNotification } from '$lib/common';
import Setting from '$lib/components/Setting.svelte';
- import { errorNotification } from '$lib/form';
+ import { appSession } from '$lib/store';
import { t } from '$lib/translations';
let loading = false;
@@ -15,13 +15,16 @@
if (loading) return;
try {
loading = true;
- await post('/new/destination/check.json', { network: payload.network });
- const { id } = await post('/new/destination/docker.json', {
+ await post(`/destinations/check`, { network: payload.network });
+ const { id } = await post(`/destinations/new`, {
...payload
});
- return await goto(`/destinations/${id}`);
- } catch ({ error }) {
+ await goto(`/destinations/${id}`);
+ window.location.reload();
+ } catch (error) {
return errorNotification(error);
+ } finally {
+ loading = false;
}
}
</script>
@@ -65,7 +68,7 @@
bind:value={payload.network}
/>
</div>
- {#if $session.teamId === '0'}
+ {#if $appSession.teamId === '0'}
<div class="grid grid-cols-2 items-center">
<Setting
bind:setting={payload.isCoolifyProxyUsed}
diff --git a/src/routes/new/destination/_RemoteDocker.svelte b/apps/ui/src/routes/destinations/[id]/_NewRemoteDocker.svelte
similarity index 93%
rename from src/routes/new/destination/_RemoteDocker.svelte
rename to apps/ui/src/routes/destinations/[id]/_NewRemoteDocker.svelte
index d032d77b45..13e45e4a1b 100644
--- a/src/routes/new/destination/_RemoteDocker.svelte
+++ b/apps/ui/src/routes/destinations/[id]/_NewRemoteDocker.svelte
@@ -1,23 +1,22 @@
<script lang="ts">
- import { goto } from '$app/navigation';
+ export let payload: any;
- export let payload;
+ import { goto } from '$app/navigation';
import { post } from '$lib/api';
- import Explainer from '$lib/components/Explainer.svelte';
+ import { errorNotification } from '$lib/common';
import Setting from '$lib/components/Setting.svelte';
- import { errorNotification } from '$lib/form';
import { t } from '$lib/translations';
let loading = false;
async function handleSubmit() {
try {
- const { id } = await post('/new/destination/docker.json', {
+ const { id } = await post('/new/destination/docker', {
...payload
});
return await goto(`/destinations/${id}`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
diff --git a/src/routes/destinations/[id]/_RemoteDocker.svelte b/apps/ui/src/routes/destinations/[id]/_RemoteDocker.svelte
similarity index 94%
rename from src/routes/destinations/[id]/_RemoteDocker.svelte
rename to apps/ui/src/routes/destinations/[id]/_RemoteDocker.svelte
index c17d0239b6..1e23818cdb 100644
--- a/src/routes/destinations/[id]/_RemoteDocker.svelte
+++ b/apps/ui/src/routes/destinations/[id]/_RemoteDocker.svelte
@@ -1,17 +1,17 @@
<script lang="ts">
- export let destination;
- export let settings;
- export let state;
+ export let destination: any;
+ export let settings: any
+ export let state: any
import { toast } from '@zerodevx/svelte-toast';
import { page, session } from '$app/stores';
import Setting from '$lib/components/Setting.svelte';
- import { errorNotification } from '$lib/form';
import { post } from '$lib/api';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import { onMount } from 'svelte';
- import { generateRemoteEngine } from '$lib/components/common';
import { t } from '$lib/translations';
+import { errorNotification, generateRemoteEngine } from '$lib/common';
+import { appSession } from '$lib/store';
const { id } = $page.params;
let cannotDisable = settings.fqdn && destination.engine === '/var/run/docker.sock';
// let scannedApps = [];
@@ -21,7 +21,7 @@
loading = true;
try {
return await post(`/destinations/${id}.json`, { ...destination });
- } catch ({ error }) {
+ } catch (error ) {
return errorNotification(error);
} finally {
loading = false;
@@ -42,7 +42,7 @@
engine: destination.engine
});
await stopProxy();
- } catch ({ error }) {
+ } catch (error ) {
return errorNotification(error);
}
} else if (state === true && destination.isCoolifyProxyUsed === false) {
@@ -53,7 +53,7 @@
engine: destination.engine
});
await startProxy();
- } catch ({ error }) {
+ } catch ( error ) {
return errorNotification(error);
}
}
@@ -127,7 +127,7 @@
<form on:submit|preventDefault={handleSubmit} class="grid grid-flow-row gap-2 py-4">
<div class="flex space-x-1 pb-5">
<div class="title font-bold">{$t('forms.configuration')}</div>
- {#if $session.isAdmin}
+ {#if $appSession.isAdmin}
<button
type="submit"
class="bg-sky-600 hover:bg-sky-500"
@@ -154,8 +154,8 @@
<input
name="name"
placeholder={$t('forms.name')}
- disabled={!$session.isAdmin}
- readonly={!$session.isAdmin}
+ disabled={!$appSession.isAdmin}
+ readonly={!$appSession.isAdmin}
bind:value={destination.name}
/>
</div>
diff --git a/apps/ui/src/routes/destinations/[id]/__layout.svelte b/apps/ui/src/routes/destinations/[id]/__layout.svelte
new file mode 100644
index 0000000000..a3f9a94081
--- /dev/null
+++ b/apps/ui/src/routes/destinations/[id]/__layout.svelte
@@ -0,0 +1,71 @@
+<script context="module" lang="ts">
+ import type { Load } from '@sveltejs/kit';
+ export const load: Load = async ({ fetch, url, params }) => {
+ try {
+ const { id } = params;
+ const response = await get(`/destinations/${id}`);
+ const { destination, settings, state } = response;
+ if (id !== 'new' && (!destination || Object.entries(destination).length === 0)) {
+ return {
+ status: 302,
+ redirect: '/destinations'
+ };
+ }
+ return {
+ props: {
+ destination
+ },
+ stuff: {
+ destination,
+ settings,
+ state
+ }
+ };
+ } catch (error) {
+ return handlerNotFoundLoad(error, url);
+ }
+ };
+</script>
+
+<script lang="ts">
+ export let destination: any;
+
+ import { del, get } from '$lib/api';
+ import { t } from '$lib/translations';
+ import { goto } from '$app/navigation';
+ import { page } from '$app/stores';
+ import { errorNotification, handlerNotFoundLoad } from '$lib/common';
+ import { appSession } from '$lib/store';
+ import DeleteIcon from '$lib/components/DeleteIcon.svelte';
+
+ const { id } = $page.params;
+
+ async function deleteDestination(destination: any) {
+ const sure = confirm($t('application.confirm_to_delete', { name: destination.name }));
+ if (sure) {
+ try {
+ await del(`/destinations/${destination.id}`, { id: destination.id });
+ return await goto('/destinations');
+ } catch (error) {
+ return errorNotification(error);
+ }
+ }
+ }
+</script>
+
+{#if id !== 'new'}
+ <nav class="nav-side">
+ <button
+ on:click={() => deleteDestination(destination)}
+ title={$t('source.delete_git_source')}
+ type="submit"
+ disabled={!$appSession.isAdmin}
+ class:hover:text-red-500={$appSession.isAdmin}
+ class="icons tooltip-bottom bg-transparent text-sm"
+ data-tooltip={$appSession.isAdmin
+ ? $t('destination.delete_destination')
+ : $t('destination.permission_denied_delete_destination')}><DeleteIcon /></button
+ >
+ </nav>
+{/if}
+<slot />
diff --git a/apps/ui/src/routes/destinations/[id]/index.svelte b/apps/ui/src/routes/destinations/[id]/index.svelte
new file mode 100644
index 0000000000..52bdccb6f0
--- /dev/null
+++ b/apps/ui/src/routes/destinations/[id]/index.svelte
@@ -0,0 +1,24 @@
+<script context="module" lang="ts">
+ import type { Load } from '@sveltejs/kit';
+ export const load: Load = async ({ fetch, params, stuff }) => {
+ return {
+ props: { ...stuff }
+ };
+ };
+</script>
+
+<script lang="ts">
+ export let destination: any;
+ export let settings: any;
+ export let state: any;
+ import { page } from '$app/stores';
+ import New from './_New.svelte';
+ import Destination from './_Destination.svelte';
+ const { id } = $page.params;
+</script>
+
+{#if id === 'new'}
+ <New />
+{:else}
+ <Destination bind:destination bind:state bind:settings />
+{/if}
diff --git a/src/routes/destinations/index.svelte b/apps/ui/src/routes/destinations/index.svelte
similarity index 75%
rename from src/routes/destinations/index.svelte
rename to apps/ui/src/routes/destinations/index.svelte
index 1313cb1b61..6880ef78d1 100644
--- a/src/routes/destinations/index.svelte
+++ b/apps/ui/src/routes/destinations/index.svelte
@@ -1,38 +1,36 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch }) => {
- const url = `/destinations.json`;
- const res = await fetch(url);
-
- if (res.ok) {
+ export const load: Load = async () => {
+ try {
+ const response = await get(`/destinations`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
+ } catch (error: any) {
+ return {
+ status: 500,
+ error: new Error(error)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
- import type Prisma from '@prisma/client';
+ export let destinations: any[];
- import { session } from '$app/stores';
import { t } from '$lib/translations';
+ import { appSession } from '$lib/store';
+ import { get } from '$lib/api';
- export let destinations: Prisma.DestinationDocker[];
const ownDestinations = destinations.filter((destination) => {
- if (destination.teams[0].id === $session.teamId) {
+ if (destination.teams[0].id === $appSession.teamId) {
return destination;
}
});
const otherDestinations = destinations.filter((destination) => {
- if (destination.teams[0].id !== $session.teamId) {
+ if (destination.teams[0].id !== $appSession.teamId) {
return destination;
}
});
@@ -40,8 +38,8 @@
<div class="flex space-x-1 p-6 font-bold">
<div class="mr-4 text-2xl tracking-tight">{$t('index.destinations')}</div>
- {#if $session.isAdmin}
- <a href="/new/destination" class="add-icon bg-sky-600 hover:bg-sky-500">
+ {#if $appSession.isAdmin}
+ <a href="/destinations/new" class="add-icon bg-sky-600 hover:bg-sky-500">
<svg
class="w-6"
xmlns="http://www.w3.org/2000/svg"
@@ -71,7 +69,7 @@
<a href="/destinations/{destination.id}" class="w-96 p-2 no-underline">
<div class="box-selection hover:bg-sky-600">
<div class="truncate text-center text-xl font-bold">{destination.name}</div>
- {#if $session.teamId === '0' && otherDestinations.length > 0}
+ {#if $appSession.teamId === '0' && otherDestinations.length > 0}
<div class="truncate text-center">{destination.teams[0].name}</div>
{/if}
<div class="truncate text-center">{destination.network}</div>
@@ -80,14 +78,14 @@
{/each}
</div>
- {#if otherDestinations.length > 0 && $session.teamId === '0'}
+ {#if otherDestinations.length > 0 && $appSession.teamId === '0'}
<div class="px-6 pb-5 pt-10 text-xl font-bold">Other Destinations</div>
<div class="flex flex-col flex-wrap justify-center px-2 md:flex-row">
{#each otherDestinations as destination}
<a href="/destinations/{destination.id}" class="w-96 p-2 no-underline">
<div class="box-selection hover:bg-sky-600">
<div class="truncate text-center text-xl font-bold">{destination.name}</div>
- {#if $session.teamId === '0'}
+ {#if $appSession.teamId === '0'}
<div class="truncate text-center">{destination.teams[0].name}</div>
{/if}
<div class="truncate text-center">{destination.network}</div>
diff --git a/src/routes/iam/index.svelte b/apps/ui/src/routes/iam/index.svelte
similarity index 66%
rename from src/routes/iam/index.svelte
rename to apps/ui/src/routes/iam/index.svelte
index d7f214acaa..4f000dc16b 100644
--- a/src/routes/iam/index.svelte
+++ b/apps/ui/src/routes/iam/index.svelte
@@ -1,103 +1,110 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch }) => {
- const url = `/iam.json`;
- const res = await fetch(url);
-
- if (res.ok) {
+ export const load: Load = async () => {
+ try {
+ const response = await get(`/iam`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
- }
- if (res.status === 401) {
+ } catch (error: any) {
return {
- status: 302,
- redirect: '/'
+ status: 500,
+ error: new Error(error)
};
}
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
- import { page, session } from '$app/stores';
- import { get, post } from '$lib/api';
- import { errorNotification } from '$lib/form';
- import { toast } from '@zerodevx/svelte-toast';
+ export let account: any;
+ export let accounts: any;
+ export let invitations: any;
+ export let ownTeams: any;
+ export let allTeams: any;
- export let account;
- export let accounts;
- export let invitations;
+ import { page } from '$app/stores';
+ import { del, get, post } from '$lib/api';
+ import { toast } from '@zerodevx/svelte-toast';
+ import { errorNotification } from '$lib/common';
+ import { appSession } from '$lib/store';
+ import { goto } from '$app/navigation';
+ import Cookies from 'js-cookie';
if (accounts.length === 0) {
accounts.push(account);
}
- export let ownTeams;
- export let allTeams;
- async function resetPassword(id) {
+ async function resetPassword(id: any) {
const sure = window.confirm('Are you sure you want to reset the password?');
if (!sure) {
return;
}
try {
- await post(`/iam/password.json`, { id });
+ await post(`/iam/user/password`, { id });
toast.push('Password reset successfully. Please relogin to reset it.');
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
- async function deleteUser(id) {
+ async function deleteUser(id: any) {
const sure = window.confirm('Are you sure you want to delete this user?');
if (!sure) {
return;
}
try {
- await post(`/iam.json`, { id });
+ await del(`/iam/user/remove`, { uid: id });
toast.push('Account deleted.');
- const data = await get('/iam.json');
+ const data = await get('/iam');
accounts = data.accounts;
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
- async function acceptInvitation(id, teamId) {
+ async function acceptInvitation(id: any, teamId: any) {
try {
- await post(`/iam/team/${teamId}/invitation/accept.json`, { id });
+ await post(`/iam/team/${teamId}/invitation/accept`, { id });
return window.location.reload();
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
- async function revokeInvitation(id, teamId) {
+ async function revokeInvitation(id: any, teamId: any) {
try {
- await post(`/iam/team/${teamId}/invitation/revoke.json`, { id });
+ await post(`/iam/team/${teamId}/invitation/revoke`, { id });
return window.location.reload();
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
- async function switchTeam(selectedTeamId) {
+ async function switchTeam(selectedTeamId: any) {
try {
- await post(`/dashboard.json?from=${$page.url.pathname}`, {
- cookie: 'teamId',
- value: selectedTeamId
- });
- return window.location.reload();
+ const payload = await get(`/user?teamId=${selectedTeamId}`);
+ if (payload.token) {
+ Cookies.set('token', payload.token, {
+ path: '/'
+ });
+ $appSession.teamId = payload.teamId;
+ $appSession.userId = payload.userId;
+ $appSession.permission = payload.permission;
+ $appSession.isAdmin = payload.isAdmin;
+ return window.location.reload();
+ }
} catch (error) {
- return window.location.reload();
+ console.error(error);
+ return errorNotification(error);
}
}
+ async function newTeam() {
+ const { id } = await post('/iam/new', {});
+ return await goto(`/iam/team/${id}`, { replaceState: true });
+ }
</script>
<div class="flex space-x-1 p-6 font-bold">
<div class="mr-4 text-2xl tracking-tight">Identity and Access Management</div>
- <a href="/new/team" class="add-icon cursor-pointer bg-fuchsia-600 hover:bg-fuchsia-500">
+ <div on:click={newTeam} class="add-icon cursor-pointer bg-fuchsia-600 hover:bg-fuchsia-500">
<svg
class="w-6"
xmlns="http://www.w3.org/2000/svg"
@@ -111,7 +118,7 @@
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
/></svg
>
- </a>
+ </div>
</div>
{#if invitations.length > 0}
@@ -138,7 +145,7 @@
</div>
{/if}
<div class="mx-auto max-w-4xl px-6 py-4">
- {#if $session.teamId === '0' && accounts.length > 0}
+ {#if $appSession.teamId === '0' && accounts.length > 0}
<div class="title font-bold">Accounts</div>
{:else}
<div class="title font-bold">Account</div>
@@ -167,7 +174,7 @@
</form>
<form on:submit|preventDefault={() => deleteUser(account.id)}>
<button
- disabled={account.id === $session.userId}
+ disabled={account.id === $appSession.userId}
class="mx-auto my-4 w-32 bg-red-600 hover:bg-red-500 disabled:bg-coolgray-200"
type="submit">Delete User</button
>
@@ -199,33 +206,18 @@
<div class="flex items-center justify-center pt-3">
<button
on:click|preventDefault={() => switchTeam(team.id)}
- class:bg-fuchsia-600={$session.teamId !== team.id}
- class:hover:bg-fuchsia-500={$session.teamId !== team.id}
- class:bg-transparent={$session.teamId === team.id}
- disabled={$session.teamId === team.id}
- ><svg
- xmlns="http://www.w3.org/2000/svg"
- class="h-6 w-6"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentColor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path d="M3 17h5l1.67 -2.386m3.66 -5.227l1.67 -2.387h6" />
- <path d="M18 4l3 3l-3 3" />
- <path d="M3 7h5l7 10h6" />
- <path d="M18 20l3 -3l-3 -3" />
- </svg></button
+ class:bg-fuchsia-600={$appSession.teamId !== team.id}
+ class:hover:bg-fuchsia-500={$appSession.teamId !== team.id}
+ class:bg-transparent={$appSession.teamId === team.id}
+ disabled={$appSession.teamId === team.id}
+ >{$appSession.teamId === team.id ? 'Current Team' : 'Switch Team'}</button
>
</div>
</div>
</a>
{/each}
</div>
- {#if $session.teamId === '0' && allTeams.length > 0}
+ {#if $appSession.teamId === '0' && allTeams.length > 0}
<div class="pb-5 pt-10 text-xl font-bold">Other Teams</div>
<div class="flex flex-row flex-wrap justify-center px-2 md:flex-row">
{#each allTeams as team}
diff --git a/apps/ui/src/routes/iam/team/[id]/__layout.svelte b/apps/ui/src/routes/iam/team/[id]/__layout.svelte
new file mode 100644
index 0000000000..b03af61c12
--- /dev/null
+++ b/apps/ui/src/routes/iam/team/[id]/__layout.svelte
@@ -0,0 +1,63 @@
+<script context="module" lang="ts">
+ import { del, get } from '$lib/api';
+ import type { Load } from '@sveltejs/kit';
+ export const load: Load = async ({ params, url }) => {
+ try {
+ const response = await get(`/iam/team/${params.id}`);
+ if (!response.permissions || Object.entries(response.permissions).length === 0) {
+ return {
+ status: 302,
+ redirect: '/iam'
+ };
+ }
+ return {
+ props: {
+ ...response
+ },
+ stuff: {
+ ...response
+ }
+ };
+ } catch (error) {
+ return handlerNotFoundLoad(error, url);
+ }
+ };
+</script>
+
+<script lang="ts">
+ import { page } from '$app/stores';
+ import { errorNotification, handlerNotFoundLoad } from '$lib/common';
+ import { appSession } from '$lib/store';
+ import { t } from '$lib/translations';
+ import DeleteIcon from '$lib/components/DeleteIcon.svelte';
+ import { goto } from '$app/navigation';
+ const { id } = $page.params;
+ async function deleteTeam() {
+ const sure = confirm('Are you sure you want to delete this team?');
+ if (sure) {
+ try {
+ await del(`/iam/team/${id}`, { id });
+ return await goto('/iam', { replaceState: true });
+ } catch (error) {
+ return errorNotification(error);
+ }
+ }
+ }
+</script>
+
+{#if id !== 'new'}
+ <nav class="nav-side">
+ <button
+ on:click={deleteTeam}
+ title={$t('source.delete_git_source')}
+ type="submit"
+ disabled={!$appSession.isAdmin}
+ class:hover:text-red-500={$appSession.isAdmin}
+ class="icons tooltip-bottom bg-transparent text-sm"
+ data-tooltip={$appSession.isAdmin
+ ? 'Delete Team'
+ : $t('destination.permission_denied_delete_destination')}><DeleteIcon /></button
+ >
+ </nav>
+{/if}
+<slot />
diff --git a/src/routes/iam/team/[id]/index.svelte b/apps/ui/src/routes/iam/team/[id]/index.svelte
similarity index 82%
rename from src/routes/iam/team/[id]/index.svelte
rename to apps/ui/src/routes/iam/team/[id]/index.svelte
index 0eff7af34b..ad21e0ad52 100644
--- a/src/routes/iam/team/[id]/index.svelte
+++ b/apps/ui/src/routes/iam/team/[id]/index.svelte
@@ -1,40 +1,28 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params }) => {
- const url = `/iam/team/${params.id}.json`;
- const res = await fetch(url);
-
- if (res.ok) {
- return {
- props: {
- ...(await res.json())
- }
- };
- }
-
+ export const load: Load = async ({ fetch, params, stuff }) => {
return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
+ props: { ...stuff }
};
};
</script>
<script lang="ts">
- export let permissions;
- export let team;
+ export let permissions: any;
+ export let team: any;
export let invitations: any[];
- import { page, session } from '$app/stores';
+ import { page } from '$app/stores';
import Explainer from '$lib/components/Explainer.svelte';
- import { errorNotification } from '$lib/form';
import { post } from '$lib/api';
import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
+ import { appSession } from '$lib/store';
const { id } = $page.params;
- let invitation = {
+ let invitation: any = {
teamName: team.name,
email: null,
permission: 'read'
};
- // let myPermission = permissions.find((u) => u.user.id === $session.userId).permission;
function isAdmin(permission: string) {
if (permission === 'admin' || permission === 'owner') {
return true;
@@ -45,30 +33,30 @@
async function sendInvitation() {
try {
- await post(`/iam/team/${id}/invitation/invite.json`, {
+ await post(`/iam/team/${id}/invitation/invite`, {
teamId: team.id,
teamName: invitation.teamName,
email: invitation.email.toLowerCase(),
permission: invitation.permission
});
return window.location.reload();
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
async function revokeInvitation(id: string) {
try {
- await post(`/iam/team/${id}/invitation/revoke.json`, { id });
+ await post(`/iam/team/${id}/invitation/revoke`, { id });
return window.location.reload();
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
async function removeFromTeam(uid: string) {
try {
- await post(`/iam/team/${id}/remove/user.json`, { teamId: team.id, uid });
+ await post(`/iam/team/${id}/user/remove`, { teamId: team.id, uid });
return window.location.reload();
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
@@ -78,17 +66,17 @@
newPermission = 'admin';
}
try {
- await post(`/iam/team/${id}/permission/change.json`, { userId, newPermission, permissionId });
+ await post(`/iam/team/${id}/permission`, { userId, newPermission, permissionId });
return window.location.reload();
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
async function handleSubmit() {
try {
- await post(`/iam/team/${id}.json`, { ...team });
+ await post(`/iam/team/${id}`, { ...team });
return window.location.reload();
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
@@ -135,11 +123,11 @@
<td class="py-4"
>{permission.user.email}
<span class="font-bold"
- >{permission.user.id === $session.userId ? $t('team.you') : ''}</span
+ >{permission.user.id === $appSession.userId ? $t('team.you') : ''}</span
></td
>
<td class="py-4">{permission.permission}</td>
- {#if $session.isAdmin && permission.user.id !== $session.userId && permission.permission !== 'owner'}
+ {#if $appSession.isAdmin && permission.user.id !== $appSession.userId && permission.permission !== 'owner'}
<td class="flex flex-col items-center justify-center space-y-2 py-4 text-center">
<button
class="w-52 bg-red-600 hover:bg-red-500"
@@ -181,7 +169,7 @@
{/each}
</table>
</div>
- {#if $session.isAdmin}
+ {#if $appSession.isAdmin}
<form on:submit|preventDefault={sendInvitation} class="py-5 pt-10">
<div class="flex space-x-1">
<div class="flex space-x-1">
diff --git a/apps/ui/src/routes/index.svelte b/apps/ui/src/routes/index.svelte
new file mode 100644
index 0000000000..7ed18a1339
--- /dev/null
+++ b/apps/ui/src/routes/index.svelte
@@ -0,0 +1,110 @@
+<script context="module" lang="ts">
+ import type { Load } from '@sveltejs/kit';
+
+ export const load: Load = async ({}) => {
+ try {
+ const data = await get('/resources');
+ return {
+ props: {
+ ...data
+ },
+ stuff: {
+ ...data
+ }
+ };
+ } catch (error) {
+ console.log(error);
+ return {};
+ }
+ };
+</script>
+
+<script lang="ts">
+ import { get } from '$lib/api';
+ import Usage from '$lib/components/Usage.svelte';
+ import { t } from '$lib/translations';
+
+ export let applicationsCount: number = 0;
+ export let sourcesCount: number = 0;
+ export let destinationsCount: number = 0;
+ export let teamsCount: number = 0;
+ export let databasesCount: number = 0;
+ export let servicesCount: number = 0;
+</script>
+
+<div class="flex space-x-1 p-6 font-bold">
+ <div class="mr-4 text-2xl tracking-tight">{$t('index.dashboard')}</div>
+</div>
+
+<div class="mt-10 pb-12 tracking-tight sm:pb-16">
+ <div class="mx-auto max-w-4xl">
+ <Usage />
+ <dl class="mt-5 grid grid-cols-1 gap-5 px-2 sm:grid-cols-3">
+ <a
+ href="/applications"
+ sveltekit:prefetch
+ class="overflow-hidden rounded px-4 py-5 text-center text-green-500 no-underline transition-all duration-100 hover:bg-green-500 hover:text-white sm:p-6 sm:text-left"
+ >
+ <dt class="truncate text-sm font-medium text-white">{$t('index.applications')}</dt>
+ <dd class="mt-1 text-3xl font-semibold ">
+ {applicationsCount}
+ </dd>
+ </a>
+ <a
+ href="/destinations"
+ sveltekit:prefetch
+ class="overflow-hidden rounded px-4 py-5 text-center text-sky-500 no-underline transition-all duration-100 hover:bg-sky-500 hover:text-white sm:p-6 sm:text-left"
+ >
+ <dt class="truncate text-sm font-medium text-white">{$t('index.destinations')}</dt>
+ <dd class="mt-1 text-3xl font-semibold ">
+ {destinationsCount}
+ </dd>
+ </a>
+
+ <a
+ href="/sources"
+ sveltekit:prefetch
+ class="overflow-hidden rounded px-4 py-5 text-center text-orange-500 no-underline transition-all duration-100 hover:bg-orange-500 hover:text-white sm:p-6 sm:text-left"
+ >
+ <dt class="truncate text-sm font-medium text-white">{$t('index.git_sources')}</dt>
+ <dd class="mt-1 text-3xl font-semibold">
+ {sourcesCount}
+ </dd>
+ </a>
+ </dl>
+ <dl class="mt-5 grid grid-cols-1 gap-5 px-2 sm:grid-cols-3">
+ <a
+ href="/databases"
+ sveltekit:prefetch
+ class="overflow-hidden rounded px-4 py-5 text-center text-purple-500 no-underline transition-all duration-100 hover:bg-purple-500 hover:text-white sm:p-6 sm:text-left"
+ >
+ <dt class="truncate text-sm font-medium text-white">{$t('index.databases')}</dt>
+ <dd class="mt-1 text-3xl font-semibold ">
+ {databasesCount}
+ </dd>
+ </a>
+
+ <a
+ href="/services"
+ sveltekit:prefetch
+ class="overflow-hidden rounded px-4 py-5 text-center text-pink-500 no-underline transition-all duration-100 hover:bg-pink-500 hover:text-white sm:p-6 sm:text-left"
+ >
+ <dt class="truncate text-sm font-medium text-white">{$t('index.services')}</dt>
+ <dd class="mt-1 text-3xl font-semibold ">
+ {servicesCount}
+ </dd>
+ </a>
+
+ <a
+ href="/iam"
+ sveltekit:prefetch
+ class="overflow-hidden rounded px-4 py-5 text-center text-cyan-500 no-underline transition-all duration-100 hover:bg-cyan-500 hover:text-white sm:p-6 sm:text-left"
+ >
+ <dt class="truncate text-sm font-medium text-white">{$t('index.teams')}</dt>
+ <dd class="mt-1 text-3xl font-semibold ">
+ {teamsCount}
+ </dd>
+ </a>
+ </dl>
+ </div>
+</div>
diff --git a/apps/ui/src/routes/login.svelte b/apps/ui/src/routes/login.svelte
new file mode 100644
index 0000000000..5ea74f67f7
--- /dev/null
+++ b/apps/ui/src/routes/login.svelte
@@ -0,0 +1,109 @@
+<script lang="ts">
+ import { browser } from '$app/env';
+ import Cookies from 'js-cookie';
+ import { goto } from '$app/navigation';
+ import { post } from '$lib/api';
+ import { errorNotification } from '$lib/common';
+ import { appSession, loginEmail } from '$lib/store';
+ import { t } from '$lib/translations';
+ import { onMount } from 'svelte';
+ let loading = false;
+ let emailEl: HTMLInputElement;
+ let email: string, password: string;
+
+ onMount(async () => {
+ if ($appSession.userId) {
+ return await goto('/');
+ }
+ emailEl.focus();
+ });
+ async function handleSubmit() {
+ loading = true;
+ try {
+ const { token, payload } = await post(`/login`, {
+ email: email.toLowerCase(),
+ password,
+ isLogin: true
+ });
+ Cookies.set('token', token, {
+ path: '/'
+ });
+ $appSession.teamId = payload.teamId;
+ $appSession.userId = payload.userId;
+ $appSession.permission = payload.permission;
+ $appSession.isAdmin = payload.isAdmin;
+ return await goto('/');
+ } catch (error) {
+ return errorNotification(error);
+ } finally {
+ loading = false;
+ }
+ }
+ async function gotoRegister() {
+ $loginEmail = email?.toLowerCase();
+ return await goto('/register');
+ }
+</script>
+
+<svelt:head>
+ <title>{$t('login.login')}</title>
+</svelt:head>
+
+<div class="flex h-screen flex-col items-center justify-center">
+ <div class="flex justify-center px-4">
+ <form on:submit|preventDefault={handleSubmit} class="flex flex-col py-4 space-y-2">
+ {#if $appSession.whiteLabeledDetails.icon}
+ <img
+ class="w-32 mx-auto pb-8"
+ src={$appSession.whiteLabeledDetails.icon}
+ alt="Icon for white labeled version of Coolify"
+ />
+ {:else}
+ <div class="text-6xl font-bold border-gradient w-48 mx-auto border-b-4 mb-8">Coolify</div>
+ {/if}
+ <input
+ type="email"
+ name="email"
+ placeholder={$t('forms.email')}
+ autocomplete="off"
+ required
+ bind:this={emailEl}
+ bind:value={email}
+ />
+ <input
+ type="password"
+ name="password"
+ placeholder={$t('forms.password')}
+ bind:value={password}
+ required
+ />
+
+ <div class="flex space-x-2 h-8 items-center justify-center pt-8">
+ <button
+ type="submit"
+ disabled={loading}
+ class="hover:opacity-90 text-white"
+ class:bg-transparent={loading}
+ class:text-stone-600={loading}
+ class:bg-coollabs={!loading}
+ >{loading ? $t('login.authenticating') : $t('login.login')}</button
+ >
+
+ <button
+ on:click|preventDefault={gotoRegister}
+ class="bg-transparent hover:bg-coolgray-300 text-white ">{$t('register.register')}</button
+ >
+ </div>
+ </form>
+ </div>
+ {#if browser && window.location.host === 'demo.coolify.io'}
+ <div class="pt-5 font-bold">
+ Registration is <span class="text-pink-500">open</span>, just fill in an email (does not need
+ to be live email address for the demo instance) and a password.
+ </div>
+ <div class="pt-5 font-bold">
+ All users gets an <span class="text-pink-500">own namespace</span>, so you won't be able to
+ access other users data.
+ </div>
+ {/if}
+</div>
diff --git a/src/routes/register/index.svelte b/apps/ui/src/routes/register.svelte
similarity index 70%
rename from src/routes/register/index.svelte
rename to apps/ui/src/routes/register.svelte
index 52ff77180f..606973bc90 100644
--- a/src/routes/register/index.svelte
+++ b/apps/ui/src/routes/register.svelte
@@ -1,23 +1,35 @@
+<script context="module" lang="ts">
+ import type { Load } from '@sveltejs/kit';
+ export const load: Load = async ({ fetch, params, stuff }) => {
+ return {
+ props: { ...stuff }
+ };
+ };
+</script>
+
<script lang="ts">
export let userCount: number;
- import { browser } from '$app/env';
import { goto } from '$app/navigation';
- import { session } from '$app/stores';
import { post } from '$lib/api';
- import { errorNotification } from '$lib/form';
+ import { errorNotification } from '$lib/common';
+ import { appSession, loginEmail } from '$lib/store';
import { t } from '$lib/translations';
import { onMount } from 'svelte';
+ import Cookies from 'js-cookie';
let loading = false;
- let emailEl;
- let email, password, passwordCheck;
+ let emailEl: HTMLInputElement;
+ let passwordEl: HTMLInputElement;
+ let email: string | undefined, password: string, passwordCheck: string;
- if (browser && $session.userId) {
- goto('/');
- }
onMount(() => {
- emailEl.focus();
+ email = $loginEmail;
+ if (email) {
+ passwordEl.focus();
+ } else {
+ emailEl.focus();
+ }
});
async function handleSubmit() {
// Prevent double submission
@@ -28,13 +40,20 @@
}
loading = true;
try {
- await post(`/login.json`, {
- email: email.toLowerCase(),
+ const { token, payload } = await post(`/login`, {
+ email: email?.toLowerCase(),
password,
isLogin: false
});
- return window.location.replace('/');
- } catch ({ error }) {
+ Cookies.set('token', token, {
+ path: '/'
+ });
+ $appSession.teamId = payload.teamId;
+ $appSession.userId = payload.userId;
+ $appSession.permission = payload.permission;
+ $appSession.isAdmin = payload.isAdmin;
+ return await goto('/');
+ } catch (error) {
return errorNotification(error);
} finally {
loading = false;
@@ -60,15 +79,15 @@
</svg>
</div>
<div class="flex h-screen flex-col items-center justify-center">
- {#if $session.userId}
+ {#if $appSession.userId}
<div class="flex justify-center px-4 text-xl font-bold">{$t('login.already_logged_in')}</div>
{:else}
<div class="flex justify-center px-4">
<form on:submit|preventDefault={handleSubmit} class="flex flex-col py-4 space-y-2">
- {#if $session.whiteLabelDetails.icon}
+ {#if $appSession.whiteLabeledDetails.icon}
<img
class="w-32 mx-auto pb-8"
- src={$session.whiteLabelDetails.icon}
+ src={$appSession.whiteLabeledDetails.icon}
alt="Icon for white labeled version of Coolify"
/>
{:else}
@@ -87,6 +106,7 @@
type="password"
name="password"
placeholder={$t('forms.password')}
+ bind:this={passwordEl}
bind:value={password}
required
/>
diff --git a/src/routes/services/[id]/secrets/_Secret.svelte b/apps/ui/src/routes/services/[id]/_Secret.svelte
similarity index 91%
rename from src/routes/services/[id]/secrets/_Secret.svelte
rename to apps/ui/src/routes/services/[id]/_Secret.svelte
index 72e6c1a664..7884e413c4 100644
--- a/src/routes/services/[id]/secrets/_Secret.svelte
+++ b/apps/ui/src/routes/services/[id]/_Secret.svelte
@@ -5,8 +5,8 @@
import { page } from '$app/stores';
import { del, post } from '$lib/api';
+ import { errorNotification } from '$lib/common';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
- import { errorNotification } from '$lib/form';
import { toast } from '@zerodevx/svelte-toast';
import { createEventDispatcher } from 'svelte';
@@ -14,13 +14,13 @@
const { id } = $page.params;
async function removeSecret() {
try {
- await del(`/services/${id}/secrets.json`, { name });
+ await del(`/services/${id}/secrets`, { name });
dispatch('refresh');
if (isNewSecret) {
name = '';
value = '';
}
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
@@ -28,7 +28,7 @@
if (!name) return errorNotification('Name is required.');
if (!value) return errorNotification('Value is required.');
try {
- await post(`/services/${id}/secrets.json`, {
+ await post(`/services/${id}/secrets`, {
name,
value,
@@ -40,7 +40,7 @@
value = '';
}
toast.push('Secret saved.');
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
diff --git a/src/lib/components/ServiceLinks.svelte b/apps/ui/src/routes/services/[id]/_ServiceLinks.svelte
similarity index 60%
rename from src/lib/components/ServiceLinks.svelte
rename to apps/ui/src/routes/services/[id]/_ServiceLinks.svelte
index b8bafc369a..5b07d38f35 100644
--- a/src/lib/components/ServiceLinks.svelte
+++ b/apps/ui/src/routes/services/[id]/_ServiceLinks.svelte
@@ -1,18 +1,24 @@
-<script>
- export let service;
- import Ghost from './svg/services/Ghost.svelte';
- import Hasura from './svg/services/Hasura.svelte';
- import LanguageTool from './svg/services/LanguageTool.svelte';
- import MinIo from './svg/services/MinIO.svelte';
- import N8n from './svg/services/N8n.svelte';
- import NocoDb from './svg/services/NocoDB.svelte';
- import PlausibleAnalytics from './svg/services/PlausibleAnalytics.svelte';
- import Umami from './svg/services/Umami.svelte';
- import UptimeKuma from './svg/services/UptimeKuma.svelte';
- import VaultWarden from './svg/services/VaultWarden.svelte';
- import VsCodeServer from './svg/services/VSCodeServer.svelte';
- import Wordpress from './svg/services/Wordpress.svelte';
- import Fider from './svg/services/Fider.svelte';
+<script lang="ts">
+ export let service: any;
+
+ import Fider from '$lib/components/svg/services/Fider.svelte';
+
+ import Ghost from '$lib/components/svg/services/Ghost.svelte';
+ import Hasura from '$lib/components/svg/services/Hasura.svelte';
+
+ import LanguageTool from '$lib/components/svg/services/LanguageTool.svelte';
+
+ import MinIo from '$lib/components/svg/services/MinIO.svelte';
+ import N8n from '$lib/components/svg/services/N8n.svelte';
+
+ import NocoDb from '$lib/components/svg/services/NocoDB.svelte';
+
+ import PlausibleAnalytics from '$lib/components/svg/services/PlausibleAnalytics.svelte';
+ import Umami from '$lib/components/svg/services/Umami.svelte';
+ import UptimeKuma from '$lib/components/svg/services/UptimeKuma.svelte';
+ import VaultWarden from '$lib/components/svg/services/VaultWarden.svelte';
+ import VsCodeServer from '$lib/components/svg/services/VSCodeServer.svelte';
+ import Wordpress from '$lib/components/svg/services/Wordpress.svelte';
</script>
{#if service.type === 'plausibleanalytics'}
diff --git a/src/routes/services/[id]/_Services/_Fider.svelte b/apps/ui/src/routes/services/[id]/_Services/_Fider.svelte
similarity index 96%
rename from src/routes/services/[id]/_Services/_Fider.svelte
rename to apps/ui/src/routes/services/[id]/_Services/_Fider.svelte
index 180235d578..f2d316fe50 100644
--- a/src/routes/services/[id]/_Services/_Fider.svelte
+++ b/apps/ui/src/routes/services/[id]/_Services/_Fider.svelte
@@ -1,10 +1,9 @@
<script lang="ts">
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
- import Explainer from '$lib/components/Explainer.svelte';
import { t } from '$lib/translations';
import Select from 'svelte-select';
- export let service;
- export let readOnly;
+ export let service: any;
+ export let readOnly: any;
let mailgunRegions = [
{
@@ -130,7 +129,7 @@
name="emailSmtpPassword"
id="emailSmtpPassword"
isPasswordField
- value={service.fider.emailSmtpPassword}
+ bind:value={service.fider.emailSmtpPassword}
readonly={readOnly}
disabled={readOnly}
placeholder="{$t('forms.eg')}: s0m3p4ssw0rd"
diff --git a/src/routes/services/[id]/_Services/_Ghost.svelte b/apps/ui/src/routes/services/[id]/_Services/_Ghost.svelte
similarity index 97%
rename from src/routes/services/[id]/_Services/_Ghost.svelte
rename to apps/ui/src/routes/services/[id]/_Services/_Ghost.svelte
index 48f9479710..b7b1d45798 100644
--- a/src/routes/services/[id]/_Services/_Ghost.svelte
+++ b/apps/ui/src/routes/services/[id]/_Services/_Ghost.svelte
@@ -1,8 +1,8 @@
<script lang="ts">
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import { t } from '$lib/translations';
- export let readOnly;
- export let service;
+ export let readOnly: any;
+ export let service: any;
</script>
<div class="flex space-x-1 py-5 font-bold">
@@ -71,7 +71,6 @@
<label for="mariadbRootUser">{$t('forms.root_db_user')}</label>
<CopyPasswordField
id="mariadbRootUser"
- isPasswordField
readonly
disabled
name="mariadbRootUser"
diff --git a/src/routes/services/[id]/_Services/_Hasura.svelte b/apps/ui/src/routes/services/[id]/_Services/_Hasura.svelte
similarity index 98%
rename from src/routes/services/[id]/_Services/_Hasura.svelte
rename to apps/ui/src/routes/services/[id]/_Services/_Hasura.svelte
index 5930e2ded9..b097ec84fd 100644
--- a/src/routes/services/[id]/_Services/_Hasura.svelte
+++ b/apps/ui/src/routes/services/[id]/_Services/_Hasura.svelte
@@ -2,7 +2,7 @@
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import Explainer from '$lib/components/Explainer.svelte';
import { t } from '$lib/translations';
- export let service;
+ export let service: any;
</script>
<div class="flex space-x-1 py-5 font-bold">
diff --git a/src/routes/services/[id]/_Services/_MeiliSearch.svelte b/apps/ui/src/routes/services/[id]/_Services/_MeiliSearch.svelte
similarity index 94%
rename from src/routes/services/[id]/_Services/_MeiliSearch.svelte
rename to apps/ui/src/routes/services/[id]/_Services/_MeiliSearch.svelte
index 383889bf2d..f34f9822cc 100644
--- a/src/routes/services/[id]/_Services/_MeiliSearch.svelte
+++ b/apps/ui/src/routes/services/[id]/_Services/_MeiliSearch.svelte
@@ -1,7 +1,7 @@
<script lang="ts">
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import { t } from '$lib/translations';
- export let service;
+ export let service: any;
</script>
<div class="flex space-x-1 py-5 font-bold">
diff --git a/src/routes/services/[id]/_Services/_MinIO.svelte b/apps/ui/src/routes/services/[id]/_Services/_MinIO.svelte
similarity index 97%
rename from src/routes/services/[id]/_Services/_MinIO.svelte
rename to apps/ui/src/routes/services/[id]/_Services/_MinIO.svelte
index 10d36a252c..002486d689 100644
--- a/src/routes/services/[id]/_Services/_MinIO.svelte
+++ b/apps/ui/src/routes/services/[id]/_Services/_MinIO.svelte
@@ -2,7 +2,7 @@
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import { t } from '$lib/translations';
- export let service;
+ export let service: any;
</script>
<div class="flex space-x-1 py-5 font-bold">
diff --git a/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte b/apps/ui/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte
similarity index 91%
rename from src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte
rename to apps/ui/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte
index c348f123e4..8532896dc6 100644
--- a/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte
+++ b/apps/ui/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte
@@ -1,12 +1,10 @@
<script lang="ts">
- import { session } from '$app/stores';
-
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import Explainer from '$lib/components/Explainer.svelte';
+ import { appSession, status } from '$lib/store';
import { t } from '$lib/translations';
- export let service;
- export let readOnly;
- export let isRunning;
+ export let service: any;
+ export let readOnly: any;
</script>
<div class="flex space-x-1 py-5 font-bold">
@@ -17,8 +15,8 @@
<input
name="scriptName"
id="scriptName"
- readonly={!$session.isAdmin && !isRunning}
- disabled={!$session.isAdmin || isRunning}
+ readonly={!$appSession.isAdmin && !$status.service.isRunning}
+ disabled={!$appSession.isAdmin || $status.service.isRunning}
placeholder="plausible.js"
bind:value={service.plausibleAnalytics.scriptName}
required
diff --git a/src/routes/services/[id]/_Services/_Services.svelte b/apps/ui/src/routes/services/[id]/_Services/_Services.svelte
similarity index 79%
rename from src/routes/services/[id]/_Services/_Services.svelte
rename to apps/ui/src/routes/services/[id]/_Services/_Services.svelte
index f432c09bf4..2980426ea0 100644
--- a/src/routes/services/[id]/_Services/_Services.svelte
+++ b/apps/ui/src/routes/services/[id]/_Services/_Services.svelte
@@ -1,21 +1,23 @@
<script lang="ts">
- import { browser } from '$app/env';
+ export let service: any;
+ export let readOnly: any;
+ export let settings: any;
- export let service;
- export let isRunning;
- export let readOnly;
- export let settings;
+ import cuid from 'cuid';
+ import { onMount } from 'svelte';
- import { page, session } from '$app/stores';
- import { post } from '$lib/api';
+ import { browser } from '$app/env';
+ import { page } from '$app/stores';
+ import { toast } from '@zerodevx/svelte-toast';
+
+ import { get, post } from '$lib/api';
+ import { errorNotification } from '$lib/common';
+ import { t } from '$lib/translations';
+ import { appSession, disabledButton, status } from '$lib/store';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import Explainer from '$lib/components/Explainer.svelte';
- import Setting from '$lib/components/Setting.svelte';
- import { errorNotification } from '$lib/form';
- import { t } from '$lib/translations';
- import { toast } from '@zerodevx/svelte-toast';
- import cuid from 'cuid';
- import { onMount } from 'svelte';
+ import Setting from '$lib/components/Setting.svelte'
+
import Fider from './_Fider.svelte';
import Ghost from './_Ghost.svelte';
import Hasura from './_Hasura.svelte';
@@ -36,14 +38,15 @@
if (loading) return;
loading = true;
try {
- await post(`/services/${id}/check.json`, {
+ await post(`/services/${id}/check`, {
fqdn: service.fqdn,
otherFqdns: service.minio?.apiFqdn ? [service.minio?.apiFqdn] : [],
exposePort: service.exposePort
});
- await post(`/services/${id}/${service.type}.json`, { ...service });
- return window.location.reload();
- } catch ({ error }) {
+ await post(`/services/${id}`, { ...service });
+ $disabledButton = false;
+ toast.push('Settings saved.');
+ } catch (error) {
return errorNotification(error);
} finally {
loading = false;
@@ -52,22 +55,22 @@
async function setEmailsToVerified() {
loadingVerification = true;
try {
- await post(`/services/${id}/${service.type}/activate.json`, { id: service.id });
+ await post(`/services/${id}/${service.type}/activate`, { id: service.id });
toast.push(t.get('services.all_email_verified'));
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
} finally {
loadingVerification = false;
}
}
- async function changeSettings(name) {
+ async function changeSettings(name: any) {
try {
if (name === 'dualCerts') {
dualCerts = !dualCerts;
}
- await post(`/services/${id}/settings.json`, { dualCerts });
+ await post(`/services/${id}/settings`, { dualCerts });
return toast.push(t.get('application.settings_saved'));
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
@@ -94,12 +97,11 @@
}
});
</script>
-
<div class="mx-auto max-w-4xl px-6 pb-12">
<form on:submit|preventDefault={handleSubmit} class="py-4">
<div class="flex space-x-1 pb-5 font-bold">
<div class="title">{$t('general')}</div>
- {#if $session.isAdmin}
+ {#if $appSession.isAdmin}
<button
type="submit"
class:bg-pink-600={!loading}
@@ -107,7 +109,7 @@
disabled={loading}>{loading ? $t('forms.saving') : $t('forms.save')}</button
>
{/if}
- {#if service.type === 'plausibleanalytics' && isRunning}
+ {#if service.type === 'plausibleanalytics' && $status.service.isRunning}
<button on:click|preventDefault={setEmailsToVerified} disabled={loadingVerification}
>{loadingVerification
? $t('forms.verifying')
@@ -117,7 +119,7 @@
</div>
<div class="grid grid-flow-row gap-2">
- {#if service.type === 'minio' && !service.minio.apiFqdn && isRunning}
+ {#if service.type === 'minio' && !service.minio.apiFqdn && $status.service.isRunning}
<div class="text-center">
<span class="font-bold text-red-500">IMPORTANT!</span> There was a small modification with
Minio in the latest version of Coolify. Now you can separate the Console URL from the API URL,
@@ -129,7 +131,7 @@
<label for="name" class="text-base font-bold text-stone-100">{$t('forms.name')}</label>
<div>
<input
- readonly={!$session.isAdmin}
+ readonly={!$appSession.isAdmin}
name="name"
id="name"
bind:value={service.name}
@@ -140,7 +142,7 @@
<div class="grid grid-cols-2 items-center px-10">
<label for="version" class="text-base font-bold text-stone-100">Version / Tag</label>
<a
- href={$session.isAdmin && !isRunning
+ href={$appSession.isAdmin && !$status.service.isRunning
? `/services/${id}/configuration/version?from=/services/${id}`
: ''}
class="no-underline"
@@ -148,8 +150,8 @@
<input
value={service.version}
id="service"
- disabled={isRunning}
- class:cursor-pointer={!isRunning}
+ disabled={$status.service.isRunning}
+ class:cursor-pointer={!$status.service.isRunning}
/></a
>
</div>
@@ -178,8 +180,8 @@
<CopyPasswordField
placeholder="eg: https://console.min.io"
- readonly={!$session.isAdmin && !isRunning}
- disabled={!$session.isAdmin || isRunning}
+ readonly={!$appSession.isAdmin && !$status.service.isRunning}
+ disabled={!$appSession.isAdmin || $status.service.isRunning}
name="fqdn"
id="fqdn"
pattern="^https?://([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{'{'}2,{'}'}$"
@@ -195,8 +197,8 @@
<CopyPasswordField
placeholder="eg: https://min.io"
- readonly={!$session.isAdmin && !isRunning}
- disabled={!$session.isAdmin || isRunning}
+ readonly={!$appSession.isAdmin && !$status.service.isRunning}
+ disabled={!$appSession.isAdmin || $status.service.isRunning}
name="apiFqdn"
id="apiFqdn"
pattern="^https?://([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{'{'}2,{'}'}$"
@@ -215,8 +217,8 @@
<CopyPasswordField
placeholder="eg: https://analytics.coollabs.io"
- readonly={!$session.isAdmin && !isRunning}
- disabled={!$session.isAdmin || isRunning}
+ readonly={!$appSession.isAdmin && !$status.service.isRunning}
+ disabled={!$appSession.isAdmin || $status.service.isRunning}
name="fqdn"
id="fqdn"
pattern="^https?://([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{'{'}2,{'}'}$"
@@ -228,19 +230,19 @@
<div class="grid grid-cols-2 items-center px-10">
<Setting
- disabled={isRunning}
+ disabled={$status.service.isRunning}
dataTooltip={$t('forms.must_be_stopped_to_modify')}
bind:setting={dualCerts}
title={$t('application.ssl_www_and_non_www')}
description={$t('services.generate_www_non_www_ssl')}
- on:click={() => !isRunning && changeSettings('dualCerts')}
+ on:click={() => !$status.service.isRunning && changeSettings('dualCerts')}
/>
</div>
<div class="grid grid-cols-2 items-center px-10">
<label for="exposePort" class="text-base font-bold text-stone-100">Exposed Port</label>
<input
- readonly={!$session.isAdmin && !isRunning}
- disabled={!$session.isAdmin || isRunning}
+ readonly={!$appSession.isAdmin && !$status.service.isRunning}
+ disabled={!$appSession.isAdmin || $status.service.isRunning}
name="exposePort"
id="exposePort"
bind:value={service.exposePort}
@@ -252,13 +254,13 @@
</div>
{#if service.type === 'plausibleanalytics'}
- <PlausibleAnalytics bind:service {isRunning} {readOnly} />
+ <PlausibleAnalytics bind:service {readOnly} />
{:else if service.type === 'minio'}
<MinIo {service} />
{:else if service.type === 'vscodeserver'}
<VsCodeServer {service} />
{:else if service.type === 'wordpress'}
- <Wordpress bind:service {isRunning} {readOnly} {settings} />
+ <Wordpress bind:service {readOnly} {settings} />
{:else if service.type === 'ghost'}
<Ghost bind:service {readOnly} />
{:else if service.type === 'meilisearch'}
diff --git a/src/routes/services/[id]/_Services/_Umami.svelte b/apps/ui/src/routes/services/[id]/_Services/_Umami.svelte
similarity index 97%
rename from src/routes/services/[id]/_Services/_Umami.svelte
rename to apps/ui/src/routes/services/[id]/_Services/_Umami.svelte
index 17dbeb179c..831444b2d9 100644
--- a/src/routes/services/[id]/_Services/_Umami.svelte
+++ b/apps/ui/src/routes/services/[id]/_Services/_Umami.svelte
@@ -2,7 +2,7 @@
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import Explainer from '$lib/components/Explainer.svelte';
- export let service;
+ export let service: any;
</script>
<div class="flex space-x-1 py-5 font-bold">
diff --git a/src/routes/services/[id]/_Services/_VSCodeServer.svelte b/apps/ui/src/routes/services/[id]/_Services/_VSCodeServer.svelte
similarity index 94%
rename from src/routes/services/[id]/_Services/_VSCodeServer.svelte
rename to apps/ui/src/routes/services/[id]/_Services/_VSCodeServer.svelte
index 43873bf4dc..c4418fbf9b 100644
--- a/src/routes/services/[id]/_Services/_VSCodeServer.svelte
+++ b/apps/ui/src/routes/services/[id]/_Services/_VSCodeServer.svelte
@@ -2,7 +2,7 @@
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import { t } from '$lib/translations';
- export let service;
+ export let service: any;
</script>
<div class="flex space-x-1 py-5 font-bold">
diff --git a/src/routes/services/[id]/_Services/_Wordpress.svelte b/apps/ui/src/routes/services/[id]/_Services/_Wordpress.svelte
similarity index 78%
rename from src/routes/services/[id]/_Services/_Wordpress.svelte
rename to apps/ui/src/routes/services/[id]/_Services/_Wordpress.svelte
index 13b222fc55..8ba3ae16fc 100644
--- a/src/routes/services/[id]/_Services/_Wordpress.svelte
+++ b/apps/ui/src/routes/services/[id]/_Services/_Wordpress.svelte
@@ -1,17 +1,16 @@
<script lang="ts">
import { post } from '$lib/api';
import { page } from '$app/stores';
+ import { status } from '$lib/store';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import Setting from '$lib/components/Setting.svelte';
- import { errorNotification } from '$lib/form';
import { browser } from '$app/env';
- import { getDomain } from '$lib/components/common';
import { t } from '$lib/translations';
+ import { errorNotification, getDomain } from '$lib/common';
- export let service;
- export let isRunning;
- export let readOnly;
- export let settings;
+ export let service: any;
+ export let readOnly: any;
+ export let settings: any;
const { id } = $page.params;
let ftpUrl = generateUrl(service.wordpress.ftpPublicPort);
@@ -20,16 +19,16 @@
let ftpLoading = false;
let ownMysql = service.wordpress.ownMysql;
- function generateUrl(publicPort) {
+ function generateUrl(publicPort: any) {
return browser
? `sftp://${
settings.fqdn ? getDomain(settings.fqdn) : window.location.hostname
}:${publicPort}`
: 'Loading...';
}
- async function changeSettings(name) {
+ async function changeSettings(name: any) {
if (ftpLoading) return;
- if (isRunning) {
+ if ($status.service.isRunning) {
ftpLoading = true;
let ftpEnabled = service.wordpress.ftpEnabled;
@@ -41,14 +40,14 @@
publicPort,
ftpUser: user,
ftpPassword: password
- } = await post(`/services/${id}/wordpress/ftp.json`, {
+ } = await post(`/services/${id}/wordpress/ftp`, {
ftpEnabled
});
ftpUrl = generateUrl(publicPort);
ftpUser = user;
ftpPassword = password;
service.wordpress.ftpEnabled = ftpEnabled;
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
} finally {
ftpLoading = false;
@@ -58,7 +57,7 @@
if (name === 'ownMysql') {
ownMysql = !ownMysql;
}
- await post(`/services/${id}/wordpress/settings.json`, {
+ await post(`/services/${id}/wordpress/settings`, {
ownMysql
});
service.wordpress.ownMysql = ownMysql;
@@ -77,13 +76,13 @@
<label for="extraConfig">{$t('forms.extra_config')}</label>
<textarea
bind:value={service.wordpress.extraConfig}
- disabled={isRunning}
- readonly={isRunning}
- class:resize-none={isRunning}
+ disabled={$status.service.isRunning}
+ readonly={$status.service.isRunning}
+ class:resize-none={$status.service.isRunning}
rows="5"
name="extraConfig"
id="extraConfig"
- placeholder={!isRunning
+ placeholder={!$status.service.isRunning
? `${$t('forms.eg')}:
define('WP_ALLOW_MULTISITE', true);
@@ -96,7 +95,7 @@ define('SUBDOMAIN_INSTALL', false);`
<Setting
bind:setting={service.wordpress.ftpEnabled}
loading={ftpLoading}
- disabled={!isRunning}
+ disabled={!$status.service.isRunning}
on:click={() => changeSettings('ftpEnabled')}
title="Enable sFTP connection to WordPress data"
description="Enables an on-demand sFTP connection to the WordPress data directory. This is useful if you want to use sFTP to upload files."
@@ -123,8 +122,8 @@ define('SUBDOMAIN_INSTALL', false);`
<Setting
dataTooltip={$t('forms.must_be_stopped_to_modify')}
bind:setting={service.wordpress.ownMysql}
- disabled={isRunning}
- on:click={() => !isRunning && changeSettings('ownMysql')}
+ disabled={$status.service.isRunning}
+ on:click={() => !$status.service.isRunning && changeSettings('ownMysql')}
title="Use your own MySQL server"
description="Enables the use of your own MySQL server. If you don't have one, you can use the one provided by Coolify."
/>
@@ -136,8 +135,8 @@ define('SUBDOMAIN_INSTALL', false);`
name="mysqlHost"
id="mysqlHost"
required
- readonly={isRunning}
- disabled={isRunning}
+ readonly={$status.service.isRunning}
+ disabled={$status.service.isRunning}
bind:value={service.wordpress.mysqlHost}
placeholder="{$t('forms.eg')}: db.coolify.io"
/>
@@ -148,8 +147,8 @@ define('SUBDOMAIN_INSTALL', false);`
name="mysqlPort"
id="mysqlPort"
required
- readonly={isRunning}
- disabled={isRunning}
+ readonly={$status.service.isRunning}
+ disabled={$status.service.isRunning}
bind:value={service.wordpress.mysqlPort}
placeholder="{$t('forms.eg')}: 3306"
/>
@@ -175,8 +174,8 @@ define('SUBDOMAIN_INSTALL', false);`
id="mysqlRootUser"
placeholder="MySQL {$t('forms.root_user')}"
value={service.wordpress.mysqlRootUser}
- readonly={isRunning || !service.wordpress.ownMysql}
- disabled={isRunning || !service.wordpress.ownMysql}
+ readonly={$status.service.isRunning || !service.wordpress.ownMysql}
+ disabled={$status.service.isRunning || !service.wordpress.ownMysql}
/>
</div>
<div class="grid grid-cols-2 items-center px-10">
@@ -184,8 +183,8 @@ define('SUBDOMAIN_INSTALL', false);`
<CopyPasswordField
id="mysqlRootUserPassword"
isPasswordField
- readonly={isRunning || !service.wordpress.ownMysql}
- disabled={isRunning || !service.wordpress.ownMysql}
+ readonly={$status.service.isRunning || !service.wordpress.ownMysql}
+ disabled={$status.service.isRunning || !service.wordpress.ownMysql}
name="mysqlRootUserPassword"
value={service.wordpress.mysqlRootUserPassword}
/>
@@ -197,8 +196,8 @@ define('SUBDOMAIN_INSTALL', false);`
name="mysqlUser"
id="mysqlUser"
bind:value={service.wordpress.mysqlUser}
- readonly={isRunning || !service.wordpress.ownMysql}
- disabled={isRunning || !service.wordpress.ownMysql}
+ readonly={$status.service.isRunning || !service.wordpress.ownMysql}
+ disabled={$status.service.isRunning || !service.wordpress.ownMysql}
/>
</div>
<div class="grid grid-cols-2 items-center px-10">
@@ -206,8 +205,8 @@ define('SUBDOMAIN_INSTALL', false);`
<CopyPasswordField
id="mysqlPassword"
isPasswordField
- readonly={isRunning || !service.wordpress.ownMysql}
- disabled={isRunning || !service.wordpress.ownMysql}
+ readonly={$status.service.isRunning || !service.wordpress.ownMysql}
+ disabled={$status.service.isRunning || !service.wordpress.ownMysql}
name="mysqlPassword"
bind:value={service.wordpress.mysqlPassword}
/>
diff --git a/src/routes/services/[id]/storage/_Storage.svelte b/apps/ui/src/routes/services/[id]/_Storage.svelte
similarity index 77%
rename from src/routes/services/[id]/storage/_Storage.svelte
rename to apps/ui/src/routes/services/[id]/_Storage.svelte
index 5fb3eb01e2..5993d68970 100644
--- a/src/routes/services/[id]/storage/_Storage.svelte
+++ b/apps/ui/src/routes/services/[id]/_Storage.svelte
@@ -1,6 +1,6 @@
<script lang="ts">
export let isNew = false;
- export let storage = {
+ export let storage: any = {
id: null,
path: null
};
@@ -8,8 +8,8 @@
import { page } from '$app/stores';
import { createEventDispatcher } from 'svelte';
- import { errorNotification } from '$lib/form';
import { toast } from '@zerodevx/svelte-toast';
+ import { errorNotification } from '$lib/common';
const { id } = $page.params;
const dispatch = createEventDispatcher();
@@ -19,7 +19,7 @@
storage.path = storage.path.startsWith('/') ? storage.path : `/${storage.path}`;
storage.path = storage.path.endsWith('/') ? storage.path.slice(0, -1) : storage.path;
storage.path.replace(/\/\//g, '/');
- await post(`/services/${id}/storage.json`, {
+ await post(`/services/${id}/storages`, {
path: storage.path,
storageId: storage.id,
newStorage
@@ -37,22 +37,31 @@
}
async function removeStorage() {
try {
- await del(`/services/${id}/storage.json`, { path: storage.path });
+ await del(`/services/${id}/storages`, { path: storage.path });
dispatch('refresh');
toast.push('Storage deleted.');
} catch ({ error }) {
return errorNotification(error);
}
}
+ async function handleSubmit() {
+ if (isNew) {
+ await saveStorage(true)
+ } else {
+ await saveStorage(false)
+ }
+ }
</script>
<td>
- <input
- bind:value={storage.path}
- required
- placeholder="eg: /data"
- class=" border border-dashed border-coolgray-300"
- />
+ <form on:submit|preventDefault={handleSubmit}>
+ <input
+ bind:value={storage.path}
+ required
+ placeholder="eg: /data"
+ class=" border border-dashed border-coolgray-300"
+ />
+ </form>
</td>
<td>
{#if isNew}
diff --git a/src/routes/services/[id]/__layout.svelte b/apps/ui/src/routes/services/[id]/__layout.svelte
similarity index 71%
rename from src/routes/services/[id]/__layout.svelte
rename to apps/ui/src/routes/services/[id]/__layout.svelte
index aa7026fd4f..a2f174a91b 100644
--- a/src/routes/services/[id]/__layout.svelte
+++ b/apps/ui/src/routes/services/[id]/__layout.svelte
@@ -1,6 +1,6 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- function checkConfiguration(service): string {
+ function checkConfiguration(service: any) {
let configurationPhase = null;
if (!service.type) {
configurationPhase = 'type';
@@ -11,12 +11,11 @@
}
return configurationPhase;
}
- export const load: Load = async ({ fetch, params, url }) => {
- let readOnly = false;
- const endpoint = `/services/${params.id}.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
- const { service, isRunning, settings } = await res.json();
+ export const load: Load = async ({ params, url }) => {
+ try {
+ let readOnly = false;
+ const response = await get(`/services/${params.id}`);
+ const { service, settings } = await response;
if (!service || Object.entries(service).length === 0) {
return {
status: 302,
@@ -39,49 +38,54 @@
return {
props: {
- service,
- isRunning
+ service
},
stuff: {
service,
- isRunning,
readOnly,
settings
}
};
+ } catch (error) {
+ return handlerNotFoundLoad(error, url);
}
-
- return {
- status: 302,
- redirect: '/services'
- };
};
</script>
-<script>
- import { page, session } from '$app/stores';
- import { errorNotification } from '$lib/form';
+<script lang="ts">
+ import { page } from '$app/stores';
import DeleteIcon from '$lib/components/DeleteIcon.svelte';
import Loading from '$lib/components/Loading.svelte';
- import { del, post } from '$lib/api';
+ import { del, get, post } from '$lib/api';
import { goto } from '$app/navigation';
import { t } from '$lib/translations';
+ import { errorNotification, handlerNotFoundLoad } from '$lib/common';
+ import { appSession, disabledButton, status } from '$lib/store';
+ import { onDestroy, onMount } from 'svelte';
const { id } = $page.params;
- export let service;
- export let isRunning;
+ export let service: any;
+
+ $disabledButton =
+ !$appSession.isAdmin ||
+ !service.fqdn ||
+ !service.destinationDocker ||
+ !service.version ||
+ !service.type;
let loading = false;
+ let statusInterval: any;
async function deleteService() {
const sure = confirm($t('application.confirm_to_delete', { name: service.name }));
if (sure) {
loading = true;
try {
- if (service.type) await post(`/services/${service.id}/${service.type}/stop.json`, {});
- await del(`/services/${service.id}/delete.json`, { id: service.id });
+ if (service.type && $status.service.isRunning)
+ await post(`/services/${service.id}/${service.type}/stop`, {});
+ await del(`/services/${service.id}`, { id: service.id });
return await goto(`/services`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
} finally {
loading = false;
@@ -93,9 +97,8 @@
if (sure) {
loading = true;
try {
- await post(`/services/${service.id}/${service.type}/stop.json`, {});
- return window.location.reload();
- } catch ({ error }) {
+ await post(`/services/${service.id}/${service.type}/stop`, {});
+ } catch (error) {
return errorNotification(error);
} finally {
loading = false;
@@ -105,29 +108,73 @@
async function startService() {
loading = true;
try {
- await post(`/services/${service.id}/${service.type}/start.json`, {});
- return window.location.reload();
- } catch ({ error }) {
+ await post(`/services/${service.id}/${service.type}/start`, {});
+ } catch (error) {
return errorNotification(error);
} finally {
loading = false;
}
}
+ async function getStatus() {
+ if ($status.service.loading) return;
+ $status.service.loading = true;
+ const data = await get(`/services/${id}`);
+ $status.service.isRunning = data.isRunning;
+ $status.service.initialLoading = false;
+ $status.service.loading = false;
+ }
+ onDestroy(() => {
+ $status.service.initialLoading = true;
+ clearInterval(statusInterval);
+ });
+ onMount(async () => {
+ $status.service.isRunning = false;
+ $status.service.loading = false;
+ if (service.type && service.destinationDockerId && service.version && service.fqdn) {
+ await getStatus();
+ statusInterval = setInterval(async () => {
+ await getStatus();
+ }, 2000);
+ }
+ });
</script>
<nav class="nav-side">
{#if loading}
<Loading fullscreen cover />
{:else}
- {#if service.type && service.destinationDockerId && service.version && service.fqdn}
- {#if isRunning}
+ {#if service.type && service.destinationDockerId && service.version}
+ {#if $status.service.initialLoading}
+ <button
+ class="icons tooltip-bottom flex animate-spin items-center space-x-2 bg-transparent text-sm duration-500 ease-in-out"
+ >
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="h-6 w-6"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path d="M9 4.55a8 8 0 0 1 6 14.9m0 -4.45v5h5" />
+ <line x1="5.63" y1="7.16" x2="5.63" y2="7.17" />
+ <line x1="4.06" y1="11" x2="4.06" y2="11.01" />
+ <line x1="4.63" y1="15.1" x2="4.63" y2="15.11" />
+ <line x1="7.16" y1="18.37" x2="7.16" y2="18.38" />
+ <line x1="11" y1="19.94" x2="11" y2="19.95" />
+ </svg>
+ </button>
+ {:else if $status.service.isRunning}
<button
on:click={stopService}
title={$t('service.stop_service')}
type="submit"
- disabled={!$session.isAdmin}
+ disabled={$disabledButton}
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-red-500"
- data-tooltip={$session.isAdmin
+ data-tooltip={$appSession.isAdmin
? $t('service.stop_service')
: $t('service.permission_denied_stop_service')}
>
@@ -151,9 +198,9 @@
on:click={startService}
title={$t('service.start_service')}
type="submit"
- disabled={!$session.isAdmin}
+ disabled={$disabledButton}
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-green-500"
- data-tooltip={$session.isAdmin
+ data-tooltip={$appSession.isAdmin
? $t('service.start_service')
: $t('service.permission_denied_start_service')}
><svg
@@ -241,11 +288,11 @@
></a
>
<a
- href="/services/{id}/storage"
+ href="/services/{id}/storages"
sveltekit:prefetch
class="hover:text-pink-500 rounded"
- class:text-pink-500={$page.url.pathname === `/services/${id}/storage`}
- class:bg-coolgray-500={$page.url.pathname === `/services/${id}/storage`}
+ class:text-pink-500={$page.url.pathname === `/services/${id}/storages`}
+ class:bg-coolgray-500={$page.url.pathname === `/services/${id}/storages`}
>
<button
title="Persistent Storage"
@@ -271,7 +318,7 @@
>
<div class="border border-stone-700 h-8" />
<a
- href={isRunning ? `/services/${id}/logs` : null}
+ href={$status.service.isRunning ? `/services/${id}/logs` : null}
sveltekit:prefetch
class="hover:text-pink-500 rounded"
class:text-pink-500={$page.url.pathname === `/services/${id}/logs`}
@@ -279,7 +326,7 @@
>
<button
title={$t('service.logs')}
- disabled={!isRunning}
+ disabled={!$status.service.isRunning}
class="icons bg-transparent tooltip-bottom text-sm"
data-tooltip={$t('service.logs')}
>
@@ -307,10 +354,10 @@
on:click={deleteService}
title={$t('service.delete_service')}
type="submit"
- disabled={!$session.isAdmin}
- class:hover:text-red-500={$session.isAdmin}
+ disabled={!$appSession.isAdmin}
+ class:hover:text-red-500={$appSession.isAdmin}
class="icons bg-transparent tooltip-bottom text-sm"
- data-tooltip={$session.isAdmin
+ data-tooltip={$appSession.isAdmin
? $t('service.delete_service')
: $t('service.permission_denied_delete_service')}><DeleteIcon /></button
>
diff --git a/src/routes/services/[id]/configuration/destination.svelte b/apps/ui/src/routes/services/[id]/configuration/destination.svelte
similarity index 72%
rename from src/routes/services/[id]/configuration/destination.svelte
rename to apps/ui/src/routes/services/[id]/configuration/destination.svelte
index 6dee1df953..cd0d916d75 100644
--- a/src/routes/services/[id]/configuration/destination.svelte
+++ b/apps/ui/src/routes/services/[id]/configuration/destination.svelte
@@ -1,50 +1,46 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- const { service } = stuff;
- if (service?.destinationDockerId && !url.searchParams.get('from')) {
- return {
- status: 302,
- redirect: `/service/${params.id}`
- };
- }
-
- const endpoint = `/destinations.json`;
- const res = await fetch(endpoint);
-
- if (res.ok) {
+ try {
+ const { service } = stuff;
+ if (service?.destinationDockerId && !url.searchParams.get('from')) {
+ return {
+ status: 302,
+ redirect: `/services/${params.id}`
+ };
+ }
+ const response = await get(`/destinations`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
- import type Prisma from '@prisma/client';
+ export let destinations: any;
import { page } from '$app/stores';
- import { enhance, errorNotification } from '$lib/form';
import { goto } from '$app/navigation';
- import { post } from '$lib/api';
+ import { get, post } from '$lib/api';
import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
const { id } = $page.params;
const from = $page.url.searchParams.get('from');
- export let destinations: Prisma.DestinationDocker[];
- async function handleSubmit(destinationId) {
+ async function handleSubmit(destinationId: any) {
try {
- await post(`/services/${id}/configuration/destination.json`, { destinationId });
+ await post(`/services/${id}/configuration/destination`, { destinationId });
return await goto(from || `/services/${id}`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
diff --git a/src/routes/services/[id]/configuration/type.svelte b/apps/ui/src/routes/services/[id]/configuration/type.svelte
similarity index 83%
rename from src/routes/services/[id]/configuration/type.svelte
rename to apps/ui/src/routes/services/[id]/configuration/type.svelte
index a736c7f150..4eb35d28af 100644
--- a/src/routes/services/[id]/configuration/type.svelte
+++ b/apps/ui/src/routes/services/[id]/configuration/type.svelte
@@ -1,47 +1,48 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- const { service } = stuff;
- if (service?.type && !url.searchParams.get('from')) {
- return {
- status: 302,
- redirect: `/services/${params.id}`
- };
- }
- const endpoint = `/services/${params.id}/configuration/type.json`;
- const res = await fetch(endpoint);
-
- if (res.ok) {
+ try {
+ const { service } = stuff;
+ if (service?.type && !url.searchParams.get('from')) {
+ return {
+ status: 302,
+ redirect: `/services/${params.id}`
+ };
+ }
+ const response = await get(`/services/${params.id}/configuration/type`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
+ export let types: any;
+
import { page } from '$app/stores';
- import { errorNotification } from '$lib/form';
+ import { goto } from '$app/navigation';
+ import { get, post } from '$lib/api';
+ import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
+
import PlausibleAnalytics from '$lib/components/svg/services/PlausibleAnalytics.svelte';
import NocoDb from '$lib/components/svg/services/NocoDB.svelte';
import MinIo from '$lib/components/svg/services/MinIO.svelte';
import VsCodeServer from '$lib/components/svg/services/VSCodeServer.svelte';
import Wordpress from '$lib/components/svg/services/Wordpress.svelte';
- import { goto } from '$app/navigation';
- import { post } from '$lib/api';
import VaultWarden from '$lib/components/svg/services/VaultWarden.svelte';
import LanguageTool from '$lib/components/svg/services/LanguageTool.svelte';
import N8n from '$lib/components/svg/services/N8n.svelte';
import UptimeKuma from '$lib/components/svg/services/UptimeKuma.svelte';
import Ghost from '$lib/components/svg/services/Ghost.svelte';
- import { t } from '$lib/translations';
import MeiliSearch from '$lib/components/svg/services/MeiliSearch.svelte';
import Umami from '$lib/components/svg/services/Umami.svelte';
import Hasura from '$lib/components/svg/services/Hasura.svelte';
@@ -50,13 +51,11 @@
const { id } = $page.params;
const from = $page.url.searchParams.get('from');
- export let types;
-
- async function handleSubmit(type) {
+ async function handleSubmit(type: any) {
try {
- await post(`/services/${id}/configuration/type.json`, { type });
+ await post(`/services/${id}/configuration/type`, { type });
return await goto(from || `/services/${id}`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
diff --git a/src/routes/services/[id]/configuration/version.svelte b/apps/ui/src/routes/services/[id]/configuration/version.svelte
similarity index 69%
rename from src/routes/services/[id]/configuration/version.svelte
rename to apps/ui/src/routes/services/[id]/configuration/version.svelte
index fd5ddbc0bd..1bbaad1acc 100644
--- a/src/routes/services/[id]/configuration/version.svelte
+++ b/apps/ui/src/routes/services/[id]/configuration/version.svelte
@@ -1,52 +1,49 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- const { service } = stuff;
- if (service?.version && !url.searchParams.get('from')) {
- return {
- status: 302,
- redirect: `/services/${params.id}`
- };
- }
- const endpoint = `/services/${params.id}/configuration/version.json`;
- const res = await fetch(endpoint);
-
- if (res.ok) {
+ try {
+ const { service } = stuff;
+ if (service?.version && !url.searchParams.get('from')) {
+ return {
+ status: 302,
+ redirect: `/services/${params.id}`
+ };
+ }
+ const response = await get(`/services/${params.id}/configuration/version`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
+ export let versions: any;
+ export let type: any;
import { page } from '$app/stores';
- import { errorNotification } from '$lib/form';
import { goto } from '$app/navigation';
- import { post } from '$lib/api';
- import { supportedServiceTypesAndVersions } from '$lib/components/common';
+ import { get, post } from '$lib/api';
import { t } from '$lib/translations';
+ import { errorNotification, supportedServiceTypesAndVersions } from '$lib/common';
const { id } = $page.params;
const from = $page.url.searchParams.get('from');
- export let versions;
- export let type;
let recommendedVersion = supportedServiceTypesAndVersions.find(
({ name }) => name === type
)?.recommendedVersion;
- async function handleSubmit(version) {
+ async function handleSubmit(version: any) {
try {
- await post(`/services/${id}/configuration/version.json`, { version });
+ await post(`/services/${id}/configuration/version`, { version });
return await goto(from || `/services/${id}`);
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
}
}
diff --git a/src/routes/services/[id]/index.svelte b/apps/ui/src/routes/services/[id]/index.svelte
similarity index 73%
rename from src/routes/services/[id]/index.svelte
rename to apps/ui/src/routes/services/[id]/index.svelte
index 4d231a8fb5..bc6edd71f6 100644
--- a/src/routes/services/[id]/index.svelte
+++ b/apps/ui/src/routes/services/[id]/index.svelte
@@ -1,61 +1,42 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params, stuff }) => {
- if (stuff?.service?.id) {
- return {
- props: {
- service: stuff.service,
- isRunning: stuff.isRunning,
- readOnly: stuff.readOnly,
- settings: stuff.settings
- }
- };
- }
- const endpoint = `/services/${params.id}.json`;
- const res = await fetch(endpoint);
-
- if (res.ok) {
- return {
- props: {
- ...(await res.json())
- }
- };
- }
-
+ export const load: Load = async ({ stuff }) => {
return {
- status: res.status,
- error: new Error(`Could not load ${endpoint}`)
+ props: { ...stuff }
};
};
</script>
<script lang="ts">
- import ServiceLinks from '$lib/components/ServiceLinks.svelte';
import Services from './_Services/_Services.svelte';
import { get } from '$lib/api';
import { page } from '$app/stores';
+ import { status } from '$lib/store';
import { onDestroy, onMount } from 'svelte';
+ import ServiceLinks from './_ServiceLinks.svelte';
- export let service;
- export let isRunning;
- export let readOnly;
- export let settings;
+ export let service: any;
+ export let readOnly: any;
+ export let settings: any;
const { id } = $page.params;
- let usageLoading = false;
+ let loading = {
+ usage: false
+ };
let usage = {
MemUsage: 0,
CPUPerc: 0,
NetIO: 0
};
- let usageInterval;
+ let usageInterval: any;
async function getUsage() {
- if (usageLoading) return;
- usageLoading = true;
- const data = await get(`/services/${id}/usage.json`);
+ if (loading.usage) return;
+ if (!$status.service.isRunning) return;
+ loading.usage = true;
+ const data = await get(`/services/${id}/usage`);
usage = data.usage;
- usageLoading = false;
+ loading.usage = false;
}
onDestroy(() => {
@@ -129,4 +110,4 @@
</dl>
</div>
</div>
-<Services bind:service {isRunning} {readOnly} {settings} />
+<Services bind:service bind:readOnly bind:settings />
diff --git a/src/routes/services/[id]/logs/_Loading.svelte b/apps/ui/src/routes/services/[id]/logs/_Loading.svelte
similarity index 100%
rename from src/routes/services/[id]/logs/_Loading.svelte
rename to apps/ui/src/routes/services/[id]/logs/_Loading.svelte
diff --git a/src/routes/services/[id]/logs/index.svelte b/apps/ui/src/routes/services/[id]/logs/index.svelte
similarity index 88%
rename from src/routes/services/[id]/logs/index.svelte
rename to apps/ui/src/routes/services/[id]/logs/index.svelte
index ffbd109de4..1e3ed84438 100644
--- a/src/routes/services/[id]/logs/index.svelte
+++ b/apps/ui/src/routes/services/[id]/logs/index.svelte
@@ -2,38 +2,37 @@
import type { Load } from '@sveltejs/kit';
import { onDestroy, onMount } from 'svelte';
export const load: Load = async ({ fetch, params, url, stuff }) => {
- let endpoint = `/services/${params.id}/logs.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
+ try {
+ const response = await get(`/services/${params.id}/logs`);
return {
props: {
service: stuff.service,
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
- export let service;
+ export let service: any;
import { page } from '$app/stores';
import LoadingLogs from './_Loading.svelte';
import { get } from '$lib/api';
- import { errorNotification } from '$lib/form';
import { t } from '$lib/translations';
+import { errorNotification } from '$lib/common';
- let loadLogsInterval = null;
- let logs = [];
- let lastLog = null;
- let followingInterval;
- let followingLogs;
- let logsEl;
+ let loadLogsInterval: any = null;
+ let logs: any = [];
+ let lastLog: any = null;
+ let followingInterval: any;
+ let followingLogs: any;
+ let logsEl: any;
let position = 0;
const { id } = $page.params;
@@ -49,7 +48,7 @@
});
async function loadAllLogs() {
try {
- const data: any = await get(`/services/${id}/logs.json`);
+ const data: any = await get(`/services/${id}/logs`);
if (data?.logs) {
lastLog = data.logs[data.logs.length - 1];
logs = data.logs;
@@ -62,7 +61,7 @@
async function loadLogs() {
try {
const newLogs: any = await get(
- `/services/${id}/logs.json?since=${lastLog?.split(' ')[0] || 0}`
+ `/services/${id}/logs?since=${lastLog?.split(' ')[0] || 0}`
);
if (newLogs?.logs && newLogs.logs[newLogs.logs.length - 1] !== logs[logs.length - 1]) {
diff --git a/src/routes/services/[id]/secrets/index.svelte b/apps/ui/src/routes/services/[id]/secrets.svelte
similarity index 79%
rename from src/routes/services/[id]/secrets/index.svelte
rename to apps/ui/src/routes/services/[id]/secrets.svelte
index 8bad53bbb6..78271ca7d3 100644
--- a/src/routes/services/[id]/secrets/index.svelte
+++ b/apps/ui/src/routes/services/[id]/secrets.svelte
@@ -1,38 +1,36 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params, stuff }) => {
- let endpoint = `/services/${params.id}/secrets.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
+ export const load: Load = async ({ fetch, params, stuff, url }) => {
+ try {
+ const response = await get(`/services/${params.id}/secrets`);
return {
props: {
service: stuff.service,
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${endpoint}`)
- };
};
</script>
<script lang="ts">
- export let secrets;
- export let service;
+ export let secrets: any;
+ export let service: any;
import Secret from './_Secret.svelte';
- import { getDomain } from '$lib/components/common';
import { page } from '$app/stores';
import { get } from '$lib/api';
import { t } from '$lib/translations';
- import ServiceLinks from '$lib/components/ServiceLinks.svelte';
+ import ServiceLinks from './_ServiceLinks.svelte';
const { id } = $page.params;
async function refreshSecrets() {
- const data = await get(`/services/${id}/secrets.json`);
+ const data = await get(`/services/${id}/secrets`);
secrets = [...data.secrets];
}
</script>
diff --git a/src/routes/services/[id]/storage/index.svelte b/apps/ui/src/routes/services/[id]/storages.svelte
similarity index 82%
rename from src/routes/services/[id]/storage/index.svelte
rename to apps/ui/src/routes/services/[id]/storages.svelte
index 3d5c43c1bd..1965878e06 100644
--- a/src/routes/services/[id]/storage/index.svelte
+++ b/apps/ui/src/routes/services/[id]/storages.svelte
@@ -1,37 +1,36 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params, stuff }) => {
- let endpoint = `/services/${params.id}/storage.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
+ export const load: Load = async ({ params, stuff, url }) => {
+ try {
+ const response = await get(`/services/${params.id}/storages`);
return {
props: {
service: stuff.service,
- ...(await res.json())
+ ...response
}
};
+ } catch (error) {
+ return {
+ status: 500,
+ error: new Error(`Could not load ${url}`)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${endpoint}`)
- };
};
</script>
<script lang="ts">
- export let service;
-
- export let persistentStorages;
+ export let service: any;
+ export let persistentStorages: any;
+
import { page } from '$app/stores';
import Storage from './_Storage.svelte';
import { get } from '$lib/api';
import Explainer from '$lib/components/Explainer.svelte';
- import ServiceLinks from '$lib/components/ServiceLinks.svelte';
+ import ServiceLinks from './_ServiceLinks.svelte';
const { id } = $page.params;
async function refreshStorage() {
- const data = await get(`/services/${id}/storage.json`);
+ const data = await get(`/services/${id}/storages`);
persistentStorages = [...data.persistentStorages];
}
</script>
diff --git a/src/routes/services/index.svelte b/apps/ui/src/routes/services/index.svelte
similarity index 87%
rename from src/routes/services/index.svelte
rename to apps/ui/src/routes/services/index.svelte
index 32c7e14ea9..dff2751422 100644
--- a/src/routes/services/index.svelte
+++ b/apps/ui/src/routes/services/index.svelte
@@ -1,4 +1,29 @@
+<script context="module" lang="ts">
+ import type { Load } from '@sveltejs/kit';
+ export const load: Load = async () => {
+ try {
+ const response = await get(`/services`);
+ return {
+ props: {
+ ...response
+ }
+ };
+ } catch (error: any) {
+ return {
+ status: 500,
+ error: new Error(error)
+ };
+ }
+ };
+</script>
+
<script lang="ts">
+ export let services: any = [];
+ import { post, get } from '$lib/api';
+ import { goto } from '$app/navigation';
+ import { t } from '$lib/translations';
+ import { appSession } from '$lib/store';
+
import PlausibleAnalytics from '$lib/components/svg/services/PlausibleAnalytics.svelte';
import NocoDb from '$lib/components/svg/services/NocoDB.svelte';
import MinIo from '$lib/components/svg/services/MinIO.svelte';
@@ -6,31 +31,27 @@
import Wordpress from '$lib/components/svg/services/Wordpress.svelte';
import VaultWarden from '$lib/components/svg/services/VaultWarden.svelte';
import LanguageTool from '$lib/components/svg/services/LanguageTool.svelte';
- import { post } from '$lib/api';
- import { goto } from '$app/navigation';
+
import N8n from '$lib/components/svg/services/N8n.svelte';
import UptimeKuma from '$lib/components/svg/services/UptimeKuma.svelte';
import Ghost from '$lib/components/svg/services/Ghost.svelte';
- import { t } from '$lib/translations';
import MeiliSearch from '$lib/components/svg/services/MeiliSearch.svelte';
- import { session } from '$app/stores';
- import { getDomain } from '$lib/components/common';
import Umami from '$lib/components/svg/services/Umami.svelte';
import Hasura from '$lib/components/svg/services/Hasura.svelte';
import Fider from '$lib/components/svg/services/Fider.svelte';
+ import { getDomain } from '$lib/common';
- export let services;
async function newService() {
const { id } = await post('/services/new', {});
return await goto(`/services/${id}`, { replaceState: true });
}
- const ownServices = services.filter((service) => {
- if (service.teams[0].id === $session.teamId) {
+ const ownServices = services.filter((service: any) => {
+ if (service.teams[0].id === $appSession.teamId) {
return service;
}
});
- const otherServices = services.filter((service) => {
- if (service.teams[0].id !== $session.teamId) {
+ const otherServices = services.filter((service: any) => {
+ if (service.teams[0].id !== $appSession.teamId) {
return service;
}
});
@@ -99,7 +120,7 @@
<div class="truncate text-center text-xl font-bold">
{service.name}
</div>
- {#if $session.teamId === '0' && otherServices.length > 0}
+ {#if $appSession.teamId === '0' && otherServices.length > 0}
<div class="truncate text-center">{service.teams[0].name}</div>
{/if}
{#if service.fqdn}
@@ -114,7 +135,7 @@
</a>
{/each}
</div>
- {#if otherServices.length > 0 && $session.teamId === '0'}
+ {#if otherServices.length > 0 && $appSession.teamId === '0'}
<div class="px-6 pb-5 pt-10 text-xl font-bold">Other Services</div>
<div class="flex flex-col flex-wrap justify-center px-2 md:flex-row">
{#each otherServices as service}
@@ -152,7 +173,7 @@
<div class="truncate text-center text-xl font-bold">
{service.name}
</div>
- {#if $session.teamId === '0'}
+ {#if $appSession.teamId === '0'}
<div class="truncate text-center">{service.teams[0].name}</div>
{/if}
{#if service.fqdn}
diff --git a/src/routes/settings/index.svelte b/apps/ui/src/routes/settings/index.svelte
similarity index 75%
rename from src/routes/settings/index.svelte
rename to apps/ui/src/routes/settings/index.svelte
index 6eeeb2bdf0..b07085eaf7 100644
--- a/src/routes/settings/index.svelte
+++ b/apps/ui/src/routes/settings/index.svelte
@@ -1,43 +1,34 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch }) => {
- const url = `/settings.json`;
- const res = await fetch(url);
-
- if (res.ok) {
+ export const load: Load = async () => {
+ try {
+ const response = await get(`/settings`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
- }
- if (res.status === 401) {
+ } catch (error: any) {
return {
- status: 302,
- redirect: '/databases'
+ status: 500,
+ error: new Error(error)
};
}
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
- import { session } from '$app/stores';
+ export let settings: any;
- export let settings;
import Setting from '$lib/components/Setting.svelte';
import Explainer from '$lib/components/Explainer.svelte';
- import { errorNotification } from '$lib/form';
import { del, get, post } from '$lib/api';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import { browser } from '$app/env';
- import { getDomain } from '$lib/components/common';
import { toast } from '@zerodevx/svelte-toast';
import { t } from '$lib/translations';
- import { features, isTraefikUsed } from '$lib/store';
+ import { appSession, features, isTraefikUsed } from '$lib/store';
+ import { errorNotification, getDomain } from '$lib/common';
let isRegistrationEnabled = settings.isRegistrationEnabled;
let dualCerts = settings.dualCerts;
@@ -64,16 +55,16 @@
if (fqdn) {
loading.remove = true;
try {
- const { redirect } = await del(`/settings.json`, { fqdn });
+ const { redirect } = await del(`/settings`, { fqdn });
return redirect ? window.location.replace(redirect) : window.location.reload();
- } catch ({ error }) {
+ } catch (error ) {
return errorNotification(error);
} finally {
loading.remove = false;
}
}
}
- async function changeSettings(name) {
+ async function changeSettings(name: any) {
try {
resetView();
if (name === 'isRegistrationEnabled') {
@@ -89,7 +80,7 @@
isDNSCheckEnabled = !isDNSCheckEnabled;
}
- await post(`/settings.json`, {
+ await post(`/settings`, {
isRegistrationEnabled,
dualCerts,
isAutoUpdateEnabled,
@@ -106,18 +97,18 @@
nonWWWDomain = fqdn && getDomain(fqdn).replace(/^www\./, '');
if (fqdn !== settings.fqdn) {
- await post(`/settings/check.json`, { fqdn, forceSave, dualCerts, isDNSCheckEnabled });
- await post(`/settings.json`, { fqdn });
+ await post(`/settings/check`, { fqdn, forceSave, dualCerts, isDNSCheckEnabled });
+ await post(`/settings`, { fqdn });
return window.location.reload();
}
if (minPort !== settings.minPort || maxPort !== settings.maxPort) {
- await post(`/settings.json`, { minPort, maxPort });
+ await post(`/settings`, { minPort, maxPort });
settings.minPort = minPort;
settings.maxPort = maxPort;
}
forceSave = false;
- } catch ({ error }) {
- if (error?.startsWith($t('application.dns_not_set_partial_error'))) {
+ } catch (error ) {
+ if (error.message?.startsWith($t('application.dns_not_set_partial_error'))) {
forceSave = true;
if (dualCerts) {
isNonWWWDomainOK = await isDNSValid(getDomain(nonWWWDomain), false);
@@ -131,22 +122,15 @@
}
}
}
+ console.log(error)
return errorNotification(error);
} finally {
loading.save = false;
}
}
- async function renewCerts() {
- try {
- toast.push('Renewing certificates...');
- return await post(`/settings/renew.json`, {});
- } catch ({ error }) {
- return errorNotification(error);
- }
- }
- async function isDNSValid(domain, isWWW) {
+ async function isDNSValid(domain: any, isWWW: any) {
try {
- await get(`/settings/check.json?domain=${domain}`);
+ await get(`/settings/check?domain=${domain}`);
toast.push('DNS configuration is valid.');
isWWW ? (isWWWDomainOK = true) : (isNonWWWDomainOK = true);
return true;
@@ -159,12 +143,12 @@
function resetView() {
forceSave = false;
}
- async function migrateProxy(to) {
+ async function migrateProxy(to: any) {
if (loading.proxyMigration) return;
try {
loading.proxyMigration = true;
- await post(`/update.json`, { type: to });
- const data = await get(`/settings.json`);
+ await post(`/update`, { type: to });
+ const data = await get(`/settings`);
$isTraefikUsed = data.settings.isTraefikUsed;
return toast.push('Proxy migration started, it takes a few seconds.');
} catch ({ error }) {
@@ -178,7 +162,7 @@
<div class="flex space-x-1 p-6 font-bold">
<div class="mr-4 text-2xl tracking-tight">{$t('index.settings')}</div>
</div>
-{#if $session.teamId === '0'}
+{#if $appSession.teamId === '0'}
<div class="mx-auto max-w-4xl px-6">
<form on:submit|preventDefault={handleSubmit} class="grid grid-flow-row gap-2 py-4">
<div class="flex space-x-1 pb-6">
@@ -209,26 +193,6 @@
</div>
<div class="grid grid-flow-row gap-2 px-10">
<!-- <Language /> -->
- <div class="grid grid-cols-2 items-center">
- <div class="flex items-center py-2 pr-8">
- <div class="flex w-96 flex-col">
- <div class="text-xs font-bold text-stone-100 md:text-base">New Proxy Available!</div>
- <Explainer
- text="We are changing to <span class='text-sky-500 font-bold'>Traefik</span> as <span class='text-red-500 font-bold'>HAProxy</span> had several problems and uses a LOT of unnecessary memory (<span class='text-sky-500 font-bold'>~20MB</span> vs <span class='text-red-500 font-bold'>~200MB</span>).<br><br>You can switch back to HAProxy if something is not working and <span class='text-yellow-500 font-bold'>please let us know</span>!"
- />
- </div>
- </div>
- <button
- disabled={loading.proxyMigration}
- class="bg-green-600 text-white hover:bg-green-500"
- on:click={() => migrateProxy($isTraefikUsed ? 'haproxy' : 'traefik')}
- >{loading.proxyMigration
- ? 'Migrating...'
- : $isTraefikUsed
- ? 'Switch back to HAProxy'
- : 'Migrate to Traefik'}</button
- >
- </div>
<div class="grid grid-cols-2 items-start">
<div class="flex-col">
<div class="pt-2 text-base font-bold text-stone-100">
@@ -239,8 +203,8 @@
<div class="justify-start text-left">
<input
bind:value={fqdn}
- readonly={!$session.isAdmin || isFqdnSet}
- disabled={!$session.isAdmin || isFqdnSet}
+ readonly={!$appSession.isAdmin || isFqdnSet}
+ disabled={!$appSession.isAdmin || isFqdnSet}
on:input={resetView}
name="fqdn"
id="fqdn"
@@ -344,22 +308,10 @@
on:click={() => changeSettings('isAutoUpdateEnabled')}
/>
</div>
- <div class="grid grid-cols-2 items-center">
- <div class="flex flex-col">
- <div class="pt-2 text-base font-bold text-stone-100">
- Renew SSL Certificates manually
- </div>
- <Explainer text="It will check and renew certificates manually" />
- </div>
- <div class="mx-auto ">
- <button class="w-32 bg-coollabs hover:bg-coollabs-100" on:click={renewCerts}
- >SSL renew manually</button
- >
- </div>
- </div>
{/if}
</div>
</form>
+ {#if !settings.isTraefikUsed}
<div class="flex space-x-1 pt-6 font-bold">
<div class="title">{$t('setting.coolify_proxy_settings')}</div>
</div>
@@ -396,6 +348,7 @@
/>
</div>
</div>
+ {/if}
</div>
{:else}
<div class="mx-auto max-w-4xl px-6">
diff --git a/src/routes/sources/[id]/_Github.svelte b/apps/ui/src/routes/sources/[id]/_Github.svelte
similarity index 63%
rename from src/routes/sources/[id]/_Github.svelte
rename to apps/ui/src/routes/sources/[id]/_Github.svelte
index b21640df1d..0a33c14026 100644
--- a/src/routes/sources/[id]/_Github.svelte
+++ b/apps/ui/src/routes/sources/[id]/_Github.svelte
@@ -1,31 +1,34 @@
<script lang="ts">
- export let source;
- import { page, session } from '$app/stores';
+ export let source: any;
+ export let settings: any;
+ import { page } from '$app/stores';
import { post } from '$lib/api';
import Explainer from '$lib/components/Explainer.svelte';
- import { errorNotification } from '$lib/form';
import { toast } from '@zerodevx/svelte-toast';
import { t } from '$lib/translations';
- const { id } = $page.params;
+ import { dashify, errorNotification, getDomain } from '$lib/common';
+ import { appSession } from '$lib/store';
+ import { dev } from '$app/env';
+ const { id } = $page.params;
let loading = false;
async function handleSubmit() {
loading = true;
try {
- await post(`/sources/${id}.json`, {
+ await post(`/sources/${id}`, {
name: source.name,
htmlUrl: source.htmlUrl.replace(/\/$/, ''),
apiUrl: source.apiUrl.replace(/\/$/, '')
});
toast.push('Settings saved.');
- } catch ({ error }) {
+ } catch (error) {
return errorNotification(error);
} finally {
loading = false;
}
}
- async function installRepositories(source) {
+ async function installRepositories(source: any) {
const { htmlUrl } = source;
const left = screen.width / 2 - 1020 / 2;
const top = screen.height / 2 - 1000 / 2;
@@ -49,33 +52,61 @@
async function newGithubApp() {
loading = true;
try {
- await post(`/sources/${id}/github.json`, {
+ const { id } = await post(`/sources/new/github`, {
type: 'github',
name: source.name,
htmlUrl: source.htmlUrl.replace(/\/$/, ''),
apiUrl: source.apiUrl.replace(/\/$/, ''),
organization: source.organization
});
- } catch ({ error }) {
+ const { organization, htmlUrl } = source;
+ const { fqdn } = settings;
+ const host = dev
+ ? 'http://localhost:3001'
+ : fqdn
+ ? fqdn
+ : `http://${window.location.host}` || '';
+ const domain = getDomain(fqdn);
+
+ let url = 'settings/apps/new';
+ if (organization) url = `organizations/${organization}/settings/apps/new`;
+ const name = dashify(domain) || 'app';
+ const data = JSON.stringify({
+ name: `coolify-${name}`,
+ url: host,
+ hook_attributes: {
+ url: dev
+ ? 'https://webhook.site/0e5beb2c-4e9b-40e2-a89e-32295e570c21/events'
+ : `${host}/webhooks/github/events`
+ },
+ redirect_url: `${host}/webhooks/github`,
+ callback_urls: [`${host}/login/github/app`],
+ public: false,
+ request_oauth_on_install: false,
+ setup_url: `${host}/webhooks/github/install?gitSourceId=${id}`,
+ setup_on_update: true,
+ default_permissions: {
+ contents: 'read',
+ metadata: 'read',
+ pull_requests: 'read',
+ emails: 'read'
+ },
+ default_events: ['pull_request', 'push']
+ });
+ const form = document.createElement('form');
+ form.setAttribute('method', 'post');
+ form.setAttribute('action', `${htmlUrl}/${url}?state=${id}`);
+ const input = document.createElement('input');
+ input.setAttribute('id', 'manifest');
+ input.setAttribute('name', 'manifest');
+ input.setAttribute('type', 'hidden');
+ input.setAttribute('value', data);
+ form.appendChild(input);
+ document.getElementsByTagName('body')[0].appendChild(form);
+ form.submit();
+ } catch (error) {
return errorNotification(error);
}
- const left = screen.width / 2 - 1020 / 2;
- const top = screen.height / 2 - 618 / 2;
- const newWindow = open(
- `/sources/${id}/newGithubApp`,
- 'New Github App',
- 'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' +
- top +
- ', left=' +
- left +
- ', toolbar=0, menubar=0, status=0'
- );
- const timer = setInterval(() => {
- if (newWindow?.closed) {
- clearInterval(timer);
- window.location.reload();
- }
- }, 100);
}
</script>
@@ -84,9 +115,6 @@
<form on:submit|preventDefault={newGithubApp} class="py-4">
<div class="flex space-x-1 pb-5 font-bold">
<div class="title">General</div>
- {#if source.apiUrl && source.htmlUrl && source.name}
- <button class=" bg-orange-600" type="submit">Create new GitHub App</button>
- {/if}
</div>
<div class="grid grid-flow-row gap-2 px-10">
<div class="grid grid-flow-row gap-2">
@@ -120,20 +148,30 @@
/>
</div>
</div>
+ {#if source.apiUrl && source.htmlUrl && source.name}
+ <div class="text-center">
+ <button class=" mt-8 bg-orange-600" type="submit">Create new GitHub App</button>
+ </div>
+ {/if}
</form>
{:else if source.githubApp?.installationId}
<form on:submit|preventDefault={handleSubmit} class="py-4">
<div class="flex space-x-1 pb-5 font-bold">
<div class="title">{$t('general')}</div>
- {#if $session.isAdmin}
+ {#if $appSession.isAdmin}
<button
type="submit"
class:bg-orange-600={!loading}
class:hover:bg-orange-500={!loading}
disabled={loading}>{loading ? 'Saving...' : 'Save'}</button
>
- <button on:click|preventDefault={() => installRepositories(source)}
- >{$t('source.change_app_settings', { name: 'GitHub' })}</button
+
+ <button
+ ><a
+ class="no-underline"
+ href={`${source.htmlUrl}/apps/${source.githubApp.name}/installations/new`}
+ >{$t('source.change_app_settings', { name: 'GitHub' })}</a
+ ></button
>
{/if}
</div>
@@ -171,8 +209,8 @@
</form>
{:else}
<div class="text-center">
- <button class=" mt-8 bg-orange-600" on:click={() => installRepositories(source)}
- >Install Repositories</button
+ <a href={`${source.htmlUrl}/apps/${source.githubApp.name}/installations/new`}>
+ <button class=" bg-orange-600 hover:bg-orange-500 mt-8">Install Repositories</button></a
>
</div>
{/if}
diff --git a/src/routes/sources/[id]/_Gitlab.svelte b/apps/ui/src/routes/sources/[id]/_Gitlab.svelte
similarity index 85%
rename from src/routes/sources/[id]/_Gitlab.svelte
rename to apps/ui/src/routes/sources/[id]/_Gitlab.svelte
index be1df4909b..94c5a2f524 100644
--- a/src/routes/sources/[id]/_Gitlab.svelte
+++ b/apps/ui/src/routes/sources/[id]/_Gitlab.svelte
@@ -1,23 +1,28 @@
<script lang="ts">
- export let source;
- export let settings;
+ export let source: any;
+ export let settings: any;
import Explainer from '$lib/components/Explainer.svelte';
- import { errorNotification } from '$lib/form';
- import { page, session } from '$app/stores';
+ import { page } from '$app/stores';
import { onMount } from 'svelte';
import { post } from '$lib/api';
- import { browser } from '$app/env';
+ import { dev } from '$app/env';
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import { toast } from '@zerodevx/svelte-toast';
import { t } from '$lib/translations';
+ import { errorNotification } from '$lib/common';
+ import { appSession } from '$lib/store';
+ import { goto } from '$app/navigation';
const { id } = $page.params;
- let url = browser ? (settings.fqdn ? settings.fqdn : window.location.origin) : '';
+ let url = settings.fqdn ? settings.fqdn : window.location.origin;
+ if (dev) {
+ url = `http://localhost:3001`;
+ }
let loading = false;
- let oauthIdEl;
- let applicationType;
+ let oauthIdEl: HTMLInputElement;
+ let applicationType: string;
if (!source.gitlabAppId) {
source.gitlabApp = {
oauthId: null,
@@ -36,7 +41,7 @@
if (!source.gitlabAppId) {
// New GitLab App
try {
- await post(`/sources/${id}/gitlab.json`, {
+ const { id } = await post(`/sources/new/gitlab`, {
type: 'gitlab',
name: source.name,
htmlUrl: source.htmlUrl.replace(/\/$/, ''),
@@ -46,8 +51,12 @@
appSecret: source.gitlabApp.appSecret,
groupName: source.gitlabApp.groupName
});
- return window.location.reload();
- } catch ({ error }) {
+ const from = $page.url.searchParams.get('from');
+ if (from) {
+ return window.location.assign(from);
+ }
+ return window.location.assign(`/sources/${id}`);
+ } catch (error) {
return errorNotification(error);
} finally {
loading = false;
@@ -55,15 +64,15 @@
} else {
// Update GitLab App
try {
- await post(`/sources/${id}.json`, {
+ await post(`/sources/${id}`, {
name: source.name,
htmlUrl: source.htmlUrl.replace(/\/$/, ''),
apiUrl: source.apiUrl.replace(/\/$/, '')
});
- } catch ({ error }) {
+ toast.push('Settings saved.');
+ } catch (error) {
return errorNotification(error);
} finally {
- toast.push('Settings saved.');
loading = false;
}
}
@@ -94,7 +103,7 @@
async function checkOauthId() {
if (source.gitlabApp?.oauthId) {
try {
- await post(`/sources/${id}/check.json`, {
+ await post(`/sources/${id}/check`, {
oauthId: source.gitlabApp?.oauthId
});
} catch ({ error }) {
@@ -124,9 +133,9 @@
<div class="mx-auto max-w-4xl px-6">
<form on:submit|preventDefault={handleSubmit} class="py-4">
- <div class="flex space-x-1 pb-5 font-bold">
+ <div class="flex space-x-1 pb-7 font-bold">
<div class="title">General</div>
- {#if $session.isAdmin}
+ {#if $appSession.isAdmin}
<button
type="submit"
class:bg-orange-600={!loading}
@@ -143,9 +152,7 @@
<div class="grid grid-flow-row gap-2 px-10">
{#if !source.gitlabAppId}
<div class="grid grid-cols-2 items-center">
- <label for="type" class="text-base font-bold text-stone-100"
- >GitLab Application Type</label
- >
+ <label for="type" class="text-base font-bold text-stone-100">Application Type</label>
<select name="type" id="type" class="w-96" bind:value={applicationType}>
<option value="user">{$t('source.gitlab.user_owned')}</option>
<option value="group">{$t('source.gitlab.group_owned')}</option>
@@ -191,11 +198,25 @@
{/if}
<div class="grid grid-cols-2 items-center">
<label for="htmlUrl" class="text-base font-bold text-stone-100">HTML URL</label>
- <input name="htmlUrl" id="htmlUrl" required bind:value={source.htmlUrl} />
+ <input
+ name="htmlUrl"
+ id="htmlUrl"
+ required
+ disabled={source.gitlabAppId}
+ readonly={source.gitlabAppId}
+ value={source.htmlUrl}
+ />
</div>
<div class="grid grid-cols-2 items-center">
<label for="apiUrl" class="text-base font-bold text-stone-100">API URL</label>
- <input name="apiUrl" id="apiUrl" required bind:value={source.apiUrl} />
+ <input
+ name="apiUrl"
+ id="apiUrl"
+ disabled={source.gitlabAppId}
+ readonly={source.gitlabAppId}
+ required
+ value={source.apiUrl}
+ />
</div>
<div class="grid grid-cols-2 items-start">
<div class="flex-col">
diff --git a/apps/ui/src/routes/sources/[id]/_New.svelte b/apps/ui/src/routes/sources/[id]/_New.svelte
new file mode 100644
index 0000000000..836a03365a
--- /dev/null
+++ b/apps/ui/src/routes/sources/[id]/_New.svelte
@@ -0,0 +1,62 @@
+<script lang="ts">
+ export let source: any;
+ export let settings: any;
+ import Github from './_Github.svelte';
+ import Gitlab from './_Gitlab.svelte';
+ function setPredefined(type: string) {
+ switch (type) {
+ case 'github':
+ source.name = 'Github.com';
+ source.type = 'github';
+ source.htmlUrl = 'https://github.com';
+ source.apiUrl = 'https://api.github.com';
+ source.organization = undefined;
+
+ break;
+ case 'gitlab':
+ source.name = 'Gitlab.com';
+ source.type = 'gitlab';
+ source.htmlUrl = 'https://gitlab.com';
+ source.apiUrl = 'https://gitlab.com/api';
+ source.organization = undefined;
+
+ break;
+ case 'bitbucket':
+ source.name = 'Bitbucket.com';
+ source.type = 'bitbucket';
+ source.htmlUrl = 'https://bitbucket.com';
+ source.apiUrl = 'https://api.bitbucket.org';
+ source.organization = undefined;
+
+ break;
+ default:
+ break;
+ }
+ }
+</script>
+
+<div class="flex h-20 items-center space-x-2 p-5 px-6 font-bold">
+ <div class="-mb-1 flex-col">
+ <div class="md:max-w-64 truncate text-base tracking-tight md:text-2xl lg:block">
+ New Git Source
+ </div>
+ </div>
+</div>
+<div class="flex flex-col justify-center">
+ <div class="flex-col space-y-2 pb-10 text-center">
+ <div class="text-xl font-bold text-white">Select a provider</div>
+ <div class="flex justify-center space-x-2">
+ <button class="w-32" on:click={() => setPredefined('github')}>GitHub.com</button>
+ <button class="w-32" on:click={() => setPredefined('gitlab')}>GitLab.com</button>
+ </div>
+ </div>
+ {#if source?.type}
+ <div>
+ {#if source.type === 'github'}
+ <Github bind:source {settings} />
+ {:else if source.type === 'gitlab'}
+ <Gitlab bind:source {settings} />
+ {/if}
+ </div>
+ {/if}
+</div>
diff --git a/src/routes/sources/[id]/index.svelte b/apps/ui/src/routes/sources/[id]/_Source.svelte
similarity index 62%
rename from src/routes/sources/[id]/index.svelte
rename to apps/ui/src/routes/sources/[id]/_Source.svelte
index 4b12fe1c6a..e0a0461c21 100644
--- a/src/routes/sources/[id]/index.svelte
+++ b/apps/ui/src/routes/sources/[id]/_Source.svelte
@@ -1,71 +1,9 @@
-<script context="module" lang="ts">
- import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params, stuff }) => {
- if (stuff?.source) {
- return {
- props: {
- source: stuff.source,
- settings: stuff.settings
- }
- };
- }
- const url = `/sources/${params.id}.json`;
- const res = await fetch(url);
-
- if (res.ok) {
- return {
- props: {
- ...(await res.json())
- }
- };
- }
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
- };
-</script>
-
<script lang="ts">
- export let source: Prisma.GitSource;
- export let settings;
- import { t } from '$lib/translations';
-
- import type Prisma from '@prisma/client';
import Github from './_Github.svelte';
import Gitlab from './_Gitlab.svelte';
- function setPredefined(type) {
- switch (type) {
- case 'github':
- source.name = 'Github.com';
- source.type = 'github';
- source.htmlUrl = 'https://github.com';
- source.apiUrl = 'https://api.github.com';
- source.organization = undefined;
-
- break;
- case 'gitlab':
- source.name = 'Gitlab.com';
- source.type = 'gitlab';
- source.htmlUrl = 'https://gitlab.com';
- source.apiUrl = 'https://gitlab.com/api';
- source.organization = undefined;
-
- break;
- case 'bitbucket':
- source.name = 'Bitbucket.com';
- source.type = 'bitbucket';
- source.htmlUrl = 'https://bitbucket.com';
- source.apiUrl = 'https://api.bitbucket.org';
- source.organization = undefined;
-
- break;
- default:
- break;
- }
- }
+ export let source: any;
+ export let settings: any;
</script>
<div class="flex h-20 items-center space-x-2 p-5 px-6 font-bold">
@@ -111,22 +49,10 @@
</svg>
{/if}
</div>
-
-<div class="flex flex-col justify-center">
- {#if !source.gitlabAppId && !source.githubAppId}
- <div class="flex-col space-y-2 pb-10 text-center">
- <div class="text-xl font-bold text-white">Select a provider</div>
- <div class="flex justify-center space-x-2">
- <button class="w-32" on:click={() => setPredefined('github')}>GitHub.com</button>
- <button class="w-32" on:click={() => setPredefined('gitlab')}>GitLab.com</button>
- </div>
- </div>
- {/if}
- <div>
- {#if source.type === 'github'}
- <Github bind:source />
- {:else if source.type === 'gitlab'}
- <Gitlab bind:source {settings} />
- {/if}
- </div>
+<div>
+ {#if source.type === 'github'}
+ <Github bind:source {settings} />
+ {:else if source.type === 'gitlab'}
+ <Gitlab bind:source {settings} />
+ {/if}
</div>
diff --git a/apps/ui/src/routes/sources/[id]/__layout.svelte b/apps/ui/src/routes/sources/[id]/__layout.svelte
new file mode 100644
index 0000000000..46afb5d6f2
--- /dev/null
+++ b/apps/ui/src/routes/sources/[id]/__layout.svelte
@@ -0,0 +1,70 @@
+<script context="module" lang="ts">
+ import type { Load } from '@sveltejs/kit';
+
+ export const load: Load = async ({ fetch, url, params }) => {
+ try {
+ const { id } = params;
+ const response = await get(`/sources/${id}`);
+ const { source, settings } = response;
+ if (id !== 'new' && (!source || Object.entries(source).length === 0)) {
+ return {
+ status: 302,
+ redirect: '/sources'
+ };
+ }
+ return {
+ props: {
+ source
+ },
+ stuff: {
+ source,
+ settings
+ }
+ };
+ } catch (error) {
+ return handlerNotFoundLoad(error, url);
+ }
+ };
+</script>
+
+<script lang="ts">
+ export let source: any;
+ import { del, get } from '$lib/api';
+
+ import { page } from '$app/stores';
+ import { errorNotification, handlerNotFoundLoad } from '$lib/common';
+ import { t } from '$lib/translations';
+ import { appSession } from '$lib/store';
+ import DeleteIcon from '$lib/components/DeleteIcon.svelte';
+ import { goto } from '$app/navigation';
+ const { id } = $page.params;
+
+ async function deleteSource(name: string) {
+ const sure = confirm($t('application.confirm_to_delete', { name }));
+ if (sure) {
+ try {
+ await del(`/sources/${id}`, {});
+ await goto('/sources', { replaceState: true });
+ } catch (error) {
+ errorNotification(error);
+ }
+ }
+ }
+</script>
+
+{#if id !== 'new'}
+ <nav class="nav-side">
+ <button
+ on:click={() => deleteSource(source.name)}
+ title={$t('source.delete_git_source')}
+ type="submit"
+ disabled={!$appSession.isAdmin}
+ class:hover:text-red-500={$appSession.isAdmin}
+ class="icons tooltip-bottom bg-transparent text-sm"
+ data-tooltip={$appSession.isAdmin
+ ? $t('source.delete_git_source')
+ : $t('source.permission_denied')}><DeleteIcon /></button
+ >
+ </nav>
+{/if}
+<slot />
diff --git a/apps/ui/src/routes/sources/[id]/index.svelte b/apps/ui/src/routes/sources/[id]/index.svelte
new file mode 100644
index 0000000000..5838a22ce1
--- /dev/null
+++ b/apps/ui/src/routes/sources/[id]/index.svelte
@@ -0,0 +1,24 @@
+<script context="module" lang="ts">
+ import type { Load } from '@sveltejs/kit';
+ export const load: Load = async ({ fetch, params, stuff }) => {
+ return {
+ props: { ...stuff }
+ };
+ };
+</script>
+
+<script lang="ts">
+ export let source: any;
+ export let settings: any;
+ import { page } from '$app/stores';
+ import Source from './_Source.svelte';
+ import New from './_New.svelte';
+ const { id } = $page.params;
+</script>
+
+
+{#if id === 'new'}
+ <New bind:source bind:settings />
+{:else}
+ <Source bind:source bind:settings />
+{/if}
diff --git a/src/routes/sources/index.svelte b/apps/ui/src/routes/sources/index.svelte
similarity index 86%
rename from src/routes/sources/index.svelte
rename to apps/ui/src/routes/sources/index.svelte
index 8d85a89db8..23a9a45d60 100644
--- a/src/routes/sources/index.svelte
+++ b/apps/ui/src/routes/sources/index.svelte
@@ -1,51 +1,45 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch }) => {
- const url = `/sources.json`;
- const res = await fetch(url);
-
- if (res.ok) {
+ export const load: Load = async () => {
+ try {
+ const response = await get(`/sources`);
return {
props: {
- ...(await res.json())
+ ...response
}
};
+ } catch (error: any) {
+ return {
+ status: 500,
+ error: new Error(error)
+ };
}
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
};
</script>
<script lang="ts">
- export let sources;
- import { session } from '$app/stores';
- import { post } from '$lib/api';
+ export let sources: any = [];
+ import { get, post } from '$lib/api';
import { goto } from '$app/navigation';
- import { getDomain } from '$lib/components/common';
- const ownSources = sources.filter((source) => {
- if (source.teams[0].id === $session.teamId) {
+ import { getDomain } from '$lib/common';
+ import { t } from '$lib/translations';
+ import { appSession } from '$lib/store';
+ const ownSources = sources.filter((source: { teams: { id: any }[] }) => {
+ if (source.teams[0].id === $appSession.teamId) {
return source;
}
});
- const otherSources = sources.filter((source) => {
- if (source.teams[0].id !== $session.teamId) {
+ const otherSources = sources.filter((source: any) => {
+ if (source.teams[0].id !== $appSession.teamId) {
return source;
}
});
- async function newSource() {
- const { id } = await post('/sources/new', {});
- return await goto(`/sources/${id}`, { replaceState: true });
- }
- import { t } from '$lib/translations';
</script>
<div class="flex space-x-1 p-6 font-bold">
<div class="mr-4 text-2xl tracking-tight">{$t('index.git_sources')}</div>
- {#if $session.isAdmin}
- <button on:click={newSource} class="add-icon bg-orange-600 hover:bg-orange-500">
+ {#if $appSession.isAdmin}
+ <a href="/sources/new" class="add-icon bg-orange-600 hover:bg-orange-500">
<svg
class="w-6"
xmlns="http://www.w3.org/2000/svg"
@@ -59,7 +53,7 @@
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
/></svg
>
- </button>
+ </a>
{/if}
</div>
<div class="flex-col justify-center">
@@ -117,7 +111,7 @@
{/if}
</div>
<div class="truncate text-center text-xl font-bold">{source.name}</div>
- {#if $session.teamId === '0' && otherSources.length > 0}
+ {#if $appSession.teamId === '0' && otherSources.length > 0}
<div class="truncate text-center">{source.teams[0].name}</div>
{/if}
@@ -133,7 +127,7 @@
{/each}
</div>
- {#if otherSources.length > 0 && $session.teamId === '0'}
+ {#if otherSources.length > 0 && $appSession.teamId === '0'}
<div class="px-6 pb-5 pt-10 text-xl font-bold">Other Sources</div>
<div class="flex flex-col flex-wrap justify-center px-2 md:flex-row">
{#each otherSources as source}
@@ -145,7 +139,7 @@
class:border-l-4={source.gitlabApp && !source.gitlabAppId}
>
<div class="truncate text-center text-xl font-bold">{source.name}</div>
- {#if $session.teamId === '0'}
+ {#if $appSession.teamId === '0'}
<div class="truncate text-center">{source.teams[0].name}</div>
{/if}
{#if (source.type === 'gitlab' && !source.gitlabAppId) || (source.type === 'github' && source.githubApp?.installationId === null)}
diff --git a/apps/ui/src/routes/webhooks/success.svelte b/apps/ui/src/routes/webhooks/success.svelte
new file mode 100644
index 0000000000..a216b8276a
--- /dev/null
+++ b/apps/ui/src/routes/webhooks/success.svelte
@@ -0,0 +1,6 @@
+<script lang="ts">
+ import { page } from '$app/stores';
+ const token = $page.url.searchParams.get('token');
+ localStorage.setItem('gitLabToken', token);
+ window.close();
+</script>
diff --git a/src/tailwind.css b/apps/ui/src/tailwind.css
similarity index 93%
rename from src/tailwind.css
rename to apps/ui/src/tailwind.css
index b8f1e647b5..d843f62ea4 100644
--- a/src/tailwind.css
+++ b/apps/ui/src/tailwind.css
@@ -49,9 +49,6 @@ textarea {
@apply h-12 w-96 rounded border-none bg-coolgray-200 p-2 px-0 text-xs tracking-tight outline-none transition duration-150 hover:bg-coolgray-500 focus:bg-coolgray-500 md:text-sm;
}
-#svelte .custom-select-wrapper .spinner {
- @apply text-coollabs-100;
-}
#svelte .listContainer {
@apply bg-coolgray-400 text-white scrollbar-w-2 scrollbar-thumb-green-500 scrollbar-track-coolgray-200;
}
@@ -69,6 +66,26 @@ textarea {
select {
@apply h-12 w-96 rounded bg-coolgray-200 p-2 text-xs font-bold tracking-tight text-white placeholder-stone-600 outline-none transition duration-150 hover:bg-coolgray-500 focus:bg-coolgray-500 disabled:text-stone-600 md:text-sm;
}
+.custom-select-wrapper{
+ --background: rgb(32 32 32);
+ --inputColor: white;
+ --multiItemPadding: 0;
+ --multiSelectPadding: 0 0.5rem 0 0.5rem;
+ --border: none;
+ --placeholderColor: rgb(87 83 78);
+ --listBackground: rgb(32 32 32);
+ --itemColor: white;
+ --itemHoverBG: rgb(107 22 237);
+ --multiItemBG: rgb(32 32 32);
+ --multiClearHoverBG: transparent;
+ --multiClearHoverFill: rgb(239 68 68);
+ --multiItemActiveBG: transparent;
+ --multiClearBG: transparent;
+ --clearSelectFocusColor: white;
+ --clearSelectHoverColor: rgb(239 68 68);
+ --multiItemBorderRadius: 0.25rem;
+ --listShadow: none;
+}
label {
@apply inline-block w-64 text-xs tracking-tight md:text-sm;
diff --git a/static/favicon.png b/apps/ui/static/favicon.png
similarity index 100%
rename from static/favicon.png
rename to apps/ui/static/favicon.png
diff --git a/static/ghost.png b/apps/ui/static/ghost.png
similarity index 100%
rename from static/ghost.png
rename to apps/ui/static/ghost.png
diff --git a/static/minio.png b/apps/ui/static/minio.png
similarity index 100%
rename from static/minio.png
rename to apps/ui/static/minio.png
diff --git a/static/nocodb.png b/apps/ui/static/nocodb.png
similarity index 100%
rename from static/nocodb.png
rename to apps/ui/static/nocodb.png
diff --git a/static/plausible.png b/apps/ui/static/plausible.png
similarity index 100%
rename from static/plausible.png
rename to apps/ui/static/plausible.png
diff --git a/static/poppins-v19-latin-ext_latin_devanagari-500.woff b/apps/ui/static/poppins-v19-latin-ext_latin_devanagari-500.woff
similarity index 100%
rename from static/poppins-v19-latin-ext_latin_devanagari-500.woff
rename to apps/ui/static/poppins-v19-latin-ext_latin_devanagari-500.woff
diff --git a/static/poppins-v19-latin-ext_latin_devanagari-500.woff2 b/apps/ui/static/poppins-v19-latin-ext_latin_devanagari-500.woff2
similarity index 100%
rename from static/poppins-v19-latin-ext_latin_devanagari-500.woff2
rename to apps/ui/static/poppins-v19-latin-ext_latin_devanagari-500.woff2
diff --git a/static/poppins-v19-latin-ext_latin_devanagari-regular.woff b/apps/ui/static/poppins-v19-latin-ext_latin_devanagari-regular.woff
similarity index 100%
rename from static/poppins-v19-latin-ext_latin_devanagari-regular.woff
rename to apps/ui/static/poppins-v19-latin-ext_latin_devanagari-regular.woff
diff --git a/static/poppins-v19-latin-ext_latin_devanagari-regular.woff2 b/apps/ui/static/poppins-v19-latin-ext_latin_devanagari-regular.woff2
similarity index 100%
rename from static/poppins-v19-latin-ext_latin_devanagari-regular.woff2
rename to apps/ui/static/poppins-v19-latin-ext_latin_devanagari-regular.woff2
diff --git a/apps/ui/svelte.config.js b/apps/ui/svelte.config.js
new file mode 100644
index 0000000000..11bd3fb749
--- /dev/null
+++ b/apps/ui/svelte.config.js
@@ -0,0 +1,20 @@
+import adapter from '@sveltejs/adapter-static';
+import preprocess from 'svelte-preprocess';
+
+/** @type {import('@sveltejs/kit').Config} */
+const config = {
+ preprocess: preprocess(),
+ kit: {
+ adapter: adapter({
+ pages: 'build',
+ assets: 'build',
+ fallback: 'index.html',
+ precompress: true
+ }),
+ prerender: {
+ default: false
+ },
+ }
+};
+
+export default config;
diff --git a/tailwind.config.cjs b/apps/ui/tailwind.config.cjs
similarity index 100%
rename from tailwind.config.cjs
rename to apps/ui/tailwind.config.cjs
diff --git a/apps/ui/tests/test.ts b/apps/ui/tests/test.ts
new file mode 100644
index 0000000000..4e579377ee
--- /dev/null
+++ b/apps/ui/tests/test.ts
@@ -0,0 +1,6 @@
+import { expect, test } from '@playwright/test';
+
+test('index page has expected h1', async ({ page }) => {
+ await page.goto('/');
+ expect(await page.textContent('h1')).toBe('Welcome to SvelteKit');
+});
diff --git a/apps/ui/tsconfig.json b/apps/ui/tsconfig.json
new file mode 100644
index 0000000000..5a3094043e
--- /dev/null
+++ b/apps/ui/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "./.svelte-kit/tsconfig.json",
+ "compilerOptions": {
+ "allowJs": true,
+ "checkJs": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "resolveJsonModule": true,
+ "skipLibCheck": true,
+ "sourceMap": true,
+ "strict": true,
+ "paths": {
+ "$lib": ["src/lib"],
+ "$lib/*": ["src/lib/*"],
+ "$commonjson/*": ["common/*"]
+ }
+ }
+}
diff --git a/apps/ui/vite.config.js b/apps/ui/vite.config.js
new file mode 100644
index 0000000000..c4e3951d7a
--- /dev/null
+++ b/apps/ui/vite.config.js
@@ -0,0 +1,11 @@
+import { sveltekit } from '@sveltejs/kit/vite';
+
+/** @type {import('vite').UserConfig} */
+export default {
+ plugins: [sveltekit()],
+ server: {
+ fs: {
+ allow: ['./src/lib/locales/']
+ }
+ },
+}
\ No newline at end of file
diff --git a/data/haproxy-http.Dockerfile b/data/haproxy-http.Dockerfile
deleted file mode 100644
index 089ae0f965..0000000000
--- a/data/haproxy-http.Dockerfile
+++ /dev/null
@@ -1,6 +0,0 @@
-FROM haproxytech/haproxy-alpine:2.5
-RUN mkdir -p /usr/local/etc/haproxy/ssl /usr/local/etc/haproxy/maps /usr/local/etc/haproxy/spoe
-
-COPY data/haproxy/haproxy.cfg-http.template /usr/local/etc/haproxy/haproxy.cfg
-COPY data/haproxy/dataplaneapi.hcl /usr/local/etc/haproxy/dataplaneapi.hcl
-COPY data/haproxy/ssl/default.pem /usr/local/etc/haproxy/ssl/default.pem
\ No newline at end of file
diff --git a/data/haproxy-tcp.Dockerfile b/data/haproxy-tcp.Dockerfile
deleted file mode 100644
index bddcbe5410..0000000000
--- a/data/haproxy-tcp.Dockerfile
+++ /dev/null
@@ -1,6 +0,0 @@
-FROM haproxytech/haproxy-alpine:2.5
-RUN mkdir -p /usr/local/etc/haproxy/ssl /usr/local/etc/haproxy/maps /usr/local/etc/haproxy/spoe
-
-COPY data/haproxy/haproxy.cfg-tcp.template /usr/local/etc/haproxy/haproxy.cfg
-COPY data/haproxy/dataplaneapi.hcl /usr/local/etc/haproxy/dataplaneapi.hcl
-COPY data/haproxy/ssl/default.pem /usr/local/etc/haproxy/ssl/default.pem
\ No newline at end of file
diff --git a/data/haproxy.Dockerfile b/data/haproxy.Dockerfile
deleted file mode 100644
index 45e2d9d717..0000000000
--- a/data/haproxy.Dockerfile
+++ /dev/null
@@ -1,6 +0,0 @@
-FROM haproxytech/haproxy-alpine:2.5
-RUN mkdir -p /usr/local/etc/haproxy/ssl /usr/local/etc/haproxy/maps /usr/local/etc/haproxy/spoe
-
-COPY data/haproxy/haproxy.cfg.template /usr/local/etc/haproxy/haproxy.cfg
-COPY data/haproxy/dataplaneapi.hcl /usr/local/etc/haproxy/dataplaneapi.hcl
-COPY data/haproxy/ssl/default.pem /usr/local/etc/haproxy/ssl/default.pem
\ No newline at end of file
diff --git a/data/haproxy/dataplaneapi.hcl b/data/haproxy/dataplaneapi.hcl
deleted file mode 100644
index e914c13995..0000000000
--- a/data/haproxy/dataplaneapi.hcl
+++ /dev/null
@@ -1,29 +0,0 @@
-config_version = 2
-name = "easy_gar"
-mode = "single"
-status = "null"
-
-dataplaneapi {
- host = "0.0.0.0"
- port = 5555
-
- transaction {
- transaction_dir = "/tmp/haproxy"
- }
-
- advertised {
- api_address = ""
- api_port = 0
- }
-}
-
-haproxy {
- config_file = "/usr/local/etc/haproxy/haproxy.cfg"
- haproxy_bin = "/usr/local/sbin/haproxy"
-
- reload {
- reload_delay = 2
- reload_cmd = "kill -HUP 1"
- restart_cmd = "kill -SIGUSR2 1"
- }
-}
diff --git a/data/haproxy/haproxy.cfg-http.template b/data/haproxy/haproxy.cfg-http.template
deleted file mode 100644
index f819e9be70..0000000000
--- a/data/haproxy/haproxy.cfg-http.template
+++ /dev/null
@@ -1,19 +0,0 @@
-global
- log stdout format raw local0 debug
-
-defaults
- mode http
- log global
- timeout http-request 120s
- timeout connect 20s
- timeout client 120s
- timeout server 120s
-
-frontend "${APP}"
- mode http
- bind *:"${PORT}" name "${APP}"
- default_backend "${APP}"
-
-backend "${APP}"
- mode http
- server "${APP}" "${APP}":"${PRIVATE_PORT}" check
diff --git a/data/haproxy/haproxy.cfg-tcp.template b/data/haproxy/haproxy.cfg-tcp.template
deleted file mode 100644
index b45644d036..0000000000
--- a/data/haproxy/haproxy.cfg-tcp.template
+++ /dev/null
@@ -1,15 +0,0 @@
-global
- log stdout format raw local0 debug
-
-defaults
- mode tcp
- log global
-
-frontend "${APP}"
- mode tcp
- bind *:"${PORT}" name "${APP}"
- default_backend "${APP}"
-
-backend "${APP}"
- mode tcp
- server "${APP}" "${APP}":"${PRIVATE_PORT}" check
diff --git a/data/haproxy/haproxy.cfg.template b/data/haproxy/haproxy.cfg.template
deleted file mode 100644
index 35cb8a74d4..0000000000
--- a/data/haproxy/haproxy.cfg.template
+++ /dev/null
@@ -1,38 +0,0 @@
-global
- stats socket /var/run/api.sock user haproxy group haproxy mode 660 level admin expose-fd listeners
- log stdout format raw local0 debug
-
-defaults
- mode http
- log global
- timeout http-request 120s
- timeout connect 20s
- timeout client 120s
- timeout server 120s
-
-userlist haproxy-dataplaneapi
- user admin insecure-password "${HAPROXY_PASSWORD}"
-
-frontend http
- mode http
- bind :80
- bind :443 ssl crt /usr/local/etc/haproxy/ssl/ alpn h2,http/1.1
- acl is_certbot path_beg /.well-known/acme-challenge/
- use_backend backend-certbot if is_certbot
- use_backend %[req.hdr(host),lower]
-
-frontend stats
- bind *:8404
- stats enable
- stats uri /
- stats refresh 5s
- stats admin if TRUE
- stats auth "${HAPROXY_USERNAME}:${HAPROXY_PASSWORD}"
-
-backend backend-certbot
- mode http
- server certbot host.docker.internal:9080
-
-program api
- command /usr/bin/dataplaneapi -f /usr/local/etc/haproxy/dataplaneapi.hcl --userlist haproxy-dataplaneapi
- no option start-on-reload
diff --git a/data/haproxy/ssl/default.pem b/data/haproxy/ssl/default.pem
deleted file mode 100644
index 77e0746ce1..0000000000
--- a/data/haproxy/ssl/default.pem
+++ /dev/null
@@ -1,81 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIFETCCAvkCFE/5JtU5geT5hOjFuQPiLgCYHwsOMA0GCSqGSIb3DQEBCwUAMEUx
-CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
-cm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMjExMDExMDkwNzQ1WhcNMzExMDA5MDkw
-NzQ1WjBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UE
-CgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIICIjANBgkqhkiG9w0BAQEFAAOC
-Ag8AMIICCgKCAgEArEZDhvc3ew2Gb8pvJlUrh5x+L5iqNxDYU3cOcOgeELCmOyAS
-cH+/1xrsHQI05xWPpz6VAja2NKl4OP90getPPkiQV1xAg5/gsOsRL8Pi/MwvQKfZ
-ObyW3t+sfFb1K3sVnm8bgk5F9OIVyAtzAx+Y53muEJsHOHpaEidnwbY2VE0zQB/G
-DBQovrMefAwmH4RPqFor6NzFMKVRi33pQjYmcfCVFZylrDeCn8T7llV0lrnWqv6z
-sGKfL3E4nHvyh/RsGNOXy+XQMxB9SA3j6hFTNtgQIPO/lxptz/+BLZoUt48nHZtr
-sc5j+3sn8c1O9e6MjI/1q8lvZsk7ZsWCGSwCOvJ9LnxCWOEQUUfqIvGLsk7NJQgf
-IkodZH9sW5Sjlro21+WBf3nvqlZ8g7r6K1RJOA8AtUiCaN/+o65t86WkwCSwQXcm
-+nArcwddOx2HN9sFrjJ59N1eYEDGmyK3BdppYuVXay705PmxotR1hCBvnXOb34dn
-gZxsxFTohr97JvEdNtGSNz4USyZPjgIMF/Gu8ruh0gQ1byhmayRqMGEqMAh58Lvb
-3HYsd3Bf+LB9PpaXLAdKzsTZ8a28zyDYo8a70h7iBRxhmFwa+Df+pSmUEdzhejfx
-7jEslhBQSQDmllaHrHc1G6H/w/u+04vi1joaLeLEGQclinKLeU88s9j3zzUCAwEA
-ATANBgkqhkiG9w0BAQsFAAOCAgEAGQED96wBGzbMUlk9mIvZeLerzEAB3YfgfAYa
-EAi79QHxM8UX06xmA2xtGvJSvlU8Xods9vxpBmIUnbDRTIAHNDApT19+vPg/iSfQ
-1J9Fo4b5kjmWL6SalEdYcxqH9V/QndHta4MXP91u/ZsJ/exwDTZFatXsfGkPjUmN
-Xp+Ip6iQg7+kV3JpRnMSbevj2Oujs7qTAdQedH38ZTNS0AaM5gvZyQkccCTKNBQ4
-3O8MhCau7U0EUirndqsQXa0D3o78FpKztLNXSM7919jU2y36kMrWXfArfrBKHJ9b
-nZeO7nkbHgvmVS8NTg9pR7L7u+YXTa2p1H2ZnpMQvruV7iL/Pb1H2N68UdvnQScL
-sgacGSzM6b6PVdWRbECiuzC0UyWLZo/LoU3DQFGoiDQ4e/B3+TMrvgFI0CnpAQ4w
-qiaVFJlRQeF4GaS4qHsN28OBliFATB3TXONFnz1aVkQlEHuh2+JbuL1b1lxvlX5t
-gBbu/GgAcP4Uy2z4PoDmempAvNi2kCcLB98m+jbFSMSB3nkrdj6MzyN7kW9bhk3T
-ClimxDmc23seprwLcxJUPP5q+HRB1VLKXLwIYxu+Up3g29d4k1Iy9nUUP9lITLTk
-blJxZ2BPuQqTLzyqmAEWa1HxljFC1b7oMp9a98PbxC3MxUggM7zx/rgXWxM8osib
-uwSZmw0=
------END CERTIFICATE-----
------BEGIN RSA PRIVATE KEY-----
-MIIJKAIBAAKCAgEArEZDhvc3ew2Gb8pvJlUrh5x+L5iqNxDYU3cOcOgeELCmOyAS
-cH+/1xrsHQI05xWPpz6VAja2NKl4OP90getPPkiQV1xAg5/gsOsRL8Pi/MwvQKfZ
-ObyW3t+sfFb1K3sVnm8bgk5F9OIVyAtzAx+Y53muEJsHOHpaEidnwbY2VE0zQB/G
-DBQovrMefAwmH4RPqFor6NzFMKVRi33pQjYmcfCVFZylrDeCn8T7llV0lrnWqv6z
-sGKfL3E4nHvyh/RsGNOXy+XQMxB9SA3j6hFTNtgQIPO/lxptz/+BLZoUt48nHZtr
-sc5j+3sn8c1O9e6MjI/1q8lvZsk7ZsWCGSwCOvJ9LnxCWOEQUUfqIvGLsk7NJQgf
-IkodZH9sW5Sjlro21+WBf3nvqlZ8g7r6K1RJOA8AtUiCaN/+o65t86WkwCSwQXcm
-+nArcwddOx2HN9sFrjJ59N1eYEDGmyK3BdppYuVXay705PmxotR1hCBvnXOb34dn
-gZxsxFTohr97JvEdNtGSNz4USyZPjgIMF/Gu8ruh0gQ1byhmayRqMGEqMAh58Lvb
-3HYsd3Bf+LB9PpaXLAdKzsTZ8a28zyDYo8a70h7iBRxhmFwa+Df+pSmUEdzhejfx
-7jEslhBQSQDmllaHrHc1G6H/w/u+04vi1joaLeLEGQclinKLeU88s9j3zzUCAwEA
-AQKCAgEAm1/z33Jwk4crTQAjJ0uBqxm1pW/ndSq4MO8cEzEGjL8F7iWK+/P8LiGV
-+sPWuuRzX7/N3OVDiFOgnqeniNWV7vK7XE9T0GMN4ALiyVW/D4mIxKOeA7jXycOq
-aap0DPdCFFbZVLkL10Vhp77LyHFjEsJn/4oTBRk0y1LG/as9bOMD6j29/X7hEL20
-LOU4LQzEW26YU7lqD+nKlijFjHYSTolRrOBPe/fE1BxxXLFOKfMKbcaygc8xCzTu
-fhQ8Nep45BtSuQ9Yq/WfSLFecemWR8yvH0k37yxjBknHVD23maZ+/PEEPKWM/2+g
-IzGsmZrBILVmOb2/v9CWxqY0JEfQ6aU/nLW1ZiXSOIPmKEooK/hPVxFIyQ1yET4G
-kQZ5RroY/QDrI14ms8P0iDzZ8K3EFKUyjiBbc83Mb0YIZ4hKd76gioOUIPeEQB+y
-QLZ8Cb9YS3V8uIOJg+F4xlpJSePAZphfSxRLojSiKUeCs8gNUxGz0zwiMNf1p76F
-8CaLgvSwT/cgQjWitMeeE1Ha+8lY8VzESmd10gPk2uES/qdrmMhwFwovPqqrtMqj
-kMrFKNy7Crka6me3dhKEtryRTk5ho2IS/VCy/eXQ7lUW8Cl4uFxmjpHYSJMqDWvC
-vu1p3/B1psSZIy2V2M9QqwZCysHqvGJMOCvYmnc6T62+kDRKQ7ECggEBAOS/1ptA
-75OBAsHLovkspiCvn3gb/VTvH6LOvxYTohjr5iBeX137vg0aR1rg0jwcdf8EEJYw
-4YxOid7KmV7O25ujzduQgwpVgujnJAeBLeLDC5dVbq3PQah61AvR2O/7t+Ls3oxi
-cWh/OHC6SeZ/n406cxSCCUpVwtgHTaNFzaSmpDdEOSbjvXjQQjiRsG7j/1u64riq
-RlJ/hIUlcys0g94yeN/5lPaNfsq0+vTSAYuTVVXVbEntwWcZVZxnQJviZVgJ99zM
-RzE3sprvvr+I5QQ4FRMn0W9U7gblSJd5FGEL8gye4SRd+LxoUL4DR6pfuwd0vlXA
-g+dgiOKoHm2Bb8cCggEBAMDMHMNR6uipdMivPjBTlklnaYd9SY3c5x65yNtx4CNh
-rXyvy/6YvME7PPnKQZ8TQ4DkbVDUCAF7wnyAJJ7eWMav3bNlqWWjzaBvQz4Fn0XG
-/1W5R1CoJ9DW5FY3f9efJzQTmfn6dIlCx1gW7XfVBZQqI1LORMWUYenk0KAvjlg2
-UHYYl/BT1RhtYyzOJHto1PaUvCNDiOiDWAkTpLigYm7hGgVmcSwbo4F54SNUHdV7
-yz3CorCM4VsEYYSL80WHYxf/Zc+mcIDoWOdog0iEeK/Zu++yG5lPRxC1862GmsZA
-J06BMqX+NVGOfiGcVaGH+SZJXeFcrr7F8ZWp6y38QSMCggEAJwzo4hAv1gqMIfFV
-nRwWMDZLDwIYOUupJu4MiQRJA+AhpRz3QuAbDbmSvNzshv6E1kgnXLxzhLRTrQkB
-LcI6k1NfbUA6XqVCd+gdqnpPDwslC2y2PE3Jc62kTXBBjJZ4SfEN/QFBQwmU5Qmo
-XAUlg8KaqsGYPGxvmtmEU38zIAyitByddRoj2mATLf0RFZ0ulsZMtiG7Z5IFWYWP
-J60LZf9Py0ycNYrqPkivHuRLBzzbsI+CsQw5nBQjHVQzH2mCy4jIG5V0Ad70Sqbq
-9V+1WQcJ8f82Lb9d8ydpQRKWfArCA42L+d1g/SkBv65nqZo2H4u6goEfA3zjYW45
-44/ZOQKCAQB440MhwYqe6ioc76z51l+ElUAZQZjOR/XvUSS9XHDjHosOhJhPgmvQ
-aZl5MrXkzcpk1lYo+Vovu+8d66eKqfZWVs2XgCYwYf48G6e5CwNsWDOgB7XMwDN/
-Ak9YNCKIC/Yj9Cp3EPDjZCjkdjPeEIcX+Tf+4vFCRiEC7INX/ZmufBgFhLQ4cAhM
-8cHexT8g1oG6P1acces1h626u0NstLwjtCeBvVM3CfmC5O4jHco7Iw00I4epVhyz
-2lJfLvWR4itjT7QB+OXQHmAocWLoJJAcC1WJHU+q2IfB1aT+aElCB9XdpqsgY/4A
-rm0uG/2hdEXoGNaxyVCUtD8fzdR2GBarAoIBACCYXXREMYb6i1TbR5Q2LvVQUPsO
-Hgnbr+PLmx93rfUzDcr5r+cJgryjYQDKJTRleDJhg80M3RYOq+IOdl6yxOmRATmJ
-ZDgwRVD1F6VFxBJePcAW30FI5CoBogsHaZQDKGsopEaDRLK5E3QHUVG5qj323RdI
-Unf1++wI4nw+qwsVf1gSTcAdzq29v3NIWUyvvrmTNO4MxFTt0/lqkCsdT/2EFQDB
-/yQ1HCtQQjXE1xlYh0BnMZp9+4FmrlMC9Oj5H0dDSWmInPION0ft8/SjBj4TQ5Qi
-2DUo1WOWQnVR8Bxz0B8McXS+dOmgLe8ws4/ez7DoEVqHTgirKqBg5qRFQKw=
------END RSA PRIVATE KEY-----
diff --git a/data/prisma/build-prisma-engine.sh b/data/prisma/build-prisma-engine.sh
deleted file mode 100644
index 4c0757d39d..0000000000
--- a/data/prisma/build-prisma-engine.sh
+++ /dev/null
@@ -1 +0,0 @@
-docker build --platform linux/amd64,linux/arm64 -t coollabsio/prisma-engine -f prisma-engine.Dockerfile --push .
\ No newline at end of file
diff --git a/docker-compose-haproxy.yaml b/docker-compose-haproxy.yaml
deleted file mode 100644
index 66b35acd64..0000000000
--- a/docker-compose-haproxy.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-version: '3.8'
-
-services:
- haproxy:
- image: coollabsio/coolify-haproxy-alpine:latest
- container_name: coolify-haproxy
- extra_hosts:
- - 'host.docker.internal:host-gateway'
- networks:
- - coolify
- volumes:
- - './data/haproxy/:/usr/local/etc/haproxy/'
- ports:
- - '80:80'
- - '443:443'
- - '8404:8404'
- - '5555:5555'
- - '3306:3306'
-
-networks:
- coolify:
- attachable: true
- name: coolify
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 39866b5e24..7236628269 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -19,13 +19,6 @@ services:
- '.env'
networks:
- coolify-infra
- depends_on: ['redis']
- redis:
- image: redis:6.2-alpine
- restart: always
- container_name: coolify-redis
- networks:
- - coolify-infra
networks:
coolify-infra:
diff --git a/data/docker/daemon.json b/others/docker/daemon.json
similarity index 100%
rename from data/docker/daemon.json
rename to others/docker/daemon.json
diff --git a/data/fluentd/Dockerfile-dev b/others/fluentd/Dockerfile-dev
similarity index 100%
rename from data/fluentd/Dockerfile-dev
rename to others/fluentd/Dockerfile-dev
diff --git a/data/fluentd/fluentbit-dev.conf b/others/fluentd/fluentbit-dev.conf
similarity index 100%
rename from data/fluentd/fluentbit-dev.conf
rename to others/fluentd/fluentbit-dev.conf
diff --git a/data/fluentd/fluentd-dev.conf b/others/fluentd/fluentd-dev.conf
similarity index 100%
rename from data/fluentd/fluentd-dev.conf
rename to others/fluentd/fluentd-dev.conf
diff --git a/others/prisma/build-prisma-engine.sh b/others/prisma/build-prisma-engine.sh
new file mode 100644
index 0000000000..896dee1e8e
--- /dev/null
+++ b/others/prisma/build-prisma-engine.sh
@@ -0,0 +1 @@
+docker buildx build --platform linux/amd64,linux/arm64 -t coollabsio/prisma-engine:3.15 -f prisma-engine.Dockerfile --push .
\ No newline at end of file
diff --git a/data/prisma/prisma-engine.Dockerfile b/others/prisma/prisma-engine.Dockerfile
similarity index 80%
rename from data/prisma/prisma-engine.Dockerfile
rename to others/prisma/prisma-engine.Dockerfile
index 76d1204fb0..1c6b1bb065 100644
--- a/data/prisma/prisma-engine.Dockerfile
+++ b/others/prisma/prisma-engine.Dockerfile
@@ -1,8 +1,8 @@
-FROM rust:1.58.1-alpine3.14 as prisma
+FROM rust:1.61-alpine3.16 as prisma
WORKDIR /prisma
ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN apk --no-cache add openssl direnv git musl-dev openssl-dev build-base perl protoc
-RUN git clone --depth=1 --branch=3.12.x https://github.com/prisma/prisma-engines.git /prisma
+RUN git clone --depth=1 --branch=3.15.x https://github.com/prisma/prisma-engines.git /prisma
RUN cargo build --release
FROM alpine
diff --git a/data/traefik/docker-compose-tcp.yaml b/others/traefik/docker-compose-tcp.yaml
similarity index 100%
rename from data/traefik/docker-compose-tcp.yaml
rename to others/traefik/docker-compose-tcp.yaml
diff --git a/package.json b/package.json
index 6dcf858d7b..b817bf7f60 100644
--- a/package.json
+++ b/package.json
@@ -1,96 +1,35 @@
{
- "name": "coolify",
- "description": "An open-source & self-hostable Heroku / Netlify alternative.",
- "version": "2.9.11",
- "license": "AGPL-3.0",
- "scripts": {
- "dev": "docker-compose -f docker-compose-dev.yaml up -d && cross-env NODE_ENV=development & svelte-kit dev --host 0.0.0.0",
- "dev:stop": "docker-compose -f docker-compose-dev.yaml down",
- "dev:logs": "docker-compose -f docker-compose-dev.yaml logs -f --tail 10",
- "studio": "npx prisma studio",
- "start": "npx prisma migrate deploy && npx prisma generate && npx prisma db seed && node build/index.js",
- "build": "svelte-kit build",
- "preview": "svelte-kit preview",
- "check": "svelte-check --tsconfig ./tsconfig.json",
- "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
- "db:generate": "prisma generate",
- "db:push": "prisma db push && prisma generate",
- "db:seed": "prisma db seed",
- "db:migrate": "COOLIFY_DATABASE_URL=file:../db/migration.db prisma migrate dev --skip-seed --name",
- "release:production:all": "cross-var docker build --platform linux/amd64,linux/arm64 -t coollabsio/coolify:$npm_package_version -t coollabsio/coolify:latest --push .",
- "release:production:amd": "cross-var docker build --platform linux/amd64 -t coollabsio/coolify:$npm_package_version -t coollabsio/coolify:latest --push .",
- "release:production:arm": "cross-var docker build --platform linux/arm64 -t coollabsio/coolify:$npm_package_version -t coollabsio/coolify:latest --push .",
- "release:staging:all": "cross-var docker build --platform linux/amd64,linux/arm64 -t coollabsio/coolify:$npm_package_version --push .",
- "release:staging:amd": "cross-var docker build --platform linux/amd64 -t coollabsio/coolify:$npm_package_version --push .",
- "release:staging:arm": "cross-var docker build --platform linux/arm64 -t coollabsio/coolify:$npm_package_version --push .",
- "release:haproxy": "docker build --platform linux/amd64,linux/arm64 -t coollabsio/coolify-haproxy-alpine:latest -t coollabsio/coolify-haproxy-alpine:1.1.0 -f data/haproxy.Dockerfile --push .",
- "release:haproxy:tcp": "docker build --platform linux/amd64,linux/arm64 -t coollabsio/coolify-haproxy-tcp-alpine:latest -t coollabsio/coolify-haproxy-tcp-alpine:1.1.0 -f data/haproxy-tcp.Dockerfile --push .",
- "release:haproxy:http": "docker build --platform linux/amd64,linux/arm64 -t coollabsio/coolify-haproxy-http-alpine:latest -t coollabsio/coolify-haproxy-http-alpine:1.1.0 -f data/haproxy-http.Dockerfile --push .",
- "prepare": "husky install"
- },
- "devDependencies": {
- "@sveltejs/adapter-node": "1.0.0-next.73",
- "@sveltejs/adapter-static": "1.0.0-next.31",
- "@sveltejs/kit": "1.0.0-next.334",
- "@types/js-cookie": "3.0.2",
- "@types/js-yaml": "4.0.5",
- "@types/node": "17.0.34",
- "@types/node-forge": "1.0.2",
- "@typescript-eslint/eslint-plugin": "4.31.1",
- "@typescript-eslint/parser": "4.31.1",
- "@zerodevx/svelte-toast": "0.7.1",
- "autoprefixer": "10.4.7",
- "cross-env": "7.0.3",
- "cross-var": "1.1.0",
- "eslint": "7.32.0",
- "eslint-config-prettier": "8.5.0",
- "eslint-plugin-svelte3": "3.4.1",
- "husky": "7.0.4",
- "lint-staged": "12.4.1",
- "postcss": "8.4.13",
- "prettier": "2.6.2",
- "prettier-plugin-svelte": "2.7.0",
- "prettier-plugin-tailwindcss": "0.1.11",
- "prisma": "3.11.1",
- "svelte": "3.48.0",
- "svelte-check": "2.7.1",
- "svelte-preprocess": "4.10.6",
- "svelte-select": "4.4.7",
- "sveltekit-i18n": "2.2.1",
- "tailwindcss": "3.0.24",
- "ts-node": "10.7.0",
- "tslib": "2.4.0",
- "typescript": "4.6.4"
- },
- "type": "module",
- "dependencies": {
- "@iarna/toml": "2.2.5",
- "@prisma/client": "3.11.1",
- "@sentry/node": "6.19.7",
- "bcryptjs": "2.4.3",
- "bullmq": "1.82.2",
- "compare-versions": "4.1.3",
- "cookie": "0.5.0",
- "cuid": "2.1.8",
- "dayjs": "1.11.2",
- "dockerode": "3.3.1",
- "dotenv-extended": "2.9.0",
- "generate-password": "1.7.0",
- "get-port": "6.1.2",
- "got": "12.0.4",
- "is-ip": "4.0.0",
- "js-cookie": "3.0.1",
- "js-yaml": "4.1.0",
- "jsonwebtoken": "8.5.1",
- "mustache": "4.2.0",
- "node-forge": "1.3.1",
- "node-os-utils": "1.3.6",
- "p-limit": "4.0.0",
- "svelte-kit-cookie-session": "2.1.4",
- "tailwindcss-scrollbar": "0.1.0",
- "unique-names-generator": "4.7.1"
- },
- "prisma": {
- "seed": "node prisma/seed.cjs"
- }
-}
+ "name": "coolify",
+ "version": "3.0.0",
+ "description": "An open-source & self-hostable Heroku / Netlify alternative.",
+ "license": "AGPL-3.0",
+ "scripts": {
+ "db:studio": "pnpm run --filter coolify-api db:studio",
+ "db:push": "pnpm run --filter coolify-api db:push",
+ "db:seed": "pnpm run --filter coolify-api db:seed",
+ "format": "run-p -l -n format:*",
+ "format:api": "NODE_ENV=development pnpm run --filter coolify-api format",
+ "lint": "run-p -l -n lint:*",
+ "lint:api": "NODE_ENV=development pnpm run --filter coolify-api lint",
+ "dev": "run-p -l -n dev:*",
+ "dev:api": "NODE_ENV=development pnpm run --filter coolify-api dev",
+ "dev:ui": "NODE_ENV=development pnpm run --filter coolify-ui dev",
+ "build": "NODE_ENV=production run-p -n build:*",
+ "build:api": "NODE_ENV=production pnpm run --filter coolify-api build",
+ "build:ui": "NODE_ENV=production pnpm run --filter coolify-ui build",
+ "release:staging:amd": "cross-var docker buildx build --platform linux/amd64 -t coollabsio/coolify:$npm_package_version --push ."
+ },
+ "devDependencies": {
+ "cross-var": "1.1.0",
+ "npm-run-all": "4.1.5"
+ },
+ "keywords": [
+ "docker",
+ "self-host",
+ "iaas",
+ "heroku",
+ "netlify",
+ "open-source",
+ "coolify"
+ ]
+}
\ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e8f3f1bc9a..5614057866 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1,277 +1,414 @@
lockfileVersion: 5.4
-specifiers:
- '@iarna/toml': 2.2.5
- '@prisma/client': 3.11.1
- '@sentry/node': 6.19.7
- '@sveltejs/adapter-node': 1.0.0-next.73
- '@sveltejs/adapter-static': 1.0.0-next.31
- '@sveltejs/kit': 1.0.0-next.334
- '@types/js-cookie': 3.0.2
- '@types/js-yaml': 4.0.5
- '@types/node': 17.0.34
- '@types/node-forge': 1.0.2
- '@typescript-eslint/eslint-plugin': 4.31.1
- '@typescript-eslint/parser': 4.31.1
- '@zerodevx/svelte-toast': 0.7.1
- autoprefixer: 10.4.7
- bcryptjs: 2.4.3
- bullmq: 1.82.2
- compare-versions: 4.1.3
- cookie: 0.5.0
- cross-env: 7.0.3
- cross-var: 1.1.0
- cuid: 2.1.8
- dayjs: 1.11.2
- dockerode: 3.3.1
- dotenv-extended: 2.9.0
- eslint: 7.32.0
- eslint-config-prettier: 8.5.0
- eslint-plugin-svelte3: 3.4.1
- generate-password: 1.7.0
- get-port: 6.1.2
- got: 12.0.4
- husky: 7.0.4
- is-ip: 4.0.0
- js-cookie: 3.0.1
- js-yaml: 4.1.0
- jsonwebtoken: 8.5.1
- lint-staged: 12.4.1
- mustache: 4.2.0
- node-forge: 1.3.1
- node-os-utils: 1.3.6
- p-limit: 4.0.0
- postcss: 8.4.13
- prettier: 2.6.2
- prettier-plugin-svelte: 2.7.0
- prettier-plugin-tailwindcss: 0.1.11
- prisma: 3.11.1
- svelte: 3.48.0
- svelte-check: 2.7.1
- svelte-kit-cookie-session: 2.1.4
- svelte-preprocess: 4.10.6
- svelte-select: 4.4.7
- sveltekit-i18n: 2.2.1
- tailwindcss: 3.0.24
- tailwindcss-scrollbar: 0.1.0
- ts-node: 10.7.0
- tslib: 2.4.0
- typescript: 4.6.4
- unique-names-generator: 4.7.1
-
-dependencies:
- '@iarna/toml': 2.2.5
- '@prisma/client': [email protected]
- '@sentry/node': 6.19.7
- bcryptjs: 2.4.3
- bullmq: 1.82.2
- compare-versions: 4.1.3
- cookie: 0.5.0
- cuid: 2.1.8
- dayjs: 1.11.2
- dockerode: 3.3.1
- dotenv-extended: 2.9.0
- generate-password: 1.7.0
- get-port: 6.1.2
- got: 12.0.4
- is-ip: 4.0.0
- js-cookie: 3.0.1
- js-yaml: 4.1.0
- jsonwebtoken: 8.5.1
- mustache: 4.2.0
- node-forge: 1.3.1
- node-os-utils: 1.3.6
- p-limit: 4.0.0
- svelte-kit-cookie-session: 2.1.4
- tailwindcss-scrollbar: [email protected]
- unique-names-generator: 4.7.1
-
-devDependencies:
- '@sveltejs/adapter-node': 1.0.0-next.73
- '@sveltejs/adapter-static': 1.0.0-next.31
- '@sveltejs/kit': [email protected]
- '@types/js-cookie': 3.0.2
- '@types/js-yaml': 4.0.5
- '@types/node': 17.0.34
- '@types/node-forge': 1.0.2
- '@typescript-eslint/eslint-plugin': 4.31.1_lii63oz3usekbu5ehvrcuwn5jy
- '@typescript-eslint/parser': 4.31.1_e4zyhrvfnqudwdx5bevnvkluy4
- '@zerodevx/svelte-toast': 0.7.1
- autoprefixer: [email protected]
- cross-env: 7.0.3
- cross-var: 1.1.0
- eslint: 7.32.0
- eslint-config-prettier: [email protected]
- eslint-plugin-svelte3: 3.4.1_6wevxxng4y4ff26nzlndg2wnpa
- husky: 7.0.4
- lint-staged: 12.4.1
- postcss: 8.4.13
- prettier: 2.6.2
- prettier-plugin-svelte: 2.7.0_kkjbqzpydplecjtkxrgomroeru
- prettier-plugin-tailwindcss: [email protected]
- prisma: 3.11.1
- svelte: 3.48.0
- svelte-check: 2.7.1_f2ke6qjyzu5axsjd6yk3u4tn7a
- svelte-preprocess: 4.10.6_nq4dx2skq5drra53vttuo4lltu
- svelte-select: 4.4.7
- sveltekit-i18n: [email protected]
- tailwindcss: [email protected]
- ts-node: 10.7.0_3smuweqyuzdazdnyhhezld6mfa
- tslib: 2.4.0
- typescript: 4.6.4
+importers:
+
+ .:
+ specifiers:
+ cross-var: 1.1.0
+ npm-run-all: 4.1.5
+ devDependencies:
+ cross-var: 1.1.0
+ npm-run-all: 4.1.5
+
+ apps/api:
+ specifiers:
+ '@breejs/ts-worker': 2.0.0
+ '@fastify/autoload': 5.0.0
+ '@fastify/cookie': 7.0.0
+ '@fastify/cors': 8.0.0
+ '@fastify/env': 4.0.0
+ '@fastify/jwt': 6.2.0
+ '@fastify/static': 6.4.0
+ '@iarna/toml': 2.2.5
+ '@prisma/client': 3.15.2
+ '@types/node': 18.0.3
+ '@types/node-os-utils': 1.3.0
+ '@typescript-eslint/eslint-plugin': 5.30.5
+ '@typescript-eslint/parser': 5.30.5
+ axios: 0.27.2
+ bcryptjs: 2.4.3
+ bree: 9.1.1
+ cabin: 9.1.2
+ compare-versions: 4.1.3
+ cuid: 2.1.8
+ dayjs: 1.11.3
+ dockerode: 3.3.2
+ dotenv-extended: 2.9.0
+ esbuild: 0.14.48
+ eslint: 8.19.0
+ eslint-config-prettier: 8.5.0
+ eslint-plugin-prettier: 4.2.1
+ fastify: 4.2.0
+ fastify-plugin: 3.0.1
+ generate-password: 1.7.0
+ get-port: 6.1.2
+ got: 12.1.0
+ is-ip: 4.0.0
+ js-yaml: 4.1.0
+ jsonwebtoken: 8.5.1
+ node-forge: 1.3.1
+ node-os-utils: 1.3.7
+ nodemon: 2.0.19
+ p-queue: 7.2.0
+ prettier: 2.7.1
+ prisma: 3.15.2
+ rimraf: 3.0.2
+ strip-ansi: 7.0.1
+ tsconfig-paths: 4.0.0
+ typescript: 4.7.4
+ unique-names-generator: 4.7.1
+ dependencies:
+ '@breejs/ts-worker': 2.0.0_6iibbo7rh4755pyipjtynkbezq
+ '@fastify/autoload': 5.0.0
+ '@fastify/cookie': 7.0.0
+ '@fastify/cors': 8.0.0
+ '@fastify/env': 4.0.0
+ '@fastify/jwt': 6.2.0
+ '@fastify/static': 6.4.0
+ '@iarna/toml': 2.2.5
+ '@prisma/client': [email protected]
+ axios: 0.27.2
+ bcryptjs: 2.4.3
+ bree: 9.1.1
+ cabin: 9.1.2
+ compare-versions: 4.1.3
+ cuid: 2.1.8
+ dayjs: 1.11.3
+ dockerode: 3.3.2
+ dotenv-extended: 2.9.0
+ fastify: 4.2.0
+ fastify-plugin: 3.0.1
+ generate-password: 1.7.0
+ get-port: 6.1.2
+ got: 12.1.0
+ is-ip: 4.0.0
+ js-yaml: 4.1.0
+ jsonwebtoken: 8.5.1
+ node-forge: 1.3.1
+ node-os-utils: 1.3.7
+ p-queue: 7.2.0
+ strip-ansi: 7.0.1
+ unique-names-generator: 4.7.1
+ devDependencies:
+ '@types/node': 18.0.3
+ '@types/node-os-utils': 1.3.0
+ '@typescript-eslint/eslint-plugin': 5.30.5_6zdoc3rn4mpiddqwhppni2mnnm
+ '@typescript-eslint/parser': 5.30.5_4x5o4skxv6sl53vpwefgt23khm
+ esbuild: 0.14.48
+ eslint: 8.19.0
+ eslint-config-prettier: [email protected]
+ eslint-plugin-prettier: 4.2.1_7uxdfn2xinezdgvmbammh6ev5i
+ nodemon: 2.0.19
+ prettier: 2.7.1
+ prisma: 3.15.2
+ rimraf: 3.0.2
+ tsconfig-paths: 4.0.0
+ typescript: 4.7.4
+
+ apps/ui:
+ specifiers:
+ '@playwright/test': 1.23.1
+ '@sveltejs/adapter-auto': 1.0.0-next.53
+ '@sveltejs/adapter-static': 1.0.0-next.34
+ '@sveltejs/kit': 1.0.0-next.359
+ '@types/js-cookie': 3.0.2
+ '@typescript-eslint/eslint-plugin': 5.30.5
+ '@typescript-eslint/parser': 5.30.5
+ '@zerodevx/svelte-toast': 0.7.2
+ autoprefixer: 10.4.7
+ cuid: 2.1.8
+ eslint: 8.19.0
+ eslint-config-prettier: 8.5.0
+ eslint-plugin-svelte3: 4.0.0
+ js-cookie: 3.0.1
+ p-limit: 4.0.0
+ postcss: 8.4.14
+ prettier: 2.7.1
+ prettier-plugin-svelte: 2.7.0
+ svelte: 3.48.0
+ svelte-check: 2.8.0
+ svelte-preprocess: 4.10.7
+ svelte-select: 4.4.7
+ sveltekit-i18n: 2.2.2
+ tailwindcss: 3.1.4
+ tailwindcss-scrollbar: 0.1.0
+ tslib: 2.4.0
+ typescript: 4.7.4
+ vite: ^2.9.13
+ dependencies:
+ '@sveltejs/adapter-static': 1.0.0-next.34
+ '@zerodevx/svelte-toast': 0.7.2
+ cuid: 2.1.8
+ js-cookie: 3.0.1
+ p-limit: 4.0.0
+ svelte-select: 4.4.7
+ sveltekit-i18n: [email protected]
+ devDependencies:
+ '@playwright/test': 1.23.1
+ '@sveltejs/adapter-auto': 1.0.0-next.53
+ '@types/js-cookie': 3.0.2
+ '@typescript-eslint/eslint-plugin': 5.30.5_6zdoc3rn4mpiddqwhppni2mnnm
+ '@typescript-eslint/parser': 5.30.5_4x5o4skxv6sl53vpwefgt23khm
+ autoprefixer: [email protected]
+ eslint: 8.19.0
+ eslint-config-prettier: [email protected]
+ eslint-plugin-svelte3: 4.0.0_m4jpobot6gi3xtcba7bv5cflma
+ postcss: 8.4.14
+ prettier: 2.7.1
+ prettier-plugin-svelte: 2.7.0_nakrehnrzdf7fdea5k3a4dfy4m
+ svelte: 3.48.0
+ svelte-check: 2.8.0_s3dopqgs4h45owyu2kxaf6kyfu
+ svelte-preprocess: 4.10.7_jr4mgafwdbjtobsadg2hrd5qfy
+ tailwindcss: 3.1.4
+ tailwindcss-scrollbar: [email protected]
+ tslib: 2.4.0
+ typescript: 4.7.4
+ vite: 2.9.13
packages:
- /@babel/code-frame/7.12.11:
- resolution:
- {
- integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==
- }
+
+ /@babel/code-frame/7.16.7:
+ resolution: {integrity: sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==}
+ engines: {node: '>=6.9.0'}
dependencies:
- '@babel/highlight': 7.14.5
- dev: true
+ '@babel/highlight': 7.17.12
+ dev: false
- /@babel/helper-validator-identifier/7.15.7:
- resolution:
- {
- integrity: sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==
- }
- engines: { node: '>=6.9.0' }
- dev: true
+ /@babel/helper-validator-identifier/7.16.7:
+ resolution: {integrity: sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==}
+ engines: {node: '>=6.9.0'}
+ dev: false
- /@babel/highlight/7.14.5:
- resolution:
- {
- integrity: sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==
- }
- engines: { node: '>=6.9.0' }
+ /@babel/highlight/7.17.12:
+ resolution: {integrity: sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==}
+ engines: {node: '>=6.9.0'}
dependencies:
- '@babel/helper-validator-identifier': 7.15.7
+ '@babel/helper-validator-identifier': 7.16.7
chalk: 2.4.2
js-tokens: 4.0.0
- dev: true
+ dev: false
+
+ /@babel/runtime/7.18.3:
+ resolution: {integrity: sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ regenerator-runtime: 0.13.9
+ dev: false
+
+ /@breejs/later/4.1.0:
+ resolution: {integrity: sha512-QgGnZ9b7o4k0Ai1ZbTJWwZpZcFK9d+Gb+DyNt4UT9x6IEIs5HVu0iIlmgzGqN+t9MoJSpSPo9S/Mm51UtHr3JA==}
+ engines: {node: '>= 10'}
+ dev: false
- /@cspotcode/source-map-consumer/0.8.0:
- resolution:
- {
- integrity: sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==
- }
- engines: { node: '>= 12' }
+ /@breejs/ts-worker/2.0.0_6iibbo7rh4755pyipjtynkbezq:
+ resolution: {integrity: sha512-6anHRcmgYlF7mrm/YVRn6rx2cegLuiY3VBxkkimOTWC/dVQeH336imVSuIKEGKTwiuNTPr2hswVdDSneNuXg3A==}
+ engines: {node: '>= 12.11'}
+ peerDependencies:
+ bree: '>=9.0.0'
+ dependencies:
+ bree: 9.1.1
+ ts-node: 10.8.2_fxk5i3xm3ivo7fjwhcizcinpla
+ tsconfig-paths: 4.0.0
+ transitivePeerDependencies:
+ - '@swc/core'
+ - '@swc/wasm'
+ - '@types/node'
+ - typescript
+ dev: false
- /@cspotcode/source-map-support/0.7.0:
- resolution:
- {
- integrity: sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==
- }
- engines: { node: '>=12' }
+ /@cspotcode/source-map-support/0.8.1:
+ resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
+ engines: {node: '>=12'}
dependencies:
- '@cspotcode/source-map-consumer': 0.8.0
+ '@jridgewell/trace-mapping': 0.3.9
+ dev: false
- /@eslint/eslintrc/0.4.3:
- resolution:
- {
- integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==
- }
- engines: { node: ^10.12.0 || >=12.0.0 }
+ /@eslint/eslintrc/1.3.0:
+ resolution: {integrity: sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
ajv: 6.12.6
- debug: 4.3.3
- espree: 7.3.1
- globals: 13.12.0
- ignore: 4.0.6
+ debug: 4.3.4
+ espree: 9.3.2
+ globals: 13.15.0
+ ignore: 5.2.0
import-fresh: 3.3.0
- js-yaml: 3.14.1
- minimatch: 3.0.4
+ js-yaml: 4.1.0
+ minimatch: 3.1.2
strip-json-comments: 3.1.1
transitivePeerDependencies:
- supports-color
dev: true
- /@humanwhocodes/config-array/0.5.0:
- resolution:
- {
- integrity: sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==
- }
- engines: { node: '>=10.10.0' }
+ /@fastify/ajv-compiler/3.1.1:
+ resolution: {integrity: sha512-sn01z9hluLu4ZKUEWK/gdCOU+QJTa6r7YpwD2l7lATgfwrJD/sMSe+zX03UWWebI9kdMmK18gj4Fhi0I3LtLnQ==}
+ dependencies:
+ ajv: 8.11.0
+ ajv-formats: 2.1.1
+ fast-uri: 2.1.0
+ dev: false
+
+ /@fastify/autoload/5.0.0:
+ resolution: {integrity: sha512-hayrT8U3cUxQDvQSINGb5+TX9n9KPh9wSAB2LxPFXiKPFzfu+G1+lZ2Uh26Ej9trzq9jZlsYbx4xUzEeFVkJZw==}
+ dependencies:
+ pkg-up: 3.1.0
+ dev: false
+
+ /@fastify/cookie/7.0.0:
+ resolution: {integrity: sha512-/JQcHR4bsFGRo39esT1GTxB0MsMd3loJxNfHYV0MRduXvdiDJd94okiCBlPOesRxwA5dJCqFNo80J7muHG+T+w==}
dependencies:
- '@humanwhocodes/object-schema': 1.2.0
- debug: 4.3.3
- minimatch: 3.0.4
+ cookie-signature: 1.2.0
+ fastify-plugin: 3.0.1
+ dev: false
+
+ /@fastify/cors/8.0.0:
+ resolution: {integrity: sha512-mB2GsA7aVwq7XG6B2OM1FMpcaiXY69ZbM1h/xDJxLEVu5ITGcs5XYrBIYTMNU2dQtzO6mzXhGd2dEKaCnB7UgQ==}
+ dependencies:
+ fastify-plugin: 3.0.1
+ vary: 1.1.2
+ dev: false
+
+ /@fastify/env/4.0.0:
+ resolution: {integrity: sha512-ZpvEH6E2dhYaDgxlyQSmTpVDhKFXRF6DH7N9sNsjpn+GIWDbIYTiYf3ttr0wGXgBWIc0bJFpTFTjlNmP2VaZ/w==}
+ dependencies:
+ env-schema: 4.0.0
+ fastify-plugin: 3.0.1
+ dev: false
+
+ /@fastify/error/3.0.0:
+ resolution: {integrity: sha512-dPRyT40GiHRzSCll3/Jn2nPe25+E1VXc9tDwRAIKwFCxd5Np5wzgz1tmooWG3sV0qKgrBibihVoCna2ru4SEFg==}
+ dev: false
+
+ /@fastify/fast-json-stringify-compiler/4.0.0:
+ resolution: {integrity: sha512-9pCi6c6tmGt/qfuf2koZQuSIG6ckP9q3mz+JoMmAq9eQ4EtA92sWoK7E0LJUn2FFTS/hp5kag+4+dWsV5ZfcXg==}
+ dependencies:
+ fast-json-stringify: 5.0.5
+ dev: false
+
+ /@fastify/jwt/6.2.0:
+ resolution: {integrity: sha512-j2hjMi0XP6WRZGVKUuhDHUeEg7QQ5edJoiKIYFPWON6hDdDRrUcDOsRQkNi2KPbjlzDPFGNq0d5iDK9gFVs2dA==}
+ dependencies:
+ '@lukeed/ms': 2.0.0
+ fast-jwt: 1.5.4
+ fastify-plugin: 3.0.1
+ http-errors: 2.0.0
+ steed: 1.1.3
+ dev: false
+
+ /@fastify/static/6.4.0:
+ resolution: {integrity: sha512-1GFNBKh4ArUpHMCwPUILurpfV3+mTvn+6r6aOQUwP8KKqWJtEAQ1blIwjE16JetmgpIYYamcBUUmojjHDfhgKA==}
+ dependencies:
+ content-disposition: 0.5.4
+ encoding-negotiator: 2.0.1
+ fastify-plugin: 3.0.1
+ glob: 8.0.3
+ p-limit: 3.1.0
+ readable-stream: 3.6.0
+ send: 0.18.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@humanwhocodes/config-array/0.9.5:
+ resolution: {integrity: sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==}
+ engines: {node: '>=10.10.0'}
+ dependencies:
+ '@humanwhocodes/object-schema': 1.2.1
+ debug: 4.3.4
+ minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
dev: true
- /@humanwhocodes/object-schema/1.2.0:
- resolution:
- {
- integrity: sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==
- }
+ /@humanwhocodes/object-schema/1.2.1:
+ resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==}
dev: true
/@iarna/toml/2.2.5:
- resolution:
- {
- integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==
- }
- dev: false
+ resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==}
/@jridgewell/resolve-uri/3.0.7:
- resolution:
- {
- integrity: sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==
- }
- engines: { node: '>=6.0.0' }
- dev: true
+ resolution: {integrity: sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==}
+ engines: {node: '>=6.0.0'}
/@jridgewell/sourcemap-codec/1.4.13:
- resolution:
- {
- integrity: sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==
- }
- dev: true
+ resolution: {integrity: sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==}
/@jridgewell/trace-mapping/0.3.13:
- resolution:
- {
- integrity: sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w==
- }
+ resolution: {integrity: sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w==}
+ dependencies:
+ '@jridgewell/resolve-uri': 3.0.7
+ '@jridgewell/sourcemap-codec': 1.4.13
+ dev: true
+
+ /@jridgewell/trace-mapping/0.3.9:
+ resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
dependencies:
'@jridgewell/resolve-uri': 3.0.7
'@jridgewell/sourcemap-codec': 1.4.13
+ dev: false
+
+ /@ladjs/format-util/1.0.4:
+ resolution: {integrity: sha512-hZere0rUga8kTzSTFbHREXpD9E/jwi94+B5RyLAmMIzl/w/EK1z7rFEnMHzPkU4AZkL42JWSsGXoV8LXMihybg==}
+ dev: false
+
+ /@lukeed/ms/2.0.0:
+ resolution: {integrity: sha512-NOlhE40rGptwLwJhE0ZW259hcoa+nkpQRQ1FUKV4Sr2z1Eh2WfkHQ3jjBNF7YEqOrF0TOpqnyU1wClvWBrXByg==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /@mapbox/node-pre-gyp/1.0.9:
+ resolution: {integrity: sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==}
+ hasBin: true
+ dependencies:
+ detect-libc: 2.0.1
+ https-proxy-agent: 5.0.1
+ make-dir: 3.1.0
+ node-fetch: 2.6.7
+ nopt: 5.0.0
+ npmlog: 5.0.1
+ rimraf: 3.0.2
+ semver: 7.3.7
+ tar: 6.1.11
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
dev: true
/@nodelib/fs.scandir/2.1.5:
- resolution:
- {
- integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==
- }
- engines: { node: '>= 8' }
+ resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
+ engines: {node: '>= 8'}
dependencies:
'@nodelib/fs.stat': 2.0.5
run-parallel: 1.2.0
+ dev: true
/@nodelib/fs.stat/2.0.5:
- resolution:
- {
- integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==
- }
- engines: { node: '>= 8' }
+ resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}
+ engines: {node: '>= 8'}
+ dev: true
/@nodelib/fs.walk/1.2.8:
- resolution:
- {
- integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==
- }
- engines: { node: '>= 8' }
+ resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
+ engines: {node: '>= 8'}
dependencies:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.13.0
+ dev: true
+
+ /@playwright/test/1.23.1:
+ resolution: {integrity: sha512-dKplLPSYPZgnsBk1xxOophhpx3ZVg8DveoNJgLPe096lDCfmaIIreLsYF+4hqzy3PG61IP+aEnG5VAOjC3bhbA==}
+ engines: {node: '>=14'}
+ hasBin: true
+ dependencies:
+ '@types/node': 18.0.1
+ playwright-core: 1.23.1
+ dev: true
- /@prisma/client/[email protected]:
- resolution:
- {
- integrity: sha512-B3C7zQG4HbjJzUr2Zg9UVkBJutbqq9/uqkl1S138+keZCubJrwizx3RuIvGwI+s+pm3qbsyNqXiZgL3Ir0fSng==
- }
- engines: { node: '>=12.6' }
+ /@prisma/client/[email protected]:
+ resolution: {integrity: sha512-ErqtwhX12ubPhU4d++30uFY/rPcyvjk+mdifaZO5SeM21zS3t4jQrscy8+6IyB0GIYshl5ldTq6JSBo1d63i8w==}
+ engines: {node: '>=12.6'}
requiresBuild: true
peerDependencies:
prisma: '*'
@@ -279,541 +416,439 @@ packages:
prisma:
optional: true
dependencies:
- '@prisma/engines-version': 3.11.1-1.1a2506facaf1a4727b7c26850735e88ec779dee9
- prisma: 3.11.1
+ '@prisma/engines-version': 3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e
+ prisma: 3.15.2
dev: false
- /@prisma/engines-version/3.11.1-1.1a2506facaf1a4727b7c26850735e88ec779dee9:
- resolution:
- {
- integrity: sha512-HkcsDniA4iNb/gi0iuyOJNAM7nD/LwQ0uJm15v360O5dee3TM4lWdSQiTYBMK6FF68ACUItmzSur7oYuUZ2zkQ==
- }
+ /@prisma/engines-version/3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e:
+ resolution: {integrity: sha512-e3k2Vd606efd1ZYy2NQKkT4C/pn31nehyLhVug6To/q8JT8FpiMrDy7zmm3KLF0L98NOQQcutaVtAPhzKhzn9w==}
dev: false
- /@prisma/engines/3.11.1-1.1a2506facaf1a4727b7c26850735e88ec779dee9:
- resolution:
- {
- integrity: sha512-MILbsGnvmnhCbFGa2/iSnsyGyazU3afzD7ldjCIeLIGKkNBMSZgA2IvpYsAXl+6qFHKGrS3B2otKfV31dwMSQw==
- }
+ /@prisma/engines/3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e:
+ resolution: {integrity: sha512-NHlojO1DFTsSi3FtEleL9QWXeSF/UjhCW0fgpi7bumnNZ4wj/eQ+BJJ5n2pgoOliTOGv9nX2qXvmHap7rJMNmg==}
requiresBuild: true
- /@rollup/pluginutils/4.1.2:
- resolution:
- {
- integrity: sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==
- }
- engines: { node: '>= 8.0.0' }
+ /@rollup/pluginutils/4.2.1:
+ resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==}
+ engines: {node: '>= 8.0.0'}
dependencies:
estree-walker: 2.0.2
- picomatch: 2.3.0
+ picomatch: 2.3.1
dev: true
- /@sentry/core/6.19.7:
- resolution:
- {
- integrity: sha512-tOfZ/umqB2AcHPGbIrsFLcvApdTm9ggpi/kQZFkej7kMphjT+SGBiQfYtjyg9jcRW+ilAR4JXC9BGKsdEQ+8Vw==
- }
- engines: { node: '>=6' }
- dependencies:
- '@sentry/hub': 6.19.7
- '@sentry/minimal': 6.19.7
- '@sentry/types': 6.19.7
- '@sentry/utils': 6.19.7
- tslib: 1.14.1
- dev: false
-
- /@sentry/hub/6.19.7:
- resolution:
- {
- integrity: sha512-y3OtbYFAqKHCWezF0EGGr5lcyI2KbaXW2Ik7Xp8Mu9TxbSTuwTe4rTntwg8ngPjUQU3SUHzgjqVB8qjiGqFXCA==
- }
- engines: { node: '>=6' }
- dependencies:
- '@sentry/types': 6.19.7
- '@sentry/utils': 6.19.7
- tslib: 1.14.1
- dev: false
-
- /@sentry/minimal/6.19.7:
- resolution:
- {
- integrity: sha512-wcYmSJOdvk6VAPx8IcmZgN08XTXRwRtB1aOLZm+MVHjIZIhHoBGZJYTVQS/BWjldsamj2cX3YGbGXNunaCfYJQ==
- }
- engines: { node: '>=6' }
- dependencies:
- '@sentry/hub': 6.19.7
- '@sentry/types': 6.19.7
- tslib: 1.14.1
+ /@sindresorhus/is/4.6.0:
+ resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==}
+ engines: {node: '>=10'}
dev: false
- /@sentry/node/6.19.7:
- resolution:
- {
- integrity: sha512-gtmRC4dAXKODMpHXKfrkfvyBL3cI8y64vEi3fDD046uqYcrWdgoQsffuBbxMAizc6Ez1ia+f0Flue6p15Qaltg==
- }
- engines: { node: '>=6' }
+ /@sveltejs/adapter-auto/1.0.0-next.53:
+ resolution: {integrity: sha512-LyaeU0rkcymGWvV/3K26AZxqG/+ZQHwa+hrx3xsbmOykjQ2WQPTXRVwmH23zV4A5ABvni76LRMsQOoqWzP3G9Q==}
dependencies:
- '@sentry/core': 6.19.7
- '@sentry/hub': 6.19.7
- '@sentry/types': 6.19.7
- '@sentry/utils': 6.19.7
- cookie: 0.4.2
- https-proxy-agent: 5.0.0
- lru_map: 0.3.3
- tslib: 1.14.1
+ '@sveltejs/adapter-cloudflare': 1.0.0-next.24
+ '@sveltejs/adapter-netlify': 1.0.0-next.66
+ '@sveltejs/adapter-vercel': 1.0.0-next.59
transitivePeerDependencies:
+ - encoding
- supports-color
- dev: false
-
- /@sentry/types/6.19.7:
- resolution:
- {
- integrity: sha512-jH84pDYE+hHIbVnab3Hr+ZXr1v8QABfhx39KknxqKWr2l0oEItzepV0URvbEhB446lk/S/59230dlUUIBGsXbg==
- }
- engines: { node: '>=6' }
- dev: false
+ dev: true
- /@sentry/utils/6.19.7:
- resolution:
- {
- integrity: sha512-z95ECmE3i9pbWoXQrD/7PgkBAzJYR+iXtPuTkpBjDKs86O3mT+PXOT3BAn79w2wkn7/i3vOGD2xVr1uiMl26dA==
- }
- engines: { node: '>=6' }
+ /@sveltejs/adapter-cloudflare/1.0.0-next.24:
+ resolution: {integrity: sha512-g1QSrjWYjM6sfJB+pQn52EIfbVFjpk23GYsj5PLt2Gi3zRNfLRbpkFkPeyAOZbAfT4k/9lUqfLW+pkh+W3yxlg==}
dependencies:
- '@sentry/types': 6.19.7
- tslib: 1.14.1
- dev: false
-
- /@sindresorhus/is/4.6.0:
- resolution:
- {
- integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==
- }
- engines: { node: '>=10' }
- dev: false
+ esbuild: 0.14.48
+ worktop: 0.8.0-next.14
+ dev: true
- /@sveltejs/adapter-node/1.0.0-next.73:
- resolution:
- {
- integrity: sha512-eidd7u1dPHIaBKMjRePrxazUt+Mm/JpnaiKLzZJBdamhBiiYIb+epkPLLqfG5Oo346/0HLKwFRAM/FXn3u3BHQ==
- }
+ /@sveltejs/adapter-netlify/1.0.0-next.66:
+ resolution: {integrity: sha512-UypTRnTd+R1O6SaDdc8l3A3c9/mQF8xLNoVb3Ay5ipb7uPU5WmjVYjfLVGyeVy67gztFfeFC/9Esu4OI2Ayx1A==}
dependencies:
+ '@iarna/toml': 2.2.5
+ esbuild: 0.14.48
+ set-cookie-parser: 2.4.8
tiny-glob: 0.2.9
dev: true
- /@sveltejs/adapter-static/1.0.0-next.31:
- resolution:
- {
- integrity: sha512-d9RNA/de5ljb+gN8mKA3YfmfJoTbYFdH96NYDD8u4Lu9O/ZnseUxOAcAmD4/LKbLXOY/oYhRpt029xT2owyI3Q==
- }
+ /@sveltejs/adapter-static/1.0.0-next.34:
+ resolution: {integrity: sha512-XjuMhemme5z0L/B2nTZpA6k+RJjF+b6L96ts6gIQ6ixiCzJQSbBqJhrrBYBCaeLAKvdUMoGEmX8m862JhKjRFg==}
dependencies:
tiny-glob: 0.2.9
+ dev: false
+
+ /@sveltejs/adapter-vercel/1.0.0-next.59:
+ resolution: {integrity: sha512-1lq5IFLWiLUXmNJVUXjwaInDb07BJg5er43xlMilpFpTA9BZI2hqjYCgtdtk7O6ee5EYJk876b2riM1m+y1M4Q==}
+ dependencies:
+ '@vercel/nft': 0.20.1
+ esbuild: 0.14.48
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
dev: true
- /@sveltejs/kit/[email protected]:
- resolution:
- {
- integrity: sha512-HPMF1oYBfyOG6wfU0Y6F4SID8jphue9yF+PXJqVTDBL5Z2WBG2ogum6MavE8aWhq+g2H6w5y0jNT8+8DO2KTCA==
- }
- engines: { node: '>=16' }
+ resolution: {integrity: sha512-3WH198JhOI9rmDlVSPPHlgg+/R/gS4x5cETjYsIw3XckpN2zExDqlYHUBUwk/dEG/12BfPB3rDMNzdZ0QHtubQ==}
+ engines: {node: '>=16.7'}
hasBin: true
peerDependencies:
svelte: ^3.44.0
+ vite: ^2.9.10
dependencies:
- '@sveltejs/vite-plugin-svelte': [email protected][email protected]
+ '@sveltejs/vite-plugin-svelte': [email protected][email protected]
chokidar: 3.5.3
- sade: 1.7.4
+ sade: 1.8.1
svelte: 3.48.0
- vite: 2.9.1
+ vite: 2.9.13
transitivePeerDependencies:
- diff-match-patch
- - less
- - sass
- - stylus
- supports-color
dev: true
- /@sveltejs/vite-plugin-svelte/[email protected][email protected]:
- resolution:
- {
- integrity: sha512-aj0h2+ZixgT+yoJFIs8dRRw/Cj9tgNu3+hY4CJikpa04mfhR61wXqJFfi2ZEFMUvFda5nCxKYIChFkc6wq5fJA==
- }
- engines: { node: ^14.13.1 || >= 16 }
+ /@sveltejs/vite-plugin-svelte/[email protected][email protected]:
+ resolution: {integrity: sha512-AKh0Ka8EDgidnxWUs8Hh2iZLZovkETkefO99XxZ4sW4WGJ7VFeBx5kH/NIIGlaNHLcrIvK3CK0HkZwC3Cici0A==}
+ engines: {node: ^14.13.1 || >= 16}
peerDependencies:
diff-match-patch: ^1.0.5
svelte: ^3.44.0
- vite: ^2.7.0
+ vite: ^2.9.0
peerDependenciesMeta:
diff-match-patch:
optional: true
dependencies:
- '@rollup/pluginutils': 4.1.2
- debug: 4.3.3
+ '@rollup/pluginutils': 4.2.1
+ debug: 4.3.4
+ deepmerge: 4.2.2
kleur: 4.1.4
- magic-string: 0.25.7
- require-relative: 0.8.7
+ magic-string: 0.26.2
svelte: 3.48.0
- svelte-hmr: [email protected]
- vite: 2.9.1
+ svelte-hmr: [email protected]
+ vite: 2.9.13
transitivePeerDependencies:
- supports-color
dev: true
/@sveltekit-i18n/base/[email protected]:
- resolution:
- {
- integrity: sha512-F8gqG2+KAOeT0o2wYlUrW3TRCX7zaD7rBy/1CEVNw0irfw9TgFf/ODmhubkHHT3+6Zk+SMz8RNgeuffBfAMbJw==
- }
+ resolution: {integrity: sha512-F8gqG2+KAOeT0o2wYlUrW3TRCX7zaD7rBy/1CEVNw0irfw9TgFf/ODmhubkHHT3+6Zk+SMz8RNgeuffBfAMbJw==}
peerDependencies:
svelte: ^3.x
dependencies:
svelte: 3.48.0
optionalDependencies:
'@sveltekit-i18n/parser-default': 1.0.3
- dev: true
+ dev: false
/@sveltekit-i18n/parser-default/1.0.3:
- resolution:
- {
- integrity: sha512-HheveklTjp3hxpYQhoHfyA6B4bQaUeSV5MQf2usIv/58UF2jY/YqhCAWj9bDBjufbuZc5pSz4BXvdX3WVT+viA==
- }
- dev: true
+ resolution: {integrity: sha512-HheveklTjp3hxpYQhoHfyA6B4bQaUeSV5MQf2usIv/58UF2jY/YqhCAWj9bDBjufbuZc5pSz4BXvdX3WVT+viA==}
+ dev: false
/@szmarczak/http-timer/5.0.1:
- resolution:
- {
- integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==
- }
- engines: { node: '>=14.16' }
+ resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==}
+ engines: {node: '>=14.16'}
dependencies:
defer-to-connect: 2.0.1
dev: false
/@tsconfig/node10/1.0.8:
- resolution:
- {
- integrity: sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==
- }
+ resolution: {integrity: sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==}
+ dev: false
/@tsconfig/node12/1.0.9:
- resolution:
- {
- integrity: sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==
- }
+ resolution: {integrity: sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==}
+ dev: false
/@tsconfig/node14/1.0.1:
- resolution:
- {
- integrity: sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==
- }
+ resolution: {integrity: sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==}
+ dev: false
/@tsconfig/node16/1.0.2:
- resolution:
- {
- integrity: sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==
- }
+ resolution: {integrity: sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==}
+ dev: false
/@types/cacheable-request/6.0.2:
- resolution:
- {
- integrity: sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==
- }
+ resolution: {integrity: sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==}
dependencies:
'@types/http-cache-semantics': 4.0.1
- '@types/keyv': 3.1.3
- '@types/node': 17.0.34
+ '@types/keyv': 3.1.4
+ '@types/node': 18.0.3
'@types/responselike': 1.0.0
dev: false
/@types/http-cache-semantics/4.0.1:
- resolution:
- {
- integrity: sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==
- }
+ resolution: {integrity: sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==}
dev: false
/@types/js-cookie/3.0.2:
- resolution:
- {
- integrity: sha512-6+0ekgfusHftJNYpihfkMu8BWdeHs9EOJuGcSofErjstGPfPGEu9yTu4t460lTzzAMl2cM5zngQJqPMHbbnvYA==
- }
+ resolution: {integrity: sha512-6+0ekgfusHftJNYpihfkMu8BWdeHs9EOJuGcSofErjstGPfPGEu9yTu4t460lTzzAMl2cM5zngQJqPMHbbnvYA==}
dev: true
- /@types/js-yaml/4.0.5:
- resolution:
- {
- integrity: sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA==
- }
- dev: true
+ /@types/json-buffer/3.0.0:
+ resolution: {integrity: sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ==}
+ dev: false
- /@types/json-schema/7.0.9:
- resolution:
- {
- integrity: sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==
- }
+ /@types/json-schema/7.0.11:
+ resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==}
dev: true
- /@types/keyv/3.1.3:
- resolution:
- {
- integrity: sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==
- }
+ /@types/keyv/3.1.4:
+ resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
dependencies:
- '@types/node': 17.0.34
+ '@types/node': 18.0.3
dev: false
- /@types/node-forge/1.0.2:
- resolution:
- {
- integrity: sha512-J1OkeZGaW0y9Y7xD49Ja8O82B9l5nZDeoYuGWqIOYPAf9LR+xF23k9ILdzv8dH+2H033fx3D5oiA0GlmicI+sg==
- }
- dependencies:
- '@types/node': 17.0.34
+ /@types/lodash/4.14.182:
+ resolution: {integrity: sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==}
+ dev: false
+
+ /@types/node-os-utils/1.3.0:
+ resolution: {integrity: sha512-XwVteWQx/XkfRPyaGkw8dEbrCAkoRZ73pI3XznUYIpzbCfpQB3UnDlR5TnmdhetlT889tUJGF8QWo9xrgTpsiA==}
+ dev: true
+
+ /@types/node/18.0.1:
+ resolution: {integrity: sha512-CmR8+Tsy95hhwtZBKJBs0/FFq4XX7sDZHlGGf+0q+BRZfMbOTkzkj0AFAuTyXbObDIoanaBBW0+KEW+m3N16Wg==}
dev: true
- /@types/node/17.0.34:
- resolution:
- {
- integrity: sha512-XImEz7XwTvDBtzlTnm8YvMqGW/ErMWBsKZ+hMTvnDIjGCKxwK5Xpc+c/oQjOauwq8M4OS11hEkpjX8rrI/eEgA==
- }
+ /@types/node/18.0.3:
+ resolution: {integrity: sha512-HzNRZtp4eepNitP+BD6k2L6DROIDG4Q0fm4x+dwfsr6LGmROENnok75VGw40628xf+iR24WeMFcHuuBDUAzzsQ==}
+
+ /@types/normalize-package-data/2.4.1:
+ resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
+ dev: false
- /@types/pug/2.0.5:
- resolution:
- {
- integrity: sha512-LOnASQoeNZMkzexRuyqcBBDZ6rS+rQxUMkmj5A0PkhhiSZivLIuz6Hxyr1mkGoEZEkk66faROmpMi4fFkrKsBA==
- }
+ /@types/pug/2.0.6:
+ resolution: {integrity: sha512-SnHmG9wN1UVmagJOnyo/qkk0Z7gejYxOYYmaAwr5u2yFYfsupN3sg10kyzN8Hep/2zbHxCnsumxOoRIRMBwKCg==}
dev: true
/@types/responselike/1.0.0:
- resolution:
- {
- integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==
- }
+ resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==}
dependencies:
- '@types/node': 17.0.34
+ '@types/node': 18.0.3
dev: false
- /@types/sass/1.16.1:
- resolution:
- {
- integrity: sha512-iZUcRrGuz/Tbg3loODpW7vrQJkUtpY2fFSf4ELqqkApcS2TkZ1msk7ie8iZPB86lDOP8QOTTmuvWjc5S0R9OjQ==
- }
+ /@types/sass/1.43.1:
+ resolution: {integrity: sha512-BPdoIt1lfJ6B7rw35ncdwBZrAssjcwzI5LByIrYs+tpXlj/CAkuVdRsgZDdP4lq5EjyWzwxZCqAoFyHKFwp32g==}
dependencies:
- '@types/node': 17.0.34
+ '@types/node': 18.0.1
dev: true
- /@typescript-eslint/eslint-plugin/4.31.1_lii63oz3usekbu5ehvrcuwn5jy:
- resolution:
- {
- integrity: sha512-UDqhWmd5i0TvPLmbK5xY3UZB0zEGseF+DHPghZ37Sb83Qd3p8ujhvAtkU4OF46Ka5Pm5kWvFIx0cCTBFKo0alA==
- }
- engines: { node: ^10.12.0 || >=12.0.0 }
+ /@typescript-eslint/eslint-plugin/5.30.5_6zdoc3rn4mpiddqwhppni2mnnm:
+ resolution: {integrity: sha512-lftkqRoBvc28VFXEoRgyZuztyVUQ04JvUnATSPtIRFAccbXTWL6DEtXGYMcbg998kXw1NLUJm7rTQ9eUt+q6Ig==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
- '@typescript-eslint/parser': ^4.0.0
- eslint: ^5.0.0 || ^6.0.0 || ^7.0.0
+ '@typescript-eslint/parser': ^5.0.0
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
- '@typescript-eslint/experimental-utils': 4.31.1_e4zyhrvfnqudwdx5bevnvkluy4
- '@typescript-eslint/parser': 4.31.1_e4zyhrvfnqudwdx5bevnvkluy4
- '@typescript-eslint/scope-manager': 4.31.1
- debug: 4.3.3
- eslint: 7.32.0
+ '@typescript-eslint/parser': 5.30.5_4x5o4skxv6sl53vpwefgt23khm
+ '@typescript-eslint/scope-manager': 5.30.5
+ '@typescript-eslint/type-utils': 5.30.5_4x5o4skxv6sl53vpwefgt23khm
+ '@typescript-eslint/utils': 5.30.5_4x5o4skxv6sl53vpwefgt23khm
+ debug: 4.3.4
+ eslint: 8.19.0
functional-red-black-tree: 1.0.1
+ ignore: 5.2.0
regexpp: 3.2.0
- semver: 7.3.5
- typescript: 4.6.4
+ semver: 7.3.7
+ typescript: 4.7.4
transitivePeerDependencies:
- supports-color
dev: true
- /@typescript-eslint/experimental-utils/4.31.1_e4zyhrvfnqudwdx5bevnvkluy4:
- resolution:
- {
- integrity: sha512-NtoPsqmcSsWty0mcL5nTZXMf7Ei0Xr2MT8jWjXMVgRK0/1qeQ2jZzLFUh4QtyJ4+/lPUyMw5cSfeeME+Zrtp9Q==
- }
- engines: { node: ^10.12.0 || >=12.0.0 }
+ /@typescript-eslint/parser/5.30.5_4x5o4skxv6sl53vpwefgt23khm:
+ resolution: {integrity: sha512-zj251pcPXI8GO9NDKWWmygP6+UjwWmrdf9qMW/L/uQJBM/0XbU2inxe5io/234y/RCvwpKEYjZ6c1YrXERkK4Q==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
- eslint: '*'
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
dependencies:
- '@types/json-schema': 7.0.9
- '@typescript-eslint/scope-manager': 4.31.1
- '@typescript-eslint/types': 4.31.1
- '@typescript-eslint/typescript-estree': [email protected]
- eslint: 7.32.0
- eslint-scope: 5.1.1
- eslint-utils: [email protected]
+ '@typescript-eslint/scope-manager': 5.30.5
+ '@typescript-eslint/types': 5.30.5
+ '@typescript-eslint/typescript-estree': [email protected]
+ debug: 4.3.4
+ eslint: 8.19.0
+ typescript: 4.7.4
transitivePeerDependencies:
- supports-color
- - typescript
dev: true
- /@typescript-eslint/parser/4.31.1_e4zyhrvfnqudwdx5bevnvkluy4:
- resolution:
- {
- integrity: sha512-dnVZDB6FhpIby6yVbHkwTKkn2ypjVIfAR9nh+kYsA/ZL0JlTsd22BiDjouotisY3Irmd3OW1qlk9EI5R8GrvRQ==
- }
- engines: { node: ^10.12.0 || >=12.0.0 }
+ /@typescript-eslint/scope-manager/5.30.5:
+ resolution: {integrity: sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ '@typescript-eslint/types': 5.30.5
+ '@typescript-eslint/visitor-keys': 5.30.5
+ dev: true
+
+ /@typescript-eslint/type-utils/5.30.5_4x5o4skxv6sl53vpwefgt23khm:
+ resolution: {integrity: sha512-k9+ejlv1GgwN1nN7XjVtyCgE0BTzhzT1YsQF0rv4Vfj2U9xnslBgMYYvcEYAFVdvhuEscELJsB7lDkN7WusErw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
- eslint: ^5.0.0 || ^6.0.0 || ^7.0.0
+ eslint: '*'
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
- '@typescript-eslint/scope-manager': 4.31.1
- '@typescript-eslint/types': 4.31.1
- '@typescript-eslint/typescript-estree': [email protected]
- debug: 4.3.3
- eslint: 7.32.0
- typescript: 4.6.4
+ '@typescript-eslint/utils': 5.30.5_4x5o4skxv6sl53vpwefgt23khm
+ debug: 4.3.4
+ eslint: 8.19.0
+ typescript: 4.7.4
transitivePeerDependencies:
- supports-color
dev: true
- /@typescript-eslint/scope-manager/4.31.1:
- resolution:
- {
- integrity: sha512-N1Uhn6SqNtU2XpFSkD4oA+F0PfKdWHyr4bTX0xTj8NRx1314gBDRL1LUuZd5+L3oP+wo6hCbZpaa1in6SwMcVQ==
- }
- engines: { node: ^8.10.0 || ^10.13.0 || >=11.10.1 }
- dependencies:
- '@typescript-eslint/types': 4.31.1
- '@typescript-eslint/visitor-keys': 4.31.1
- dev: true
-
- /@typescript-eslint/types/4.31.1:
- resolution:
- {
- integrity: sha512-kixltt51ZJGKENNW88IY5MYqTBA8FR0Md8QdGbJD2pKZ+D5IvxjTYDNtJPDxFBiXmka2aJsITdB1BtO1fsgmsQ==
- }
- engines: { node: ^8.10.0 || ^10.13.0 || >=11.10.1 }
+ /@typescript-eslint/types/5.30.5:
+ resolution: {integrity: sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
- /@typescript-eslint/typescript-estree/[email protected]:
- resolution:
- {
- integrity: sha512-EGHkbsUvjFrvRnusk6yFGqrqMBTue5E5ROnS5puj3laGQPasVUgwhrxfcgkdHNFECHAewpvELE1Gjv0XO3mdWg==
- }
- engines: { node: ^10.12.0 || >=12.0.0 }
+ /@typescript-eslint/typescript-estree/[email protected]:
+ resolution: {integrity: sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
- '@typescript-eslint/types': 4.31.1
- '@typescript-eslint/visitor-keys': 4.31.1
- debug: 4.3.3
- globby: 11.0.4
+ '@typescript-eslint/types': 5.30.5
+ '@typescript-eslint/visitor-keys': 5.30.5
+ debug: 4.3.4
+ globby: 11.1.0
is-glob: 4.0.3
- semver: 7.3.5
- typescript: 4.6.4
+ semver: 7.3.7
+ typescript: 4.7.4
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /@typescript-eslint/utils/5.30.5_4x5o4skxv6sl53vpwefgt23khm:
+ resolution: {integrity: sha512-o4SSUH9IkuA7AYIfAvatldovurqTAHrfzPApOZvdUq01hHojZojCFXx06D/aFpKCgWbMPRdJBWAC3sWp3itwTA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ dependencies:
+ '@types/json-schema': 7.0.11
+ '@typescript-eslint/scope-manager': 5.30.5
+ '@typescript-eslint/types': 5.30.5
+ '@typescript-eslint/typescript-estree': [email protected]
+ eslint: 8.19.0
+ eslint-scope: 5.1.1
+ eslint-utils: [email protected]
transitivePeerDependencies:
- supports-color
+ - typescript
dev: true
- /@typescript-eslint/visitor-keys/4.31.1:
- resolution:
- {
- integrity: sha512-PCncP8hEqKw6SOJY+3St4LVtoZpPPn+Zlpm7KW5xnviMhdqcsBty4Lsg4J/VECpJjw1CkROaZhH4B8M1OfnXTQ==
- }
- engines: { node: ^8.10.0 || ^10.13.0 || >=11.10.1 }
+ /@typescript-eslint/visitor-keys/5.30.5:
+ resolution: {integrity: sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
- '@typescript-eslint/types': 4.31.1
- eslint-visitor-keys: 2.1.0
+ '@typescript-eslint/types': 5.30.5
+ eslint-visitor-keys: 3.3.0
dev: true
- /@zerodevx/svelte-toast/0.7.1:
- resolution:
- {
- integrity: sha512-JxyjPlpc3IzwyHLGbU5pDPW68HM1o7FjiSWmm9SIig7NuuBFIqoJkVt9CYr6toAXzi5sLBgu27hT1NntKbKcmA==
- }
+ /@vercel/nft/0.20.1:
+ resolution: {integrity: sha512-hSLcr64KHOkcNiTAlv154K4p4faEFBwYIi2eIgu1QCDhB1qyQYvFuEhtw3eaapNjA4/7x/2jcclfCAjILua/ag==}
+ hasBin: true
+ dependencies:
+ '@mapbox/node-pre-gyp': 1.0.9
+ acorn: 8.7.1
+ bindings: 1.5.0
+ estree-walker: 2.0.2
+ glob: 7.2.3
+ graceful-fs: 4.2.10
+ micromatch: 4.0.5
+ node-gyp-build: 4.4.0
+ resolve-from: 5.0.0
+ rollup-pluginutils: 2.8.2
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+ dev: true
+
+ /@zerodevx/svelte-toast/0.7.2:
+ resolution: {integrity: sha512-vWiY6IqsstcOoQ8PFBuFuxgPkj1JFAGhUF9gC7wLx7c5A9SSfdtxWs/39ekGSIeyJK0yqWhTcmzGrCEWSELzDw==}
+ dev: false
+
+ /abbrev/1.1.1:
+ resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
dev: true
- /acorn-jsx/[email protected]:
- resolution:
- {
- integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
- }
+ /abort-controller/3.0.0:
+ resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
+ engines: {node: '>=6.5'}
+ dependencies:
+ event-target-shim: 5.0.1
+ dev: false
+
+ /abstract-logging/2.0.1:
+ resolution: {integrity: sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==}
+ dev: false
+
+ /acorn-jsx/[email protected]:
+ resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
peerDependencies:
acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
- acorn: 7.4.1
+ acorn: 8.7.1
dev: true
/acorn-node/1.8.2:
- resolution:
- {
- integrity: sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==
- }
+ resolution: {integrity: sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==}
dependencies:
acorn: 7.4.1
acorn-walk: 7.2.0
xtend: 4.0.2
+ dev: true
/acorn-walk/7.2.0:
- resolution:
- {
- integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==
- }
- engines: { node: '>=0.4.0' }
+ resolution: {integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==}
+ engines: {node: '>=0.4.0'}
+ dev: true
/acorn-walk/8.2.0:
- resolution:
- {
- integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==
- }
- engines: { node: '>=0.4.0' }
+ resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
+ engines: {node: '>=0.4.0'}
+ dev: false
/acorn/7.4.1:
- resolution:
- {
- integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==
- }
- engines: { node: '>=0.4.0' }
+ resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==}
+ engines: {node: '>=0.4.0'}
hasBin: true
+ dev: true
- /acorn/8.5.0:
- resolution:
- {
- integrity: sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==
- }
- engines: { node: '>=0.4.0' }
+ /acorn/8.7.1:
+ resolution: {integrity: sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==}
+ engines: {node: '>=0.4.0'}
hasBin: true
/agent-base/6.0.2:
- resolution:
- {
- integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==
- }
- engines: { node: '>= 6.0.0' }
+ resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
+ engines: {node: '>= 6.0.0'}
dependencies:
- debug: 4.3.3
+ debug: 4.3.4
transitivePeerDependencies:
- supports-color
- dev: false
+ dev: true
- /aggregate-error/3.1.0:
- resolution:
- {
- integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==
- }
- engines: { node: '>=8' }
+ /ajv-formats/2.1.1:
+ resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==}
+ peerDependenciesMeta:
+ ajv:
+ optional: true
dependencies:
- clean-stack: 2.2.0
- indent-string: 4.0.0
- dev: true
+ ajv: 8.11.0
+ dev: false
/ajv/6.12.6:
- resolution:
- {
- integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
- }
+ resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
dependencies:
fast-deep-equal: 3.1.3
fast-json-stable-stringify: 2.1.0
@@ -821,183 +856,184 @@ packages:
uri-js: 4.4.1
dev: true
- /ajv/8.6.3:
- resolution:
- {
- integrity: sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==
- }
+ /ajv/8.11.0:
+ resolution: {integrity: sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==}
dependencies:
fast-deep-equal: 3.1.3
json-schema-traverse: 1.0.0
require-from-string: 2.0.2
uri-js: 4.4.1
- dev: true
-
- /ansi-colors/4.1.1:
- resolution:
- {
- integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
- }
- engines: { node: '>=6' }
- dev: true
+ dev: false
- /ansi-escapes/4.3.2:
- resolution:
- {
- integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==
- }
- engines: { node: '>=8' }
- dependencies:
- type-fest: 0.21.3
- dev: true
+ /ansi-colors/4.1.3:
+ resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==}
+ engines: {node: '>=6'}
+ dev: false
/ansi-regex/2.1.1:
- resolution: { integrity: sha1-w7M6te42DYbg5ijwRorn7yfWVN8= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==}
+ engines: {node: '>=0.10.0'}
dev: true
/ansi-regex/5.0.1:
- resolution:
- {
- integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
+ engines: {node: '>=8'}
dev: true
/ansi-regex/6.0.1:
- resolution:
- {
- integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==
- }
- engines: { node: '>=12' }
- dev: true
+ resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==}
+ engines: {node: '>=12'}
+ dev: false
/ansi-styles/2.2.1:
- resolution: { integrity: sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==}
+ engines: {node: '>=0.10.0'}
dev: true
/ansi-styles/3.2.1:
- resolution:
- {
- integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
- }
- engines: { node: '>=4' }
+ resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
+ engines: {node: '>=4'}
dependencies:
color-convert: 1.9.3
- dev: true
/ansi-styles/4.3.0:
- resolution:
- {
- integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
+ engines: {node: '>=8'}
dependencies:
color-convert: 2.0.1
dev: true
- /ansi-styles/6.1.0:
- resolution:
- {
- integrity: sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==
- }
- engines: { node: '>=12' }
- dev: true
-
/anymatch/3.1.2:
- resolution:
- {
- integrity: sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
- }
- engines: { node: '>= 8' }
+ resolution: {integrity: sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==}
+ engines: {node: '>= 8'}
dependencies:
normalize-path: 3.0.0
- picomatch: 2.3.0
+ picomatch: 2.3.1
+ dev: true
- /arg/4.1.3:
- resolution:
- {
- integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
- }
+ /aproba/2.0.0:
+ resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==}
+ dev: true
- /arg/5.0.1:
- resolution:
- {
- integrity: sha512-e0hDa9H2Z9AwFkk2qDlwhoMYE4eToKarchkQHovNdLTCYMHZHeRjI71crOh+dio4K6u1IcwubQqo79Ga4CyAQA==
- }
+ /archy/1.0.0:
+ resolution: {integrity: sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==}
+ dev: false
- /argparse/1.0.10:
- resolution:
- {
- integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
- }
+ /are-we-there-yet/2.0.0:
+ resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==}
+ engines: {node: '>=10'}
dependencies:
- sprintf-js: 1.0.3
+ delegates: 1.0.0
+ readable-stream: 3.6.0
dev: true
- /argparse/2.0.1:
- resolution:
- {
- integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
- }
+ /arg/4.1.3:
+ resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
dev: false
+ /arg/5.0.2:
+ resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}
+ dev: true
+
+ /argparse/2.0.1:
+ resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
+
/array-union/2.1.0:
- resolution:
- {
- integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
+ engines: {node: '>=8'}
dev: true
- /asn1/0.2.4:
- resolution:
- {
- integrity: sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==
- }
+ /asap/2.0.6:
+ resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==}
+ dev: false
+
+ /asn1.js/5.4.1:
+ resolution: {integrity: sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==}
dependencies:
+ bn.js: 4.12.0
+ inherits: 2.0.4
+ minimalistic-assert: 1.0.1
safer-buffer: 2.1.2
dev: false
- /astral-regex/2.0.0:
- resolution:
- {
- integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==
- }
- engines: { node: '>=8' }
- dev: true
+ /asn1/0.2.6:
+ resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==}
+ dependencies:
+ safer-buffer: 2.1.2
+ dev: false
+
+ /asynckit/0.4.0:
+ resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
+ dev: false
+
+ /atomic-sleep/1.0.0:
+ resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==}
+ engines: {node: '>=8.0.0'}
+ dev: false
/auto-parse/1.8.0:
- resolution:
- {
- integrity: sha512-Uri4uC+K5cSi5hjM4snFrqPrjqUpwxeSW5EMTPvN7Ju3PlDzmXXDr5tjdzxPvvwgT3J7bmMDJ3Rm625nbrc72A==
- }
+ resolution: {integrity: sha512-Uri4uC+K5cSi5hjM4snFrqPrjqUpwxeSW5EMTPvN7Ju3PlDzmXXDr5tjdzxPvvwgT3J7bmMDJ3Rm625nbrc72A==}
dependencies:
typpy: 2.3.11
dev: false
- /autoprefixer/[email protected]:
- resolution:
- {
- integrity: sha512-ypHju4Y2Oav95SipEcCcI5J7CGPuvz8oat7sUtYj3ClK44bldfvtvcxK6IEK++7rqB7YchDGzweZIBG+SD0ZAA==
- }
- engines: { node: ^10 || ^12 || >=14 }
+ /autoprefixer/[email protected]:
+ resolution: {integrity: sha512-ypHju4Y2Oav95SipEcCcI5J7CGPuvz8oat7sUtYj3ClK44bldfvtvcxK6IEK++7rqB7YchDGzweZIBG+SD0ZAA==}
+ engines: {node: ^10 || ^12 || >=14}
hasBin: true
peerDependencies:
postcss: ^8.1.0
dependencies:
browserslist: 4.20.3
- caniuse-lite: 1.0.30001338
+ caniuse-lite: 1.0.30001343
fraction.js: 4.2.0
normalize-range: 0.1.2
picocolors: 1.0.0
- postcss: 8.4.13
+ postcss: 8.4.14
postcss-value-parser: 4.2.0
dev: true
+ /avvio/8.1.3:
+ resolution: {integrity: sha512-tl9TC0yDRKzP6gFLkrInqPyx8AkfBC/0QRnwkE9Jo31+OJjLrE/73GJuE0QgSB0Vpv38CTJJZGqU9hczowclWw==}
+ dependencies:
+ archy: 1.0.0
+ debug: 4.3.4
+ fastq: 1.13.0
+ queue-microtask: 1.2.3
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /axe/8.1.2:
+ resolution: {integrity: sha512-6DuhuYO6Pq482M/7Xt8/cxfxarX9EyOn0jHt1MWPmUrAOdW2SnrqHQfRmZycos4lfmACdXKC6I6uQu5+nsT+rQ==}
+ engines: {node: '>=7.0.0'}
+ dependencies:
+ '@ladjs/format-util': 1.0.4
+ boolean: 3.2.0
+ console-polyfill: 0.3.0
+ cuid: 2.1.8
+ fast-safe-stringify: 2.1.1
+ format-specifiers: 1.0.0
+ iserror: 0.0.2
+ lodash.omit: 4.5.0
+ parse-app-info: 4.0.3
+ parse-err: 0.0.12
+ superagent: 7.1.3
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /axios/0.27.2:
+ resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==}
+ dependencies:
+ follow-redirects: 1.15.0
+ form-data: 4.0.0
+ transitivePeerDependencies:
+ - debug
+ dev: false
+
/babel-code-frame/6.26.0:
- resolution: { integrity: sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= }
+ resolution: {integrity: sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==}
dependencies:
chalk: 1.1.3
esutils: 2.0.3
@@ -1005,10 +1041,7 @@ packages:
dev: true
/babel-core/6.26.3:
- resolution:
- {
- integrity: sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==
- }
+ resolution: {integrity: sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==}
dependencies:
babel-code-frame: 6.26.0
babel-generator: 6.26.1
@@ -1024,7 +1057,7 @@ packages:
debug: 2.6.9
json5: 0.5.1
lodash: 4.17.21
- minimatch: 3.0.4
+ minimatch: 3.1.2
path-is-absolute: 1.0.1
private: 0.1.8
slash: 1.0.0
@@ -1034,10 +1067,7 @@ packages:
dev: true
/babel-generator/6.26.1:
- resolution:
- {
- integrity: sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==
- }
+ resolution: {integrity: sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==}
dependencies:
babel-messages: 6.23.0
babel-runtime: 6.26.0
@@ -1050,7 +1080,7 @@ packages:
dev: true
/babel-helper-bindify-decorators/6.24.1:
- resolution: { integrity: sha1-FMGeXxQte0fxmlJDHlKxzLxAozA= }
+ resolution: {integrity: sha512-TYX2QQATKA6Wssp6j7jqlw4QLmABDN1olRdEHndYvBXdaXM5dcx6j5rN0+nd+aVL+Th40fAEYvvw/Xxd/LETuQ==}
dependencies:
babel-runtime: 6.26.0
babel-traverse: 6.26.0
@@ -1060,7 +1090,7 @@ packages:
dev: true
/babel-helper-builder-binary-assignment-operator-visitor/6.24.1:
- resolution: { integrity: sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= }
+ resolution: {integrity: sha512-gCtfYORSG1fUMX4kKraymq607FWgMWg+j42IFPc18kFQEsmtaibP4UrqsXt8FlEJle25HUd4tsoDR7H2wDhe9Q==}
dependencies:
babel-helper-explode-assignable-expression: 6.24.1
babel-runtime: 6.26.0
@@ -1070,7 +1100,7 @@ packages:
dev: true
/babel-helper-call-delegate/6.24.1:
- resolution: { integrity: sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= }
+ resolution: {integrity: sha512-RL8n2NiEj+kKztlrVJM9JT1cXzzAdvWFh76xh/H1I4nKwunzE4INBXn8ieCZ+wh4zWszZk7NBS1s/8HR5jDkzQ==}
dependencies:
babel-helper-hoist-variables: 6.24.1
babel-runtime: 6.26.0
@@ -1081,7 +1111,7 @@ packages:
dev: true
/babel-helper-define-map/6.26.0:
- resolution: { integrity: sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= }
+ resolution: {integrity: sha512-bHkmjcC9lM1kmZcVpA5t2om2nzT/xiZpo6TJq7UlZ3wqKfzia4veeXbIhKvJXAMzhhEBd3cR1IElL5AenWEUpA==}
dependencies:
babel-helper-function-name: 6.24.1
babel-runtime: 6.26.0
@@ -1092,7 +1122,7 @@ packages:
dev: true
/babel-helper-explode-assignable-expression/6.24.1:
- resolution: { integrity: sha1-8luCz33BBDPFX3BZLVdGQArCLKo= }
+ resolution: {integrity: sha512-qe5csbhbvq6ccry9G7tkXbzNtcDiH4r51rrPUbwwoTzZ18AqxWYRZT6AOmxrpxKnQBW0pYlBI/8vh73Z//78nQ==}
dependencies:
babel-runtime: 6.26.0
babel-traverse: 6.26.0
@@ -1102,7 +1132,7 @@ packages:
dev: true
/babel-helper-explode-class/6.24.1:
- resolution: { integrity: sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes= }
+ resolution: {integrity: sha512-SFbWewr0/0U4AiRzsHqwsbOQeLXVa9T1ELdqEa2efcQB5KopTnunAqoj07TuHlN2lfTQNPGO/rJR4FMln5fVcA==}
dependencies:
babel-helper-bindify-decorators: 6.24.1
babel-runtime: 6.26.0
@@ -1113,7 +1143,7 @@ packages:
dev: true
/babel-helper-function-name/6.24.1:
- resolution: { integrity: sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= }
+ resolution: {integrity: sha512-Oo6+e2iX+o9eVvJ9Y5eKL5iryeRdsIkwRYheCuhYdVHsdEQysbc2z2QkqCLIYnNxkT5Ss3ggrHdXiDI7Dhrn4Q==}
dependencies:
babel-helper-get-function-arity: 6.24.1
babel-runtime: 6.26.0
@@ -1125,28 +1155,28 @@ packages:
dev: true
/babel-helper-get-function-arity/6.24.1:
- resolution: { integrity: sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= }
+ resolution: {integrity: sha512-WfgKFX6swFB1jS2vo+DwivRN4NB8XUdM3ij0Y1gnC21y1tdBoe6xjVnd7NSI6alv+gZXCtJqvrTeMW3fR/c0ng==}
dependencies:
babel-runtime: 6.26.0
babel-types: 6.26.0
dev: true
/babel-helper-hoist-variables/6.24.1:
- resolution: { integrity: sha1-HssnaJydJVE+rbyZFKc/VAi+enY= }
+ resolution: {integrity: sha512-zAYl3tqerLItvG5cKYw7f1SpvIxS9zi7ohyGHaI9cgDUjAT6YcY9jIEH5CstetP5wHIVSceXwNS7Z5BpJg+rOw==}
dependencies:
babel-runtime: 6.26.0
babel-types: 6.26.0
dev: true
/babel-helper-optimise-call-expression/6.24.1:
- resolution: { integrity: sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= }
+ resolution: {integrity: sha512-Op9IhEaxhbRT8MDXx2iNuMgciu2V8lDvYCNQbDGjdBNCjaMvyLf4wl4A3b8IgndCyQF8TwfgsQ8T3VD8aX1/pA==}
dependencies:
babel-runtime: 6.26.0
babel-types: 6.26.0
dev: true
/babel-helper-regex/6.26.0:
- resolution: { integrity: sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= }
+ resolution: {integrity: sha512-VlPiWmqmGJp0x0oK27Out1D+71nVVCTSdlbhIVoaBAj2lUgrNjBCRR9+llO4lTSb2O4r7PJg+RobRkhBrf6ofg==}
dependencies:
babel-runtime: 6.26.0
babel-types: 6.26.0
@@ -1154,7 +1184,7 @@ packages:
dev: true
/babel-helper-remap-async-to-generator/6.24.1:
- resolution: { integrity: sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= }
+ resolution: {integrity: sha512-RYqaPD0mQyQIFRu7Ho5wE2yvA/5jxqCIj/Lv4BXNq23mHYu/vxikOy2JueLiBxQknwapwrJeNCesvY0ZcfnlHg==}
dependencies:
babel-helper-function-name: 6.24.1
babel-runtime: 6.26.0
@@ -1166,7 +1196,7 @@ packages:
dev: true
/babel-helper-replace-supers/6.24.1:
- resolution: { integrity: sha1-v22/5Dk40XNpohPKiov3S2qQqxo= }
+ resolution: {integrity: sha512-sLI+u7sXJh6+ToqDr57Bv973kCepItDhMou0xCP2YPVmR1jkHSCY+p1no8xErbV1Siz5QE8qKT1WIwybSWlqjw==}
dependencies:
babel-helper-optimise-call-expression: 6.24.1
babel-messages: 6.23.0
@@ -1179,7 +1209,7 @@ packages:
dev: true
/babel-helpers/6.24.1:
- resolution: { integrity: sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= }
+ resolution: {integrity: sha512-n7pFrqQm44TCYvrCDb0MqabAF+JUBq+ijBvNMUxpkLjJaAu32faIexewMumrH5KLLJ1HDyT0PTEqRyAe/GwwuQ==}
dependencies:
babel-runtime: 6.26.0
babel-template: 6.26.0
@@ -1188,67 +1218,67 @@ packages:
dev: true
/babel-messages/6.23.0:
- resolution: { integrity: sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= }
+ resolution: {integrity: sha512-Bl3ZiA+LjqaMtNYopA9TYE9HP1tQ+E5dLxE0XrAzcIJeK2UqF0/EaqXwBn9esd4UmTfEab+P+UYQ1GnioFIb/w==}
dependencies:
babel-runtime: 6.26.0
dev: true
/babel-plugin-check-es2015-constants/6.22.0:
- resolution: { integrity: sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= }
+ resolution: {integrity: sha512-B1M5KBP29248dViEo1owyY32lk1ZSH2DaNNrXLGt8lyjjHm7pBqAdQ7VKUPR6EEDO323+OvT3MQXbCin8ooWdA==}
dependencies:
babel-runtime: 6.26.0
dev: true
/babel-plugin-syntax-async-functions/6.13.0:
- resolution: { integrity: sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= }
+ resolution: {integrity: sha512-4Zp4unmHgw30A1eWI5EpACji2qMocisdXhAftfhXoSV9j0Tvj6nRFE3tOmRY912E0FMRm/L5xWE7MGVT2FoLnw==}
dev: true
/babel-plugin-syntax-async-generators/6.13.0:
- resolution: { integrity: sha1-a8lj67FuzLrmuStZbrfzXDQqi5o= }
+ resolution: {integrity: sha512-EbciFN5Jb9iqU9bqaLmmFLx2G8pAUsvpWJ6OzOWBNrSY9qTohXj+7YfZx6Ug1Qqh7tCb1EA7Jvn9bMC1HBiucg==}
dev: true
/babel-plugin-syntax-class-constructor-call/6.18.0:
- resolution: { integrity: sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY= }
+ resolution: {integrity: sha512-EEuBcXz/wZ81Jaac0LnMHtD4Mfz9XWn2oH2Xj+CHwz2SZWUqqdtR2BgWPSdTGMmxN/5KLSh4PImt9+9ZedDarA==}
dev: true
/babel-plugin-syntax-class-properties/6.13.0:
- resolution: { integrity: sha1-1+sjt5oxf4VDlixQW4J8fWysJ94= }
+ resolution: {integrity: sha512-chI3Rt9T1AbrQD1s+vxw3KcwC9yHtF621/MacuItITfZX344uhQoANjpoSJZleAmW2tjlolqB/f+h7jIqXa7pA==}
dev: true
/babel-plugin-syntax-decorators/6.13.0:
- resolution: { integrity: sha1-MSVjtNvePMgGzuPkFszurd0RrAs= }
+ resolution: {integrity: sha512-AWj19x2aDm8qFQ5O2JcD6pwJDW1YdcnO+1b81t7gxrGjz5VHiUqeYWAR4h7zueWMalRelrQDXprv2FrY1dbpbw==}
dev: true
/babel-plugin-syntax-do-expressions/6.13.0:
- resolution: { integrity: sha1-V0d1YTmqJtOQ0JQQsDdEugfkeW0= }
+ resolution: {integrity: sha512-HD/5qJB9oSXzl0caxM+aRD7ENICXqcc3Up/8toDQk7zNIDE7TzsqtxC5f4t9Rwhu2Ya8l9l4j6b3vOsy+a6qxg==}
dev: true
/babel-plugin-syntax-dynamic-import/6.18.0:
- resolution: { integrity: sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo= }
+ resolution: {integrity: sha512-MioUE+LfjCEz65Wf7Z/Rm4XCP5k2c+TbMd2Z2JKc7U9uwjBhAfNPE48KC4GTGKhppMeYVepwDBNO/nGY6NYHBA==}
dev: true
/babel-plugin-syntax-exponentiation-operator/6.13.0:
- resolution: { integrity: sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= }
+ resolution: {integrity: sha512-Z/flU+T9ta0aIEKl1tGEmN/pZiI1uXmCiGFRegKacQfEJzp7iNsKloZmyJlQr+75FCJtiFfGIK03SiCvCt9cPQ==}
dev: true
/babel-plugin-syntax-export-extensions/6.13.0:
- resolution: { integrity: sha1-cKFITw+QiaToStRLrDU8lbmxJyE= }
+ resolution: {integrity: sha512-Eo0rcRaIDMld/W6mVhePiudIuLW+Cr/8eveW3mBREfZORScZgx4rh6BAPyvzdEc/JZvQ+LkC80t0VGFs6FX+lg==}
dev: true
/babel-plugin-syntax-function-bind/6.13.0:
- resolution: { integrity: sha1-SMSV8Xe98xqYHnMvVa3AvdJgH0Y= }
+ resolution: {integrity: sha512-m8yMoh9LIiNyeLdQs5I9G+3YXo4nqVsKQkk7YplrG4qAFbNi9hkZlow8HDHxhH9QOVFPHmy8+03NzRCdyChIKw==}
dev: true
/babel-plugin-syntax-object-rest-spread/6.13.0:
- resolution: { integrity: sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= }
+ resolution: {integrity: sha512-C4Aq+GaAj83pRQ0EFgTvw5YO6T3Qz2KGrNRwIj9mSoNHVvdZY4KO2uA6HNtNXCw993iSZnckY1aLW8nOi8i4+w==}
dev: true
/babel-plugin-syntax-trailing-function-commas/6.22.0:
- resolution: { integrity: sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= }
+ resolution: {integrity: sha512-Gx9CH3Q/3GKbhs07Bszw5fPTlU+ygrOGfAhEt7W2JICwufpC4SuO0mG0+4NykPBSYPMJhqvVlDBU17qB1D+hMQ==}
dev: true
/babel-plugin-transform-async-generator-functions/6.24.1:
- resolution: { integrity: sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds= }
+ resolution: {integrity: sha512-uT7eovUxtXe8Q2ufcjRuJIOL0hg6VAUJhiWJBLxH/evYAw+aqoJLcYTR8hqx13iOx/FfbCMHgBmXWZjukbkyPg==}
dependencies:
babel-helper-remap-async-to-generator: 6.24.1
babel-plugin-syntax-async-generators: 6.13.0
@@ -1258,7 +1288,7 @@ packages:
dev: true
/babel-plugin-transform-async-to-generator/6.24.1:
- resolution: { integrity: sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= }
+ resolution: {integrity: sha512-7BgYJujNCg0Ti3x0c/DL3tStvnKS6ktIYOmo9wginv/dfZOrbSZ+qG4IRRHMBOzZ5Awb1skTiAsQXg/+IWkZYw==}
dependencies:
babel-helper-remap-async-to-generator: 6.24.1
babel-plugin-syntax-async-functions: 6.13.0
@@ -1268,7 +1298,7 @@ packages:
dev: true
/babel-plugin-transform-class-constructor-call/6.24.1:
- resolution: { integrity: sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk= }
+ resolution: {integrity: sha512-RvYukT1Nh7njz8P8326ztpQUGCKwmjgu6aRIx1lkvylWITYcskg29vy1Kp8WXIq7FvhXsz0Crf2kS94bjB690A==}
dependencies:
babel-plugin-syntax-class-constructor-call: 6.18.0
babel-runtime: 6.26.0
@@ -1278,7 +1308,7 @@ packages:
dev: true
/babel-plugin-transform-class-properties/6.24.1:
- resolution: { integrity: sha1-anl2PqYdM9NvN7YRqp3vgagbRqw= }
+ resolution: {integrity: sha512-n4jtBA3OYBdvG5PRMKsMXJXHfLYw/ZOmtxCLOOwz6Ro5XlrColkStLnz1AS1L2yfPA9BKJ1ZNlmVCLjAL9DSIg==}
dependencies:
babel-helper-function-name: 6.24.1
babel-plugin-syntax-class-properties: 6.13.0
@@ -1289,7 +1319,7 @@ packages:
dev: true
/babel-plugin-transform-decorators/6.24.1:
- resolution: { integrity: sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0= }
+ resolution: {integrity: sha512-skQ2CImwDkCHu0mkWvCOlBCpBIHW4/49IZWVwV4A/EnWjL9bB6UBvLyMNe3Td5XDStSZNhe69j4bfEW8dvUbew==}
dependencies:
babel-helper-explode-class: 6.24.1
babel-plugin-syntax-decorators: 6.13.0
@@ -1301,26 +1331,26 @@ packages:
dev: true
/babel-plugin-transform-do-expressions/6.22.0:
- resolution: { integrity: sha1-KMyvkoEtlJws0SgfaQyP3EaK6bs= }
+ resolution: {integrity: sha512-yQwYqYg+Tnj1InA8W1rsItsZVhkv1Euc4KVua9ledtPz5PDWYz7LVyy6rDBpVYUWFZj5k6GUm3YZpCbIm8Tqew==}
dependencies:
babel-plugin-syntax-do-expressions: 6.13.0
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-es2015-arrow-functions/6.22.0:
- resolution: { integrity: sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= }
+ resolution: {integrity: sha512-PCqwwzODXW7JMrzu+yZIaYbPQSKjDTAsNNlK2l5Gg9g4rz2VzLnZsStvp/3c46GfXpwkyufb3NCyG9+50FF1Vg==}
dependencies:
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-es2015-block-scoped-functions/6.22.0:
- resolution: { integrity: sha1-u8UbSflk1wy42OC5ToICRs46YUE= }
+ resolution: {integrity: sha512-2+ujAT2UMBzYFm7tidUsYh+ZoIutxJ3pN9IYrF1/H6dCKtECfhmB8UkHVpyxDwkj0CYbQG35ykoz925TUnBc3A==}
dependencies:
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-es2015-block-scoping/6.26.0:
- resolution: { integrity: sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= }
+ resolution: {integrity: sha512-YiN6sFAQ5lML8JjCmr7uerS5Yc/EMbgg9G8ZNmk2E3nYX4ckHR01wrkeeMijEf5WHNK5TW0Sl0Uu3pv3EdOJWw==}
dependencies:
babel-runtime: 6.26.0
babel-template: 6.26.0
@@ -1332,7 +1362,7 @@ packages:
dev: true
/babel-plugin-transform-es2015-classes/6.24.1:
- resolution: { integrity: sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= }
+ resolution: {integrity: sha512-5Dy7ZbRinGrNtmWpquZKZ3EGY8sDgIVB4CU8Om8q8tnMLrD/m94cKglVcHps0BCTdZ0TJeeAWOq2TK9MIY6cag==}
dependencies:
babel-helper-define-map: 6.26.0
babel-helper-function-name: 6.24.1
@@ -1348,7 +1378,7 @@ packages:
dev: true
/babel-plugin-transform-es2015-computed-properties/6.24.1:
- resolution: { integrity: sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= }
+ resolution: {integrity: sha512-C/uAv4ktFP/Hmh01gMTvYvICrKze0XVX9f2PdIXuriCSvUmV9j+u+BB9f5fJK3+878yMK6dkdcq+Ymr9mrcLzw==}
dependencies:
babel-runtime: 6.26.0
babel-template: 6.26.0
@@ -1357,26 +1387,26 @@ packages:
dev: true
/babel-plugin-transform-es2015-destructuring/6.23.0:
- resolution: { integrity: sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= }
+ resolution: {integrity: sha512-aNv/GDAW0j/f4Uy1OEPZn1mqD+Nfy9viFGBfQ5bZyT35YqOiqx7/tXdyfZkJ1sC21NyEsBdfDY6PYmLHF4r5iA==}
dependencies:
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-es2015-duplicate-keys/6.24.1:
- resolution: { integrity: sha1-c+s9MQypaePvnskcU3QabxV2Qj4= }
+ resolution: {integrity: sha512-ossocTuPOssfxO2h+Z3/Ea1Vo1wWx31Uqy9vIiJusOP4TbF7tPs9U0sJ9pX9OJPf4lXRGj5+6Gkl/HHKiAP5ug==}
dependencies:
babel-runtime: 6.26.0
babel-types: 6.26.0
dev: true
/babel-plugin-transform-es2015-for-of/6.23.0:
- resolution: { integrity: sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= }
+ resolution: {integrity: sha512-DLuRwoygCoXx+YfxHLkVx5/NpeSbVwfoTeBykpJK7JhYWlL/O8hgAK/reforUnZDlxasOrVPPJVI/guE3dCwkw==}
dependencies:
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-es2015-function-name/6.24.1:
- resolution: { integrity: sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= }
+ resolution: {integrity: sha512-iFp5KIcorf11iBqu/y/a7DK3MN5di3pNCzto61FqCNnUX4qeBwcV1SLqe10oXNnCaxBUImX3SckX2/o1nsrTcg==}
dependencies:
babel-helper-function-name: 6.24.1
babel-runtime: 6.26.0
@@ -1386,13 +1416,13 @@ packages:
dev: true
/babel-plugin-transform-es2015-literals/6.22.0:
- resolution: { integrity: sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= }
+ resolution: {integrity: sha512-tjFl0cwMPpDYyoqYA9li1/7mGFit39XiNX5DKC/uCNjBctMxyL1/PT/l4rSlbvBG1pOKI88STRdUsWXB3/Q9hQ==}
dependencies:
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-es2015-modules-amd/6.24.1:
- resolution: { integrity: sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= }
+ resolution: {integrity: sha512-LnIIdGWIKdw7zwckqx+eGjcS8/cl8D74A3BpJbGjKTFFNJSMrjN4bIh22HY1AlkUbeLG6X6OZj56BDvWD+OeFA==}
dependencies:
babel-plugin-transform-es2015-modules-commonjs: 6.26.2
babel-runtime: 6.26.0
@@ -1402,10 +1432,7 @@ packages:
dev: true
/babel-plugin-transform-es2015-modules-commonjs/6.26.2:
- resolution:
- {
- integrity: sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==
- }
+ resolution: {integrity: sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==}
dependencies:
babel-plugin-transform-strict-mode: 6.24.1
babel-runtime: 6.26.0
@@ -1416,7 +1443,7 @@ packages:
dev: true
/babel-plugin-transform-es2015-modules-systemjs/6.24.1:
- resolution: { integrity: sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= }
+ resolution: {integrity: sha512-ONFIPsq8y4bls5PPsAWYXH/21Hqv64TBxdje0FvU3MhIV6QM2j5YS7KvAzg/nTIVLot2D2fmFQrFWCbgHlFEjg==}
dependencies:
babel-helper-hoist-variables: 6.24.1
babel-runtime: 6.26.0
@@ -1426,7 +1453,7 @@ packages:
dev: true
/babel-plugin-transform-es2015-modules-umd/6.24.1:
- resolution: { integrity: sha1-rJl+YoXNGO1hdq22B9YCNErThGg= }
+ resolution: {integrity: sha512-LpVbiT9CLsuAIp3IG0tfbVo81QIhn6pE8xBJ7XSeCtFlMltuar5VuBV6y6Q45tpui9QWcy5i0vLQfCfrnF7Kiw==}
dependencies:
babel-plugin-transform-es2015-modules-amd: 6.24.1
babel-runtime: 6.26.0
@@ -1436,7 +1463,7 @@ packages:
dev: true
/babel-plugin-transform-es2015-object-super/6.24.1:
- resolution: { integrity: sha1-JM72muIcuDp/hgPa0CH1cusnj40= }
+ resolution: {integrity: sha512-8G5hpZMecb53vpD3mjs64NhI1au24TAmokQ4B+TBFBjN9cVoGoOvotdrMMRmHvVZUEvqGUPWL514woru1ChZMA==}
dependencies:
babel-helper-replace-supers: 6.24.1
babel-runtime: 6.26.0
@@ -1445,7 +1472,7 @@ packages:
dev: true
/babel-plugin-transform-es2015-parameters/6.24.1:
- resolution: { integrity: sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= }
+ resolution: {integrity: sha512-8HxlW+BB5HqniD+nLkQ4xSAVq3bR/pcYW9IigY+2y0dI+Y7INFeTbfAQr+63T3E4UDsZGjyb+l9txUnABWxlOQ==}
dependencies:
babel-helper-call-delegate: 6.24.1
babel-helper-get-function-arity: 6.24.1
@@ -1458,20 +1485,20 @@ packages:
dev: true
/babel-plugin-transform-es2015-shorthand-properties/6.24.1:
- resolution: { integrity: sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= }
+ resolution: {integrity: sha512-mDdocSfUVm1/7Jw/FIRNw9vPrBQNePy6wZJlR8HAUBLybNp1w/6lr6zZ2pjMShee65t/ybR5pT8ulkLzD1xwiw==}
dependencies:
babel-runtime: 6.26.0
babel-types: 6.26.0
dev: true
/babel-plugin-transform-es2015-spread/6.22.0:
- resolution: { integrity: sha1-1taKmfia7cRTbIGlQujdnxdG+NE= }
+ resolution: {integrity: sha512-3Ghhi26r4l3d0Js933E5+IhHwk0A1yiutj9gwvzmFbVV0sPMYk2lekhOufHBswX7NCoSeF4Xrl3sCIuSIa+zOg==}
dependencies:
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-es2015-sticky-regex/6.24.1:
- resolution: { integrity: sha1-AMHNsaynERLN8M9hJsLta0V8zbw= }
+ resolution: {integrity: sha512-CYP359ADryTo3pCsH0oxRo/0yn6UsEZLqYohHmvLQdfS9xkf+MbCzE3/Kolw9OYIY4ZMilH25z/5CbQbwDD+lQ==}
dependencies:
babel-helper-regex: 6.26.0
babel-runtime: 6.26.0
@@ -1479,19 +1506,19 @@ packages:
dev: true
/babel-plugin-transform-es2015-template-literals/6.22.0:
- resolution: { integrity: sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= }
+ resolution: {integrity: sha512-x8b9W0ngnKzDMHimVtTfn5ryimars1ByTqsfBDwAqLibmuuQY6pgBQi5z1ErIsUOWBdw1bW9FSz5RZUojM4apg==}
dependencies:
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-es2015-typeof-symbol/6.23.0:
- resolution: { integrity: sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= }
+ resolution: {integrity: sha512-fz6J2Sf4gYN6gWgRZaoFXmq93X+Li/8vf+fb0sGDVtdeWvxC9y5/bTD7bvfWMEq6zetGEHpWjtzRGSugt5kNqw==}
dependencies:
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-es2015-unicode-regex/6.24.1:
- resolution: { integrity: sha1-04sS9C6nMj9yk4fxinxa4frrNek= }
+ resolution: {integrity: sha512-v61Dbbihf5XxnYjtBN04B/JBvsScY37R1cZT5r9permN1cp+b70DY3Ib3fIkgn1DI9U3tGgBJZVD8p/mE/4JbQ==}
dependencies:
babel-helper-regex: 6.26.0
babel-runtime: 6.26.0
@@ -1499,7 +1526,7 @@ packages:
dev: true
/babel-plugin-transform-exponentiation-operator/6.24.1:
- resolution: { integrity: sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= }
+ resolution: {integrity: sha512-LzXDmbMkklvNhprr20//RStKVcT8Cu+SQtX18eMHLhjHf2yFzwtQ0S2f0jQ+89rokoNdmwoSqYzAhq86FxlLSQ==}
dependencies:
babel-helper-builder-binary-assignment-operator-visitor: 6.24.1
babel-plugin-syntax-exponentiation-operator: 6.13.0
@@ -1509,41 +1536,41 @@ packages:
dev: true
/babel-plugin-transform-export-extensions/6.22.0:
- resolution: { integrity: sha1-U3OLR+deghhYnuqUbLvTkQm75lM= }
+ resolution: {integrity: sha512-mtzELzINaYqdVglyZrDDVwkcFRuE7s6QUFWXxwffKAHB/NkfbJ2NJSytugB43ytIC8UVt30Ereyx+7gNyTkDLg==}
dependencies:
babel-plugin-syntax-export-extensions: 6.13.0
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-function-bind/6.22.0:
- resolution: { integrity: sha1-xvuOlqwpajELjPjqQBRiQH3fapc= }
+ resolution: {integrity: sha512-9Ec4KYf1GurT39mlUjDSlN7HWSlB3u3mWRMogQbb+Y88lO0ZM3rJ0ADhPnQwWK9TbO6e/4E+Et1rrfGY9mFimA==}
dependencies:
babel-plugin-syntax-function-bind: 6.13.0
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-object-rest-spread/6.26.0:
- resolution: { integrity: sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= }
+ resolution: {integrity: sha512-ocgA9VJvyxwt+qJB0ncxV8kb/CjfTcECUY4tQ5VT7nP6Aohzobm8CDFaQ5FHdvZQzLmf0sgDxB8iRXZXxwZcyA==}
dependencies:
babel-plugin-syntax-object-rest-spread: 6.13.0
babel-runtime: 6.26.0
dev: true
/babel-plugin-transform-regenerator/6.26.0:
- resolution: { integrity: sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= }
+ resolution: {integrity: sha512-LS+dBkUGlNR15/5WHKe/8Neawx663qttS6AGqoOUhICc9d1KciBvtrQSuc0PI+CxQ2Q/S1aKuJ+u64GtLdcEZg==}
dependencies:
regenerator-transform: 0.10.1
dev: true
/babel-plugin-transform-strict-mode/6.24.1:
- resolution: { integrity: sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= }
+ resolution: {integrity: sha512-j3KtSpjyLSJxNoCDrhwiJad8kw0gJ9REGj8/CqL0HeRyLnvUNYV9zcqluL6QJSXh3nfsLEmSLvwRfGzrgR96Pw==}
dependencies:
babel-runtime: 6.26.0
babel-types: 6.26.0
dev: true
/babel-preset-es2015/6.24.1:
- resolution: { integrity: sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk= }
+ resolution: {integrity: sha512-XfwUqG1Ry6R43m4Wfob+vHbIVBIqTg/TJY4Snku1iIzeH7mUnwHA8Vagmv+ZQbPwhS8HgsdQvy28Py3k5zpoFQ==}
deprecated: 'πŸ™Œ Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!'
dependencies:
babel-plugin-check-es2015-constants: 6.22.0
@@ -1575,7 +1602,7 @@ packages:
dev: true
/babel-preset-stage-0/6.24.1:
- resolution: { integrity: sha1-VkLRUEL5E4TX5a+LyIsduVsDnmo= }
+ resolution: {integrity: sha512-MJD+xBbpsApbKlzAX0sOBF+VeFaUmv5s8FSOO7SSZpes1QgphCjq/UIGRFWSmQ/0i5bqQjLGCTXGGXqcLQ9JDA==}
dependencies:
babel-plugin-transform-do-expressions: 6.22.0
babel-plugin-transform-function-bind: 6.22.0
@@ -1585,7 +1612,7 @@ packages:
dev: true
/babel-preset-stage-1/6.24.1:
- resolution: { integrity: sha1-dpLNfc1oSZB+auSgqFWJz7niv7A= }
+ resolution: {integrity: sha512-rn+UOcd7BHDniq1SVxv2/AVVSVI1NK+hfS0I/iR6m6KbOi/aeBRcqBilqO73pd9VUpRXF2HFtlDuC9F2BEQqmg==}
dependencies:
babel-plugin-transform-class-constructor-call: 6.24.1
babel-plugin-transform-export-extensions: 6.22.0
@@ -1595,7 +1622,7 @@ packages:
dev: true
/babel-preset-stage-2/6.24.1:
- resolution: { integrity: sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE= }
+ resolution: {integrity: sha512-9F+nquz+37PrlTSBdpeQBKnQfAMNBnryXw+m4qBh35FNbJPfzZz+sjN2G5Uf1CRedU9PH7fJkTbYijxmkLX8Og==}
dependencies:
babel-plugin-syntax-dynamic-import: 6.18.0
babel-plugin-transform-class-properties: 6.24.1
@@ -1606,7 +1633,7 @@ packages:
dev: true
/babel-preset-stage-3/6.24.1:
- resolution: { integrity: sha1-g2raCp56f6N8sTj7kyb4eTSkg5U= }
+ resolution: {integrity: sha512-eCbEOF8uN0KypFXJmZXn2sTk7bPV9uM5xov7G/7BM08TbQEObsVs0cEWfy6NQySlfk7JBi/t+XJP1JkruYfthA==}
dependencies:
babel-plugin-syntax-trailing-function-commas: 6.22.0
babel-plugin-transform-async-generator-functions: 6.24.1
@@ -1618,28 +1645,28 @@ packages:
dev: true
/babel-register/6.26.0:
- resolution: { integrity: sha1-btAhFz4vy0htestFxgCahW9kcHE= }
+ resolution: {integrity: sha512-veliHlHX06wjaeY8xNITbveXSiI+ASFnOqvne/LaIJIqOWi2Ogmj91KOugEz/hoh/fwMhXNBJPCv8Xaz5CyM4A==}
dependencies:
babel-core: 6.26.3
babel-runtime: 6.26.0
core-js: 2.6.12
home-or-tmp: 2.0.0
lodash: 4.17.21
- mkdirp: 0.5.5
+ mkdirp: 0.5.6
source-map-support: 0.4.18
transitivePeerDependencies:
- supports-color
dev: true
/babel-runtime/6.26.0:
- resolution: { integrity: sha1-llxwWGaOgrVde/4E/yM3vItWR/4= }
+ resolution: {integrity: sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==}
dependencies:
core-js: 2.6.12
regenerator-runtime: 0.11.1
dev: true
/babel-template/6.26.0:
- resolution: { integrity: sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= }
+ resolution: {integrity: sha512-PCOcLFW7/eazGUKIoqH97sO9A2UYMahsn/yRQ7uOk37iutwjq7ODtcTNF+iFDSHNfkctqsLRjLP7URnOx0T1fg==}
dependencies:
babel-runtime: 6.26.0
babel-traverse: 6.26.0
@@ -1651,7 +1678,7 @@ packages:
dev: true
/babel-traverse/6.26.0:
- resolution: { integrity: sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= }
+ resolution: {integrity: sha512-iSxeXx7apsjCHe9c7n8VtRXGzI2Bk1rBSOJgCCjfyXb6v1aCqE1KSEpq/8SXuVN8Ka/Rh1WDTF0MDzkvTA4MIA==}
dependencies:
babel-code-frame: 6.26.0
babel-messages: 6.23.0
@@ -1667,7 +1694,7 @@ packages:
dev: true
/babel-types/6.26.0:
- resolution: { integrity: sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= }
+ resolution: {integrity: sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g==}
dependencies:
babel-runtime: 6.26.0
esutils: 2.0.3
@@ -1676,181 +1703,193 @@ packages:
dev: true
/babylon/6.18.0:
- resolution:
- {
- integrity: sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==
- }
+ resolution: {integrity: sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==}
hasBin: true
dev: true
/balanced-match/1.0.2:
- resolution:
- {
- integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
- }
+ resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
/base64-js/1.5.1:
- resolution:
- {
- integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
- }
+ resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
dev: false
/bcrypt-pbkdf/1.0.2:
- resolution: { integrity: sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= }
+ resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==}
dependencies:
tweetnacl: 0.14.5
dev: false
/bcryptjs/2.4.3:
- resolution: { integrity: sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms= }
+ resolution: {integrity: sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==}
dev: false
/binary-extensions/2.2.0:
- resolution:
- {
- integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
+ engines: {node: '>=8'}
+ dev: true
+
+ /bindings/1.5.0:
+ resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==}
+ dependencies:
+ file-uri-to-path: 1.0.0
+ dev: true
/bl/4.1.0:
- resolution:
- {
- integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==
- }
+ resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
dependencies:
buffer: 5.7.1
inherits: 2.0.4
readable-stream: 3.6.0
dev: false
+ /bn.js/4.12.0:
+ resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==}
+ dev: false
+
+ /boolean/3.2.0:
+ resolution: {integrity: sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==}
+ dev: false
+
/brace-expansion/1.1.11:
- resolution:
- {
- integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
- }
+ resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
dependencies:
balanced-match: 1.0.2
concat-map: 0.0.1
+ dev: true
+
+ /brace-expansion/2.0.1:
+ resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
+ dependencies:
+ balanced-match: 1.0.2
+ dev: false
/braces/3.0.2:
- resolution:
- {
- integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
+ engines: {node: '>=8'}
dependencies:
fill-range: 7.0.1
+ dev: true
+
+ /bree/9.1.1:
+ resolution: {integrity: sha512-jNTi5+Su6AQfSz155Z3FJb+nNVexxWKlIp3SvPE5dAH0zr0ffzpK61BN943IF5+ZlJjQhyG5VcprCQY/Wjpdrw==}
+ engines: {node: '>=12.17.0 <13.0.0-0||>=13.2.0'}
+ dependencies:
+ '@breejs/later': 4.1.0
+ boolean: 3.2.0
+ combine-errors: 3.0.3
+ cron-validate: 1.4.3
+ human-interval: 2.0.1
+ is-string-and-not-blank: 0.0.2
+ is-valid-path: 0.1.1
+ ms: 2.1.3
+ p-wait-for: 3.2.0
+ safe-timers: 1.1.0
+ dev: false
+
+ /browser-hrtime/1.1.8:
+ resolution: {integrity: sha512-kzXheikaJsBtzUBlyVtPIY5r0soQePzjwVwT4IlDpU2RvfB5Py52gpU98M77rgqMCheoSSZvrcrdj3t6cZ3suA==}
+ dev: false
/browserslist/4.20.3:
- resolution:
- {
- integrity: sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg==
- }
- engines: { node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7 }
+ resolution: {integrity: sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg==}
+ engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
dependencies:
- caniuse-lite: 1.0.30001338
- electron-to-chromium: 1.4.137
+ caniuse-lite: 1.0.30001343
+ electron-to-chromium: 1.4.139
escalade: 3.1.1
- node-releases: 2.0.4
+ node-releases: 2.0.5
picocolors: 1.0.0
dev: true
+ /bson-objectid/1.3.1:
+ resolution: {integrity: sha512-eQBNQXsisEAXlwiSy8zRNZdW2xDBJaEVkTPbodYR9hGxxtE548Qq7ilYOd8WAQ86xF7NRUdiWSQ1pa/TkKiE2A==}
+ dev: false
+
/buffer-crc32/0.2.13:
- resolution: { integrity: sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= }
+ resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==}
dev: true
/buffer-equal-constant-time/1.0.1:
- resolution: { integrity: sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= }
+ resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==}
dev: false
/buffer/5.7.1:
- resolution:
- {
- integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==
- }
+ resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
dependencies:
base64-js: 1.5.1
ieee754: 1.2.1
dev: false
- /bullmq/1.82.2:
- resolution:
- {
- integrity: sha512-pDmMl6HmL/7B41ldBK4lnmGUcobkI/n/a0T3d/volMWC0ULxsaZ6R6fDePk23LwH9Fxu4o9Ny+zurCL3vG7lbg==
- }
- dependencies:
- cron-parser: 4.2.1
- get-port: 5.1.1
- glob: 7.2.0
- ioredis: 4.28.5
- lodash: 4.17.21
- msgpackr: 1.4.7
- semver: 6.3.0
- tslib: 1.14.1
- uuid: 8.3.2
+ /buildcheck/0.0.3:
+ resolution: {integrity: sha512-pziaA+p/wdVImfcbsZLNF32EiWyujlQLwolMqUQE8xpKNOH7KmZQaY8sXN7DGOEzPAElo9QTaeNRfGnf3iOJbA==}
+ engines: {node: '>=10.0.0'}
+ dev: false
+ optional: true
+
+ /cabin/9.1.2:
+ resolution: {integrity: sha512-qCiJYmPdB1OcGybQxhKzEAHpQZ1+aJFt1KQqAHDQFZ801Va68uU/Gcb3jRHY+PPKWtRUjBuuo2FrU1De7GLZow==}
+ engines: {node: '>=6.4.0'}
+ dependencies:
+ ansi-colors: 4.1.3
+ axe: 8.1.2
+ clf-date: 0.2.0
+ iserror: 0.0.2
+ ms: 2.1.3
+ on-finished: 2.3.0
+ parse-err: 0.0.12
+ parse-request: 4.0.0
transitivePeerDependencies:
- supports-color
dev: false
/cacheable-lookup/6.0.4:
- resolution:
- {
- integrity: sha512-mbcDEZCkv2CZF4G01kr8eBd/5agkt9oCqz75tJMSIsquvRZ2sL6Hi5zGVKi/0OSC9oO1GHfJ2AV0ZIOY9vye0A==
- }
- engines: { node: '>=10.6.0' }
+ resolution: {integrity: sha512-mbcDEZCkv2CZF4G01kr8eBd/5agkt9oCqz75tJMSIsquvRZ2sL6Hi5zGVKi/0OSC9oO1GHfJ2AV0ZIOY9vye0A==}
+ engines: {node: '>=10.6.0'}
dev: false
/cacheable-request/7.0.2:
- resolution:
- {
- integrity: sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==}
+ engines: {node: '>=8'}
dependencies:
clone-response: 1.0.2
get-stream: 5.2.0
http-cache-semantics: 4.1.0
- keyv: 4.0.4
+ keyv: 4.3.0
lowercase-keys: 2.0.0
normalize-url: 6.1.0
responselike: 2.0.0
dev: false
+ /call-bind/1.0.2:
+ resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==}
+ dependencies:
+ function-bind: 1.1.1
+ get-intrinsic: 1.1.1
+
/callsites/3.1.0:
- resolution:
- {
- integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
- }
- engines: { node: '>=6' }
+ resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
+ engines: {node: '>=6'}
dev: true
/camelcase-css/2.0.1:
- resolution:
- {
- integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==
- }
- engines: { node: '>= 6' }
+ resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==}
+ engines: {node: '>= 6'}
+ dev: true
/camelcase/5.3.1:
- resolution:
- {
- integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
- }
- engines: { node: '>=6' }
+ resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
+ engines: {node: '>=6'}
dev: false
- /caniuse-lite/1.0.30001338:
- resolution:
- {
- integrity: sha512-1gLHWyfVoRDsHieO+CaeYe7jSo/MT7D7lhaXUiwwbuR5BwQxORs0f1tAwUSQr3YbxRXJvxHM/PA5FfPQRnsPeQ==
- }
+ /caniuse-lite/1.0.30001343:
+ resolution: {integrity: sha512-8KeCrAtPMabo/XW14B+R9sZYoClx1n0b+WYgwDKZPtWR3TcdvWzdSy7mPyFEmR5WU1St9v1PW6sdO5dkFOEzfA==}
dev: true
/chalk/1.1.3:
- resolution: { integrity: sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==}
+ engines: {node: '>=0.10.0'}
dependencies:
ansi-styles: 2.2.1
escape-string-regexp: 1.0.5
@@ -1860,34 +1899,24 @@ packages:
dev: true
/chalk/2.4.2:
- resolution:
- {
- integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
- }
- engines: { node: '>=4' }
+ resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
+ engines: {node: '>=4'}
dependencies:
ansi-styles: 3.2.1
escape-string-regexp: 1.0.5
supports-color: 5.5.0
- dev: true
/chalk/4.1.2:
- resolution:
- {
- integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
- }
- engines: { node: '>=10' }
+ resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
+ engines: {node: '>=10'}
dependencies:
ansi-styles: 4.3.0
supports-color: 7.2.0
dev: true
/chokidar/3.5.3:
- resolution:
- {
- integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
- }
- engines: { node: '>= 8.10.0' }
+ resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==}
+ engines: {node: '>= 8.10.0'}
dependencies:
anymatch: 3.1.2
braces: 3.0.2
@@ -1898,216 +1927,190 @@ packages:
readdirp: 3.6.0
optionalDependencies:
fsevents: 2.3.2
+ dev: true
/chownr/1.1.4:
- resolution:
- {
- integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==
- }
+ resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}
dev: false
- /clean-stack/2.2.0:
- resolution:
- {
- integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==
- }
- engines: { node: '>=6' }
- dev: true
-
- /cli-cursor/3.1.0:
- resolution:
- {
- integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==
- }
- engines: { node: '>=8' }
- dependencies:
- restore-cursor: 3.1.0
- dev: true
-
- /cli-truncate/2.1.0:
- resolution:
- {
- integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==
- }
- engines: { node: '>=8' }
- dependencies:
- slice-ansi: 3.0.0
- string-width: 4.2.3
+ /chownr/2.0.0:
+ resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}
+ engines: {node: '>=10'}
dev: true
- /cli-truncate/3.1.0:
- resolution:
- {
- integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==
- }
- engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
- dependencies:
- slice-ansi: 5.0.0
- string-width: 5.1.0
- dev: true
+ /clf-date/0.2.0:
+ resolution: {integrity: sha512-KmV+reIoSINOik5moU6eOqSUy3r/9t6J6Dbl4TCndg1g0R6Z3S3xHzd3u0ZeoTUSbUFr9hHbpiZ+36MrhlNEHQ==}
+ hasBin: true
+ dev: false
/clone-response/1.0.2:
- resolution: { integrity: sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= }
+ resolution: {integrity: sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==}
dependencies:
mimic-response: 1.0.1
dev: false
- /cluster-key-slot/1.1.0:
- resolution:
- {
- integrity: sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw==
- }
- engines: { node: '>=0.10.0' }
- dev: false
-
/color-convert/1.9.3:
- resolution:
- {
- integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
- }
+ resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
dependencies:
color-name: 1.1.3
- dev: true
/color-convert/2.0.1:
- resolution:
- {
- integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
- }
- engines: { node: '>=7.0.0' }
+ resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
+ engines: {node: '>=7.0.0'}
dependencies:
color-name: 1.1.4
dev: true
/color-name/1.1.3:
- resolution: { integrity: sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= }
- dev: true
+ resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==}
/color-name/1.1.4:
- resolution:
- {
- integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
- }
-
- /colorette/2.0.16:
- resolution:
- {
- integrity: sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==
- }
+ resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
dev: true
- /commander/8.3.0:
- resolution:
- {
- integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
- }
- engines: { node: '>= 12' }
+ /color-support/1.1.3:
+ resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==}
+ hasBin: true
dev: true
+ /combine-errors/3.0.3:
+ resolution: {integrity: sha512-C8ikRNRMygCwaTx+Ek3Yr+OuZzgZjduCOfSQBjbM8V3MfgcjSTeto/GXP6PAwKvJz/v15b7GHZvx5rOlczFw/Q==}
+ dependencies:
+ custom-error-instance: 2.1.1
+ lodash.uniqby: 4.5.0
+ dev: false
+
+ /combined-stream/1.0.8:
+ resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
+ engines: {node: '>= 0.8'}
+ dependencies:
+ delayed-stream: 1.0.0
+ dev: false
+
/compare-versions/4.1.3:
- resolution:
- {
- integrity: sha512-WQfnbDcrYnGr55UwbxKiQKASnTtNnaAWVi8jZyy8NTpVAXWACSne8lMD1iaIo9AiU6mnuLvSVshCzewVuWxHUg==
- }
+ resolution: {integrity: sha512-WQfnbDcrYnGr55UwbxKiQKASnTtNnaAWVi8jZyy8NTpVAXWACSne8lMD1iaIo9AiU6mnuLvSVshCzewVuWxHUg==}
+ dev: false
+
+ /component-emitter/1.3.0:
+ resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==}
+ dev: false
+
+ /compress-brotli/1.3.8:
+ resolution: {integrity: sha512-lVcQsjhxhIXsuupfy9fmZUFtAIdBmXA7EGY6GBdgZ++qkM9zG4YFT8iU7FoBxzryNDMOpD1HIFHUSX4D87oqhQ==}
+ engines: {node: '>= 12'}
+ dependencies:
+ '@types/json-buffer': 3.0.0
+ json-buffer: 3.0.1
dev: false
/concat-map/0.0.1:
- resolution: { integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= }
+ resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}
+ dev: true
+
+ /console-control-strings/1.1.0:
+ resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==}
+ dev: true
+
+ /console-polyfill/0.3.0:
+ resolution: {integrity: sha512-w+JSDZS7XML43Xnwo2x5O5vxB0ID7T5BdqDtyqT6uiCAX2kZAgcWxNaGqT97tZfSHzfOcvrfsDAodKcJ3UvnXQ==}
+ dev: false
+
+ /content-disposition/0.5.4:
+ resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==}
+ engines: {node: '>= 0.6'}
+ dependencies:
+ safe-buffer: 5.2.1
+ dev: false
+
+ /convert-hrtime/3.0.0:
+ resolution: {integrity: sha512-7V+KqSvMiHp8yWDuwfww06XleMWVVB9b9tURBx+G7UTADuo5hYPuowKloz4OzOqbPezxgo+fdQ1522WzPG4OeA==}
+ engines: {node: '>=8'}
+ dev: false
/convert-source-map/1.8.0:
- resolution:
- {
- integrity: sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==
- }
+ resolution: {integrity: sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==}
dependencies:
safe-buffer: 5.1.2
dev: true
+ /cookie-signature/1.2.0:
+ resolution: {integrity: sha512-R0BOPfLGTitaKhgKROKZQN6iyq2iDQcH1DOF8nJoaWapguX5bC2w+Q/I9NmmM5lfcvEarnLZr+cCvmEYYSXvYA==}
+ engines: {node: '>=6.6.0'}
+ dev: false
+
/cookie/0.4.2:
- resolution:
- {
- integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==
- }
- engines: { node: '>= 0.6' }
+ resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==}
+ engines: {node: '>= 0.6'}
dev: false
/cookie/0.5.0:
- resolution:
- {
- integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==
- }
- engines: { node: '>= 0.6' }
+ resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==}
+ engines: {node: '>= 0.6'}
+ dev: false
+
+ /cookiejar/2.1.3:
+ resolution: {integrity: sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==}
dev: false
/core-js/2.6.12:
- resolution:
- {
- integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==
- }
+ resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==}
deprecated: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
requiresBuild: true
dev: true
- /cpu-features/0.0.2:
- resolution:
- {
- integrity: sha512-/2yieBqvMcRj8McNzkycjW2v3OIUOibBfd2dLEJ0nWts8NobAxwiyw9phVNS6oDL8x8tz9F7uNVFEVpJncQpeA==
- }
- engines: { node: '>=8.0.0' }
+ /cpu-features/0.0.4:
+ resolution: {integrity: sha512-fKiZ/zp1mUwQbnzb9IghXtHtDoTMtNeb8oYGx6kX2SYfhnG0HNdBEBIzB9b5KlXu5DQPhfy3mInbBxFcgwAr3A==}
+ engines: {node: '>=10.0.0'}
requiresBuild: true
dependencies:
- nan: 2.15.0
+ buildcheck: 0.0.3
+ nan: 2.16.0
dev: false
optional: true
/create-require/1.1.1:
- resolution:
- {
- integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
- }
-
- /cron-parser/4.2.1:
- resolution:
- {
- integrity: sha512-5sJBwDYyCp+0vU5b7POl8zLWfgV5fOHxlc45FWoWdHecGC7MQHCjx0CHivCMRnGFovghKhhyYM+Zm9DcY5qcHg==
- }
- engines: { node: '>=0.8' }
- dependencies:
- luxon: 1.28.0
- dev: false
-
- /cross-env/7.0.3:
- resolution:
- {
- integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
- }
- engines: { node: '>=10.14', npm: '>=6', yarn: '>=1' }
- hasBin: true
+ resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
+ dev: false
+
+ /credit-card-type/8.3.0:
+ resolution: {integrity: sha512-czfZUpQ7W9CDxZL4yFLb1kFtM/q2lTOY975hL2aO+DC8+GRNDVSXVCHXhVFZPxiUKmQCZbFP8vIhxx5TBQaThw==}
+ dev: false
+
+ /cron-validate/1.4.3:
+ resolution: {integrity: sha512-N+qKw019oQBEPIP5Qwi8Z5XelQ00ThN6Maahwv+9UGu2u/b/MPb35zngMQI0T8pBoNiBrIXGlhvsmspNSYae/w==}
dependencies:
- cross-spawn: 7.0.3
- dev: true
+ yup: 0.32.9
+ dev: false
/cross-spawn/5.1.0:
- resolution: { integrity: sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= }
+ resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==}
dependencies:
lru-cache: 4.1.5
shebang-command: 1.2.0
which: 1.3.1
dev: true
+ /cross-spawn/6.0.5:
+ resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==}
+ engines: {node: '>=4.8'}
+ dependencies:
+ nice-try: 1.0.5
+ path-key: 2.0.1
+ semver: 5.7.1
+ shebang-command: 1.2.0
+ which: 1.3.1
+ dev: true
+
/cross-spawn/7.0.3:
- resolution:
- {
- integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
- }
- engines: { node: '>= 8' }
+ resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
+ engines: {node: '>= 8'}
dependencies:
path-key: 3.1.1
shebang-command: 2.0.0
which: 2.0.2
/cross-var/1.1.0:
- resolution: { integrity: sha1-8PDUuyNdlRONGlOYQtKQ8A23HNY= }
+ resolution: {integrity: sha512-wIcFax9RNm5ayuORUeJ5MLxPbfh8XdZhhUpKutIszU46Fs9UIhEdPJ7+YguM+7FxEj+68hSQVyathVsIu84SiA==}
hasBin: true
dependencies:
babel-preset-es2015: 6.24.1
@@ -2120,32 +2123,25 @@ packages:
dev: true
/cssesc/3.0.0:
- resolution:
- {
- integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==
- }
- engines: { node: '>=4' }
+ resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}
+ engines: {node: '>=4'}
hasBin: true
+ dev: true
/cuid/2.1.8:
- resolution:
- {
- integrity: sha512-xiEMER6E7TlTPnDxrM4eRiC6TRgjNX9xzEZ5U/Se2YJKr7Mq4pJn/2XEHjl3STcSh96GmkHPcBXLES8M29wyyg==
- }
+ resolution: {integrity: sha512-xiEMER6E7TlTPnDxrM4eRiC6TRgjNX9xzEZ5U/Se2YJKr7Mq4pJn/2XEHjl3STcSh96GmkHPcBXLES8M29wyyg==}
+ dev: false
+
+ /custom-error-instance/2.1.1:
+ resolution: {integrity: sha512-p6JFxJc3M4OTD2li2qaHkDCw9SfMw82Ldr6OC9Je1aXiGfhx2W8p3GaoeaGrPJTUN9NirTM/KTxHWMUdR1rsUg==}
dev: false
- /dayjs/1.11.2:
- resolution:
- {
- integrity: sha512-F4LXf1OeU9hrSYRPTTj/6FbO4HTjPKXvEIC1P2kcnFurViINCVk3ZV0xAS3XVx9MkMsXbbqlK6hjseaYbgKEHw==
- }
+ /dayjs/1.11.3:
+ resolution: {integrity: sha512-xxwlswWOlGhzgQ4TKzASQkUhqERI3egRNqgV4ScR8wlANA/A9tZ7miXa44vTTKEq5l7vWoL5G57bG3zA+Kow0A==}
dev: false
/debug/2.6.9:
- resolution:
- {
- integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
- }
+ resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
@@ -2153,28 +2149,22 @@ packages:
optional: true
dependencies:
ms: 2.0.0
- dev: true
- /debug/4.3.3:
- resolution:
- {
- integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
- }
- engines: { node: '>=6.0' }
+ resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
dependencies:
- ms: 2.1.2
+ ms: 2.1.3
+ supports-color: 5.5.0
+ dev: true
- resolution:
- {
- integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
- }
- engines: { node: '>=6.0' }
+ /debug/4.3.4:
+ resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
+ engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
@@ -2182,145 +2172,149 @@ packages:
optional: true
dependencies:
ms: 2.1.2
- supports-color: 9.2.1
- dev: true
/decompress-response/6.0.0:
- resolution:
- {
- integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==
- }
- engines: { node: '>=10' }
+ resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==}
+ engines: {node: '>=10'}
dependencies:
mimic-response: 3.1.0
dev: false
/deep-is/0.1.4:
- resolution:
- {
- integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==
- }
+ resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
dev: true
+ /deepmerge/4.2.2:
+ resolution: {integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==}
+ engines: {node: '>=0.10.0'}
+
/defer-to-connect/2.0.1:
- resolution:
- {
- integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==
- }
- engines: { node: '>=10' }
+ resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==}
+ engines: {node: '>=10'}
dev: false
+ /define-properties/1.1.4:
+ resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-property-descriptors: 1.0.0
+ object-keys: 1.1.1
+ dev: true
+
/defined/1.0.0:
- resolution: { integrity: sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= }
+ resolution: {integrity: sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ==}
+ dev: true
+
+ /delayed-stream/1.0.0:
+ resolution: {integrity: sha1-3zrhmayt+31ECqrgsp4icrJOxhk=}
+ engines: {node: '>=0.4.0'}
+ dev: false
+
+ /delegates/1.0.0:
+ resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==}
+ dev: true
+
+ /depd/2.0.0:
+ resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==}
+ engines: {node: '>= 0.8'}
+ dev: false
- /denque/1.5.1:
- resolution:
- {
- integrity: sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==
- }
- engines: { node: '>=0.10' }
+ /destroy/1.2.0:
+ resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==}
+ engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
dev: false
/detect-indent/4.0.0:
- resolution: { integrity: sha1-920GQ1LN9Docts5hnE7jqUdd4gg= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-BDKtmHlOzwI7iRuEkhzsnPoi5ypEhWAJB5RvHWe1kMr06js3uK5B3734i3ui5Yd+wOJV1cpE4JnivPD283GU/A==}
+ engines: {node: '>=0.10.0'}
dependencies:
repeating: 2.0.1
dev: true
/detect-indent/6.1.0:
- resolution:
- {
- integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==
- }
- engines: { node: '>=8' }
- dev: true
-
- /detective/5.2.0:
- resolution:
- {
- integrity: sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==
- }
- engines: { node: '>=0.8.0' }
+ resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==}
+ engines: {node: '>=8'}
+ dev: true
+
+ /detect-libc/2.0.1:
+ resolution: {integrity: sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==}
+ engines: {node: '>=8'}
+ dev: true
+
+ /detective/5.2.1:
+ resolution: {integrity: sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw==}
+ engines: {node: '>=0.8.0'}
hasBin: true
dependencies:
acorn-node: 1.8.2
defined: 1.0.0
- minimist: 1.2.5
+ minimist: 1.2.6
+ dev: true
+
+ /dezalgo/1.0.3:
+ resolution: {integrity: sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=}
+ dependencies:
+ asap: 2.0.6
+ wrappy: 1.0.2
+ dev: false
/didyoumean/1.2.2:
- resolution:
- {
- integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==
- }
+ resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
+ dev: true
/diff/4.0.2:
- resolution:
- {
- integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
- }
- engines: { node: '>=0.3.1' }
+ resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
+ engines: {node: '>=0.3.1'}
+ dev: false
/dir-glob/3.0.1:
- resolution:
- {
- integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
+ engines: {node: '>=8'}
dependencies:
path-type: 4.0.0
dev: true
/dlv/1.1.3:
- resolution:
- {
- integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==
- }
-
- /docker-modem/3.0.3:
- resolution:
- {
- integrity: sha512-Tgkn2a+yiNP9FoZgMa/D9Wk+D2Db///0KOyKSYZRJa8w4+DzKyzQMkczKSdR/adQ0x46BOpeNkoyEOKjPhCzjw==
- }
- engines: { node: '>= 8.0' }
- dependencies:
- debug: 4.3.3
+ resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
+ dev: true
+
+ /docker-modem/3.0.5:
+ resolution: {integrity: sha512-x1E6jxWdtoK3+ifAUWj4w5egPdTDGBpesSCErm+aKET5BnnEOvDtTP6GxcnMB1zZiv2iQ0qJZvJie+1wfIRg6Q==}
+ engines: {node: '>= 8.0'}
+ dependencies:
+ debug: 4.3.4
readable-stream: 3.6.0
split-ca: 1.0.1
- ssh2: 1.5.0
+ ssh2: 1.10.0
transitivePeerDependencies:
- supports-color
dev: false
- /dockerode/3.3.1:
- resolution:
- {
- integrity: sha512-AS2mr8Lp122aa5n6d99HkuTNdRV1wkkhHwBdcnY6V0+28D3DSYwhxAk85/mM9XwD3RMliTxyr63iuvn5ZblFYQ==
- }
- engines: { node: '>= 8.0' }
+ /dockerode/3.3.2:
+ resolution: {integrity: sha512-oXN+1XVH2TeyE0Jj9Ci6Fim8ZIDxyqeJrkx9qhEOaRiA+nhLihKfd3M2L+Aqrj5C2ObPw8RVN2zPWvvk0x2dwg==}
+ engines: {node: '>= 8.0'}
dependencies:
- docker-modem: 3.0.3
+ docker-modem: 3.0.5
tar-fs: 2.0.1
transitivePeerDependencies:
- supports-color
dev: false
/doctrine/3.0.0:
- resolution:
- {
- integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==
- }
- engines: { node: '>=6.0.0' }
+ resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
+ engines: {node: '>=6.0.0'}
dependencies:
esutils: 2.0.3
dev: true
+ /dotenv-expand/8.0.3:
+ resolution: {integrity: sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg==}
+ engines: {node: '>=12'}
+ dev: false
+
/dotenv-extended/2.9.0:
- resolution:
- {
- integrity: sha512-MKc4WCqZj6Abx4rpDbQ9LsuBJldRLxLgFkY5qE+4JM7hXVYT/v8zyWGgnBeDjSOGzEecWOFPlosNpxfB9YnsCw==
- }
- engines: { node: '>=6' }
+ resolution: {integrity: sha512-MKc4WCqZj6Abx4rpDbQ9LsuBJldRLxLgFkY5qE+4JM7hXVYT/v8zyWGgnBeDjSOGzEecWOFPlosNpxfB9YnsCw==}
+ engines: {node: '>=6'}
hasBin: true
dependencies:
auto-parse: 1.8.0
@@ -2329,842 +2323,899 @@ packages:
dotenv: 8.6.0
dev: false
+ /dotenv/16.0.1:
+ resolution: {integrity: sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==}
+ engines: {node: '>=12'}
+ dev: false
+
/dotenv/8.6.0:
- resolution:
- {
- integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==
- }
- engines: { node: '>=10' }
+ resolution: {integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==}
+ engines: {node: '>=10'}
dev: false
- /eastasianwidth/0.2.0:
- resolution:
- {
- integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==
- }
- dev: true
+ /dotgitconfig/1.1.2:
+ resolution: {integrity: sha512-M+nUsYHJT2qs6bnYqotmO+1IQ09w3ZwLcX4MmbblaWN9C7ydDWM2xQLv22xfl4bUxienESi1GsZnZJPb8jslqQ==}
+ dependencies:
+ ini: 1.3.8
+ dev: false
/ecdsa-sig-formatter/1.0.11:
- resolution:
- {
- integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==
- }
+ resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==}
dependencies:
safe-buffer: 5.2.1
dev: false
- /electron-to-chromium/1.4.137:
- resolution:
- {
- integrity: sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA==
- }
+ /ee-first/1.1.1:
+ resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=}
+ dev: false
+
+ /electron-to-chromium/1.4.139:
+ resolution: {integrity: sha512-lYxzcUCjWxxVug+A7UxBCUiVr13TCjfZFYJS9Lq1VpU/ErwV4a6zUQo9dfojuGpw/L/x9REGuBl6ICQPGgbs3g==}
dev: true
/emoji-regex/8.0.0:
- resolution:
- {
- integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
- }
+ resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
dev: true
- /emoji-regex/9.2.2:
- resolution:
- {
- integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==
- }
- dev: true
+ /encodeurl/1.0.2:
+ resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==}
+ engines: {node: '>= 0.8'}
+ dev: false
+
+ /encoding-negotiator/2.0.1:
+ resolution: {integrity: sha512-GSK7qphNR4iPcejfAlZxKDoz3xMhnspwImK+Af5WhePS9jUpK/Oh7rUdyENWu+9rgDflOCTmAojBsgsvM8neAQ==}
+ engines: {node: '>=10.13.0'}
+ dev: false
/end-of-stream/1.4.4:
- resolution:
- {
- integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==
- }
+ resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
dependencies:
once: 1.4.0
dev: false
- /enquirer/2.3.6:
- resolution:
- {
- integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==
- }
- engines: { node: '>=8.6' }
+ /env-schema/4.0.0:
+ resolution: {integrity: sha512-hM5OwjrUPxxrCjC1Ykf+wPld2lbnN3/m9Y9wuMPt0jmYluJpAV3OXc1HiliZxFkxLzw2FcrSOXdw/3uI7PYCFA==}
+ dependencies:
+ ajv: 8.11.0
+ dotenv: 16.0.1
+ dotenv-expand: 8.0.3
+ dev: false
+
+ /error-ex/1.3.2:
+ resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
+ dependencies:
+ is-arrayish: 0.2.1
+
+ /es-abstract/1.20.1:
+ resolution: {integrity: sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==}
+ engines: {node: '>= 0.4'}
dependencies:
- ansi-colors: 4.1.1
+ call-bind: 1.0.2
+ es-to-primitive: 1.2.1
+ function-bind: 1.1.1
+ function.prototype.name: 1.1.5
+ get-intrinsic: 1.1.1
+ get-symbol-description: 1.0.0
+ has: 1.0.3
+ has-property-descriptors: 1.0.0
+ has-symbols: 1.0.3
+ internal-slot: 1.0.3
+ is-callable: 1.2.4
+ is-negative-zero: 2.0.2
+ is-regex: 1.1.4
+ is-shared-array-buffer: 1.0.2
+ is-string: 1.0.7
+ is-weakref: 1.0.2
+ object-inspect: 1.12.1
+ object-keys: 1.1.1
+ object.assign: 4.1.2
+ regexp.prototype.flags: 1.4.3
+ string.prototype.trimend: 1.0.5
+ string.prototype.trimstart: 1.0.5
+ unbox-primitive: 1.0.2
+ dev: true
+
+ /es-to-primitive/1.2.1:
+ resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ is-callable: 1.2.4
+ is-date-object: 1.0.5
+ is-symbol: 1.0.4
dev: true
/es6-promise/3.3.1:
- resolution: { integrity: sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM= }
+ resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==}
dev: true
- /esbuild-android-64/0.14.34:
- resolution:
- {
- integrity: sha512-XfxcfJqmMYsT/LXqrptzFxmaR3GWzXHDLdFNIhm6S00zPaQF1TBBWm+9t0RZ6LRR7iwH57DPjaOeW20vMqI4Yw==
- }
- engines: { node: '>=12' }
+ /esbuild-android-64/0.14.48:
+ resolution: {integrity: sha512-3aMjboap/kqwCUpGWIjsk20TtxVoKck8/4Tu19rubh7t5Ra0Yrpg30Mt1QXXlipOazrEceGeWurXKeFJgkPOUg==}
+ engines: {node: '>=12'}
cpu: [x64]
os: [android]
requiresBuild: true
dev: true
optional: true
- /esbuild-android-arm64/0.14.34:
- resolution:
- {
- integrity: sha512-T02+NXTmSRL1Mc6puz+R9CB54rSPICkXKq6+tw8B6vxZFnCPzbJxgwIX4kcluz9p8nYBjF3+lSilTGWb7+Xgew==
- }
- engines: { node: '>=12' }
+ /esbuild-android-arm64/0.14.48:
+ resolution: {integrity: sha512-vptI3K0wGALiDq+EvRuZotZrJqkYkN5282iAfcffjI5lmGG9G1ta/CIVauhY42MBXwEgDJkweiDcDMRLzBZC4g==}
+ engines: {node: '>=12'}
cpu: [arm64]
os: [android]
requiresBuild: true
dev: true
optional: true
- /esbuild-darwin-64/0.14.34:
- resolution:
- {
- integrity: sha512-pLRip2Bh4Ng7Bf6AMgCrSp3pPe/qZyf11h5Qo2mOfJqLWzSVjxrXW+CFRJfrOVP7TCnh/gmZSM2AFdCPB72vtw==
- }
- engines: { node: '>=12' }
+ /esbuild-darwin-64/0.14.48:
+ resolution: {integrity: sha512-gGQZa4+hab2Va/Zww94YbshLuWteyKGD3+EsVon8EWTWhnHFRm5N9NbALNbwi/7hQ/hM1Zm4FuHg+k6BLsl5UA==}
+ engines: {node: '>=12'}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
- /esbuild-darwin-arm64/0.14.34:
- resolution:
- {
- integrity: sha512-vpidSJEBxx6lf1NWgXC+DCmGqesJuZ5Y8aQVVsaoO4i8tRXbXb0whChRvop/zd3nfNM4dIl5EXAky0knRX5I6w==
- }
- engines: { node: '>=12' }
+ /esbuild-darwin-arm64/0.14.48:
+ resolution: {integrity: sha512-bFjnNEXjhZT+IZ8RvRGNJthLWNHV5JkCtuOFOnjvo5pC0sk2/QVk0Qc06g2PV3J0TcU6kaPC3RN9yy9w2PSLEA==}
+ engines: {node: '>=12'}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
- /esbuild-freebsd-64/0.14.34:
- resolution:
- {
- integrity: sha512-m0HBjePhe0hAQJgtMRMNV9kMgIyV4/qSnzPx42kRMQBcPhgjAq1JRu4Il26czC+9FgpMbFkUktb07f/Lwnc6CA==
- }
- engines: { node: '>=12' }
+ /esbuild-freebsd-64/0.14.48:
+ resolution: {integrity: sha512-1NOlwRxmOsnPcWOGTB10JKAkYSb2nue0oM1AfHWunW/mv3wERfJmnYlGzL3UAOIUXZqW8GeA2mv+QGwq7DToqA==}
+ engines: {node: '>=12'}
cpu: [x64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
- /esbuild-freebsd-arm64/0.14.34:
- resolution:
- {
- integrity: sha512-cpRc2B94L1KvMPPYB4D6G39jLqpKlD3noAMY4/e86iXXXkhUYJJEtTuyNFTa9JRpWM0xCAp4mxjHjoIiLuoCLA==
- }
- engines: { node: '>=12' }
+ /esbuild-freebsd-arm64/0.14.48:
+ resolution: {integrity: sha512-gXqKdO8wabVcYtluAbikDH2jhXp+Klq5oCD5qbVyUG6tFiGhrC9oczKq3vIrrtwcxDQqK6+HDYK8Zrd4bCA9Gw==}
+ engines: {node: '>=12'}
cpu: [arm64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
- /esbuild-linux-32/0.14.34:
- resolution:
- {
- integrity: sha512-8nQaEaoW7MH/K/RlozJa+lE1ejHIr8fuPIHhc513UebRav7HtXgQvxHQ6VZRUkWtep23M6dd7UqhwO1tMOfzQQ==
- }
- engines: { node: '>=12' }
+ /esbuild-linux-32/0.14.48:
+ resolution: {integrity: sha512-ghGyDfS289z/LReZQUuuKq9KlTiTspxL8SITBFQFAFRA/IkIvDpnZnCAKTCjGXAmUqroMQfKJXMxyjJA69c/nQ==}
+ engines: {node: '>=12'}
cpu: [ia32]
os: [linux]
requiresBuild: true
dev: true
optional: true
- /esbuild-linux-64/0.14.34:
- resolution:
- {
- integrity: sha512-Y3of4qQoLLlAgf042MlrY1P+7PnN9zWj8nVtw9XQG5hcLOZLz7IKpU35oeu7n4wvyaZHwvQqDJ93gRLqdJekcQ==
- }
- engines: { node: '>=12' }
+ /esbuild-linux-64/0.14.48:
+ resolution: {integrity: sha512-vni3p/gppLMVZLghI7oMqbOZdGmLbbKR23XFARKnszCIBpEMEDxOMNIKPmMItQrmH/iJrL1z8Jt2nynY0bE1ug==}
+ engines: {node: '>=12'}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
- /esbuild-linux-arm/0.14.34:
- resolution:
- {
- integrity: sha512-9lpq1NcJqssAF7alCO6zL3gvBVVt/lKw4oetUM7OgNnRX0OWpB+ZIO9FwCrSj/dMdmgDhPLf+119zB8QxSMmAg==
- }
- engines: { node: '>=12' }
+ /esbuild-linux-arm/0.14.48:
+ resolution: {integrity: sha512-+VfSV7Akh1XUiDNXgqgY1cUP1i2vjI+BmlyXRfVz5AfV3jbpde8JTs5Q9sYgaoq5cWfuKfoZB/QkGOI+QcL1Tw==}
+ engines: {node: '>=12'}
cpu: [arm]
os: [linux]
requiresBuild: true
dev: true
optional: true
- /esbuild-linux-arm64/0.14.34:
- resolution:
- {
- integrity: sha512-IlWaGtj9ir7+Nrume1DGcyzBDlK8GcnJq0ANKwcI9pVw8tqr+6GD0eqyF9SF1mR8UmAp+odrx1H5NdR2cHdFHA==
- }
- engines: { node: '>=12' }
+ /esbuild-linux-arm64/0.14.48:
+ resolution: {integrity: sha512-3CFsOlpoxlKPRevEHq8aAntgYGYkE1N9yRYAcPyng/p4Wyx0tPR5SBYsxLKcgPB9mR8chHEhtWYz6EZ+H199Zw==}
+ engines: {node: '>=12'}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
- /esbuild-linux-mips64le/0.14.34:
- resolution:
- {
- integrity: sha512-k3or+01Rska1AjUyNjA4buEwB51eyN/xPQAoOx1CjzAQC3l8rpjUDw55kXyL63O/1MUi4ISvtNtl8gLwdyEcxw==
- }
- engines: { node: '>=12' }
+ /esbuild-linux-mips64le/0.14.48:
+ resolution: {integrity: sha512-cs0uOiRlPp6ymknDnjajCgvDMSsLw5mST2UXh+ZIrXTj2Ifyf2aAP3Iw4DiqgnyYLV2O/v/yWBJx+WfmKEpNLA==}
+ engines: {node: '>=12'}
cpu: [mips64el]
os: [linux]
requiresBuild: true
dev: true
optional: true
- /esbuild-linux-ppc64le/0.14.34:
- resolution:
- {
- integrity: sha512-+qxb8M9FfM2CJaVU7GgYpJOHM1ngQOx+/VrtBjb4C8oVqaPcESCeg2anjl+HRZy8VpYc71q/iBYausPPbJ+Keg==
- }
- engines: { node: '>=12' }
+ /esbuild-linux-ppc64le/0.14.48:
+ resolution: {integrity: sha512-+2F0vJMkuI0Wie/wcSPDCqXvSFEELH7Jubxb7mpWrA/4NpT+/byjxDz0gG6R1WJoeDefcrMfpBx4GFNN1JQorQ==}
+ engines: {node: '>=12'}
cpu: [ppc64]
os: [linux]
requiresBuild: true
dev: true
optional: true
- /esbuild-linux-riscv64/0.14.34:
- resolution:
- {
- integrity: sha512-Y717ltBdQ5j5sZIHdy1DV9kieo0wMip0dCmVSTceowCPYSn1Cg33Kd6981+F/3b9FDMzNWldZFOBRILViENZSA==
- }
- engines: { node: '>=12' }
+ /esbuild-linux-riscv64/0.14.48:
+ resolution: {integrity: sha512-BmaK/GfEE+5F2/QDrIXteFGKnVHGxlnK9MjdVKMTfvtmudjY3k2t8NtlY4qemKSizc+QwyombGWTBDc76rxePA==}
+ engines: {node: '>=12'}
cpu: [riscv64]
os: [linux]
requiresBuild: true
dev: true
optional: true
- /esbuild-linux-s390x/0.14.34:
- resolution:
- {
- integrity: sha512-bDDgYO4LhL4+zPs+WcBkXph+AQoPcQRTv18FzZS0WhjfH8TZx2QqlVPGhmhZ6WidrY+jKthUqO6UhGyIb4MpmA==
- }
- engines: { node: '>=12' }
+ /esbuild-linux-s390x/0.14.48:
+ resolution: {integrity: sha512-tndw/0B9jiCL+KWKo0TSMaUm5UWBLsfCKVdbfMlb3d5LeV9WbijZ8Ordia8SAYv38VSJWOEt6eDCdOx8LqkC4g==}
+ engines: {node: '>=12'}
cpu: [s390x]
os: [linux]
requiresBuild: true
dev: true
optional: true
- /esbuild-netbsd-64/0.14.34:
- resolution:
- {
- integrity: sha512-cfaFGXdRt0+vHsjNPyF0POM4BVSHPSbhLPe8mppDc7GDDxjIl08mV1Zou14oDWMp/XZMjYN1kWYRSfftiD0vvQ==
- }
- engines: { node: '>=12' }
+ /esbuild-netbsd-64/0.14.48:
+ resolution: {integrity: sha512-V9hgXfwf/T901Lr1wkOfoevtyNkrxmMcRHyticybBUHookznipMOHoF41Al68QBsqBxnITCEpjjd4yAos7z9Tw==}
+ engines: {node: '>=12'}
cpu: [x64]
os: [netbsd]
requiresBuild: true
dev: true
optional: true
- /esbuild-openbsd-64/0.14.34:
- resolution:
- {
- integrity: sha512-vmy9DxXVnRiI14s8GKuYBtess+EVcDALkbpTqd5jw4XITutIzyB7n4x0Tj5utAkKsgZJB22lLWGekr0ABnSLow==
- }
- engines: { node: '>=12' }
+ /esbuild-openbsd-64/0.14.48:
+ resolution: {integrity: sha512-+IHf4JcbnnBl4T52egorXMatil/za0awqzg2Vy6FBgPcBpisDWT2sVz/tNdrK9kAqj+GZG/jZdrOkj7wsrNTKA==}
+ engines: {node: '>=12'}
cpu: [x64]
os: [openbsd]
requiresBuild: true
dev: true
optional: true
- /esbuild-sunos-64/0.14.34:
- resolution:
- {
- integrity: sha512-eNPVatNET1F7tRMhii7goL/eptfxc0ALRjrj9SPFNqp0zmxrehBFD6BaP3R4LjMn6DbMO0jOAnTLFKr8NqcJAA==
- }
- engines: { node: '>=12' }
+ /esbuild-sunos-64/0.14.48:
+ resolution: {integrity: sha512-77m8bsr5wOpOWbGi9KSqDphcq6dFeJyun8TA+12JW/GAjyfTwVtOnN8DOt6DSPUfEV+ltVMNqtXUeTeMAxl5KA==}
+ engines: {node: '>=12'}
cpu: [x64]
os: [sunos]
requiresBuild: true
dev: true
optional: true
- /esbuild-windows-32/0.14.34:
- resolution:
- {
- integrity: sha512-EFhpXyHEcnqWYe2rAHFd8dRw8wkrd9U+9oqcyoEL84GbanAYjiiIjBZsnR8kl0sCQ5w6bLpk7vCEIA2VS32Vcg==
- }
- engines: { node: '>=12' }
+ /esbuild-windows-32/0.14.48:
+ resolution: {integrity: sha512-EPgRuTPP8vK9maxpTGDe5lSoIBHGKO/AuxDncg5O3NkrPeLNdvvK8oywB0zGaAZXxYWfNNSHskvvDgmfVTguhg==}
+ engines: {node: '>=12'}
cpu: [ia32]
os: [win32]
requiresBuild: true
dev: true
optional: true
- /esbuild-windows-64/0.14.34:
- resolution:
- {
- integrity: sha512-a8fbl8Ky7PxNEjf1aJmtxdDZj32/hC7S1OcA2ckEpCJRTjiKslI9vAdPpSjrKIWhws4Galpaawy0nB7fjHYf5Q==
- }
- engines: { node: '>=12' }
+ /esbuild-windows-64/0.14.48:
+ resolution: {integrity: sha512-YmpXjdT1q0b8ictSdGwH3M8VCoqPpK1/UArze3X199w6u8hUx3V8BhAi1WjbsfDYRBanVVtduAhh2sirImtAvA==}
+ engines: {node: '>=12'}
cpu: [x64]
os: [win32]
requiresBuild: true
dev: true
optional: true
- /esbuild-windows-arm64/0.14.34:
- resolution:
- {
- integrity: sha512-EYvmKbSa2B3sPnpC28UEu9jBK5atGV4BaVRE7CYGUci2Hlz4AvtV/LML+TcDMT6gBgibnN2gcltWclab3UutMg==
- }
- engines: { node: '>=12' }
+ /esbuild-windows-arm64/0.14.48:
+ resolution: {integrity: sha512-HHaOMCsCXp0rz5BT2crTka6MPWVno121NKApsGs/OIW5QC0ggC69YMGs1aJct9/9FSUF4A1xNE/cLvgB5svR4g==}
+ engines: {node: '>=12'}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
- /esbuild/0.14.34:
- resolution:
- {
- integrity: sha512-QIWdPT/gFF6hCaf4m7kP0cJ+JIuFkdHibI7vVFvu3eJS1HpVmYHWDulyN5WXwbRA0SX/7ZDaJ/1DH8SdY9xOJg==
- }
- engines: { node: '>=12' }
+ /esbuild/0.14.48:
+ resolution: {integrity: sha512-w6N1Yn5MtqK2U1/WZTX9ZqUVb8IOLZkZ5AdHkT6x3cHDMVsYWC7WPdiLmx19w3i4Rwzy5LqsEMtVihG3e4rFzA==}
+ engines: {node: '>=12'}
hasBin: true
requiresBuild: true
optionalDependencies:
- esbuild-android-64: 0.14.34
- esbuild-android-arm64: 0.14.34
- esbuild-darwin-64: 0.14.34
- esbuild-darwin-arm64: 0.14.34
- esbuild-freebsd-64: 0.14.34
- esbuild-freebsd-arm64: 0.14.34
- esbuild-linux-32: 0.14.34
- esbuild-linux-64: 0.14.34
- esbuild-linux-arm: 0.14.34
- esbuild-linux-arm64: 0.14.34
- esbuild-linux-mips64le: 0.14.34
- esbuild-linux-ppc64le: 0.14.34
- esbuild-linux-riscv64: 0.14.34
- esbuild-linux-s390x: 0.14.34
- esbuild-netbsd-64: 0.14.34
- esbuild-openbsd-64: 0.14.34
- esbuild-sunos-64: 0.14.34
- esbuild-windows-32: 0.14.34
- esbuild-windows-64: 0.14.34
- esbuild-windows-arm64: 0.14.34
+ esbuild-android-64: 0.14.48
+ esbuild-android-arm64: 0.14.48
+ esbuild-darwin-64: 0.14.48
+ esbuild-darwin-arm64: 0.14.48
+ esbuild-freebsd-64: 0.14.48
+ esbuild-freebsd-arm64: 0.14.48
+ esbuild-linux-32: 0.14.48
+ esbuild-linux-64: 0.14.48
+ esbuild-linux-arm: 0.14.48
+ esbuild-linux-arm64: 0.14.48
+ esbuild-linux-mips64le: 0.14.48
+ esbuild-linux-ppc64le: 0.14.48
+ esbuild-linux-riscv64: 0.14.48
+ esbuild-linux-s390x: 0.14.48
+ esbuild-netbsd-64: 0.14.48
+ esbuild-openbsd-64: 0.14.48
+ esbuild-sunos-64: 0.14.48
+ esbuild-windows-32: 0.14.48
+ esbuild-windows-64: 0.14.48
+ esbuild-windows-arm64: 0.14.48
dev: true
/escalade/3.1.1:
- resolution:
- {
- integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
- }
- engines: { node: '>=6' }
+ resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
+ engines: {node: '>=6'}
dev: true
+ /escape-html/1.0.3:
+ resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==}
+ dev: false
+
/escape-string-regexp/1.0.5:
- resolution: { integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= }
- engines: { node: '>=0.8.0' }
- dev: true
+ resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==}
+ engines: {node: '>=0.8.0'}
/escape-string-regexp/4.0.0:
- resolution:
- {
- integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
- }
- engines: { node: '>=10' }
- dev: true
-
- /eslint-config-prettier/[email protected]:
- resolution:
- {
- integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
- }
+ resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
+ engines: {node: '>=10'}
+ dev: true
+
+ /eslint-config-prettier/[email protected]:
+ resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==}
hasBin: true
peerDependencies:
eslint: '>=7.0.0'
dependencies:
- eslint: 7.32.0
+ eslint: 8.19.0
+ dev: true
+
+ /eslint-plugin-prettier/4.2.1_7uxdfn2xinezdgvmbammh6ev5i:
+ resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==}
+ engines: {node: '>=12.0.0'}
+ peerDependencies:
+ eslint: '>=7.28.0'
+ eslint-config-prettier: '*'
+ prettier: '>=2.0.0'
+ peerDependenciesMeta:
+ eslint-config-prettier:
+ optional: true
+ dependencies:
+ eslint: 8.19.0
+ eslint-config-prettier: [email protected]
+ prettier: 2.7.1
+ prettier-linter-helpers: 1.0.0
dev: true
- /eslint-plugin-svelte3/3.4.1_6wevxxng4y4ff26nzlndg2wnpa:
- resolution:
- {
- integrity: sha512-7p59WG8qV8L6wLdl4d/c3mdjkgVglQCdv5XOTk/iNPBKXuuV+Q0eFP5Wa6iJd/G2M1qR3BkLPEzaANOqKAZczw==
- }
- engines: { node: '>=10' }
+ /eslint-plugin-svelte3/4.0.0_m4jpobot6gi3xtcba7bv5cflma:
+ resolution: {integrity: sha512-OIx9lgaNzD02+MDFNLw0GEUbuovNcglg+wnd/UY0fbZmlQSz7GlQiQ1f+yX0XvC07XPcDOnFcichqI3xCwp71g==}
peerDependencies:
- eslint: '>=6.0.0'
+ eslint: '>=8.0.0'
svelte: ^3.2.0
dependencies:
- eslint: 7.32.0
+ eslint: 8.19.0
svelte: 3.48.0
dev: true
/eslint-scope/5.1.1:
- resolution:
- {
- integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==
- }
- engines: { node: '>=8.0.0' }
+ resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}
+ engines: {node: '>=8.0.0'}
dependencies:
esrecurse: 4.3.0
estraverse: 4.3.0
dev: true
- /eslint-utils/2.1.0:
- resolution:
- {
- integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==
- }
- engines: { node: '>=6' }
+ /eslint-scope/7.1.1:
+ resolution: {integrity: sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
- eslint-visitor-keys: 1.3.0
+ esrecurse: 4.3.0
+ estraverse: 5.3.0
dev: true
- /eslint-utils/[email protected]:
- resolution:
- {
- integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==
- }
- engines: { node: ^10.0.0 || ^12.0.0 || >= 14.0.0 }
+ /eslint-utils/[email protected]:
+ resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==}
+ engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0}
peerDependencies:
eslint: '>=5'
dependencies:
- eslint: 7.32.0
+ eslint: 8.19.0
eslint-visitor-keys: 2.1.0
dev: true
- /eslint-visitor-keys/1.3.0:
- resolution:
- {
- integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==
- }
- engines: { node: '>=4' }
+ /eslint-visitor-keys/2.1.0:
+ resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==}
+ engines: {node: '>=10'}
+ dev: true
+
+ /eslint-visitor-keys/3.3.0:
+ resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
- /eslint-visitor-keys/2.1.0:
- resolution:
- {
- integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
- }
- engines: { node: '>=10' }
- dev: true
-
- /eslint/7.32.0:
- resolution:
- {
- integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==
- }
- engines: { node: ^10.12.0 || >=12.0.0 }
+ /eslint/8.19.0:
+ resolution: {integrity: sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
hasBin: true
dependencies:
- '@babel/code-frame': 7.12.11
- '@eslint/eslintrc': 0.4.3
- '@humanwhocodes/config-array': 0.5.0
+ '@eslint/eslintrc': 1.3.0
+ '@humanwhocodes/config-array': 0.9.5
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.3
- debug: 4.3.3
+ debug: 4.3.4
doctrine: 3.0.0
- enquirer: 2.3.6
escape-string-regexp: 4.0.0
- eslint-scope: 5.1.1
- eslint-utils: 2.1.0
- eslint-visitor-keys: 2.1.0
- espree: 7.3.1
+ eslint-scope: 7.1.1
+ eslint-utils: [email protected]
+ eslint-visitor-keys: 3.3.0
+ espree: 9.3.2
esquery: 1.4.0
esutils: 2.0.3
fast-deep-equal: 3.1.3
file-entry-cache: 6.0.1
functional-red-black-tree: 1.0.1
- glob-parent: 5.1.2
- globals: 13.12.0
- ignore: 4.0.6
+ glob-parent: 6.0.2
+ globals: 13.15.0
+ ignore: 5.2.0
import-fresh: 3.3.0
imurmurhash: 0.1.4
is-glob: 4.0.3
- js-yaml: 3.14.1
+ js-yaml: 4.1.0
json-stable-stringify-without-jsonify: 1.0.1
levn: 0.4.1
lodash.merge: 4.6.2
- minimatch: 3.0.4
+ minimatch: 3.1.2
natural-compare: 1.4.0
optionator: 0.9.1
- progress: 2.0.3
regexpp: 3.2.0
- semver: 7.3.5
strip-ansi: 6.0.1
strip-json-comments: 3.1.1
- table: 6.7.2
text-table: 0.2.0
v8-compile-cache: 2.3.0
transitivePeerDependencies:
- supports-color
dev: true
- /espree/7.3.1:
- resolution:
- {
- integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==
- }
- engines: { node: ^10.12.0 || >=12.0.0 }
+ /espree/9.3.2:
+ resolution: {integrity: sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
- acorn: 7.4.1
- acorn-jsx: [email protected]
- eslint-visitor-keys: 1.3.0
- dev: true
-
- /esprima/4.0.1:
- resolution:
- {
- integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
- }
- engines: { node: '>=4' }
- hasBin: true
+ acorn: 8.7.1
+ acorn-jsx: [email protected]
+ eslint-visitor-keys: 3.3.0
dev: true
/esquery/1.4.0:
- resolution:
- {
- integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==
- }
- engines: { node: '>=0.10' }
+ resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==}
+ engines: {node: '>=0.10'}
dependencies:
estraverse: 5.3.0
dev: true
/esrecurse/4.3.0:
- resolution:
- {
- integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==
- }
- engines: { node: '>=4.0' }
+ resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
+ engines: {node: '>=4.0'}
dependencies:
estraverse: 5.3.0
dev: true
/estraverse/4.3.0:
- resolution:
- {
- integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
- }
- engines: { node: '>=4.0' }
+ resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==}
+ engines: {node: '>=4.0'}
dev: true
/estraverse/5.3.0:
- resolution:
- {
- integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
- }
- engines: { node: '>=4.0' }
+ resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
+ engines: {node: '>=4.0'}
+ dev: true
+
+ /estree-walker/0.6.1:
+ resolution: {integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==}
dev: true
/estree-walker/2.0.2:
- resolution:
- {
- integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
- }
+ resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
dev: true
/esutils/2.0.3:
- resolution:
- {
- integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
- }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
+ engines: {node: '>=0.10.0'}
dev: true
- /execa/5.1.1:
- resolution:
- {
- integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==
- }
- engines: { node: '>=10' }
- dependencies:
- cross-spawn: 7.0.3
- get-stream: 6.0.1
- human-signals: 2.1.0
- is-stream: 2.0.1
- merge-stream: 2.0.0
- npm-run-path: 4.0.1
- onetime: 5.1.2
- signal-exit: 3.0.5
- strip-final-newline: 2.0.0
- dev: true
+ /etag/1.8.1:
+ resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
+ engines: {node: '>= 0.6'}
+ dev: false
+
+ /event-target-shim/5.0.1:
+ resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /eventemitter3/4.0.7:
+ resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==}
+ dev: false
/exit/0.1.2:
- resolution: { integrity: sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= }
- engines: { node: '>= 0.8.0' }
+ resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==}
+ engines: {node: '>= 0.8.0'}
dev: true
/fast-deep-equal/3.1.3:
- resolution:
- {
- integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
- }
+ resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
+
+ /fast-diff/1.2.0:
+ resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==}
dev: true
/fast-glob/3.2.11:
- resolution:
- {
- integrity: sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==
- }
- engines: { node: '>=8.6.0' }
+ resolution: {integrity: sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==}
+ engines: {node: '>=8.6.0'}
dependencies:
'@nodelib/fs.stat': 2.0.5
'@nodelib/fs.walk': 1.2.8
glob-parent: 5.1.2
merge2: 1.4.1
- micromatch: 4.0.4
+ micromatch: 4.0.5
+ dev: true
/fast-json-stable-stringify/2.1.0:
- resolution:
- {
- integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
- }
+ resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
dev: true
+ /fast-json-stringify/5.0.5:
+ resolution: {integrity: sha512-NGXE7I6dBcSTM1pprcLEIQ6nHp424mDn8ABleM17Sp7XkyPLlbIDed41/VhUiqnLICX7XiOoFsNHx/nnJ8qhig==}
+ dependencies:
+ ajv: 8.11.0
+ ajv-formats: 2.1.1
+ deepmerge: 4.2.2
+ fast-uri: 2.1.0
+ rfdc: 1.3.0
+ dev: false
+
+ /fast-jwt/1.5.4:
+ resolution: {integrity: sha512-Rhu6YhZzskOjAUx/yD4PsnhCAqGhtvLqrtxvTEewE+GKaoJfC/IX+B+WDiDyR+jwfyB3ToXuMo0w0qDs9SHG/w==}
+ engines: {node: ^18 || ^17 || ^16 || ^14 || ^12}
+ dependencies:
+ asn1.js: 5.4.1
+ ecdsa-sig-formatter: 1.0.11
+ mnemonist: 0.39.1
+ dev: false
+
/fast-levenshtein/2.0.6:
- resolution: { integrity: sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= }
+ resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
dev: true
+ /fast-redact/3.1.1:
+ resolution: {integrity: sha512-odVmjC8x8jNeMZ3C+rPMESzXVSEU8tSWSHv9HFxP2mm89G/1WwqhrerJDQm9Zus8X6aoRgQDThKqptdNA6bt+A==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /fast-safe-stringify/2.1.1:
+ resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==}
+ dev: false
+
+ /fast-uri/2.1.0:
+ resolution: {integrity: sha512-qKRta6N7BWEFVlyonVY/V+BMLgFqktCUV0QjT259ekAIlbVrMaFnFLxJ4s/JPl4tou56S1BzPufI60bLe29fHA==}
+ dev: false
+
+ /fastfall/1.5.1:
+ resolution: {integrity: sha512-KH6p+Z8AKPXnmA7+Iz2Lh8ARCMr+8WNPVludm1LGkZoD2MjY6LVnRMtTKhkdzI+jr0RzQWXKzKyBJm1zoHEL4Q==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ reusify: 1.0.4
+ dev: false
+
+ /fastify-plugin/3.0.1:
+ resolution: {integrity: sha512-qKcDXmuZadJqdTm6vlCqioEbyewF60b/0LOFCcYN1B6BIZGlYJumWWOYs70SFYLDAH4YqdE1cxH/RKMG7rFxgA==}
+ dev: false
+
+ /fastify/4.2.0:
+ resolution: {integrity: sha512-0QXEp+8ceKc0fwVakeBLM/1Ss/+fc7a3auuygT+1GjbSAgHfwqxSucUuu0rYjziu32UgEZXfjItYN/a89HWKhw==}
+ dependencies:
+ '@fastify/ajv-compiler': 3.1.1
+ '@fastify/error': 3.0.0
+ '@fastify/fast-json-stringify-compiler': 4.0.0
+ abstract-logging: 2.0.1
+ avvio: 8.1.3
+ find-my-way: 7.0.0
+ light-my-request: 5.0.0
+ pino: 8.1.0
+ process-warning: 2.0.0
+ proxy-addr: 2.0.7
+ rfdc: 1.3.0
+ secure-json-parse: 2.4.0
+ semver: 7.3.7
+ tiny-lru: 8.0.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /fastparallel/2.4.1:
+ resolution: {integrity: sha512-qUmhxPgNHmvRjZKBFUNI0oZuuH9OlSIOXmJ98lhKPxMZZ7zS/Fi0wRHOihDSz0R1YiIOjxzOY4bq65YTcdBi2Q==}
+ dependencies:
+ reusify: 1.0.4
+ xtend: 4.0.2
+ dev: false
+
/fastq/1.13.0:
- resolution:
- {
- integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==
- }
+ resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==}
+ dependencies:
+ reusify: 1.0.4
+
+ /fastseries/1.7.2:
+ resolution: {integrity: sha512-dTPFrPGS8SNSzAt7u/CbMKCJ3s01N04s4JFbORHcmyvVfVKmbhMD1VtRbh5enGHxkaQDqWyLefiKOGGmohGDDQ==}
dependencies:
reusify: 1.0.4
+ xtend: 4.0.2
+ dev: false
/file-entry-cache/6.0.1:
- resolution:
- {
- integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==
- }
- engines: { node: ^10.12.0 || >=12.0.0 }
+ resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
+ engines: {node: ^10.12.0 || >=12.0.0}
dependencies:
flat-cache: 3.0.4
dev: true
+ /file-uri-to-path/1.0.0:
+ resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==}
+ dev: true
+
/fill-range/7.0.1:
- resolution:
- {
- integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
+ engines: {node: '>=8'}
dependencies:
to-regex-range: 5.0.1
+ dev: true
+
+ /find-my-way/7.0.0:
+ resolution: {integrity: sha512-NHVohYPYRXgj6jxXVRwm4iMQjA2ggJpyewHz7Nq7hvBnHoYJJIyHuxNzs8QLPTLQfoqxZzls2g6Zm79XMbhXjA==}
+ engines: {node: '>=14'}
+ dependencies:
+ fast-deep-equal: 3.1.3
+ safe-regex2: 2.0.0
+ dev: false
+
+ /find-up/3.0.0:
+ resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==}
+ engines: {node: '>=6'}
+ dependencies:
+ locate-path: 3.0.0
+ dev: false
+
+ /find-up/4.1.0:
+ resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
+ engines: {node: '>=8'}
+ dependencies:
+ locate-path: 5.0.0
+ path-exists: 4.0.0
+ dev: false
/flat-cache/3.0.4:
- resolution:
- {
- integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==
- }
- engines: { node: ^10.12.0 || >=12.0.0 }
+ resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==}
+ engines: {node: ^10.12.0 || >=12.0.0}
dependencies:
- flatted: 3.2.2
+ flatted: 3.2.5
rimraf: 3.0.2
dev: true
- /flatted/3.2.2:
- resolution:
- {
- integrity: sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==
- }
+ /flatted/3.2.5:
+ resolution: {integrity: sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==}
dev: true
+ /follow-redirects/1.15.0:
+ resolution: {integrity: sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==}
+ engines: {node: '>=4.0'}
+ peerDependencies:
+ debug: '*'
+ peerDependenciesMeta:
+ debug:
+ optional: true
+ dev: false
+
/form-data-encoder/1.7.1:
- resolution:
- {
- integrity: sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==
- }
+ resolution: {integrity: sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==}
+ dev: false
+
+ /form-data/4.0.0:
+ resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
+ engines: {node: '>= 6'}
+ dependencies:
+ asynckit: 0.4.0
+ combined-stream: 1.0.8
+ mime-types: 2.1.35
+ dev: false
+
+ /format-specifiers/1.0.0:
+ resolution: {integrity: sha512-/xcmy6xn/DsR+V6flFj3E47yCbrsk70r90moAMENVkKckUPUG9CRE79S/2xajLVx1iADIoWx+1R304uMXB/riQ==}
+ dev: false
+
+ /formidable/2.0.1:
+ resolution: {integrity: sha512-rjTMNbp2BpfQShhFbR3Ruk3qk2y9jKpvMW78nJgx8QKtxjDVrwbZG+wvDOmVbifHyOUOQJXxqEy6r0faRrPzTQ==}
+ dependencies:
+ dezalgo: 1.0.3
+ hexoid: 1.0.0
+ once: 1.4.0
+ qs: 6.9.3
+ dev: false
+
+ /forwarded/0.2.0:
+ resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==}
+ engines: {node: '>= 0.6'}
dev: false
/fraction.js/4.2.0:
- resolution:
- {
- integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==
- }
+ resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==}
dev: true
+ /fresh/0.5.2:
+ resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==}
+ engines: {node: '>= 0.6'}
+ dev: false
+
/fs-constants/1.0.0:
- resolution:
- {
- integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
- }
+ resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
dev: false
+ /fs-minipass/2.1.0:
+ resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==}
+ engines: {node: '>= 8'}
+ dependencies:
+ minipass: 3.1.6
+ dev: true
+
/fs.realpath/1.0.0:
- resolution: { integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8= }
+ resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=}
/fsevents/2.3.2:
- resolution:
- {
- integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
- }
- engines: { node: ^8.16.0 || ^10.6.0 || >=11.0.0 }
+ resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
+ engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
requiresBuild: true
+ dev: true
optional: true
/function-bind/1.1.1:
- resolution:
- {
- integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
- }
+ resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
/function.name/1.0.13:
- resolution:
- {
- integrity: sha512-mVrqdoy5npWZyoXl4DxCeuVF6delDcQjVS9aPdvLYlBxtMTZDR2B5GVEQEoM1jJyspCqg3C0v4ABkLE7tp9xFA==
- }
+ resolution: {integrity: sha512-mVrqdoy5npWZyoXl4DxCeuVF6delDcQjVS9aPdvLYlBxtMTZDR2B5GVEQEoM1jJyspCqg3C0v4ABkLE7tp9xFA==}
dependencies:
noop6: 1.0.9
dev: false
+ /function.prototype.name/1.1.5:
+ resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.1.4
+ es-abstract: 1.20.1
+ functions-have-names: 1.2.3
+ dev: true
+
/functional-red-black-tree/1.0.1:
- resolution: { integrity: sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= }
+ resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==}
+ dev: true
+
+ /functions-have-names/1.2.3:
+ resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==}
+ dev: true
+
+ /gauge/3.0.2:
+ resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==}
+ engines: {node: '>=10'}
+ dependencies:
+ aproba: 2.0.0
+ color-support: 1.1.3
+ console-control-strings: 1.1.0
+ has-unicode: 2.0.1
+ object-assign: 4.1.1
+ signal-exit: 3.0.7
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ wide-align: 1.1.5
dev: true
/generate-password/1.7.0:
- resolution:
- {
- integrity: sha512-WPCtlfy0jexf7W5IbwxGUgpIDvsZIohbI2DAq2Q6TSlKKis+G4GT9sxvPxrZUGL8kP6WUXMWNqYnxY6DDKAdFA==
- }
+ resolution: {integrity: sha512-WPCtlfy0jexf7W5IbwxGUgpIDvsZIohbI2DAq2Q6TSlKKis+G4GT9sxvPxrZUGL8kP6WUXMWNqYnxY6DDKAdFA==}
dev: false
- /get-port/5.1.1:
- resolution:
- {
- integrity: sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==
- }
- engines: { node: '>=8' }
- dev: false
+ /get-intrinsic/1.1.1:
+ resolution: {integrity: sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==}
+ dependencies:
+ function-bind: 1.1.1
+ has: 1.0.3
+ has-symbols: 1.0.3
/get-port/6.1.2:
- resolution:
- {
- integrity: sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==
- }
- engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
+ resolution: {integrity: sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dev: false
/get-stream/5.2.0:
- resolution:
- {
- integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==}
+ engines: {node: '>=8'}
dependencies:
pump: 3.0.0
dev: false
/get-stream/6.0.1:
- resolution:
- {
- integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==
- }
- engines: { node: '>=10' }
+ resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==}
+ engines: {node: '>=10'}
+ dev: false
+
+ /get-symbol-description/1.0.0:
+ resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ get-intrinsic: 1.1.1
+ dev: true
/glob-parent/5.1.2:
- resolution:
- {
- integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
- }
- engines: { node: '>= 6' }
+ resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
+ engines: {node: '>= 6'}
dependencies:
is-glob: 4.0.3
+ dev: true
/glob-parent/6.0.2:
- resolution:
- {
- integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==
- }
- engines: { node: '>=10.13.0' }
+ resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}
+ engines: {node: '>=10.13.0'}
dependencies:
is-glob: 4.0.3
+ dev: true
- /glob/7.2.0:
- resolution:
- {
- integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
- }
+ /glob/7.2.3:
+ resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
dependencies:
fs.realpath: 1.0.0
inflight: 1.0.6
inherits: 2.0.4
- minimatch: 3.0.4
+ minimatch: 3.1.2
once: 1.4.0
path-is-absolute: 1.0.1
+ dev: true
+
+ /glob/8.0.3:
+ resolution: {integrity: sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==}
+ engines: {node: '>=12'}
+ dependencies:
+ fs.realpath: 1.0.0
+ inflight: 1.0.6
+ inherits: 2.0.4
+ minimatch: 5.1.0
+ once: 1.4.0
+ dev: false
- /globals/13.12.0:
- resolution:
- {
- integrity: sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==
- }
- engines: { node: '>=8' }
+ /globals/13.15.0:
+ resolution: {integrity: sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==}
+ engines: {node: '>=8'}
dependencies:
type-fest: 0.20.2
dev: true
/globals/9.18.0:
- resolution:
- {
- integrity: sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==
- }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==}
+ engines: {node: '>=0.10.0'}
dev: true
/globalyzer/0.1.0:
- resolution:
- {
- integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==
- }
- dev: true
+ resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==}
- /globby/11.0.4:
- resolution:
- {
- integrity: sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==
- }
- engines: { node: '>=10' }
+ /globby/11.1.0:
+ resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
+ engines: {node: '>=10'}
dependencies:
array-union: 2.1.0
dir-glob: 3.0.1
fast-glob: 3.2.11
- ignore: 5.1.8
+ ignore: 5.2.0
merge2: 1.4.1
slash: 3.0.0
dev: true
/globrex/0.1.2:
- resolution:
- {
- integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==
- }
- dev: true
+ resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
- /got/12.0.4:
- resolution:
- {
- integrity: sha512-2Eyz4iU/ktq7wtMFXxzK7g5p35uNYLLdiZarZ5/Yn3IJlNEpBd5+dCgcAyxN8/8guZLszffwe3wVyw+DEVrpBg==
- }
- engines: { node: '>=14.16' }
+ /got/12.1.0:
+ resolution: {integrity: sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig==}
+ engines: {node: '>=14.16'}
dependencies:
'@sindresorhus/is': 4.6.0
'@szmarczak/http-timer': 5.0.1
@@ -3175,370 +3226,436 @@ packages:
decompress-response: 6.0.0
form-data-encoder: 1.7.1
get-stream: 6.0.1
- http2-wrapper: 2.1.10
+ http2-wrapper: 2.1.11
lowercase-keys: 3.0.0
p-cancelable: 3.0.0
responselike: 2.0.0
dev: false
- /graceful-fs/4.2.8:
- resolution:
- {
- integrity: sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==
- }
+ /graceful-fs/4.2.10:
+ resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==}
dev: true
/has-ansi/2.0.0:
- resolution: { integrity: sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==}
+ engines: {node: '>=0.10.0'}
dependencies:
ansi-regex: 2.1.1
dev: true
- /has-flag/3.0.0:
- resolution: { integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0= }
- engines: { node: '>=4' }
+ /has-bigints/1.0.2:
+ resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==}
dev: true
+ /has-flag/3.0.0:
+ resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
+ engines: {node: '>=4'}
+
/has-flag/4.0.0:
- resolution:
- {
- integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
+ engines: {node: '>=8'}
+ dev: true
+
+ /has-property-descriptors/1.0.0:
+ resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==}
+ dependencies:
+ get-intrinsic: 1.1.1
+ dev: true
+
+ /has-symbols/1.0.3:
+ resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==}
+ engines: {node: '>= 0.4'}
+
+ /has-tostringtag/1.0.0:
+ resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-symbols: 1.0.3
+ dev: true
+
+ /has-unicode/2.0.1:
+ resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==}
dev: true
/has/1.0.3:
- resolution:
- {
- integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
- }
- engines: { node: '>= 0.4.0' }
+ resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==}
+ engines: {node: '>= 0.4.0'}
dependencies:
function-bind: 1.1.1
+ /hexoid/1.0.0:
+ resolution: {integrity: sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==}
+ engines: {node: '>=8'}
+ dev: false
+
/home-or-tmp/2.0.0:
- resolution: { integrity: sha1-42w/LSyufXRqhX440Y1fMqeILbg= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-ycURW7oUxE2sNiPVw1HVEFsW+ecOpJ5zaj7eC0RlwhibhRBod20muUN8qu/gzx956YrLolVvs1MTXwKgC2rVEg==}
+ engines: {node: '>=0.10.0'}
dependencies:
os-homedir: 1.0.2
os-tmpdir: 1.0.2
dev: true
+ /hosted-git-info/2.8.9:
+ resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}
+
/http-cache-semantics/4.1.0:
- resolution:
- {
- integrity: sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==
- }
+ resolution: {integrity: sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==}
dev: false
- /http2-wrapper/2.1.10:
- resolution:
- {
- integrity: sha512-QHgsdYkieKp+6JbXP25P+tepqiHYd+FVnDwXpxi/BlUcoIB0nsmTOymTNvETuTO+pDuwcSklPE72VR3DqV+Haw==
- }
- engines: { node: '>=10.19.0' }
+ /http-errors/2.0.0:
+ resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==}
+ engines: {node: '>= 0.8'}
+ dependencies:
+ depd: 2.0.0
+ inherits: 2.0.4
+ setprototypeof: 1.2.0
+ statuses: 2.0.1
+ toidentifier: 1.0.1
+ dev: false
+
+ /http-headers/3.0.2:
+ resolution: {integrity: sha512-87E1I+2Wg4dxxz4rcxElo3dxO/w1ZtgL1yA0Sb6vH3qU16vRKq1NjWQv9SCY3ly2OQROcoxHZOUpmelS+k6wOw==}
+ dependencies:
+ next-line: 1.1.0
+ dev: false
+
+ /http2-wrapper/2.1.11:
+ resolution: {integrity: sha512-aNAk5JzLturWEUiuhAN73Jcbq96R7rTitAoXV54FYMatvihnpD2+6PUgU4ce3D/m5VDbw+F5CsyKSF176ptitQ==}
+ engines: {node: '>=10.19.0'}
dependencies:
quick-lru: 5.1.1
resolve-alpn: 1.2.1
dev: false
- /https-proxy-agent/5.0.0:
- resolution:
- {
- integrity: sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==
- }
- engines: { node: '>= 6' }
+ /https-proxy-agent/5.0.1:
+ resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
+ engines: {node: '>= 6'}
dependencies:
agent-base: 6.0.2
- debug: 4.3.3
+ debug: 4.3.4
transitivePeerDependencies:
- supports-color
- dev: false
-
- /human-signals/2.1.0:
- resolution:
- {
- integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==
- }
- engines: { node: '>=10.17.0' }
dev: true
- /husky/7.0.4:
- resolution:
- {
- integrity: sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==
- }
- engines: { node: '>=12' }
- hasBin: true
- dev: true
+ /human-interval/2.0.1:
+ resolution: {integrity: sha512-r4Aotzf+OtKIGQCB3odUowy4GfUDTy3aTWTfLd7ZF2gBCy3XW3v/dJLRefZnOFFnjqs5B1TypvS8WarpBkYUNQ==}
+ dependencies:
+ numbered: 1.1.0
+ dev: false
/ieee754/1.2.1:
- resolution:
- {
- integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
- }
+ resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
dev: false
- /ignore/4.0.6:
- resolution:
- {
- integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==
- }
- engines: { node: '>= 4' }
+ /ignore-by-default/1.0.1:
+ resolution: {integrity: sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==}
dev: true
- /ignore/5.1.8:
- resolution:
- {
- integrity: sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==
- }
- engines: { node: '>= 4' }
+ /ignore/5.2.0:
+ resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==}
+ engines: {node: '>= 4'}
dev: true
/import-fresh/3.3.0:
- resolution:
- {
- integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==
- }
- engines: { node: '>=6' }
+ resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
+ engines: {node: '>=6'}
dependencies:
parent-module: 1.0.1
resolve-from: 4.0.0
dev: true
/imurmurhash/0.1.4:
- resolution: { integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o= }
- engines: { node: '>=0.8.19' }
- dev: true
-
- /indent-string/4.0.0:
- resolution:
- {
- integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
+ engines: {node: '>=0.8.19'}
dev: true
/inflight/1.0.6:
- resolution: { integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= }
+ resolution: {integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=}
dependencies:
once: 1.4.0
wrappy: 1.0.2
/inherits/2.0.4:
- resolution:
- {
- integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
- }
+ resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
+
+ /ini/1.3.8:
+ resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
+ dev: false
+
+ /internal-slot/1.0.3:
+ resolution: {integrity: sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ get-intrinsic: 1.1.1
+ has: 1.0.3
+ side-channel: 1.0.4
+ dev: true
/invariant/2.2.4:
- resolution:
- {
- integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
- }
+ resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==}
dependencies:
loose-envify: 1.4.0
dev: true
- /ioredis/4.28.5:
- resolution:
- {
- integrity: sha512-3GYo0GJtLqgNXj4YhrisLaNNvWSNwSS2wS4OELGfGxH8I69+XfNdnmV1AyN+ZqMh0i7eX+SWjrwFKDBDgfBC1A==
- }
- engines: { node: '>=6' }
- dependencies:
- cluster-key-slot: 1.1.0
- debug: 4.3.3
- denque: 1.5.1
- lodash.defaults: 4.2.0
- lodash.flatten: 4.4.0
- lodash.isarguments: 3.1.0
- p-map: 2.1.0
- redis-commands: 1.7.0
- redis-errors: 1.2.0
- redis-parser: 3.0.0
- standard-as-callback: 2.1.0
- transitivePeerDependencies:
- - supports-color
+ /ip-regex/5.0.0:
+ resolution: {integrity: sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dev: false
- /ip-regex/5.0.0:
- resolution:
- {
- integrity: sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==
- }
- engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
+ /ipaddr.js/1.9.1:
+ resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==}
+ engines: {node: '>= 0.10'}
+ dev: false
+
+ /is-array-buffer/1.0.1:
+ resolution: {integrity: sha512-lj035IqdAwsodoRGs9/8+Kn3HPoz9CTuZbcw63afugWonxigvUVeHY5d6Ve1O+s1N3RCk7txo2TIWQLbU0SuNA==}
dev: false
+ /is-arrayish/0.2.1:
+ resolution: {integrity: sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=}
+
+ /is-bigint/1.0.4:
+ resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==}
+ dependencies:
+ has-bigints: 1.0.2
+ dev: true
+
/is-binary-path/2.1.0:
- resolution:
- {
- integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
+ engines: {node: '>=8'}
dependencies:
binary-extensions: 2.2.0
+ dev: true
+
+ /is-boolean-object/1.1.2:
+ resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ has-tostringtag: 1.0.0
+ dev: true
+
+ /is-buffer/2.0.5:
+ resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==}
+ engines: {node: '>=4'}
+ dev: false
- /is-core-module/2.8.1:
- resolution:
- {
- integrity: sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==
- }
+ /is-callable/1.2.4:
+ resolution: {integrity: sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==}
+ engines: {node: '>= 0.4'}
+ dev: true
+
+ /is-core-module/2.9.0:
+ resolution: {integrity: sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==}
dependencies:
has: 1.0.3
+ /is-date-object/1.0.5:
+ resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-tostringtag: 1.0.0
+ dev: true
+
+ /is-extglob/1.0.0:
+ resolution: {integrity: sha512-7Q+VbVafe6x2T+Tu6NcOf6sRklazEPmBoB3IWk3WdGZM2iGUwU/Oe3Wtq5lSEkDTTlpp8yx+5t4pzO/i9Ty1ww==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
/is-extglob/2.1.1:
- resolution: { integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
+ engines: {node: '>=0.10.0'}
+ dev: true
/is-finite/1.1.0:
- resolution:
- {
- integrity: sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==
- }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==}
+ engines: {node: '>=0.10.0'}
dev: true
/is-fullwidth-code-point/3.0.0:
- resolution:
- {
- integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
+ engines: {node: '>=8'}
dev: true
- /is-fullwidth-code-point/4.0.0:
- resolution:
- {
- integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==
- }
- engines: { node: '>=12' }
- dev: true
+ /is-glob/2.0.1:
+ resolution: {integrity: sha512-a1dBeB19NXsf/E0+FHqkagizel/LQw2DjSQpvQrj3zT+jYPpaUCryPnrQajXKFLCMuf4I6FhRpaGtw4lPrG6Eg==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ is-extglob: 1.0.0
+ dev: false
/is-glob/4.0.3:
- resolution:
- {
- integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
- }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
+ engines: {node: '>=0.10.0'}
dependencies:
is-extglob: 2.1.1
+ dev: true
+
+ /is-invalid-path/0.1.0:
+ resolution: {integrity: sha512-aZMG0T3F34mTg4eTdszcGXx54oiZ4NtHSft3hWNJMGJXUUqdIj3cOZuHcU0nCWWcY3jd7yRe/3AEm3vSNTpBGQ==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ is-glob: 2.0.1
+ dev: false
/is-ip/4.0.0:
- resolution:
- {
- integrity: sha512-4B4XA2HEIm/PY+OSpeMBXr8pGWBYbXuHgjMAqrwbLO3CPTCAd9ArEJzBUKGZtk9viY6+aSfadGnWyjY3ydYZkw==
- }
- engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
+ resolution: {integrity: sha512-4B4XA2HEIm/PY+OSpeMBXr8pGWBYbXuHgjMAqrwbLO3CPTCAd9ArEJzBUKGZtk9viY6+aSfadGnWyjY3ydYZkw==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
ip-regex: 5.0.0
dev: false
+ /is-negative-zero/2.0.2:
+ resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==}
+ engines: {node: '>= 0.4'}
+ dev: true
+
+ /is-number-object/1.0.7:
+ resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-tostringtag: 1.0.0
+ dev: true
+
/is-number/7.0.0:
- resolution:
- {
- integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
- }
- engines: { node: '>=0.12.0' }
+ resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
+ engines: {node: '>=0.12.0'}
+ dev: true
+
+ /is-regex/1.1.4:
+ resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ has-tostringtag: 1.0.0
+ dev: true
+
+ /is-shared-array-buffer/1.0.2:
+ resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==}
+ dependencies:
+ call-bind: 1.0.2
+ dev: true
/is-stream/2.0.1:
- resolution:
- {
- integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /is-string-and-not-blank/0.0.2:
+ resolution: {integrity: sha512-FyPGAbNVyZpTeDCTXnzuwbu9/WpNXbCfbHXLpCRpN4GANhS00eEIP5Ef+k5HYSNIzIhdN9zRDoBj6unscECvtQ==}
+ engines: {node: '>=6.4.0'}
+ dependencies:
+ is-string-blank: 1.0.1
+ dev: false
+
+ /is-string-blank/1.0.1:
+ resolution: {integrity: sha512-9H+ZBCVs3L9OYqv8nuUAzpcT9OTgMD1yAWrG7ihlnibdkbtB850heAmYWxHuXc4CHy4lKeK69tN+ny1K7gBIrw==}
+ dev: false
+
+ /is-string/1.0.7:
+ resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-tostringtag: 1.0.0
+ dev: true
+
+ /is-symbol/1.0.4:
+ resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ has-symbols: 1.0.3
+ dev: true
+
+ /is-uuid/1.0.2:
+ resolution: {integrity: sha1-rRiY3fFUlHwlyOVJZvSGBOnK7MQ=}
+ dev: false
+
+ /is-valid-path/0.1.1:
+ resolution: {integrity: sha512-+kwPrVDu9Ms03L90Qaml+79+6DZHqHyRoANI6IsZJ/g8frhnfchDOBCa0RbQ6/kdHt5CS5OeIEyrYznNuVN+8A==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ is-invalid-path: 0.1.0
+ dev: false
+
+ /is-weakref/1.0.2:
+ resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==}
+ dependencies:
+ call-bind: 1.0.2
dev: true
+ /iserror/0.0.2:
+ resolution: {integrity: sha1-vVNFH+L2aLnyQCwZZnh6qix8C/U=}
+ dev: false
+
/isexe/2.0.0:
- resolution: { integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= }
+ resolution: {integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=}
/js-cookie/3.0.1:
- resolution:
- {
- integrity: sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw==
- }
- engines: { node: '>=12' }
+ resolution: {integrity: sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw==}
+ engines: {node: '>=12'}
dev: false
/js-tokens/3.0.2:
- resolution: { integrity: sha1-mGbfOVECEw449/mWvOtlRDIJwls= }
+ resolution: {integrity: sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==}
dev: true
/js-tokens/4.0.0:
- resolution:
- {
- integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
- }
- dev: true
-
- /js-yaml/3.14.1:
- resolution:
- {
- integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
- }
- hasBin: true
- dependencies:
- argparse: 1.0.10
- esprima: 4.0.1
- dev: true
+ resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
/js-yaml/4.1.0:
- resolution:
- {
- integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
- }
+ resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
hasBin: true
dependencies:
argparse: 2.0.1
- dev: false
/jsesc/0.5.0:
- resolution: { integrity: sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= }
+ resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==}
hasBin: true
dev: true
/jsesc/1.3.0:
- resolution: { integrity: sha1-RsP+yMGJKxKwgz25vHYiF226s0s= }
+ resolution: {integrity: sha512-Mke0DA0QjUWuJlhsE0ZPPhYiJkRap642SmI/4ztCFaUs6V2AiH1sfecc+57NgaryfAA2VR3v6O+CSjC1jZJKOA==}
hasBin: true
dev: true
/json-buffer/3.0.1:
- resolution:
- {
- integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==
- }
+ resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}
+ dev: false
+
+ /json-parse-better-errors/1.0.2:
+ resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==}
+ dev: true
+
+ /json-parse-even-better-errors/2.3.1:
+ resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
dev: false
/json-schema-traverse/0.4.1:
- resolution:
- {
- integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
- }
+ resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
dev: true
/json-schema-traverse/1.0.0:
- resolution:
- {
- integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==
- }
- dev: true
+ resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
+ dev: false
/json-stable-stringify-without-jsonify/1.0.1:
- resolution: { integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= }
+ resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
dev: true
/json5/0.5.1:
- resolution: { integrity: sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= }
+ resolution: {integrity: sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==}
hasBin: true
dev: true
+ /json5/2.2.1:
+ resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==}
+ engines: {node: '>=6'}
+ hasBin: true
+
/jsonwebtoken/8.5.1:
- resolution:
- {
- integrity: sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==
- }
- engines: { node: '>=4', npm: '>=1.4.28' }
+ resolution: {integrity: sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==}
+ engines: {node: '>=4', npm: '>=1.4.28'}
dependencies:
jws: 3.2.2
lodash.includes: 4.3.0
@@ -3548,15 +3665,12 @@ packages:
lodash.isplainobject: 4.0.6
lodash.isstring: 4.0.1
lodash.once: 4.1.1
- ms: 2.1.2
+ ms: 2.1.3
semver: 5.7.1
dev: false
/jwa/1.4.1:
- resolution:
- {
- integrity: sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==
- }
+ resolution: {integrity: sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==}
dependencies:
buffer-equal-constant-time: 1.0.1
ecdsa-sig-formatter: 1.0.11
@@ -3564,509 +3678,569 @@ packages:
dev: false
/jws/3.2.2:
- resolution:
- {
- integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==
- }
+ resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==}
dependencies:
jwa: 1.4.1
safe-buffer: 5.2.1
dev: false
- /keyv/4.0.4:
- resolution:
- {
- integrity: sha512-vqNHbAc8BBsxk+7QBYLW0Y219rWcClspR6WSeoHYKG5mnsSoOH+BL1pWq02DDCVdvvuUny5rkBlzMRzoqc+GIg==
- }
+ /keyv/4.3.0:
+ resolution: {integrity: sha512-C30Un9+63J0CsR7Wka5quXKqYZsT6dcRQ2aOwGcSc3RiQ4HGWpTAHlCA+puNfw2jA/s11EsxA1nCXgZRuRKMQQ==}
dependencies:
+ compress-brotli: 1.3.8
json-buffer: 3.0.1
dev: false
/kleur/4.1.4:
- resolution:
- {
- integrity: sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==
- }
- engines: { node: '>=6' }
+ resolution: {integrity: sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==}
+ engines: {node: '>=6'}
dev: true
+ /last-commit-log/3.1.2:
+ resolution: {integrity: sha512-xCA2dLwhRxvTj/6oPcKD12ICOr+rxDNtc3byd1rfCGawBHYf1vTrS1oiPHjWBIa8drY25W7J3arLjfJa/JngAA==}
+ dependencies:
+ dotgitconfig: 1.1.2
+ dev: false
+
/levn/0.4.1:
- resolution:
- {
- integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==
- }
- engines: { node: '>= 0.8.0' }
+ resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
+ engines: {node: '>= 0.8.0'}
dependencies:
prelude-ls: 1.2.1
type-check: 0.4.0
dev: true
- /lilconfig/2.0.4:
- resolution:
- {
- integrity: sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA==
- }
- engines: { node: '>=10' }
- dev: true
+ /light-my-request/5.0.0:
+ resolution: {integrity: sha512-0OPHKV+uHgBOnRokzL1LqeMCnSAo5l/rZS7kyB6G1I8qxGCvhXpq1M6WK565Y9A5CSn50l3DVaHnJ5FCdpguZQ==}
+ dependencies:
+ ajv: 8.11.0
+ cookie: 0.5.0
+ process-warning: 1.0.0
+ set-cookie-parser: 2.4.8
+ dev: false
/lilconfig/2.0.5:
- resolution:
- {
- integrity: sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==
- }
- engines: { node: '>=10' }
-
- /lint-staged/12.4.1:
- resolution:
- {
- integrity: sha512-PTXgzpflrQ+pODQTG116QNB+Q6uUTDg5B5HqGvNhoQSGt8Qy+MA/6zSnR8n38+sxP5TapzeQGTvoKni0KRS8Vg==
- }
- engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
- hasBin: true
- dependencies:
- cli-truncate: 3.1.0
- colorette: 2.0.16
- commander: 8.3.0
- execa: 5.1.1
- lilconfig: 2.0.4
- listr2: 4.0.1
- micromatch: 4.0.4
- normalize-path: 3.0.0
- object-inspect: 1.12.0
- pidtree: 0.5.0
- string-argv: 0.3.1
- supports-color: 9.2.1
- yaml: 1.10.2
- transitivePeerDependencies:
- - enquirer
+ resolution: {integrity: sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==}
+ engines: {node: '>=10'}
dev: true
- /listr2/4.0.1:
- resolution:
- {
- integrity: sha512-D65Nl+zyYHL2jQBGmxtH/pU8koPZo5C8iCNE8EoB04RwPgQG1wuaKwVbeZv9LJpiH4Nxs0FCp+nNcG8OqpniiA==
- }
- engines: { node: '>=12' }
- peerDependencies:
- enquirer: '>= 2.3.0 < 3'
- peerDependenciesMeta:
- enquirer:
- optional: true
+ /lines-and-columns/1.2.4:
+ resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
+ dev: false
+
+ /load-json-file/4.0.0:
+ resolution: {integrity: sha1-L19Fq5HjMhYjT9U62rZo607AmTs=}
+ engines: {node: '>=4'}
dependencies:
- cli-truncate: 2.1.0
- colorette: 2.0.16
- log-update: 4.0.0
- p-map: 4.0.0
- rfdc: 1.3.0
- rxjs: 7.5.2
- through: 2.3.8
- wrap-ansi: 7.0.0
+ graceful-fs: 4.2.10
+ parse-json: 4.0.0
+ pify: 3.0.0
+ strip-bom: 3.0.0
dev: true
- /lodash.clonedeep/4.5.0:
- resolution: { integrity: sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= }
- dev: true
+ /locate-path/3.0.0:
+ resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==}
+ engines: {node: '>=6'}
+ dependencies:
+ p-locate: 3.0.0
+ path-exists: 3.0.0
+ dev: false
- /lodash.defaults/4.2.0:
- resolution: { integrity: sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= }
+ /locate-path/5.0.0:
+ resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
+ engines: {node: '>=8'}
+ dependencies:
+ p-locate: 4.1.0
dev: false
- /lodash.flatten/4.4.0:
- resolution: { integrity: sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= }
+ /lodash-es/4.17.21:
+ resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
dev: false
- /lodash.includes/4.3.0:
- resolution: { integrity: sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8= }
+ /lodash._baseiteratee/4.7.0:
+ resolution: {integrity: sha512-nqB9M+wITz0BX/Q2xg6fQ8mLkyfF7MU7eE+MNBNjTHFKeKaZAPEzEg+E8LWxKWf1DQVflNEn9N49yAuqKh2mWQ==}
+ dependencies:
+ lodash._stringtopath: 4.8.0
+ dev: false
+
+ /lodash._basetostring/4.12.0:
+ resolution: {integrity: sha512-SwcRIbyxnN6CFEEK4K1y+zuApvWdpQdBHM/swxP962s8HIxPO3alBH5t3m/dl+f4CMUug6sJb7Pww8d13/9WSw==}
+ dev: false
+
+ /lodash._baseuniq/4.6.0:
+ resolution: {integrity: sha512-Ja1YevpHZctlI5beLA7oc5KNDhGcPixFhcqSiORHNsp/1QTv7amAXzw+gu4YOvErqVlMVyIJGgtzeepCnnur0A==}
+ dependencies:
+ lodash._createset: 4.0.3
+ lodash._root: 3.0.1
+ dev: false
+
+ /lodash._createset/4.0.3:
+ resolution: {integrity: sha512-GTkC6YMprrJZCYU3zcqZj+jkXkrXzq3IPBcF/fIPpNEAB4hZEtXU8zp/RwKOvZl43NUmwDbyRk3+ZTbeRdEBXA==}
+ dev: false
+
+ /lodash._root/3.0.1:
+ resolution: {integrity: sha512-O0pWuFSK6x4EXhM1dhZ8gchNtG7JMqBtrHdoUFUWXD7dJnNSUze1GuyQr5sOs0aCvgGeI3o/OJW8f4ca7FDxmQ==}
dev: false
- /lodash.isarguments/3.1.0:
- resolution: { integrity: sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo= }
+ /lodash._stringtopath/4.8.0:
+ resolution: {integrity: sha512-SXL66C731p0xPDC5LZg4wI5H+dJo/EO4KTqOMwLYCH3+FmmfAKJEZCm6ohGpI+T1xwsDsJCfL4OnhorllvlTPQ==}
+ dependencies:
+ lodash._basetostring: 4.12.0
+ dev: false
+
+ /lodash.includes/4.3.0:
+ resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==}
dev: false
/lodash.isboolean/3.0.3:
- resolution: { integrity: sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY= }
+ resolution: {integrity: sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==}
dev: false
/lodash.isinteger/4.0.4:
- resolution: { integrity: sha1-YZwK89A/iwTDH1iChAt3sRzWg0M= }
+ resolution: {integrity: sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==}
dev: false
/lodash.isnumber/3.0.3:
- resolution: { integrity: sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w= }
+ resolution: {integrity: sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==}
dev: false
/lodash.isplainobject/4.0.6:
- resolution: { integrity: sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= }
+ resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==}
dev: false
/lodash.isstring/4.0.1:
- resolution: { integrity: sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= }
+ resolution: {integrity: sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==}
dev: false
/lodash.merge/4.6.2:
- resolution:
- {
- integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
- }
+ resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
dev: true
+ /lodash.omit/4.5.0:
+ resolution: {integrity: sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA=}
+ dev: false
+
/lodash.once/4.1.1:
- resolution: { integrity: sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= }
+ resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==}
dev: false
- /lodash.truncate/4.4.2:
- resolution: { integrity: sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= }
- dev: true
+ /lodash.uniqby/4.5.0:
+ resolution: {integrity: sha512-IRt7cfTtHy6f1aRVA5n7kT8rgN3N1nH6MOWLcHfpWG2SH19E3JksLK38MktLxZDhlAjCP9jpIXkOnRXlu6oByQ==}
+ dependencies:
+ lodash._baseiteratee: 4.7.0
+ lodash._baseuniq: 4.6.0
+ dev: false
/lodash/4.17.21:
- resolution:
- {
- integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
- }
-
- /log-update/4.0.0:
- resolution:
- {
- integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==
- }
- engines: { node: '>=10' }
- dependencies:
- ansi-escapes: 4.3.2
- cli-cursor: 3.1.0
- slice-ansi: 4.0.0
- wrap-ansi: 6.2.0
- dev: true
+ resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
/loose-envify/1.4.0:
- resolution:
- {
- integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
- }
+ resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}
hasBin: true
dependencies:
js-tokens: 4.0.0
dev: true
+ /lower-case/1.1.4:
+ resolution: {integrity: sha1-miyr0bno4K6ZOkv31YdcOcQujqw=}
+ dev: false
+
/lowercase-keys/2.0.0:
- resolution:
- {
- integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==}
+ engines: {node: '>=8'}
dev: false
/lowercase-keys/3.0.0:
- resolution:
- {
- integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==
- }
- engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
+ resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dev: false
/lru-cache/4.1.5:
- resolution:
- {
- integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==
- }
+ resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==}
dependencies:
pseudomap: 1.0.2
yallist: 2.1.2
dev: true
/lru-cache/6.0.0:
- resolution:
- {
- integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
- }
- engines: { node: '>=10' }
+ resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
+ engines: {node: '>=10'}
dependencies:
yallist: 4.0.0
- dev: true
-
- /lru_map/0.3.3:
- resolution: { integrity: sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= }
- dev: false
- /luxon/1.28.0:
- resolution:
- {
- integrity: sha512-TfTiyvZhwBYM/7QdAVDh+7dBTBA29v4ik0Ce9zda3Mnf8on1S5KJI8P2jKFZ8+5C0jhmr0KwJEO/Wdpm0VeWJQ==
- }
- dev: false
+ /magic-string/0.25.9:
+ resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==}
+ dependencies:
+ sourcemap-codec: 1.4.8
+ dev: true
- /magic-string/0.25.7:
- resolution:
- {
- integrity: sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==
- }
+ /magic-string/0.26.2:
+ resolution: {integrity: sha512-NzzlXpclt5zAbmo6h6jNc8zl2gNRGHvmsZW4IvZhTC4W7k4OlLP+S5YLussa/r3ixNT66KOQfNORlXHSOy/X4A==}
+ engines: {node: '>=12'}
dependencies:
sourcemap-codec: 1.4.8
dev: true
+ /make-dir/3.1.0:
+ resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
+ engines: {node: '>=8'}
+ dependencies:
+ semver: 6.3.0
+ dev: true
+
/make-error/1.3.6:
- resolution:
- {
- integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
- }
+ resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
+ dev: false
- /merge-stream/2.0.0:
- resolution:
- {
- integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==
- }
+ /memorystream/0.3.1:
+ resolution: {integrity: sha1-htcJCzDORV1j+64S3aUaR93K+bI=}
+ engines: {node: '>= 0.10.0'}
dev: true
/merge2/1.4.1:
- resolution:
- {
- integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
- }
- engines: { node: '>= 8' }
-
- /micromatch/4.0.4:
- resolution:
- {
- integrity: sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==
- }
- engines: { node: '>=8.6' }
+ resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
+ engines: {node: '>= 8'}
+ dev: true
+
+ /methods/1.1.2:
+ resolution: {integrity: sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=}
+ engines: {node: '>= 0.6'}
+ dev: false
+
+ /micromatch/4.0.5:
+ resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==}
+ engines: {node: '>=8.6'}
dependencies:
braces: 3.0.2
- picomatch: 2.3.0
-
- /mimic-fn/2.1.0:
- resolution:
- {
- integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
- }
- engines: { node: '>=6' }
+ picomatch: 2.3.1
dev: true
+ /mime-db/1.52.0:
+ resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
+ engines: {node: '>= 0.6'}
+ dev: false
+
+ /mime-types/2.1.35:
+ resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
+ engines: {node: '>= 0.6'}
+ dependencies:
+ mime-db: 1.52.0
+ dev: false
+
+ /mime/1.6.0:
+ resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==}
+ engines: {node: '>=4'}
+ hasBin: true
+ dev: false
+
+ /mime/2.6.0:
+ resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==}
+ engines: {node: '>=4.0.0'}
+ hasBin: true
+ dev: false
+
/mimic-response/1.0.1:
- resolution:
- {
- integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==
- }
- engines: { node: '>=4' }
+ resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==}
+ engines: {node: '>=4'}
dev: false
/mimic-response/3.1.0:
- resolution:
- {
- integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==
- }
- engines: { node: '>=10' }
+ resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==}
+ engines: {node: '>=10'}
dev: false
/min-indent/1.0.1:
- resolution:
- {
- integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==
- }
- engines: { node: '>=4' }
+ resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}
+ engines: {node: '>=4'}
dev: true
- /minimatch/3.0.4:
- resolution:
- {
- integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
- }
+ /minimalistic-assert/1.0.1:
+ resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==}
+ dev: false
+
+ /minimatch/3.1.2:
+ resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
dependencies:
brace-expansion: 1.1.11
+ dev: true
+
+ /minimatch/5.1.0:
+ resolution: {integrity: sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==}
+ engines: {node: '>=10'}
+ dependencies:
+ brace-expansion: 2.0.1
+ dev: false
+
+ /minimist/1.2.6:
+ resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}
- /minimist/1.2.5:
- resolution:
- {
- integrity: sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
- }
+ /minipass/3.1.6:
+ resolution: {integrity: sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ yallist: 4.0.0
+ dev: true
+
+ /minizlib/2.1.2:
+ resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
+ engines: {node: '>= 8'}
+ dependencies:
+ minipass: 3.1.6
+ yallist: 4.0.0
+ dev: true
/mkdirp-classic/0.5.3:
- resolution:
- {
- integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==
- }
+ resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}
dev: false
- /mkdirp/0.5.5:
- resolution:
- {
- integrity: sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
- }
+ /mkdirp/0.5.6:
+ resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
hasBin: true
dependencies:
- minimist: 1.2.5
+ minimist: 1.2.6
dev: true
+ /mkdirp/1.0.4:
+ resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
+ engines: {node: '>=10'}
+ hasBin: true
+ dev: true
+
+ /mnemonist/0.39.1:
+ resolution: {integrity: sha512-bY13FSvcbKLj+FaJcR2+xFZ3m2R1+BrLpavAh0BMyGSq0iPowbvYllwitlkvVyEowEYSulCMzxDaju9bC4+cow==}
+ dependencies:
+ obliterator: 2.0.4
+ dev: false
+
/mri/1.2.0:
- resolution:
- {
- integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==
- }
- engines: { node: '>=4' }
+ resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
+ engines: {node: '>=4'}
dev: true
- /ms/2.0.0:
- resolution: { integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= }
+ /mrmime/1.0.0:
+ resolution: {integrity: sha512-a70zx7zFfVO7XpnQ2IX1Myh9yY4UYvfld/dikWRnsXxbyvMcfz+u6UfgNAtH+k2QqtJuzVpv6eLTx1G2+WKZbQ==}
+ engines: {node: '>=10'}
dev: true
+ /ms/2.0.0:
+ resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
+
/ms/2.1.2:
- resolution:
- {
- integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
- }
-
- /msgpackr-extract/1.0.15:
- resolution:
- {
- integrity: sha512-vgJgzFva0/4/mt84wXf3CRCDPHKqiqk5t7/kVSjk/V2IvwSjoStHhxyq/b2+VrWcch3sxiNQOJEWXgI86Fm7AQ==
- }
- requiresBuild: true
- dependencies:
- nan: 2.15.0
- node-gyp-build: 4.3.0
- dev: false
- optional: true
+ resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
- /msgpackr/1.4.7:
- resolution:
- {
- integrity: sha512-bhC8Ed1au3L3oHaR/fe4lk4w7PLGFcWQ5XY/Tk9N6tzDRz8YndjCG68TD8zcvYZoxNtw767eF/7VpaTpU9kf9w==
- }
- optionalDependencies:
- msgpackr-extract: 1.0.15
- dev: false
+ /ms/2.1.3:
+ resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
- /mustache/4.2.0:
- resolution:
- {
- integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==
- }
- hasBin: true
+ /nan/2.16.0:
+ resolution: {integrity: sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==}
dev: false
+ optional: true
- /nan/2.15.0:
- resolution:
- {
- integrity: sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==
- }
+ /nanoclone/0.2.1:
+ resolution: {integrity: sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA==}
dev: false
- optional: true
/nanoid/3.3.4:
- resolution:
- {
- integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==
- }
- engines: { node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1 }
+ resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==}
+ engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
+ dev: true
/natural-compare/1.4.0:
- resolution: { integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= }
+ resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
+ dev: true
+
+ /next-line/1.1.0:
+ resolution: {integrity: sha1-/K5XhTBStqm66CCOQN19PC0wRgM=}
+ dev: false
+
+ /nice-try/1.0.5:
+ resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==}
+ dev: true
+
+ /no-case/2.3.2:
+ resolution: {integrity: sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==}
+ dependencies:
+ lower-case: 1.1.4
+ dev: false
+
+ /node-fetch/2.6.7:
+ resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==}
+ engines: {node: 4.x || >=6.0.0}
+ peerDependencies:
+ encoding: ^0.1.0
+ peerDependenciesMeta:
+ encoding:
+ optional: true
+ dependencies:
+ whatwg-url: 5.0.0
dev: true
/node-forge/1.3.1:
- resolution:
- {
- integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==
- }
- engines: { node: '>= 6.13.0' }
- dev: false
-
- /node-gyp-build/4.3.0:
- resolution:
- {
- integrity: sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==
- }
- hasBin: true
+ resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==}
+ engines: {node: '>= 6.13.0'}
dev: false
- optional: true
- /node-os-utils/1.3.6:
- resolution:
- {
- integrity: sha512-WympE9ELtdOzNak/rAuuIV5DwvX/PTJtN0LjyWeGyTTR2Kt0sY56ldLoGbVBnfM1dz46VeO3sHcNZI5BZ+EB+w==
- }
+ /node-gyp-build/4.4.0:
+ resolution: {integrity: sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==}
+ hasBin: true
+ dev: true
+
+ /node-os-utils/1.3.7:
+ resolution: {integrity: sha512-fvnX9tZbR7WfCG5BAy3yO/nCLyjVWD6MghEq0z5FDfN+ZXpLWNITBdbifxQkQ25ebr16G0N7eRWJisOcMEHG3Q==}
dev: false
- /node-releases/2.0.4:
- resolution:
- {
- integrity: sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ==
- }
+ /node-releases/2.0.5:
+ resolution: {integrity: sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==}
+ dev: true
+
+ /nodemon/2.0.19:
+ resolution: {integrity: sha512-4pv1f2bMDj0Eeg/MhGqxrtveeQ5/G/UVe9iO6uTZzjnRluSA4PVWf8CW99LUPwGB3eNIA7zUFoP77YuI7hOc0A==}
+ engines: {node: '>=8.10.0'}
+ hasBin: true
+ requiresBuild: true
+ dependencies:
+ chokidar: 3.5.3
+ ignore-by-default: 1.0.1
+ minimatch: 3.1.2
+ pstree.remy: 1.1.8
+ semver: 5.7.1
+ simple-update-notifier: 1.0.7
+ supports-color: 5.5.0
+ touch: 3.1.0
+ undefsafe: 2.0.5
dev: true
/noop6/1.0.9:
- resolution:
- {
- integrity: sha512-DB3Hwyd89dPr5HqEPg3YHjzvwh/mCqizC1zZ8vyofqc+TQRyPDnT4wgXXbLGF4z9YAzwwTLi8pNLhGqcbSjgkA==
- }
+ resolution: {integrity: sha512-DB3Hwyd89dPr5HqEPg3YHjzvwh/mCqizC1zZ8vyofqc+TQRyPDnT4wgXXbLGF4z9YAzwwTLi8pNLhGqcbSjgkA==}
dev: false
+ /nopt/1.0.10:
+ resolution: {integrity: sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==}
+ hasBin: true
+ dependencies:
+ abbrev: 1.1.1
+ dev: true
+
+ /nopt/5.0.0:
+ resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==}
+ engines: {node: '>=6'}
+ hasBin: true
+ dependencies:
+ abbrev: 1.1.1
+ dev: true
+
+ /normalize-package-data/2.5.0:
+ resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==}
+ dependencies:
+ hosted-git-info: 2.8.9
+ resolve: 1.22.0
+ semver: 5.7.1
+ validate-npm-package-license: 3.0.4
+
/normalize-path/3.0.0:
- resolution:
- {
- integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
- }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
+ engines: {node: '>=0.10.0'}
+ dev: true
/normalize-range/0.1.2:
- resolution: { integrity: sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=}
+ engines: {node: '>=0.10.0'}
dev: true
/normalize-url/6.1.0:
- resolution:
- {
- integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==
- }
- engines: { node: '>=10' }
+ resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==}
+ engines: {node: '>=10'}
dev: false
- /npm-run-path/4.0.1:
- resolution:
- {
- integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==
- }
- engines: { node: '>=8' }
+ /npm-run-all/4.1.5:
+ resolution: {integrity: sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==}
+ engines: {node: '>= 4'}
+ hasBin: true
+ dependencies:
+ ansi-styles: 3.2.1
+ chalk: 2.4.2
+ cross-spawn: 6.0.5
+ memorystream: 0.3.1
+ minimatch: 3.1.2
+ pidtree: 0.3.1
+ read-pkg: 3.0.0
+ shell-quote: 1.7.3
+ string.prototype.padend: 3.1.3
+ dev: true
+
+ /npmlog/5.0.1:
+ resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==}
dependencies:
- path-key: 3.1.1
+ are-we-there-yet: 2.0.0
+ console-control-strings: 1.1.0
+ gauge: 3.0.2
+ set-blocking: 2.0.0
+ dev: true
+
+ /numbered/1.1.0:
+ resolution: {integrity: sha512-pv/ue2Odr7IfYOO0byC1KgBI10wo5YDauLhxY6/saNzAdAs0r1SotGCPzzCLNPL0xtrAwWRialLu23AAu9xO1g==}
+ dev: false
+
+ /object-assign/4.1.1:
+ resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
+ engines: {node: '>=0.10.0'}
dev: true
/object-hash/3.0.0:
- resolution:
- {
- integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==
- }
- engines: { node: '>= 6' }
+ resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==}
+ engines: {node: '>= 6'}
+ dev: true
+
+ /object-inspect/1.12.1:
+ resolution: {integrity: sha512-Y/jF6vnvEtOPGiKD1+q+X0CiUYRQtEHp89MLLUJ7TUivtH8Ugn2+3A7Rynqk7BRsAoqeOQWnFnjpDrKSxDgIGA==}
- /object-inspect/1.12.0:
- resolution:
- {
- integrity: sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==
- }
+ /object-keys/1.1.1:
+ resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}
+ engines: {node: '>= 0.4'}
dev: true
- /once/1.4.0:
- resolution: { integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E= }
+ /object.assign/4.1.2:
+ resolution: {integrity: sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==}
+ engines: {node: '>= 0.4'}
dependencies:
- wrappy: 1.0.2
+ call-bind: 1.0.2
+ define-properties: 1.1.4
+ has-symbols: 1.0.3
+ object-keys: 1.1.1
+ dev: true
+
+ /obliterator/2.0.4:
+ resolution: {integrity: sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==}
+ dev: false
- /onetime/5.1.2:
- resolution:
- {
- integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==
- }
- engines: { node: '>=6' }
+ /on-exit-leak-free/2.1.0:
+ resolution: {integrity: sha512-VuCaZZAjReZ3vUwgOB8LxAosIurDiAW0s13rI1YwmaP++jvcxP77AWoQvenZebpCA2m8WC1/EosPYPMjnRAp/w==}
+ dev: false
+
+ /on-finished/2.3.0:
+ resolution: {integrity: sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=}
+ engines: {node: '>= 0.8'}
dependencies:
- mimic-fn: 2.1.0
- dev: true
+ ee-first: 1.1.1
+ dev: false
+
+ /on-finished/2.4.1:
+ resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
+ engines: {node: '>= 0.8'}
+ dependencies:
+ ee-first: 1.1.1
+ dev: false
+
+ /once/1.4.0:
+ resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=}
+ dependencies:
+ wrappy: 1.0.2
/optionator/0.9.1:
- resolution:
- {
- integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==
- }
- engines: { node: '>= 0.8.0' }
+ resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==}
+ engines: {node: '>= 0.8.0'}
dependencies:
deep-is: 0.1.4
fast-levenshtein: 2.0.6
@@ -4077,126 +4251,290 @@ packages:
dev: true
/os-homedir/1.0.2:
- resolution: { integrity: sha1-/7xJiDNuDoM94MFox+8VISGqf7M= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==}
+ engines: {node: '>=0.10.0'}
dev: true
/os-tmpdir/1.0.2:
- resolution: { integrity: sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==}
+ engines: {node: '>=0.10.0'}
dev: true
/p-cancelable/3.0.0:
- resolution:
- {
- integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==
- }
- engines: { node: '>=12.20' }
+ resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==}
+ engines: {node: '>=12.20'}
+ dev: false
+
+ /p-finally/1.0.0:
+ resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==}
+ engines: {node: '>=4'}
+ dev: false
+
+ /p-limit/2.3.0:
+ resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
+ engines: {node: '>=6'}
+ dependencies:
+ p-try: 2.2.0
+ dev: false
+
+ /p-limit/3.1.0:
+ resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==}
+ engines: {node: '>=10'}
+ dependencies:
+ yocto-queue: 0.1.0
dev: false
/p-limit/4.0.0:
- resolution:
- {
- integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==
- }
- engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
+ resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
yocto-queue: 1.0.0
dev: false
- /p-map/2.1.0:
- resolution:
- {
- integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==
- }
- engines: { node: '>=6' }
+ /p-locate/3.0.0:
+ resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==}
+ engines: {node: '>=6'}
+ dependencies:
+ p-limit: 2.3.0
dev: false
- /p-map/4.0.0:
- resolution:
- {
- integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==
- }
- engines: { node: '>=10' }
+ /p-locate/4.1.0:
+ resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
+ engines: {node: '>=8'}
dependencies:
- aggregate-error: 3.1.0
- dev: true
+ p-limit: 2.3.0
+ dev: false
+
+ /p-queue/7.2.0:
+ resolution: {integrity: sha512-Kvv7p13M46lTYLQ/PsZdaj/1Vj6u/8oiIJgyQyx4oVkOfHdd7M2EZvXigDvcsSzRwanCzQirV5bJPQFoSQt5MA==}
+ engines: {node: '>=12'}
+ dependencies:
+ eventemitter3: 4.0.7
+ p-timeout: 5.0.2
+ dev: false
+
+ /p-timeout/3.2.0:
+ resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==}
+ engines: {node: '>=8'}
+ dependencies:
+ p-finally: 1.0.0
+ dev: false
+
+ /p-timeout/5.0.2:
+ resolution: {integrity: sha512-sEmji9Yaq+Tw+STwsGAE56hf7gMy9p0tQfJojIAamB7WHJYJKf1qlsg9jqBWG8q9VCxKPhZaP/AcXwEoBcYQhQ==}
+ engines: {node: '>=12'}
+ dev: false
+
+ /p-try/2.2.0:
+ resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /p-wait-for/3.2.0:
+ resolution: {integrity: sha512-wpgERjNkLrBiFmkMEjuZJEWKKDrNfHCKA1OhyN1wg1FrLkULbviEy6py1AyJUgZ72YWFbZ38FIpnqvVqAlDUwA==}
+ engines: {node: '>=8'}
+ dependencies:
+ p-timeout: 3.2.0
+ dev: false
/parent-module/1.0.1:
- resolution:
- {
- integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==
- }
- engines: { node: '>=6' }
+ resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
+ engines: {node: '>=6'}
dependencies:
callsites: 3.1.0
dev: true
+ /parse-app-info/4.0.3:
+ resolution: {integrity: sha512-TGU0xhNyzyhBkYhrUqBGXu5JT9E5EMIkh6vgv3Vq/nh8iz3CROqY7ohVTj4H6FcioyKTE7FG2AtAuhomGb1mUQ==}
+ engines: {node: '>=7.0.0'}
+ dependencies:
+ last-commit-log: 3.1.2
+ lodash: 4.17.21
+ read-pkg-up: 7.0.1
+ semver: 7.3.7
+ dev: false
+
+ /parse-err/0.0.12:
+ resolution: {integrity: sha512-q9bGpXmSFfTCAoz0/YfZB62p73h3SXP4YpZNnVHQXC9svNSrhZtzqubqtztL37YWmMsdINHOMimg8aC1EKNg7g==}
+ engines: {node: '>=6.4.0'}
+ dependencies:
+ iserror: 0.0.2
+ dev: false
+
+ /parse-json/4.0.0:
+ resolution: {integrity: sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=}
+ engines: {node: '>=4'}
+ dependencies:
+ error-ex: 1.3.2
+ json-parse-better-errors: 1.0.2
+ dev: true
+
+ /parse-json/5.2.0:
+ resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}
+ engines: {node: '>=8'}
+ dependencies:
+ '@babel/code-frame': 7.16.7
+ error-ex: 1.3.2
+ json-parse-even-better-errors: 2.3.1
+ lines-and-columns: 1.2.4
+ dev: false
+
+ /parse-request/4.0.0:
+ resolution: {integrity: sha512-NcDIEa6Dn5nmy78YKCvx4N+tMcuwZIASZHv4r3xsZagD+sGkeUe/ymiGy3XB8GYagqZJL6QzBvRBLsB4q2YeXQ==}
+ engines: {node: '>=6.4.0'}
+ dependencies:
+ browser-hrtime: 1.1.8
+ bson-objectid: 1.3.1
+ convert-hrtime: 3.0.0
+ cookie: 0.4.2
+ credit-card-type: 8.3.0
+ debug: 4.3.4
+ fast-safe-stringify: 2.1.1
+ http-headers: 3.0.2
+ is-array-buffer: 1.0.1
+ is-buffer: 2.0.5
+ is-stream: 2.0.1
+ is-uuid: 1.0.2
+ ms: 2.1.3
+ no-case: 2.3.2
+ qs: 6.10.3
+ rfdc: 1.3.0
+ sensitive-fields: 0.0.9
+ url-parse: 1.5.10
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /path-exists/3.0.0:
+ resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==}
+ engines: {node: '>=4'}
+ dev: false
+
+ /path-exists/4.0.0:
+ resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
+ engines: {node: '>=8'}
+ dev: false
+
/path-is-absolute/1.0.1:
- resolution: { integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ /path-key/2.0.1:
+ resolution: {integrity: sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=}
+ engines: {node: '>=4'}
+ dev: true
/path-key/3.1.1:
- resolution:
- {
- integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
+ engines: {node: '>=8'}
/path-parse/1.0.7:
- resolution:
- {
- integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
- }
+ resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
+
+ /path-type/3.0.0:
+ resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==}
+ engines: {node: '>=4'}
+ dependencies:
+ pify: 3.0.0
+ dev: true
/path-type/4.0.0:
- resolution:
- {
- integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
+ engines: {node: '>=8'}
dev: true
/picocolors/1.0.0:
- resolution:
- {
- integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
- }
-
- /picomatch/2.3.0:
- resolution:
- {
- integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==
- }
- engines: { node: '>=8.6' }
-
- /pidtree/0.5.0:
- resolution:
- {
- integrity: sha512-9nxspIM7OpZuhBxPg73Zvyq7j1QMPMPsGKTqRc2XOaFQauDvoNz9fM1Wdkjmeo7l9GXOZiRs97sPkuayl39wjA==
- }
- engines: { node: '>=0.10' }
+ resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
+ dev: true
+
+ /picomatch/2.3.1:
+ resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
+ engines: {node: '>=8.6'}
+ dev: true
+
+ /pidtree/0.3.1:
+ resolution: {integrity: sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==}
+ engines: {node: '>=0.10'}
+ hasBin: true
+ dev: true
+
+ /pify/2.3.0:
+ resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ /pify/3.0.0:
+ resolution: {integrity: sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=}
+ engines: {node: '>=4'}
+ dev: true
+
+ /pino-abstract-transport/1.0.0:
+ resolution: {integrity: sha512-c7vo5OpW4wIS42hUVcT5REsL8ZljsUfBjqV/e2sFxmFEFZiq1XLUp5EYLtuDH6PEHq9W1egWqRbnLUP5FuZmOA==}
+ dependencies:
+ readable-stream: 4.0.0
+ split2: 4.1.0
+ dev: false
+
+ /pino-std-serializers/5.6.0:
+ resolution: {integrity: sha512-VdUXCw8gO+xhir7sFuoYSjTnzB+TMDGxhAC/ph3YS3sdHnXNdsK0wMtADNUltfeGkn2KDxEM21fnjF3RwXyC8A==}
+ dev: false
+
+ /pino/8.1.0:
+ resolution: {integrity: sha512-53jlxs+02UNTtF1XwVWfa0dHipBiM5GK73XhkHn8M2hUl9y3L94dNwB8BwQhpd5WdHjBkyJiO7v0LRt4SGgsPg==}
hasBin: true
+ dependencies:
+ atomic-sleep: 1.0.0
+ fast-redact: 3.1.1
+ on-exit-leak-free: 2.1.0
+ pino-abstract-transport: 1.0.0
+ pino-std-serializers: 5.6.0
+ process-warning: 2.0.0
+ quick-format-unescaped: 4.0.4
+ real-require: 0.1.0
+ safe-stable-stringify: 2.3.1
+ sonic-boom: 3.0.0
+ thread-stream: 1.0.1
+ dev: false
+
+ /pkg-up/3.1.0:
+ resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==}
+ engines: {node: '>=8'}
+ dependencies:
+ find-up: 3.0.0
+ dev: false
+
+ /playwright-core/1.23.1:
+ resolution: {integrity: sha512-9CXsE0gawph4KXl6oUaa0ehHRySZjHvly4TybcBXDvzK3N3o6L/eZ8Q6iVWUiMn0LLS5bRFxo1qEtOETlYJxjw==}
+ engines: {node: '>=14'}
+ hasBin: true
+ dev: true
+
+ /postcss-import/[email protected]:
+ resolution: {integrity: sha512-flwI+Vgm4SElObFVPpTIT7SU7R3qk2L7PyduMcokiaVKuWv9d/U+Gm/QAd8NDLuykTWTkcrjOeD2Pp1rMeBTGw==}
+ engines: {node: '>=10.0.0'}
+ peerDependencies:
+ postcss: ^8.0.0
+ dependencies:
+ postcss: 8.4.14
+ postcss-value-parser: 4.2.0
+ read-cache: 1.0.0
+ resolve: 1.22.0
dev: true
- /postcss-js/[email protected]:
- resolution:
- {
- integrity: sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ==
- }
- engines: { node: ^12 || ^14 || >= 16 }
+ /postcss-js/[email protected]:
+ resolution: {integrity: sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ==}
+ engines: {node: ^12 || ^14 || >= 16}
peerDependencies:
postcss: ^8.3.3
dependencies:
camelcase-css: 2.0.1
- postcss: 8.4.13
-
- /postcss-load-config/3.1.4_4jqnslpwnj4ifyjfqbkuebd4fy:
- resolution:
- {
- integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==
- }
- engines: { node: '>= 10' }
+ postcss: 8.4.14
+ dev: true
+
+ /postcss-load-config/[email protected]:
+ resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==}
+ engines: {node: '>= 10'}
peerDependencies:
postcss: '>=8.0.9'
ts-node: '>=9.0.0'
@@ -4207,228 +4545,255 @@ packages:
optional: true
dependencies:
lilconfig: 2.0.5
- postcss: 8.4.13
- ts-node: 10.7.0_3smuweqyuzdazdnyhhezld6mfa
+ postcss: 8.4.14
yaml: 1.10.2
+ dev: true
- /postcss-nested/[email protected]:
- resolution:
- {
- integrity: sha512-rKqm2Fk0KbA8Vt3AdGN0FB9OBOMDVajMG6ZCf/GoHgdxUJ4sBFp0A/uMIRm+MJUdo33YXEtjqIz8u7DAp8B7DA==
- }
- engines: { node: '>=12.0' }
+ /postcss-nested/[email protected]:
+ resolution: {integrity: sha512-rKqm2Fk0KbA8Vt3AdGN0FB9OBOMDVajMG6ZCf/GoHgdxUJ4sBFp0A/uMIRm+MJUdo33YXEtjqIz8u7DAp8B7DA==}
+ engines: {node: '>=12.0'}
peerDependencies:
postcss: ^8.2.14
dependencies:
- postcss: 8.4.13
+ postcss: 8.4.14
postcss-selector-parser: 6.0.10
+ dev: true
/postcss-selector-parser/6.0.10:
- resolution:
- {
- integrity: sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==
- }
- engines: { node: '>=4' }
+ resolution: {integrity: sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==}
+ engines: {node: '>=4'}
dependencies:
cssesc: 3.0.0
util-deprecate: 1.0.2
+ dev: true
/postcss-value-parser/4.2.0:
- resolution:
- {
- integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
- }
-
- /postcss/8.4.13:
- resolution:
- {
- integrity: sha512-jtL6eTBrza5MPzy8oJLFuUscHDXTV5KcLlqAWHl5q5WYRfnNRGSmOZmOZ1T6Gy7A99mOZfqungmZMpMmCVJ8ZA==
- }
- engines: { node: ^10 || ^12 || >=14 }
+ resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
+ dev: true
+
+ /postcss/8.4.14:
+ resolution: {integrity: sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==}
+ engines: {node: ^10 || ^12 || >=14}
dependencies:
nanoid: 3.3.4
picocolors: 1.0.0
source-map-js: 1.0.2
+ dev: true
/prelude-ls/1.2.1:
- resolution:
- {
- integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
- }
- engines: { node: '>= 0.8.0' }
- dev: true
-
- /prettier-plugin-svelte/2.7.0_kkjbqzpydplecjtkxrgomroeru:
- resolution:
- {
- integrity: sha512-fQhhZICprZot2IqEyoiUYLTRdumULGRvw0o4dzl5jt0jfzVWdGqeYW27QTWAeXhoupEZJULmNoH3ueJwUWFLIA==
- }
- peerDependencies:
- prettier: ^1.16.4 || ^2.0.0
- svelte: ^3.2.0
+ resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
+ engines: {node: '>= 0.8.0'}
+ dev: true
+
+ /prettier-linter-helpers/1.0.0:
+ resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==}
+ engines: {node: '>=6.0.0'}
dependencies:
- prettier: 2.6.2
- svelte: 3.48.0
+ fast-diff: 1.2.0
dev: true
- /prettier-plugin-tailwindcss/[email protected]:
- resolution:
- {
- integrity: sha512-a28+1jvpIZQdZ/W97wOXb6VqI762MKE/TxMMuibMEHhyYsSxQA8Ek30KObd5kJI2HF1ldtSYprFayXJXi3pz8Q==
- }
- engines: { node: '>=12.17.0' }
+ /prettier-plugin-svelte/2.7.0_nakrehnrzdf7fdea5k3a4dfy4m:
+ resolution: {integrity: sha512-fQhhZICprZot2IqEyoiUYLTRdumULGRvw0o4dzl5jt0jfzVWdGqeYW27QTWAeXhoupEZJULmNoH3ueJwUWFLIA==}
peerDependencies:
- prettier: '>=2.2.0'
+ prettier: ^1.16.4 || ^2.0.0
+ svelte: ^3.2.0
dependencies:
- prettier: 2.6.2
+ prettier: 2.7.1
+ svelte: 3.48.0
dev: true
- /prettier/2.6.2:
- resolution:
- {
- integrity: sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==
- }
- engines: { node: '>=10.13.0' }
+ /prettier/2.7.1:
+ resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==}
+ engines: {node: '>=10.13.0'}
hasBin: true
dev: true
- /prisma/3.11.1:
- resolution:
- {
- integrity: sha512-aYn8bQwt1xwR2oSsVNHT4PXU7EhsThIwmpNB/MNUaaMx5OPLTro6VdNJe/sJssXFLxhamfWeMjwmpXjljo6xkg==
- }
- engines: { node: '>=12.6' }
+ /prisma/3.15.2:
+ resolution: {integrity: sha512-nMNSMZvtwrvoEQ/mui8L/aiCLZRCj5t6L3yujKpcDhIPk7garp8tL4nMx2+oYsN0FWBacevJhazfXAbV1kfBzA==}
+ engines: {node: '>=12.6'}
hasBin: true
requiresBuild: true
dependencies:
- '@prisma/engines': 3.11.1-1.1a2506facaf1a4727b7c26850735e88ec779dee9
+ '@prisma/engines': 3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e
/private/0.1.8:
- resolution:
- {
- integrity: sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==
- }
- engines: { node: '>= 0.6' }
+ resolution: {integrity: sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==}
+ engines: {node: '>= 0.6'}
dev: true
- /progress/2.0.3:
- resolution:
- {
- integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
- }
- engines: { node: '>=0.4.0' }
- dev: true
+ /process-warning/1.0.0:
+ resolution: {integrity: sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==}
+ dev: false
+
+ /process-warning/2.0.0:
+ resolution: {integrity: sha512-+MmoAXoUX+VTHAlwns0h+kFUWFs/3FZy+ZuchkgjyOu3oioLAo2LB5aCfKPh2+P9O18i3m43tUEv3YqttSy0Ww==}
+ dev: false
+
+ /property-expr/2.0.5:
+ resolution: {integrity: sha512-IJUkICM5dP5znhCckHSv30Q4b5/JA5enCtkRHYaOVOAocnH/1BQEYTC5NMfT3AVl/iXKdr3aqQbQn9DxyWknwA==}
+ dev: false
+
+ /proxy-addr/2.0.7:
+ resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==}
+ engines: {node: '>= 0.10'}
+ dependencies:
+ forwarded: 0.2.0
+ ipaddr.js: 1.9.1
+ dev: false
/pseudomap/1.0.2:
- resolution: { integrity: sha1-8FKijacOYYkX7wqKw0wa5aaChrM= }
+ resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==}
+ dev: true
+
+ /pstree.remy/1.1.8:
+ resolution: {integrity: sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==}
dev: true
/pump/3.0.0:
- resolution:
- {
- integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
- }
+ resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}
dependencies:
end-of-stream: 1.4.4
once: 1.4.0
dev: false
/punycode/2.1.1:
- resolution:
- {
- integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
- }
- engines: { node: '>=6' }
- dev: true
+ resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==}
+ engines: {node: '>=6'}
+
+ /qs/6.10.3:
+ resolution: {integrity: sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==}
+ engines: {node: '>=0.6'}
+ dependencies:
+ side-channel: 1.0.4
+ dev: false
+
+ /qs/6.9.3:
+ resolution: {integrity: sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==}
+ engines: {node: '>=0.6'}
+ dev: false
+
+ /querystringify/2.2.0:
+ resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==}
+ dev: false
/queue-microtask/1.2.3:
- resolution:
- {
- integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
- }
+ resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
+
+ /quick-format-unescaped/4.0.4:
+ resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==}
+ dev: false
/quick-lru/5.1.1:
- resolution:
- {
- integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==
- }
- engines: { node: '>=10' }
+ resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==}
+ engines: {node: '>=10'}
- /readable-stream/3.6.0:
- resolution:
- {
- integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==
- }
- engines: { node: '>= 6' }
+ /range-parser/1.2.1:
+ resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==}
+ engines: {node: '>= 0.6'}
+ dev: false
+
+ /read-cache/1.0.0:
+ resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==}
dependencies:
- inherits: 2.0.4
- string_decoder: 1.3.0
- util-deprecate: 1.0.2
+ pify: 2.3.0
+ dev: true
+
+ /read-pkg-up/7.0.1:
+ resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==}
+ engines: {node: '>=8'}
+ dependencies:
+ find-up: 4.1.0
+ read-pkg: 5.2.0
+ type-fest: 0.8.1
dev: false
- /readdirp/3.6.0:
- resolution:
- {
- integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
- }
- engines: { node: '>=8.10.0' }
+ /read-pkg/3.0.0:
+ resolution: {integrity: sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=}
+ engines: {node: '>=4'}
dependencies:
- picomatch: 2.3.0
+ load-json-file: 4.0.0
+ normalize-package-data: 2.5.0
+ path-type: 3.0.0
+ dev: true
- /redis-commands/1.7.0:
- resolution:
- {
- integrity: sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==
- }
+ /read-pkg/5.2.0:
+ resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==}
+ engines: {node: '>=8'}
+ dependencies:
+ '@types/normalize-package-data': 2.4.1
+ normalize-package-data: 2.5.0
+ parse-json: 5.2.0
+ type-fest: 0.6.0
dev: false
- /redis-errors/1.2.0:
- resolution: { integrity: sha1-62LSrbFeTq9GEMBK/hUpOEJQq60= }
- engines: { node: '>=4' }
+ /readable-stream/3.6.0:
+ resolution: {integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==}
+ engines: {node: '>= 6'}
+ dependencies:
+ inherits: 2.0.4
+ string_decoder: 1.3.0
+ util-deprecate: 1.0.2
+
+ /readable-stream/4.0.0:
+ resolution: {integrity: sha512-Mf7ilWBP6AV3tF3MjtBrHMH3roso7wIrpgzCwt9ybvqiJQVWIEBMnp/W+S//yvYSsUUi2cJIwD7q7m57l0AqZw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ abort-controller: 3.0.0
dev: false
- /redis-parser/3.0.0:
- resolution: { integrity: sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ= }
- engines: { node: '>=4' }
+ /readdirp/3.6.0:
+ resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
+ engines: {node: '>=8.10.0'}
dependencies:
- redis-errors: 1.2.0
+ picomatch: 2.3.1
+ dev: true
+
+ /real-require/0.1.0:
+ resolution: {integrity: sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==}
+ engines: {node: '>= 12.13.0'}
dev: false
/regenerate/1.4.2:
- resolution:
- {
- integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==
- }
+ resolution: {integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==}
dev: true
/regenerator-runtime/0.11.1:
- resolution:
- {
- integrity: sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==
- }
+ resolution: {integrity: sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==}
dev: true
+ /regenerator-runtime/0.13.9:
+ resolution: {integrity: sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==}
+ dev: false
+
/regenerator-transform/0.10.1:
- resolution:
- {
- integrity: sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==
- }
+ resolution: {integrity: sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==}
dependencies:
babel-runtime: 6.26.0
babel-types: 6.26.0
private: 0.1.8
dev: true
+ /regexp.prototype.flags/1.4.3:
+ resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.1.4
+ functions-have-names: 1.2.3
+ dev: true
+
+ /regexparam/2.0.0:
+ resolution: {integrity: sha512-gJKwd2MVPWHAIFLsaYDZfyKzHNS4o7E/v8YmNf44vmeV2e4YfVoDToTOKTvE7ab68cRJ++kLuEXJBaEeJVt5ow==}
+ engines: {node: '>=8'}
+ dev: true
+
/regexpp/3.2.0:
- resolution:
- {
- integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==}
+ engines: {node: '>=8'}
dev: true
/regexpu-core/2.0.0:
- resolution: { integrity: sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= }
+ resolution: {integrity: sha512-tJ9+S4oKjxY8IZ9jmjnp/mtytu1u3iyIQAfmI51IKWH6bFf7XR1ybtaO6j7INhZKXOTYADk7V5qxaqLkmNxiZQ==}
dependencies:
regenerate: 1.4.2
regjsgen: 0.2.0
@@ -4436,500 +4801,473 @@ packages:
dev: true
/regjsgen/0.2.0:
- resolution: { integrity: sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc= }
+ resolution: {integrity: sha512-x+Y3yA24uF68m5GA+tBjbGYo64xXVJpbToBaWCoSNSc1hdk6dfctaRWrNFTVJZIIhL5GxW8zwjoixbnifnK59g==}
dev: true
/regjsparser/0.1.5:
- resolution: { integrity: sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw= }
+ resolution: {integrity: sha512-jlQ9gYLfk2p3V5Ag5fYhA7fv7OHzd1KUH0PRP46xc3TgwjwgROIW572AfYg/X9kaNq/LJnu6oJcFRXlIrGoTRw==}
hasBin: true
dependencies:
jsesc: 0.5.0
dev: true
/repeating/2.0.1:
- resolution: { integrity: sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A==}
+ engines: {node: '>=0.10.0'}
dependencies:
is-finite: 1.1.0
dev: true
/require-from-string/2.0.2:
- resolution:
- {
- integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
- }
- engines: { node: '>=0.10.0' }
- dev: true
+ resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
+ engines: {node: '>=0.10.0'}
+ dev: false
- /require-relative/0.8.7:
- resolution: { integrity: sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4= }
- dev: true
+ /requires-port/1.0.0:
+ resolution: {integrity: sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=}
+ dev: false
/resolve-alpn/1.2.1:
- resolution:
- {
- integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==
- }
+ resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==}
dev: false
/resolve-from/4.0.0:
- resolution:
- {
- integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
- }
- engines: { node: '>=4' }
+ resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
+ engines: {node: '>=4'}
+ dev: true
+
+ /resolve-from/5.0.0:
+ resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
+ engines: {node: '>=8'}
dev: true
/resolve/1.22.0:
- resolution:
- {
- integrity: sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==
- }
+ resolution: {integrity: sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==}
hasBin: true
dependencies:
- is-core-module: 2.8.1
+ is-core-module: 2.9.0
path-parse: 1.0.7
supports-preserve-symlinks-flag: 1.0.0
/responselike/2.0.0:
- resolution:
- {
- integrity: sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==
- }
+ resolution: {integrity: sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==}
dependencies:
lowercase-keys: 2.0.0
dev: false
- /restore-cursor/3.1.0:
- resolution:
- {
- integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==
- }
- engines: { node: '>=8' }
- dependencies:
- onetime: 5.1.2
- signal-exit: 3.0.5
- dev: true
+ /ret/0.2.2:
+ resolution: {integrity: sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==}
+ engines: {node: '>=4'}
+ dev: false
/reusify/1.0.4:
- resolution:
- {
- integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
- }
- engines: { iojs: '>=1.0.0', node: '>=0.10.0' }
+ resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
+ engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
/rfdc/1.3.0:
- resolution:
- {
- integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==
- }
- dev: true
+ resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==}
+ dev: false
/rimraf/2.7.1:
- resolution:
- {
- integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
- }
+ resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==}
hasBin: true
dependencies:
- glob: 7.2.0
+ glob: 7.2.3
dev: true
/rimraf/3.0.2:
- resolution:
- {
- integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
- }
+ resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
hasBin: true
dependencies:
- glob: 7.2.0
+ glob: 7.2.3
+ dev: true
+
+ /rollup-pluginutils/2.8.2:
+ resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==}
+ dependencies:
+ estree-walker: 0.6.1
dev: true
- /rollup/2.61.1:
- resolution:
- {
- integrity: sha512-BbTXlEvB8d+XFbK/7E5doIcRtxWPRiqr0eb5vQ0+2paMM04Ye4PZY5nHOQef2ix24l/L0SpLd5hwcH15QHPdvA==
- }
- engines: { node: '>=10.0.0' }
+ /rollup/2.75.7:
+ resolution: {integrity: sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==}
+ engines: {node: '>=10.0.0'}
hasBin: true
optionalDependencies:
fsevents: 2.3.2
dev: true
/run-parallel/1.2.0:
- resolution:
- {
- integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==
- }
+ resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
dependencies:
queue-microtask: 1.2.3
-
- /rxjs/7.5.2:
- resolution:
- {
- integrity: sha512-PwDt186XaL3QN5qXj/H9DGyHhP3/RYYgZZwqBv9Tv8rsAaiwFH1IsJJlcgD37J7UW5a6O67qX0KWKS3/pu0m4w==
- }
- dependencies:
- tslib: 2.4.0
dev: true
- /sade/1.7.4:
- resolution:
- {
- integrity: sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==
- }
- engines: { node: '>= 6' }
+ /sade/1.8.1:
+ resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==}
+ engines: {node: '>=6'}
dependencies:
mri: 1.2.0
dev: true
/safe-buffer/5.1.2:
- resolution:
- {
- integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
- }
+ resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
dev: true
/safe-buffer/5.2.1:
- resolution:
- {
- integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
- }
+ resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
+
+ /safe-regex2/2.0.0:
+ resolution: {integrity: sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ==}
+ dependencies:
+ ret: 0.2.2
+ dev: false
+
+ /safe-stable-stringify/2.3.1:
+ resolution: {integrity: sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg==}
+ engines: {node: '>=10'}
+ dev: false
+
+ /safe-timers/1.1.0:
+ resolution: {integrity: sha512-9aqY+v5eMvmRaluUEtdRThV1EjlSElzO7HuCj0sTW9xvp++8iJ9t/RWGNWV6/WHcUJLHpyT2SNf/apoKTU2EpA==}
dev: false
/safer-buffer/2.1.2:
- resolution:
- {
- integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
- }
+ resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
dev: false
/sander/0.5.1:
- resolution: { integrity: sha1-dB4kXiMfB8r7b98PEzrfohalAq0= }
+ resolution: {integrity: sha512-3lVqBir7WuKDHGrKRDn/1Ye3kwpXaDOMsiRP1wd6wpZW56gJhsbp5RqQpA6JG/P+pkXizygnr1dKR8vzWaVsfA==}
dependencies:
es6-promise: 3.3.1
- graceful-fs: 4.2.8
- mkdirp: 0.5.5
+ graceful-fs: 4.2.10
+ mkdirp: 0.5.6
rimraf: 2.7.1
dev: true
+ /secure-json-parse/2.4.0:
+ resolution: {integrity: sha512-Q5Z/97nbON5t/L/sH6mY2EacfjVGwrCcSi5D3btRO2GZ8pf1K1UN7Z9H5J57hjVU2Qzxr1xO+FmBhOvEkzCMmg==}
+ dev: false
+
/semver/5.7.1:
- resolution:
- {
- integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
- }
+ resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==}
hasBin: true
- dev: false
/semver/6.3.0:
- resolution:
- {
- integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
- }
+ resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==}
hasBin: true
- dev: false
+ dev: true
+
+ /semver/7.0.0:
+ resolution: {integrity: sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==}
+ hasBin: true
+ dev: true
- /semver/7.3.5:
- resolution:
- {
- integrity: sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
- }
- engines: { node: '>=10' }
+ /semver/7.3.7:
+ resolution: {integrity: sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==}
+ engines: {node: '>=10'}
hasBin: true
dependencies:
lru-cache: 6.0.0
+
+ /send/0.18.0:
+ resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ debug: 2.6.9
+ depd: 2.0.0
+ destroy: 1.2.0
+ encodeurl: 1.0.2
+ escape-html: 1.0.3
+ etag: 1.8.1
+ fresh: 0.5.2
+ http-errors: 2.0.0
+ mime: 1.6.0
+ ms: 2.1.3
+ on-finished: 2.4.1
+ range-parser: 1.2.1
+ statuses: 2.0.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /sensitive-fields/0.0.9:
+ resolution: {integrity: sha512-6oGOAj9wPBKEuzJxqrN1sxMHJKbWOg7D2zNYOXaKrDC4lP6FpAw2MVuZd4okp/KqtRxkgLMweEd6HM1+c4m8Yg==}
+ dev: false
+
+ /set-blocking/2.0.0:
+ resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
dev: true
+ /set-cookie-parser/2.4.8:
+ resolution: {integrity: sha512-edRH8mBKEWNVIVMKejNnuJxleqYE/ZSdcT8/Nem9/mmosx12pctd80s2Oy00KNZzrogMZS5mauK2/ymL1bvlvg==}
+
+ /setprototypeof/1.2.0:
+ resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==}
+ dev: false
+
/shebang-command/1.2.0:
- resolution: { integrity: sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=}
+ engines: {node: '>=0.10.0'}
dependencies:
shebang-regex: 1.0.0
dev: true
/shebang-command/2.0.0:
- resolution:
- {
- integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
+ engines: {node: '>=8'}
dependencies:
shebang-regex: 3.0.0
/shebang-regex/1.0.0:
- resolution: { integrity: sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=}
+ engines: {node: '>=0.10.0'}
dev: true
/shebang-regex/3.0.0:
- resolution:
- {
- integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
+ engines: {node: '>=8'}
- /signal-exit/3.0.5:
- resolution:
- {
- integrity: sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==
- }
+ /shell-quote/1.7.3:
+ resolution: {integrity: sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==}
dev: true
- /slash/1.0.0:
- resolution: { integrity: sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= }
- engines: { node: '>=0.10.0' }
- dev: true
+ /side-channel/1.0.4:
+ resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
+ dependencies:
+ call-bind: 1.0.2
+ get-intrinsic: 1.1.1
+ object-inspect: 1.12.1
- /slash/3.0.0:
- resolution:
- {
- integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
- }
- engines: { node: '>=8' }
+ /signal-exit/3.0.7:
+ resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
dev: true
- /slice-ansi/3.0.0:
- resolution:
- {
- integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==
- }
- engines: { node: '>=8' }
+ /simple-update-notifier/1.0.7:
+ resolution: {integrity: sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==}
+ engines: {node: '>=8.10.0'}
dependencies:
- ansi-styles: 4.3.0
- astral-regex: 2.0.0
- is-fullwidth-code-point: 3.0.0
+ semver: 7.0.0
dev: true
- /slice-ansi/4.0.0:
- resolution:
- {
- integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==
- }
- engines: { node: '>=10' }
- dependencies:
- ansi-styles: 4.3.0
- astral-regex: 2.0.0
- is-fullwidth-code-point: 3.0.0
+ /slash/1.0.0:
+ resolution: {integrity: sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg==}
+ engines: {node: '>=0.10.0'}
dev: true
- /slice-ansi/5.0.0:
- resolution:
- {
- integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==
- }
- engines: { node: '>=12' }
- dependencies:
- ansi-styles: 6.1.0
- is-fullwidth-code-point: 4.0.0
+ /slash/3.0.0:
+ resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
+ engines: {node: '>=8'}
dev: true
+ /sonic-boom/3.0.0:
+ resolution: {integrity: sha512-p5DiZOZHbJ2ZO5MADczp5qrfOd3W5Vr2vHxfCpe7G4AzPwVOweIjbfgku8wSQUuk+Y5Yuo8W7JqRe6XKmKistg==}
+ dependencies:
+ atomic-sleep: 1.0.0
+ dev: false
+
/sorcery/0.10.0:
- resolution: { integrity: sha1-iukK19fLBfxZ8asMY3hF1cFaUrc= }
+ resolution: {integrity: sha512-R5ocFmKZQFfSTstfOtHjJuAwbpGyf9qjQa1egyhvXSbM7emjrtLXtGdZsDJDABC85YBfVvrOiGWKSYXPKdvP1g==}
hasBin: true
dependencies:
buffer-crc32: 0.2.13
- minimist: 1.2.5
+ minimist: 1.2.6
sander: 0.5.1
sourcemap-codec: 1.4.8
dev: true
/source-map-js/1.0.2:
- resolution:
- {
- integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
- }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
+ engines: {node: '>=0.10.0'}
+ dev: true
/source-map-support/0.4.18:
- resolution:
- {
- integrity: sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==
- }
+ resolution: {integrity: sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==}
dependencies:
source-map: 0.5.7
dev: true
/source-map/0.5.7:
- resolution: { integrity: sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==}
+ engines: {node: '>=0.10.0'}
dev: true
/sourcemap-codec/1.4.8:
- resolution:
- {
- integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==
- }
+ resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==}
dev: true
+ /spdx-correct/3.1.1:
+ resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==}
+ dependencies:
+ spdx-expression-parse: 3.0.1
+ spdx-license-ids: 3.0.11
+
+ /spdx-exceptions/2.3.0:
+ resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==}
+
+ /spdx-expression-parse/3.0.1:
+ resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==}
+ dependencies:
+ spdx-exceptions: 2.3.0
+ spdx-license-ids: 3.0.11
+
+ /spdx-license-ids/3.0.11:
+ resolution: {integrity: sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==}
+
/split-ca/1.0.1:
- resolution: { integrity: sha1-bIOv82kvphJW4M0ZfgXp3hV2kaY= }
+ resolution: {integrity: sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ==}
dev: false
- /sprintf-js/1.0.3:
- resolution: { integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= }
- dev: true
+ /split2/4.1.0:
+ resolution: {integrity: sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==}
+ engines: {node: '>= 10.x'}
+ dev: false
- /ssh2/1.5.0:
- resolution:
- {
- integrity: sha512-iUmRkhH9KGeszQwDW7YyyqjsMTf4z+0o48Cp4xOwlY5LjtbIAvyd3fwnsoUZW/hXmTCRA3yt7S/Jb9uVjErVlA==
- }
- engines: { node: '>=10.16.0' }
+ /ssh2/1.10.0:
+ resolution: {integrity: sha512-OnKAAmf4j8wCRrXXZv3Tp5lCZkLJZtgZbn45ELiShCg27djDQ3XFGvIzuGsIsf4hdHslP+VdhA9BhUQdTdfd9w==}
+ engines: {node: '>=10.16.0'}
requiresBuild: true
dependencies:
- asn1: 0.2.4
+ asn1: 0.2.6
bcrypt-pbkdf: 1.0.2
optionalDependencies:
- cpu-features: 0.0.2
- nan: 2.15.0
+ cpu-features: 0.0.4
+ nan: 2.16.0
dev: false
- /standard-as-callback/2.1.0:
- resolution:
- {
- integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==
- }
+ /statuses/2.0.1:
+ resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==}
+ engines: {node: '>= 0.8'}
dev: false
- /string-argv/0.3.1:
- resolution:
- {
- integrity: sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==
- }
- engines: { node: '>=0.6.19' }
- dev: true
+ /steed/1.1.3:
+ resolution: {integrity: sha512-EUkci0FAUiE4IvGTSKcDJIQ/eRUP2JJb56+fvZ4sdnguLTqIdKjSxUe138poW8mkvKWXW2sFPrgTsxqoISnmoA==}
+ dependencies:
+ fastfall: 1.5.1
+ fastparallel: 2.4.1
+ fastq: 1.13.0
+ fastseries: 1.7.2
+ reusify: 1.0.4
+ dev: false
/string-width/4.2.3:
- resolution:
- {
- integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
+ engines: {node: '>=8'}
dependencies:
emoji-regex: 8.0.0
is-fullwidth-code-point: 3.0.0
strip-ansi: 6.0.1
dev: true
- /string-width/5.1.0:
- resolution:
- {
- integrity: sha512-7x54QnN21P+XL/v8SuNKvfgsUre6PXpN7mc77N3HlZv+f1SBRGmjxtOud2Z6FZ8DmdkD/IdjCaf9XXbnqmTZGQ==
- }
- engines: { node: '>=12' }
+ /string.prototype.padend/3.1.3:
+ resolution: {integrity: sha512-jNIIeokznm8SD/TZISQsZKYu7RJyheFNt84DUPrh482GC8RVp2MKqm2O5oBRdGxbDQoXrhhWtPIWQOiy20svUg==}
+ engines: {node: '>= 0.4'}
dependencies:
- eastasianwidth: 0.2.0
- emoji-regex: 9.2.2
- strip-ansi: 7.0.1
+ call-bind: 1.0.2
+ define-properties: 1.1.4
+ es-abstract: 1.20.1
+ dev: true
+
+ /string.prototype.trimend/1.0.5:
+ resolution: {integrity: sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.1.4
+ es-abstract: 1.20.1
+ dev: true
+
+ /string.prototype.trimstart/1.0.5:
+ resolution: {integrity: sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==}
+ dependencies:
+ call-bind: 1.0.2
+ define-properties: 1.1.4
+ es-abstract: 1.20.1
dev: true
/string_decoder/1.3.0:
- resolution:
- {
- integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
- }
+ resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
dependencies:
safe-buffer: 5.2.1
- dev: false
/strip-ansi/3.0.1:
- resolution: { integrity: sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==}
+ engines: {node: '>=0.10.0'}
dependencies:
ansi-regex: 2.1.1
dev: true
/strip-ansi/6.0.1:
- resolution:
- {
- integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
+ engines: {node: '>=8'}
dependencies:
ansi-regex: 5.0.1
dev: true
/strip-ansi/7.0.1:
- resolution:
- {
- integrity: sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==
- }
- engines: { node: '>=12' }
+ resolution: {integrity: sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==}
+ engines: {node: '>=12'}
dependencies:
ansi-regex: 6.0.1
- dev: true
+ dev: false
- /strip-final-newline/2.0.0:
- resolution:
- {
- integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==
- }
- engines: { node: '>=6' }
- dev: true
+ /strip-bom/3.0.0:
+ resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
+ engines: {node: '>=4'}
/strip-indent/3.0.0:
- resolution:
- {
- integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==}
+ engines: {node: '>=8'}
dependencies:
min-indent: 1.0.1
dev: true
/strip-json-comments/3.1.1:
- resolution:
- {
- integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
- }
- engines: { node: '>=8' }
- dev: true
+ resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
+ engines: {node: '>=8'}
+ dev: true
+
+ /superagent/7.1.3:
+ resolution: {integrity: sha512-WA6et4nAvgBCS73lJvv1D0ssI5uk5Gh+TGN/kNe+B608EtcVs/yzfl+OLXTzDs7tOBDIpvgh/WUs1K2OK1zTeQ==}
+ engines: {node: '>=6.4.0 <13 || >=14'}
+ dependencies:
+ component-emitter: 1.3.0
+ cookiejar: 2.1.3
+ debug: 4.3.4
+ fast-safe-stringify: 2.1.1
+ form-data: 4.0.0
+ formidable: 2.0.1
+ methods: 1.1.2
+ mime: 2.6.0
+ qs: 6.10.3
+ readable-stream: 3.6.0
+ semver: 7.3.7
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
/supports-color/2.0.0:
- resolution: { integrity: sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= }
- engines: { node: '>=0.8.0' }
+ resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==}
+ engines: {node: '>=0.8.0'}
dev: true
/supports-color/5.5.0:
- resolution:
- {
- integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
- }
- engines: { node: '>=4' }
+ resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
+ engines: {node: '>=4'}
dependencies:
has-flag: 3.0.0
- dev: true
/supports-color/7.2.0:
- resolution:
- {
- integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
+ engines: {node: '>=8'}
dependencies:
has-flag: 4.0.0
dev: true
- /supports-color/9.2.1:
- resolution:
- {
- integrity: sha512-Obv7ycoCTG51N7y175StI9BlAXrmgZrFhZOb0/PyjHBher/NmsdBgbbQ1Inhq+gIhz6+7Gb+jWF2Vqi7Mf1xnQ==
- }
- engines: { node: '>=12' }
- dev: true
-
/supports-preserve-symlinks-flag/1.0.0:
- resolution:
- {
- integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
- }
- engines: { node: '>= 0.4' }
-
- /svelte-check/2.7.1_f2ke6qjyzu5axsjd6yk3u4tn7a:
- resolution:
- {
- integrity: sha512-vHVu2+SQ6ibt77iTQaq2oiOjBgGL48qqcg0ZdEOsP5pPOjgeyR9QbnaEdzdBs9nsVYBc/42haKtzb2uFqS8GVw==
- }
+ resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
+ engines: {node: '>= 0.4'}
+
+ /svelte-check/2.8.0_s3dopqgs4h45owyu2kxaf6kyfu:
+ resolution: {integrity: sha512-HRL66BxffMAZusqe5I5k26mRWQ+BobGd9Rxm3onh7ZVu0nTk8YTKJ9vu3LVPjUGLU9IX7zS+jmwPVhJYdXJ8vg==}
hasBin: true
peerDependencies:
svelte: ^3.24.0
@@ -4939,10 +5277,10 @@ packages:
fast-glob: 3.2.11
import-fresh: 3.3.0
picocolors: 1.0.0
- sade: 1.7.4
+ sade: 1.8.1
svelte: 3.48.0
- svelte-preprocess: 4.10.6_nq4dx2skq5drra53vttuo4lltu
- typescript: 4.6.4
+ svelte-preprocess: 4.10.7_jr4mgafwdbjtobsadg2hrd5qfy
+ typescript: 4.7.4
transitivePeerDependencies:
- '@babel/core'
- coffeescript
@@ -4956,30 +5294,18 @@ packages:
- sugarss
dev: true
- /svelte-hmr/[email protected]:
- resolution:
- {
- integrity: sha512-bKE9+4qb4sAnA+TKHiYurUl970rjA0XmlP9TEP7K/ncyWz3m81kA4HOgmlZK/7irGK7gzZlaPDI3cmf8fp/+tg==
- }
+ /svelte-hmr/[email protected]:
+ resolution: {integrity: sha512-4QSW/VvXuqVcFZ+RhxiR8/newmwOCTlbYIezvkeN6302YFRE8cXy0naamHcjz8Y9Ce3ITTZtrHrIL0AGfyo61w==}
+ engines: {node: ^12.20 || ^14.13.1 || >= 16}
peerDependencies:
svelte: '>=3.19.0'
dependencies:
svelte: 3.48.0
dev: true
- /svelte-kit-cookie-session/2.1.4:
- resolution:
- {
- integrity: sha512-z/ckxHWguYyy66UqfId4Lu+A77ft/3mV5oozbRTI9bnQY0tyJfns/SM0ikdkj7OV5GiI8kq7GSOGvajWwyGeZw==
- }
- dev: false
-
- /svelte-preprocess/4.10.6_nq4dx2skq5drra53vttuo4lltu:
- resolution:
- {
- integrity: sha512-I2SV1w/AveMvgIQlUF/ZOO3PYVnhxfcpNyGt8pxpUVhPfyfL/CZBkkw/KPfuFix5FJ9TnnNYMhACK3DtSaYVVQ==
- }
- engines: { node: '>= 9.11.2' }
+ /svelte-preprocess/4.10.7_jr4mgafwdbjtobsadg2hrd5qfy:
+ resolution: {integrity: sha512-sNPBnqYD6FnmdBrUmBCaqS00RyCsCpj2BG58A1JBswNF7b0OKviwxqVrOL/CKyJrLSClrSeqQv5BXNg2RUbPOw==}
+ engines: {node: '>= 9.11.2'}
requiresBuild: true
peerDependencies:
'@babel/core': ^7.10.2
@@ -4987,7 +5313,7 @@ packages:
less: ^3.11.3 || ^4.0.0
node-sass: '*'
postcss: ^7 || ^8
- postcss-load-config: ^2.1.0 || ^3.0.0
+ postcss-load-config: ^2.1.0 || ^3.0.0 || ^4.0.0
pug: ^3.0.0
sass: ^1.26.8
stylus: ^0.55.0
@@ -5018,83 +5344,52 @@ packages:
typescript:
optional: true
dependencies:
- '@types/pug': 2.0.5
- '@types/sass': 1.16.1
+ '@types/pug': 2.0.6
+ '@types/sass': 1.43.1
detect-indent: 6.1.0
- magic-string: 0.25.7
- postcss: 8.4.13
+ magic-string: 0.25.9
+ postcss: 8.4.14
sorcery: 0.10.0
strip-indent: 3.0.0
svelte: 3.48.0
- typescript: 4.6.4
+ typescript: 4.7.4
dev: true
/svelte-select/4.4.7:
- resolution:
- {
- integrity: sha512-fIf9Z8rPI6F8naHZ9wjXT0Pv5gLyhdHAFkHFJnCfVVfELE8e82uOoF0xEVQP6Kir+b4Q5yOvNAzZ61WbSU6A0A==
- }
- dev: true
+ resolution: {integrity: sha512-fIf9Z8rPI6F8naHZ9wjXT0Pv5gLyhdHAFkHFJnCfVVfELE8e82uOoF0xEVQP6Kir+b4Q5yOvNAzZ61WbSU6A0A==}
+ dev: false
/svelte/3.48.0:
- resolution:
- {
- integrity: sha512-fN2YRm/bGumvjUpu6yI3BpvZnpIm9I6A7HR4oUNYd7ggYyIwSA/BX7DJ+UXXffLp6XNcUijyLvttbPVCYa/3xQ==
- }
- engines: { node: '>= 8' }
- dev: true
-
- /sveltekit-i18n/[email protected]:
- resolution:
- {
- integrity: sha512-1CyaRN6dBvp467JjBdji+nJf+7pZ3myFu+2YaCuGSAt09Cvt5ndfRbzy+aAd5WJdk6Lu/hnPEE7ZZFauTbDRNw==
- }
+ resolution: {integrity: sha512-fN2YRm/bGumvjUpu6yI3BpvZnpIm9I6A7HR4oUNYd7ggYyIwSA/BX7DJ+UXXffLp6XNcUijyLvttbPVCYa/3xQ==}
+ engines: {node: '>= 8'}
+
+ /sveltekit-i18n/[email protected]:
+ resolution: {integrity: sha512-6eygICleGCSL7elY7A3trF8XUhV+mlW56ZSoD0UUKXlw+Y6u0MTTHDq48u1LyY73SfnlbPHXgTarhTjZ0BvUKA==}
peerDependencies:
svelte: ^3.x
dependencies:
'@sveltekit-i18n/base': [email protected]
'@sveltekit-i18n/parser-default': 1.0.3
svelte: 3.48.0
- dev: true
-
- /table/6.7.2:
- resolution:
- {
- integrity: sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==
- }
- engines: { node: '>=10.0.0' }
- dependencies:
- ajv: 8.6.3
- lodash.clonedeep: 4.5.0
- lodash.truncate: 4.4.2
- slice-ansi: 4.0.0
- string-width: 4.2.3
- strip-ansi: 6.0.1
- dev: true
+ dev: false
- /tailwindcss-scrollbar/[email protected]:
- resolution:
- {
- integrity: sha512-egipxw4ooQDh94x02XQpPck0P0sfwazwoUGfA9SedPATIuYDR+6qe8d31Gl7YsSMRiOKDkkqfI0kBvEw9lT/Hg==
- }
+ /tailwindcss-scrollbar/[email protected]:
+ resolution: {integrity: sha512-egipxw4ooQDh94x02XQpPck0P0sfwazwoUGfA9SedPATIuYDR+6qe8d31Gl7YsSMRiOKDkkqfI0kBvEw9lT/Hg==}
peerDependencies:
tailwindcss: '>= 2.x.x'
dependencies:
- tailwindcss: [email protected]
- dev: false
+ tailwindcss: 3.1.4
+ dev: true
- /tailwindcss/[email protected]:
- resolution:
- {
- integrity: sha512-H3uMmZNWzG6aqmg9q07ZIRNIawoiEcNFKDfL+YzOPuPsXuDXxJxB9icqzLgdzKNwjG3SAro2h9SYav8ewXNgig==
- }
- engines: { node: '>=12.13.0' }
+ /tailwindcss/3.1.4:
+ resolution: {integrity: sha512-NrxbFV4tYsga/hpWbRyUfIaBrNMXDxx5BsHgBS4v5tlyjf+sDsgBg5m9OxjrXIqAS/uR9kicxLKP+bEHI7BSeQ==}
+ engines: {node: '>=12.13.0'}
hasBin: true
dependencies:
- arg: 5.0.1
+ arg: 5.0.2
chokidar: 3.5.3
color-name: 1.1.4
- detective: 5.2.0
+ detective: 5.2.1
didyoumean: 1.2.2
dlv: 1.1.3
fast-glob: 3.2.11
@@ -5104,22 +5399,21 @@ packages:
normalize-path: 3.0.0
object-hash: 3.0.0
picocolors: 1.0.0
- postcss: 8.4.13
- postcss-js: [email protected]
- postcss-load-config: 3.1.4_4jqnslpwnj4ifyjfqbkuebd4fy
- postcss-nested: [email protected]
+ postcss: 8.4.14
+ postcss-import: [email protected]
+ postcss-js: [email protected]
+ postcss-load-config: [email protected]
+ postcss-nested: [email protected]
postcss-selector-parser: 6.0.10
postcss-value-parser: 4.2.0
quick-lru: 5.1.1
resolve: 1.22.0
transitivePeerDependencies:
- ts-node
+ dev: true
/tar-fs/2.0.1:
- resolution:
- {
- integrity: sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==
- }
+ resolution: {integrity: sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==}
dependencies:
chownr: 1.1.4
mkdirp-classic: 0.5.3
@@ -5128,11 +5422,8 @@ packages:
dev: false
/tar-stream/2.2.0:
- resolution:
- {
- integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==
- }
- engines: { node: '>=6' }
+ resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}
+ engines: {node: '>=6'}
dependencies:
bl: 4.1.0
end-of-stream: 1.4.4
@@ -5141,48 +5432,78 @@ packages:
readable-stream: 3.6.0
dev: false
- /text-table/0.2.0:
- resolution: { integrity: sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= }
+ /tar/6.1.11:
+ resolution: {integrity: sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==}
+ engines: {node: '>= 10'}
+ dependencies:
+ chownr: 2.0.0
+ fs-minipass: 2.1.0
+ minipass: 3.1.6
+ minizlib: 2.1.2
+ mkdirp: 1.0.4
+ yallist: 4.0.0
dev: true
- /through/2.3.8:
- resolution: { integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= }
+ /text-table/0.2.0:
+ resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
dev: true
+ /thread-stream/1.0.1:
+ resolution: {integrity: sha512-JuZyfzx81e5MBk8uIr8ZH76bXyjEQvbRDEkSdlV1JFBdq/rbby2RuvzBYlTBd/xCljxy6lPxrTLXzB9Jl1bNrw==}
+ dependencies:
+ real-require: 0.1.0
+ dev: false
+
/tiny-glob/0.2.9:
- resolution:
- {
- integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==
- }
+ resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==}
dependencies:
globalyzer: 0.1.0
globrex: 0.1.2
- dev: true
+
+ /tiny-lru/8.0.2:
+ resolution: {integrity: sha512-ApGvZ6vVvTNdsmt676grvCkUCGwzG9IqXma5Z07xJgiC5L7akUMof5U8G2JTI9Rz/ovtVhJBlY6mNhEvtjzOIg==}
+ engines: {node: '>=6'}
+ dev: false
/to-fast-properties/1.0.3:
- resolution: { integrity: sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og==}
+ engines: {node: '>=0.10.0'}
dev: true
/to-regex-range/5.0.1:
- resolution:
- {
- integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
- }
- engines: { node: '>=8.0' }
+ resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
+ engines: {node: '>=8.0'}
dependencies:
is-number: 7.0.0
+ dev: true
+
+ /toidentifier/1.0.1:
+ resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==}
+ engines: {node: '>=0.6'}
+ dev: false
+
+ /toposort/2.0.2:
+ resolution: {integrity: sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==}
+ dev: false
+
+ /touch/3.1.0:
+ resolution: {integrity: sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==}
+ hasBin: true
+ dependencies:
+ nopt: 1.0.10
+ dev: true
+
+ /tr46/0.0.3:
+ resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
+ dev: true
/trim-right/1.0.1:
- resolution: { integrity: sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= }
- engines: { node: '>=0.10.0' }
+ resolution: {integrity: sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==}
+ engines: {node: '>=0.10.0'}
dev: true
- /ts-node/10.7.0_3smuweqyuzdazdnyhhezld6mfa:
- resolution:
- {
- integrity: sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==
- }
+ /ts-node/10.8.2_fxk5i3xm3ivo7fjwhcizcinpla:
+ resolution: {integrity: sha512-LYdGnoGddf1D6v8REPtIH+5iq/gTDuZqv2/UJUU7tKjuEU8xVZorBM+buCGNjj+pGEud+sOoM4CX3/YzINpENA==}
hasBin: true
peerDependencies:
'@swc/core': '>=1.2.50'
@@ -5195,142 +5516,140 @@ packages:
'@swc/wasm':
optional: true
dependencies:
- '@cspotcode/source-map-support': 0.7.0
+ '@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.8
'@tsconfig/node12': 1.0.9
'@tsconfig/node14': 1.0.1
'@tsconfig/node16': 1.0.2
- '@types/node': 17.0.34
- acorn: 8.5.0
+ '@types/node': 18.0.3
+ acorn: 8.7.1
acorn-walk: 8.2.0
arg: 4.1.3
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
- typescript: 4.6.4
- v8-compile-cache-lib: 3.0.0
+ typescript: 4.7.4
+ v8-compile-cache-lib: 3.0.1
yn: 3.1.1
+ dev: false
+
+ /tsconfig-paths/4.0.0:
+ resolution: {integrity: sha512-SLBg2GBKlR6bVtMgJJlud/o3waplKtL7skmLkExomIiaAtLGtVsoXIqP3SYdjbcH9lq/KVv7pMZeCBpLYOit6Q==}
+ dependencies:
+ json5: 2.2.1
+ minimist: 1.2.6
+ strip-bom: 3.0.0
/tslib/1.14.1:
- resolution:
- {
- integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
- }
+ resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
+ dev: true
/tslib/2.4.0:
- resolution:
- {
- integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==
- }
- dev: true
-
- /tsutils/[email protected]:
- resolution:
- {
- integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==
- }
- engines: { node: '>= 6' }
+ resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==}
+ dev: true
+
+ /tsutils/[email protected]:
+ resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
+ engines: {node: '>= 6'}
peerDependencies:
typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
dependencies:
tslib: 1.14.1
- typescript: 4.6.4
+ typescript: 4.7.4
dev: true
/tweetnacl/0.14.5:
- resolution: { integrity: sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= }
+ resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==}
dev: false
/type-check/0.4.0:
- resolution:
- {
- integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==
- }
- engines: { node: '>= 0.8.0' }
+ resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
+ engines: {node: '>= 0.8.0'}
dependencies:
prelude-ls: 1.2.1
dev: true
/type-fest/0.20.2:
- resolution:
- {
- integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==
- }
- engines: { node: '>=10' }
- dev: true
-
- /type-fest/0.21.3:
- resolution:
- {
- integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==
- }
- engines: { node: '>=10' }
- dev: true
-
- /typescript/4.6.4:
- resolution:
- {
- integrity: sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==
- }
- engines: { node: '>=4.2.0' }
+ resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}
+ engines: {node: '>=10'}
+ dev: true
+
+ /type-fest/0.6.0:
+ resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /type-fest/0.8.1:
+ resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /typescript/4.7.4:
+ resolution: {integrity: sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==}
+ engines: {node: '>=4.2.0'}
hasBin: true
/typpy/2.3.11:
- resolution:
- {
- integrity: sha512-Jh/fykZSaxeKO0ceMAs6agki9T5TNA9kiIR6fzKbvafKpIw8UlNlHhzuqKyi5lfJJ5VojJOx9tooIbyy7vHV/g==
- }
+ resolution: {integrity: sha512-Jh/fykZSaxeKO0ceMAs6agki9T5TNA9kiIR6fzKbvafKpIw8UlNlHhzuqKyi5lfJJ5VojJOx9tooIbyy7vHV/g==}
dependencies:
function.name: 1.0.13
dev: false
+ /unbox-primitive/1.0.2:
+ resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==}
+ dependencies:
+ call-bind: 1.0.2
+ has-bigints: 1.0.2
+ has-symbols: 1.0.3
+ which-boxed-primitive: 1.0.2
+ dev: true
+
+ /undefsafe/2.0.5:
+ resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==}
+ dev: true
+
/unique-names-generator/4.7.1:
- resolution:
- {
- integrity: sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow==
- }
- engines: { node: '>=8' }
+ resolution: {integrity: sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow==}
+ engines: {node: '>=8'}
dev: false
/uri-js/4.4.1:
- resolution:
- {
- integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==
- }
+ resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
dependencies:
punycode: 2.1.1
- dev: true
+
+ /url-parse/1.5.10:
+ resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==}
+ dependencies:
+ querystringify: 2.2.0
+ requires-port: 1.0.0
+ dev: false
/util-deprecate/1.0.2:
- resolution: { integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= }
+ resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
- /uuid/8.3.2:
- resolution:
- {
- integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
- }
- hasBin: true
+ /v8-compile-cache-lib/3.0.1:
+ resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
dev: false
- /v8-compile-cache-lib/3.0.0:
- resolution:
- {
- integrity: sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==
- }
-
/v8-compile-cache/2.3.0:
- resolution:
- {
- integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==
- }
- dev: true
-
- /vite/2.9.1:
- resolution:
- {
- integrity: sha512-vSlsSdOYGcYEJfkQ/NeLXgnRv5zZfpAsdztkIrs7AZHV8RCMZQkwjo4DS5BnrYTqoWqLoUe1Cah4aVO4oNNqCQ==
- }
- engines: { node: '>=12.2.0' }
+ resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==}
+ dev: true
+
+ /validate-npm-package-license/3.0.4:
+ resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==}
+ dependencies:
+ spdx-correct: 3.1.1
+ spdx-expression-parse: 3.0.1
+
+ /vary/1.1.2:
+ resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
+ engines: {node: '>= 0.8'}
+ dev: false
+
+ /vite/2.9.13:
+ resolution: {integrity: sha512-AsOBAaT0AD7Mhe8DuK+/kE4aWYFMx/i0ZNi98hJclxb4e0OhQcZYUrvLjIaQ8e59Ui7txcvKMiJC1yftqpQoDw==}
+ engines: {node: '>=12.2.0'}
hasBin: true
peerDependencies:
less: '*'
@@ -5344,105 +5663,111 @@ packages:
stylus:
optional: true
dependencies:
- esbuild: 0.14.34
- postcss: 8.4.13
+ esbuild: 0.14.48
+ postcss: 8.4.14
resolve: 1.22.0
- rollup: 2.61.1
+ rollup: 2.75.7
optionalDependencies:
fsevents: 2.3.2
dev: true
+ /webidl-conversions/3.0.1:
+ resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
+ dev: true
+
+ /whatwg-url/5.0.0:
+ resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
+ dependencies:
+ tr46: 0.0.3
+ webidl-conversions: 3.0.1
+ dev: true
+
+ /which-boxed-primitive/1.0.2:
+ resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==}
+ dependencies:
+ is-bigint: 1.0.4
+ is-boolean-object: 1.1.2
+ is-number-object: 1.0.7
+ is-string: 1.0.7
+ is-symbol: 1.0.4
+ dev: true
+
/which/1.3.1:
- resolution:
- {
- integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
- }
+ resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==}
hasBin: true
dependencies:
isexe: 2.0.0
dev: true
/which/2.0.2:
- resolution:
- {
- integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
- }
- engines: { node: '>= 8' }
+ resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
+ engines: {node: '>= 8'}
hasBin: true
dependencies:
isexe: 2.0.0
- /word-wrap/1.2.3:
- resolution:
- {
- integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
- }
- engines: { node: '>=0.10.0' }
- dev: true
-
- /wrap-ansi/6.2.0:
- resolution:
- {
- integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==
- }
- engines: { node: '>=8' }
+ /wide-align/1.1.5:
+ resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==}
dependencies:
- ansi-styles: 4.3.0
string-width: 4.2.3
- strip-ansi: 6.0.1
dev: true
- /wrap-ansi/7.0.0:
- resolution:
- {
- integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
- }
- engines: { node: '>=10' }
+ /word-wrap/1.2.3:
+ resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==}
+ engines: {node: '>=0.10.0'}
+ dev: true
+
+ /worktop/0.8.0-next.14:
+ resolution: {integrity: sha512-RZgqHu1w/JcUdWOE/BUEAzarrUUHh39eWkLdX8XpA6MfgLJF6X5Vl26CV7/wcm4O/UpZvHMGJUtB9eYTqDjc9g==}
+ engines: {node: '>=12'}
dependencies:
- ansi-styles: 4.3.0
- string-width: 4.2.3
- strip-ansi: 6.0.1
+ mrmime: 1.0.0
+ regexparam: 2.0.0
dev: true
/wrappy/1.0.2:
- resolution: { integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= }
+ resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=}
/xtend/4.0.2:
- resolution:
- {
- integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
- }
- engines: { node: '>=0.4' }
+ resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
+ engines: {node: '>=0.4'}
/yallist/2.1.2:
- resolution: { integrity: sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= }
+ resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==}
dev: true
/yallist/4.0.0:
- resolution:
- {
- integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
- }
- dev: true
+ resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
/yaml/1.10.2:
- resolution:
- {
- integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
- }
- engines: { node: '>= 6' }
+ resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==}
+ engines: {node: '>= 6'}
+ dev: true
/yn/3.1.1:
- resolution:
- {
- integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==
- }
- engines: { node: '>=6' }
+ resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /yocto-queue/0.1.0:
+ resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
+ engines: {node: '>=10'}
+ dev: false
/yocto-queue/1.0.0:
- resolution:
- {
- integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==
- }
- engines: { node: '>=12.20' }
+ resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==}
+ engines: {node: '>=12.20'}
+ dev: false
+
+ /yup/0.32.9:
+ resolution: {integrity: sha512-Ci1qN+i2H0XpY7syDQ0k5zKQ/DoxO0LzPg8PAR/X4Mpj6DqaeCoIYEEjDJwhArh3Fa7GWbQQVDZKeXYlSH4JMg==}
+ engines: {node: '>=10'}
+ dependencies:
+ '@babel/runtime': 7.18.3
+ '@types/lodash': 4.14.182
+ lodash: 4.17.21
+ lodash-es: 4.17.21
+ nanoclone: 0.2.1
+ property-expr: 2.0.5
+ toposort: 2.0.2
dev: false
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
new file mode 100644
index 0000000000..bd646fe6b4
--- /dev/null
+++ b/pnpm-workspace.yaml
@@ -0,0 +1,3 @@
+prefer-workspace-packages: true
+packages:
+ - 'apps/*'
\ No newline at end of file
diff --git a/prisma/seed.cjs b/prisma/seed.cjs
deleted file mode 100644
index 2a76ee27cf..0000000000
--- a/prisma/seed.cjs
+++ /dev/null
@@ -1,159 +0,0 @@
-const dotEnvExtended = require('dotenv-extended');
-dotEnvExtended.load();
-const { PrismaClient } = require('@prisma/client');
-const prisma = new PrismaClient();
-const crypto = require('crypto');
-const generator = require('generate-password');
-const cuid = require('cuid');
-const compare = require('compare-versions');
-const { version } = require('../package.json');
-const child = require('child_process');
-const util = require('util');
-
-const algorithm = 'aes-256-ctr';
-
-function generatePassword(length = 24) {
- return generator.generate({
- length,
- numbers: true,
- strict: true
- });
-}
-const asyncExecShell = util.promisify(child.exec);
-
-async function main() {
- // Enable registration for the first user
- // Set initial HAProxy password
- const settingsFound = await prisma.setting.findFirst({});
- if (!settingsFound) {
- await prisma.setting.create({
- data: {
- isRegistrationEnabled: true,
- proxyPassword: encrypt(generatePassword()),
- proxyUser: cuid()
- }
- });
- } else {
- await prisma.setting.update({
- where: {
- id: settingsFound.id
- },
- data: {
- proxyHash: null
- }
- });
- }
- const localDocker = await prisma.destinationDocker.findFirst({
- where: { engine: '/var/run/docker.sock' }
- });
- if (!localDocker) {
- await prisma.destinationDocker.create({
- data: {
- engine: '/var/run/docker.sock',
- name: 'Local Docker',
- isCoolifyProxyUsed: true,
- network: 'coolify'
- }
- });
- }
-
- // Set auto-update based on env variable
- const isAutoUpdateEnabled = process.env['COOLIFY_AUTO_UPDATE'] === 'true';
- const settings = await prisma.setting.findFirst({});
- if (settings) {
- await prisma.setting.update({
- where: {
- id: settings.id
- },
- data: {
- isAutoUpdateEnabled
- }
- });
- }
- if (settings.isTraefikUsed) {
- // Force stop Coolify Proxy, as it had a bug in < 2.9.2. TrustProxy + api.insecure
- try {
- const { stdout } = await asyncExecShell(
- `docker inspect coolify-proxy --format '{{json .Config.Cmd}}'`
- );
- if (
- !stdout
- .replaceAll('[', '')
- .replaceAll(']', '')
- .replaceAll('"', '')
- .replace('\n', '')
- .split(',')
- .includes('--entrypoints.web.forwardedHeaders.insecure=true')
- ) {
- console.log('Reconfiguring Coolify Proxy (Traefik)...');
- await asyncExecShell(`docker stop -t 0 coolify-proxy && docker rm coolify-proxy`);
- const { stdout: Config } = await asyncExecShell(
- `docker network inspect bridge --format '{{json .IPAM.Config }}'`
- );
- const ip = JSON.parse(Config)[0].Gateway;
- await asyncExecShell(
- `docker run --restart always \
- --add-host 'host.docker.internal:host-gateway' \
- --add-host 'host.docker.internal:${ip}' \
- -v coolify-traefik-letsencrypt:/etc/traefik/acme \
- -v /var/run/docker.sock:/var/run/docker.sock \
- --network coolify-infra \
- -p "80:80" \
- -p "443:443" \
- --name coolify-proxy \
- -d traefik:v2.6 \
- --entrypoints.web.address=:80 \
- --entrypoints.web.forwardedHeaders.insecure=true \
- --entrypoints.websecure.address=:443 \
- --entrypoints.websecure.forwardedHeaders.insecure=true \
- --providers.docker=true \
- --providers.docker.exposedbydefault=false \
- --providers.http.endpoint=http://coolify:3000/webhooks/traefik/main.json \
- --providers.http.pollTimeout=5s \
- --certificatesresolvers.letsencrypt.acme.httpchallenge=true \
- --certificatesresolvers.letsencrypt.acme.storage=/etc/traefik/acme/acme.json \
- --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web \
- --log.level=error`
- );
- }
- } catch (error) {
- console.log(error);
- }
- }
-}
-main()
- .catch((e) => {
- console.error(e);
- process.exit(1);
- })
- .finally(async () => {
- await prisma.$disconnect();
- });
-
-const encrypt = (text) => {
- if (text) {
- const iv = crypto.randomBytes(16);
- const cipher = crypto.createCipheriv(algorithm, process.env['COOLIFY_SECRET_KEY'], iv);
- const encrypted = Buffer.concat([cipher.update(text), cipher.final()]);
- return JSON.stringify({
- iv: iv.toString('hex'),
- content: encrypted.toString('hex')
- });
- }
-};
-
-const decrypt = (hashString) => {
- if (hashString) {
- const hash = JSON.parse(hashString);
- const decipher = crypto.createDecipheriv(
- algorithm,
- process.env['COOLIFY_SECRET_KEY'],
- Buffer.from(hash.iv, 'hex')
- );
- const decrpyted = Buffer.concat([
- decipher.update(Buffer.from(hash.content, 'hex')),
- decipher.final()
- ]);
- return decrpyted.toString();
- }
-};
diff --git a/src/app.d.ts b/src/app.d.ts
deleted file mode 100644
index ccdea3ceed..0000000000
--- a/src/app.d.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-/// <reference types="@sveltejs/kit" />
-
-declare namespace App {
- interface Locals {
- session: import('svelte-kit-cookie-session').Session<SessionData>;
- cookies: Record<string, string>;
- }
- interface Platform {}
- interface Session extends SessionData {
- whiteLabelDetails: {
- icon: string | null;
- };
- }
- interface Stuff {
- service: any;
- application: any;
- isRunning: boolean;
- appId: string;
- readOnly: boolean;
- source: string;
- settings: string;
- database: Record<string, any>;
- versions: string;
- privatePort: string;
- }
-}
-
-interface SessionData {
- whiteLabeled: boolean;
- version?: string;
- userId?: string | null;
- teamId?: string | null;
- permission?: string;
- lang?: string;
- isAdmin?: boolean;
- expires?: string | null;
-}
-
-type DateTimeFormatOptions = {
- localeMatcher?: 'lookup' | 'best fit';
- weekday?: 'long' | 'short' | 'narrow';
- era?: 'long' | 'short' | 'narrow';
- year?: 'numeric' | '2-digit';
- month?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow';
- day?: 'numeric' | '2-digit';
- hour?: 'numeric' | '2-digit';
- minute?: 'numeric' | '2-digit';
- second?: 'numeric' | '2-digit';
- timeZoneName?: 'long' | 'short';
- formatMatcher?: 'basic' | 'best fit';
- hour12?: boolean;
- timeZone?: string;
-};
-
-interface Hash {
- iv: string;
- content: string;
-}
-
-type RawHaproxyConfiguration = {
- _version: number;
- data: string;
-};
-
-type NewTransaction = {
- _version: number;
- id: string;
- status: string;
-};
-
-type Application = {
- name: string;
- domain: string;
-};
diff --git a/src/hooks.ts b/src/hooks.ts
deleted file mode 100644
index 639bab3536..0000000000
--- a/src/hooks.ts
+++ /dev/null
@@ -1,118 +0,0 @@
-import dotEnvExtended from 'dotenv-extended';
-dotEnvExtended.load();
-import type { GetSession } from '@sveltejs/kit';
-import { handleSession } from 'svelte-kit-cookie-session';
-import { getUserDetails, sentry } from '$lib/common';
-import { version } from '$lib/common';
-import cookie from 'cookie';
-import { dev } from '$app/env';
-import { locales } from '$lib/translations';
-
-const whiteLabeled = process.env['COOLIFY_WHITE_LABELED'] === 'true';
-const whiteLabelDetails = {
- icon: (whiteLabeled && process.env['COOLIFY_WHITE_LABELED_ICON']) || null
-};
-
-export const handle = handleSession(
- {
- secret: process.env['COOLIFY_SECRET_KEY'],
- expires: 30,
- cookie: { secure: false }
- },
- async function ({ event, resolve }) {
- let response;
-
- const { url, request } = event;
-
- // Get defined locales
- const supportedLocales = locales.get();
- let locale;
-
- if (event.locals.cookies['lang']) {
- locale = event.locals.cookies['lang'];
- } else if (!locale) {
- locale = `${`${request.headers.get('accept-language')}`.match(
- /[a-zA-Z]+?(?=-|_|,|;)/
- )}`.toLowerCase();
- }
-
- // Set default locale if user preferred locale does not match
- if (!supportedLocales.includes(locale)) locale = 'en';
-
- try {
- if (event.locals.cookies) {
- if (event.locals.cookies['kit.session']) {
- const { permission, teamId, userId } = await getUserDetails(event, false);
- const newSession = {
- userId,
- teamId,
- permission,
- isAdmin: permission === 'admin' || permission === 'owner',
- expires: event.locals.session.data.expires
- };
-
- if (JSON.stringify(event.locals.session.data) !== JSON.stringify(newSession)) {
- event.locals.session.data = { ...newSession };
- }
- }
- }
-
- response = await resolve(event, {
- ssr: !event.url.pathname.startsWith('/webhooks/success'),
- transformPage: ({ html }) => html.replace(/<html.*>/, `<html lang="${locale}">`)
- });
- } catch (error) {
- console.log(error);
- response = await resolve(event, {
- ssr: !event.url.pathname.startsWith('/webhooks/success'),
- transformPage: ({ html }) => html.replace(/<html.*>/, `<html lang="${locale}">`)
- });
- response.headers.append(
- 'Set-Cookie',
- cookie.serialize('kit.session', '', {
- path: '/',
- expires: new Date('Thu, 01 Jan 1970 00:00:01 GMT')
- })
- );
- response.headers.append(
- 'Set-Cookie',
- cookie.serialize('teamId', '', {
- path: '/',
- expires: new Date('Thu, 01 Jan 1970 00:00:01 GMT')
- })
- );
- response.headers.append(
- 'Set-Cookie',
- cookie.serialize('gitlabToken', '', {
- path: '/',
- expires: new Date('Thu, 01 Jan 1970 00:00:01 GMT')
- })
- );
- }
-
- response.headers.append(
- 'Set-Cookie',
- cookie.serialize('lang', locale, {
- path: '/',
- sameSite: 'strict',
- maxAge: 30 * 24 * 60 * 60
- })
- );
-
- return response;
- }
-);
-
-export const getSession: GetSession = function ({ locals }) {
- return {
- lang: locals.cookies.lang,
- version,
- whiteLabeled,
- whiteLabelDetails,
- ...locals.session.data
- };
-};
-
-export async function handleError({ error, event }) {
- // if (!dev) sentry.captureException(error, event);
-}
diff --git a/src/lib/common.ts b/src/lib/common.ts
deleted file mode 100644
index cae9350cea..0000000000
--- a/src/lib/common.ts
+++ /dev/null
@@ -1,282 +0,0 @@
-import child from 'child_process';
-import util from 'util';
-import { dev } from '$app/env';
-import * as Sentry from '@sentry/node';
-import { uniqueNamesGenerator, adjectives, colors, animals } from 'unique-names-generator';
-import type { Config } from 'unique-names-generator';
-import { promises as dns } from 'dns';
-import { isIP } from 'is-ip';
-
-import * as db from '$lib/database';
-import { buildLogQueue } from './queues';
-
-import { version as currentVersion } from '../../package.json';
-import dayjs from 'dayjs';
-import Cookie from 'cookie';
-import os from 'os';
-import type { RequestEvent } from '@sveltejs/kit/types/internal';
-import type { Job } from 'bullmq';
-import { t } from './translations';
-
-try {
- if (!dev) {
- // Sentry.init({
- // dsn: process.env['COOLIFY_SENTRY_DSN'],
- // tracesSampleRate: 0,
- // environment: 'production',
- // debug: true,
- // release: currentVersion,
- // initialScope: {
- // tags: {
- // appId: process.env['COOLIFY_APP_ID'],
- // 'os.arch': getOsArch(),
- // 'os.platform': os.platform(),
- // 'os.release': os.release()
- // }
- // }
- // });
- }
-} catch (err) {
- console.log('Could not initialize Sentry, no worries.');
-}
-
-const customConfig: Config = {
- dictionaries: [adjectives, colors, animals],
- style: 'capital',
- separator: ' ',
- length: 3
-};
-
-export const version = currentVersion;
-export const asyncExecShell = util.promisify(child.exec);
-export const asyncSleep = (delay: number): Promise<unknown> =>
- new Promise((resolve) => setTimeout(resolve, delay));
-export const sentry = Sentry;
-
-export const uniqueName = (): string => uniqueNamesGenerator(customConfig);
-
-export const saveBuildLog = async ({
- line,
- buildId,
- applicationId
-}: {
- line: string;
- buildId: string;
- applicationId: string;
-}): Promise<Job> => {
- if (line && typeof line === 'string' && line.includes('ghs_')) {
- const regex = /ghs_.*@/g;
- line = line.replace(regex, '<SENSITIVE_DATA_DELETED>@');
- }
- const addTimestamp = `${generateTimestamp()} ${line}`;
- return await buildLogQueue.add(buildId, { buildId, line: addTimestamp, applicationId });
-};
-
-export const getTeam = (event: RequestEvent): string | null => {
- const cookies = Cookie.parse(event.request.headers.get('cookie'));
- if (cookies?.teamId) {
- return cookies.teamId;
- } else if (event.locals.session.data?.teamId) {
- return event.locals.session.data.teamId;
- }
- return null;
-};
-
-export const getUserDetails = async (
- event: RequestEvent,
- isAdminRequired = true
-): Promise<{
- teamId: string;
- userId: string;
- permission: string;
- status: number;
- body: { message: string };
-}> => {
- const teamId = getTeam(event);
- const userId = event?.locals?.session?.data?.userId || null;
- let permission = 'read';
- if (teamId && userId) {
- try {
- const data = await db.prisma.permission.findFirst({
- where: { teamId, userId },
- select: { permission: true },
- rejectOnNotFound: true
- });
- if (data.permission) permission = data.permission;
- } catch (error) {
- console.log(error);
- }
- }
-
- const payload = {
- teamId,
- userId,
- permission,
- status: 200,
- body: {
- message: 'OK'
- }
- };
-
- if (isAdminRequired && permission !== 'admin' && permission !== 'owner') {
- payload.status = 401;
- payload.body.message =
- 'You do not have permission to do this. \nAsk an admin to modify your permissions.';
- }
-
- return payload;
-};
-
-export function getEngine(engine: string): string {
- return engine === '/var/run/docker.sock' ? 'unix:///var/run/docker.sock' : engine;
-}
-
-export async function removeContainer(id: string, engine: string): Promise<void> {
- const host = getEngine(engine);
- try {
- const { stdout } = await asyncExecShell(
- `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`
- );
- if (JSON.parse(stdout).Running) {
- await asyncExecShell(`DOCKER_HOST=${host} docker stop -t 0 ${id}`);
- await asyncExecShell(`DOCKER_HOST=${host} docker rm ${id}`);
- }
- } catch (error) {
- console.log(error);
- throw error;
- }
-}
-
-export const removeDestinationDocker = async ({
- id,
- engine
-}: {
- id: string;
- engine: string;
-}): Promise<void> => {
- return await removeContainer(id, engine);
-};
-
-export const createDirectories = async ({
- repository,
- buildId
-}: {
- repository: string;
- buildId: string;
-}): Promise<{ workdir: string; repodir: string }> => {
- const repodir = `/tmp/build-sources/${repository}/`;
- const workdir = `/tmp/build-sources/${repository}/${buildId}`;
-
- await asyncExecShell(`mkdir -p ${workdir}`);
-
- return {
- workdir,
- repodir
- };
-};
-
-export function generateTimestamp(): string {
- return `${dayjs().format('HH:mm:ss.SSS')} `;
-}
-
-export function getDomain(domain: string): string {
- return domain?.replace('https://', '').replace('http://', '');
-}
-
-export function getOsArch() {
- return os.arch();
-}
-
-export async function isDNSValid(event: any, domain: string): Promise<any> {
- let resolves = [];
- try {
- if (isIP(event.url.hostname)) {
- resolves = [event.url.hostname];
- } else {
- resolves = await dns.resolve4(event.url.hostname);
- }
- } catch (error) {
- throw {
- message: t.get('application.dns_not_set_error', { domain })
- };
- }
-
- try {
- let ipDomainFound = false;
- dns.setServers(['1.1.1.1', '8.8.8.8']);
- const dnsResolve = await dns.resolve4(domain);
- if (dnsResolve.length > 0) {
- for (const ip of dnsResolve) {
- if (resolves.includes(ip)) {
- ipDomainFound = true;
- }
- }
- }
- if (!ipDomainFound) throw false;
- } catch (error) {
- throw {
- message: t.get('application.domain_not_valid')
- };
- }
-}
-
-export async function checkDomainsIsValidInDNS({ event, fqdn, dualCerts }): Promise<any> {
- const domain = getDomain(fqdn);
- const domainDualCert = domain.includes('www.') ? domain.replace('www.', '') : `www.${domain}`;
- dns.setServers(['1.1.1.1', '8.8.8.8']);
- let resolves = [];
- try {
- if (isIP(event.url.hostname)) {
- resolves = [event.url.hostname];
- } else {
- resolves = await dns.resolve4(event.url.hostname);
- }
- } catch (error) {
- throw {
- message: t.get('application.dns_not_set_error', { domain })
- };
- }
-
- if (dualCerts) {
- try {
- const ipDomain = await dns.resolve4(domain);
- const ipDomainDualCert = await dns.resolve4(domainDualCert);
-
- let ipDomainFound = false;
- let ipDomainDualCertFound = false;
-
- for (const ip of ipDomain) {
- if (resolves.includes(ip)) {
- ipDomainFound = true;
- }
- }
- for (const ip of ipDomainDualCert) {
- if (resolves.includes(ip)) {
- ipDomainDualCertFound = true;
- }
- }
- if (ipDomainFound && ipDomainDualCertFound) return { status: 200 };
- throw false;
- } catch (error) {
- throw {
- message: t.get('application.dns_not_set_error', { domain })
- };
- }
- } else {
- try {
- const ipDomain = await dns.resolve4(domain);
- let ipDomainFound = false;
- for (const ip of ipDomain) {
- if (resolves.includes(ip)) {
- ipDomainFound = true;
- }
- }
- if (ipDomainFound) return { status: 200 };
- throw false;
- } catch (error) {
- throw {
- message: t.get('application.dns_not_set_error', { domain })
- };
- }
- }
-}
diff --git a/src/lib/components/DatabaseLinks.svelte b/src/lib/components/DatabaseLinks.svelte
deleted file mode 100644
index 5927c405cf..0000000000
--- a/src/lib/components/DatabaseLinks.svelte
+++ /dev/null
@@ -1,28 +0,0 @@
-<script>
- export let database;
- import Clickhouse from './svg/databases/Clickhouse.svelte';
- import CouchDb from './svg/databases/CouchDB.svelte';
- import MongoDb from './svg/databases/MongoDB.svelte';
- import MariaDb from './svg/databases/MariaDB.svelte';
- import MySql from './svg/databases/MySQL.svelte';
- import PostgreSql from './svg/databases/PostgreSQL.svelte';
- import Redis from './svg/databases/Redis.svelte';
-</script>
-
-<span class="relative">
- {#if database.type === 'clickhouse'}
- <Clickhouse />
- {:else if database.type === 'couchdb'}
- <CouchDb />
- {:else if database.type === 'mongodb'}
- <MongoDb />
- {:else if database.type === 'mysql'}
- <MySql />
- {:else if database.type === 'mariadb'}
- <MariaDb />
- {:else if database.type === 'postgresql'}
- <PostgreSql />
- {:else if database.type === 'redis'}
- <Redis />
- {/if}
-</span>
diff --git a/src/lib/components/common.ts b/src/lib/components/common.ts
deleted file mode 100644
index 68eb96a8d8..0000000000
--- a/src/lib/components/common.ts
+++ /dev/null
@@ -1,243 +0,0 @@
-export const asyncSleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay));
-export const dateOptions: DateTimeFormatOptions = {
- year: 'numeric',
- month: 'short',
- day: '2-digit',
- hour: 'numeric',
- minute: 'numeric',
- second: 'numeric',
- hour12: false
-};
-
-export const staticDeployments = [
- 'react',
- 'vuejs',
- 'static',
- 'svelte',
- 'gatsby',
- 'php',
- 'astro',
- 'eleventy'
-];
-export const notNodeDeployments = ['php', 'docker', 'rust', 'python', 'deno', 'laravel'];
-
-export function getDomain(domain) {
- return domain?.replace('https://', '').replace('http://', '');
-}
-export function generateRemoteEngine(destination) {
- return `ssh://${destination.user}@${destination.ipAddress}:${destination.port}`;
-}
-
-export function dashify(str: string, options?: any): string {
- if (typeof str !== 'string') return str;
- return str
- .trim()
- .replace(/\W/g, (m) => (/[Γ€-ΕΎ]/.test(m) ? m : '-'))
- .replace(/^-+|-+$/g, '')
- .replace(/-{2,}/g, (m) => (options && options.condense ? '-' : m))
- .toLowerCase();
-}
-
-export function changeQueryParams(buildId) {
- const queryParams = new URLSearchParams(window.location.search);
- queryParams.set('buildId', buildId);
- return history.pushState(null, null, '?' + queryParams.toString());
-}
-
-export const supportedDatabaseTypesAndVersions = [
- {
- name: 'mongodb',
- fancyName: 'MongoDB',
- baseImage: 'bitnami/mongodb',
- versions: ['5.0', '4.4', '4.2']
- },
- { name: 'mysql', fancyName: 'MySQL', baseImage: 'bitnami/mysql', versions: ['8.0', '5.7'] },
- {
- name: 'mariadb',
- fancyName: 'MariaDB',
- baseImage: 'bitnami/mariadb',
- versions: ['10.7', '10.6', '10.5', '10.4', '10.3', '10.2']
- },
- {
- name: 'postgresql',
- fancyName: 'PostgreSQL',
- baseImage: 'bitnami/postgresql',
- versions: ['14.4.0', '13.6.0', '12.10.0', '11.15.0', '10.20.0']
- },
- {
- name: 'redis',
- fancyName: 'Redis',
- baseImage: 'bitnami/redis',
- versions: ['6.2', '6.0', '5.0']
- },
- { name: 'couchdb', fancyName: 'CouchDB', baseImage: 'bitnami/couchdb', versions: ['3.2.1'] }
-];
-export const supportedServiceTypesAndVersions = [
- {
- name: 'plausibleanalytics',
- fancyName: 'Plausible Analytics',
- baseImage: 'plausible/analytics',
- images: ['bitnami/postgresql:13.2.0', 'yandex/clickhouse-server:21.3.2.5'],
- versions: ['latest', 'stable'],
- recommendedVersion: 'stable',
- ports: {
- main: 8000
- }
- },
- {
- name: 'nocodb',
- fancyName: 'NocoDB',
- baseImage: 'nocodb/nocodb',
- versions: ['latest'],
- recommendedVersion: 'latest',
- ports: {
- main: 8080
- }
- },
- {
- name: 'minio',
- fancyName: 'MinIO',
- baseImage: 'minio/minio',
- versions: ['latest'],
- recommendedVersion: 'latest',
- ports: {
- main: 9001
- }
- },
- {
- name: 'vscodeserver',
- fancyName: 'VSCode Server',
- baseImage: 'codercom/code-server',
- versions: ['latest'],
- recommendedVersion: 'latest',
- ports: {
- main: 8080
- }
- },
- {
- name: 'wordpress',
- fancyName: 'Wordpress',
- baseImage: 'wordpress',
- images: ['bitnami/mysql:5.7'],
- versions: ['latest', 'php8.1', 'php8.0', 'php7.4', 'php7.3'],
- recommendedVersion: 'latest',
- ports: {
- main: 80
- }
- },
- {
- name: 'vaultwarden',
- fancyName: 'Vaultwarden',
- baseImage: 'vaultwarden/server',
- versions: ['latest'],
- recommendedVersion: 'latest',
- ports: {
- main: 80
- }
- },
- {
- name: 'languagetool',
- fancyName: 'LanguageTool',
- baseImage: 'silviof/docker-languagetool',
- versions: ['latest'],
- recommendedVersion: 'latest',
- ports: {
- main: 8010
- }
- },
- {
- name: 'n8n',
- fancyName: 'n8n',
- baseImage: 'n8nio/n8n',
- versions: ['latest'],
- recommendedVersion: 'latest',
- ports: {
- main: 5678
- }
- },
- {
- name: 'uptimekuma',
- fancyName: 'Uptime Kuma',
- baseImage: 'louislam/uptime-kuma',
- versions: ['latest'],
- recommendedVersion: 'latest',
- ports: {
- main: 3001
- }
- },
- {
- name: 'ghost',
- fancyName: 'Ghost',
- baseImage: 'bitnami/ghost',
- images: ['bitnami/mariadb'],
- versions: ['latest'],
- recommendedVersion: 'latest',
- ports: {
- main: 2368
- }
- },
- {
- name: 'meilisearch',
- fancyName: 'Meilisearch',
- baseImage: 'getmeili/meilisearch',
- images: [],
- versions: ['latest'],
- recommendedVersion: 'latest',
- ports: {
- main: 7700
- }
- },
- {
- name: 'umami',
- fancyName: 'Umami',
- baseImage: 'ghcr.io/mikecao/umami',
- images: ['postgres:12-alpine'],
- versions: ['postgresql-latest'],
- recommendedVersion: 'postgresql-latest',
- ports: {
- main: 3000
- }
- },
- {
- name: 'hasura',
- fancyName: 'Hasura',
- baseImage: 'hasura/graphql-engine',
- images: ['postgres:12-alpine'],
- versions: ['latest', 'v2.5.1'],
- recommendedVersion: 'v2.5.1',
- ports: {
- main: 8080
- }
- },
- {
- name: 'fider',
- fancyName: 'Fider',
- baseImage: 'getfider/fider',
- images: ['postgres:12-alpine'],
- versions: ['stable'],
- recommendedVersion: 'stable',
- ports: {
- main: 3000
- }
- // },
- // {
- // name: 'appwrite',
- // fancyName: 'AppWrite',
- // baseImage: 'appwrite/appwrite',
- // images: ['appwrite/influxdb', 'appwrite/telegraf', 'mariadb:10.7', 'redis:6.0-alpine3.12'],
- // versions: ['latest', '0.13.0'],
- // recommendedVersion: '0.13.0',
- // ports: {
- // main: 3000
- // }
- // }
- }
-];
-
-export const getServiceMainPort = (service: string) => {
- const serviceType = supportedServiceTypesAndVersions.find((s) => s.name === service);
- if (serviceType) {
- return serviceType.ports.main;
- }
- return null;
-};
diff --git a/src/lib/crypto.ts b/src/lib/crypto.ts
deleted file mode 100644
index dfb38991f7..0000000000
--- a/src/lib/crypto.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import crypto from 'crypto';
-const algorithm = 'aes-256-ctr';
-
-export const base64Encode = (text: string): string => {
- return Buffer.from(text).toString('base64');
-};
-export const base64Decode = (text: string): string => {
- return Buffer.from(text, 'base64').toString('ascii');
-};
-export const encrypt = (text: string): string => {
- if (text) {
- const iv = crypto.randomBytes(16);
- const cipher = crypto.createCipheriv(algorithm, process.env['COOLIFY_SECRET_KEY'], iv);
- const encrypted = Buffer.concat([cipher.update(text), cipher.final()]);
- return JSON.stringify({
- iv: iv.toString('hex'),
- content: encrypted.toString('hex')
- });
- }
-};
-
-export const decrypt = (hashString: string): string => {
- if (hashString) {
- const hash: Hash = JSON.parse(hashString);
- const decipher = crypto.createDecipheriv(
- algorithm,
- process.env['COOLIFY_SECRET_KEY'],
- Buffer.from(hash.iv, 'hex')
- );
- const decrpyted = Buffer.concat([
- decipher.update(Buffer.from(hash.content, 'hex')),
- decipher.final()
- ]);
- return decrpyted.toString();
- }
-};
diff --git a/src/lib/database/applications.ts b/src/lib/database/applications.ts
deleted file mode 100644
index 87d6f90d8e..0000000000
--- a/src/lib/database/applications.ts
+++ /dev/null
@@ -1,368 +0,0 @@
-import { decrypt, encrypt } from '$lib/crypto';
-import { asyncExecShell, getEngine } from '$lib/common';
-
-import { removeDestinationDocker } from '$lib/common';
-import { prisma } from './common';
-
-import type {
- DestinationDocker,
- GitSource,
- Secret,
- ApplicationSettings,
- Application,
- ApplicationPersistentStorage
-} from '@prisma/client';
-import { setDefaultBaseImage } from '$lib/buildPacks/common';
-
-export async function listApplications(teamId: string): Promise<Application[]> {
- if (teamId === '0') {
- return await prisma.application.findMany({ include: { teams: true } });
- }
- return await prisma.application.findMany({
- where: { teams: { some: { id: teamId } } },
- include: { teams: true }
- });
-}
-
-export async function newApplication({
- name,
- teamId
-}: {
- name: string;
- teamId: string;
-}): Promise<Application> {
- return await prisma.application.create({
- data: {
- name,
- teams: { connect: { id: teamId } },
- settings: { create: { debug: false, previews: false } }
- }
- });
-}
-
-export async function removeApplication({
- id,
- teamId
-}: {
- id: string;
- teamId: string;
-}): Promise<void> {
- const { destinationDockerId, destinationDocker } = await prisma.application.findUnique({
- where: { id },
- include: { destinationDocker: true }
- });
- if (destinationDockerId) {
- const host = getEngine(destinationDocker.engine);
- const { stdout: containers } = await asyncExecShell(
- `DOCKER_HOST=${host} docker ps -a --filter network=${destinationDocker.network} --filter name=${id} --format '{{json .}}'`
- );
- if (containers) {
- const containersArray = containers.trim().split('\n');
- for (const container of containersArray) {
- const containerObj = JSON.parse(container);
- const id = containerObj.ID;
- await removeDestinationDocker({ id, engine: destinationDocker.engine });
- }
- }
- }
-
- await prisma.applicationSettings.deleteMany({ where: { application: { id } } });
- await prisma.buildLog.deleteMany({ where: { applicationId: id } });
- await prisma.build.deleteMany({ where: { applicationId: id } });
- await prisma.secret.deleteMany({ where: { applicationId: id } });
- await prisma.applicationPersistentStorage.deleteMany({ where: { applicationId: id } });
- if (teamId === '0') {
- await prisma.application.deleteMany({ where: { id } });
- } else {
- await prisma.application.deleteMany({ where: { id, teams: { some: { id: teamId } } } });
- }
-}
-
-export async function getApplicationWebhook({
- projectId,
- branch
-}: {
- projectId: number;
- branch: string;
-}): Promise<
- Application & {
- destinationDocker: DestinationDocker;
- settings: ApplicationSettings;
- gitSource: GitSource;
- secrets: Secret[];
- persistentStorage: ApplicationPersistentStorage[];
- }
-> {
- try {
- const application = await prisma.application.findFirst({
- where: { projectId, branch, settings: { autodeploy: true } },
- include: {
- destinationDocker: true,
- settings: true,
- gitSource: { include: { githubApp: true, gitlabApp: true } },
- secrets: true,
- persistentStorage: true
- }
- });
- if (!application) {
- return null;
- }
- if (application?.gitSource?.githubApp?.clientSecret) {
- application.gitSource.githubApp.clientSecret = decrypt(
- application.gitSource.githubApp.clientSecret
- );
- }
- if (application?.gitSource?.githubApp?.webhookSecret) {
- application.gitSource.githubApp.webhookSecret = decrypt(
- application.gitSource.githubApp.webhookSecret
- );
- }
- if (application?.gitSource?.githubApp?.privateKey) {
- application.gitSource.githubApp.privateKey = decrypt(
- application.gitSource.githubApp.privateKey
- );
- }
- if (application?.gitSource?.gitlabApp?.appSecret) {
- application.gitSource.gitlabApp.appSecret = decrypt(
- application.gitSource.gitlabApp.appSecret
- );
- }
- if (application?.gitSource?.gitlabApp?.webhookToken) {
- application.gitSource.gitlabApp.webhookToken = decrypt(
- application.gitSource.gitlabApp.webhookToken
- );
- }
- if (application?.secrets.length > 0) {
- application.secrets = application.secrets.map((s) => {
- s.value = decrypt(s.value);
- return s;
- });
- }
- const { baseImage, baseBuildImage, baseBuildImages, baseImages } = setDefaultBaseImage(
- application.buildPack
- );
-
- // Set default build images
- if (!application.baseImage) {
- application.baseImage = baseImage;
- }
- if (!application.baseBuildImage) {
- application.baseBuildImage = baseBuildImage;
- }
- return { ...application, baseBuildImages, baseImages };
- } catch (e) {
- throw { status: 404, body: { message: e.message } };
- }
-}
-
-export async function getApplication({ id, teamId }: { id: string; teamId: string }): Promise<
- Application & {
- destinationDocker: DestinationDocker;
- settings: ApplicationSettings;
- gitSource: GitSource;
- secrets: Secret[];
- persistentStorage: ApplicationPersistentStorage[];
- }
-> {
- let body;
- if (teamId === '0') {
- body = await prisma.application.findFirst({
- where: { id },
- include: {
- destinationDocker: true,
- settings: true,
- gitSource: { include: { githubApp: true, gitlabApp: true } },
- secrets: true,
- persistentStorage: true
- }
- });
- } else {
- body = await prisma.application.findFirst({
- where: { id, teams: { some: { id: teamId } } },
- include: {
- destinationDocker: true,
- settings: true,
- gitSource: { include: { githubApp: true, gitlabApp: true } },
- secrets: true,
- persistentStorage: true
- }
- });
- }
-
- if (body?.gitSource?.githubApp?.clientSecret) {
- body.gitSource.githubApp.clientSecret = decrypt(body.gitSource.githubApp.clientSecret);
- }
- if (body?.gitSource?.githubApp?.webhookSecret) {
- body.gitSource.githubApp.webhookSecret = decrypt(body.gitSource.githubApp.webhookSecret);
- }
- if (body?.gitSource?.githubApp?.privateKey) {
- body.gitSource.githubApp.privateKey = decrypt(body.gitSource.githubApp.privateKey);
- }
- if (body?.gitSource?.gitlabApp?.appSecret) {
- body.gitSource.gitlabApp.appSecret = decrypt(body.gitSource.gitlabApp.appSecret);
- }
- if (body?.secrets.length > 0) {
- body.secrets = body.secrets.map((s) => {
- s.value = decrypt(s.value);
- return s;
- });
- }
- const { baseImage, baseBuildImage, baseBuildImages, baseImages } = setDefaultBaseImage(
- body.buildPack
- );
-
- // Set default build images
- if (!body.baseImage) {
- body.baseImage = baseImage;
- }
- if (!body.baseBuildImage) {
- body.baseBuildImage = baseBuildImage;
- }
- return { ...body, baseBuildImages, baseImages };
-}
-
-export async function configureGitRepository({
- id,
- repository,
- branch,
- projectId,
- webhookToken,
- autodeploy
-}: {
- id: string;
- repository: string;
- branch: string;
- projectId: number;
- webhookToken: string;
- autodeploy: boolean;
-}): Promise<void> {
- if (webhookToken) {
- const encryptedWebhookToken = encrypt(webhookToken);
- await prisma.application.update({
- where: { id },
- data: {
- repository,
- branch,
- projectId,
- gitSource: { update: { gitlabApp: { update: { webhookToken: encryptedWebhookToken } } } },
- settings: { update: { autodeploy } }
- }
- });
- } else {
- await prisma.application.update({
- where: { id },
- data: { repository, branch, projectId, settings: { update: { autodeploy } } }
- });
- }
- if (!autodeploy) {
- const applications = await prisma.application.findMany({ where: { branch, projectId } });
- for (const application of applications) {
- await prisma.applicationSettings.updateMany({
- where: { applicationId: application.id },
- data: { autodeploy: false }
- });
- }
- }
-}
-
-export async function configureBuildPack({
- id,
- buildPack
-}: Pick<Application, 'id' | 'buildPack'>): Promise<Application> {
- return await prisma.application.update({ where: { id }, data: { buildPack } });
-}
-
-export async function configureApplication({
- id,
- buildPack,
- name,
- fqdn,
- port,
- exposePort,
- installCommand,
- buildCommand,
- startCommand,
- baseDirectory,
- publishDirectory,
- pythonWSGI,
- pythonModule,
- pythonVariable,
- dockerFileLocation,
- denoMainFile,
- denoOptions,
- baseImage,
- baseBuildImage
-}: {
- id: string;
- buildPack: string;
- name: string;
- fqdn: string;
- port: number;
- exposePort: number;
- installCommand: string;
- buildCommand: string;
- startCommand: string;
- baseDirectory: string;
- publishDirectory: string;
- pythonWSGI: string;
- pythonModule: string;
- pythonVariable: string;
- dockerFileLocation: string;
- denoMainFile: string;
- denoOptions: string;
- baseImage: string;
- baseBuildImage: string;
-}): Promise<Application> {
- return await prisma.application.update({
- where: { id },
- data: {
- name,
- buildPack,
- fqdn,
- port,
- exposePort,
- installCommand,
- buildCommand,
- startCommand,
- baseDirectory,
- publishDirectory,
- pythonWSGI,
- pythonModule,
- pythonVariable,
- dockerFileLocation,
- denoMainFile,
- denoOptions,
- baseImage,
- baseBuildImage
- }
- });
-}
-
-export async function checkDoubleBranch(branch: string, projectId: number): Promise<boolean> {
- const applications = await prisma.application.findMany({ where: { branch, projectId } });
- return applications.length > 1;
-}
-
-export async function setApplicationSettings({
- id,
- debug,
- previews,
- dualCerts,
- autodeploy
-}: {
- id: string;
- debug: boolean;
- previews: boolean;
- dualCerts: boolean;
- autodeploy: boolean;
-}): Promise<Application & { destinationDocker: DestinationDocker }> {
- return await prisma.application.update({
- where: { id },
- data: { settings: { update: { debug, previews, dualCerts, autodeploy } } },
- include: { destinationDocker: true }
- });
-}
-
-export async function getPersistentStorage(id: string): Promise<ApplicationPersistentStorage[]> {
- return await prisma.applicationPersistentStorage.findMany({ where: { applicationId: id } });
-}
diff --git a/src/lib/database/checks.ts b/src/lib/database/checks.ts
deleted file mode 100644
index 2c1c25cd87..0000000000
--- a/src/lib/database/checks.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-import { getDomain } from '$lib/common';
-import { prisma } from './common';
-import type { Application, ServiceSecret, DestinationDocker, Secret } from '@prisma/client';
-
-export async function isBranchAlreadyUsed({
- repository,
- branch,
- id
-}: {
- id: string;
- repository: string;
- branch: string;
-}): Promise<Application> {
- const application = await prisma.application.findUnique({
- where: { id },
- include: { gitSource: true }
- });
- return await prisma.application.findFirst({
- where: { branch, repository, gitSource: { type: application.gitSource.type }, id: { not: id } }
- });
-}
-
-export async function isDockerNetworkExists({
- network
-}: {
- network: string;
-}): Promise<DestinationDocker> {
- return await prisma.destinationDocker.findFirst({ where: { network } });
-}
-
-export async function isServiceSecretExists({
- id,
- name
-}: {
- id: string;
- name: string;
-}): Promise<ServiceSecret> {
- return await prisma.serviceSecret.findFirst({ where: { name, serviceId: id } });
-}
-export async function isSecretExists({
- id,
- name,
- isPRMRSecret
-}: {
- id: string;
- name: string;
- isPRMRSecret: boolean;
-}): Promise<Secret> {
- return await prisma.secret.findFirst({ where: { name, applicationId: id, isPRMRSecret } });
-}
-
-export async function isDomainConfigured({
- id,
- fqdn,
- checkOwn = false
-}: {
- id: string;
- fqdn: string;
- checkOwn?: boolean;
-}): Promise<boolean> {
- const domain = getDomain(fqdn);
- const nakedDomain = domain.replace('www.', '');
- const foundApp = await prisma.application.findFirst({
- where: {
- OR: [
- { fqdn: { endsWith: `//${nakedDomain}` } },
- { fqdn: { endsWith: `//www.${nakedDomain}` } }
- ],
- id: { not: id }
- },
- select: { fqdn: true }
- });
- const foundService = await prisma.service.findFirst({
- where: {
- OR: [
- { fqdn: { endsWith: `//${nakedDomain}` } },
- { fqdn: { endsWith: `//www.${nakedDomain}` } },
- { minio: { apiFqdn: { endsWith: `//${nakedDomain}` } } },
- { minio: { apiFqdn: { endsWith: `//www.${nakedDomain}` } } }
- ],
- id: { not: checkOwn ? undefined : id }
- },
- select: { fqdn: true }
- });
-
- const coolifyFqdn = await prisma.setting.findFirst({
- where: {
- OR: [
- { fqdn: { endsWith: `//${nakedDomain}` } },
- { fqdn: { endsWith: `//www.${nakedDomain}` } }
- ],
- id: { not: id }
- },
- select: { fqdn: true }
- });
- return !!(foundApp || foundService || coolifyFqdn);
-}
diff --git a/src/lib/database/common.ts b/src/lib/database/common.ts
deleted file mode 100644
index c26796ea48..0000000000
--- a/src/lib/database/common.ts
+++ /dev/null
@@ -1,316 +0,0 @@
-import { dev } from '$app/env';
-import { sentry } from '$lib/common';
-import {
- supportedDatabaseTypesAndVersions,
- supportedServiceTypesAndVersions
-} from '$lib/components/common';
-import * as Prisma from '@prisma/client';
-import { default as ProdPrisma } from '@prisma/client';
-import type { Database, DatabaseSettings } from '@prisma/client';
-import generator from 'generate-password';
-import forge from 'node-forge';
-import getPort, { portNumbers } from 'get-port';
-
-export function generatePassword(length = 24, symbols = false): string {
- return generator.generate({
- length,
- numbers: true,
- strict: true,
- symbols
- });
-}
-
-let { PrismaClient } = Prisma;
-let P = Prisma.Prisma;
-if (!dev) {
- PrismaClient = ProdPrisma.PrismaClient;
- P = ProdPrisma.Prisma;
-}
-
-export const prisma = new PrismaClient({
- errorFormat: 'minimal',
- rejectOnNotFound: false
-});
-
-export function ErrorHandler(e: {
- stdout?;
- message?: string;
- status?: number;
- name?: string;
- error?: string;
-}): { status: number; body: { message: string; error: string } } {
- if (e && e instanceof Error) {
- e = new Error(e.toString());
- }
- let truncatedError = e;
- if (e.stdout) {
- truncatedError = e.stdout;
- }
- if (e.message?.includes('docker run')) {
- const truncatedArray: string[] = truncatedError.message.split('-').filter((line) => {
- if (!line.startsWith('e ')) {
- return line;
- }
- });
- truncatedError.message = truncatedArray.join('-');
- }
- if (e.message?.includes('git clone')) {
- truncatedError.message = 'git clone failed';
- }
- if (!e.message?.includes('Coolify Proxy is not running')) {
- // sentry.captureException(truncatedError);
- }
- const payload = {
- status: truncatedError.status || 500,
- body: {
- message: 'Ooops, something is not okay, are you okay?',
- error: truncatedError.error || truncatedError.message
- }
- };
- if (truncatedError?.name === 'NotFoundError') {
- payload.status = 404;
- }
- if (truncatedError instanceof P.PrismaClientKnownRequestError) {
- if (truncatedError?.code === 'P2002') {
- payload.body.message = 'Already exists. Choose another name.';
- }
- }
- return payload;
-}
-
-export async function generateSshKeyPair(): Promise<{ publicKey: string; privateKey: string }> {
- return await new Promise((resolve, reject) => {
- forge.pki.rsa.generateKeyPair({ bits: 4096, workers: -1 }, function (err, keys) {
- if (keys) {
- resolve({
- publicKey: forge.ssh.publicKeyToOpenSSH(keys.publicKey),
- privateKey: forge.ssh.privateKeyToOpenSSH(keys.privateKey)
- });
- } else {
- reject(keys);
- }
- });
- });
-}
-
-export function getVersions(type: string): string[] {
- const found = supportedDatabaseTypesAndVersions.find((t) => t.name === type);
- if (found) {
- return found.versions;
- }
- return [];
-}
-
-export function getDatabaseImage(type: string): string {
- const found = supportedDatabaseTypesAndVersions.find((t) => t.name === type);
- if (found) {
- return found.baseImage;
- }
- return '';
-}
-
-export function getServiceImage(type: string): string {
- const found = supportedServiceTypesAndVersions.find((t) => t.name === type);
- if (found) {
- return found.baseImage;
- }
- return '';
-}
-
-export function getServiceImages(type: string): string[] {
- const found = supportedServiceTypesAndVersions.find((t) => t.name === type);
- if (found) {
- return found.images;
- }
- return [];
-}
-
-export function generateDatabaseConfiguration(database: Database & { settings: DatabaseSettings }):
- | {
- volume: string;
- image: string;
- ulimits: Record<string, unknown>;
- privatePort: number;
- environmentVariables: {
- MYSQL_DATABASE: string;
- MYSQL_PASSWORD: string;
- MYSQL_ROOT_USER: string;
- MYSQL_USER: string;
- MYSQL_ROOT_PASSWORD: string;
- };
- }
- | {
- volume: string;
- image: string;
- ulimits: Record<string, unknown>;
- privatePort: number;
- environmentVariables: {
- MONGODB_ROOT_USER: string;
- MONGODB_ROOT_PASSWORD: string;
- };
- }
- | {
- volume: string;
- image: string;
- ulimits: Record<string, unknown>;
- privatePort: number;
- environmentVariables: {
- MARIADB_ROOT_USER: string;
- MARIADB_ROOT_PASSWORD: string;
- MARIADB_USER: string;
- MARIADB_PASSWORD: string;
- MARIADB_DATABASE: string;
- };
- }
- | {
- volume: string;
- image: string;
- ulimits: Record<string, unknown>;
- privatePort: number;
- environmentVariables: {
- POSTGRESQL_POSTGRES_PASSWORD: string;
- POSTGRESQL_USERNAME: string;
- POSTGRESQL_PASSWORD: string;
- POSTGRESQL_DATABASE: string;
- };
- }
- | {
- volume: string;
- image: string;
- ulimits: Record<string, unknown>;
- privatePort: number;
- environmentVariables: {
- REDIS_AOF_ENABLED: string;
- REDIS_PASSWORD: string;
- };
- }
- | {
- volume: string;
- image: string;
- ulimits: Record<string, unknown>;
- privatePort: number;
- environmentVariables: {
- COUCHDB_PASSWORD: string;
- COUCHDB_USER: string;
- };
- } {
- const {
- id,
- dbUser,
- dbUserPassword,
- rootUser,
- rootUserPassword,
- defaultDatabase,
- version,
- type,
- settings: { appendOnly }
- } = database;
- const baseImage = getDatabaseImage(type);
- if (type === 'mysql') {
- return {
- privatePort: 3306,
- environmentVariables: {
- MYSQL_USER: dbUser,
- MYSQL_PASSWORD: dbUserPassword,
- MYSQL_ROOT_PASSWORD: rootUserPassword,
- MYSQL_ROOT_USER: rootUser,
- MYSQL_DATABASE: defaultDatabase
- },
- image: `${baseImage}:${version}`,
- volume: `${id}-${type}-data:/bitnami/mysql/data`,
- ulimits: {}
- };
- } else if (type === 'mariadb') {
- return {
- privatePort: 3306,
- environmentVariables: {
- MARIADB_ROOT_USER: rootUser,
- MARIADB_ROOT_PASSWORD: rootUserPassword,
- MARIADB_USER: dbUser,
- MARIADB_PASSWORD: dbUserPassword,
- MARIADB_DATABASE: defaultDatabase
- },
- image: `${baseImage}:${version}`,
- volume: `${id}-${type}-data:/bitnami/mariadb`,
- ulimits: {}
- };
- } else if (type === 'mongodb') {
- return {
- privatePort: 27017,
- environmentVariables: {
- MONGODB_ROOT_USER: rootUser,
- MONGODB_ROOT_PASSWORD: rootUserPassword
- },
- image: `${baseImage}:${version}`,
- volume: `${id}-${type}-data:/bitnami/mongodb`,
- ulimits: {}
- };
- } else if (type === 'postgresql') {
- return {
- privatePort: 5432,
- environmentVariables: {
- POSTGRESQL_POSTGRES_PASSWORD: rootUserPassword,
- POSTGRESQL_PASSWORD: dbUserPassword,
- POSTGRESQL_USERNAME: dbUser,
- POSTGRESQL_DATABASE: defaultDatabase
- },
- image: `${baseImage}:${version}`,
- volume: `${id}-${type}-data:/bitnami/postgresql`,
- ulimits: {}
- };
- } else if (type === 'redis') {
- return {
- privatePort: 6379,
- environmentVariables: {
- REDIS_PASSWORD: dbUserPassword,
- REDIS_AOF_ENABLED: appendOnly ? 'yes' : 'no'
- },
- image: `${baseImage}:${version}`,
- volume: `${id}-${type}-data:/bitnami/redis/data`,
- ulimits: {}
- };
- } else if (type === 'couchdb') {
- return {
- privatePort: 5984,
- environmentVariables: {
- COUCHDB_PASSWORD: dbUserPassword,
- COUCHDB_USER: dbUser
- },
- image: `${baseImage}:${version}`,
- volume: `${id}-${type}-data:/bitnami/couchdb`,
- ulimits: {}
- };
- }
-}
-
-export async function getFreePort() {
- const data = await prisma.setting.findFirst();
- const { minPort, maxPort } = data;
-
- const dbUsed = await (
- await prisma.database.findMany({
- where: { publicPort: { not: null } },
- select: { publicPort: true }
- })
- ).map((a) => a.publicPort);
- const wpFtpUsed = await (
- await prisma.wordpress.findMany({
- where: { ftpPublicPort: { not: null } },
- select: { ftpPublicPort: true }
- })
- ).map((a) => a.ftpPublicPort);
- const wpUsed = await (
- await prisma.wordpress.findMany({
- where: { mysqlPublicPort: { not: null } },
- select: { mysqlPublicPort: true }
- })
- ).map((a) => a.mysqlPublicPort);
- const minioUsed = await (
- await prisma.minio.findMany({
- where: { publicPort: { not: null } },
- select: { publicPort: true }
- })
- ).map((a) => a.publicPort);
- const usedPorts = [...dbUsed, ...wpFtpUsed, ...wpUsed, ...minioUsed];
- return await getPort({ port: portNumbers(minPort, maxPort), exclude: usedPorts });
-}
diff --git a/src/lib/database/databases.ts b/src/lib/database/databases.ts
deleted file mode 100644
index edc15c7299..0000000000
--- a/src/lib/database/databases.ts
+++ /dev/null
@@ -1,211 +0,0 @@
-import { decrypt, encrypt } from '$lib/crypto';
-import cuid from 'cuid';
-import { generatePassword } from '.';
-import { prisma } from './common';
-import { asyncExecShell, getEngine, removeContainer } from '$lib/common';
-import type { Database, DatabaseSettings, DestinationDocker } from '@prisma/client';
-
-export async function listDatabases(teamId: string): Promise<Database[]> {
- if (teamId === '0') {
- return await prisma.database.findMany({ include: { teams: true } });
- } else {
- return await prisma.database.findMany({
- where: { teams: { some: { id: teamId } } },
- include: { teams: true }
- });
- }
-}
-
-export async function newDatabase({
- name,
- teamId
-}: {
- name: string;
- teamId: string;
-}): Promise<Database> {
- const dbUser = cuid();
- const dbUserPassword = encrypt(generatePassword());
- const rootUser = cuid();
- const rootUserPassword = encrypt(generatePassword());
- const defaultDatabase = cuid();
-
- return await prisma.database.create({
- data: {
- name,
- defaultDatabase,
- dbUser,
- dbUserPassword,
- rootUser,
- rootUserPassword,
- teams: { connect: { id: teamId } },
- settings: { create: { isPublic: false } }
- }
- });
-}
-
-export async function getDatabase({
- id,
- teamId
-}: {
- id: string;
- teamId: string;
-}): Promise<Database & { destinationDocker: DestinationDocker; settings: DatabaseSettings }> {
- let body;
- if (teamId === '0') {
- body = await prisma.database.findFirst({
- where: { id },
- include: { destinationDocker: true, settings: true }
- });
- } else {
- body = await prisma.database.findFirst({
- where: { id, teams: { some: { id: teamId } } },
- include: { destinationDocker: true, settings: true }
- });
- }
- if (body.dbUserPassword) body.dbUserPassword = decrypt(body.dbUserPassword);
- if (body.rootUserPassword) body.rootUserPassword = decrypt(body.rootUserPassword);
-
- return body;
-}
-
-export async function removeDatabase({ id }: { id: string }): Promise<void> {
- await prisma.databaseSettings.deleteMany({ where: { databaseId: id } });
- await prisma.database.delete({ where: { id } });
- return;
-}
-
-export async function configureDatabaseType({
- id,
- type
-}: {
- id: string;
- type: string;
-}): Promise<Database> {
- return await prisma.database.update({
- where: { id },
- data: { type }
- });
-}
-export async function setDatabase({
- id,
- version,
- isPublic,
- appendOnly
-}: {
- id: string;
- version?: string;
- isPublic?: boolean;
- appendOnly?: boolean;
-}): Promise<Database> {
- return await prisma.database.update({
- where: { id },
- data: {
- version,
- settings: { upsert: { update: { isPublic, appendOnly }, create: { isPublic, appendOnly } } }
- }
- });
-}
-export async function updateDatabase({
- id,
- name,
- defaultDatabase,
- dbUser,
- dbUserPassword,
- rootUser,
- rootUserPassword,
- version
-}: {
- id: string;
- name: string;
- defaultDatabase: string;
- dbUser: string;
- dbUserPassword: string;
- rootUser: string;
- rootUserPassword: string;
- version: string;
-}): Promise<Database> {
- const encryptedDbUserPassword = dbUserPassword && encrypt(dbUserPassword);
- const encryptedRootUserPassword = rootUserPassword && encrypt(rootUserPassword);
- return await prisma.database.update({
- where: { id },
- data: {
- name,
- defaultDatabase,
- dbUser,
- dbUserPassword: encryptedDbUserPassword,
- rootUser,
- rootUserPassword: encryptedRootUserPassword,
- version
- }
- });
-}
-
-export async function stopDatabase(
- database: Database & { destinationDocker: DestinationDocker }
-): Promise<boolean> {
- let everStarted = false;
- const {
- id,
- destinationDockerId,
- destinationDocker: { engine }
- } = database;
- if (destinationDockerId) {
- try {
- const host = getEngine(engine);
- const { stdout } = await asyncExecShell(
- `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`
- );
- if (stdout) {
- everStarted = true;
- await removeContainer(id, engine);
- }
- } catch (error) {
- //
- }
- }
- return everStarted;
-}
-
-export async function updatePasswordInDb(database, user, newPassword, isRoot) {
- const {
- id,
- type,
- rootUser,
- rootUserPassword,
- dbUser,
- dbUserPassword,
- defaultDatabase,
- destinationDockerId,
- destinationDocker: { engine }
- } = database;
- if (destinationDockerId) {
- const host = getEngine(engine);
- if (type === 'mysql') {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker exec ${id} mysql -u ${rootUser} -p${rootUserPassword} -e \"ALTER USER '${user}'@'%' IDENTIFIED WITH caching_sha2_password BY '${newPassword}';\"`
- );
- } else if (type === 'mariadb') {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker exec ${id} mysql -u ${rootUser} -p${rootUserPassword} -e \"SET PASSWORD FOR '${user}'@'%' = PASSWORD('${newPassword}');\"`
- );
- } else if (type === 'postgresql') {
- if (isRoot) {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker exec ${id} psql postgresql://postgres:${rootUserPassword}@${id}:5432/${defaultDatabase} -c "ALTER role postgres WITH PASSWORD '${newPassword}'"`
- );
- } else {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker exec ${id} psql postgresql://${dbUser}:${dbUserPassword}@${id}:5432/${defaultDatabase} -c "ALTER role ${user} WITH PASSWORD '${newPassword}'"`
- );
- }
- } else if (type === 'mongodb') {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker exec ${id} mongo 'mongodb://${rootUser}:${rootUserPassword}@${id}:27017/admin?readPreference=primary&ssl=false' --eval "db.changeUserPassword('${user}','${newPassword}')"`
- );
- } else if (type === 'redis') {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker exec ${id} redis-cli -u redis://${dbUserPassword}@${id}:6379 --raw CONFIG SET requirepass ${newPassword}`
- );
- }
- }
-}
diff --git a/src/lib/database/destinations.ts b/src/lib/database/destinations.ts
deleted file mode 100644
index f378874b01..0000000000
--- a/src/lib/database/destinations.ts
+++ /dev/null
@@ -1,194 +0,0 @@
-import { asyncExecShell, getEngine } from '$lib/common';
-import { dockerInstance } from '$lib/docker';
-import { startCoolifyProxy, startTraefikProxy } from '$lib/haproxy';
-import { getDatabaseImage } from '.';
-import { prisma } from './common';
-import type { DestinationDocker, Service, Application, Prisma } from '@prisma/client';
-import type { CreateDockerDestination } from '$lib/types/destinations';
-
-type DestinationConfigurationObject = {
- id: string;
- destinationId: string;
-};
-
-type FindDestinationFromTeam = {
- id: string;
- teamId: string;
-};
-
-export async function listDestinations(teamId: string): Promise<DestinationDocker[]> {
- if (teamId === '0') {
- return await prisma.destinationDocker.findMany({ include: { teams: true } });
- }
- return await prisma.destinationDocker.findMany({
- where: { teams: { some: { id: teamId } } },
- include: { teams: true }
- });
-}
-
-export async function configureDestinationForService({
- id,
- destinationId
-}: DestinationConfigurationObject): Promise<Service> {
- return await prisma.service.update({
- where: { id },
- data: { destinationDocker: { connect: { id: destinationId } } }
- });
-}
-export async function configureDestinationForApplication({
- id,
- destinationId
-}: DestinationConfigurationObject): Promise<Application> {
- return await prisma.application.update({
- where: { id },
- data: { destinationDocker: { connect: { id: destinationId } } }
- });
-}
-export async function configureDestinationForDatabase({
- id,
- destinationId
-}: DestinationConfigurationObject): Promise<void> {
- await prisma.database.update({
- where: { id },
- data: { destinationDocker: { connect: { id: destinationId } } }
- });
-
- const {
- destinationDockerId,
- destinationDocker: { engine },
- version,
- type
- } = await prisma.database.findUnique({ where: { id }, include: { destinationDocker: true } });
-
- if (destinationDockerId) {
- const host = getEngine(engine);
- if (type && version) {
- const baseImage = getDatabaseImage(type);
- asyncExecShell(`DOCKER_HOST=${host} docker pull ${baseImage}:${version}`);
- }
- }
-}
-export async function updateDestination({
- id,
- name,
- engine,
- network
-}: Pick<DestinationDocker, 'id' | 'name' | 'engine' | 'network'>): Promise<DestinationDocker> {
- return await prisma.destinationDocker.update({ where: { id }, data: { name, engine, network } });
-}
-
-export async function newRemoteDestination({
- name,
- teamId,
- engine,
- network,
- isCoolifyProxyUsed,
- remoteEngine
-}: CreateDockerDestination): Promise<string> {
- const destination = await prisma.destinationDocker.create({
- data: {
- name,
- teams: { connect: { id: teamId } },
- engine,
- network,
- isCoolifyProxyUsed,
- remoteEngine
- }
- });
- return destination.id;
-}
-export async function newLocalDestination({
- name,
- teamId,
- engine,
- network,
- isCoolifyProxyUsed
-}: CreateDockerDestination): Promise<string> {
- const host = getEngine(engine);
- const docker = dockerInstance({ destinationDocker: { engine, network } });
- const found = await docker.engine.listNetworks({ filters: { name: [`^${network}$`] } });
- if (found.length === 0) {
- await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable ${network}`);
- }
- await prisma.destinationDocker.create({
- data: { name, teams: { connect: { id: teamId } }, engine, network, isCoolifyProxyUsed }
- });
- const destinations = await prisma.destinationDocker.findMany({ where: { engine } });
- const destination = destinations.find((destination) => destination.network === network);
-
- if (destinations.length > 0) {
- const proxyConfigured = destinations.find(
- (destination) => destination.network !== network && destination.isCoolifyProxyUsed === true
- );
- if (proxyConfigured) {
- isCoolifyProxyUsed = !!proxyConfigured.isCoolifyProxyUsed;
- }
- await prisma.destinationDocker.updateMany({ where: { engine }, data: { isCoolifyProxyUsed } });
- }
- if (isCoolifyProxyUsed) {
- const settings = await prisma.setting.findFirst();
- if (settings?.isTraefikUsed) {
- await startTraefikProxy(engine);
- } else {
- await startCoolifyProxy(engine);
- }
- }
- return destination.id;
-}
-export async function removeDestination({ id }: Pick<DestinationDocker, 'id'>): Promise<void> {
- const destination = await prisma.destinationDocker.delete({ where: { id } });
- if (destination.isCoolifyProxyUsed) {
- const host = getEngine(destination.engine);
- const { network } = destination;
- const settings = await prisma.setting.findFirst();
- const containerName = settings.isTraefikUsed ? 'coolify-proxy' : 'coolify-haproxy';
- const { stdout: found } = await asyncExecShell(
- `DOCKER_HOST=${host} docker ps -a --filter network=${network} --filter name=${containerName} --format '{{.}}'`
- );
- if (found) {
- await asyncExecShell(
- `DOCKER_HOST="${host}" docker network disconnect ${network} ${containerName}`
- );
- await asyncExecShell(`DOCKER_HOST="${host}" docker network rm ${network}`);
- }
- }
-}
-
-export async function getDestination({
- id,
- teamId
-}: FindDestinationFromTeam): Promise<DestinationDocker & { sshPrivateKey?: string }> {
- let destination;
- if (teamId === '0') {
- destination = await prisma.destinationDocker.findFirst({
- where: { id }
- });
- } else {
- destination = await prisma.destinationDocker.findFirst({
- where: { id, teams: { some: { id: teamId } } }
- });
- }
-
- return destination;
-}
-export async function getDestinationByApplicationId({
- id,
- teamId
-}: FindDestinationFromTeam): Promise<DestinationDocker> {
- return await prisma.destinationDocker.findFirst({
- where: { application: { some: { id } }, teams: { some: { id: teamId } } }
- });
-}
-
-export async function setDestinationSettings({
- engine,
- isCoolifyProxyUsed
-}: {
- engine: string;
- isCoolifyProxyUsed: boolean;
-}): Promise<Prisma.BatchPayload> {
- return await prisma.destinationDocker.updateMany({
- where: { engine },
- data: { isCoolifyProxyUsed }
- });
-}
diff --git a/src/lib/database/gitSources.ts b/src/lib/database/gitSources.ts
deleted file mode 100644
index bed6769886..0000000000
--- a/src/lib/database/gitSources.ts
+++ /dev/null
@@ -1,128 +0,0 @@
-import { decrypt, encrypt } from '$lib/crypto';
-import { prisma } from './common';
-import type { GithubApp, GitlabApp, GitSource, Prisma, Application } from '@prisma/client';
-
-export async function listSources(
- teamId: string | Prisma.StringFilter
-): Promise<(GitSource & { githubApp?: GithubApp; gitlabApp?: GitlabApp })[]> {
- if (teamId === '0') {
- return await prisma.gitSource.findMany({
- include: { githubApp: true, gitlabApp: true, teams: true }
- });
- }
- return await prisma.gitSource.findMany({
- where: { teams: { some: { id: teamId } } },
- include: { githubApp: true, gitlabApp: true, teams: true }
- });
-}
-
-export async function newSource({
- name,
- teamId
-}: {
- name: string;
- teamId: string;
-}): Promise<GitSource> {
- return await prisma.gitSource.create({
- data: {
- name,
- teams: { connect: { id: teamId } }
- }
- });
-}
-export async function removeSource({ id }: { id: string }): Promise<void> {
- const source = await prisma.gitSource.delete({
- where: { id },
- include: { githubApp: true, gitlabApp: true }
- });
- if (source.githubAppId) await prisma.githubApp.delete({ where: { id: source.githubAppId } });
- if (source.gitlabAppId) await prisma.gitlabApp.delete({ where: { id: source.gitlabAppId } });
-}
-
-export async function getSource({
- id,
- teamId
-}: {
- id: string;
- teamId: string;
-}): Promise<GitSource & { githubApp: GithubApp; gitlabApp: GitlabApp }> {
- let body;
- if (teamId === '0') {
- body = await prisma.gitSource.findFirst({
- where: { id },
- include: { githubApp: true, gitlabApp: true }
- });
- } else {
- body = await prisma.gitSource.findFirst({
- where: { id, teams: { some: { id: teamId } } },
- include: { githubApp: true, gitlabApp: true }
- });
- }
- if (body?.githubApp?.clientSecret)
- body.githubApp.clientSecret = decrypt(body.githubApp.clientSecret);
- if (body?.githubApp?.webhookSecret)
- body.githubApp.webhookSecret = decrypt(body.githubApp.webhookSecret);
- if (body?.githubApp?.privateKey) body.githubApp.privateKey = decrypt(body.githubApp.privateKey);
- if (body?.gitlabApp?.appSecret) body.gitlabApp.appSecret = decrypt(body.gitlabApp.appSecret);
- return body;
-}
-export async function addGitHubSource({ id, teamId, type, name, htmlUrl, apiUrl, organization }) {
- return await prisma.gitSource.update({
- where: { id },
- data: { type, name, htmlUrl, apiUrl, organization }
- });
-}
-export async function addGitLabSource({
- id,
- teamId,
- type,
- name,
- htmlUrl,
- apiUrl,
- oauthId,
- appId,
- appSecret,
- groupName
-}) {
- const encryptedAppSecret = encrypt(appSecret);
- await prisma.gitSource.update({ where: { id }, data: { type, apiUrl, htmlUrl, name } });
- return await prisma.gitlabApp.create({
- data: {
- teams: { connect: { id: teamId } },
- appId,
- oauthId,
- groupName,
- appSecret: encryptedAppSecret,
- gitSource: { connect: { id } }
- }
- });
-}
-
-export async function configureGitsource({
- id,
- gitSourceId
-}: {
- id: string;
- gitSourceId: string;
-}): Promise<Application> {
- return await prisma.application.update({
- where: { id },
- data: { gitSource: { connect: { id: gitSourceId } } }
- });
-}
-export async function updateGitsource({
- id,
- name,
- htmlUrl,
- apiUrl
-}: {
- id: string;
- name: string;
- htmlUrl: string;
- apiUrl: string;
-}): Promise<GitSource> {
- return await prisma.gitSource.update({
- where: { id },
- data: { name, htmlUrl, apiUrl }
- });
-}
diff --git a/src/lib/database/github.ts b/src/lib/database/github.ts
deleted file mode 100644
index 182ad45291..0000000000
--- a/src/lib/database/github.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import { decrypt, encrypt } from '$lib/crypto';
-import { prisma } from './common';
-import type { GithubApp } from '@prisma/client';
-
-// TODO: We should change installation_id to be camelCase
-export async function addInstallation({
- gitSourceId,
- installation_id
-}: {
- gitSourceId: string;
- installation_id: string;
-}): Promise<GithubApp> {
- const source = await prisma.gitSource.findUnique({
- where: { id: gitSourceId },
- include: { githubApp: true }
- });
- return await prisma.githubApp.update({
- where: { id: source.githubAppId },
- data: { installationId: Number(installation_id) }
- });
-}
-
-export async function getUniqueGithubApp({
- githubAppId
-}: {
- githubAppId: string;
-}): Promise<GithubApp> {
- const body = await prisma.githubApp.findUnique({ where: { id: githubAppId } });
- if (body.privateKey) body.privateKey = decrypt(body.privateKey);
- return body;
-}
-
-export async function createGithubApp({
- id,
- client_id,
- slug,
- client_secret,
- pem,
- webhook_secret,
- state
-}: {
- id: number;
- client_id: string;
- slug: string;
- client_secret: string;
- pem: string;
- webhook_secret: string;
- state: string;
-}): Promise<GithubApp> {
- const encryptedClientSecret = encrypt(client_secret);
- const encryptedWebhookSecret = encrypt(webhook_secret);
- const encryptedPem = encrypt(pem);
- return await prisma.githubApp.create({
- data: {
- appId: id,
- name: slug,
- clientId: client_id,
- clientSecret: encryptedClientSecret,
- webhookSecret: encryptedWebhookSecret,
- privateKey: encryptedPem,
- gitSource: { connect: { id: state } }
- }
- });
-}
diff --git a/src/lib/database/gitlab.ts b/src/lib/database/gitlab.ts
deleted file mode 100644
index 8bb6a9c9b0..0000000000
--- a/src/lib/database/gitlab.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { encrypt } from '$lib/crypto';
-import { generateSshKeyPair, prisma } from './common';
-import type { GitlabApp } from '@prisma/client';
-
-export async function updateDeployKey({
- id,
- deployKeyId
-}: {
- id: string;
- deployKeyId: number;
-}): Promise<GitlabApp> {
- const application = await prisma.application.findUnique({
- where: { id },
- include: { gitSource: { include: { gitlabApp: true } } }
- });
- return await prisma.gitlabApp.update({
- where: { id: application.gitSource.gitlabApp.id },
- data: { deployKeyId }
- });
-}
-export async function getSshKey({
- id
-}: {
- id: string;
-}): Promise<{ status: number; body: { publicKey: string } }> {
- const application = await prisma.application.findUnique({
- where: { id },
- include: { gitSource: { include: { gitlabApp: true } } }
- });
- return { status: 200, body: { publicKey: application.gitSource.gitlabApp.publicSshKey } };
-}
-export async function generateSshKey({
- id
-}: {
- id: string;
-}): Promise<
- { status: number; body: { publicKey: string } } | { status: number; body?: undefined }
-> {
- const application = await prisma.application.findUnique({
- where: { id },
- include: { gitSource: { include: { gitlabApp: true } } }
- });
- if (!application.gitSource?.gitlabApp?.privateSshKey) {
- const keys = await generateSshKeyPair();
- const encryptedPrivateKey = encrypt(keys.privateKey);
- await prisma.gitlabApp.update({
- where: { id: application.gitSource.gitlabApp.id },
- data: { privateSshKey: encryptedPrivateKey, publicSshKey: keys.publicKey }
- });
- return { status: 201, body: { publicKey: keys.publicKey } };
- } else {
- return { status: 200 };
- }
-}
diff --git a/src/lib/database/index.ts b/src/lib/database/index.ts
deleted file mode 100644
index e03b564f79..0000000000
--- a/src/lib/database/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-export * from './applications';
-export * from './checks';
-export * from './common';
-export * from './destinations';
-export * from './github';
-export * from './gitlab';
-export * from './gitSources';
-export * from './logs';
-export * from './settings';
-export * from './users';
-export * from './teams';
-export * from './secrets';
-export * from './databases';
-export * from './services';
diff --git a/src/lib/database/logs.ts b/src/lib/database/logs.ts
deleted file mode 100644
index 74f50b50b0..0000000000
--- a/src/lib/database/logs.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import type { BuildLog } from '@prisma/client';
-import { prisma, ErrorHandler } from './common';
-
-export async function listLogs({
- buildId,
- last = 0
-}: {
- buildId: string;
- last: number;
-}): Promise<BuildLog[] | { status: number; body: { message: string; error: string } }> {
- try {
- const body = await prisma.buildLog.findMany({
- where: { buildId, time: { gt: last } },
- orderBy: { time: 'asc' }
- });
- return [...body];
- } catch (error) {
- return ErrorHandler(error);
- }
-}
diff --git a/src/lib/database/secrets.ts b/src/lib/database/secrets.ts
deleted file mode 100644
index 2aade4a2f9..0000000000
--- a/src/lib/database/secrets.ts
+++ /dev/null
@@ -1,133 +0,0 @@
-import { encrypt, decrypt } from '$lib/crypto';
-import { prisma } from './common';
-import type { ServiceSecret, Secret, Prisma } from '@prisma/client';
-
-export async function listServiceSecrets(serviceId: string): Promise<ServiceSecret[]> {
- let secrets = await prisma.serviceSecret.findMany({
- where: { serviceId },
- orderBy: { createdAt: 'desc' }
- });
- secrets = secrets.map((secret) => {
- secret.value = decrypt(secret.value);
- return secret;
- });
-
- return secrets;
-}
-
-export async function listSecrets(applicationId: string): Promise<Secret[]> {
- let secrets = await prisma.secret.findMany({
- where: { applicationId },
- orderBy: { createdAt: 'desc' }
- });
- secrets = secrets.map((secret) => {
- secret.value = decrypt(secret.value);
- return secret;
- });
-
- return secrets;
-}
-
-export async function createServiceSecret({
- id,
- name,
- value
-}: {
- id: string;
- name: string;
- value: string;
-}): Promise<ServiceSecret> {
- value = encrypt(value);
- return await prisma.serviceSecret.create({
- data: { name, value, service: { connect: { id } } }
- });
-}
-export async function createSecret({
- id,
- name,
- value,
- isBuildSecret,
- isPRMRSecret
-}: {
- id: string;
- name: string;
- value: string;
- isBuildSecret: boolean;
- isPRMRSecret: boolean;
-}): Promise<Secret> {
- value = encrypt(value);
- return await prisma.secret.create({
- data: { name, value, isBuildSecret, isPRMRSecret, application: { connect: { id } } }
- });
-}
-
-export async function updateServiceSecret({
- id,
- name,
- value
-}: {
- id: string;
- name: string;
- value: string;
-}): Promise<Prisma.BatchPayload | ServiceSecret> {
- value = encrypt(value);
- const found = await prisma.serviceSecret.findFirst({ where: { serviceId: id, name } });
-
- if (found) {
- return await prisma.serviceSecret.updateMany({
- where: { serviceId: id, name },
- data: { value }
- });
- } else {
- return await prisma.serviceSecret.create({
- data: { name, value, service: { connect: { id } } }
- });
- }
-}
-export async function updateSecret({
- id,
- name,
- value,
- isBuildSecret,
- isPRMRSecret
-}: {
- id: string;
- name: string;
- value: string;
- isBuildSecret: boolean;
- isPRMRSecret: boolean;
-}): Promise<Prisma.BatchPayload | Secret> {
- value = encrypt(value);
- const found = await prisma.secret.findFirst({ where: { applicationId: id, name, isPRMRSecret } });
-
- if (found) {
- return await prisma.secret.updateMany({
- where: { applicationId: id, name, isPRMRSecret },
- data: { value, isBuildSecret, isPRMRSecret }
- });
- } else {
- return await prisma.secret.create({
- data: { name, value, isBuildSecret, isPRMRSecret, application: { connect: { id } } }
- });
- }
-}
-
-export async function removeServiceSecret({
- id,
- name
-}: {
- id: string;
- name: string;
-}): Promise<Prisma.BatchPayload> {
- return await prisma.serviceSecret.deleteMany({ where: { serviceId: id, name } });
-}
-
-export async function removeSecret({
- id,
- name
-}: {
- id: string;
- name: string;
-}): Promise<Prisma.BatchPayload> {
- return await prisma.secret.deleteMany({ where: { applicationId: id, name } });
-}
diff --git a/src/lib/database/services.ts b/src/lib/database/services.ts
deleted file mode 100644
index a481a8fe1c..0000000000
--- a/src/lib/database/services.ts
+++ /dev/null
@@ -1,521 +0,0 @@
-import { decrypt, encrypt } from '$lib/crypto';
-import type { Minio, Prisma, Service } from '@prisma/client';
-import cuid from 'cuid';
-import { generatePassword } from '.';
-import { prisma } from './common';
-
-const include: Prisma.ServiceInclude = {
- destinationDocker: true,
- persistentStorage: true,
- serviceSecret: true,
- minio: true,
- plausibleAnalytics: true,
- vscodeserver: true,
- wordpress: true,
- ghost: true,
- meiliSearch: true,
- umami: true,
- hasura: true,
- fider: true
-};
-export async function listServicesWithIncludes(): Promise<Service[]> {
- return await prisma.service.findMany({
- include,
- orderBy: { createdAt: 'desc' }
- });
-}
-export async function listServices(teamId: string): Promise<Service[]> {
- if (teamId === '0') {
- return await prisma.service.findMany({ include: { teams: true } });
- } else {
- return await prisma.service.findMany({
- where: { teams: { some: { id: teamId } } },
- include: { teams: true }
- });
- }
-}
-
-export async function newService({
- name,
- teamId
-}: {
- name: string;
- teamId: string;
-}): Promise<Service> {
- return await prisma.service.create({ data: { name, teams: { connect: { id: teamId } } } });
-}
-
-export async function getService({ id, teamId }: { id: string; teamId: string }): Promise<Service> {
- let body;
- if (teamId === '0') {
- body = await prisma.service.findFirst({
- where: { id },
- include
- });
- } else {
- body = await prisma.service.findFirst({
- where: { id, teams: { some: { id: teamId } } },
- include
- });
- }
-
- if (body?.serviceSecret.length > 0) {
- body.serviceSecret = body.serviceSecret.map((s) => {
- s.value = decrypt(s.value);
- return s;
- });
- }
- if (body.plausibleAnalytics?.postgresqlPassword)
- body.plausibleAnalytics.postgresqlPassword = decrypt(
- body.plausibleAnalytics.postgresqlPassword
- );
- if (body.plausibleAnalytics?.password)
- body.plausibleAnalytics.password = decrypt(body.plausibleAnalytics.password);
- if (body.plausibleAnalytics?.secretKeyBase)
- body.plausibleAnalytics.secretKeyBase = decrypt(body.plausibleAnalytics.secretKeyBase);
-
- if (body.minio?.rootUserPassword)
- body.minio.rootUserPassword = decrypt(body.minio.rootUserPassword);
-
- if (body.vscodeserver?.password) body.vscodeserver.password = decrypt(body.vscodeserver.password);
-
- if (body.wordpress?.mysqlPassword)
- body.wordpress.mysqlPassword = decrypt(body.wordpress.mysqlPassword);
- if (body.wordpress?.mysqlRootUserPassword)
- body.wordpress.mysqlRootUserPassword = decrypt(body.wordpress.mysqlRootUserPassword);
-
- if (body.ghost?.mariadbPassword) body.ghost.mariadbPassword = decrypt(body.ghost.mariadbPassword);
- if (body.ghost?.mariadbRootUserPassword)
- body.ghost.mariadbRootUserPassword = decrypt(body.ghost.mariadbRootUserPassword);
- if (body.ghost?.defaultPassword) body.ghost.defaultPassword = decrypt(body.ghost.defaultPassword);
-
- if (body.meiliSearch?.masterKey) body.meiliSearch.masterKey = decrypt(body.meiliSearch.masterKey);
-
- if (body.wordpress?.ftpPassword) body.wordpress.ftpPassword = decrypt(body.wordpress.ftpPassword);
-
- if (body.umami?.postgresqlPassword)
- body.umami.postgresqlPassword = decrypt(body.umami.postgresqlPassword);
- if (body.umami?.umamiAdminPassword)
- body.umami.umamiAdminPassword = decrypt(body.umami.umamiAdminPassword);
- if (body.umami?.hashSalt) body.umami.hashSalt = decrypt(body.umami.hashSalt);
-
- if (body.hasura?.postgresqlPassword)
- body.hasura.postgresqlPassword = decrypt(body.hasura.postgresqlPassword);
- if (body.hasura?.graphQLAdminPassword)
- body.hasura.graphQLAdminPassword = decrypt(body.hasura.graphQLAdminPassword);
-
- if (body.fider?.postgresqlPassword)
- body.fider.postgresqlPassword = decrypt(body.fider.postgresqlPassword);
- if (body.fider?.jwtSecret) body.fider.jwtSecret = decrypt(body.fider.jwtSecret);
- if (body.fider?.emailSmtpPassword)
- body.fider.emailSmtpPassword = decrypt(body.fider.emailSmtpPassword);
-
- const settings = await prisma.setting.findFirst();
-
- return { ...body, settings };
-}
-
-export async function configureServiceType({
- id,
- type
-}: {
- id: string;
- type: string;
-}): Promise<void> {
- if (type === 'plausibleanalytics') {
- const password = encrypt(generatePassword());
- const postgresqlUser = cuid();
- const postgresqlPassword = encrypt(generatePassword());
- const postgresqlDatabase = 'plausibleanalytics';
- const secretKeyBase = encrypt(generatePassword(64));
-
- await prisma.service.update({
- where: { id },
- data: {
- type,
- plausibleAnalytics: {
- create: {
- postgresqlDatabase,
- postgresqlUser,
- postgresqlPassword,
- password,
- secretKeyBase
- }
- }
- }
- });
- } else if (type === 'nocodb') {
- await prisma.service.update({
- where: { id },
- data: { type }
- });
- } else if (type === 'minio') {
- const rootUser = cuid();
- const rootUserPassword = encrypt(generatePassword());
- await prisma.service.update({
- where: { id },
- data: { type, minio: { create: { rootUser, rootUserPassword } } }
- });
- } else if (type === 'vscodeserver') {
- const password = encrypt(generatePassword());
- await prisma.service.update({
- where: { id },
- data: { type, vscodeserver: { create: { password } } }
- });
- } else if (type === 'wordpress') {
- const mysqlUser = cuid();
- const mysqlPassword = encrypt(generatePassword());
- const mysqlRootUser = cuid();
- const mysqlRootUserPassword = encrypt(generatePassword());
- await prisma.service.update({
- where: { id },
- data: {
- type,
- wordpress: { create: { mysqlPassword, mysqlRootUserPassword, mysqlRootUser, mysqlUser } }
- }
- });
- } else if (type === 'vaultwarden') {
- await prisma.service.update({
- where: { id },
- data: {
- type
- }
- });
- } else if (type === 'languagetool') {
- await prisma.service.update({
- where: { id },
- data: {
- type
- }
- });
- } else if (type === 'n8n') {
- await prisma.service.update({
- where: { id },
- data: {
- type
- }
- });
- } else if (type === 'uptimekuma') {
- await prisma.service.update({
- where: { id },
- data: {
- type
- }
- });
- } else if (type === 'ghost') {
- const defaultEmail = `${cuid()}@example.com`;
- const defaultPassword = encrypt(generatePassword());
- const mariadbUser = cuid();
- const mariadbPassword = encrypt(generatePassword());
- const mariadbRootUser = cuid();
- const mariadbRootUserPassword = encrypt(generatePassword());
-
- await prisma.service.update({
- where: { id },
- data: {
- type,
- ghost: {
- create: {
- defaultEmail,
- defaultPassword,
- mariadbUser,
- mariadbPassword,
- mariadbRootUser,
- mariadbRootUserPassword
- }
- }
- }
- });
- } else if (type === 'meilisearch') {
- const masterKey = encrypt(generatePassword(32));
- await prisma.service.update({
- where: { id },
- data: {
- type,
- meiliSearch: { create: { masterKey } }
- }
- });
- } else if (type === 'umami') {
- const umamiAdminPassword = encrypt(generatePassword());
- const postgresqlUser = cuid();
- const postgresqlPassword = encrypt(generatePassword());
- const postgresqlDatabase = 'umami';
- const hashSalt = encrypt(generatePassword(64));
- await prisma.service.update({
- where: { id },
- data: {
- type,
- umami: {
- create: {
- umamiAdminPassword,
- postgresqlDatabase,
- postgresqlPassword,
- postgresqlUser,
- hashSalt
- }
- }
- }
- });
- } else if (type === 'hasura') {
- const postgresqlUser = cuid();
- const postgresqlPassword = encrypt(generatePassword());
- const postgresqlDatabase = 'hasura';
- const graphQLAdminPassword = encrypt(generatePassword());
- await prisma.service.update({
- where: { id },
- data: {
- type,
- hasura: {
- create: {
- postgresqlDatabase,
- postgresqlPassword,
- postgresqlUser,
- graphQLAdminPassword
- }
- }
- }
- });
- } else if (type === 'fider') {
- const postgresqlUser = cuid();
- const postgresqlPassword = encrypt(generatePassword());
- const postgresqlDatabase = 'fider';
- const jwtSecret = encrypt(generatePassword(64, true));
- await prisma.service.update({
- where: { id },
- data: {
- type,
- fider: {
- create: {
- postgresqlDatabase,
- postgresqlPassword,
- postgresqlUser,
- jwtSecret
- }
- }
- }
- });
- }
-}
-
-export async function setServiceVersion({
- id,
- version
-}: {
- id: string;
- version: string;
-}): Promise<Service> {
- return await prisma.service.update({
- where: { id },
- data: { version }
- });
-}
-
-export async function setServiceSettings({
- id,
- dualCerts
-}: {
- id: string;
- dualCerts: boolean;
-}): Promise<Service> {
- return await prisma.service.update({
- where: { id },
- data: { dualCerts }
- });
-}
-
-export async function updatePlausibleAnalyticsService({
- id,
- fqdn,
- email,
- exposePort,
- username,
- name,
- scriptName
-}: {
- id: string;
- fqdn: string;
- exposePort?: number;
- name: string;
- email: string;
- username: string;
- scriptName: string;
-}): Promise<void> {
- await prisma.plausibleAnalytics.update({
- where: { serviceId: id },
- data: { email, username, scriptName }
- });
- await prisma.service.update({ where: { id }, data: { name, fqdn, exposePort } });
-}
-
-export async function updateService({
- id,
- fqdn,
- exposePort,
- name
-}: {
- id: string;
- fqdn: string;
- exposePort?: number;
- name: string;
-}): Promise<Service> {
- return await prisma.service.update({ where: { id }, data: { fqdn, name, exposePort } });
-}
-export async function updateMinioService({
- id,
- fqdn,
- apiFqdn,
- exposePort,
- name
-}: {
- id: string;
- fqdn: string;
- apiFqdn: string;
- exposePort?: number;
- name: string;
-}): Promise<Service> {
- return await prisma.service.update({
- where: { id },
- data: { fqdn, name, exposePort, minio: { update: { apiFqdn } } }
- });
-}
-export async function updateFiderService({
- id,
- fqdn,
- name,
- exposePort,
- emailNoreply,
- emailMailgunApiKey,
- emailMailgunDomain,
- emailMailgunRegion,
- emailSmtpHost,
- emailSmtpPort,
- emailSmtpUser,
- emailSmtpPassword,
- emailSmtpEnableStartTls
-}: {
- id: string;
- fqdn: string;
- exposePort?: number;
- name: string;
- emailNoreply: string;
- emailMailgunApiKey: string;
- emailMailgunDomain: string;
- emailMailgunRegion: string;
- emailSmtpHost: string;
- emailSmtpPort: number;
- emailSmtpUser: string;
- emailSmtpPassword: string;
- emailSmtpEnableStartTls: boolean;
-}): Promise<Service> {
- return await prisma.service.update({
- where: { id },
- data: {
- fqdn,
- name,
- exposePort,
- fider: {
- update: {
- emailNoreply,
- emailMailgunApiKey,
- emailMailgunDomain,
- emailMailgunRegion,
- emailSmtpHost,
- emailSmtpPort,
- emailSmtpUser,
- emailSmtpPassword,
- emailSmtpEnableStartTls
- }
- }
- }
- });
-}
-
-export async function updateWordpress({
- id,
- fqdn,
- name,
- exposePort,
- mysqlDatabase,
- extraConfig,
- mysqlHost,
- mysqlPort,
- mysqlUser,
- mysqlPassword
-}: {
- id: string;
- fqdn: string;
- name: string;
- exposePort?: number;
- ownMysql: boolean;
- mysqlDatabase: string;
- extraConfig: string;
- mysqlHost?: string;
- mysqlPort?: number;
- mysqlUser?: string;
- mysqlPassword?: string;
-}): Promise<Service> {
- mysqlPassword = encrypt(mysqlPassword);
- return await prisma.service.update({
- where: { id },
- data: {
- fqdn,
- name,
- exposePort,
- wordpress: {
- update: {
- mysqlDatabase,
- extraConfig,
- mysqlHost,
- mysqlUser,
- mysqlPassword,
- mysqlPort
- }
- }
- }
- });
-}
-
-export async function updateMinioServicePort({
- id,
- publicPort
-}: {
- id: string;
- publicPort: number;
-}): Promise<Minio> {
- return await prisma.minio.update({ where: { serviceId: id }, data: { publicPort } });
-}
-
-export async function updateGhostService({
- id,
- fqdn,
- name,
- exposePort,
- mariadbDatabase
-}: {
- id: string;
- fqdn: string;
- name: string;
- exposePort?: number;
- mariadbDatabase: string;
-}): Promise<Service> {
- return await prisma.service.update({
- where: { id },
- data: { fqdn, name, exposePort, ghost: { update: { mariadbDatabase } } }
- });
-}
-
-export async function removeService({ id }: { id: string }): Promise<void> {
- await prisma.servicePersistentStorage.deleteMany({ where: { serviceId: id } });
- await prisma.meiliSearch.deleteMany({ where: { serviceId: id } });
- await prisma.fider.deleteMany({ where: { serviceId: id } });
- await prisma.ghost.deleteMany({ where: { serviceId: id } });
- await prisma.umami.deleteMany({ where: { serviceId: id } });
- await prisma.hasura.deleteMany({ where: { serviceId: id } });
- await prisma.plausibleAnalytics.deleteMany({ where: { serviceId: id } });
- await prisma.minio.deleteMany({ where: { serviceId: id } });
- await prisma.vscodeserver.deleteMany({ where: { serviceId: id } });
- await prisma.wordpress.deleteMany({ where: { serviceId: id } });
- await prisma.serviceSecret.deleteMany({ where: { serviceId: id } });
-
- await prisma.service.delete({ where: { id } });
-}
diff --git a/src/lib/database/settings.ts b/src/lib/database/settings.ts
deleted file mode 100644
index 2d0395d887..0000000000
--- a/src/lib/database/settings.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { decrypt } from '$lib/crypto';
-import { prisma } from './common';
-import type { Setting } from '@prisma/client';
-
-export async function listSettings(): Promise<Setting> {
- const settings = await prisma.setting.findFirst({});
- if (settings.proxyPassword) settings.proxyPassword = decrypt(settings.proxyPassword);
- return settings;
-}
diff --git a/src/lib/database/teams.ts b/src/lib/database/teams.ts
deleted file mode 100644
index 45d8fb5db6..0000000000
--- a/src/lib/database/teams.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import type { Team, Permission } from '@prisma/client';
-import { prisma } from './common';
-
-export async function listTeams(): Promise<Team[]> {
- return await prisma.team.findMany();
-}
-export async function newTeam({ name, userId }: { name: string; userId: string }): Promise<Team> {
- return await prisma.team.create({
- data: {
- name,
- permissions: { create: { user: { connect: { id: userId } }, permission: 'owner' } },
- users: { connect: { id: userId } }
- }
- });
-}
-export async function getMyTeams({
- userId
-}: {
- userId: string;
-}): Promise<(Permission & { team: Team & { _count: { users: number } } })[]> {
- return await prisma.permission.findMany({
- where: { userId },
- include: { team: { include: { _count: { select: { users: true } } } } }
- });
-}
diff --git a/src/lib/database/users.ts b/src/lib/database/users.ts
deleted file mode 100644
index b74c8de4c1..0000000000
--- a/src/lib/database/users.ts
+++ /dev/null
@@ -1,163 +0,0 @@
-import cuid from 'cuid';
-import bcrypt from 'bcryptjs';
-
-import { prisma } from './common';
-import { asyncExecShell, uniqueName } from '$lib/common';
-import * as db from '$lib/database';
-import { startCoolifyProxy } from '$lib/haproxy';
-import type { User } from '@prisma/client';
-
-export async function hashPassword(password: string): Promise<string> {
- const saltRounds = 15;
- return bcrypt.hash(password, saltRounds);
-}
-
-export async function login({
- email,
- password,
- isLogin
-}: {
- email: string;
- password: string;
- isLogin: boolean;
-}): Promise<{
- status: number;
- headers: { 'Set-Cookie': string };
- body: { userId: string; teamId: string; permission: string; isAdmin: boolean };
-}> {
- const users = await prisma.user.count();
- const userFound = await prisma.user.findUnique({
- where: { email },
- include: { teams: true, permission: true },
- rejectOnNotFound: false
- });
- if (!userFound && isLogin) {
- throw {
- error: 'Wrong password or email address.'
- };
- }
- // Registration disabled if database is not seeded properly
- const { isRegistrationEnabled, id } = await db.listSettings();
-
- let uid = cuid();
- let permission = 'read';
- let isAdmin = false;
- // Disable registration if we are registering the first user.
- if (users === 0) {
- await prisma.setting.update({ where: { id }, data: { isRegistrationEnabled: false } });
- // Create default network & start Coolify Proxy
- try {
- await asyncExecShell(`docker network create --attachable coolify`);
- } catch (error) {}
- try {
- await startCoolifyProxy('/var/run/docker.sock');
- } catch (error) {}
- uid = '0';
- }
-
- if (userFound) {
- if (userFound.type === 'email') {
- if (userFound.password === 'RESETME') {
- const hashedPassword = await hashPassword(password);
- if (userFound.updatedAt < new Date(Date.now() - 1000 * 60 * 10)) {
- await prisma.user.update({
- where: { email: userFound.email },
- data: { password: 'RESETTIMEOUT' }
- });
- throw {
- error: 'Password reset link has expired. Please request a new one.'
- };
- } else {
- await prisma.user.update({
- where: { email: userFound.email },
- data: { password: hashedPassword }
- });
- return {
- status: 200,
- headers: {
- 'Set-Cookie': `teamId=${uid}; HttpOnly; Path=/; Max-Age=15778800;`
- },
- body: {
- userId: userFound.id,
- teamId: userFound.id,
- permission: userFound.permission,
- isAdmin: true
- }
- };
- }
- }
- const passwordMatch = await bcrypt.compare(password, userFound.password);
- if (!passwordMatch) {
- throw {
- error: 'Wrong password or email address.'
- };
- }
- uid = userFound.id;
- // permission = userFound.permission;
- isAdmin = true;
- }
- } else {
- // If registration disabled, return 403
- if (!isRegistrationEnabled) {
- throw {
- error: 'Registration disabled by administrator.'
- };
- }
-
- const hashedPassword = await hashPassword(password);
- if (users === 0) {
- permission = 'owner';
- isAdmin = true;
- await prisma.user.create({
- data: {
- id: uid,
- email,
- password: hashedPassword,
- type: 'email',
- teams: {
- create: {
- id: uid,
- name: uniqueName(),
- destinationDocker: { connect: { network: 'coolify' } }
- }
- },
- permission: { create: { teamId: uid, permission: 'owner' } }
- },
- include: { teams: true }
- });
- } else {
- await prisma.user.create({
- data: {
- id: uid,
- email,
- password: hashedPassword,
- type: 'email',
- teams: {
- create: {
- id: uid,
- name: uniqueName()
- }
- },
- permission: { create: { teamId: uid, permission: 'owner' } }
- },
- include: { teams: true }
- });
- }
- }
- return {
- status: 200,
- headers: {
- 'Set-Cookie': `teamId=${uid}; HttpOnly; Path=/; Max-Age=15778800;`
- },
- body: {
- userId: uid,
- teamId: uid,
- permission,
- isAdmin
- }
- };
-}
-
-export async function getUser({ userId }: { userId: string }): Promise<User> {
- return await prisma.user.findUnique({ where: { id: userId } });
-}
diff --git a/src/lib/docker.ts b/src/lib/docker.ts
deleted file mode 100644
index 864b32b629..0000000000
--- a/src/lib/docker.ts
+++ /dev/null
@@ -1,202 +0,0 @@
-import Dockerode from 'dockerode';
-import { promises as fs } from 'fs';
-import { checkPnpm } from './buildPacks/common';
-import { saveBuildLog } from './common';
-
-export async function buildCacheImageForLaravel(data, imageForBuild) {
- const { applicationId, tag, workdir, docker, buildId, debug, secrets, pullmergeRequestId } = data;
- const Dockerfile: Array<string> = [];
- Dockerfile.push(`FROM ${imageForBuild}`);
- Dockerfile.push('WORKDIR /app');
- Dockerfile.push(`LABEL coolify.buildId=${buildId}`);
- if (secrets.length > 0) {
- secrets.forEach((secret) => {
- if (secret.isBuildSecret) {
- if (pullmergeRequestId) {
- if (secret.isPRMRSecret) {
- Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
- }
- } else {
- if (!secret.isPRMRSecret) {
- Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
- }
- }
- }
- });
- }
- Dockerfile.push(`COPY *.json *.mix.js /app/`);
- Dockerfile.push(`COPY resources /app/resources`);
- Dockerfile.push(`RUN yarn install && yarn production`);
- await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));
- await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });
-}
-
-export async function buildCacheImageWithNode(data, imageForBuild) {
- const {
- applicationId,
- tag,
- workdir,
- docker,
- buildId,
- baseDirectory,
- installCommand,
- buildCommand,
- debug,
- secrets,
- pullmergeRequestId
- } = data;
- const isPnpm = checkPnpm(installCommand, buildCommand);
- const Dockerfile: Array<string> = [];
- Dockerfile.push(`FROM ${imageForBuild}`);
- Dockerfile.push('WORKDIR /app');
- Dockerfile.push(`LABEL coolify.buildId=${buildId}`);
- if (secrets.length > 0) {
- secrets.forEach((secret) => {
- if (secret.isBuildSecret) {
- if (pullmergeRequestId) {
- if (secret.isPRMRSecret) {
- Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
- }
- } else {
- if (!secret.isPRMRSecret) {
- Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
- }
- }
- }
- });
- }
- if (isPnpm) {
- Dockerfile.push('RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7');
- }
- if (installCommand) {
- Dockerfile.push(`COPY .${baseDirectory || ''}/package.json ./`);
- Dockerfile.push(`RUN ${installCommand}`);
- }
- Dockerfile.push(`COPY .${baseDirectory || ''} ./`);
- Dockerfile.push(`RUN ${buildCommand}`);
- await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));
- await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });
-}
-
-export async function buildCacheImageWithCargo(data, imageForBuild) {
- const {
- applicationId,
- tag,
- workdir,
- docker,
- buildId,
- baseDirectory,
- installCommand,
- buildCommand,
- debug,
- secrets
- } = data;
- const Dockerfile: Array<string> = [];
- Dockerfile.push(`FROM ${imageForBuild} as planner-${applicationId}`);
- Dockerfile.push(`LABEL coolify.buildId=${buildId}`);
- Dockerfile.push('WORKDIR /app');
- Dockerfile.push('RUN cargo install cargo-chef');
- Dockerfile.push('COPY . .');
- Dockerfile.push('RUN cargo chef prepare --recipe-path recipe.json');
- Dockerfile.push(`FROM ${imageForBuild}`);
- Dockerfile.push(`LABEL coolify.buildId=${buildId}`);
- Dockerfile.push('WORKDIR /app');
- Dockerfile.push('RUN cargo install cargo-chef');
- Dockerfile.push(`COPY --from=planner-${applicationId} /app/recipe.json recipe.json`);
- Dockerfile.push('RUN cargo chef cook --release --recipe-path recipe.json');
- await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));
- await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });
-}
-
-export async function buildImage({
- applicationId,
- tag,
- workdir,
- docker,
- buildId,
- isCache = false,
- debug = false,
- dockerFileLocation = '/Dockerfile'
-}) {
- if (isCache) {
- await saveBuildLog({ line: `Building cache image started.`, buildId, applicationId });
- } else {
- await saveBuildLog({ line: `Building image started.`, buildId, applicationId });
- }
- if (!debug && isCache) {
- await saveBuildLog({
- line: `Debug turned off. To see more details, allow it in the configuration.`,
- buildId,
- applicationId
- });
- }
-
- const stream = await docker.engine.buildImage(
- { src: ['.'], context: workdir },
- {
- dockerfile: isCache ? `${dockerFileLocation}-cache` : dockerFileLocation,
- t: `${applicationId}:${tag}${isCache ? '-cache' : ''}`
- }
- );
- await streamEvents({ stream, docker, buildId, applicationId, debug });
- await saveBuildLog({ line: `Building image successful!`, buildId, applicationId });
-}
-
-export function dockerInstance({ destinationDocker }): { engine: Dockerode; network: string } {
- // new Docker({protocol:"ssh", host: '188.34.164.25',port: 22, username:'root', sshOptions: {agentForward: true, agent:process.env.SSH_AUTH_SOCK}})
- return {
- engine: new Dockerode({
- socketPath: destinationDocker.engine
- }),
- network: destinationDocker.network
- };
-}
-export async function streamEvents({ stream, docker, buildId, applicationId, debug }) {
- await new Promise((resolve, reject) => {
- docker.engine.modem.followProgress(stream, onFinished, onProgress);
- function onFinished(err, res) {
- if (err) reject(err);
- resolve(res);
- }
- async function onProgress(event) {
- if (event.error) {
- reject(event.error);
- } else if (event.stream) {
- if (event.stream !== '\n') {
- if (debug)
- await saveBuildLog({
- line: `${event.stream.replace('\n', '')}`,
- buildId,
- applicationId
- });
- }
- }
- }
- });
-}
-
-export const baseServiceConfigurationDocker = {
- restart_policy: {
- condition: 'any',
- max_attempts: 6
- }
-};
-
-export const baseServiceConfigurationSwarm = {
- replicas: 1,
- restart_policy: {
- condition: 'any',
- max_attempts: 6
- },
- update_config: {
- parallelism: 1,
- delay: '10s',
- order: 'start-first'
- },
- rollback_config: {
- parallelism: 1,
- delay: '10s',
- order: 'start-first',
- failure_action: 'rollback'
- }
-};
diff --git a/src/lib/form.ts b/src/lib/form.ts
deleted file mode 100644
index 5a7d65e238..0000000000
--- a/src/lib/form.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-import { toast } from '@zerodevx/svelte-toast';
-
-export function errorNotification(message: string): void {
- console.error(message);
- if (typeof message !== 'string') {
- toast.push('Ooops, something is not okay, are you okay?');
- } else {
- toast.push(message);
- }
-}
-export function enhance(
- form: HTMLFormElement,
- {
- beforeSubmit,
- final,
- pending,
- error,
- result
- }: {
- beforeSubmit?: () => Promise<void>;
- final?: () => Promise<void>;
- pending?: (data: FormData, form: HTMLFormElement) => void;
- error?: (res: Response, error: Error, form: HTMLFormElement) => void;
- result?: (res: Response, form: HTMLFormElement) => void;
- }
-): { destroy: () => void } {
- let current_token: unknown;
-
- async function handle_submit(e: Event) {
- const token = (current_token = {});
- e.preventDefault();
-
- let body = new FormData(form);
- const parsedData = body;
-
- body.forEach((data, key) => {
- if (data === '' || data === null) parsedData.delete(key);
- });
- body = parsedData;
-
- if (beforeSubmit) await beforeSubmit();
- if (pending) pending(body, form);
-
- try {
- const res = await fetch(form.action, {
- method: form.method,
- headers: {
- accept: 'application/json'
- },
- body
- });
-
- if (token !== current_token) return;
-
- if (res.ok) {
- if (result) result(res, form);
- } else if (error) {
- error(res, null, form);
- } else {
- // TODO: Add error frontend here
- const { message } = await res.json();
- errorNotification(message);
- }
- } catch (e) {
- if (error) {
- error(null, e, form);
- } else {
- throw e;
- }
- } finally {
- if (final) final();
- }
- }
-
- form.addEventListener('submit', handle_submit);
-
- return {
- destroy() {
- form.removeEventListener('submit', handle_submit);
- }
- };
-}
diff --git a/src/lib/haproxy/configuration.ts b/src/lib/haproxy/configuration.ts
deleted file mode 100644
index eb6b7ef00b..0000000000
--- a/src/lib/haproxy/configuration.ts
+++ /dev/null
@@ -1,299 +0,0 @@
-import { dev } from '$app/env';
-import got, { type Got } from 'got';
-import * as db from '$lib/database';
-import mustache from 'mustache';
-import crypto from 'crypto';
-import { checkContainer, checkHAProxy } from '.';
-import { asyncExecShell, getDomain, getEngine } from '$lib/common';
-import { supportedServiceTypesAndVersions } from '$lib/components/common';
-import { listServicesWithIncludes } from '$lib/database';
-
-const url = dev ? 'http://localhost:5555' : 'http://coolify-haproxy:5555';
-
-const template = `program api
- command /usr/bin/dataplaneapi -f /usr/local/etc/haproxy/dataplaneapi.hcl --userlist haproxy-dataplaneapi
- no option start-on-reload
-
-global
- stats socket /var/run/api.sock user haproxy group haproxy mode 660 level admin expose-fd listeners
- log stdout format raw local0 debug
-
-defaults
- mode http
- log global
- timeout http-request 120s
- timeout connect 10s
- timeout client 120s
- timeout server 120s
-
-userlist haproxy-dataplaneapi
- user admin insecure-password "\${HAPROXY_PASSWORD}"
-
-frontend http
- mode http
- bind :80
- bind :443 ssl crt /usr/local/etc/haproxy/ssl/ alpn h2,http/1.1
- acl is_certbot path_beg /.well-known/acme-challenge/
-
- {{#applications}}
- {{#isHttps}}
- http-request redirect scheme https code ${
- dev ? 302 : 301
- } if { hdr(host) -i {{domain}} } !{ ssl_fc }
- {{/isHttps}}
- http-request redirect location {{{redirectValue}}} code ${
- dev ? 302 : 301
- } if { req.hdr(host) -i {{redirectTo}} }
- {{/applications}}
-
- {{#services}}
- {{#isHttps}}
- http-request redirect scheme https code ${
- dev ? 302 : 301
- } if { hdr(host) -i {{domain}} } !{ ssl_fc }
- {{/isHttps}}
- http-request redirect location {{{redirectValue}}} code ${
- dev ? 302 : 301
- } if { req.hdr(host) -i {{redirectTo}} }
- {{#scriptName}}
- http-request set-path /js/plausible.js if { hdr(host) -i {{domain}} } { path_beg -i /js/{{scriptName}} }
- {{/scriptName}}
- {{/services}}
-
- {{#coolify}}
- {{#isHttps}}
- http-request redirect scheme https code ${
- dev ? 302 : 301
- } if { hdr(host) -i {{domain}} } !{ ssl_fc }
- {{/isHttps}}
- http-request redirect location {{{redirectValue}}} code ${
- dev ? 302 : 301
- } if { req.hdr(host) -i {{redirectTo}} }
- {{/coolify}}
-
- use_backend backend-certbot if is_certbot
- use_backend %[req.hdr(host),lower]
-
-frontend stats
- bind *:8404
- stats enable
- stats uri /
- stats admin if TRUE
- stats auth "\${HAPROXY_USERNAME}:\${HAPROXY_PASSWORD}"
-
-backend backend-certbot
- mode http
- server certbot host.docker.internal:9080
-
-{{#applications}}
-{{#isRunning}}
-# updatedAt={{updatedAt}}
-backend {{domain}}
- option forwardfor
- {{#isHttps}}
- http-request add-header X-Forwarded-Proto https
- {{/isHttps}}
- {{^isHttps}}
- http-request add-header X-Forwarded-Proto http
- {{/isHttps}}
- http-request add-header X-Forwarded-Host %[req.hdr(host),lower]
- server {{id}} {{id}}:{{port}}
- compression algo gzip
- compression type text/html text/css text/plain text/xml text/x-component text/javascript application/x-javascript application/javascript application/json application/manifest+json application/vnd.api+json application/xml application/xhtml+xml application/rss+xml application/atom+xml application/vnd.ms-fontobject application/x-font-ttf application/x-font-opentype application/x-font-truetype image/svg+xml image/x-icon image/vnd.microsoft.icon font/ttf font/eot font/otf font/opentype
-{{/isRunning}}
-{{/applications}}
-
-{{#services}}
-{{#isRunning}}
-# updatedAt={{updatedAt}}
-backend {{domain}}
- option forwardfor
- {{#isHttps}}
- http-request add-header X-Forwarded-Proto https
- {{/isHttps}}
- {{^isHttps}}
- http-request add-header X-Forwarded-Proto http
- {{/isHttps}}
- http-request add-header X-Forwarded-Host %[req.hdr(host),lower]
- server {{id}} {{id}}:{{port}}
- compression algo gzip
- compression type text/html text/css text/plain text/xml text/x-component text/javascript application/x-javascript application/javascript application/json application/manifest+json application/vnd.api+json application/xml application/xhtml+xml application/rss+xml application/atom+xml application/vnd.ms-fontobject application/x-font-ttf application/x-font-opentype application/x-font-truetype image/svg+xml image/x-icon image/vnd.microsoft.icon font/ttf font/eot font/otf font/opentype
-{{/isRunning}}
-{{/services}}
-
-{{#coolify}}
-backend {{domain}}
- option forwardfor
- option httpchk GET /undead.json
- {{#isHttps}}
- http-request add-header X-Forwarded-Proto https
- {{/isHttps}}
- {{^isHttps}}
- http-request add-header X-Forwarded-Proto http
- {{/isHttps}}
- http-request add-header X-Forwarded-Host %[req.hdr(host),lower]
- server {{id}} {{id}}:{{port}} check fall 10
- compression algo gzip
- compression type text/html text/css text/plain text/xml text/x-component text/javascript application/x-javascript application/javascript application/json application/manifest+json application/vnd.api+json application/xml application/xhtml+xml application/rss+xml application/atom+xml application/vnd.ms-fontobject application/x-font-ttf application/x-font-opentype application/x-font-truetype image/svg+xml image/x-icon image/vnd.microsoft.icon font/ttf font/eot font/otf font/opentype
-{{/coolify}}
-`;
-
-export async function haproxyInstance(): Promise<Got> {
- const { proxyPassword } = await db.listSettings();
- return got.extend({
- prefixUrl: url,
- username: 'admin',
- password: proxyPassword
- });
-}
-
-export async function configureHAProxy(): Promise<void> {
- const haproxy = await haproxyInstance();
- await checkHAProxy(haproxy);
-
- const data = {
- applications: [],
- services: [],
- coolify: []
- };
- const applications = await db.prisma.application.findMany({
- include: { destinationDocker: true, settings: true }
- });
- for (const application of applications) {
- const {
- fqdn,
- id,
- port,
- destinationDocker,
- destinationDockerId,
- settings: { previews },
- updatedAt
- } = application;
- if (destinationDockerId) {
- const { engine, network } = destinationDocker;
- const isRunning = await checkContainer(engine, id);
- if (fqdn) {
- const domain = getDomain(fqdn);
- const isHttps = fqdn.startsWith('https://');
- const isWWW = fqdn.includes('www.');
- const redirectValue = `${isHttps ? 'https://' : 'http://'}${domain}%[capture.req.uri]`;
- if (isRunning) {
- data.applications.push({
- id,
- port: port || 3000,
- domain,
- isRunning,
- isHttps,
- redirectValue,
- redirectTo: isWWW ? domain.replace('www.', '') : 'www.' + domain,
- updatedAt: updatedAt.getTime()
- });
- }
- if (previews) {
- const host = getEngine(engine);
- const { stdout } = await asyncExecShell(
- `DOCKER_HOST=${host} docker container ls --filter="status=running" --filter="network=${network}" --filter="name=${id}-" --format="{{json .Names}}"`
- );
- const containers = stdout
- .trim()
- .split('\n')
- .filter((a) => a)
- .map((c) => c.replace(/"/g, ''));
- if (containers.length > 0) {
- for (const container of containers) {
- const previewDomain = `${container.split('-')[1]}.${domain}`;
- data.applications.push({
- id: container,
- port: port || 3000,
- domain: previewDomain,
- isRunning,
- isHttps,
- redirectValue,
- redirectTo: isWWW ? previewDomain.replace('www.', '') : 'www.' + previewDomain,
- updatedAt: updatedAt.getTime()
- });
- }
- }
- }
- }
- }
- }
- const services = await listServicesWithIncludes();
-
- for (const service of services) {
- const {
- fqdn,
- id,
- type,
- destinationDocker,
- destinationDockerId,
- updatedAt,
- plausibleAnalytics
- } = service;
- if (destinationDockerId) {
- const { engine } = destinationDocker;
- const found = supportedServiceTypesAndVersions.find((a) => a.name === type);
- if (found) {
- const port = found.ports.main;
- const publicPort = service[type]?.publicPort;
- const isRunning = await checkContainer(engine, id);
- if (fqdn) {
- const domain = getDomain(fqdn);
- const isHttps = fqdn.startsWith('https://');
- const isWWW = fqdn.includes('www.');
- const redirectValue = `${isHttps ? 'https://' : 'http://'}${domain}%[capture.req.uri]`;
- if (isRunning) {
- // Plausible Analytics custom script
- let scriptName = false;
- if (type === 'plausibleanalytics' && plausibleAnalytics.scriptName !== 'plausible.js') {
- scriptName = plausibleAnalytics.scriptName;
- }
-
- data.services.push({
- id,
- port,
- publicPort,
- domain,
- isRunning,
- isHttps,
- redirectValue,
- redirectTo: isWWW ? domain.replace('www.', '') : 'www.' + domain,
- updatedAt: updatedAt.getTime(),
- scriptName
- });
- }
- }
- }
- }
- }
- const { fqdn } = await db.prisma.setting.findFirst();
- if (fqdn) {
- const domain = getDomain(fqdn);
- const isHttps = fqdn.startsWith('https://');
- const isWWW = fqdn.includes('www.');
- const redirectValue = `${isHttps ? 'https://' : 'http://'}${domain}%[capture.req.uri]`;
- data.coolify.push({
- id: dev ? 'host.docker.internal' : 'coolify',
- port: 3000,
- domain,
- isHttps,
- redirectValue,
- redirectTo: isWWW ? domain.replace('www.', '') : 'www.' + domain
- });
- }
- const output = mustache.render(template, data);
- const newHash = crypto.createHash('md5').update(output).digest('hex');
- const { proxyHash, id } = await db.listSettings();
- if (proxyHash !== newHash) {
- await db.prisma.setting.update({ where: { id }, data: { proxyHash: newHash } });
- await haproxy.post(`v2/services/haproxy/configuration/raw`, {
- searchParams: {
- skip_version: true
- },
- body: output,
- headers: {
- 'Content-Type': 'text/plain'
- }
- });
- }
-}
diff --git a/src/lib/haproxy/index.ts b/src/lib/haproxy/index.ts
deleted file mode 100644
index 362783b730..0000000000
--- a/src/lib/haproxy/index.ts
+++ /dev/null
@@ -1,520 +0,0 @@
-import { dev } from '$app/env';
-import { asyncExecShell, getEngine } from '$lib/common';
-import got, { type Got, type Response } from 'got';
-import * as db from '$lib/database';
-import type { DestinationDocker } from '@prisma/client';
-import fs from 'fs/promises';
-import yaml from 'js-yaml';
-const url = dev ? 'http://localhost:5555' : 'http://coolify-haproxy:5555';
-
-export const defaultProxyImage = `coolify-haproxy-alpine:latest`;
-export const defaultProxyImageTcp = `coolify-haproxy-tcp-alpine:latest`;
-export const defaultProxyImageHttp = `coolify-haproxy-http-alpine:latest`;
-export const defaultTraefikImage = `traefik:v2.6`;
-
-const mainTraefikEndpoint = dev
- ? 'http://host.docker.internal:3000/webhooks/traefik/main.json'
- : 'http://coolify:3000/webhooks/traefik/main.json';
-
-const otherTraefikEndpoint = dev
- ? 'http://host.docker.internal:3000/webhooks/traefik/other.json'
- : 'http://coolify:3000/webhooks/traefik/other.json';
-
-export async function haproxyInstance(): Promise<Got> {
- const { proxyPassword } = await db.listSettings();
- return got.extend({
- prefixUrl: url,
- username: 'admin',
- password: proxyPassword
- });
-}
-
-export async function getRawConfiguration(): Promise<RawHaproxyConfiguration> {
- return await (await haproxyInstance()).get(`v2/services/haproxy/configuration/raw`).json();
-}
-
-export async function getNextTransactionVersion(): Promise<number> {
- const raw = await getRawConfiguration();
- if (raw?._version) {
- return raw._version;
- }
- return 1;
-}
-
-export async function getNextTransactionId(): Promise<string> {
- const version = await getNextTransactionVersion();
- const newTransaction: NewTransaction = await (
- await haproxyInstance()
- )
- .post('v2/services/haproxy/transactions', {
- searchParams: {
- version
- }
- })
- .json();
- return newTransaction.id;
-}
-
-export async function completeTransaction(transactionId: string): Promise<Response<string>> {
- const haproxy = await haproxyInstance();
- return await haproxy.put(`v2/services/haproxy/transactions/${transactionId}`);
-}
-
-export async function deleteProxy({ id }: { id: string }): Promise<void> {
- const haproxy = await haproxyInstance();
- await checkHAProxy(haproxy);
-
- let transactionId;
- try {
- await haproxy.get(`v2/services/haproxy/configuration/backends/${id}`).json();
- transactionId = await getNextTransactionId();
- await haproxy
- .delete(`v2/services/haproxy/configuration/backends/${id}`, {
- searchParams: {
- transaction_id: transactionId
- }
- })
- .json();
- await haproxy.get(`v2/services/haproxy/configuration/frontends/${id}`).json();
- await haproxy
- .delete(`v2/services/haproxy/configuration/frontends/${id}`, {
- searchParams: {
- transaction_id: transactionId
- }
- })
- .json();
- } catch (error) {
- console.log(error.response?.body || error);
- } finally {
- if (transactionId) await completeTransaction(transactionId);
- }
-}
-
-export async function reloadHaproxy(engine: string): Promise<{ stdout: string; stderr: string }> {
- const host = getEngine(engine);
- return await asyncExecShell(`DOCKER_HOST=${host} docker exec coolify-haproxy kill -HUP 1`);
-}
-
-export async function checkHAProxy(haproxy?: Got): Promise<void> {
- if (!haproxy) haproxy = await haproxyInstance();
- try {
- await haproxy.get('v2/info');
- } catch (error) {
- throw {
- message:
- 'Coolify Proxy is not running, but it should be!<br><br>Start it in the "Destinations" menu.'
- };
- }
-}
-
-export async function stopTcpHttpProxy(
- id: string,
- destinationDocker: DestinationDocker,
- publicPort: number,
- forceName: string = null
-): Promise<{ stdout: string; stderr: string } | Error> {
- const { engine } = destinationDocker;
- const host = getEngine(engine);
- const settings = await db.listSettings();
- let containerName = `${id}-${publicPort}`;
- if (!settings.isTraefikUsed) {
- containerName = `haproxy-for-${publicPort}`;
- }
- if (forceName) containerName = forceName;
- const found = await checkContainer(engine, containerName);
-
- try {
- if (found) {
- return await asyncExecShell(
- `DOCKER_HOST=${host} docker stop -t 0 ${containerName} && docker rm ${containerName}`
- );
- }
- } catch (error) {
- return error;
- }
-}
-export async function startTraefikTCPProxy(
- destinationDocker: DestinationDocker,
- id: string,
- publicPort: number,
- privatePort: number,
- type?: string
-): Promise<{ stdout: string; stderr: string } | Error> {
- const { network, engine } = destinationDocker;
- const host = getEngine(engine);
- const containerName = `${id}-${publicPort}`;
- const found = await checkContainer(engine, containerName, true);
- let dependentId = id;
- if (type === 'wordpressftp') dependentId = `${id}-ftp`;
- const foundDependentContainer = await checkContainer(engine, dependentId, true);
- try {
- if (foundDependentContainer && !found) {
- const { stdout: Config } = await asyncExecShell(
- `DOCKER_HOST="${host}" docker network inspect bridge --format '{{json .IPAM.Config }}'`
- );
- const ip = JSON.parse(Config)[0].Gateway;
- const tcpProxy = {
- version: '3.5',
- services: {
- [`${id}-${publicPort}`]: {
- container_name: containerName,
- image: 'traefik:v2.6',
- command: [
- `--entrypoints.tcp.address=:${publicPort}`,
- `--entryPoints.tcp.forwardedHeaders.insecure=true`,
- `--providers.http.endpoint=${otherTraefikEndpoint}?id=${id}&privatePort=${privatePort}&publicPort=${publicPort}&type=tcp&address=${dependentId}`,
- '--providers.http.pollTimeout=2s',
- '--log.level=error'
- ],
- ports: [`${publicPort}:${publicPort}`],
- extra_hosts: ['host.docker.internal:host-gateway', `host.docker.internal:${ip}`],
- volumes: ['/var/run/docker.sock:/var/run/docker.sock'],
- networks: ['coolify-infra', network]
- }
- },
- networks: {
- [network]: {
- external: false,
- name: network
- },
- 'coolify-infra': {
- external: false,
- name: 'coolify-infra'
- }
- }
- };
- await fs.writeFile(`/tmp/docker-compose-${id}.yaml`, yaml.dump(tcpProxy));
- await asyncExecShell(
- `DOCKER_HOST=${host} docker compose -f /tmp/docker-compose-${id}.yaml up -d`
- );
- await fs.rm(`/tmp/docker-compose-${id}.yaml`);
- }
- if (!foundDependentContainer && found) {
- return await asyncExecShell(
- `DOCKER_HOST=${host} docker stop -t 0 ${containerName} && docker rm ${containerName}`
- );
- }
- } catch (error) {
- console.log(error);
- return error;
- }
-}
-export async function startTcpProxy(
- destinationDocker: DestinationDocker,
- id: string,
- publicPort: number,
- privatePort: number
-): Promise<{ stdout: string; stderr: string } | Error> {
- const { network, engine } = destinationDocker;
- const host = getEngine(engine);
-
- const containerName = `haproxy-for-${publicPort}`;
- const found = await checkContainer(engine, containerName, true);
- const foundDependentContainer = await checkContainer(engine, id, true);
- try {
- if (foundDependentContainer && !found) {
- const { stdout: Config } = await asyncExecShell(
- `DOCKER_HOST="${host}" docker network inspect bridge --format '{{json .IPAM.Config }}'`
- );
- const ip = JSON.parse(Config)[0].Gateway;
- return await asyncExecShell(
- `DOCKER_HOST=${host} docker run --restart always -e PORT=${publicPort} -e APP=${id} -e PRIVATE_PORT=${privatePort} --add-host 'host.docker.internal:host-gateway' --add-host 'host.docker.internal:${ip}' --network ${network} -p ${publicPort}:${publicPort} --name ${containerName} -d coollabsio/${defaultProxyImageTcp}`
- );
- }
- if (!foundDependentContainer && found) {
- return await asyncExecShell(
- `DOCKER_HOST=${host} docker stop -t 0 ${containerName} && docker rm ${containerName}`
- );
- }
- } catch (error) {
- return error;
- }
-}
-
-export async function startTraefikHTTPProxy(
- destinationDocker: DestinationDocker,
- id: string,
- publicPort: number,
- privatePort: number
-): Promise<{ stdout: string; stderr: string } | Error> {
- const { network, engine } = destinationDocker;
- const host = getEngine(engine);
-
- const containerName = `${id}-${publicPort}`;
- const found = await checkContainer(engine, containerName, true);
- const foundDependentContainer = await checkContainer(engine, id, true);
-
- try {
- if (foundDependentContainer && !found) {
- const { stdout: Config } = await asyncExecShell(
- `DOCKER_HOST="${host}" docker network inspect bridge --format '{{json .IPAM.Config }}'`
- );
- const ip = JSON.parse(Config)[0].Gateway;
- const tcpProxy = {
- version: '3.5',
- services: {
- [`${id}-${publicPort}`]: {
- container_name: containerName,
- image: 'traefik:v2.6',
- command: [
- `--entrypoints.http.address=:${publicPort}`,
- `--entryPoints.http.forwardedHeaders.insecure=true`,
- `--providers.http.endpoint=${otherTraefikEndpoint}?id=${id}&privatePort=${privatePort}&publicPort=${publicPort}&type=http`,
- '--providers.http.pollTimeout=2s',
- '--certificatesresolvers.letsencrypt.acme.httpchallenge=true',
- '--certificatesresolvers.letsencrypt.acme.storage=/etc/traefik/acme/acme.json',
- '--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http',
- '--log.level=error'
- ],
- ports: [`${publicPort}:${publicPort}`],
- extra_hosts: ['host.docker.internal:host-gateway', `host.docker.internal:${ip}`],
- networks: ['coolify-infra', network],
- volumes: ['coolify-traefik-letsencrypt:/etc/traefik/acme']
- }
- },
- networks: {
- [network]: {
- external: false,
- name: network
- },
- 'coolify-infra': {
- external: false,
- name: 'coolify-infra'
- }
- },
- volumes: {
- 'coolify-traefik-letsencrypt': {}
- }
- };
- await fs.writeFile(`/tmp/docker-compose-${id}.yaml`, yaml.dump(tcpProxy));
- await asyncExecShell(
- `DOCKER_HOST=${host} docker compose -f /tmp/docker-compose-${id}.yaml up -d`
- );
- await fs.rm(`/tmp/docker-compose-${id}.yaml`);
- }
- if (!foundDependentContainer && found) {
- return await asyncExecShell(
- `DOCKER_HOST=${host} docker stop -t 0 ${containerName} && docker rm ${containerName}`
- );
- }
- } catch (error) {
- return error;
- }
-}
-export async function startHttpProxy(
- destinationDocker: DestinationDocker,
- id: string,
- publicPort: number,
- privatePort: number
-): Promise<{ stdout: string; stderr: string } | Error> {
- const { network, engine } = destinationDocker;
- const host = getEngine(engine);
-
- const containerName = `haproxy-for-${publicPort}`;
- const found = await checkContainer(engine, containerName, true);
- const foundDependentContainer = await checkContainer(engine, id, true);
-
- try {
- if (foundDependentContainer && !found) {
- const { stdout: Config } = await asyncExecShell(
- `DOCKER_HOST="${host}" docker network inspect bridge --format '{{json .IPAM.Config }}'`
- );
- const ip = JSON.parse(Config)[0].Gateway;
- return await asyncExecShell(
- `DOCKER_HOST=${host} docker run --restart always -e PORT=${publicPort} -e APP=${id} -e PRIVATE_PORT=${privatePort} --add-host 'host.docker.internal:host-gateway' --add-host 'host.docker.internal:${ip}' --network ${network} -p ${publicPort}:${publicPort} --name ${containerName} -d coollabsio/${defaultProxyImageHttp}`
- );
- }
- if (!foundDependentContainer && found) {
- return await asyncExecShell(
- `DOCKER_HOST=${host} docker stop -t 0 ${containerName} && docker rm ${containerName}`
- );
- }
- } catch (error) {
- return error;
- }
-}
-
-export async function startCoolifyProxy(engine: string): Promise<void> {
- const host = getEngine(engine);
- const found = await checkContainer(engine, 'coolify-haproxy', true);
- const { proxyPassword, proxyUser, id } = await db.listSettings();
- if (!found) {
- const { stdout: Config } = await asyncExecShell(
- `DOCKER_HOST="${host}" docker network inspect bridge --format '{{json .IPAM.Config }}'`
- );
- const ip = JSON.parse(Config)[0].Gateway;
- await asyncExecShell(
- `DOCKER_HOST="${host}" docker run -e HAPROXY_USERNAME=${proxyUser} -e HAPROXY_PASSWORD=${proxyPassword} --restart always --add-host 'host.docker.internal:host-gateway' --add-host 'host.docker.internal:${ip}' -v coolify-ssl-certs:/usr/local/etc/haproxy/ssl --network coolify-infra -p "80:80" -p "443:443" -p "8404:8404" -p "5555:5555" -p "5000:5000" --name coolify-haproxy -d coollabsio/${defaultProxyImage}`
- );
- await db.prisma.setting.update({ where: { id }, data: { proxyHash: null } });
- await db.setDestinationSettings({ engine, isCoolifyProxyUsed: true });
- }
- await configureNetworkCoolifyProxy(engine);
-}
-
-export async function startTraefikProxy(engine: string): Promise<void> {
- const host = getEngine(engine);
- const found = await checkContainer(engine, 'coolify-proxy', true);
- const { id, proxyPassword, proxyUser } = await db.listSettings();
- if (!found) {
- const { stdout: Config } = await asyncExecShell(
- `DOCKER_HOST="${host}" docker network inspect bridge --format '{{json .IPAM.Config }}'`
- );
- const ip = JSON.parse(Config)[0].Gateway;
- await asyncExecShell(
- `DOCKER_HOST="${host}" docker run --restart always \
- --add-host 'host.docker.internal:host-gateway' \
- --add-host 'host.docker.internal:${ip}' \
- -v coolify-traefik-letsencrypt:/etc/traefik/acme \
- -v /var/run/docker.sock:/var/run/docker.sock \
- --network coolify-infra \
- -p "80:80" \
- -p "443:443" \
- --name coolify-proxy \
- -d ${defaultTraefikImage} \
- --entrypoints.web.address=:80 \
- --entrypoints.web.forwardedHeaders.insecure=true \
- --entrypoints.websecure.address=:443 \
- --entrypoints.websecure.forwardedHeaders.insecure=true \
- --providers.docker=true \
- --providers.docker.exposedbydefault=false \
- --providers.http.endpoint=${mainTraefikEndpoint} \
- --providers.http.pollTimeout=5s \
- --certificatesresolvers.letsencrypt.acme.httpchallenge=true \
- --certificatesresolvers.letsencrypt.acme.storage=/etc/traefik/acme/acme.json \
- --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web \
- --log.level=error`
- );
- await db.prisma.setting.update({ where: { id }, data: { proxyHash: null } });
- await db.setDestinationSettings({ engine, isCoolifyProxyUsed: true });
- }
- await configureNetworkTraefikProxy(engine);
-}
-
-export async function isContainerExited(engine: string, containerName: string): Promise<boolean> {
- let isExited = false;
- const host = getEngine(engine);
- try {
- const { stdout } = await asyncExecShell(
- `DOCKER_HOST="${host}" docker inspect -f '{{.State.Status}}' ${containerName}`
- );
- if (stdout.trim() === 'exited') {
- isExited = true;
- }
- } catch (error) {}
-
- return isExited;
-}
-export async function checkContainer(
- engine: string,
- container: string,
- remove: boolean = false
-): Promise<boolean> {
- const host = getEngine(engine);
- let containerFound = false;
-
- try {
- const { stdout } = await asyncExecShell(
- `DOCKER_HOST="${host}" docker inspect --format '{{json .State}}' ${container}`
- );
- const parsedStdout = JSON.parse(stdout);
- const status = parsedStdout.Status;
- const isRunning = status === 'running';
- if (status === 'created') {
- await asyncExecShell(`DOCKER_HOST="${host}" docker rm ${container}`);
- }
- if (remove && status === 'exited') {
- await asyncExecShell(`DOCKER_HOST="${host}" docker rm ${container}`);
- }
- if (isRunning) {
- containerFound = true;
- }
- } catch (err) {
- // Container not found
- }
- return containerFound;
-}
-
-export async function getContainerUsage(engine: string, container: string): Promise<any> {
- const host = getEngine(engine);
- try {
- const { stdout } = await asyncExecShell(
- `DOCKER_HOST="${host}" docker container stats ${container} --no-stream --no-trunc --format "{{json .}}"`
- );
- return JSON.parse(stdout);
- } catch (err) {
- return {
- MemUsage: 0,
- CPUPerc: 0,
- NetIO: 0
- };
- }
-}
-export async function stopCoolifyProxy(
- engine: string
-): Promise<{ stdout: string; stderr: string } | Error> {
- const host = getEngine(engine);
- const found = await checkContainer(engine, 'coolify-haproxy');
- await db.setDestinationSettings({ engine, isCoolifyProxyUsed: false });
- const { id } = await db.prisma.setting.findFirst({});
- await db.prisma.setting.update({ where: { id }, data: { proxyHash: null } });
- try {
- if (found) {
- await asyncExecShell(
- `DOCKER_HOST="${host}" docker stop -t 0 coolify-haproxy && docker rm coolify-haproxy`
- );
- }
- } catch (error) {
- return error;
- }
-}
-export async function stopTraefikProxy(
- engine: string
-): Promise<{ stdout: string; stderr: string } | Error> {
- const host = getEngine(engine);
- const found = await checkContainer(engine, 'coolify-proxy');
- await db.setDestinationSettings({ engine, isCoolifyProxyUsed: false });
- const { id } = await db.prisma.setting.findFirst({});
- await db.prisma.setting.update({ where: { id }, data: { proxyHash: null } });
- try {
- if (found) {
- await asyncExecShell(
- `DOCKER_HOST="${host}" docker stop -t 0 coolify-proxy && docker rm coolify-proxy`
- );
- }
- } catch (error) {
- return error;
- }
-}
-
-export async function configureNetworkCoolifyProxy(engine: string): Promise<void> {
- const host = getEngine(engine);
- const destinations = await db.prisma.destinationDocker.findMany({ where: { engine } });
- const { stdout: networks } = await asyncExecShell(
- `DOCKER_HOST="${host}" docker ps -a --filter name=coolify-haproxy --format '{{json .Networks}}'`
- );
- const configuredNetworks = networks.replace(/"/g, '').replace('\n', '').split(',');
- for (const destination of destinations) {
- if (!configuredNetworks.includes(destination.network)) {
- await asyncExecShell(
- `DOCKER_HOST="${host}" docker network connect ${destination.network} coolify-haproxy`
- );
- }
- }
-}
-
-export async function configureNetworkTraefikProxy(engine: string): Promise<void> {
- const host = getEngine(engine);
- const destinations = await db.prisma.destinationDocker.findMany({ where: { engine } });
- const { stdout: networks } = await asyncExecShell(
- `DOCKER_HOST="${host}" docker ps -a --filter name=coolify-proxy --format '{{json .Networks}}'`
- );
- const configuredNetworks = networks.replace(/"/g, '').replace('\n', '').split(',');
- for (const destination of destinations) {
- if (!configuredNetworks.includes(destination.network)) {
- await asyncExecShell(
- `DOCKER_HOST="${host}" docker network connect ${destination.network} coolify-proxy`
- );
- }
- }
-}
diff --git a/src/lib/letsencrypt/index.ts b/src/lib/letsencrypt/index.ts
deleted file mode 100644
index 0f2a2b1d6d..0000000000
--- a/src/lib/letsencrypt/index.ts
+++ /dev/null
@@ -1,319 +0,0 @@
-import { asyncExecShell, getDomain, getEngine } from '$lib/common';
-import { checkContainer, reloadHaproxy } from '$lib/haproxy';
-import * as db from '$lib/database';
-import { dev } from '$app/env';
-import cuid from 'cuid';
-import fs from 'fs/promises';
-import getPort, { portNumbers } from 'get-port';
-import { supportedServiceTypesAndVersions } from '$lib/components/common';
-import { promises as dns } from 'dns';
-import { listServicesWithIncludes } from '$lib/database';
-
-export async function letsEncrypt(domain: string, id?: string, isCoolify = false): Promise<void> {
- try {
- const certbotImage =
- process.arch === 'x64' ? 'certbot/certbot' : 'certbot/certbot:arm64v8-latest';
-
- const data = await db.prisma.setting.findFirst();
- const { minPort, maxPort } = data;
-
- const nakedDomain = domain.replace('www.', '');
- const wwwDomain = `www.${nakedDomain}`;
- const randomCuid = cuid();
- const randomPort = await getPort({ port: portNumbers(minPort, maxPort) });
-
- let host;
- let dualCerts = false;
- if (isCoolify) {
- dualCerts = data.dualCerts;
- host = 'unix:///var/run/docker.sock';
- } else {
- const applicationData = await db.prisma.application.findUnique({
- where: { id },
- include: { destinationDocker: true, settings: true }
- });
- if (applicationData) {
- if (applicationData?.destinationDockerId && applicationData?.destinationDocker) {
- host = getEngine(applicationData.destinationDocker.engine);
- }
- if (applicationData?.settings?.dualCerts) {
- dualCerts = applicationData.settings.dualCerts;
- }
- }
- // Check Service
- const serviceData = await db.prisma.service.findUnique({
- where: { id },
- include: { destinationDocker: true }
- });
- if (serviceData) {
- if (serviceData?.destinationDockerId && serviceData?.destinationDocker) {
- host = getEngine(serviceData.destinationDocker.engine);
- }
- if (serviceData?.dualCerts) {
- dualCerts = serviceData.dualCerts;
- }
- }
- }
- if (dualCerts) {
- let found = false;
- try {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker run --rm -v "coolify-letsencrypt:/etc/letsencrypt" -v "coolify-ssl-certs:/app/ssl" alpine:latest sh -c "ls -1 /app/ssl/${wwwDomain}.pem"`
- );
- found = true;
- } catch (error) {
- //
- }
- if (found) return;
-
- await asyncExecShell(
- `DOCKER_HOST=${host} docker run --rm --name certbot-${randomCuid} -p 9080:${randomPort} -v "coolify-letsencrypt:/etc/letsencrypt" ${certbotImage} --logs-dir /etc/letsencrypt/logs certonly --standalone --preferred-challenges http --http-01-address 0.0.0.0 --http-01-port ${randomPort} -d ${nakedDomain} -d ${wwwDomain} --expand --agree-tos --non-interactive --register-unsafely-without-email ${
- dev ? '--test-cert' : ''
- }`
- );
- await asyncExecShell(
- `DOCKER_HOST=${host} docker run --rm -v "coolify-letsencrypt:/etc/letsencrypt" -v "coolify-ssl-certs:/app/ssl" alpine:latest sh -c "test -d /etc/letsencrypt/live/${nakedDomain}/ && cat /etc/letsencrypt/live/${nakedDomain}/fullchain.pem /etc/letsencrypt/live/${nakedDomain}/privkey.pem > /app/ssl/${nakedDomain}.pem || cat /etc/letsencrypt/live/${wwwDomain}/fullchain.pem /etc/letsencrypt/live/${wwwDomain}/privkey.pem > /app/ssl/${wwwDomain}.pem"`
- );
- await reloadHaproxy(host);
- } else {
- let found = false;
- try {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker run --rm -v "coolify-letsencrypt:/etc/letsencrypt" -v "coolify-ssl-certs:/app/ssl" alpine:latest sh -c "ls -1 /app/ssl/${domain}.pem"`
- );
- found = true;
- } catch (error) {
- //
- }
- if (found) return;
- await asyncExecShell(
- `DOCKER_HOST=${host} docker run --rm --name certbot-${randomCuid} -p 9080:${randomPort} -v "coolify-letsencrypt:/etc/letsencrypt" ${certbotImage} --logs-dir /etc/letsencrypt/logs certonly --standalone --preferred-challenges http --http-01-address 0.0.0.0 --http-01-port ${randomPort} -d ${domain} --expand --agree-tos --non-interactive --register-unsafely-without-email ${
- dev ? '--test-cert' : ''
- }`
- );
- await asyncExecShell(
- `DOCKER_HOST=${host} docker run --rm -v "coolify-letsencrypt:/etc/letsencrypt" -v "coolify-ssl-certs:/app/ssl" alpine:latest sh -c "cat /etc/letsencrypt/live/${domain}/fullchain.pem /etc/letsencrypt/live/${domain}/privkey.pem > /app/ssl/${domain}.pem"`
- );
- await reloadHaproxy(host);
- }
- } catch (error) {
- if (error.code !== 0) {
- throw error;
- }
- }
-}
-
-export async function generateSSLCerts(): Promise<void> {
- const ssls = [];
- const applications = await db.prisma.application.findMany({
- include: { destinationDocker: true, settings: true },
- orderBy: { createdAt: 'desc' }
- });
- const { fqdn, isDNSCheckEnabled } = await db.prisma.setting.findFirst();
- for (const application of applications) {
- try {
- if (application.fqdn && application.destinationDockerId) {
- const {
- fqdn,
- id,
- destinationDocker: { engine, network },
- settings: { previews }
- } = application;
- const isRunning = await checkContainer(engine, id);
- const domain = getDomain(fqdn);
- const isHttps = fqdn.startsWith('https://');
- if (isRunning) {
- if (isHttps) ssls.push({ domain, id, isCoolify: false });
- }
- if (previews) {
- const host = getEngine(engine);
- const { stdout } = await asyncExecShell(
- `DOCKER_HOST=${host} docker container ls --filter="status=running" --filter="network=${network}" --filter="name=${id}-" --format="{{json .Names}}"`
- );
- const containers = stdout
- .trim()
- .split('\n')
- .filter((a) => a)
- .map((c) => c.replace(/"/g, ''));
- if (containers.length > 0) {
- for (const container of containers) {
- const previewDomain = `${container.split('-')[1]}.${domain}`;
- if (isHttps) ssls.push({ domain: previewDomain, id, isCoolify: false });
- }
- }
- }
- }
- } catch (error) {
- console.log(`Error during generateSSLCerts with ${application.fqdn}: ${error}`);
- }
- }
- const services = await listServicesWithIncludes();
- for (const service of services) {
- try {
- if (service.fqdn && service.destinationDockerId) {
- const {
- fqdn,
- id,
- type,
- destinationDocker: { engine }
- } = service;
- const found = supportedServiceTypesAndVersions.find((a) => a.name === type);
- if (found) {
- const domain = getDomain(fqdn);
- const isHttps = fqdn.startsWith('https://');
- const isRunning = await checkContainer(engine, id);
- if (isRunning) {
- if (isHttps) ssls.push({ domain, id, isCoolify: false });
- }
- }
- }
- } catch (error) {
- console.log(`Error during generateSSLCerts with ${service.fqdn}: ${error}`);
- }
- }
- if (fqdn) {
- const domain = getDomain(fqdn);
- const isHttps = fqdn.startsWith('https://');
- if (isHttps) ssls.push({ domain, id: 'coolify', isCoolify: true });
- }
- if (ssls.length > 0) {
- const sslDir = dev ? '/tmp/ssl' : '/app/ssl';
- if (dev) {
- try {
- await asyncExecShell(`mkdir -p ${sslDir}`);
- } catch (error) {
- //
- }
- }
- const files = await fs.readdir(sslDir);
- let certificates = [];
- if (files.length > 0) {
- for (const file of files) {
- file.endsWith('.pem') && certificates.push(file.replace(/\.pem$/, ''));
- }
- }
- if (isDNSCheckEnabled) {
- const resolver = new dns.Resolver({ timeout: 2000 });
- resolver.setServers(['8.8.8.8', '1.1.1.1']);
- let ipv4, ipv6;
- try {
- ipv4 = await (await asyncExecShell(`curl -4s https://ifconfig.io`)).stdout;
- } catch (error) {}
- try {
- ipv6 = await (await asyncExecShell(`curl -6s https://ifconfig.io`)).stdout;
- } catch (error) {}
- for (const ssl of ssls) {
- if (!dev) {
- if (
- certificates.includes(ssl.domain) ||
- certificates.includes(ssl.domain.replace('www.', ''))
- ) {
- // console.log(`Certificate for ${ssl.domain} already exists`);
- } else {
- // Checking DNS entry before generating certificate
- if (ipv4 || ipv6) {
- let domains4 = [];
- let domains6 = [];
- try {
- domains4 = await resolver.resolve4(ssl.domain);
- } catch (error) {}
- try {
- domains6 = await resolver.resolve6(ssl.domain);
- } catch (error) {}
- if (domains4.length > 0 || domains6.length > 0) {
- if (
- (ipv4 && domains4.includes(ipv4.replace('\n', ''))) ||
- (ipv6 && domains6.includes(ipv6.replace('\n', '')))
- ) {
- console.log('Generating SSL for', ssl.domain);
- return await letsEncrypt(ssl.domain, ssl.id, ssl.isCoolify);
- }
- }
- }
- console.log('DNS settings is incorrect for', ssl.domain, 'skipping.');
- }
- } else {
- if (
- certificates.includes(ssl.domain) ||
- certificates.includes(ssl.domain.replace('www.', ''))
- ) {
- console.log(`Certificate for ${ssl.domain} already exists`);
- } else {
- // Checking DNS entry before generating certificate
- if (ipv4 || ipv6) {
- let domains4 = [];
- let domains6 = [];
- try {
- domains4 = await resolver.resolve4(ssl.domain);
- } catch (error) {}
- try {
- domains6 = await resolver.resolve6(ssl.domain);
- } catch (error) {}
- if (domains4.length > 0 || domains6.length > 0) {
- if (
- (ipv4 && domains4.includes(ipv4.replace('\n', ''))) ||
- (ipv6 && domains6.includes(ipv6.replace('\n', '')))
- ) {
- console.log('Generating SSL for', ssl.domain);
- return;
- }
- }
- }
- console.log('DNS settings is incorrect for', ssl.domain, 'skipping.');
- }
- }
- }
- } else {
- if (!dev) {
- for (const ssl of ssls) {
- if (
- certificates.includes(ssl.domain) ||
- certificates.includes(ssl.domain.replace('www.', ''))
- ) {
- } else {
- console.log('Generating SSL for', ssl.domain);
- return await letsEncrypt(ssl.domain, ssl.id, ssl.isCoolify);
- }
- }
- } else {
- for (const ssl of ssls) {
- if (
- certificates.includes(ssl.domain) ||
- certificates.includes(ssl.domain.replace('www.', ''))
- ) {
- console.log(`Certificate for ${ssl.domain} already exists`);
- } else {
- console.log('Generating SSL for', ssl.domain);
- }
- }
- }
- }
- }
-}
-
-export async function renewSSLCerts(): Promise<void> {
- if (!dev) {
- const host = 'unix:///var/run/docker.sock';
- await asyncExecShell(`docker pull alpine:latest`);
- const certbotImage =
- process.arch === 'x64' ? 'certbot/certbot' : 'certbot/certbot:arm64v8-latest';
-
- const { stdout: certificates } = await asyncExecShell(
- `DOCKER_HOST=${host} docker run --rm -v "coolify-letsencrypt:/etc/letsencrypt" -v "coolify-ssl-certs:/app/ssl" alpine:latest sh -c "ls -1 /etc/letsencrypt/live/ | grep -v README"`
- );
-
- for (const certificate of certificates.trim().split('\n')) {
- try {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker run --rm --name certbot-renewal -p 9080:9080 -v "coolify-letsencrypt:/etc/letsencrypt" ${certbotImage} --cert-name ${certificate} --logs-dir /etc/letsencrypt/logs renew --standalone --preferred-challenges http --http-01-address 0.0.0.0 --http-01-port 9080`
- );
- await asyncExecShell(
- `DOCKER_HOST=${host} docker run --rm -v "coolify-letsencrypt:/etc/letsencrypt" -v "coolify-ssl-certs:/app/ssl" alpine:latest sh -c "test -d /etc/letsencrypt/live/${certificate}/ && cat /etc/letsencrypt/live/${certificate}/fullchain.pem /etc/letsencrypt/live/${certificate}/privkey.pem > /app/ssl/${certificate}.pem"`
- );
- } catch (error) {
- console.log(error);
- }
- }
- await reloadHaproxy('unix:///var/run/docker.sock');
- }
-}
diff --git a/src/lib/queues/autoUpdater.ts b/src/lib/queues/autoUpdater.ts
deleted file mode 100644
index 4bfb995c7b..0000000000
--- a/src/lib/queues/autoUpdater.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { prisma } from '$lib/database';
-import { buildQueue } from '.';
-import got from 'got';
-import { asyncExecShell, version } from '$lib/common';
-import compare from 'compare-versions';
-import { dev } from '$app/env';
-
-export default async function (): Promise<void> {
- try {
- const currentVersion = version;
- const { isAutoUpdateEnabled } = await prisma.setting.findFirst();
- if (isAutoUpdateEnabled) {
- const versions = await got
- .get(
- `https://get.coollabs.io/versions.json?appId=${process.env['COOLIFY_APP_ID']}&version=${currentVersion}`
- )
- .json();
- const latestVersion = versions['coolify'].main.version;
- const isUpdateAvailable = compare(latestVersion, currentVersion);
- if (isUpdateAvailable === 1) {
- const activeCount = await buildQueue.getActiveCount();
- if (activeCount === 0) {
- if (!dev) {
- await buildQueue.pause();
- console.log(`Updating Coolify to ${latestVersion}.`);
- await asyncExecShell(`docker pull coollabsio/coolify:${latestVersion}`);
- await asyncExecShell(`env | grep COOLIFY > .env`);
- await asyncExecShell(
- `docker run --rm -tid --env-file .env -v /var/run/docker.sock:/var/run/docker.sock -v coolify-db coollabsio/coolify:${latestVersion} /bin/sh -c "env | grep COOLIFY > .env && echo 'TAG=${latestVersion}' >> .env && docker stop -t 0 coolify coolify-redis && docker rm coolify coolify-redis && docker compose up -d --force-recreate"`
- );
- } else {
- await buildQueue.pause();
- console.log('Updating (not really in dev mode).');
- }
- }
- }
- }
- } catch (error) {
- await buildQueue.resume();
- console.log(error);
- }
-}
diff --git a/src/lib/queues/builder.ts b/src/lib/queues/builder.ts
deleted file mode 100644
index c69ffb6788..0000000000
--- a/src/lib/queues/builder.ts
+++ /dev/null
@@ -1,336 +0,0 @@
-import crypto from 'crypto';
-import fs from 'fs/promises';
-import * as buildpacks from '../buildPacks';
-import * as importers from '../importers';
-import { dockerInstance } from '../docker';
-import {
- asyncExecShell,
- asyncSleep,
- createDirectories,
- getDomain,
- getEngine,
- saveBuildLog
-} from '../common';
-import * as db from '$lib/database';
-import { decrypt } from '$lib/crypto';
-import { sentry } from '$lib/common';
-import {
- copyBaseConfigurationFiles,
- makeLabelForStandaloneApplication,
- setDefaultConfiguration
-} from '$lib/buildPacks/common';
-import yaml from 'js-yaml';
-import type { Job } from 'bullmq';
-import type { BuilderJob } from '$lib/types/builderJob';
-
-import type { ComposeFile } from '$lib/types/composeFile';
-
-export default async function (job: Job<BuilderJob, void, string>): Promise<void> {
- const {
- id: applicationId,
- repository,
- name,
- destinationDocker,
- destinationDockerId,
- gitSource,
- build_id: buildId,
- configHash,
- fqdn,
- projectId,
- secrets,
- phpModules,
- type,
- pullmergeRequestId = null,
- sourceBranch = null,
- settings,
- persistentStorage,
- pythonWSGI,
- pythonModule,
- pythonVariable,
- denoOptions,
- exposePort,
- baseImage,
- baseBuildImage
- } = job.data;
- let {
- branch,
- buildPack,
- port,
- installCommand,
- buildCommand,
- startCommand,
- baseDirectory,
- publishDirectory,
- dockerFileLocation,
- denoMainFile
- } = job.data;
- const { debug } = settings;
-
- await asyncSleep(500);
- await db.prisma.build.updateMany({
- where: {
- status: { in: ['queued', 'running'] },
- id: { not: buildId },
- applicationId,
- createdAt: { lt: new Date(new Date().getTime() - 60 * 60 * 1000) }
- },
- data: { status: 'failed' }
- });
- let imageId = applicationId;
- let domain = getDomain(fqdn);
- const volumes =
- persistentStorage?.map((storage) => {
- return `${applicationId}${storage.path.replace(/\//gi, '-')}:${
- buildPack !== 'docker' ? '/app' : ''
- }${storage.path}`;
- }) || [];
- // Previews, we need to get the source branch and set subdomain
- if (pullmergeRequestId) {
- branch = sourceBranch;
- domain = `${pullmergeRequestId}.${domain}`;
- imageId = `${applicationId}-${pullmergeRequestId}`;
- }
-
- let deployNeeded = true;
- let destinationType;
-
- if (destinationDockerId) {
- destinationType = 'docker';
- }
- if (destinationType === 'docker') {
- const docker = dockerInstance({ destinationDocker });
- const host = getEngine(destinationDocker.engine);
-
- await db.prisma.build.update({ where: { id: buildId }, data: { status: 'running' } });
- const { workdir, repodir } = await createDirectories({ repository, buildId });
-
- const configuration = await setDefaultConfiguration(job.data);
-
- buildPack = configuration.buildPack;
- port = configuration.port;
- installCommand = configuration.installCommand;
- startCommand = configuration.startCommand;
- buildCommand = configuration.buildCommand;
- publishDirectory = configuration.publishDirectory;
- baseDirectory = configuration.baseDirectory;
- dockerFileLocation = configuration.dockerFileLocation;
- denoMainFile = configuration.denoMainFile;
-
- const commit = await importers[gitSource.type]({
- applicationId,
- debug,
- workdir,
- repodir,
- githubAppId: gitSource.githubApp?.id,
- gitlabAppId: gitSource.gitlabApp?.id,
- repository,
- branch,
- buildId,
- apiUrl: gitSource.apiUrl,
- htmlUrl: gitSource.htmlUrl,
- projectId,
- deployKeyId: gitSource.gitlabApp?.deployKeyId || null,
- privateSshKey: decrypt(gitSource.gitlabApp?.privateSshKey) || null
- });
- if (!commit) {
- throw new Error('No commit found?');
- }
- let tag = commit.slice(0, 7);
- if (pullmergeRequestId) {
- tag = `${commit.slice(0, 7)}-${pullmergeRequestId}`;
- }
-
- try {
- await db.prisma.build.update({ where: { id: buildId }, data: { commit } });
- } catch (err) {
- console.log(err);
- }
-
- if (!pullmergeRequestId) {
- const currentHash = crypto
- .createHash('sha256')
- .update(
- JSON.stringify({
- buildPack,
- port,
- exposePort,
- installCommand,
- buildCommand,
- startCommand,
- secrets,
- branch,
- repository,
- fqdn
- })
- )
- .digest('hex');
-
- if (configHash !== currentHash) {
- await db.prisma.application.update({
- where: { id: applicationId },
- data: { configHash: currentHash }
- });
- deployNeeded = true;
- if (configHash) {
- await saveBuildLog({ line: 'Configuration changed.', buildId, applicationId });
- }
- } else {
- deployNeeded = false;
- }
- } else {
- deployNeeded = true;
- }
- const image = await docker.engine.getImage(`${applicationId}:${tag}`);
-
- let imageFound = false;
- try {
- await image.inspect();
- imageFound = false;
- } catch (error) {
- //
- }
- if (!imageFound || deployNeeded) {
- await copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId, baseImage);
- if (buildpacks[buildPack])
- await buildpacks[buildPack]({
- buildId,
- applicationId,
- domain,
- name,
- type,
- pullmergeRequestId,
- buildPack,
- repository,
- branch,
- projectId,
- publishDirectory,
- debug,
- commit,
- tag,
- workdir,
- docker,
- port: exposePort ? `${exposePort}:${port}` : port,
- installCommand,
- buildCommand,
- startCommand,
- baseDirectory,
- secrets,
- phpModules,
- pythonWSGI,
- pythonModule,
- pythonVariable,
- dockerFileLocation,
- denoMainFile,
- denoOptions,
- baseImage,
- baseBuildImage
- });
- else {
- await saveBuildLog({ line: `Build pack ${buildPack} not found`, buildId, applicationId });
- throw new Error(`Build pack ${buildPack} not found.`);
- }
- } else {
- await saveBuildLog({ line: 'Nothing changed.', buildId, applicationId });
- }
-
- // Deploy to Docker Engine
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker stop -t 0 ${imageId}`);
- await asyncExecShell(`DOCKER_HOST=${host} docker rm ${imageId}`);
- } catch (error) {
- //
- }
- const envs = [];
- if (secrets.length > 0) {
- secrets.forEach((secret) => {
- if (pullmergeRequestId) {
- if (secret.isPRMRSecret) {
- envs.push(`${secret.name}=${secret.value}`);
- }
- } else {
- if (!secret.isPRMRSecret) {
- envs.push(`${secret.name}=${secret.value}`);
- }
- }
- });
- }
- await fs.writeFile(`${workdir}/.env`, envs.join('\n'));
- const labels = makeLabelForStandaloneApplication({
- applicationId,
- fqdn,
- name,
- type,
- pullmergeRequestId,
- buildPack,
- repository,
- branch,
- projectId,
- port: exposePort ? `${exposePort}:${port}` : port,
- commit,
- installCommand,
- buildCommand,
- startCommand,
- baseDirectory,
- publishDirectory
- });
- let envFound = false;
- try {
- envFound = !!(await fs.stat(`${workdir}/.env`));
- } catch (error) {
- //
- }
- try {
- await saveBuildLog({ line: 'Deployment started.', buildId, applicationId });
- const composeVolumes = volumes.map((volume) => {
- return {
- [`${volume.split(':')[0]}`]: {
- name: volume.split(':')[0]
- }
- };
- });
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [imageId]: {
- image: `${applicationId}:${tag}`,
- container_name: imageId,
- volumes,
- env_file: envFound ? [`${workdir}/.env`] : [],
- networks: [docker.network],
- labels,
- depends_on: [],
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- // logging: {
- // driver: 'fluentd',
- // },
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [docker.network]: {
- external: true
- }
- },
- volumes: Object.assign({}, ...composeVolumes)
- };
- await fs.writeFile(`${workdir}/docker-compose.yml`, yaml.dump(composeFile));
- await asyncExecShell(
- `DOCKER_HOST=${host} docker compose --project-directory ${workdir} up -d`
- );
- await saveBuildLog({ line: 'Deployment successful!', buildId, applicationId });
- } catch (error) {
- await saveBuildLog({ line: error, buildId, applicationId });
- // sentry.captureException(error);
- throw new Error(error);
- }
- await saveBuildLog({ line: 'Proxy will be updated shortly.', buildId, applicationId });
- }
-}
diff --git a/src/lib/queues/cleanup.ts b/src/lib/queues/cleanup.ts
deleted file mode 100644
index d64246390c..0000000000
--- a/src/lib/queues/cleanup.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import { asyncExecShell, getEngine, version } from '$lib/common';
-import { prisma } from '$lib/database';
-export default async function (): Promise<void> {
- const destinationDockers = await prisma.destinationDocker.findMany();
- const engines = [...new Set(destinationDockers.map(({ engine }) => engine))];
- for (const engine of engines) {
- let lowDiskSpace = false;
- const host = getEngine(engine);
- try {
- const { stdout } = await asyncExecShell(
- `DOCKER_HOST=${host} docker exec coolify sh -c 'df -kPT /'`
- );
- let lines = stdout.trim().split('\n');
- let header = lines[0];
- let regex =
- /^Filesystem\s+|Type\s+|1024-blocks|\s+Used|\s+Available|\s+Capacity|\s+Mounted on\s*$/g;
- const boundaries = [];
- let match;
-
- while ((match = regex.exec(header))) {
- boundaries.push(match[0].length);
- }
-
- boundaries[boundaries.length - 1] = -1;
- const data = lines.slice(1).map((line) => {
- const cl = boundaries.map((boundary) => {
- const column = boundary > 0 ? line.slice(0, boundary) : line;
- line = line.slice(boundary);
- return column.trim();
- });
- return {
- capacity: Number.parseInt(cl[5], 10) / 100
- };
- });
- if (data.length > 0) {
- const { capacity } = data[0];
- if (capacity > 0.8) {
- lowDiskSpace = true;
- }
- }
- } catch (error) {
- console.log(error);
- }
- if (lowDiskSpace) {
- // Cleanup old coolify images
- try {
- let { stdout: images } = await asyncExecShell(
- `DOCKER_HOST=${host} docker images coollabsio/coolify --filter before="coollabsio/coolify:${version}" -q | xargs `
- );
- images = images.trim();
- if (images) {
- await asyncExecShell(`DOCKER_HOST=${host} docker rmi -f ${images}`);
- }
- } catch (error) {
- //console.log(error);
- }
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker container prune -f`);
- } catch (error) {
- //console.log(error);
- }
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker image prune -f --filter "until=2h"`);
- } catch (error) {
- //console.log(error);
- }
- // Cleanup old images older than a day
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker image prune --filter "until=72h" -a -f`);
- } catch (error) {
- //console.log(error);
- }
- }
- }
-}
diff --git a/src/lib/queues/index.ts b/src/lib/queues/index.ts
deleted file mode 100644
index b35a058d7a..0000000000
--- a/src/lib/queues/index.ts
+++ /dev/null
@@ -1,183 +0,0 @@
-import * as Bullmq from 'bullmq';
-import { default as ProdBullmq, QueueScheduler } from 'bullmq';
-import { dev } from '$app/env';
-import { prisma } from '$lib/database';
-
-import builder from './builder';
-import logger from './logger';
-import cleanup from './cleanup';
-import proxy from './proxy';
-import proxyTcpHttp from './proxyTcpHttp';
-import ssl from './ssl';
-import sslrenewal from './sslrenewal';
-import autoUpdater from './autoUpdater';
-
-import { asyncExecShell, saveBuildLog } from '$lib/common';
-
-let { Queue, Worker } = Bullmq;
-let redisHost = 'localhost';
-
-if (!dev) {
- Queue = ProdBullmq.Queue;
- Worker = ProdBullmq.Worker;
- redisHost = 'coolify-redis';
-}
-
-const connectionOptions = {
- connection: {
- host: redisHost
- }
-};
-
-const cron = async (): Promise<void> => {
- new QueueScheduler('proxy', connectionOptions);
- new QueueScheduler('proxyTcpHttp', connectionOptions);
- new QueueScheduler('cleanup', connectionOptions);
- new QueueScheduler('ssl', connectionOptions);
- new QueueScheduler('sslRenew', connectionOptions);
- new QueueScheduler('autoUpdater', connectionOptions);
-
- const queue = {
- proxy: new Queue('proxy', { ...connectionOptions }),
- proxyTcpHttp: new Queue('proxyTcpHttp', { ...connectionOptions }),
- cleanup: new Queue('cleanup', { ...connectionOptions }),
- ssl: new Queue('ssl', { ...connectionOptions }),
- sslRenew: new Queue('sslRenew', { ...connectionOptions }),
- autoUpdater: new Queue('autoUpdater', { ...connectionOptions })
- };
- await queue.proxy.drain();
- await queue.proxyTcpHttp.drain();
- await queue.cleanup.drain();
- await queue.ssl.drain();
- await queue.sslRenew.drain();
- await queue.autoUpdater.drain();
-
- new Worker(
- 'proxy',
- async () => {
- await proxy();
- },
- {
- ...connectionOptions
- }
- );
-
- new Worker(
- 'proxyTcpHttp',
- async () => {
- await proxyTcpHttp();
- },
- {
- ...connectionOptions
- }
- );
-
- new Worker(
- 'ssl',
- async () => {
- await ssl();
- },
- {
- ...connectionOptions
- }
- );
-
- new Worker(
- 'cleanup',
- async () => {
- await cleanup();
- },
- {
- ...connectionOptions
- }
- );
-
- new Worker(
- 'sslRenew',
- async () => {
- await sslrenewal();
- },
- {
- ...connectionOptions
- }
- );
-
- new Worker(
- 'autoUpdater',
- async () => {
- await autoUpdater();
- },
- {
- ...connectionOptions
- }
- );
-
- await queue.proxy.add('proxy', {}, { repeat: { every: 10000 } });
- await queue.proxyTcpHttp.add('proxyTcpHttp', {}, { repeat: { every: 10000 } });
- await queue.ssl.add('ssl', {}, { repeat: { every: dev ? 10000 : 60000 } });
- if (!dev) await queue.cleanup.add('cleanup', {}, { repeat: { every: 300000 } });
- if (!dev) await queue.sslRenew.add('sslRenew', {}, { repeat: { every: 1800000 } });
- if (!dev) await queue.autoUpdater.add('autoUpdater', {}, { repeat: { every: 60000 } });
-};
-cron().catch((error) => {
- console.log('cron failed to start');
- console.log(error);
-});
-
-const buildQueueName = 'build_queue';
-const buildQueue = new Queue(buildQueueName, connectionOptions);
-const buildWorker = new Worker(buildQueueName, async (job) => await builder(job), {
- concurrency: 1,
- ...connectionOptions
-});
-buildQueue.resume().catch((err) => {
- console.log('Build queue failed to resume!', err);
-});
-
-buildWorker.on('completed', async (job: Bullmq.Job) => {
- try {
- await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'success' } });
- } catch (error) {
- setTimeout(async () => {
- await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'success' } });
- }, 1234);
- } finally {
- const workdir = `/tmp/build-sources/${job.data.repository}/${job.data.build_id}`;
- if (!dev) await asyncExecShell(`rm -fr ${workdir}`);
- await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'success' } });
- }
- return;
-});
-
-buildWorker.on('failed', async (job: Bullmq.Job, failedReason) => {
- try {
- await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'failed' } });
- } catch (error) {
- setTimeout(async () => {
- await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'failed' } });
- }, 1234);
- } finally {
- const workdir = `/tmp/build-sources/${job.data.repository}`;
- if (!dev) await asyncExecShell(`rm -fr ${workdir}`);
- await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'failed' } });
- }
- await saveBuildLog({
- line: 'Failed to deploy!',
- buildId: job.data.build_id,
- applicationId: job.data.id
- });
- await saveBuildLog({
- line: `Reason: ${failedReason.toString()}`,
- buildId: job.data.build_id,
- applicationId: job.data.id
- });
-});
-
-const buildLogQueueName = 'log_queue';
-const buildLogQueue = new Queue(buildLogQueueName, connectionOptions);
-const buildLogWorker = new Worker(buildLogQueueName, async (job) => await logger(job), {
- concurrency: 1,
- ...connectionOptions
-});
-
-export { buildQueue, buildLogQueue };
diff --git a/src/lib/queues/logger.ts b/src/lib/queues/logger.ts
deleted file mode 100644
index f751f8d6fa..0000000000
--- a/src/lib/queues/logger.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { prisma } from '$lib/database';
-import { dev } from '$app/env';
-import type { Job } from 'bullmq';
-
-export default async function (job: Job): Promise<void> {
- const { line, applicationId, buildId } = job.data;
- if (dev) console.debug(`[${applicationId}] ${line}`);
- await prisma.buildLog.create({ data: { line, buildId, time: Number(job.id), applicationId } });
-}
diff --git a/src/lib/queues/proxy.ts b/src/lib/queues/proxy.ts
deleted file mode 100644
index 245fb3b02b..0000000000
--- a/src/lib/queues/proxy.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ErrorHandler, prisma } from '$lib/database';
-import { configureHAProxy } from '$lib/haproxy/configuration';
-
-export default async function (): Promise<void | {
- status: number;
- body: { message: string; error: string };
-}> {
- try {
- const settings = await prisma.setting.findFirst();
- if (!settings.isTraefikUsed) {
- return await configureHAProxy();
- }
- } catch (error) {
- return ErrorHandler(error.response?.body || error);
- }
-}
diff --git a/src/lib/queues/proxyTcpHttp.ts b/src/lib/queues/proxyTcpHttp.ts
deleted file mode 100644
index 9ce239b669..0000000000
--- a/src/lib/queues/proxyTcpHttp.ts
+++ /dev/null
@@ -1,103 +0,0 @@
-import { ErrorHandler, generateDatabaseConfiguration, prisma } from '$lib/database';
-import {
- checkContainer,
- startCoolifyProxy,
- startHttpProxy,
- startTcpProxy,
- startTraefikHTTPProxy,
- startTraefikProxy,
- startTraefikTCPProxy,
- stopCoolifyProxy,
- stopTcpHttpProxy,
- stopTraefikProxy
-} from '$lib/haproxy';
-
-export default async function (): Promise<void | {
- status: number;
- body: { message: string; error: string };
-}> {
- try {
- // Coolify Proxy
- const engine = '/var/run/docker.sock';
- const settings = await prisma.setting.findFirst();
- const localDocker = await prisma.destinationDocker.findFirst({
- where: { engine, network: 'coolify' }
- });
- if (localDocker && localDocker.isCoolifyProxyUsed) {
- if (settings.isTraefikUsed) {
- const found = await checkContainer(engine, 'coolify-haproxy');
- if (found) await stopCoolifyProxy(engine);
- await startTraefikProxy(engine);
- } else {
- const found = await checkContainer(engine, 'coolify-proxy');
- if (found) await stopTraefikProxy(engine);
- await startCoolifyProxy(engine);
- }
- }
-
- // TCP Proxies
- const databasesWithPublicPort = await prisma.database.findMany({
- where: { publicPort: { not: null } },
- include: { settings: true, destinationDocker: true }
- });
- for (const database of databasesWithPublicPort) {
- const { destinationDockerId, destinationDocker, publicPort, id } = database;
- if (destinationDockerId) {
- if (destinationDocker.isCoolifyProxyUsed) {
- const { privatePort } = generateDatabaseConfiguration(database);
- if (settings.isTraefikUsed) {
- await stopTcpHttpProxy(id, destinationDocker, publicPort, `haproxy-for-${publicPort}`);
- await startTraefikTCPProxy(destinationDocker, id, publicPort, privatePort);
- } else {
- await stopTcpHttpProxy(id, destinationDocker, publicPort, `${id}-${publicPort}`);
- await startTcpProxy(destinationDocker, id, publicPort, privatePort);
- }
- }
- }
- }
- const wordpressWithFtp = await prisma.wordpress.findMany({
- where: { ftpPublicPort: { not: null } },
- include: { service: { include: { destinationDocker: true } } }
- });
- for (const ftp of wordpressWithFtp) {
- const { service, ftpPublicPort } = ftp;
- const { destinationDockerId, destinationDocker, id } = service;
- if (destinationDockerId) {
- if (destinationDocker.isCoolifyProxyUsed) {
- if (settings.isTraefikUsed) {
- await stopTcpHttpProxy(
- id,
- destinationDocker,
- ftpPublicPort,
- `haproxy-for-${ftpPublicPort}`
- );
- await startTraefikTCPProxy(destinationDocker, id, ftpPublicPort, 22, 'wordpressftp');
- } else {
- await stopTcpHttpProxy(id, destinationDocker, ftpPublicPort, `${id}-${ftpPublicPort}`);
- await startTcpProxy(destinationDocker, `${id}-ftp`, ftpPublicPort, 22);
- }
- }
- }
- }
-
- // HTTP Proxies
- if (!settings.isTraefikUsed) {
- const minioInstances = await prisma.minio.findMany({
- where: { publicPort: { not: null } },
- include: { service: { include: { destinationDocker: true } } }
- });
- for (const minio of minioInstances) {
- const { service, publicPort } = minio;
- const { destinationDockerId, destinationDocker, id } = service;
- if (destinationDockerId) {
- if (destinationDocker.isCoolifyProxyUsed) {
- await stopTcpHttpProxy(id, destinationDocker, publicPort, `${id}-${publicPort}`);
- await startHttpProxy(destinationDocker, id, publicPort, 9000);
- }
- }
- }
- }
- } catch (error) {
- return ErrorHandler(error.response?.body || error);
- }
-}
diff --git a/src/lib/queues/ssl.ts b/src/lib/queues/ssl.ts
deleted file mode 100644
index 2aaf50732c..0000000000
--- a/src/lib/queues/ssl.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { generateSSLCerts } from '$lib/letsencrypt';
-import { prisma } from '$lib/database';
-
-export default async function (): Promise<void> {
- try {
- const settings = await prisma.setting.findFirst();
- if (!settings.isTraefikUsed) {
- return await generateSSLCerts();
- }
- } catch (error) {
- console.log(error);
- throw error;
- }
-}
diff --git a/src/lib/queues/sslrenewal.ts b/src/lib/queues/sslrenewal.ts
deleted file mode 100644
index 0c14b2dc9d..0000000000
--- a/src/lib/queues/sslrenewal.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { renewSSLCerts } from '$lib/letsencrypt';
-import { prisma } from '$lib/database';
-
-export default async function (): Promise<void> {
- try {
- const settings = await prisma.setting.findFirst();
- if (!settings.isTraefikUsed) {
- return await renewSSLCerts();
- }
- } catch (error) {
- console.log(error);
- throw error;
- }
-}
diff --git a/src/lib/realtime.ts b/src/lib/realtime.ts
deleted file mode 100644
index 419bb154bd..0000000000
--- a/src/lib/realtime.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-// import ioClient from 'socket.io-client';
-// const socket = ioClient('http://localhost:3000');
-// export const io = socket;
diff --git a/src/lib/settings.ts b/src/lib/settings.ts
deleted file mode 100644
index 4e13f4f0f3..0000000000
--- a/src/lib/settings.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export const publicPaths = [
- '/login',
- '/register',
- '/webhooks/success',
- '/webhooks/github',
- '/webhooks/github/install',
- '/webhooks/gitlab'
-];
diff --git a/src/lib/store.ts b/src/lib/store.ts
deleted file mode 100644
index 9366d70b2b..0000000000
--- a/src/lib/store.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { browser } from '$app/env';
-import { writable, type Writable, type Readable, readable } from 'svelte/store';
-
-export const gitTokens: Writable<{ githubToken: string | null; gitlabToken: string | null }> =
- writable({
- githubToken: null,
- gitlabToken: null
- });
-export const disabledButton: Writable<boolean> = writable(false);
-
-export const features: Readable<{ latestVersion: string; beta: boolean }> = readable({
- beta: browser && window.localStorage.getItem('beta') === 'true',
- latestVersion: browser && window.localStorage.getItem('latestVersion')
-});
-
-export const isTraefikUsed: Writable<boolean> = writable(false);
-
-export const status: Writable<any> = writable({
- application: {
- isRunning: false,
- isExited: false,
- loading: false,
- initialLoading: true
- }
-});
diff --git a/src/lib/types/builderJob.ts b/src/lib/types/builderJob.ts
deleted file mode 100644
index 968e2c897e..0000000000
--- a/src/lib/types/builderJob.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import type { DestinationDocker, GithubApp, GitlabApp, GitSource, Secret } from '@prisma/client';
-
-export type BuilderJob = {
- build_id: string;
- type: BuildType;
- id: string;
- name: string;
- fqdn: string;
- repository: string;
- configHash: unknown;
- branch: string;
- buildPack: BuildPackName;
- projectId: number;
- port: number;
- exposePort?: number;
- installCommand: string;
- buildCommand?: string;
- startCommand?: string;
- baseDirectory: string;
- publishDirectory: string;
- phpModules: string;
- pythonWSGI: string;
- pythonModule: string;
- pythonVariable: string;
- dockerFileLocation: string;
- denoMainFile: string;
- denoOptions: string;
- createdAt: string;
- updatedAt: string;
- destinationDockerId: string;
- destinationDocker: DestinationDocker;
- gitSource: GitSource & { githubApp?: GithubApp; gitlabApp?: GitlabApp };
- settings: BuilderJobSettings;
- secrets: Secret[];
- persistentStorage: { path: string }[];
- pullmergeRequestId?: unknown;
- sourceBranch?: string;
- baseImage: string;
- baseBuildImage: string;
-};
-
-// TODO: Add the other build types
-export type BuildType = 'manual';
-
-// TODO: Add the other buildpack names
-export type BuildPackName = 'node' | 'docker';
-
-export type BuilderJobSettings = {
- id: string;
- applicationId: string;
- dualCerts: boolean;
- debug: boolean;
- previews: boolean;
- autodeploy: boolean;
- createdAt: string;
- updatedAt: string;
-};
diff --git a/src/lib/types/composeFile.ts b/src/lib/types/composeFile.ts
deleted file mode 100644
index 724a53b69a..0000000000
--- a/src/lib/types/composeFile.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-export type ComposeFile = {
- version: ComposerFileVersion;
- services: Record<string, ComposeFileService>;
- networks: Record<string, ComposeFileNetwork>;
- volumes?: Record<string, ComposeFileVolume>;
-};
-
-export type ComposeFileService = {
- container_name: string;
- image?: string;
- networks: string[];
- environment?: Record<string, unknown>;
- volumes?: string[];
- ulimits?: unknown;
- labels?: string[];
- env_file?: string[];
- extra_hosts?: string[];
- restart: ComposeFileRestartOption;
- depends_on?: string[];
- command?: string;
- ports?: string[];
- build?: {
- context: string;
- dockerfile: string;
- args?: Record<string, unknown>;
- };
- deploy?: {
- restart_policy?: {
- condition?: string;
- delay?: string;
- max_attempts?: number;
- window?: string;
- };
- };
-};
-
-export type ComposerFileVersion =
- | '3.8'
- | '3.7'
- | '3.6'
- | '3.5'
- | '3.4'
- | '3.3'
- | '3.2'
- | '3.1'
- | '3.0'
- | '2.4'
- | '2.3'
- | '2.2'
- | '2.1'
- | '2.0';
-
-export type ComposeFileRestartOption = 'no' | 'always' | 'on-failure' | 'unless-stopped';
-
-export type ComposeFileNetwork = {
- external: boolean;
-};
-
-export type ComposeFileVolume = {
- external?: boolean;
- name?: string;
-};
diff --git a/src/lib/types/destinations.ts b/src/lib/types/destinations.ts
deleted file mode 100644
index c5a56d7727..0000000000
--- a/src/lib/types/destinations.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export type CreateDockerDestination = {
- name: string;
- engine: string;
- remoteEngine: boolean;
- network: string;
- isCoolifyProxyUsed: boolean;
- teamId: string;
-};
diff --git a/src/routes/applications/[id]/cancel.json.ts b/src/routes/applications/[id]/cancel.json.ts
deleted file mode 100644
index 72abf14dc5..0000000000
--- a/src/routes/applications/[id]/cancel.json.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-import { asyncExecShell, getEngine, removeDestinationDocker, saveBuildLog } from '$lib/common';
-import { buildQueue } from '$lib/queues';
-import type { RequestHandler } from '@sveltejs/kit';
-import * as db from '$lib/database';
-
-async function cleanupDB(buildId: string) {
- const data = await db.prisma.build.findUnique({ where: { id: buildId } });
- if (data?.status === 'queued' || data?.status === 'running') {
- await db.prisma.build.update({ where: { id: buildId }, data: { status: 'failed' } });
- }
-}
-
-async function stopBuild(buildId, applicationId) {
- let count = 0;
- await new Promise<void>(async (resolve, reject) => {
- const job = await buildQueue.getJob(buildId);
- if (!job) {
- await cleanupDB(buildId);
- return resolve();
- }
- const {
- destinationDocker: { engine }
- } = job?.data;
- const host = getEngine(engine);
- let interval = setInterval(async () => {
- try {
- const data = await db.prisma.build.findUnique({ where: { id: buildId } });
- if (data?.status === 'failed') {
- clearInterval(interval);
- return resolve();
- }
- if (count > 100) {
- clearInterval(interval);
- return reject(new Error('Build canceled'));
- }
-
- const { stdout: buildContainers } = await asyncExecShell(
- `DOCKER_HOST=${host} docker container ls --filter "label=coolify.buildId=${buildId}" --format '{{json .}}'`
- );
- if (buildContainers) {
- const containersArray = buildContainers.trim().split('\n');
- for (const container of containersArray) {
- const containerObj = JSON.parse(container);
- const id = containerObj.ID;
- if (!containerObj.Names.startsWith(`${applicationId}`)) {
- await removeDestinationDocker({ id, engine });
- clearInterval(interval);
- await saveBuildLog({
- line: 'Canceled by user!',
- buildId: job.data.build_id,
- applicationId: job.data.id
- });
- }
- }
- }
- count++;
- } catch (error) {}
- }, 100);
- });
-}
-export const post: RequestHandler = async (event) => {
- const { buildId, applicationId } = await event.request.json();
- if (!buildId) {
- return {
- status: 500,
- body: {
- message: 'Build ID not found.'
- }
- };
- }
- try {
- await stopBuild(buildId, applicationId);
- return {
- status: 200,
- body: {
- message: 'Build canceled.'
- }
- };
- } catch (error) {
- return {
- status: 500,
- body: {
- message: error.message
- }
- };
- }
-};
diff --git a/src/routes/applications/[id]/check.json.ts b/src/routes/applications/[id]/check.json.ts
deleted file mode 100644
index 6e3b77a6df..0000000000
--- a/src/routes/applications/[id]/check.json.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import { dev } from '$app/env';
-import { checkDomainsIsValidInDNS, getDomain, getUserDetails, isDNSValid } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-import { promises as dns } from 'dns';
-import getPort from 'get-port';
-import { t } from '$lib/translations';
-
-export const get: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const domain = event.url.searchParams.get('domain');
- if (!domain) {
- return {
- status: 500,
- body: {
- message: t.get('application.domain_required')
- }
- };
- }
- try {
- await isDNSValid(event, domain);
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- let { exposePort, fqdn, forceSave, dualCerts } = await event.request.json();
- fqdn = fqdn.toLowerCase();
-
- try {
- const { isDNSCheckEnabled } = await db.prisma.setting.findFirst({});
- const found = await db.isDomainConfigured({ id, fqdn });
- if (found) {
- throw {
- message: t.get('application.domain_already_in_use', {
- domain: getDomain(fqdn).replace('www.', '')
- })
- };
- }
-
- if (exposePort) {
- exposePort = Number(exposePort);
-
- if (exposePort < 1024 || exposePort > 65535) {
- throw { message: `Exposed Port needs to be between 1024 and 65535.` };
- }
-
- const publicPort = await getPort({ port: exposePort });
- if (publicPort !== exposePort) {
- throw { message: `Port ${exposePort} is already in use.` };
- }
- }
-
- if (isDNSCheckEnabled && !dev && !forceSave) {
- return await checkDomainsIsValidInDNS({ event, fqdn, dualCerts });
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/configuration/buildpack.json.ts b/src/routes/applications/[id]/configuration/buildpack.json.ts
deleted file mode 100644
index 6e06ba44b4..0000000000
--- a/src/routes/applications/[id]/configuration/buildpack.json.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, generatePassword } from '$lib/database';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- try {
- const application = await db.getApplication({ id, teamId });
- return {
- status: 200,
- body: {
- type: application.gitSource.type,
- projectId: application.projectId,
- repository: application.repository,
- branch: application.branch,
- apiUrl: application.gitSource.apiUrl
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { buildPack } = await event.request.json();
-
- try {
- await db.configureBuildPack({ id, buildPack });
-
- // Generate default secrets
- if (buildPack === 'laravel') {
- let found = await db.isSecretExists({ id, name: 'APP_ENV', isPRMRSecret: false });
- if (!found) {
- await db.createSecret({
- id,
- name: 'APP_ENV',
- value: 'production',
- isBuildSecret: false,
- isPRMRSecret: false
- });
- }
- found = await db.isSecretExists({ id, name: 'APP_KEY', isPRMRSecret: false });
- if (!found) {
- await db.createSecret({
- id,
- name: 'APP_KEY',
- value: generatePassword(32),
- isBuildSecret: false,
- isPRMRSecret: false
- });
- }
- }
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/configuration/deploykey.json.ts b/src/routes/applications/[id]/configuration/deploykey.json.ts
deleted file mode 100644
index 7599d15cbd..0000000000
--- a/src/routes/applications/[id]/configuration/deploykey.json.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { id } = event.params;
- let { deployKeyId } = await event.request.json();
-
- deployKeyId = Number(deployKeyId);
-
- try {
- await db.updateDeployKey({ id, deployKeyId });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/configuration/destination.json.ts b/src/routes/applications/[id]/configuration/destination.json.ts
deleted file mode 100644
index 48989917e6..0000000000
--- a/src/routes/applications/[id]/configuration/destination.json.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { destinationId } = await event.request.json();
-
- try {
- await db.configureDestinationForApplication({ id, destinationId });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/configuration/githubToken.json.ts b/src/routes/applications/[id]/configuration/githubToken.json.ts
deleted file mode 100644
index 1e477a06be..0000000000
--- a/src/routes/applications/[id]/configuration/githubToken.json.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-import jsonwebtoken from 'jsonwebtoken';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- try {
- const application = await db.getApplication({ id, teamId });
- const payload = {
- iat: Math.round(new Date().getTime() / 1000),
- exp: Math.round(new Date().getTime() / 1000 + 60),
- iss: application.gitSource.githubApp.appId
- };
- const githubToken = jsonwebtoken.sign(payload, application.gitSource.githubApp.privateKey, {
- algorithm: 'RS256'
- });
- const response = await fetch(
- `${application.gitSource.apiUrl}/app/installations/${application.gitSource.githubApp.installationId}/access_tokens`,
- {
- method: 'POST',
- headers: {
- Authorization: `Bearer ${githubToken}`
- }
- }
- );
- if (!response.ok) {
- throw new Error(`${response.status} ${response.statusText}`);
- }
- const data = await response.json();
- return {
- status: 201,
- body: { token: data.token },
- headers: {
- 'Set-Cookie': `githubToken=${data.token}; Path=/; HttpOnly; Max-Age=15778800;`
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/configuration/repository.json.ts b/src/routes/applications/[id]/configuration/repository.json.ts
deleted file mode 100644
index 38987c4c62..0000000000
--- a/src/routes/applications/[id]/configuration/repository.json.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- const repository = event.url.searchParams.get('repository')?.toLocaleLowerCase() || undefined;
- const branch = event.url.searchParams.get('branch')?.toLocaleLowerCase() || undefined;
-
- try {
- const found = await db.isBranchAlreadyUsed({ repository, branch, id });
- return {
- status: 200,
- body: {
- used: found ? true : false
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- let { repository, branch, projectId, webhookToken, autodeploy } = await event.request.json();
-
- repository = repository.toLowerCase();
- branch = branch.toLowerCase();
- projectId = Number(projectId);
-
- try {
- await db.configureGitRepository({
- id,
- repository,
- branch,
- projectId,
- webhookToken,
- autodeploy
- });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/configuration/source.json.ts b/src/routes/applications/[id]/configuration/source.json.ts
deleted file mode 100644
index 6481cc5334..0000000000
--- a/src/routes/applications/[id]/configuration/source.json.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { gitSourceId } = await event.request.json();
- try {
- await db.configureGitsource({ id, gitSourceId });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/configuration/sshkey.json.ts b/src/routes/applications/[id]/configuration/sshkey.json.ts
deleted file mode 100644
index 38b1640882..0000000000
--- a/src/routes/applications/[id]/configuration/sshkey.json.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { id } = event.params;
- try {
- return await db.getSshKey({ id });
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-export const post: RequestHandler = async (event) => {
- const { id } = event.params;
- try {
- return await db.generateSshKey({ id });
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/delete.json.ts b/src/routes/applications/[id]/delete.json.ts
deleted file mode 100644
index 03e48a8470..0000000000
--- a/src/routes/applications/[id]/delete.json.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const del: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- try {
- await db.removeApplication({ id, teamId });
- return {
- status: 200
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/deploy.json.ts b/src/routes/applications/[id]/deploy.json.ts
deleted file mode 100644
index c22d6a21a4..0000000000
--- a/src/routes/applications/[id]/deploy.json.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-import * as db from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-import cuid from 'cuid';
-import crypto from 'crypto';
-import { buildQueue } from '$lib/queues';
-import { getUserDetails } from '$lib/common';
-import { ErrorHandler } from '$lib/database';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { pullmergeRequestId = null, branch } = await event.request.json();
- try {
- const buildId = cuid();
- const applicationFound = await db.getApplication({ id, teamId });
- if (!applicationFound.configHash) {
- const configHash = crypto
- .createHash('sha256')
- .update(
- JSON.stringify({
- buildPack: applicationFound.buildPack,
- port: applicationFound.port,
- exposePort: applicationFound.exposePort,
- installCommand: applicationFound.installCommand,
- buildCommand: applicationFound.buildCommand,
- startCommand: applicationFound.startCommand
- })
- )
- .digest('hex');
- await db.prisma.application.update({ where: { id }, data: { configHash } });
- }
- await db.prisma.application.update({ where: { id }, data: { updatedAt: new Date() } });
- await db.prisma.build.create({
- data: {
- id: buildId,
- applicationId: id,
- branch: applicationFound.branch,
- destinationDockerId: applicationFound.destinationDocker.id,
- gitSourceId: applicationFound.gitSource.id,
- githubAppId: applicationFound.gitSource.githubApp?.id,
- gitlabAppId: applicationFound.gitSource.gitlabApp?.id,
- status: 'queued',
- type: 'manual'
- }
- });
- if (pullmergeRequestId) {
- await buildQueue.add(
- buildId,
- {
- build_id: buildId,
- type: 'manual',
- ...applicationFound,
- sourceBranch: branch,
- pullmergeRequestId
- },
- { jobId: buildId }
- );
- } else {
- await buildQueue.add(
- buildId,
- { build_id: buildId, type: 'manual', ...applicationFound },
- { jobId: buildId }
- );
- }
- return {
- status: 200,
- body: {
- buildId
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/index.json.ts b/src/routes/applications/[id]/index.json.ts
deleted file mode 100644
index 434383be19..0000000000
--- a/src/routes/applications/[id]/index.json.ts
+++ /dev/null
@@ -1,105 +0,0 @@
-import { asyncExecShell, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer, getContainerUsage, isContainerExited } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-import { setDefaultConfiguration } from '$lib/buildPacks/common';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- const appId = process.env['COOLIFY_APP_ID'];
- let githubToken = event.locals.cookies?.githubToken || null;
- let gitlabToken = event.locals.cookies?.gitlabToken || null;
- try {
- const application = await db.getApplication({ id, teamId });
-
- return {
- status: 200,
- body: {
- application,
- appId,
- githubToken,
- gitlabToken
- },
- headers: {}
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- let {
- name,
- buildPack,
- fqdn,
- port,
- exposePort,
- installCommand,
- buildCommand,
- startCommand,
- baseDirectory,
- publishDirectory,
- pythonWSGI,
- pythonModule,
- pythonVariable,
- dockerFileLocation,
- denoMainFile,
- denoOptions,
- baseImage,
- baseBuildImage
- } = await event.request.json();
- if (port) port = Number(port);
- if (exposePort) {
- exposePort = Number(exposePort);
- }
- if (denoOptions) denoOptions = denoOptions.trim();
-
- try {
- const defaultConfiguration = await setDefaultConfiguration({
- buildPack,
- port,
- installCommand,
- startCommand,
- buildCommand,
- publishDirectory,
- baseDirectory,
- dockerFileLocation,
- denoMainFile
- });
- await db.configureApplication({
- id,
- buildPack,
- name,
- fqdn,
- port,
- exposePort,
- installCommand,
- buildCommand,
- startCommand,
- baseDirectory,
- publishDirectory,
- pythonWSGI,
- pythonModule,
- pythonVariable,
- dockerFileLocation,
- denoMainFile,
- denoOptions,
- baseImage,
- baseBuildImage,
- ...defaultConfiguration
- });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/logs/build/build.json.ts b/src/routes/applications/[id]/logs/build/build.json.ts
deleted file mode 100644
index 08779c001b..0000000000
--- a/src/routes/applications/[id]/logs/build/build.json.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { getTeam, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const buildId = event.url.searchParams.get('buildId');
- const sequence = Number(event.url.searchParams.get('sequence'));
- try {
- let logs = await db.prisma.buildLog.findMany({
- where: { buildId, time: { gt: sequence } },
- orderBy: { time: 'asc' }
- });
- const data = await db.prisma.build.findFirst({ where: { id: buildId } });
-
- return {
- body: {
- logs,
- status: data?.status
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/logs/build/index.json.ts b/src/routes/applications/[id]/logs/build/index.json.ts
deleted file mode 100644
index 1af90f289e..0000000000
--- a/src/routes/applications/[id]/logs/build/index.json.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { dayjs } from '$lib/dayjs';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { id } = event.params;
- const buildId = event.url.searchParams.get('buildId');
- const skip = Number(event.url.searchParams.get('skip')) || 0;
-
- let builds = [];
- try {
- const buildCount = await db.prisma.build.count({ where: { applicationId: id } });
- if (buildId) {
- builds = await db.prisma.build.findMany({ where: { applicationId: id, id: buildId } });
- } else {
- builds = await db.prisma.build.findMany({
- where: { applicationId: id },
- orderBy: { createdAt: 'desc' },
- take: 5,
- skip
- });
- }
- builds = builds.map((build) => {
- const updatedAt = dayjs(build.updatedAt).utc();
- build.took = updatedAt.diff(dayjs(build.createdAt)) / 1000;
- build.since = updatedAt.fromNow();
- return build;
- });
- return {
- status: 200,
- body: {
- builds,
- buildCount
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/logs/index.json.ts b/src/routes/applications/[id]/logs/index.json.ts
deleted file mode 100644
index 9ef7653bc8..0000000000
--- a/src/routes/applications/[id]/logs/index.json.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { dayjs } from '$lib/dayjs';
-import { dockerInstance } from '$lib/docker';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- let since = event.url.searchParams.get('since') || 0;
- if (since !== 0) {
- since = dayjs(since).unix();
- }
- try {
- const { destinationDockerId, destinationDocker } = await db.prisma.application.findUnique({
- where: { id },
- include: { destinationDocker: true }
- });
- if (destinationDockerId) {
- const docker = dockerInstance({ destinationDocker });
- try {
- const container = await docker.engine.getContainer(id);
- if (container) {
- const logs = (
- await container.logs({
- stdout: true,
- stderr: true,
- timestamps: true,
- since,
- tail: 5000
- })
- )
- .toString()
- .split('\n')
- .map((l) => l.slice(8))
- .filter((a) => a);
- return {
- body: {
- logs
- }
- };
- }
- } catch (error) {
- const { statusCode } = error;
- if (statusCode === 404) {
- return {
- body: {
- logs: []
- }
- };
- }
- }
- }
- return {
- status: 200,
- body: {
- message: 'No logs found.'
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/previews/index.json.ts b/src/routes/applications/[id]/previews/index.json.ts
deleted file mode 100644
index d926906715..0000000000
--- a/src/routes/applications/[id]/previews/index.json.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { getTeam, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { dockerInstance } from '$lib/docker';
-import type { RequestHandler } from '@sveltejs/kit';
-import jsonwebtoken from 'jsonwebtoken';
-
-export const get: RequestHandler = async (event) => {
- const { status, body, teamId } = await getUserDetails(event, false);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- try {
- const secrets = await db.listSecrets(id);
- const applicationSecrets = secrets.filter((secret) => !secret.isPRMRSecret);
- const PRMRSecrets = secrets.filter((secret) => secret.isPRMRSecret);
- const destinationDocker = await db.getDestinationByApplicationId({ id, teamId });
- const docker = dockerInstance({ destinationDocker });
- const listContainers = await docker.engine.listContainers({
- filters: { network: [destinationDocker.network], name: [id] }
- });
- const containers = listContainers.filter((container) => {
- return (
- container.Labels['coolify.configuration'] &&
- container.Labels['coolify.type'] === 'standalone-application'
- );
- });
- const jsonContainers = containers
- .map((container) =>
- JSON.parse(Buffer.from(container.Labels['coolify.configuration'], 'base64').toString())
- )
- .filter((container) => {
- return container.pullmergeRequestId && container.applicationId === id;
- });
- return {
- body: {
- containers: jsonContainers,
- applicationSecrets: applicationSecrets.sort((a, b) => {
- return ('' + a.name).localeCompare(b.name);
- }),
- PRMRSecrets: PRMRSecrets.sort((a, b) => {
- return ('' + a.name).localeCompare(b.name);
- })
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/secrets/_BatchSecrets.svelte b/src/routes/applications/[id]/secrets/_BatchSecrets.svelte
deleted file mode 100644
index d7c23938f3..0000000000
--- a/src/routes/applications/[id]/secrets/_BatchSecrets.svelte
+++ /dev/null
@@ -1,49 +0,0 @@
-<script>
- export let secrets;
- export let refreshSecrets;
- export let id;
-
- import { saveSecret } from './utils';
- import pLimit from 'p-limit';
- import { createEventDispatcher } from 'svelte';
- import { t } from '$lib/translations';
- const dispatch = createEventDispatcher();
-
- let batchSecrets = '';
- function setBatchValue(event) {
- batchSecrets = event.target?.value;
- }
- const limit = pLimit(1);
- async function getValues(e) {
- e.preventDefault();
- const eachValuePair = batchSecrets.split('\n');
- const batchSecretsPairs = eachValuePair
- .filter((secret) => !secret.startsWith('#') && secret)
- .map((secret) => {
- const [name, value] = secret.split('=');
- const cleanValue = value?.replaceAll('"', '') || '';
- return {
- name,
- value: cleanValue,
- isNew: !secrets.find((secret) => name === secret.name)
- };
- });
-
- await Promise.all(
- batchSecretsPairs.map(({ name, value, isNew }) =>
- limit(() => saveSecret({ name, value, applicationId: id, isNew }))
- )
- );
- batchSecrets = '';
- refreshSecrets();
- }
-</script>
-
-<h2 class="title my-6 font-bold">{$t('application.secret__batch_dot_env')}</h2>
-<form on:submit|preventDefault={getValues} class="mb-12 w-full">
- <textarea bind:value={batchSecrets} class="mb-2 min-h-[200px] w-full" />
- <button
- class="bg-green-600 hover:bg-green-500 disabled:text-white disabled:opacity-40"
- type="submit">{$t('application.batch_secrets')}</button
- >
-</form>
diff --git a/src/routes/applications/[id]/secrets/index.json.ts b/src/routes/applications/[id]/secrets/index.json.ts
deleted file mode 100644
index 174427615a..0000000000
--- a/src/routes/applications/[id]/secrets/index.json.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- try {
- const secrets = await (await db.listSecrets(id)).filter((secret) => !secret.isPRMRSecret);
- return {
- status: 200,
- body: {
- secrets: secrets.sort((a, b) => {
- return ('' + a.name).localeCompare(b.name);
- })
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { name, value, isBuildSecret, isPRMRSecret, isNew } = await event.request.json();
- try {
- if (isNew) {
- const found = await db.isSecretExists({ id, name, isPRMRSecret });
- if (found) {
- throw {
- error: `Secret ${name} already exists.`
- };
- } else {
- await db.createSecret({ id, name, value, isBuildSecret, isPRMRSecret });
- return {
- status: 201
- };
- }
- } else {
- await db.updateSecret({ id, name, value, isBuildSecret, isPRMRSecret });
- return {
- status: 201
- };
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-export const del: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { name } = await event.request.json();
-
- try {
- await db.removeSecret({ id, name });
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/settings.json.ts b/src/routes/applications/[id]/settings.json.ts
deleted file mode 100644
index 77c4bc8861..0000000000
--- a/src/routes/applications/[id]/settings.json.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { t } from '$lib/translations';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { debug, previews, dualCerts, autodeploy, branch, projectId } = await event.request.json();
-
- try {
- const isDouble = await db.checkDoubleBranch(branch, projectId);
- if (isDouble && autodeploy) {
- throw {
- message: t.get('application.cant_activate_auto_deploy_without_repo')
- };
- }
- await db.setApplicationSettings({ id, debug, previews, dualCerts, autodeploy });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/status.json.ts b/src/routes/applications/[id]/status.json.ts
deleted file mode 100644
index 27c5df3d77..0000000000
--- a/src/routes/applications/[id]/status.json.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { asyncExecShell, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer, getContainerUsage, isContainerExited } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-import { setDefaultConfiguration } from '$lib/buildPacks/common';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- let isRunning = false;
- let isExited = false;
- try {
- const application = await db.getApplication({ id, teamId });
- if (application.destinationDockerId) {
- [isRunning, isExited] = await Promise.all([
- checkContainer(application.destinationDocker.engine, id),
- isContainerExited(application.destinationDocker.engine, id)
- ]);
- }
- return {
- status: 200,
- body: {
- isRunning,
- isExited
- },
- headers: {}
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/stop.json.ts b/src/routes/applications/[id]/stop.json.ts
deleted file mode 100644
index 999d8c106c..0000000000
--- a/src/routes/applications/[id]/stop.json.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { asyncExecShell, getEngine, getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const { destinationDocker, destinationDockerId, fqdn } = await db.getApplication({
- id,
- teamId
- });
- if (destinationDockerId) {
- const { engine } = destinationDocker;
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- }
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/storage/index.json.ts b/src/routes/applications/[id]/storage/index.json.ts
deleted file mode 100644
index c1581fd70c..0000000000
--- a/src/routes/applications/[id]/storage/index.json.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { status, body, teamId } = await getUserDetails(event, false);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- try {
- const persistentStorages = await db.getPersistentStorage(id);
- return {
- body: {
- persistentStorages
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { path, newStorage, storageId } = await event.request.json();
- try {
- if (newStorage) {
- await db.prisma.applicationPersistentStorage.create({
- data: { path, application: { connect: { id } } }
- });
- } else {
- await db.prisma.applicationPersistentStorage.update({
- where: { id: storageId },
- data: { path }
- });
- }
- return {
- status: 201
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const del: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { path } = await event.request.json();
-
- try {
- await db.prisma.applicationPersistentStorage.deleteMany({ where: { applicationId: id, path } });
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/[id]/usage.json.ts b/src/routes/applications/[id]/usage.json.ts
deleted file mode 100644
index ab161d81eb..0000000000
--- a/src/routes/applications/[id]/usage.json.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { getContainerUsage } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- let usage = {};
- try {
- const application = await db.getApplication({ id, teamId });
- if (application.destinationDockerId) {
- [usage] = await Promise.all([getContainerUsage(application.destinationDocker.engine, id)]);
- }
- return {
- status: 200,
- body: {
- usage
- },
- headers: {}
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/index.ts b/src/routes/applications/index.ts
deleted file mode 100644
index 640577e164..0000000000
--- a/src/routes/applications/index.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- try {
- const applications = await db.listApplications(teamId);
- return {
- status: 200,
- body: {
- applications
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/applications/new.ts b/src/routes/applications/new.ts
deleted file mode 100644
index 62d55edf64..0000000000
--- a/src/routes/applications/new.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { getUserDetails, uniqueName } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const name = uniqueName();
- try {
- const { id } = await db.newApplication({ name, teamId });
- return { status: 201, body: { id } };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/common/getUniqueName.json.ts b/src/routes/common/getUniqueName.json.ts
deleted file mode 100644
index b1b4a00501..0000000000
--- a/src/routes/common/getUniqueName.json.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { uniqueName } from '$lib/common';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async () => {
- return {
- body: {
- name: uniqueName()
- }
- };
-};
diff --git a/src/routes/dashboard.json.ts b/src/routes/dashboard.json.ts
deleted file mode 100644
index 1b95288617..0000000000
--- a/src/routes/dashboard.json.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-import os from 'node:os';
-import osu from 'node-os-utils';
-
-export const get: RequestHandler = async (event) => {
- const { userId, teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const usage = event.url.searchParams.get('usage');
- if (usage) {
- try {
- return {
- status: 200,
- body: {
- uptime: os.uptime(),
- memory: await osu.mem.info(),
- cpu: {
- load: os.loadavg(),
- usage: await osu.cpu.usage(),
- count: os.cpus().length
- },
- disk: await osu.drive.info()
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- } else {
- try {
- const applicationsCount = await db.prisma.application.count({
- where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } }
- });
- const sourcesCount = await db.prisma.gitSource.count({
- where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } }
- });
- const destinationsCount = await db.prisma.destinationDocker.count({
- where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } }
- });
- const teamsCount = await db.prisma.permission.count({ where: { userId } });
- const databasesCount = await db.prisma.database.count({
- where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } }
- });
- const servicesCount = await db.prisma.service.count({
- where: { teams: { some: { id: teamId === '0' ? undefined : teamId } } }
- });
- const teams = await db.prisma.permission.findMany({
- where: { userId },
- include: { team: { include: { _count: { select: { users: true } } } } }
- });
- const settings = await db.prisma.setting.findFirst();
- return {
- body: {
- teams,
- applicationsCount,
- sourcesCount,
- destinationsCount,
- teamsCount,
- databasesCount,
- servicesCount,
- settings
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event, false);
- if (status === 401) return { status, body };
-
- const { cookie, value } = await event.request.json();
- const from = event.url.searchParams.get('from') || '/';
-
- return {
- status: 302,
- body: {},
- headers: {
- 'set-cookie': [
- `${cookie}=${value}; HttpOnly; Path=/; Max-Age=15778800;`,
- 'gitlabToken=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT',
- 'githubToken=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'
- ],
- Location: from
- }
- };
-};
diff --git a/src/routes/databases/[id]/__layout.svelte b/src/routes/databases/[id]/__layout.svelte
deleted file mode 100644
index 2696910f7f..0000000000
--- a/src/routes/databases/[id]/__layout.svelte
+++ /dev/null
@@ -1,250 +0,0 @@
-<script context="module" lang="ts">
- import type { Load } from '@sveltejs/kit';
- function checkConfiguration(database): string {
- let configurationPhase = null;
- if (!database.type) {
- configurationPhase = 'type';
- } else if (!database.version) {
- configurationPhase = 'version';
- } else if (!database.destinationDockerId) {
- configurationPhase = 'destination';
- }
- return configurationPhase;
- }
- export const load: Load = async ({ fetch, params, url }) => {
- const endpoint = `/databases/${params.id}.json`;
- const res = await fetch(endpoint);
- if (res.ok) {
- const { database, isRunning, versions, privatePort, settings } = await res.json();
- if (!database || Object.entries(database).length === 0) {
- return {
- status: 302,
- redirect: '/databases'
- };
- }
- const configurationPhase = checkConfiguration(database);
- if (
- configurationPhase &&
- url.pathname !== `/databases/${params.id}/configuration/${configurationPhase}`
- ) {
- return {
- status: 302,
- redirect: `/databases/${params.id}/configuration/${configurationPhase}`
- };
- }
- return {
- props: {
- database,
- isRunning,
- versions,
- privatePort
- },
- stuff: {
- database,
- isRunning,
- versions,
- privatePort,
- settings
- }
- };
- }
-
- return {
- status: 302,
- redirect: '/databases'
- };
- };
-</script>
-
-<script>
- import { page, session } from '$app/stores';
- import { errorNotification } from '$lib/form';
- import DeleteIcon from '$lib/components/DeleteIcon.svelte';
- import Loading from '$lib/components/Loading.svelte';
- import { del, post } from '$lib/api';
- import { goto } from '$app/navigation';
- import { t } from '$lib/translations';
-
- const { id } = $page.params;
-
- export let database;
- export let isRunning;
- let loading = false;
-
- async function deleteDatabase() {
- const sure = confirm(`Are you sure you would like to delete '${database.name}'?`);
- if (sure) {
- loading = true;
- try {
- await del(`/databases/${database.id}/delete.json`, { id: database.id });
- return await goto('/databases');
- } catch ({ error }) {
- return errorNotification(error);
- } finally {
- loading = false;
- }
- }
- }
- async function stopDatabase() {
- const sure = confirm($t('database.confirm_stop', { name: database.name }));
- if (sure) {
- loading = true;
- try {
- await post(`/databases/${database.id}/stop.json`, {});
- return window.location.reload();
- } catch ({ error }) {
- return errorNotification(error);
- }
- }
- }
- async function startDatabase() {
- loading = true;
- try {
- await post(`/databases/${database.id}/start.json`, {});
- return window.location.reload();
- } catch ({ error }) {
- return errorNotification(error);
- }
- }
-</script>
-
-<nav class="nav-side">
- {#if loading}
- <Loading fullscreen cover />
- {:else}
- {#if database.type && database.destinationDockerId && database.version && database.defaultDatabase}
- {#if isRunning}
- <button
- on:click={stopDatabase}
- title={$t('database.stop_database')}
- type="submit"
- disabled={!$session.isAdmin}
- class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-red-500"
- data-tooltip={$session.isAdmin
- ? $t('database.stop_database')
- : $t('database.permission_denied_stop_database')}
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="w-6 h-6"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentColor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <rect x="6" y="5" width="4" height="14" rx="1" />
- <rect x="14" y="5" width="4" height="14" rx="1" />
- </svg>
- </button>
- {:else}
- <button
- on:click={startDatabase}
- title={$t('database.start_database')}
- type="submit"
- disabled={!$session.isAdmin}
- class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-green-500"
- data-tooltip={$session.isAdmin
- ? $t('database.start_database')
- : $t('database.permission_denied_start_database')}
- ><svg
- xmlns="http://www.w3.org/2000/svg"
- class="w-6 h-6"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentColor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path d="M7 4v16l13 -8z" />
- </svg>
- </button>
- {/if}
- {/if}
- <div class="border border-stone-700 h-8" />
- <a
- href="/databases/{id}"
- sveltekit:prefetch
- class="hover:text-yellow-500 rounded"
- class:text-yellow-500={$page.url.pathname === `/databases/${id}`}
- class:bg-coolgray-500={$page.url.pathname === `/databases/${id}`}
- >
- <button
- title={$t('application.configurations')}
- class="icons bg-transparent tooltip-bottom text-sm disabled:text-red-500"
- data-tooltip={$t('application.configurations')}
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="h-6 w-6"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentColor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <rect x="4" y="8" width="4" height="4" />
- <line x1="6" y1="4" x2="6" y2="8" />
- <line x1="6" y1="12" x2="6" y2="20" />
- <rect x="10" y="14" width="4" height="4" />
- <line x1="12" y1="4" x2="12" y2="14" />
- <line x1="12" y1="18" x2="12" y2="20" />
- <rect x="16" y="5" width="4" height="4" />
- <line x1="18" y1="4" x2="18" y2="5" />
- <line x1="18" y1="9" x2="18" y2="20" />
- </svg></button
- ></a
- >
- <div class="border border-stone-700 h-8" />
- <a
- href={isRunning ? `/databases/${id}/logs` : null}
- sveltekit:prefetch
- class="hover:text-pink-500 rounded"
- class:text-pink-500={$page.url.pathname === `/databases/${id}/logs`}
- class:bg-coolgray-500={$page.url.pathname === `/databases/${id}/logs`}
- >
- <button
- title={$t('database.logs')}
- disabled={!isRunning}
- class="icons bg-transparent tooltip-bottom text-sm"
- data-tooltip={$t('database.logs')}
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="h-6 w-6"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentColor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path d="M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />
- <path d="M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />
- <line x1="3" y1="6" x2="3" y2="19" />
- <line x1="12" y1="6" x2="12" y2="19" />
- <line x1="21" y1="6" x2="21" y2="19" />
- </svg></button
- ></a
- >
- <button
- on:click={deleteDatabase}
- title={$t('database.delete_database')}
- type="submit"
- disabled={!$session.isAdmin}
- class:hover:text-red-500={$session.isAdmin}
- class="icons bg-transparent tooltip-bottom text-sm"
- data-tooltip={$session.isAdmin
- ? $t('database.delete_database')
- : $t('database.permission_denied_delete_database')}><DeleteIcon /></button
- >
- {/if}
-</nav>
-<slot />
diff --git a/src/routes/databases/[id]/configuration/destination.json.ts b/src/routes/databases/[id]/configuration/destination.json.ts
deleted file mode 100644
index ae7cf2fce5..0000000000
--- a/src/routes/databases/[id]/configuration/destination.json.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { destinationId } = await event.request.json();
-
- try {
- await db.configureDestinationForDatabase({ id, destinationId });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/databases/[id]/configuration/type.json.ts b/src/routes/databases/[id]/configuration/type.json.ts
deleted file mode 100644
index 8ab007891b..0000000000
--- a/src/routes/databases/[id]/configuration/type.json.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import { supportedDatabaseTypesAndVersions } from '$lib/components/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- return {
- status: 200,
- body: {
- types: supportedDatabaseTypesAndVersions
- }
- };
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { type } = await event.request.json();
-
- try {
- await db.configureDatabaseType({ id, type });
- return {
- status: 201
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/databases/[id]/configuration/version.json.ts b/src/routes/databases/[id]/configuration/version.json.ts
deleted file mode 100644
index 0007170161..0000000000
--- a/src/routes/databases/[id]/configuration/version.json.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import { supportedDatabaseTypesAndVersions } from '$lib/components/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { type } = await db.getDatabase({ id, teamId });
-
- return {
- status: 200,
- body: {
- versions: supportedDatabaseTypesAndVersions.find((name) => name.name === type).versions
- }
- };
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { version } = await event.request.json();
-
- try {
- await db.setDatabase({ id, version });
- return {
- status: 201
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/databases/[id]/delete.json.ts b/src/routes/databases/[id]/delete.json.ts
deleted file mode 100644
index 71c05130c9..0000000000
--- a/src/routes/databases/[id]/delete.json.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler, stopDatabase } from '$lib/database';
-import { stopTcpHttpProxy } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const del: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
- try {
- const database = await db.getDatabase({ id, teamId });
- if (database.destinationDockerId) {
- const everStarted = await stopDatabase(database);
- if (everStarted) await stopTcpHttpProxy(id, database.destinationDocker, database.publicPort);
- }
- await db.removeDatabase({ id });
- return { status: 200 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/databases/[id]/index.json.ts b/src/routes/databases/[id]/index.json.ts
deleted file mode 100644
index 830deee103..0000000000
--- a/src/routes/databases/[id]/index.json.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-import { asyncExecShell, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import {
- generateDatabaseConfiguration,
- getVersions,
- ErrorHandler,
- updatePasswordInDb
-} from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- try {
- const database = await db.getDatabase({ id, teamId });
- const { destinationDockerId, destinationDocker } = database;
-
- let isRunning = false;
- if (destinationDockerId) {
- const host = getEngine(destinationDocker.engine);
-
- try {
- const { stdout } = await asyncExecShell(
- `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`
- );
-
- if (JSON.parse(stdout).Running) {
- isRunning = true;
- }
- } catch (error) {
- //
- }
- }
- const configuration = generateDatabaseConfiguration(database);
- const settings = await db.listSettings();
- return {
- body: {
- privatePort: configuration?.privatePort,
- database,
- isRunning,
- versions: getVersions(database.type),
- settings
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
- const {
- name,
- defaultDatabase,
- dbUser,
- dbUserPassword,
- rootUser,
- rootUserPassword,
- version,
- isRunning
- } = await event.request.json();
-
- try {
- const database = await db.getDatabase({ id, teamId });
- if (isRunning) {
- if (database.dbUserPassword !== dbUserPassword) {
- await updatePasswordInDb(database, dbUser, dbUserPassword, false);
- } else if (database.rootUserPassword !== rootUserPassword) {
- await updatePasswordInDb(database, rootUser, rootUserPassword, true);
- }
- }
- await db.updateDatabase({
- id,
- name,
- defaultDatabase,
- dbUser,
- dbUserPassword,
- rootUser,
- rootUserPassword,
- version
- });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/databases/[id]/logs/index.json.ts b/src/routes/databases/[id]/logs/index.json.ts
deleted file mode 100644
index 7aff718b43..0000000000
--- a/src/routes/databases/[id]/logs/index.json.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { dayjs } from '$lib/dayjs';
-import { dockerInstance } from '$lib/docker';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- let since = event.url.searchParams.get('since') || 0;
- if (since !== 0) {
- since = dayjs(since).unix();
- }
- try {
- const { destinationDockerId, destinationDocker } = await db.prisma.database.findUnique({
- where: { id },
- include: { destinationDocker: true }
- });
- if (destinationDockerId) {
- const docker = dockerInstance({ destinationDocker });
- try {
- const container = await docker.engine.getContainer(id);
- if (container) {
- const logs = (
- await container.logs({
- stdout: true,
- stderr: true,
- timestamps: true,
- since,
- tail: 5000
- })
- )
- .toString()
- .split('\n')
- .map((l) => l.slice(8))
- .filter((a) => a);
- return {
- body: {
- logs
- }
- };
- }
- } catch (error) {
- const { statusCode } = error;
- if (statusCode === 404) {
- return {
- body: {
- logs: []
- }
- };
- }
- }
- }
- return {
- status: 200,
- body: {
- message: 'No logs found.'
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/databases/[id]/settings.json.ts b/src/routes/databases/[id]/settings.json.ts
deleted file mode 100644
index 1c2002890c..0000000000
--- a/src/routes/databases/[id]/settings.json.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { generateDatabaseConfiguration, ErrorHandler, getFreePort } from '$lib/database';
-import { startTcpProxy, startTraefikTCPProxy, stopTcpHttpProxy } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body, teamId } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { isPublic, appendOnly = true } = await event.request.json();
- const publicPort = await getFreePort();
-
- try {
- const settings = await db.listSettings();
- await db.setDatabase({ id, isPublic, appendOnly });
- const database = await db.getDatabase({ id, teamId });
- const { destinationDockerId, destinationDocker, publicPort: oldPublicPort } = database;
- const { privatePort } = generateDatabaseConfiguration(database);
-
- if (destinationDockerId) {
- if (isPublic) {
- await db.prisma.database.update({ where: { id }, data: { publicPort } });
- if (settings.isTraefikUsed) {
- await startTraefikTCPProxy(destinationDocker, id, publicPort, privatePort);
- } else {
- await startTcpProxy(destinationDocker, id, publicPort, privatePort);
- }
- } else {
- await db.prisma.database.update({ where: { id }, data: { publicPort: null } });
- await stopTcpHttpProxy(id, destinationDocker, oldPublicPort);
- }
- }
- return {
- status: 201,
- body: {
- publicPort
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/databases/[id]/start.json.ts b/src/routes/databases/[id]/start.json.ts
deleted file mode 100644
index 7a7d8dedfd..0000000000
--- a/src/routes/databases/[id]/start.json.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { generateDatabaseConfiguration, ErrorHandler } from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { makeLabelForStandaloneDatabase } from '$lib/buildPacks/common';
-import { startTcpProxy } from '$lib/haproxy';
-import type { ComposeFile } from '$lib/types/composeFile';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const database = await db.getDatabase({ id, teamId });
- const {
- type,
- destinationDockerId,
- destinationDocker,
- publicPort,
- settings: { isPublic }
- } = database;
- const { privatePort, environmentVariables, image, volume, ulimits } =
- generateDatabaseConfiguration(database);
-
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const engine = destinationDocker.engine;
- const volumeName = volume.split(':')[0];
- const labels = await makeLabelForStandaloneDatabase({ id, image, volume });
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
-
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image,
- networks: [network],
- environment: environmentVariables,
- volumes: [volume],
- ulimits,
- labels,
- restart: 'always',
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [volumeName]: {
- external: true
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker volume create ${volumeName}`);
- } catch (error) {
- console.log(error);
- }
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- if (isPublic) await startTcpProxy(destinationDocker, id, publicPort, privatePort);
- return {
- status: 200
- };
- } catch (error) {
- throw {
- error
- };
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/databases/[id]/stop.json.ts b/src/routes/databases/[id]/stop.json.ts
deleted file mode 100644
index 15c5c6e411..0000000000
--- a/src/routes/databases/[id]/stop.json.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler, stopDatabase } from '$lib/database';
-import { stopTcpHttpProxy } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const database = await db.getDatabase({ id, teamId });
- const everStarted = await stopDatabase(database);
- if (everStarted) await stopTcpHttpProxy(id, database.destinationDocker, database.publicPort);
- await db.setDatabase({ id, isPublic: false });
- await db.prisma.database.update({ where: { id }, data: { publicPort: null } });
-
- return {
- status: 200
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/databases/[id]/usage.json.ts b/src/routes/databases/[id]/usage.json.ts
deleted file mode 100644
index 9ec987310d..0000000000
--- a/src/routes/databases/[id]/usage.json.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { getContainerUsage } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- let usage = {};
- try {
- const database = await db.getDatabase({ id, teamId });
- if (database.destinationDockerId) {
- [usage] = await Promise.all([getContainerUsage(database.destinationDocker.engine, id)]);
- }
- return {
- status: 200,
- body: {
- usage
- },
- headers: {}
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/databases/index.ts b/src/routes/databases/index.ts
deleted file mode 100644
index 29cdad39ca..0000000000
--- a/src/routes/databases/index.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- try {
- const databases = await db.listDatabases(teamId);
- return {
- status: 200,
- body: {
- databases
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/databases/new.ts b/src/routes/databases/new.ts
deleted file mode 100644
index 86bf028bf5..0000000000
--- a/src/routes/databases/new.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { getUserDetails, uniqueName } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const name = uniqueName();
- try {
- const { id } = await db.newDatabase({ name, teamId });
- return { status: 201, body: { id } };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/destinations/[id]/_FoundApp.svelte b/src/routes/destinations/[id]/_FoundApp.svelte
deleted file mode 100644
index f6c44bb258..0000000000
--- a/src/routes/destinations/[id]/_FoundApp.svelte
+++ /dev/null
@@ -1,78 +0,0 @@
-<script lang="ts">
- export let app;
- import { onMount } from 'svelte';
- import { page } from '$app/stores';
- import { t } from '$lib/translations';
- const { id } = $page.params;
- let loading = true;
- async function checkApp() {
- const form = new FormData();
- form.append('name', app.name);
- form.append('domain', app.domain);
- form.append('projectId', app.projectId);
- form.append('repository', app.repository);
- form.append('branch', app.branch);
- const response = await fetch(`/destinations/${id}/scan.json`, {
- method: 'POST',
- headers: {
- accept: 'application/json'
- },
- body: form
- });
- if (response.ok) {
- const { by, name } = await response.json();
- if (by === 'domain') {
- app.foundByDomain = true;
- } else if (by === 'repository') {
- app.foundByRepository = true;
- }
- app.foundName = name;
- }
- }
- onMount(async () => {
- await checkApp();
- loading = false;
- });
- async function addToCoolify() {
- const form = new FormData();
- form.append('name', app.name);
- form.append('domain', app.domain);
- if (app.port) form.append('port', app.port);
- if (app.buildCommand) form.append('buildCommand', app.buildCommand);
- if (app.startCommand) form.append('startCommand', app.startCommand);
- if (app.installCommand) form.append('installCommand', app.installCommand);
-
- const response = await fetch(`/new/application/import.json`, {
- method: 'POST',
- headers: {
- accept: 'application/json'
- },
- body: form
- });
- if (response.ok) {
- const { id } = await response.json();
- window.location.replace(`/applications/${id}`);
- }
- }
-</script>
-
-<div class="box-selection hover:border-transparent hover:bg-coolgray-200">
- <div class="truncate pb-2 text-center text-xl font-bold">{app.domain}</div>
- {#if loading}
- <div class="w-full text-center font-bold">{$t('forms.loading')}</div>
- {:else if app.foundByDomain}
- <div class="w-full bg-coolgray-200 text-xs">
- {@html $t('forms.already_used_for', { type: 'Domains' })}
- <span class="text-red-500">{app.foundName}</span>
- </div>
- {:else if app.foundByRepository}
- <div class="w-full bg-coolgray-200 text-xs">
- {@html $t('forms.already_used_for', { type: 'Repository' })}
- <span class="text-red-500">{app.foundName}</span>
- </div>
- {:else}
- <button class="bg-green-600 hover:bg-green-500 w-full" on:click={addToCoolify}
- >{$t('destination.add_to_coolify')}</button
- >
- {/if}
-</div>
diff --git a/src/routes/destinations/[id]/__layout.svelte b/src/routes/destinations/[id]/__layout.svelte
deleted file mode 100644
index 6d49fbb634..0000000000
--- a/src/routes/destinations/[id]/__layout.svelte
+++ /dev/null
@@ -1,69 +0,0 @@
-<script context="module" lang="ts">
- import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params }) => {
- const url = `/destinations/${params.id}.json`;
- const res = await fetch(url);
- if (res.ok) {
- const { destination, state, settings } = await res.json();
- if (!destination || Object.entries(destination).length === 0) {
- return {
- status: 302,
- redirect: '/destinations'
- };
- }
- return {
- props: {
- destination,
- state
- },
- stuff: {
- destination,
- settings,
- state
- }
- };
- }
-
- return {
- status: 302,
- redirect: '/destinations'
- };
- };
-</script>
-
-<script>
- import { session } from '$app/stores';
- import { errorNotification } from '$lib/form';
- import DeleteIcon from '$lib/components/DeleteIcon.svelte';
- import { del } from '$lib/api';
- import { goto } from '$app/navigation';
- import { t } from '$lib/translations';
-
- export let destination;
- async function deleteDestination(destination) {
- const sure = confirm($t('application.confirm_to_delete', { name: destination.name }));
- if (sure) {
- try {
- await del(`/destinations/${destination.id}.json`, { id: destination.id });
- return await goto('/destinations');
- } catch ({ error }) {
- return errorNotification(error);
- }
- }
- }
-</script>
-
-<nav class="nav-side">
- <button
- on:click={() => deleteDestination(destination)}
- title={$t('destination.delete_destination')}
- type="submit"
- disabled={!$session.isAdmin}
- class:hover:text-red-500={$session.isAdmin}
- class="icons tooltip-bottom bg-transparent text-sm"
- data-tooltip={$session.isAdmin
- ? $t('destination.delete_destination')
- : $t('destination.permission_denied_delete_destination')}><DeleteIcon /></button
- >
-</nav>
-<slot />
diff --git a/src/routes/destinations/[id]/index.json.ts b/src/routes/destinations/[id]/index.json.ts
deleted file mode 100644
index 8c4c67ceeb..0000000000
--- a/src/routes/destinations/[id]/index.json.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { asyncExecShell, getUserDetails } from '$lib/common';
-import { generateRemoteEngine } from '$lib/components/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
- try {
- const destination = await db.getDestination({ id, teamId });
- const settings = await db.listSettings();
- let payload = {
- destination,
- settings,
- state: false
- };
- if (destination.remoteEngine) {
- // const { stdout } = await asyncExecShell(
- // `ssh -p ${destination.port} ${destination.user}@${destination.ipAddress} "docker ps -a"`
- // );
- // console.log(stdout)
- // const engine = await generateRemoteEngine(destination);
- // // await saveSshKey(destination);
- // payload.state = await checkContainer(engine, 'coolify-haproxy');
- } else {
- let containerName = 'coolify-proxy';
- if (!settings.isTraefikUsed) {
- containerName = 'coolify-haproxy';
- }
- payload.state =
- destination?.engine && (await checkContainer(destination.engine, containerName));
- }
- return {
- status: 200,
- body: { ...payload }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { name, engine, network } = await event.request.json();
-
- try {
- await db.updateDestination({ id, name, engine, network });
- return { status: 200 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const del: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- await db.removeDestination({ id });
- return { status: 200 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/destinations/[id]/index.svelte b/src/routes/destinations/[id]/index.svelte
deleted file mode 100644
index dabc3c88f1..0000000000
--- a/src/routes/destinations/[id]/index.svelte
+++ /dev/null
@@ -1,57 +0,0 @@
-<script context="module" lang="ts">
- import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params, stuff }) => {
- if (stuff?.destination.id) {
- return {
- props: {
- destination: stuff.destination,
- state: stuff.state,
- settings: stuff.settings
- }
- };
- }
- const url = `/destinations/${params.id}.json`;
- const res = await fetch(url);
-
- if (res.ok) {
- return {
- props: {
- ...(await res.json())
- }
- };
- }
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
- };
-</script>
-
-<script lang="ts">
- export let destination: Prisma.DestinationDocker;
- export let settings;
- export let state;
-
- import type Prisma from '@prisma/client';
- import LocalDocker from './_LocalDocker.svelte';
- import RemoteDocker from './_RemoteDocker.svelte';
- import { t } from '$lib/translations';
-</script>
-
-<div class="flex h-20 items-center space-x-2 p-5 px-6 font-bold">
- <div class="-mb-5 flex-col">
- <div class="md:max-w-64 truncate text-base tracking-tight md:text-2xl lg:block">
- Configuration
- </div>
- <span class="text-xs">{destination.name}</span>
- </div>
-</div>
-
-<div class="mx-auto max-w-4xl px-6">
- {#if destination.remoteEngine}
- <RemoteDocker bind:destination {settings} {state} />
- {:else}
- <LocalDocker bind:destination {settings} {state} />
- {/if}
-</div>
diff --git a/src/routes/destinations/[id]/restart.json.ts b/src/routes/destinations/[id]/restart.json.ts
deleted file mode 100644
index c2cf88fa4c..0000000000
--- a/src/routes/destinations/[id]/restart.json.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import { ErrorHandler } from '$lib/database';
-import * as db from '$lib/database';
-import {
- startCoolifyProxy,
- startTraefikProxy,
- stopCoolifyProxy,
- stopTraefikProxy
-} from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { engine } = await event.request.json();
-
- try {
- const settings = await db.prisma.setting.findFirst({});
- if (settings?.isTraefikUsed) {
- await stopTraefikProxy(engine);
- await startTraefikProxy(engine);
- } else {
- await stopCoolifyProxy(engine);
- await startCoolifyProxy(engine);
- }
- await db.setDestinationSettings({ engine, isCoolifyProxyUsed: true });
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/destinations/[id]/scan.json.ts b/src/routes/destinations/[id]/scan.json.ts
deleted file mode 100644
index 400c2c7e2d..0000000000
--- a/src/routes/destinations/[id]/scan.json.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import { asyncExecShell, getTeam, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { dockerInstance } from '$lib/docker';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (request) => {
- const { teamId, status, body } = await getUserDetails(request);
- if (status === 401) return { status, body };
-
- const { id } = request.params;
-
- const destinationDocker = await db.getDestination({ id, teamId });
- const docker = dockerInstance({ destinationDocker });
- const listContainers = await docker.engine.listContainers({
- filters: { network: [destinationDocker.network] }
- });
- const containers = listContainers.filter((container) => {
- return container.Labels['coolify.configuration'];
- });
- const jsonContainers = containers
- .map((container) =>
- JSON.parse(Buffer.from(container.Labels['coolify.configuration'], 'base64').toString())
- )
- .filter((container) => container.type === 'manual');
- return {
- body: {
- containers: jsonContainers
- }
- };
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- let { fqdn, projectId, repository, branch } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (projectId) projectId = Number(projectId);
-
- try {
- const foundByDomain = await db.prisma.application.findFirst({ where: { fqdn } });
- const foundByRepository = await db.prisma.application.findFirst({
- where: { repository, branch, projectId }
- });
- if (foundByDomain) {
- return {
- status: 200,
- body: { by: 'domain', name: foundByDomain.name }
- };
- }
- if (foundByRepository) {
- return {
- status: 200,
- body: { by: 'repository', name: foundByRepository.name }
- };
- }
- return {
- status: 404
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/destinations/[id]/settings.json.ts b/src/routes/destinations/[id]/settings.json.ts
deleted file mode 100644
index 84a5be120a..0000000000
--- a/src/routes/destinations/[id]/settings.json.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { engine, isCoolifyProxyUsed } = await event.request.json();
-
- try {
- await db.setDestinationSettings({ engine, isCoolifyProxyUsed });
- return { status: 200 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/destinations/[id]/start.json.ts b/src/routes/destinations/[id]/start.json.ts
deleted file mode 100644
index 8651875427..0000000000
--- a/src/routes/destinations/[id]/start.json.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import { ErrorHandler } from '$lib/database';
-import * as db from '$lib/database';
-import {
- startCoolifyProxy,
- startTraefikProxy,
- stopCoolifyProxy,
- stopTraefikProxy
-} from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { engine } = await event.request.json();
- const settings = await db.prisma.setting.findFirst({});
-
- try {
- if (settings?.isTraefikUsed) {
- await startTraefikProxy(engine);
- } else {
- await startCoolifyProxy(engine);
- }
-
- return {
- status: 200
- };
- } catch (error) {
- if (settings?.isTraefikUsed) {
- await stopTraefikProxy(engine);
- } else {
- await stopCoolifyProxy(engine);
- }
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/destinations/[id]/stop.json.ts b/src/routes/destinations/[id]/stop.json.ts
deleted file mode 100644
index a1e01d2184..0000000000
--- a/src/routes/destinations/[id]/stop.json.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import { ErrorHandler } from '$lib/database';
-import * as db from '$lib/database';
-import { stopCoolifyProxy, stopTraefikProxy } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { engine } = await event.request.json();
- try {
- const settings = await db.prisma.setting.findFirst({});
- if (settings?.isTraefikUsed) {
- await stopTraefikProxy(engine);
- } else {
- await stopCoolifyProxy(engine);
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/destinations/index.json.ts b/src/routes/destinations/index.json.ts
deleted file mode 100644
index 0d8d3d0bc6..0000000000
--- a/src/routes/destinations/index.json.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { getTeam, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (request) => {
- const { teamId, status, body } = await getUserDetails(request);
- if (status === 401) return { status, body };
-
- try {
- return {
- body: {
- destinations: await db.listDestinations(teamId)
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/iam/index.json.ts b/src/routes/iam/index.json.ts
deleted file mode 100644
index 6ff142eb3b..0000000000
--- a/src/routes/iam/index.json.ts
+++ /dev/null
@@ -1,135 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, userId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- try {
- const account = await db.prisma.user.findUnique({
- where: { id: userId },
- select: { id: true, email: true, teams: true }
- });
- let accounts = [];
- let allTeams = [];
- if (teamId === '0') {
- accounts = await db.prisma.user.findMany({ select: { id: true, email: true, teams: true } });
- allTeams = await db.prisma.team.findMany({
- where: { users: { none: { id: userId } } },
- include: { permissions: true }
- });
- }
- const ownTeams = await db.prisma.team.findMany({
- where: { users: { some: { id: userId } } },
- include: { permissions: true }
- });
-
- const invitations = await db.prisma.teamInvitation.findMany({ where: { uid: userId } });
- return {
- status: 200,
- body: {
- ownTeams,
- allTeams,
- invitations,
- account,
- accounts
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, userId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- if (teamId !== '0')
- return { status: 401, body: { message: 'You are not authorized to perform this action' } };
-
- const { id } = await event.request.json();
- try {
- const aloneInTeams = await db.prisma.team.findMany({ where: { users: { every: { id } } } });
- if (aloneInTeams.length > 0) {
- for (const team of aloneInTeams) {
- const applications = await db.prisma.application.findMany({
- where: { teams: { every: { id: team.id } } }
- });
- if (applications.length > 0) {
- for (const application of applications) {
- await db.prisma.application.update({
- where: { id: application.id },
- data: { teams: { connect: { id: '0' } } }
- });
- }
- }
- const services = await db.prisma.service.findMany({
- where: { teams: { every: { id: team.id } } }
- });
- if (services.length > 0) {
- for (const service of services) {
- await db.prisma.service.update({
- where: { id: service.id },
- data: { teams: { connect: { id: '0' } } }
- });
- }
- }
- const databases = await db.prisma.database.findMany({
- where: { teams: { every: { id: team.id } } }
- });
- if (databases.length > 0) {
- for (const database of databases) {
- await db.prisma.database.update({
- where: { id: database.id },
- data: { teams: { connect: { id: '0' } } }
- });
- }
- }
- const sources = await db.prisma.gitSource.findMany({
- where: { teams: { every: { id: team.id } } }
- });
- if (sources.length > 0) {
- for (const source of sources) {
- await db.prisma.gitSource.update({
- where: { id: source.id },
- data: { teams: { connect: { id: '0' } } }
- });
- }
- }
- const destinations = await db.prisma.destinationDocker.findMany({
- where: { teams: { every: { id: team.id } } }
- });
- if (destinations.length > 0) {
- for (const destination of destinations) {
- await db.prisma.destinationDocker.update({
- where: { id: destination.id },
- data: { teams: { connect: { id: '0' } } }
- });
- }
- }
- await db.prisma.teamInvitation.deleteMany({ where: { teamId: team.id } });
- await db.prisma.permission.deleteMany({ where: { teamId: team.id } });
- await db.prisma.user.delete({ where: { id } });
- await db.prisma.team.delete({ where: { id: team.id } });
- }
- }
-
- const notAloneInTeams = await db.prisma.team.findMany({ where: { users: { some: { id } } } });
- if (notAloneInTeams.length > 0) {
- for (const team of notAloneInTeams) {
- await db.prisma.team.update({
- where: { id: team.id },
- data: { users: { disconnect: { id } } }
- });
- }
- }
- return {
- status: 201
- };
- } catch (error) {
- return {
- status: 500
- };
- }
-};
diff --git a/src/routes/iam/password.json.ts b/src/routes/iam/password.json.ts
deleted file mode 100644
index b8ba2ca8e5..0000000000
--- a/src/routes/iam/password.json.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, userId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = await event.request.json();
- try {
- await db.prisma.user.update({ where: { id }, data: { password: 'RESETME' } });
- return {
- status: 201
- };
- } catch (error) {
- console.log(error);
- return {
- status: 500
- };
- }
-};
diff --git a/src/routes/iam/team/[id]/__layout.svelte b/src/routes/iam/team/[id]/__layout.svelte
deleted file mode 100644
index 972ca111ff..0000000000
--- a/src/routes/iam/team/[id]/__layout.svelte
+++ /dev/null
@@ -1,28 +0,0 @@
-<script context="module" lang="ts">
- import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params }) => {
- const url = `/iam/team/${params.id}.json`;
- const res = await fetch(url);
- if (res.ok) {
- const data = await res.json();
- if (!data.permissions || Object.entries(data.permissions).length === 0) {
- return {
- status: 302,
- redirect: '/iam'
- };
- }
- return {
- stuff: {
- ...data
- }
- };
- }
-
- return {
- status: 302,
- redirect: '/iam'
- };
- };
-</script>
-
-<slot />
diff --git a/src/routes/iam/team/[id]/index.json.ts b/src/routes/iam/team/[id]/index.json.ts
deleted file mode 100644
index 7a06d4ab70..0000000000
--- a/src/routes/iam/team/[id]/index.json.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, userId, status, body } = await getUserDetails(event, false);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const user = await db.prisma.user.findFirst({
- where: { id: userId, teams: teamId === '0' ? undefined : { some: { id } } },
- include: { permission: true }
- });
- if (!user) {
- return {
- status: 401
- };
- }
- const permissions = await db.prisma.permission.findMany({
- where: { teamId: id },
- include: { user: { select: { id: true, email: true } } }
- });
- const team = await db.prisma.team.findUnique({ where: { id }, include: { permissions: true } });
- const invitations = await db.prisma.teamInvitation.findMany({ where: { teamId: team.id } });
- return {
- body: {
- team,
- permissions,
- invitations
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { name } = await event.request.json();
-
- try {
- await db.prisma.team.update({ where: { id }, data: { name: { set: name } } });
- return {
- status: 201
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/iam/team/[id]/invitation/accept.json.ts b/src/routes/iam/team/[id]/invitation/accept.json.ts
deleted file mode 100644
index 635283014b..0000000000
--- a/src/routes/iam/team/[id]/invitation/accept.json.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { dayjs } from '$lib/dayjs';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { userId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = await event.request.json();
-
- try {
- const invitation = await db.prisma.teamInvitation.findFirst({
- where: { uid: userId },
- rejectOnNotFound: true
- });
- await db.prisma.team.update({
- where: { id: invitation.teamId },
- data: { users: { connect: { id: userId } } }
- });
- await db.prisma.permission.create({
- data: {
- user: { connect: { id: userId } },
- permission: invitation.permission,
- team: { connect: { id: invitation.teamId } }
- }
- });
- await db.prisma.teamInvitation.delete({ where: { id } });
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/iam/team/[id]/invitation/invite.json.ts b/src/routes/iam/team/[id]/invitation/invite.json.ts
deleted file mode 100644
index 5354b0046d..0000000000
--- a/src/routes/iam/team/[id]/invitation/invite.json.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { dayjs } from '$lib/dayjs';
-import type { RequestHandler } from '@sveltejs/kit';
-
-async function createInvitation({ email, uid, teamId, teamName, permission }) {
- return await db.prisma.teamInvitation.create({
- data: { email, uid, teamId, teamName, permission }
- });
-}
-
-export const post: RequestHandler = async (event) => {
- const { userId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { email, permission, teamId, teamName } = await event.request.json();
-
- try {
- const userFound = await db.prisma.user.findUnique({ where: { email } });
- if (!userFound) {
- throw {
- error: `No user found with '${email}' email address.`
- };
- }
- const uid = userFound.id;
- // Invitation to yourself?!
- if (uid === userId) {
- throw {
- error: `Invitation to yourself? Whaaaaat?`
- };
- }
- const alreadyInTeam = await db.prisma.team.findFirst({
- where: { id: teamId, users: { some: { id: uid } } }
- });
- if (alreadyInTeam) {
- throw {
- error: `Already in the team.`
- };
- }
- const invitationFound = await db.prisma.teamInvitation.findFirst({ where: { uid, teamId } });
- if (invitationFound) {
- if (dayjs().toDate() < dayjs(invitationFound.createdAt).add(1, 'day').toDate()) {
- throw {
- error: 'Invitiation already pending on user confirmation.'
- };
- } else {
- await db.prisma.teamInvitation.delete({ where: { id: invitationFound.id } });
- await createInvitation({ email, uid, teamId, teamName, permission });
- return {
- status: 200,
- body: {
- message: 'Invitiation sent.'
- }
- };
- }
- } else {
- await createInvitation({ email, uid, teamId, teamName, permission });
- return {
- status: 200,
- body: {
- message: 'Invitiation sent.'
- }
- };
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/iam/team/[id]/invitation/revoke.json.ts b/src/routes/iam/team/[id]/invitation/revoke.json.ts
deleted file mode 100644
index 43bb2c77f1..0000000000
--- a/src/routes/iam/team/[id]/invitation/revoke.json.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { dayjs } from '$lib/dayjs';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { userId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = await event.request.json();
- try {
- await db.prisma.teamInvitation.delete({ where: { id } });
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/iam/team/[id]/permission/change.json.ts b/src/routes/iam/team/[id]/permission/change.json.ts
deleted file mode 100644
index 792bdeecb0..0000000000
--- a/src/routes/iam/team/[id]/permission/change.json.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { userId, newPermission, permissionId } = await event.request.json();
-
- try {
- await db.prisma.permission.updateMany({
- where: { id: permissionId, userId },
- data: { permission: { set: newPermission } }
- });
- return {
- status: 201
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/iam/team/[id]/remove/user.json.ts b/src/routes/iam/team/[id]/remove/user.json.ts
deleted file mode 100644
index 40b1c254bf..0000000000
--- a/src/routes/iam/team/[id]/remove/user.json.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { userId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { teamId, uid } = await event.request.json();
-
- try {
- await db.prisma.team.update({
- where: { id: teamId },
- data: { users: { disconnect: { id: uid } } }
- });
- await db.prisma.permission.deleteMany({ where: { userId: uid, teamId } });
- return {
- status: 201
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/index.svelte b/src/routes/index.svelte
deleted file mode 100644
index 858a0387b4..0000000000
--- a/src/routes/index.svelte
+++ /dev/null
@@ -1,291 +0,0 @@
-<script context="module" lang="ts">
- import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, session }) => {
- const url = `/dashboard.json`;
- const res = await fetch(url);
-
- if (res.ok) {
- return {
- props: {
- ...(await res.json())
- }
- };
- }
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
- };
-</script>
-
-<script lang="ts">
- import { t } from '$lib/translations';
- import { get } from '$lib/api';
- import { onDestroy, onMount } from 'svelte';
- import Trend from './_Trend.svelte';
- import { session } from '$app/stores';
-
- export let applicationsCount: number;
- export let sourcesCount: number;
- export let destinationsCount: number;
- export let teamsCount: number;
- export let databasesCount: number;
- export let servicesCount: number;
- let loading = {
- usage: false
- };
- let usageInterval = null;
- let memoryWarning = false;
- let cpuWarning = false;
- let diskWarning = false;
-
- let trends = {
- memory: 'stable',
- cpu: 'stable',
- disk: 'stable'
- };
- let usage = {
- cpu: {
- load: [0, 0, 0],
- count: 0,
- usage: 0
- },
- memory: {
- totalMemMb: 0,
- freeMemMb: 0,
- usedMemMb: 0,
- freeMemPercentage: 0
- },
- disk: {
- freePercentage: 0,
- totalGb: 0,
- usedGb: 0
- }
- };
- async function getStatus() {
- if (loading.usage) return;
- try {
- loading.usage = true;
- const data = await get(`/dashboard.json?usage=true`);
- if (data.memory.freeMemPercentage === usage.memory.freeMemPercentage) {
- trends.memory = 'stable';
- } else {
- if (data.memory.freeMemPercentage > usage.memory.freeMemPercentage) {
- trends.memory = 'up';
- } else {
- trends.memory = 'down';
- }
- }
- if (data.cpu.usage === usage.cpu.usage) {
- trends.cpu = 'stable';
- } else {
- if (data.cpu.usage > usage.cpu.usage) {
- trends.cpu = 'up';
- } else {
- trends.cpu = 'down';
- }
- }
-
- if (data.disk.freePercentage === usage.disk.freePercentage) {
- trends.disk = 'stable';
- } else {
- if (data.disk.freePercentage > usage.disk.freePercentage) {
- trends.disk = 'up';
- } else {
- trends.disk = 'down';
- }
- }
-
- usage = data;
- if (usage.memory.freeMemPercentage < 15) {
- memoryWarning = true;
- } else {
- memoryWarning = false;
- }
- if (usage.cpu.usage > 90) {
- cpuWarning = true;
- } else {
- cpuWarning = false;
- }
- if (usage.disk.freePercentage < 10) {
- diskWarning = true;
- } else {
- diskWarning = false;
- }
- } catch (error) {
- } finally {
- loading.usage = false;
- }
- }
- onDestroy(() => {
- clearInterval(usageInterval);
- });
- onMount(async () => {
- if ($session.teamId === '0') {
- await getStatus();
- usageInterval = setInterval(async () => {
- await getStatus();
- }, 1000);
- }
- });
-</script>
-
-<div class="flex space-x-1 p-6 font-bold">
- <div class="mr-4 text-2xl tracking-tight">{$t('index.dashboard')}</div>
-</div>
-<div class="mt-10 pb-12 tracking-tight sm:pb-16">
- <div class="mx-auto max-w-4xl">
- {#if $session.teamId === '0'}
- <div class="px-6 text-2xl font-bold">Server Usage</div>
- <dl class="relative mt-5 grid grid-cols-1 gap-5 sm:grid-cols-3">
- <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
- <dt class="truncate text-sm font-medium text-white">Total Memory</dt>
- <dd class="mt-1 text-3xl font-semibold text-white">
- {(usage?.memory.totalMemMb).toFixed(0)}<span class="text-sm">MB</span>
- </dd>
- </div>
-
- <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
- <dt class="truncate text-sm font-medium text-white">Used Memory</dt>
- <dd class="mt-1 text-3xl font-semibold text-white ">
- {(usage?.memory.usedMemMb).toFixed(0)}<span class="text-sm">MB</span>
- </dd>
- </div>
-
- <div
- class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left"
- class:bg-red-500={memoryWarning}
- >
- <dt class="truncate text-sm font-medium text-white">Free Memory</dt>
- <dd class="mt-1 text-3xl font-semibold text-white">
- {usage?.memory.freeMemPercentage}<span class="text-sm">%</span>
- {#if !memoryWarning}
- <Trend trend={trends.memory} />
- {/if}
- </dd>
- </div>
- </dl>
- <dl class="relative mt-5 grid grid-cols-1 gap-5 sm:grid-cols-3">
- <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
- <dt class="truncate text-sm font-medium text-white">Total CPUs</dt>
- <dd class="mt-1 text-3xl font-semibold text-white">
- {usage?.cpu.count}
- </dd>
- </div>
- <div
- class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left"
- class:bg-red-500={cpuWarning}
- >
- <dt class="truncate text-sm font-medium text-white">CPU Usage</dt>
- <dd class="mt-1 text-3xl font-semibold text-white">
- {usage?.cpu.usage}<span class="text-sm">%</span>
- {#if !cpuWarning}
- <Trend trend={trends.cpu} />
- {/if}
- </dd>
- </div>
- <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
- <dt class="truncate text-sm font-medium text-white">Load Average (5/10/30mins)</dt>
- <dd class="mt-1 text-3xl font-semibold text-white">
- {usage?.cpu.load.join('/')}
- </dd>
- </div>
- </dl>
- <dl class="relative mt-5 grid grid-cols-1 gap-5 sm:grid-cols-3">
- <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
- <dt class="truncate text-sm font-medium text-white">Total Disk</dt>
- <dd class="mt-1 text-3xl font-semibold text-white">
- {usage?.disk.totalGb}<span class="text-sm">GB</span>
- </dd>
- </div>
- <div class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left">
- <dt class="truncate text-sm font-medium text-white">Used Disk</dt>
- <dd class="mt-1 text-3xl font-semibold text-white">
- {usage?.disk.usedGb}<span class="text-sm">GB</span>
- </dd>
- </div>
- <div
- class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left"
- class:bg-red-500={diskWarning}
- >
- <dt class="truncate text-sm font-medium text-white">Free Disk</dt>
- <dd class="mt-1 text-3xl font-semibold text-white">
- {usage?.disk.freePercentage}<span class="text-sm">%</span>
- {#if !diskWarning}
- <Trend trend={trends.disk} />
- {/if}
- </dd>
- </div>
- </dl>
- <div class="px-6 pt-20 text-2xl font-bold">Resources</div>
- {/if}
- <dl class="mt-5 grid grid-cols-1 gap-5 px-2 sm:grid-cols-3">
- <a
- href="/applications"
- sveltekit:prefetch
- class="overflow-hidden rounded px-4 py-5 text-center text-green-500 no-underline transition-all duration-100 hover:bg-green-500 hover:text-white sm:p-6 sm:text-left"
- >
- <dt class="truncate text-sm font-medium text-white">{$t('index.applications')}</dt>
- <dd class="mt-1 text-3xl font-semibold ">
- {applicationsCount}
- </dd>
- </a>
- <a
- href="/destinations"
- sveltekit:prefetch
- class="overflow-hidden rounded px-4 py-5 text-center text-sky-500 no-underline transition-all duration-100 hover:bg-sky-500 hover:text-white sm:p-6 sm:text-left"
- >
- <dt class="truncate text-sm font-medium text-white">{$t('index.destinations')}</dt>
- <dd class="mt-1 text-3xl font-semibold ">
- {destinationsCount}
- </dd>
- </a>
-
- <a
- href="/sources"
- sveltekit:prefetch
- class="overflow-hidden rounded px-4 py-5 text-center text-orange-500 no-underline transition-all duration-100 hover:bg-orange-500 hover:text-white sm:p-6 sm:text-left"
- >
- <dt class="truncate text-sm font-medium text-white">{$t('index.git_sources')}</dt>
- <dd class="mt-1 text-3xl font-semibold">
- {sourcesCount}
- </dd>
- </a>
- </dl>
- <dl class="mt-5 grid grid-cols-1 gap-5 px-2 sm:grid-cols-3">
- <a
- href="/databases"
- sveltekit:prefetch
- class="overflow-hidden rounded px-4 py-5 text-center text-purple-500 no-underline transition-all duration-100 hover:bg-purple-500 hover:text-white sm:p-6 sm:text-left"
- >
- <dt class="truncate text-sm font-medium text-white">{$t('index.databases')}</dt>
- <dd class="mt-1 text-3xl font-semibold ">
- {databasesCount}
- </dd>
- </a>
-
- <a
- href="/services"
- sveltekit:prefetch
- class="overflow-hidden rounded px-4 py-5 text-center text-pink-500 no-underline transition-all duration-100 hover:bg-pink-500 hover:text-white sm:p-6 sm:text-left"
- >
- <dt class="truncate text-sm font-medium text-white">{$t('index.services')}</dt>
- <dd class="mt-1 text-3xl font-semibold ">
- {servicesCount}
- </dd>
- </a>
-
- <a
- href="/iam"
- sveltekit:prefetch
- class="overflow-hidden rounded px-4 py-5 text-center text-cyan-500 no-underline transition-all duration-100 hover:bg-cyan-500 hover:text-white sm:p-6 sm:text-left"
- >
- <dt class="truncate text-sm font-medium text-white">{$t('index.teams')}</dt>
- <dd class="mt-1 text-3xl font-semibold ">
- {teamsCount}
- </dd>
- </a>
- </dl>
- </div>
-</div>
diff --git a/src/routes/login/index.json.ts b/src/routes/login/index.json.ts
deleted file mode 100644
index 222b7254de..0000000000
--- a/src/routes/login/index.json.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { email, password, isLogin } = await event.request.json();
-
- try {
- const { body } = await db.login({ email, password, isLogin });
- event.locals.session.data = body;
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const get: RequestHandler = async (event) => {
- const { userId } = await getUserDetails(event, false);
- if (!userId) {
- return {
- status: 401
- };
- }
- try {
- await db.getUser({ userId });
- return { status: 200 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/login/index.svelte b/src/routes/login/index.svelte
deleted file mode 100644
index 7ebefd55e8..0000000000
--- a/src/routes/login/index.svelte
+++ /dev/null
@@ -1,107 +0,0 @@
-<script lang="ts">
- import { browser } from '$app/env';
- import { goto } from '$app/navigation';
- import { session } from '$app/stores';
- import { post } from '$lib/api';
- import { errorNotification } from '$lib/form';
- import { t } from '$lib/translations';
- import { onMount } from 'svelte';
- let loading = false;
- let emailEl;
- let email, password;
-
- if (browser && $session.userId) {
- goto('/');
- }
- onMount(() => {
- emailEl.focus();
- });
- async function handleSubmit() {
- loading = true;
- try {
- const { teamId } = await post(`/login.json`, {
- email: email.toLowerCase(),
- password,
- isLogin: true
- });
- if (teamId === '0') {
- window.location.replace('/settings');
- } else {
- window.location.replace('/');
- }
- return;
- } catch ({ error }) {
- return errorNotification(error);
- } finally {
- loading = false;
- }
- }
-</script>
-
-<svelt:head>
- <title>{$t('login.login')}</title>
-</svelt:head>
-
-<div class="flex h-screen flex-col items-center justify-center">
- {#if $session.userId}
- <div class="flex justify-center px-4 text-xl font-bold">{$t('login.already_logged_in')}</div>
- {:else}
- <div class="flex justify-center px-4">
- <form on:submit|preventDefault={handleSubmit} class="flex flex-col py-4 space-y-2">
- {#if $session.whiteLabelDetails.icon}
- <img
- class="w-32 mx-auto pb-8"
- src={$session.whiteLabelDetails.icon}
- alt="Icon for white labeled version of Coolify"
- />
- {:else}
- <div class="text-6xl font-bold border-gradient w-48 mx-auto border-b-4 mb-8">Coolify</div>
- {/if}
- <input
- type="email"
- name="email"
- placeholder={$t('forms.email')}
- autocomplete="off"
- required
- bind:this={emailEl}
- bind:value={email}
- />
- <input
- type="password"
- name="password"
- placeholder={$t('forms.password')}
- bind:value={password}
- required
- />
-
- <div class="flex space-x-2 h-8 items-center justify-center pt-8">
- <button
- type="submit"
- disabled={loading}
- class="hover:opacity-90 text-white"
- class:bg-transparent={loading}
- class:text-stone-600={loading}
- class:bg-coollabs={!loading}
- >{loading ? $t('login.authenticating') : $t('login.login')}</button
- >
-
- <button
- on:click|preventDefault={() => goto('/register')}
- class="bg-transparent hover:bg-coolgray-300 text-white "
- >{$t('register.register')}</button
- >
- </div>
- </form>
- </div>
- {#if browser && window.location.host === 'demo.coolify.io'}
- <div class="pt-5 font-bold">
- Registration is <span class="text-pink-500">open</span>, just fill in an email (does not
- need to be live email address for the demo instance) and a password.
- </div>
- <div class="pt-5 font-bold">
- All users gets an <span class="text-pink-500">own namespace</span>, so you won't be able to
- access other users data.
- </div>
- {/if}
- {/if}
-</div>
diff --git a/src/routes/logout/index.json.ts b/src/routes/logout/index.json.ts
deleted file mode 100644
index 08ec57ac52..0000000000
--- a/src/routes/logout/index.json.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-export async function del({ locals }) {
- locals.session.destroy();
-
- return {
- headers: {
- 'set-cookie': [
- 'teamId=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT',
- 'gitlabToken=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'
- ]
- },
- body: {
- ok: true
- }
- };
-}
diff --git a/src/routes/new/destination/check.json.ts b/src/routes/new/destination/check.json.ts
deleted file mode 100644
index 54f099e4a4..0000000000
--- a/src/routes/new/destination/check.json.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import { isDockerNetworkExists, ErrorHandler } from '$lib/database';
-import { t } from '$lib/translations';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { network } = await event.request.json();
- try {
- const found = await isDockerNetworkExists({ network });
-
- if (found) {
- throw {
- error: t.get('destination.new_error_network_already_exists', { network: network })
- };
- }
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/new/destination/docker.json.ts b/src/routes/new/destination/docker.json.ts
deleted file mode 100644
index f3941e0251..0000000000
--- a/src/routes/new/destination/docker.json.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-import type { CreateDockerDestination } from '$lib/types/destinations';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const dockerDestinationProps = {
- ...((await event.request.json()) as Omit<CreateDockerDestination, 'teamId'>),
- teamId
- };
-
- try {
- const id = dockerDestinationProps.remoteEngine
- ? await db.newRemoteDestination(dockerDestinationProps)
- : await db.newLocalDestination(dockerDestinationProps);
- return { status: 200, body: { id } };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/new/team/index.json.ts b/src/routes/new/team/index.json.ts
deleted file mode 100644
index 7873e56f1a..0000000000
--- a/src/routes/new/team/index.json.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { getUserDetails, uniqueName } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { userId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { name } = await event.request.json();
-
- try {
- const { id } = await db.newTeam({ name, userId });
- return { status: 201, body: { id } };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/new/team/index.svelte b/src/routes/new/team/index.svelte
deleted file mode 100644
index aadf35d651..0000000000
--- a/src/routes/new/team/index.svelte
+++ /dev/null
@@ -1,56 +0,0 @@
-<script context="module" lang="ts">
- import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, session }) => {
- const url = `/common/getUniqueName.json`;
- const res = await fetch(url);
-
- if (res.ok) {
- return {
- props: {
- ...(await res.json())
- }
- };
- }
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
- };
-</script>
-
-<script lang="ts">
- export let name;
- import { errorNotification } from '$lib/form';
- import { onMount } from 'svelte';
- import { goto } from '$app/navigation';
- import { post } from '$lib/api';
-
- let autofocus;
- onMount(() => {
- autofocus.focus();
- });
- async function handleSubmit() {
- if (name) {
- try {
- const { id } = await post('/new/team.json', { name });
- return await goto(`/iam/team/${id}`);
- } catch ({ error }) {
- return errorNotification(error);
- }
- }
- }
-</script>
-
-<div class="flex space-x-1 p-6 font-bold">
- <div class="mr-4 text-2xl tracking-tight">Add New Team</div>
-</div>
-
-<div class="pt-10">
- <form on:submit|preventDefault={handleSubmit}>
- <div class="flex flex-col items-center space-y-4">
- <input name="name" placeholder="Team name" required bind:this={autofocus} bind:value={name} />
- <button type="submit" class="bg-fuchsia-600 hover:bg-fuchsia-500">Save</button>
- </div>
- </form>
-</div>
diff --git a/src/routes/register/index.ts b/src/routes/register/index.ts
deleted file mode 100644
index 98e8991301..0000000000
--- a/src/routes/register/index.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async () => {
- try {
- return { status: 200, body: { userCount: await db.prisma.user.count() } };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/appwrite-wip/index.json.ts b/src/routes/services/[id]/appwrite-wip/index.json.ts
deleted file mode 100644
index e269e8fe78..0000000000
--- a/src/routes/services/[id]/appwrite-wip/index.json.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
-
- let { name, fqdn, exposePort } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
-
- try {
- await db.updateService({ id, fqdn, name, exposePort });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/appwrite-wip/start.json.ts b/src/routes/services/[id]/appwrite-wip/start.json.ts
deleted file mode 100644
index 70748a0a60..0000000000
--- a/src/routes/services/[id]/appwrite-wip/start.json.ts
+++ /dev/null
@@ -1,519 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
- service;
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('n8n');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
-
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- variables[secret.name] = secret.value;
- });
- }
-
- const variables = {
- _APP_ENV: 'production',
- _APP_VERSION: '',
- _APP_LOCALE: '',
- _APP_OPTIONS_ABUSE: '',
- _APP_OPTIONS_FORCE_HTTPS: '',
- _APP_OPENSSL_KEY_V1: '',
- _APP_DOMAIN: '',
- _APP_DOMAIN_TARGET: '',
- _APP_CONSOLE_WHITELIST_ROOT: '',
- _APP_CONSOLE_WHITELIST_EMAILS: '',
- _APP_CONSOLE_WHITELIST_IPS: '',
- _APP_SYSTEM_EMAIL_NAME: '',
- _APP_SYSTEM_EMAIL_ADDRESS: '',
- _APP_SYSTEM_RESPONSE_FORMAT: '',
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS: '',
- _APP_USAGE_STATS: '',
- _APP_LOGGING_PROVIDER: '',
- _APP_LOGGING_CONFIG: '',
- _APP_USAGE_AGGREGATION_INTERVAL: '',
- _APP_WORKER_PER_CORE: '',
- _APP_REDIS_HOST: '',
- _APP_REDIS_PORT: '',
- _APP_REDIS_USER: '',
- _APP_REDIS_PASS: '',
- _APP_DB_HOST: '',
- _APP_DB_PORT: '',
- _APP_DB_SCHEMA: '',
- _APP_DB_USER: '',
- _APP_DB_PASS: '',
- _APP_DB_ROOT_PASS: '',
- _APP_INFLUXDB_HOST: '',
- _APP_INFLUXDB_PORT: '',
- _APP_STATSD_HOST: '',
- _APP_STATSD_PORT: '',
- _APP_SMTP_HOST: '',
- _APP_SMTP_PORT: '',
- _APP_SMTP_SECURE: '',
- _APP_SMTP_USERNAME: '',
- _APP_SMTP_PASSWORD: '',
- _APP_STORAGE_LIMIT: '',
- _APP_STORAGE_ANTIVIRUS: '',
- _APP_STORAGE_ANTIVIRUS_HOST: '',
- _APP_STORAGE_ANTIVIRUS_PORT: '',
- _APP_STORAGE_DEVICE: '',
- _APP_STORAGE_S3_ACCESS_KEY: '',
- _APP_STORAGE_S3_SECRET: '',
- _APP_STORAGE_S3_REGION: '',
- _APP_STORAGE_S3_BUCKET: '',
- _APP_STORAGE_DO_SPACES_ACCESS_KEY: '',
- _APP_STORAGE_DO_SPACES_SECRET: '',
- _APP_STORAGE_DO_SPACES_REGION: '',
- _APP_STORAGE_DO_SPACES_BUCKET: '',
- _APP_FUNCTIONS_SIZE_LIMIT: '',
- _APP_FUNCTIONS_TIMEOUT: '',
- _APP_FUNCTIONS_BUILD_TIMEOUT: '',
- _APP_FUNCTIONS_CONTAINERS: '',
- _APP_FUNCTIONS_CPUS: '',
- _APP_FUNCTIONS_MEMORY: '',
- _APP_FUNCTIONS_MEMORY_SWAP: '',
- _APP_FUNCTIONS_RUNTIMES: '',
- _APP_EXECUTOR_SECRET: '',
- _APP_EXECUTOR_RUNTIME_NETWORK: '',
- _APP_FUNCTIONS_ENVS: '',
- _APP_FUNCTIONS_INACTIVE_THRESHOLD: '',
- DOCKERHUB_PULL_USERNAME: '',
- DOCKERHUB_PULL_PASSWORD: '',
- DOCKERHUB_PULL_EMAIL: '',
- _APP_MAINTENANCE_INTERVAL: '',
- _APP_MAINTENANCE_RETENTION_EXECUTION: '',
- _APP_MAINTENANCE_RETENTION_ABUSE: '',
- _APP_MAINTENANCE_RETENTION_AUDIT: ''
- };
- const config = {
- appwrite: {
- image: `${image}:${version}`,
- volumes: [
- `${id}-appwrite-uploads:/storage/uploads`,
- `${id}-appwrite-cache:/storage/cache`,
- `${id}-appwrite-config:/storage/config`,
- `${id}-appwrite-certificates:/storage/certificates`,
- `${id}-appwrite-functions:/storage/functions`
- ],
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_WORKER_PER_CORE: variables._APP_WORKER_PER_CORE,
- _APP_LOCALE: variables._APP_LOCALE,
- _APP_CONSOLE_WHITELIST_ROOT: variables._APP_CONSOLE_WHITELIST_ROOT,
- _APP_CONSOLE_WHITELIST_EMAILS: variables._APP_CONSOLE_WHITELIST_EMAILS,
- _APP_CONSOLE_WHITELIST_IPS: variables._APP_CONSOLE_WHITELIST_IPS,
- _APP_SYSTEM_EMAIL_NAME: variables._APP_SYSTEM_EMAIL_NAME,
- _APP_SYSTEM_EMAIL_ADDRESS: variables._APP_SYSTEM_EMAIL_ADDRESS,
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS: variables._APP_SYSTEM_SECURITY_EMAIL_ADDRESS,
- _APP_SYSTEM_RESPONSE_FORMAT: variables._APP_SYSTEM_RESPONSE_FORMAT,
- _APP_OPTIONS_ABUSE: variables._APP_OPTIONS_ABUSE,
- _APP_OPTIONS_FORCE_HTTPS: variables._APP_OPTIONS_FORCE_HTTPS,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_DOMAIN: variables._APP_DOMAIN,
- _APP_DOMAIN_TARGET: variables._APP_DOMAIN_TARGET,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS,
- _APP_DB_HOST: variables._APP_DB_HOST,
- _APP_DB_PORT: variables._APP_DB_PORT,
- _APP_DB_SCHEMA: variables._APP_DB_SCHEMA,
- _APP_DB_USER: variables._APP_DB_USER,
- _APP_DB_PASS: variables._APP_DB_PASS,
- _APP_SMTP_HOST: variables._APP_SMTP_HOST,
- _APP_SMTP_PORT: variables._APP_SMTP_PORT,
- _APP_SMTP_SECURE: variables._APP_SMTP_SECURE,
- _APP_SMTP_USERNAME: variables._APP_SMTP_USERNAME,
- _APP_SMTP_PASSWORD: variables._APP_SMTP_PASSWORD,
- _APP_USAGE_STATS: variables._APP_USAGE_STATS,
- _APP_INFLUXDB_HOST: variables._APP_INFLUXDB_HOST,
- _APP_INFLUXDB_PORT: variables._APP_INFLUXDB_PORT,
- _APP_STORAGE_LIMIT: variables._APP_STORAGE_LIMIT,
- _APP_STORAGE_ANTIVIRUS: variables._APP_STORAGE_ANTIVIRUS,
- _APP_STORAGE_ANTIVIRUS_HOST: variables._APP_STORAGE_ANTIVIRUS_HOST,
- _APP_STORAGE_ANTIVIRUS_PORT: variables._APP_STORAGE_ANTIVIRUS_PORT,
- _APP_STORAGE_DEVICE: variables._APP_STORAGE_DEVICE,
- _APP_STORAGE_S3_ACCESS_KEY: variables._APP_STORAGE_S3_ACCESS_KEY,
- _APP_STORAGE_S3_SECRET: variables._APP_STORAGE_S3_SECRET,
- _APP_STORAGE_S3_REGION: variables._APP_STORAGE_S3_REGION,
- _APP_STORAGE_S3_BUCKET: variables._APP_STORAGE_S3_BUCKET,
- _APP_STORAGE_DO_SPACES_ACCESS_KEY: variables._APP_STORAGE_DO_SPACES_ACCESS_KEY,
- _APP_STORAGE_DO_SPACES_SECRET: variables._APP_STORAGE_DO_SPACES_SECRET,
- _APP_STORAGE_DO_SPACES_REGION: variables._APP_STORAGE_DO_SPACES_REGION,
- _APP_STORAGE_DO_SPACES_BUCKET: variables._APP_STORAGE_DO_SPACES_BUCKET,
- _APP_FUNCTIONS_SIZE_LIMIT: variables._APP_FUNCTIONS_SIZE_LIMIT,
- _APP_FUNCTIONS_TIMEOUT: variables._APP_FUNCTIONS_TIMEOUT,
- _APP_FUNCTIONS_BUILD_TIMEOUT: variables._APP_FUNCTIONS_BUILD_TIMEOUT,
- _APP_FUNCTIONS_CONTAINERS: variables._APP_FUNCTIONS_CONTAINERS,
- _APP_FUNCTIONS_CPUS: variables._APP_FUNCTIONS_CPUS,
- _APP_FUNCTIONS_MEMORY: variables._APP_FUNCTIONS_MEMORY,
- _APP_FUNCTIONS_MEMORY_SWAP: variables._APP_FUNCTIONS_MEMORY_SWAP,
- _APP_EXECUTOR_SECRET: variables._APP_EXECUTOR_SECRET,
- _APP_FUNCTIONS_RUNTIMES: variables._APP_FUNCTIONS_RUNTIMES,
- _APP_LOGGING_PROVIDER: variables._APP_LOGGING_PROVIDER,
- _APP_LOGGING_CONFIG: variables._APP_LOGGING_CONFIG,
- _APP_STATSD_HOST: variables._APP_STATSD_HOST,
- _APP_STATSD_PORT: variables._APP_STATSD_PORT,
- _APP_MAINTENANCE_INTERVAL: variables._APP_MAINTENANCE_INTERVAL,
- _APP_MAINTENANCE_RETENTION_EXECUTION: variables._APP_MAINTENANCE_RETENTION_EXECUTION,
- _APP_MAINTENANCE_RETENTION_ABUSE: variables._APP_MAINTENANCE_RETENTION_ABUSE,
- _APP_MAINTENANCE_RETENTION_AUDIT: variables._APP_MAINTENANCE_RETENTION_AUDIT
- }
- },
- appwriteRealtime: {
- image: `${image}:${version}`,
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_WORKER_PER_CORE: variables._APP_WORKER_PER_CORE,
- _APP_OPTIONS_ABUSE: variables._APP_OPTIONS_ABUSE,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_DB_HOST: variables._APP_DB_HOST,
- _APP_DB_PORT: variables._APP_DB_PORT,
- _APP_DB_SCHEMA: variables._APP_DB_SCHEMA,
- _APP_DB_USER: variables._APP_DB_USER,
- _APP_DB_PASS: variables._APP_DB_PASS,
- _APP_USAGE_STATS: variables._APP_USAGE_STATS,
- _APP_LOGGING_PROVIDER: variables._APP_LOGGING_PROVIDER,
- _APP_LOGGING_CONFIG: variables._APP_LOGGING_CONFIG
- }
- },
- appwriteExecutor: {
- image: `${image}:${version}`,
- volumes: [
- `${id}-appwrite-functions:/storage/functions`,
- `/tmp:/tmp`,
- '/var/run/docker.sock:/var/run/docker.sock'
- ],
- environmentVariables: {
- DOCKERHUB_PULL_USERNAME: variables.DOCKERHUB_PULL_USERNAME,
- DOCKERHUB_PULL_PASSWORD: variables.DOCKERHUB_PULL_PASSWORD,
- _APP_LOGGING_PROVIDER: variables._APP_LOGGING_PROVIDER,
- _APP_LOGGING_CONFIG: variables._APP_LOGGING_CONFIG,
- _APP_VERSION: variables._APP_VERSION,
- _APP_ENV: variables._APP_ENV,
- _APP_STORAGE_DEVICE: variables._APP_STORAGE_DEVICE,
- _APP_STORAGE_S3_ACCESS_KEY: variables._APP_STORAGE_S3_ACCESS_KEY,
- _APP_STORAGE_S3_SECRET: variables._APP_STORAGE_S3_SECRET,
- _APP_STORAGE_S3_REGION: variables._APP_STORAGE_S3_REGION,
- _APP_STORAGE_S3_BUCKET: variables._APP_STORAGE_S3_BUCKET,
- _APP_STORAGE_DO_SPACES_ACCESS_KEY: variables._APP_STORAGE_DO_SPACES_ACCESS_KEY,
- _APP_STORAGE_DO_SPACES_SECRET: variables._APP_STORAGE_DO_SPACES_SECRET,
- _APP_STORAGE_DO_SPACES_REGION: variables._APP_STORAGE_DO_SPACES_REGION,
- _APP_STORAGE_DO_SPACES_BUCKET: variables._APP_STORAGE_DO_SPACES_BUCKET,
- _APP_FUNCTIONS_CPUS: variables._APP_FUNCTIONS_CPUS,
- _APP_FUNCTIONS_MEMORY: variables._APP_FUNCTIONS_MEMORY,
- _APP_FUNCTIONS_MEMORY_SWAP: variables._APP_FUNCTIONS_MEMORY_SWAP,
- _APP_FUNCTIONS_TIMEOUT: variables._APP_FUNCTIONS_TIMEOUT,
- _APP_EXECUTOR_SECRET: variables._APP_EXECUTOR_SECRET,
- _APP_FUNCTIONS_RUNTIMES: variables._APP_FUNCTIONS_RUNTIMES,
- _APP_FUNCTIONS_INACTIVE_THRESHOLD: variables._APP_FUNCTIONS_INACTIVE_THRESHOLD,
- _APP_EXECUTOR_RUNTIME_NETWORK: variables._APP_EXECUTOR_RUNTIME_NETWORK
- }
- },
- appwriteWorkerDatabase: {
- image: `${image}:${version}`,
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS,
- _APP_DB_HOST: variables._APP_DB_HOST,
- _APP_DB_PORT: variables._APP_DB_PORT,
- _APP_DB_SCHEMA: variables._APP_DB_SCHEMA,
- _APP_DB_USER: variables._APP_DB_USER,
- _APP_DB_PASS: variables._APP_DB_PASS,
- _APP_LOGGING_PROVIDER: variables._APP_LOGGING_PROVIDER,
- _APP_LOGGING_CONFIG: variables._APP_LOGGING_CONFIG
- }
- },
- appwriteWorkerBuilds: {
- image: `${image}:${version}`,
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_EXECUTOR_SECRET: variables._APP_EXECUTOR_SECRET,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS,
- _APP_DB_HOST: variables._APP_DB_HOST,
- _APP_DB_PORT: variables._APP_DB_PORT,
- _APP_DB_SCHEMA: variables._APP_DB_SCHEMA,
- _APP_DB_USER: variables._APP_DB_USER,
- _APP_DB_PASS: variables._APP_DB_PASS,
- _APP_LOGGING_PROVIDER: variables._APP_LOGGING_PROVIDER,
- _APP_LOGGING_CONFIG: variables._APP_LOGGING_CONFIG
- }
- },
- appwriteWorkerAudits: {
- image: `${image}:${version}`,
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS,
- _APP_DB_HOST: variables._APP_DB_HOST,
- _APP_DB_PORT: variables._APP_DB_PORT,
- _APP_DB_SCHEMA: variables._APP_DB_SCHEMA,
- _APP_DB_USER: variables._APP_DB_USER,
- _APP_DB_PASS: variables._APP_DB_PASS,
- _APP_LOGGING_PROVIDER: variables._APP_LOGGING_PROVIDER,
- _APP_LOGGING_CONFIG: variables._APP_LOGGING_CONFIG
- }
- },
- appwriteWorkerWebhooks: {
- image: `${image}:${version}`,
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS: variables._APP_SYSTEM_SECURITY_EMAIL_ADDRESS,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS,
- _APP_LOGGING_PROVIDER: variables._APP_LOGGING_PROVIDER,
- _APP_LOGGING_CONFIG: variables._APP_LOGGING_CONFIG
- }
- },
- appwriteWorkerDeletes: {
- image: `${image}:${version}`,
- volumes: [
- `${id}-appwrite-uploads:/storage/uploads`,
- `${id}-appwrite-cache:/storage/cache`,
- `${id}-appwrite-certificates:/storage/certificates`
- ],
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS,
- _APP_DB_HOST: variables._APP_DB_HOST,
- _APP_DB_PORT: variables._APP_DB_PORT,
- _APP_DB_SCHEMA: variables._APP_DB_SCHEMA,
- _APP_DB_USER: variables._APP_DB_USER,
- _APP_DB_PASS: variables._APP_DB_PASS,
- _APP_STORAGE_DEVICE: variables._APP_STORAGE_DEVICE,
- _APP_STORAGE_S3_ACCESS_KEY: variables._APP_STORAGE_S3_ACCESS_KEY,
- _APP_STORAGE_S3_SECRET: variables._APP_STORAGE_S3_SECRET,
- _APP_STORAGE_S3_REGION: variables._APP_STORAGE_S3_REGION,
- _APP_STORAGE_S3_BUCKET: variables._APP_STORAGE_S3_BUCKET,
- _APP_STORAGE_DO_SPACES_ACCESS_KEY: variables._APP_STORAGE_DO_SPACES_ACCESS_KEY,
- _APP_STORAGE_DO_SPACES_SECRET: variables._APP_STORAGE_DO_SPACES_SECRET,
- _APP_STORAGE_DO_SPACES_REGION: variables._APP_STORAGE_DO_SPACES_REGION,
- _APP_STORAGE_DO_SPACES_BUCKET: variables._APP_STORAGE_DO_SPACES_BUCKET,
- _APP_LOGGING_PROVIDER: variables._APP_LOGGING_PROVIDER,
- _APP_LOGGING_CONFIG: variables._APP_LOGGING_CONFIG
- }
- },
- appwriteWorkerCertificates: {
- image: `${image}:${version}`,
- volumes: [
- `${id}-appwrite-config:/storage/config`,
- `${id}-appwrite-certificates:/storage/certificates`
- ],
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS: variables._APP_SYSTEM_SECURITY_EMAIL_ADDRESS,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS,
- _APP_DOMAIN_TARGET: variables._APP_DOMAIN_TARGET,
- _APP_DB_HOST: variables._APP_DB_HOST,
- _APP_DB_PORT: variables._APP_DB_PORT,
- _APP_DB_SCHEMA: variables._APP_DB_SCHEMA,
- _APP_DB_USER: variables._APP_DB_USER,
- _APP_DB_PASS: variables._APP_DB_PASS,
- _APP_LOGGING_PROVIDER: variables._APP_LOGGING_PROVIDER,
- _APP_LOGGING_CONFIG: variables._APP_LOGGING_CONFIG
- }
- },
- appwriteWorkerFunctions: {
- image: `${image}:${version}`,
- envvironmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS,
- _APP_DB_HOST: variables._APP_DB_HOST,
- _APP_DB_PORT: variables._APP_DB_PORT,
- _APP_DB_SCHEMA: variables._APP_DB_SCHEMA,
- _APP_DB_USER: variables._APP_DB_USER,
- _APP_DB_PASS: variables._APP_DB_PASS,
- _APP_FUNCTIONS_TIMEOUT: variables._APP_FUNCTIONS_TIMEOUT,
- _APP_EXECUTOR_SECRET: variables._APP_EXECUTOR_SECRET,
- _APP_USAGE_STATS: variables._APP_USAGE_STATS,
- DOCKERHUB_PULL_USERNAME: variables.DOCKERHUB_PULL_USERNAME,
- DOCKERHUB_PULL_PASSWORD: variables.DOCKERHUB_PULL_PASSWORD
- }
- },
- appwriteWorkerMails: {
- image: `${image}:${version}`,
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_SYSTEM_EMAIL_NAME: variables._APP_SYSTEM_EMAIL_NAME,
- _APP_SYSTEM_EMAIL_ADDRESS: variables._APP_SYSTEM_EMAIL_ADDRESS,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS,
- _APP_SMTP_HOST: variables._APP_SMTP_HOST,
- _APP_SMTP_PORT: variables._APP_SMTP_PORT,
- _APP_SMTP_SECURE: variables._APP_SMTP_SECURE,
- _APP_SMTP_USERNAME: variables._APP_SMTP_USERNAME,
- _APP_SMTP_PASSWORD: variables._APP_SMTP_PASSWORD,
- _APP_LOGGING_PROVIDER: variables._APP_LOGGING_PROVIDER,
- _APP_LOGGING_CONFIG: variables._APP_LOGGING_CONFIG
- }
- },
- appwriteMaintenance: {
- image: `${image}:${version}`,
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS,
- _APP_MAINTENANCE_INTERVAL: variables._APP_MAINTENANCE_INTERVAL,
- _APP_MAINTENANCE_RETENTION_EXECUTION: variables._APP_MAINTENANCE_RETENTION_EXECUTION,
- _APP_MAINTENANCE_RETENTION_ABUSE: variables._APP_MAINTENANCE_RETENTION_ABUSE,
- _APP_MAINTENANCE_RETENTION_AUDIT: variables._APP_MAINTENANCE_RETENTION_AUDIT
- }
- },
- appwriteUsage: {
- image: `${image}:${version}`,
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_OPENSSL_KEY_V1: variables._APP_OPENSSL_KEY_V1,
- _APP_DB_HOST: variables._APP_DB_HOST,
- _APP_DB_PORT: variables._APP_DB_PORT,
- _APP_DB_SCHEMA: variables._APP_DB_SCHEMA,
- _APP_DB_USER: variables._APP_DB_USER,
- _APP_DB_PASS: variables._APP_DB_PASS,
- _APP_INFLUXDB_HOST: variables._APP_INFLUXDB_HOST,
- _APP_INFLUXDB_PORT: variables._APP_INFLUXDB_PORT,
- _APP_USAGE_AGGREGATION_INTERVAL: variables._APP_USAGE_AGGREGATION_INTERVAL,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS
- }
- },
- appwriteSchedule: {
- image: `${image}:${version}`,
- environmentVariables: {
- _APP_ENV: variables._APP_ENV,
- _APP_REDIS_HOST: variables._APP_REDIS_HOST,
- _APP_REDIS_PORT: variables._APP_REDIS_PORT,
- _APP_REDIS_USER: variables._APP_REDIS_USER,
- _APP_REDIS_PASS: variables._APP_REDIS_PASS
- }
- },
- mariadb: {
- image: 'mariadb:10.7',
- volumes: [`${id}-appwrite-mariadb:/var/lib/mysql`],
- environmentVariables: {
- MYSQL_ROOT_PASSWORD: variables._APP_DB_ROOT_PASS,
- MYSQL_DATABASE: variables._APP_DB_SCHEMA,
- MYSQL_USER: variables._APP_DB_USER,
- MYSQL_PASSWORD: variables._APP_DB_PASS
- }
- },
- redis: {
- image: 'redis:6.0-alpine3.12',
- volumes: [`${id}-appwrite-redis:/data`]
- },
- influxdb: {
- image: 'appwrite/influxdb:1.0.0',
- volumes: [`${id}-appwrite-influxdb:/var/lib/influxdb`]
- },
- telegraf: {
- image: 'appwrite/telegraf:1.0.0',
- environmentVariables: {
- _APP_INFLUXDB_HOST: variables._APP_INFLUXDB_HOST,
- _APP_INFLUXDB_PORT: variables._APP_INFLUXDB_PORT
- }
- }
- };
-
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.image,
- networks: [network],
- volumes: [...config.appwrite.volumes],
- environment: config.environmentVariables,
- restart: 'always',
- labels: makeLabelForServices('appwrite'),
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.volume.split(':')[0]]: {
- name: config.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/appwrite-wip/stop.json.ts b/src/routes/services/[id]/appwrite-wip/stop.json.ts
deleted file mode 100644
index c604e1cc3b..0000000000
--- a/src/routes/services/[id]/appwrite-wip/stop.json.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker, fqdn } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/check.json.ts b/src/routes/services/[id]/check.json.ts
deleted file mode 100644
index 4201e94dac..0000000000
--- a/src/routes/services/[id]/check.json.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import { asyncExecShell, getDomain, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { t } from '$lib/translations';
-import type { RequestHandler } from '@sveltejs/kit';
-import getPort from 'get-port';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- let { fqdn, exposePort, otherFqdns } = await event.request.json();
-
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (otherFqdns && otherFqdns.length > 0) otherFqdns = otherFqdns.map((f) => f.toLowerCase());
- if (exposePort) exposePort = Number(exposePort);
-
- try {
- let found = await db.isDomainConfigured({ id, fqdn });
- if (found) {
- throw {
- message: t.get('application.domain_already_in_use', {
- domain: getDomain(fqdn).replace('www.', '')
- })
- };
- }
- if (otherFqdns && otherFqdns.length > 0) {
- for (const ofqdn of otherFqdns) {
- const domain = getDomain(ofqdn);
- const nakedDomain = domain.replace('www.', '');
- found = await db.isDomainConfigured({ id, fqdn: ofqdn, checkOwn: true });
- if (found) {
- throw {
- message: t.get('application.domain_already_in_use', {
- domain: nakedDomain
- })
- };
- }
- }
- }
- if (exposePort) {
- exposePort = Number(exposePort);
-
- if (exposePort < 1024 || exposePort > 65535) {
- throw { message: `Exposed Port needs to be between 1024 and 65535.` };
- }
-
- const publicPort = await getPort({ port: exposePort });
- if (publicPort !== exposePort) {
- throw { message: `Port ${exposePort} is already in use.` };
- }
- }
- return {
- status: found ? 500 : 200,
- body: {
- error: found && `Domain ${getDomain(fqdn).replace('www.', '')} is already used.`
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/configuration/destination.json.ts b/src/routes/services/[id]/configuration/destination.json.ts
deleted file mode 100644
index d684147d96..0000000000
--- a/src/routes/services/[id]/configuration/destination.json.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
-
- const { destinationId } = await event.request.json();
-
- try {
- await db.configureDestinationForService({ id, destinationId });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/configuration/type.json.ts b/src/routes/services/[id]/configuration/type.json.ts
deleted file mode 100644
index 42c5344e69..0000000000
--- a/src/routes/services/[id]/configuration/type.json.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import { supportedServiceTypesAndVersions } from '$lib/components/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- return {
- status: 200,
- body: {
- types: supportedServiceTypesAndVersions
- }
- };
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { type } = await event.request.json();
-
- try {
- await db.configureServiceType({ id, type });
- return {
- status: 201
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/configuration/version.json.ts b/src/routes/services/[id]/configuration/version.json.ts
deleted file mode 100644
index bf93e167bc..0000000000
--- a/src/routes/services/[id]/configuration/version.json.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import { supportedServiceTypesAndVersions } from '$lib/components/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const { type } = await db.getService({ id, teamId });
- return {
- status: 200,
- body: {
- type,
- versions: supportedServiceTypesAndVersions.find((name) => name.name === type).versions
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { version } = await event.request.json();
-
- try {
- await db.setServiceVersion({ id, version });
- return {
- status: 201
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/delete.json.ts b/src/routes/services/[id]/delete.json.ts
deleted file mode 100644
index 63da062240..0000000000
--- a/src/routes/services/[id]/delete.json.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const del: RequestHandler = async (events) => {
- const { teamId, status, body } = await getUserDetails(events);
- if (status === 401) return { status, body };
-
- const { id } = events.params;
-
- try {
- await db.removeService({ id });
- return { status: 200 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/fider/index.json.ts b/src/routes/services/[id]/fider/index.json.ts
deleted file mode 100644
index b561e33920..0000000000
--- a/src/routes/services/[id]/fider/index.json.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import { encrypt } from '$lib/crypto';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- let {
- name,
- fqdn,
- fider: {
- emailNoreply,
- emailMailgunApiKey,
- emailMailgunDomain,
- emailMailgunRegion,
- emailSmtpHost,
- emailSmtpPort,
- emailSmtpUser,
- emailSmtpPassword,
- emailSmtpEnableStartTls
- }
- } = await event.request.json();
-
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (emailNoreply) emailNoreply = emailNoreply.toLowerCase();
- if (emailSmtpHost) emailSmtpHost = emailSmtpHost.toLowerCase();
- if (emailSmtpPassword) {
- emailSmtpPassword = encrypt(emailSmtpPassword);
- }
- if (emailSmtpPort) emailSmtpPort = Number(emailSmtpPort);
- if (emailSmtpEnableStartTls) emailSmtpEnableStartTls = Boolean(emailSmtpEnableStartTls);
-
- try {
- await db.updateFiderService({
- id,
- fqdn,
- name,
- emailNoreply,
- emailMailgunApiKey,
- emailMailgunDomain,
- emailMailgunRegion,
- emailSmtpHost,
- emailSmtpPort,
- emailSmtpUser,
- emailSmtpPassword,
- emailSmtpEnableStartTls
- });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/fider/start.json.ts b/src/routes/services/[id]/fider/start.json.ts
deleted file mode 100644
index 2adf537385..0000000000
--- a/src/routes/services/[id]/fider/start.json.ts
+++ /dev/null
@@ -1,158 +0,0 @@
-import {
- asyncExecShell,
- createDirectories,
- getDomain,
- getEngine,
- getUserDetails
-} from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import type { Service, DestinationDocker, Prisma } from '@prisma/client';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service: Service & Prisma.ServiceInclude & { destinationDocker: DestinationDocker } =
- await db.getService({ id, teamId });
- const {
- type,
- version,
- fqdn,
- destinationDockerId,
- destinationDocker,
- serviceSecret,
- exposePort,
- fider: {
- postgresqlUser,
- postgresqlPassword,
- postgresqlDatabase,
- jwtSecret,
- emailNoreply,
- emailMailgunApiKey,
- emailMailgunDomain,
- emailMailgunRegion,
- emailSmtpHost,
- emailSmtpPort,
- emailSmtpUser,
- emailSmtpPassword,
- emailSmtpEnableStartTls
- }
- } = service;
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('fider');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
- const domain = getDomain(fqdn);
- const config = {
- fider: {
- image: `${image}:${version}`,
- environmentVariables: {
- BASE_URL: domain,
- DATABASE_URL: `postgresql://${postgresqlUser}:${postgresqlPassword}@${id}-postgresql:5432/${postgresqlDatabase}?sslmode=disable`,
- JWT_SECRET: `${jwtSecret.replace(/\$/g, '$$$')}`,
- EMAIL_NOREPLY: emailNoreply,
- EMAIL_MAILGUN_API: emailMailgunApiKey,
- EMAIL_MAILGUN_REGION: emailMailgunRegion,
- EMAIL_MAILGUN_DOMAIN: emailMailgunDomain,
- EMAIL_SMTP_HOST: emailSmtpHost,
- EMAIL_SMTP_PORT: emailSmtpPort,
- EMAIL_SMTP_USER: emailSmtpUser,
- EMAIL_SMTP_PASSWORD: emailSmtpPassword,
- EMAIL_SMTP_ENABLE_STARTTLS: emailSmtpEnableStartTls
- }
- },
- postgresql: {
- image: 'postgres:12-alpine',
- volume: `${id}-postgresql-data:/var/lib/postgresql/data`,
- environmentVariables: {
- POSTGRES_USER: postgresqlUser,
- POSTGRES_PASSWORD: postgresqlPassword,
- POSTGRES_DB: postgresqlDatabase
- }
- }
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.fider.environmentVariables[secret.name] = secret.value;
- });
- }
-
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.fider.image,
- environment: config.fider.environmentVariables,
- networks: [network],
- volumes: [],
- restart: 'always',
- labels: makeLabelForServices('fider'),
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- },
- depends_on: [`${id}-postgresql`]
- },
- [`${id}-postgresql`]: {
- image: config.postgresql.image,
- container_name: `${id}-postgresql`,
- environment: config.postgresql.environmentVariables,
- networks: [network],
- volumes: [config.postgresql.volume],
- restart: 'always',
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.postgresql.volume.split(':')[0]]: {
- name: config.postgresql.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/fider/stop.json.ts b/src/routes/services/[id]/fider/stop.json.ts
deleted file mode 100644
index 67dd96d048..0000000000
--- a/src/routes/services/[id]/fider/stop.json.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer, stopTcpHttpProxy } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- try {
- const found = await checkContainer(engine, `${id}-postgresql`);
- if (found) {
- await removeDestinationDocker({ id: `${id}-postgresql`, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/ghost/index.json.ts b/src/routes/services/[id]/ghost/index.json.ts
deleted file mode 100644
index 1b1225f591..0000000000
--- a/src/routes/services/[id]/ghost/index.json.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
-
- let {
- name,
- fqdn,
- exposePort,
- ghost: { mariadbDatabase }
- } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- try {
- await db.updateGhostService({ id, fqdn, name, exposePort, mariadbDatabase });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/ghost/start.json.ts b/src/routes/services/[id]/ghost/start.json.ts
deleted file mode 100644
index 67e9364b92..0000000000
--- a/src/routes/services/[id]/ghost/start.json.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-import {
- asyncExecShell,
- createDirectories,
- getDomain,
- getEngine,
- getUserDetails
-} from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- const port = getServiceMainPort('ghost');
-
- try {
- const service = await db.getService({ id, teamId });
- const {
- type,
- version,
- destinationDockerId,
- destinationDocker,
- serviceSecret,
- exposePort,
- fqdn,
- ghost: {
- defaultEmail,
- defaultPassword,
- mariadbRootUser,
- mariadbRootUserPassword,
- mariadbDatabase,
- mariadbPassword,
- mariadbUser
- }
- } = service;
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
- const domain = getDomain(fqdn);
- const isHttps = fqdn.startsWith('https://');
- const config = {
- ghost: {
- image: `${image}:${version}`,
- volume: `${id}-ghost:/bitnami/ghost`,
- environmentVariables: {
- url: fqdn,
- GHOST_HOST: domain,
- GHOST_ENABLE_HTTPS: isHttps ? 'yes' : 'no',
- GHOST_EMAIL: defaultEmail,
- GHOST_PASSWORD: defaultPassword,
- GHOST_DATABASE_HOST: `${id}-mariadb`,
- GHOST_DATABASE_USER: mariadbUser,
- GHOST_DATABASE_PASSWORD: mariadbPassword,
- GHOST_DATABASE_NAME: mariadbDatabase,
- GHOST_DATABASE_PORT_NUMBER: 3306
- }
- },
- mariadb: {
- image: `bitnami/mariadb:latest`,
- volume: `${id}-mariadb:/bitnami/mariadb`,
- environmentVariables: {
- MARIADB_USER: mariadbUser,
- MARIADB_PASSWORD: mariadbPassword,
- MARIADB_DATABASE: mariadbDatabase,
- MARIADB_ROOT_USER: mariadbRootUser,
- MARIADB_ROOT_PASSWORD: mariadbRootUserPassword
- }
- }
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.ghost.environmentVariables[secret.name] = secret.value;
- });
- }
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.ghost.image,
- networks: [network],
- volumes: [config.ghost.volume],
- environment: config.ghost.environmentVariables,
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- labels: makeLabelForServices('ghost'),
- depends_on: [`${id}-mariadb`],
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- },
- [`${id}-mariadb`]: {
- container_name: `${id}-mariadb`,
- image: config.mariadb.image,
- networks: [network],
- volumes: [config.mariadb.volume],
- environment: config.mariadb.environmentVariables,
- restart: 'always',
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.ghost.volume.split(':')[0]]: {
- name: config.ghost.volume.split(':')[0]
- },
- [config.mariadb.volume.split(':')[0]]: {
- name: config.mariadb.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/ghost/stop.json.ts b/src/routes/services/[id]/ghost/stop.json.ts
deleted file mode 100644
index 478f5b946e..0000000000
--- a/src/routes/services/[id]/ghost/stop.json.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker, fqdn } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- let found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- found = await checkContainer(engine, `${id}-mariadb`);
- if (found) {
- await removeDestinationDocker({ id: `${id}-mariadb`, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/hasura/index.json.ts b/src/routes/services/[id]/hasura/index.json.ts
deleted file mode 100644
index d717502c52..0000000000
--- a/src/routes/services/[id]/hasura/index.json.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- let { name, fqdn } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
-
- try {
- await db.updateService({ id, fqdn, name });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/hasura/start.json.ts b/src/routes/services/[id]/hasura/start.json.ts
deleted file mode 100644
index 8a8cc3f040..0000000000
--- a/src/routes/services/[id]/hasura/start.json.ts
+++ /dev/null
@@ -1,126 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import type { Service, DestinationDocker, Prisma } from '@prisma/client';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service: Service & Prisma.ServiceInclude & { destinationDocker: DestinationDocker } =
- await db.getService({ id, teamId });
- const {
- type,
- version,
- destinationDockerId,
- destinationDocker,
- serviceSecret,
- exposePort,
- hasura: { postgresqlUser, postgresqlPassword, postgresqlDatabase }
- } = service;
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('hasura');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
-
- const config = {
- hasura: {
- image: `${image}:${version}`,
- environmentVariables: {
- HASURA_GRAPHQL_METADATA_DATABASE_URL: `postgresql://${postgresqlUser}:${postgresqlPassword}@${id}-postgresql:5432/${postgresqlDatabase}`
- }
- },
- postgresql: {
- image: 'postgres:12-alpine',
- volume: `${id}-postgresql-data:/var/lib/postgresql/data`,
- environmentVariables: {
- POSTGRES_USER: postgresqlUser,
- POSTGRES_PASSWORD: postgresqlPassword,
- POSTGRES_DB: postgresqlDatabase
- }
- }
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.hasura.environmentVariables[secret.name] = secret.value;
- });
- }
-
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.hasura.image,
- environment: config.hasura.environmentVariables,
- networks: [network],
- volumes: [],
- restart: 'always',
- labels: makeLabelForServices('hasura'),
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- },
- depends_on: [`${id}-postgresql`]
- },
- [`${id}-postgresql`]: {
- image: config.postgresql.image,
- container_name: `${id}-postgresql`,
- environment: config.postgresql.environmentVariables,
- networks: [network],
- volumes: [config.postgresql.volume],
- restart: 'always',
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.postgresql.volume.split(':')[0]]: {
- name: config.postgresql.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/hasura/stop.json.ts b/src/routes/services/[id]/hasura/stop.json.ts
deleted file mode 100644
index 67dd96d048..0000000000
--- a/src/routes/services/[id]/hasura/stop.json.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer, stopTcpHttpProxy } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- try {
- const found = await checkContainer(engine, `${id}-postgresql`);
- if (found) {
- await removeDestinationDocker({ id: `${id}-postgresql`, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/index.json.ts b/src/routes/services/[id]/index.json.ts
deleted file mode 100644
index f75ff87f65..0000000000
--- a/src/routes/services/[id]/index.json.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-import { asyncExecShell, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import {
- generateDatabaseConfiguration,
- getServiceImage,
- getVersions,
- ErrorHandler,
- getServiceImages
-} from '$lib/database';
-import { dockerInstance } from '$lib/docker';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker, type, version, settings } = service;
-
- let isRunning = false;
- if (destinationDockerId) {
- const host = getEngine(destinationDocker.engine);
- const docker = dockerInstance({ destinationDocker });
- const baseImage = getServiceImage(type);
- const images = getServiceImages(type);
- docker.engine.pull(`${baseImage}:${version}`);
- if (images?.length > 0) {
- for (const image of images) {
- docker.engine.pull(`${image}:latest`);
- }
- }
- try {
- const { stdout } = await asyncExecShell(
- `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`
- );
-
- if (JSON.parse(stdout).Running) {
- isRunning = true;
- }
- } catch (error) {
- //
- }
- }
- return {
- body: {
- isRunning,
- service,
- settings
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/languagetool/index.json.ts b/src/routes/services/[id]/languagetool/index.json.ts
deleted file mode 100644
index dcba0b6f8e..0000000000
--- a/src/routes/services/[id]/languagetool/index.json.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- let { name, fqdn, exposePort } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
-
- try {
- await db.updateService({ id, fqdn, name, exposePort });
- return { status: 201 };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/languagetool/start.json.ts b/src/routes/services/[id]/languagetool/start.json.ts
deleted file mode 100644
index 0818ac6f70..0000000000
--- a/src/routes/services/[id]/languagetool/start.json.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
- service;
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('languagetool');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
-
- const config = {
- image: `${image}:${version}`,
- volume: `${id}-ngrams:/ngrams`,
- environmentVariables: {}
- };
-
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.environmentVariables[secret.name] = secret.value;
- });
- }
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.image,
- networks: [network],
- environment: config.environmentVariables,
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- volumes: [config.volume],
- labels: makeLabelForServices('languagetool'),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.volume.split(':')[0]]: {
- name: config.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/languagetool/stop.json.ts b/src/routes/services/[id]/languagetool/stop.json.ts
deleted file mode 100644
index c604e1cc3b..0000000000
--- a/src/routes/services/[id]/languagetool/stop.json.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker, fqdn } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/logs/index.json.ts b/src/routes/services/[id]/logs/index.json.ts
deleted file mode 100644
index fe94db9ab6..0000000000
--- a/src/routes/services/[id]/logs/index.json.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { dayjs } from '$lib/dayjs';
-import { dockerInstance } from '$lib/docker';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- let since = event.url.searchParams.get('since') || 0;
- if (since !== 0) {
- since = dayjs(since).unix();
- }
- try {
- const { destinationDockerId, destinationDocker } = await db.prisma.service.findUnique({
- where: { id },
- include: { destinationDocker: true }
- });
- if (destinationDockerId) {
- const docker = dockerInstance({ destinationDocker });
- try {
- const container = await docker.engine.getContainer(id);
- if (container) {
- const logs = (
- await container.logs({
- stdout: true,
- stderr: true,
- timestamps: true,
- since,
- tail: 5000
- })
- )
- .toString()
- .split('\n')
- .map((l) => l.slice(8))
- .filter((a) => a);
- return {
- body: {
- logs
- }
- };
- }
- } catch (error) {
- const { statusCode } = error;
- if (statusCode === 404) {
- return {
- body: {
- logs: []
- }
- };
- }
- }
- }
- return {
- status: 200,
- body: {
- message: 'No logs found.'
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/meilisearch/index.json.ts b/src/routes/services/[id]/meilisearch/index.json.ts
deleted file mode 100644
index ff98ede6d0..0000000000
--- a/src/routes/services/[id]/meilisearch/index.json.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- let { name, fqdn, exposePort } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
-
- try {
- await db.updateService({ id, fqdn, name, exposePort });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/meilisearch/start.json.ts b/src/routes/services/[id]/meilisearch/start.json.ts
deleted file mode 100644
index b019d69b94..0000000000
--- a/src/routes/services/[id]/meilisearch/start.json.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const {
- meiliSearch: { masterKey }
- } = service;
- const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
- service;
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('meilisearch');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
-
- const config = {
- image: `${image}:${version}`,
- volume: `${id}-datams:/data.ms`,
- environmentVariables: {
- MEILI_MASTER_KEY: masterKey
- }
- };
-
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.environmentVariables[secret.name] = secret.value;
- });
- }
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.image,
- networks: [network],
- environment: config.environmentVariables,
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- volumes: [config.volume],
- labels: makeLabelForServices('meilisearch'),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.volume.split(':')[0]]: {
- name: config.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/meilisearch/stop.json.ts b/src/routes/services/[id]/meilisearch/stop.json.ts
deleted file mode 100644
index c604e1cc3b..0000000000
--- a/src/routes/services/[id]/meilisearch/stop.json.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker, fqdn } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/minio/index.json.ts b/src/routes/services/[id]/minio/index.json.ts
deleted file mode 100644
index 32056218d5..0000000000
--- a/src/routes/services/[id]/minio/index.json.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- let {
- name,
- fqdn,
- exposePort,
- minio: { apiFqdn }
- } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
- if (apiFqdn) apiFqdn = apiFqdn.toLowerCase();
- try {
- await db.updateMinioService({ id, fqdn, apiFqdn, name, exposePort });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/minio/start.json.ts b/src/routes/services/[id]/minio/start.json.ts
deleted file mode 100644
index 9dd75bdd90..0000000000
--- a/src/routes/services/[id]/minio/start.json.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getFreePort, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const {
- type,
- version,
- fqdn,
- destinationDockerId,
- destinationDocker,
- exposePort,
- minio: { rootUser, rootUserPassword },
- serviceSecret
- } = service;
-
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('minio');
-
- const publicPort = await getFreePort();
-
- const consolePort = 9001;
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
-
- const config = {
- image: `${image}:${version}`,
- volume: `${id}-minio-data:/data`,
- environmentVariables: {
- MINIO_ROOT_USER: rootUser,
- MINIO_ROOT_PASSWORD: rootUserPassword,
- MINIO_BROWSER_REDIRECT_URL: fqdn
- }
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.environmentVariables[secret.name] = secret.value;
- });
- }
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.image,
- command: `server /data --console-address ":${consolePort}"`,
- environment: config.environmentVariables,
- networks: [network],
- volumes: [config.volume],
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- labels: makeLabelForServices('minio'),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.volume.split(':')[0]]: {
- name: config.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- await db.updateMinioServicePort({ id, publicPort });
- return {
- status: 200
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/minio/stop.json.ts b/src/routes/services/[id]/minio/stop.json.ts
deleted file mode 100644
index 4ae3c106b8..0000000000
--- a/src/routes/services/[id]/minio/stop.json.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer, stopTcpHttpProxy } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker } = service;
- await db.updateMinioService({ id, publicPort: null });
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/n8n/index.json.ts b/src/routes/services/[id]/n8n/index.json.ts
deleted file mode 100644
index e269e8fe78..0000000000
--- a/src/routes/services/[id]/n8n/index.json.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
-
- let { name, fqdn, exposePort } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
-
- try {
- await db.updateService({ id, fqdn, name, exposePort });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/n8n/start.json.ts b/src/routes/services/[id]/n8n/start.json.ts
deleted file mode 100644
index 073fede9b4..0000000000
--- a/src/routes/services/[id]/n8n/start.json.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
- service;
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('n8n');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
-
- const config = {
- image: `${image}:${version}`,
- volume: `${id}-n8n:/root/.n8n`,
- environmentVariables: {
- WEBHOOK_URL: `${service.fqdn}`
- }
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.environmentVariables[secret.name] = secret.value;
- });
- }
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.image,
- networks: [network],
- volumes: [config.volume],
- environment: config.environmentVariables,
- restart: 'always',
- labels: makeLabelForServices('n8n'),
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.volume.split(':')[0]]: {
- name: config.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/n8n/stop.json.ts b/src/routes/services/[id]/n8n/stop.json.ts
deleted file mode 100644
index c604e1cc3b..0000000000
--- a/src/routes/services/[id]/n8n/stop.json.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker, fqdn } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/nocodb/index.json.ts b/src/routes/services/[id]/nocodb/index.json.ts
deleted file mode 100644
index e269e8fe78..0000000000
--- a/src/routes/services/[id]/nocodb/index.json.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
-
- let { name, fqdn, exposePort } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
-
- try {
- await db.updateService({ id, fqdn, name, exposePort });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/nocodb/start.json.ts b/src/routes/services/[id]/nocodb/start.json.ts
deleted file mode 100644
index 35eb4e2c52..0000000000
--- a/src/routes/services/[id]/nocodb/start.json.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
- service;
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('nocodb');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
-
- const config = {
- image: `${image}:${version}`,
- volume: `${id}-nc:/usr/app/data`,
- environmentVariables: {}
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.environmentVariables[secret.name] = secret.value;
- });
- }
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.image,
- networks: [network],
- volumes: [config.volume],
- environment: config.environmentVariables,
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- labels: makeLabelForServices('nocodb'),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.volume.split(':')[0]]: {
- name: config.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/nocodb/stop.json.ts b/src/routes/services/[id]/nocodb/stop.json.ts
deleted file mode 100644
index c604e1cc3b..0000000000
--- a/src/routes/services/[id]/nocodb/stop.json.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker, fqdn } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/plausibleanalytics/activate.json.ts b/src/routes/services/[id]/plausibleanalytics/activate.json.ts
deleted file mode 100644
index d6528d74b5..0000000000
--- a/src/routes/services/[id]/plausibleanalytics/activate.json.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { dockerInstance } from '$lib/docker';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = await event.request.json();
-
- try {
- const {
- destinationDockerId,
- destinationDocker,
- plausibleAnalytics: { postgresqlUser, postgresqlPassword, postgresqlDatabase }
- } = await db.getService({ id, teamId });
- if (destinationDockerId) {
- const docker = dockerInstance({ destinationDocker });
- const container = await docker.engine.getContainer(id);
- const command = await container.exec({
- Cmd: [
- `psql -H postgresql://${postgresqlUser}:${postgresqlPassword}@localhost:5432/${postgresqlDatabase} -c "UPDATE users SET email_verified = true;"`
- ]
- });
- await command.start();
- }
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/plausibleanalytics/index.json.ts b/src/routes/services/[id]/plausibleanalytics/index.json.ts
deleted file mode 100644
index aeaf655ce9..0000000000
--- a/src/routes/services/[id]/plausibleanalytics/index.json.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- let {
- name,
- fqdn,
- exposePort,
- plausibleAnalytics: { email, username, scriptName }
- } = await event.request.json();
-
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (email) email = email.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
- if (scriptName) {
- scriptName = scriptName.toLowerCase();
- if (scriptName.startsWith('/')) {
- scriptName = scriptName.replaceAll(/\//gi, '');
- }
- }
- try {
- await db.updatePlausibleAnalyticsService({
- id,
- fqdn,
- name,
- email,
- username,
- exposePort,
- scriptName
- });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/plausibleanalytics/start.json.ts b/src/routes/services/[id]/plausibleanalytics/start.json.ts
deleted file mode 100644
index e98e7093a5..0000000000
--- a/src/routes/services/[id]/plausibleanalytics/start.json.ts
+++ /dev/null
@@ -1,209 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const {
- type,
- version,
- fqdn,
- destinationDockerId,
- destinationDocker,
- serviceSecret,
- exposePort,
- plausibleAnalytics: {
- id: plausibleDbId,
- username,
- email,
- password,
- postgresqlDatabase,
- postgresqlPassword,
- postgresqlUser,
- secretKeyBase
- }
- } = service;
- const image = getServiceImage(type);
-
- const config = {
- plausibleAnalytics: {
- image: `${image}:${version}`,
- environmentVariables: {
- ADMIN_USER_EMAIL: email,
- ADMIN_USER_NAME: username,
- ADMIN_USER_PWD: password,
- BASE_URL: fqdn,
- SECRET_KEY_BASE: secretKeyBase,
- DISABLE_AUTH: 'false',
- DISABLE_REGISTRATION: 'true',
- DATABASE_URL: `postgresql://${postgresqlUser}:${postgresqlPassword}@${id}-postgresql:5432/${postgresqlDatabase}`,
- CLICKHOUSE_DATABASE_URL: `http://${id}-clickhouse:8123/plausible`
- }
- },
- postgresql: {
- volume: `${plausibleDbId}-postgresql-data:/bitnami/postgresql/`,
- image: 'bitnami/postgresql:13.2.0',
- environmentVariables: {
- POSTGRESQL_PASSWORD: postgresqlPassword,
- POSTGRESQL_USERNAME: postgresqlUser,
- POSTGRESQL_DATABASE: postgresqlDatabase
- }
- },
- clickhouse: {
- volume: `${plausibleDbId}-clickhouse-data:/var/lib/clickhouse`,
- image: 'yandex/clickhouse-server:21.3.2.5',
- environmentVariables: {},
- ulimits: {
- nofile: {
- soft: 262144,
- hard: 262144
- }
- }
- }
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.plausibleAnalytics.environmentVariables[secret.name] = secret.value;
- });
- }
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('plausibleanalytics');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
-
- const clickhouseConfigXml = `
- <yandex>
- <logger>
- <level>warning</level>
- <console>true</console>
- </logger>
-
- <!-- Stop all the unnecessary logging -->
- <query_thread_log remove="remove"/>
- <query_log remove="remove"/>
- <text_log remove="remove"/>
- <trace_log remove="remove"/>
- <metric_log remove="remove"/>
- <asynchronous_metric_log remove="remove"/>
- </yandex>`;
- const clickhouseUserConfigXml = `
- <yandex>
- <profiles>
- <default>
- <log_queries>0</log_queries>
- <log_query_threads>0</log_query_threads>
- </default>
- </profiles>
- </yandex>`;
-
- const initQuery = 'CREATE DATABASE IF NOT EXISTS plausible;';
- const initScript = 'clickhouse client --queries-file /docker-entrypoint-initdb.d/init.query';
- await fs.writeFile(`${workdir}/clickhouse-config.xml`, clickhouseConfigXml);
- await fs.writeFile(`${workdir}/clickhouse-user-config.xml`, clickhouseUserConfigXml);
- await fs.writeFile(`${workdir}/init.query`, initQuery);
- await fs.writeFile(`${workdir}/init-db.sh`, initScript);
-
- const Dockerfile = `
-FROM ${config.clickhouse.image}
-COPY ./clickhouse-config.xml /etc/clickhouse-server/users.d/logging.xml
-COPY ./clickhouse-user-config.xml /etc/clickhouse-server/config.d/logging.xml
-COPY ./init.query /docker-entrypoint-initdb.d/init.query
-COPY ./init-db.sh /docker-entrypoint-initdb.d/init-db.sh`;
-
- await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile);
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.plausibleAnalytics.image,
- command:
- 'sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"',
- networks: [network],
- environment: config.plausibleAnalytics.environmentVariables,
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- depends_on: [`${id}-postgresql`, `${id}-clickhouse`],
- labels: makeLabelForServices('plausibleAnalytics'),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '10s',
- max_attempts: 5,
- window: '120s'
- }
- }
- },
- [`${id}-postgresql`]: {
- container_name: `${id}-postgresql`,
- image: config.postgresql.image,
- networks: [network],
- environment: config.postgresql.environmentVariables,
- volumes: [config.postgresql.volume],
- restart: 'always',
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '10s',
- max_attempts: 5,
- window: '120s'
- }
- }
- },
- [`${id}-clickhouse`]: {
- build: workdir,
- container_name: `${id}-clickhouse`,
- networks: [network],
- environment: config.clickhouse.environmentVariables,
- volumes: [config.clickhouse.volume],
- restart: 'always',
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '10s',
- max_attempts: 5,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.postgresql.volume.split(':')[0]]: {
- name: config.postgresql.volume.split(':')[0]
- },
- [config.clickhouse.volume.split(':')[0]]: {
- name: config.clickhouse.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(
- `DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up --build -d`
- );
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/plausibleanalytics/stop.json.ts b/src/routes/services/[id]/plausibleanalytics/stop.json.ts
deleted file mode 100644
index 6ff3cac3b5..0000000000
--- a/src/routes/services/[id]/plausibleanalytics/stop.json.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker, fqdn } = service;
-
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- let found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- found = await checkContainer(engine, `${id}-postgresql`);
- if (found) {
- await removeDestinationDocker({ id: `${id}-postgresql`, engine });
- }
- found = await checkContainer(engine, `${id}-clickhouse`);
- if (found) {
- await removeDestinationDocker({ id: `${id}-clickhouse`, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/secrets/index.json.ts b/src/routes/services/[id]/secrets/index.json.ts
deleted file mode 100644
index 22c22ae297..0000000000
--- a/src/routes/services/[id]/secrets/index.json.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-import { getTeam, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- try {
- const secrets = await db.listServiceSecrets(id);
- return {
- status: 200,
- body: {
- secrets: secrets.sort((a, b) => {
- return ('' + a.name).localeCompare(b.name);
- })
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { name, value, isBuildSecret, isPRMRSecret, isNew } = await event.request.json();
- try {
- if (isNew) {
- const found = await db.isServiceSecretExists({ id, name });
- if (found) {
- throw {
- error: `Secret ${name} already exists.`
- };
- } else {
- await db.createServiceSecret({ id, name, value });
- return {
- status: 201
- };
- }
- } else {
- await db.updateServiceSecret({ id, name, value });
- return {
- status: 201
- };
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-export const del: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { name } = await event.request.json();
-
- try {
- await db.removeServiceSecret({ id, name });
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/settings.json.ts b/src/routes/services/[id]/settings.json.ts
deleted file mode 100644
index 50488cf939..0000000000
--- a/src/routes/services/[id]/settings.json.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { dualCerts } = await event.request.json();
-
- try {
- await db.setServiceSettings({ id, dualCerts });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/storage/index.json.ts b/src/routes/services/[id]/storage/index.json.ts
deleted file mode 100644
index a2a240fe4b..0000000000
--- a/src/routes/services/[id]/storage/index.json.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { status, body, teamId } = await getUserDetails(event, false);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- try {
- const persistentStorages = await db.prisma.servicePersistentStorage.findMany({
- where: { serviceId: id }
- });
- return {
- body: {
- persistentStorages
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { path, newStorage, storageId } = await event.request.json();
- try {
- if (newStorage) {
- await db.prisma.servicePersistentStorage.create({
- data: { path, service: { connect: { id } } }
- });
- } else {
- await db.prisma.servicePersistentStorage.update({
- where: { id: storageId },
- data: { path }
- });
- }
- return {
- status: 201
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const del: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
- const { path } = await event.request.json();
-
- try {
- await db.prisma.servicePersistentStorage.deleteMany({ where: { serviceId: id, path } });
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/umami/index.json.ts b/src/routes/services/[id]/umami/index.json.ts
deleted file mode 100644
index ff98ede6d0..0000000000
--- a/src/routes/services/[id]/umami/index.json.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- let { name, fqdn, exposePort } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
-
- try {
- await db.updateService({ id, fqdn, name, exposePort });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/umami/start.json.ts b/src/routes/services/[id]/umami/start.json.ts
deleted file mode 100644
index 7ba5547edf..0000000000
--- a/src/routes/services/[id]/umami/start.json.ts
+++ /dev/null
@@ -1,218 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import type { Service, DestinationDocker, Prisma } from '@prisma/client';
-import bcrypt from 'bcryptjs';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service: Service & Prisma.ServiceInclude & { destinationDocker: DestinationDocker } =
- await db.getService({ id, teamId });
- const {
- type,
- version,
- destinationDockerId,
- destinationDocker,
- serviceSecret,
- exposePort,
- umami: {
- umamiAdminPassword,
- postgresqlUser,
- postgresqlPassword,
- postgresqlDatabase,
- hashSalt
- }
- } = service;
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('umami');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
-
- const config = {
- umami: {
- image: `${image}:${version}`,
- environmentVariables: {
- DATABASE_URL: `postgresql://${postgresqlUser}:${postgresqlPassword}@${id}-postgresql:5432/${postgresqlDatabase}`,
- DATABASE_TYPE: 'postgresql',
- HASH_SALT: hashSalt
- }
- },
- postgresql: {
- image: 'postgres:12-alpine',
- volume: `${id}-postgresql-data:/var/lib/postgresql/data`,
- environmentVariables: {
- POSTGRES_USER: postgresqlUser,
- POSTGRES_PASSWORD: postgresqlPassword,
- POSTGRES_DB: postgresqlDatabase
- }
- }
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.umami.environmentVariables[secret.name] = secret.value;
- });
- }
-
- const initDbSQL = `
- drop table if exists event;
- drop table if exists pageview;
- drop table if exists session;
- drop table if exists website;
- drop table if exists account;
-
- create table account (
- user_id serial primary key,
- username varchar(255) unique not null,
- password varchar(60) not null,
- is_admin bool not null default false,
- created_at timestamp with time zone default current_timestamp,
- updated_at timestamp with time zone default current_timestamp
- );
-
- create table website (
- website_id serial primary key,
- website_uuid uuid unique not null,
- user_id int not null references account(user_id) on delete cascade,
- name varchar(100) not null,
- domain varchar(500),
- share_id varchar(64) unique,
- created_at timestamp with time zone default current_timestamp
- );
-
- create table session (
- session_id serial primary key,
- session_uuid uuid unique not null,
- website_id int not null references website(website_id) on delete cascade,
- created_at timestamp with time zone default current_timestamp,
- hostname varchar(100),
- browser varchar(20),
- os varchar(20),
- device varchar(20),
- screen varchar(11),
- language varchar(35),
- country char(2)
- );
-
- create table pageview (
- view_id serial primary key,
- website_id int not null references website(website_id) on delete cascade,
- session_id int not null references session(session_id) on delete cascade,
- created_at timestamp with time zone default current_timestamp,
- url varchar(500) not null,
- referrer varchar(500)
- );
-
- create table event (
- event_id serial primary key,
- website_id int not null references website(website_id) on delete cascade,
- session_id int not null references session(session_id) on delete cascade,
- created_at timestamp with time zone default current_timestamp,
- url varchar(500) not null,
- event_type varchar(50) not null,
- event_value varchar(50) not null
- );
-
- create index website_user_id_idx on website(user_id);
-
- create index session_created_at_idx on session(created_at);
- create index session_website_id_idx on session(website_id);
-
- create index pageview_created_at_idx on pageview(created_at);
- create index pageview_website_id_idx on pageview(website_id);
- create index pageview_session_id_idx on pageview(session_id);
- create index pageview_website_id_created_at_idx on pageview(website_id, created_at);
- create index pageview_website_id_session_id_created_at_idx on pageview(website_id, session_id, created_at);
-
- create index event_created_at_idx on event(created_at);
- create index event_website_id_idx on event(website_id);
- create index event_session_id_idx on event(session_id);
-
- insert into account (username, password, is_admin) values ('admin', '${bcrypt.hashSync(
- umamiAdminPassword,
- 10
- )}', true);`;
- await fs.writeFile(`${workdir}/schema.postgresql.sql`, initDbSQL);
- const Dockerfile = `
- FROM ${config.postgresql.image}
- COPY ./schema.postgresql.sql /docker-entrypoint-initdb.d/schema.postgresql.sql`;
- await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile);
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.umami.image,
- environment: config.umami.environmentVariables,
- networks: [network],
- volumes: [],
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- labels: makeLabelForServices('umami'),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- },
- depends_on: [`${id}-postgresql`]
- },
- [`${id}-postgresql`]: {
- build: workdir,
- container_name: `${id}-postgresql`,
- environment: config.postgresql.environmentVariables,
- networks: [network],
- volumes: [config.postgresql.volume],
- restart: 'always',
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.postgresql.volume.split(':')[0]]: {
- name: config.postgresql.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/umami/stop.json.ts b/src/routes/services/[id]/umami/stop.json.ts
deleted file mode 100644
index 67dd96d048..0000000000
--- a/src/routes/services/[id]/umami/stop.json.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer, stopTcpHttpProxy } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- try {
- const found = await checkContainer(engine, `${id}-postgresql`);
- if (found) {
- await removeDestinationDocker({ id: `${id}-postgresql`, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/uptimekuma/index.json.ts b/src/routes/services/[id]/uptimekuma/index.json.ts
deleted file mode 100644
index e269e8fe78..0000000000
--- a/src/routes/services/[id]/uptimekuma/index.json.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
-
- let { name, fqdn, exposePort } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
-
- try {
- await db.updateService({ id, fqdn, name, exposePort });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/uptimekuma/start.json.ts b/src/routes/services/[id]/uptimekuma/start.json.ts
deleted file mode 100644
index 9032ce4695..0000000000
--- a/src/routes/services/[id]/uptimekuma/start.json.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
- service;
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('uptimekuma');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
-
- const config = {
- image: `${image}:${version}`,
- volume: `${id}-uptimekuma:/app/data`,
- environmentVariables: {}
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.environmentVariables[secret.name] = secret.value;
- });
- }
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.image,
- networks: [network],
- volumes: [config.volume],
- environment: config.environmentVariables,
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- labels: makeLabelForServices('uptimekuma'),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.volume.split(':')[0]]: {
- name: config.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/uptimekuma/stop.json.ts b/src/routes/services/[id]/uptimekuma/stop.json.ts
deleted file mode 100644
index c604e1cc3b..0000000000
--- a/src/routes/services/[id]/uptimekuma/stop.json.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker, fqdn } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/usage.json.ts b/src/routes/services/[id]/usage.json.ts
deleted file mode 100644
index 24e27b1c4a..0000000000
--- a/src/routes/services/[id]/usage.json.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { getContainerUsage } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- let usage = {};
- try {
- const service = await db.getService({ id, teamId });
- if (service.destinationDockerId) {
- [usage] = await Promise.all([getContainerUsage(service.destinationDocker.engine, id)]);
- }
- return {
- status: 200,
- body: {
- usage
- },
- headers: {}
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/vaultwarden/index.json.ts b/src/routes/services/[id]/vaultwarden/index.json.ts
deleted file mode 100644
index e269e8fe78..0000000000
--- a/src/routes/services/[id]/vaultwarden/index.json.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
-
- let { name, fqdn, exposePort } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
-
- try {
- await db.updateService({ id, fqdn, name, exposePort });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/vaultwarden/start.json.ts b/src/routes/services/[id]/vaultwarden/start.json.ts
deleted file mode 100644
index 41b7902666..0000000000
--- a/src/routes/services/[id]/vaultwarden/start.json.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { getServiceImage, ErrorHandler } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { type, version, destinationDockerId, destinationDocker, serviceSecret, exposePort } =
- service;
-
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('vaultwarden');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
-
- const config = {
- image: `${image}:${version}`,
- volume: `${id}-vaultwarden-data:/data/`,
- environmentVariables: {}
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.environmentVariables[secret.name] = secret.value;
- });
- }
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.image,
- environment: config.environmentVariables,
- networks: [network],
- volumes: [config.volume],
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- labels: makeLabelForServices('vaultWarden'),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.volume.split(':')[0]]: {
- name: config.volume.split(':')[0]
- }
- }
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/vaultwarden/stop.json.ts b/src/routes/services/[id]/vaultwarden/stop.json.ts
deleted file mode 100644
index 3c3bfbc626..0000000000
--- a/src/routes/services/[id]/vaultwarden/stop.json.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker, fqdn } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/vscodeserver/index.json.ts b/src/routes/services/[id]/vscodeserver/index.json.ts
deleted file mode 100644
index ff98ede6d0..0000000000
--- a/src/routes/services/[id]/vscodeserver/index.json.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- let { name, fqdn, exposePort } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
-
- try {
- await db.updateService({ id, fqdn, name, exposePort });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/vscodeserver/start.json.ts b/src/routes/services/[id]/vscodeserver/start.json.ts
deleted file mode 100644
index ba9807f120..0000000000
--- a/src/routes/services/[id]/vscodeserver/start.json.ts
+++ /dev/null
@@ -1,120 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const {
- type,
- version,
- destinationDockerId,
- destinationDocker,
- serviceSecret,
- persistentStorage,
- exposePort,
- vscodeserver: { password }
- } = service;
-
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const port = getServiceMainPort('vscodeserver');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const image = getServiceImage(type);
-
- const config = {
- image: `${image}:${version}`,
- volume: `${id}-vscodeserver-data:/home/coder`,
- environmentVariables: {
- PASSWORD: password
- }
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.environmentVariables[secret.name] = secret.value;
- });
- }
-
- const volumes =
- persistentStorage?.map((storage) => {
- return `${id}${storage.path.replace(/\//gi, '-')}:${storage.path}`;
- }) || [];
-
- const composeVolumes = volumes.map((volume) => {
- return {
- [`${volume.split(':')[0]}`]: {
- name: volume.split(':')[0]
- }
- };
- });
- const volumeMounts = Object.assign(
- {},
- {
- [config.volume.split(':')[0]]: {
- name: config.volume.split(':')[0]
- }
- },
- ...composeVolumes
- );
- const composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.image,
- environment: config.environmentVariables,
- networks: [network],
- volumes: [config.volume, ...volumes],
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- labels: makeLabelForServices('vscodeServer'),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: volumeMounts
- };
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
-
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
-
- const changePermissionOn = persistentStorage.map((p) => p.path);
- if (changePermissionOn.length > 0) {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker exec -u root ${id} chown -R 1000:1000 ${changePermissionOn.join(
- ' '
- )}`
- );
- }
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/vscodeserver/stop.json.ts b/src/routes/services/[id]/vscodeserver/stop.json.ts
deleted file mode 100644
index 3c3bfbc626..0000000000
--- a/src/routes/services/[id]/vscodeserver/stop.json.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const { destinationDockerId, destinationDocker, fqdn } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
-
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- }
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/wordpress/ftp.json.ts b/src/routes/services/[id]/wordpress/ftp.json.ts
deleted file mode 100644
index fab9cd7df4..0000000000
--- a/src/routes/services/[id]/wordpress/ftp.json.ts
+++ /dev/null
@@ -1,187 +0,0 @@
-import { dev } from '$app/env';
-import { asyncExecShell, getEngine, getUserDetails } from '$lib/common';
-import { decrypt, encrypt } from '$lib/crypto';
-import * as db from '$lib/database';
-import { ErrorHandler, generatePassword, getFreePort } from '$lib/database';
-import {
- checkContainer,
- startTcpProxy,
- startTraefikTCPProxy,
- stopTcpHttpProxy
-} from '$lib/haproxy';
-import type { ComposeFile } from '$lib/types/composeFile';
-import type { RequestHandler } from '@sveltejs/kit';
-import cuid from 'cuid';
-import fs from 'fs/promises';
-import yaml from 'js-yaml';
-
-export const post: RequestHandler = async (event) => {
- const { status, body, teamId } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- const { ftpEnabled } = await event.request.json();
- const publicPort = await getFreePort();
-
- let ftpUser = cuid();
- let ftpPassword = generatePassword();
-
- const hostkeyDir = dev ? '/tmp/hostkeys' : '/app/ssl/hostkeys';
- try {
- const data = await db.prisma.wordpress.update({
- where: { serviceId: id },
- data: { ftpEnabled },
- include: { service: { include: { destinationDocker: true } } }
- });
- const {
- service: { destinationDockerId, destinationDocker },
- ftpPublicPort,
- ftpUser: user,
- ftpPassword: savedPassword,
- ftpHostKey,
- ftpHostKeyPrivate
- } = data;
- const { network, engine } = destinationDocker;
- const settings = await db.prisma.setting.findFirst();
- const host = getEngine(engine);
- if (ftpEnabled) {
- if (user) ftpUser = user;
- if (savedPassword) ftpPassword = decrypt(savedPassword);
-
- const { stdout: password } = await asyncExecShell(
- `echo ${ftpPassword} | openssl passwd -1 -stdin`
- );
- if (destinationDockerId) {
- try {
- await fs.stat(hostkeyDir);
- } catch (error) {
- await asyncExecShell(`mkdir -p ${hostkeyDir}`);
- }
- if (!ftpHostKey) {
- await asyncExecShell(
- `ssh-keygen -t ed25519 -f ssh_host_ed25519_key -N "" -q -f ${hostkeyDir}/${id}.ed25519`
- );
- const { stdout: ftpHostKey } = await asyncExecShell(`cat ${hostkeyDir}/${id}.ed25519`);
- await db.prisma.wordpress.update({
- where: { serviceId: id },
- data: { ftpHostKey: encrypt(ftpHostKey) }
- });
- } else {
- await asyncExecShell(`echo "${decrypt(ftpHostKey)}" > ${hostkeyDir}/${id}.ed25519`);
- }
- if (!ftpHostKeyPrivate) {
- await asyncExecShell(`ssh-keygen -t rsa -b 4096 -N "" -f ${hostkeyDir}/${id}.rsa`);
- const { stdout: ftpHostKeyPrivate } = await asyncExecShell(`cat ${hostkeyDir}/${id}.rsa`);
- await db.prisma.wordpress.update({
- where: { serviceId: id },
- data: { ftpHostKeyPrivate: encrypt(ftpHostKeyPrivate) }
- });
- } else {
- await asyncExecShell(`echo "${decrypt(ftpHostKeyPrivate)}" > ${hostkeyDir}/${id}.rsa`);
- }
-
- await db.prisma.wordpress.update({
- where: { serviceId: id },
- data: {
- ftpPublicPort: publicPort,
- ftpUser: user ? undefined : ftpUser,
- ftpPassword: savedPassword ? undefined : encrypt(ftpPassword)
- }
- });
-
- try {
- const isRunning = await checkContainer(engine, `${id}-ftp`);
- if (isRunning) {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker stop -t 0 ${id}-ftp && docker rm ${id}-ftp`
- );
- }
- } catch (error) {
- console.log(error);
- //
- }
- const volumes = [
- `${id}-wordpress-data:/home/${ftpUser}`,
- `${
- dev ? hostkeyDir : '/var/lib/docker/volumes/coolify-ssl-certs/_data/hostkeys'
- }/${id}.ed25519:/etc/ssh/ssh_host_ed25519_key`,
- `${
- dev ? hostkeyDir : '/var/lib/docker/volumes/coolify-ssl-certs/_data/hostkeys'
- }/${id}.rsa:/etc/ssh/ssh_host_rsa_key`,
- `${
- dev ? hostkeyDir : '/var/lib/docker/volumes/coolify-ssl-certs/_data/hostkeys'
- }/${id}.sh:/etc/sftp.d/chmod.sh`
- ];
-
- const compose: ComposeFile = {
- version: '3.8',
- services: {
- [`${id}-ftp`]: {
- image: `atmoz/sftp:alpine`,
- command: `'${ftpUser}:${password.replace('\n', '').replace(/\$/g, '$$$')}:e:33'`,
- extra_hosts: ['host.docker.internal:host-gateway'],
- container_name: `${id}-ftp`,
- volumes,
- networks: [network],
- depends_on: [],
- restart: 'always'
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [`${id}-wordpress-data`]: {
- external: true,
- name: `${id}-wordpress-data`
- }
- }
- };
- await fs.writeFile(
- `${hostkeyDir}/${id}.sh`,
- `#!/bin/bash\nchmod 600 /etc/ssh/ssh_host_ed25519_key /etc/ssh/ssh_host_rsa_key`
- );
- await asyncExecShell(`chmod +x ${hostkeyDir}/${id}.sh`);
- await fs.writeFile(`${hostkeyDir}/${id}-docker-compose.yml`, yaml.dump(compose));
- await asyncExecShell(
- `DOCKER_HOST=${host} docker compose -f ${hostkeyDir}/${id}-docker-compose.yml up -d`
- );
- }
- return {
- status: 201,
- body: {
- publicPort,
- ftpUser,
- ftpPassword
- }
- };
- } else {
- await db.prisma.wordpress.update({
- where: { serviceId: id },
- data: { ftpPublicPort: null }
- });
- try {
- await asyncExecShell(
- `DOCKER_HOST=${host} docker stop -t 0 ${id}-ftp && docker rm ${id}-ftp`
- );
- } catch (error) {
- //
- }
- await stopTcpHttpProxy(id, destinationDocker, ftpPublicPort);
- return {
- status: 200,
- body: {}
- };
- }
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- } finally {
- await asyncExecShell(
- `rm -f ${hostkeyDir}/${id}-docker-compose.yml ${hostkeyDir}/${id}.ed25519 ${hostkeyDir}/${id}.ed25519.pub ${hostkeyDir}/${id}.rsa ${hostkeyDir}/${id}.rsa.pub ${hostkeyDir}/${id}.sh`
- );
- }
-};
diff --git a/src/routes/services/[id]/wordpress/index.json.ts b/src/routes/services/[id]/wordpress/index.json.ts
deleted file mode 100644
index b10bfeefca..0000000000
--- a/src/routes/services/[id]/wordpress/index.json.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
-
- let {
- name,
- fqdn,
- exposePort,
- ownMysql,
- wordpress: { extraConfig, mysqlDatabase, mysqlHost, mysqlPort, mysqlUser, mysqlPassword }
- } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- if (exposePort) exposePort = Number(exposePort);
- if (mysqlPort) mysqlPort = Number(mysqlPort);
- try {
- await db.updateWordpress({
- id,
- fqdn,
- name,
- extraConfig,
- ownMysql,
- mysqlDatabase,
- exposePort,
- mysqlHost,
- mysqlPort,
- mysqlUser,
- mysqlPassword
- });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/wordpress/settings.json.ts b/src/routes/services/[id]/wordpress/settings.json.ts
deleted file mode 100644
index 4848dd220c..0000000000
--- a/src/routes/services/[id]/wordpress/settings.json.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { dev } from '$app/env';
-import { asyncExecShell, getEngine, getUserDetails } from '$lib/common';
-import { decrypt, encrypt } from '$lib/crypto';
-import * as db from '$lib/database';
-import { ErrorHandler, generatePassword, getFreePort } from '$lib/database';
-import { checkContainer, startTcpProxy, stopTcpHttpProxy } from '$lib/haproxy';
-import type { ComposeFile } from '$lib/types/composeFile';
-import type { RequestHandler } from '@sveltejs/kit';
-import cuid from 'cuid';
-import fs from 'fs/promises';
-import yaml from 'js-yaml';
-
-export const post: RequestHandler = async (event) => {
- const { status, body, teamId } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- const { ownMysql } = await event.request.json();
- try {
- await db.prisma.wordpress.update({
- where: { serviceId: id },
- data: { ownMysql }
- });
- return {
- status: 201
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/wordpress/start.json.ts b/src/routes/services/[id]/wordpress/start.json.ts
deleted file mode 100644
index 8375c06d0b..0000000000
--- a/src/routes/services/[id]/wordpress/start.json.ts
+++ /dev/null
@@ -1,146 +0,0 @@
-import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { promises as fs } from 'fs';
-import yaml from 'js-yaml';
-import type { RequestHandler } from '@sveltejs/kit';
-import { ErrorHandler, getServiceImage } from '$lib/database';
-import { makeLabelForServices } from '$lib/buildPacks/common';
-import type { ComposeFile } from '$lib/types/composeFile';
-import { getServiceMainPort } from '$lib/components/common';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const {
- type,
- version,
- fqdn,
- destinationDockerId,
- serviceSecret,
- destinationDocker,
- exposePort,
- wordpress: {
- mysqlDatabase,
- mysqlHost,
- mysqlPort,
- mysqlUser,
- mysqlPassword,
- extraConfig,
- mysqlRootUser,
- mysqlRootUserPassword,
- ownMysql
- }
- } = service;
-
- const network = destinationDockerId && destinationDocker.network;
- const host = getEngine(destinationDocker.engine);
- const image = getServiceImage(type);
- const port = getServiceMainPort('wordpress');
-
- const { workdir } = await createDirectories({ repository: type, buildId: id });
- const config = {
- wordpress: {
- image: `${image}:${version}`,
- volume: `${id}-wordpress-data:/var/www/html`,
- environmentVariables: {
- WORDPRESS_DB_HOST: ownMysql ? `${mysqlHost}:${mysqlPort}` : `${id}-mysql`,
- WORDPRESS_DB_USER: mysqlUser,
- WORDPRESS_DB_PASSWORD: mysqlPassword,
- WORDPRESS_DB_NAME: mysqlDatabase,
- WORDPRESS_CONFIG_EXTRA: extraConfig
- }
- },
- mysql: {
- image: `bitnami/mysql:5.7`,
- volume: `${id}-mysql-data:/bitnami/mysql/data`,
- environmentVariables: {
- MYSQL_ROOT_PASSWORD: mysqlRootUserPassword,
- MYSQL_ROOT_USER: mysqlRootUser,
- MYSQL_USER: mysqlUser,
- MYSQL_PASSWORD: mysqlPassword,
- MYSQL_DATABASE: mysqlDatabase
- }
- }
- };
- if (serviceSecret.length > 0) {
- serviceSecret.forEach((secret) => {
- config.wordpress.environmentVariables[secret.name] = secret.value;
- });
- }
- let composeFile: ComposeFile = {
- version: '3.8',
- services: {
- [id]: {
- container_name: id,
- image: config.wordpress.image,
- environment: config.wordpress.environmentVariables,
- volumes: [config.wordpress.volume],
- networks: [network],
- restart: 'always',
- ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
- labels: makeLabelForServices('wordpress'),
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- }
- },
- networks: {
- [network]: {
- external: true
- }
- },
- volumes: {
- [config.wordpress.volume.split(':')[0]]: {
- name: config.wordpress.volume.split(':')[0]
- }
- }
- };
- if (!ownMysql) {
- composeFile.services[id].depends_on = [`${id}-mysql`];
- composeFile.services[`${id}-mysql`] = {
- container_name: `${id}-mysql`,
- image: config.mysql.image,
- volumes: [config.mysql.volume],
- environment: config.mysql.environmentVariables,
- networks: [network],
- restart: 'always',
- deploy: {
- restart_policy: {
- condition: 'on-failure',
- delay: '5s',
- max_attempts: 3,
- window: '120s'
- }
- }
- };
-
- composeFile.volumes[config.mysql.volume.split(':')[0]] = {
- name: config.mysql.volume.split(':')[0]
- };
- }
- const composeFileDestination = `${workdir}/docker-compose.yaml`;
- await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
- try {
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
- await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
- return {
- status: 200
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/[id]/wordpress/stop.json.ts b/src/routes/services/[id]/wordpress/stop.json.ts
deleted file mode 100644
index c99ed34206..0000000000
--- a/src/routes/services/[id]/wordpress/stop.json.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-import { getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- try {
- const service = await db.getService({ id, teamId });
- const {
- destinationDockerId,
- destinationDocker,
- fqdn,
- wordpress: { ftpEnabled }
- } = service;
- if (destinationDockerId) {
- const engine = destinationDocker.engine;
- try {
- const found = await checkContainer(engine, id);
- if (found) {
- await removeDestinationDocker({ id, engine });
- }
- } catch (error) {
- console.error(error);
- }
- try {
- const found = await checkContainer(engine, `${id}-mysql`);
- if (found) {
- await removeDestinationDocker({ id: `${id}-mysql`, engine });
- }
- } catch (error) {
- console.error(error);
- }
- try {
- if (ftpEnabled) {
- const found = await checkContainer(engine, `${id}-ftp`);
- if (found) {
- await removeDestinationDocker({ id: `${id}-ftp`, engine });
- }
- await db.prisma.wordpress.update({
- where: { serviceId: id },
- data: { ftpEnabled: false }
- });
- }
- } catch (error) {
- console.error(error);
- }
- }
-
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/index.ts b/src/routes/services/index.ts
deleted file mode 100644
index 9bd7a3dce7..0000000000
--- a/src/routes/services/index.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- try {
- const services = await db.listServices(teamId);
- return {
- body: {
- services
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/services/new.ts b/src/routes/services/new.ts
deleted file mode 100644
index 2faad169c8..0000000000
--- a/src/routes/services/new.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { getUserDetails, uniqueName } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const name = uniqueName();
- try {
- const { id } = await db.newService({ name, teamId });
- return { status: 201, body: { id } };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/settings/_Language.svelte b/src/routes/settings/_Language.svelte
deleted file mode 100644
index 566e9c1d11..0000000000
--- a/src/routes/settings/_Language.svelte
+++ /dev/null
@@ -1,22 +0,0 @@
-<script>
- import { t } from '$lib/translations';
- import Cookies from 'js-cookie';
- import langs from '$lib/lang.json';
- function setLocale(locale) {
- Cookies.set('lang', locale);
- return window.location.reload();
- }
-</script>
-
-<div class="grid grid-cols-2 items-start pb-4">
- <div class="flex-col">
- <div class="text-base font-bold text-stone-100">
- {$t('setting.change_language')}
- </div>
- </div>
- <div class="items-center justify-start space-x-2 text-left">
- {#each Object.entries(langs) as [lang, name]}
- <button on:click={() => setLocale(lang)}>Change to {name}</button>
- {/each}
- </div>
-</div>
diff --git a/src/routes/settings/check.json.ts b/src/routes/settings/check.json.ts
deleted file mode 100644
index 88eaa0293b..0000000000
--- a/src/routes/settings/check.json.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-import { dev } from '$app/env';
-import { checkDomainsIsValidInDNS, getDomain, getUserDetails, isDNSValid } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { t } from '$lib/translations';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const domain = event.url.searchParams.get('domain');
- if (!domain) {
- return {
- status: 500,
- body: {
- message: t.get('application.domain_required')
- }
- };
- }
- try {
- await isDNSValid(event, domain);
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
-
- let { fqdn, forceSave, dualCerts, isDNSCheckEnabled } = await event.request.json();
- if (fqdn) fqdn = fqdn.toLowerCase();
- try {
- const found = await db.isDomainConfigured({ id, fqdn });
- console.log(found);
- if (found) {
- throw {
- message: t.get('application.domain_already_in_use', {
- domain: getDomain(fqdn).replace('www.', '')
- })
- };
- }
- if (isDNSCheckEnabled && !forceSave) {
- return await checkDomainsIsValidInDNS({ event, fqdn, dualCerts });
- }
- return {
- status: 200
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/settings/index.json.ts b/src/routes/settings/index.json.ts
deleted file mode 100644
index e57b159c62..0000000000
--- a/src/routes/settings/index.json.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import { dev } from '$app/env';
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { listSettings, ErrorHandler } from '$lib/database';
-import { t } from '$lib/translations';
-import type { RequestHandler } from '@sveltejs/kit';
-import { promises as dns } from 'dns';
-
-export const get: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- if (teamId !== '0') return { status: 200, body: { settings: {} } };
- try {
- const settings = await listSettings();
- return {
- status: 200,
- body: {
- settings
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const del: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (teamId !== '0')
- return {
- status: 401,
- body: {
- message: t.get('setting.permission_denied')
- }
- };
- if (status === 401) return { status, body };
-
- const { fqdn } = await event.request.json();
- let ip;
- try {
- ip = await dns.resolve(fqdn);
- } catch (error) {
- // Do not care.
- }
- try {
- await db.prisma.setting.update({ where: { fqdn }, data: { fqdn: null } });
- return {
- status: 200,
- body: {
- message: t.get('setting.domain_removed'),
- redirect: ip ? `http://${ip[0]}:3000/settings` : undefined
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (teamId !== '0')
- return {
- status: 401,
- body: {
- message: t.get('setting.permission_denied')
- }
- };
- if (status === 401) return { status, body };
-
- const {
- fqdn,
- isRegistrationEnabled,
- dualCerts,
- minPort,
- maxPort,
- isAutoUpdateEnabled,
- isDNSCheckEnabled
- } = await event.request.json();
- try {
- const { id } = await db.listSettings();
- await db.prisma.setting.update({
- where: { id },
- data: { isRegistrationEnabled, dualCerts, isAutoUpdateEnabled, isDNSCheckEnabled }
- });
- if (fqdn) {
- await db.prisma.setting.update({ where: { id }, data: { fqdn } });
- }
- if (minPort && maxPort) {
- await db.prisma.setting.update({ where: { id }, data: { minPort, maxPort } });
- }
- return {
- status: 201
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/settings/renew.json.ts b/src/routes/settings/renew.json.ts
deleted file mode 100644
index 3cbb8f4ad8..0000000000
--- a/src/routes/settings/renew.json.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import { ErrorHandler } from '$lib/database';
-import { renewSSLCerts } from '$lib/letsencrypt';
-import { t } from '$lib/translations';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (teamId !== '0')
- return {
- status: 401,
- body: {
- message: t.get('setting.permission_denied')
- }
- };
- if (status === 401) return { status, body };
-
- try {
- renewSSLCerts();
- return {
- status: 201
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/sources/[id]/__layout.svelte b/src/routes/sources/[id]/__layout.svelte
deleted file mode 100644
index 30df278a50..0000000000
--- a/src/routes/sources/[id]/__layout.svelte
+++ /dev/null
@@ -1,69 +0,0 @@
-<script context="module" lang="ts">
- import type { Load } from '@sveltejs/kit';
- export const load: Load = async ({ fetch, params }) => {
- const url = `/sources/${params.id}.json`;
- const res = await fetch(url);
- if (res.ok) {
- const { source, settings } = await res.json();
- if (!source || Object.entries(source).length === 0) {
- return {
- status: 302,
- redirect: '/sources'
- };
- }
- return {
- props: {
- source
- },
- stuff: {
- source,
- settings
- }
- };
- }
-
- return {
- status: 302,
- redirect: '/sources'
- };
- };
-</script>
-
-<script>
- export let source;
- import { page, session } from '$app/stores';
- import { errorNotification } from '$lib/form';
- import DeleteIcon from '$lib/components/DeleteIcon.svelte';
- import { t } from '$lib/translations';
- const { id } = $page.params;
-
- async function deleteSource(name) {
- const sure = confirm($t('application.confirm_to_delete', { name: name }));
- if (sure) {
- const response = await fetch(`/sources/${id}.json`, {
- method: 'delete'
- });
- if (!response.ok) {
- const { message } = await response.json();
- errorNotification(message);
- } else {
- window.location.assign('/sources');
- }
- }
- }
-</script>
-
-<nav class="nav-side">
- <button
- on:click={() => deleteSource(source.name)}
- title={$t('source.delete_git_source')}
- type="submit"
- disabled={!$session.isAdmin}
- class:hover:text-red-500={$session.isAdmin}
- class="icons tooltip-bottom bg-transparent text-sm"
- data-tooltip={$session.isAdmin
- ? $t('source.delete_git_source')
- : $t('source.permission_denied')}><DeleteIcon /></button
- >
-</nav>
-<slot />
diff --git a/src/routes/sources/[id]/check.json.ts b/src/routes/sources/[id]/check.json.ts
deleted file mode 100644
index 89084fdd76..0000000000
--- a/src/routes/sources/[id]/check.json.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import { t } from '$lib/translations';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- try {
- const { oauthId } = await event.request.json();
- const found = await db.prisma.gitlabApp.findFirst({ where: { oauthId: Number(oauthId) } });
- if (found) {
- throw {
- message: t.get('source.gitlab.already_configured')
- };
- }
- return { status: 200 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/sources/[id]/github.json.ts b/src/routes/sources/[id]/github.json.ts
deleted file mode 100644
index 14da66c0a4..0000000000
--- a/src/routes/sources/[id]/github.json.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
-
- try {
- let { type, name, htmlUrl, apiUrl, organization } = await event.request.json();
- await db.addGitHubSource({ id, teamId, type, name, htmlUrl, apiUrl, organization });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/sources/[id]/gitlab.json.ts b/src/routes/sources/[id]/gitlab.json.ts
deleted file mode 100644
index b1ed314bf0..0000000000
--- a/src/routes/sources/[id]/gitlab.json.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
- const { id } = event.params;
-
- try {
- let { type, name, htmlUrl, apiUrl, oauthId, appId, appSecret, groupName } =
- await event.request.json();
-
- oauthId = Number(oauthId);
-
- await db.addGitLabSource({
- id,
- teamId,
- type,
- name,
- htmlUrl,
- apiUrl,
- oauthId,
- appId,
- appSecret,
- groupName
- });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/sources/[id]/index.json.ts b/src/routes/sources/[id]/index.json.ts
deleted file mode 100644
index cd19e6785f..0000000000
--- a/src/routes/sources/[id]/index.json.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { getTeam, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (request) => {
- const { teamId, status, body } = await getUserDetails(request);
- if (status === 401) return { status, body };
-
- const { id } = request.params;
- try {
- const source = await db.getSource({ id, teamId });
- const settings = await db.listSettings();
- return {
- status: 200,
- body: {
- source,
- settings
- }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const del: RequestHandler = async (request) => {
- const { status, body } = await getUserDetails(request);
- if (status === 401) return { status, body };
-
- const { id } = request.params;
-
- try {
- await db.removeSource({ id });
- return { status: 200 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const { id } = event.params;
-
- const { name, htmlUrl, apiUrl } = await event.request.json();
-
- try {
- await db.updateGitsource({ id, name, htmlUrl, apiUrl });
- return { status: 201 };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/sources/[id]/newGithubApp.svelte b/src/routes/sources/[id]/newGithubApp.svelte
deleted file mode 100644
index e3215b380b..0000000000
--- a/src/routes/sources/[id]/newGithubApp.svelte
+++ /dev/null
@@ -1,89 +0,0 @@
-<script context="module" lang="ts">
- import type { Load } from '@sveltejs/kit';
- import { onMount } from 'svelte';
- export const load: Load = async ({ fetch, params, stuff }) => {
- if (stuff?.source) {
- return {
- props: {
- source: stuff.source,
- settings: stuff.settings
- }
- };
- }
- const url = `/sources/${params.id}.json`;
- const res = await fetch(url);
-
- if (res.ok) {
- return {
- props: {
- ...(await res.json())
- }
- };
- }
-
- return {
- status: res.status,
- error: new Error(`Could not load ${url}`)
- };
- };
-</script>
-
-<script>
- import { dev } from '$app/env';
- import { getDomain, dashify } from '$lib/components/common';
- import { t } from '$lib/translations';
-
- export let source;
- export let settings;
- onMount(() => {
- const { organization, id, htmlUrl } = source;
- const { fqdn } = settings;
- const host = dev
- ? 'http://localhost:3000'
- : fqdn
- ? fqdn
- : `http://${window.location.host}` || '';
- const domain = getDomain(fqdn);
-
- let url = 'settings/apps/new';
- if (organization) url = `organizations/${organization}/settings/apps/new`;
- const name = dashify(domain) || 'app';
- const data = JSON.stringify({
- name: `coolify-${name}`,
- url: host,
- hook_attributes: {
- url: dev
- ? 'https://webhook.site/0e5beb2c-4e9b-40e2-a89e-32295e570c21/events'
- : `${host}/webhooks/github/events`
- },
- redirect_url: `${host}/webhooks/github`,
- callback_urls: [`${host}/login/github/app`],
- public: false,
- request_oauth_on_install: false,
- setup_url: `${host}/webhooks/github/install?gitSourceId=${id}`,
- setup_on_update: true,
- default_permissions: {
- contents: 'read',
- metadata: 'read',
- pull_requests: 'read',
- emails: 'read'
- },
- default_events: ['pull_request', 'push']
- });
- const form = document.createElement('form');
- form.setAttribute('method', 'post');
- form.setAttribute('action', `${htmlUrl}/${url}?state=${id}`);
- const input = document.createElement('input');
- input.setAttribute('id', 'manifest');
- input.setAttribute('name', 'manifest');
- input.setAttribute('type', 'hidden');
- input.setAttribute('value', data);
- form.appendChild(input);
- document.getElementsByTagName('body')[0].appendChild(form);
- form.submit();
- });
-</script>
-
-<div class="flex h-screen items-center justify-center text-3xl font-bold">
- {$t('source.github.redirecting')}
-</div>
diff --git a/src/routes/sources/index.json.ts b/src/routes/sources/index.json.ts
deleted file mode 100644
index b4e89fce9c..0000000000
--- a/src/routes/sources/index.json.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { getTeam, getUserDetails } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (request) => {
- const { teamId, status, body } = await getUserDetails(request);
- if (status === 401) return { status, body };
-
- try {
- const sources = await db.listSources(teamId);
- return { status: 200, body: { sources } };
- } catch (err) {
- return ErrorHandler(err);
- }
-};
diff --git a/src/routes/sources/new.ts b/src/routes/sources/new.ts
deleted file mode 100644
index 25943f8bc7..0000000000
--- a/src/routes/sources/new.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { getUserDetails, uniqueName } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const post: RequestHandler = async (event) => {
- const { teamId, status, body } = await getUserDetails(event);
- if (status === 401) return { status, body };
-
- const name = uniqueName();
- try {
- const { id } = await db.newSource({ teamId, name });
- return { status: 201, body: { id } };
- } catch (e) {
- return ErrorHandler(e);
- }
-};
diff --git a/src/routes/undead.json.ts b/src/routes/undead.json.ts
deleted file mode 100644
index bf9423d744..0000000000
--- a/src/routes/undead.json.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export const get = async () => {
- return {
- status: 200,
- body: {
- message: 'Nope'
- }
- };
-};
diff --git a/src/routes/update.json.ts b/src/routes/update.json.ts
deleted file mode 100644
index a7c3e5c575..0000000000
--- a/src/routes/update.json.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-import { dev } from '$app/env';
-import { asyncExecShell, version } from '$lib/common';
-import { asyncSleep } from '$lib/components/common';
-import { ErrorHandler } from '$lib/database';
-import * as db from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-import compare from 'compare-versions';
-import got from 'got';
-
-export const get: RequestHandler = async (request) => {
- try {
- const currentVersion = version;
- const versions = await got
- .get(
- `https://get.coollabs.io/versions.json?appId=${process.env['COOLIFY_APP_ID']}&version=${currentVersion}`
- )
- .json();
- const latestVersion =
- request.url.hostname === 'staging.coolify.io'
- ? versions['coolify'].next.version
- : versions['coolify'].main.version;
- const isUpdateAvailable = compare(latestVersion, currentVersion);
- return {
- body: {
- isUpdateAvailable: isUpdateAvailable === 1,
- latestVersion
- }
- };
- } catch (error) {
- console.log(error);
- return ErrorHandler(error);
- }
-};
-
-export const post: RequestHandler = async (event) => {
- const { type, latestVersion } = await event.request.json();
- const settings = await db.prisma.setting.findFirst();
- if (type === 'update') {
- try {
- if (!dev) {
- await asyncExecShell(`docker pull coollabsio/coolify:${latestVersion}`);
- await asyncExecShell(`env | grep COOLIFY > .env`);
- await asyncExecShell(
- `sed -i '/COOLIFY_AUTO_UPDATE=/c\COOLIFY_AUTO_UPDATE=${settings.isAutoUpdateEnabled}' .env`
- );
- await asyncExecShell(
- `docker run --rm -tid --env-file .env -v /var/run/docker.sock:/var/run/docker.sock -v coolify-db coollabsio/coolify:${latestVersion} /bin/sh -c "env | grep COOLIFY > .env && echo 'TAG=${latestVersion}' >> .env && docker stop -t 0 coolify coolify-redis && docker rm coolify coolify-redis && docker compose up -d --force-recreate"`
- );
- return {
- status: 200,
- body: {}
- };
- } else {
- console.log(latestVersion);
- await asyncSleep(2000);
- return {
- status: 200,
- body: {}
- };
- }
- } catch (error) {
- return ErrorHandler(error);
- }
- } else if (type === 'traefik') {
- try {
- // const found = await checkContainer('/var/run/docker.sock', 'coolify-haproxy');
- // if (found) {
- // await asyncExecShell(`docker stop -t 0 coolify-haproxy`);
- // await asyncExecShell(`docker rm coolify-haproxy`);
- // }
- // await startTraefikProxy('/var/run/docker.sock');
- await db.prisma.setting.update({
- where: { id: settings.id },
- data: { isTraefikUsed: true }
- });
- return {
- status: 200,
- body: {}
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- } else if (type === 'haproxy') {
- try {
- // const found = await checkContainer('/var/run/docker.sock', 'coolify-proxy');
- // if (found) {
- // await asyncExecShell(`docker stop -t 0 coolify-proxy`);
- // await asyncExecShell(`docker rm coolify-proxy`);
- // }
- // await startCoolifyProxy('/var/run/docker.sock');
- await db.prisma.setting.update({
- where: { id: settings.id },
- data: { isTraefikUsed: false }
- });
- return {
- status: 200,
- body: {}
- };
- } catch (error) {
- return ErrorHandler(error);
- }
- }
- return {
- status: 500
- };
-};
diff --git a/src/routes/webhooks/github/events.ts b/src/routes/webhooks/github/events.ts
deleted file mode 100644
index cc777a6c5e..0000000000
--- a/src/routes/webhooks/github/events.ts
+++ /dev/null
@@ -1,223 +0,0 @@
-import { getDomain, getTeam, getUserDetails, removeDestinationDocker } from '$lib/common';
-import * as db from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-import cuid from 'cuid';
-import crypto from 'crypto';
-import { buildQueue } from '$lib/queues';
-import { checkContainer } from '$lib/haproxy';
-import { dev } from '$app/env';
-
-export const options: RequestHandler = async () => {
- return {
- status: 204,
- headers: {
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Headers': 'Content-Type, Authorization',
- 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'
- }
- };
-};
-
-export const post: RequestHandler = async (event) => {
- try {
- const buildId = cuid();
- const allowedGithubEvents = ['push', 'pull_request'];
- const allowedActions = ['opened', 'reopened', 'synchronize', 'closed'];
- const githubEvent = event.request.headers.get('x-github-event')?.toLowerCase();
- const githubSignature = event.request.headers.get('x-hub-signature-256')?.toLowerCase();
- if (!allowedGithubEvents.includes(githubEvent)) {
- return {
- status: 500,
- body: {
- message: 'Event not allowed.'
- }
- };
- }
- let repository, projectId, branch;
- const body = await event.request.json();
- if (githubEvent === 'push') {
- repository = body.repository;
- projectId = repository.id;
- branch = body.ref.split('/')[2];
- } else if (githubEvent === 'pull_request') {
- repository = body.pull_request.head.repo;
- projectId = repository.id;
- branch = body.pull_request.head.ref.split('/')[2];
- }
-
- const applicationFound = await db.getApplicationWebhook({ projectId, branch });
- if (applicationFound) {
- const webhookSecret = applicationFound.gitSource.githubApp.webhookSecret || null;
- const hmac = crypto.createHmac('sha256', webhookSecret);
- const digest = Buffer.from(
- 'sha256=' + hmac.update(JSON.stringify(body)).digest('hex'),
- 'utf8'
- );
- if (!dev) {
- const checksum = Buffer.from(githubSignature, 'utf8');
- if (checksum.length !== digest.length || !crypto.timingSafeEqual(digest, checksum)) {
- return {
- status: 500,
- body: {
- message: 'SHA256 checksum failed. Are you doing something fishy?'
- }
- };
- }
- }
-
- if (githubEvent === 'push') {
- if (!applicationFound.configHash) {
- const configHash = crypto
- .createHash('sha256')
- .update(
- JSON.stringify({
- buildPack: applicationFound.buildPack,
- port: applicationFound.port,
- exposePort: applicationFound.exposePort,
- installCommand: applicationFound.installCommand,
- buildCommand: applicationFound.buildCommand,
- startCommand: applicationFound.startCommand
- })
- )
- .digest('hex');
- await db.prisma.application.updateMany({
- where: { branch, projectId },
- data: { configHash }
- });
- }
- await db.prisma.application.update({
- where: { id: applicationFound.id },
- data: { updatedAt: new Date() }
- });
- await db.prisma.build.create({
- data: {
- id: buildId,
- applicationId: applicationFound.id,
- destinationDockerId: applicationFound.destinationDocker.id,
- gitSourceId: applicationFound.gitSource.id,
- githubAppId: applicationFound.gitSource.githubApp?.id,
- gitlabAppId: applicationFound.gitSource.gitlabApp?.id,
- status: 'queued',
- type: 'webhook_commit'
- }
- });
- await buildQueue.add(
- buildId,
- {
- build_id: buildId,
- type: 'webhook_commit',
- ...applicationFound
- },
- { jobId: buildId }
- );
- return {
- status: 200,
- body: {
- message: 'Queued. Thank you!'
- }
- };
- } else if (githubEvent === 'pull_request') {
- const pullmergeRequestId = body.number;
- const pullmergeRequestAction = body.action;
- const sourceBranch = body.pull_request.head.ref;
- if (!allowedActions.includes(pullmergeRequestAction)) {
- return {
- status: 500,
- body: {
- message: 'Action not allowed.'
- }
- };
- }
-
- if (applicationFound.settings.previews) {
- if (applicationFound.destinationDockerId) {
- const isRunning = await checkContainer(
- applicationFound.destinationDocker.engine,
- applicationFound.id
- );
- if (!isRunning) {
- return {
- status: 500,
- body: {
- message: 'Application not running.'
- }
- };
- }
- }
- if (
- pullmergeRequestAction === 'opened' ||
- pullmergeRequestAction === 'reopened' ||
- pullmergeRequestAction === 'synchronize'
- ) {
- await db.prisma.application.update({
- where: { id: applicationFound.id },
- data: { updatedAt: new Date() }
- });
- await db.prisma.build.create({
- data: {
- id: buildId,
- applicationId: applicationFound.id,
- destinationDockerId: applicationFound.destinationDocker.id,
- gitSourceId: applicationFound.gitSource.id,
- githubAppId: applicationFound.gitSource.githubApp?.id,
- gitlabAppId: applicationFound.gitSource.gitlabApp?.id,
- status: 'queued',
- type: 'webhook_pr'
- }
- });
- await buildQueue.add(
- buildId,
- {
- build_id: buildId,
- type: 'webhook_pr',
- ...applicationFound,
- sourceBranch,
- pullmergeRequestId
- },
- { jobId: buildId }
- );
- return {
- status: 200,
- body: {
- message: 'Queued. Thank you!'
- }
- };
- } else if (pullmergeRequestAction === 'closed') {
- if (applicationFound.destinationDockerId) {
- const id = `${applicationFound.id}-${pullmergeRequestId}`;
- const engine = applicationFound.destinationDocker.engine;
- await removeDestinationDocker({ id, engine });
- }
- return {
- status: 200,
- body: {
- message: 'Removed preview. Thank you!'
- }
- };
- }
- } else {
- return {
- status: 500,
- body: {
- message: 'Pull request previews are not enabled.'
- }
- };
- }
- }
- }
- return {
- status: 500,
- body: {
- message: 'Not handled event.'
- }
- };
- } catch (err) {
- console.log(err);
- return {
- status: 500,
- body: {
- message: err.message
- }
- };
- }
-};
diff --git a/src/routes/webhooks/github/index.ts b/src/routes/webhooks/github/index.ts
deleted file mode 100644
index f08556f646..0000000000
--- a/src/routes/webhooks/github/index.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { dev } from '$app/env';
-import { getTeam } from '$lib/common';
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const options = async () => {
- return {
- status: 200,
- headers: {
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Headers': 'Content-Type, Authorization',
- 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'
- }
- };
-};
-
-export const get: RequestHandler = async (request) => {
- const teamId = undefined;
- const code = request.url.searchParams.get('code');
- const state = request.url.searchParams.get('state');
- try {
- const { apiUrl } = await db.getSource({ id: state, teamId });
- const response = await fetch(`${apiUrl}/app-manifests/${code}/conversions`, { method: 'POST' });
- if (!response.ok) {
- const error = await response.json();
- return {
- status: 500,
- body: { ...error }
- };
- }
- const { id, client_id, slug, client_secret, pem, webhook_secret } = await response.json();
- await db.createGithubApp({ id, client_id, slug, client_secret, pem, webhook_secret, state });
- return {
- status: 302,
- headers: { Location: `/webhooks/success` }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/webhooks/github/install.ts b/src/routes/webhooks/github/install.ts
deleted file mode 100644
index 27a8a18708..0000000000
--- a/src/routes/webhooks/github/install.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import * as db from '$lib/database';
-import { ErrorHandler } from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const options = async () => {
- return {
- status: 200,
- headers: {
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Headers': 'Content-Type, Authorization',
- 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'
- }
- };
-};
-
-export const get: RequestHandler = async (request) => {
- const gitSourceId = request.url.searchParams.get('gitSourceId');
- const installation_id = request.url.searchParams.get('installation_id');
-
- try {
- await db.addInstallation({ gitSourceId, installation_id });
- return {
- status: 302,
- headers: { Location: `/webhooks/success` }
- };
- } catch (error) {
- return ErrorHandler(error);
- }
-};
diff --git a/src/routes/webhooks/gitlab/events.ts b/src/routes/webhooks/gitlab/events.ts
deleted file mode 100644
index 6d2cdb65c9..0000000000
--- a/src/routes/webhooks/gitlab/events.ts
+++ /dev/null
@@ -1,220 +0,0 @@
-import { getTeam, getUserDetails, getDomain, removeDestinationDocker } from '$lib/common';
-import { checkContainer } from '$lib/haproxy';
-import * as db from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-import cuid from 'cuid';
-import crypto from 'crypto';
-import { buildQueue } from '$lib/queues';
-import { dev } from '$app/env';
-
-export const options: RequestHandler = async () => {
- return {
- status: 204,
- headers: {
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Headers': 'Content-Type, Authorization',
- 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'
- }
- };
-};
-
-export const post: RequestHandler = async (event) => {
- const allowedActions = ['opened', 'reopen', 'close', 'open', 'update'];
- const body = await event.request.json();
- const buildId = cuid();
- const webhookToken = event.request.headers.get('x-gitlab-token');
- if (!webhookToken) {
- return {
- status: 500,
- body: {
- message: 'Ooops, something is not okay, are you okay?'
- }
- };
- }
- try {
- const { object_kind: objectKind } = body;
- if (objectKind === 'push') {
- const { ref } = body;
- const projectId = Number(body['project_id']);
- const branch = ref.split('/')[2];
- const applicationFound = await db.getApplicationWebhook({ projectId, branch });
- if (applicationFound) {
- if (!applicationFound.configHash) {
- const configHash = crypto
- .createHash('sha256')
- .update(
- JSON.stringify({
- buildPack: applicationFound.buildPack,
- port: applicationFound.port,
- exposePort: applicationFound.exposePort,
- installCommand: applicationFound.installCommand,
- buildCommand: applicationFound.buildCommand,
- startCommand: applicationFound.startCommand
- })
- )
- .digest('hex');
- await db.prisma.application.updateMany({
- where: { branch, projectId },
- data: { configHash }
- });
- }
- await db.prisma.application.update({
- where: { id: applicationFound.id },
- data: { updatedAt: new Date() }
- });
- await db.prisma.build.create({
- data: {
- id: buildId,
- applicationId: applicationFound.id,
- destinationDockerId: applicationFound.destinationDocker.id,
- gitSourceId: applicationFound.gitSource.id,
- githubAppId: applicationFound.gitSource.githubApp?.id,
- gitlabAppId: applicationFound.gitSource.gitlabApp?.id,
- status: 'queued',
- type: 'webhook_commit'
- }
- });
- await buildQueue.add(
- buildId,
- {
- build_id: buildId,
- type: 'webhook_commit',
- ...applicationFound
- },
- { jobId: buildId }
- );
- return {
- status: 200,
- body: {
- message: 'Queued. Thank you!'
- }
- };
- }
- } else if (objectKind === 'merge_request') {
- const isDraft = body.object_attributes.work_in_progress;
- const action = body.object_attributes.action;
- const projectId = Number(body.project.id);
- const sourceBranch = body.object_attributes.source_branch;
- const targetBranch = body.object_attributes.target_branch;
- const pullmergeRequestId = body.object_attributes.iid;
- if (!allowedActions.includes(action)) {
- return {
- status: 500,
- body: {
- message: 'Action not allowed.'
- }
- };
- }
- if (isDraft) {
- return {
- status: 500,
- body: {
- message: 'Draft MR, do nothing.'
- }
- };
- }
-
- const applicationFound = await db.getApplicationWebhook({ projectId, branch: targetBranch });
- if (applicationFound) {
- if (applicationFound.settings.previews) {
- if (applicationFound.destinationDockerId) {
- const isRunning = await checkContainer(
- applicationFound.destinationDocker.engine,
- applicationFound.id
- );
- if (!isRunning) {
- return {
- status: 500,
- body: {
- message: 'Application not running.'
- }
- };
- }
- }
- if (!dev && applicationFound.gitSource.gitlabApp.webhookToken !== webhookToken) {
- return {
- status: 500,
- body: {
- message: 'Ooops, something is not okay, are you okay?'
- }
- };
- }
- if (
- action === 'opened' ||
- action === 'reopen' ||
- action === 'open' ||
- action === 'update'
- ) {
- await db.prisma.application.update({
- where: { id: applicationFound.id },
- data: { updatedAt: new Date() }
- });
- await db.prisma.build.create({
- data: {
- id: buildId,
- applicationId: applicationFound.id,
- destinationDockerId: applicationFound.destinationDocker.id,
- gitSourceId: applicationFound.gitSource.id,
- githubAppId: applicationFound.gitSource.githubApp?.id,
- gitlabAppId: applicationFound.gitSource.gitlabApp?.id,
- status: 'queued',
- type: 'webhook_mr'
- }
- });
- await buildQueue.add(
- buildId,
- {
- build_id: buildId,
- type: 'webhook_mr',
- ...applicationFound,
- sourceBranch,
- pullmergeRequestId
- },
- { jobId: buildId }
- );
- return {
- status: 200,
- body: {
- message: 'Queued. Thank you!'
- }
- };
- } else if (action === 'close') {
- if (applicationFound.destinationDockerId) {
- const id = `${applicationFound.id}-${pullmergeRequestId}`;
- const engine = applicationFound.destinationDocker.engine;
- await removeDestinationDocker({ id, engine });
- }
-
- return {
- status: 200,
- body: {
- message: 'Removed preview. Thank you!'
- }
- };
- }
- }
- return {
- status: 500,
- body: {
- message: 'Merge request previews are not enabled.'
- }
- };
- }
- }
-
- return {
- status: 500,
- body: {
- message: 'Not handled event.'
- }
- };
- } catch (err) {
- console.log(err);
- return {
- status: 500,
- body: {
- message: err.message
- }
- };
- }
-};
diff --git a/src/routes/webhooks/gitlab/index.ts b/src/routes/webhooks/gitlab/index.ts
deleted file mode 100644
index 0cc4f7ab88..0000000000
--- a/src/routes/webhooks/gitlab/index.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import { dev } from '$app/env';
-import { getTeam } from '$lib/common';
-import * as db from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-import got from 'got';
-import cookie from 'cookie';
-
-export const options: RequestHandler = async () => {
- return {
- status: 204,
- headers: {
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Headers': 'Content-Type, Authorization',
- 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'
- }
- };
-};
-
-export const get: RequestHandler = async (event) => {
- const teamId = undefined;
- const code = event.url.searchParams.get('code');
- const state = event.url.searchParams.get('state');
- try {
- const { fqdn } = await db.listSettings();
- const application = await db.getApplication({ id: state, teamId });
- const { appId, appSecret } = application.gitSource.gitlabApp;
- const { htmlUrl } = application.gitSource;
-
- let domain = `http://${event.url.host}`;
- if (fqdn) domain = fqdn;
-
- const { access_token } = await got
- .post(`${htmlUrl}/oauth/token`, {
- searchParams: {
- client_id: appId,
- client_secret: appSecret,
- code,
- state,
- grant_type: 'authorization_code',
- redirect_uri: `${domain}/webhooks/gitlab`
- }
- })
- .json();
-
- return {
- status: 302,
- headers: {
- Location: `/webhooks/success`,
- 'Set-Cookie': [`gitlabToken=${access_token}; HttpOnly; Path=/; Max-Age=15778800;`]
- }
- };
- } catch (err) {
- console.log(err);
- return {
- status: 500,
- body: err.message
- };
- }
-};
diff --git a/src/routes/webhooks/success/index.svelte b/src/routes/webhooks/success/index.svelte
deleted file mode 100644
index 9dd61a089d..0000000000
--- a/src/routes/webhooks/success/index.svelte
+++ /dev/null
@@ -1,3 +0,0 @@
-<script lang="ts">
- window.close();
-</script>
diff --git a/src/routes/webhooks/traefik/main.json.ts b/src/routes/webhooks/traefik/main.json.ts
deleted file mode 100644
index a34d96a4ab..0000000000
--- a/src/routes/webhooks/traefik/main.json.ts
+++ /dev/null
@@ -1,364 +0,0 @@
-import { dev } from '$app/env';
-import { asyncExecShell, getDomain, getEngine } from '$lib/common';
-import { supportedServiceTypesAndVersions } from '$lib/components/common';
-import * as db from '$lib/database';
-import { listServicesWithIncludes } from '$lib/database';
-import { checkContainer } from '$lib/haproxy';
-import type { RequestHandler } from '@sveltejs/kit';
-
-function configureMiddleware(
- { id, container, port, domain, nakedDomain, isHttps, isWWW, isDualCerts, scriptName, type },
- traefik
-) {
- if (isHttps) {
- traefik.http.routers[id] = {
- entrypoints: ['web'],
- rule: `Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`)`,
- service: `${id}`,
- middlewares: ['redirect-to-https']
- };
-
- traefik.http.services[id] = {
- loadbalancer: {
- servers: [
- {
- url: `http://${container}:${port}`
- }
- ]
- }
- };
-
- if (isDualCerts) {
- traefik.http.routers[`${id}-secure`] = {
- entrypoints: ['websecure'],
- rule: `Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`)`,
- service: `${id}`,
- tls: {
- certresolver: 'letsencrypt'
- },
- middlewares: []
- };
- } else {
- if (isWWW) {
- traefik.http.routers[`${id}-secure-www`] = {
- entrypoints: ['websecure'],
- rule: `Host(\`www.${nakedDomain}\`)`,
- service: `${id}`,
- tls: {
- certresolver: 'letsencrypt'
- },
- middlewares: []
- };
- traefik.http.routers[`${id}-secure`] = {
- entrypoints: ['websecure'],
- rule: `Host(\`${nakedDomain}\`)`,
- service: `${id}`,
- tls: {
- domains: {
- main: `${domain}`
- }
- },
- middlewares: ['redirect-to-www']
- };
- traefik.http.routers[`${id}`].middlewares.push('redirect-to-www');
- } else {
- traefik.http.routers[`${id}-secure-www`] = {
- entrypoints: ['websecure'],
- rule: `Host(\`www.${nakedDomain}\`)`,
- service: `${id}`,
- tls: {
- domains: {
- main: `${domain}`
- }
- },
- middlewares: ['redirect-to-non-www']
- };
- traefik.http.routers[`${id}-secure`] = {
- entrypoints: ['websecure'],
- rule: `Host(\`${domain}\`)`,
- service: `${id}`,
- tls: {
- certresolver: 'letsencrypt'
- },
- middlewares: []
- };
- traefik.http.routers[`${id}`].middlewares.push('redirect-to-non-www');
- }
- }
- } else {
- traefik.http.routers[id] = {
- entrypoints: ['web'],
- rule: `Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`)`,
- service: `${id}`,
- middlewares: []
- };
-
- traefik.http.routers[`${id}-secure`] = {
- entrypoints: ['websecure'],
- rule: `Host(\`${nakedDomain}\`) || Host(\`www.${nakedDomain}\`)`,
- service: `${id}`,
- tls: {
- domains: {
- main: `${nakedDomain}`
- }
- },
- middlewares: ['redirect-to-http']
- };
-
- traefik.http.services[id] = {
- loadbalancer: {
- servers: [
- {
- url: `http://${container}:${port}`
- }
- ]
- }
- };
-
- if (!isDualCerts) {
- if (isWWW) {
- traefik.http.routers[`${id}`].middlewares.push('redirect-to-www');
- traefik.http.routers[`${id}-secure`].middlewares.push('redirect-to-www');
- } else {
- traefik.http.routers[`${id}`].middlewares.push('redirect-to-non-www');
- traefik.http.routers[`${id}-secure`].middlewares.push('redirect-to-non-www');
- }
- }
- }
-
- if (type === 'plausibleanalytics' && scriptName && scriptName !== 'plausible.js') {
- if (!traefik.http.routers[`${id}`].middlewares.includes(`${id}-redir`)) {
- traefik.http.routers[`${id}`].middlewares.push(`${id}-redir`);
- }
- if (!traefik.http.routers[`${id}-secure`].middlewares.includes(`${id}-redir`)) {
- traefik.http.routers[`${id}-secure`].middlewares.push(`${id}-redir`);
- }
- }
-}
-export const get: RequestHandler = async (event) => {
- const traefik = {
- http: {
- routers: {},
- services: {},
- middlewares: {
- 'redirect-to-https': {
- redirectscheme: {
- scheme: 'https'
- }
- },
- 'redirect-to-http': {
- redirectscheme: {
- scheme: 'http'
- }
- },
- 'redirect-to-non-www': {
- redirectregex: {
- regex: '^https?://www\\.(.+)',
- replacement: 'http://${1}'
- }
- },
- 'redirect-to-www': {
- redirectregex: {
- regex: '^https?://(?:www\\.)?(.+)',
- replacement: 'http://www.${1}'
- }
- }
- }
- }
- };
- const applications = await db.prisma.application.findMany({
- include: { destinationDocker: true, settings: true }
- });
- const data = {
- applications: [],
- services: [],
- coolify: []
- };
- for (const application of applications) {
- const {
- fqdn,
- id,
- port,
- destinationDocker,
- destinationDockerId,
- settings: { previews, dualCerts }
- } = application;
- if (destinationDockerId) {
- const { engine, network } = destinationDocker;
- const isRunning = true;
- if (fqdn) {
- const domain = getDomain(fqdn);
- const nakedDomain = domain.replace(/^www\./, '');
- const isHttps = fqdn.startsWith('https://');
- const isWWW = fqdn.includes('www.');
- if (isRunning) {
- data.applications.push({
- id,
- container: id,
- port: port || 3000,
- domain,
- nakedDomain,
- isRunning,
- isHttps,
- isWWW,
- isDualCerts: dualCerts
- });
- }
- if (previews) {
- const host = getEngine(engine);
- const { stdout } = await asyncExecShell(
- `DOCKER_HOST=${host} docker container ls --filter="status=running" --filter="network=${network}" --filter="name=${id}-" --format="{{json .Names}}"`
- );
- const containers = stdout
- .trim()
- .split('\n')
- .filter((a) => a)
- .map((c) => c.replace(/"/g, ''));
- if (containers.length > 0) {
- for (const container of containers) {
- const previewDomain = `${container.split('-')[1]}.${domain}`;
- const nakedDomain = previewDomain.replace(/^www\./, '');
- data.applications.push({
- id: container,
- container,
- port: port || 3000,
- domain: previewDomain,
- isRunning,
- nakedDomain,
- isHttps,
- isWWW,
- isDualCerts: dualCerts
- });
- }
- }
- }
- }
- }
- }
- const services = await listServicesWithIncludes();
-
- for (const service of services) {
- const {
- fqdn,
- id,
- type,
- destinationDocker,
- destinationDockerId,
- dualCerts,
- plausibleAnalytics
- } = service;
- if (destinationDockerId) {
- const { engine } = destinationDocker;
- const found = supportedServiceTypesAndVersions.find((a) => a.name === type);
- if (found) {
- const port = found.ports.main;
- const publicPort = service[type]?.publicPort;
- const isRunning = true;
- if (fqdn) {
- const domain = getDomain(fqdn);
- const nakedDomain = domain.replace(/^www\./, '');
- const isHttps = fqdn.startsWith('https://');
- const isWWW = fqdn.includes('www.');
- if (isRunning) {
- // Plausible Analytics custom script
- let scriptName = false;
- if (type === 'plausibleanalytics' && plausibleAnalytics.scriptName !== 'plausible.js') {
- scriptName = plausibleAnalytics.scriptName;
- }
-
- let container = id;
- let otherDomain = null;
- let otherNakedDomain = null;
- let otherIsHttps = null;
- let otherIsWWW = null;
-
- if (type === 'minio' && service.minio.apiFqdn) {
- otherDomain = getDomain(service.minio.apiFqdn);
- otherNakedDomain = otherDomain.replace(/^www\./, '');
- otherIsHttps = service.minio.apiFqdn.startsWith('https://');
- otherIsWWW = service.minio.apiFqdn.includes('www.');
- }
- data.services.push({
- id,
- container,
- type,
- otherDomain,
- otherNakedDomain,
- otherIsHttps,
- otherIsWWW,
- port,
- publicPort,
- domain,
- nakedDomain,
- isRunning,
- isHttps,
- isWWW,
- isDualCerts: dualCerts,
- scriptName
- });
- }
- }
- }
- }
- }
-
- const { fqdn, dualCerts } = await db.prisma.setting.findFirst();
- if (fqdn) {
- const domain = getDomain(fqdn);
- const nakedDomain = domain.replace(/^www\./, '');
- const isHttps = fqdn.startsWith('https://');
- const isWWW = fqdn.includes('www.');
- data.coolify.push({
- id: dev ? 'host.docker.internal' : 'coolify',
- container: dev ? 'host.docker.internal' : 'coolify',
- port: 3000,
- domain,
- nakedDomain,
- isHttps,
- isWWW,
- isDualCerts: dualCerts
- });
- }
- for (const application of data.applications) {
- configureMiddleware(application, traefik);
- }
- for (const service of data.services) {
- const { id, scriptName } = service;
-
- configureMiddleware(service, traefik);
- if (service.type === 'minio') {
- service.id = id + '-minio';
- service.container = id;
- service.domain = service.otherDomain;
- service.nakedDomain = service.otherNakedDomain;
- service.isHttps = service.otherIsHttps;
- service.isWWW = service.otherIsWWW;
- service.port = 9000;
- configureMiddleware(service, traefik);
- }
-
- if (scriptName) {
- traefik.http.middlewares[`${id}-redir`] = {
- replacepathregex: {
- regex: `/js/${scriptName}`,
- replacement: '/js/plausible.js'
- }
- };
- }
- }
- for (const coolify of data.coolify) {
- configureMiddleware(coolify, traefik);
- }
- if (Object.keys(traefik.http.routers).length === 0) {
- traefik.http.routers = null;
- }
- if (Object.keys(traefik.http.services).length === 0) {
- traefik.http.services = null;
- }
- return {
- status: 200,
- body: {
- ...traefik
- }
- };
-};
diff --git a/src/routes/webhooks/traefik/other.json.ts b/src/routes/webhooks/traefik/other.json.ts
deleted file mode 100644
index 3dc4d0e597..0000000000
--- a/src/routes/webhooks/traefik/other.json.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-import { dev } from '$app/env';
-import { getDomain } from '$lib/common';
-import * as db from '$lib/database';
-import type { RequestHandler } from '@sveltejs/kit';
-
-export const get: RequestHandler = async (event) => {
- const id = event.url.searchParams.get('id');
- if (id) {
- const privatePort = event.url.searchParams.get('privatePort');
- const publicPort = event.url.searchParams.get('publicPort');
- const type = event.url.searchParams.get('type');
- const address = event.url.searchParams.get('address') || id;
- let traefik = {};
- if (publicPort && type && privatePort) {
- if (type === 'tcp') {
- traefik = {
- [type]: {
- routers: {
- [id]: {
- entrypoints: [type],
- rule: `HostSNI(\`*\`)`,
- service: id
- }
- },
- services: {
- [id]: {
- loadbalancer: {
- servers: [{ address: `${address}:${privatePort}` }]
- }
- }
- }
- }
- };
- } else if (type === 'http') {
- const service = await db.prisma.service.findFirst({
- where: { id },
- include: { minio: true }
- });
- if (service) {
- if (service.type === 'minio') {
- if (service?.minio?.apiFqdn) {
- const {
- minio: { apiFqdn }
- } = service;
- const domain = getDomain(apiFqdn);
- const isHttps = apiFqdn.startsWith('https://');
- traefik = {
- [type]: {
- routers: {
- [id]: {
- entrypoints: [type],
- rule: `Host(\`${domain}\`)`,
- service: id
- }
- },
- services: {
- [id]: {
- loadbalancer: {
- servers: [{ url: `http://${id}:${privatePort}` }]
- }
- }
- }
- }
- };
- if (isHttps) {
- if (dev) {
- traefik[type].routers[id].tls = {
- domains: {
- main: `${domain}`
- }
- };
- } else {
- traefik[type].routers[id].tls = {
- certresolver: 'letsencrypt'
- };
- }
- }
- }
- } else {
- if (service?.fqdn) {
- const domain = getDomain(service.fqdn);
- const isHttps = service.fqdn.startsWith('https://');
- traefik = {
- [type]: {
- routers: {
- [id]: {
- entrypoints: [type],
- rule: `Host(\`${domain}:${privatePort}\`)`,
- service: id
- }
- },
- services: {
- [id]: {
- loadbalancer: {
- servers: [{ url: `http://${id}:${privatePort}` }]
- }
- }
- }
- }
- };
- if (isHttps) {
- if (dev) {
- traefik[type].routers[id].tls = {
- domains: {
- main: `${domain}`
- }
- };
- } else {
- traefik[type].routers[id].tls = {
- certresolver: 'letsencrypt'
- };
- }
- }
- }
- }
- } else {
- return {
- status: 500
- };
- }
- }
- } else {
- return {
- status: 500
- };
- }
- return {
- status: 200,
- body: {
- ...traefik
- }
- };
- }
- return {
- status: 500
- };
-};
diff --git a/svelte.config.js b/svelte.config.js
deleted file mode 100644
index 8fa7ba43e1..0000000000
--- a/svelte.config.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import preprocess from 'svelte-preprocess';
-import adapter from '@sveltejs/adapter-node';
-const config = {
- preprocess: preprocess(),
- kit: {
- adapter: adapter(),
- prerender: {
- enabled: false
- },
- floc: true,
- vite: {
- proxy: {
- '/api/v2': {
- target: 'http://localhost:3001/api/v2',
- changeOrigin: true
- }
- },
- optimizeDeps: {
- exclude: ['svelte-kit-cookie-session']
- },
- server: {
- fs: {
- allow: ['./src/lib/locales/']
- }
- }
- }
- }
-};
-
-export default config;
diff --git a/tsconfig.json b/tsconfig.json
deleted file mode 100644
index 4a8095f0aa..0000000000
--- a/tsconfig.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "extends": "./.svelte-kit/tsconfig.json",
- "compilerOptions": {
- "moduleResolution": "node",
- "module": "es2020",
- "lib": ["es2020", "DOM"],
- "target": "es2020",
- /**
- svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript
- to enforce using \`import type\` instead of \`import\` for Types.
- */
- "importsNotUsedAsValues": "error",
- "isolatedModules": true,
- "resolveJsonModule": true,
- /**
- To have warnings/errors of the Svelte compiler at the correct position,
- enable source maps by default.
- */
- "sourceMap": true,
- "esModuleInterop": true,
- "skipLibCheck": true,
- "forceConsistentCasingInFileNames": true,
- "baseUrl": ".",
- "allowJs": true,
- "checkJs": true,
- "paths": {
- "$lib": ["src/lib"],
- "$lib/*": ["src/lib/*"]
- }
- },
- "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]
-}