mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-20 20:59:23 +00:00
Compare commits
73 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a7c4310d0 | ||
|
|
4e8fe79e2b | ||
|
|
a8c5551292 | ||
|
|
2bf73109b2 | ||
|
|
f0ab3750bd | ||
|
|
58a11e37fe | ||
|
|
927bf46304 | ||
|
|
6b89857697 | ||
|
|
b72e5ccef6 | ||
|
|
6617b7811b | ||
|
|
e1c1988db4 | ||
|
|
af99ea4678 | ||
|
|
a6d5316090 | ||
|
|
f5e7a84fa6 | ||
|
|
c013764b61 | ||
|
|
2320ab0dfc | ||
|
|
1281a0f7e4 | ||
|
|
d8350cd4ee | ||
|
|
e3b7c23ed9 | ||
|
|
eae1ea21d6 | ||
|
|
541aa76b64 | ||
|
|
7b8555d524 | ||
|
|
fdf998c181 | ||
|
|
3d6b343adc | ||
|
|
e338cecc14 | ||
|
|
e5537a33fb | ||
|
|
35384deb68 | ||
|
|
547ca60c2a | ||
|
|
376f6f7455 | ||
|
|
abe92dedff | ||
|
|
4b521ceedc | ||
|
|
6dfcb9e52b | ||
|
|
335e3216e2 | ||
|
|
5b22bb4818 | ||
|
|
0097004882 | ||
|
|
1bc9e4c2d3 | ||
|
|
36c7e1a3c3 | ||
|
|
c6b4d04e26 | ||
|
|
fa6cf068c7 | ||
|
|
7c273a3a48 | ||
|
|
3de2ea1523 | ||
|
|
c5c9f84503 | ||
|
|
16ea9a3e07 | ||
|
|
48f952c798 | ||
|
|
f78ea5de07 | ||
|
|
5adbd5e784 | ||
|
|
5b2afa79d7 | ||
|
|
dc4e6d02b7 | ||
|
|
8ae61c8f78 | ||
|
|
684b8e0914 | ||
|
|
7c3314abae | ||
|
|
ab9f8ff356 | ||
|
|
892d8cd5c1 | ||
|
|
8b8b45778d | ||
|
|
6655fb182c | ||
|
|
0926d40247 | ||
|
|
ddc4d36688 | ||
|
|
53e1f22eb1 | ||
|
|
3d2a34737b | ||
|
|
ebde77008c | ||
|
|
3d27fd04ba | ||
|
|
d9fcaf3473 | ||
|
|
d266f761aa | ||
|
|
1d01405412 | ||
|
|
7c62eb5bd6 | ||
|
|
4dcc76d366 | ||
|
|
d2fad19a11 | ||
|
|
7c92c4c964 | ||
|
|
5a71d33236 | ||
|
|
1b4db4f793 | ||
|
|
c084b22815 | ||
|
|
acacef95cd | ||
|
|
5d722183d3 |
@@ -1,4 +1,5 @@
|
|||||||
FROM node:16.14.0-alpine
|
FROM node:16.14.0-alpine
|
||||||
|
RUN apk add --no-cache g++ cmake make python3
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json .
|
COPY package*.json .
|
||||||
RUN yarn install
|
RUN yarn install
|
||||||
|
|||||||
30
package.json
30
package.json
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "coolify",
|
"name": "coolify",
|
||||||
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
||||||
"version": "2.0.24",
|
"version": "2.1.0",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "docker-compose -f docker-compose-dev.yaml up -d && NODE_ENV=development svelte-kit dev --host 0.0.0.0",
|
"dev": "docker-compose -f docker-compose-dev.yaml up -d && NODE_ENV=development svelte-kit dev",
|
||||||
"dev:stop": "docker-compose -f docker-compose-dev.yaml down",
|
"dev:stop": "docker-compose -f docker-compose-dev.yaml down",
|
||||||
"dev:logs": "docker-compose -f docker-compose-dev.yaml logs -f --tail 10",
|
"dev:logs": "docker-compose -f docker-compose-dev.yaml logs -f --tail 10",
|
||||||
"studio": "npx prisma studio",
|
"studio": "npx prisma studio",
|
||||||
@@ -25,12 +25,13 @@
|
|||||||
"prepare": "husky install"
|
"prepare": "husky install"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/adapter-node": "1.0.0-next.69",
|
"@sveltejs/adapter-node": "1.0.0-next.70",
|
||||||
"@sveltejs/adapter-static": "1.0.0-next.28",
|
"@sveltejs/adapter-static": "1.0.0-next.28",
|
||||||
"@sveltejs/kit": "1.0.0-next.283",
|
"@sveltejs/kit": "1.0.0-next.288",
|
||||||
"@types/bcrypt": "5.0.0",
|
"@types/bcrypt": "5.0.0",
|
||||||
"@types/js-cookie": "3.0.1",
|
"@types/js-cookie": "3.0.1",
|
||||||
"@types/node": "17.0.20",
|
"@types/js-yaml": "^4.0.5",
|
||||||
|
"@types/node": "17.0.21",
|
||||||
"@types/node-forge": "1.0.0",
|
"@types/node-forge": "1.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "4.31.1",
|
"@typescript-eslint/eslint-plugin": "4.31.1",
|
||||||
"@typescript-eslint/parser": "4.31.1",
|
"@typescript-eslint/parser": "4.31.1",
|
||||||
@@ -39,37 +40,38 @@
|
|||||||
"cross-var": "1.1.0",
|
"cross-var": "1.1.0",
|
||||||
"eslint": "7.32.0",
|
"eslint": "7.32.0",
|
||||||
"eslint-config-prettier": "8.4.0",
|
"eslint-config-prettier": "8.4.0",
|
||||||
"eslint-plugin-svelte3": "3.4.0",
|
"eslint-plugin-svelte3": "3.4.1",
|
||||||
"husky": "7.0.4",
|
"husky": "7.0.4",
|
||||||
"lint-staged": "12.3.4",
|
"lint-staged": "12.3.4",
|
||||||
"postcss": "8.4.6",
|
"postcss": "8.4.7",
|
||||||
"prettier": "2.5.1",
|
"prettier": "2.5.1",
|
||||||
"prettier-plugin-svelte": "2.6.0",
|
"prettier-plugin-svelte": "2.6.0",
|
||||||
"prettier-plugin-tailwindcss": "0.1.7",
|
"prettier-plugin-tailwindcss": "0.1.8",
|
||||||
"prisma": "3.10.0",
|
"prisma": "3.10.0",
|
||||||
"svelte": "3.46.4",
|
"svelte": "3.46.4",
|
||||||
"svelte-check": "2.4.5",
|
"svelte-check": "2.4.5",
|
||||||
"svelte-preprocess": "4.10.4",
|
"svelte-preprocess": "4.10.4",
|
||||||
|
"svelte-select": "^4.4.7",
|
||||||
"tailwindcss": "3.0.23",
|
"tailwindcss": "3.0.23",
|
||||||
"ts-node": "10.5.0",
|
"ts-node": "10.6.0",
|
||||||
"tslib": "2.3.1",
|
"tslib": "2.3.1",
|
||||||
"typescript": "4.5.5"
|
"typescript": "4.6.2"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@iarna/toml": "2.2.5",
|
"@iarna/toml": "2.2.5",
|
||||||
"@prisma/client": "3.10.0",
|
"@prisma/client": "3.10.0",
|
||||||
"@sentry/node": "6.17.9",
|
"@sentry/node": "6.18.1",
|
||||||
"bcrypt": "5.0.1",
|
"bcrypt": "5.0.1",
|
||||||
"bullmq": "1.74.2",
|
"bullmq": "1.76.0",
|
||||||
"compare-versions": "4.1.3",
|
"compare-versions": "4.1.3",
|
||||||
"cookie": "0.4.2",
|
"cookie": "0.4.2",
|
||||||
"cuid": "2.1.8",
|
"cuid": "2.1.8",
|
||||||
"dayjs": "1.10.7",
|
"dayjs": "1.10.8",
|
||||||
"dockerode": "3.3.1",
|
"dockerode": "3.3.1",
|
||||||
"dotenv-extended": "2.9.0",
|
"dotenv-extended": "2.9.0",
|
||||||
"generate-password": "1.7.0",
|
"generate-password": "1.7.0",
|
||||||
"get-port": "6.1.1",
|
"get-port": "6.1.2",
|
||||||
"got": "12.0.1",
|
"got": "12.0.1",
|
||||||
"js-cookie": "3.0.1",
|
"js-cookie": "3.0.1",
|
||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
|
|||||||
282
pnpm-lock.yaml
generated
282
pnpm-lock.yaml
generated
@@ -3,32 +3,33 @@ lockfileVersion: 5.3
|
|||||||
specifiers:
|
specifiers:
|
||||||
'@iarna/toml': 2.2.5
|
'@iarna/toml': 2.2.5
|
||||||
'@prisma/client': 3.10.0
|
'@prisma/client': 3.10.0
|
||||||
'@sentry/node': 6.17.9
|
'@sentry/node': 6.18.1
|
||||||
'@sveltejs/adapter-node': 1.0.0-next.69
|
'@sveltejs/adapter-node': 1.0.0-next.70
|
||||||
'@sveltejs/adapter-static': 1.0.0-next.28
|
'@sveltejs/adapter-static': 1.0.0-next.28
|
||||||
'@sveltejs/kit': 1.0.0-next.283
|
'@sveltejs/kit': 1.0.0-next.288
|
||||||
'@types/bcrypt': 5.0.0
|
'@types/bcrypt': 5.0.0
|
||||||
'@types/js-cookie': 3.0.1
|
'@types/js-cookie': 3.0.1
|
||||||
'@types/node': 17.0.20
|
'@types/js-yaml': ^4.0.5
|
||||||
|
'@types/node': 17.0.21
|
||||||
'@types/node-forge': 1.0.0
|
'@types/node-forge': 1.0.0
|
||||||
'@typescript-eslint/eslint-plugin': 4.31.1
|
'@typescript-eslint/eslint-plugin': 4.31.1
|
||||||
'@typescript-eslint/parser': 4.31.1
|
'@typescript-eslint/parser': 4.31.1
|
||||||
'@zerodevx/svelte-toast': 0.7.0
|
'@zerodevx/svelte-toast': 0.7.0
|
||||||
autoprefixer: 10.4.2
|
autoprefixer: 10.4.2
|
||||||
bcrypt: 5.0.1
|
bcrypt: 5.0.1
|
||||||
bullmq: 1.74.2
|
bullmq: 1.76.0
|
||||||
compare-versions: 4.1.3
|
compare-versions: 4.1.3
|
||||||
cookie: 0.4.2
|
cookie: 0.4.2
|
||||||
cross-var: 1.1.0
|
cross-var: 1.1.0
|
||||||
cuid: 2.1.8
|
cuid: 2.1.8
|
||||||
dayjs: 1.10.7
|
dayjs: 1.10.8
|
||||||
dockerode: 3.3.1
|
dockerode: 3.3.1
|
||||||
dotenv-extended: 2.9.0
|
dotenv-extended: 2.9.0
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
eslint-config-prettier: 8.4.0
|
eslint-config-prettier: 8.4.0
|
||||||
eslint-plugin-svelte3: 3.4.0
|
eslint-plugin-svelte3: 3.4.1
|
||||||
generate-password: 1.7.0
|
generate-password: 1.7.0
|
||||||
get-port: 6.1.1
|
get-port: 6.1.2
|
||||||
got: 12.0.1
|
got: 12.0.1
|
||||||
husky: 7.0.4
|
husky: 7.0.4
|
||||||
js-cookie: 3.0.1
|
js-cookie: 3.0.1
|
||||||
@@ -37,36 +38,37 @@ specifiers:
|
|||||||
lint-staged: 12.3.4
|
lint-staged: 12.3.4
|
||||||
mustache: ^4.2.0
|
mustache: ^4.2.0
|
||||||
node-forge: 1.2.1
|
node-forge: 1.2.1
|
||||||
postcss: 8.4.6
|
postcss: 8.4.7
|
||||||
prettier: 2.5.1
|
prettier: 2.5.1
|
||||||
prettier-plugin-svelte: 2.6.0
|
prettier-plugin-svelte: 2.6.0
|
||||||
prettier-plugin-tailwindcss: 0.1.7
|
prettier-plugin-tailwindcss: 0.1.8
|
||||||
prisma: 3.10.0
|
prisma: 3.10.0
|
||||||
svelte: 3.46.4
|
svelte: 3.46.4
|
||||||
svelte-check: 2.4.5
|
svelte-check: 2.4.5
|
||||||
svelte-kit-cookie-session: 2.1.2
|
svelte-kit-cookie-session: 2.1.2
|
||||||
svelte-preprocess: 4.10.4
|
svelte-preprocess: 4.10.4
|
||||||
|
svelte-select: ^4.4.7
|
||||||
tailwindcss: 3.0.23
|
tailwindcss: 3.0.23
|
||||||
tailwindcss-scrollbar: ^0.1.0
|
tailwindcss-scrollbar: ^0.1.0
|
||||||
ts-node: 10.5.0
|
ts-node: 10.6.0
|
||||||
tslib: 2.3.1
|
tslib: 2.3.1
|
||||||
typescript: 4.5.5
|
typescript: 4.6.2
|
||||||
unique-names-generator: 4.7.1
|
unique-names-generator: 4.7.1
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@iarna/toml': 2.2.5
|
'@iarna/toml': 2.2.5
|
||||||
'@prisma/client': 3.10.0_prisma@3.10.0
|
'@prisma/client': 3.10.0_prisma@3.10.0
|
||||||
'@sentry/node': 6.17.9
|
'@sentry/node': 6.18.1
|
||||||
bcrypt: 5.0.1
|
bcrypt: 5.0.1
|
||||||
bullmq: 1.74.2
|
bullmq: 1.76.0
|
||||||
compare-versions: 4.1.3
|
compare-versions: 4.1.3
|
||||||
cookie: 0.4.2
|
cookie: 0.4.2
|
||||||
cuid: 2.1.8
|
cuid: 2.1.8
|
||||||
dayjs: 1.10.7
|
dayjs: 1.10.8
|
||||||
dockerode: 3.3.1
|
dockerode: 3.3.1
|
||||||
dotenv-extended: 2.9.0
|
dotenv-extended: 2.9.0
|
||||||
generate-password: 1.7.0
|
generate-password: 1.7.0
|
||||||
get-port: 6.1.1
|
get-port: 6.1.2
|
||||||
got: 12.0.1
|
got: 12.0.1
|
||||||
js-cookie: 3.0.1
|
js-cookie: 3.0.1
|
||||||
js-yaml: 4.1.0
|
js-yaml: 4.1.0
|
||||||
@@ -78,35 +80,37 @@ dependencies:
|
|||||||
unique-names-generator: 4.7.1
|
unique-names-generator: 4.7.1
|
||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@sveltejs/adapter-node': 1.0.0-next.69
|
'@sveltejs/adapter-node': 1.0.0-next.70
|
||||||
'@sveltejs/adapter-static': 1.0.0-next.28
|
'@sveltejs/adapter-static': 1.0.0-next.28
|
||||||
'@sveltejs/kit': 1.0.0-next.283_svelte@3.46.4
|
'@sveltejs/kit': 1.0.0-next.288_svelte@3.46.4
|
||||||
'@types/bcrypt': 5.0.0
|
'@types/bcrypt': 5.0.0
|
||||||
'@types/js-cookie': 3.0.1
|
'@types/js-cookie': 3.0.1
|
||||||
'@types/node': 17.0.20
|
'@types/js-yaml': 4.0.5
|
||||||
|
'@types/node': 17.0.21
|
||||||
'@types/node-forge': 1.0.0
|
'@types/node-forge': 1.0.0
|
||||||
'@typescript-eslint/eslint-plugin': 4.31.1_5d7752337e5ea49772097d8af1823bf9
|
'@typescript-eslint/eslint-plugin': 4.31.1_386b67ad67ef29c6a0ccaf3e9b60f945
|
||||||
'@typescript-eslint/parser': 4.31.1_eslint@7.32.0+typescript@4.5.5
|
'@typescript-eslint/parser': 4.31.1_eslint@7.32.0+typescript@4.6.2
|
||||||
'@zerodevx/svelte-toast': 0.7.0
|
'@zerodevx/svelte-toast': 0.7.0
|
||||||
autoprefixer: 10.4.2_postcss@8.4.6
|
autoprefixer: 10.4.2_postcss@8.4.7
|
||||||
cross-var: 1.1.0
|
cross-var: 1.1.0
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
eslint-config-prettier: 8.4.0_eslint@7.32.0
|
eslint-config-prettier: 8.4.0_eslint@7.32.0
|
||||||
eslint-plugin-svelte3: 3.4.0_eslint@7.32.0+svelte@3.46.4
|
eslint-plugin-svelte3: 3.4.1_eslint@7.32.0+svelte@3.46.4
|
||||||
husky: 7.0.4
|
husky: 7.0.4
|
||||||
lint-staged: 12.3.4
|
lint-staged: 12.3.4
|
||||||
postcss: 8.4.6
|
postcss: 8.4.7
|
||||||
prettier: 2.5.1
|
prettier: 2.5.1
|
||||||
prettier-plugin-svelte: 2.6.0_prettier@2.5.1+svelte@3.46.4
|
prettier-plugin-svelte: 2.6.0_prettier@2.5.1+svelte@3.46.4
|
||||||
prettier-plugin-tailwindcss: 0.1.7_prettier@2.5.1
|
prettier-plugin-tailwindcss: 0.1.8_prettier@2.5.1
|
||||||
prisma: 3.10.0
|
prisma: 3.10.0
|
||||||
svelte: 3.46.4
|
svelte: 3.46.4
|
||||||
svelte-check: 2.4.5_postcss@8.4.6+svelte@3.46.4
|
svelte-check: 2.4.5_postcss@8.4.7+svelte@3.46.4
|
||||||
svelte-preprocess: 4.10.4_88b359da5cac6d8f6ee1bbb7080a3fa9
|
svelte-preprocess: 4.10.4_e836cbb8ceb5bfaa7513362dd6308834
|
||||||
tailwindcss: 3.0.23_c940fbabf228b85b1c73d314b43e31f1
|
svelte-select: 4.4.7
|
||||||
ts-node: 10.5.0_e04e69b201f218c8d0d59acefc9ea8a6
|
tailwindcss: 3.0.23_4b9e11f8e85900587b5e2272c5d4c20c
|
||||||
|
ts-node: 10.6.0_e79e62fe450383fd2d418267dc75e645
|
||||||
tslib: 2.3.1
|
tslib: 2.3.1
|
||||||
typescript: 4.5.5
|
typescript: 4.6.2
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
/@babel/code-frame/7.12.11:
|
/@babel/code-frame/7.12.11:
|
||||||
@@ -297,56 +301,56 @@ packages:
|
|||||||
picomatch: 2.3.0
|
picomatch: 2.3.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@sentry/core/6.17.9:
|
/@sentry/core/6.18.1:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-14KalmTholGUtgdh9TklO+jUpyQ/D3OGkhlH1rnGQGoJgFy2eYm+s+MnUEMxFdGIUCz5kOteuNqYZxaDmFagpQ==
|
integrity: sha512-9V8Q+3Asi+3RL67CSIMMZ9mjMsu2/hrpQszYStX7hPPpAZIlAKk2MT5B+na/r80iWKhy+3Ts6aDFF218QtnsVw==
|
||||||
}
|
}
|
||||||
engines: { node: '>=6' }
|
engines: { node: '>=6' }
|
||||||
dependencies:
|
dependencies:
|
||||||
'@sentry/hub': 6.17.9
|
'@sentry/hub': 6.18.1
|
||||||
'@sentry/minimal': 6.17.9
|
'@sentry/minimal': 6.18.1
|
||||||
'@sentry/types': 6.17.9
|
'@sentry/types': 6.18.1
|
||||||
'@sentry/utils': 6.17.9
|
'@sentry/utils': 6.18.1
|
||||||
tslib: 1.14.1
|
tslib: 1.14.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@sentry/hub/6.17.9:
|
/@sentry/hub/6.18.1:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-34EdrweWDbBV9EzEFIXcO+JeoyQmKzQVJxpTKZoJA6PUwf2NrndaUdjlkDEtBEzjuLUTxhLxtOzEsYs1O6RVcg==
|
integrity: sha512-+zGzgc/xX3an/nKA3ELMn9YD9VmqbNaNwWZ5/SjNUvzsYHh2UNZ7YzT8WawQsRVOXLljyCKxkWpFB4EchiYGbw==
|
||||||
}
|
}
|
||||||
engines: { node: '>=6' }
|
engines: { node: '>=6' }
|
||||||
dependencies:
|
dependencies:
|
||||||
'@sentry/types': 6.17.9
|
'@sentry/types': 6.18.1
|
||||||
'@sentry/utils': 6.17.9
|
'@sentry/utils': 6.18.1
|
||||||
tslib: 1.14.1
|
tslib: 1.14.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@sentry/minimal/6.17.9:
|
/@sentry/minimal/6.18.1:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-T3PMCHcKk6lkZq6zKgANrYJJxXBXKOe+ousV1Fas1rVBMv7dtKfsa4itqQHszcW9shusPDiaQKIJ4zRLE5LKmg==
|
integrity: sha512-dm+0MuasWNi/LASvHX+09oCo8IBZY5WpMK8qXvQMnwQ9FVfklrjcfEI3666WORDCmeUhDCSeL2MbjPDm+AmPLg==
|
||||||
}
|
}
|
||||||
engines: { node: '>=6' }
|
engines: { node: '>=6' }
|
||||||
dependencies:
|
dependencies:
|
||||||
'@sentry/hub': 6.17.9
|
'@sentry/hub': 6.18.1
|
||||||
'@sentry/types': 6.17.9
|
'@sentry/types': 6.18.1
|
||||||
tslib: 1.14.1
|
tslib: 1.14.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@sentry/node/6.17.9:
|
/@sentry/node/6.18.1:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-jbn+q7qPGOh6D7nYoYGaAlmuvMDpQmyMwBtUVYybuZp2AALe43O3Z4LtoJ+1+F31XowpsIPZx1mwNs4ZrILskA==
|
integrity: sha512-aTb2gwfZUq0lGDRGH5zNOYDfFMOQZu6E0QcAsvH2ZBcEj3rUWZz3r25COFrHmfzHLUV1KcF2AmnWo1QU1jmm0g==
|
||||||
}
|
}
|
||||||
engines: { node: '>=6' }
|
engines: { node: '>=6' }
|
||||||
dependencies:
|
dependencies:
|
||||||
'@sentry/core': 6.17.9
|
'@sentry/core': 6.18.1
|
||||||
'@sentry/hub': 6.17.9
|
'@sentry/hub': 6.18.1
|
||||||
'@sentry/tracing': 6.17.9
|
'@sentry/tracing': 6.18.1
|
||||||
'@sentry/types': 6.17.9
|
'@sentry/types': 6.18.1
|
||||||
'@sentry/utils': 6.17.9
|
'@sentry/utils': 6.18.1
|
||||||
cookie: 0.4.2
|
cookie: 0.4.2
|
||||||
https-proxy-agent: 5.0.0
|
https-proxy-agent: 5.0.0
|
||||||
lru_map: 0.3.3
|
lru_map: 0.3.3
|
||||||
@@ -355,36 +359,36 @@ packages:
|
|||||||
- supports-color
|
- supports-color
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@sentry/tracing/6.17.9:
|
/@sentry/tracing/6.18.1:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-5Rb/OS4ryNJLvz2nv6wyjwhifjy6veqaF9ffLrwFYij/WDy7m62ASBblxgeiI3fbPLX0aBRFWIJAq1vko26+AQ==
|
integrity: sha512-OxozmSfxGx246Ae1XhO01I7ZWxO3briwMBh55E5KyjQb8fuS9gVE7Uy8ZRs5hhNjDutFAU7nMtC0zipfVxP6fg==
|
||||||
}
|
}
|
||||||
engines: { node: '>=6' }
|
engines: { node: '>=6' }
|
||||||
dependencies:
|
dependencies:
|
||||||
'@sentry/hub': 6.17.9
|
'@sentry/hub': 6.18.1
|
||||||
'@sentry/minimal': 6.17.9
|
'@sentry/minimal': 6.18.1
|
||||||
'@sentry/types': 6.17.9
|
'@sentry/types': 6.18.1
|
||||||
'@sentry/utils': 6.17.9
|
'@sentry/utils': 6.18.1
|
||||||
tslib: 1.14.1
|
tslib: 1.14.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@sentry/types/6.17.9:
|
/@sentry/types/6.18.1:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-xuulX6qUCL14ayEOh/h6FUIvZtsi1Bx34dSOaWDrjXUOJHJAM7214uiqW1GZxPJ13YuaUIubjTSfDmSQ9CBzTw==
|
integrity: sha512-wp741NoBKnXE/4T9L723sWJ8EcNMxeTIT1smgNJOfbPwrsDICoYmGEt6JFa05XHpWBGI66WuNvnDjoHVeh6zhA==
|
||||||
}
|
}
|
||||||
engines: { node: '>=6' }
|
engines: { node: '>=6' }
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@sentry/utils/6.17.9:
|
/@sentry/utils/6.18.1:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-4eo9Z3JlJCGlGrQRbtZWL+L9NnlUXgTbfK3Lk7oO8D1ev8R5b5+iE6tZHTvU5rQRcq6zu+POT+tK5u9oxc/rnQ==
|
integrity: sha512-IFZmuvA+c5lDGlZEri13JSyUP0BHelzY0S4dcKxAzskPW+BtBdQDgYGV90iED1y+IRMLawWb34GF7HyJSouN1Q==
|
||||||
}
|
}
|
||||||
engines: { node: '>=6' }
|
engines: { node: '>=6' }
|
||||||
dependencies:
|
dependencies:
|
||||||
'@sentry/types': 6.17.9
|
'@sentry/types': 6.18.1
|
||||||
tslib: 1.14.1
|
tslib: 1.14.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
@@ -396,10 +400,10 @@ packages:
|
|||||||
engines: { node: '>=10' }
|
engines: { node: '>=10' }
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@sveltejs/adapter-node/1.0.0-next.69:
|
/@sveltejs/adapter-node/1.0.0-next.70:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-tVKwJ8vYG4NGFJ5L+tRuyRglGPaJ1khNqTKq4bYIUahk/pjXIu9USbMmFtNHd6IyDdxjPtRoVwHubAYfTQLTpg==
|
integrity: sha512-9EtqSTxVOipESyPQH8uVdkl+iSqsq3oRKS3RZoE2vAG9I849MuTTxr1g9L4kALbXaklsYRztwhmrLpTdcSM4vA==
|
||||||
}
|
}
|
||||||
dependencies:
|
dependencies:
|
||||||
tiny-glob: 0.2.9
|
tiny-glob: 0.2.9
|
||||||
@@ -414,10 +418,10 @@ packages:
|
|||||||
tiny-glob: 0.2.9
|
tiny-glob: 0.2.9
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@sveltejs/kit/1.0.0-next.283_svelte@3.46.4:
|
/@sveltejs/kit/1.0.0-next.288_svelte@3.46.4:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-QFhL7cdBKXUKhJ3sHZnL7q07Eohc54N7OpX2ZsJuNTA43Z6vX/HF/Jh4TK62kqT+thDVlT5J1iEEMppxA2IxoQ==
|
integrity: sha512-6ky4CUFNGKoU1QV+fY2LOIB7atHdUCIMRx3pX21B2g9yZzQzkot0zHBrMMBSKF0/4Wx19PLEWrlGxlhakYmi8Q==
|
||||||
}
|
}
|
||||||
engines: { node: '>=14.13' }
|
engines: { node: '>=14.13' }
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -506,7 +510,7 @@ packages:
|
|||||||
integrity: sha512-agtcFKaruL8TmcvqbndlqHPSJgsolhf/qPWchFlgnW1gECTN/nKbFcoFnvKAQRFfKbh+BO6A3SWdJu9t+xF3Lw==
|
integrity: sha512-agtcFKaruL8TmcvqbndlqHPSJgsolhf/qPWchFlgnW1gECTN/nKbFcoFnvKAQRFfKbh+BO6A3SWdJu9t+xF3Lw==
|
||||||
}
|
}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 17.0.20
|
'@types/node': 17.0.21
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/cacheable-request/6.0.2:
|
/@types/cacheable-request/6.0.2:
|
||||||
@@ -517,7 +521,7 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@types/http-cache-semantics': 4.0.1
|
'@types/http-cache-semantics': 4.0.1
|
||||||
'@types/keyv': 3.1.3
|
'@types/keyv': 3.1.3
|
||||||
'@types/node': 17.0.20
|
'@types/node': 17.0.21
|
||||||
'@types/responselike': 1.0.0
|
'@types/responselike': 1.0.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
@@ -535,6 +539,13 @@ packages:
|
|||||||
}
|
}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@types/js-yaml/4.0.5:
|
||||||
|
resolution:
|
||||||
|
{
|
||||||
|
integrity: sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA==
|
||||||
|
}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@types/json-schema/7.0.9:
|
/@types/json-schema/7.0.9:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
@@ -548,7 +559,7 @@ packages:
|
|||||||
integrity: sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==
|
integrity: sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==
|
||||||
}
|
}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 17.0.20
|
'@types/node': 17.0.21
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@types/node-forge/1.0.0:
|
/@types/node-forge/1.0.0:
|
||||||
@@ -557,13 +568,13 @@ packages:
|
|||||||
integrity: sha512-h0bgwPKq5u99T9Gor4qtV1lCZ41xNkai0pie1n/a2mh2/4+jENWOlo7AJ4YKxTZAnSZ8FRurUpdIN7ohaPPuHA==
|
integrity: sha512-h0bgwPKq5u99T9Gor4qtV1lCZ41xNkai0pie1n/a2mh2/4+jENWOlo7AJ4YKxTZAnSZ8FRurUpdIN7ohaPPuHA==
|
||||||
}
|
}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 17.0.20
|
'@types/node': 17.0.21
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/node/17.0.20:
|
/@types/node/17.0.21:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-Q15Clj3lZSLnhVA6yKw1G7SQz46DeL9gO1TEgfK1OQGvMdQ6TUWmCeWf1QBUNkw2BDfV52i2YuYd9OF3ZwGhjw==
|
integrity: sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==
|
||||||
}
|
}
|
||||||
|
|
||||||
/@types/parse-json/4.0.0:
|
/@types/parse-json/4.0.0:
|
||||||
@@ -586,7 +597,7 @@ packages:
|
|||||||
integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==
|
integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==
|
||||||
}
|
}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 17.0.20
|
'@types/node': 17.0.21
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@types/sass/1.16.1:
|
/@types/sass/1.16.1:
|
||||||
@@ -595,10 +606,10 @@ packages:
|
|||||||
integrity: sha512-iZUcRrGuz/Tbg3loODpW7vrQJkUtpY2fFSf4ELqqkApcS2TkZ1msk7ie8iZPB86lDOP8QOTTmuvWjc5S0R9OjQ==
|
integrity: sha512-iZUcRrGuz/Tbg3loODpW7vrQJkUtpY2fFSf4ELqqkApcS2TkZ1msk7ie8iZPB86lDOP8QOTTmuvWjc5S0R9OjQ==
|
||||||
}
|
}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 17.0.20
|
'@types/node': 17.0.21
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/eslint-plugin/4.31.1_5d7752337e5ea49772097d8af1823bf9:
|
/@typescript-eslint/eslint-plugin/4.31.1_386b67ad67ef29c6a0ccaf3e9b60f945:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-UDqhWmd5i0TvPLmbK5xY3UZB0zEGseF+DHPghZ37Sb83Qd3p8ujhvAtkU4OF46Ka5Pm5kWvFIx0cCTBFKo0alA==
|
integrity: sha512-UDqhWmd5i0TvPLmbK5xY3UZB0zEGseF+DHPghZ37Sb83Qd3p8ujhvAtkU4OF46Ka5Pm5kWvFIx0cCTBFKo0alA==
|
||||||
@@ -612,21 +623,21 @@ packages:
|
|||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/experimental-utils': 4.31.1_eslint@7.32.0+typescript@4.5.5
|
'@typescript-eslint/experimental-utils': 4.31.1_eslint@7.32.0+typescript@4.6.2
|
||||||
'@typescript-eslint/parser': 4.31.1_eslint@7.32.0+typescript@4.5.5
|
'@typescript-eslint/parser': 4.31.1_eslint@7.32.0+typescript@4.6.2
|
||||||
'@typescript-eslint/scope-manager': 4.31.1
|
'@typescript-eslint/scope-manager': 4.31.1
|
||||||
debug: 4.3.3
|
debug: 4.3.3
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
functional-red-black-tree: 1.0.1
|
functional-red-black-tree: 1.0.1
|
||||||
regexpp: 3.2.0
|
regexpp: 3.2.0
|
||||||
semver: 7.3.5
|
semver: 7.3.5
|
||||||
tsutils: 3.21.0_typescript@4.5.5
|
tsutils: 3.21.0_typescript@4.6.2
|
||||||
typescript: 4.5.5
|
typescript: 4.6.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/experimental-utils/4.31.1_eslint@7.32.0+typescript@4.5.5:
|
/@typescript-eslint/experimental-utils/4.31.1_eslint@7.32.0+typescript@4.6.2:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-NtoPsqmcSsWty0mcL5nTZXMf7Ei0Xr2MT8jWjXMVgRK0/1qeQ2jZzLFUh4QtyJ4+/lPUyMw5cSfeeME+Zrtp9Q==
|
integrity: sha512-NtoPsqmcSsWty0mcL5nTZXMf7Ei0Xr2MT8jWjXMVgRK0/1qeQ2jZzLFUh4QtyJ4+/lPUyMw5cSfeeME+Zrtp9Q==
|
||||||
@@ -638,7 +649,7 @@ packages:
|
|||||||
'@types/json-schema': 7.0.9
|
'@types/json-schema': 7.0.9
|
||||||
'@typescript-eslint/scope-manager': 4.31.1
|
'@typescript-eslint/scope-manager': 4.31.1
|
||||||
'@typescript-eslint/types': 4.31.1
|
'@typescript-eslint/types': 4.31.1
|
||||||
'@typescript-eslint/typescript-estree': 4.31.1_typescript@4.5.5
|
'@typescript-eslint/typescript-estree': 4.31.1_typescript@4.6.2
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
eslint-scope: 5.1.1
|
eslint-scope: 5.1.1
|
||||||
eslint-utils: 3.0.0_eslint@7.32.0
|
eslint-utils: 3.0.0_eslint@7.32.0
|
||||||
@@ -647,7 +658,7 @@ packages:
|
|||||||
- typescript
|
- typescript
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/parser/4.31.1_eslint@7.32.0+typescript@4.5.5:
|
/@typescript-eslint/parser/4.31.1_eslint@7.32.0+typescript@4.6.2:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-dnVZDB6FhpIby6yVbHkwTKkn2ypjVIfAR9nh+kYsA/ZL0JlTsd22BiDjouotisY3Irmd3OW1qlk9EI5R8GrvRQ==
|
integrity: sha512-dnVZDB6FhpIby6yVbHkwTKkn2ypjVIfAR9nh+kYsA/ZL0JlTsd22BiDjouotisY3Irmd3OW1qlk9EI5R8GrvRQ==
|
||||||
@@ -662,10 +673,10 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/scope-manager': 4.31.1
|
'@typescript-eslint/scope-manager': 4.31.1
|
||||||
'@typescript-eslint/types': 4.31.1
|
'@typescript-eslint/types': 4.31.1
|
||||||
'@typescript-eslint/typescript-estree': 4.31.1_typescript@4.5.5
|
'@typescript-eslint/typescript-estree': 4.31.1_typescript@4.6.2
|
||||||
debug: 4.3.3
|
debug: 4.3.3
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
typescript: 4.5.5
|
typescript: 4.6.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
@@ -689,7 +700,7 @@ packages:
|
|||||||
engines: { node: ^8.10.0 || ^10.13.0 || >=11.10.1 }
|
engines: { node: ^8.10.0 || ^10.13.0 || >=11.10.1 }
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/typescript-estree/4.31.1_typescript@4.5.5:
|
/@typescript-eslint/typescript-estree/4.31.1_typescript@4.6.2:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-EGHkbsUvjFrvRnusk6yFGqrqMBTue5E5ROnS5puj3laGQPasVUgwhrxfcgkdHNFECHAewpvELE1Gjv0XO3mdWg==
|
integrity: sha512-EGHkbsUvjFrvRnusk6yFGqrqMBTue5E5ROnS5puj3laGQPasVUgwhrxfcgkdHNFECHAewpvELE1Gjv0XO3mdWg==
|
||||||
@@ -707,8 +718,8 @@ packages:
|
|||||||
globby: 11.0.4
|
globby: 11.0.4
|
||||||
is-glob: 4.0.3
|
is-glob: 4.0.3
|
||||||
semver: 7.3.5
|
semver: 7.3.5
|
||||||
tsutils: 3.21.0_typescript@4.5.5
|
tsutils: 3.21.0_typescript@4.6.2
|
||||||
typescript: 4.5.5
|
typescript: 4.6.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
@@ -1010,7 +1021,7 @@ packages:
|
|||||||
typpy: 2.3.11
|
typpy: 2.3.11
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/autoprefixer/10.4.2_postcss@8.4.6:
|
/autoprefixer/10.4.2_postcss@8.4.7:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-9fOPpHKuDW1w/0EKfRmVnxTDt8166MAnLI3mgZ1JCnhNtYWxcJ6Ud5CO/AVOZi/AvFa8DY9RTy3h3+tFBlrrdQ==
|
integrity: sha512-9fOPpHKuDW1w/0EKfRmVnxTDt8166MAnLI3mgZ1JCnhNtYWxcJ6Ud5CO/AVOZi/AvFa8DY9RTy3h3+tFBlrrdQ==
|
||||||
@@ -1025,7 +1036,7 @@ packages:
|
|||||||
fraction.js: 4.1.2
|
fraction.js: 4.1.2
|
||||||
normalize-range: 0.1.2
|
normalize-range: 0.1.2
|
||||||
picocolors: 1.0.0
|
picocolors: 1.0.0
|
||||||
postcss: 8.4.6
|
postcss: 8.4.7
|
||||||
postcss-value-parser: 4.2.0
|
postcss-value-parser: 4.2.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@@ -1750,10 +1761,10 @@ packages:
|
|||||||
ieee754: 1.2.1
|
ieee754: 1.2.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/bullmq/1.74.2:
|
/bullmq/1.76.0:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-qf0xjF3NDbZqi6ovxAA9QPrPdEgl3BrdYzQO5Pr+ECNIfscLpSXz87kVXI0oTPeDqxw5EJx4sh8EFf2RvVPYTg==
|
integrity: sha512-e9No/JiE7B+wnLsoZnVBLTKTfc1An3bnuIaWewhjDImYNFq5aU/YmzoCdJRgUXrRWGc3EnATFSOLHiEY6Z2FpA==
|
||||||
}
|
}
|
||||||
dependencies:
|
dependencies:
|
||||||
cron-parser: 2.18.0
|
cron-parser: 2.18.0
|
||||||
@@ -2138,10 +2149,10 @@ packages:
|
|||||||
}
|
}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/dayjs/1.10.7:
|
/dayjs/1.10.8:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==
|
integrity: sha512-wbNwDfBHHur9UOzNUjeKUOJ0fCb0a52Wx0xInmQ7Y8FstyajiV1NmK1e00cxsr9YrE9r7yAChE0VvpuY5Rnlow==
|
||||||
}
|
}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
@@ -2720,10 +2731,10 @@ packages:
|
|||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/eslint-plugin-svelte3/3.4.0_eslint@7.32.0+svelte@3.46.4:
|
/eslint-plugin-svelte3/3.4.1_eslint@7.32.0+svelte@3.46.4:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-MIQUTuRv3o7LyQ+360qOc9mLT35j1I5YzHr04g/UDcvJTpg0X/kHWELY99ve869Rp/9wjqD7I26Aq5H8OH5RIg==
|
integrity: sha512-7p59WG8qV8L6wLdl4d/c3mdjkgVglQCdv5XOTk/iNPBKXuuV+Q0eFP5Wa6iJd/G2M1qR3BkLPEzaANOqKAZczw==
|
||||||
}
|
}
|
||||||
engines: { node: '>=10' }
|
engines: { node: '>=10' }
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@@ -3118,10 +3129,10 @@ packages:
|
|||||||
engines: { node: '>=8' }
|
engines: { node: '>=8' }
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/get-port/6.1.1:
|
/get-port/6.1.2:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-RQOsDPSd2PcoLwakY1dwEtLiAbTR7IfmnxsKswfcHEfRKKbhWAG2R5Qo7C8ga6Ne4Mq4lFbogXfDGNfqFxwAaw==
|
integrity: sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==
|
||||||
}
|
}
|
||||||
engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
|
engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
|
||||||
dev: false
|
dev: false
|
||||||
@@ -4109,10 +4120,10 @@ packages:
|
|||||||
dev: false
|
dev: false
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/nanoid/3.2.0:
|
/nanoid/3.3.1:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==
|
integrity: sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==
|
||||||
}
|
}
|
||||||
engines: { node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1 }
|
engines: { node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1 }
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -4382,7 +4393,7 @@ packages:
|
|||||||
engines: { node: '>=8.6' }
|
engines: { node: '>=8.6' }
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/postcss-js/4.0.0_postcss@8.4.6:
|
/postcss-js/4.0.0_postcss@8.4.7:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ==
|
integrity: sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ==
|
||||||
@@ -4392,10 +4403,10 @@ packages:
|
|||||||
postcss: ^8.3.3
|
postcss: ^8.3.3
|
||||||
dependencies:
|
dependencies:
|
||||||
camelcase-css: 2.0.1
|
camelcase-css: 2.0.1
|
||||||
postcss: 8.4.6
|
postcss: 8.4.7
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/postcss-load-config/3.1.0_ts-node@10.5.0:
|
/postcss-load-config/3.1.0_ts-node@10.6.0:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-ipM8Ds01ZUophjDTQYSVP70slFSYg3T0/zyfII5vzhN6V57YSxMgG5syXuwi5VtS8wSf3iL30v0uBdoIVx4Q0g==
|
integrity: sha512-ipM8Ds01ZUophjDTQYSVP70slFSYg3T0/zyfII5vzhN6V57YSxMgG5syXuwi5VtS8wSf3iL30v0uBdoIVx4Q0g==
|
||||||
@@ -4409,11 +4420,11 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
import-cwd: 3.0.0
|
import-cwd: 3.0.0
|
||||||
lilconfig: 2.0.4
|
lilconfig: 2.0.4
|
||||||
ts-node: 10.5.0_e04e69b201f218c8d0d59acefc9ea8a6
|
ts-node: 10.6.0_e79e62fe450383fd2d418267dc75e645
|
||||||
yaml: 1.10.2
|
yaml: 1.10.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/postcss-nested/5.0.6_postcss@8.4.6:
|
/postcss-nested/5.0.6_postcss@8.4.7:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-rKqm2Fk0KbA8Vt3AdGN0FB9OBOMDVajMG6ZCf/GoHgdxUJ4sBFp0A/uMIRm+MJUdo33YXEtjqIz8u7DAp8B7DA==
|
integrity: sha512-rKqm2Fk0KbA8Vt3AdGN0FB9OBOMDVajMG6ZCf/GoHgdxUJ4sBFp0A/uMIRm+MJUdo33YXEtjqIz8u7DAp8B7DA==
|
||||||
@@ -4422,7 +4433,7 @@ packages:
|
|||||||
peerDependencies:
|
peerDependencies:
|
||||||
postcss: ^8.2.14
|
postcss: ^8.2.14
|
||||||
dependencies:
|
dependencies:
|
||||||
postcss: 8.4.6
|
postcss: 8.4.7
|
||||||
postcss-selector-parser: 6.0.9
|
postcss-selector-parser: 6.0.9
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@@ -4444,14 +4455,14 @@ packages:
|
|||||||
}
|
}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/postcss/8.4.6:
|
/postcss/8.4.7:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-OovjwIzs9Te46vlEx7+uXB0PLijpwjXGKXjVGGPIGubGpq7uh5Xgf6D6FiJ/SzJMBosHDp6a2hiXOS97iBXcaA==
|
integrity: sha512-L9Ye3r6hkkCeOETQX6iOaWZgjp3LL6Lpqm6EtgbKrgqGGteRMNb9vzBfRL96YOSu8o7x3MfIH9Mo5cPJFGrW6A==
|
||||||
}
|
}
|
||||||
engines: { node: ^10 || ^12 || >=14 }
|
engines: { node: ^10 || ^12 || >=14 }
|
||||||
dependencies:
|
dependencies:
|
||||||
nanoid: 3.2.0
|
nanoid: 3.3.1
|
||||||
picocolors: 1.0.0
|
picocolors: 1.0.0
|
||||||
source-map-js: 1.0.2
|
source-map-js: 1.0.2
|
||||||
dev: true
|
dev: true
|
||||||
@@ -4477,10 +4488,10 @@ packages:
|
|||||||
svelte: 3.46.4
|
svelte: 3.46.4
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/prettier-plugin-tailwindcss/0.1.7_prettier@2.5.1:
|
/prettier-plugin-tailwindcss/0.1.8_prettier@2.5.1:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-tmBr45hCLuit2Cz9Pwow0/Jl1bGivYGsfcF29O+3sKcE++ybjz9dfie565S3ZsvAeV8uYer9SRMBWDsHPly2Lg==
|
integrity: sha512-hwarSBCswAXa+kqYtaAkFr3Vop9o04WOyZs0qo3NyvW8L7f1rif61wRyq0+ArmVThOuRBcJF5hjGXYk86cwemg==
|
||||||
}
|
}
|
||||||
engines: { node: '>=12.17.0' }
|
engines: { node: '>=12.17.0' }
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@@ -5172,7 +5183,7 @@ packages:
|
|||||||
engines: { node: '>= 0.4' }
|
engines: { node: '>= 0.4' }
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/svelte-check/2.4.5_postcss@8.4.6+svelte@3.46.4:
|
/svelte-check/2.4.5_postcss@8.4.7+svelte@3.46.4:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-nRft8BbG2wcxyCdHDZ7X43xLcvDzua3xLwq6wzHGcAF3ka3Jyhv2rvgq0+SF9NwHLMefp9C2XkM6etzsxK/cMQ==
|
integrity: sha512-nRft8BbG2wcxyCdHDZ7X43xLcvDzua3xLwq6wzHGcAF3ka3Jyhv2rvgq0+SF9NwHLMefp9C2XkM6etzsxK/cMQ==
|
||||||
@@ -5189,8 +5200,8 @@ packages:
|
|||||||
sade: 1.7.4
|
sade: 1.7.4
|
||||||
source-map: 0.7.3
|
source-map: 0.7.3
|
||||||
svelte: 3.46.4
|
svelte: 3.46.4
|
||||||
svelte-preprocess: 4.10.4_88b359da5cac6d8f6ee1bbb7080a3fa9
|
svelte-preprocess: 4.10.4_e836cbb8ceb5bfaa7513362dd6308834
|
||||||
typescript: 4.5.5
|
typescript: 4.6.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@babel/core'
|
- '@babel/core'
|
||||||
- coffeescript
|
- coffeescript
|
||||||
@@ -5222,7 +5233,7 @@ packages:
|
|||||||
}
|
}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/svelte-preprocess/4.10.4_88b359da5cac6d8f6ee1bbb7080a3fa9:
|
/svelte-preprocess/4.10.4_e836cbb8ceb5bfaa7513362dd6308834:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-fuwol0N4UoHsNQolLFbMqWivqcJ9N0vfWO9IuPAiX/5okfoGXURyJ6nECbuEIv0nU3M8Xe2I1ONNje2buk7l6A==
|
integrity: sha512-fuwol0N4UoHsNQolLFbMqWivqcJ9N0vfWO9IuPAiX/5okfoGXURyJ6nECbuEIv0nU3M8Xe2I1ONNje2buk7l6A==
|
||||||
@@ -5270,11 +5281,18 @@ packages:
|
|||||||
'@types/sass': 1.16.1
|
'@types/sass': 1.16.1
|
||||||
detect-indent: 6.1.0
|
detect-indent: 6.1.0
|
||||||
magic-string: 0.25.7
|
magic-string: 0.25.7
|
||||||
postcss: 8.4.6
|
postcss: 8.4.7
|
||||||
sorcery: 0.10.0
|
sorcery: 0.10.0
|
||||||
strip-indent: 3.0.0
|
strip-indent: 3.0.0
|
||||||
svelte: 3.46.4
|
svelte: 3.46.4
|
||||||
typescript: 4.5.5
|
typescript: 4.6.2
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/svelte-select/4.4.7:
|
||||||
|
resolution:
|
||||||
|
{
|
||||||
|
integrity: sha512-fIf9Z8rPI6F8naHZ9wjXT0Pv5gLyhdHAFkHFJnCfVVfELE8e82uOoF0xEVQP6Kir+b4Q5yOvNAzZ61WbSU6A0A==
|
||||||
|
}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/svelte/3.46.4:
|
/svelte/3.46.4:
|
||||||
@@ -5308,10 +5326,10 @@ packages:
|
|||||||
peerDependencies:
|
peerDependencies:
|
||||||
tailwindcss: '>= 2.x.x'
|
tailwindcss: '>= 2.x.x'
|
||||||
dependencies:
|
dependencies:
|
||||||
tailwindcss: 3.0.23_c940fbabf228b85b1c73d314b43e31f1
|
tailwindcss: 3.0.23_4b9e11f8e85900587b5e2272c5d4c20c
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/tailwindcss/3.0.23_c940fbabf228b85b1c73d314b43e31f1:
|
/tailwindcss/3.0.23_4b9e11f8e85900587b5e2272c5d4c20c:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-+OZOV9ubyQ6oI2BXEhzw4HrqvgcARY38xv3zKcjnWtMIZstEsXdI9xftd1iB7+RbOnj2HOEzkA0OyB5BaSxPQA==
|
integrity: sha512-+OZOV9ubyQ6oI2BXEhzw4HrqvgcARY38xv3zKcjnWtMIZstEsXdI9xftd1iB7+RbOnj2HOEzkA0OyB5BaSxPQA==
|
||||||
@@ -5322,7 +5340,7 @@ packages:
|
|||||||
autoprefixer: ^10.0.2
|
autoprefixer: ^10.0.2
|
||||||
dependencies:
|
dependencies:
|
||||||
arg: 5.0.1
|
arg: 5.0.1
|
||||||
autoprefixer: 10.4.2_postcss@8.4.6
|
autoprefixer: 10.4.2_postcss@8.4.7
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
chokidar: 3.5.3
|
chokidar: 3.5.3
|
||||||
color-name: 1.1.4
|
color-name: 1.1.4
|
||||||
@@ -5335,10 +5353,10 @@ packages:
|
|||||||
is-glob: 4.0.3
|
is-glob: 4.0.3
|
||||||
normalize-path: 3.0.0
|
normalize-path: 3.0.0
|
||||||
object-hash: 2.2.0
|
object-hash: 2.2.0
|
||||||
postcss: 8.4.6
|
postcss: 8.4.7
|
||||||
postcss-js: 4.0.0_postcss@8.4.6
|
postcss-js: 4.0.0_postcss@8.4.7
|
||||||
postcss-load-config: 3.1.0_ts-node@10.5.0
|
postcss-load-config: 3.1.0_ts-node@10.6.0
|
||||||
postcss-nested: 5.0.6_postcss@8.4.6
|
postcss-nested: 5.0.6_postcss@8.4.7
|
||||||
postcss-selector-parser: 6.0.9
|
postcss-selector-parser: 6.0.9
|
||||||
postcss-value-parser: 4.2.0
|
postcss-value-parser: 4.2.0
|
||||||
quick-lru: 5.1.1
|
quick-lru: 5.1.1
|
||||||
@@ -5430,10 +5448,10 @@ packages:
|
|||||||
engines: { node: '>=0.10.0' }
|
engines: { node: '>=0.10.0' }
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/ts-node/10.5.0_e04e69b201f218c8d0d59acefc9ea8a6:
|
/ts-node/10.6.0_e79e62fe450383fd2d418267dc75e645:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-6kEJKwVxAJ35W4akuiysfKwKmjkbYxwQMTBaAxo9KKAx/Yd26mPUyhGz3ji+EsJoAgrLqVsYHNuuYwQe22lbtw==
|
integrity: sha512-CJen6+dfOXolxudBQXnVjRVvYTmTWbyz7cn+xq2XTsvnaXbHqr4gXSCNbS2Jj8yTZMuGwUoBESLaOkLascVVvg==
|
||||||
}
|
}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@@ -5452,14 +5470,14 @@ packages:
|
|||||||
'@tsconfig/node12': 1.0.9
|
'@tsconfig/node12': 1.0.9
|
||||||
'@tsconfig/node14': 1.0.1
|
'@tsconfig/node14': 1.0.1
|
||||||
'@tsconfig/node16': 1.0.2
|
'@tsconfig/node16': 1.0.2
|
||||||
'@types/node': 17.0.20
|
'@types/node': 17.0.21
|
||||||
acorn: 8.5.0
|
acorn: 8.5.0
|
||||||
acorn-walk: 8.2.0
|
acorn-walk: 8.2.0
|
||||||
arg: 4.1.3
|
arg: 4.1.3
|
||||||
create-require: 1.1.1
|
create-require: 1.1.1
|
||||||
diff: 4.0.2
|
diff: 4.0.2
|
||||||
make-error: 1.3.6
|
make-error: 1.3.6
|
||||||
typescript: 4.5.5
|
typescript: 4.6.2
|
||||||
v8-compile-cache-lib: 3.0.0
|
v8-compile-cache-lib: 3.0.0
|
||||||
yn: 3.1.1
|
yn: 3.1.1
|
||||||
dev: true
|
dev: true
|
||||||
@@ -5477,7 +5495,7 @@ packages:
|
|||||||
}
|
}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/tsutils/3.21.0_typescript@4.5.5:
|
/tsutils/3.21.0_typescript@4.6.2:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==
|
integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==
|
||||||
@@ -5487,7 +5505,7 @@ packages:
|
|||||||
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'
|
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:
|
dependencies:
|
||||||
tslib: 1.14.1
|
tslib: 1.14.1
|
||||||
typescript: 4.5.5
|
typescript: 4.6.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/tweetnacl/0.14.5:
|
/tweetnacl/0.14.5:
|
||||||
@@ -5520,10 +5538,10 @@ packages:
|
|||||||
engines: { node: '>=10' }
|
engines: { node: '>=10' }
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/typescript/4.5.5:
|
/typescript/4.6.2:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==
|
integrity: sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==
|
||||||
}
|
}
|
||||||
engines: { node: '>=4.2.0' }
|
engines: { node: '>=4.2.0' }
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -5600,7 +5618,7 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
esbuild: 0.14.21
|
esbuild: 0.14.21
|
||||||
postcss: 8.4.6
|
postcss: 8.4.7
|
||||||
resolve: 1.22.0
|
resolve: 1.22.0
|
||||||
rollup: 2.61.1
|
rollup: 2.61.1
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "ServiceSecret" (
|
||||||
|
"id" TEXT NOT NULL PRIMARY KEY,
|
||||||
|
"name" TEXT NOT NULL,
|
||||||
|
"value" TEXT NOT NULL,
|
||||||
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updatedAt" DATETIME NOT NULL,
|
||||||
|
"serviceId" TEXT NOT NULL,
|
||||||
|
CONSTRAINT "ServiceSecret_serviceId_fkey" FOREIGN KEY ("serviceId") REFERENCES "Service" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "ServiceSecret_name_serviceId_key" ON "ServiceSecret"("name", "serviceId");
|
||||||
19
prisma/migrations/20220311213422_autodeploy/migration.sql
Normal file
19
prisma/migrations/20220311213422_autodeploy/migration.sql
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
-- RedefineTables
|
||||||
|
PRAGMA foreign_keys=OFF;
|
||||||
|
CREATE TABLE "new_ApplicationSettings" (
|
||||||
|
"id" TEXT NOT NULL PRIMARY KEY,
|
||||||
|
"applicationId" TEXT NOT NULL,
|
||||||
|
"dualCerts" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"debug" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"previews" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"autodeploy" BOOLEAN NOT NULL DEFAULT true,
|
||||||
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updatedAt" DATETIME NOT NULL,
|
||||||
|
CONSTRAINT "ApplicationSettings_applicationId_fkey" FOREIGN KEY ("applicationId") REFERENCES "Application" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
INSERT INTO "new_ApplicationSettings" ("applicationId", "createdAt", "debug", "dualCerts", "id", "previews", "updatedAt") SELECT "applicationId", "createdAt", "debug", "dualCerts", "id", "previews", "updatedAt" FROM "ApplicationSettings";
|
||||||
|
DROP TABLE "ApplicationSettings";
|
||||||
|
ALTER TABLE "new_ApplicationSettings" RENAME TO "ApplicationSettings";
|
||||||
|
CREATE UNIQUE INDEX "ApplicationSettings_applicationId_key" ON "ApplicationSettings"("applicationId");
|
||||||
|
PRAGMA foreign_key_check;
|
||||||
|
PRAGMA foreign_keys=ON;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Application" ADD COLUMN "phpModules" TEXT;
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "ApplicationPersistentStorage" (
|
||||||
|
"id" TEXT NOT NULL PRIMARY KEY,
|
||||||
|
"applicationId" TEXT NOT NULL,
|
||||||
|
"path" TEXT NOT NULL,
|
||||||
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updatedAt" DATETIME NOT NULL,
|
||||||
|
CONSTRAINT "ApplicationPersistentStorage_applicationId_fkey" FOREIGN KEY ("applicationId") REFERENCES "Application" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "ApplicationPersistentStorage_applicationId_key" ON "ApplicationPersistentStorage"("applicationId");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "ApplicationPersistentStorage_path_key" ON "ApplicationPersistentStorage"("path");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "ApplicationPersistentStorage_applicationId_path_key" ON "ApplicationPersistentStorage"("applicationId", "path");
|
||||||
@@ -72,9 +72,9 @@ model TeamInvitation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model Application {
|
model Application {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
name String
|
name String
|
||||||
fqdn String? @unique
|
fqdn String? @unique
|
||||||
repository String?
|
repository String?
|
||||||
configHash String?
|
configHash String?
|
||||||
branch String?
|
branch String?
|
||||||
@@ -86,15 +86,17 @@ model Application {
|
|||||||
startCommand String?
|
startCommand String?
|
||||||
baseDirectory String?
|
baseDirectory String?
|
||||||
publishDirectory String?
|
publishDirectory String?
|
||||||
createdAt DateTime @default(now())
|
phpModules String?
|
||||||
updatedAt DateTime @updatedAt
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
settings ApplicationSettings?
|
settings ApplicationSettings?
|
||||||
teams Team[]
|
teams Team[]
|
||||||
destinationDockerId String?
|
destinationDockerId String?
|
||||||
destinationDocker DestinationDocker? @relation(fields: [destinationDockerId], references: [id])
|
destinationDocker DestinationDocker? @relation(fields: [destinationDockerId], references: [id])
|
||||||
gitSourceId String?
|
gitSourceId String?
|
||||||
gitSource GitSource? @relation(fields: [gitSourceId], references: [id])
|
gitSource GitSource? @relation(fields: [gitSourceId], references: [id])
|
||||||
secrets Secret[]
|
secrets Secret[]
|
||||||
|
persistentStorage ApplicationPersistentStorage[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model ApplicationSettings {
|
model ApplicationSettings {
|
||||||
@@ -104,10 +106,22 @@ model ApplicationSettings {
|
|||||||
dualCerts Boolean @default(false)
|
dualCerts Boolean @default(false)
|
||||||
debug Boolean @default(false)
|
debug Boolean @default(false)
|
||||||
previews Boolean @default(false)
|
previews Boolean @default(false)
|
||||||
|
autodeploy Boolean @default(true)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model ApplicationPersistentStorage {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
application Application @relation(fields: [applicationId], references: [id])
|
||||||
|
applicationId String @unique
|
||||||
|
path String @unique
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
|
@@unique([applicationId, path])
|
||||||
|
}
|
||||||
|
|
||||||
model Secret {
|
model Secret {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
name String
|
name String
|
||||||
@@ -122,6 +136,18 @@ model Secret {
|
|||||||
@@unique([name, applicationId, isPRMRSecret])
|
@@unique([name, applicationId, isPRMRSecret])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model ServiceSecret {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String
|
||||||
|
value String
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
service Service @relation(fields: [serviceId], references: [id])
|
||||||
|
serviceId String
|
||||||
|
|
||||||
|
@@unique([name, serviceId])
|
||||||
|
}
|
||||||
|
|
||||||
model BuildLog {
|
model BuildLog {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
applicationId String?
|
applicationId String?
|
||||||
@@ -252,6 +278,7 @@ model Service {
|
|||||||
minio Minio?
|
minio Minio?
|
||||||
vscodeserver Vscodeserver?
|
vscodeserver Vscodeserver?
|
||||||
wordpress Wordpress?
|
wordpress Wordpress?
|
||||||
|
serviceSecret ServiceSecret[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model PlausibleAnalytics {
|
model PlausibleAnalytics {
|
||||||
|
|||||||
5
src/app.d.ts
vendored
5
src/app.d.ts
vendored
@@ -7,7 +7,10 @@ declare namespace App {
|
|||||||
}
|
}
|
||||||
interface Platform {}
|
interface Platform {}
|
||||||
interface Session extends SessionData {}
|
interface Session extends SessionData {}
|
||||||
interface Stuff {}
|
interface Stuff {
|
||||||
|
application: any;
|
||||||
|
isRunning: boolean;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SessionData {
|
interface SessionData {
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ export function makeLabelForStandaloneApplication({
|
|||||||
fqdn = `${protocol}://${pullmergeRequestId}.${domain}`;
|
fqdn = `${protocol}://${pullmergeRequestId}.${domain}`;
|
||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
'--label coolify.managed=true',
|
'coolify.managed=true',
|
||||||
`--label coolify.version=${version}`,
|
`coolify.version=${version}`,
|
||||||
`--label coolify.type=standalone-application`,
|
`coolify.type=standalone-application`,
|
||||||
`--label coolify.configuration=${base64Encode(
|
`coolify.configuration=${base64Encode(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
applicationId,
|
applicationId,
|
||||||
fqdn,
|
fqdn,
|
||||||
@@ -84,7 +84,15 @@ export function makeLabelForServices(type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const setDefaultConfiguration = async (data) => {
|
export const setDefaultConfiguration = async (data) => {
|
||||||
let { buildPack, port, installCommand, startCommand, buildCommand, publishDirectory } = data;
|
let {
|
||||||
|
buildPack,
|
||||||
|
port,
|
||||||
|
installCommand,
|
||||||
|
startCommand,
|
||||||
|
buildCommand,
|
||||||
|
publishDirectory,
|
||||||
|
baseDirectory
|
||||||
|
} = data;
|
||||||
const template = scanningTemplates[buildPack];
|
const template = scanningTemplates[buildPack];
|
||||||
if (!port) {
|
if (!port) {
|
||||||
port = template?.port || 3000;
|
port = template?.port || 3000;
|
||||||
@@ -97,6 +105,10 @@ export const setDefaultConfiguration = async (data) => {
|
|||||||
if (!startCommand) startCommand = template?.startCommand || 'yarn start';
|
if (!startCommand) startCommand = template?.startCommand || 'yarn start';
|
||||||
if (!buildCommand) buildCommand = template?.buildCommand || null;
|
if (!buildCommand) buildCommand = template?.buildCommand || null;
|
||||||
if (!publishDirectory) publishDirectory = template?.publishDirectory || null;
|
if (!publishDirectory) publishDirectory = template?.publishDirectory || null;
|
||||||
|
if (baseDirectory) {
|
||||||
|
if (!baseDirectory.startsWith('/')) baseDirectory = `/${baseDirectory}`;
|
||||||
|
if (!baseDirectory.endsWith('/')) baseDirectory = `${baseDirectory}/`;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
buildPack,
|
buildPack,
|
||||||
@@ -104,7 +116,8 @@ export const setDefaultConfiguration = async (data) => {
|
|||||||
installCommand,
|
installCommand,
|
||||||
startCommand,
|
startCommand,
|
||||||
buildCommand,
|
buildCommand,
|
||||||
publishDirectory
|
publishDirectory,
|
||||||
|
baseDirectory
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -122,6 +135,7 @@ export async function copyBaseConfigurationFiles(buildPack, workdir, buildId, ap
|
|||||||
RewriteRule ^(.+)$ index.php [QSA,L]
|
RewriteRule ^(.+)$ index.php [QSA,L]
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
await fs.writeFile(`${workdir}/entrypoint.sh`, `chown -R 1000 /app`);
|
||||||
saveBuildLog({ line: 'Copied default configuration file for PHP.', buildId, applicationId });
|
saveBuildLog({ line: 'Copied default configuration file for PHP.', buildId, applicationId });
|
||||||
} else if (staticDeployments.includes(buildPack)) {
|
} else if (staticDeployments.includes(buildPack)) {
|
||||||
await fs.writeFile(
|
await fs.writeFile(
|
||||||
@@ -129,27 +143,35 @@ export async function copyBaseConfigurationFiles(buildPack, workdir, buildId, ap
|
|||||||
`user nginx;
|
`user nginx;
|
||||||
worker_processes auto;
|
worker_processes auto;
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
error_log /docker.stdout;
|
||||||
pid /var/run/nginx.pid;
|
pid /run/nginx.pid;
|
||||||
|
|
||||||
events {
|
events {
|
||||||
worker_connections 1024;
|
worker_connections 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
http {
|
http {
|
||||||
include /etc/nginx/mime.types;
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
access_log off;
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
sendfile on;
|
|
||||||
#tcp_nopush on;
|
access_log /docker.stdout main;
|
||||||
keepalive_timeout 65;
|
|
||||||
|
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 {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /usr/share/nginx/html;
|
root /app;
|
||||||
index index.html;
|
index index.html;
|
||||||
try_files $uri $uri/index.html $uri/ /index.html =404;
|
try_files $uri $uri/index.html $uri/ /index.html =404;
|
||||||
}
|
}
|
||||||
@@ -160,7 +182,7 @@ export async function copyBaseConfigurationFiles(buildPack, workdir, buildId, ap
|
|||||||
#
|
#
|
||||||
error_page 500 502 503 504 /50x.html;
|
error_page 500 502 503 504 /50x.html;
|
||||||
location = /50x.html {
|
location = /50x.html {
|
||||||
root /usr/share/nginx/html;
|
root /app;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -175,3 +197,11 @@ export async function copyBaseConfigurationFiles(buildPack, workdir, buildId, ap
|
|||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function checkPnpm(installCommand = null, buildCommand = null, startCommand = null) {
|
||||||
|
return (
|
||||||
|
installCommand?.includes('pnpm') ||
|
||||||
|
buildCommand?.includes('pnpm') ||
|
||||||
|
startCommand?.includes('pnpm')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export default async function ({
|
|||||||
let file = `${workdir}/Dockerfile`;
|
let file = `${workdir}/Dockerfile`;
|
||||||
if (baseDirectory) {
|
if (baseDirectory) {
|
||||||
file = `${workdir}/${baseDirectory}/Dockerfile`;
|
file = `${workdir}/${baseDirectory}/Dockerfile`;
|
||||||
|
workdir = `${workdir}/${baseDirectory}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Dockerfile: Array<string> = (await fs.readFile(`${file}`, 'utf8'))
|
const Dockerfile: Array<string> = (await fs.readFile(`${file}`, 'utf8'))
|
||||||
|
|||||||
@@ -6,17 +6,17 @@ const createDockerfile = async (data, imageforBuild): Promise<void> => {
|
|||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
|
|
||||||
Dockerfile.push(`FROM ${imageforBuild}`);
|
Dockerfile.push(`FROM ${imageforBuild}`);
|
||||||
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /app/${publishDirectory} ./`);
|
||||||
|
Dockerfile.push(`COPY /nginx.conf /etc/nginx/nginx.conf`);
|
||||||
Dockerfile.push(`EXPOSE 80`);
|
Dockerfile.push(`EXPOSE 80`);
|
||||||
Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');
|
|
||||||
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function (data) {
|
export default async function (data) {
|
||||||
try {
|
try {
|
||||||
const image = 'nginx:stable-alpine';
|
const image = 'webdevops/nginx:alpine';
|
||||||
const imageForBuild = 'node:lts';
|
const imageForBuild = 'node:lts';
|
||||||
|
|
||||||
await buildCacheImageWithNode(data, imageForBuild);
|
await buildCacheImageWithNode(data, imageForBuild);
|
||||||
|
|||||||
@@ -4,13 +4,17 @@ import { promises as fs } from 'fs';
|
|||||||
const createDockerfile = async (data, image): Promise<void> => {
|
const createDockerfile = async (data, image): Promise<void> => {
|
||||||
const { applicationId, tag, port, startCommand, workdir, baseDirectory } = data;
|
const { applicationId, tag, port, startCommand, workdir, baseDirectory } = data;
|
||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
|
const isPnpm = startCommand.includes('pnpm');
|
||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push(
|
if (isPnpm) {
|
||||||
`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${baseDirectory || ''} ./`
|
Dockerfile.push('RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm');
|
||||||
);
|
Dockerfile.push('RUN pnpm add -g pnpm');
|
||||||
|
}
|
||||||
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /app/${baseDirectory || ''} ./`);
|
||||||
|
|
||||||
Dockerfile.push(`EXPOSE ${port}`);
|
Dockerfile.push(`EXPOSE ${port}`);
|
||||||
Dockerfile.push(`CMD ${startCommand}`);
|
Dockerfile.push(`CMD ${startCommand}`);
|
||||||
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { buildImage } from '$lib/docker';
|
import { buildImage } from '$lib/docker';
|
||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
|
import { checkPnpm } from './common';
|
||||||
|
|
||||||
const createDockerfile = async (data, image): Promise<void> => {
|
const createDockerfile = async (data, image): Promise<void> => {
|
||||||
const {
|
const {
|
||||||
@@ -13,9 +14,9 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
pullmergeRequestId
|
pullmergeRequestId
|
||||||
} = data;
|
} = data;
|
||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
|
const isPnpm = checkPnpm(installCommand, buildCommand, startCommand);
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
if (secrets.length > 0) {
|
if (secrets.length > 0) {
|
||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
@@ -32,17 +33,13 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}package*.json ./`);
|
if (isPnpm) {
|
||||||
try {
|
Dockerfile.push('RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm');
|
||||||
await fs.stat(`${workdir}/yarn.lock`);
|
Dockerfile.push('RUN pnpm add -g pnpm');
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}yarn.lock ./`);
|
}
|
||||||
} catch (error) {}
|
Dockerfile.push(`COPY .${baseDirectory || ''} ./`);
|
||||||
try {
|
|
||||||
await fs.stat(`${workdir}/pnpm-lock.yaml`);
|
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}pnpm-lock.yaml ./`);
|
|
||||||
} catch (error) {}
|
|
||||||
Dockerfile.push(`RUN ${installCommand}`);
|
Dockerfile.push(`RUN ${installCommand}`);
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''} ./`);
|
|
||||||
if (buildCommand) {
|
if (buildCommand) {
|
||||||
Dockerfile.push(`RUN ${buildCommand}`);
|
Dockerfile.push(`RUN ${buildCommand}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { buildImage } from '$lib/docker';
|
import { buildImage } from '$lib/docker';
|
||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
|
import { checkPnpm } from './common';
|
||||||
|
|
||||||
const createDockerfile = async (data, image): Promise<void> => {
|
const createDockerfile = async (data, image): Promise<void> => {
|
||||||
const {
|
const {
|
||||||
@@ -13,9 +14,10 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
pullmergeRequestId
|
pullmergeRequestId
|
||||||
} = data;
|
} = data;
|
||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
|
const isPnpm = checkPnpm(installCommand, buildCommand, startCommand);
|
||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
if (secrets.length > 0) {
|
if (secrets.length > 0) {
|
||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
@@ -32,17 +34,12 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}package*.json ./`);
|
if (isPnpm) {
|
||||||
try {
|
Dockerfile.push('RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm');
|
||||||
await fs.stat(`${workdir}/yarn.lock`);
|
Dockerfile.push('RUN pnpm add -g pnpm');
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}yarn.lock ./`);
|
}
|
||||||
} catch (error) {}
|
Dockerfile.push(`COPY .${baseDirectory || ''} ./`);
|
||||||
try {
|
|
||||||
await fs.stat(`${workdir}/pnpm-lock.yaml`);
|
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}pnpm-lock.yaml ./`);
|
|
||||||
} catch (error) {}
|
|
||||||
Dockerfile.push(`RUN ${installCommand}`);
|
Dockerfile.push(`RUN ${installCommand}`);
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''} ./`);
|
|
||||||
if (buildCommand) {
|
if (buildCommand) {
|
||||||
Dockerfile.push(`RUN ${buildCommand}`);
|
Dockerfile.push(`RUN ${buildCommand}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { buildImage } from '$lib/docker';
|
import { buildImage } from '$lib/docker';
|
||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
|
import { checkPnpm } from './common';
|
||||||
|
|
||||||
const createDockerfile = async (data, image): Promise<void> => {
|
const createDockerfile = async (data, image): Promise<void> => {
|
||||||
const {
|
const {
|
||||||
@@ -13,9 +14,9 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
pullmergeRequestId
|
pullmergeRequestId
|
||||||
} = data;
|
} = data;
|
||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
|
const isPnpm = checkPnpm(installCommand, buildCommand, startCommand);
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
if (secrets.length > 0) {
|
if (secrets.length > 0) {
|
||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
@@ -32,17 +33,12 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}package*.json ./`);
|
if (isPnpm) {
|
||||||
try {
|
Dockerfile.push('RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm');
|
||||||
await fs.stat(`${workdir}/yarn.lock`);
|
Dockerfile.push('RUN pnpm add -g pnpm');
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}yarn.lock ./`);
|
}
|
||||||
} catch (error) {}
|
Dockerfile.push(`COPY .${baseDirectory || ''} ./`);
|
||||||
try {
|
|
||||||
await fs.stat(`${workdir}/pnpm-lock.yaml`);
|
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}pnpm-lock.yaml ./`);
|
|
||||||
} catch (error) {}
|
|
||||||
Dockerfile.push(`RUN ${installCommand}`);
|
Dockerfile.push(`RUN ${installCommand}`);
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''} ./`);
|
|
||||||
if (buildCommand) {
|
if (buildCommand) {
|
||||||
Dockerfile.push(`RUN ${buildCommand}`);
|
Dockerfile.push(`RUN ${buildCommand}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,21 +4,19 @@ import { promises as fs } from 'fs';
|
|||||||
const createDockerfile = async (data, image): Promise<void> => {
|
const createDockerfile = async (data, image): Promise<void> => {
|
||||||
const { workdir, baseDirectory } = data;
|
const { workdir, baseDirectory } = data;
|
||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push('RUN a2enmod rewrite');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push('WORKDIR /var/www/html');
|
Dockerfile.push(`COPY .${baseDirectory || ''} /app`);
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''} /var/www/html`);
|
Dockerfile.push(`COPY /.htaccess .`);
|
||||||
|
Dockerfile.push(`COPY /entrypoint.sh /opt/docker/provision/entrypoint.d/30-entrypoint.sh`);
|
||||||
Dockerfile.push(`EXPOSE 80`);
|
Dockerfile.push(`EXPOSE 80`);
|
||||||
Dockerfile.push('CMD ["apache2-foreground"]');
|
|
||||||
Dockerfile.push('RUN chown -R www-data /var/www/html');
|
|
||||||
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function (data) {
|
export default async function (data) {
|
||||||
try {
|
try {
|
||||||
const image = 'php:apache';
|
const image = 'webdevops/php-nginx';
|
||||||
await createDockerfile(data, image);
|
await createDockerfile(data, image);
|
||||||
await buildImage(data);
|
await buildImage(data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -7,16 +7,16 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /app/${publishDirectory} ./`);
|
||||||
|
Dockerfile.push(`COPY /nginx.conf /etc/nginx/nginx.conf`);
|
||||||
Dockerfile.push(`EXPOSE 80`);
|
Dockerfile.push(`EXPOSE 80`);
|
||||||
Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');
|
|
||||||
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function (data) {
|
export default async function (data) {
|
||||||
try {
|
try {
|
||||||
const image = 'nginx:stable-alpine';
|
const image = 'webdevops/nginx:alpine';
|
||||||
const imageForBuild = 'node:lts';
|
const imageForBuild = 'node:lts';
|
||||||
await buildCacheImageWithNode(data, imageForBuild);
|
await buildCacheImageWithNode(data, imageForBuild);
|
||||||
await createDockerfile(data, image);
|
await createDockerfile(data, image);
|
||||||
|
|||||||
@@ -7,23 +7,21 @@ const createDockerfile = async (data, image, name): Promise<void> => {
|
|||||||
const { workdir, port, applicationId, tag } = data;
|
const { workdir, port, applicationId, tag } = data;
|
||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/target target`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /app/target target`);
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/local/cargo /usr/local/cargo`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/local/cargo /usr/local/cargo`);
|
||||||
Dockerfile.push(`COPY . .`);
|
Dockerfile.push(`COPY . .`);
|
||||||
Dockerfile.push(`RUN cargo build --release --bin ${name}`);
|
Dockerfile.push(`RUN cargo build --release --bin ${name}`);
|
||||||
Dockerfile.push('FROM debian:buster-slim');
|
Dockerfile.push('FROM debian:buster-slim');
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(
|
Dockerfile.push(
|
||||||
`RUN apt-get update -y && apt-get install -y --no-install-recommends openssl libcurl4 ca-certificates && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*`
|
`RUN apt-get update -y && apt-get install -y --no-install-recommends openssl libcurl4 ca-certificates && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*`
|
||||||
);
|
);
|
||||||
Dockerfile.push(`RUN update-ca-certificates`);
|
Dockerfile.push(`RUN update-ca-certificates`);
|
||||||
Dockerfile.push(
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /app/target/release/${name} ${name}`);
|
||||||
`COPY --from=${applicationId}:${tag}-cache /usr/src/app/target/release/${name} ${name}`
|
|
||||||
);
|
|
||||||
Dockerfile.push(`EXPOSE ${port}`);
|
Dockerfile.push(`EXPOSE ${port}`);
|
||||||
Dockerfile.push(`CMD ["/usr/src/app/${name}"]`);
|
Dockerfile.push(`CMD ["/app/${name}"]`);
|
||||||
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
if (secrets.length > 0) {
|
if (secrets.length > 0) {
|
||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
@@ -33,20 +33,18 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (buildCommand) {
|
if (buildCommand) {
|
||||||
Dockerfile.push(
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /app/${publishDirectory} ./`);
|
||||||
`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''} ./`);
|
Dockerfile.push(`COPY .${baseDirectory || ''} ./`);
|
||||||
}
|
}
|
||||||
|
Dockerfile.push(`COPY /nginx.conf /etc/nginx/nginx.conf`);
|
||||||
Dockerfile.push(`EXPOSE 80`);
|
Dockerfile.push(`EXPOSE 80`);
|
||||||
Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');
|
|
||||||
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function (data) {
|
export default async function (data) {
|
||||||
try {
|
try {
|
||||||
const image = 'nginx:stable-alpine';
|
const image = 'webdevops/nginx:alpine';
|
||||||
const imageForBuild = 'node:lts';
|
const imageForBuild = 'node:lts';
|
||||||
if (data.buildCommand) await buildCacheImageWithNode(data, imageForBuild);
|
if (data.buildCommand) await buildCacheImageWithNode(data, imageForBuild);
|
||||||
await createDockerfile(data, image);
|
await createDockerfile(data, image);
|
||||||
|
|||||||
@@ -6,17 +6,17 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /app/${publishDirectory} ./`);
|
||||||
|
Dockerfile.push(`COPY /nginx.conf /etc/nginx/nginx.conf`);
|
||||||
Dockerfile.push(`EXPOSE 80`);
|
Dockerfile.push(`EXPOSE 80`);
|
||||||
Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');
|
|
||||||
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function (data) {
|
export default async function (data) {
|
||||||
try {
|
try {
|
||||||
const image = 'nginx:stable-alpine';
|
const image = 'webdevops/nginx:alpine';
|
||||||
const imageForBuild = 'node:lts';
|
const imageForBuild = 'node:lts';
|
||||||
|
|
||||||
await buildCacheImageWithNode(data, imageForBuild);
|
await buildCacheImageWithNode(data, imageForBuild);
|
||||||
|
|||||||
@@ -6,17 +6,17 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /app/${publishDirectory} ./`);
|
||||||
|
Dockerfile.push(`COPY /nginx.conf /etc/nginx/nginx.conf`);
|
||||||
Dockerfile.push(`EXPOSE 80`);
|
Dockerfile.push(`EXPOSE 80`);
|
||||||
Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');
|
|
||||||
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function (data) {
|
export default async function (data) {
|
||||||
try {
|
try {
|
||||||
const image = 'nginx:stable-alpine';
|
const image = 'webdevops/nginx:alpine';
|
||||||
const imageForBuild = 'node:lts';
|
const imageForBuild = 'node:lts';
|
||||||
await buildCacheImageWithNode(data, imageForBuild);
|
await buildCacheImageWithNode(data, imageForBuild);
|
||||||
await createDockerfile(data, image);
|
await createDockerfile(data, image);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { version as currentVersion } from '../../package.json';
|
|||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import Cookie from 'cookie';
|
import Cookie from 'cookie';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
import cuid from 'cuid';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
@@ -68,9 +69,9 @@ export const isTeamIdTokenAvailable = (request) => {
|
|||||||
|
|
||||||
export const getTeam = (event) => {
|
export const getTeam = (event) => {
|
||||||
const cookies = Cookie.parse(event.request.headers.get('cookie'));
|
const cookies = Cookie.parse(event.request.headers.get('cookie'));
|
||||||
if (cookies.teamId) {
|
if (cookies?.teamId) {
|
||||||
return cookies.teamId;
|
return cookies.teamId;
|
||||||
} else if (event.locals.session.data.teamId) {
|
} else if (event.locals.session.data?.teamId) {
|
||||||
return event.locals.session.data.teamId;
|
return event.locals.session.data.teamId;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="absolute top-0 right-0 m-3 cursor-pointer text-warmGray-600 hover:text-white">
|
<div class="absolute top-0 right-0 m-3 cursor-pointer text-stone-600 hover:text-white">
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
{#if isPasswordField}
|
{#if isPasswordField}
|
||||||
<div on:click={() => (showPassword = !showPassword)}>
|
<div on:click={() => (showPassword = !showPassword)}>
|
||||||
|
|||||||
@@ -9,7 +9,16 @@ export const dateOptions: DateTimeFormatOptions = {
|
|||||||
hour12: false
|
hour12: false
|
||||||
};
|
};
|
||||||
|
|
||||||
export const staticDeployments = ['react', 'vuejs', 'static', 'svelte', 'gatsby', 'php'];
|
export const staticDeployments = [
|
||||||
|
'react',
|
||||||
|
'vuejs',
|
||||||
|
'static',
|
||||||
|
'svelte',
|
||||||
|
'gatsby',
|
||||||
|
'php',
|
||||||
|
'astro',
|
||||||
|
'eleventy'
|
||||||
|
];
|
||||||
export const notNodeDeployments = ['php', 'docker', 'rust'];
|
export const notNodeDeployments = ['php', 'docker', 'rust'];
|
||||||
|
|
||||||
export function getDomain(domain) {
|
export function getDomain(domain) {
|
||||||
|
|||||||
27
src/lib/components/svg/services/LanguageTool.svelte
Normal file
27
src/lib/components/svg/services/LanguageTool.svelte
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
export let isAbsolute = false;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
class={isAbsolute ? 'w-10 h-10 absolute top-0 left-0 -m-5' : 'w-8 mx-auto'}
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 140 140"
|
||||||
|
data-lt-extension-installed="true"
|
||||||
|
><g clip-path="url(#clip0)"
|
||||||
|
><path
|
||||||
|
fill="#fff"
|
||||||
|
fill-rule="evenodd"
|
||||||
|
d="M140 43.602c0-1.662.001-3.324-.01-4.987-.008-1.4-.024-2.8-.062-4.2-.082-3.05-.262-6.126-.805-9.142-.55-3.06-1.448-5.907-2.864-8.688A29.227 29.227 0 0 0 123.476 3.81c-2.783-1.416-5.634-2.314-8.697-2.864-3.016-.542-6.094-.722-9.144-.804-1.4-.038-2.801-.054-4.202-.063C99.77.068 98.107.07 96.444.07L77.135 0H62.694L43.726.07c-1.666 0-3.332-.002-4.998.008-1.404.01-2.807.025-4.21.063-3.058.082-6.142.262-9.166.805-3.067.55-5.922 1.447-8.709 2.862a29.293 29.293 0 0 0-7.419 5.377 29.223 29.223 0 0 0-5.389 7.4c-1.42 2.78-2.32 5.63-2.871 8.691-.543 3.016-.723 6.091-.806 9.14-.038 1.4-.054 2.8-.062 4.2C.086 40.277 0 42.342 0 44.004v33.3l.086 19.102c0 1.665 0 3.33.01 4.994a200.6 200.6 0 0 0 .062 4.205c.083 3.054.263 6.135.807 9.155.551 3.064 1.451 5.916 2.87 8.7a29.294 29.294 0 0 0 12.807 12.794c2.788 1.418 5.645 2.317 8.714 2.868 3.022.542 6.105.722 9.162.804 1.403.038 2.806.054 4.21.063 1.666.01 3.332.009 4.998.009l19.14.001h14.477l19.101-.001c1.663 0 3.326.001 4.989-.009a202.92 202.92 0 0 0 4.202-.063c3.052-.082 6.13-.262 9.148-.805 3.061-.551 5.911-1.45 8.692-2.867a29.215 29.215 0 0 0 7.405-5.384 29.22 29.22 0 0 0 5.378-7.409c1.417-2.785 2.315-5.639 2.866-8.704.542-3.02.722-6.099.804-9.152.038-1.402.054-2.804.062-4.205.011-1.665.01-3.33.01-4.993l-.001-19.103V62.694L140 43.602"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
/><path
|
||||||
|
fill="#000"
|
||||||
|
fill-rule="evenodd"
|
||||||
|
d="M39.375 40.188h8.313a6.25 6.25 0 0 1 6.25 6.25v24.25h16.25v8.75h-18.75a6.25 6.25 0 0 1-6.25-6.25v-24.25h-5.813v-8.75zm63.563 6.25v6.5h-8.75v-4h-6.876v30.5h-8.75v-30.5h-6.874v4h-8.75v-6.5a6.25 6.25 0 0 1 6.25-6.25h27.5a6.25 6.25 0 0 1 6.25 6.25z"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
/><path
|
||||||
|
fill="#239AFF"
|
||||||
|
d="M35.319 102.906l-8.138-5.812c2.39-3.347 4.857-5.936 7.452-7.753 2.884-2.018 5.948-3.091 9.117-3.091 2.942 0 5.491.714 7.768 2.08a17.622 17.622 0 0 1 2.615 1.94c.589.518 1.009.926 1.903 1.82 1.355 1.354 1.917 1.851 2.591 2.255.731.439 1.503.655 2.623.655 1.121 0 1.896-.217 2.631-.657.677-.405 1.245-.905 2.6-2.257l.012-.012c.89-.888 1.314-1.299 1.902-1.817a17.643 17.643 0 0 1 2.61-1.933c2.273-1.362 4.814-2.074 7.745-2.074s5.472.712 7.745 2.074c.916.55 1.758 1.183 2.61 1.933.589.518 1.013.929 1.902 1.817l.013.012c1.354 1.352 1.922 1.852 2.599 2.257.735.44 1.51.657 2.631.657.998 0 2.1-.386 3.383-1.284 1.572-1.1 3.272-2.886 5.048-5.372l8.138 5.812c-2.391 3.347-4.857 5.936-7.452 7.753-2.884 2.018-5.948 3.091-9.117 3.091-2.941 0-5.49-.713-7.769-2.078a17.627 17.627 0 0 1-2.619-1.938c-.59-.519-1.015-.93-1.906-1.82l-.013-.013c-1.351-1.348-1.917-1.846-2.59-2.25-.728-.436-1.494-.651-2.603-.651-1.109 0-1.875.215-2.603.651-.673.404-1.239.902-2.59 2.25l-.012.013c-.892.89-1.317 1.301-1.907 1.82-.855.752-1.7 1.388-2.62 1.938C66.74 104.287 64.192 105 61.25 105c-2.942 0-5.49-.714-7.768-2.08a17.654 17.654 0 0 1-2.615-1.939c-.588-.519-1.009-.927-1.902-1.82-1.355-1.355-1.918-1.852-2.592-2.256-.731-.439-1.503-.655-2.623-.655-.998 0-2.1.386-3.383 1.284-1.572 1.1-3.272 2.886-5.048 5.372z"
|
||||||
|
/></g
|
||||||
|
><defs><clipPath id="clip0"><path fill="#fff" d="M0 0h140v140H0z" /></clipPath></defs></svg
|
||||||
|
>
|
||||||
@@ -13,7 +13,7 @@ export function findBuildPack(pack, packageManager = 'npm') {
|
|||||||
if (pack === 'node') {
|
if (pack === 'node') {
|
||||||
return {
|
return {
|
||||||
...metaData,
|
...metaData,
|
||||||
installCommand: null,
|
...defaultBuildAndDeploy(packageManager),
|
||||||
buildCommand: null,
|
buildCommand: null,
|
||||||
startCommand: null,
|
startCommand: null,
|
||||||
publishDirectory: null,
|
publishDirectory: null,
|
||||||
|
|||||||
@@ -58,29 +58,22 @@ export async function removeApplication({ id, teamId }) {
|
|||||||
const id = containerObj.ID;
|
const id = containerObj.ID;
|
||||||
const preview = containerObj.Image.split('-')[1];
|
const preview = containerObj.Image.split('-')[1];
|
||||||
await removeDestinationDocker({ id, engine: destinationDocker.engine });
|
await removeDestinationDocker({ id, engine: destinationDocker.engine });
|
||||||
try {
|
|
||||||
if (preview) {
|
|
||||||
await removeProxyConfiguration({ domain: `${preview}.${domain}` });
|
|
||||||
} else {
|
|
||||||
await removeProxyConfiguration({ domain });
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await prisma.applicationSettings.deleteMany({ where: { application: { id } } });
|
await prisma.applicationSettings.deleteMany({ where: { application: { id } } });
|
||||||
await prisma.buildLog.deleteMany({ where: { applicationId: id } });
|
await prisma.buildLog.deleteMany({ where: { applicationId: id } });
|
||||||
|
await prisma.build.deleteMany({ where: { applicationId: id } });
|
||||||
await prisma.secret.deleteMany({ where: { applicationId: id } });
|
await prisma.secret.deleteMany({ where: { applicationId: id } });
|
||||||
|
await prisma.applicationPersistentStorage.deleteMany({ where: { applicationId: id } });
|
||||||
await prisma.application.deleteMany({ where: { id, teams: { some: { id: teamId } } } });
|
await prisma.application.deleteMany({ where: { id, teams: { some: { id: teamId } } } });
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getApplicationWebhook({ projectId, branch }) {
|
export async function getApplicationWebhook({ projectId, branch }) {
|
||||||
try {
|
try {
|
||||||
let body = await prisma.application.findFirst({
|
let application = await prisma.application.findFirst({
|
||||||
where: { projectId, branch },
|
where: { projectId, branch, settings: { autodeploy: true } },
|
||||||
include: {
|
include: {
|
||||||
destinationDocker: true,
|
destinationDocker: true,
|
||||||
settings: true,
|
settings: true,
|
||||||
@@ -88,30 +81,41 @@ export async function getApplicationWebhook({ projectId, branch }) {
|
|||||||
secrets: true
|
secrets: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (!application) {
|
||||||
if (body.gitSource?.githubApp?.clientSecret) {
|
return null;
|
||||||
body.gitSource.githubApp.clientSecret = decrypt(body.gitSource.githubApp.clientSecret);
|
|
||||||
}
|
}
|
||||||
if (body.gitSource?.githubApp?.webhookSecret) {
|
if (application?.gitSource?.githubApp?.clientSecret) {
|
||||||
body.gitSource.githubApp.webhookSecret = decrypt(body.gitSource.githubApp.webhookSecret);
|
application.gitSource.githubApp.clientSecret = decrypt(
|
||||||
|
application.gitSource.githubApp.clientSecret
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (body.gitSource?.githubApp?.privateKey) {
|
if (application?.gitSource?.githubApp?.webhookSecret) {
|
||||||
body.gitSource.githubApp.privateKey = decrypt(body.gitSource.githubApp.privateKey);
|
application.gitSource.githubApp.webhookSecret = decrypt(
|
||||||
|
application.gitSource.githubApp.webhookSecret
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (body?.gitSource?.gitlabApp?.appSecret) {
|
if (application?.gitSource?.githubApp?.privateKey) {
|
||||||
body.gitSource.gitlabApp.appSecret = decrypt(body.gitSource.gitlabApp.appSecret);
|
application.gitSource.githubApp.privateKey = decrypt(
|
||||||
|
application.gitSource.githubApp.privateKey
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (body?.gitSource?.gitlabApp?.webhookToken) {
|
if (application?.gitSource?.gitlabApp?.appSecret) {
|
||||||
body.gitSource.gitlabApp.webhookToken = decrypt(body.gitSource.gitlabApp.webhookToken);
|
application.gitSource.gitlabApp.appSecret = decrypt(
|
||||||
|
application.gitSource.gitlabApp.appSecret
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (body?.secrets.length > 0) {
|
if (application?.gitSource?.gitlabApp?.webhookToken) {
|
||||||
body.secrets = body.secrets.map((s) => {
|
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);
|
s.value = decrypt(s.value);
|
||||||
return s;
|
return s;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return { ...application };
|
||||||
return { ...body };
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw { status: 404, body: { message: e.message } };
|
throw { status: 404, body: { message: e.message } };
|
||||||
}
|
}
|
||||||
@@ -131,7 +135,8 @@ export async function getApplication({ id, teamId }) {
|
|||||||
destinationDocker: true,
|
destinationDocker: true,
|
||||||
settings: true,
|
settings: true,
|
||||||
gitSource: { include: { githubApp: true, gitlabApp: true } },
|
gitSource: { include: { githubApp: true, gitlabApp: true } },
|
||||||
secrets: true
|
secrets: true,
|
||||||
|
persistentStorage: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -157,24 +162,41 @@ export async function getApplication({ id, teamId }) {
|
|||||||
return { ...body };
|
return { ...body };
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function configureGitRepository({ id, repository, branch, projectId, webhookToken }) {
|
export async function configureGitRepository({
|
||||||
|
id,
|
||||||
|
repository,
|
||||||
|
branch,
|
||||||
|
projectId,
|
||||||
|
webhookToken,
|
||||||
|
autodeploy
|
||||||
|
}) {
|
||||||
if (webhookToken) {
|
if (webhookToken) {
|
||||||
const encryptedWebhookToken = encrypt(webhookToken);
|
const encryptedWebhookToken = encrypt(webhookToken);
|
||||||
return await prisma.application.update({
|
await prisma.application.update({
|
||||||
where: { id },
|
where: { id },
|
||||||
data: {
|
data: {
|
||||||
repository,
|
repository,
|
||||||
branch,
|
branch,
|
||||||
projectId,
|
projectId,
|
||||||
gitSource: { update: { gitlabApp: { update: { webhookToken: encryptedWebhookToken } } } }
|
gitSource: { update: { gitlabApp: { update: { webhookToken: encryptedWebhookToken } } } },
|
||||||
|
settings: { update: { autodeploy } }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return await prisma.application.update({
|
await prisma.application.update({
|
||||||
where: { id },
|
where: { id },
|
||||||
data: { repository, branch, projectId }
|
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 }) {
|
export async function configureBuildPack({ id, buildPack }) {
|
||||||
@@ -209,10 +231,14 @@ export async function configureApplication({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function setApplicationSettings({ id, debug, previews, dualCerts }) {
|
export async function checkDoubleBranch(branch, projectId) {
|
||||||
|
const applications = await prisma.application.findMany({ where: { branch, projectId } });
|
||||||
|
return applications.length > 1;
|
||||||
|
}
|
||||||
|
export async function setApplicationSettings({ id, debug, previews, dualCerts, autodeploy }) {
|
||||||
return await prisma.application.update({
|
return await prisma.application.update({
|
||||||
where: { id },
|
where: { id },
|
||||||
data: { settings: { update: { debug, previews, dualCerts } } },
|
data: { settings: { update: { debug, previews, dualCerts, autodeploy } } },
|
||||||
include: { destinationDocker: true }
|
include: { destinationDocker: true }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -239,3 +265,7 @@ export async function createBuild({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getPersistentStorage(id) {
|
||||||
|
return await prisma.applicationPersistentStorage.findMany({ where: { applicationId: id } });
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ export async function isDockerNetworkExists({ network }) {
|
|||||||
return await prisma.destinationDocker.findFirst({ where: { network } });
|
return await prisma.destinationDocker.findFirst({ where: { network } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function isServiceSecretExists({ id, name }) {
|
||||||
|
return await prisma.serviceSecret.findFirst({ where: { name, serviceId: id } });
|
||||||
|
}
|
||||||
export async function isSecretExists({ id, name, isPRMRSecret }) {
|
export async function isSecretExists({ id, name, isPRMRSecret }) {
|
||||||
return await prisma.secret.findFirst({ where: { name, applicationId: id, isPRMRSecret } });
|
return await prisma.secret.findFirst({ where: { name, applicationId: id, isPRMRSecret } });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,6 +156,15 @@ export const supportedServiceTypesAndVersions = [
|
|||||||
ports: {
|
ports: {
|
||||||
main: 80
|
main: 80
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'languagetool',
|
||||||
|
fancyName: 'LanguageTool',
|
||||||
|
baseImage: 'silviof/docker-languagetool',
|
||||||
|
versions: ['latest'],
|
||||||
|
ports: {
|
||||||
|
main: 8010
|
||||||
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,19 @@
|
|||||||
import { encrypt, decrypt } from '$lib/crypto';
|
import { encrypt, decrypt } from '$lib/crypto';
|
||||||
import { prisma } from './common';
|
import { prisma } from './common';
|
||||||
|
|
||||||
|
export async function listServiceSecrets(serviceId: string) {
|
||||||
|
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) {
|
export async function listSecrets(applicationId: string) {
|
||||||
let secrets = await prisma.secret.findMany({
|
let secrets = await prisma.secret.findMany({
|
||||||
where: { applicationId },
|
where: { applicationId },
|
||||||
@@ -14,6 +27,12 @@ export async function listSecrets(applicationId: string) {
|
|||||||
return secrets;
|
return secrets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function createServiceSecret({ id, name, value }) {
|
||||||
|
value = encrypt(value);
|
||||||
|
return await prisma.serviceSecret.create({
|
||||||
|
data: { name, value, service: { connect: { id } } }
|
||||||
|
});
|
||||||
|
}
|
||||||
export async function createSecret({ id, name, value, isBuildSecret, isPRMRSecret }) {
|
export async function createSecret({ id, name, value, isBuildSecret, isPRMRSecret }) {
|
||||||
value = encrypt(value);
|
value = encrypt(value);
|
||||||
return await prisma.secret.create({
|
return await prisma.secret.create({
|
||||||
@@ -21,10 +40,24 @@ export async function createSecret({ id, name, value, isBuildSecret, isPRMRSecre
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function updateServiceSecret({ id, name, value }) {
|
||||||
|
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 }) {
|
export async function updateSecret({ id, name, value, isBuildSecret, isPRMRSecret }) {
|
||||||
value = encrypt(value);
|
value = encrypt(value);
|
||||||
const found = await prisma.secret.findFirst({ where: { applicationId: id, name, isPRMRSecret } });
|
const found = await prisma.secret.findFirst({ where: { applicationId: id, name, isPRMRSecret } });
|
||||||
console.log(found);
|
|
||||||
|
|
||||||
if (found) {
|
if (found) {
|
||||||
return await prisma.secret.updateMany({
|
return await prisma.secret.updateMany({
|
||||||
@@ -38,6 +71,10 @@ export async function updateSecret({ id, name, value, isBuildSecret, isPRMRSecre
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function removeServiceSecret({ id, name }) {
|
||||||
|
return await prisma.serviceSecret.deleteMany({ where: { serviceId: id, name } });
|
||||||
|
}
|
||||||
|
|
||||||
export async function removeSecret({ id, name }) {
|
export async function removeSecret({ id, name }) {
|
||||||
return await prisma.secret.deleteMany({ where: { applicationId: id, name } });
|
return await prisma.secret.deleteMany({ where: { applicationId: id, name } });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ export async function getService({ id, teamId }) {
|
|||||||
plausibleAnalytics: true,
|
plausibleAnalytics: true,
|
||||||
minio: true,
|
minio: true,
|
||||||
vscodeserver: true,
|
vscodeserver: true,
|
||||||
wordpress: true
|
wordpress: true,
|
||||||
|
serviceSecret: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -42,6 +43,12 @@ export async function getService({ id, teamId }) {
|
|||||||
if (body.wordpress?.mysqlRootUserPassword)
|
if (body.wordpress?.mysqlRootUserPassword)
|
||||||
body.wordpress.mysqlRootUserPassword = decrypt(body.wordpress.mysqlRootUserPassword);
|
body.wordpress.mysqlRootUserPassword = decrypt(body.wordpress.mysqlRootUserPassword);
|
||||||
|
|
||||||
|
if (body?.serviceSecret.length > 0) {
|
||||||
|
body.serviceSecret = body.serviceSecret.map((s) => {
|
||||||
|
s.value = decrypt(s.value);
|
||||||
|
return s;
|
||||||
|
});
|
||||||
|
}
|
||||||
return { ...body };
|
return { ...body };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,6 +112,13 @@ export async function configureServiceType({ id, type }) {
|
|||||||
type
|
type
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else if (type === 'languagetool') {
|
||||||
|
await prisma.service.update({
|
||||||
|
where: { id },
|
||||||
|
data: {
|
||||||
|
type
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export async function setServiceVersion({ id, version }) {
|
export async function setServiceVersion({ id, version }) {
|
||||||
@@ -128,6 +142,9 @@ export async function updatePlausibleAnalyticsService({ id, fqdn, email, usernam
|
|||||||
export async function updateNocoDbOrMinioService({ id, fqdn, name }) {
|
export async function updateNocoDbOrMinioService({ id, fqdn, name }) {
|
||||||
return await prisma.service.update({ where: { id }, data: { fqdn, name } });
|
return await prisma.service.update({ where: { id }, data: { fqdn, name } });
|
||||||
}
|
}
|
||||||
|
export async function updateLanguageToolService({ id, fqdn, name }) {
|
||||||
|
return await prisma.service.update({ where: { id }, data: { fqdn, name } });
|
||||||
|
}
|
||||||
export async function updateVaultWardenService({ id, fqdn, name }) {
|
export async function updateVaultWardenService({ id, fqdn, name }) {
|
||||||
return await prisma.service.update({ where: { id }, data: { fqdn, name } });
|
return await prisma.service.update({ where: { id }, data: { fqdn, name } });
|
||||||
}
|
}
|
||||||
@@ -149,5 +166,7 @@ export async function removeService({ id }) {
|
|||||||
await prisma.minio.deleteMany({ where: { serviceId: id } });
|
await prisma.minio.deleteMany({ where: { serviceId: id } });
|
||||||
await prisma.vscodeserver.deleteMany({ where: { serviceId: id } });
|
await prisma.vscodeserver.deleteMany({ where: { serviceId: id } });
|
||||||
await prisma.wordpress.deleteMany({ where: { serviceId: id } });
|
await prisma.wordpress.deleteMany({ where: { serviceId: id } });
|
||||||
|
await prisma.serviceSecret.deleteMany({ where: { serviceId: id } });
|
||||||
|
|
||||||
await prisma.service.delete({ where: { id } });
|
await prisma.service.delete({ where: { id } });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import Dockerode from 'dockerode';
|
import Dockerode from 'dockerode';
|
||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
|
import { checkPnpm } from './buildPacks/common';
|
||||||
import { saveBuildLog } from './common';
|
import { saveBuildLog } from './common';
|
||||||
|
|
||||||
export async function buildCacheImageWithNode(data, imageForBuild) {
|
export async function buildCacheImageWithNode(data, imageForBuild) {
|
||||||
@@ -16,9 +17,10 @@ export async function buildCacheImageWithNode(data, imageForBuild) {
|
|||||||
secrets,
|
secrets,
|
||||||
pullmergeRequestId
|
pullmergeRequestId
|
||||||
} = data;
|
} = data;
|
||||||
|
const isPnpm = checkPnpm(installCommand, buildCommand);
|
||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
Dockerfile.push(`FROM ${imageForBuild}`);
|
Dockerfile.push(`FROM ${imageForBuild}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push(`LABEL coolify.image=true`);
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
if (secrets.length > 0) {
|
if (secrets.length > 0) {
|
||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
@@ -35,20 +37,14 @@ export async function buildCacheImageWithNode(data, imageForBuild) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// TODO: If build command defined, install command should be the default yarn install
|
if (isPnpm) {
|
||||||
|
Dockerfile.push('RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm');
|
||||||
|
Dockerfile.push('RUN pnpm add -g pnpm');
|
||||||
|
}
|
||||||
|
Dockerfile.push(`COPY .${baseDirectory || ''} ./`);
|
||||||
if (installCommand) {
|
if (installCommand) {
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}package*.json ./`);
|
|
||||||
try {
|
|
||||||
await fs.stat(`${workdir}/yarn.lock`);
|
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}yarn.lock ./`);
|
|
||||||
} catch (error) {}
|
|
||||||
try {
|
|
||||||
await fs.stat(`${workdir}/pnpm-lock.yaml`);
|
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''}pnpm-lock.yaml ./`);
|
|
||||||
} catch (error) {}
|
|
||||||
Dockerfile.push(`RUN ${installCommand}`);
|
Dockerfile.push(`RUN ${installCommand}`);
|
||||||
}
|
}
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''} ./`);
|
|
||||||
Dockerfile.push(`RUN ${buildCommand}`);
|
Dockerfile.push(`RUN ${buildCommand}`);
|
||||||
await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));
|
await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));
|
||||||
await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });
|
await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });
|
||||||
@@ -69,14 +65,14 @@ export async function buildCacheImageWithCargo(data, imageForBuild) {
|
|||||||
} = data;
|
} = data;
|
||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
Dockerfile.push(`FROM ${imageForBuild} as planner-${applicationId}`);
|
Dockerfile.push(`FROM ${imageForBuild} as planner-${applicationId}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push('RUN cargo install cargo-chef');
|
Dockerfile.push('RUN cargo install cargo-chef');
|
||||||
Dockerfile.push('COPY . .');
|
Dockerfile.push('COPY . .');
|
||||||
Dockerfile.push('RUN cargo chef prepare --recipe-path recipe.json');
|
Dockerfile.push('RUN cargo chef prepare --recipe-path recipe.json');
|
||||||
Dockerfile.push(`FROM ${imageForBuild}`);
|
Dockerfile.push(`FROM ${imageForBuild}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /app');
|
||||||
Dockerfile.push('RUN cargo install cargo-chef');
|
Dockerfile.push('RUN cargo install cargo-chef');
|
||||||
Dockerfile.push(`COPY --from=planner-${applicationId} /usr/src/app/recipe.json recipe.json`);
|
Dockerfile.push(`COPY --from=planner-${applicationId} /app/recipe.json recipe.json`);
|
||||||
Dockerfile.push('RUN cargo chef cook --release --recipe-path recipe.json');
|
Dockerfile.push('RUN cargo chef cook --release --recipe-path recipe.json');
|
||||||
await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));
|
await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));
|
||||||
await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });
|
await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });
|
||||||
|
|||||||
@@ -112,9 +112,15 @@ export async function haproxyInstance() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function configureHAProxy() {
|
export async function configureHAProxy() {
|
||||||
|
const haproxy = await haproxyInstance();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const haproxy = await haproxyInstance();
|
|
||||||
await checkHAProxy(haproxy);
|
await checkHAProxy(haproxy);
|
||||||
|
} catch (error) {
|
||||||
|
return 'Error: HAProxy is not running';
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const data = {
|
const data = {
|
||||||
applications: [],
|
applications: [],
|
||||||
services: [],
|
services: [],
|
||||||
|
|||||||
@@ -49,7 +49,12 @@ export async function completeTransaction(transactionId) {
|
|||||||
}
|
}
|
||||||
export async function deleteProxy({ id }) {
|
export async function deleteProxy({ id }) {
|
||||||
const haproxy = await haproxyInstance();
|
const haproxy = await haproxyInstance();
|
||||||
await checkHAProxy(haproxy);
|
try {
|
||||||
|
await checkHAProxy(haproxy);
|
||||||
|
} catch (error) {
|
||||||
|
return 'Error: HAProxy is not running';
|
||||||
|
}
|
||||||
|
|
||||||
let transactionId;
|
let transactionId;
|
||||||
try {
|
try {
|
||||||
await haproxy.get(`v2/services/haproxy/configuration/backends/${id}`).json();
|
await haproxy.get(`v2/services/haproxy/configuration/backends/${id}`).json();
|
||||||
@@ -175,11 +180,9 @@ export async function checkContainer(engine, container) {
|
|||||||
const { stdout } = await asyncExecShell(
|
const { stdout } = await asyncExecShell(
|
||||||
`DOCKER_HOST="${host}" docker inspect --format '{{json .State}}' ${container}`
|
`DOCKER_HOST="${host}" docker inspect --format '{{json .State}}' ${container}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const parsedStdout = JSON.parse(stdout);
|
const parsedStdout = JSON.parse(stdout);
|
||||||
const status = parsedStdout.Status;
|
const status = parsedStdout.Status;
|
||||||
const isRunning = parsedStdout.Running;
|
const isRunning = status === 'running' ? true : false;
|
||||||
|
|
||||||
if (status === 'exited' || status === 'created') {
|
if (status === 'exited' || status === 'created') {
|
||||||
await asyncExecShell(`DOCKER_HOST="${host}" docker rm ${container}`);
|
await asyncExecShell(`DOCKER_HOST="${host}" docker rm ${container}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ export default async function ({
|
|||||||
const { stdout: commit } = await asyncExecShell(`cd ${workdir}/ && git rev-parse HEAD`);
|
const { stdout: commit } = await asyncExecShell(`cd ${workdir}/ && git rev-parse HEAD`);
|
||||||
return commit.replace('\n', '');
|
return commit.replace('\n', '');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log({ error });
|
||||||
return ErrorHandler(error);
|
return ErrorHandler(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { asyncExecShell, getDomain, getEngine } from '$lib/common';
|
import { asyncExecShell, getDomain, getEngine } from '$lib/common';
|
||||||
import { checkContainer } from '$lib/haproxy';
|
import { checkContainer, reloadHaproxy } from '$lib/haproxy';
|
||||||
import * as db from '$lib/database';
|
import * as db from '$lib/database';
|
||||||
import { dev } from '$app/env';
|
import { dev } from '$app/env';
|
||||||
import cuid from 'cuid';
|
import cuid from 'cuid';
|
||||||
@@ -48,6 +48,17 @@ export async function letsEncrypt(domain, id = null, isCoolify = false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (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(
|
await asyncExecShell(
|
||||||
`DOCKER_HOST=${host} docker run --rm --name certbot-${randomCuid} -p 9080:${randomPort} -v "coolify-letsencrypt:/etc/letsencrypt" certbot/certbot --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 ${
|
`DOCKER_HOST=${host} docker run --rm --name certbot-${randomCuid} -p 9080:${randomPort} -v "coolify-letsencrypt:/etc/letsencrypt" certbot/certbot --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' : ''
|
dev ? '--test-cert' : ''
|
||||||
@@ -56,7 +67,18 @@ export async function letsEncrypt(domain, id = null, isCoolify = false) {
|
|||||||
await asyncExecShell(
|
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"`
|
`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 {
|
} 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(
|
await asyncExecShell(
|
||||||
`DOCKER_HOST=${host} docker run --rm --name certbot-${randomCuid} -p 9080:${randomPort} -v "coolify-letsencrypt:/etc/letsencrypt" certbot/certbot --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 ${
|
`DOCKER_HOST=${host} docker run --rm --name certbot-${randomCuid} -p 9080:${randomPort} -v "coolify-letsencrypt:/etc/letsencrypt" certbot/certbot --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' : ''
|
dev ? '--test-cert' : ''
|
||||||
@@ -65,6 +87,7 @@ export async function letsEncrypt(domain, id = null, isCoolify = false) {
|
|||||||
await asyncExecShell(
|
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"`
|
`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) {
|
} catch (error) {
|
||||||
if (error.code !== 0) {
|
if (error.code !== 0) {
|
||||||
@@ -76,37 +99,42 @@ export async function letsEncrypt(domain, id = null, isCoolify = false) {
|
|||||||
export async function generateSSLCerts() {
|
export async function generateSSLCerts() {
|
||||||
const ssls = [];
|
const ssls = [];
|
||||||
const applications = await db.prisma.application.findMany({
|
const applications = await db.prisma.application.findMany({
|
||||||
include: { destinationDocker: true, settings: true }
|
include: { destinationDocker: true, settings: true },
|
||||||
|
orderBy: { createdAt: 'desc' }
|
||||||
});
|
});
|
||||||
for (const application of applications) {
|
for (const application of applications) {
|
||||||
const {
|
try {
|
||||||
fqdn,
|
const {
|
||||||
id,
|
fqdn,
|
||||||
destinationDocker: { engine, network },
|
id,
|
||||||
settings: { previews }
|
destinationDocker: { engine, network },
|
||||||
} = application;
|
settings: { previews }
|
||||||
const isRunning = await checkContainer(engine, id);
|
} = application;
|
||||||
const domain = getDomain(fqdn);
|
const isRunning = await checkContainer(engine, id);
|
||||||
const isHttps = fqdn.startsWith('https://');
|
const domain = getDomain(fqdn);
|
||||||
if (isRunning) {
|
const isHttps = fqdn.startsWith('https://');
|
||||||
if (isHttps) ssls.push({ domain, id, isCoolify: false });
|
if (isRunning) {
|
||||||
}
|
if (isHttps) ssls.push({ domain, id, isCoolify: false });
|
||||||
if (previews) {
|
}
|
||||||
const host = getEngine(engine);
|
if (previews) {
|
||||||
const { stdout } = await asyncExecShell(
|
const host = getEngine(engine);
|
||||||
`DOCKER_HOST=${host} docker container ls --filter="status=running" --filter="network=${network}" --filter="name=${id}-" --format="{{json .Names}}"`
|
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()
|
const containers = stdout
|
||||||
.split('\n')
|
.trim()
|
||||||
.filter((a) => a)
|
.split('\n')
|
||||||
.map((c) => c.replace(/"/g, ''));
|
.filter((a) => a)
|
||||||
if (containers.length > 0) {
|
.map((c) => c.replace(/"/g, ''));
|
||||||
for (const container of containers) {
|
if (containers.length > 0) {
|
||||||
let previewDomain = `${container.split('-')[1]}.${domain}`;
|
for (const container of containers) {
|
||||||
if (isHttps) ssls.push({ domain: previewDomain, id, isCoolify: false });
|
let 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 db.prisma.service.findMany({
|
const services = await db.prisma.service.findMany({
|
||||||
@@ -116,24 +144,29 @@ export async function generateSSLCerts() {
|
|||||||
plausibleAnalytics: true,
|
plausibleAnalytics: true,
|
||||||
vscodeserver: true,
|
vscodeserver: true,
|
||||||
wordpress: true
|
wordpress: true
|
||||||
}
|
},
|
||||||
|
orderBy: { createdAt: 'desc' }
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const service of services) {
|
for (const service of services) {
|
||||||
const {
|
try {
|
||||||
fqdn,
|
const {
|
||||||
id,
|
fqdn,
|
||||||
type,
|
id,
|
||||||
destinationDocker: { engine }
|
type,
|
||||||
} = service;
|
destinationDocker: { engine }
|
||||||
const found = db.supportedServiceTypesAndVersions.find((a) => a.name === type);
|
} = service;
|
||||||
if (found) {
|
const found = db.supportedServiceTypesAndVersions.find((a) => a.name === type);
|
||||||
const domain = getDomain(fqdn);
|
if (found) {
|
||||||
const isHttps = fqdn.startsWith('https://');
|
const domain = getDomain(fqdn);
|
||||||
const isRunning = await checkContainer(engine, id);
|
const isHttps = fqdn.startsWith('https://');
|
||||||
if (isRunning) {
|
const isRunning = await checkContainer(engine, id);
|
||||||
if (isHttps) ssls.push({ domain, id, isCoolify: false });
|
if (isRunning) {
|
||||||
|
if (isHttps) ssls.push({ domain, id, isCoolify: false });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(`Error during generateSSLCerts with ${service.fqdn}: ${error}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const { fqdn } = await db.prisma.setting.findFirst();
|
const { fqdn } = await db.prisma.setting.findFirst();
|
||||||
@@ -145,9 +178,10 @@ export async function generateSSLCerts() {
|
|||||||
if (ssls.length > 0) {
|
if (ssls.length > 0) {
|
||||||
for (const ssl of ssls) {
|
for (const ssl of ssls) {
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
|
console.log('Checking SSL for', ssl.domain);
|
||||||
await letsEncrypt(ssl.domain, ssl.id, ssl.isCoolify);
|
await letsEncrypt(ssl.domain, ssl.id, ssl.isCoolify);
|
||||||
} else {
|
} else {
|
||||||
console.log('Generate ssl for', ssl.domain);
|
console.log('Checking SSL for', ssl.domain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,14 @@ import fs from 'fs/promises';
|
|||||||
import * as buildpacks from '../buildPacks';
|
import * as buildpacks from '../buildPacks';
|
||||||
import * as importers from '../importers';
|
import * as importers from '../importers';
|
||||||
import { dockerInstance } from '../docker';
|
import { dockerInstance } from '../docker';
|
||||||
import { asyncExecShell, createDirectories, getDomain, getEngine, saveBuildLog } from '../common';
|
import {
|
||||||
|
asyncExecShell,
|
||||||
|
asyncSleep,
|
||||||
|
createDirectories,
|
||||||
|
getDomain,
|
||||||
|
getEngine,
|
||||||
|
saveBuildLog
|
||||||
|
} from '../common';
|
||||||
import * as db from '$lib/database';
|
import * as db from '$lib/database';
|
||||||
import { decrypt } from '$lib/crypto';
|
import { decrypt } from '$lib/crypto';
|
||||||
import { sentry } from '$lib/common';
|
import { sentry } from '$lib/common';
|
||||||
@@ -12,7 +19,7 @@ import {
|
|||||||
makeLabelForStandaloneApplication,
|
makeLabelForStandaloneApplication,
|
||||||
setDefaultConfiguration
|
setDefaultConfiguration
|
||||||
} from '$lib/buildPacks/common';
|
} from '$lib/buildPacks/common';
|
||||||
import { letsEncrypt } from '$lib/letsencrypt';
|
import yaml from 'js-yaml';
|
||||||
|
|
||||||
export default async function (job) {
|
export default async function (job) {
|
||||||
/*
|
/*
|
||||||
@@ -39,17 +46,34 @@ export default async function (job) {
|
|||||||
publishDirectory,
|
publishDirectory,
|
||||||
projectId,
|
projectId,
|
||||||
secrets,
|
secrets,
|
||||||
|
phpModules,
|
||||||
type,
|
type,
|
||||||
pullmergeRequestId = null,
|
pullmergeRequestId = null,
|
||||||
sourceBranch = null,
|
sourceBranch = null,
|
||||||
settings
|
settings,
|
||||||
|
persistentStorage
|
||||||
} = job.data;
|
} = job.data;
|
||||||
const { debug } = settings;
|
const { debug } = settings;
|
||||||
|
|
||||||
|
await asyncSleep(1000);
|
||||||
|
|
||||||
|
await db.prisma.build.updateMany({
|
||||||
|
where: {
|
||||||
|
status: 'queued',
|
||||||
|
id: { not: buildId },
|
||||||
|
applicationId,
|
||||||
|
createdAt: { lt: new Date(new Date().getTime() - 60 * 60 * 1000) }
|
||||||
|
},
|
||||||
|
data: { status: 'failed' }
|
||||||
|
});
|
||||||
let imageId = applicationId;
|
let imageId = applicationId;
|
||||||
let domain = getDomain(fqdn);
|
let domain = getDomain(fqdn);
|
||||||
const isHttps = fqdn.startsWith('https://');
|
let 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
|
// Previews, we need to get the source branch and set subdomain
|
||||||
if (pullmergeRequestId) {
|
if (pullmergeRequestId) {
|
||||||
branch = sourceBranch;
|
branch = sourceBranch;
|
||||||
@@ -67,17 +91,8 @@ export default async function (job) {
|
|||||||
const docker = dockerInstance({ destinationDocker });
|
const docker = dockerInstance({ destinationDocker });
|
||||||
const host = getEngine(destinationDocker.engine);
|
const host = getEngine(destinationDocker.engine);
|
||||||
|
|
||||||
const build = await db.createBuild({
|
await db.prisma.build.update({ where: { id: buildId }, data: { status: 'running' } });
|
||||||
id: buildId,
|
const { workdir, repodir } = await createDirectories({ repository, buildId });
|
||||||
applicationId,
|
|
||||||
destinationDockerId: destinationDocker.id,
|
|
||||||
gitSourceId: gitSource.id,
|
|
||||||
githubAppId: gitSource.githubApp?.id,
|
|
||||||
gitlabAppId: gitSource.gitlabApp?.id,
|
|
||||||
type
|
|
||||||
});
|
|
||||||
|
|
||||||
const { workdir, repodir } = await createDirectories({ repository, buildId: build.id });
|
|
||||||
|
|
||||||
const configuration = await setDefaultConfiguration(job.data);
|
const configuration = await setDefaultConfiguration(job.data);
|
||||||
|
|
||||||
@@ -87,6 +102,7 @@ export default async function (job) {
|
|||||||
startCommand = configuration.startCommand;
|
startCommand = configuration.startCommand;
|
||||||
buildCommand = configuration.buildCommand;
|
buildCommand = configuration.buildCommand;
|
||||||
publishDirectory = configuration.publishDirectory;
|
publishDirectory = configuration.publishDirectory;
|
||||||
|
baseDirectory = configuration.baseDirectory;
|
||||||
|
|
||||||
let commit = await importers[gitSource.type]({
|
let commit = await importers[gitSource.type]({
|
||||||
applicationId,
|
applicationId,
|
||||||
@@ -97,19 +113,22 @@ export default async function (job) {
|
|||||||
gitlabAppId: gitSource.gitlabApp?.id,
|
gitlabAppId: gitSource.gitlabApp?.id,
|
||||||
repository,
|
repository,
|
||||||
branch,
|
branch,
|
||||||
buildId: build.id,
|
buildId,
|
||||||
apiUrl: gitSource.apiUrl,
|
apiUrl: gitSource.apiUrl,
|
||||||
projectId,
|
projectId,
|
||||||
deployKeyId: gitSource.gitlabApp?.deployKeyId || null,
|
deployKeyId: gitSource.gitlabApp?.deployKeyId || null,
|
||||||
privateSshKey: decrypt(gitSource.gitlabApp?.privateSshKey) || null
|
privateSshKey: decrypt(gitSource.gitlabApp?.privateSshKey) || null
|
||||||
});
|
});
|
||||||
|
if (!commit) {
|
||||||
|
throw new Error('No commit found?');
|
||||||
|
}
|
||||||
let tag = commit.slice(0, 7);
|
let tag = commit.slice(0, 7);
|
||||||
if (pullmergeRequestId) {
|
if (pullmergeRequestId) {
|
||||||
tag = `${commit.slice(0, 7)}-${pullmergeRequestId}`;
|
tag = `${commit.slice(0, 7)}-${pullmergeRequestId}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await db.prisma.build.update({ where: { id: build.id }, data: { commit } });
|
db.prisma.build.update({ where: { id: buildId }, data: { commit } });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
@@ -160,7 +179,7 @@ export default async function (job) {
|
|||||||
await copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId);
|
await copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId);
|
||||||
if (buildpacks[buildPack])
|
if (buildpacks[buildPack])
|
||||||
await buildpacks[buildPack]({
|
await buildpacks[buildPack]({
|
||||||
buildId: build.id,
|
buildId,
|
||||||
applicationId,
|
applicationId,
|
||||||
domain,
|
domain,
|
||||||
name,
|
name,
|
||||||
@@ -181,7 +200,8 @@ export default async function (job) {
|
|||||||
buildCommand,
|
buildCommand,
|
||||||
startCommand,
|
startCommand,
|
||||||
baseDirectory,
|
baseDirectory,
|
||||||
secrets
|
secrets,
|
||||||
|
phpModules
|
||||||
});
|
});
|
||||||
else {
|
else {
|
||||||
saveBuildLog({ line: `Build pack ${buildPack} not found`, buildId, applicationId });
|
saveBuildLog({ line: `Build pack ${buildPack} not found`, buildId, applicationId });
|
||||||
@@ -241,14 +261,53 @@ export default async function (job) {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
saveBuildLog({ line: 'Deployment started.', buildId, applicationId });
|
saveBuildLog({ line: 'Deployment started.', buildId, applicationId });
|
||||||
const { stderr } = await asyncExecShell(
|
// for await (const volume of volumes) {
|
||||||
`DOCKER_HOST=${host} docker run ${envFound && `--env-file=${workdir}/.env`} ${labels.join(
|
// const id = volume.split(':')[0];
|
||||||
' '
|
// try {
|
||||||
)} --name ${imageId} --network ${
|
// await asyncExecShell(`DOCKER_HOST=${host} docker volume inspect ${id}`);
|
||||||
docker.network
|
// } catch (error) {
|
||||||
} --restart always -d ${applicationId}:${tag}`
|
// await asyncExecShell(`DOCKER_HOST=${host} docker volume create ${id}`);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
const composeVolumes = volumes.map((volume) => {
|
||||||
|
return {
|
||||||
|
[`${volume.split(':')[0]}`]: {
|
||||||
|
name: volume.split(':')[0]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const compose = {
|
||||||
|
version: '3.8',
|
||||||
|
services: {
|
||||||
|
[imageId]: {
|
||||||
|
image: `${applicationId}:${tag}`,
|
||||||
|
container_name: imageId,
|
||||||
|
volumes,
|
||||||
|
env_file: envFound ? [`${workdir}/.env`] : [],
|
||||||
|
networks: [docker.network],
|
||||||
|
labels: labels,
|
||||||
|
depends_on: [],
|
||||||
|
restart: 'always'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
networks: {
|
||||||
|
[docker.network]: {
|
||||||
|
external: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
volumes: Object.assign({}, ...composeVolumes)
|
||||||
|
};
|
||||||
|
await fs.writeFile(`${workdir}/docker-compose.yml`, yaml.dump(compose));
|
||||||
|
await asyncExecShell(
|
||||||
|
`DOCKER_HOST=${host} docker compose --project-directory ${workdir} up -d`
|
||||||
);
|
);
|
||||||
if (stderr) console.log(stderr);
|
|
||||||
|
// const { stderr } = await asyncExecShell(
|
||||||
|
// `DOCKER_HOST=${host} docker run ${envFound && `--env-file=${workdir}/.env`} ${labels.join(
|
||||||
|
// ' '
|
||||||
|
// )} --name ${imageId} --network ${docker.network} --restart always ${volumes.length > 0 ? volumes : ''
|
||||||
|
// } -d ${applicationId}:${tag}`
|
||||||
|
// );
|
||||||
saveBuildLog({ line: 'Deployment successful!', buildId, applicationId });
|
saveBuildLog({ line: 'Deployment successful!', buildId, applicationId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
saveBuildLog({ line: error, buildId, applicationId });
|
saveBuildLog({ line: error, buildId, applicationId });
|
||||||
|
|||||||
@@ -1,12 +1,33 @@
|
|||||||
import { dev } from '$app/env';
|
import { dev } from '$app/env';
|
||||||
import { asyncExecShell, getEngine } from '$lib/common';
|
import { asyncExecShell, getEngine, version } from '$lib/common';
|
||||||
import { prisma } from '$lib/database';
|
import { prisma } from '$lib/database';
|
||||||
import { defaultProxyImageHttp, defaultProxyImageTcp } from '$lib/haproxy';
|
import { defaultProxyImageHttp, defaultProxyImageTcp } from '$lib/haproxy';
|
||||||
|
|
||||||
export default async function () {
|
export default async function () {
|
||||||
const destinationDockers = await prisma.destinationDocker.findMany();
|
const destinationDockers = await prisma.destinationDocker.findMany();
|
||||||
for (const destinationDocker of destinationDockers) {
|
for (const destinationDocker of destinationDockers) {
|
||||||
const host = getEngine(destinationDocker.engine);
|
const host = getEngine(destinationDocker.engine);
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
// Tagging images with labels
|
// Tagging images with labels
|
||||||
// try {
|
// try {
|
||||||
// const images = [
|
// const images = [
|
||||||
@@ -30,16 +51,6 @@ export default async function () {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// } catch (error) {}
|
// } catch (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);
|
|
||||||
}
|
|
||||||
// if (!dev) {
|
// if (!dev) {
|
||||||
// // Cleanup images that are not managed by coolify
|
// // Cleanup images that are not managed by coolify
|
||||||
// try {
|
// try {
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ const cron = async () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await queue.proxy.add('proxy', {}, { repeat: { every: 10000 } });
|
await queue.proxy.add('proxy', {}, { repeat: { every: 10000 } });
|
||||||
await queue.ssl.add('ssl', {}, { repeat: { every: 60000 } });
|
await queue.ssl.add('ssl', {}, { repeat: { every: dev ? 10000 : 60000 } });
|
||||||
await queue.cleanup.add('cleanup', {}, { repeat: { every: 600000 } });
|
if (!dev) await queue.cleanup.add('cleanup', {}, { repeat: { every: 300000 } });
|
||||||
await queue.sslRenew.add('sslRenew', {}, { repeat: { every: 1800000 } });
|
await queue.sslRenew.add('sslRenew', {}, { repeat: { every: 1800000 } });
|
||||||
|
|
||||||
const events = {
|
const events = {
|
||||||
@@ -110,18 +110,18 @@ cron().catch((error) => {
|
|||||||
const buildQueueName = 'build_queue';
|
const buildQueueName = 'build_queue';
|
||||||
const buildQueue = new Queue(buildQueueName, connectionOptions);
|
const buildQueue = new Queue(buildQueueName, connectionOptions);
|
||||||
const buildWorker = new Worker(buildQueueName, async (job) => await builder(job), {
|
const buildWorker = new Worker(buildQueueName, async (job) => await builder(job), {
|
||||||
concurrency: 2,
|
concurrency: 1,
|
||||||
...connectionOptions
|
...connectionOptions
|
||||||
});
|
});
|
||||||
|
|
||||||
buildWorker.on('completed', async (job: Bullmq.Job) => {
|
buildWorker.on('completed', async (job: Bullmq.Job) => {
|
||||||
try {
|
try {
|
||||||
await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'success' } });
|
await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'success' } });
|
||||||
} catch (err) {
|
} catch (error) {
|
||||||
console.log(err);
|
console.log(error);
|
||||||
} finally {
|
} finally {
|
||||||
const workdir = `/tmp/build-sources/${job.data.repository}/`;
|
const workdir = `/tmp/build-sources/${job.data.repository}/${job.data.build_id}`;
|
||||||
await asyncExecShell(`rm -fr ${workdir}`);
|
if (!dev) await asyncExecShell(`rm -fr ${workdir}`);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
@@ -133,7 +133,7 @@ buildWorker.on('failed', async (job: Bullmq.Job, failedReason) => {
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
} finally {
|
} finally {
|
||||||
const workdir = `/tmp/build-sources/${job.data.repository}`;
|
const workdir = `/tmp/build-sources/${job.data.repository}`;
|
||||||
await asyncExecShell(`rm -fr ${workdir}`);
|
if (!dev) await asyncExecShell(`rm -fr ${workdir}`);
|
||||||
}
|
}
|
||||||
saveBuildLog({
|
saveBuildLog({
|
||||||
line: 'Failed to deploy!',
|
line: 'Failed to deploy!',
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { dev } from '$app/env';
|
|
||||||
import { ErrorHandler } from '$lib/database';
|
import { ErrorHandler } from '$lib/database';
|
||||||
import { configureHAProxy } from '$lib/haproxy/configuration';
|
import { configureHAProxy } from '$lib/haproxy/configuration';
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export default async function () {
|
|||||||
try {
|
try {
|
||||||
return await generateSSLCerts();
|
return await generateSSLCerts();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import { asyncExecShell } from '$lib/common';
|
import { asyncExecShell } from '$lib/common';
|
||||||
|
import { reloadHaproxy } from '$lib/haproxy';
|
||||||
|
|
||||||
export default async function () {
|
export default async function () {
|
||||||
try {
|
try {
|
||||||
return await asyncExecShell(
|
await asyncExecShell(
|
||||||
`docker run --rm --name certbot-renewal -v "coolify-letsencrypt:/etc/letsencrypt" certbot/certbot --logs-dir /etc/letsencrypt/logs renew`
|
`docker run --rm --name certbot-renewal -v "coolify-letsencrypt:/etc/letsencrypt" certbot/certbot --logs-dir /etc/letsencrypt/logs renew`
|
||||||
);
|
);
|
||||||
|
await reloadHaproxy('unix:///var/run/docker.sock');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,13 +63,11 @@
|
|||||||
const data = await get(`/update.json`);
|
const data = await get(`/update.json`);
|
||||||
if (overrideVersion || data?.isUpdateAvailable) {
|
if (overrideVersion || data?.isUpdateAvailable) {
|
||||||
latestVersion = overrideVersion || data.latestVersion;
|
latestVersion = overrideVersion || data.latestVersion;
|
||||||
console.log('checking update');
|
if (overrideVersion) {
|
||||||
const { exists } = await post(`/update.json`, {
|
isUpdateAvailable = true;
|
||||||
type: 'check',
|
} else {
|
||||||
latestVersion,
|
isUpdateAvailable = data.isUpdateAvailable;
|
||||||
overrideVersion
|
}
|
||||||
});
|
|
||||||
isUpdateAvailable = exists;
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -76,6 +76,7 @@
|
|||||||
import { del, post } from '$lib/api';
|
import { del, post } from '$lib/api';
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { gitTokens } from '$lib/store';
|
import { gitTokens } from '$lib/store';
|
||||||
|
import { toast } from '@zerodevx/svelte-toast';
|
||||||
|
|
||||||
if (githubToken) $gitTokens.githubToken = githubToken;
|
if (githubToken) $gitTokens.githubToken = githubToken;
|
||||||
if (gitlabToken) $gitTokens.gitlabToken = gitlabToken;
|
if (gitlabToken) $gitTokens.gitlabToken = gitlabToken;
|
||||||
@@ -86,7 +87,8 @@
|
|||||||
async function handleDeploySubmit() {
|
async function handleDeploySubmit() {
|
||||||
try {
|
try {
|
||||||
const { buildId } = await post(`/applications/${id}/deploy.json`, { ...application });
|
const { buildId } = await post(`/applications/${id}/deploy.json`, { ...application });
|
||||||
return window.location.assign(`/applications/${id}/logs/build?buildId=${buildId}`);
|
toast.push('Deployment queued.');
|
||||||
|
return await goto(`/applications/${id}/logs/build?buildId=${buildId}`);
|
||||||
} catch ({ error }) {
|
} catch ({ error }) {
|
||||||
return errorNotification(error);
|
return errorNotification(error);
|
||||||
}
|
}
|
||||||
@@ -111,8 +113,6 @@
|
|||||||
return window.location.reload();
|
return window.location.reload();
|
||||||
} catch ({ error }) {
|
} catch ({ error }) {
|
||||||
return errorNotification(error);
|
return errorNotification(error);
|
||||||
} finally {
|
|
||||||
loading = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -271,6 +271,35 @@
|
|||||||
</svg></button
|
</svg></button
|
||||||
></a
|
></a
|
||||||
>
|
>
|
||||||
|
<a
|
||||||
|
href="/applications/{id}/storage"
|
||||||
|
sveltekit:prefetch
|
||||||
|
class="hover:text-pink-500 rounded"
|
||||||
|
class:text-pink-500={$page.url.pathname === `/applications/${id}/storage`}
|
||||||
|
class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/storage`}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
title="Persistent Storage"
|
||||||
|
class="icons bg-transparent tooltip-bottom text-sm disabled:text-red-500"
|
||||||
|
data-tooltip="Persistent Storage"
|
||||||
|
>
|
||||||
|
<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" />
|
||||||
|
<ellipse cx="12" cy="6" rx="8" ry="3" />
|
||||||
|
<path d="M4 6v6a8 3 0 0 0 16 0v-6" />
|
||||||
|
<path d="M4 12v6a8 3 0 0 0 16 0v-6" />
|
||||||
|
</svg>
|
||||||
|
</button></a
|
||||||
|
>
|
||||||
<a
|
<a
|
||||||
href="/applications/{id}/previews"
|
href="/applications/{id}/previews"
|
||||||
sveltekit:prefetch
|
sveltekit:prefetch
|
||||||
|
|||||||
@@ -25,9 +25,11 @@
|
|||||||
let selected = {
|
let selected = {
|
||||||
projectId: undefined,
|
projectId: undefined,
|
||||||
repository: undefined,
|
repository: undefined,
|
||||||
branch: undefined
|
branch: undefined,
|
||||||
|
autodeploy: application.settings.autodeploy || true
|
||||||
};
|
};
|
||||||
let showSave = false;
|
let showSave = false;
|
||||||
|
|
||||||
async function loadRepositoriesByPage(page = 0) {
|
async function loadRepositoriesByPage(page = 0) {
|
||||||
return await get(`${apiUrl}/installation/repositories?per_page=100&page=${page}`, {
|
return await get(`${apiUrl}/installation/repositories?per_page=100&page=${page}`, {
|
||||||
Authorization: `token ${$gitTokens.githubToken}`
|
Authorization: `token ${$gitTokens.githubToken}`
|
||||||
@@ -69,7 +71,14 @@
|
|||||||
`/applications/${id}/configuration/repository.json?repository=${selected.repository}&branch=${selected.branch}`
|
`/applications/${id}/configuration/repository.json?repository=${selected.repository}&branch=${selected.branch}`
|
||||||
);
|
);
|
||||||
if (data.used) {
|
if (data.used) {
|
||||||
errorNotification('This branch is already used by another application.');
|
const sure = confirm(
|
||||||
|
`This branch is already used by another application. Webhooks won't work in this case for both applications. Are you sure you want to use it?`
|
||||||
|
);
|
||||||
|
if (sure) {
|
||||||
|
selected.autodeploy = false;
|
||||||
|
showSave = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
showSave = false;
|
showSave = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
let projects = [];
|
let projects = [];
|
||||||
let branches = [];
|
let branches = [];
|
||||||
let showSave = false;
|
let showSave = false;
|
||||||
|
let autodeploy = application.settings.autodeploy || true;
|
||||||
|
|
||||||
let selected = {
|
let selected = {
|
||||||
group: undefined,
|
group: undefined,
|
||||||
@@ -138,7 +139,14 @@
|
|||||||
`/applications/${id}/configuration/repository.json?repository=${selected.project.path_with_namespace}&branch=${selected.branch.name}`
|
`/applications/${id}/configuration/repository.json?repository=${selected.project.path_with_namespace}&branch=${selected.branch.name}`
|
||||||
);
|
);
|
||||||
if (data.used) {
|
if (data.used) {
|
||||||
errorNotification('This branch is already used by another application.');
|
const sure = confirm(
|
||||||
|
`This branch is already used by another application. Webhooks won't work in this case for both applications. Are you sure you want to use it?`
|
||||||
|
);
|
||||||
|
if (sure) {
|
||||||
|
autodeploy = false;
|
||||||
|
showSave = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
showSave = false;
|
showSave = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -235,10 +243,14 @@
|
|||||||
|
|
||||||
const url = `/applications/${id}/configuration/repository.json`;
|
const url = `/applications/${id}/configuration/repository.json`;
|
||||||
try {
|
try {
|
||||||
|
const repository = `${selected.group.full_path.replace('-personal', '')}/${
|
||||||
|
selected.project.name
|
||||||
|
}`;
|
||||||
await post(url, {
|
await post(url, {
|
||||||
repository: `${selected.group.full_path}/${selected.project.name}`,
|
repository,
|
||||||
branch: selected.branch.name,
|
branch: selected.branch.name,
|
||||||
projectId: selected.project.id,
|
projectId: selected.project.id,
|
||||||
|
autodeploy,
|
||||||
webhookToken
|
webhookToken
|
||||||
});
|
});
|
||||||
return await goto(from || `/applications/${id}/configuration/buildpack`);
|
return await goto(from || `/applications/${id}/configuration/buildpack`);
|
||||||
|
|||||||
@@ -30,14 +30,21 @@ export const post: RequestHandler = async (event) => {
|
|||||||
if (status === 401) return { status, body };
|
if (status === 401) return { status, body };
|
||||||
|
|
||||||
const { id } = event.params;
|
const { id } = event.params;
|
||||||
let { repository, branch, projectId, webhookToken } = await event.request.json();
|
let { repository, branch, projectId, webhookToken, autodeploy } = await event.request.json();
|
||||||
|
|
||||||
repository = repository.toLowerCase();
|
repository = repository.toLowerCase();
|
||||||
branch = branch.toLowerCase();
|
branch = branch.toLowerCase();
|
||||||
projectId = Number(projectId);
|
projectId = Number(projectId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await db.configureGitRepository({ id, repository, branch, projectId, webhookToken });
|
await db.configureGitRepository({
|
||||||
|
id,
|
||||||
|
repository,
|
||||||
|
branch,
|
||||||
|
projectId,
|
||||||
|
webhookToken,
|
||||||
|
autodeploy
|
||||||
|
});
|
||||||
return { status: 201 };
|
return { status: 201 };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return ErrorHandler(error);
|
return ErrorHandler(error);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
if (status === 401) return { status, body };
|
if (status === 401) return { status, body };
|
||||||
|
|
||||||
const { id } = event.params;
|
const { id } = event.params;
|
||||||
|
const { pullmergeRequestId = null, branch } = await event.request.json();
|
||||||
try {
|
try {
|
||||||
const buildId = cuid();
|
const buildId = cuid();
|
||||||
const applicationFound = await db.getApplication({ id, teamId });
|
const applicationFound = await db.getApplication({ id, teamId });
|
||||||
@@ -30,7 +31,29 @@ export const post: RequestHandler = async (event) => {
|
|||||||
await db.prisma.application.update({ where: { id }, data: { configHash } });
|
await db.prisma.application.update({ where: { id }, data: { configHash } });
|
||||||
}
|
}
|
||||||
await db.prisma.application.update({ where: { id }, data: { updatedAt: new Date() } });
|
await db.prisma.application.update({ where: { id }, data: { updatedAt: new Date() } });
|
||||||
await buildQueue.add(buildId, { build_id: buildId, type: 'manual', ...applicationFound });
|
await db.prisma.build.create({
|
||||||
|
data: {
|
||||||
|
id: buildId,
|
||||||
|
applicationId: id,
|
||||||
|
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
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await buildQueue.add(buildId, { build_id: buildId, type: 'manual', ...applicationFound });
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
let debug = application.settings.debug;
|
let debug = application.settings.debug;
|
||||||
let previews = application.settings.previews;
|
let previews = application.settings.previews;
|
||||||
let dualCerts = application.settings.dualCerts;
|
let dualCerts = application.settings.dualCerts;
|
||||||
|
let autodeploy = application.settings.autodeploy;
|
||||||
if (browser && window.location.hostname === 'demo.coolify.io' && !application.fqdn) {
|
if (browser && window.location.hostname === 'demo.coolify.io' && !application.fqdn) {
|
||||||
application.fqdn = `http://${cuid()}.demo.coolify.io`;
|
application.fqdn = `http://${cuid()}.demo.coolify.io`;
|
||||||
}
|
}
|
||||||
@@ -75,10 +75,32 @@
|
|||||||
if (name === 'dualCerts') {
|
if (name === 'dualCerts') {
|
||||||
dualCerts = !dualCerts;
|
dualCerts = !dualCerts;
|
||||||
}
|
}
|
||||||
|
if (name === 'autodeploy') {
|
||||||
|
autodeploy = !autodeploy;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await post(`/applications/${id}/settings.json`, { previews, debug, dualCerts });
|
await post(`/applications/${id}/settings.json`, {
|
||||||
|
previews,
|
||||||
|
debug,
|
||||||
|
dualCerts,
|
||||||
|
autodeploy,
|
||||||
|
branch: application.branch,
|
||||||
|
projectId: application.projectId
|
||||||
|
});
|
||||||
return toast.push('Settings saved.');
|
return toast.push('Settings saved.');
|
||||||
} catch ({ error }) {
|
} catch ({ error }) {
|
||||||
|
if (name === 'debug') {
|
||||||
|
debug = !debug;
|
||||||
|
}
|
||||||
|
if (name === 'previews') {
|
||||||
|
previews = !previews;
|
||||||
|
}
|
||||||
|
if (name === 'dualCerts') {
|
||||||
|
dualCerts = !dualCerts;
|
||||||
|
}
|
||||||
|
if (name === 'autodeploy') {
|
||||||
|
autodeploy = !autodeploy;
|
||||||
|
}
|
||||||
return errorNotification(error);
|
return errorNotification(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -340,7 +362,6 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="grid grid-cols-2 items-center">
|
<div class="grid grid-cols-2 items-center">
|
||||||
<div class="flex-col">
|
<div class="flex-col">
|
||||||
<label for="baseDirectory" class="pt-2 text-base font-bold text-stone-100"
|
<label for="baseDirectory" class="pt-2 text-base font-bold text-stone-100"
|
||||||
@@ -383,22 +404,23 @@
|
|||||||
<div class="flex space-x-1 pb-5 font-bold">
|
<div class="flex space-x-1 pb-5 font-bold">
|
||||||
<div class="title">Features</div>
|
<div class="title">Features</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <ul class="mt-2 divide-y divide-stone-800">
|
|
||||||
<Setting
|
|
||||||
bind:setting={forceSSL}
|
|
||||||
on:click={() => changeSettings('forceSSL')}
|
|
||||||
title="Force https"
|
|
||||||
description="Creates a https redirect for all requests from http and also generates a https certificate for the domain through Let's Encrypt."
|
|
||||||
/>
|
|
||||||
</ul> -->
|
|
||||||
<div class="px-10 pb-10">
|
<div class="px-10 pb-10">
|
||||||
|
<div class="grid grid-cols-2 items-center">
|
||||||
|
<Setting
|
||||||
|
isCenter={false}
|
||||||
|
bind:setting={autodeploy}
|
||||||
|
on:click={() => changeSettings('autodeploy')}
|
||||||
|
title="Enable Automatic Deployment"
|
||||||
|
description="Enable automatic deployment through webhooks."
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div class="grid grid-cols-2 items-center">
|
<div class="grid grid-cols-2 items-center">
|
||||||
<Setting
|
<Setting
|
||||||
isCenter={false}
|
isCenter={false}
|
||||||
bind:setting={previews}
|
bind:setting={previews}
|
||||||
on:click={() => changeSettings('previews')}
|
on:click={() => changeSettings('previews')}
|
||||||
title="Enable MR/PR Previews"
|
title="Enable MR/PR Previews"
|
||||||
description="Creates previews from pull and merge requests."
|
description="Enable preview deployments from pull or merge requests."
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-2 items-center">
|
<div class="grid grid-cols-2 items-center">
|
||||||
|
|||||||
@@ -43,11 +43,11 @@
|
|||||||
logs = logs.concat(responseLogs.map((log) => ({ ...log, line: cleanAnsiCodes(log.line) })));
|
logs = logs.concat(responseLogs.map((log) => ({ ...log, line: cleanAnsiCodes(log.line) })));
|
||||||
loading = false;
|
loading = false;
|
||||||
streamInterval = setInterval(async () => {
|
streamInterval = setInterval(async () => {
|
||||||
if (status !== 'running') {
|
if (status !== 'running' && status !== 'queued') {
|
||||||
clearInterval(streamInterval);
|
clearInterval(streamInterval);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const nextSequence = logs[logs.length - 1].time;
|
const nextSequence = logs[logs.length - 1]?.time || 0;
|
||||||
try {
|
try {
|
||||||
const data = await get(
|
const data = await get(
|
||||||
`/applications/${id}/logs/build/build.json?buildId=${buildId}&sequence=${nextSequence}`
|
`/applications/${id}/logs/build/build.json?buildId=${buildId}&sequence=${nextSequence}`
|
||||||
@@ -83,38 +83,42 @@
|
|||||||
{#if currentStatus === 'running'}
|
{#if currentStatus === 'running'}
|
||||||
<LoadingLogs />
|
<LoadingLogs />
|
||||||
{/if}
|
{/if}
|
||||||
<div class="flex justify-end sticky top-0 p-2">
|
{#if currentStatus === 'queued'}
|
||||||
<button
|
<div class="text-center">Queued and waiting for execution.</div>
|
||||||
on:click={followBuild}
|
{:else}
|
||||||
class="bg-transparent"
|
<div class="flex justify-end sticky top-0 p-2">
|
||||||
data-tooltip="Follow logs"
|
<button
|
||||||
class:text-green-500={followingBuild}
|
on:click={followBuild}
|
||||||
>
|
class="bg-transparent"
|
||||||
<svg
|
data-tooltip="Follow logs"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
class:text-green-500={followingBuild}
|
||||||
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" />
|
<svg
|
||||||
<circle cx="12" cy="12" r="9" />
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
<line x1="8" y1="12" x2="12" y2="16" />
|
class="w-6 h-6"
|
||||||
<line x1="12" y1="8" x2="12" y2="16" />
|
viewBox="0 0 24 24"
|
||||||
<line x1="16" y1="12" x2="12" y2="16" />
|
stroke-width="1.5"
|
||||||
</svg>
|
stroke="currentColor"
|
||||||
</button>
|
fill="none"
|
||||||
</div>
|
stroke-linecap="round"
|
||||||
<div
|
stroke-linejoin="round"
|
||||||
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}
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||||
>
|
<circle cx="12" cy="12" r="9" />
|
||||||
{#each logs as log}
|
<line x1="8" y1="12" x2="12" y2="16" />
|
||||||
<div>{log.line + '\n'}</div>
|
<line x1="12" y1="8" x2="12" y2="16" />
|
||||||
{/each}
|
<line x1="16" y1="12" x2="12" y2="16" />
|
||||||
</div>
|
</svg>
|
||||||
|
</button>
|
||||||
|
</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}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export const get: RequestHandler = async (event) => {
|
|||||||
return {
|
return {
|
||||||
body: {
|
body: {
|
||||||
logs,
|
logs,
|
||||||
status: data?.status || 'running'
|
status: data?.status
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -51,9 +51,10 @@
|
|||||||
build.took = data.builds[0].took;
|
build.took = data.builds[0].took;
|
||||||
build.since = data.builds[0].since;
|
build.since = data.builds[0].since;
|
||||||
}
|
}
|
||||||
|
|
||||||
return build;
|
return build;
|
||||||
});
|
});
|
||||||
return;
|
return window.location.reload();
|
||||||
} catch ({ error }) {
|
} catch ({ error }) {
|
||||||
return errorNotification(error);
|
return errorNotification(error);
|
||||||
}
|
}
|
||||||
@@ -120,6 +121,8 @@
|
|||||||
<div class="w-48 text-center text-xs">
|
<div class="w-48 text-center text-xs">
|
||||||
{#if build.status === 'running'}
|
{#if build.status === 'running'}
|
||||||
<div class="font-bold">Running</div>
|
<div class="font-bold">Running</div>
|
||||||
|
{:else if build.status === 'queued'}
|
||||||
|
<div class="font-bold">Queued</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div>{build.since}</div>
|
<div>{build.since}</div>
|
||||||
<div>Finished in <span class="font-bold">{build.took}s</span></div>
|
<div>Finished in <span class="font-bold">{build.took}s</span></div>
|
||||||
|
|||||||
@@ -26,15 +26,28 @@
|
|||||||
export let applicationSecrets;
|
export let applicationSecrets;
|
||||||
import { getDomain } from '$lib/components/common';
|
import { getDomain } from '$lib/components/common';
|
||||||
import Secret from '../secrets/_Secret.svelte';
|
import Secret from '../secrets/_Secret.svelte';
|
||||||
import { get } from '$lib/api';
|
import { get, post } from '$lib/api';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import Explainer from '$lib/components/Explainer.svelte';
|
import Explainer from '$lib/components/Explainer.svelte';
|
||||||
|
import { errorNotification } from '$lib/form';
|
||||||
|
import { toast } from '@zerodevx/svelte-toast';
|
||||||
|
|
||||||
const { id } = $page.params;
|
const { id } = $page.params;
|
||||||
async function refreshSecrets() {
|
async function refreshSecrets() {
|
||||||
const data = await get(`/applications/${id}/secrets.json`);
|
const data = await get(`/applications/${id}/secrets.json`);
|
||||||
PRMRSecrets = [...data.secrets];
|
PRMRSecrets = [...data.secrets];
|
||||||
}
|
}
|
||||||
|
async function redeploy(container) {
|
||||||
|
try {
|
||||||
|
await post(`/applications/${id}/deploy.json`, {
|
||||||
|
pullmergeRequestId: container.pullmergeRequestId,
|
||||||
|
branch: container.branch
|
||||||
|
});
|
||||||
|
toast.push('Application redeployed queued.');
|
||||||
|
} catch ({ error }) {
|
||||||
|
return errorNotification(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex space-x-1 p-6 font-bold">
|
<div class="flex space-x-1 p-6 font-bold">
|
||||||
@@ -90,6 +103,11 @@
|
|||||||
<div class="truncate text-center text-xl font-bold">{getDomain(container.fqdn)}</div>
|
<div class="truncate text-center text-xl font-bold">{getDomain(container.fqdn)}</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
<div class="flex items-center justify-center">
|
||||||
|
<button class="bg-coollabs hover:bg-coollabs-100" on:click={() => redeploy(container)}
|
||||||
|
>Redeploy</button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
{:else}
|
{:else}
|
||||||
<div class="flex-col">
|
<div class="flex-col">
|
||||||
|
|||||||
@@ -8,10 +8,17 @@ export const post: RequestHandler = async (event) => {
|
|||||||
if (status === 401) return { status, body };
|
if (status === 401) return { status, body };
|
||||||
|
|
||||||
const { id } = event.params;
|
const { id } = event.params;
|
||||||
const { debug, previews, dualCerts } = await event.request.json();
|
const { debug, previews, dualCerts, autodeploy, branch, projectId } = await event.request.json();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await db.setApplicationSettings({ id, debug, previews, dualCerts });
|
const isDouble = await db.checkDoubleBranch(branch, projectId);
|
||||||
|
if (isDouble && autodeploy) {
|
||||||
|
throw {
|
||||||
|
message:
|
||||||
|
'Cannot activate automatic deployments until only one application is defined for this repository / branch.'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
await db.setApplicationSettings({ id, debug, previews, dualCerts, autodeploy });
|
||||||
return { status: 201 };
|
return { status: 201 };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return ErrorHandler(error);
|
return ErrorHandler(error);
|
||||||
|
|||||||
73
src/routes/applications/[id]/storage/_Storage.svelte
Normal file
73
src/routes/applications/[id]/storage/_Storage.svelte
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
export let isNew = false;
|
||||||
|
export let storage = {
|
||||||
|
id: null,
|
||||||
|
path: null
|
||||||
|
};
|
||||||
|
import { del, post } from '$lib/api';
|
||||||
|
import { page } from '$app/stores';
|
||||||
|
import { createEventDispatcher } from 'svelte';
|
||||||
|
|
||||||
|
import { errorNotification } from '$lib/form';
|
||||||
|
import { toast } from '@zerodevx/svelte-toast';
|
||||||
|
const { id } = $page.params;
|
||||||
|
|
||||||
|
const dispatch = createEventDispatcher();
|
||||||
|
async function saveStorage(newStorage = false) {
|
||||||
|
try {
|
||||||
|
if (!storage.path) return errorNotification('Path is required.');
|
||||||
|
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`, {
|
||||||
|
path: storage.path,
|
||||||
|
storageId: storage.id,
|
||||||
|
newStorage
|
||||||
|
});
|
||||||
|
dispatch('refresh');
|
||||||
|
if (isNew) {
|
||||||
|
storage.path = null;
|
||||||
|
storage.id = null;
|
||||||
|
}
|
||||||
|
if (newStorage) toast.push('Storage saved.');
|
||||||
|
else toast.push('Storage updated.');
|
||||||
|
} catch ({ error }) {
|
||||||
|
return errorNotification(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function removeStorage() {
|
||||||
|
try {
|
||||||
|
await del(`/applications/${id}/storage.json`, { path: storage.path });
|
||||||
|
dispatch('refresh');
|
||||||
|
toast.push('Storage deleted.');
|
||||||
|
} catch ({ error }) {
|
||||||
|
return errorNotification(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<input
|
||||||
|
bind:value={storage.path}
|
||||||
|
required
|
||||||
|
placeholder="eg: /sqlite.db"
|
||||||
|
class=" border border-dashed border-coolgray-300"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{#if isNew}
|
||||||
|
<div class="flex items-center justify-center">
|
||||||
|
<button class="bg-green-600 hover:bg-green-500" on:click={() => saveStorage(true)}>Add</button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="flex flex-row justify-center space-x-2">
|
||||||
|
<div class="flex items-center justify-center">
|
||||||
|
<button class="" on:click={() => saveStorage(false)}>Set</button>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-center items-end">
|
||||||
|
<button class="bg-red-600 hover:bg-red-500" on:click={removeStorage}>Remove</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
63
src/routes/applications/[id]/storage/index.json.ts
Normal file
63
src/routes/applications/[id]/storage/index.json.ts
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
};
|
||||||
73
src/routes/applications/[id]/storage/index.svelte
Normal file
73
src/routes/applications/[id]/storage/index.svelte
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<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) {
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
application: stuff.application,
|
||||||
|
...(await res.json())
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
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';
|
||||||
|
import { page } from '$app/stores';
|
||||||
|
import Storage from './_Storage.svelte';
|
||||||
|
import { get } from '$lib/api';
|
||||||
|
import Explainer from '$lib/components/Explainer.svelte';
|
||||||
|
|
||||||
|
const { id } = $page.params;
|
||||||
|
async function refreshStorage() {
|
||||||
|
const data = await get(`/applications/${id}/storage.json`);
|
||||||
|
persistentStorages = [...data.persistentStorages];
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="flex space-x-1 p-6 font-bold">
|
||||||
|
<div class="mr-4 text-2xl tracking-tight">
|
||||||
|
Persistent storage for <a href={application.fqdn} target="_blank"
|
||||||
|
>{getDomain(application.fqdn)}</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mx-auto max-w-6xl rounded-xl px-6 pt-4">
|
||||||
|
<div class="flex justify-center py-4 text-center">
|
||||||
|
<Explainer
|
||||||
|
customClass="w-full"
|
||||||
|
text={'You can specify any folder that you want to be persistent across deployments. <br>This is useful for storing data such as a database (SQLite) or a cache.'}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<table class="mx-auto border-separate text-left">
|
||||||
|
<thead>
|
||||||
|
<tr class="h-12">
|
||||||
|
<th scope="col">Path</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{#each persistentStorages as storage}
|
||||||
|
{#key storage.id}
|
||||||
|
<tr>
|
||||||
|
<Storage on:refresh={refreshStorage} {storage} />
|
||||||
|
</tr>
|
||||||
|
{/key}
|
||||||
|
{/each}
|
||||||
|
<tr>
|
||||||
|
<Storage on:refresh={refreshStorage} isNew />
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
define('WP_ALLOW_MULTISITE', true);
|
define('WP_ALLOW_MULTISITE', true);
|
||||||
define('MULTISITE', true);
|
define('MULTISITE', true);
|
||||||
define('SUBDOMAIN_INSTALL', false);`
|
define('SUBDOMAIN_INSTALL', false);`
|
||||||
: null}>{service.wordpress.extraConfig || 'N/A'}</textarea
|
: 'N/A'}>{service.wordpress.extraConfig}</textarea
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex space-x-1 py-5 font-bold">
|
<div class="flex space-x-1 py-5 font-bold">
|
||||||
|
|||||||
@@ -57,13 +57,13 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { session } from '$app/stores';
|
import { page, session } from '$app/stores';
|
||||||
import { errorNotification } from '$lib/form';
|
import { errorNotification } from '$lib/form';
|
||||||
import DeleteIcon from '$lib/components/DeleteIcon.svelte';
|
import DeleteIcon from '$lib/components/DeleteIcon.svelte';
|
||||||
import Loading from '$lib/components/Loading.svelte';
|
import Loading from '$lib/components/Loading.svelte';
|
||||||
import { del, post } from '$lib/api';
|
import { del, post } from '$lib/api';
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { onMount } from 'svelte';
|
const { id } = $page.params;
|
||||||
|
|
||||||
export let service;
|
export let service;
|
||||||
export let isRunning;
|
export let isRunning;
|
||||||
@@ -110,23 +110,6 @@
|
|||||||
loading = false;
|
loading = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// onMount(async () => {
|
|
||||||
// if (
|
|
||||||
// service.type &&
|
|
||||||
// service.destinationDockerId &&
|
|
||||||
// service.version &&
|
|
||||||
// service.fqdn &&
|
|
||||||
// !isRunning
|
|
||||||
// ) {
|
|
||||||
// try {
|
|
||||||
// await post(`/services/${service.id}/${service.type}/stop.json`, {});
|
|
||||||
// } catch ({ error }) {
|
|
||||||
// return errorNotification(error);
|
|
||||||
// } finally {
|
|
||||||
// loading = false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav class="nav-side">
|
<nav class="nav-side">
|
||||||
@@ -185,6 +168,76 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
|
<div class="border border-stone-700 h-8" />
|
||||||
|
{/if}
|
||||||
|
{#if service.type && service.destinationDockerId && service.version}
|
||||||
|
<a
|
||||||
|
href="/services/{id}"
|
||||||
|
sveltekit:prefetch
|
||||||
|
class="hover:text-yellow-500 rounded"
|
||||||
|
class:text-yellow-500={$page.url.pathname === `/services/${id}`}
|
||||||
|
class:bg-coolgray-500={$page.url.pathname === `/services/${id}`}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
title="Configurations"
|
||||||
|
class="icons bg-transparent tooltip-bottom text-sm disabled:text-red-500"
|
||||||
|
data-tooltip="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
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
href="/services/{id}/secrets"
|
||||||
|
sveltekit:prefetch
|
||||||
|
class="hover:text-pink-500 rounded"
|
||||||
|
class:text-pink-500={$page.url.pathname === `/services/${id}/secrets`}
|
||||||
|
class:bg-coolgray-500={$page.url.pathname === `/services/${id}/secrets`}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
title="Secrets"
|
||||||
|
class="icons bg-transparent tooltip-bottom text-sm disabled:text-red-500"
|
||||||
|
data-tooltip="Secrets"
|
||||||
|
>
|
||||||
|
<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="M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3"
|
||||||
|
/>
|
||||||
|
<circle cx="12" cy="11" r="1" />
|
||||||
|
<line x1="12" y1="12" x2="12" y2="14.5" />
|
||||||
|
</svg></button
|
||||||
|
></a
|
||||||
|
>
|
||||||
|
<div class="border border-stone-700 h-8" />
|
||||||
{/if}
|
{/if}
|
||||||
<button
|
<button
|
||||||
on:click={deleteService}
|
on:click={deleteService}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { post } from '$lib/api';
|
import { post } from '$lib/api';
|
||||||
import VaultWarden from '$lib/components/svg/services/VaultWarden.svelte';
|
import VaultWarden from '$lib/components/svg/services/VaultWarden.svelte';
|
||||||
|
import LanguageTool from '$lib/components/svg/services/LanguageTool.svelte';
|
||||||
|
|
||||||
const { id } = $page.params;
|
const { id } = $page.params;
|
||||||
const from = $page.url.searchParams.get('from');
|
const from = $page.url.searchParams.get('from');
|
||||||
@@ -74,6 +75,8 @@
|
|||||||
<Wordpress isAbsolute />
|
<Wordpress isAbsolute />
|
||||||
{:else if type.name === 'vaultwarden'}
|
{:else if type.name === 'vaultwarden'}
|
||||||
<VaultWarden isAbsolute />
|
<VaultWarden isAbsolute />
|
||||||
|
{:else if type.name === 'languagetool'}
|
||||||
|
<LanguageTool isAbsolute />
|
||||||
{/if}{type.fancyName}
|
{/if}{type.fancyName}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -35,10 +35,10 @@
|
|||||||
import VsCodeServer from '$lib/components/svg/services/VSCodeServer.svelte';
|
import VsCodeServer from '$lib/components/svg/services/VSCodeServer.svelte';
|
||||||
import Wordpress from '$lib/components/svg/services/Wordpress.svelte';
|
import Wordpress from '$lib/components/svg/services/Wordpress.svelte';
|
||||||
import Services from './_Services/_Services.svelte';
|
import Services from './_Services/_Services.svelte';
|
||||||
import { getDomain } from '$lib/components/common';
|
|
||||||
import VaultWarden from '$lib/components/svg/services/VaultWarden.svelte';
|
import VaultWarden from '$lib/components/svg/services/VaultWarden.svelte';
|
||||||
import cuid from 'cuid';
|
import cuid from 'cuid';
|
||||||
import { browser } from '$app/env';
|
import { browser } from '$app/env';
|
||||||
|
import LanguageTool from '$lib/components/svg/services/LanguageTool.svelte';
|
||||||
|
|
||||||
export let service;
|
export let service;
|
||||||
export let isRunning;
|
export let isRunning;
|
||||||
@@ -105,6 +105,10 @@
|
|||||||
<a href="https://github.com/dani-garcia/vaultwarden" target="_blank">
|
<a href="https://github.com/dani-garcia/vaultwarden" target="_blank">
|
||||||
<VaultWarden />
|
<VaultWarden />
|
||||||
</a>
|
</a>
|
||||||
|
{:else if service.type === 'languagetool'}
|
||||||
|
<a href="https://languagetool.org/dev" target="_blank">
|
||||||
|
<LanguageTool />
|
||||||
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
21
src/routes/services/[id]/languagetool/index.json.ts
Normal file
21
src/routes/services/[id]/languagetool/index.json.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
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.updateLanguageToolService({ id, fqdn, name });
|
||||||
|
return { status: 201 };
|
||||||
|
} catch (error) {
|
||||||
|
return ErrorHandler(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
78
src/routes/services/[id]/languagetool/start.json.ts
Normal file
78
src/routes/services/[id]/languagetool/start.json.ts
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
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';
|
||||||
|
|
||||||
|
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 } = service;
|
||||||
|
const network = destinationDockerId && destinationDocker.network;
|
||||||
|
const host = getEngine(destinationDocker.engine);
|
||||||
|
|
||||||
|
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 = {
|
||||||
|
version: '3.8',
|
||||||
|
services: {
|
||||||
|
[id]: {
|
||||||
|
container_name: id,
|
||||||
|
image: config.image,
|
||||||
|
networks: [network],
|
||||||
|
environment: config.environmentVariables,
|
||||||
|
restart: 'always',
|
||||||
|
volumes: [`${id}-ngrams:/ngrams`],
|
||||||
|
labels: makeLabelForServices('languagetool')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
networks: {
|
||||||
|
[network]: {
|
||||||
|
external: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
volumes: {
|
||||||
|
[`${id}-ngrams`]: {
|
||||||
|
external: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||||
|
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||||
|
try {
|
||||||
|
await asyncExecShell(`DOCKER_HOST=${host} docker volume create ${id}-ngrams`);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
||||||
|
return {
|
||||||
|
status: 200
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
return ErrorHandler(error);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
return ErrorHandler(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
35
src/routes/services/[id]/languagetool/stop.json.ts
Normal file
35
src/routes/services/[id]/languagetool/stop.json.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -6,7 +6,7 @@ import type { RequestHandler } from '@sveltejs/kit';
|
|||||||
import { startHttpProxy } from '$lib/haproxy';
|
import { startHttpProxy } from '$lib/haproxy';
|
||||||
import getPort, { portNumbers } from 'get-port';
|
import getPort, { portNumbers } from 'get-port';
|
||||||
import { getDomain } from '$lib/components/common';
|
import { getDomain } from '$lib/components/common';
|
||||||
import { ErrorHandler } from '$lib/database';
|
import { ErrorHandler, getServiceImage } from '$lib/database';
|
||||||
import { makeLabelForServices } from '$lib/buildPacks/common';
|
import { makeLabelForServices } from '$lib/buildPacks/common';
|
||||||
|
|
||||||
export const post: RequestHandler = async (event) => {
|
export const post: RequestHandler = async (event) => {
|
||||||
@@ -23,7 +23,8 @@ export const post: RequestHandler = async (event) => {
|
|||||||
fqdn,
|
fqdn,
|
||||||
destinationDockerId,
|
destinationDockerId,
|
||||||
destinationDocker,
|
destinationDocker,
|
||||||
minio: { rootUser, rootUserPassword }
|
minio: { rootUser, rootUserPassword },
|
||||||
|
serviceSecret
|
||||||
} = service;
|
} = service;
|
||||||
|
|
||||||
const data = await db.prisma.setting.findFirst();
|
const data = await db.prisma.setting.findFirst();
|
||||||
@@ -38,9 +39,10 @@ export const post: RequestHandler = async (event) => {
|
|||||||
const apiPort = 9000;
|
const apiPort = 9000;
|
||||||
|
|
||||||
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
||||||
|
const image = getServiceImage(type);
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
image: `minio/minio:${version}`,
|
image: `${image}:${version}`,
|
||||||
volume: `${id}-minio-data:/data`,
|
volume: `${id}-minio-data:/data`,
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
MINIO_ROOT_USER: rootUser,
|
MINIO_ROOT_USER: rootUser,
|
||||||
@@ -48,12 +50,17 @@ export const post: RequestHandler = async (event) => {
|
|||||||
MINIO_BROWSER_REDIRECT_URL: fqdn
|
MINIO_BROWSER_REDIRECT_URL: fqdn
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (serviceSecret.length > 0) {
|
||||||
|
serviceSecret.forEach((secret) => {
|
||||||
|
config.environmentVariables[secret.name] = secret.value;
|
||||||
|
});
|
||||||
|
}
|
||||||
const composeFile = {
|
const composeFile = {
|
||||||
version: '3.8',
|
version: '3.8',
|
||||||
services: {
|
services: {
|
||||||
[id]: {
|
[id]: {
|
||||||
container_name: id,
|
container_name: id,
|
||||||
image: `minio/minio:${version}`,
|
image: config.image,
|
||||||
command: `server /data --console-address ":${consolePort}"`,
|
command: `server /data --console-address ":${consolePort}"`,
|
||||||
environment: config.environmentVariables,
|
environment: config.environmentVariables,
|
||||||
networks: [network],
|
networks: [network],
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as db from '$lib/database';
|
|||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
import yaml from 'js-yaml';
|
import yaml from 'js-yaml';
|
||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { ErrorHandler } from '$lib/database';
|
import { ErrorHandler, getServiceImage } from '$lib/database';
|
||||||
import { makeLabelForServices } from '$lib/buildPacks/common';
|
import { makeLabelForServices } from '$lib/buildPacks/common';
|
||||||
|
|
||||||
export const post: RequestHandler = async (event) => {
|
export const post: RequestHandler = async (event) => {
|
||||||
@@ -14,19 +14,30 @@ export const post: RequestHandler = async (event) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const service = await db.getService({ id, teamId });
|
const service = await db.getService({ id, teamId });
|
||||||
const { type, version, destinationDockerId, destinationDocker } = service;
|
const { type, version, destinationDockerId, destinationDocker, serviceSecret } = service;
|
||||||
const network = destinationDockerId && destinationDocker.network;
|
const network = destinationDockerId && destinationDocker.network;
|
||||||
const host = getEngine(destinationDocker.engine);
|
const host = getEngine(destinationDocker.engine);
|
||||||
|
|
||||||
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
||||||
|
const image = getServiceImage(type);
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
image: `${image}:${version}`,
|
||||||
|
environmentVariables: {}
|
||||||
|
};
|
||||||
|
if (serviceSecret.length > 0) {
|
||||||
|
serviceSecret.forEach((secret) => {
|
||||||
|
config.environmentVariables[secret.name] = secret.value;
|
||||||
|
});
|
||||||
|
}
|
||||||
const composeFile = {
|
const composeFile = {
|
||||||
version: '3.8',
|
version: '3.8',
|
||||||
services: {
|
services: {
|
||||||
[id]: {
|
[id]: {
|
||||||
container_name: id,
|
container_name: id,
|
||||||
image: `nocodb/nocodb:${version}`,
|
image: config.image,
|
||||||
networks: [network],
|
networks: [network],
|
||||||
|
environment: config.environmentVariables,
|
||||||
restart: 'always',
|
restart: 'always',
|
||||||
labels: makeLabelForServices('nocodb')
|
labels: makeLabelForServices('nocodb')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as db from '$lib/database';
|
|||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
import yaml from 'js-yaml';
|
import yaml from 'js-yaml';
|
||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { ErrorHandler } from '$lib/database';
|
import { ErrorHandler, getServiceImage } from '$lib/database';
|
||||||
import { makeLabelForServices } from '$lib/buildPacks/common';
|
import { makeLabelForServices } from '$lib/buildPacks/common';
|
||||||
|
|
||||||
export const post: RequestHandler = async (event) => {
|
export const post: RequestHandler = async (event) => {
|
||||||
@@ -20,6 +20,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
fqdn,
|
fqdn,
|
||||||
destinationDockerId,
|
destinationDockerId,
|
||||||
destinationDocker,
|
destinationDocker,
|
||||||
|
serviceSecret,
|
||||||
plausibleAnalytics: {
|
plausibleAnalytics: {
|
||||||
id: plausibleDbId,
|
id: plausibleDbId,
|
||||||
username,
|
username,
|
||||||
@@ -31,10 +32,11 @@ export const post: RequestHandler = async (event) => {
|
|||||||
secretKeyBase
|
secretKeyBase
|
||||||
}
|
}
|
||||||
} = service;
|
} = service;
|
||||||
|
const image = getServiceImage(type);
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
plausibleAnalytics: {
|
plausibleAnalytics: {
|
||||||
image: `plausible/analytics:${version}`,
|
image: `${image}:${version}`,
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
ADMIN_USER_EMAIL: email,
|
ADMIN_USER_EMAIL: email,
|
||||||
ADMIN_USER_NAME: username,
|
ADMIN_USER_NAME: username,
|
||||||
@@ -68,6 +70,11 @@ export const post: RequestHandler = async (event) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (serviceSecret.length > 0) {
|
||||||
|
serviceSecret.forEach((secret) => {
|
||||||
|
config.plausibleAnalytics.environmentVariables[secret.name] = secret.value;
|
||||||
|
});
|
||||||
|
}
|
||||||
const network = destinationDockerId && destinationDocker.network;
|
const network = destinationDockerId && destinationDocker.network;
|
||||||
const host = getEngine(destinationDocker.engine);
|
const host = getEngine(destinationDocker.engine);
|
||||||
|
|
||||||
|
|||||||
87
src/routes/services/[id]/secrets/_Secret.svelte
Normal file
87
src/routes/services/[id]/secrets/_Secret.svelte
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<script>
|
||||||
|
export let name = '';
|
||||||
|
export let value = '';
|
||||||
|
export let isNewSecret = false;
|
||||||
|
|
||||||
|
import { page } from '$app/stores';
|
||||||
|
import { del, post } from '$lib/api';
|
||||||
|
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
|
||||||
|
import { errorNotification } from '$lib/form';
|
||||||
|
import { toast } from '@zerodevx/svelte-toast';
|
||||||
|
import { createEventDispatcher } from 'svelte';
|
||||||
|
|
||||||
|
const dispatch = createEventDispatcher();
|
||||||
|
const { id } = $page.params;
|
||||||
|
async function removeSecret() {
|
||||||
|
try {
|
||||||
|
await del(`/services/${id}/secrets.json`, { name });
|
||||||
|
dispatch('refresh');
|
||||||
|
if (isNewSecret) {
|
||||||
|
name = '';
|
||||||
|
value = '';
|
||||||
|
}
|
||||||
|
} catch ({ error }) {
|
||||||
|
return errorNotification(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function saveSecret(isNew = false) {
|
||||||
|
if (!name) return errorNotification('Name is required.');
|
||||||
|
if (!value) return errorNotification('Value is required.');
|
||||||
|
try {
|
||||||
|
await post(`/services/${id}/secrets.json`, {
|
||||||
|
name,
|
||||||
|
value,
|
||||||
|
|
||||||
|
isNew
|
||||||
|
});
|
||||||
|
dispatch('refresh');
|
||||||
|
if (isNewSecret) {
|
||||||
|
name = '';
|
||||||
|
value = '';
|
||||||
|
}
|
||||||
|
toast.push('Secret saved.');
|
||||||
|
} catch ({ error }) {
|
||||||
|
return errorNotification(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<input
|
||||||
|
id={isNewSecret ? 'secretName' : 'secretNameNew'}
|
||||||
|
bind:value={name}
|
||||||
|
required
|
||||||
|
placeholder="EXAMPLE_VARIABLE"
|
||||||
|
class=" border border-dashed border-coolgray-300"
|
||||||
|
readonly={!isNewSecret}
|
||||||
|
class:bg-transparent={!isNewSecret}
|
||||||
|
class:cursor-not-allowed={!isNewSecret}
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<CopyPasswordField
|
||||||
|
id={isNewSecret ? 'secretValue' : 'secretValueNew'}
|
||||||
|
name={isNewSecret ? 'secretValue' : 'secretValueNew'}
|
||||||
|
isPasswordField={true}
|
||||||
|
bind:value
|
||||||
|
required
|
||||||
|
placeholder="J$#@UIO%HO#$U%H"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
{#if isNewSecret}
|
||||||
|
<div class="flex items-center justify-center">
|
||||||
|
<button class="bg-green-600 hover:bg-green-500" on:click={() => saveSecret(true)}>Add</button>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="flex flex-row justify-center space-x-2">
|
||||||
|
<div class="flex items-center justify-center">
|
||||||
|
<button class="" on:click={() => saveSecret(false)}>Set</button>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-center items-end">
|
||||||
|
<button class="bg-red-600 hover:bg-red-500" on:click={removeSecret}>Remove</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
70
src/routes/services/[id]/secrets/index.json.ts
Normal file
70
src/routes/services/[id]/secrets/index.json.ts
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
};
|
||||||
67
src/routes/services/[id]/secrets/index.svelte
Normal file
67
src/routes/services/[id]/secrets/index.svelte
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<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) {
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
service: stuff.service,
|
||||||
|
...(await res.json())
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
status: res.status,
|
||||||
|
error: new Error(`Could not load ${endpoint}`)
|
||||||
|
};
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export let secrets;
|
||||||
|
export let service;
|
||||||
|
import Secret from './_Secret.svelte';
|
||||||
|
import { getDomain } from '$lib/components/common';
|
||||||
|
import { page } from '$app/stores';
|
||||||
|
import { get } from '$lib/api';
|
||||||
|
|
||||||
|
const { id } = $page.params;
|
||||||
|
|
||||||
|
async function refreshSecrets() {
|
||||||
|
const data = await get(`/services/${id}/secrets.json`);
|
||||||
|
secrets = [...data.secrets];
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="flex space-x-1 p-6 font-bold">
|
||||||
|
<div class="mr-4 text-2xl tracking-tight">
|
||||||
|
Secrets {#if service.fqdn}
|
||||||
|
<a href={service.fqdn} target="_blank">{getDomain(service.fqdn)}</a>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mx-auto max-w-6xl rounded-xl px-6 pt-4">
|
||||||
|
<table class="mx-auto border-separate text-left">
|
||||||
|
<thead>
|
||||||
|
<tr class="h-12">
|
||||||
|
<th scope="col">Name</th>
|
||||||
|
<th scope="col">Value</th>
|
||||||
|
<th scope="col" class="w-96 text-center">Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{#each secrets as secret}
|
||||||
|
{#key secret.id}
|
||||||
|
<tr>
|
||||||
|
<Secret name={secret.name} value={secret.value} on:refresh={refreshSecrets} />
|
||||||
|
</tr>
|
||||||
|
{/key}
|
||||||
|
{/each}
|
||||||
|
<tr>
|
||||||
|
<Secret isNewSecret on:refresh={refreshSecrets} />
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
@@ -14,25 +14,31 @@ export const post: RequestHandler = async (event) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const service = await db.getService({ id, teamId });
|
const service = await db.getService({ id, teamId });
|
||||||
const { type, version, destinationDockerId, destinationDocker } = service;
|
const { type, version, destinationDockerId, destinationDocker, serviceSecret } = service;
|
||||||
|
|
||||||
const network = destinationDockerId && destinationDocker.network;
|
const network = destinationDockerId && destinationDocker.network;
|
||||||
const host = getEngine(destinationDocker.engine);
|
const host = getEngine(destinationDocker.engine);
|
||||||
|
|
||||||
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
||||||
const baseImage = getServiceImage(type);
|
const image = getServiceImage(type);
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
image: `${baseImage}:${version}`,
|
image: `${image}:${version}`,
|
||||||
volume: `${id}-vaultwarden-data:/data/`
|
volume: `${id}-vaultwarden-data:/data/`,
|
||||||
|
environmentVariables: {}
|
||||||
};
|
};
|
||||||
|
if (serviceSecret.length > 0) {
|
||||||
|
serviceSecret.forEach((secret) => {
|
||||||
|
config.environmentVariables[secret.name] = secret.value;
|
||||||
|
});
|
||||||
|
}
|
||||||
const composeFile = {
|
const composeFile = {
|
||||||
version: '3.8',
|
version: '3.8',
|
||||||
services: {
|
services: {
|
||||||
[id]: {
|
[id]: {
|
||||||
container_name: id,
|
container_name: id,
|
||||||
image: config.image,
|
image: config.image,
|
||||||
|
environment: config.environmentVariables,
|
||||||
networks: [network],
|
networks: [network],
|
||||||
volumes: [config.volume],
|
volumes: [config.volume],
|
||||||
restart: 'always',
|
restart: 'always',
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as db from '$lib/database';
|
|||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
import yaml from 'js-yaml';
|
import yaml from 'js-yaml';
|
||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { ErrorHandler } from '$lib/database';
|
import { ErrorHandler, getServiceImage } from '$lib/database';
|
||||||
import { makeLabelForServices } from '$lib/buildPacks/common';
|
import { makeLabelForServices } from '$lib/buildPacks/common';
|
||||||
|
|
||||||
export const post: RequestHandler = async (event) => {
|
export const post: RequestHandler = async (event) => {
|
||||||
@@ -19,6 +19,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
version,
|
version,
|
||||||
destinationDockerId,
|
destinationDockerId,
|
||||||
destinationDocker,
|
destinationDocker,
|
||||||
|
serviceSecret,
|
||||||
vscodeserver: { password }
|
vscodeserver: { password }
|
||||||
} = service;
|
} = service;
|
||||||
|
|
||||||
@@ -26,13 +27,20 @@ export const post: RequestHandler = async (event) => {
|
|||||||
const host = getEngine(destinationDocker.engine);
|
const host = getEngine(destinationDocker.engine);
|
||||||
|
|
||||||
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
||||||
|
const image = getServiceImage(type);
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
image: `codercom/code-server:${version}`,
|
image: `${image}:${version}`,
|
||||||
volume: `${id}-vscodeserver-data:/home/coder`,
|
volume: `${id}-vscodeserver-data:/home/coder`,
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
PASSWORD: password
|
PASSWORD: password
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (serviceSecret.length > 0) {
|
||||||
|
serviceSecret.forEach((secret) => {
|
||||||
|
config.environmentVariables[secret.name] = secret.value;
|
||||||
|
});
|
||||||
|
}
|
||||||
const composeFile = {
|
const composeFile = {
|
||||||
version: '3.8',
|
version: '3.8',
|
||||||
services: {
|
services: {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as db from '$lib/database';
|
|||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
import yaml from 'js-yaml';
|
import yaml from 'js-yaml';
|
||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { ErrorHandler } from '$lib/database';
|
import { ErrorHandler, getServiceImage } from '$lib/database';
|
||||||
import { makeLabelForServices } from '$lib/buildPacks/common';
|
import { makeLabelForServices } from '$lib/buildPacks/common';
|
||||||
|
|
||||||
export const post: RequestHandler = async (event) => {
|
export const post: RequestHandler = async (event) => {
|
||||||
@@ -19,6 +19,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
version,
|
version,
|
||||||
fqdn,
|
fqdn,
|
||||||
destinationDockerId,
|
destinationDockerId,
|
||||||
|
serviceSecret,
|
||||||
destinationDocker,
|
destinationDocker,
|
||||||
wordpress: {
|
wordpress: {
|
||||||
mysqlDatabase,
|
mysqlDatabase,
|
||||||
@@ -32,11 +33,12 @@ export const post: RequestHandler = async (event) => {
|
|||||||
|
|
||||||
const network = destinationDockerId && destinationDocker.network;
|
const network = destinationDockerId && destinationDocker.network;
|
||||||
const host = getEngine(destinationDocker.engine);
|
const host = getEngine(destinationDocker.engine);
|
||||||
|
const image = getServiceImage(type);
|
||||||
|
|
||||||
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
||||||
const config = {
|
const config = {
|
||||||
wordpress: {
|
wordpress: {
|
||||||
image: `wordpress:${version}`,
|
image: `${image}:${version}`,
|
||||||
volume: `${id}-wordpress-data:/var/www/html`,
|
volume: `${id}-wordpress-data:/var/www/html`,
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
WORDPRESS_DB_HOST: `${id}-mysql`,
|
WORDPRESS_DB_HOST: `${id}-mysql`,
|
||||||
@@ -58,6 +60,11 @@ export const post: RequestHandler = async (event) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (serviceSecret.length > 0) {
|
||||||
|
serviceSecret.forEach((secret) => {
|
||||||
|
config.wordpress.environmentVariables[secret.name] = secret.value;
|
||||||
|
});
|
||||||
|
}
|
||||||
const composeFile = {
|
const composeFile = {
|
||||||
version: '3.8',
|
version: '3.8',
|
||||||
services: {
|
services: {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
import VsCodeServer from '$lib/components/svg/services/VSCodeServer.svelte';
|
import VsCodeServer from '$lib/components/svg/services/VSCodeServer.svelte';
|
||||||
import Wordpress from '$lib/components/svg/services/Wordpress.svelte';
|
import Wordpress from '$lib/components/svg/services/Wordpress.svelte';
|
||||||
import VaultWarden from '$lib/components/svg/services/VaultWarden.svelte';
|
import VaultWarden from '$lib/components/svg/services/VaultWarden.svelte';
|
||||||
|
import LanguageTool from '$lib/components/svg/services/LanguageTool.svelte';
|
||||||
|
|
||||||
export let services;
|
export let services;
|
||||||
</script>
|
</script>
|
||||||
@@ -70,6 +71,8 @@
|
|||||||
<Wordpress isAbsolute />
|
<Wordpress isAbsolute />
|
||||||
{:else if service.type === 'vaultwarden'}
|
{:else if service.type === 'vaultwarden'}
|
||||||
<VaultWarden isAbsolute />
|
<VaultWarden isAbsolute />
|
||||||
|
{:else if service.type === 'languagetool'}
|
||||||
|
<LanguageTool isAbsolute />
|
||||||
{/if}
|
{/if}
|
||||||
<div class="font-bold text-xl text-center truncate">
|
<div class="font-bold text-xl text-center truncate">
|
||||||
{service.name}
|
{service.name}
|
||||||
|
|||||||
@@ -189,8 +189,11 @@
|
|||||||
<Explainer
|
<Explainer
|
||||||
text={`Credentials for <a class="text-white font-bold" href=${
|
text={`Credentials for <a class="text-white font-bold" href=${
|
||||||
fqdn
|
fqdn
|
||||||
? 'http://' + getDomain(fqdn) + ':8404'
|
? `http://${settings.proxyUser}:${settings.proxyPassword}@` + getDomain(fqdn) + ':8404'
|
||||||
: browser && 'http://' + window.location.hostname + ':8404'
|
: browser &&
|
||||||
|
`http://${settings.proxyUser}:${settings.proxyPassword}@` +
|
||||||
|
window.location.hostname +
|
||||||
|
':8404'
|
||||||
} target="_blank">stats</a> page.`}
|
} target="_blank">stats</a> page.`}
|
||||||
/>
|
/>
|
||||||
<div class="space-y-2 px-10 py-5">
|
<div class="space-y-2 px-10 py-5">
|
||||||
|
|||||||
@@ -6,13 +6,18 @@ import type { RequestHandler } from '@sveltejs/kit';
|
|||||||
import compare from 'compare-versions';
|
import compare from 'compare-versions';
|
||||||
import got from 'got';
|
import got from 'got';
|
||||||
|
|
||||||
export const get: RequestHandler = async () => {
|
export const get: RequestHandler = async (request) => {
|
||||||
try {
|
try {
|
||||||
const currentVersion = version;
|
const currentVersion = version;
|
||||||
const versions = await got
|
const versions = await got
|
||||||
.get(`https://get.coollabs.io/versions.json?appId=${process.env['COOLIFY_APP_ID']}`)
|
.get(
|
||||||
|
`https://get.coollabs.io/versions.json?appId=${process.env['COOLIFY_APP_ID']}&version=${currentVersion}`
|
||||||
|
)
|
||||||
.json();
|
.json();
|
||||||
const latestVersion = versions['coolify'].main.version;
|
const latestVersion =
|
||||||
|
request.url.hostname === 'staging.coolify.io'
|
||||||
|
? versions['coolify'].next.version
|
||||||
|
: versions['coolify'].main.version;
|
||||||
const isUpdateAvailable = compare(latestVersion, currentVersion);
|
const isUpdateAvailable = compare(latestVersion, currentVersion);
|
||||||
return {
|
return {
|
||||||
body: {
|
body: {
|
||||||
@@ -21,12 +26,13 @@ export const get: RequestHandler = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
return ErrorHandler(error);
|
return ErrorHandler(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const post: RequestHandler = async (event) => {
|
export const post: RequestHandler = async (event) => {
|
||||||
const { type, latestVersion, overrideVersion } = await event.request.json();
|
const { type, latestVersion } = await event.request.json();
|
||||||
if (type === 'update') {
|
if (type === 'update') {
|
||||||
try {
|
try {
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
@@ -50,31 +56,6 @@ export const post: RequestHandler = async (event) => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
return ErrorHandler(error);
|
return ErrorHandler(error);
|
||||||
}
|
}
|
||||||
} else if (type === 'check') {
|
|
||||||
try {
|
|
||||||
if (overrideVersion) {
|
|
||||||
return {
|
|
||||||
status: 200,
|
|
||||||
body: {
|
|
||||||
exists: true
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
await asyncExecShell(`docker image inspect coollabsio/coolify:${latestVersion}`);
|
|
||||||
return {
|
|
||||||
status: 200,
|
|
||||||
body: {
|
|
||||||
exists: true
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} catch (error) {
|
|
||||||
return {
|
|
||||||
status: 200,
|
|
||||||
body: {
|
|
||||||
exists: false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
status: 500
|
status: 500
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { dev } from '$app/env';
|
|||||||
|
|
||||||
export const options: RequestHandler = async () => {
|
export const options: RequestHandler = async () => {
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 204,
|
||||||
headers: {
|
headers: {
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*',
|
||||||
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
|
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
|
||||||
@@ -47,7 +47,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
|
|
||||||
const applicationFound = await db.getApplicationWebhook({ projectId, branch });
|
const applicationFound = await db.getApplicationWebhook({ projectId, branch });
|
||||||
if (applicationFound) {
|
if (applicationFound) {
|
||||||
const webhookSecret = applicationFound.gitSource.githubApp.webhookSecret;
|
const webhookSecret = applicationFound.gitSource.githubApp.webhookSecret || null;
|
||||||
const hmac = crypto.createHmac('sha256', webhookSecret);
|
const hmac = crypto.createHmac('sha256', webhookSecret);
|
||||||
const digest = Buffer.from(
|
const digest = Buffer.from(
|
||||||
'sha256=' + hmac.update(JSON.stringify(body)).digest('hex'),
|
'sha256=' + hmac.update(JSON.stringify(body)).digest('hex'),
|
||||||
@@ -88,6 +88,18 @@ export const post: RequestHandler = async (event) => {
|
|||||||
where: { id: applicationFound.id },
|
where: { id: applicationFound.id },
|
||||||
data: { updatedAt: new Date() }
|
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, {
|
await buildQueue.add(buildId, {
|
||||||
build_id: buildId,
|
build_id: buildId,
|
||||||
type: 'webhook_commit',
|
type: 'webhook_commit',
|
||||||
@@ -136,6 +148,18 @@ export const post: RequestHandler = async (event) => {
|
|||||||
where: { id: applicationFound.id },
|
where: { id: applicationFound.id },
|
||||||
data: { updatedAt: new Date() }
|
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, {
|
await buildQueue.add(buildId, {
|
||||||
build_id: buildId,
|
build_id: buildId,
|
||||||
type: 'webhook_pr',
|
type: 'webhook_pr',
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { dev } from '$app/env';
|
|||||||
|
|
||||||
export const options: RequestHandler = async () => {
|
export const options: RequestHandler = async () => {
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 204,
|
||||||
headers: {
|
headers: {
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*',
|
||||||
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
|
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
|
||||||
@@ -52,6 +52,18 @@ export const post: RequestHandler = async (event) => {
|
|||||||
where: { id: applicationFound.id },
|
where: { id: applicationFound.id },
|
||||||
data: { updatedAt: new Date() }
|
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, {
|
await buildQueue.add(buildId, {
|
||||||
build_id: buildId,
|
build_id: buildId,
|
||||||
type: 'webhook_commit',
|
type: 'webhook_commit',
|
||||||
@@ -133,6 +145,18 @@ export const post: RequestHandler = async (event) => {
|
|||||||
where: { id: applicationFound.id },
|
where: { id: applicationFound.id },
|
||||||
data: { updatedAt: new Date() }
|
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, {
|
await buildQueue.add(buildId, {
|
||||||
build_id: buildId,
|
build_id: buildId,
|
||||||
type: 'webhook_mr',
|
type: 'webhook_mr',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import cookie from 'cookie';
|
|||||||
|
|
||||||
export const options: RequestHandler = async () => {
|
export const options: RequestHandler = async () => {
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 204,
|
||||||
headers: {
|
headers: {
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*',
|
||||||
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
|
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
|
||||||
|
|||||||
@@ -42,7 +42,27 @@ textarea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
@apply h-12 w-96 rounded bg-coolgray-200 p-2 text-xs font-bold tracking-tight text-white outline-none transition duration-150 hover:bg-coolgray-500 focus:bg-coolgray-500 disabled:text-stone-600 md:text-sm;
|
@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;
|
||||||
|
}
|
||||||
|
.svelte-select {
|
||||||
|
--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 {
|
label {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const defaultTheme = require('tailwindcss/defaultTheme');
|
const defaultTheme = require('tailwindcss/defaultTheme');
|
||||||
const colors = require('tailwindcss/colors');
|
// const colors = require('tailwindcss/colors');
|
||||||
module.exports = {
|
module.exports = {
|
||||||
content: ['./**/*.html', './src/**/*.{js,jsx,ts,tsx,svelte}'],
|
content: ['./**/*.html', './src/**/*.{js,jsx,ts,tsx,svelte}'],
|
||||||
important: true,
|
important: true,
|
||||||
@@ -18,7 +18,6 @@ module.exports = {
|
|||||||
sans: ['Poppins', ...defaultTheme.fontFamily.sans]
|
sans: ['Poppins', ...defaultTheme.fontFamily.sans]
|
||||||
},
|
},
|
||||||
colors: {
|
colors: {
|
||||||
...colors,
|
|
||||||
coollabs: '#6B16ED',
|
coollabs: '#6B16ED',
|
||||||
'coollabs-100': '#7317FF',
|
'coollabs-100': '#7317FF',
|
||||||
coolblack: '#161616',
|
coolblack: '#161616',
|
||||||
|
|||||||
Reference in New Issue
Block a user