An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
V2 (#111)
Andras Bacsai460ae852268a
diff --git a/.dockerignore b/.dockerignoreindex 3fd3b242aa..ad52155e3d 100644--- a/.dockerignore+++ b/.dockerignore@@ -1,7 +1,11 @@.DS_Storenode_modules-/.svelte/build-/functions-.pnpm-store-.pnpm-debug.log+/.svelte-kit+/package++.env+.env.stag+/db/*.db+/db/*.db-journal+/data/haproxy/haproxy.cfg\ No newline at end of filediff --git a/.env.template b/.env.templateindex 589fe13802..30bd7cf21b 100644--- a/.env.template+++ b/.env.template@@ -1,35 +1,5 @@-####################################-# Domain where your Coolify instance will be available and reachable.-# It's the same as you set in Github OAuth App and Github App as <domain>.-DOMAIN=-## Let's Encrypt contact email required-EMAIL=--# JWT Token Sign Key for logging you in to Coolify's frontend-JWT_SIGN_KEY=-# Encryption key for SECRETS - do NOT share it with others!-SECRETS_ENCRYPTION_KEY=--# Docker Engine-DOCKER_ENGINE=/var/run/docker.sock-# Docker network to use internally between the proxy and your apps-DOCKER_NETWORK=coollabs--# Mongodb-# Values in case if you are using our Mongodb installation - CHANGE user and password fields!-MONGODB_HOST=coollabs-mongodb-MONGODB_PORT=27017-MONGODB_USER=supercooldbuser-MONGODB_PASSWORD=developmentPassword4db-MONGODB_DB=coolLabs-prod--# Frontend only variables-VITE_GITHUB_APP_CLIENTID=-VITE_GITHUB_APP_NAME=--# Github OAuth & App secrets and private key - you can get it from Github.-GITHUB_APP_CLIENT_SECRET=-GITHUP_APP_WEBHOOK_SECRET=--# It should look like this. Newlines breaks with \n-GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEA7Y+Uwkd8FINSwFktWGdtwCaOAazTDYR8ucEzGyR9r+ooJZhF\nOc32qgDSps6Q5DsqPOzvfhiviqU+et9VF+bJhfdzwJ+Le86QZH1RgsDMoY049XvI\nKSwP........"+COOLIFY_APP_ID=+COOLIFY_SECRET_KEY=+COOLIFY_DATABASE_URL=file:../db/prod.db+COOLIFY_SENTRY_DSN=+COOLIFY_IS_ON="docker"\ No newline at end of filediff --git a/.eslintrc.cjs b/.eslintrc.cjsindex fba3861946..3ccf435f02 100644--- a/.eslintrc.cjs+++ b/.eslintrc.cjs@@ -10,7 +10,7 @@ module.exports = {},parserOptions: {sourceType: 'module',- ecmaVersion: 2019+ ecmaVersion: 2020},env: {browser: true,diff --git a/.gitignore b/.gitignoreindex 82beb85048..38eeaa4795 100644--- a/.gitignore+++ b/.gitignore@@ -1,9 +1,13 @@-/node_modules-/.svelte-/.svelte-kit-/.pnpm-store+.DS_Store+node_modules/build-/functions+/.svelte-kit+/package+.env-.DS_Store-.pnpm-debug.log\ No newline at end of file+.env.prod+.env.stag+/db/*.db+/db/*.db-journal+/data/haproxy/haproxy.cfg+/data/haproxy/haproxy.cfg.lkgdiff --git a/.husky/_/.gitignore b/.husky/_/.gitignorenew file mode 100644index 0000000000..f59ec20aab--- /dev/null+++ b/.husky/_/.gitignore@@ -0,0 +1 @@+*\ No newline at end of filediff --git a/.husky/pre-commit b/.husky/pre-commitnew file mode 100755index 0000000000..dc0378c348--- /dev/null+++ b/.husky/pre-commit@@ -0,0 +1,4 @@+#!/bin/sh+. "$(dirname "$0")/_/husky.sh"++yarn lint-staged\ No newline at end of filediff --git a/.lintstagedrc.json b/.lintstagedrc.jsonnew file mode 100644index 0000000000..f56aabfecd--- /dev/null+++ b/.lintstagedrc.json@@ -0,0 +1,5 @@+{+ "**/*.{js,jsx,ts,tsx,cjs,svelte,json,css,scss,md,yaml}": [+ "prettier --ignore-path .gitignore --write --plugin-search-dir=."+ ]+}diff --git a/.npmrc b/.npmrcdeleted file mode 100644index b6f27f1359..0000000000--- a/.npmrc+++ /dev/null@@ -1 +0,0 @@-engine-strict=truediff --git a/.prettierignore b/.prettierignoredeleted file mode 100644index 82a5e3e129..0000000000--- a/.prettierignore+++ /dev/null@@ -1,5 +0,0 @@-.svelte/**-static/**-build/**-node_modules/**-.svelte-kit/**\ No newline at end of filediff --git a/Dockerfile b/Dockerfilenew file mode 100644index 0000000000..83d513ceca--- /dev/null+++ b/Dockerfile@@ -0,0 +1,28 @@+FROM node:16.14.0-alpine+WORKDIR /app+COPY package*.json .+RUN yarn install+COPY . .+RUN yarn build++FROM node:16.14.0-alpine+WORKDIR /app++RUN apk add --no-cache git openssh-client curl jq cmake sqlite++RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6+RUN pnpm add -g pnpm++RUN curl -fsSL "https://download.docker.com/linux/static/stable/x86_64/docker-20.10.9.tgz" | tar -xzvf - docker/docker -C . --strip-components 1 && mv docker /usr/bin/docker+RUN mkdir -p ~/.docker/cli-plugins/+RUN curl -SL https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose+RUN chmod +x ~/.docker/cli-plugins/docker-compose++COPY --from=0 /app/docker-compose.yaml .+COPY --from=0 /app/build .+COPY --from=0 /app/package.json .+COPY --from=0 /app/node_modules ./node_modules+COPY --from=0 /app/prisma ./prisma++EXPOSE 3000+CMD ["pnpm", "start"]\ No newline at end of filediff --git a/LICENSE b/LICENSEdeleted file mode 100644index 29ebfa545f..0000000000--- a/LICENSE+++ /dev/null@@ -1,661 +0,0 @@- GNU AFFERO GENERAL PUBLIC LICENSE- Version 3, 19 November 2007-- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>- Everyone is permitted to copy and distribute verbatim copies- of this license document, but changing it is not allowed.-- Preamble-- The GNU Affero General Public License is a free, copyleft license for-software and other kinds of works, specifically designed to ensure-cooperation with the community in the case of network server software.-- The licenses for most software and other practical works are designed-to take away your freedom to share and change the works. By contrast,-our General Public Licenses are intended to guarantee your freedom to-share and change all versions of a program--to make sure it remains free-software for all its users.-- When we speak of free software, we are referring to freedom, not-price. Our General Public Licenses are designed to make sure that you-have the freedom to distribute copies of free software (and charge for-them if you wish), that you receive source code or can get it if you-want it, that you can change the software or use pieces of it in new-free programs, and that you know you can do these things.-- Developers that use our General Public Licenses protect your rights-with two steps: (1) assert copyright on the software, and (2) offer-you this License which gives you legal permission to copy, distribute-and/or modify the software.-- A secondary benefit of defending all users' freedom is that-improvements made in alternate versions of the program, if they-receive widespread use, become available for other developers to-incorporate. Many developers of free software are heartened and-encouraged by the resulting cooperation. However, in the case of-software used on network servers, this result may fail to come about.-The GNU General Public License permits making a modified version and-letting the public access it on a server without ever releasing its-source code to the public.-- The GNU Affero General Public License is designed specifically to-ensure that, in such cases, the modified source code becomes available-to the community. It requires the operator of a network server to-provide the source code of the modified version running there to the-users of that server. Therefore, public use of a modified version, on-a publicly accessible server, gives the public access to the source-code of the modified version.-- An older license, called the Affero General Public License and-published by Affero, was designed to accomplish similar goals. This is-a different license, not a version of the Affero GPL, but Affero has-released a new version of the Affero GPL which permits relicensing under-this license.-- The precise terms and conditions for copying, distribution and-modification follow.-- TERMS AND CONDITIONS-- 0. Definitions.-- "This License" refers to version 3 of the GNU Affero General Public License.-- "Copyright" also means copyright-like laws that apply to other kinds of-works, such as semiconductor masks.-- "The Program" refers to any copyrightable work licensed under this-License. Each licensee is addressed as "you". "Licensees" and-"recipients" may be individuals or organizations.-- To "modify" a work means to copy from or adapt all or part of the work-in a fashion requiring copyright permission, other than the making of an-exact copy. The resulting work is called a "modified version" of the-earlier work or a work "based on" the earlier work.-- A "covered work" means either the unmodified Program or a work based-on the Program.-- To "propagate" a work means to do anything with it that, without-permission, would make you directly or secondarily liable for-infringement under applicable copyright law, except executing it on a-computer or modifying a private copy. Propagation includes copying,-distribution (with or without modification), making available to the-public, and in some countries other activities as well.-- To "convey" a work means any kind of propagation that enables other-parties to make or receive copies. Mere interaction with a user through-a computer network, with no transfer of a copy, is not conveying.-- An interactive user interface displays "Appropriate Legal Notices"-to the extent that it includes a convenient and prominently visible-feature that (1) displays an appropriate copyright notice, and (2)-tells the user that there is no warranty for the work (except to the-extent that warranties are provided), that licensees may convey the-work under this License, and how to view a copy of this License. If-the interface presents a list of user commands or options, such as a-menu, a prominent item in the list meets this criterion.-- 1. Source Code.-- The "source code" for a work means the preferred form of the work-for making modifications to it. "Object code" means any non-source-form of a work.-- A "Standard Interface" means an interface that either is an official-standard defined by a recognized standards body, or, in the case of-interfaces specified for a particular programming language, one that-is widely used among developers working in that language.-- The "System Libraries" of an executable work include anything, other-than the work as a whole, that (a) is included in the normal form of-packaging a Major Component, but which is not part of that Major-Component, and (b) serves only to enable use of the work with that-Major Component, or to implement a Standard Interface for which an-implementation is available to the public in source code form. A-"Major Component", in this context, means a major essential component-(kernel, window system, and so on) of the specific operating system-(if any) on which the executable work runs, or a compiler used to-produce the work, or an object code interpreter used to run it.-- The "Corresponding Source" for a work in object code form means all-the source code needed to generate, install, and (for an executable-work) run the object code and to modify the work, including scripts to-control those activities. However, it does not include the work's-System Libraries, or general-purpose tools or generally available free-programs which are used unmodified in performing those activities but-which are not part of the work. For example, Corresponding Source-includes interface definition files associated with source files for-the work, and the source code for shared libraries and dynamically-linked subprograms that the work is specifically designed to require,-such as by intimate data communication or control flow between those-subprograms and other parts of the work.-- The Corresponding Source need not include anything that users-can regenerate automatically from other parts of the Corresponding-Source.-- The Corresponding Source for a work in source code form is that-same work.-- 2. Basic Permissions.-- All rights granted under this License are granted for the term of-copyright on the Program, and are irrevocable provided the stated-conditions are met. This License explicitly affirms your unlimited-permission to run the unmodified Program. The output from running a-covered work is covered by this License only if the output, given its-content, constitutes a covered work. This License acknowledges your-rights of fair use or other equivalent, as provided by copyright law.-- You may make, run and propagate covered works that you do not-convey, without conditions so long as your license otherwise remains-in force. You may convey covered works to others for the sole purpose-of having them make modifications exclusively for you, or provide you-with facilities for running those works, provided that you comply with-the terms of this License in conveying all material for which you do-not control copyright. Those thus making or running the covered works-for you must do so exclusively on your behalf, under your direction-and control, on terms that prohibit them from making any copies of-your copyrighted material outside their relationship with you.-- Conveying under any other circumstances is permitted solely under-the conditions stated below. Sublicensing is not allowed; section 10-makes it unnecessary.-- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.-- No covered work shall be deemed part of an effective technological-measure under any applicable law fulfilling obligations under article-11 of the WIPO copyright treaty adopted on 20 December 1996, or-similar laws prohibiting or restricting circumvention of such-measures.-- When you convey a covered work, you waive any legal power to forbid-circumvention of technological measures to the extent such circumvention-is effected by exercising rights under this License with respect to-the covered work, and you disclaim any intention to limit operation or-modification of the work as a means of enforcing, against the work's-users, your or third parties' legal rights to forbid circumvention of-technological measures.-- 4. Conveying Verbatim Copies.-- You may convey verbatim copies of the Program's source code as you-receive it, in any medium, provided that you conspicuously and-appropriately publish on each copy an appropriate copyright notice;-keep intact all notices stating that this License and any-non-permissive terms added in accord with section 7 apply to the code;-keep intact all notices of the absence of any warranty; and give all-recipients a copy of this License along with the Program.-- You may charge any price or no price for each copy that you convey,-and you may offer support or warranty protection for a fee.-- 5. Conveying Modified Source Versions.-- You may convey a work based on the Program, or the modifications to-produce it from the Program, in the form of source code under the-terms of section 4, provided that you also meet all of these conditions:-- a) The work must carry prominent notices stating that you modified- it, and giving a relevant date.-- b) The work must carry prominent notices stating that it is- released under this License and any conditions added under section- 7. This requirement modifies the requirement in section 4 to- "keep intact all notices".-- c) You must license the entire work, as a whole, under this- License to anyone who comes into possession of a copy. This- License will therefore apply, along with any applicable section 7- additional terms, to the whole of the work, and all its parts,- regardless of how they are packaged. This License gives no- permission to license the work in any other way, but it does not- invalidate such permission if you have separately received it.-- d) If the work has interactive user interfaces, each must display- Appropriate Legal Notices; however, if the Program has interactive- interfaces that do not display Appropriate Legal Notices, your- work need not make them do so.-- A compilation of a covered work with other separate and independent-works, which are not by their nature extensions of the covered work,-and which are not combined with it such as to form a larger program,-in or on a volume of a storage or distribution medium, is called an-"aggregate" if the compilation and its resulting copyright are not-used to limit the access or legal rights of the compilation's users-beyond what the individual works permit. Inclusion of a covered work-in an aggregate does not cause this License to apply to the other-parts of the aggregate.-- 6. Conveying Non-Source Forms.-- You may convey a covered work in object code form under the terms-of sections 4 and 5, provided that you also convey the-machine-readable Corresponding Source under the terms of this License,-in one of these ways:-- a) Convey the object code in, or embodied in, a physical product- (including a physical distribution medium), accompanied by the- Corresponding Source fixed on a durable physical medium- customarily used for software interchange.-- b) Convey the object code in, or embodied in, a physical product- (including a physical distribution medium), accompanied by a- written offer, valid for at least three years and valid for as- long as you offer spare parts or customer support for that product- model, to give anyone who possesses the object code either (1) a- copy of the Corresponding Source for all the software in the- product that is covered by this License, on a durable physical- medium customarily used for software interchange, for a price no- more than your reasonable cost of physically performing this- conveying of source, or (2) access to copy the- Corresponding Source from a network server at no charge.-- c) Convey individual copies of the object code with a copy of the- written offer to provide the Corresponding Source. This- alternative is allowed only occasionally and noncommercially, and- only if you received the object code with such an offer, in accord- with subsection 6b.-- d) Convey the object code by offering access from a designated- place (gratis or for a charge), and offer equivalent access to the- Corresponding Source in the same way through the same place at no- further charge. You need not require recipients to copy the- Corresponding Source along with the object code. If the place to- copy the object code is a network server, the Corresponding Source- may be on a different server (operated by you or a third party)- that supports equivalent copying facilities, provided you maintain- clear directions next to the object code saying where to find the- Corresponding Source. Regardless of what server hosts the- Corresponding Source, you remain obligated to ensure that it is- available for as long as needed to satisfy these requirements.-- e) Convey the object code using peer-to-peer transmission, provided- you inform other peers where the object code and Corresponding- Source of the work are being offered to the general public at no- charge under subsection 6d.-- A separable portion of the object code, whose source code is excluded-from the Corresponding Source as a System Library, need not be-included in conveying the object code work.-- A "User Product" is either (1) a "consumer product", which means any-tangible personal property which is normally used for personal, family,-or household purposes, or (2) anything designed or sold for incorporation-into a dwelling. In determining whether a product is a consumer product,-doubtful cases shall be resolved in favor of coverage. For a particular-product received by a particular user, "normally used" refers to a-typical or common use of that class of product, regardless of the status-of the particular user or of the way in which the particular user-actually uses, or expects or is expected to use, the product. A product-is a consumer product regardless of whether the product has substantial-commercial, industrial or non-consumer uses, unless such uses represent-the only significant mode of use of the product.-- "Installation Information" for a User Product means any methods,-procedures, authorization keys, or other information required to install-and execute modified versions of a covered work in that User Product from-a modified version of its Corresponding Source. The information must-suffice to ensure that the continued functioning of the modified object-code is in no case prevented or interfered with solely because-modification has been made.-- If you convey an object code work under this section in, or with, or-specifically for use in, a User Product, and the conveying occurs as-part of a transaction in which the right of possession and use of the-User Product is transferred to the recipient in perpetuity or for a-fixed term (regardless of how the transaction is characterized), the-Corresponding Source conveyed under this section must be accompanied-by the Installation Information. But this requirement does not apply-if neither you nor any third party retains the ability to install-modified object code on the User Product (for example, the work has-been installed in ROM).-- The requirement to provide Installation Information does not include a-requirement to continue to provide support service, warranty, or updates-for a work that has been modified or installed by the recipient, or for-the User Product in which it has been modified or installed. Access to a-network may be denied when the modification itself materially and-adversely affects the operation of the network or violates the rules and-protocols for communication across the network.-- Corresponding Source conveyed, and Installation Information provided,-in accord with this section must be in a format that is publicly-documented (and with an implementation available to the public in-source code form), and must require no special password or key for-unpacking, reading or copying.-- 7. Additional Terms.-- "Additional permissions" are terms that supplement the terms of this-License by making exceptions from one or more of its conditions.-Additional permissions that are applicable to the entire Program shall-be treated as though they were included in this License, to the extent-that they are valid under applicable law. If additional permissions-apply only to part of the Program, that part may be used separately-under those permissions, but the entire Program remains governed by-this License without regard to the additional permissions.-- When you convey a copy of a covered work, you may at your option-remove any additional permissions from that copy, or from any part of-it. (Additional permissions may be written to require their own-removal in certain cases when you modify the work.) You may place-additional permissions on material, added by you to a covered work,-for which you have or can give appropriate copyright permission.-- Notwithstanding any other provision of this License, for material you-add to a covered work, you may (if authorized by the copyright holders of-that material) supplement the terms of this License with terms:-- a) Disclaiming warranty or limiting liability differently from the- terms of sections 15 and 16 of this License; or-- b) Requiring preservation of specified reasonable legal notices or- author attributions in that material or in the Appropriate Legal- Notices displayed by works containing it; or-- c) Prohibiting misrepresentation of the origin of that material, or- requiring that modified versions of such material be marked in- reasonable ways as different from the original version; or-- d) Limiting the use for publicity purposes of names of licensors or- authors of the material; or-- e) Declining to grant rights under trademark law for use of some- trade names, trademarks, or service marks; or-- f) Requiring indemnification of licensors and authors of that- material by anyone who conveys the material (or modified versions of- it) with contractual assumptions of liability to the recipient, for- any liability that these contractual assumptions directly impose on- those licensors and authors.-- All other non-permissive additional terms are considered "further-restrictions" within the meaning of section 10. If the Program as you-received it, or any part of it, contains a notice stating that it is-governed by this License along with a term that is a further-restriction, you may remove that term. If a license document contains-a further restriction but permits relicensing or conveying under this-License, you may add to a covered work material governed by the terms-of that license document, provided that the further restriction does-not survive such relicensing or conveying.-- If you add terms to a covered work in accord with this section, you-must place, in the relevant source files, a statement of the-additional terms that apply to those files, or a notice indicating-where to find the applicable terms.-- Additional terms, permissive or non-permissive, may be stated in the-form of a separately written license, or stated as exceptions;-the above requirements apply either way.-- 8. Termination.-- You may not propagate or modify a covered work except as expressly-provided under this License. Any attempt otherwise to propagate or-modify it is void, and will automatically terminate your rights under-this License (including any patent licenses granted under the third-paragraph of section 11).-- However, if you cease all violation of this License, then your-license from a particular copyright holder is reinstated (a)-provisionally, unless and until the copyright holder explicitly and-finally terminates your license, and (b) permanently, if the copyright-holder fails to notify you of the violation by some reasonable means-prior to 60 days after the cessation.-- Moreover, your license from a particular copyright holder is-reinstated permanently if the copyright holder notifies you of the-violation by some reasonable means, this is the first time you have-received notice of violation of this License (for any work) from that-copyright holder, and you cure the violation prior to 30 days after-your receipt of the notice.-- Termination of your rights under this section does not terminate the-licenses of parties who have received copies or rights from you under-this License. If your rights have been terminated and not permanently-reinstated, you do not qualify to receive new licenses for the same-material under section 10.-- 9. Acceptance Not Required for Having Copies.-- You are not required to accept this License in order to receive or-run a copy of the Program. Ancillary propagation of a covered work-occurring solely as a consequence of using peer-to-peer transmission-to receive a copy likewise does not require acceptance. However,-nothing other than this License grants you permission to propagate or-modify any covered work. These actions infringe copyright if you do-not accept this License. Therefore, by modifying or propagating a-covered work, you indicate your acceptance of this License to do so.-- 10. Automatic Licensing of Downstream Recipients.-- Each time you convey a covered work, the recipient automatically-receives a license from the original licensors, to run, modify and-propagate that work, subject to this License. You are not responsible-for enforcing compliance by third parties with this License.-- An "entity transaction" is a transaction transferring control of an-organization, or substantially all assets of one, or subdividing an-organization, or merging organizations. If propagation of a covered-work results from an entity transaction, each party to that-transaction who receives a copy of the work also receives whatever-licenses to the work the party's predecessor in interest had or could-give under the previous paragraph, plus a right to possession of the-Corresponding Source of the work from the predecessor in interest, if-the predecessor has it or can get it with reasonable efforts.-- You may not impose any further restrictions on the exercise of the-rights granted or affirmed under this License. For example, you may-not impose a license fee, royalty, or other charge for exercise of-rights granted under this License, and you may not initiate litigation-(including a cross-claim or counterclaim in a lawsuit) alleging that-any patent claim is infringed by making, using, selling, offering for-sale, or importing the Program or any portion of it.-- 11. Patents.-- A "contributor" is a copyright holder who authorizes use under this-License of the Program or a work on which the Program is based. The-work thus licensed is called the contributor's "contributor version".-- A contributor's "essential patent claims" are all patent claims-owned or controlled by the contributor, whether already acquired or-hereafter acquired, that would be infringed by some manner, permitted-by this License, of making, using, or selling its contributor version,-but do not include claims that would be infringed only as a-consequence of further modification of the contributor version. For-purposes of this definition, "control" includes the right to grant-patent sublicenses in a manner consistent with the requirements of-this License.-- Each contributor grants you a non-exclusive, worldwide, royalty-free-patent license under the contributor's essential patent claims, to-make, use, sell, offer for sale, import and otherwise run, modify and-propagate the contents of its contributor version.-- In the following three paragraphs, a "patent license" is any express-agreement or commitment, however denominated, not to enforce a patent-(such as an express permission to practice a patent or covenant not to-sue for patent infringement). To "grant" such a patent license to a-party means to make such an agreement or commitment not to enforce a-patent against the party.-- If you convey a covered work, knowingly relying on a patent license,-and the Corresponding Source of the work is not available for anyone-to copy, free of charge and under the terms of this License, through a-publicly available network server or other readily accessible means,-then you must either (1) cause the Corresponding Source to be so-available, or (2) arrange to deprive yourself of the benefit of the-patent license for this particular work, or (3) arrange, in a manner-consistent with the requirements of this License, to extend the patent-license to downstream recipients. "Knowingly relying" means you have-actual knowledge that, but for the patent license, your conveying the-covered work in a country, or your recipient's use of the covered work-in a country, would infringe one or more identifiable patents in that-country that you have reason to believe are valid.-- If, pursuant to or in connection with a single transaction or-arrangement, you convey, or propagate by procuring conveyance of, a-covered work, and grant a patent license to some of the parties-receiving the covered work authorizing them to use, propagate, modify-or convey a specific copy of the covered work, then the patent license-you grant is automatically extended to all recipients of the covered-work and works based on it.-- A patent license is "discriminatory" if it does not include within-the scope of its coverage, prohibits the exercise of, or is-conditioned on the non-exercise of one or more of the rights that are-specifically granted under this License. You may not convey a covered-work if you are a party to an arrangement with a third party that is-in the business of distributing software, under which you make payment-to the third party based on the extent of your activity of conveying-the work, and under which the third party grants, to any of the-parties who would receive the covered work from you, a discriminatory-patent license (a) in connection with copies of the covered work-conveyed by you (or copies made from those copies), or (b) primarily-for and in connection with specific products or compilations that-contain the covered work, unless you entered into that arrangement,-or that patent license was granted, prior to 28 March 2007.-- Nothing in this License shall be construed as excluding or limiting-any implied license or other defenses to infringement that may-otherwise be available to you under applicable patent law.-- 12. No Surrender of Others' Freedom.-- If conditions are imposed on you (whether by court order, agreement or-otherwise) that contradict the conditions of this License, they do not-excuse you from the conditions of this License. If you cannot convey a-covered work so as to satisfy simultaneously your obligations under this-License and any other pertinent obligations, then as a consequence you may-not convey it at all. For example, if you agree to terms that obligate you-to collect a royalty for further conveying from those to whom you convey-the Program, the only way you could satisfy both those terms and this-License would be to refrain entirely from conveying the Program.-- 13. Remote Network Interaction; Use with the GNU General Public License.-- Notwithstanding any other provision of this License, if you modify the-Program, your modified version must prominently offer all users-interacting with it remotely through a computer network (if your version-supports such interaction) an opportunity to receive the Corresponding-Source of your version by providing access to the Corresponding Source-from a network server at no charge, through some standard or customary-means of facilitating copying of software. This Corresponding Source-shall include the Corresponding Source for any work covered by version 3-of the GNU General Public License that is incorporated pursuant to the-following paragraph.-- Notwithstanding any other provision of this License, you have-permission to link or combine any covered work with a work licensed-under version 3 of the GNU General Public License into a single-combined work, and to convey the resulting work. The terms of this-License will continue to apply to the part which is the covered work,-but the work with which it is combined will remain governed by version-3 of the GNU General Public License.-- 14. Revised Versions of this License.-- The Free Software Foundation may publish revised and/or new versions of-the GNU Affero General Public License from time to time. Such new versions-will be similar in spirit to the present version, but may differ in detail to-address new problems or concerns.-- Each version is given a distinguishing version number. If the-Program specifies that a certain numbered version of the GNU Affero General-Public License "or any later version" applies to it, you have the-option of following the terms and conditions either of that numbered-version or of any later version published by the Free Software-Foundation. If the Program does not specify a version number of the-GNU Affero General Public License, you may choose any version ever published-by the Free Software Foundation.-- If the Program specifies that a proxy can decide which future-versions of the GNU Affero General Public License can be used, that proxy's-public statement of acceptance of a version permanently authorizes you-to choose that version for the Program.-- Later license versions may give you additional or different-permissions. However, no additional obligations are imposed on any-author or copyright holder as a result of your choosing to follow a-later version.-- 15. Disclaimer of Warranty.-- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.-- 16. Limitation of Liability.-- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF-SUCH DAMAGES.-- 17. Interpretation of Sections 15 and 16.-- If the disclaimer of warranty and limitation of liability provided-above cannot be given local legal effect according to their terms,-reviewing courts shall apply local law that most closely approximates-an absolute waiver of all civil liability in connection with the-Program, unless a warranty or assumption of liability accompanies a-copy of the Program in return for a fee.-- END OF TERMS AND CONDITIONS-- How to Apply These Terms to Your New Programs-- If you develop a new program, and you want it to be of the greatest-possible use to the public, the best way to achieve this is to make it-free software which everyone can redistribute and change under these terms.-- To do so, attach the following notices to the program. It is safest-to attach them to the start of each source file to most effectively-state the exclusion of warranty; and each file should have at least-the "copyright" line and a pointer to where the full notice is found.-- <one line to give the program's name and a brief idea of what it does.>- Copyright (C) <year> <name of author>-- This program is free software: you can redistribute it and/or modify- it under the terms of the GNU Affero General Public License as published- by the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- This program is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU Affero General Public License for more details.-- You should have received a copy of the GNU Affero General Public License- along with this program. If not, see <https://www.gnu.org/licenses/>.--Also add information on how to contact you by electronic and paper mail.-- If your software can interact with users remotely through a computer-network, you should also make sure that it provides a way for users to-get its source. For example, if your program is a web application, its-interface could display a "Source" link that leads users to an archive-of the code. There are many ways you could offer source, and different-solutions will be better for different programs; see section 13 for the-specific requirements.-- You should also get your employer (if you work as a programmer) or school,-if any, to sign a "copyright disclaimer" for the program, if necessary.-For more information on this, and how to apply and follow the GNU AGPL, see-<https://www.gnu.org/licenses/>.\ No newline at end of filediff --git a/README.md b/README.mdindex 6295f42a6d..d0bdd2563b 100644--- a/README.md+++ b/README.md@@ -2,57 +2,11 @@An open-source, hassle-free, self-hostable Heroku & Netlify alternative.-## Demo+## Status-[Small video](https://cdn.coollabs.io/assets/coolify/video/coolify.webm)+This version is not usable yet. But it will be:-## Installation--Installation is automated with the following command:--```bash-/bin/bash -c "$(curl -fsSL https://get.coollabs.io/coolify/install.sh)"-```--## Features--- Deploy Pull Request automatically, so you can review them quickly!-- You can deploy any of the following applications, databases and services easily.--(constantly growing lists)--### Applications--With Github integration--- Static sites-- NodeJS-- VueJS-- NuxtJS-- NextJS-- React/Preact-- NextJS-- Gatsby-- Svelte-- PHP-- Rust-- or any custom dockerfile--### Databases--- MongoDB-- MySQL-- PostgreSQL-- CouchDB-- Redis--### Services--- [WordPress](https://wordpress.org)-- [Plausible Analytics](https://plausible.io)-- [NocoDB](https://nocodb.com)-- [VSCode Server](https://github.com/cdr/code-server)-- [MinIO](https://min.io)+## Supportdiff --git a/data/docker/daemon.json b/data/docker/daemon.jsonnew file mode 100644index 0000000000..d1a836defb--- /dev/null+++ b/data/docker/daemon.json@@ -0,0 +1,11 @@+{+ "log-driver": "json-file",+ "log-opts": {+ "max-size": "100m",+ "max-file": "5"+ },+ "features": {+ "buildkit": true+ },+ "live-restore": true+}diff --git a/data/haproxy/dataplaneapi.hcl b/data/haproxy/dataplaneapi.hclnew file mode 100644index 0000000000..e914c13995--- /dev/null+++ b/data/haproxy/dataplaneapi.hcl@@ -0,0 +1,29 @@+config_version = 2+name = "easy_gar"+mode = "single"+status = "null"++dataplaneapi {+ host = "0.0.0.0"+ port = 5555++ transaction {+ transaction_dir = "/tmp/haproxy"+ }++ advertised {+ api_address = ""+ api_port = 0+ }+}++haproxy {+ config_file = "/usr/local/etc/haproxy/haproxy.cfg"+ haproxy_bin = "/usr/local/sbin/haproxy"++ reload {+ reload_delay = 2+ reload_cmd = "kill -HUP 1"+ restart_cmd = "kill -SIGUSR2 1"+ }+}diff --git a/data/haproxy/haproxy.cfg-http.template b/data/haproxy/haproxy.cfg-http.templatenew file mode 100644index 0000000000..72fdece7a4--- /dev/null+++ b/data/haproxy/haproxy.cfg-http.template@@ -0,0 +1,19 @@+global+ log stdout format raw local0 debug++defaults+ mode http+ log global+ timeout http-request 60s+ timeout connect 10s+ timeout client 60s+ timeout server 60s++frontend "${APP}"+ mode http+ bind *:"${PORT}" name "${APP}"+ default_backend "${APP}"++backend "${APP}"+ mode http+ server "${APP}" "${APP}":"${PRIVATE_PORT}" checkdiff --git a/data/haproxy/haproxy.cfg-tcp.template b/data/haproxy/haproxy.cfg-tcp.templatenew file mode 100644index 0000000000..b45644d036--- /dev/null+++ b/data/haproxy/haproxy.cfg-tcp.template@@ -0,0 +1,15 @@+global+ log stdout format raw local0 debug++defaults+ mode tcp+ log global++frontend "${APP}"+ mode tcp+ bind *:"${PORT}" name "${APP}"+ default_backend "${APP}"++backend "${APP}"+ mode tcp+ server "${APP}" "${APP}":"${PRIVATE_PORT}" checkdiff --git a/data/haproxy/haproxy.cfg.template b/data/haproxy/haproxy.cfg.templatenew file mode 100644index 0000000000..c39cb7878c--- /dev/null+++ b/data/haproxy/haproxy.cfg.template@@ -0,0 +1,38 @@+global+ stats socket /var/run/api.sock user haproxy group haproxy mode 660 level admin expose-fd listeners+ log stdout format raw local0 debug++defaults+ mode http+ log global+ timeout http-request 60s+ timeout connect 10s+ timeout client 60s+ timeout server 60s++userlist haproxy-dataplaneapi+ user admin insecure-password "${HAPROXY_PASSWORD}"++frontend http+ mode http+ bind :80+ bind :443 ssl crt /usr/local/etc/haproxy/ssl/ alpn h2,http/1.1+ acl is_certbot path_beg /.well-known/acme-challenge/+ use_backend backend-certbot if is_certbot+ use_backend %[req.hdr(host),lower]++frontend stats+ bind *:8404+ stats enable+ stats uri /+ stats refresh 5s+ stats admin if TRUE+ stats auth "${HAPROXY_USERNAME}:${HAPROXY_PASSWORD}"++backend backend-certbot+ mode http+ server certbot host.docker.internal:9080++program api+ command /usr/bin/dataplaneapi -f /usr/local/etc/haproxy/dataplaneapi.hcl --userlist haproxy-dataplaneapi+ no option start-on-reloaddiff --git a/data/haproxy/ssl/default.pem b/data/haproxy/ssl/default.pemnew file mode 100644index 0000000000..77e0746ce1--- /dev/null+++ b/data/haproxy/ssl/default.pem@@ -0,0 +1,81 @@+-----BEGIN CERTIFICATE-----+MIIFETCCAvkCFE/5JtU5geT5hOjFuQPiLgCYHwsOMA0GCSqGSIb3DQEBCwUAMEUx+CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl+cm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMjExMDExMDkwNzQ1WhcNMzExMDA5MDkw+NzQ1WjBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UE+CgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIICIjANBgkqhkiG9w0BAQEFAAOC+Ag8AMIICCgKCAgEArEZDhvc3ew2Gb8pvJlUrh5x+L5iqNxDYU3cOcOgeELCmOyAS+cH+/1xrsHQI05xWPpz6VAja2NKl4OP90getPPkiQV1xAg5/gsOsRL8Pi/MwvQKfZ+ObyW3t+sfFb1K3sVnm8bgk5F9OIVyAtzAx+Y53muEJsHOHpaEidnwbY2VE0zQB/G+DBQovrMefAwmH4RPqFor6NzFMKVRi33pQjYmcfCVFZylrDeCn8T7llV0lrnWqv6z+sGKfL3E4nHvyh/RsGNOXy+XQMxB9SA3j6hFTNtgQIPO/lxptz/+BLZoUt48nHZtr+sc5j+3sn8c1O9e6MjI/1q8lvZsk7ZsWCGSwCOvJ9LnxCWOEQUUfqIvGLsk7NJQgf+IkodZH9sW5Sjlro21+WBf3nvqlZ8g7r6K1RJOA8AtUiCaN/+o65t86WkwCSwQXcm++nArcwddOx2HN9sFrjJ59N1eYEDGmyK3BdppYuVXay705PmxotR1hCBvnXOb34dn+gZxsxFTohr97JvEdNtGSNz4USyZPjgIMF/Gu8ruh0gQ1byhmayRqMGEqMAh58Lvb+3HYsd3Bf+LB9PpaXLAdKzsTZ8a28zyDYo8a70h7iBRxhmFwa+Df+pSmUEdzhejfx+7jEslhBQSQDmllaHrHc1G6H/w/u+04vi1joaLeLEGQclinKLeU88s9j3zzUCAwEA+ATANBgkqhkiG9w0BAQsFAAOCAgEAGQED96wBGzbMUlk9mIvZeLerzEAB3YfgfAYa+EAi79QHxM8UX06xmA2xtGvJSvlU8Xods9vxpBmIUnbDRTIAHNDApT19+vPg/iSfQ+1J9Fo4b5kjmWL6SalEdYcxqH9V/QndHta4MXP91u/ZsJ/exwDTZFatXsfGkPjUmN+Xp+Ip6iQg7+kV3JpRnMSbevj2Oujs7qTAdQedH38ZTNS0AaM5gvZyQkccCTKNBQ4+3O8MhCau7U0EUirndqsQXa0D3o78FpKztLNXSM7919jU2y36kMrWXfArfrBKHJ9b+nZeO7nkbHgvmVS8NTg9pR7L7u+YXTa2p1H2ZnpMQvruV7iL/Pb1H2N68UdvnQScL+sgacGSzM6b6PVdWRbECiuzC0UyWLZo/LoU3DQFGoiDQ4e/B3+TMrvgFI0CnpAQ4w+qiaVFJlRQeF4GaS4qHsN28OBliFATB3TXONFnz1aVkQlEHuh2+JbuL1b1lxvlX5t+gBbu/GgAcP4Uy2z4PoDmempAvNi2kCcLB98m+jbFSMSB3nkrdj6MzyN7kW9bhk3T+ClimxDmc23seprwLcxJUPP5q+HRB1VLKXLwIYxu+Up3g29d4k1Iy9nUUP9lITLTk+blJxZ2BPuQqTLzyqmAEWa1HxljFC1b7oMp9a98PbxC3MxUggM7zx/rgXWxM8osib+uwSZmw0=+-----END CERTIFICATE-----+-----BEGIN RSA PRIVATE KEY-----+MIIJKAIBAAKCAgEArEZDhvc3ew2Gb8pvJlUrh5x+L5iqNxDYU3cOcOgeELCmOyAS+cH+/1xrsHQI05xWPpz6VAja2NKl4OP90getPPkiQV1xAg5/gsOsRL8Pi/MwvQKfZ+ObyW3t+sfFb1K3sVnm8bgk5F9OIVyAtzAx+Y53muEJsHOHpaEidnwbY2VE0zQB/G+DBQovrMefAwmH4RPqFor6NzFMKVRi33pQjYmcfCVFZylrDeCn8T7llV0lrnWqv6z+sGKfL3E4nHvyh/RsGNOXy+XQMxB9SA3j6hFTNtgQIPO/lxptz/+BLZoUt48nHZtr+sc5j+3sn8c1O9e6MjI/1q8lvZsk7ZsWCGSwCOvJ9LnxCWOEQUUfqIvGLsk7NJQgf+IkodZH9sW5Sjlro21+WBf3nvqlZ8g7r6K1RJOA8AtUiCaN/+o65t86WkwCSwQXcm++nArcwddOx2HN9sFrjJ59N1eYEDGmyK3BdppYuVXay705PmxotR1hCBvnXOb34dn+gZxsxFTohr97JvEdNtGSNz4USyZPjgIMF/Gu8ruh0gQ1byhmayRqMGEqMAh58Lvb+3HYsd3Bf+LB9PpaXLAdKzsTZ8a28zyDYo8a70h7iBRxhmFwa+Df+pSmUEdzhejfx+7jEslhBQSQDmllaHrHc1G6H/w/u+04vi1joaLeLEGQclinKLeU88s9j3zzUCAwEA+AQKCAgEAm1/z33Jwk4crTQAjJ0uBqxm1pW/ndSq4MO8cEzEGjL8F7iWK+/P8LiGV++sPWuuRzX7/N3OVDiFOgnqeniNWV7vK7XE9T0GMN4ALiyVW/D4mIxKOeA7jXycOq+aap0DPdCFFbZVLkL10Vhp77LyHFjEsJn/4oTBRk0y1LG/as9bOMD6j29/X7hEL20+LOU4LQzEW26YU7lqD+nKlijFjHYSTolRrOBPe/fE1BxxXLFOKfMKbcaygc8xCzTu+fhQ8Nep45BtSuQ9Yq/WfSLFecemWR8yvH0k37yxjBknHVD23maZ+/PEEPKWM/2+g+IzGsmZrBILVmOb2/v9CWxqY0JEfQ6aU/nLW1ZiXSOIPmKEooK/hPVxFIyQ1yET4G+kQZ5RroY/QDrI14ms8P0iDzZ8K3EFKUyjiBbc83Mb0YIZ4hKd76gioOUIPeEQB+y+QLZ8Cb9YS3V8uIOJg+F4xlpJSePAZphfSxRLojSiKUeCs8gNUxGz0zwiMNf1p76F+8CaLgvSwT/cgQjWitMeeE1Ha+8lY8VzESmd10gPk2uES/qdrmMhwFwovPqqrtMqj+kMrFKNy7Crka6me3dhKEtryRTk5ho2IS/VCy/eXQ7lUW8Cl4uFxmjpHYSJMqDWvC+vu1p3/B1psSZIy2V2M9QqwZCysHqvGJMOCvYmnc6T62+kDRKQ7ECggEBAOS/1ptA+75OBAsHLovkspiCvn3gb/VTvH6LOvxYTohjr5iBeX137vg0aR1rg0jwcdf8EEJYw+4YxOid7KmV7O25ujzduQgwpVgujnJAeBLeLDC5dVbq3PQah61AvR2O/7t+Ls3oxi+cWh/OHC6SeZ/n406cxSCCUpVwtgHTaNFzaSmpDdEOSbjvXjQQjiRsG7j/1u64riq+RlJ/hIUlcys0g94yeN/5lPaNfsq0+vTSAYuTVVXVbEntwWcZVZxnQJviZVgJ99zM+RzE3sprvvr+I5QQ4FRMn0W9U7gblSJd5FGEL8gye4SRd+LxoUL4DR6pfuwd0vlXA+g+dgiOKoHm2Bb8cCggEBAMDMHMNR6uipdMivPjBTlklnaYd9SY3c5x65yNtx4CNh+rXyvy/6YvME7PPnKQZ8TQ4DkbVDUCAF7wnyAJJ7eWMav3bNlqWWjzaBvQz4Fn0XG+/1W5R1CoJ9DW5FY3f9efJzQTmfn6dIlCx1gW7XfVBZQqI1LORMWUYenk0KAvjlg2+UHYYl/BT1RhtYyzOJHto1PaUvCNDiOiDWAkTpLigYm7hGgVmcSwbo4F54SNUHdV7+yz3CorCM4VsEYYSL80WHYxf/Zc+mcIDoWOdog0iEeK/Zu++yG5lPRxC1862GmsZA+J06BMqX+NVGOfiGcVaGH+SZJXeFcrr7F8ZWp6y38QSMCggEAJwzo4hAv1gqMIfFV+nRwWMDZLDwIYOUupJu4MiQRJA+AhpRz3QuAbDbmSvNzshv6E1kgnXLxzhLRTrQkB+LcI6k1NfbUA6XqVCd+gdqnpPDwslC2y2PE3Jc62kTXBBjJZ4SfEN/QFBQwmU5Qmo+XAUlg8KaqsGYPGxvmtmEU38zIAyitByddRoj2mATLf0RFZ0ulsZMtiG7Z5IFWYWP+J60LZf9Py0ycNYrqPkivHuRLBzzbsI+CsQw5nBQjHVQzH2mCy4jIG5V0Ad70Sqbq+9V+1WQcJ8f82Lb9d8ydpQRKWfArCA42L+d1g/SkBv65nqZo2H4u6goEfA3zjYW45+44/ZOQKCAQB440MhwYqe6ioc76z51l+ElUAZQZjOR/XvUSS9XHDjHosOhJhPgmvQ+aZl5MrXkzcpk1lYo+Vovu+8d66eKqfZWVs2XgCYwYf48G6e5CwNsWDOgB7XMwDN/+Ak9YNCKIC/Yj9Cp3EPDjZCjkdjPeEIcX+Tf+4vFCRiEC7INX/ZmufBgFhLQ4cAhM+8cHexT8g1oG6P1acces1h626u0NstLwjtCeBvVM3CfmC5O4jHco7Iw00I4epVhyz+2lJfLvWR4itjT7QB+OXQHmAocWLoJJAcC1WJHU+q2IfB1aT+aElCB9XdpqsgY/4A+rm0uG/2hdEXoGNaxyVCUtD8fzdR2GBarAoIBACCYXXREMYb6i1TbR5Q2LvVQUPsO+Hgnbr+PLmx93rfUzDcr5r+cJgryjYQDKJTRleDJhg80M3RYOq+IOdl6yxOmRATmJ+ZDgwRVD1F6VFxBJePcAW30FI5CoBogsHaZQDKGsopEaDRLK5E3QHUVG5qj323RdI+Unf1++wI4nw+qwsVf1gSTcAdzq29v3NIWUyvvrmTNO4MxFTt0/lqkCsdT/2EFQDB+/yQ1HCtQQjXE1xlYh0BnMZp9+4FmrlMC9Oj5H0dDSWmInPION0ft8/SjBj4TQ5Qi+2DUo1WOWQnVR8Bxz0B8McXS+dOmgLe8ws4/ez7DoEVqHTgirKqBg5qRFQKw=+-----END RSA PRIVATE KEY-----diff --git a/db/.gitkeep b/db/.gitkeepnew file mode 100644index 0000000000..e69de29bb2diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yamlnew file mode 100644index 0000000000..41f287f2b8--- /dev/null+++ b/docker-compose-dev.yaml@@ -0,0 +1,20 @@+version: '3.8'++services:+ redis:+ image: 'bitnami/redis:6.2'+ container_name: coolify-redis+ environment:+ - ALLOW_EMPTY_PASSWORD=yes+ networks:+ - coolify-infra+ ports:+ - target: 6379+ published: 6379+ protocol: tcp+ mode: host++networks:+ coolify-infra:+ attachable: true+ name: coolify-infradiff --git a/docker-compose-dev.yml b/docker-compose-dev.ymldeleted file mode 100644index 57cc0f1fb9..0000000000--- a/docker-compose-dev.yml+++ /dev/null@@ -1,84 +0,0 @@-version: '3.8'--services:- proxy:- image: traefik:v2.4- hostname: coollabs-proxy- ports:- - target: 80- published: 80- protocol: tcp- mode: host- - target: 443- published: 443- protocol: tcp- mode: host- - target: 8080- published: 8080- protocol: tcp- mode: host- command:- - --api.insecure=true- - --api.dashboard=true- - --api.debug=true- - --log.level=ERROR- - --providers.docker=true- - --providers.docker.swarmMode=true- - --providers.docker.exposedbydefault=false- - --providers.docker.network=coollabs- - --providers.docker.swarmModeRefreshSeconds=1s- - --entrypoints.web.address=:80- - --entrypoints.websecure.address=:443- volumes:- - /var/run/docker.sock:/var/run/docker.sock- networks:- - coollabs- deploy:- update_config:- parallelism: 1- delay: 10s- order: start-first- replicas: 1- placement:- constraints:- - node.role == manager- labels:- - 'traefik.enable=true'- - 'traefik.http.routers.api.entrypoints=websecure'- - 'traefik.http.routers.api.service=api@internal'- - 'traefik.http.routers.api.middlewares=auth'- - 'traefik.http.services.traefik.loadbalancer.server.port=80'-- # Global redirect www to non-www- - 'traefik.http.routers.www-catchall.rule=hostregexp(`{host:www.(.+)}`)'- - 'traefik.http.routers.www-catchall.entrypoints=web'- - 'traefik.http.routers.www-catchall.middlewares=redirect-www-to-nonwww'- - "traefik.http.middlewares.redirect-www-to-nonwww.redirectregex.regex=^http://(?:www\\.)?(.+)"- - 'traefik.http.middlewares.redirect-www-to-nonwww.redirectregex.replacement=http://$${1}'- mongodb:- image: bitnami/mongodb:4.4- hostname: coollabs-mongodb- ports:- - target: 27017- published: 27017- protocol: tcp- mode: host- environment:- - MONGODB_DISABLE_SYSTEM_LOG=true- - MONGODB_ROOT_PASSWORD=developmentPassword4db- - MONGODB_USERNAME=supercooldbuser- - MONGODB_PASSWORD=developmentPassword4db- - MONGODB_DATABASE=coolify- volumes:- - coollabs-mongodb-data:/bitnami/mongodb- networks:- - coollabs--volumes:- coollabs-mongodb-data: {}--networks:- coollabs:- driver: overlay- name: coollabs- external: truediff --git a/docker-compose-haproxy.yaml b/docker-compose-haproxy.yamlnew file mode 100644index 0000000000..66b35acd64--- /dev/null+++ b/docker-compose-haproxy.yaml@@ -0,0 +1,23 @@+version: '3.8'++services:+ haproxy:+ image: coollabsio/coolify-haproxy-alpine:latest+ container_name: coolify-haproxy+ extra_hosts:+ - 'host.docker.internal:host-gateway'+ networks:+ - coolify+ volumes:+ - './data/haproxy/:/usr/local/etc/haproxy/'+ ports:+ - '80:80'+ - '443:443'+ - '8404:8404'+ - '5555:5555'+ - '3306:3306'++networks:+ coolify:+ attachable: true+ name: coolifydiff --git a/docker-compose.yaml b/docker-compose.yamlnew file mode 100644index 0000000000..66160f0e67--- /dev/null+++ b/docker-compose.yaml@@ -0,0 +1,43 @@+version: '3.8'++services:+ coolify:+ image: coollabsio/coolify:latest+ restart: always+ container_name: coolify+ ports:+ - target: 3000+ published: 3000+ protocol: tcp+ mode: host+ volumes:+ - 'coolify-db:/app/db'+ - 'coolify-ssl-certs:/app/ssl'+ - 'coolify-letsencrypt:/etc/letsencrypt'+ - '/var/run/docker.sock:/var/run/docker.sock'+ env_file:+ - '.env'+ networks:+ - coolify-infra+ depends_on: ['redis']+ redis:+ image: bitnami/redis:6.2+ restart: always+ container_name: coolify-redis+ environment:+ - ALLOW_EMPTY_PASSWORD=yes+ networks:+ - coolify-infra++networks:+ coolify-infra:+ attachable: true+ name: coolify-infra++volumes:+ coolify-db:+ name: coolify-db+ coolify-ssl-certs:+ name: coolify-ssl-certs+ coolify-letsencrypt:+ name: coolify-letsencryptdiff --git a/haproxy-http.Dockerfile b/haproxy-http.Dockerfilenew file mode 100644index 0000000000..089ae0f965--- /dev/null+++ b/haproxy-http.Dockerfile@@ -0,0 +1,6 @@+FROM haproxytech/haproxy-alpine:2.5+RUN mkdir -p /usr/local/etc/haproxy/ssl /usr/local/etc/haproxy/maps /usr/local/etc/haproxy/spoe++COPY data/haproxy/haproxy.cfg-http.template /usr/local/etc/haproxy/haproxy.cfg+COPY data/haproxy/dataplaneapi.hcl /usr/local/etc/haproxy/dataplaneapi.hcl+COPY data/haproxy/ssl/default.pem /usr/local/etc/haproxy/ssl/default.pem\ No newline at end of filediff --git a/haproxy-tcp.Dockerfile b/haproxy-tcp.Dockerfilenew file mode 100644index 0000000000..bddcbe5410--- /dev/null+++ b/haproxy-tcp.Dockerfile@@ -0,0 +1,6 @@+FROM haproxytech/haproxy-alpine:2.5+RUN mkdir -p /usr/local/etc/haproxy/ssl /usr/local/etc/haproxy/maps /usr/local/etc/haproxy/spoe++COPY data/haproxy/haproxy.cfg-tcp.template /usr/local/etc/haproxy/haproxy.cfg+COPY data/haproxy/dataplaneapi.hcl /usr/local/etc/haproxy/dataplaneapi.hcl+COPY data/haproxy/ssl/default.pem /usr/local/etc/haproxy/ssl/default.pem\ No newline at end of filediff --git a/haproxy.Dockerfile b/haproxy.Dockerfilenew file mode 100644index 0000000000..45e2d9d717--- /dev/null+++ b/haproxy.Dockerfile@@ -0,0 +1,6 @@+FROM haproxytech/haproxy-alpine:2.5+RUN mkdir -p /usr/local/etc/haproxy/ssl /usr/local/etc/haproxy/maps /usr/local/etc/haproxy/spoe++COPY data/haproxy/haproxy.cfg.template /usr/local/etc/haproxy/haproxy.cfg+COPY data/haproxy/dataplaneapi.hcl /usr/local/etc/haproxy/dataplaneapi.hcl+COPY data/haproxy/ssl/default.pem /usr/local/etc/haproxy/ssl/default.pem\ No newline at end of filediff --git a/install.sh b/install.shdeleted file mode 100644index 33889e7145..0000000000--- a/install.sh+++ /dev/null@@ -1,88 +0,0 @@-#!/bin/bash--preTasks() {-echo '-##############################-#### Pulling Git Updates #####-##############################'-GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git pull--if [ $? -ne 0 ]; then- echo '-####################################-#### Ooops something not okay! #####-####################################'- exit 1-fi--echo '-##############################-#### Building Base Image #####-##############################'-docker build --label coolify-reserve=true -t coolify-base -f install/Dockerfile-base .--if [ $? -ne 0 ]; then- echo '-####################################-#### Ooops something not okay! #####-####################################'- exit 1-fi--echo '-##################################-#### Checking configuration. #####-##################################'-docker run --rm -w /usr/src/app coolify-base node install/install.js --check-if [ $? -ne 0 ]; then- echo '-##################################-#### Missing configuration ! #####-##################################'- exit 1-fi-}-case "$1" in- "all")- preTasks- echo '-#################################-#### Rebuilding everything. #####-#################################'- docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /data/coolify:/data/coolify -u root -w /usr/src/app coolify-base node install/install.js --type all- ;;- "coolify")- preTasks- echo '-##############################-#### Rebuilding Coolify. #####-##############################'- docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /data/coolify:/data/coolify -u root -w /usr/src/app coolify-base node install/install.js --type coolify- ;;- "proxy")- preTasks- echo '-############################-#### Rebuilding Proxy. #####-############################'- docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /data/coolify:/data/coolify -u root -w /usr/src/app coolify-base node install/install.js --type proxy- ;;- "upgrade-phase-1")- preTasks- echo '-################################-#### Upgrading Coolify P1. #####-################################'- docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /data/coolify:/data/coolify -u root -w /usr/src/app coolify-base node install/install.js --type upgrade- ;;- "upgrade-phase-2")- echo '-################################-#### Upgrading Coolify P2. #####-################################'- docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /data/coolify:/data/coolify -u root -w /usr/src/app coolify-base node install/update.js --type upgrade- ;;- *)- exit 1- ;;-esac\ No newline at end of filediff --git a/install/Dockerfile b/install/Dockerfiledeleted file mode 100644index a9b3a30b34..0000000000--- a/install/Dockerfile+++ /dev/null@@ -1,5 +0,0 @@-FROM coolify-base-WORKDIR /usr/src/app-RUN pnpm build-CMD ["pnpm", "start"]-EXPOSE 3000\ No newline at end of filediff --git a/install/Dockerfile-base b/install/Dockerfile-basedeleted file mode 100644index 04778a30e4..0000000000--- a/install/Dockerfile-base+++ /dev/null@@ -1,19 +0,0 @@-FROM ubuntu:20.04 as binaries-RUN apt update && apt install -y curl gnupg2 ca-certificates-RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add --RUN echo 'deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable' >> /etc/apt/sources.list-RUN curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o /usr/bin/envsubst-RUN chmod +x /usr/bin/envsubst-RUN apt update && apt install -y docker-ce-cli && apt clean all--FROM node:14 as modules-COPY --from=binaries /usr/bin/docker /usr/bin/docker-COPY --from=binaries /usr/bin/envsubst /usr/bin/envsubst-RUN curl -L https://pnpm.js.org/pnpm.js | node - add --global pnpm-WORKDIR /usr/src/app-COPY ./package*.json .-RUN pnpm install--FROM modules-WORKDIR /usr/src/app-COPY . .\ No newline at end of filediff --git a/install/Dockerfile-dev b/install/Dockerfile-devdeleted file mode 100644index a5a63844ca..0000000000--- a/install/Dockerfile-dev+++ /dev/null@@ -1,10 +0,0 @@-FROM node:latest-LABEL coolify-preserve=true-WORKDIR /usr/src/app-RUN curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-20.10.6.tgz | tar -xzvf - docker/docker -C . --strip-components 1-RUN mv /usr/src/app/docker /usr/bin/docker-RUN curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o /usr/bin/envsubst-RUN curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -o /usr/bin/jq-RUN chmod +x /usr/bin/envsubst /usr/bin/jq /usr/bin/docker-ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache-RUN curl -f https://get.pnpm.io/v6.js | node - add --global pnpm\ No newline at end of filediff --git a/install/Dockerfile-new b/install/Dockerfile-newdeleted file mode 100644index c0c46b08e4..0000000000--- a/install/Dockerfile-new+++ /dev/null@@ -1,15 +0,0 @@-FROM node:lts-LABEL coolify-preserve=true-WORKDIR /usr/src/app-RUN curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-20.10.6.tgz | tar -xzvf - docker/docker -C . --strip-components 1-RUN mv /usr/src/app/docker /usr/bin/docker-RUN curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o /usr/bin/envsubst-RUN curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -o /usr/bin/jq-RUN chmod +x /usr/bin/envsubst /usr/bin/jq /usr/bin/docker-RUN curl -f https://get.pnpm.io/v6.js | node - add --global pnpm-COPY ./*package.json .-RUN pnpm install-COPY . .-RUN pnpm build-CMD ["pnpm", "start"]-EXPOSE 3000\ No newline at end of filediff --git a/install/README.md b/install/README.mddeleted file mode 100644index 9b9f89f5a8..0000000000--- a/install/README.md+++ /dev/null@@ -1,10 +0,0 @@-Some of the files are here for backwards compatibility.--I will do things after 2 months:--- rm ./install.js and ./update.js-- rm ../install.sh-- rm ./Dockerfile-base-- rm ./obs-- rm ./check.js "No need to check env file. During installation, it is checked by the installer. If you change it between to upgrades: 🤷♂️"-- Rename Dockerfile-new to Dockerfilediff --git a/install/coolify-template.yml b/install/coolify-template.ymldeleted file mode 100644index 3ced0cadfd..0000000000--- a/install/coolify-template.yml+++ /dev/null@@ -1,97 +0,0 @@-version: '3.8'--services:- proxy:- image: traefik:v2.4- hostname: coollabs-proxy- ports:- - target: 80- published: 80- protocol: tcp- mode: host- - target: 443- published: 443- protocol: tcp- mode: host- command:- - --api.insecure=false- - --api.dashboard=false- - --api.debug=false- - --log.level=ERROR- - --providers.docker=true- - --providers.docker.swarmMode=true- - --providers.docker.exposedbydefault=false- - --providers.docker.network=${DOCKER_NETWORK}- - --providers.docker.swarmModeRefreshSeconds=1s- - --entrypoints.web.address=:80- - --entrypoints.websecure.address=:443- - --certificatesresolvers.letsencrypt.acme.httpchallenge=true- - --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web- - --certificatesresolvers.letsencrypt.acme.email=${EMAIL}- - --certificatesresolvers.letsencrypt.acme.storage=/data/coolify/acme.json- volumes:- - /var/run/docker.sock:/var/run/docker.sock- - /data/coolify:/data/coolify- networks:- - ${DOCKER_NETWORK}- deploy:- update_config:- parallelism: 1- delay: 10s- order: start-first- replicas: 1- placement:- constraints:- - node.role == manager- labels:- - 'traefik.enable=true'- - 'traefik.http.routers.api.entrypoints=websecure'- - 'traefik.http.routers.api.service=api@internal'- - 'traefik.http.routers.api.middlewares=auth'- - 'traefik.http.services.traefik.loadbalancer.server.port=80'- - 'traefik.http.services.traefik.loadbalancer.server.port=443'-- # Global redirect www to non-www- - 'traefik.http.routers.www-catchall.rule=hostregexp(`{host:www.(.+)}`)'- - 'traefik.http.routers.www-catchall.entrypoints=web'- - 'traefik.http.routers.www-catchall.middlewares=redirect-www-to-nonwww'- - "traefik.http.middlewares.redirect-www-to-nonwww.redirectregex.regex=^http://(?:www\\.)?(.+)"- - 'traefik.http.middlewares.redirect-www-to-nonwww.redirectregex.replacement=http://$$$${1}'-- # Global redirect http to https- - 'traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)'- - 'traefik.http.routers.http-catchall.entrypoints=web'- - 'traefik.http.routers.http-catchall.middlewares=redirect-to-https'-- - 'traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https'- - 'traefik.http.middlewares.global-compress.compress=true'-- coolify:- image: coolify- hostname: coollabs-coolify- env_file:- - .env- networks:- - ${DOCKER_NETWORK}- command: 'yarn start'- volumes:- - /var/run/docker.sock:/var/run/docker.sock:ro- deploy:- update_config:- parallelism: 1- delay: 10s- order: start-first- replicas: 1- labels:- - 'traefik.enable=true'- - 'traefik.http.routers.coolify.entrypoints=websecure'- - 'traefik.http.routers.coolify.tls.certresolver=letsencrypt'- - 'traefik.http.routers.coolify.rule=Host(`${DOMAIN}`) && PathPrefix(`/`)'- - 'traefik.http.services.coolify.loadbalancer.server.port=3000'- - 'traefik.http.routers.coolify.middlewares=global-compress'--networks:- ${DOCKER_NETWORK}:- driver: overlay- name: ${DOCKER_NETWORK}- external: truediff --git a/install/install.js b/install/install.jsdeleted file mode 100644index 0366bc3b7b..0000000000--- a/install/install.js+++ /dev/null@@ -1,36 +0,0 @@-require('dotenv').config();-const { program } = require('commander');-const shell = require('shelljs');-const user = shell.exec('whoami', { silent: true }).stdout.replace('\n', '');--program.version('0.0.1');-program- .option('-d, --debug', 'Debug outputs.')- .option('-c, --check', 'Only checks configuration.')- .option('-t, --type <type>', 'Deploy type.');--program.parse(process.argv);--const options = program.opts();--if (user !== 'root') {- console.error(`Please run as root! Current user: ${user}`);- process.exit(1);-}-shell.exec(`docker network create ${process.env.DOCKER_NETWORK} --driver overlay`, {- silent: !options.debug-});-shell.exec('docker build -t coolify -f install/Dockerfile .');-if (options.type === 'all') {- shell.exec('docker stack rm coollabs-coolify', { silent: !options.debug });-} else if (options.type === 'coolify') {- shell.exec('docker service rm coollabs-coolify_coolify');-} else if (options.type === 'proxy') {- shell.exec('docker service rm coollabs-coolify_proxy');-}-if (options.type !== 'upgrade') {- shell.exec(- 'set -a && source .env && set +a && envsubst < install/coolify-template.yml | docker stack deploy -c - coollabs-coolify',- { silent: !options.debug, shell: '/bin/bash' }- );-}diff --git a/install/update.js b/install/update.jsdeleted file mode 100644index 1137937ba7..0000000000--- a/install/update.js+++ /dev/null@@ -1,24 +0,0 @@-require('dotenv').config();-const { program } = require('commander');-const shell = require('shelljs');-const user = shell.exec('whoami', { silent: true }).stdout.replace('\n', '');-program.version('0.0.1');-program- .option('-d, --debug', 'Debug outputs.')- .option('-c, --check', 'Only checks configuration.')- .option('-t, --type <type>', 'Deploy type.');--program.parse(process.argv);-const options = program.opts();-if (user !== 'root') {- console.error(`Please run as root! Current user: ${user}`);- process.exit(1);-}--if (options.type === 'upgrade') {- shell.exec('docker service rm coollabs-coolify_coolify');- shell.exec(- 'set -a && source .env && set +a && envsubst < install/coolify-template.yml | docker stack deploy -c - coollabs-coolify',- { silent: !options.debug, shell: '/bin/bash' }- );-}diff --git a/package.json b/package.jsonindex 6a31f3533d..3f6d3f6c8f 100644--- a/package.json+++ b/package.json@@ -1,61 +1,83 @@{"name": "coolify",- "description": "An open-source, hassle-free, self-hostable Heroku & Netlify alternative.",- "version": "1.0.24",+ "description": "An open-source & self-hostable Heroku / Netlify alternative.",+ "version": "2.0.0","license": "AGPL-3.0","scripts": {- "dev:docker:start": "docker-compose -f docker-compose-dev.yml up -d",- "dev:docker:stop": "docker-compose -f docker-compose-dev.yml down",- "dev": "TAILWIND_MODE=watch NODE_ENV=development svelte-kit dev --host 0.0.0.0",- "build": "NODE_ENV=production svelte-kit build",+ "dev": "docker-compose -f docker-compose-dev.yaml up -d && NODE_ENV=development svelte-kit dev --host 0.0.0.0",+ "dev:stop": "docker-compose -f docker-compose-dev.yaml down",+ "dev:logs": "docker-compose -f docker-compose-dev.yaml logs -f --tail 10",+ "studio": "npx prisma studio",+ "start": "npx prisma migrate deploy && npx prisma generate && npx prisma db seed && node index.js",+ "build": "svelte-kit build","preview": "svelte-kit preview",- "start": "node build",- "lint": "prettier --check . && eslint --ignore-path .gitignore .",- "format": "prettier --write ."+ "check": "svelte-check --tsconfig ./tsconfig.json",+ "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",+ "db:generate": "prisma generate",+ "db:push": "prisma db push && prisma generate",+ "db:seed": "prisma db seed",+ "prerelease": "cross-var docker build -t coollabsio/coolify:$npm_package_version -t coollabsio/coolify:latest .",+ "release:coolify": "cross-var yarn prerelease && docker push coollabsio/coolify:$npm_package_version && docker image push coollabsio/coolify:$npm_package_version && docker push coollabsio/coolify:latest",+ "release:haproxy": "docker build -f haproxy.Dockerfile -t coollabsio/coolify-haproxy-alpine:1.0.0 -t coollabsio/coolify-haproxy-alpine:latest . && docker image push --all-tags coollabsio/coolify-haproxy-alpine",+ "release:haproxy:tcp": "docker build -f haproxy-tcp.Dockerfile -t coollabsio/coolify-haproxy-tcp-alpine:1.0.0 -t coollabsio/coolify-haproxy-tcp-alpine:latest . && docker image push --all-tags coollabsio/coolify-haproxy-tcp-alpine",+ "release:haproxy:http": "docker build -f haproxy-http.Dockerfile -t coollabsio/coolify-haproxy-http-alpine:1.0.0 -t coollabsio/coolify-haproxy-http-alpine:latest . && docker image push --all-tags coollabsio/coolify-haproxy-http-alpine",+ "prepare": "husky install"},"devDependencies": {- "@sveltejs/adapter-node": "1.0.0-next.39",- "@sveltejs/kit": "1.0.0-next.142",- "@types/dockerode": "^3.2.3",- "@typescript-eslint/eslint-plugin": "^4.26.1",- "@typescript-eslint/parser": "^4.26.1",- "autoprefixer": "^10.2.6",- "cssnano": "^5.0.5",- "eslint": "^7.28.0",- "eslint-config-prettier": "^8.3.0",- "eslint-plugin-svelte3": "^3.2.0",- "postcss": "^8.3.0",- "postcss-load-config": "^3.0.1",- "prettier": "~2.3.1",- "prettier-plugin-svelte": "^2.3.0",- "svelte": "^3.38.2",- "svelte-preprocess": "^4.7.3",- "tailwindcss": "2.2.4",- "tslib": "^2.2.0",- "typescript": "^4.3.2",- "vite": "^2.3.6"+ "@sveltejs/adapter-node": "1.0.0-next.67",+ "@sveltejs/adapter-static": "1.0.0-next.27",+ "@sveltejs/kit": "1.0.0-next.259",+ "@types/bcrypt": "5.0.0",+ "@types/js-cookie": "3.0.1",+ "@types/node": "17.0.16",+ "@types/node-forge": "1.0.0",+ "@typescript-eslint/eslint-plugin": "4.31.1",+ "@typescript-eslint/parser": "4.31.1",+ "@zerodevx/svelte-toast": "0.6.3",+ "autoprefixer": "10.4.2",+ "cross-var": "1.1.0",+ "eslint": "7.32.0",+ "eslint-config-prettier": "8.3.0",+ "eslint-plugin-svelte3": "3.2.1",+ "husky": "7.0.4",+ "lint-staged": "12.3.3",+ "postcss": "8.4.6",+ "prettier": "2.5.1",+ "prettier-plugin-svelte": "2.6.0",+ "prettier-plugin-tailwindcss": "0.1.7",+ "prisma": "3.9.1",+ "svelte": "3.46.4",+ "svelte-check": "2.4.3",+ "svelte-preprocess": "4.10.3",+ "tailwindcss": "3.0.19",+ "ts-node": "10.5.0",+ "tslib": "2.3.1",+ "typescript": "4.5.5"},"type": "module","dependencies": {- "@iarna/toml": "^2.2.5",- "@zerodevx/svelte-toast": "^0.3.0",- "bcrypt": "^5.0.1",- "commander": "^7.2.0",- "compare-versions": "^3.6.0",- "cookie": "^0.4.1",- "cuid": "^2.1.8",- "dayjs": "^1.10.5",- "dockerode": "^3.3.0",- "dotenv-extended": "^2.9.0",- "generate-password": "^1.6.0",- "js-yaml": "^4.1.0",- "jsonwebtoken": "^8.5.1",- "microtip": "^0.2.2",- "mongoose": "^5.12.13",- "shelljs": "^0.8.4",- "svelte-kit-cookie-session": "^1.3.1",- "svelte-select": "^3.17.0",- "systeminformation": "^5.7.7",- "unique-names-generator": "^4.5.0"+ "@iarna/toml": "2.2.5",+ "@prisma/client": "3.9.1",+ "@sentry/node": "6.17.6",+ "bcrypt": "5.0.1",+ "bullmq": "1.69.0",+ "compare-versions": "4.1.3",+ "cookie": "0.4.2",+ "cuid": "2.1.8",+ "dayjs": "1.10.7",+ "dockerode": "3.3.1",+ "dotenv-extended": "2.9.0",+ "generate-password": "1.7.0",+ "get-port": "6.0.0",+ "got": "12.0.1",+ "js-cookie": "3.0.1",+ "js-yaml": "4.1.0",+ "jsonwebtoken": "8.5.1",+ "node-forge": "1.2.1",+ "svelte-kit-cookie-session": "2.0.3",+ "unique-names-generator": "4.6.0"+ },+ "prisma": {+ "seed": "node prisma/seed.cjs"}}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex c6d4a9d797..76d4ab997e 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1,140 +1,168 @@lockfileVersion: 5.3specifiers:- '@iarna/toml': ^2.2.5- '@sveltejs/adapter-node': 1.0.0-next.33- '@sveltejs/kit': 1.0.0-next.125- '@types/dockerode': ^3.2.3- '@typescript-eslint/eslint-plugin': ^4.26.1- '@typescript-eslint/parser': ^4.26.1- '@zerodevx/svelte-toast': ^0.3.0- autoprefixer: ^10.2.6- bcrypt: ^5.0.1- commander: ^7.2.0- compare-versions: ^3.6.0- cookie: ^0.4.1- cssnano: ^5.0.5- cuid: ^2.1.8- dayjs: ^1.10.5- dockerode: ^3.3.0- dotenv-extended: ^2.9.0- eslint: ^7.28.0- eslint-config-prettier: ^8.3.0- eslint-plugin-svelte3: ^3.2.0- generate-password: ^1.6.0- js-yaml: ^4.1.0- jsonwebtoken: ^8.5.1- microtip: ^0.2.2- mongoose: ^5.12.13- postcss: ^8.3.0- postcss-load-config: ^3.0.1- prettier: ~2.3.1- prettier-plugin-svelte: ^2.3.0- shelljs: ^0.8.4- svelte: ^3.38.2- svelte-kit-cookie-session: ^1.0.6- svelte-preprocess: ^4.7.3- svelte-select: ^3.17.0- systeminformation: ^5.7.7- tailwindcss: 2.2.4- tslib: ^2.2.0- typescript: ^4.3.2- unique-names-generator: ^4.5.0- vite: ^2.3.6+ '@iarna/toml': 2.2.5+ '@prisma/client': 3.9.1+ '@sentry/node': 6.17.6+ '@sveltejs/adapter-node': 1.0.0-next.67+ '@sveltejs/adapter-static': 1.0.0-next.27+ '@sveltejs/kit': 1.0.0-next.259+ '@types/bcrypt': 5.0.0+ '@types/js-cookie': 3.0.1+ '@types/node': 17.0.16+ '@types/node-forge': 1.0.0+ '@typescript-eslint/eslint-plugin': 4.31.1+ '@typescript-eslint/parser': 4.31.1+ '@zerodevx/svelte-toast': 0.6.3+ autoprefixer: 10.4.2+ bcrypt: 5.0.1+ bullmq: 1.69.0+ compare-versions: 4.1.3+ cookie: 0.4.2+ cross-var: 1.1.0+ cuid: 2.1.8+ dayjs: 1.10.7+ dockerode: 3.3.1+ dotenv-extended: 2.9.0+ eslint: 7.32.0+ eslint-config-prettier: 8.3.0+ eslint-plugin-svelte3: 3.2.1+ generate-password: 1.7.0+ get-port: 6.0.0+ got: 12.0.1+ husky: 7.0.4+ js-cookie: 3.0.1+ js-yaml: 4.1.0+ jsonwebtoken: 8.5.1+ lint-staged: 12.3.3+ node-forge: 1.2.1+ postcss: 8.4.6+ prettier: 2.5.1+ prettier-plugin-svelte: 2.6.0+ prettier-plugin-tailwindcss: 0.1.7+ prisma: 3.9.1+ svelte: 3.46.4+ svelte-check: 2.4.3+ svelte-kit-cookie-session: 2.0.3+ svelte-preprocess: 4.10.3+ tailwindcss: 3.0.19+ ts-node: 10.5.0+ tslib: 2.3.1+ typescript: 4.5.5+ unique-names-generator: 4.6.0dependencies:'@iarna/toml': 2.2.5- '@zerodevx/svelte-toast': 0.3.0+ '@prisma/client': [email protected]+ '@sentry/node': 6.17.6bcrypt: 5.0.1- commander: 7.2.0- compare-versions: 3.6.0- cookie: 0.4.1+ bullmq: 1.69.0+ compare-versions: 4.1.3+ cookie: 0.4.2cuid: 2.1.8- dayjs: 1.10.5- dockerode: 3.3.0+ dayjs: 1.10.7+ dockerode: 3.3.1dotenv-extended: 2.9.0- generate-password: 1.6.0+ generate-password: 1.7.0+ get-port: 6.0.0+ got: 12.0.1+ js-cookie: 3.0.1js-yaml: 4.1.0jsonwebtoken: 8.5.1- microtip: 0.2.2- mongoose: 5.12.13- shelljs: 0.8.4- svelte-kit-cookie-session: 1.0.6- svelte-select: 3.17.0- systeminformation: 5.7.7- unique-names-generator: 4.5.0+ node-forge: 1.2.1+ svelte-kit-cookie-session: 2.0.3+ unique-names-generator: 4.6.0devDependencies:- '@sveltejs/adapter-node': 1.0.0-next.33- '@sveltejs/kit': [email protected]- '@types/dockerode': 3.2.3- '@typescript-eslint/eslint-plugin': 4.26.1_c8cbd5e7f5f92609ec78d991aced454b- '@typescript-eslint/parser': [email protected][email protected]- autoprefixer: [email protected]- cssnano: [email protected]- eslint: 7.28.0- eslint-config-prettier: [email protected]- eslint-plugin-svelte3: [email protected][email protected]- postcss: 8.3.0- postcss-load-config: 3.0.1- prettier: 2.3.1- prettier-plugin-svelte: [email protected][email protected]- svelte: 3.38.2- svelte-preprocess: 4.7.3_ddfd8490a44ef0de606159ff3aef985a- tailwindcss: 2.2.4_6daa0ece57b4377652e73c9c66c3b94c- tslib: 2.2.0- typescript: 4.3.2- vite: 2.3.6+ '@sveltejs/adapter-node': 1.0.0-next.67+ '@sveltejs/adapter-static': 1.0.0-next.27+ '@sveltejs/kit': [email protected]+ '@types/bcrypt': 5.0.0+ '@types/js-cookie': 3.0.1+ '@types/node': 17.0.16+ '@types/node-forge': 1.0.0+ '@typescript-eslint/eslint-plugin': 4.31.1_5d7752337e5ea49772097d8af1823bf9+ '@typescript-eslint/parser': [email protected][email protected]+ '@zerodevx/svelte-toast': 0.6.3+ autoprefixer: [email protected]+ cross-var: 1.1.0+ eslint: 7.32.0+ eslint-config-prettier: [email protected]+ eslint-plugin-svelte3: [email protected][email protected]+ husky: 7.0.4+ lint-staged: 12.3.3+ postcss: 8.4.6+ prettier: 2.5.1+ prettier-plugin-svelte: [email protected][email protected]+ prettier-plugin-tailwindcss: [email protected]+ prisma: 3.9.1+ svelte: 3.46.4+ svelte-check: [email protected][email protected]+ svelte-preprocess: 4.10.3_88b359da5cac6d8f6ee1bbb7080a3fa9+ tailwindcss: 3.0.19_27d966e3a2f4b84fbc8a2f9653dbb362+ ts-node: 10.5.0_99ae9436e134a034c8d45fdd98ebbf22+ tslib: 2.3.1+ typescript: 4.5.5packages:-/@babel/code-frame/7.12.11:- resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==}- dependencies:- '@babel/highlight': 7.14.0- dev: true-- /@babel/code-frame/7.14.5:- resolution: {integrity: sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==}- engines: {node: '>=6.9.0'}+ resolution:+ {+ integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==+ }dependencies:'@babel/highlight': 7.14.5dev: true- /@babel/helper-validator-identifier/7.14.0:- resolution: {integrity: sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==}- dev: true-- /@babel/helper-validator-identifier/7.14.5:- resolution: {integrity: sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==}- engines: {node: '>=6.9.0'}+ /@babel/helper-validator-identifier/7.15.7:+ resolution:+ {+ integrity: sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==+ }+ engines: { node: '>=6.9.0' }dev: true- /@babel/highlight/7.14.0:- resolution: {integrity: sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==}+ /@babel/highlight/7.14.5:+ resolution:+ {+ integrity: sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==+ }+ engines: { node: '>=6.9.0' }dependencies:- '@babel/helper-validator-identifier': 7.14.0+ '@babel/helper-validator-identifier': 7.15.7chalk: 2.4.2js-tokens: 4.0.0dev: true- /@babel/highlight/7.14.5:- resolution: {integrity: sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==}- engines: {node: '>=6.9.0'}+ /@cspotcode/source-map-consumer/0.8.0:+ resolution:+ {+ integrity: sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==+ }+ engines: { node: '>= 12' }+ dev: true++ /@cspotcode/source-map-support/0.7.0:+ resolution:+ {+ integrity: sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==+ }+ engines: { node: '>=12' }dependencies:- '@babel/helper-validator-identifier': 7.14.5- chalk: 2.4.2- js-tokens: 4.0.0+ '@cspotcode/source-map-consumer': 0.8.0dev: true- /@eslint/eslintrc/0.4.2:- resolution: {integrity: sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==}- engines: {node: ^10.12.0 || >=12.0.0}+ /@eslint/eslintrc/0.4.3:+ resolution:+ {+ integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==+ }+ engines: { node: ^10.12.0 || >=12.0.0 }dependencies:ajv: 6.12.6- debug: 4.3.1+ debug: 4.3.3espree: 7.3.1- globals: 13.9.0+ globals: 13.12.0ignore: 4.0.6import-fresh: 3.3.0js-yaml: 3.14.1@@ -144,159 +172,434 @@ packages:- supports-colordev: true- /@fullhuman/postcss-purgecss/[email protected]:- resolution: {integrity: sha512-/EnQ9UDWGGqHkn1UKAwSgh+gJHPKmD+Z+5dQ4gWT4qq2NUyez3zqAfZNwFH3eSgmgO+wjTXfhlLchx2M9/K+7Q==}- peerDependencies:- postcss: ^8.0.0+ /@humanwhocodes/config-array/0.5.0:+ resolution:+ {+ integrity: sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==+ }+ engines: { node: '>=10.10.0' }dependencies:- postcss: 8.3.0- purgecss: 4.0.3+ '@humanwhocodes/object-schema': 1.2.0+ debug: 4.3.3+ minimatch: 3.0.4+ transitivePeerDependencies:+ - supports-color+ dev: true++ /@humanwhocodes/object-schema/1.2.0:+ resolution:+ {+ integrity: sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==+ }dev: true/@iarna/toml/2.2.5:- resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==}+ resolution:+ {+ integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==+ }dev: false- /@mapbox/node-pre-gyp/1.0.5:- resolution: {integrity: sha512-4srsKPXWlIxp5Vbqz5uLfBN+du2fJChBoYn/f2h991WLdk7jUvcSk/McVLSv/X+xQIPI8eGD5GjrnygdyHnhPA==}+ /@mapbox/node-pre-gyp/1.0.6:+ resolution:+ {+ integrity: sha512-qK1ECws8UxuPqOA8F5LFD90vyVU33W7N3hGfgsOVfrJaRVc8McC3JClTDHpeSbL9CBrOHly/4GsNPAvIgNZE+g==+ }hasBin: truedependencies:detect-libc: 1.0.3https-proxy-agent: 5.0.0make-dir: 3.1.0- node-fetch: 2.6.1+ node-fetch: 2.6.6nopt: 5.0.0- npmlog: 4.1.2+ npmlog: 5.0.1rimraf: 3.0.2semver: 7.3.5- tar: 6.1.0+ tar: 6.1.11transitivePeerDependencies:- supports-colordev: false/@nodelib/fs.scandir/2.1.5:- resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}- engines: {node: '>= 8'}+ resolution:+ {+ integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==+ }+ engines: { node: '>= 8' }dependencies:'@nodelib/fs.stat': 2.0.5run-parallel: 1.2.0dev: true/@nodelib/fs.stat/2.0.5:- resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}- engines: {node: '>= 8'}+ resolution:+ {+ integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==+ }+ engines: { node: '>= 8' }dev: true- /@nodelib/fs.walk/1.2.7:- resolution: {integrity: sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==}- engines: {node: '>= 8'}+ /@nodelib/fs.walk/1.2.8:+ resolution:+ {+ integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==+ }+ engines: { node: '>= 8' }dependencies:'@nodelib/fs.scandir': 2.1.5- fastq: 1.11.0+ fastq: 1.13.0dev: true- /@rollup/pluginutils/4.1.0:- resolution: {integrity: sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==}- engines: {node: '>= 8.0.0'}+ /@prisma/client/[email protected]:+ resolution:+ {+ integrity: sha512-aLwfXKLvL+loQ0IuPPCXkcq8cXBg1IeoHHa5lqQu3dJHdj45wnislA/Ny4UxRQjD5FXqrfAb8sWtF+jhdmjFTg==+ }+ engines: { node: '>=12.6' }+ requiresBuild: truepeerDependencies:- rollup: ^1.20.0||^2.0.0+ prisma: '*'+ peerDependenciesMeta:+ prisma:+ optional: true+ dependencies:+ '@prisma/engines-version': 3.9.0-58.bcc2ff906db47790ee902e7bbc76d7ffb1893009+ prisma: 3.9.1+ dev: false++ /@prisma/engines-version/3.9.0-58.bcc2ff906db47790ee902e7bbc76d7ffb1893009:+ resolution:+ {+ integrity: sha512-5Dh+qTDhpPR66w6NNAnPs+/W/Qt4r1DSd+qhfPFcDThUK4uxoZKGlPb2IYQn5LL+18aIGnmteDf7BnVMmvBNSQ==+ }+ dev: false++ /@prisma/engines/3.9.0-58.bcc2ff906db47790ee902e7bbc76d7ffb1893009:+ resolution:+ {+ integrity: sha512-qM+uJbkelB21bnK44gYE049YTHIjHysOuj0mj5U2gDGyNLfmiazlggzFPCgEjgme4U5YB2tYs6Z5Hq08Kl8pjA==+ }+ requiresBuild: true+ dev: true++ /@rollup/pluginutils/4.1.2:+ resolution:+ {+ integrity: sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==+ }+ engines: { node: '>= 8.0.0' }dependencies:estree-walker: 2.0.2picomatch: 2.3.0dev: true- /@sveltejs/adapter-node/1.0.0-next.33:- resolution: {integrity: sha512-0mABbAWQ5Dg7eSptvpX+fmZ0tgifscgNwgtg4iX6GRhWGizTYYBgp4yAHl4IXPqlAQkW7Lh0gw3+G2tQcs2qcQ==}+ /@sentry/core/6.17.6:+ resolution:+ {+ integrity: sha512-wSNsQSqsW8vQ2HEvUEXYOJnzTyVDSWbyH4RHrWV1pQM8zqGx/qfz0sKFM5XFnE9ZeaXKL8LXV3v5i73v+z8lew==+ }+ engines: { node: '>=6' }+ dependencies:+ '@sentry/hub': 6.17.6+ '@sentry/minimal': 6.17.6+ '@sentry/types': 6.17.6+ '@sentry/utils': 6.17.6+ tslib: 1.14.1+ dev: false++ /@sentry/hub/6.17.6:+ resolution:+ {+ integrity: sha512-Ps9nk+DoFia8jhZ1lucdRE0vDx8hqXOsKXJE8a3hK/Ndki0J9jedYqBeLqSgiFG4qRjXpNFcD6TEM6tnQrv5lw==+ }+ engines: { node: '>=6' }+ dependencies:+ '@sentry/types': 6.17.6+ '@sentry/utils': 6.17.6+ tslib: 1.14.1+ dev: false++ /@sentry/minimal/6.17.6:+ resolution:+ {+ integrity: sha512-PLGf8WlhtdHuY6ofwYR3nyClr/TYHHAW6i0r62OZCOXTqnFPJorZpAz3VCCP2jMJmbgVbo03wN+u/xAA/zwObA==+ }+ engines: { node: '>=6' }+ dependencies:+ '@sentry/hub': 6.17.6+ '@sentry/types': 6.17.6+ tslib: 1.14.1+ dev: false++ /@sentry/node/6.17.6:+ resolution:+ {+ integrity: sha512-T1s0yPbGvYpoh9pJgLvpy7s+jVwCyf0ieEoN9rSbnPwbi2vm6MfoV5wtGrE0cBHTPgnyOMv+zq4Q3ww6dfr7Pw==+ }+ engines: { node: '>=6' }+ dependencies:+ '@sentry/core': 6.17.6+ '@sentry/hub': 6.17.6+ '@sentry/tracing': 6.17.6+ '@sentry/types': 6.17.6+ '@sentry/utils': 6.17.6+ cookie: 0.4.2+ https-proxy-agent: 5.0.0+ lru_map: 0.3.3+ tslib: 1.14.1+ transitivePeerDependencies:+ - supports-color+ dev: false++ /@sentry/tracing/6.17.6:+ resolution:+ {+ integrity: sha512-+h5ov+zEm5WH9+vmFfdT4EIqBOW7Tggzh0BDz8QRStRc2JbvEiSZDs+HlsycBwWMQi/ucJs93FPtNnWjW+xvBw==+ }+ engines: { node: '>=6' }+ dependencies:+ '@sentry/hub': 6.17.6+ '@sentry/minimal': 6.17.6+ '@sentry/types': 6.17.6+ '@sentry/utils': 6.17.6+ tslib: 1.14.1+ dev: false++ /@sentry/types/6.17.6:+ resolution:+ {+ integrity: sha512-peGM873lDJtHd/jwW9Egr/hhxLuF0bcPIf2kMZlvEvW/G5GCbuaCR4ArQJlh7vQyma+NLn/XdojpJkC0TomKrw==+ }+ engines: { node: '>=6' }+ dev: false++ /@sentry/utils/6.17.6:+ resolution:+ {+ integrity: sha512-RI797N8Ax5yuKUftVX6dc0XmXqo5CN7XqJYPFzYC8udutQ4L8ZYadtUcqNsdz1ZQxl+rp0XK9Q6wjoWmsI2RXA==+ }+ engines: { node: '>=6' }+ dependencies:+ '@sentry/types': 6.17.6+ tslib: 1.14.1+ dev: false++ /@sindresorhus/is/4.2.0:+ resolution:+ {+ integrity: sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==+ }+ engines: { node: '>=10' }+ dev: false++ /@sveltejs/adapter-node/1.0.0-next.67:+ resolution:+ {+ integrity: sha512-+LuLn91xARZsRANiQNIIDpMMncUTnP2pJc8tyL+FdpVvs5UtlvkYJpeCBPFqjjseRpIIbi8Slu89GCdrRXBDUg==+ }+ dependencies:+ tiny-glob: 0.2.9+ dev: true++ /@sveltejs/adapter-static/1.0.0-next.27:+ resolution:+ {+ integrity: sha512-dcN1p1D7ZY/a9SClfN14mgm9pyWbLxdwM9gzPMZG6xXOoqMtwI03aZOFgGGumHPdv+XcGRZM96vUSRoDm6vBJQ==+ }dependencies:- esbuild: 0.12.6tiny-glob: 0.2.9dev: true- /@sveltejs/kit/[email protected]:- resolution: {integrity: sha512-msYbZak97rW2Cgk08NiJW5Sz4S6XnVcjwTXrMo1G4MkYn8cZeL/eKWhuYrjGFvv4U3bYOZhTj/WfAzXNVEFX0A==}- engines: {node: ^12.20 || >=14.13}+ /@sveltejs/kit/[email protected]:+ resolution:+ {+ integrity: sha512-+Tss6cQXmpi4Jno/ZP0zJ3INBLMED+WeW4UI81tmexheC76Y2p+cbInneKO/REx/8QFo1iroYrWAUkZPsOg8Ew==+ }+ engines: { node: '>=14.13' }hasBin: truepeerDependencies:- svelte: ^3.34.0+ svelte: ^3.44.0dependencies:- '@sveltejs/vite-plugin-svelte': [email protected][email protected]- cheap-watch: 1.0.3+ '@sveltejs/vite-plugin-svelte': [email protected][email protected]sade: 1.7.4- svelte: 3.38.2- vite: 2.4.2+ svelte: 3.46.4+ vite: 2.8.0transitivePeerDependencies:- - rollup+ - diff-match-patch+ - less+ - sass+ - stylus- supports-colordev: true- /@sveltejs/vite-plugin-svelte/[email protected][email protected]:- resolution: {integrity: sha512-cuyNkJ6leptfv+7qL/fWQ7EpGWdguosFOUI0z93oQUmFTcX7QxJ5h+QI3NQyktBzlKL/761L8BbG2hHNkVbLIQ==}- engines: {node: ^12.20 || ^14.13.1 || >= 16}+ /@sveltejs/vite-plugin-svelte/[email protected][email protected]:+ resolution:+ {+ integrity: sha512-aj0h2+ZixgT+yoJFIs8dRRw/Cj9tgNu3+hY4CJikpa04mfhR61wXqJFfi2ZEFMUvFda5nCxKYIChFkc6wq5fJA==+ }+ engines: { node: ^14.13.1 || >= 16 }peerDependencies:- svelte: ^3.34.0- vite: ^2.3.7+ diff-match-patch: ^1.0.5+ svelte: ^3.44.0+ vite: ^2.7.0+ peerDependenciesMeta:+ diff-match-patch:+ optional: truedependencies:- '@rollup/pluginutils': 4.1.0- debug: 4.3.2+ '@rollup/pluginutils': 4.1.2+ debug: 4.3.3kleur: 4.1.4magic-string: 0.25.7require-relative: 0.8.7- svelte: 3.38.2- svelte-hmr: [email protected]- vite: 2.4.2+ svelte: 3.46.4+ svelte-hmr: [email protected]+ vite: 2.8.0transitivePeerDependencies:- - rollup- supports-colordev: true- /@trysound/sax/0.1.1:- resolution: {integrity: sha512-Z6DoceYb/1xSg5+e+ZlPZ9v0N16ZvZ+wYMraFue4HYrE4ttONKtsvruIRf6t9TBR0YvSOfi1hUU0fJfBLCDYow==}- engines: {node: '>=10.13.0'}+ /@szmarczak/http-timer/5.0.1:+ resolution:+ {+ integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==+ }+ engines: { node: '>=14.16' }+ dependencies:+ defer-to-connect: 2.0.1+ dev: false++ /@tsconfig/node10/1.0.8:+ resolution:+ {+ integrity: sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==+ }+ dev: true++ /@tsconfig/node12/1.0.9:+ resolution:+ {+ integrity: sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==+ }+ dev: true++ /@tsconfig/node14/1.0.1:+ resolution:+ {+ integrity: sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==+ }+ dev: true++ /@tsconfig/node16/1.0.2:+ resolution:+ {+ integrity: sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==+ }dev: true- /@types/bson/4.0.3:- resolution: {integrity: sha512-mVRvYnTOZJz3ccpxhr3wgxVmSeiYinW+zlzQz3SXWaJmD1DuL05Jeq7nKw3SnbKmbleW5qrLG5vdyWe/A9sXhw==}+ /@types/bcrypt/5.0.0:+ resolution:+ {+ integrity: sha512-agtcFKaruL8TmcvqbndlqHPSJgsolhf/qPWchFlgnW1gECTN/nKbFcoFnvKAQRFfKbh+BO6A3SWdJu9t+xF3Lw==+ }dependencies:- '@types/node': 15.0.1- dev: false+ '@types/node': 17.0.16+ dev: true- /@types/dockerode/3.2.3:- resolution: {integrity: sha512-nZRhpSxm3PYianRBcRExcHxDvEzYHUPfGCnRL5Fe4/fSEZbtxrRNJ7okzCans3lXxj2t298EynFHGTnTC2f1Iw==}+ /@types/cacheable-request/6.0.2:+ resolution:+ {+ integrity: sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==+ }dependencies:- '@types/node': 15.0.1+ '@types/http-cache-semantics': 4.0.1+ '@types/keyv': 3.1.3+ '@types/node': 17.0.16+ '@types/responselike': 1.0.0+ dev: false++ /@types/http-cache-semantics/4.0.1:+ resolution:+ {+ integrity: sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==+ }+ dev: false++ /@types/js-cookie/3.0.1:+ resolution:+ {+ integrity: sha512-7wg/8gfHltklehP+oyJnZrz9XBuX5ZPP4zB6UsI84utdlkRYLnOm2HfpLXazTwZA+fpGn0ir8tGNgVnMEleBGQ==+ }dev: true- /@types/json-schema/7.0.7:- resolution: {integrity: sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==}+ /@types/json-schema/7.0.9:+ resolution:+ {+ integrity: sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==+ }dev: true- /@types/mongodb/3.6.12:- resolution: {integrity: sha512-49aEzQD5VdHPxyd5dRyQdqEveAg9LanwrH8RQipnMuulwzKmODXIZRp0umtxi1eBUfEusRkoy8AVOMr+kVuFog==}+ /@types/keyv/3.1.3:+ resolution:+ {+ integrity: sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==+ }dependencies:- '@types/bson': 4.0.3- '@types/node': 15.0.1+ '@types/node': 17.0.16dev: false- /@types/node/15.0.1:- resolution: {integrity: sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA==}+ /@types/node-forge/1.0.0:+ resolution:+ {+ integrity: sha512-h0bgwPKq5u99T9Gor4qtV1lCZ41xNkai0pie1n/a2mh2/4+jENWOlo7AJ4YKxTZAnSZ8FRurUpdIN7ohaPPuHA==+ }+ dependencies:+ '@types/node': 17.0.16+ dev: true++ /@types/node/17.0.16:+ resolution:+ {+ integrity: sha512-ydLaGVfQOQ6hI1xK2A5nVh8bl0OGoIfYMxPWHqqYe9bTkWCfqiVvZoh2I/QF2sNSkZzZyROBoTefIEI+PB6iIA==+ }/@types/parse-json/4.0.0:- resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==}+ resolution:+ {+ integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==+ }dev: true- /@types/pug/2.0.4:- resolution: {integrity: sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI=}+ /@types/pug/2.0.5:+ resolution:+ {+ integrity: sha512-LOnASQoeNZMkzexRuyqcBBDZ6rS+rQxUMkmj5A0PkhhiSZivLIuz6Hxyr1mkGoEZEkk66faROmpMi4fFkrKsBA==+ }dev: true- /@types/sass/1.16.0:- resolution: {integrity: sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA==}+ /@types/responselike/1.0.0:+ resolution:+ {+ integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==+ }dependencies:- '@types/node': 15.0.1+ '@types/node': 17.0.16+ dev: false++ /@types/sass/1.16.1:+ resolution:+ {+ integrity: sha512-iZUcRrGuz/Tbg3loODpW7vrQJkUtpY2fFSf4ELqqkApcS2TkZ1msk7ie8iZPB86lDOP8QOTTmuvWjc5S0R9OjQ==+ }+ dependencies:+ '@types/node': 17.0.16dev: true- /@typescript-eslint/eslint-plugin/4.26.1_c8cbd5e7f5f92609ec78d991aced454b:- resolution: {integrity: sha512-aoIusj/8CR+xDWmZxARivZjbMBQTT9dImUtdZ8tVCVRXgBUuuZyM5Of5A9D9arQPxbi/0rlJLcuArclz/rCMJw==}- engines: {node: ^10.12.0 || >=12.0.0}+ /@typescript-eslint/eslint-plugin/4.31.1_5d7752337e5ea49772097d8af1823bf9:+ resolution:+ {+ integrity: sha512-UDqhWmd5i0TvPLmbK5xY3UZB0zEGseF+DHPghZ37Sb83Qd3p8ujhvAtkU4OF46Ka5Pm5kWvFIx0cCTBFKo0alA==+ }+ engines: { node: ^10.12.0 || >=12.0.0 }peerDependencies:'@typescript-eslint/parser': ^4.0.0eslint: ^5.0.0 || ^6.0.0 || ^7.0.0@@ -305,42 +608,47 @@ packages:typescript:optional: truedependencies:- '@typescript-eslint/experimental-utils': [email protected][email protected]- '@typescript-eslint/parser': [email protected][email protected]- '@typescript-eslint/scope-manager': 4.26.1- debug: 4.3.1- eslint: 7.28.0+ '@typescript-eslint/experimental-utils': [email protected][email protected]+ '@typescript-eslint/parser': [email protected][email protected]+ '@typescript-eslint/scope-manager': 4.31.1+ debug: 4.3.3+ eslint: 7.32.0functional-red-black-tree: 1.0.1- lodash: 4.17.21- regexpp: 3.1.0+ regexpp: 3.2.0semver: 7.3.5- tsutils: [email protected]- typescript: 4.3.2+ tsutils: [email protected]+ typescript: 4.5.5transitivePeerDependencies:- supports-colordev: true- /@typescript-eslint/experimental-utils/[email protected][email protected]:- resolution: {integrity: sha512-sQHBugRhrXzRCs9PaGg6rowie4i8s/iD/DpTB+EXte8OMDfdCG5TvO73XlO9Wc/zi0uyN4qOmX9hIjQEyhnbmQ==}- engines: {node: ^10.12.0 || >=12.0.0}+ /@typescript-eslint/experimental-utils/[email protected][email protected]:+ resolution:+ {+ integrity: sha512-NtoPsqmcSsWty0mcL5nTZXMf7Ei0Xr2MT8jWjXMVgRK0/1qeQ2jZzLFUh4QtyJ4+/lPUyMw5cSfeeME+Zrtp9Q==+ }+ engines: { node: ^10.12.0 || >=12.0.0 }peerDependencies:eslint: '*'dependencies:- '@types/json-schema': 7.0.7- '@typescript-eslint/scope-manager': 4.26.1- '@typescript-eslint/types': 4.26.1- '@typescript-eslint/typescript-estree': [email protected]- eslint: 7.28.0+ '@types/json-schema': 7.0.9+ '@typescript-eslint/scope-manager': 4.31.1+ '@typescript-eslint/types': 4.31.1+ '@typescript-eslint/typescript-estree': [email protected]+ eslint: 7.32.0eslint-scope: 5.1.1- eslint-utils: [email protected]+ eslint-utils: [email protected]transitivePeerDependencies:- supports-color- typescriptdev: true- /@typescript-eslint/parser/[email protected][email protected]:- resolution: {integrity: sha512-q7F3zSo/nU6YJpPJvQveVlIIzx9/wu75lr6oDbDzoeIRWxpoc/HQ43G4rmMoCc5my/3uSj2VEpg/D83LYZF5HQ==}- engines: {node: ^10.12.0 || >=12.0.0}+ /@typescript-eslint/parser/[email protected][email protected]:+ resolution:+ {+ integrity: sha512-dnVZDB6FhpIby6yVbHkwTKkn2ypjVIfAR9nh+kYsA/ZL0JlTsd22BiDjouotisY3Irmd3OW1qlk9EI5R8GrvRQ==+ }+ engines: { node: ^10.12.0 || >=12.0.0 }peerDependencies:eslint: ^5.0.0 || ^6.0.0 || ^7.0.0typescript: '*'@@ -348,68 +656,89 @@ packages:typescript:optional: truedependencies:- '@typescript-eslint/scope-manager': 4.26.1- '@typescript-eslint/types': 4.26.1- '@typescript-eslint/typescript-estree': [email protected]- debug: 4.3.1- eslint: 7.28.0- typescript: 4.3.2+ '@typescript-eslint/scope-manager': 4.31.1+ '@typescript-eslint/types': 4.31.1+ '@typescript-eslint/typescript-estree': [email protected]+ debug: 4.3.3+ eslint: 7.32.0+ typescript: 4.5.5transitivePeerDependencies:- supports-colordev: true- /@typescript-eslint/scope-manager/4.26.1:- resolution: {integrity: sha512-TW1X2p62FQ8Rlne+WEShyd7ac2LA6o27S9i131W4NwDSfyeVlQWhw8ylldNNS8JG6oJB9Ha9Xyc+IUcqipvheQ==}- engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1}+ /@typescript-eslint/scope-manager/4.31.1:+ resolution:+ {+ integrity: sha512-N1Uhn6SqNtU2XpFSkD4oA+F0PfKdWHyr4bTX0xTj8NRx1314gBDRL1LUuZd5+L3oP+wo6hCbZpaa1in6SwMcVQ==+ }+ engines: { node: ^8.10.0 || ^10.13.0 || >=11.10.1 }dependencies:- '@typescript-eslint/types': 4.26.1- '@typescript-eslint/visitor-keys': 4.26.1+ '@typescript-eslint/types': 4.31.1+ '@typescript-eslint/visitor-keys': 4.31.1dev: true- /@typescript-eslint/types/4.26.1:- resolution: {integrity: sha512-STyMPxR3cS+LaNvS8yK15rb8Y0iL0tFXq0uyl6gY45glyI7w0CsyqyEXl/Fa0JlQy+pVANeK3sbwPneCbWE7yg==}- engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1}+ /@typescript-eslint/types/4.31.1:+ resolution:+ {+ integrity: sha512-kixltt51ZJGKENNW88IY5MYqTBA8FR0Md8QdGbJD2pKZ+D5IvxjTYDNtJPDxFBiXmka2aJsITdB1BtO1fsgmsQ==+ }+ engines: { node: ^8.10.0 || ^10.13.0 || >=11.10.1 }dev: true- /@typescript-eslint/typescript-estree/[email protected]:- resolution: {integrity: sha512-l3ZXob+h0NQzz80lBGaykdScYaiEbFqznEs99uwzm8fPHhDjwaBFfQkjUC/slw6Sm7npFL8qrGEAMxcfBsBJUg==}- engines: {node: ^10.12.0 || >=12.0.0}+ /@typescript-eslint/typescript-estree/[email protected]:+ resolution:+ {+ integrity: sha512-EGHkbsUvjFrvRnusk6yFGqrqMBTue5E5ROnS5puj3laGQPasVUgwhrxfcgkdHNFECHAewpvELE1Gjv0XO3mdWg==+ }+ engines: { node: ^10.12.0 || >=12.0.0 }peerDependencies:typescript: '*'peerDependenciesMeta:typescript:optional: truedependencies:- '@typescript-eslint/types': 4.26.1- '@typescript-eslint/visitor-keys': 4.26.1- debug: 4.3.1- globby: 11.0.3- is-glob: 4.0.1+ '@typescript-eslint/types': 4.31.1+ '@typescript-eslint/visitor-keys': 4.31.1+ debug: 4.3.3+ globby: 11.0.4+ is-glob: 4.0.3semver: 7.3.5- tsutils: [email protected]- typescript: 4.3.2+ tsutils: [email protected]+ typescript: 4.5.5transitivePeerDependencies:- supports-colordev: true- /@typescript-eslint/visitor-keys/4.26.1:- resolution: {integrity: sha512-IGouNSSd+6x/fHtYRyLOM6/C+QxMDzWlDtN41ea+flWuSF9g02iqcIlX8wM53JkfljoIjP0U+yp7SiTS1onEkw==}- engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1}+ /@typescript-eslint/visitor-keys/4.31.1:+ resolution:+ {+ integrity: sha512-PCncP8hEqKw6SOJY+3St4LVtoZpPPn+Zlpm7KW5xnviMhdqcsBty4Lsg4J/VECpJjw1CkROaZhH4B8M1OfnXTQ==+ }+ engines: { node: ^8.10.0 || ^10.13.0 || >=11.10.1 }dependencies:- '@typescript-eslint/types': 4.26.1- eslint-visitor-keys: 2.0.0+ '@typescript-eslint/types': 4.31.1+ eslint-visitor-keys: 2.1.0dev: true- /@zerodevx/svelte-toast/0.3.0:- resolution: {integrity: sha512-TY5dLB5DEpxuHu60M6gum+fDxzIGXg35R8500orz58JTFs9LiHWoEfeJ4n9t7Afix3iMmYLl2thjhnCHCiQIhQ==}- dev: false+ /@zerodevx/svelte-toast/0.6.3:+ resolution:+ {+ integrity: sha512-k0W1JFoqHIcIQaP9ij99+Rv0ugaQSSNwOuNwwmTGRjWtIqrQr+ExLDE8LQGXLlJIprqDyMWB4lJkUql/r0RAtA==+ }+ dev: true/abbrev/1.1.1:- resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}+ resolution:+ {+ integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==+ }dev: false- /acorn-jsx/[email protected]:- resolution: {integrity: sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==}+ /acorn-jsx/[email protected]:+ resolution:+ {+ integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==+ }peerDependencies:acorn: ^6.0.0 || ^7.0.0 || ^8.0.0dependencies:@@ -417,7 +746,10 @@ packages:dev: true/acorn-node/1.8.2:- resolution: {integrity: sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==}+ resolution:+ {+ integrity: sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==+ }dependencies:acorn: 7.4.1acorn-walk: 7.2.0@@ -425,27 +757,67 @@ packages:dev: true/acorn-walk/7.2.0:- resolution: {integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==}- engines: {node: '>=0.4.0'}+ resolution:+ {+ integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==+ }+ engines: { node: '>=0.4.0' }+ dev: true++ /acorn-walk/8.2.0:+ resolution:+ {+ integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==+ }+ engines: { node: '>=0.4.0' }dev: true/acorn/7.4.1:- resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==}- engines: {node: '>=0.4.0'}+ resolution:+ {+ integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==+ }+ engines: { node: '>=0.4.0' }+ hasBin: true+ dev: true++ /acorn/8.5.0:+ resolution:+ {+ integrity: sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==+ }+ engines: { node: '>=0.4.0' }hasBin: truedev: true/agent-base/6.0.2:- resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}- engines: {node: '>= 6.0.0'}+ resolution:+ {+ integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==+ }+ engines: { node: '>= 6.0.0' }dependencies:- debug: 4.3.1+ debug: 4.3.3transitivePeerDependencies:- supports-colordev: false+ /aggregate-error/3.1.0:+ resolution:+ {+ integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==+ }+ engines: { node: '>=8' }+ dependencies:+ clean-stack: 2.2.0+ indent-string: 4.0.0+ dev: true+/ajv/6.12.6:- resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}+ resolution:+ {+ integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==+ }dependencies:fast-deep-equal: 3.1.3fast-json-stable-stringify: 2.1.0@@ -453,8 +825,11 @@ packages:uri-js: 4.4.1dev: true- /ajv/8.2.0:- resolution: {integrity: sha512-WSNGFuyWd//XO8n/m/EaOlNLtO0yL8EXT/74LqT4khdhpZjP7lkj/kT5uwRmGitKEVp/Oj7ZUHeGfPtgHhQ5CA==}+ /ajv/8.6.3:+ resolution:+ {+ integrity: sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==+ }dependencies:fast-deep-equal: 3.1.3json-schema-traverse: 1.0.0@@ -462,512 +837,1325 @@ packages:uri-js: 4.4.1dev: true- /alphanum-sort/1.0.2:- resolution: {integrity: sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=}+ /ansi-colors/4.1.1:+ resolution:+ {+ integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==+ }+ engines: { node: '>=6' }dev: true- /ansi-colors/4.1.1:- resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==}- engines: {node: '>=6'}+ /ansi-escapes/4.3.2:+ resolution:+ {+ integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==+ }+ engines: { node: '>=8' }+ dependencies:+ type-fest: 0.21.3dev: true/ansi-regex/2.1.1:- resolution: {integrity: sha1-w7M6te42DYbg5ijwRorn7yfWVN8=}- engines: {node: '>=0.10.0'}+ resolution: { integrity: sha1-w7M6te42DYbg5ijwRorn7yfWVN8= }+ engines: { node: '>=0.10.0' }+ dev: true++ /ansi-regex/3.0.0:+ resolution: { integrity: sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= }+ engines: { node: '>=4' }dev: false- /ansi-regex/5.0.0:- resolution: {integrity: sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==}- engines: {node: '>=8'}+ /ansi-regex/5.0.1:+ resolution:+ {+ integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==+ }+ engines: { node: '>=8' }++ /ansi-regex/6.0.1:+ resolution:+ {+ integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==+ }+ engines: { node: '>=12' }+ dev: true++ /ansi-styles/2.2.1:+ resolution: { integrity: sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= }+ engines: { node: '>=0.10.0' }dev: true/ansi-styles/3.2.1:- resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}- engines: {node: '>=4'}+ resolution:+ {+ integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==+ }+ engines: { node: '>=4' }dependencies:color-convert: 1.9.3dev: true/ansi-styles/4.3.0:- resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==+ }+ engines: { node: '>=8' }dependencies:color-convert: 2.0.1dev: true+ /ansi-styles/6.1.0:+ resolution:+ {+ integrity: sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==+ }+ engines: { node: '>=12' }+ dev: true+/anymatch/3.1.2:- resolution: {integrity: sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==}- engines: {node: '>= 8'}+ resolution:+ {+ integrity: sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==+ }+ engines: { node: '>= 8' }dependencies:normalize-path: 3.0.0picomatch: 2.3.0dev: true- /aproba/1.2.0:- resolution: {integrity: sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==}+ /aproba/2.0.0:+ resolution:+ {+ integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==+ }dev: false- /are-we-there-yet/1.1.5:- resolution: {integrity: sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==}+ /are-we-there-yet/2.0.0:+ resolution:+ {+ integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==+ }+ engines: { node: '>=10' }dependencies:delegates: 1.0.0- readable-stream: 2.3.7+ readable-stream: 3.6.0dev: false- /arg/5.0.0:- resolution: {integrity: sha512-4P8Zm2H+BRS+c/xX1LrHw0qKpEhdlZjLCgWy+d78T9vqa2Z2SiD2wMrYuWIAFy5IZUD7nnNXroRttz+0RzlrzQ==}+ /arg/4.1.3:+ resolution:+ {+ integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==+ }+ dev: true++ /arg/5.0.1:+ resolution:+ {+ integrity: sha512-e0hDa9H2Z9AwFkk2qDlwhoMYE4eToKarchkQHovNdLTCYMHZHeRjI71crOh+dio4K6u1IcwubQqo79Ga4CyAQA==+ }dev: true/argparse/1.0.10:- resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}+ resolution:+ {+ integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==+ }dependencies:sprintf-js: 1.0.3dev: true/argparse/2.0.1:- resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}+ resolution:+ {+ integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==+ }dev: false/array-union/2.1.0:- resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==+ }+ engines: { node: '>=8' }dev: true/asn1/0.2.4:- resolution: {integrity: sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==}+ resolution:+ {+ integrity: sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==+ }dependencies:safer-buffer: 2.1.2dev: false/astral-regex/2.0.0:- resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==+ }+ engines: { node: '>=8' }dev: true/auto-parse/1.8.0:- resolution: {integrity: sha512-Uri4uC+K5cSi5hjM4snFrqPrjqUpwxeSW5EMTPvN7Ju3PlDzmXXDr5tjdzxPvvwgT3J7bmMDJ3Rm625nbrc72A==}+ resolution:+ {+ integrity: sha512-Uri4uC+K5cSi5hjM4snFrqPrjqUpwxeSW5EMTPvN7Ju3PlDzmXXDr5tjdzxPvvwgT3J7bmMDJ3Rm625nbrc72A==+ }dependencies:typpy: 2.3.11dev: false- /autoprefixer/[email protected]:- resolution: {integrity: sha512-8lChSmdU6dCNMCQopIf4Pe5kipkAGj/fvTMslCsih0uHpOrXOPUEVOmYMMqmw3cekQkSD7EhIeuYl5y0BLdKqg==}- engines: {node: ^10 || ^12 || >=14}+ /autoprefixer/[email protected]:+ resolution:+ {+ integrity: sha512-9fOPpHKuDW1w/0EKfRmVnxTDt8166MAnLI3mgZ1JCnhNtYWxcJ6Ud5CO/AVOZi/AvFa8DY9RTy3h3+tFBlrrdQ==+ }+ engines: { node: ^10 || ^12 || >=14 }hasBin: truepeerDependencies:postcss: ^8.1.0dependencies:- browserslist: 4.16.6- caniuse-lite: 1.0.30001235- colorette: 1.2.2- fraction.js: 4.1.1+ browserslist: 4.19.1+ caniuse-lite: 1.0.30001300+ fraction.js: 4.1.2normalize-range: 0.1.2- postcss: 8.3.0- postcss-value-parser: 4.1.0+ picocolors: 1.0.0+ postcss: 8.4.6+ postcss-value-parser: 4.2.0dev: true- /balanced-match/1.0.2:- resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}-- /base64-js/1.5.1:- resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}- dev: false-- /bcrypt-pbkdf/1.0.2:- resolution: {integrity: sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=}- dependencies:- tweetnacl: 0.14.5- dev: false-- /bcrypt/5.0.1:- resolution: {integrity: sha512-9BTgmrhZM2t1bNuDtrtIMVSmmxZBrJ71n8Wg+YgdjHuIWYF7SjjmCPZFB+/5i/o/PIeRpwVJR3P+NrpIItUjqw==}- engines: {node: '>= 10.0.0'}- requiresBuild: true+ /babel-code-frame/6.26.0:+ resolution: { integrity: sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= }dependencies:- '@mapbox/node-pre-gyp': 1.0.5- node-addon-api: 3.2.1- transitivePeerDependencies:- - supports-color- dev: false-- /binary-extensions/2.2.0:- resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}- engines: {node: '>=8'}+ chalk: 1.1.3+ esutils: 2.0.3+ js-tokens: 3.0.2+ dev: true++ /babel-core/6.26.3:+ resolution:+ {+ integrity: sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==+ }+ dependencies:+ babel-code-frame: 6.26.0+ babel-generator: 6.26.1+ babel-helpers: 6.24.1+ babel-messages: 6.23.0+ babel-register: 6.26.0+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0+ babylon: 6.18.0+ convert-source-map: 1.8.0+ debug: 2.6.9+ json5: 0.5.1+ lodash: 4.17.21+ minimatch: 3.0.4+ path-is-absolute: 1.0.1+ private: 0.1.8+ slash: 1.0.0+ source-map: 0.5.7+ dev: true++ /babel-generator/6.26.1:+ resolution:+ {+ integrity: sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==+ }+ dependencies:+ babel-messages: 6.23.0+ babel-runtime: 6.26.0+ babel-types: 6.26.0+ detect-indent: 4.0.0+ jsesc: 1.3.0+ lodash: 4.17.21+ source-map: 0.5.7+ trim-right: 1.0.1dev: true- /bl/2.2.1:- resolution: {integrity: sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==}+ /babel-helper-bindify-decorators/6.24.1:+ resolution: { integrity: sha1-FMGeXxQte0fxmlJDHlKxzLxAozA= }dependencies:- readable-stream: 2.3.7- safe-buffer: 5.2.1- dev: false+ babel-runtime: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0+ dev: true- /bl/4.1.0:- resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}+ /babel-helper-builder-binary-assignment-operator-visitor/6.24.1:+ resolution: { integrity: sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= }dependencies:- buffer: 5.7.1- inherits: 2.0.4- readable-stream: 3.6.0- dev: false-- /bluebird/3.5.1:- resolution: {integrity: sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==}- dev: false-- /boolbase/1.0.0:- resolution: {integrity: sha1-aN/1++YMUes3cl6p4+0xDcwed24=}+ babel-helper-explode-assignable-expression: 6.24.1+ babel-runtime: 6.26.0+ babel-types: 6.26.0dev: true- /brace-expansion/1.1.11:- resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}+ /babel-helper-call-delegate/6.24.1:+ resolution: { integrity: sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= }dependencies:- balanced-match: 1.0.2- concat-map: 0.0.1+ babel-helper-hoist-variables: 6.24.1+ babel-runtime: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0+ dev: true- /braces/3.0.2:- resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}- engines: {node: '>=8'}+ /babel-helper-define-map/6.26.0:+ resolution: { integrity: sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= }dependencies:- fill-range: 7.0.1+ babel-helper-function-name: 6.24.1+ babel-runtime: 6.26.0+ babel-types: 6.26.0+ lodash: 4.17.21dev: true- /browserslist/4.16.6:- resolution: {integrity: sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==}- engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}- hasBin: true+ /babel-helper-explode-assignable-expression/6.24.1:+ resolution: { integrity: sha1-8luCz33BBDPFX3BZLVdGQArCLKo= }dependencies:- caniuse-lite: 1.0.30001235- colorette: 1.2.2- electron-to-chromium: 1.3.725- escalade: 3.1.1- node-releases: 1.1.71+ babel-runtime: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0dev: true- /bson/1.1.6:- resolution: {integrity: sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg==}- engines: {node: '>=0.6.19'}- dev: false-- /buffer-equal-constant-time/1.0.1:- resolution: {integrity: sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=}- dev: false-- /buffer/5.7.1:- resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}+ /babel-helper-explode-class/6.24.1:+ resolution: { integrity: sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes= }dependencies:- base64-js: 1.5.1- ieee754: 1.2.1- dev: false-- /bytes/3.1.0:- resolution: {integrity: sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==}- engines: {node: '>= 0.8'}+ babel-helper-bindify-decorators: 6.24.1+ babel-runtime: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0dev: true- /callsites/3.1.0:- resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}- engines: {node: '>=6'}+ /babel-helper-function-name/6.24.1:+ resolution: { integrity: sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= }+ dependencies:+ babel-helper-get-function-arity: 6.24.1+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0dev: true- /camelcase-css/2.0.1:- resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==}- engines: {node: '>= 6'}+ /babel-helper-get-function-arity/6.24.1:+ resolution: { integrity: sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= }+ dependencies:+ babel-runtime: 6.26.0+ babel-types: 6.26.0dev: true- /camelcase/5.3.1:- resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}- engines: {node: '>=6'}- dev: false-- /caniuse-api/3.0.0:- resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==}+ /babel-helper-hoist-variables/6.24.1:+ resolution: { integrity: sha1-HssnaJydJVE+rbyZFKc/VAi+enY= }dependencies:- browserslist: 4.16.6- caniuse-lite: 1.0.30001235- lodash.memoize: 4.1.2- lodash.uniq: 4.5.0+ babel-runtime: 6.26.0+ babel-types: 6.26.0dev: true- /caniuse-lite/1.0.30001235:- resolution: {integrity: sha512-zWEwIVqnzPkSAXOUlQnPW2oKoYb2aLQ4Q5ejdjBcnH63rfypaW34CxaeBn1VMya2XaEU3P/R2qHpWyj+l0BT1A==}+ /babel-helper-optimise-call-expression/6.24.1:+ resolution: { integrity: sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= }+ dependencies:+ babel-runtime: 6.26.0+ babel-types: 6.26.0dev: true- /chalk/2.4.2:- resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}- engines: {node: '>=4'}+ /babel-helper-regex/6.26.0:+ resolution: { integrity: sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= }dependencies:- ansi-styles: 3.2.1- escape-string-regexp: 1.0.5- supports-color: 5.5.0+ babel-runtime: 6.26.0+ babel-types: 6.26.0+ lodash: 4.17.21dev: true- /chalk/4.1.1:- resolution: {integrity: sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==}- engines: {node: '>=10'}+ /babel-helper-remap-async-to-generator/6.24.1:+ resolution: { integrity: sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= }dependencies:- ansi-styles: 4.3.0- supports-color: 7.2.0+ babel-helper-function-name: 6.24.1+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0dev: true- /cheap-watch/1.0.3:- resolution: {integrity: sha512-xC5CruMhLzjPwJ5ecUxGu1uGmwJQykUhqd2QrCrYbwvsFYdRyviu6jG9+pccwDXJR/OpmOTOJ9yLFunVgQu9wg==}- engines: {node: '>=8'}+ /babel-helper-replace-supers/6.24.1:+ resolution: { integrity: sha1-v22/5Dk40XNpohPKiov3S2qQqxo= }+ dependencies:+ babel-helper-optimise-call-expression: 6.24.1+ babel-messages: 6.23.0+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0dev: true- /chokidar/3.5.2:- resolution: {integrity: sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==}- engines: {node: '>= 8.10.0'}+ /babel-helpers/6.24.1:+ resolution: { integrity: sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= }dependencies:- anymatch: 3.1.2- braces: 3.0.2- glob-parent: 5.1.2- is-binary-path: 2.1.0- is-glob: 4.0.1- normalize-path: 3.0.0- readdirp: 3.6.0- optionalDependencies:- fsevents: 2.3.2+ babel-runtime: 6.26.0+ babel-template: 6.26.0dev: true- /chownr/1.1.4:- resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}- dev: false-- /chownr/2.0.0:- resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}- engines: {node: '>=10'}- dev: false-- /code-point-at/1.1.0:- resolution: {integrity: sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=}- engines: {node: '>=0.10.0'}- dev: false-- /color-convert/1.9.3:- resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}+ /babel-messages/6.23.0:+ resolution: { integrity: sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= }dependencies:- color-name: 1.1.3+ babel-runtime: 6.26.0dev: true- /color-convert/2.0.1:- resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}- engines: {node: '>=7.0.0'}+ /babel-plugin-check-es2015-constants/6.22.0:+ resolution: { integrity: sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= }dependencies:- color-name: 1.1.4+ babel-runtime: 6.26.0dev: true- /color-name/1.1.3:- resolution: {integrity: sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=}+ /babel-plugin-syntax-async-functions/6.13.0:+ resolution: { integrity: sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= }dev: true- /color-name/1.1.4:- resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}+ /babel-plugin-syntax-async-generators/6.13.0:+ resolution: { integrity: sha1-a8lj67FuzLrmuStZbrfzXDQqi5o= }dev: true- /color-string/1.5.5:- resolution: {integrity: sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg==}- dependencies:- color-name: 1.1.4- simple-swizzle: 0.2.2+ /babel-plugin-syntax-class-constructor-call/6.18.0:+ resolution: { integrity: sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY= }dev: true- /color/3.1.3:- resolution: {integrity: sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ==}- dependencies:- color-convert: 1.9.3- color-string: 1.5.5+ /babel-plugin-syntax-class-properties/6.13.0:+ resolution: { integrity: sha1-1+sjt5oxf4VDlixQW4J8fWysJ94= }dev: true- /colord/2.0.1:- resolution: {integrity: sha512-vm5YpaWamD0Ov6TSG0GGmUIwstrWcfKQV/h2CmbR7PbNu41+qdB5PW9lpzhjedrpm08uuYvcXi0Oel1RLZIJuA==}+ /babel-plugin-syntax-decorators/6.13.0:+ resolution: { integrity: sha1-MSVjtNvePMgGzuPkFszurd0RrAs= }dev: true- /colorette/1.2.2:- resolution: {integrity: sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==}+ /babel-plugin-syntax-do-expressions/6.13.0:+ resolution: { integrity: sha1-V0d1YTmqJtOQ0JQQsDdEugfkeW0= }dev: true- /commander/6.2.1:- resolution: {integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==}- engines: {node: '>= 6'}+ /babel-plugin-syntax-dynamic-import/6.18.0:+ resolution: { integrity: sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo= }dev: true- /commander/7.2.0:- resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==}- engines: {node: '>= 10'}+ /babel-plugin-syntax-exponentiation-operator/6.13.0:+ resolution: { integrity: sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= }+ dev: true- /compare-versions/3.6.0:- resolution: {integrity: sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==}- dev: false+ /babel-plugin-syntax-export-extensions/6.13.0:+ resolution: { integrity: sha1-cKFITw+QiaToStRLrDU8lbmxJyE= }+ dev: true- /concat-map/0.0.1:- resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}+ /babel-plugin-syntax-function-bind/6.13.0:+ resolution: { integrity: sha1-SMSV8Xe98xqYHnMvVa3AvdJgH0Y= }+ dev: true- /console-control-strings/1.1.0:- resolution: {integrity: sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=}- dev: false+ /babel-plugin-syntax-object-rest-spread/6.13.0:+ resolution: { integrity: sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= }+ dev: true- /cookie/0.4.1:- resolution: {integrity: sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==}- engines: {node: '>= 0.6'}- dev: false+ /babel-plugin-syntax-trailing-function-commas/6.22.0:+ resolution: { integrity: sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= }+ dev: true- /core-util-is/1.0.2:- resolution: {integrity: sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=}- dev: false+ /babel-plugin-transform-async-generator-functions/6.24.1:+ resolution: { integrity: sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds= }+ dependencies:+ babel-helper-remap-async-to-generator: 6.24.1+ babel-plugin-syntax-async-generators: 6.13.0+ babel-runtime: 6.26.0+ dev: true- /cosmiconfig/7.0.0:- resolution: {integrity: sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==}- engines: {node: '>=10'}+ /babel-plugin-transform-async-to-generator/6.24.1:+ resolution: { integrity: sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= }dependencies:- '@types/parse-json': 4.0.0- import-fresh: 3.3.0- parse-json: 5.2.0- path-type: 4.0.0- yaml: 1.10.2+ babel-helper-remap-async-to-generator: 6.24.1+ babel-plugin-syntax-async-functions: 6.13.0+ babel-runtime: 6.26.0dev: true- /cross-spawn/7.0.3:- resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}- engines: {node: '>= 8'}+ /babel-plugin-transform-class-constructor-call/6.24.1:+ resolution: { integrity: sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk= }dependencies:- path-key: 3.1.1- shebang-command: 2.0.0- which: 2.0.2+ babel-plugin-syntax-class-constructor-call: 6.18.0+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ dev: true- /css-color-names/0.0.4:- resolution: {integrity: sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=}+ /babel-plugin-transform-class-properties/6.24.1:+ resolution: { integrity: sha1-anl2PqYdM9NvN7YRqp3vgagbRqw= }+ dependencies:+ babel-helper-function-name: 6.24.1+ babel-plugin-syntax-class-properties: 6.13.0+ babel-runtime: 6.26.0+ babel-template: 6.26.0dev: true- /css-color-names/1.0.1:- resolution: {integrity: sha512-/loXYOch1qU1biStIFsHH8SxTmOseh1IJqFvy8IujXOm1h+QjUdDhkzOrR5HG8K8mlxREj0yfi8ewCHx0eMxzA==}+ /babel-plugin-transform-decorators/6.24.1:+ resolution: { integrity: sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0= }+ dependencies:+ babel-helper-explode-class: 6.24.1+ babel-plugin-syntax-decorators: 6.13.0+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ babel-types: 6.26.0dev: true- /css-declaration-sorter/[email protected]:- resolution: {integrity: sha512-52P95mvW1SMzuRZegvpluT6yEv0FqQusydKQPZsNN5Q7hh8EwQvN8E2nwuJ16BBvNN6LcoIZXu/Bk58DAhrrxw==}- engines: {node: '>= 10'}- peerDependencies:- postcss: ^8.0.9+ /babel-plugin-transform-do-expressions/6.22.0:+ resolution: { integrity: sha1-KMyvkoEtlJws0SgfaQyP3EaK6bs= }dependencies:- postcss: 8.3.0- timsort: 0.3.0+ babel-plugin-syntax-do-expressions: 6.13.0+ babel-runtime: 6.26.0dev: true- /css-select/3.1.2:- resolution: {integrity: sha512-qmss1EihSuBNWNNhHjxzxSfJoFBM/lERB/Q4EnsJQQC62R2evJDW481091oAdOr9uh46/0n4nrg0It5cAnj1RA==}+ /babel-plugin-transform-es2015-arrow-functions/6.22.0:+ resolution: { integrity: sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= }dependencies:- boolbase: 1.0.0- css-what: 4.0.0- domhandler: 4.2.0- domutils: 2.6.0- nth-check: 2.0.0+ babel-runtime: 6.26.0dev: true- /css-tree/1.1.3:- resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==}- engines: {node: '>=8.0.0'}+ /babel-plugin-transform-es2015-block-scoped-functions/6.22.0:+ resolution: { integrity: sha1-u8UbSflk1wy42OC5ToICRs46YUE= }dependencies:- mdn-data: 2.0.14- source-map: 0.6.1+ babel-runtime: 6.26.0dev: true- /css-unit-converter/1.1.2:- resolution: {integrity: sha512-IiJwMC8rdZE0+xiEZHeru6YoONC4rfPMqGm2W85jMIbkFvv5nFTwJVFHam2eFrN6txmoUYFAFXiv8ICVeTO0MA==}+ /babel-plugin-transform-es2015-block-scoping/6.26.0:+ resolution: { integrity: sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= }+ dependencies:+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0+ lodash: 4.17.21dev: true- /css-what/4.0.0:- resolution: {integrity: sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A==}- engines: {node: '>= 6'}+ /babel-plugin-transform-es2015-classes/6.24.1:+ resolution: { integrity: sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= }+ dependencies:+ babel-helper-define-map: 6.26.0+ babel-helper-function-name: 6.24.1+ babel-helper-optimise-call-expression: 6.24.1+ babel-helper-replace-supers: 6.24.1+ babel-messages: 6.23.0+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0dev: true- /cssesc/3.0.0:- resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}- engines: {node: '>=4'}- hasBin: true+ /babel-plugin-transform-es2015-computed-properties/6.24.1:+ resolution: { integrity: sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= }+ dependencies:+ babel-runtime: 6.26.0+ babel-template: 6.26.0dev: true- /cssnano-preset-default/[email protected]:- resolution: {integrity: sha512-spilp8LRw0sacuxiN9A/dyyPr6G/WISKMBKcBD4NMoPV0ENx4DeuWvIIrSx9PII2nJIDCO3kywkqTPreECBVOg==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- css-declaration-sorter: [email protected]- cssnano-utils: [email protected]- postcss: 8.3.0- postcss-calc: [email protected]- postcss-colormin: [email protected]- postcss-convert-values: [email protected]- postcss-discard-comments: [email protected]- postcss-discard-duplicates: [email protected]- postcss-discard-empty: [email protected]- postcss-discard-overridden: [email protected]- postcss-merge-longhand: [email protected]- postcss-merge-rules: [email protected]- postcss-minify-font-values: [email protected]- postcss-minify-gradients: [email protected]- postcss-minify-params: [email protected]- postcss-minify-selectors: [email protected]- postcss-normalize-charset: [email protected]- postcss-normalize-display-values: [email protected]- postcss-normalize-positions: [email protected]- postcss-normalize-repeat-style: [email protected]- postcss-normalize-string: [email protected]- postcss-normalize-timing-functions: [email protected]- postcss-normalize-unicode: [email protected]- postcss-normalize-url: [email protected]- postcss-normalize-whitespace: [email protected]- postcss-ordered-values: [email protected]- postcss-reduce-initial: [email protected]- postcss-reduce-transforms: [email protected]- postcss-svgo: [email protected]- postcss-unique-selectors: [email protected]- dev: true-- /cssnano-utils/[email protected]:- resolution: {integrity: sha512-i8vLRZTnEH9ubIyfdZCAdIdgnHAUeQeByEeQ2I7oTilvP9oHO6RScpeq3GsFUVqeB8uZgOQ9pw8utofNn32hhQ==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15+ /babel-plugin-transform-es2015-destructuring/6.23.0:+ resolution: { integrity: sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= }dependencies:- postcss: 8.3.0+ babel-runtime: 6.26.0dev: true- /cssnano/[email protected]:- resolution: {integrity: sha512-L2VtPXnq6rmcMC9vkBOP131sZu3ccRQI27ejKZdmQiPDpUlFkUbpXHgKN+cibeO1U4PItxVZp1zTIn5dHsXoyg==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15+ /babel-plugin-transform-es2015-duplicate-keys/6.24.1:+ resolution: { integrity: sha1-c+s9MQypaePvnskcU3QabxV2Qj4= }dependencies:- cosmiconfig: 7.0.0- cssnano-preset-default: [email protected]- is-resolvable: 1.1.0- postcss: 8.3.0+ babel-runtime: 6.26.0+ babel-types: 6.26.0dev: true- /csso/4.2.0:- resolution: {integrity: sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==}- engines: {node: '>=8.0.0'}+ /babel-plugin-transform-es2015-for-of/6.23.0:+ resolution: { integrity: sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= }dependencies:- css-tree: 1.1.3+ babel-runtime: 6.26.0dev: true- /cuid/2.1.8:- resolution: {integrity: sha512-xiEMER6E7TlTPnDxrM4eRiC6TRgjNX9xzEZ5U/Se2YJKr7Mq4pJn/2XEHjl3STcSh96GmkHPcBXLES8M29wyyg==}- dev: false+ /babel-plugin-transform-es2015-function-name/6.24.1:+ resolution: { integrity: sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= }+ dependencies:+ babel-helper-function-name: 6.24.1+ babel-runtime: 6.26.0+ babel-types: 6.26.0+ dev: true- /dayjs/1.10.5:- resolution: {integrity: sha512-BUFis41ikLz+65iH6LHQCDm4YPMj5r1YFLdupPIyM4SGcXMmtiLQ7U37i+hGS8urIuqe7I/ou3IS1jVc4nbN4g==}- dev: false+ /babel-plugin-transform-es2015-literals/6.22.0:+ resolution: { integrity: sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= }+ dependencies:+ babel-runtime: 6.26.0+ dev: true- /debug/3.1.0:- resolution: {integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==}+ /babel-plugin-transform-es2015-modules-amd/6.24.1:+ resolution: { integrity: sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= }dependencies:- ms: 2.0.0- dev: false+ babel-plugin-transform-es2015-modules-commonjs: 6.26.2+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ dev: true- /debug/4.3.1:- resolution: {integrity: sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==}- engines: {node: '>=6.0'}+ /babel-plugin-transform-es2015-modules-commonjs/6.26.2:+ resolution:+ {+ integrity: sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==+ }+ dependencies:+ babel-plugin-transform-strict-mode: 6.24.1+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ babel-types: 6.26.0+ dev: true++ /babel-plugin-transform-es2015-modules-systemjs/6.24.1:+ resolution: { integrity: sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= }+ dependencies:+ babel-helper-hoist-variables: 6.24.1+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ dev: true++ /babel-plugin-transform-es2015-modules-umd/6.24.1:+ resolution: { integrity: sha1-rJl+YoXNGO1hdq22B9YCNErThGg= }+ dependencies:+ babel-plugin-transform-es2015-modules-amd: 6.24.1+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ dev: true++ /babel-plugin-transform-es2015-object-super/6.24.1:+ resolution: { integrity: sha1-JM72muIcuDp/hgPa0CH1cusnj40= }+ dependencies:+ babel-helper-replace-supers: 6.24.1+ babel-runtime: 6.26.0+ dev: true++ /babel-plugin-transform-es2015-parameters/6.24.1:+ resolution: { integrity: sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= }+ dependencies:+ babel-helper-call-delegate: 6.24.1+ babel-helper-get-function-arity: 6.24.1+ babel-runtime: 6.26.0+ babel-template: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0+ dev: true++ /babel-plugin-transform-es2015-shorthand-properties/6.24.1:+ resolution: { integrity: sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= }+ dependencies:+ babel-runtime: 6.26.0+ babel-types: 6.26.0+ dev: true++ /babel-plugin-transform-es2015-spread/6.22.0:+ resolution: { integrity: sha1-1taKmfia7cRTbIGlQujdnxdG+NE= }+ dependencies:+ babel-runtime: 6.26.0+ dev: true++ /babel-plugin-transform-es2015-sticky-regex/6.24.1:+ resolution: { integrity: sha1-AMHNsaynERLN8M9hJsLta0V8zbw= }+ dependencies:+ babel-helper-regex: 6.26.0+ babel-runtime: 6.26.0+ babel-types: 6.26.0+ dev: true++ /babel-plugin-transform-es2015-template-literals/6.22.0:+ resolution: { integrity: sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= }+ dependencies:+ babel-runtime: 6.26.0+ dev: true++ /babel-plugin-transform-es2015-typeof-symbol/6.23.0:+ resolution: { integrity: sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= }+ dependencies:+ babel-runtime: 6.26.0+ dev: true++ /babel-plugin-transform-es2015-unicode-regex/6.24.1:+ resolution: { integrity: sha1-04sS9C6nMj9yk4fxinxa4frrNek= }+ dependencies:+ babel-helper-regex: 6.26.0+ babel-runtime: 6.26.0+ regexpu-core: 2.0.0+ dev: true++ /babel-plugin-transform-exponentiation-operator/6.24.1:+ resolution: { integrity: sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= }+ dependencies:+ babel-helper-builder-binary-assignment-operator-visitor: 6.24.1+ babel-plugin-syntax-exponentiation-operator: 6.13.0+ babel-runtime: 6.26.0+ dev: true++ /babel-plugin-transform-export-extensions/6.22.0:+ resolution: { integrity: sha1-U3OLR+deghhYnuqUbLvTkQm75lM= }+ dependencies:+ babel-plugin-syntax-export-extensions: 6.13.0+ babel-runtime: 6.26.0+ dev: true++ /babel-plugin-transform-function-bind/6.22.0:+ resolution: { integrity: sha1-xvuOlqwpajELjPjqQBRiQH3fapc= }+ dependencies:+ babel-plugin-syntax-function-bind: 6.13.0+ babel-runtime: 6.26.0+ dev: true++ /babel-plugin-transform-object-rest-spread/6.26.0:+ resolution: { integrity: sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= }+ dependencies:+ babel-plugin-syntax-object-rest-spread: 6.13.0+ babel-runtime: 6.26.0+ dev: true++ /babel-plugin-transform-regenerator/6.26.0:+ resolution: { integrity: sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= }+ dependencies:+ regenerator-transform: 0.10.1+ dev: true++ /babel-plugin-transform-strict-mode/6.24.1:+ resolution: { integrity: sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= }+ dependencies:+ babel-runtime: 6.26.0+ babel-types: 6.26.0+ dev: true++ /babel-preset-es2015/6.24.1:+ resolution: { integrity: sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk= }+ deprecated: '🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!'+ dependencies:+ babel-plugin-check-es2015-constants: 6.22.0+ babel-plugin-transform-es2015-arrow-functions: 6.22.0+ babel-plugin-transform-es2015-block-scoped-functions: 6.22.0+ babel-plugin-transform-es2015-block-scoping: 6.26.0+ babel-plugin-transform-es2015-classes: 6.24.1+ babel-plugin-transform-es2015-computed-properties: 6.24.1+ babel-plugin-transform-es2015-destructuring: 6.23.0+ babel-plugin-transform-es2015-duplicate-keys: 6.24.1+ babel-plugin-transform-es2015-for-of: 6.23.0+ babel-plugin-transform-es2015-function-name: 6.24.1+ babel-plugin-transform-es2015-literals: 6.22.0+ babel-plugin-transform-es2015-modules-amd: 6.24.1+ babel-plugin-transform-es2015-modules-commonjs: 6.26.2+ babel-plugin-transform-es2015-modules-systemjs: 6.24.1+ babel-plugin-transform-es2015-modules-umd: 6.24.1+ babel-plugin-transform-es2015-object-super: 6.24.1+ babel-plugin-transform-es2015-parameters: 6.24.1+ babel-plugin-transform-es2015-shorthand-properties: 6.24.1+ babel-plugin-transform-es2015-spread: 6.22.0+ babel-plugin-transform-es2015-sticky-regex: 6.24.1+ babel-plugin-transform-es2015-template-literals: 6.22.0+ babel-plugin-transform-es2015-typeof-symbol: 6.23.0+ babel-plugin-transform-es2015-unicode-regex: 6.24.1+ babel-plugin-transform-regenerator: 6.26.0+ dev: true++ /babel-preset-stage-0/6.24.1:+ resolution: { integrity: sha1-VkLRUEL5E4TX5a+LyIsduVsDnmo= }+ dependencies:+ babel-plugin-transform-do-expressions: 6.22.0+ babel-plugin-transform-function-bind: 6.22.0+ babel-preset-stage-1: 6.24.1+ dev: true++ /babel-preset-stage-1/6.24.1:+ resolution: { integrity: sha1-dpLNfc1oSZB+auSgqFWJz7niv7A= }+ dependencies:+ babel-plugin-transform-class-constructor-call: 6.24.1+ babel-plugin-transform-export-extensions: 6.22.0+ babel-preset-stage-2: 6.24.1+ dev: true++ /babel-preset-stage-2/6.24.1:+ resolution: { integrity: sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE= }+ dependencies:+ babel-plugin-syntax-dynamic-import: 6.18.0+ babel-plugin-transform-class-properties: 6.24.1+ babel-plugin-transform-decorators: 6.24.1+ babel-preset-stage-3: 6.24.1+ dev: true++ /babel-preset-stage-3/6.24.1:+ resolution: { integrity: sha1-g2raCp56f6N8sTj7kyb4eTSkg5U= }+ dependencies:+ babel-plugin-syntax-trailing-function-commas: 6.22.0+ babel-plugin-transform-async-generator-functions: 6.24.1+ babel-plugin-transform-async-to-generator: 6.24.1+ babel-plugin-transform-exponentiation-operator: 6.24.1+ babel-plugin-transform-object-rest-spread: 6.26.0+ dev: true++ /babel-register/6.26.0:+ resolution: { integrity: sha1-btAhFz4vy0htestFxgCahW9kcHE= }+ dependencies:+ babel-core: 6.26.3+ babel-runtime: 6.26.0+ core-js: 2.6.12+ home-or-tmp: 2.0.0+ lodash: 4.17.21+ mkdirp: 0.5.5+ source-map-support: 0.4.18+ dev: true++ /babel-runtime/6.26.0:+ resolution: { integrity: sha1-llxwWGaOgrVde/4E/yM3vItWR/4= }+ dependencies:+ core-js: 2.6.12+ regenerator-runtime: 0.11.1+ dev: true++ /babel-template/6.26.0:+ resolution: { integrity: sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= }+ dependencies:+ babel-runtime: 6.26.0+ babel-traverse: 6.26.0+ babel-types: 6.26.0+ babylon: 6.18.0+ lodash: 4.17.21+ dev: true++ /babel-traverse/6.26.0:+ resolution: { integrity: sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= }+ dependencies:+ babel-code-frame: 6.26.0+ babel-messages: 6.23.0+ babel-runtime: 6.26.0+ babel-types: 6.26.0+ babylon: 6.18.0+ debug: 2.6.9+ globals: 9.18.0+ invariant: 2.2.4+ lodash: 4.17.21+ dev: true++ /babel-types/6.26.0:+ resolution: { integrity: sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= }+ dependencies:+ babel-runtime: 6.26.0+ esutils: 2.0.3+ lodash: 4.17.21+ to-fast-properties: 1.0.3+ dev: true++ /babylon/6.18.0:+ resolution:+ {+ integrity: sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==+ }+ hasBin: true+ dev: true++ /balanced-match/1.0.2:+ resolution:+ {+ integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==+ }++ /base64-js/1.5.1:+ resolution:+ {+ integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==+ }+ dev: false++ /bcrypt-pbkdf/1.0.2:+ resolution: { integrity: sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= }+ dependencies:+ tweetnacl: 0.14.5+ dev: false++ /bcrypt/5.0.1:+ resolution:+ {+ integrity: sha512-9BTgmrhZM2t1bNuDtrtIMVSmmxZBrJ71n8Wg+YgdjHuIWYF7SjjmCPZFB+/5i/o/PIeRpwVJR3P+NrpIItUjqw==+ }+ engines: { node: '>= 10.0.0' }+ requiresBuild: true+ dependencies:+ '@mapbox/node-pre-gyp': 1.0.6+ node-addon-api: 3.2.1+ transitivePeerDependencies:+ - supports-color+ dev: false++ /binary-extensions/2.2.0:+ resolution:+ {+ integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==+ }+ engines: { node: '>=8' }+ dev: true++ /bl/4.1.0:+ resolution:+ {+ integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==+ }+ dependencies:+ buffer: 5.7.1+ inherits: 2.0.4+ readable-stream: 3.6.0+ dev: false++ /brace-expansion/1.1.11:+ resolution:+ {+ integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==+ }+ dependencies:+ balanced-match: 1.0.2+ concat-map: 0.0.1++ /braces/3.0.2:+ resolution:+ {+ integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==+ }+ engines: { node: '>=8' }+ dependencies:+ fill-range: 7.0.1+ dev: true++ /browserslist/4.19.1:+ resolution:+ {+ integrity: sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==+ }+ engines: { node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7 }+ hasBin: true+ dependencies:+ caniuse-lite: 1.0.30001300+ electron-to-chromium: 1.4.48+ escalade: 3.1.1+ node-releases: 2.0.1+ picocolors: 1.0.0+ dev: true++ /buffer-crc32/0.2.13:+ resolution: { integrity: sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= }+ dev: true++ /buffer-equal-constant-time/1.0.1:+ resolution: { integrity: sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= }+ dev: false++ /buffer/5.7.1:+ resolution:+ {+ integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==+ }+ dependencies:+ base64-js: 1.5.1+ ieee754: 1.2.1+ dev: false++ /bullmq/1.69.0:+ resolution:+ {+ integrity: sha512-1aIO7bN0HQeADWoXa+I72GgofvoBFRs/kcoveB3KN8ytKv7QJbGhtks0pYNhHn/P9H3OWHWDccpNEfnv3VGfcw==+ }+ dependencies:+ cron-parser: 2.18.0+ get-port: 5.1.1+ glob: 7.2.0+ ioredis: 4.28.3+ lodash: 4.17.21+ msgpackr: 1.4.7+ semver: 6.3.0+ tslib: 1.14.1+ uuid: 8.3.2+ transitivePeerDependencies:+ - supports-color+ dev: false++ /cacheable-lookup/6.0.4:+ resolution:+ {+ integrity: sha512-mbcDEZCkv2CZF4G01kr8eBd/5agkt9oCqz75tJMSIsquvRZ2sL6Hi5zGVKi/0OSC9oO1GHfJ2AV0ZIOY9vye0A==+ }+ engines: { node: '>=10.6.0' }+ dev: false++ /cacheable-request/7.0.2:+ resolution:+ {+ integrity: sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==+ }+ engines: { node: '>=8' }+ dependencies:+ clone-response: 1.0.2+ get-stream: 5.2.0+ http-cache-semantics: 4.1.0+ keyv: 4.0.4+ lowercase-keys: 2.0.0+ normalize-url: 6.1.0+ responselike: 2.0.0+ dev: false++ /call-bind/1.0.2:+ resolution:+ {+ integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==+ }+ dependencies:+ function-bind: 1.1.1+ get-intrinsic: 1.1.1+ dev: false++ /callsites/3.1.0:+ resolution:+ {+ integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==+ }+ engines: { node: '>=6' }+ dev: true++ /camelcase-css/2.0.1:+ resolution:+ {+ integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==+ }+ engines: { node: '>= 6' }+ dev: true++ /camelcase/5.3.1:+ resolution:+ {+ integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==+ }+ engines: { node: '>=6' }+ dev: false++ /caniuse-lite/1.0.30001300:+ resolution:+ {+ integrity: sha512-cVjiJHWGcNlJi8TZVKNMnvMid3Z3TTdDHmLDzlOdIiZq138Exvo0G+G0wTdVYolxKb4AYwC+38pxodiInVtJSA==+ }+ dev: true++ /chalk/1.1.3:+ resolution: { integrity: sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= }+ engines: { node: '>=0.10.0' }+ dependencies:+ ansi-styles: 2.2.1+ escape-string-regexp: 1.0.5+ has-ansi: 2.0.0+ strip-ansi: 3.0.1+ supports-color: 2.0.0+ dev: true++ /chalk/2.4.2:+ resolution:+ {+ integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==+ }+ engines: { node: '>=4' }+ dependencies:+ ansi-styles: 3.2.1+ escape-string-regexp: 1.0.5+ supports-color: 5.5.0+ dev: true++ /chalk/4.1.2:+ resolution:+ {+ integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==+ }+ engines: { node: '>=10' }+ dependencies:+ ansi-styles: 4.3.0+ supports-color: 7.2.0+ dev: true++ /chokidar/3.5.3:+ resolution:+ {+ integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==+ }+ engines: { node: '>= 8.10.0' }+ dependencies:+ anymatch: 3.1.2+ braces: 3.0.2+ glob-parent: 5.1.2+ is-binary-path: 2.1.0+ is-glob: 4.0.3+ normalize-path: 3.0.0+ readdirp: 3.6.0+ optionalDependencies:+ fsevents: 2.3.2+ dev: true++ /chownr/1.1.4:+ resolution:+ {+ integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==+ }+ dev: false++ /chownr/2.0.0:+ resolution:+ {+ integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==+ }+ engines: { node: '>=10' }+ dev: false++ /clean-stack/2.2.0:+ resolution:+ {+ integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==+ }+ engines: { node: '>=6' }+ dev: true++ /cli-cursor/3.1.0:+ resolution:+ {+ integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==+ }+ engines: { node: '>=8' }+ dependencies:+ restore-cursor: 3.1.0+ dev: true++ /cli-truncate/2.1.0:+ resolution:+ {+ integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==+ }+ engines: { node: '>=8' }+ dependencies:+ slice-ansi: 3.0.0+ string-width: 4.2.3+ dev: true++ /cli-truncate/3.1.0:+ resolution:+ {+ integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==+ }+ engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }+ dependencies:+ slice-ansi: 5.0.0+ string-width: 5.1.0+ dev: true++ /clone-response/1.0.2:+ resolution: { integrity: sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= }+ dependencies:+ mimic-response: 1.0.1+ dev: false++ /cluster-key-slot/1.1.0:+ resolution:+ {+ integrity: sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw==+ }+ engines: { node: '>=0.10.0' }+ dev: false++ /color-convert/1.9.3:+ resolution:+ {+ integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==+ }+ dependencies:+ color-name: 1.1.3+ dev: true++ /color-convert/2.0.1:+ resolution:+ {+ integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==+ }+ engines: { node: '>=7.0.0' }+ dependencies:+ color-name: 1.1.4+ dev: true++ /color-name/1.1.3:+ resolution: { integrity: sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= }+ dev: true++ /color-name/1.1.4:+ resolution:+ {+ integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==+ }+ dev: true++ /color-support/1.1.3:+ resolution:+ {+ integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==+ }+ hasBin: true+ dev: false++ /colorette/2.0.16:+ resolution:+ {+ integrity: sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==+ }+ dev: true++ /commander/8.3.0:+ resolution:+ {+ integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==+ }+ engines: { node: '>= 12' }+ dev: true++ /compare-versions/4.1.3:+ resolution:+ {+ integrity: sha512-WQfnbDcrYnGr55UwbxKiQKASnTtNnaAWVi8jZyy8NTpVAXWACSne8lMD1iaIo9AiU6mnuLvSVshCzewVuWxHUg==+ }+ dev: false++ /concat-map/0.0.1:+ resolution: { integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= }++ /console-control-strings/1.1.0:+ resolution: { integrity: sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= }+ dev: false++ /convert-source-map/1.8.0:+ resolution:+ {+ integrity: sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==+ }+ dependencies:+ safe-buffer: 5.1.2+ dev: true++ /cookie/0.4.2:+ resolution:+ {+ integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==+ }+ engines: { node: '>= 0.6' }+ dev: false++ /core-js/2.6.12:+ resolution:+ {+ integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==+ }+ deprecated: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.+ requiresBuild: true+ dev: true++ /cosmiconfig/7.0.1:+ resolution:+ {+ integrity: sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==+ }+ engines: { node: '>=10' }+ dependencies:+ '@types/parse-json': 4.0.0+ import-fresh: 3.3.0+ parse-json: 5.2.0+ path-type: 4.0.0+ yaml: 1.10.2+ dev: true++ /cpu-features/0.0.2:+ resolution:+ {+ integrity: sha512-/2yieBqvMcRj8McNzkycjW2v3OIUOibBfd2dLEJ0nWts8NobAxwiyw9phVNS6oDL8x8tz9F7uNVFEVpJncQpeA==+ }+ engines: { node: '>=8.0.0' }+ requiresBuild: true+ dependencies:+ nan: 2.15.0+ dev: false+ optional: true++ /create-require/1.1.1:+ resolution:+ {+ integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==+ }+ dev: true++ /cron-parser/2.18.0:+ resolution:+ {+ integrity: sha512-s4odpheTyydAbTBQepsqd2rNWGa2iV3cyo8g7zbI2QQYGLVsfbhmwukayS1XHppe02Oy1fg7mg6xoaraVJeEcg==+ }+ engines: { node: '>=0.8' }+ dependencies:+ is-nan: 1.3.2+ moment-timezone: 0.5.33+ dev: false++ /cross-spawn/5.1.0:+ resolution: { integrity: sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= }+ dependencies:+ lru-cache: 4.1.5+ shebang-command: 1.2.0+ which: 1.3.1+ dev: true++ /cross-spawn/7.0.3:+ resolution:+ {+ integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==+ }+ engines: { node: '>= 8' }+ dependencies:+ path-key: 3.1.1+ shebang-command: 2.0.0+ which: 2.0.2++ /cross-var/1.1.0:+ resolution: { integrity: sha1-8PDUuyNdlRONGlOYQtKQ8A23HNY= }+ hasBin: true+ dependencies:+ babel-preset-es2015: 6.24.1+ babel-preset-stage-0: 6.24.1+ babel-register: 6.26.0+ cross-spawn: 5.1.0+ exit: 0.1.2+ dev: true++ /cssesc/3.0.0:+ resolution:+ {+ integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==+ }+ engines: { node: '>=4' }+ hasBin: true+ dev: true++ /cuid/2.1.8:+ resolution:+ {+ integrity: sha512-xiEMER6E7TlTPnDxrM4eRiC6TRgjNX9xzEZ5U/Se2YJKr7Mq4pJn/2XEHjl3STcSh96GmkHPcBXLES8M29wyyg==+ }+ dev: false++ /dayjs/1.10.7:+ resolution:+ {+ integrity: sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==+ }+ dev: false++ /debug/2.6.9:+ resolution:+ {+ integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==+ }+ dependencies:+ ms: 2.0.0+ dev: true++ /debug/4.3.3:+ resolution:+ {+ integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==+ }+ engines: { node: '>=6.0' }peerDependencies:supports-color: '*'peerDependenciesMeta:@@ -976,9 +2164,12 @@ packages:dependencies:ms: 2.1.2- /debug/4.3.2:- resolution: {integrity: sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==}- engines: {node: '>=6.0'}+ /debug/[email protected]:+ resolution:+ {+ integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==+ }+ engines: { node: '>=6.0' }peerDependencies:supports-color: '*'peerDependenciesMeta:@@ -986,39 +2177,87 @@ packages:optional: truedependencies:ms: 2.1.2+ supports-color: 9.2.1dev: true- /deep-is/0.1.3:- resolution: {integrity: sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=}+ /decompress-response/6.0.0:+ resolution:+ {+ integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==+ }+ engines: { node: '>=10' }+ dependencies:+ mimic-response: 3.1.0+ dev: false++ /deep-is/0.1.4:+ resolution:+ {+ integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==+ }dev: true+ /defer-to-connect/2.0.1:+ resolution:+ {+ integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==+ }+ engines: { node: '>=10' }+ dev: false++ /define-properties/1.1.3:+ resolution:+ {+ integrity: sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==+ }+ engines: { node: '>= 0.4' }+ dependencies:+ object-keys: 1.1.1+ dev: false+/defined/1.0.0:- resolution: {integrity: sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=}+ resolution: { integrity: sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= }dev: true/delegates/1.0.0:- resolution: {integrity: sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=}+ resolution: { integrity: sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= }dev: false- /denque/1.5.0:- resolution: {integrity: sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==}- engines: {node: '>=0.10'}+ /denque/1.5.1:+ resolution:+ {+ integrity: sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==+ }+ engines: { node: '>=0.10' }dev: false- /detect-indent/6.0.0:- resolution: {integrity: sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==}- engines: {node: '>=8'}+ /detect-indent/4.0.0:+ resolution: { integrity: sha1-920GQ1LN9Docts5hnE7jqUdd4gg= }+ engines: { node: '>=0.10.0' }+ dependencies:+ repeating: 2.0.1+ dev: true++ /detect-indent/6.1.0:+ resolution:+ {+ integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==+ }+ engines: { node: '>=8' }dev: true/detect-libc/1.0.3:- resolution: {integrity: sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=}- engines: {node: '>=0.10'}+ resolution: { integrity: sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= }+ engines: { node: '>=0.10' }hasBin: truedev: false/detective/5.2.0:- resolution: {integrity: sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==}- engines: {node: '>=0.8.0'}+ resolution:+ {+ integrity: sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==+ }+ engines: { node: '>=0.8.0' }hasBin: truedependencies:acorn-node: 1.8.2@@ -1026,229 +2265,542 @@ packages:minimist: 1.2.5dev: true- /didyoumean/1.2.1:- resolution: {integrity: sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=}+ /didyoumean/1.2.2:+ resolution:+ {+ integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==+ }+ dev: true++ /diff/4.0.2:+ resolution:+ {+ integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==+ }+ engines: { node: '>=0.3.1' }dev: true/dir-glob/3.0.1:- resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==+ }+ engines: { node: '>=8' }dependencies:path-type: 4.0.0dev: true/dlv/1.1.3:- resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}+ resolution:+ {+ integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==+ }dev: true- /docker-modem/3.0.0:- resolution: {integrity: sha512-WwFajJ8I5geZ/dDZ5FDMDA6TBkWa76xWwGIGw8uzUjNUGCN0to83wJ8Oi1AxrJTC0JBn+7fvIxUctnawtlwXeg==}- engines: {node: '>= 8.0'}+ /docker-modem/3.0.3:+ resolution:+ {+ integrity: sha512-Tgkn2a+yiNP9FoZgMa/D9Wk+D2Db///0KOyKSYZRJa8w4+DzKyzQMkczKSdR/adQ0x46BOpeNkoyEOKjPhCzjw==+ }+ engines: { node: '>= 8.0' }dependencies:- debug: 4.3.1+ debug: 4.3.3readable-stream: 3.6.0split-ca: 1.0.1- ssh2: 0.8.9+ ssh2: 1.5.0transitivePeerDependencies:- supports-colordev: false- /dockerode/3.3.0:- resolution: {integrity: sha512-St08lfOjpYCOXEM8XA0VLu3B3hRjtddODphNW5GFoA0AS3JHgoPQKOz0Qmdzg3P+hUPxhb02g1o1Cu1G+U3lRg==}- engines: {node: '>= 8.0'}+ /dockerode/3.3.1:+ resolution:+ {+ integrity: sha512-AS2mr8Lp122aa5n6d99HkuTNdRV1wkkhHwBdcnY6V0+28D3DSYwhxAk85/mM9XwD3RMliTxyr63iuvn5ZblFYQ==+ }+ engines: { node: '>= 8.0' }dependencies:- docker-modem: 3.0.0+ docker-modem: 3.0.3tar-fs: 2.0.1transitivePeerDependencies:- supports-colordev: false/doctrine/3.0.0:- resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}- engines: {node: '>=6.0.0'}+ resolution:+ {+ integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==+ }+ engines: { node: '>=6.0.0' }dependencies:esutils: 2.0.3dev: true- /dom-serializer/1.3.1:- resolution: {integrity: sha512-Pv2ZluG5ife96udGgEDovOOOA5UELkltfJpnIExPrAk1LTvecolUGn6lIaoLh86d83GiB86CjzciMd9BuRB71Q==}- dependencies:- domelementtype: 2.2.0- domhandler: 4.2.0- entities: 2.2.0- dev: true-- /domelementtype/2.2.0:- resolution: {integrity: sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==}- dev: true-- /domhandler/4.2.0:- resolution: {integrity: sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==}- engines: {node: '>= 4'}- dependencies:- domelementtype: 2.2.0- dev: true-- /domutils/2.6.0:- resolution: {integrity: sha512-y0BezHuy4MDYxh6OvolXYsH+1EMGmFbwv5FKW7ovwMG6zTPWqNPq3WF9ayZssFq+UlKdffGLbOEaghNdaOm1WA==}- dependencies:- dom-serializer: 1.3.1- domelementtype: 2.2.0- domhandler: 4.2.0- dev: true-/dotenv-extended/2.9.0:- resolution: {integrity: sha512-MKc4WCqZj6Abx4rpDbQ9LsuBJldRLxLgFkY5qE+4JM7hXVYT/v8zyWGgnBeDjSOGzEecWOFPlosNpxfB9YnsCw==}- engines: {node: '>=6'}+ resolution:+ {+ integrity: sha512-MKc4WCqZj6Abx4rpDbQ9LsuBJldRLxLgFkY5qE+4JM7hXVYT/v8zyWGgnBeDjSOGzEecWOFPlosNpxfB9YnsCw==+ }+ engines: { node: '>=6' }hasBin: truedependencies:auto-parse: 1.8.0camelcase: 5.3.1cross-spawn: 7.0.3- dotenv: 8.2.0+ dotenv: 8.6.0dev: false- /dotenv/8.2.0:- resolution: {integrity: sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==}- engines: {node: '>=8'}+ /dotenv/8.6.0:+ resolution:+ {+ integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==+ }+ engines: { node: '>=10' }dev: false+ /eastasianwidth/0.2.0:+ resolution:+ {+ integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==+ }+ dev: true+/ecdsa-sig-formatter/1.0.11:- resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==}+ resolution:+ {+ integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==+ }dependencies:safe-buffer: 5.2.1dev: false- /electron-to-chromium/1.3.725:- resolution: {integrity: sha512-2BbeAESz7kc6KBzs7WVrMc1BY5waUphk4D4DX5dSQXJhsc3tP5ZFaiyuL0AB7vUKzDYpIeYwTYlEfxyjsGUrhw==}+ /electron-to-chromium/1.4.48:+ resolution:+ {+ integrity: sha512-RT3SEmpv7XUA+tKXrZGudAWLDpa7f8qmhjcLaM6OD/ERxjQ/zAojT8/Vvo0BSzbArkElFZ1WyZ9FuwAYbkdBNA==+ }dev: true/emoji-regex/8.0.0:- resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}+ resolution:+ {+ integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==+ }++ /emoji-regex/9.2.2:+ resolution:+ {+ integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==+ }dev: true/end-of-stream/1.4.4:- resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}+ resolution:+ {+ integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==+ }dependencies:once: 1.4.0dev: false/enquirer/2.3.6:- resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==}- engines: {node: '>=8.6'}+ resolution:+ {+ integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==+ }+ engines: { node: '>=8.6' }dependencies:ansi-colors: 4.1.1dev: true- /entities/2.2.0:- resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==}- dev: true-/error-ex/1.3.2:- resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}+ resolution:+ {+ integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==+ }dependencies:is-arrayish: 0.2.1dev: true- /esbuild/0.12.15:- resolution: {integrity: sha512-72V4JNd2+48eOVCXx49xoSWHgC3/cCy96e7mbXKY+WOWghN00cCmlGnwVLRhRHorvv0dgCyuMYBZlM2xDM5OQw==}- hasBin: true+ /es6-promise/3.3.1:+ resolution: { integrity: sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM= }+ dev: true++ /esbuild-android-arm64/0.14.21:+ resolution:+ {+ integrity: sha512-Bqgld1TY0wZv8TqiQmVxQFgYzz8ZmyzT7clXBDZFkOOdRybzsnj8AZuK1pwcLVA7Ya6XncHgJqIao7NFd3s0RQ==+ }+ engines: { node: '>=12' }+ cpu: [arm64]+ os: [android]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-darwin-64/0.14.21:+ resolution:+ {+ integrity: sha512-j+Eg+e13djzyYINVvAbOo2/zvZ2DivuJJTaBrJnJHSD7kUNuGHRkHoSfFjbI80KHkn091w350wdmXDNSgRjfYQ==+ }+ engines: { node: '>=12' }+ cpu: [x64]+ os: [darwin]requiresBuild: truedev: true+ optional: true- /esbuild/0.12.6:- resolution: {integrity: sha512-RDvVLvAjsq/kIZJoneMiUOH7EE7t2QaW7T3Q7EdQij14+bZbDq5sndb0tTanmHIFSqZVMBMMyqzVHkS3dJobeA==}+ /esbuild-darwin-arm64/0.14.21:+ resolution:+ {+ integrity: sha512-nDNTKWDPI0RuoPj5BhcSB2z5EmZJJAyRtZLIjyXSqSpAyoB8eyAKXl4lB8U2P78Fnh4Lh1le/fmpewXE04JhBQ==+ }+ engines: { node: '>=12' }+ cpu: [arm64]+ os: [darwin]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-freebsd-64/0.14.21:+ resolution:+ {+ integrity: sha512-zIurkCHXhxELiDZtLGiexi8t8onQc2LtuE+S7457H/pP0g0MLRKMrsn/IN4LDkNe6lvBjuoZZi2OfelOHn831g==+ }+ engines: { node: '>=12' }+ cpu: [x64]+ os: [freebsd]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-freebsd-arm64/0.14.21:+ resolution:+ {+ integrity: sha512-wdxMmkJfbwcN+q85MpeUEamVZ40FNsBa9mPq8tAszDn8TRT2HoJvVRADPIIBa9SWWwlDChIMjkDKAnS3KS/sPA==+ }+ engines: { node: '>=12' }+ cpu: [arm64]+ os: [freebsd]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-linux-32/0.14.21:+ resolution:+ {+ integrity: sha512-fmxvyzOPPh2xiEHojpCeIQP6pXcoKsWbz3ryDDIKLOsk4xp3GbpHIEAWP0xTeuhEbendmvBDVKbAVv3PnODXLg==+ }+ engines: { node: '>=12' }+ cpu: [ia32]+ os: [linux]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-linux-64/0.14.21:+ resolution:+ {+ integrity: sha512-edZyNOv1ql+kpmlzdqzzDjRQYls+tSyi4QFi+PdBhATJFUqHsnNELWA9vMSzAaInPOEaVUTA5Ml28XFChcy4DA==+ }+ engines: { node: '>=12' }+ cpu: [x64]+ os: [linux]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-linux-arm/0.14.21:+ resolution:+ {+ integrity: sha512-aSU5pUueK6afqmLQsbU+QcFBT62L+4G9hHMJDHWfxgid6hzhSmfRH9U/f+ymvxsSTr/HFRU4y7ox8ZyhlVl98w==+ }+ engines: { node: '>=12' }+ cpu: [arm]+ os: [linux]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-linux-arm64/0.14.21:+ resolution:+ {+ integrity: sha512-t5qxRkq4zdQC0zXpzSB2bTtfLgOvR0C6BXYaRE/6/k8/4SrkZcTZBeNu+xGvwCU4b5dU9ST9pwIWkK6T1grS8g==+ }+ engines: { node: '>=12' }+ cpu: [arm64]+ os: [linux]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-linux-mips64le/0.14.21:+ resolution:+ {+ integrity: sha512-jLZLQGCNlUsmIHtGqNvBs3zN+7a4D9ckf0JZ+jQTwHdZJ1SgV9mAjbB980OFo66LoY+WeM7t3WEnq3FjI1zw4A==+ }+ engines: { node: '>=12' }+ cpu: [mips64el]+ os: [linux]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-linux-ppc64le/0.14.21:+ resolution:+ {+ integrity: sha512-4TWxpK391en2UBUw6GSrukToTDu6lL9vkm3Ll40HrI08WG3qcnJu7bl8e1+GzelDsiw1QmfAY/nNvJ6iaHRpCQ==+ }+ engines: { node: '>=12' }+ cpu: [ppc64]+ os: [linux]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-linux-riscv64/0.14.21:+ resolution:+ {+ integrity: sha512-fElngqOaOfTsF+u+oetDLHsPG74vB2ZaGZUqmGefAJn3a5z9Z2pNa4WpVbbKgHpaAAy5tWM1m1sbGohj6Ki6+Q==+ }+ engines: { node: '>=12' }+ cpu: [riscv64]+ os: [linux]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-linux-s390x/0.14.21:+ resolution:+ {+ integrity: sha512-brleZ6R5fYv0qQ7ZBwenQmP6i9TdvJCB092c/3D3pTLQHBGHJb5zWgKxOeS7bdHzmLy6a6W7GbFk6QKpjyD6QA==+ }+ engines: { node: '>=12' }+ cpu: [s390x]+ os: [linux]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-netbsd-64/0.14.21:+ resolution:+ {+ integrity: sha512-nCEgsLCQ8RoFWVV8pVI+kX66ICwbPP/M9vEa0NJGIEB/Vs5sVGMqkf67oln90XNSkbc0bPBDuo4G6FxlF7PN8g==+ }+ engines: { node: '>=12' }+ cpu: [x64]+ os: [netbsd]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-openbsd-64/0.14.21:+ resolution:+ {+ integrity: sha512-h9zLMyVD0T73MDTVYIb/qUTokwI6EJH9O6wESuTNq6+XpMSr6C5aYZ4fvFKdNELW+Xsod+yDS2hV2JTUAbFrLA==+ }+ engines: { node: '>=12' }+ cpu: [x64]+ os: [openbsd]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-sunos-64/0.14.21:+ resolution:+ {+ integrity: sha512-Kl+7Cot32qd9oqpLdB1tEGXEkjBlijrIxMJ0+vlDFaqsODutif25on0IZlFxEBtL2Gosd4p5WCV1U7UskNQfXA==+ }+ engines: { node: '>=12' }+ cpu: [x64]+ os: [sunos]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-windows-32/0.14.21:+ resolution:+ {+ integrity: sha512-V7vnTq67xPBUCk/9UtlolmQ798Ecjdr1ZoI1vcSgw7M82aSSt0eZdP6bh5KAFZU8pxDcx3qoHyWQfHYr11f22A==+ }+ engines: { node: '>=12' }+ cpu: [ia32]+ os: [win32]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-windows-64/0.14.21:+ resolution:+ {+ integrity: sha512-kDgHjKOHwjfJDCyRGELzVxiP/RBJBTA+wyspf78MTTJQkyPuxH2vChReNdWc+dU2S4gIZFHMdP1Qrl/k22ZmaA==+ }+ engines: { node: '>=12' }+ cpu: [x64]+ os: [win32]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild-windows-arm64/0.14.21:+ resolution:+ {+ integrity: sha512-8Sbo0zpzgwWrwjQYLmHF78f7E2xg5Ve63bjB2ng3V2aManilnnTGaliq2snYg+NOX60+hEvJHRdVnuIAHW0lVw==+ }+ engines: { node: '>=12' }+ cpu: [arm64]+ os: [win32]+ requiresBuild: true+ dev: true+ optional: true++ /esbuild/0.14.21:+ resolution:+ {+ integrity: sha512-7WEoNMBJdLN993dr9h0CpFHPRc3yFZD+EAVY9lg6syJJ12gc5fHq8d75QRExuhnMkT2DaRiIKFThRvDWP+fO+A==+ }+ engines: { node: '>=12' }hasBin: truerequiresBuild: true+ optionalDependencies:+ esbuild-android-arm64: 0.14.21+ esbuild-darwin-64: 0.14.21+ esbuild-darwin-arm64: 0.14.21+ esbuild-freebsd-64: 0.14.21+ esbuild-freebsd-arm64: 0.14.21+ esbuild-linux-32: 0.14.21+ esbuild-linux-64: 0.14.21+ esbuild-linux-arm: 0.14.21+ esbuild-linux-arm64: 0.14.21+ esbuild-linux-mips64le: 0.14.21+ esbuild-linux-ppc64le: 0.14.21+ esbuild-linux-riscv64: 0.14.21+ esbuild-linux-s390x: 0.14.21+ esbuild-netbsd-64: 0.14.21+ esbuild-openbsd-64: 0.14.21+ esbuild-sunos-64: 0.14.21+ esbuild-windows-32: 0.14.21+ esbuild-windows-64: 0.14.21+ esbuild-windows-arm64: 0.14.21dev: true/escalade/3.1.1:- resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}- engines: {node: '>=6'}+ resolution:+ {+ integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==+ }+ engines: { node: '>=6' }dev: true/escape-string-regexp/1.0.5:- resolution: {integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=}- engines: {node: '>=0.8.0'}+ resolution: { integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= }+ engines: { node: '>=0.8.0' }dev: true/escape-string-regexp/4.0.0:- resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}- engines: {node: '>=10'}- dev: true-- /eslint-config-prettier/[email protected]:- resolution: {integrity: sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==}+ resolution:+ {+ integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==+ }+ engines: { node: '>=10' }+ dev: true++ /eslint-config-prettier/[email protected]:+ resolution:+ {+ integrity: sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==+ }hasBin: truepeerDependencies:eslint: '>=7.0.0'dependencies:- eslint: 7.28.0+ eslint: 7.32.0dev: true- /eslint-plugin-svelte3/[email protected][email protected]:- resolution: {integrity: sha512-qdWB1QN21dEozsJFdR8XlEhMnsS6aKHjsXWuNmchYwxoet5I6QdCr1Xcq62++IzRBMCNCeH4waXqSOAdqrZzgA==}- engines: {node: '>=10'}+ /eslint-plugin-svelte3/[email protected][email protected]:+ resolution:+ {+ integrity: sha512-YoBR9mLoKCjGghJ/gvpnFZKaMEu/VRcuxpSRS8KuozuEo7CdBH7bmBHa6FmMm0i4kJnOyx+PVsaptz96K6H/4Q==+ }+ engines: { node: '>=10' }peerDependencies:eslint: '>=6.0.0'svelte: ^3.2.0dependencies:- eslint: 7.28.0- svelte: 3.38.2+ eslint: 7.32.0+ svelte: 3.46.4dev: true/eslint-scope/5.1.1:- resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}- engines: {node: '>=8.0.0'}+ resolution:+ {+ integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==+ }+ engines: { node: '>=8.0.0' }dependencies:esrecurse: 4.3.0estraverse: 4.3.0dev: true/eslint-utils/2.1.0:- resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==}- engines: {node: '>=6'}+ resolution:+ {+ integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==+ }+ engines: { node: '>=6' }dependencies:eslint-visitor-keys: 1.3.0dev: true- /eslint-utils/[email protected]:- resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==}- engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0}+ /eslint-utils/[email protected]:+ resolution:+ {+ integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==+ }+ engines: { node: ^10.0.0 || ^12.0.0 || >= 14.0.0 }peerDependencies:eslint: '>=5'dependencies:- eslint: 7.28.0- eslint-visitor-keys: 2.0.0+ eslint: 7.32.0+ eslint-visitor-keys: 2.1.0dev: true/eslint-visitor-keys/1.3.0:- resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==}- engines: {node: '>=4'}- dev: true-- /eslint-visitor-keys/2.0.0:- resolution: {integrity: sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==}- engines: {node: '>=10'}- dev: true-- /eslint/7.28.0:- resolution: {integrity: sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g==}- engines: {node: ^10.12.0 || >=12.0.0}+ resolution:+ {+ integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==+ }+ engines: { node: '>=4' }+ dev: true++ /eslint-visitor-keys/2.1.0:+ resolution:+ {+ integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==+ }+ engines: { node: '>=10' }+ dev: true++ /eslint/7.32.0:+ resolution:+ {+ integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==+ }+ engines: { node: ^10.12.0 || >=12.0.0 }hasBin: truedependencies:'@babel/code-frame': 7.12.11- '@eslint/eslintrc': 0.4.2+ '@eslint/eslintrc': 0.4.3+ '@humanwhocodes/config-array': 0.5.0ajv: 6.12.6- chalk: 4.1.1+ chalk: 4.1.2cross-spawn: 7.0.3- debug: 4.3.1+ debug: 4.3.3doctrine: 3.0.0enquirer: 2.3.6escape-string-regexp: 4.0.0eslint-scope: 5.1.1eslint-utils: 2.1.0- eslint-visitor-keys: 2.0.0+ eslint-visitor-keys: 2.1.0espree: 7.3.1esquery: 1.4.0esutils: 2.0.3@@ -1256,11 +2808,11 @@ packages:file-entry-cache: 6.0.1functional-red-black-tree: 1.0.1glob-parent: 5.1.2- globals: 13.8.0+ globals: 13.12.0ignore: 4.0.6import-fresh: 3.3.0imurmurhash: 0.1.4- is-glob: 4.0.1+ is-glob: 4.0.3js-yaml: 3.14.1json-stable-stringify-without-jsonify: 1.0.1levn: 0.4.1@@ -1269,11 +2821,11 @@ packages:natural-compare: 1.4.0optionator: 0.9.1progress: 2.0.3- regexpp: 3.1.0+ regexpp: 3.2.0semver: 7.3.5- strip-ansi: 6.0.0+ strip-ansi: 6.0.1strip-json-comments: 3.1.1- table: 6.6.0+ table: 6.7.2text-table: 0.2.0v8-compile-cache: 2.3.0transitivePeerDependencies:@@ -1281,200 +2833,337 @@ packages:dev: true/espree/7.3.1:- resolution: {integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==}- engines: {node: ^10.12.0 || >=12.0.0}+ resolution:+ {+ integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==+ }+ engines: { node: ^10.12.0 || >=12.0.0 }dependencies:acorn: 7.4.1- acorn-jsx: [email protected]+ acorn-jsx: [email protected]eslint-visitor-keys: 1.3.0dev: true/esprima/4.0.1:- resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}- engines: {node: '>=4'}+ resolution:+ {+ integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==+ }+ engines: { node: '>=4' }hasBin: truedev: true/esquery/1.4.0:- resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==}- engines: {node: '>=0.10'}+ resolution:+ {+ integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==+ }+ engines: { node: '>=0.10' }dependencies:- estraverse: 5.2.0+ estraverse: 5.3.0dev: true/esrecurse/4.3.0:- resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}- engines: {node: '>=4.0'}+ resolution:+ {+ integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==+ }+ engines: { node: '>=4.0' }dependencies:- estraverse: 5.2.0+ estraverse: 5.3.0dev: true/estraverse/4.3.0:- resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==}- engines: {node: '>=4.0'}+ resolution:+ {+ integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==+ }+ engines: { node: '>=4.0' }dev: true- /estraverse/5.2.0:- resolution: {integrity: sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==}- engines: {node: '>=4.0'}+ /estraverse/5.3.0:+ resolution:+ {+ integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==+ }+ engines: { node: '>=4.0' }dev: true/estree-walker/2.0.2:- resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}+ resolution:+ {+ integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==+ }dev: true/esutils/2.0.3:- resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}- engines: {node: '>=0.10.0'}+ resolution:+ {+ integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==+ }+ engines: { node: '>=0.10.0' }+ dev: true++ /execa/5.1.1:+ resolution:+ {+ integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==+ }+ engines: { node: '>=10' }+ dependencies:+ cross-spawn: 7.0.3+ get-stream: 6.0.1+ human-signals: 2.1.0+ is-stream: 2.0.1+ merge-stream: 2.0.0+ npm-run-path: 4.0.1+ onetime: 5.1.2+ signal-exit: 3.0.5+ strip-final-newline: 2.0.0+ dev: true++ /exit/0.1.2:+ resolution: { integrity: sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= }+ engines: { node: '>= 0.8.0' }dev: true/fast-deep-equal/3.1.3:- resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}+ resolution:+ {+ integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==+ }dev: true- /fast-glob/3.2.5:- resolution: {integrity: sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==}- engines: {node: '>=8'}+ /fast-glob/3.2.11:+ resolution:+ {+ integrity: sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==+ }+ engines: { node: '>=8.6.0' }dependencies:'@nodelib/fs.stat': 2.0.5- '@nodelib/fs.walk': 1.2.7+ '@nodelib/fs.walk': 1.2.8glob-parent: 5.1.2merge2: 1.4.1micromatch: 4.0.4- picomatch: 2.3.0dev: true/fast-json-stable-stringify/2.1.0:- resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}+ resolution:+ {+ integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==+ }dev: true/fast-levenshtein/2.0.6:- resolution: {integrity: sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=}+ resolution: { integrity: sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= }dev: true- /fastq/1.11.0:- resolution: {integrity: sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==}+ /fastq/1.13.0:+ resolution:+ {+ integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==+ }dependencies:reusify: 1.0.4dev: true/file-entry-cache/6.0.1:- resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}- engines: {node: ^10.12.0 || >=12.0.0}+ resolution:+ {+ integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==+ }+ engines: { node: ^10.12.0 || >=12.0.0 }dependencies:flat-cache: 3.0.4dev: true/fill-range/7.0.1:- resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==+ }+ engines: { node: '>=8' }dependencies:to-regex-range: 5.0.1dev: true/flat-cache/3.0.4:- resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==}- engines: {node: ^10.12.0 || >=12.0.0}+ resolution:+ {+ integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==+ }+ engines: { node: ^10.12.0 || >=12.0.0 }dependencies:- flatted: 3.1.1+ flatted: 3.2.2rimraf: 3.0.2dev: true- /flatted/3.1.1:- resolution: {integrity: sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==}+ /flatted/3.2.2:+ resolution:+ {+ integrity: sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==+ }dev: true- /fraction.js/4.1.1:- resolution: {integrity: sha512-MHOhvvxHTfRFpF1geTK9czMIZ6xclsEor2wkIGYYq+PxcQqT7vStJqjhe6S1TenZrMZzo+wlqOufBDVepUEgPg==}+ /form-data-encoder/1.7.1:+ resolution:+ {+ integrity: sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==+ }+ dev: false++ /fraction.js/4.1.2:+ resolution:+ {+ integrity: sha512-o2RiJQ6DZaR/5+Si0qJUIy637QMRudSi9kU/FFzx9EZazrIdnBgpU+3sEWCxAVhH2RtxW2Oz+T4p2o8uOPVcgA==+ }dev: true/fs-constants/1.0.0:- resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}+ resolution:+ {+ integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==+ }dev: false- /fs-extra/10.0.0:- resolution: {integrity: sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==}- engines: {node: '>=12'}- dependencies:- graceful-fs: 4.2.6- jsonfile: 6.1.0- universalify: 2.0.0- dev: true-/fs-minipass/2.1.0:- resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==}- engines: {node: '>= 8'}+ resolution:+ {+ integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==+ }+ engines: { node: '>= 8' }dependencies:- minipass: 3.1.3+ minipass: 3.1.5dev: false/fs.realpath/1.0.0:- resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=}+ resolution: { integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8= }/fsevents/2.3.2:- resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}- engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}+ resolution:+ {+ integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==+ }+ engines: { node: ^8.16.0 || ^10.6.0 || >=11.0.0 }os: [darwin]+ requiresBuild: truedev: trueoptional: true/function-bind/1.1.1:- resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}+ resolution:+ {+ integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==+ }/function.name/1.0.13:- resolution: {integrity: sha512-mVrqdoy5npWZyoXl4DxCeuVF6delDcQjVS9aPdvLYlBxtMTZDR2B5GVEQEoM1jJyspCqg3C0v4ABkLE7tp9xFA==}+ resolution:+ {+ integrity: sha512-mVrqdoy5npWZyoXl4DxCeuVF6delDcQjVS9aPdvLYlBxtMTZDR2B5GVEQEoM1jJyspCqg3C0v4ABkLE7tp9xFA==+ }dependencies:noop6: 1.0.9dev: false/functional-red-black-tree/1.0.1:- resolution: {integrity: sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=}+ resolution: { integrity: sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= }dev: true- /gauge/2.7.4:- resolution: {integrity: sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=}+ /gauge/3.0.1:+ resolution:+ {+ integrity: sha512-6STz6KdQgxO4S/ko+AbjlFGGdGcknluoqU+79GOFCDqqyYj5OanQf9AjxwN0jCidtT+ziPMmPSt9E4hfQ0CwIQ==+ }+ engines: { node: '>=10' }dependencies:- aproba: 1.2.0+ aproba: 2.0.0+ color-support: 1.1.3console-control-strings: 1.1.0has-unicode: 2.0.1object-assign: 4.1.1- signal-exit: 3.0.3- string-width: 1.0.2- strip-ansi: 3.0.1- wide-align: 1.1.3+ signal-exit: 3.0.5+ string-width: 2.1.1+ strip-ansi: 4.0.0+ wide-align: 1.1.5dev: false- /generate-password/1.6.0:- resolution: {integrity: sha512-YUJTQkApkLT/fru0QdYWP0lVZdPKhF5kXCP24sgI4gR/vFMJFopCj5t1+9FAKIYcML/nxzx2PMkA1ymO1FC+tQ==}+ /generate-password/1.7.0:+ resolution:+ {+ integrity: sha512-WPCtlfy0jexf7W5IbwxGUgpIDvsZIohbI2DAq2Q6TSlKKis+G4GT9sxvPxrZUGL8kP6WUXMWNqYnxY6DDKAdFA==+ }dev: false- /glob-parent/5.1.2:- resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}- engines: {node: '>= 6'}+ /get-intrinsic/1.1.1:+ resolution:+ {+ integrity: sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==+ }dependencies:- is-glob: 4.0.1- dev: true+ function-bind: 1.1.1+ has: 1.0.3+ has-symbols: 1.0.2+ dev: false++ /get-port/5.1.1:+ resolution:+ {+ integrity: sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==+ }+ engines: { node: '>=8' }+ dev: false++ /get-port/6.0.0:+ resolution:+ {+ integrity: sha512-qSVkVF6Eq1GdL/cBNiFuP4nUHMF7OEMTqEjC6alR2N90u8BFOoO0PFhNTX2QtAUoGrz8NnrSWj85TZ8YXZ6LOA==+ }+ engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }+ dev: false++ /get-stream/5.2.0:+ resolution:+ {+ integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==+ }+ engines: { node: '>=8' }+ dependencies:+ pump: 3.0.0+ dev: false++ /get-stream/6.0.1:+ resolution:+ {+ integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==+ }+ engines: { node: '>=10' }- /glob-parent/6.0.0:- resolution: {integrity: sha512-Hdd4287VEJcZXUwv1l8a+vXC1GjOQqXe+VS30w/ypihpcnu9M1n3xeYeJu5CBpeEQj2nAab2xxz28GuA3vp4Ww==}- engines: {node: '>=10.13.0'}+ /glob-parent/5.1.2:+ resolution:+ {+ integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==+ }+ engines: { node: '>= 6' }dependencies:- is-glob: 4.0.1+ is-glob: 4.0.3dev: true- /glob/7.1.6:- resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==}+ /glob-parent/6.0.2:+ resolution:+ {+ integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==+ }+ engines: { node: '>=10.13.0' }dependencies:- fs.realpath: 1.0.0- inflight: 1.0.6- inherits: 2.0.4- minimatch: 3.0.4- once: 1.4.0- path-is-absolute: 1.0.1- dev: false+ is-glob: 4.0.3+ dev: true- /glob/7.1.7:- resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==}+ /glob/7.2.0:+ resolution:+ {+ integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==+ }dependencies:fs.realpath: 1.0.0inflight: 1.0.6@@ -1483,228 +3172,409 @@ packages:once: 1.4.0path-is-absolute: 1.0.1- /globals/13.8.0:- resolution: {integrity: sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q==}- engines: {node: '>=8'}+ /globals/13.12.0:+ resolution:+ {+ integrity: sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==+ }+ engines: { node: '>=8' }dependencies:type-fest: 0.20.2dev: true- /globals/13.9.0:- resolution: {integrity: sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==}- engines: {node: '>=8'}- dependencies:- type-fest: 0.20.2+ /globals/9.18.0:+ resolution:+ {+ integrity: sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==+ }+ engines: { node: '>=0.10.0' }dev: true/globalyzer/0.1.0:- resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==}+ resolution:+ {+ integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==+ }dev: true- /globby/11.0.3:- resolution: {integrity: sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==}- engines: {node: '>=10'}+ /globby/11.0.4:+ resolution:+ {+ integrity: sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==+ }+ engines: { node: '>=10' }dependencies:array-union: 2.1.0dir-glob: 3.0.1- fast-glob: 3.2.5+ fast-glob: 3.2.11ignore: 5.1.8merge2: 1.4.1slash: 3.0.0dev: true/globrex/0.1.2:- resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}+ resolution:+ {+ integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==+ }+ dev: true++ /got/12.0.1:+ resolution:+ {+ integrity: sha512-1Zhoh+lDej3t7Ks1BP/Jufn+rNqdiHQgUOcTxHzg2Dao1LQfp5S4Iq0T3iBxN4Zdo7QqCJL+WJUNzDX6rCP2Ew==+ }+ engines: { node: '>=14.16' }+ dependencies:+ '@sindresorhus/is': 4.2.0+ '@szmarczak/http-timer': 5.0.1+ '@types/cacheable-request': 6.0.2+ '@types/responselike': 1.0.0+ cacheable-lookup: 6.0.4+ cacheable-request: 7.0.2+ decompress-response: 6.0.0+ form-data-encoder: 1.7.1+ get-stream: 6.0.1+ http2-wrapper: 2.1.10+ lowercase-keys: 3.0.0+ p-cancelable: 3.0.0+ responselike: 2.0.0+ dev: false++ /graceful-fs/4.2.8:+ resolution:+ {+ integrity: sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==+ }dev: true- /graceful-fs/4.2.6:- resolution: {integrity: sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==}+ /has-ansi/2.0.0:+ resolution: { integrity: sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= }+ engines: { node: '>=0.10.0' }+ dependencies:+ ansi-regex: 2.1.1dev: true/has-flag/3.0.0:- resolution: {integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0=}- engines: {node: '>=4'}+ resolution: { integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0= }+ engines: { node: '>=4' }dev: true/has-flag/4.0.0:- resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}- engines: {node: '>=8'}- dev: true+ resolution:+ {+ integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==+ }+ engines: { node: '>=8' }+ dev: true++ /has-symbols/1.0.2:+ resolution:+ {+ integrity: sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==+ }+ engines: { node: '>= 0.4' }+ dev: false/has-unicode/2.0.1:- resolution: {integrity: sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=}+ resolution: { integrity: sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= }dev: false/has/1.0.3:- resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==}- engines: {node: '>= 0.4.0'}+ resolution:+ {+ integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==+ }+ engines: { node: '>= 0.4.0' }dependencies:function-bind: 1.1.1- /hex-color-regex/1.1.0:- resolution: {integrity: sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==}- dev: true-- /hsl-regex/1.0.0:- resolution: {integrity: sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4=}+ /home-or-tmp/2.0.0:+ resolution: { integrity: sha1-42w/LSyufXRqhX440Y1fMqeILbg= }+ engines: { node: '>=0.10.0' }+ dependencies:+ os-homedir: 1.0.2+ os-tmpdir: 1.0.2dev: true- /hsla-regex/1.0.0:- resolution: {integrity: sha1-wc56MWjIxmFAM6S194d/OyJfnDg=}- dev: true+ /http-cache-semantics/4.1.0:+ resolution:+ {+ integrity: sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==+ }+ dev: false- /html-tags/3.1.0:- resolution: {integrity: sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg==}- engines: {node: '>=8'}- dev: true+ /http2-wrapper/2.1.10:+ resolution:+ {+ integrity: sha512-QHgsdYkieKp+6JbXP25P+tepqiHYd+FVnDwXpxi/BlUcoIB0nsmTOymTNvETuTO+pDuwcSklPE72VR3DqV+Haw==+ }+ engines: { node: '>=10.19.0' }+ dependencies:+ quick-lru: 5.1.1+ resolve-alpn: 1.2.1+ dev: false/https-proxy-agent/5.0.0:- resolution: {integrity: sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==}- engines: {node: '>= 6'}+ resolution:+ {+ integrity: sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==+ }+ engines: { node: '>= 6' }dependencies:agent-base: 6.0.2- debug: 4.3.1+ debug: 4.3.3transitivePeerDependencies:- supports-colordev: false+ /human-signals/2.1.0:+ resolution:+ {+ integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==+ }+ engines: { node: '>=10.17.0' }+ dev: true++ /husky/7.0.4:+ resolution:+ {+ integrity: sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==+ }+ engines: { node: '>=12' }+ hasBin: true+ dev: true+/ieee754/1.2.1:- resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}+ resolution:+ {+ integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==+ }dev: false/ignore/4.0.6:- resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==}- engines: {node: '>= 4'}+ resolution:+ {+ integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==+ }+ engines: { node: '>= 4' }dev: true/ignore/5.1.8:- resolution: {integrity: sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==}- engines: {node: '>= 4'}+ resolution:+ {+ integrity: sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==+ }+ engines: { node: '>= 4' }dev: true/import-cwd/3.0.0:- resolution: {integrity: sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg==+ }+ engines: { node: '>=8' }dependencies:import-from: 3.0.0dev: true/import-fresh/3.3.0:- resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}- engines: {node: '>=6'}+ resolution:+ {+ integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==+ }+ engines: { node: '>=6' }dependencies:parent-module: 1.0.1resolve-from: 4.0.0dev: true/import-from/3.0.0:- resolution: {integrity: sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ==+ }+ engines: { node: '>=8' }dependencies:resolve-from: 5.0.0dev: true/imurmurhash/0.1.4:- resolution: {integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o=}- engines: {node: '>=0.8.19'}+ resolution: { integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o= }+ engines: { node: '>=0.8.19' }+ dev: true++ /indent-string/4.0.0:+ resolution:+ {+ integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==+ }+ engines: { node: '>=8' }dev: true/inflight/1.0.6:- resolution: {integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=}+ resolution: { integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= }dependencies:once: 1.4.0wrappy: 1.0.2/inherits/2.0.4:- resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}-- /interpret/1.4.0:- resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==}- engines: {node: '>= 0.10'}+ resolution:+ {+ integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==+ }++ /invariant/2.2.4:+ resolution:+ {+ integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==+ }+ dependencies:+ loose-envify: 1.4.0+ dev: true++ /ioredis/4.28.3:+ resolution:+ {+ integrity: sha512-9JOWVgBnuSxpIgfpjc1OeY1OLmA4t2KOWWURTDRXky+eWO0LZhI33pQNT9gYxANUXfh5p/zYephYni6GPRsksQ==+ }+ engines: { node: '>=6' }+ dependencies:+ cluster-key-slot: 1.1.0+ debug: 4.3.3+ denque: 1.5.1+ lodash.defaults: 4.2.0+ lodash.flatten: 4.4.0+ lodash.isarguments: 3.1.0+ p-map: 2.1.0+ redis-commands: 1.7.0+ redis-errors: 1.2.0+ redis-parser: 3.0.0+ standard-as-callback: 2.1.0+ transitivePeerDependencies:+ - supports-colordev: false- /is-absolute-url/3.0.3:- resolution: {integrity: sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==}- engines: {node: '>=8'}- dev: true-/is-arrayish/0.2.1:- resolution: {integrity: sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=}- dev: true-- /is-arrayish/0.3.2:- resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==}+ resolution: { integrity: sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= }dev: true/is-binary-path/2.1.0:- resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==+ }+ engines: { node: '>=8' }dependencies:binary-extensions: 2.2.0dev: true- /is-color-stop/1.1.0:- resolution: {integrity: sha1-z/9HGu5N1cnhWFmPvhKWe1za00U=}- dependencies:- css-color-names: 0.0.4- hex-color-regex: 1.1.0- hsl-regex: 1.0.0- hsla-regex: 1.0.0- rgb-regex: 1.0.1- rgba-regex: 1.0.0- dev: true-- /is-core-module/2.4.0:- resolution: {integrity: sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==}+ /is-core-module/2.8.1:+ resolution:+ {+ integrity: sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==+ }dependencies:has: 1.0.3+ dev: true/is-extglob/2.1.1:- resolution: {integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=}- engines: {node: '>=0.10.0'}+ resolution: { integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= }+ engines: { node: '>=0.10.0' }dev: true- /is-fullwidth-code-point/1.0.0:- resolution: {integrity: sha1-754xOG8DGn8NZDr4L95QxFfvAMs=}- engines: {node: '>=0.10.0'}- dependencies:- number-is-nan: 1.0.1+ /is-finite/1.1.0:+ resolution:+ {+ integrity: sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==+ }+ engines: { node: '>=0.10.0' }+ dev: true++ /is-fullwidth-code-point/2.0.0:+ resolution: { integrity: sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= }+ engines: { node: '>=4' }dev: false/is-fullwidth-code-point/3.0.0:- resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}- engines: {node: '>=8'}- dev: true-- /is-glob/4.0.1:- resolution: {integrity: sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==}- engines: {node: '>=0.10.0'}+ resolution:+ {+ integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==+ }+ engines: { node: '>=8' }++ /is-fullwidth-code-point/4.0.0:+ resolution:+ {+ integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==+ }+ engines: { node: '>=12' }+ dev: true++ /is-glob/4.0.3:+ resolution:+ {+ integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==+ }+ engines: { node: '>=0.10.0' }dependencies:is-extglob: 2.1.1dev: true+ /is-nan/1.3.2:+ resolution:+ {+ integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==+ }+ engines: { node: '>= 0.4' }+ dependencies:+ call-bind: 1.0.2+ define-properties: 1.1.3+ dev: false+/is-number/7.0.0:- resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}- engines: {node: '>=0.12.0'}+ resolution:+ {+ integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==+ }+ engines: { node: '>=0.12.0' }dev: true- /is-resolvable/1.1.0:- resolution: {integrity: sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==}+ /is-stream/2.0.1:+ resolution:+ {+ integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==+ }+ engines: { node: '>=8' }dev: true- /isarray/1.0.0:- resolution: {integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=}+ /isexe/2.0.0:+ resolution: { integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= }++ /js-cookie/3.0.1:+ resolution:+ {+ integrity: sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw==+ }+ engines: { node: '>=12' }dev: false- /isexe/2.0.0:- resolution: {integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=}+ /js-tokens/3.0.2:+ resolution: { integrity: sha1-mGbfOVECEw449/mWvOtlRDIJwls= }+ dev: true/js-tokens/4.0.0:- resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}+ resolution:+ {+ integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==+ }dev: true/js-yaml/3.14.1:- resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}+ resolution:+ {+ integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==+ }hasBin: truedependencies:argparse: 1.0.10@@ -1712,39 +3582,68 @@ packages:dev: true/js-yaml/4.1.0:- resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}+ resolution:+ {+ integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==+ }hasBin: truedependencies:argparse: 2.0.1dev: false+ /jsesc/0.5.0:+ resolution: { integrity: sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= }+ hasBin: true+ dev: true++ /jsesc/1.3.0:+ resolution: { integrity: sha1-RsP+yMGJKxKwgz25vHYiF226s0s= }+ hasBin: true+ dev: true++ /json-buffer/3.0.1:+ resolution:+ {+ integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==+ }+ dev: false+/json-parse-even-better-errors/2.3.1:- resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}+ resolution:+ {+ integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==+ }dev: true/json-schema-traverse/0.4.1:- resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}+ resolution:+ {+ integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==+ }dev: true/json-schema-traverse/1.0.0:- resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}+ resolution:+ {+ integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==+ }dev: true/json-stable-stringify-without-jsonify/1.0.1:- resolution: {integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=}+ resolution: { integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= }dev: true- /jsonfile/6.1.0:- resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}- dependencies:- universalify: 2.0.0- optionalDependencies:- graceful-fs: 4.2.6+ /json5/0.5.1:+ resolution: { integrity: sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= }+ hasBin: truedev: true/jsonwebtoken/8.5.1:- resolution: {integrity: sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==}- engines: {node: '>=4', npm: '>=1.4.28'}+ resolution:+ {+ integrity: sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==+ }+ engines: { node: '>=4', npm: '>=1.4.28' }dependencies:jws: 3.2.2lodash.includes: 4.3.0@@ -1754,12 +3653,15 @@ packages:lodash.isplainobject: 4.0.6lodash.isstring: 4.0.1lodash.once: 4.1.1- ms: 2.1.3+ ms: 2.1.2semver: 5.7.1dev: false/jwa/1.4.1:- resolution: {integrity: sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==}+ resolution:+ {+ integrity: sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==+ }dependencies:buffer-equal-constant-time: 1.0.1ecdsa-sig-formatter: 1.0.11@@ -1767,883 +3669,893 @@ packages:dev: false/jws/3.2.2:- resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==}+ resolution:+ {+ integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==+ }dependencies:jwa: 1.4.1safe-buffer: 5.2.1dev: false- /kareem/2.3.2:- resolution: {integrity: sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==}+ /keyv/4.0.4:+ resolution:+ {+ integrity: sha512-vqNHbAc8BBsxk+7QBYLW0Y219rWcClspR6WSeoHYKG5mnsSoOH+BL1pWq02DDCVdvvuUny5rkBlzMRzoqc+GIg==+ }+ dependencies:+ json-buffer: 3.0.1dev: false/kleur/4.1.4:- resolution: {integrity: sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==}- engines: {node: '>=6'}+ resolution:+ {+ integrity: sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==+ }+ engines: { node: '>=6' }dev: true/levn/0.4.1:- resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}- engines: {node: '>= 0.8.0'}+ resolution:+ {+ integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==+ }+ engines: { node: '>= 0.8.0' }dependencies:prelude-ls: 1.2.1type-check: 0.4.0dev: true- /lilconfig/2.0.3:- resolution: {integrity: sha512-EHKqr/+ZvdKCifpNrJCKxBTgk5XupZA3y/aCPY9mxfgBzmgh93Mt/WqjjQ38oMxXuvDokaKiM3lAgvSH2sjtHg==}- engines: {node: '>=10'}+ /lilconfig/2.0.4:+ resolution:+ {+ integrity: sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA==+ }+ engines: { node: '>=10' }dev: true/lines-and-columns/1.1.6:- resolution: {integrity: sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=}+ resolution: { integrity: sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= }+ dev: true++ /lint-staged/12.3.3:+ resolution:+ {+ integrity: sha512-OqcLsqcPOqzvsfkxjeBpZylgJ3SRG1RYqc9LxC6tkt6tNsq1bNVkAixBwX09f6CobcHswzqVOCBpFR1Fck0+ag==+ }+ engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }+ hasBin: true+ dependencies:+ cli-truncate: 3.1.0+ colorette: 2.0.16+ commander: 8.3.0+ debug: [email protected]+ execa: 5.1.1+ lilconfig: 2.0.4+ listr2: 4.0.1+ micromatch: 4.0.4+ normalize-path: 3.0.0+ object-inspect: 1.12.0+ string-argv: 0.3.1+ supports-color: 9.2.1+ yaml: 1.10.2+ transitivePeerDependencies:+ - enquirer+ dev: true++ /listr2/4.0.1:+ resolution:+ {+ integrity: sha512-D65Nl+zyYHL2jQBGmxtH/pU8koPZo5C8iCNE8EoB04RwPgQG1wuaKwVbeZv9LJpiH4Nxs0FCp+nNcG8OqpniiA==+ }+ engines: { node: '>=12' }+ peerDependencies:+ enquirer: '>= 2.3.0 < 3'+ peerDependenciesMeta:+ enquirer:+ optional: true+ dependencies:+ cli-truncate: 2.1.0+ colorette: 2.0.16+ log-update: 4.0.0+ p-map: 4.0.0+ rfdc: 1.3.0+ rxjs: 7.5.2+ through: 2.3.8+ wrap-ansi: 7.0.0dev: true/lodash.clonedeep/4.5.0:- resolution: {integrity: sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=}+ resolution: { integrity: sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= }dev: true+ /lodash.defaults/4.2.0:+ resolution: { integrity: sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= }+ dev: false+/lodash.flatten/4.4.0:- resolution: {integrity: sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=}- dev: true+ resolution: { integrity: sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= }+ dev: false/lodash.includes/4.3.0:- resolution: {integrity: sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=}+ resolution: { integrity: sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8= }+ dev: false++ /lodash.isarguments/3.1.0:+ resolution: { integrity: sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo= }dev: false/lodash.isboolean/3.0.3:- resolution: {integrity: sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=}+ resolution: { integrity: sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY= }dev: false/lodash.isinteger/4.0.4:- resolution: {integrity: sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=}+ resolution: { integrity: sha1-YZwK89A/iwTDH1iChAt3sRzWg0M= }dev: false/lodash.isnumber/3.0.3:- resolution: {integrity: sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=}+ resolution: { integrity: sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w= }dev: false/lodash.isplainobject/4.0.6:- resolution: {integrity: sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=}+ resolution: { integrity: sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= }dev: false/lodash.isstring/4.0.1:- resolution: {integrity: sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=}+ resolution: { integrity: sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= }dev: false- /lodash.memoize/4.1.2:- resolution: {integrity: sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=}- dev: true-/lodash.merge/4.6.2:- resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}+ resolution:+ {+ integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==+ }dev: true/lodash.once/4.1.1:- resolution: {integrity: sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=}+ resolution: { integrity: sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= }dev: false- /lodash.toarray/4.4.0:- resolution: {integrity: sha1-JMS/zWsvuji/0FlNsRedjptlZWE=}+ /lodash.truncate/4.4.2:+ resolution: { integrity: sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= }dev: true- /lodash.topath/4.5.2:- resolution: {integrity: sha1-NhY1Hzu6YZlKCTGYlmC9AyVP0Ak=}+ /lodash/4.17.21:+ resolution:+ {+ integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==+ }++ /log-update/4.0.0:+ resolution:+ {+ integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==+ }+ engines: { node: '>=10' }+ dependencies:+ ansi-escapes: 4.3.2+ cli-cursor: 3.1.0+ slice-ansi: 4.0.0+ wrap-ansi: 6.2.0dev: true- /lodash.truncate/4.4.2:- resolution: {integrity: sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=}+ /loose-envify/1.4.0:+ resolution:+ {+ integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==+ }+ hasBin: true+ dependencies:+ js-tokens: 4.0.0dev: true- /lodash.uniq/4.5.0:- resolution: {integrity: sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=}- dev: true+ /lowercase-keys/2.0.0:+ resolution:+ {+ integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==+ }+ engines: { node: '>=8' }+ dev: false- /lodash/4.17.21:- resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}+ /lowercase-keys/3.0.0:+ resolution:+ {+ integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==+ }+ engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }+ dev: false++ /lru-cache/4.1.5:+ resolution:+ {+ integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==+ }+ dependencies:+ pseudomap: 1.0.2+ yallist: 2.1.2dev: true/lru-cache/6.0.0:- resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}- engines: {node: '>=10'}+ resolution:+ {+ integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==+ }+ engines: { node: '>=10' }dependencies:yallist: 4.0.0+ /lru_map/0.3.3:+ resolution: { integrity: sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= }+ dev: false+/magic-string/0.25.7:- resolution: {integrity: sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==}+ resolution:+ {+ integrity: sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==+ }dependencies:sourcemap-codec: 1.4.8dev: true/make-dir/3.1.0:- resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==+ }+ engines: { node: '>=8' }dependencies:semver: 6.3.0dev: false- /mdn-data/2.0.14:- resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==}+ /make-error/1.3.6:+ resolution:+ {+ integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==+ }dev: true- /memory-pager/1.5.0:- resolution: {integrity: sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==}- dev: false- optional: true+ /merge-stream/2.0.0:+ resolution:+ {+ integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==+ }+ dev: true/merge2/1.4.1:- resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}- engines: {node: '>= 8'}+ resolution:+ {+ integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==+ }+ engines: { node: '>= 8' }dev: true/micromatch/4.0.4:- resolution: {integrity: sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==}- engines: {node: '>=8.6'}+ resolution:+ {+ integrity: sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==+ }+ engines: { node: '>=8.6' }dependencies:braces: 3.0.2picomatch: 2.3.0dev: true- /microtip/0.2.2:- resolution: {integrity: sha512-oah38eH5vSHVFP6yXjbKWOYt92mav++0j3zh844h1vhOscqEg7Rf4agDEIwUTFCcAPPdlhYUQMe6eZfHgD+4oQ==}+ /mimic-fn/2.1.0:+ resolution:+ {+ integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==+ }+ engines: { node: '>=6' }+ dev: true++ /mimic-response/1.0.1:+ resolution:+ {+ integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==+ }+ engines: { node: '>=4' }+ dev: false++ /mimic-response/3.1.0:+ resolution:+ {+ integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==+ }+ engines: { node: '>=10' }dev: false/min-indent/1.0.1:- resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}- engines: {node: '>=4'}+ resolution:+ {+ integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==+ }+ engines: { node: '>=4' }dev: true/minimatch/3.0.4:- resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==}+ resolution:+ {+ integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==+ }dependencies:brace-expansion: 1.1.11/minimist/1.2.5:- resolution: {integrity: sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==}+ resolution:+ {+ integrity: sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==+ }dev: true- /minipass/3.1.3:- resolution: {integrity: sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==}- engines: {node: '>=8'}+ /minipass/3.1.5:+ resolution:+ {+ integrity: sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==+ }+ engines: { node: '>=8' }dependencies:yallist: 4.0.0dev: false/minizlib/2.1.2:- resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}- engines: {node: '>= 8'}+ resolution:+ {+ integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==+ }+ engines: { node: '>= 8' }dependencies:- minipass: 3.1.3+ minipass: 3.1.5yallist: 4.0.0dev: false/mkdirp-classic/0.5.3:- resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}+ resolution:+ {+ integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==+ }dev: false- /mkdirp/1.0.4:- resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}- engines: {node: '>=10'}+ /mkdirp/0.5.5:+ resolution:+ {+ integrity: sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==+ }hasBin: true- dev: false-- /modern-normalize/1.1.0:- resolution: {integrity: sha512-2lMlY1Yc1+CUy0gw4H95uNN7vjbpoED7NNRSBHE25nWfLBdmMzFCsPshlzbxHz+gYMcBEUN8V4pU16prcdPSgA==}- engines: {node: '>=6'}- dev: true-- /mongodb/3.6.8:- resolution: {integrity: sha512-sDjJvI73WjON1vapcbyBD3Ao9/VN3TKYY8/QX9EPbs22KaCSrQ5rXo5ZZd44tWJ3wl3FlnrFZ+KyUtNH6+1ZPQ==}- engines: {node: '>=4'}- peerDependencies:- aws4: '*'- bson-ext: '*'- kerberos: '*'- mongodb-client-encryption: '*'- mongodb-extjson: '*'- snappy: '*'- peerDependenciesMeta:- aws4:- optional: true- bson-ext:- optional: true- kerberos:- optional: true- mongodb-client-encryption:- optional: true- mongodb-extjson:- optional: true- snappy:- optional: truedependencies:- bl: 2.2.1- bson: 1.1.6- denque: 1.5.0- optional-require: 1.0.3- safe-buffer: 5.2.1- optionalDependencies:- saslprep: 1.0.3- dev: false+ minimist: 1.2.5+ dev: true- /mongoose-legacy-pluralize/[email protected]:- resolution: {integrity: sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==}- peerDependencies:- mongoose: '*'- dependencies:- mongoose: 5.12.13+ /mkdirp/1.0.4:+ resolution:+ {+ integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==+ }+ engines: { node: '>=10' }+ hasBin: truedev: false- /mongoose/5.12.13:- resolution: {integrity: sha512-QGn1FCzZ8Z+mMGVg8oR2kQw4NmhLloCHsw1NqKWg3Yr7WfPzkE4pe7s9P6o5pkYGsku17n9mqMHowne7EFK/zQ==}- engines: {node: '>=4.0.0'}+ /moment-timezone/0.5.33:+ resolution:+ {+ integrity: sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==+ }dependencies:- '@types/mongodb': 3.6.12- bson: 1.1.6- kareem: 2.3.2- mongodb: 3.6.8- mongoose-legacy-pluralize: [email protected]- mpath: 0.8.3- mquery: 3.2.5- ms: 2.1.2- regexp-clone: 1.0.0- safe-buffer: 5.2.1- sift: 13.5.2- sliced: 1.0.1- transitivePeerDependencies:- - aws4- - bson-ext- - kerberos- - mongodb-client-encryption- - mongodb-extjson- - snappy- dev: false-- /mpath/0.8.3:- resolution: {integrity: sha512-eb9rRvhDltXVNL6Fxd2zM9D4vKBxjVVQNLNijlj7uoXUy19zNDsIif5zR+pWmPCWNKwAtqyo4JveQm4nfD5+eA==}- engines: {node: '>=4.0.0'}+ moment: 2.29.1dev: false- /mquery/3.2.5:- resolution: {integrity: sha512-VjOKHHgU84wij7IUoZzFRU07IAxd5kWJaDmyUzQlbjHjyoeK5TNeeo8ZsFDtTYnSgpW6n/nMNIHvE3u8Lbrf4A==}- engines: {node: '>=4.0.0'}- dependencies:- bluebird: 3.5.1- debug: 3.1.0- regexp-clone: 1.0.0- safe-buffer: 5.1.2- sliced: 1.0.1+ /moment/2.29.1:+ resolution:+ {+ integrity: sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==+ }dev: false- /mri/1.1.6:- resolution: {integrity: sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==}- engines: {node: '>=4'}+ /mri/1.2.0:+ resolution:+ {+ integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==+ }+ engines: { node: '>=4' }dev: true/ms/2.0.0:- resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=}- dev: false+ resolution: { integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= }+ dev: true/ms/2.1.2:- resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}+ resolution:+ {+ integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==+ }++ /msgpackr-extract/1.0.15:+ resolution:+ {+ integrity: sha512-vgJgzFva0/4/mt84wXf3CRCDPHKqiqk5t7/kVSjk/V2IvwSjoStHhxyq/b2+VrWcch3sxiNQOJEWXgI86Fm7AQ==+ }+ requiresBuild: true+ dependencies:+ nan: 2.15.0+ node-gyp-build: 4.3.0+ dev: false+ optional: true++ /msgpackr/1.4.7:+ resolution:+ {+ integrity: sha512-bhC8Ed1au3L3oHaR/fe4lk4w7PLGFcWQ5XY/Tk9N6tzDRz8YndjCG68TD8zcvYZoxNtw767eF/7VpaTpU9kf9w==+ }+ optionalDependencies:+ msgpackr-extract: 1.0.15+ dev: false- /ms/2.1.3:- resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}+ /nan/2.15.0:+ resolution:+ {+ integrity: sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==+ }dev: false+ optional: true- /nanoid/3.1.23:- resolution: {integrity: sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==}- engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}+ /nanoid/3.2.0:+ resolution:+ {+ integrity: sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==+ }+ engines: { node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1 }hasBin: truedev: true/natural-compare/1.4.0:- resolution: {integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=}+ resolution: { integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= }dev: true/node-addon-api/3.2.1:- resolution: {integrity: sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==}+ resolution:+ {+ integrity: sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==+ }dev: false- /node-emoji/1.10.0:- resolution: {integrity: sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==}+ /node-fetch/2.6.6:+ resolution:+ {+ integrity: sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==+ }+ engines: { node: 4.x || >=6.0.0 }dependencies:- lodash.toarray: 4.4.0- dev: true+ whatwg-url: 5.0.0+ dev: false++ /node-forge/1.2.1:+ resolution:+ {+ integrity: sha512-Fcvtbb+zBcZXbTTVwqGA5W+MKBj56UjVRevvchv5XrcyXbmNdesfZL37nlcWOfpgHhgmxApw3tQbTr4CqNmX4w==+ }+ engines: { node: '>= 6.13.0' }+ dev: false- /node-fetch/2.6.1:- resolution: {integrity: sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==}- engines: {node: 4.x || >=6.0.0}+ /node-gyp-build/4.3.0:+ resolution:+ {+ integrity: sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==+ }+ hasBin: truedev: false+ optional: true- /node-releases/1.1.71:- resolution: {integrity: sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==}+ /node-releases/2.0.1:+ resolution:+ {+ integrity: sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==+ }dev: true/noop6/1.0.9:- resolution: {integrity: sha512-DB3Hwyd89dPr5HqEPg3YHjzvwh/mCqizC1zZ8vyofqc+TQRyPDnT4wgXXbLGF4z9YAzwwTLi8pNLhGqcbSjgkA==}+ resolution:+ {+ integrity: sha512-DB3Hwyd89dPr5HqEPg3YHjzvwh/mCqizC1zZ8vyofqc+TQRyPDnT4wgXXbLGF4z9YAzwwTLi8pNLhGqcbSjgkA==+ }dev: false/nopt/5.0.0:- resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==}- engines: {node: '>=6'}+ resolution:+ {+ integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==+ }+ engines: { node: '>=6' }hasBin: truedependencies:abbrev: 1.1.1dev: false/normalize-path/3.0.0:- resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}- engines: {node: '>=0.10.0'}+ resolution:+ {+ integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==+ }+ engines: { node: '>=0.10.0' }dev: true/normalize-range/0.1.2:- resolution: {integrity: sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=}- engines: {node: '>=0.10.0'}- dev: true-- /normalize-url/4.5.0:- resolution: {integrity: sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==}- engines: {node: '>=8'}+ resolution: { integrity: sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= }+ engines: { node: '>=0.10.0' }dev: true- /npmlog/4.1.2:- resolution: {integrity: sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==}- dependencies:- are-we-there-yet: 1.1.5- console-control-strings: 1.1.0- gauge: 2.7.4- set-blocking: 2.0.0+ /normalize-url/6.1.0:+ resolution:+ {+ integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==+ }+ engines: { node: '>=10' }dev: false- /nth-check/2.0.0:- resolution: {integrity: sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==}+ /npm-run-path/4.0.1:+ resolution:+ {+ integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==+ }+ engines: { node: '>=8' }dependencies:- boolbase: 1.0.0+ path-key: 3.1.1dev: true- /number-is-nan/1.0.1:- resolution: {integrity: sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=}- engines: {node: '>=0.10.0'}+ /npmlog/5.0.1:+ resolution:+ {+ integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==+ }+ dependencies:+ are-we-there-yet: 2.0.0+ console-control-strings: 1.1.0+ gauge: 3.0.1+ set-blocking: 2.0.0dev: false/object-assign/4.1.1:- resolution: {integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=}- engines: {node: '>=0.10.0'}+ resolution: { integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= }+ engines: { node: '>=0.10.0' }dev: false/object-hash/2.2.0:- resolution: {integrity: sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==}- engines: {node: '>= 6'}- dev: true-- /once/1.4.0:- resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=}- dependencies:- wrappy: 1.0.2-- /optional-require/1.0.3:- resolution: {integrity: sha512-RV2Zp2MY2aeYK5G+B/Sps8lW5NHAzE5QClbFP15j+PWmP+T9PxlJXBOOLoSAdgwFvS4t0aMR4vpedMkbHfh0nA==}- engines: {node: '>=4'}+ resolution:+ {+ integrity: sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==+ }+ engines: { node: '>= 6' }+ dev: true++ /object-inspect/1.12.0:+ resolution:+ {+ integrity: sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==+ }+ dev: true++ /object-keys/1.1.1:+ resolution:+ {+ integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==+ }+ engines: { node: '>= 0.4' }dev: false- /optionator/0.9.1:- resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==}- engines: {node: '>= 0.8.0'}- dependencies:- deep-is: 0.1.3- fast-levenshtein: 2.0.6- levn: 0.4.1- prelude-ls: 1.2.1- type-check: 0.4.0- word-wrap: 1.2.3- dev: true-- /parent-module/1.0.1:- resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}- engines: {node: '>=6'}- dependencies:- callsites: 3.1.0- dev: true-- /parse-json/5.2.0:- resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}- engines: {node: '>=8'}- dependencies:- '@babel/code-frame': 7.14.5- error-ex: 1.3.2- json-parse-even-better-errors: 2.3.1- lines-and-columns: 1.1.6- dev: true-- /path-is-absolute/1.0.1:- resolution: {integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18=}- engines: {node: '>=0.10.0'}-- /path-key/3.1.1:- resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}- engines: {node: '>=8'}-- /path-parse/1.0.7:- resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}-- /path-type/4.0.0:- resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}- engines: {node: '>=8'}- dev: true-- /picomatch/2.3.0:- resolution: {integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==}- engines: {node: '>=8.6'}- dev: true-- /postcss-calc/[email protected]:- resolution: {integrity: sha512-5NglwDrcbiy8XXfPM11F3HeC6hoT9W7GUH/Zi5U/p7u3Irv4rHhdDcIZwG0llHXV4ftsBjpfWMXAnXNl4lnt8g==}- peerDependencies:- postcss: ^8.2.2- dependencies:- postcss: 8.3.0- postcss-selector-parser: 6.0.6- postcss-value-parser: 4.1.0- dev: true-- /postcss-colormin/[email protected]:- resolution: {integrity: sha512-+HC6GfWU3upe5/mqmxuqYZ9B2Wl4lcoUUNkoaX59nEWV4EtADCMiBqui111Bu8R8IvaZTmqmxrqOAqjbHIwXPw==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- browserslist: 4.16.6- caniuse-api: 3.0.0- colord: 2.0.1- postcss: 8.3.0- postcss-value-parser: 4.1.0- dev: true-- /postcss-convert-values/[email protected]:- resolution: {integrity: sha512-C3zR1Do2BkKkCgC0g3sF8TS0koF2G+mN8xxayZx3f10cIRmTaAnpgpRQZjNekTZxM2ciSPoh2IWJm0VZx8NoQg==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- postcss: 8.3.0- postcss-value-parser: 4.1.0- dev: true-- /postcss-discard-comments/[email protected]:- resolution: {integrity: sha512-lgZBPTDvWrbAYY1v5GYEv8fEO/WhKOu/hmZqmCYfrpD6eyDWWzAOsl2rF29lpvziKO02Gc5GJQtlpkTmakwOWg==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- postcss: 8.3.0- dev: true-- /postcss-discard-duplicates/[email protected]:- resolution: {integrity: sha512-svx747PWHKOGpAXXQkCc4k/DsWo+6bc5LsVrAsw+OU+Ibi7klFZCyX54gjYzX4TH+f2uzXjRviLARxkMurA2bA==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- postcss: 8.3.0- dev: true-- /postcss-discard-empty/[email protected]:- resolution: {integrity: sha512-vfU8CxAQ6YpMxV2SvMcMIyF2LX1ZzWpy0lqHDsOdaKKLQVQGVP1pzhrI9JlsO65s66uQTfkQBKBD/A5gp9STFw==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- postcss: 8.3.0- dev: true-- /postcss-discard-overridden/[email protected]:- resolution: {integrity: sha512-Y28H7y93L2BpJhrdUR2SR2fnSsT+3TVx1NmVQLbcnZWwIUpJ7mfcTC6Za9M2PG6w8j7UQRfzxqn8jU2VwFxo3Q==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- postcss: 8.3.0- dev: true-- /postcss-js/3.0.3:- resolution: {integrity: sha512-gWnoWQXKFw65Hk/mi2+WTQTHdPD5UJdDXZmX073EY/B3BWnYjO4F4t0VneTCnCGQ5E5GsCdMkzPaTXwl3r5dJw==}- engines: {node: '>=10.0'}- dependencies:- camelcase-css: 2.0.1- postcss: 8.3.5- dev: true-- /postcss-load-config/3.0.1:- resolution: {integrity: sha512-/pDHe30UYZUD11IeG8GWx9lNtu1ToyTsZHnyy45B4Mrwr/Kb6NgYl7k753+05CJNKnjbwh4975amoPJ+TEjHNQ==}- engines: {node: '>= 10'}- dependencies:- cosmiconfig: 7.0.0- import-cwd: 3.0.0- dev: true-- /postcss-load-config/3.1.0:- resolution: {integrity: sha512-ipM8Ds01ZUophjDTQYSVP70slFSYg3T0/zyfII5vzhN6V57YSxMgG5syXuwi5VtS8wSf3iL30v0uBdoIVx4Q0g==}- engines: {node: '>= 10'}- peerDependencies:- ts-node: '>=9.0.0'- peerDependenciesMeta:- ts-node:- optional: true- dependencies:- import-cwd: 3.0.0- lilconfig: 2.0.3- yaml: 1.10.2- dev: true-- /postcss-merge-longhand/[email protected]:- resolution: {integrity: sha512-BMlg9AXSI5G9TBT0Lo/H3PfUy63P84rVz3BjCFE9e9Y9RXQZD3+h3YO1kgTNsNJy7bBc1YQp8DmSnwLIW5VPcw==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- css-color-names: 1.0.1- postcss: 8.3.0- postcss-value-parser: 4.1.0- stylehacks: [email protected]- dev: true-- /postcss-merge-rules/[email protected]:- resolution: {integrity: sha512-5K+Md7S3GwBewfB4rjDeol6V/RZ8S+v4B66Zk2gChRqLTCC8yjnHQ601omj9TKftS19OPGqZ/XzoqpzNQQLwbg==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- browserslist: 4.16.6- caniuse-api: 3.0.0- cssnano-utils: [email protected]- postcss: 8.3.0- postcss-selector-parser: 6.0.6- vendors: 1.0.4- dev: true-- /postcss-minify-font-values/[email protected]:- resolution: {integrity: sha512-7JS4qIsnqaxk+FXY1E8dHBDmraYFWmuL6cgt0T1SWGRO5bzJf8sUoelwa4P88LEWJZweHevAiDKxHlofuvtIoA==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- postcss: 8.3.0- postcss-value-parser: 4.1.0- dev: true-- /postcss-minify-gradients/[email protected]:- resolution: {integrity: sha512-odOwBFAIn2wIv+XYRpoN2hUV3pPQlgbJ10XeXPq8UY2N+9ZG42xu45lTn/g9zZ+d70NKSQD6EOi6UiCMu3FN7g==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- cssnano-utils: [email protected]- is-color-stop: 1.1.0- postcss: 8.3.0- postcss-value-parser: 4.1.0- dev: true-- /postcss-minify-params/[email protected]:- resolution: {integrity: sha512-4RUC4k2A/Q9mGco1Z8ODc7h+A0z7L7X2ypO1B6V8057eVK6mZ6xwz6QN64nHuHLbqbclkX1wyzRnIrdZehTEHw==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- alphanum-sort: 1.0.2- browserslist: 4.16.6- cssnano-utils: [email protected]- postcss: 8.3.0- postcss-value-parser: 4.1.0- uniqs: 2.0.0- dev: true-- /postcss-minify-selectors/[email protected]:- resolution: {integrity: sha512-NzGBXDa7aPsAcijXZeagnJBKBPMYLaJJzB8CQh6ncvyl2sIndLVWfbcDi0SBjRWk5VqEjXvf8tYwzoKf4Z07og==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15+ /once/1.4.0:+ resolution: { integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E= }dependencies:- alphanum-sort: 1.0.2- postcss: 8.3.0- postcss-selector-parser: 6.0.6- dev: true+ wrappy: 1.0.2- /postcss-nested/[email protected]:- resolution: {integrity: sha512-GSRXYz5bccobpTzLQZXOnSOfKl6TwVr5CyAQJUPub4nuRJSOECK5AqurxVgmtxP48p0Kc/ndY/YyS1yqldX0Ew==}- engines: {node: '>=10.0'}- peerDependencies:- postcss: ^8.1.13+ /onetime/5.1.2:+ resolution:+ {+ integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==+ }+ engines: { node: '>=6' }dependencies:- postcss: 8.3.0- postcss-selector-parser: 6.0.6+ mimic-fn: 2.1.0dev: true- /postcss-normalize-charset/[email protected]:- resolution: {integrity: sha512-6J40l6LNYnBdPSk+BHZ8SF+HAkS4q2twe5jnocgd+xWpz/mx/5Sa32m3W1AA8uE8XaXN+eg8trIlfu8V9x61eg==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15+ /optionator/0.9.1:+ resolution:+ {+ integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==+ }+ engines: { node: '>= 0.8.0' }dependencies:- postcss: 8.3.0+ deep-is: 0.1.4+ fast-levenshtein: 2.0.6+ levn: 0.4.1+ prelude-ls: 1.2.1+ type-check: 0.4.0+ word-wrap: 1.2.3dev: true- /postcss-normalize-display-values/[email protected]:- resolution: {integrity: sha512-uupdvWk88kLDXi5HEyI9IaAJTE3/Djbcrqq8YgjvAVuzgVuqIk3SuJWUisT2gaJbZm1H9g5k2w1xXilM3x8DjQ==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- cssnano-utils: [email protected]- postcss: 8.3.0- postcss-value-parser: 4.1.0+ /os-homedir/1.0.2:+ resolution: { integrity: sha1-/7xJiDNuDoM94MFox+8VISGqf7M= }+ engines: { node: '>=0.10.0' }dev: true- /postcss-normalize-positions/[email protected]:- resolution: {integrity: sha512-rvzWAJai5xej9yWqlCb1OWLd9JjW2Ex2BCPzUJrbaXmtKtgfL8dBMOOMTX6TnvQMtjk3ei1Lswcs78qKO1Skrg==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- postcss: 8.3.0- postcss-value-parser: 4.1.0+ /os-tmpdir/1.0.2:+ resolution: { integrity: sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= }+ engines: { node: '>=0.10.0' }dev: true- /postcss-normalize-repeat-style/[email protected]:- resolution: {integrity: sha512-syZ2itq0HTQjj4QtXZOeefomckiV5TaUO6ReIEabCh3wgDs4Mr01pkif0MeVwKyU/LHEkPJnpwFKRxqWA/7O3w==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15+ /p-cancelable/3.0.0:+ resolution:+ {+ integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==+ }+ engines: { node: '>=12.20' }+ dev: false++ /p-map/2.1.0:+ resolution:+ {+ integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==+ }+ engines: { node: '>=6' }+ dev: false++ /p-map/4.0.0:+ resolution:+ {+ integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==+ }+ engines: { node: '>=10' }dependencies:- cssnano-utils: [email protected]- postcss: 8.3.0- postcss-value-parser: 4.1.0+ aggregate-error: 3.1.0dev: true- /postcss-normalize-string/[email protected]:- resolution: {integrity: sha512-Ic8GaQ3jPMVl1OEn2U//2pm93AXUcF3wz+OriskdZ1AOuYV25OdgS7w9Xu2LO5cGyhHCgn8dMXh9bO7vi3i9pA==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15+ /parent-module/1.0.1:+ resolution:+ {+ integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==+ }+ engines: { node: '>=6' }dependencies:- postcss: 8.3.0- postcss-value-parser: 4.1.0+ callsites: 3.1.0dev: true- /postcss-normalize-timing-functions/[email protected]:- resolution: {integrity: sha512-cPcBdVN5OsWCNEo5hiXfLUnXfTGtSFiBU9SK8k7ii8UD7OLuznzgNRYkLZow11BkQiiqMcgPyh4ZqXEEUrtQ1Q==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15+ /parse-json/5.2.0:+ resolution:+ {+ integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==+ }+ engines: { node: '>=8' }dependencies:- cssnano-utils: [email protected]- postcss: 8.3.0- postcss-value-parser: 4.1.0+ '@babel/code-frame': 7.12.11+ error-ex: 1.3.2+ json-parse-even-better-errors: 2.3.1+ lines-and-columns: 1.1.6dev: true- /postcss-normalize-unicode/[email protected]:- resolution: {integrity: sha512-kAtYD6V3pK0beqrU90gpCQB7g6AOfP/2KIPCVBKJM2EheVsBQmx/Iof+9zR9NFKLAx4Pr9mDhogB27pmn354nA==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- browserslist: 4.16.6- postcss: 8.3.0- postcss-value-parser: 4.1.0+ /path-is-absolute/1.0.1:+ resolution: { integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18= }+ engines: { node: '>=0.10.0' }++ /path-key/3.1.1:+ resolution:+ {+ integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==+ }+ engines: { node: '>=8' }++ /path-parse/1.0.7:+ resolution:+ {+ integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==+ }dev: true- /postcss-normalize-url/[email protected]:- resolution: {integrity: sha512-hkbG0j58Z1M830/CJ73VsP7gvlG1yF+4y7Fd1w4tD2c7CaA2Psll+pQ6eQhth9y9EaqZSLzamff/D0MZBMbYSg==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- is-absolute-url: 3.0.3- normalize-url: 4.5.0- postcss: 8.3.0- postcss-value-parser: 4.1.0+ /path-type/4.0.0:+ resolution:+ {+ integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==+ }+ engines: { node: '>=8' }dev: true- /postcss-normalize-whitespace/[email protected]:- resolution: {integrity: sha512-iPklmI5SBnRvwceb/XH568yyzK0qRVuAG+a1HFUsFRf11lEJTiQQa03a4RSCQvLKdcpX7XsI1Gen9LuLoqwiqA==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- postcss: 8.3.0- postcss-value-parser: 4.1.0+ /picocolors/1.0.0:+ resolution:+ {+ integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==+ }dev: true- /postcss-ordered-values/[email protected]:- resolution: {integrity: sha512-6mkCF5BQ25HvEcDfrMHCLLFHlraBSlOXFnQMHYhSpDO/5jSR1k8LdEXOkv+7+uzW6o6tBYea1Km0wQSRkPJkwA==}- engines: {node: ^10 || ^12 || >=14.0}+ /picomatch/2.3.0:+ resolution:+ {+ integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==+ }+ engines: { node: '>=8.6' }+ dev: true++ /postcss-js/[email protected]:+ resolution:+ {+ integrity: sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ==+ }+ engines: { node: ^12 || ^14 || >= 16 }peerDependencies:- postcss: ^8.2.15+ postcss: ^8.3.3dependencies:- cssnano-utils: [email protected]- postcss: 8.3.0- postcss-value-parser: 4.1.0+ camelcase-css: 2.0.1+ postcss: 8.4.6dev: true- /postcss-reduce-initial/[email protected]:- resolution: {integrity: sha512-zlCZPKLLTMAqA3ZWH57HlbCjkD55LX9dsRyxlls+wfuRfqCi5mSlZVan0heX5cHr154Dq9AfbH70LyhrSAezJw==}- engines: {node: ^10 || ^12 || >=14.0}+ /postcss-load-config/[email protected]:+ resolution:+ {+ integrity: sha512-ipM8Ds01ZUophjDTQYSVP70slFSYg3T0/zyfII5vzhN6V57YSxMgG5syXuwi5VtS8wSf3iL30v0uBdoIVx4Q0g==+ }+ engines: { node: '>= 10' }peerDependencies:- postcss: ^8.2.15+ ts-node: '>=9.0.0'+ peerDependenciesMeta:+ ts-node:+ optional: truedependencies:- browserslist: 4.16.6- caniuse-api: 3.0.0- postcss: 8.3.0+ import-cwd: 3.0.0+ lilconfig: 2.0.4+ ts-node: 10.5.0_99ae9436e134a034c8d45fdd98ebbf22+ yaml: 1.10.2dev: true- /postcss-reduce-transforms/[email protected]:- resolution: {integrity: sha512-a//FjoPeFkRuAguPscTVmRQUODP+f3ke2HqFNgGPwdYnpeC29RZdCBvGRGTsKpMURb/I3p6jdKoBQ2zI+9Q7kA==}- engines: {node: ^10 || ^12 || >=14.0}+ /postcss-nested/[email protected]:+ resolution:+ {+ integrity: sha512-rKqm2Fk0KbA8Vt3AdGN0FB9OBOMDVajMG6ZCf/GoHgdxUJ4sBFp0A/uMIRm+MJUdo33YXEtjqIz8u7DAp8B7DA==+ }+ engines: { node: '>=12.0' }peerDependencies:- postcss: ^8.2.15+ postcss: ^8.2.14dependencies:- cssnano-utils: [email protected]- postcss: 8.3.0- postcss-value-parser: 4.1.0+ postcss: 8.4.6+ postcss-selector-parser: 6.0.9dev: true- /postcss-selector-parser/6.0.6:- resolution: {integrity: sha512-9LXrvaaX3+mcv5xkg5kFwqSzSH1JIObIx51PrndZwlmznwXRfxMddDvo9gve3gVR8ZTKgoFDdWkbRFmEhT4PMg==}- engines: {node: '>=4'}+ /postcss-selector-parser/6.0.9:+ resolution:+ {+ integrity: sha512-UO3SgnZOVTwu4kyLR22UQ1xZh086RyNZppb7lLAKBFK8a32ttG5i87Y/P3+2bRSjZNyJ1B7hfFNo273tKe9YxQ==+ }+ engines: { node: '>=4' }dependencies:cssesc: 3.0.0util-deprecate: 1.0.2dev: true- /postcss-svgo/[email protected]:- resolution: {integrity: sha512-YzQuFLZu3U3aheizD+B1joQ94vzPfE6BNUcSYuceNxlVnKKsOtdo6hL9/zyC168Q8EwfLSgaDSalsUGa9f2C0A==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- postcss: 8.3.0- postcss-value-parser: 4.1.0- svgo: 2.3.0+ /postcss-value-parser/4.2.0:+ resolution:+ {+ integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==+ }dev: true- /postcss-unique-selectors/[email protected]:- resolution: {integrity: sha512-gwi1NhHV4FMmPn+qwBNuot1sG1t2OmacLQ/AX29lzyggnjd+MnVD5uqQmpXO3J17KGL2WAxQruj1qTd3H0gG/w==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15+ /postcss/8.4.6:+ resolution:+ {+ integrity: sha512-OovjwIzs9Te46vlEx7+uXB0PLijpwjXGKXjVGGPIGubGpq7uh5Xgf6D6FiJ/SzJMBosHDp6a2hiXOS97iBXcaA==+ }+ engines: { node: ^10 || ^12 || >=14 }dependencies:- alphanum-sort: 1.0.2- postcss: 8.3.0- postcss-selector-parser: 6.0.6- uniqs: 2.0.0- dev: true-- /postcss-value-parser/3.3.1:- resolution: {integrity: sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==}- dev: true-- /postcss-value-parser/4.1.0:- resolution: {integrity: sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==}+ nanoid: 3.2.0+ picocolors: 1.0.0+ source-map-js: 1.0.2dev: true- /postcss/8.3.0:- resolution: {integrity: sha512-+ogXpdAjWGa+fdYY5BQ96V/6tAo+TdSSIMP5huJBIygdWwKtVoB5JWZ7yUd4xZ8r+8Kvvx4nyg/PQ071H4UtcQ==}- engines: {node: ^10 || ^12 || >=14}+ /prelude-ls/1.2.1:+ resolution:+ {+ integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==+ }+ engines: { node: '>= 0.8.0' }+ dev: true++ /prettier-plugin-svelte/[email protected][email protected]:+ resolution:+ {+ integrity: sha512-NPSRf6Y5rufRlBleok/pqg4+1FyGsL0zYhkYP6hnueeL1J/uCm3OfOZPsLX4zqD9VAdcXfyEL2PYqGv8ZoOSfA==+ }+ peerDependencies:+ prettier: ^1.16.4 || ^2.0.0+ svelte: ^3.2.0dependencies:- colorette: 1.2.2- nanoid: 3.1.23- source-map-js: 0.6.2+ prettier: 2.5.1+ svelte: 3.46.4dev: true- /postcss/8.3.5:- resolution: {integrity: sha512-NxTuJocUhYGsMiMFHDUkmjSKT3EdH4/WbGF6GCi1NDGk+vbcUTun4fpbOqaPtD8IIsztA2ilZm2DhYCuyN58gA==}- engines: {node: ^10 || ^12 || >=14}+ /prettier-plugin-tailwindcss/[email protected]:+ resolution:+ {+ integrity: sha512-tmBr45hCLuit2Cz9Pwow0/Jl1bGivYGsfcF29O+3sKcE++ybjz9dfie565S3ZsvAeV8uYer9SRMBWDsHPly2Lg==+ }+ engines: { node: '>=12.17.0' }+ peerDependencies:+ prettier: '>=2.2.0'dependencies:- colorette: 1.2.2- nanoid: 3.1.23- source-map-js: 0.6.2+ prettier: 2.5.1dev: true- /prelude-ls/1.2.1:- resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}- engines: {node: '>= 0.8.0'}+ /prettier/2.5.1:+ resolution:+ {+ integrity: sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==+ }+ engines: { node: '>=10.13.0' }+ hasBin: truedev: true- /prettier-plugin-svelte/[email protected][email protected]:- resolution: {integrity: sha512-HTzXvSq7lWFuLsSaxYOUkGkVNCl3RrSjDCOgQjkBX5FQGmWjL8o3IFACSGhjPMMfWKADpapAr0zdbBWkND9mqw==}- peerDependencies:- prettier: ^1.16.4 || ^2.0.0- svelte: ^3.2.0+ /prisma/3.9.1:+ resolution:+ {+ integrity: sha512-IGcJAu5LzlFv+i+NNhOEh1J1xVVttsVdRBxmrMN7eIH+7mRN6L89Hz1npUAiz4jOpNlHC7n9QwaOYZGxTqlwQw==+ }+ engines: { node: '>=12.6' }+ hasBin: true+ requiresBuild: truedependencies:- prettier: 2.3.1- svelte: 3.38.2+ '@prisma/engines': 3.9.0-58.bcc2ff906db47790ee902e7bbc76d7ffb1893009dev: true- /prettier/2.3.1:- resolution: {integrity: sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA==}- engines: {node: '>=10.13.0'}- hasBin: true+ /private/0.1.8:+ resolution:+ {+ integrity: sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==+ }+ engines: { node: '>= 0.6' }dev: true- /pretty-hrtime/1.0.3:- resolution: {integrity: sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=}- engines: {node: '>= 0.8'}+ /progress/2.0.3:+ resolution:+ {+ integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==+ }+ engines: { node: '>=0.4.0' }dev: true- /process-nextick-args/2.0.1:- resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}- dev: false-- /progress/2.0.3:- resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}- engines: {node: '>=0.4.0'}+ /pseudomap/1.0.2:+ resolution: { integrity: sha1-8FKijacOYYkX7wqKw0wa5aaChrM= }dev: true/pump/3.0.0:- resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}+ resolution:+ {+ integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==+ }dependencies:end-of-stream: 1.4.4once: 1.4.0dev: false/punycode/2.1.1:- resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==}- engines: {node: '>=6'}- dev: true-- /purgecss/4.0.3:- resolution: {integrity: sha512-PYOIn5ibRIP34PBU9zohUcCI09c7drPJJtTDAc0Q6QlRz2/CHQ8ywGLdE7ZhxU2VTqB7p5wkvj5Qcm05Rz3Jmw==}- hasBin: true- dependencies:- commander: 6.2.1- glob: 7.1.7- postcss: 8.3.5- postcss-selector-parser: 6.0.6+ resolution:+ {+ integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==+ }+ engines: { node: '>=6' }dev: true/queue-microtask/1.2.3:- resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}+ resolution:+ {+ integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==+ }dev: true/quick-lru/5.1.1:- resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==}- engines: {node: '>=10'}- dev: true-- /readable-stream/2.3.7:- resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==}- dependencies:- core-util-is: 1.0.2- inherits: 2.0.4- isarray: 1.0.0- process-nextick-args: 2.0.1- safe-buffer: 5.1.2- string_decoder: 1.1.1- util-deprecate: 1.0.2- dev: false+ resolution:+ {+ integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==+ }+ engines: { node: '>=10' }/readable-stream/3.6.0:- resolution: {integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==}- engines: {node: '>= 6'}+ resolution:+ {+ integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==+ }+ engines: { node: '>= 6' }dependencies:inherits: 2.0.4string_decoder: 1.3.0@@ -2651,361 +4563,670 @@ packages:dev: false/readdirp/3.6.0:- resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}- engines: {node: '>=8.10.0'}+ resolution:+ {+ integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==+ }+ engines: { node: '>=8.10.0' }dependencies:picomatch: 2.3.0dev: true- /rechoir/0.6.2:- resolution: {integrity: sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=}- engines: {node: '>= 0.10'}+ /redis-commands/1.7.0:+ resolution:+ {+ integrity: sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==+ }+ dev: false++ /redis-errors/1.2.0:+ resolution: { integrity: sha1-62LSrbFeTq9GEMBK/hUpOEJQq60= }+ engines: { node: '>=4' }+ dev: false++ /redis-parser/3.0.0:+ resolution: { integrity: sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ= }+ engines: { node: '>=4' }dependencies:- resolve: 1.20.0+ redis-errors: 1.2.0dev: false- /reduce-css-calc/2.1.8:- resolution: {integrity: sha512-8liAVezDmUcH+tdzoEGrhfbGcP7nOV4NkGE3a74+qqvE7nt9i4sKLGBuZNOnpI4WiGksiNPklZxva80061QiPg==}+ /regenerate/1.4.2:+ resolution:+ {+ integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==+ }+ dev: true++ /regenerator-runtime/0.11.1:+ resolution:+ {+ integrity: sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==+ }+ dev: true++ /regenerator-transform/0.10.1:+ resolution:+ {+ integrity: sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==+ }dependencies:- css-unit-converter: 1.1.2- postcss-value-parser: 3.3.1+ babel-runtime: 6.26.0+ babel-types: 6.26.0+ private: 0.1.8dev: true- /regexp-clone/1.0.0:- resolution: {integrity: sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==}- dev: false+ /regexpp/3.2.0:+ resolution:+ {+ integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==+ }+ engines: { node: '>=8' }+ dev: true++ /regexpu-core/2.0.0:+ resolution: { integrity: sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= }+ dependencies:+ regenerate: 1.4.2+ regjsgen: 0.2.0+ regjsparser: 0.1.5+ dev: true++ /regjsgen/0.2.0:+ resolution: { integrity: sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc= }+ dev: true++ /regjsparser/0.1.5:+ resolution: { integrity: sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw= }+ hasBin: true+ dependencies:+ jsesc: 0.5.0+ dev: true- /regexpp/3.1.0:- resolution: {integrity: sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==}- engines: {node: '>=8'}+ /repeating/2.0.1:+ resolution: { integrity: sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= }+ engines: { node: '>=0.10.0' }+ dependencies:+ is-finite: 1.1.0dev: true/require-from-string/2.0.2:- resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}- engines: {node: '>=0.10.0'}+ resolution:+ {+ integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==+ }+ engines: { node: '>=0.10.0' }dev: true/require-relative/0.8.7:- resolution: {integrity: sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=}+ resolution: { integrity: sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4= }dev: true+ /resolve-alpn/1.2.1:+ resolution:+ {+ integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==+ }+ dev: false+/resolve-from/4.0.0:- resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}- engines: {node: '>=4'}+ resolution:+ {+ integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==+ }+ engines: { node: '>=4' }dev: true/resolve-from/5.0.0:- resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==+ }+ engines: { node: '>=8' }+ dev: true++ /resolve/1.22.0:+ resolution:+ {+ integrity: sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==+ }+ hasBin: true+ dependencies:+ is-core-module: 2.8.1+ path-parse: 1.0.7+ supports-preserve-symlinks-flag: 1.0.0dev: true- /resolve/1.20.0:- resolution: {integrity: sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==}+ /responselike/2.0.0:+ resolution:+ {+ integrity: sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==+ }dependencies:- is-core-module: 2.4.0- path-parse: 1.0.7+ lowercase-keys: 2.0.0+ dev: false++ /restore-cursor/3.1.0:+ resolution:+ {+ integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==+ }+ engines: { node: '>=8' }+ dependencies:+ onetime: 5.1.2+ signal-exit: 3.0.5+ dev: true/reusify/1.0.4:- resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}- engines: {iojs: '>=1.0.0', node: '>=0.10.0'}+ resolution:+ {+ integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==+ }+ engines: { iojs: '>=1.0.0', node: '>=0.10.0' }dev: true- /rgb-regex/1.0.1:- resolution: {integrity: sha1-wODWiC3w4jviVKR16O3UGRX+rrE=}+ /rfdc/1.3.0:+ resolution:+ {+ integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==+ }dev: true- /rgba-regex/1.0.0:- resolution: {integrity: sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=}+ /rimraf/2.7.1:+ resolution:+ {+ integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==+ }+ hasBin: true+ dependencies:+ glob: 7.2.0dev: true/rimraf/3.0.2:- resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}+ resolution:+ {+ integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==+ }hasBin: truedependencies:- glob: 7.1.7+ glob: 7.2.0- /rollup/2.46.0:- resolution: {integrity: sha512-qPGoUBNl+Z8uNu0z7pD3WPTABWRbcOwIrO/5ccDJzmrtzn0LVf6Lj91+L5CcWhXl6iWf23FQ6m8Jkl2CmN1O7Q==}- engines: {node: '>=10.0.0'}+ /rollup/2.61.1:+ resolution:+ {+ integrity: sha512-BbTXlEvB8d+XFbK/7E5doIcRtxWPRiqr0eb5vQ0+2paMM04Ye4PZY5nHOQef2ix24l/L0SpLd5hwcH15QHPdvA==+ }+ engines: { node: '>=10.0.0' }hasBin: trueoptionalDependencies:fsevents: 2.3.2dev: true/run-parallel/1.2.0:- resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}+ resolution:+ {+ integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==+ }dependencies:queue-microtask: 1.2.3dev: true+ /rxjs/7.5.2:+ resolution:+ {+ integrity: sha512-PwDt186XaL3QN5qXj/H9DGyHhP3/RYYgZZwqBv9Tv8rsAaiwFH1IsJJlcgD37J7UW5a6O67qX0KWKS3/pu0m4w==+ }+ dependencies:+ tslib: 2.3.1+ dev: true+/sade/1.7.4:- resolution: {integrity: sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==}- engines: {node: '>= 6'}+ resolution:+ {+ integrity: sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==+ }+ engines: { node: '>= 6' }dependencies:- mri: 1.1.6+ mri: 1.2.0dev: true/safe-buffer/5.1.2:- resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}- dev: false+ resolution:+ {+ integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==+ }+ dev: true/safe-buffer/5.2.1:- resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}+ resolution:+ {+ integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==+ }dev: false/safer-buffer/2.1.2:- resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}- dev: false-- /salteen/1.0.0:- resolution: {integrity: sha512-hApiOPudRSzM5aD1dWIWlXL8dPUja8GloMzHMlmDtNiU5brFNyjvQ+SiLLxHVQNeZ2HgKBnzrRHp+BXQiA5vGg==}- engines: {node: '>=6'}+ resolution:+ {+ integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==+ }dev: false- /saslprep/1.0.3:- resolution: {integrity: sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==}- engines: {node: '>=6'}+ /sander/0.5.1:+ resolution: { integrity: sha1-dB4kXiMfB8r7b98PEzrfohalAq0= }dependencies:- sparse-bitfield: 3.0.3- dev: false- optional: true+ es6-promise: 3.3.1+ graceful-fs: 4.2.8+ mkdirp: 0.5.5+ rimraf: 2.7.1+ dev: true/semver/5.7.1:- resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==}+ resolution:+ {+ integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==+ }hasBin: truedev: false/semver/6.3.0:- resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==}+ resolution:+ {+ integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==+ }hasBin: truedev: false/semver/7.3.5:- resolution: {integrity: sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==}- engines: {node: '>=10'}+ resolution:+ {+ integrity: sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==+ }+ engines: { node: '>=10' }hasBin: truedependencies:lru-cache: 6.0.0/set-blocking/2.0.0:- resolution: {integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc=}+ resolution: { integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc= }dev: false+ /shebang-command/1.2.0:+ resolution: { integrity: sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= }+ engines: { node: '>=0.10.0' }+ dependencies:+ shebang-regex: 1.0.0+ dev: true+/shebang-command/2.0.0:- resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==+ }+ engines: { node: '>=8' }dependencies:shebang-regex: 3.0.0- /shebang-regex/3.0.0:- resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}- engines: {node: '>=8'}-- /shelljs/0.8.4:- resolution: {integrity: sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==}- engines: {node: '>=4'}- hasBin: true- dependencies:- glob: 7.1.6- interpret: 1.4.0- rechoir: 0.6.2- dev: false+ /shebang-regex/1.0.0:+ resolution: { integrity: sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= }+ engines: { node: '>=0.10.0' }+ dev: true- /sift/13.5.2:- resolution: {integrity: sha512-+gxdEOMA2J+AI+fVsCqeNn7Tgx3M9ZN9jdi95939l1IJ8cZsqS8sqpJyOkic2SJk+1+98Uwryt/gL6XDaV+UZA==}- dev: false+ /shebang-regex/3.0.0:+ resolution:+ {+ integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==+ }+ engines: { node: '>=8' }- /signal-exit/3.0.3:- resolution: {integrity: sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==}- dev: false+ /signal-exit/3.0.5:+ resolution:+ {+ integrity: sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==+ }- /simple-swizzle/0.2.2:- resolution: {integrity: sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=}- dependencies:- is-arrayish: 0.3.2+ /slash/1.0.0:+ resolution: { integrity: sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= }+ engines: { node: '>=0.10.0' }dev: true/slash/3.0.0:- resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==+ }+ engines: { node: '>=8' }dev: true- /slice-ansi/4.0.0:- resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==}- engines: {node: '>=10'}+ /slice-ansi/3.0.0:+ resolution:+ {+ integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==+ }+ engines: { node: '>=8' }dependencies:ansi-styles: 4.3.0astral-regex: 2.0.0is-fullwidth-code-point: 3.0.0dev: true- /sliced/1.0.1:- resolution: {integrity: sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=}- dev: false+ /slice-ansi/4.0.0:+ resolution:+ {+ integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==+ }+ engines: { node: '>=10' }+ dependencies:+ ansi-styles: 4.3.0+ astral-regex: 2.0.0+ is-fullwidth-code-point: 3.0.0+ dev: true- /source-map-js/0.6.2:- resolution: {integrity: sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==}- engines: {node: '>=0.10.0'}+ /slice-ansi/5.0.0:+ resolution:+ {+ integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==+ }+ engines: { node: '>=12' }+ dependencies:+ ansi-styles: 6.1.0+ is-fullwidth-code-point: 4.0.0dev: true- /source-map/0.6.1:- resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}- engines: {node: '>=0.10.0'}+ /sorcery/0.10.0:+ resolution: { integrity: sha1-iukK19fLBfxZ8asMY3hF1cFaUrc= }+ hasBin: true+ dependencies:+ buffer-crc32: 0.2.13+ minimist: 1.2.5+ sander: 0.5.1+ sourcemap-codec: 1.4.8dev: true- /sourcemap-codec/1.4.8:- resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==}+ /source-map-js/1.0.2:+ resolution:+ {+ integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==+ }+ engines: { node: '>=0.10.0' }dev: true- /sparse-bitfield/3.0.3:- resolution: {integrity: sha1-/0rm5oZWBWuks+eSqzM004JzyhE=}+ /source-map-support/0.4.18:+ resolution:+ {+ integrity: sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==+ }dependencies:- memory-pager: 1.5.0- dev: false- optional: true+ source-map: 0.5.7+ dev: true++ /source-map/0.5.7:+ resolution: { integrity: sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= }+ engines: { node: '>=0.10.0' }+ dev: true++ /source-map/0.7.3:+ resolution:+ {+ integrity: sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==+ }+ engines: { node: '>= 8' }+ dev: true++ /sourcemap-codec/1.4.8:+ resolution:+ {+ integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==+ }+ dev: true/split-ca/1.0.1:- resolution: {integrity: sha1-bIOv82kvphJW4M0ZfgXp3hV2kaY=}+ resolution: { integrity: sha1-bIOv82kvphJW4M0ZfgXp3hV2kaY= }dev: false/sprintf-js/1.0.3:- resolution: {integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=}+ resolution: { integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= }dev: true- /ssh2-streams/0.4.10:- resolution: {integrity: sha512-8pnlMjvnIZJvmTzUIIA5nT4jr2ZWNNVHwyXfMGdRJbug9TpI3kd99ffglgfSWqujVv/0gxwMsDn9j9RVst8yhQ==}- engines: {node: '>=5.2.0'}+ /ssh2/1.5.0:+ resolution:+ {+ integrity: sha512-iUmRkhH9KGeszQwDW7YyyqjsMTf4z+0o48Cp4xOwlY5LjtbIAvyd3fwnsoUZW/hXmTCRA3yt7S/Jb9uVjErVlA==+ }+ engines: { node: '>=10.16.0' }+ requiresBuild: truedependencies:asn1: 0.2.4bcrypt-pbkdf: 1.0.2- streamsearch: 0.1.2+ optionalDependencies:+ cpu-features: 0.0.2+ nan: 2.15.0dev: false- /ssh2/0.8.9:- resolution: {integrity: sha512-GmoNPxWDMkVpMFa9LVVzQZHF6EW3WKmBwL+4/GeILf2hFmix5Isxm7Amamo8o7bHiU0tC+wXsGcUXOxp8ChPaw==}- engines: {node: '>=5.2.0'}- dependencies:- ssh2-streams: 0.4.10+ /standard-as-callback/2.1.0:+ resolution:+ {+ integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==+ }dev: false- /stable/0.1.8:- resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==}+ /string-argv/0.3.1:+ resolution:+ {+ integrity: sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==+ }+ engines: { node: '>=0.6.19' }dev: true- /streamsearch/0.1.2:- resolution: {integrity: sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=}- engines: {node: '>=0.8.0'}- dev: false-- /string-width/1.0.2:- resolution: {integrity: sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=}- engines: {node: '>=0.10.0'}+ /string-width/2.1.1:+ resolution:+ {+ integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==+ }+ engines: { node: '>=4' }dependencies:- code-point-at: 1.1.0- is-fullwidth-code-point: 1.0.0- strip-ansi: 3.0.1+ is-fullwidth-code-point: 2.0.0+ strip-ansi: 4.0.0dev: false- /string-width/4.2.2:- resolution: {integrity: sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==}- engines: {node: '>=8'}+ /string-width/4.2.3:+ resolution:+ {+ integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==+ }+ engines: { node: '>=8' }dependencies:emoji-regex: 8.0.0is-fullwidth-code-point: 3.0.0- strip-ansi: 6.0.0- dev: true+ strip-ansi: 6.0.1- /string_decoder/1.1.1:- resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}+ /string-width/5.1.0:+ resolution:+ {+ integrity: sha512-7x54QnN21P+XL/v8SuNKvfgsUre6PXpN7mc77N3HlZv+f1SBRGmjxtOud2Z6FZ8DmdkD/IdjCaf9XXbnqmTZGQ==+ }+ engines: { node: '>=12' }dependencies:- safe-buffer: 5.1.2- dev: false+ eastasianwidth: 0.2.0+ emoji-regex: 9.2.2+ strip-ansi: 7.0.1+ dev: true/string_decoder/1.3.0:- resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}+ resolution:+ {+ integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==+ }dependencies:safe-buffer: 5.2.1dev: false/strip-ansi/3.0.1:- resolution: {integrity: sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=}- engines: {node: '>=0.10.0'}+ resolution: { integrity: sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= }+ engines: { node: '>=0.10.0' }dependencies:ansi-regex: 2.1.1+ dev: true++ /strip-ansi/4.0.0:+ resolution: { integrity: sha1-qEeQIusaw2iocTibY1JixQXuNo8= }+ engines: { node: '>=4' }+ dependencies:+ ansi-regex: 3.0.0dev: false- /strip-ansi/6.0.0:- resolution: {integrity: sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==}- engines: {node: '>=8'}+ /strip-ansi/6.0.1:+ resolution:+ {+ integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==+ }+ engines: { node: '>=8' }dependencies:- ansi-regex: 5.0.0+ ansi-regex: 5.0.1++ /strip-ansi/7.0.1:+ resolution:+ {+ integrity: sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==+ }+ engines: { node: '>=12' }+ dependencies:+ ansi-regex: 6.0.1+ dev: true++ /strip-final-newline/2.0.0:+ resolution:+ {+ integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==+ }+ engines: { node: '>=6' }dev: true/strip-indent/3.0.0:- resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==+ }+ engines: { node: '>=8' }dependencies:min-indent: 1.0.1dev: true/strip-json-comments/3.1.1:- resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==+ }+ engines: { node: '>=8' }dev: true- /stylehacks/[email protected]:- resolution: {integrity: sha512-Es0rVnHIqbWzveU1b24kbw92HsebBepxfcqe5iix7t9j0PQqhs0IxXVXv0pY2Bxa08CgMkzD6OWql7kbGOuEdA==}- engines: {node: ^10 || ^12 || >=14.0}- peerDependencies:- postcss: ^8.2.15- dependencies:- browserslist: 4.16.6- postcss: 8.3.0- postcss-selector-parser: 6.0.6+ /supports-color/2.0.0:+ resolution: { integrity: sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= }+ engines: { node: '>=0.8.0' }dev: true/supports-color/5.5.0:- resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}- engines: {node: '>=4'}+ resolution:+ {+ integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==+ }+ engines: { node: '>=4' }dependencies:has-flag: 3.0.0dev: true/supports-color/7.2.0:- resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}- engines: {node: '>=8'}+ resolution:+ {+ integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==+ }+ engines: { node: '>=8' }dependencies:has-flag: 4.0.0dev: true- /svelte-hmr/[email protected]:- resolution: {integrity: sha512-3O+kkbT1XKAomKB0LRcdY8JUTzONoNZ8rSH4iEdG7piIYsw+KkXpTkbbU1Sc1yPY4onfXkmCrHElYsxr0V1Snw==}+ /supports-color/9.2.1:+ resolution:+ {+ integrity: sha512-Obv7ycoCTG51N7y175StI9BlAXrmgZrFhZOb0/PyjHBher/NmsdBgbbQ1Inhq+gIhz6+7Gb+jWF2Vqi7Mf1xnQ==+ }+ engines: { node: '>=12' }+ dev: true++ /supports-preserve-symlinks-flag/1.0.0:+ resolution:+ {+ integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==+ }+ engines: { node: '>= 0.4' }+ dev: true++ /svelte-check/[email protected][email protected]:+ resolution:+ {+ integrity: sha512-0zJMMgqYHoP7QEG3tfc5DekpHAOqoy4QOL8scWMSdHIpVVDVC0MuYK57nFyj3XVTW8Zfm85FlgnAdQYsVmST2Q==+ }+ hasBin: true+ peerDependencies:+ svelte: ^3.24.0+ dependencies:+ chokidar: 3.5.3+ fast-glob: 3.2.11+ import-fresh: 3.3.0+ minimist: 1.2.5+ picocolors: 1.0.0+ sade: 1.7.4+ source-map: 0.7.3+ svelte: 3.46.4+ svelte-preprocess: 4.10.3_88b359da5cac6d8f6ee1bbb7080a3fa9+ typescript: 4.5.5+ transitivePeerDependencies:+ - '@babel/core'+ - coffeescript+ - less+ - node-sass+ - postcss+ - postcss-load-config+ - pug+ - sass+ - stylus+ - sugarss+ dev: true++ /svelte-hmr/[email protected]:+ resolution:+ {+ integrity: sha512-bKE9+4qb4sAnA+TKHiYurUl970rjA0XmlP9TEP7K/ncyWz3m81kA4HOgmlZK/7irGK7gzZlaPDI3cmf8fp/+tg==+ }peerDependencies:svelte: '>=3.19.0'dependencies:- svelte: 3.38.2+ svelte: 3.46.4dev: true- /svelte-kit-cookie-session/1.0.6:- resolution: {integrity: sha512-vFf0eIyb6T3xaFQGzygLpkMEOvnxarmnobpZmkaC/Q2kh1Q2aFvwo3TEVrg5lD5mIT9irp4MqxRxIGWesF0XOQ==}- dependencies:- salteen: 1.0.0+ /svelte-kit-cookie-session/2.0.3:+ resolution:+ {+ integrity: sha512-jOBUpvrkt/fI5zaqWsWHDDIGnfuPQt3/PC1FDJpEV/E/hA8DvGO52esFny1HvUAP1tkVZ5FU3k6Yd3HyQH5oUQ==+ }dev: false- /svelte-preprocess/4.7.3_ddfd8490a44ef0de606159ff3aef985a:- resolution: {integrity: sha512-Zx1/xLeGOIBlZMGPRCaXtlMe4ZA0faato5Dc3CosEqwu75MIEPuOstdkH6cy+RYTUYynoxzNaDxkPX4DbrPwRA==}- engines: {node: '>= 9.11.2'}+ /svelte-preprocess/4.10.3_88b359da5cac6d8f6ee1bbb7080a3fa9:+ resolution:+ {+ integrity: sha512-ttw17lJfb/dx2ZJT9sesaXT5l7mPQ9Apx1H496Kli3Hkk7orIRGpOw6rCPkRNzr6ueVPqb4vzodS5x7sBFhKHw==+ }+ engines: { node: '>= 9.11.2' }requiresBuild: truepeerDependencies:'@babel/core': ^7.10.2coffeescript: ^2.5.1- less: ^3.11.3+ less: ^3.11.3 || ^4.0.0node-sass: '*'postcss: ^7 || ^8postcss-load-config: ^2.1.0 || ^3.0.0pug: ^3.0.0sass: ^1.26.8- stylus: ^0.54.7+ stylus: ^0.55.0sugarss: ^2.0.0svelte: ^3.23.0typescript: ^3.9.5 || ^4.0.0@@ -3033,106 +5254,82 @@ packages:typescript:optional: truedependencies:- '@types/pug': 2.0.4- '@types/sass': 1.16.0- detect-indent: 6.0.0- postcss: 8.3.0- postcss-load-config: 3.0.1+ '@types/pug': 2.0.5+ '@types/sass': 1.16.1+ detect-indent: 6.1.0+ magic-string: 0.25.7+ postcss: 8.4.6+ sorcery: 0.10.0strip-indent: 3.0.0- svelte: 3.38.2- typescript: 4.3.2- dev: true-- /svelte-select/3.17.0:- resolution: {integrity: sha512-ITmX/XUiSdkaILmsTviKRkZPaXckM5/FA7Y8BhiUPoamaZG/ZDyOo6ydjFu9fDVFTbwoAUGUi6HBjs+ZdK2AwA==}- dev: false-- /svelte/3.38.2:- resolution: {integrity: sha512-q5Dq0/QHh4BLJyEVWGe7Cej5NWs040LWjMbicBGZ+3qpFWJ1YObRmUDZKbbovddLC9WW7THTj3kYbTOFmU9fbg==}- engines: {node: '>= 8'}+ svelte: 3.46.4+ typescript: 4.5.5dev: true- /svgo/2.3.0:- resolution: {integrity: sha512-fz4IKjNO6HDPgIQxu4IxwtubtbSfGEAJUq/IXyTPIkGhWck/faiiwfkvsB8LnBkKLvSoyNNIY6d13lZprJMc9Q==}- engines: {node: '>=10.13.0'}- hasBin: true- dependencies:- '@trysound/sax': 0.1.1- chalk: 4.1.1- commander: 7.2.0- css-select: 3.1.2- css-tree: 1.1.3- csso: 4.2.0- stable: 0.1.8+ /svelte/3.46.4:+ resolution:+ {+ integrity: sha512-qKJzw6DpA33CIa+C/rGp4AUdSfii0DOTCzj/2YpSKKayw5WGSS624Et9L1nU1k2OVRS9vaENQXp2CVZNU+xvIg==+ }+ engines: { node: '>= 8' }dev: true- /systeminformation/5.7.7:- resolution: {integrity: sha512-aQ7MBeVI2MKPYOi3YJAoZ45JVlRkBA7IXoqGgtVBamvtE0I6JLOyJzD/VVc9pnMXDb3yqaMwssAjhwtJax4/Rw==}- engines: {node: '>=4.0.0'}- os: [darwin, linux, win32, freebsd, openbsd, netbsd, sunos]- hasBin: true- dev: false-- /table/6.6.0:- resolution: {integrity: sha512-iZMtp5tUvcnAdtHpZTWLPF0M7AgiQsURR2DwmxnJwSy8I3+cY+ozzVvYha3BOLG2TB+L0CqjIz+91htuj6yCXg==}- engines: {node: '>=10.0.0'}+ /table/6.7.2:+ resolution:+ {+ integrity: sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==+ }+ engines: { node: '>=10.0.0' }dependencies:- ajv: 8.2.0+ ajv: 8.6.3lodash.clonedeep: 4.5.0- lodash.flatten: 4.4.0lodash.truncate: 4.4.2slice-ansi: 4.0.0- string-width: 4.2.2- strip-ansi: 6.0.0+ string-width: 4.2.3+ strip-ansi: 6.0.1dev: true- /tailwindcss/2.2.4_6daa0ece57b4377652e73c9c66c3b94c:- resolution: {integrity: sha512-OdBCPgazNNsknSP+JfrPzkay9aqKjhKtFhbhgxHgvEFdHy/GuRPo2SCJ4w1SFTN8H6FPI4m6qD/Jj20NWY1GkA==}- engines: {node: '>=12.13.0'}+ /tailwindcss/3.0.19_27d966e3a2f4b84fbc8a2f9653dbb362:+ resolution:+ {+ integrity: sha512-rjsdfz/qZya5xQ0OVynEMETgWq1CacmftgMYeXXh6bRM5vxsNwRSbMJsCCIjq/w67om9VP/AFMolOwiE+5VKig==+ }+ engines: { node: '>=12.13.0' }hasBin: truepeerDependencies:autoprefixer: ^10.0.2postcss: ^8.0.9dependencies:- '@fullhuman/postcss-purgecss': [email protected]- arg: 5.0.0- autoprefixer: [email protected]- bytes: 3.1.0- chalk: 4.1.1- chokidar: 3.5.2- color: 3.1.3- cosmiconfig: 7.0.0+ arg: 5.0.1+ autoprefixer: [email protected]+ chalk: 4.1.2+ chokidar: 3.5.3+ color-name: 1.1.4+ cosmiconfig: 7.0.1detective: 5.2.0- didyoumean: 1.2.1+ didyoumean: 1.2.2dlv: 1.1.3- fast-glob: 3.2.5- fs-extra: 10.0.0- glob-parent: 6.0.0- html-tags: 3.1.0- is-glob: 4.0.1- lodash: 4.17.21- lodash.topath: 4.5.2- modern-normalize: 1.1.0- node-emoji: 1.10.0+ fast-glob: 3.2.11+ glob-parent: 6.0.2+ is-glob: 4.0.3normalize-path: 3.0.0object-hash: 2.2.0- postcss: 8.3.0- postcss-js: 3.0.3- postcss-load-config: 3.1.0- postcss-nested: [email protected]- postcss-selector-parser: 6.0.6- postcss-value-parser: 4.1.0- pretty-hrtime: 1.0.3+ postcss: 8.4.6+ postcss-js: [email protected]+ postcss-load-config: [email protected]+ postcss-nested: [email protected]+ postcss-selector-parser: 6.0.9+ postcss-value-parser: 4.2.0quick-lru: 5.1.1- reduce-css-calc: 2.1.8- resolve: 1.20.0- tmp: 0.2.1+ resolve: 1.22.0transitivePeerDependencies:- ts-nodedev: true/tar-fs/2.0.1:- resolution: {integrity: sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==}+ resolution:+ {+ integrity: sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==+ }dependencies:chownr: 1.1.4mkdirp-classic: 0.5.3@@ -3141,8 +5338,11 @@ packages:dev: false/tar-stream/2.2.0:- resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}- engines: {node: '>=6'}+ resolution:+ {+ integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==+ }+ engines: { node: '>=6' }dependencies:bl: 4.1.0end-of-stream: 1.4.4@@ -3151,180 +5351,345 @@ packages:readable-stream: 3.6.0dev: false- /tar/6.1.0:- resolution: {integrity: sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==}- engines: {node: '>= 10'}+ /tar/6.1.11:+ resolution:+ {+ integrity: sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==+ }+ engines: { node: '>= 10' }dependencies:chownr: 2.0.0fs-minipass: 2.1.0- minipass: 3.1.3+ minipass: 3.1.5minizlib: 2.1.2mkdirp: 1.0.4yallist: 4.0.0dev: false/text-table/0.2.0:- resolution: {integrity: sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=}+ resolution: { integrity: sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= }dev: true- /timsort/0.3.0:- resolution: {integrity: sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=}+ /through/2.3.8:+ resolution: { integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= }dev: true/tiny-glob/0.2.9:- resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==}+ resolution:+ {+ integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==+ }dependencies:globalyzer: 0.1.0globrex: 0.1.2dev: true- /tmp/0.2.1:- resolution: {integrity: sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==}- engines: {node: '>=8.17.0'}- dependencies:- rimraf: 3.0.2+ /to-fast-properties/1.0.3:+ resolution: { integrity: sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= }+ engines: { node: '>=0.10.0' }dev: true/to-regex-range/5.0.1:- resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}- engines: {node: '>=8.0'}+ resolution:+ {+ integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==+ }+ engines: { node: '>=8.0' }dependencies:is-number: 7.0.0dev: true- /tslib/1.14.1:- resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}+ /tr46/0.0.3:+ resolution: { integrity: sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= }+ dev: false++ /trim-right/1.0.1:+ resolution: { integrity: sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= }+ engines: { node: '>=0.10.0' }dev: true- /tslib/2.2.0:- resolution: {integrity: sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==}+ /ts-node/10.5.0_99ae9436e134a034c8d45fdd98ebbf22:+ resolution:+ {+ integrity: sha512-6kEJKwVxAJ35W4akuiysfKwKmjkbYxwQMTBaAxo9KKAx/Yd26mPUyhGz3ji+EsJoAgrLqVsYHNuuYwQe22lbtw==+ }+ hasBin: true+ peerDependencies:+ '@swc/core': '>=1.2.50'+ '@swc/wasm': '>=1.2.50'+ '@types/node': '*'+ typescript: '>=2.7'+ peerDependenciesMeta:+ '@swc/core':+ optional: true+ '@swc/wasm':+ optional: true+ dependencies:+ '@cspotcode/source-map-support': 0.7.0+ '@tsconfig/node10': 1.0.8+ '@tsconfig/node12': 1.0.9+ '@tsconfig/node14': 1.0.1+ '@tsconfig/node16': 1.0.2+ '@types/node': 17.0.16+ acorn: 8.5.0+ acorn-walk: 8.2.0+ arg: 4.1.3+ create-require: 1.1.1+ diff: 4.0.2+ make-error: 1.3.6+ typescript: 4.5.5+ v8-compile-cache-lib: 3.0.0+ yn: 3.1.1dev: true- /tsutils/[email protected]:- resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}- engines: {node: '>= 6'}+ /tslib/1.14.1:+ resolution:+ {+ integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==+ }++ /tslib/2.3.1:+ resolution:+ {+ integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==+ }+ dev: true++ /tsutils/[email protected]:+ resolution:+ {+ integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==+ }+ engines: { node: '>= 6' }peerDependencies:typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'dependencies:tslib: 1.14.1- typescript: 4.3.2+ typescript: 4.5.5dev: true/tweetnacl/0.14.5:- resolution: {integrity: sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=}+ resolution: { integrity: sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= }dev: false/type-check/0.4.0:- resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}- engines: {node: '>= 0.8.0'}+ resolution:+ {+ integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==+ }+ engines: { node: '>= 0.8.0' }dependencies:prelude-ls: 1.2.1dev: true/type-fest/0.20.2:- resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}- engines: {node: '>=10'}- dev: true-- /typescript/4.3.2:- resolution: {integrity: sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==}- engines: {node: '>=4.2.0'}+ resolution:+ {+ integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==+ }+ engines: { node: '>=10' }+ dev: true++ /type-fest/0.21.3:+ resolution:+ {+ integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==+ }+ engines: { node: '>=10' }+ dev: true++ /typescript/4.5.5:+ resolution:+ {+ integrity: sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==+ }+ engines: { node: '>=4.2.0' }hasBin: truedev: true/typpy/2.3.11:- resolution: {integrity: sha512-Jh/fykZSaxeKO0ceMAs6agki9T5TNA9kiIR6fzKbvafKpIw8UlNlHhzuqKyi5lfJJ5VojJOx9tooIbyy7vHV/g==}+ resolution:+ {+ integrity: sha512-Jh/fykZSaxeKO0ceMAs6agki9T5TNA9kiIR6fzKbvafKpIw8UlNlHhzuqKyi5lfJJ5VojJOx9tooIbyy7vHV/g==+ }dependencies:function.name: 1.0.13dev: false- /uniqs/2.0.0:- resolution: {integrity: sha1-/+3ks2slKQaW5uFl1KWe25mOawI=}- dev: true-- /unique-names-generator/4.5.0:- resolution: {integrity: sha512-GaiWvo3rKIHi1SyYP8/9cDrPMPSwEiYDUo2p0NQHeCHDXzLn8P6p8bttSS3lX7HHS3Yl5vnw/ulybO4GN85CgQ==}- engines: {node: '>=8'}+ /unique-names-generator/4.6.0:+ resolution:+ {+ integrity: sha512-m0fke1emBeT96UYn2psPQYwljooDWRTKt9oUZ5vlt88ZFMBGxqwPyLHXwCfkbgdm8jzioCp7oIpo6KdM+fnUlQ==+ }+ engines: { node: '>=8' }dev: false- /universalify/2.0.0:- resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==}- engines: {node: '>= 10.0.0'}- dev: true-/uri-js/4.4.1:- resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}+ resolution:+ {+ integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==+ }dependencies:punycode: 2.1.1dev: true/util-deprecate/1.0.2:- resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=}+ resolution: { integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= }- /v8-compile-cache/2.3.0:- resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==}- dev: true+ /uuid/8.3.2:+ resolution:+ {+ integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==+ }+ hasBin: true+ dev: false- /vendors/1.0.4:- resolution: {integrity: sha512-/juG65kTL4Cy2su4P8HjtkTxk6VmJDiOPBufWniqQ6wknac6jNiXS9vU+hO3wgusiyqWlzTbVHi0dyJqRONg3w==}+ /v8-compile-cache-lib/3.0.0:+ resolution:+ {+ integrity: sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==+ }dev: true- /vite/2.3.6:- resolution: {integrity: sha512-fsEpNKDHgh3Sn66JH06ZnUBnIgUVUtw6ucDhlOj1CEqxIkymU25yv1/kWDPlIjyYHnalr0cN6V+zzUJ+fmWHYw==}- engines: {node: '>=12.0.0'}+ /v8-compile-cache/2.3.0:+ resolution:+ {+ integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==+ }+ dev: true++ /vite/2.8.0:+ resolution:+ {+ integrity: sha512-ed5rjyeysttuPJX/aKSA0gTB/8ZKLM5xF6FtEuKy1B9DiQbDNFMVMQxnb9JesgBPUMMIJxC8w5KZ/KNWLKFXoA==+ }+ engines: { node: '>=12.2.0' }hasBin: true+ peerDependencies:+ less: '*'+ sass: '*'+ stylus: '*'+ peerDependenciesMeta:+ less:+ optional: true+ sass:+ optional: true+ stylus:+ optional: truedependencies:- esbuild: 0.12.6- postcss: 8.3.0- resolve: 1.20.0- rollup: 2.46.0+ esbuild: 0.14.21+ postcss: 8.4.6+ resolve: 1.22.0+ rollup: 2.61.1optionalDependencies:fsevents: 2.3.2dev: true- /vite/2.4.2:- resolution: {integrity: sha512-2MifxD2I9fjyDmmEzbULOo3kOUoqX90A58cT6mECxoVQlMYFuijZsPQBuA14mqSwvV3ydUsqnq+BRWXyO9Qa+w==}- engines: {node: '>=12.0.0'}+ /webidl-conversions/3.0.1:+ resolution: { integrity: sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= }+ dev: false++ /whatwg-url/5.0.0:+ resolution: { integrity: sha1-lmRU6HZUYuN2RNNib2dCzotwll0= }+ dependencies:+ tr46: 0.0.3+ webidl-conversions: 3.0.1+ dev: false++ /which/1.3.1:+ resolution:+ {+ integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==+ }hasBin: truedependencies:- esbuild: 0.12.15- postcss: 8.3.5- resolve: 1.20.0- rollup: 2.46.0- optionalDependencies:- fsevents: 2.3.2+ isexe: 2.0.0dev: true/which/2.0.2:- resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}- engines: {node: '>= 8'}+ resolution:+ {+ integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==+ }+ engines: { node: '>= 8' }hasBin: truedependencies:isexe: 2.0.0- /wide-align/1.1.3:- resolution: {integrity: sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==}+ /wide-align/1.1.5:+ resolution:+ {+ integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==+ }dependencies:- string-width: 1.0.2+ string-width: 4.2.3dev: false/word-wrap/1.2.3:- resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==}- engines: {node: '>=0.10.0'}+ resolution:+ {+ integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==+ }+ engines: { node: '>=0.10.0' }+ dev: true++ /wrap-ansi/6.2.0:+ resolution:+ {+ integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==+ }+ engines: { node: '>=8' }+ dependencies:+ ansi-styles: 4.3.0+ string-width: 4.2.3+ strip-ansi: 6.0.1+ dev: true++ /wrap-ansi/7.0.0:+ resolution:+ {+ integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==+ }+ engines: { node: '>=10' }+ dependencies:+ ansi-styles: 4.3.0+ string-width: 4.2.3+ strip-ansi: 6.0.1dev: true/wrappy/1.0.2:- resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=}+ resolution: { integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= }/xtend/4.0.2:- resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}- engines: {node: '>=0.4'}+ resolution:+ {+ integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==+ }+ engines: { node: '>=0.4' }+ dev: true++ /yallist/2.1.2:+ resolution: { integrity: sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= }dev: true/yallist/4.0.0:- resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}+ resolution:+ {+ integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==+ }/yaml/1.10.2:- resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==}- engines: {node: '>= 6'}+ resolution:+ {+ integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==+ }+ engines: { node: '>= 6' }+ dev: true++ /yn/3.1.1:+ resolution:+ {+ integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==+ }+ engines: { node: '>=6' }dev: truediff --git a/postcss.config.cjs b/postcss.config.cjsindex fba8830b23..054c147cbf 100644--- a/postcss.config.cjs+++ b/postcss.config.cjs@@ -1,18 +1,6 @@-const tailwindcss = require('tailwindcss');-const autoprefixer = require('autoprefixer');-const cssnano = require('cssnano');--const mode = process.env.NODE_ENV;-const dev = mode === 'development';-module.exports = {- plugins: [- tailwindcss,- autoprefixer,-- !dev &&- cssnano({- preset: 'default'- })- ]+ plugins: {+ tailwindcss: {},+ autoprefixer: {}+ }};diff --git a/prisma/migrations/20220131142425_init/migration.sql b/prisma/migrations/20220131142425_init/migration.sqlnew file mode 100644index 0000000000..6607a48b5a--- /dev/null+++ b/prisma/migrations/20220131142425_init/migration.sql@@ -0,0 +1,443 @@+-- CreateTable+CREATE TABLE "Setting" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "fqdn" TEXT,+ "isRegistrationEnabled" BOOLEAN NOT NULL DEFAULT false,+ "proxyPassword" TEXT NOT NULL,+ "proxyUser" TEXT NOT NULL,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL+);++-- CreateTable+CREATE TABLE "User" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "email" TEXT NOT NULL,+ "type" TEXT NOT NULL,+ "password" TEXT,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL+);++-- CreateTable+CREATE TABLE "Permission" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "userId" TEXT NOT NULL,+ "teamId" TEXT NOT NULL,+ "permission" TEXT NOT NULL,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ CONSTRAINT "Permission_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,+ CONSTRAINT "Permission_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team" ("id") ON DELETE RESTRICT ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "Team" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "name" TEXT,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ "databaseId" TEXT,+ "serviceId" TEXT,+ FOREIGN KEY ("databaseId") REFERENCES "Database" ("id") ON DELETE SET NULL ON UPDATE CASCADE,+ FOREIGN KEY ("serviceId") REFERENCES "Service" ("id") ON DELETE SET NULL ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "TeamInvitation" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "uid" TEXT NOT NULL,+ "email" TEXT NOT NULL,+ "teamId" TEXT NOT NULL,+ "teamName" TEXT NOT NULL,+ "permission" TEXT NOT NULL,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP+);++-- CreateTable+CREATE TABLE "Application" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "name" TEXT NOT NULL,+ "fqdn" TEXT,+ "repository" TEXT,+ "configHash" TEXT,+ "branch" TEXT,+ "buildPack" TEXT,+ "projectId" INTEGER,+ "port" INTEGER,+ "installCommand" TEXT,+ "buildCommand" TEXT,+ "startCommand" TEXT,+ "baseDirectory" TEXT,+ "publishDirectory" TEXT,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ "destinationDockerId" TEXT,+ "gitSourceId" TEXT,+ CONSTRAINT "Application_destinationDockerId_fkey" FOREIGN KEY ("destinationDockerId") REFERENCES "DestinationDocker" ("id") ON DELETE SET NULL ON UPDATE CASCADE,+ CONSTRAINT "Application_gitSourceId_fkey" FOREIGN KEY ("gitSourceId") REFERENCES "GitSource" ("id") ON DELETE SET NULL ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "ApplicationSettings" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "applicationId" TEXT NOT NULL,+ "debug" BOOLEAN NOT NULL DEFAULT false,+ "previews" BOOLEAN NOT NULL DEFAULT false,+ "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+);++-- CreateTable+CREATE TABLE "Secret" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "name" TEXT NOT NULL,+ "value" TEXT NOT NULL,+ "isBuildSecret" BOOLEAN NOT NULL DEFAULT false,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ "applicationId" TEXT NOT NULL,+ CONSTRAINT "Secret_applicationId_fkey" FOREIGN KEY ("applicationId") REFERENCES "Application" ("id") ON DELETE RESTRICT ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "BuildLog" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "applicationId" TEXT,+ "buildId" TEXT NOT NULL,+ "line" TEXT NOT NULL,+ "time" INTEGER NOT NULL+);++-- CreateTable+CREATE TABLE "Build" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "type" TEXT NOT NULL,+ "applicationId" TEXT,+ "destinationDockerId" TEXT,+ "gitSourceId" TEXT,+ "githubAppId" TEXT,+ "gitlabAppId" TEXT,+ "commit" TEXT,+ "status" TEXT DEFAULT 'queued',+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL+);++-- CreateTable+CREATE TABLE "DestinationDocker" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "network" TEXT NOT NULL,+ "name" TEXT NOT NULL,+ "engine" TEXT NOT NULL,+ "remoteEngine" BOOLEAN NOT NULL DEFAULT false,+ "isCoolifyProxyUsed" BOOLEAN DEFAULT false,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL+);++-- CreateTable+CREATE TABLE "GitSource" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "name" TEXT NOT NULL,+ "type" TEXT,+ "apiUrl" TEXT,+ "htmlUrl" TEXT,+ "organization" TEXT,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ "githubAppId" TEXT,+ "gitlabAppId" TEXT,+ CONSTRAINT "GitSource_githubAppId_fkey" FOREIGN KEY ("githubAppId") REFERENCES "GithubApp" ("id") ON DELETE SET NULL ON UPDATE CASCADE,+ CONSTRAINT "GitSource_gitlabAppId_fkey" FOREIGN KEY ("gitlabAppId") REFERENCES "GitlabApp" ("id") ON DELETE SET NULL ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "GithubApp" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "name" TEXT,+ "appId" INTEGER,+ "installationId" INTEGER,+ "clientId" TEXT,+ "clientSecret" TEXT,+ "webhookSecret" TEXT,+ "privateKey" TEXT,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL+);++-- CreateTable+CREATE TABLE "GitlabApp" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "oauthId" INTEGER NOT NULL,+ "groupName" TEXT,+ "deployKeyId" INTEGER,+ "privateSshKey" TEXT,+ "publicSshKey" TEXT,+ "webhookToken" TEXT,+ "appId" TEXT,+ "appSecret" TEXT,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL+);++-- CreateTable+CREATE TABLE "Database" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "name" TEXT NOT NULL,+ "publicPort" INTEGER,+ "defaultDatabase" TEXT,+ "type" TEXT,+ "version" TEXT,+ "dbUser" TEXT,+ "dbUserPassword" TEXT,+ "rootUser" TEXT,+ "rootUserPassword" TEXT,+ "destinationDockerId" TEXT,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ CONSTRAINT "Database_destinationDockerId_fkey" FOREIGN KEY ("destinationDockerId") REFERENCES "DestinationDocker" ("id") ON DELETE SET NULL ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "DatabaseSettings" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "databaseId" TEXT NOT NULL,+ "isPublic" BOOLEAN NOT NULL DEFAULT false,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ CONSTRAINT "DatabaseSettings_databaseId_fkey" FOREIGN KEY ("databaseId") REFERENCES "Database" ("id") ON DELETE RESTRICT ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "Service" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "name" TEXT NOT NULL,+ "fqdn" TEXT,+ "type" TEXT,+ "version" TEXT,+ "destinationDockerId" TEXT,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ CONSTRAINT "Service_destinationDockerId_fkey" FOREIGN KEY ("destinationDockerId") REFERENCES "DestinationDocker" ("id") ON DELETE SET NULL ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "PlausibleAnalytics" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "email" TEXT,+ "username" TEXT,+ "password" TEXT NOT NULL,+ "postgresqlUser" TEXT NOT NULL,+ "postgresqlPassword" TEXT NOT NULL,+ "postgresqlDatabase" TEXT NOT NULL,+ "postgresqlPublicPort" INTEGER,+ "secretKeyBase" TEXT,+ "serviceId" TEXT NOT NULL,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ CONSTRAINT "PlausibleAnalytics_serviceId_fkey" FOREIGN KEY ("serviceId") REFERENCES "Service" ("id") ON DELETE RESTRICT ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "Minio" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "rootUser" TEXT NOT NULL,+ "rootUserPassword" TEXT NOT NULL,+ "publicPort" INTEGER,+ "serviceId" TEXT NOT NULL,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ CONSTRAINT "Minio_serviceId_fkey" FOREIGN KEY ("serviceId") REFERENCES "Service" ("id") ON DELETE RESTRICT ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "Vscodeserver" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "password" TEXT NOT NULL,+ "serviceId" TEXT NOT NULL,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ CONSTRAINT "Vscodeserver_serviceId_fkey" FOREIGN KEY ("serviceId") REFERENCES "Service" ("id") ON DELETE RESTRICT ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "Wordpress" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "extraConfig" TEXT,+ "tablePrefix" TEXT,+ "mysqlUser" TEXT NOT NULL,+ "mysqlPassword" TEXT NOT NULL,+ "mysqlRootUser" TEXT NOT NULL,+ "mysqlRootUserPassword" TEXT NOT NULL,+ "mysqlDatabase" TEXT,+ "mysqlPublicPort" INTEGER,+ "serviceId" TEXT NOT NULL,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ CONSTRAINT "Wordpress_serviceId_fkey" FOREIGN KEY ("serviceId") REFERENCES "Service" ("id") ON DELETE RESTRICT ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "_TeamToUser" (+ "A" TEXT NOT NULL,+ "B" TEXT NOT NULL,+ FOREIGN KEY ("A") REFERENCES "Team" ("id") ON DELETE CASCADE ON UPDATE CASCADE,+ FOREIGN KEY ("B") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "_ApplicationToTeam" (+ "A" TEXT NOT NULL,+ "B" TEXT NOT NULL,+ FOREIGN KEY ("A") REFERENCES "Application" ("id") ON DELETE CASCADE ON UPDATE CASCADE,+ FOREIGN KEY ("B") REFERENCES "Team" ("id") ON DELETE CASCADE ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "_GitSourceToTeam" (+ "A" TEXT NOT NULL,+ "B" TEXT NOT NULL,+ FOREIGN KEY ("A") REFERENCES "GitSource" ("id") ON DELETE CASCADE ON UPDATE CASCADE,+ FOREIGN KEY ("B") REFERENCES "Team" ("id") ON DELETE CASCADE ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "_GithubAppToTeam" (+ "A" TEXT NOT NULL,+ "B" TEXT NOT NULL,+ FOREIGN KEY ("A") REFERENCES "GithubApp" ("id") ON DELETE CASCADE ON UPDATE CASCADE,+ FOREIGN KEY ("B") REFERENCES "Team" ("id") ON DELETE CASCADE ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "_GitlabAppToTeam" (+ "A" TEXT NOT NULL,+ "B" TEXT NOT NULL,+ FOREIGN KEY ("A") REFERENCES "GitlabApp" ("id") ON DELETE CASCADE ON UPDATE CASCADE,+ FOREIGN KEY ("B") REFERENCES "Team" ("id") ON DELETE CASCADE ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "_DestinationDockerToTeam" (+ "A" TEXT NOT NULL,+ "B" TEXT NOT NULL,+ FOREIGN KEY ("A") REFERENCES "DestinationDocker" ("id") ON DELETE CASCADE ON UPDATE CASCADE,+ FOREIGN KEY ("B") REFERENCES "Team" ("id") ON DELETE CASCADE ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "_DatabaseToTeam" (+ "A" TEXT NOT NULL,+ "B" TEXT NOT NULL,+ FOREIGN KEY ("A") REFERENCES "Database" ("id") ON DELETE CASCADE ON UPDATE CASCADE,+ FOREIGN KEY ("B") REFERENCES "Team" ("id") ON DELETE CASCADE ON UPDATE CASCADE+);++-- CreateTable+CREATE TABLE "_ServiceToTeam" (+ "A" TEXT NOT NULL,+ "B" TEXT NOT NULL,+ FOREIGN KEY ("A") REFERENCES "Service" ("id") ON DELETE CASCADE ON UPDATE CASCADE,+ FOREIGN KEY ("B") REFERENCES "Team" ("id") ON DELETE CASCADE ON UPDATE CASCADE+);++-- CreateIndex+CREATE UNIQUE INDEX "Setting_fqdn_key" ON "Setting"("fqdn");++-- CreateIndex+CREATE UNIQUE INDEX "User_id_key" ON "User"("id");++-- CreateIndex+CREATE UNIQUE INDEX "User_email_key" ON "User"("email");++-- CreateIndex+CREATE UNIQUE INDEX "Application_fqdn_key" ON "Application"("fqdn");++-- CreateIndex+CREATE UNIQUE INDEX "ApplicationSettings_applicationId_key" ON "ApplicationSettings"("applicationId");++-- CreateIndex+CREATE UNIQUE INDEX "Secret_name_key" ON "Secret"("name");++-- CreateIndex+CREATE UNIQUE INDEX "DestinationDocker_network_key" ON "DestinationDocker"("network");++-- CreateIndex+CREATE UNIQUE INDEX "GitSource_githubAppId_key" ON "GitSource"("githubAppId");++-- CreateIndex+CREATE UNIQUE INDEX "GitSource_gitlabAppId_key" ON "GitSource"("gitlabAppId");++-- CreateIndex+CREATE UNIQUE INDEX "GithubApp_name_key" ON "GithubApp"("name");++-- CreateIndex+CREATE UNIQUE INDEX "GitlabApp_oauthId_key" ON "GitlabApp"("oauthId");++-- CreateIndex+CREATE UNIQUE INDEX "GitlabApp_groupName_key" ON "GitlabApp"("groupName");++-- CreateIndex+CREATE UNIQUE INDEX "DatabaseSettings_databaseId_key" ON "DatabaseSettings"("databaseId");++-- CreateIndex+CREATE UNIQUE INDEX "PlausibleAnalytics_serviceId_key" ON "PlausibleAnalytics"("serviceId");++-- CreateIndex+CREATE UNIQUE INDEX "Minio_serviceId_key" ON "Minio"("serviceId");++-- CreateIndex+CREATE UNIQUE INDEX "Vscodeserver_serviceId_key" ON "Vscodeserver"("serviceId");++-- CreateIndex+CREATE UNIQUE INDEX "Wordpress_serviceId_key" ON "Wordpress"("serviceId");++-- CreateIndex+CREATE UNIQUE INDEX "_TeamToUser_AB_unique" ON "_TeamToUser"("A", "B");++-- CreateIndex+CREATE INDEX "_TeamToUser_B_index" ON "_TeamToUser"("B");++-- CreateIndex+CREATE UNIQUE INDEX "_ApplicationToTeam_AB_unique" ON "_ApplicationToTeam"("A", "B");++-- CreateIndex+CREATE INDEX "_ApplicationToTeam_B_index" ON "_ApplicationToTeam"("B");++-- CreateIndex+CREATE UNIQUE INDEX "_GitSourceToTeam_AB_unique" ON "_GitSourceToTeam"("A", "B");++-- CreateIndex+CREATE INDEX "_GitSourceToTeam_B_index" ON "_GitSourceToTeam"("B");++-- CreateIndex+CREATE UNIQUE INDEX "_GithubAppToTeam_AB_unique" ON "_GithubAppToTeam"("A", "B");++-- CreateIndex+CREATE INDEX "_GithubAppToTeam_B_index" ON "_GithubAppToTeam"("B");++-- CreateIndex+CREATE UNIQUE INDEX "_GitlabAppToTeam_AB_unique" ON "_GitlabAppToTeam"("A", "B");++-- CreateIndex+CREATE INDEX "_GitlabAppToTeam_B_index" ON "_GitlabAppToTeam"("B");++-- CreateIndex+CREATE UNIQUE INDEX "_DestinationDockerToTeam_AB_unique" ON "_DestinationDockerToTeam"("A", "B");++-- CreateIndex+CREATE INDEX "_DestinationDockerToTeam_B_index" ON "_DestinationDockerToTeam"("B");++-- CreateIndex+CREATE UNIQUE INDEX "_DatabaseToTeam_AB_unique" ON "_DatabaseToTeam"("A", "B");++-- CreateIndex+CREATE INDEX "_DatabaseToTeam_B_index" ON "_DatabaseToTeam"("B");++-- CreateIndex+CREATE UNIQUE INDEX "_ServiceToTeam_AB_unique" ON "_ServiceToTeam"("A", "B");++-- CreateIndex+CREATE INDEX "_ServiceToTeam_B_index" ON "_ServiceToTeam"("B");diff --git a/prisma/migrations/20220210104005_redis_aol/migration.sql b/prisma/migrations/20220210104005_redis_aol/migration.sqlnew file mode 100644index 0000000000..8a7e41098f--- /dev/null+++ b/prisma/migrations/20220210104005_redis_aol/migration.sql@@ -0,0 +1,28 @@+-- RedefineTables+PRAGMA foreign_keys=OFF;+CREATE TABLE "new_Team" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "name" TEXT,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ "databaseId" TEXT,+ "serviceId" TEXT+);+INSERT INTO "new_Team" ("createdAt", "databaseId", "id", "name", "serviceId", "updatedAt") SELECT "createdAt", "databaseId", "id", "name", "serviceId", "updatedAt" FROM "Team";+DROP TABLE "Team";+ALTER TABLE "new_Team" RENAME TO "Team";+CREATE TABLE "new_DatabaseSettings" (+ "id" TEXT NOT NULL PRIMARY KEY,+ "databaseId" TEXT NOT NULL,+ "isPublic" BOOLEAN NOT NULL DEFAULT false,+ "appendOnly" BOOLEAN NOT NULL DEFAULT true,+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" DATETIME NOT NULL,+ CONSTRAINT "DatabaseSettings_databaseId_fkey" FOREIGN KEY ("databaseId") REFERENCES "Database" ("id") ON DELETE RESTRICT ON UPDATE CASCADE+);+INSERT INTO "new_DatabaseSettings" ("createdAt", "databaseId", "id", "isPublic", "updatedAt") SELECT "createdAt", "databaseId", "id", "isPublic", "updatedAt" FROM "DatabaseSettings";+DROP TABLE "DatabaseSettings";+ALTER TABLE "new_DatabaseSettings" RENAME TO "DatabaseSettings";+CREATE UNIQUE INDEX "DatabaseSettings_databaseId_key" ON "DatabaseSettings"("databaseId");+PRAGMA foreign_key_check;+PRAGMA foreign_keys=ON;diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.tomlnew file mode 100644index 0000000000..e5e5c4705a--- /dev/null+++ b/prisma/migrations/migration_lock.toml@@ -0,0 +1,3 @@+# Please do not edit this file manually+# It should be added in your version-control system (i.e. Git)+provider = "sqlite"\ No newline at end of filediff --git a/prisma/schema.prisma b/prisma/schema.prismanew file mode 100644index 0000000000..b12e29fc53--- /dev/null+++ b/prisma/schema.prisma@@ -0,0 +1,298 @@+generator client {+ provider = "prisma-client-js"+}++datasource db {+ provider = "sqlite"+ url = env("COOLIFY_DATABASE_URL")+}++model Setting {+ id String @id @default(cuid())+ fqdn String? @unique+ isRegistrationEnabled Boolean @default(false)+ proxyPassword String+ proxyUser String+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+}++model User {+ id String @id @unique @default(cuid())+ email String @unique+ type String+ password String?+ teams Team[]+ permission Permission[]+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+}++model Permission {+ id String @id @default(cuid())+ user User @relation(fields: [userId], references: [id])+ userId String+ team Team @relation(fields: [teamId], references: [id])+ teamId String+ permission String+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+}++model Team {+ id String @id @default(cuid())+ users User[]+ name String?+ applications Application[]+ gitSources GitSource[]+ gitHubApps GithubApp[]+ gitLabApps GitlabApp[]+ destinationDocker DestinationDocker[]+ permissions Permission[]+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+ database Database[] @relation(fields: [databaseId], references: [id])+ databaseId String?+ service Service[] @relation(fields: [serviceId], references: [id])+ serviceId String?+}++model TeamInvitation {+ id String @id @default(cuid())+ uid String+ email String+ teamId String+ teamName String+ permission String+ createdAt DateTime @default(now())+}++model Application {+ id String @id @default(cuid())+ name String+ fqdn String? @unique+ repository String?+ configHash String?+ branch String?+ buildPack String?+ projectId Int?+ port Int?+ installCommand String?+ buildCommand String?+ startCommand String?+ baseDirectory String?+ publishDirectory String?+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+ settings ApplicationSettings?+ teams Team[]+ destinationDockerId String?+ destinationDocker DestinationDocker? @relation(fields: [destinationDockerId], references: [id])+ gitSourceId String?+ gitSource GitSource? @relation(fields: [gitSourceId], references: [id])+ secrets Secret[]+}++model ApplicationSettings {+ id String @id @default(cuid())+ application Application @relation(fields: [applicationId], references: [id])+ applicationId String @unique+ debug Boolean @default(false)+ previews Boolean @default(false)+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+}++model Secret {+ id String @id @default(cuid())+ name String @unique+ value String+ isBuildSecret Boolean @default(false)+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+ application Application @relation(fields: [applicationId], references: [id])+ applicationId String+}++model BuildLog {+ id String @id @default(cuid())+ applicationId String?+ buildId String+ line String+ time Int+}++model Build {+ id String @id @default(cuid())+ type String+ applicationId String?+ destinationDockerId String?+ gitSourceId String?+ githubAppId String?+ gitlabAppId String?+ commit String?+ status String? @default("queued")+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+}++model DestinationDocker {+ id String @id @default(cuid())+ network String @unique+ name String+ engine String+ remoteEngine Boolean @default(false)+ isCoolifyProxyUsed Boolean? @default(false)+ teams Team[]+ application Application[]+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+ database Database[]+ service Service[]+}++model GitSource {+ id String @id @default(cuid())+ name String+ teams Team[]+ type String?+ apiUrl String?+ htmlUrl String?+ organization String?+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+ githubAppId String? @unique+ githubApp GithubApp? @relation(fields: [githubAppId], references: [id])+ application Application[]+ gitlabAppId String? @unique+ gitlabApp GitlabApp? @relation(fields: [gitlabAppId], references: [id])+}++model GithubApp {+ id String @id @default(cuid())+ name String? @unique+ teams Team[]+ appId Int?+ installationId Int?+ clientId String?+ clientSecret String?+ webhookSecret String?+ privateKey String?+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+ gitSource GitSource?+}++model GitlabApp {+ id String @id @default(cuid())+ oauthId Int @unique+ groupName String? @unique+ teams Team[]+ deployKeyId Int?+ privateSshKey String?+ publicSshKey String?+ webhookToken String?+ appId String?+ appSecret String?+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+ gitSource GitSource?+}++model Database {+ id String @id @default(cuid())+ name String+ publicPort Int?+ defaultDatabase String?+ type String?+ version String?+ dbUser String?+ dbUserPassword String?+ rootUser String?+ rootUserPassword String?+ settings DatabaseSettings?+ destinationDocker DestinationDocker? @relation(fields: [destinationDockerId], references: [id])+ destinationDockerId String?+ teams Team[]+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+}++model DatabaseSettings {+ id String @id @default(cuid())+ database Database @relation(fields: [databaseId], references: [id])+ databaseId String @unique+ isPublic Boolean @default(false)+ appendOnly Boolean @default(true)+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+}++model Service {+ id String @id @default(cuid())+ name String+ fqdn String?+ type String?+ version String?+ teams Team[]+ destinationDockerId String?+ destinationDocker DestinationDocker? @relation(fields: [destinationDockerId], references: [id])+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+ plausibleAnalytics PlausibleAnalytics?+ minio Minio?+ vscodeserver Vscodeserver?+ wordpress Wordpress?+}++model PlausibleAnalytics {+ id String @id @default(cuid())+ email String?+ username String?+ password String+ postgresqlUser String+ postgresqlPassword String+ postgresqlDatabase String+ postgresqlPublicPort Int?+ secretKeyBase String?+ serviceId String @unique+ service Service @relation(fields: [serviceId], references: [id])+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+}++model Minio {+ id String @id @default(cuid())+ rootUser String+ rootUserPassword String+ publicPort Int?+ serviceId String @unique+ service Service @relation(fields: [serviceId], references: [id])+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+}++model Vscodeserver {+ id String @id @default(cuid())+ password String+ serviceId String @unique+ service Service @relation(fields: [serviceId], references: [id])+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+}++model Wordpress {+ id String @id @default(cuid())+ extraConfig String?+ tablePrefix String?+ mysqlUser String+ mysqlPassword String+ mysqlRootUser String+ mysqlRootUserPassword String+ mysqlDatabase String?+ mysqlPublicPort Int?+ serviceId String @unique+ service Service @relation(fields: [serviceId], references: [id])+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt+}diff --git a/prisma/seed.cjs b/prisma/seed.cjsnew file mode 100644index 0000000000..2dacc9a728--- /dev/null+++ b/prisma/seed.cjs@@ -0,0 +1,80 @@+const dotEnvExtended = require('dotenv-extended');+dotEnvExtended.load();+const { PrismaClient } = require('@prisma/client');+const prisma = new PrismaClient();+const crypto = require('crypto');+const generator = require('generate-password');+const cuid = require('cuid');++function generatePassword(length = 24) {+ return generator.generate({+ length,+ numbers: true,+ strict: true+ });+}+const algorithm = 'aes-256-ctr';++async function main() {+ // Enable registration for the first user+ // Set initial HAProxy password+ const settingsFound = await prisma.setting.findFirst({});+ if (!settingsFound) {+ await prisma.setting.create({+ data: {+ isRegistrationEnabled: true,+ proxyPassword: encrypt(generatePassword()),+ proxyUser: cuid()+ }+ });+ }+ const localDocker = await prisma.destinationDocker.findFirst({+ where: { engine: '/var/run/docker.sock' }+ });+ if (!localDocker) {+ await prisma.destinationDocker.create({+ data: {+ engine: '/var/run/docker.sock',+ name: 'Local Docker',+ isCoolifyProxyUsed: true,+ network: 'coolify'+ }+ });+ }+}+main()+ .catch((e) => {+ console.error(e);+ process.exit(1);+ })+ .finally(async () => {+ await prisma.$disconnect();+ });++const encrypt = (text) => {+ if (text) {+ const iv = crypto.randomBytes(16);+ const cipher = crypto.createCipheriv(algorithm, process.env['COOLIFY_SECRET_KEY'], iv);+ const encrypted = Buffer.concat([cipher.update(text), cipher.final()]);+ return JSON.stringify({+ iv: iv.toString('hex'),+ content: encrypted.toString('hex')+ });+ }+};++const decrypt = (hashString) => {+ if (hashString) {+ const hash = JSON.parse(hashString);+ const decipher = crypto.createDecipheriv(+ algorithm,+ process.env['COOLIFY_SECRET_KEY'],+ Buffer.from(hash.iv, 'hex')+ );+ const decrpyted = Buffer.concat([+ decipher.update(Buffer.from(hash.content, 'hex')),+ decipher.final()+ ]);+ return decrpyted.toString();+ }+};diff --git a/scripts/install.sh b/scripts/install.shnew file mode 100644index 0000000000..e728f8d0d6--- /dev/null+++ b/scripts/install.sh@@ -0,0 +1,112 @@+#!/usr/bin/env bash+clear+ARG1=$1+WHO=$(whoami)+APP_ID=$(cat /proc/sys/kernel/random/uuid)+RANDOM_SECRET=$(echo $(($(date +%s%N) / 1000000)) | sha256sum | base64 | head -c 32)+SENTRY_DSN="https://[email protected]/6091062"+DOCKER_MAJOR=20+DOCKER_MINOR=10+DOCKER_VERSION_OK="nok"++set -eou pipefail++if [ $ARG1 ] && [ $ARG1 == "-d" ]; then+ set -x+fi++function errorchecker() {+ exitCode=$?+ if [ $exitCode -ne "0" ]; then+ echo "$0 exited unexpectedly with status: $exitCode"+ exit $exitCode+ fi+}+trap 'errorchecker' EXIT++echo -e "Welcome to Coolify installer! \n"+echo "This script will install all the required packages and services to run Coolify."+echo -e "If you want to install Coolify on a different OS, please open an issue on Github to get supported version.\n\n"++echo -e "To see what I'm doing, please check:"+echo -e "https://github.com/coollabsio/get.coollabs.io/blob/main/static/coolify/install_v2.sh\n\n"++if [ $WHO != 'root' ]; then+ echo 'Run as root please: sudo sh -c "$(curl -fsSL https://get.coollabs.io/coolify/install.sh)"'+ exit 1+fi++if [ ! -x "$(command -v docker)" ]; then+ while true; do+ read -p "Docker Engine not found, should I install it automatically? [Yy/Nn] " yn+ case $yn in+ [Yy]*)+ sh -c "$(curl -fsSL https://get.docker.com)"+ break+ ;;+ [Nn]*)+ echo "Please install docker manually and update it to the latest, but at least to $DOCKER_MAJOR.$DOCKER_MINOR"+ exit 0+ ;;+ *) echo "Please answer Y or N." ;;+ esac+ done+fi++SERVER_VERSION=$(docker version -f "{{.Server.Version}}")+SERVER_VERSION_MAJOR=$(echo "$SERVER_VERSION" | cut -d'.' -f 1)+SERVER_VERSION_MINOR=$(echo "$SERVER_VERSION" | cut -d'.' -f 2)++if [ "$SERVER_VERSION_MAJOR" -ge "$DOCKER_MAJOR" ] &&+ [ "$SERVER_VERSION_MINOR" -ge "$DOCKER_MINOR" ]; then+ DOCKER_VERSION_OK="ok"+fi++if [ $DOCKER_VERSION_OK == 'nok' ]; then+ echo "Docker version less than $DOCKER_MAJOR.$DOCKER_MINOR, please update it to at least to $DOCKER_MAJOR.$DOCKER_MINOR"+ exit 1+fi++# Adding docker daemon configuration+cat <<EOF >/etc/docker/daemon.json+{+ "log-driver": "json-file",+ "log-opts": {+ "max-size": "100m",+ "max-file": "5"+ },+ "features": {+ "buildkit": true+ },+ "live-restore": true+}+EOF++# Restarting docker daemon+sh -c "systemctl daemon-reload && systemctl restart docker"++# Downloading docker compose cli plugin+mkdir -p ~/.docker/cli-plugins/+curl -SL https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose+chmod +x ~/.docker/cli-plugins/docker-compose++# Making base directory for coolify+if [ ! -d coolify ]; then+ mkdir coolify+fi++if [ -f coolify/.env ]; then+ echo -e "Coolify is already installed, using some of the existing settings."+else+ echo "COOLIFY_APP_ID=$APP_ID+COOLIFY_SECRET_KEY=$RANDOM_SECRET+COOLIFY_DATABASE_URL=file:../db/prod.db+COOLIFY_SENTRY_DSN=$SENTRY_DSN+COOLIFY_HOSTED_ON=docker" > coolify/.env+fi++cd coolify && docker run -tid --env-file .env -v /var/run/docker.sock:/var/run/docker.sock -v coolify-db-sqlite coollabsio/coolify:latest /bin/sh -c "env | grep COOLIFY > .env && docker compose up -d --force-recreate"++echo -e "Congratulations! Your coolify is ready to use.\n"+echo "Please visit http://<Your Public IP Address>:3000/ to get started."+echo "It will take a few minutes to start up, don't worry."\ No newline at end of filediff --git a/scripts/install_podman_experiment.sh b/scripts/install_podman_experiment.shnew file mode 100644index 0000000000..0edfb90d29--- /dev/null+++ b/scripts/install_podman_experiment.sh@@ -0,0 +1,114 @@+#!/usr/bin/env bash++clear+ARG1=$1+WHO=$(whoami)+APP_ID=$(cat /proc/sys/kernel/random/uuid)+RANDOM_SECRET=$(echo $(($(date +%s%N) / 1000000)) | sha256sum | base64 | head -c 32)+SENTRY_DSN="https://[email protected]/6091062"++UBUNTU_MAJOR_MIN=20+UBUNTU_MINOR_MIN=04+OS_OK="nok"++set -eou pipefail++if [ $ARG1 ] && [ $ARG1 == "-d" ]; then+ set -x+fi++function errorchecker() {+ exitCode=$?+ if [ $exitCode -ne "0" ]; then+ echo "$0 exited unexpectedly with status: $exitCode"+ exit $exitCode+ fi+}+trap 'errorchecker' EXIT++if [ $WHO != 'root' ]; then+ echo 'Run as root please: sudo sh -c "$(curl -fsSL https://get.coollabs.io/coolify/install.sh)"'+ exit 1+fi++. /etc/lsb-release+if [ $DISTRIB_ID != 'Ubuntu' ]; then+ echo 'Not supported OS, please open an issue on Github to get supported version.'+ exit 1+fi++DISTRIB_RELEASE_MAJOR=$(echo "$DISTRIB_RELEASE" | cut -d'.' -f 1)+DISTRIB_RELEASE_MINOR=$(echo "$DISTRIB_RELEASE" | cut -d'.' -f 2)++if [ "$DISTRIB_RELEASE_MAJOR" -ge "$UBUNTU_MAJOR_MIN" ] &&+ [ "$DISTRIB_RELEASE_MINOR" -ge "$UBUNTU_MINOR_MIN" ]; then+ OS_OK="ok"+fi++if [ $OS_OK == 'nok' ]; then+ echo "Ubuntu version less than $UBUNTU_MAJOR_MIN.$UBUNTU_MINOR_MIN."+ exit 1+fi++function installPodman() {+ apt-get update -y+ apt-get install curl wget gnupg2 -y+ if [ "$DISTRIB_RELEASE_MAJOR" -eq "20" ] && [ "$DISTRIB_RELEASE_MINOR" -eq "04" ]; then+ echo 'Installing on 20.04'+ source /etc/os-release+ sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"+ wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | apt-key add -+ apt-get update -y+ apt-get -y install podman+ return 0+ elif [ "$DISTRIB_RELEASE_MAJOR" -eq "20" ] && [ "$DISTRIB_RELEASE_MINOR" -eq "10" ]; then+ apt-get -y install podman+ return 0+ elif [ "$DISTRIB_RELEASE_MAJOR" -gt "20" ]; then+ apt-get -y install podman+ return 0+ else+ exit 1+ fi++}++if [ ! -x "$(command -v podman)" ]; then+ while true; do+ read -p "Podman not found, should I install it automatically? [Yy/Nn] " yn+ case $yn in+ [Yy]*)+ installPodman+ break+ ;;+ [Nn]*)+ echo "Please install docker manually and update it to the latest, but at least to $DOCKER_MAJOR.$DOCKER_MINOR"+ exit 0+ ;;+ *) echo "Please answer Yy or Nn." ;;+ esac+ done+fi++# Making base directory for coolify+if [ ! -d coolify ]; then+ mkdir coolify+fi++echo "COOLIFY_APP_ID=$APP_ID+COOLIFY_SECRET_KEY=$RANDOM_SECRET+COOLIFY_DATABASE_URL=file:../db/prod.db+COOLIFY_SENTRY_DSN=$SENTRY_DSN+COOLIFY_HOSTED_ON=docker" >coolify/.env++systemctl start podman.socket+systemctl enable podman.socket++podman volume create coolify-db+podman volume create coolify-ssl-certs+podman volume create coolify-letsencrypt+++cd coolify && podman run --privileged -tid --env-file .env -v /var/run/podman/podman.sock:/var/run/podman/podman.sock -v coolify-db-sqlite:/app/db docker.io/coollabsio/coolify:latest /bin/sh -c "env | grep COOLIFY > .env && docker-compose up -d --force-recreate"+echo "Done"+exit 0diff --git a/src/app.html b/src/app.htmlindex 488c26e306..d5c431e119 100644--- a/src/app.html+++ b/src/app.html@@ -4,10 +4,10 @@<meta charset="utf-8" /><link rel="icon" href="/favicon.png" /><meta name="viewport" content="width=device-width, initial-scale=1" />- <title>Coolify</title><link rel="dns-prefetch" href="https://cdn.coollabs.io/" /><link rel="preconnect" href="https://cdn.coollabs.io/" crossorigin="" />- <link rel="stylesheet" href="https://cdn.coollabs.io/fonts/montserrat/montserrat.css" />+ <link rel="stylesheet" href="https://cdn.coollabs.io/fonts/poppins/poppins.css" />+ <title>Coolify</title>%svelte.head%</head><body>diff --git a/src/app.postcss b/src/app.postcssdeleted file mode 100644index 51f8daf3a4..0000000000--- a/src/app.postcss+++ /dev/null@@ -1,149 +0,0 @@-@tailwind base;-@tailwind components;-@tailwind utilities;--html {- height: 100%;-}-body {- background-color: rgb(22, 22, 22);- min-height: 100vh;- overflow-x: hidden;- @apply text-white;-}--:root {- --toastBackground: rgba(41, 37, 36, 0.8);- --toastProgressBackground: transparent;- --toastFont: 'Inter';-}--.border-gradient {- border-bottom: 2px solid transparent;- border-image: linear-gradient(- 0.25turn,- rgba(255, 249, 34),- rgba(255, 0, 128),- rgba(56, 2, 155, 0)- );- border-image-slice: 1;-}-.border-gradient-full {- border: 4px solid transparent;- border-image: linear-gradient(- 0.25turn,- rgba(255, 249, 34),- rgba(255, 0, 128),- rgba(56, 2, 155, 0)- );- border-image-slice: 1;-}--[aria-label][role~='tooltip']::after {- background: rgba(41, 37, 36, 0.9);- color: white;- font-family: 'Inter';- font-size: 16px;- font-weight: 600;- white-space: normal;-}--[role~='tooltip'][data-microtip-position|='bottom']::before {- background: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2841,%2037,%2036,%200.9%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E')- no-repeat;-}--[role~='tooltip'][data-microtip-position|='top']::before {- background: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2841,%2037,%2036,%200.9%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E')- no-repeat;-}-[role~='tooltip'][data-microtip-position='right']::before {- background: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2841,%2037,%2036,%200.9%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E')- no-repeat;-}--[role~='tooltip'][data-microtip-position='left']::before {- background: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2841,%2037,%2036,%200.9%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E')- no-repeat;-}--.main {- width: calc(100% - 4rem);- margin-left: 4rem;-}-._toastMsg {- @apply text-sm font-bold !important;-}-._toastItem {- @apply w-full border-l-2 border-green-600 !important;-}-._toastBtn {- @apply text-xs !important;-}-._toastBtn:hover {- @apply bg-gray-500 !important;-}-.icon {- @apply text-white rounded p-2 transition duration-100;-}-.icon:hover {- @apply bg-warmGray-700;-}-input {- @apply text-sm rounded py-2 px-6 font-bold bg-warmGray-800 text-white transition duration-150 outline-none border border-transparent !important;-}-input:hover,-input:focus-visible,-input:focus {- @apply bg-warmGray-700 !important;-}-textarea {- @apply text-sm rounded py-2 px-6 font-bold bg-warmGray-800 text-white transition duration-150 outline-none resize-none !important;-}-textarea:hover {- @apply bg-warmGray-700 !important;-}-select {- @apply text-sm rounded py-2 px-6 font-bold bg-warmGray-800 text-white transition duration-150 outline-none !important;-}-select:hover {- @apply bg-warmGray-700 !important;-}--label {- @apply text-left text-base font-bold text-warmGray-400 !important;-}-button {- @apply outline-none !important;-}-.button {- @apply rounded text-sm font-bold transition-all duration-100 !important;-}--.button:focus-visible,-.button:focus {- @apply bg-warmGray-700 !important;-}-.h-271 {- min-height: 271px !important;-}-.repository-select-search .listItem .item,-.repository-select-search .empty {- @apply text-sm py-3 font-bold bg-warmGray-800 text-white cursor-pointer border-none hover:bg-warmGray-700 !important;-}--.repository-select-search .listContainer {- @apply bg-transparent !important;-}--.repository-select-search .clearSelect {- @apply text-white cursor-pointer !important;-}--.repository-select-search .selectedItem {- @apply text-white relative cursor-pointer font-bold text-sm flex items-center !important;-}-.selectContainer {- background: transparent !important;- @apply border-0 !important;-}diff --git a/src/components/Application/ActiveTab/General.svelte b/src/components/Application/ActiveTab/General.sveltedeleted file mode 100644index fe3f5b79a3..0000000000--- a/src/components/Application/ActiveTab/General.svelte+++ /dev/null@@ -1,610 +0,0 @@-<script>- import { VITE_GITHUB_APP_NAME } from '$lib/consts';- import { application, isPullRequestPermissionsGranted, originalDomain } from '$store';- import { onMount } from 'svelte';- import TooltipInfo from '$components/TooltipInfo.svelte';- import { request } from '$lib/request';- import { page, session } from '$app/stores';- import { browser } from '$app/env';-- let domainInput;- let loading = {- previewDeployment: false- };- let howToActivate = false;- const buildpacks = {- static: {- port: {- active: false,- number: 80- },- build: true,- start: false- },- nodejs: {- port: {- active: true,- number: 3000- },- build: true,- start: true- },- nestjs: {- port: {- active: true,- number: 3000- },- build: true,- start: true- },- vuejs: {- port: {- active: false,- number: 80- },- build: true,- start: false- },- nuxtjs: {- port: {- active: true,- number: 3000- },- build: true,- start: true- },- react: {- port: {- active: false,- number: 80- },- build: true,- start: false- },- nextjs: {- port: {- active: true,- number: 3000- },- build: true,- start: true- },- gatsby: {- port: {- active: true,- number: 3000- },- build: true,- start: false- },- svelte: {- port: {- active: false,- number: 80- },- build: true,- start: false- },- php: {- port: {- active: false,- number: 80- },- build: false,- start: false- },- rust: {- port: {- active: true,- number: 3000- },- build: false,- start: false- },- docker: {- port: {- active: true,- number: 3000- },- build: false,- start: false- },- python: {- port: {- active: true,- number: 4000- },- build: false,- start: false,- custom: true- }- };- async function setPreviewDeployment() {- if ($application.general.isPreviewDeploymentEnabled) {- const result = window.confirm(- "DANGER ZONE! It will delete all PR deployments. It's NOT reversible! Are you sure?"- );- if (result) {- loading.previewDeployment = true;- $application.general.isPreviewDeploymentEnabled =- !$application.general.isPreviewDeploymentEnabled;- if ($page.path !== '/application/new') {- const config = await request(`/api/v1/application/config/previewDeployment`, $session, {- body: {- name: $application.repository.name,- organization: $application.repository.organization,- branch: $application.repository.branch,- isPreviewDeploymentEnabled: $application.general.isPreviewDeploymentEnabled- }- });- }- loading.previewDeployment = false;- }- } else {- loading.previewDeployment = true;- $application.general.isPreviewDeploymentEnabled =- !$application.general.isPreviewDeploymentEnabled;- $application.general.pullRequest = 0;- if ($page.path !== '/application/new') {- const config = await request(`/api/v1/application/config/previewDeployment`, $session, {- body: {- name: $application.repository.name,- organization: $application.repository.organization,- branch: $application.repository.branch,- isPreviewDeploymentEnabled: $application.general.isPreviewDeploymentEnabled- }- });- }- loading.previewDeployment = false;- }- }- function selectBuildPack(event) {- if (event.target.innerText === 'React/Preact') {- $application.build.pack = 'react';- } else {- $application.build.pack = event.target.innerText.replace(/\./g, '').toLowerCase();- }- }- async function openGithub() {- if (browser) {- const config = await request(`https://api.github.com/apps/${VITE_GITHUB_APP_NAME}`, $session);-- let url = `https://github.com/settings/apps/${VITE_GITHUB_APP_NAME}/permissions`;- if (config.owner.type === 'Organization') {- url = `https://github.com/organizations/${config.owner.login}/settings/apps/${VITE_GITHUB_APP_NAME}/permissions`;- }-- const left = screen.width / 2 - 1020 / 2;- const top = screen.height / 2 - 618 / 2;- const newWindow = open(- url,- 'Permission Update',- 'resizable=1, scrollbars=1, fullscreen=1, height=1000, width=1220,top=' +- top +- ', left=' +- left +- ', toolbar=0, menubar=0, status=0'- );- const timer = setInterval(async () => {- if (newWindow?.closed) {- clearInterval(timer);- location.reload();- }- }, 100);- }- }- onMount(() => {- if (!$application.publish.domain) {- domainInput.focus();- } else {- $originalDomain = $application.publish.domain;- }- });-</script>--<div>- <div class="grid grid-cols-1 text-sm max-w-4xl md:mx-auto mx-6 pb-16 auto-cols-max ">- <div class="text-2xl font-bold border-gradient w-40">Build Packs</div>- <div class="flex font-bold flex-wrap justify-center pt-10">- <div- class={$application.build.pack === 'static'- ? 'buildpack bg-red-500'- : 'buildpack hover:border-red-500'}- on:click={selectBuildPack}- >- Static- </div>- <div- class={$application.build.pack === 'nodejs'- ? 'buildpack bg-emerald-600'- : 'buildpack hover:border-emerald-600'}- on:click={selectBuildPack}- >- NodeJS- </div>- <div- class={$application.build.pack === 'vuejs'- ? 'buildpack bg-green-500'- : 'buildpack hover:border-green-500'}- on:click={selectBuildPack}- >- VueJS- </div>- <div- class={$application.build.pack === 'nuxtjs'- ? 'buildpack bg-green-500'- : 'buildpack hover:border-green-500'}- on:click={selectBuildPack}- >- NuxtJS- </div>- <div- class={$application.build.pack === 'react'- ? 'buildpack bg-gradient-to-r from-blue-500 to-purple-500'- : 'buildpack hover:border-blue-500'}- on:click={selectBuildPack}- >- React/Preact- </div>- <div- class={$application.build.pack === 'nextjs'- ? 'buildpack bg-blue-500'- : 'buildpack hover:border-blue-500'}- on:click={selectBuildPack}- >- NextJS- </div>- <div- class={$application.build.pack === 'gatsby'- ? 'buildpack bg-blue-500'- : 'buildpack hover:border-blue-500'}- on:click={selectBuildPack}- >- Gatsby- </div>- <div- class={$application.build.pack === 'svelte'- ? 'buildpack bg-orange-600'- : 'buildpack hover:border-orange-600'}- on:click={selectBuildPack}- >- Svelte- </div>- <div- class={$application.build.pack === 'php'- ? 'buildpack bg-indigo-500'- : 'buildpack hover:border-indigo-500'}- on:click={selectBuildPack}- >- PHP- </div>- <div- class={$application.build.pack === 'rust'- ? 'buildpack bg-pink-500'- : 'buildpack hover:border-pink-500'}- on:click={selectBuildPack}- >- Rust- </div>- <div- class={$application.build.pack === 'nestjs'- ? 'buildpack bg-red-500'- : 'buildpack hover:border-red-500'}- on:click={selectBuildPack}- >- NestJS- </div>- <div- class={$application.build.pack === 'docker'- ? 'buildpack bg-purple-500'- : 'buildpack hover:border-purple-500'}- on:click={selectBuildPack}- >- Docker- </div>- <div- class={$application.build.pack === 'python'- ? 'buildpack bg-green-500'- : 'buildpack hover:border-green-500'}- on:click={selectBuildPack}- >- Python- </div>- </div>- </div>- <div class="text-2xl font-bold border-gradient w-52">General settings</div>- <div class="grid grid-cols-1 max-w-2xl md:mx-auto mx-6 justify-center items-center pt-10">- <div>- <ul class="divide-y divide-warmGray-800">- <li class="pb-6 flex items-center justify-between">- <div class="flex flex-col">- <p class="text-base font-bold text-warmGray-100">Preview deployments</p>- <p class="text-sm font-medium text-warmGray-400">- PR's will be deployed so you could review them easily- </p>- </div>-- {#if $isPullRequestPermissionsGranted}- <div- class="relative"- class:animate-wiggle={loading.previewDeployment}- class:opacity-25={loading.previewDeployment}- >- <button- type="button"- disabled={loading.previewDeployment}- on:click={setPreviewDeployment}- aria-pressed="false"- class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200"- class:bg-green-600={$application.general.isPreviewDeploymentEnabled}- class:bg-warmGray-700={!$application.general.isPreviewDeploymentEnabled}- class:cursor-not-allowed={loading.previewDeployment}- >- <span class="sr-only">Use setting</span>- <span- class="pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white shadow transition ease-in-out duration-200 transform"- class:translate-x-5={$application.general.isPreviewDeploymentEnabled}- class:translate-x-0={!$application.general.isPreviewDeploymentEnabled}- >- <span- class=" ease-in duration-200 absolute inset-0 h-full w-full flex items-center justify-center transition-opacity"- class:opacity-0={$application.general.isPreviewDeploymentEnabled}- class:opacity-100={!$application.general.isPreviewDeploymentEnabled}- aria-hidden="true"- >- <svg class="bg-white h-3 w-3 text-red-600" fill="none" viewBox="0 0 12 12">- <path- d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- />- </svg>- </span>- <span- class="ease-out duration-100 absolute inset-0 h-full w-full flex items-center justify-center transition-opacity"- aria-hidden="true"- class:opacity-100={$application.general.isPreviewDeploymentEnabled}- class:opacity-0={!$application.general.isPreviewDeploymentEnabled}- >- <svg- class="bg-white h-3 w-3 text-green-600"- fill="currentColor"- viewBox="0 0 12 12"- >- <path- d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"- />- </svg>- </span>- </span>- </button>- {#if loading.previewDeployment}- <div class="absolute left-0 bottom-0 -mb-4 -ml-2 text-xs font-bold">- {$application.general.isPreviewDeploymentEnabled ? 'Enabling...' : 'Disabling...'}- </div>- {/if}- </div>- {:else}- <div class="relative">- {#if !howToActivate}- <button- class="button py-2 px-2 bg-warmGray-800 hover:bg-warmGray-700 text-white"- on:click={() => (howToActivate = !howToActivate)}>How to active this?</button- >- {:else}- <button- class="button py-2 px-2 bg-green-600 hover:bg-green-500 text-white"- on:click={openGithub}>Open Github</button- >- {/if}- {#if howToActivate}- <div class="absolute right-0 w-64 z-10">- <div class="bg-warmGray-800 p-4 my-2 rounded text-white">- <div- class="absolute right-0 top-0 p-2 my-3 mx-1 text-xs font-bold cursor-pointer hover:bg-warmGray-700"- on:click={() => (howToActivate = false)}- >- X- </div>- <p class="text-sm font-medium text-warmGray-400">- You need to add <span class="text-white">two new permissions</span> to your GitHub- App:- </p>- <br />- <p class="text-sm font-medium text-warmGray-400">- 1. In <span class="text-white">Repository permissions</span>, add- <span class="text-white">Read-only</span>- access to <span class="text-white">Pull requests</span>.- </p>- <br />- <p class="text-sm font-medium text-warmGray-400">- 2. In <span class="text-white">Subscribe to events</span> section,- <span class="text-white"> check Pull request</span> field.- </p>- <br />- <p class="text-sm font-medium text-warmGray-400">- 3. You <span class="text-white">receive an email</span> where you need to- <span class="text-white">accept the new permissions</span>.- </p>- </div>- </div>- {/if}- </div>- {/if}- </li>- </ul>- </div>-- <div class="grid grid-flow-col gap-2 items-center pb-6">- <div class="grid grid-flow-row">- <label for="Domain" class="">Domain</label>- <input- bind:this={domainInput}- class="border-2"- disabled={$page.path !== '/application/new'}- class:cursor-not-allowed={$page.path !== '/application/new'}- class:bg-warmGray-900={$page.path !== '/application/new'}- class:hover:bg-warmGray-900={$page.path !== '/application/new'}- class:placeholder-red-500={$application.publish.domain == null ||- $application.publish.domain == ''}- class:border-red-500={$application.publish.domain == null ||- $application.publish.domain == ''}- id="Domain"- bind:value={$application.publish.domain}- placeholder="eg: coollabs.io (without www)"- />- </div>- <div class="grid grid-flow-row">- <label for="Path"- >Path <TooltipInfo- label={`Path to deploy your application on your domain. eg: /api means it will be deployed to -> https://${- $application.publish.domain || '<yourdomain>'- }/api`}- /></label- >- <input- id="Path"- bind:value={$application.publish.path}- disabled={$page.path !== '/application/new'}- class:cursor-not-allowed={$page.path !== '/application/new'}- class:bg-warmGray-900={$page.path !== '/application/new'}- class:hover:bg-warmGray-900={$page.path !== '/application/new'}- placeholder="/"- />- </div>- </div>- <label for="Port" class:text-warmGray-800={!buildpacks[$application.build.pack].port.active}- >Port</label- >- <input- disabled={!buildpacks[$application.build.pack].port.active}- id="Port"- class:bg-warmGray-900={!buildpacks[$application.build.pack].port.active}- class:text-warmGray-900={!buildpacks[$application.build.pack].port.active}- class:placeholder-warmGray-800={!buildpacks[$application.build.pack].port.active}- class:hover:bg-warmGray-900={!buildpacks[$application.build.pack].port.active}- class:cursor-not-allowed={!buildpacks[$application.build.pack].port.active}- bind:value={$application.publish.port}- placeholder={buildpacks[$application.build.pack].port.number}- />- <div class="grid grid-flow-col gap-2 items-center pt-6 pb-12">- <div class="grid grid-flow-row">- <label for="baseDir"- >Base Directory <TooltipInfo- label="The directory to use as base for every command (could be useful if you have a monorepo)."- /></label- >- <input id="baseDir" bind:value={$application.build.directory} placeholder="eg: sourcedir" />- </div>- <div class="grid grid-flow-row">- <label for="publishDir"- >Publish Directory <TooltipInfo- label="The directory to deploy after running the build command. eg: dist, _site, public."- /></label- >- <input- id="publishDir"- bind:value={$application.publish.directory}- placeholder="eg: dist, _site, public"- />- </div>- </div>- </div>- <div class="text-2xl font-bold w-40 border-gradient">Commands</div>- <div class=" max-w-2xl md:mx-auto mx-6 justify-center items-center pt-10 pb-32">- <div class="grid grid-flow-col gap-2 items-center">- <div class="grid grid-flow-row">- {#if $application.build.pack === 'python'}- <label for="ModulePackageName"- >Module/Package Name<TooltipInfo- label="The module/package name to start (eg: the entry filename [main], without the py extension. See gunicorn.org for more details)"- />- </label>-- <input- class="mb-6"- id="ModulePackageName"- bind:value={$application.build.command.python.module}- placeholder="main"- />- <label for="ApplicationInstance"- >Application Instance<TooltipInfo- label="The instance name (the main function name. See gunicorn.org for more details)"- />- </label>-- <input- class="mb-6"- id="ApplicationInstance"- bind:value={$application.build.command.python.instance}- placeholder="app"- />- {:else}- <label- for="installCommand"- class:text-warmGray-800={!buildpacks[$application.build.pack].build}- >Install Command <TooltipInfo- label="Command to run for installing dependencies. eg: yarn install"- />- </label>-- <input- class="mb-6"- class:bg-warmGray-900={!buildpacks[$application.build.pack].build}- class:text-warmGray-900={!buildpacks[$application.build.pack].build}- class:placeholder-warmGray-800={!buildpacks[$application.build.pack].build}- class:hover:bg-warmGray-900={!buildpacks[$application.build.pack].build}- class:cursor-not-allowed={!buildpacks[$application.build.pack].build}- id="installCommand"- bind:value={$application.build.command.installation}- placeholder="eg: yarn install"- />- <label- for="buildCommand"- class:text-warmGray-800={!buildpacks[$application.build.pack].build}- >Build Command <TooltipInfo- label="Command to run for building your application. If empty, no build phase initiated in the deploy process."- /></label- >- <input- class="mb-6"- class:bg-warmGray-900={!buildpacks[$application.build.pack].build}- class:text-warmGray-900={!buildpacks[$application.build.pack].build}- class:placeholder-warmGray-800={!buildpacks[$application.build.pack].build}- class:hover:bg-warmGray-900={!buildpacks[$application.build.pack].build}- class:cursor-not-allowed={!buildpacks[$application.build.pack].build}- id="buildCommand"- bind:value={$application.build.command.build}- placeholder="eg: yarn build"- />- <label- for="startCommand"- class:text-warmGray-800={!buildpacks[$application.build.pack].start}- >Start Command <TooltipInfo- label="Command to start the application. eg: yarn start"- /></label- >- <input- class="mb-6"- class:bg-warmGray-900={!buildpacks[$application.build.pack].start}- class:text-warmGray-900={!buildpacks[$application.build.pack].start}- class:placeholder-warmGray-800={!buildpacks[$application.build.pack].start}- class:hover:bg-warmGray-900={!buildpacks[$application.build.pack].start}- class:cursor-not-allowed={!buildpacks[$application.build.pack].start}- id="startcommand"- bind:value={$application.build.command.start}- placeholder="eg: yarn start"- />- {/if}- </div>- </div>- </div>-</div>--<style lang="postcss">- .buildpack {- @apply px-6 py-2 mx-2 my-2 bg-warmGray-800 w-48 ease-in-out hover:scale-105 text-center rounded border-2 border-transparent border-dashed cursor-pointer transition duration-100;- }-</style>diff --git a/src/components/Application/ActiveTab/PullRequests.svelte b/src/components/Application/ActiveTab/PullRequests.sveltedeleted file mode 100644index 1ee1761330..0000000000--- a/src/components/Application/ActiveTab/PullRequests.svelte+++ /dev/null@@ -1,102 +0,0 @@-<script>- import { browser } from '$app/env';- import { goto } from '$app/navigation';- import { onDestroy, onMount } from 'svelte';- import { session } from '$app/stores';- import { request } from '$lib/request';- import { toast } from '@zerodevx/svelte-toast';- import { application, prApplication } from '$store';- let loadPRDeployments = null;- onMount(async () => {- await getPRDeployments();- loadPRDeployments = setInterval(async () => {- await getPRDeployments();- }, 1000);- });- onDestroy(() => {- clearInterval(loadPRDeployments);- });- async function getPRDeployments() {- const { configuration } = await request(`/api/v1/application/config`, $session, {- body: {- nickname: $application.general.nickname- }- });- $prApplication = configuration.filter((c) => c.general.pullRequest !== 0);- }- async function removePR(prConfiguration) {- const result = window.confirm("DANGER ZONE! It's NOT reversible! Are you sure?");- if (result) {- await request(`/api/v1/application/remove`, $session, {- body: {- nickname: prConfiguration.general.nickname- }- });-- browser && toast.push('PR deployment removed.');- const { configuration } = await request(`/api/v1/application/config`, $session, {- body: {- nickname: prConfiguration.general.nickname- }- });- $prApplication = configuration.filter((c) => c.general.pullRequest !== 0);- }- }-</script>--<div class="text-2xl font-bold border-gradient w-48">Pull Requests</div>-<div class="text-center pt-4">- {#if $prApplication.length > 0}- <div class="py-4 ">- {#each $prApplication as pr}- <div class="flex space-x-4 justify-center items-center">- <div class="text-left font-bold tracking-tight ">- {pr.publish.domain}- </div>- <a- target="_blank"- class="icon mx-2 "- href={'https://' + pr.publish.domain + pr.publish.path}- >- <svg- xmlns="http://www.w3.org/2000/svg"- class="h-5 w-5"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"- />- </svg></a- >- <!-- <div class="flex-1" /> -->- <button- class="icon hover:text-red-500 hover:bg-warmGray-800"- on:click={() => removePR(pr)}- >- <svg- xmlns="http://www.w3.org/2000/svg"- class="h-5 w-5"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"- />- </svg>- </button>- </div>- {/each}- </div>- {:else}- <div class="font-bold text-center">No PR deployments found</div>- {/if}-</div>diff --git a/src/components/Application/ActiveTab/Secrets.svelte b/src/components/Application/ActiveTab/Secrets.sveltedeleted file mode 100644index 5415144543..0000000000--- a/src/components/Application/ActiveTab/Secrets.svelte+++ /dev/null@@ -1,128 +0,0 @@-<script>- import { application } from '$store';- import BuildEnv from '../BuildEnv.svelte';-- let secret = {- name: null,- value: null,- isBuild: false- };- let foundSecret = null;- async function saveSecret() {- if (secret.name && secret.value) {- const found = $application.publish.secrets.find((s) => s.name === secret.name);- if (!found) {- $application.publish.secrets = [- ...$application.publish.secrets,- {- name: secret.name,- value: secret.value,- isBuild: secret.isBuild- }- ];- secret = {- name: null,- value: null,- isBuild: false- };- } else {- foundSecret = found;- }- }- }-- async function removeSecret(name) {- foundSecret = null;- $application.publish.secrets = [...$application.publish.secrets.filter((s) => s.name !== name)];- }-</script>--<div class="text-2xl font-bold border-gradient w-24">Secrets</div>-<div class="max-w-3xl mx-auto text-center pt-4">- <div class="flex space-x-4">- <div class="grid grid-flow-row">- <label for="secretName">Secret Name</label>- <input- id="secretName"- bind:value={secret.name}- placeholder="Name"- class="w-64 border-2 border-transparent"- />- </div>- <div class="grid grid-flow-row">- <label for="secretValue">Secret Value</label>- <input- id="secretValue"- bind:value={secret.value}- placeholder="Value"- class="w-64 border-2 border-transparent"- />- </div>-- <div class="grid grid-flow-row">- <label for="buildVariable">Is build variable?</label>- <div class="mt-2 w-full">- <BuildEnv {secret} />- </div>- </div>- <div class="mt-6">- <button class="icon hover:text-green-500" on:click={saveSecret}>- <svg- xmlns="http://www.w3.org/2000/svg"- class="h-6 w-6"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M12 6v6m0 0v6m0-6h6m-6 0H6"- />- </svg>- </button>- </div>- </div>-- {#if $application.publish.secrets.length > 0}- <div class="pt-1">- {#each $application.publish.secrets as secret}- <div class="flex space-x-4 space-y-2">- <input- id={secret.name}- value={secret.name}- disabled- class="border-2 bg-transparent border-transparent w-64 hover:bg-transparent"- class:border-red-600={foundSecret && foundSecret.name === secret.name}- />- <input- id={secret.createdAt}- value="SAVED"- disabled- class="border-2 bg-transparent border-transparent w-64 hover:bg-transparent"- />- <div class="flex justify-center items-center px-12">- <BuildEnv {secret} readOnly />- </div>- <button class="icon hover:text-red-500" on:click={() => removeSecret(secret.name)}>- <svg- xmlns="http://www.w3.org/2000/svg"- class="h-6 w-6"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"- />- </svg>- </button>- </div>- {/each}- </div>- {/if}-</div>diff --git a/src/components/Application/Branches.svelte b/src/components/Application/Branches.sveltedeleted file mode 100644index feb25d790d..0000000000--- a/src/components/Application/Branches.svelte+++ /dev/null@@ -1,46 +0,0 @@-<script>- import { page } from '$app/stores';-- export let loading, branches;- import { application } from '$store';- import Select from 'svelte-select';-- const selectedValue = $page.path !== '/application/new' && $application.repository.branch;-- function handleSelect(event) {- $application.repository.branch = null;- setTimeout(() => {- $application.repository.branch = event.detail.value;- }, 1);- }-</script>--{#if loading}- <div class="grid grid-cols-1">- <label for="branch">Branch</label>- <div class="repository-select-search col-span-2">- <Select- containerClasses="w-full border-none bg-transparent"- placeholder="Loading branches..."- isDisabled- />- </div>- </div>-{:else}- <div class="grid grid-cols-1">- <label for="branch">Branch</label>- <div class="repository-select-search col-span-2">- <Select- containerClasses="w-full border-none bg-transparent"- on:select={handleSelect}- {selectedValue}- isClearable={false}- items={branches.map((b) => ({ label: b.name, value: b.name }))}- showIndicator={$page.path === '/application/new'}- noOptionsMessage="No branches found"- placeholder="Select a branch"- isDisabled={$page.path !== '/application/new'}- />- </div>- </div>-{/if}diff --git a/src/components/Application/BuildEnv.svelte b/src/components/Application/BuildEnv.sveltedeleted file mode 100644index 1214140700..0000000000--- a/src/components/Application/BuildEnv.svelte+++ /dev/null@@ -1,55 +0,0 @@-<script>- export let secret;- export let readOnly = false;- function isBuildSet() {- if (!readOnly) secret.isBuild = !secret.isBuild;- }-</script>--<button- id="buildVariable"- type="button"- aria-pressed="false"- on:click={isBuildSet}- class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-100"- class:bg-green-600={secret.isBuild}- class:bg-warmGray-700={!secret.isBuild}- class:opacity-50={readOnly}- class:cursor-not-allowed={readOnly}->- <span class="sr-only">Use setting</span>- <span- class="pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white shadow transition ease-in-out duration-200 transform"- class:translate-x-5={secret.isBuild}- class:translate-x-0={!secret.isBuild}- >- <span- class=" ease-in duration-200 absolute inset-0 h-full w-full flex items-center justify-center transition-opacity"- class:opacity-0={secret.isBuild}- class:opacity-100={!secret.isBuild}- aria-hidden="true"- >- <svg class="bg-white h-3 w-3 text-red-600" fill="none" viewBox="0 0 12 12">- <path- d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- />- </svg>- </span>- <span- class="ease-out duration-100 absolute inset-0 h-full w-full flex items-center justify-center transition-opacity"- aria-hidden="true"- class:opacity-100={secret.isBuild}- class:opacity-0={!secret.isBuild}- >- <svg class="bg-white h-3 w-3 text-green-600" fill="currentColor" viewBox="0 0 12 12">- <path- d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"- />- </svg>- </span>- </span>-</button>diff --git a/src/components/Application/Configuration.svelte b/src/components/Application/Configuration.sveltedeleted file mode 100644index 60ecd62009..0000000000--- a/src/components/Application/Configuration.svelte+++ /dev/null@@ -1,198 +0,0 @@-<script lang="ts">- import { goto } from '$app/navigation';- import { request } from '$lib/request';- import { session } from '$app/stores';- import {- githubRepositories,- application,- githubInstallations,- prApplication,- initConf,- isPullRequestPermissionsGranted- } from '$store';-- import { fade } from 'svelte/transition';- import Loading from '$components/Loading.svelte';-- import { browser } from '$app/env';- import Branches from '$components/Application/Branches.svelte';- import Tabs from '$components/Application/Tabs.svelte';- import Repositories from '$components/Application/Repositories.svelte';- import Login from '$components/Application/Login.svelte';-import { dashify } from '$lib/common';- let loading = {- github: false,- branches: false- };- let branches = [];- let relogin = false;- let permissions = {};-- async function getGithubRepos(id, page) {- return await request(- `https://api.github.com/user/installations/${id}/repositories?per_page=100&page=${page}`,- $session- );- }- async function loadGithubRepositories(force) {- if ($githubRepositories.length > 0 && !force) {- $application.github.installation.id = $githubInstallations.id;- $application.github.app.id = $githubInstallations.app_id;- const foundRepositoryOnGithub = $githubRepositories.find(- (r) =>- r.full_name === `${$application.repository.organization}/${$application.repository.name}`- );-- if (foundRepositoryOnGithub) {- $application.repository.id = foundRepositoryOnGithub.id;- $application.repository.organization = foundRepositoryOnGithub.owner.login;- $application.repository.name = foundRepositoryOnGithub.name;- }- return;- } else {- loading.github = true;- let installations = [];- try {- const data = await request('https://api.github.com/user/installations', $session);- installations = data.installations;- } catch (error) {- relogin = true;- console.log(error);- return false;- }- if (installations.length === 0) {- loading.github = false;- return false;- }- $application.github.installation.id = installations[0].id;- $application.github.app.id = installations[0].app_id;- $githubInstallations = installations[0];-- try {- let page = 1;- let userRepos = 0;- const data = await getGithubRepos($application.github.installation.id, page);- $githubRepositories = $githubRepositories.concat(data.repositories);- userRepos = data.total_count;- if (userRepos > $githubRepositories.length) {- while (userRepos > $githubRepositories.length) {- page = page + 1;- const repos = await getGithubRepos($application.github.installation.id, page);- $githubRepositories = $githubRepositories.concat(repos.repositories);- }- }- const foundRepositoryOnGithub = $githubRepositories.find(- (r) =>- r.full_name ===- `${$application.repository.organization}/${$application.repository.name}`- );- if (foundRepositoryOnGithub) {- $application.repository.id = foundRepositoryOnGithub.id;- await loadBranches();- }- } catch (error) {- return false;- } finally {- loading.github = false;- }- }- }- async function loadBranches() {- loading.branches = true;- const selectedRepository = $githubRepositories.find((r) => r.id === $application.repository.id);-- if (selectedRepository) {- $application.repository.organization = selectedRepository.owner.login;- $application.repository.name = selectedRepository.name;- }-- branches = await request(- `https://api.github.com/repos/${$application.repository.organization}/${$application.repository.name}/branches`,- $session- );- loading.branches = false;- await loadPermissions();- }- async function loadPermissions() {- const config = await request(- `https://api.github.com/apps/${dashify(import.meta.env.VITE_GITHUB_APP_NAME)}`,- $session- );- if (config.permissions['pull_requests'] && config.events.includes('pull_request')) {- $isPullRequestPermissionsGranted = true;- }- }- async function modifyGithubAppConfig() {- if (browser) {- const left = screen.width / 2 - 1020 / 2;- const top = screen.height / 2 - 618 / 2;- const newWindow = open(- `https://github.com/apps/${dashify(- import.meta.env.VITE_GITHUB_APP_NAME- )}/installations/new`,- 'Install App',- 'resizable=1, scrollbars=1, fullscreen=0, height=1000, width=1020,top=' +- top +- ', left=' +- left +- ', toolbar=0, menubar=0, status=0'- );- const timer = setInterval(async () => {- if (newWindow?.closed) {- clearInterval(timer);- loading.github = true;-- if ($application.repository.name) {- try {- const { configuration } = await request(`/api/v1/application/config`, $session, {- body: {- name: $application.repository.name,- organization: $application.repository.organization,- branch: $application.repository.branch- }- });-- $prApplication = configuration.filter((c) => c.general.pullRequest !== 0);- $application = configuration.find((c) => c.general.pullRequest === 0);- $initConf = JSON.parse(JSON.stringify($application));- } catch (error) {- browser && goto('/dashboard/applications', { replaceState: true });- }- }-- branches = [];- $githubRepositories = [];- await loadGithubRepositories(true);- }- }, 100);- }- }-</script>--<div in:fade={{ duration: 100 }}>- {#if relogin}- <Login />- {:else}- {#await loadGithubRepositories(false)}- <Loading github githubLoadingText="Loading repositories..." />- {:then}- {#if loading.github}- <Loading github githubLoadingText="Loading repositories..." />- {:else}- <div class="space-y-2 max-w-4xl mx-auto px-6" in:fade={{ duration: 100 }}>- <Repositories- on:loadBranches={loadBranches}- on:modifyGithubAppConfig={modifyGithubAppConfig}- />- {#if $application.repository.organization}- <Branches loading={loading.branches} {branches} />- {/if}-- {#if $application.repository.branch}- <Tabs />- {/if}- </div>- {/if}- {/await}- {/if}-</div>diff --git a/src/components/Application/Login.svelte b/src/components/Application/Login.sveltedeleted file mode 100644index c5089ffd0e..0000000000--- a/src/components/Application/Login.svelte+++ /dev/null@@ -1,42 +0,0 @@-<script>- function login() {- const left = screen.width / 2 - 1020 / 2;- const top = screen.height / 2 - 618 / 2;- const newWindow = open(- `https://github.com/login/oauth/authorize?client_id=${- import.meta.env.VITE_GITHUB_APP_CLIENTID- }`,- 'Authenticate',- 'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' +- top +- ', left=' +- left +- ', toolbar=0, menubar=0, status=0'- );- const timer = setInterval(() => {- if (newWindow?.closed) {- clearInterval(timer);- location.reload()- }- }, 100);- }-</script>--<div class="text-center text-white">- <div class="text-2xl font-bold text-center pb-4">Choose your Git provider</div>- <button on:click={login} class="hover:scale-110 duration-100 transition">- <svg- class="w-16"- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- ><path- d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"- /></svg- >- </button>-</div>diff --git a/src/components/Application/Navbar.svelte b/src/components/Application/Navbar.sveltedeleted file mode 100644index 5ddc6e1962..0000000000--- a/src/components/Application/Navbar.svelte+++ /dev/null@@ -1,173 +0,0 @@-<script>- import { application, initialApplication, initConf, originalDomain } from '$store';- import { onDestroy } from 'svelte';- import { toast } from '@zerodevx/svelte-toast';- import Tooltip from '$components/Tooltip.svelte';- import { request } from '$lib/request';- import { page, session } from '$app/stores';- import { goto } from '$app/navigation';- import { browser } from '$app/env';- async function removeApplication() {- const result = window.confirm(- "DANGER ZONE! It will delete all deployments, including PR's. It's NOT reversible! Are you sure?"- );- if (result) {- await request(`/api/v1/application/remove`, $session, {- body: {- nickname: $application.general.nickname- }- });-- browser && toast.push('Application removed.');- $application = JSON.parse(JSON.stringify(initialApplication));- browser && goto(`/dashboard/applications`, { replaceState: true });- }- }-- onDestroy(() => {- $application = JSON.parse(JSON.stringify(initialApplication));- });-- async function deploy() {- try {- browser && toast.push('Checking configuration.');- await request(`/api/v1/application/check`, $session, {- body: $application- });- const { nickname, name, deployId } = await request(`/api/v1/application/deploy`, $session, {- body: $application- });- $application.general.nickname = nickname;- $application.build.container.name = name;- $application.general.deployId = deployId;- $initConf = JSON.parse(JSON.stringify($application));- if (browser) {- toast.push('Application deployment queued.');- goto(`/application/${$application.general.nickname}/logs/${$application.general.deployId}`, {- replaceState: true- });- }- } catch (error) {- // browser && toast.push(error.error || error || 'Ooops something went wrong.');- }- }-</script>--<nav class="flex text-white justify-end items-center m-4 fixed right-0 top-0 space-x-4 z-50">- <Tooltip position="bottom" label="Deploy">- <button- disabled={$application.publish.domain === '' || $application.publish.domain === null}- class:cursor-not-allowed={$application.publish.domain === '' ||- $application.publish.domain === null}- class:hover:bg-green-500={$application.publish.domain}- class:bg-green-600={$application.publish.domain}- class:hover:bg-transparent={!$application.publish.domain && $page.path === '/application/new'}- class:text-warmGray-700={$application.publish.domain === '' ||- $application.publish.domain === null}- class="icon"- on:click={deploy}- >- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- ><polyline points="16 16 12 12 8 16" /><line x1="12" y1="12" x2="12" y2="21" /><path- d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"- /><polyline points="16 16 12 12 8 16" /></svg- >- </button>- </Tooltip>- <Tooltip position="bottom" label="Delete">- <button- disabled={$application.publish.domain === '' ||- $application.publish.domain === null ||- $page.path === '/application/new'}- class:cursor-not-allowed={$application.publish.domain === '' ||- $application.publish.domain === null ||- $page.path === '/application/new'}- class:hover:text-red-500={$application.publish.domain && $page.path !== '/application/new'}- class:hover:bg-warmGray-700={$application.publish.domain && $page.path !== '/application/new'}- class:hover:bg-transparent={$page.path === '/application/new'}- class:text-warmGray-700={$application.publish.domain === '' ||- $application.publish.domain === null ||- $page.path === '/application/new'}- class="icon"- on:click={removeApplication}- >- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"- />- </svg>- </button>- </Tooltip>- <div class="border border-warmGray-700 h-8" />- <Tooltip position="bottom" label="Logs">- <button- class="icon"- class:text-warmGray-700={$page.path === '/application/new'}- disabled={$page.path === '/application/new'}- class:hover:text-blue-400={$page.path !== '/application/new'}- class:hover:bg-transparent={$page.path === '/application/new'}- class:cursor-not-allowed={$page.path === '/application/new'}- class:text-blue-400={/logs\/*/.test($page.path)}- class:bg-warmGray-700={/logs\/*/.test($page.path)}- on:click={() => goto(`/application/${$application.general.nickname}/logs`)}- >- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"- />- </svg>- </button>- </Tooltip>- <Tooltip position="bottom-left" label="Configuration">- <button- class="icon hover:text-yellow-400"- disabled={$page.path === '/application/new'}- class:text-yellow-400={$page.path.endsWith('configuration') ||- $page.path === '/application/new'}- class:bg-warmGray-700={$page.path.endsWith('configuration') ||- $page.path === '/application/new'}- on:click={() => goto(`/application/${$application.general.nickname}/configuration`)}- >- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"- />- </svg>- </button>- </Tooltip>-</nav>diff --git a/src/components/Application/Repositories.svelte b/src/components/Application/Repositories.sveltedeleted file mode 100644index 4f8d4fd0a0..0000000000--- a/src/components/Application/Repositories.svelte+++ /dev/null@@ -1,54 +0,0 @@-<script>- import { createEventDispatcher } from 'svelte';- import { application, githubRepositories } from '$store';- import Select from 'svelte-select';- import { page } from '$app/stores';- function handleSelect(event) {- $application.build.pack = 'static';- $application.repository.id = parseInt(event.detail.value, 10);- $application.repository.branch = null- dispatch('loadBranches');- }- const path = $page.path === '/application/new';- let items = $githubRepositories.map((repo) => ({- label: `${repo.owner.login}/${repo.name}`,- value: repo.id.toString()- }));-- const selectedValue =- !path && `${$application.repository.organization}/${$application.repository.name}`;-- const dispatch = createEventDispatcher();- const modifyGithubAppConfig = () => dispatch('modifyGithubAppConfig');-</script>--<div class="grid grid-cols-1 pt-4">- {#if $githubRepositories.length !== 0}- <label for="repository">Organization / Repository</label>- <div class="grid grid-cols-3 ">- <div class="repository-select-search col-span-2">- <Select- isFocused="{true}"- containerClasses="w-full border-none bg-transparent"- on:select={handleSelect}- {selectedValue}- isClearable={false}- {items}- showIndicator={path}- noOptionsMessage="No Repositories found"- placeholder="Select a Repository"- isDisabled={!path}- />- </div>- <button- class="button col-span-1 ml-2 bg-warmGray-800 hover:bg-warmGray-700 text-white"- on:click={modifyGithubAppConfig}>Configure on Github</button- >- </div>- {:else}- <button- class="button col-span-1 ml-2 bg-warmGray-800 hover:bg-warmGray-700 text-white py-2"- on:click={modifyGithubAppConfig}>Add repositories on Github</button- >- {/if}-</div>diff --git a/src/components/Application/Tabs.svelte b/src/components/Application/Tabs.sveltedeleted file mode 100644index 8d1a77d308..0000000000--- a/src/components/Application/Tabs.svelte+++ /dev/null@@ -1,131 +0,0 @@-<script>- import { toast } from '@zerodevx/svelte-toast';- import templates from '$lib/api/applications/packs/templates';- import { application, dashboard, initConf, prApplication } from '$store';- import General from '$components/Application/ActiveTab/General.svelte';- import Secrets from '$components/Application/ActiveTab/Secrets.svelte';- import Loading from '$components/Loading.svelte';- import { goto } from '$app/navigation';- import { page, session } from '$app/stores';- import { request } from '$lib/request';- import { browser } from '$app/env';- import PullRequests from './ActiveTab/PullRequests.svelte';-- let activeTab = {- general: true,- secrets: false,- pullRequests: false- };- function activateTab(tab) {- if (activeTab.hasOwnProperty(tab)) {- activeTab = {- general: false,- pullRequests: false,- secrets: false- };- activeTab[tab] = true;- }- }- async function load() {- if ($page.path === '/application/new') {- try {- const dir = await request(- `https://api.github.com/repos/${$application.repository.organization}/${$application.repository.name}/contents/?ref=${$application.repository.branch}`,- $session- );- const packageJson = dir.find((f) => f.type === 'file' && f.name === 'package.json');- const Dockerfile = dir.find((f) => f.type === 'file' && f.name === 'Dockerfile');- const CargoToml = dir.find((f) => f.type === 'file' && f.name === 'Cargo.toml');- const requirementsTXT = dir.find((f) => f.type === 'file' && f.name === 'requirements.txt');- if (packageJson) {- const { content } = await request(packageJson.git_url, $session);- const packageJsonContent = JSON.parse(atob(content));- const checkPackageJSONContents = (dep) => {- return (- packageJsonContent?.dependencies?.hasOwnProperty(dep) ||- packageJsonContent?.devDependencies?.hasOwnProperty(dep)- );- };- Object.keys(templates).map((dep) => {- if (checkPackageJSONContents(dep)) {- const config = templates[dep];- $application.build.pack = config.pack;- if (config.installation) {- $application.build.command.installation = config.installation;- }- if (config.start) {- $application.build.command.start = config.start;- }- if (config.port) {- $application.publish.port = config.port;- }- if (config.directory) {- $application.publish.directory = config.directory;- }-- if (packageJsonContent.scripts.hasOwnProperty('build') && config.build) {- $application.build.command.build = config.build;- }- browser && toast.push(`${config.name} detected. Default values set.`);- }- });- } else if (CargoToml) {- $application.build.pack = 'rust';- browser && toast.push(`Rust language detected. Default values set.`);- } else if (requirementsTXT) {- $application.build.pack = 'python';- browser && toast.push('Python language detected. Default values set.');- } else if (Dockerfile) {- $application.build.pack = 'docker';- browser && toast.push('Custom Dockerfile found. Build pack set to docker.');- }- } catch (error) {- // Nothing detected- }- }- }--</script>--{#await load()}- <Loading github githubLoadingText="Scanning repository..." />-{:then}- <div class="block text-center py-8">- <nav class="flex space-x-4 justify-center font-bold text-md text-white" aria-label="Tabs">- <div- on:click={() => activateTab('general')}- class:text-green-500={activeTab.general}- class="px-3 py-2 cursor-pointer hover:bg-warmGray-700 rounded-lg transition duration-100"- >- General- </div>- <div- on:click={() => activateTab('secrets')}- class:text-green-500={activeTab.secrets}- class="px-3 py-2 cursor-pointer hover:bg-warmGray-700 rounded-lg transition duration-100"- >- Secrets- </div>- {#if $application.general.isPreviewDeploymentEnabled}- <div- on:click={() => activateTab('pullRequests')}- class:text-green-500={activeTab.pullRequests}- class="px-3 py-2 cursor-pointer hover:bg-warmGray-700 rounded-lg transition duration-100"- >- Pull Requests- </div>- {/if}- </nav>- </div>- <div class="max-w-4xl mx-auto">- <div class="h-full">- {#if activeTab.general}- <General />- {:else if activeTab.secrets}- <Secrets />- {:else if activeTab.pullRequests && $page.path !== '/application/new'}- <PullRequests />- {/if}- </div>- </div>-{/await}diff --git a/src/components/Database/Configuration.svelte b/src/components/Database/Configuration.sveltedeleted file mode 100644index 0a865e22b2..0000000000--- a/src/components/Database/Configuration.svelte+++ /dev/null@@ -1,136 +0,0 @@-<script>- import { fade } from 'svelte/transition';- import { toast } from '@zerodevx/svelte-toast';- import MongoDb from './SVGs/MongoDb.svelte';- import Postgresql from './SVGs/Postgresql.svelte';- import Mysql from './SVGs/Mysql.svelte';- import CouchDb from './SVGs/CouchDb.svelte';- import Redis from './SVGs/Redis.svelte';- import { page, session } from '$app/stores';- import { goto } from '$app/navigation';- import { request } from '$lib/request';- import { browser } from '$app/env';- import Loading from '$components/Loading.svelte';-- let type;- let defaultDatabaseName;- let loading = false;- async function deploy() {- try {- loading = true;- await request(`/api/v1/databases/deploy`, $session, {- body: {- type,- defaultDatabaseName- }- });-- if (browser) {- toast.push('Database deployment queued.');- goto(`/dashboard/databases`, { replaceState: true });- }- } catch (error) {- console.log(error);- } finally {- loading = false;- }- }--</script>--{#if loading}- <Loading />-{:else}- <div class="text-center space-y-2 max-w-4xl mx-auto px-6" in:fade={{ duration: 100 }}>- {#if $page.path === '/database/new'}- <div class="flex justify-center space-x-4 font-bold pb-6">- <div- class="text-center flex-col items-center cursor-pointer ease-in-out hover:scale-105 duration-100 border-2 border-dashed border-transparent hover:border-green-600 p-2 rounded bg-warmGray-800 w-32"- class:border-green-600={type === 'mongodb'}- on:click={() => (type = 'mongodb')}- >- <div class="flex items-center justify-center my-2">- <MongoDb customClass="w-6" />- </div>- <div class="text-white">MongoDB</div>- </div>- <div- class="text-center flex-col items-center cursor-pointer ease-in-out hover:scale-105 duration-100 border-2 border-dashed border-transparent hover:border-red-600 p-2 rounded bg-warmGray-800 w-32"- class:border-red-600={type === 'couchdb'}- on:click={() => (type = 'couchdb')}- >- <div class="flex items-center justify-center my-2">- <CouchDb customClass="w-12 text-red-600 fill-current" />- </div>- <div class="text-white">Couchdb</div>- </div>- <div- class="text-center flex-col items-center cursor-pointer ease-in-out hover:scale-105 duration-100 border-2 border-dashed border-transparent hover:border-blue-600 p-2 rounded bg-warmGray-800 w-32"- class:border-blue-600={type === 'postgresql'}- on:click={() => (type = 'postgresql')}- >- <div class="flex items-center justify-center my-2">- <Postgresql customClass="w-12" />- </div>- <div class="text-white">PostgreSQL</div>- </div>- <div- class="text-center flex-col items-center cursor-pointer ease-in-out hover:scale-105 duration-100 border-2 border-dashed border-transparent hover:border-orange-600 p-2 rounded bg-warmGray-800 w-32"- class:border-orange-600={type === 'mysql'}- on:click={() => (type = 'mysql')}- >- <div class="flex items-center justify-center">- <Mysql customClass="w-10" />- </div>- <div class="text-white">MySQL</div>- </div>- <div- class="text-center flex-col items-center cursor-pointer ease-in-out hover:scale-105 duration-100 border-2 border-dashed border-transparent hover:border-red-600 p-2 rounded bg-warmGray-800 w-32"- class:border-red-600={type === 'redis'}- on:click={() => (type = 'redis')}- >- <div class="flex items-center justify-center">- <Redis customClass="w-12" />- </div>- <div class="text-white">Redis</div>- </div>-- <!-- <button- class="button bg-gray-500 p-2 text-white hover:bg-yellow-500 cursor-pointer w-32"- on:click="{() => (type = 'clickhouse')}"- class:bg-yellow-500="{type === 'clickhouse'}"- >- Clickhouse- </button> -->- </div>- {#if type}- <div class="flex justify-center space-x-4 items-center">- {#if type !== 'redis'}- <label for="defaultDB">Default database</label>- <input- id="defaultDB"- class="w-64"- placeholder="random"- bind:value={defaultDatabaseName}- />- {/if}-- <button- class:bg-green-600={type === 'mongodb'}- class:hover:bg-green-500={type === 'mongodb'}- class:bg-blue-600={type === 'postgresql'}- class:hover:bg-blue-500={type === 'postgresql'}- class:bg-orange-600={type === 'mysql'}- class:hover:bg-orange-500={type === 'mysql'}- class:bg-red-600={type === 'couchdb' || type === 'redis'}- class:hover:bg-red-500={type === 'couchdb' || type === 'redis'}- class:bg-yellow-500={type === 'clickhouse'}- class:hover:bg-yellow-400={type === 'clickhouse'}- class="button p-2 w-32 text-white"- on:click={deploy}>Deploy</button- >- </div>- {/if}- {/if}- </div>-{/if}diff --git a/src/components/Database/SVGs/Clickhouse.svelte b/src/components/Database/SVGs/Clickhouse.sveltedeleted file mode 100644index b8cd289334..0000000000--- a/src/components/Database/SVGs/Clickhouse.svelte+++ /dev/null@@ -1,9 +0,0 @@-<script>- export let customClass;-</script>--<svg class="{customClass}" viewBox="0 0 9 8" xmlns="http://www.w3.org/2000/svg"- ><path d="m0 7h1v1h-1z" fill="#f00"></path><path- d="m0 0h1v7h-1zm2 0h1v8h-1zm2 0h1v8h-1zm2 0h1v8h-1zm2 3.25h1v1.5h-1z"- fill="#fc0"></path></svg->diff --git a/src/components/Database/SVGs/CouchDb.svelte b/src/components/Database/SVGs/CouchDb.sveltedeleted file mode 100644index 393c1f3e6e..0000000000--- a/src/components/Database/SVGs/CouchDb.svelte+++ /dev/null@@ -1,16 +0,0 @@-<script>- export let customClass;-</script>--<svg-class={customClass}-id="CouchDB"-xmlns="http://www.w3.org/2000/svg"-viewBox="0 0 128 128"-><g id="original"- ><path- class=""- d="M101.4,77.2c0,5-2.7,7.5-7.6,7.7H33.9c-4.9,0-7.6-2.5-7.6-7.7,0-5,2.7-7.5,7.6-7.7H94.1C99,69.7,101.4,72.2,101.4,77.2ZM94.1,88.7H33.9c-4.9,0-7.6,2.4-7.6,7.7,0,5,2.7,7.4,7.6,7.7H94.1c4.9,0,7.6-2.5,7.6-7.7C101.4,91.1,99,88.7,94.1,88.7Zm18.6-42.1h0c-4.9,0-7.6,2.5-7.6,7.4V96.1c0,5,2.7,7.5,7.6,7.7h0c7.4-.2,11.3-7.7,11.3-22.9V62C124,51.8,120.1,46.8,112.7,46.6Zm-97.4,0h0C7.9,46.8,4,51.8,4,62V80.9c0,15.2,3.9,22.7,11.3,22.9h0c4.9,0,7.6-2.4,7.6-7.7V54.3C22.7,49.3,20.2,46.8,15.3,46.6Zm97.4-3.8c0-12.7-6.6-18.7-18.6-18.9H33.9c-12.2.2-18.6,6.5-18.6,18.9h0c7.4,0,11.3,4,11.3,11.5s3.9,11.4,11.3,11.4H90.4c7.3,0,11.3-3.9,11.3-11.4-.3-7.7,3.9-11.2,11-11.5Z"- ></path></g-></svg->\ No newline at end of filediff --git a/src/components/Database/SVGs/MongoDb.svelte b/src/components/Database/SVGs/MongoDb.sveltedeleted file mode 100644index bc2bf91d5e..0000000000--- a/src/components/Database/SVGs/MongoDb.svelte+++ /dev/null@@ -1,32 +0,0 @@-<script>- export let customClass;-</script>-<svg- class={customClass}- xmlns="http://www.w3.org/2000/svg"- id="Layer_1"- data-name="Layer 1"- viewBox="0 0 216.56 448.5"- ><defs- ><style>- .cls-1 {- fill: #10aa50;- }- .cls-2 {- fill: #b8c4c2;- }- .cls-3 {- fill: #12924f;- }- </style></defs- ><title>MongoDB_Leaf_FullColor_RGB</title><path- class="cls-1"- d="M202.8,179.68c-23-101.47-71-128.49-83.18-147.59C113,21.7,106.25,5.91,106.25,5.91c-.66,9-1.83,14.7-9.51,21.54C81.36,41.16,16,94.42,10.51,209.72c-5.12,107.5,79,173.8,90.18,180.65,8.54,4.2,19,.08,24-3.77,40.54-27.84,96-102.07,78.06-206.92"- ></path><path- class="cls-2"- d="M109.73,333.11c-2.11,26.62-3.63,42.11-9,57.29,0,0,3.54,25.33,6,52.17l8.77,0a488.62,488.62,0,0,1,9.57-56.2C113.71,380.8,110.16,356.46,109.73,333.11Z"- ></path><path- class="cls-3"- d="M125.06,386.39h0c-11.48-5.3-14.8-30.13-15.31-53.28A1090.8,1090.8,0,0,0,112.2,218.4c-.6-20.07.3-185.92-4.94-210.2,2.12,4.75,7.24,15.91,12.36,23.88,12.23,19.11,60.19,46.13,83.17,147.61C220.7,284.27,165.57,358.37,125.06,386.39Z"- ></path>-</svg>diff --git a/src/components/Database/SVGs/Postgresql.svelte b/src/components/Database/SVGs/Postgresql.sveltedeleted file mode 100644index b2fe80c993..0000000000--- a/src/components/Database/SVGs/Postgresql.svelte+++ /dev/null@@ -1,60 +0,0 @@-<script>- export let customClass;-</script>--<svg-class={customClass}-xmlns="http://www.w3.org/2000/svg"-viewBox="0 0 432.071 445.383"-xml:space="preserve"->-<g- id="orginal"- style="fill-rule:nonzero;clip-rule:nonzero;stroke:#000000;stroke-miterlimit:4;"->-</g>-<g- id="Layer_x0020_3"- style="fill-rule:nonzero;clip-rule:nonzero;fill:none;stroke:#FFFFFF;stroke-width:12.4651;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;"->- <path- style="fill:#000000;stroke:#000000;stroke-width:37.3953;stroke-linecap:butt;stroke-linejoin:miter;"- d="M323.205,324.227c2.833-23.601,1.984-27.062,19.563-23.239l4.463,0.392c13.517,0.615,31.199-2.174,41.587-7c22.362-10.376,35.622-27.7,13.572-23.148c-50.297,10.376-53.755-6.655-53.755-6.655c53.111-78.803,75.313-178.836,56.149-203.322 C352.514-5.534,262.036,26.049,260.522,26.869l-0.482,0.089c-9.938-2.062-21.06-3.294-33.554-3.496c-22.761-0.374-40.032,5.967-53.133,15.904c0,0-161.408-66.498-153.899,83.628c1.597,31.936,45.777,241.655,98.47,178.31 c19.259-23.163,37.871-42.748,37.871-42.748c9.242,6.14,20.307,9.272,31.912,8.147l0.897-0.765c-0.281,2.876-0.157,5.689,0.359,9.019c-13.572,15.167-9.584,17.83-36.723,23.416c-27.457,5.659-11.326,15.734-0.797,18.367c12.768,3.193,42.305,7.716,62.268-20.224 l-0.795,3.188c5.325,4.26,4.965,30.619,5.72,49.452c0.756,18.834,2.017,36.409,5.856,46.771c3.839,10.36,8.369,37.05,44.036,29.406c29.809-6.388,52.6-15.582,54.677-101.107"- ></path>- <path- style="fill:#336791;stroke:none;"- d="M402.395,271.23c-50.302,10.376-53.76-6.655-53.76-6.655c53.111-78.808,75.313-178.843,56.153-203.326c-52.27-66.785-142.752-35.2-144.262-34.38l-0.486,0.087c-9.938-2.063-21.06-3.292-33.56-3.496c-22.761-0.373-40.026,5.967-53.127,15.902 c0,0-161.411-66.495-153.904,83.63c1.597,31.938,45.776,241.657,98.471,178.312c19.26-23.163,37.869-42.748,37.869-42.748c9.243,6.14,20.308,9.272,31.908,8.147l0.901-0.765c-0.28,2.876-0.152,5.689,0.361,9.019c-13.575,15.167-9.586,17.83-36.723,23.416 c-27.459,5.659-11.328,15.734-0.796,18.367c12.768,3.193,42.307,7.716,62.266-20.224l-0.796,3.188c5.319,4.26,9.054,27.711,8.428,48.969c-0.626,21.259-1.044,35.854,3.147,47.254c4.191,11.4,8.368,37.05,44.042,29.406c29.809-6.388,45.256-22.942,47.405-50.555 c1.525-19.631,4.976-16.729,5.194-34.28l2.768-8.309c3.192-26.611,0.507-35.196,18.872-31.203l4.463,0.392c13.517,0.615,31.208-2.174,41.591-7c22.358-10.376,35.618-27.7,13.573-23.148z"- ></path>- <path- d="M215.866,286.484c-1.385,49.516,0.348,99.377,5.193,111.495c4.848,12.118,15.223,35.688,50.9,28.045c29.806-6.39,40.651-18.756,45.357-46.051c3.466-20.082,10.148-75.854,11.005-87.281"- ></path>- <path- d="M173.104,38.256c0,0-161.521-66.016-154.012,84.109c1.597,31.938,45.779,241.664,98.473,178.316c19.256-23.166,36.671-41.335,36.671-41.335"- ></path>- <path- d="M260.349,26.207c-5.591,1.753,89.848-34.889,144.087,34.417c19.159,24.484-3.043,124.519-56.153,203.329"- ></path>- <path- style="stroke-linejoin:bevel;"- d="M348.282,263.953c0,0,3.461,17.036,53.764,6.653c22.04-4.552,8.776,12.774-13.577,23.155c-18.345,8.514-59.474,10.696-60.146-1.069c-1.729-30.355,21.647-21.133,19.96-28.739c-1.525-6.85-11.979-13.573-18.894-30.338 c-6.037-14.633-82.796-126.849,21.287-110.183c3.813-0.789-27.146-99.002-124.553-100.599c-97.385-1.597-94.19,119.762-94.19,119.762"- ></path>- <path- d="M188.604,274.334c-13.577,15.166-9.584,17.829-36.723,23.417c-27.459,5.66-11.326,15.733-0.797,18.365c12.768,3.195,42.307,7.718,62.266-20.229c6.078-8.509-0.036-22.086-8.385-25.547c-4.034-1.671-9.428-3.765-16.361,3.994z"- ></path>- <path- d="M187.715,274.069c-1.368-8.917,2.93-19.528,7.536-31.942c6.922-18.626,22.893-37.255,10.117-96.339c-9.523-44.029-73.396-9.163-73.436-3.193c-0.039,5.968,2.889,30.26-1.067,58.548c-5.162,36.913,23.488,68.132,56.479,64.938"- ></path>- <path- style="fill:#FFFFFF;stroke-width:4.155;stroke-linecap:butt;stroke-linejoin:miter;"- d="M172.517,141.7c-0.288,2.039,3.733,7.48,8.976,8.207c5.234,0.73,9.714-3.522,9.998-5.559c0.284-2.039-3.732-4.285-8.977-5.015c-5.237-0.731-9.719,0.333-9.996,2.367z"- ></path>- <path- style="fill:#FFFFFF;stroke-width:2.0775;stroke-linecap:butt;stroke-linejoin:miter;"- d="M331.941,137.543c0.284,2.039-3.732,7.48-8.976,8.207c-5.238,0.73-9.718-3.522-10.005-5.559c-0.277-2.039,3.74-4.285,8.979-5.015c5.239-0.73,9.718,0.333,10.002,2.368z"- ></path>- <path- d="M350.676,123.432c0.863,15.994-3.445,26.888-3.988,43.914c-0.804,24.748,11.799,53.074-7.191,81.435"- ></path>- <path style="stroke-width:3;" d="M0,60.232"></path>-</g>-</svg>\ No newline at end of filediff --git a/src/components/Loading.svelte b/src/components/Loading.sveltedeleted file mode 100644index 19e3577935..0000000000--- a/src/components/Loading.svelte+++ /dev/null@@ -1,83 +0,0 @@-<script>- export let github = false;- export let githubLoadingText = 'Loading GitHub...';- export let fullscreen = true;-</script>--{#if fullscreen}- {#if github}- <div class="fixed left-0 top-0 flex flex-wrap content-center h-full w-full">- <div class="main flex justify-center items-center">- <div class="w-64">- <svg- class=" w-28 animate-bounce mx-auto"- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- ><path- d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"- /></svg- >- <div class="text-xl font-bold text-center">- {githubLoadingText}- </div>- </div>- </div>- </div>- {:else}- <div class="main fixed left-0 top-0 flex flex-wrap content-center h-full">- <span class="loader" />- </div>- {/if}-{:else}- <div class="main h-64 py-24 left-0 top-0 flex flex-wrap content-center mx-auto">- <span class="loader" />- </div>-{/if}--<style lang="postcss">- .loader {- width: 8px;- height: 40px;- border-radius: 4px;- display: block;- margin: 20px auto;- position: relative;- background: currentColor;- color: #fff;- box-sizing: border-box;- animation: animloader 0.3s 0.3s linear infinite alternate;- }-- .loader::after,- .loader::before {- content: '';- width: 8px;- height: 40px;- border-radius: 4px;- background: currentColor;- position: absolute;- top: 50%;- transform: translateY(-50%);- left: 20px;- box-sizing: border-box;- animation: animloader 0.3s 0.45s linear infinite alternate;- }- .loader::before {- left: -20px;- animation-delay: 0s;- }-- @keyframes animloader {- 0% {- height: 48px;- }- 100% {- height: 4px;- }- }-</style>diff --git a/src/components/PasswordField.svelte b/src/components/PasswordField.sveltedeleted file mode 100644index 8f754c883e..0000000000--- a/src/components/PasswordField.svelte+++ /dev/null@@ -1,56 +0,0 @@-<script>- export let value;- let showPassword = false;- export let isEditable = false;-</script>--<div class="relative w-full">- {#if showPassword}- <input type="text" class="w-full" bind:value disabled={!isEditable} />- {:else}- <input type="password" class="w-full" bind:value disabled={!isEditable} />- {/if}-- <div- class="absolute top-0 my-2 mx-2 right-0 cursor-pointer text-warmGray-600 hover:text-white"- on:click={() => (showPassword = !showPassword)}- >- {#if showPassword}- <svg- xmlns="http://www.w3.org/2000/svg"- class="h-6 w-6"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"- />- </svg>- {:else}- <svg- xmlns="http://www.w3.org/2000/svg"- class="h-6 w-6"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"- />- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"- />- </svg>- {/if}- </div>-</div>diff --git a/src/components/Service/CodeServer.svelte b/src/components/Service/CodeServer.sveltedeleted file mode 100644index d06679f34d..0000000000--- a/src/components/Service/CodeServer.svelte+++ /dev/null@@ -1,35 +0,0 @@-<script>- import { fade } from 'svelte/transition';- import { toast } from '@zerodevx/svelte-toast';- import Loading from '../Loading.svelte';- import Tooltip from '$components/Tooltip.svelte';- import { request } from '$lib/request';- import { page, session } from '$app/stores';- import PasswordField from '$components/PasswordField.svelte';- import { browser } from '$app/env';- export let service;-- async function getPassword() {- try {- const { password } = await request(`/api/v1/services/deploy/${$page.params.name}/password`, $session);- service.config.password = password- } catch (error) {- console.log(error);- browser && toast.push(`Ooops, there was an error activating users for VSCode Server?!`);- }- }--</script>--{#await getPassword()}- <Loading />-{:then}- <div class="text-left max-w-5xl mx-auto px-6" in:fade={{ duration: 100 }}>- <div class="pb-2 pt-5 space-y-4">- <div class="flex items-center">- <div class="font-bold w-64 text-warmGray-400">Password</div>- <PasswordField value={service.config.password} />- </div>- </div>- </div>-{/await}diff --git a/src/components/Service/MinIO.svelte b/src/components/Service/MinIO.sveltedeleted file mode 100644index 683e8967f9..0000000000--- a/src/components/Service/MinIO.svelte+++ /dev/null@@ -1,26 +0,0 @@-<script>- import { fade } from 'svelte/transition';- import { toast } from '@zerodevx/svelte-toast';- import Loading from '../Loading.svelte';- import Tooltip from '$components/Tooltip.svelte';- import { request } from '$lib/request';- import { page, session } from '$app/stores';- import PasswordField from '$components/PasswordField.svelte';- import { browser } from '$app/env';- export let service;--</script>--<div class="text-left max-w-5xl mx-auto px-6" in:fade={{ duration: 100 }}>- <div class="pb-2 pt-5 space-y-4">- <div class="flex items-center pt-4">- <div class="font-bold w-64 text-warmGray-400">Root User</div>- <input class="w-full" value={service.config.generateEnvsMinIO.MINIO_ROOT_USER} disabled />- </div>-- <div class="flex items-center">- <div class="font-bold w-64 text-warmGray-400">Root Password</div>- <PasswordField value={service.config.generateEnvsMinIO.MINIO_ROOT_PASSWORD} />- </div>- </div>-</div>diff --git a/src/components/Service/Plausible.svelte b/src/components/Service/Plausible.sveltedeleted file mode 100644index 44b7036b78..0000000000--- a/src/components/Service/Plausible.svelte+++ /dev/null@@ -1,88 +0,0 @@-<script>- import { fade } from 'svelte/transition';- import { toast } from '@zerodevx/svelte-toast';- import Loading from '../Loading.svelte';- import Tooltip from '$components/Tooltip.svelte';- import { request } from '$lib/request';- import { page, session } from '$app/stores';- import PasswordField from '$components/PasswordField.svelte';- import { browser } from '$app/env';- export let service;- let loading = false;- async function activate() {- try {- loading = true;- await request(`/api/v1/services/deploy/${$page.params.name}/activate`, $session, {- method: 'PATCH',- body: {}- });- browser && toast.push(`All users are activated for Plausible.`);- } catch (error) {- console.log(error);- browser && toast.push(`Ooops, there was an error activating users for Plausible?!`);- } finally {- loading = false;- }- }--</script>--{#if loading}- <Loading />-{:else}- <div class="text-left max-w-5xl mx-auto px-6" in:fade={{ duration: 100 }}>- <div class="pb-2 pt-5 space-y-4">- <div class="flex space-x-5 items-center">- <div class="text-2xl font-bold border-gradient">General</div>- <div class="flex-1" />- <Tooltip- position="bottom"- size="large"- label="Activate all users in Plausible database, so you can login without the email verification."- >- <button class="button bg-blue-500 hover:bg-blue-400 px-2" on:click={activate}- >Activate All Users</button- >- </Tooltip>- </div>-- <div class="flex items-center pt-4">- <div class="font-bold w-64 text-warmGray-400">Domain</div>- <input class="w-full" value={service.config.baseURL} disabled />- </div>- <div class="flex items-center">- <div class="font-bold w-64 text-warmGray-400">Email address</div>- <input class="w-full" value={service.config.email} disabled />- </div>- <div class="flex items-center">- <div class="font-bold w-64 text-warmGray-400">Username</div>- <input class="w-full" value={service.config.userName} disabled />- </div>- <div class="flex items-center">- <div class="font-bold w-64 text-warmGray-400">Password</div>- <PasswordField value={service.config.userPassword} />- </div>- <div class="text-2xl font-bold pt-4 border-gradient w-32">PostgreSQL</div>- <div class="flex items-center pt-4">- <div class="font-bold w-64 text-warmGray-400">Username</div>- <input- class="w-full"- value={service.config.generateEnvsPostgres.POSTGRESQL_USERNAME}- disabled- />- </div>- <div class="flex items-center">- <div class="font-bold w-64 text-warmGray-400">Password</div>- <PasswordField value={service.config.generateEnvsPostgres.POSTGRESQL_PASSWORD} />- </div>- <div class="flex items-center">- <div class="font-bold w-64 text-warmGray-400">Database</div>- <input- class="w-full"- value={service.config.generateEnvsPostgres.POSTGRESQL_DATABASE}- disabled- />- </div>- </div>- </div>-{/if}diff --git a/src/components/Tooltip.svelte b/src/components/Tooltip.sveltedeleted file mode 100644index f4942709d1..0000000000--- a/src/components/Tooltip.svelte+++ /dev/null@@ -1,15 +0,0 @@-<script>- export let position = "bottom";- export let label;- export let size = "fit";- </script>-- <span- aria-label="{label}"- data-microtip-position="{position}"- data-microtip-size="{size}"- role="tooltip"- >- <slot></slot>- </span>-\ No newline at end of filediff --git a/src/components/TooltipInfo.svelte b/src/components/TooltipInfo.sveltedeleted file mode 100644index 9e00d0d605..0000000000--- a/src/components/TooltipInfo.svelte+++ /dev/null@@ -1,25 +0,0 @@-<script>- export let position = "top";- export let label;- export let size = "large";-</script>--<span- class="absolute px-1 py-1"- aria-label="{label}"- data-microtip-position="{position}"- data-microtip-size="{size}"- role="tooltip"->- <svg- class="w-4 text-warmGray-600 hover:text-white"- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 20 20"- fill="currentColor"- >- <path- fill-rule="evenodd"- d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z"- clip-rule="evenodd"></path>- </svg>-</span>diff --git a/src/global.d.ts b/src/global.d.tsindex 716f94507c..4a2702fbc9 100644--- a/src/global.d.ts+++ b/src/global.d.ts@@ -1,8 +1,75 @@/// <reference types="@sveltejs/kit" />-/// <reference types="svelte" />-/// <reference types="vite/client" />+interface Cookies {+ teamId?: string;+ gitlabToken?: string;+ 'kit.session'?: string;+}+interface Locals {+ gitlabToken?: string;+ user: {+ teamId: string;+ permission: string;+ isAdmin: boolean;+ };+ session: {+ data: {+ uid?: string;+ teams?: string[];+ expires?: string;+ };+ };+}++type Applications = {+ name: string;+ domain: string;+};++interface Hash {+ iv: string;+ content: string;+}++interface BuildPack {+ name: string;+}++// TODO: Not used, not working what?!+enum GitSource {+ Github = 'github',+ Gitlab = 'gitlab',+ Bitbucket = 'bitbucket'+}++type RawHaproxyConfiguration = {+ _version: number;+ data: string;+};++type NewTransaction = {+ _version: number;+ id: string;+ status: string;+};++type HttpRequestRuleForceSSL = {+ return_hdrs: null;+ cond: string;+ cond_test: string;+ index: number;+ redir_code: number;+ redir_type: string;+ redir_value: string;+ type: string;+};++// TODO: No any please+type HttpRequestRule = {+ _version: number;+ data: Array<any>;+};-export type DateTimeFormatOptions = {+type DateTimeFormatOptions = {localeMatcher?: 'lookup' | 'best fit';weekday?: 'long' | 'short' | 'narrow';era?: 'long' | 'short' | 'narrow';@@ -17,106 +84,3 @@ export type DateTimeFormatOptions = {hour12?: boolean;timeZone?: string;};-export type Application = {- github: {- installation: {- id: number;- };- app: {- id: number;- };- };- repository: {- id: number;- organization: string;- name: string;- branch: string;- };- general: {- deployId: string;- nickname: string;- workdir: string;- isPreviewDeploymentEnabled: boolean;- pullRequest: number;- };- build: {- pack: string;- directory: string;- command: {- build: string | null;- installation: string;- start: string;- python: {- module?: string;- instance?: string;- };- };- container: {- name: string;- tag: string;- baseSHA: string;- };- };- publish: {- directory: string;- domain: string;- path: string;- port: number;- secrets: Array<Record<string, unknown>>;- };-};-export type Database = {- config:- | {- general: {- deployId: string;- nickname: string;- workdir: string;- type: string;- };- database: {- usernames: Array;- passwords: Array;- defaultDatabaseName: string;- };- deploy: {- name: string;- };- }- | Record<string, unknown>;- envs: Array;-};-export type Dashboard = {- databases: {- deployed:- | [- {- configuration: Database;- }- ]- | [];- };- services: {- deployed:- | [- {- configuration: any;- }- ]- | [];- };- applications: {- deployed:- | [- {- configuration: Application;- UpdatedAt: any;- }- ]- | [];- };-};-export type GithubInstallations = {- id: number;- app_id: number;-};diff --git a/src/hooks.ts b/src/hooks.tsnew file mode 100644index 0000000000..d4fea1baf1--- /dev/null+++ b/src/hooks.ts@@ -0,0 +1,77 @@+import dotEnvExtended from 'dotenv-extended';+dotEnvExtended.load();+import type { GetSession } from '@sveltejs/kit';+import { handleSession } from 'svelte-kit-cookie-session';+import { getUserDetails, isTeamIdTokenAvailable, sentry } from '$lib/common';+import { version } from '$lib/common';+import cookie from 'cookie';+import { dev } from '$app/env';++export const handle = handleSession(+ {+ secret: process.env['COOLIFY_SECRET_KEY'],+ expires: 30+ },+ async function ({ event, resolve }) {+ let response;+ try {+ const cookies: Cookies = cookie.parse(event.request.headers.get('cookie') || '');+ if (cookies['kit.session']) {+ const { permission, teamId } = await getUserDetails(event, false);+ event.locals.user = {+ teamId,+ permission,+ isAdmin: permission === 'admin' || permission === 'owner'+ };+ }+ if (cookies.gitlabToken) {+ event.locals.gitlabToken = cookies.gitlabToken;+ }+ response = await resolve(event, {+ ssr: !event.url.pathname.startsWith('/webhooks/success')+ });+ } catch (error) {+ response = await resolve(event, {+ ssr: !event.url.pathname.startsWith('/webhooks/success')+ });+ response.headers.append(+ 'Set-Cookie',+ cookie.serialize('kit.session', '', {+ path: '/',+ expires: new Date('Thu, 01 Jan 1970 00:00:01 GMT')+ })+ );+ response.headers.append(+ 'Set-Cookie',+ cookie.serialize('teamId', '', {+ path: '/',+ expires: new Date('Thu, 01 Jan 1970 00:00:01 GMT')+ })+ );+ response.headers.append(+ 'Set-Cookie',+ cookie.serialize('gitlabToken', '', {+ path: '/',+ expires: new Date('Thu, 01 Jan 1970 00:00:01 GMT')+ })+ );+ } finally {+ return response;+ }+ }+);++export const getSession: GetSession = function (request) {+ return {+ version,+ gitlabToken: request.locals?.gitlabToken || null,+ uid: request.locals.session.data?.uid || null,+ teamId: request.locals.user?.teamId || null,+ permission: request.locals.user?.permission,+ isAdmin: request.locals.user?.isAdmin || false+ };+};++export async function handleError({ error, event }) {+ if (!dev) sentry.captureException(error, { event });+}diff --git a/src/hooks/index.ts b/src/hooks/index.tsdeleted file mode 100644index 05738d97c4..0000000000--- a/src/hooks/index.ts+++ /dev/null@@ -1,151 +0,0 @@-import dotEnvExtended from 'dotenv-extended';-dotEnvExtended.load();-import { publicPages } from '$lib/consts';-import mongoose from 'mongoose';-import { verifyUserId } from '$lib/api/common';-import { initializeSession } from 'svelte-kit-cookie-session';-import { cleanupStuckedDeploymentsInDB } from '$lib/api/applications/cleanup';-import { docker } from '$lib/api/docker';-import Configuration from '$models/Configuration';--process.on('SIGINT', function () {- mongoose.connection.close(function () {- console.log('Mongoose default connection disconnected through app termination');- process.exit(0);- });-});--async function connectMongoDB() {- // TODO: Save configurations on start?- const { MONGODB_USER, MONGODB_PASSWORD, MONGODB_HOST, MONGODB_PORT, MONGODB_DB } = process.env;- try {- if (process.env.NODE_ENV === 'production') {- await mongoose.connect(- `mongodb://${MONGODB_USER}:${MONGODB_PASSWORD}@${MONGODB_HOST}:${MONGODB_PORT}/${MONGODB_DB}?authSource=${MONGODB_DB}&readPreference=primary&ssl=false`,- { useNewUrlParser: true, useUnifiedTopology: true, useFindAndModify: false }- );- } else {- await mongoose.connect(- 'mongodb://supercooldbuser:developmentPassword4db@localhost:27017/coolify?&readPreference=primary&ssl=false',- { useNewUrlParser: true, useUnifiedTopology: true, useFindAndModify: false }- );- }- console.log('Connected to mongodb.');- } catch (error) {- console.log(error);- }-}--(async () => {- if (mongoose.connection.readyState !== 1) await connectMongoDB();- try {- await mongoose.connection.db.dropCollection('logs-servers');- } catch (error) {- //- }- try {- await cleanupStuckedDeploymentsInDB();- } catch (error) {- console.log(error);- }- try {- const dockerServices = await docker.engine.listServices();- let applications: any = dockerServices.filter(- (r) =>- r.Spec.Labels.managedBy === 'coolify' &&- r.Spec.Labels.type === 'application' &&- r.Spec.Labels.configuration- );- applications = applications.map((r) => {- if (JSON.parse(r.Spec.Labels.configuration)) {- return {- configuration: JSON.parse(r.Spec.Labels.configuration),- UpdatedAt: r.UpdatedAt- };- }- return {};- });- applications = [- ...new Map(- applications.map((item) => [- item.configuration.publish.domain + item.configuration.publish.path,- item- ])- ).values()- ];- for (const application of applications) {- await Configuration.findOneAndUpdate(- {- 'repository.name': application.configuration.repository.name,- 'repository.organization': application.configuration.repository.organization,- 'repository.branch': application.configuration.repository.branch,- 'publish.domain': application.configuration.publish.domain- },- {- ...application.configuration- },- { upsert: true, new: true }- );- }- } catch (error) {- console.log(error);- }-})();--export async function handle({ request, resolve }) {- const { SECRETS_ENCRYPTION_KEY } = process.env;- let session;- try {- session = initializeSession(request.headers, {- secret: SECRETS_ENCRYPTION_KEY,- cookie: { path: '/', secure: true }- });- } catch (error) {- console.log(error);- return {- status: 302,- headers: {- 'set-cookie': 'kit.session=deleted;path=/;expires=Wed, 21 Oct 2015 07:28:00 GMT',- location: '/'- }- };- }-- request.locals.session = session;- if (session?.data?.coolToken) {- try {- await verifyUserId(session.data.coolToken);- request.locals.session = session;- } catch (error) {- request.locals.session.destroy = true;- }- }- const response = await resolve(request);- if (!session['set-cookie']) {- if (!session?.data?.coolToken && !publicPages.includes(request.path)) {- return {- status: 302,- headers: {- location: '/'- }- };- }- return response;- }- return {- ...response,- headers: {- ...response.headers,- ...session- }- };-}-export function getSession(request) {- const { data } = request.locals.session;- return {- isLoggedIn: data && Object.keys(data).length !== 0 ? true : false,- expires: data.expires,- coolToken: data.coolToken,- ghToken: data.ghToken || null- };-}diff --git a/src/lib/api.ts b/src/lib/api.tsnew file mode 100644index 0000000000..42fe10a1e8--- /dev/null+++ b/src/lib/api.ts@@ -0,0 +1,60 @@+async function send({ method, path, data = {}, headers, timeout = 30000 }) {+ const controller = new AbortController();+ const id = setTimeout(() => controller.abort(), timeout);+ const opts = { method, headers: {}, body: null, signal: controller.signal };+ if (Object.keys(data).length > 0) {+ let parsedData = data;+ for (const [key, value] of Object.entries(data)) {+ if (value === '') {+ parsedData[key] = null;+ }+ }+ if (parsedData) {+ opts.headers['Content-Type'] = 'application/json';+ opts.body = JSON.stringify(parsedData);+ }+ }++ if (headers) {+ opts.headers = {+ ...opts.headers,+ ...headers+ };+ }+ const response = await fetch(`${path}`, opts);++ clearTimeout(id);++ const contentType = response.headers.get('content-type');++ let responseData = {};+ if (contentType) {+ if (contentType?.indexOf('application/json') !== -1) {+ responseData = await response.json();+ } else if (contentType?.indexOf('text/plain') !== -1) {+ responseData = await response.text();+ } else {+ return {};+ }+ } else {+ return {};+ }+ if (!response.ok) throw responseData;+ return responseData;+}++export function get(path, headers = {}): Promise<any> {+ return send({ method: 'GET', path, headers });+}++export function del(path, data = {}, headers = {}): Promise<any> {+ return send({ method: 'DELETE', path, data, headers });+}++export function post(path, data, headers = {}): Promise<any> {+ return send({ method: 'POST', path, data, headers });+}++export function put(path, data, headers = {}): Promise<any> {+ return send({ method: 'PUT', path, data, headers });+}diff --git a/src/lib/api/applications/buildContainer.ts b/src/lib/api/applications/buildContainer.tsdeleted file mode 100644index e971747f6f..0000000000--- a/src/lib/api/applications/buildContainer.ts+++ /dev/null@@ -1,29 +0,0 @@-import Deployment from '$models/Deployment';-import { saveAppLog } from './logging';-import * as packs from './packs';--export default async function (configuration) {- const { id, organization, name, branch } = configuration.repository;- const { domain } = configuration.publish;- const deployId = configuration.general.deployId;- const execute = packs[configuration.build.pack];- if (execute) {- await Deployment.findOneAndUpdate(- { repoId: id, branch, deployId, organization, name, domain },- { repoId: id, branch, deployId, organization, name, domain, progress: 'inprogress' }- );- await saveAppLog('### Building application.', configuration);- await execute(configuration);- await saveAppLog('### Building done.', configuration);- } else {- try {- await Deployment.findOneAndUpdate(- { repoId: id, branch, deployId, organization, name, domain },- { repoId: id, branch, deployId, organization, name, domain, progress: 'failed' }- );- } catch (error) {- // Hmm.- }- throw new Error('No buildpack found.');- }-}diff --git a/src/lib/api/applications/cleanup.ts b/src/lib/api/applications/cleanup.tsdeleted file mode 100644index b300787028..0000000000--- a/src/lib/api/applications/cleanup.ts+++ /dev/null@@ -1,66 +0,0 @@-import { docker } from '$lib/api/docker';-import Deployment from '$models/Deployment';-import { execShellAsync } from '../common';-import crypto from 'crypto';-export async function deleteSameDeployments(configuration, originalDomain = null) {- await (- await docker.engine.listServices()- )- .filter((r) => r.Spec.Labels.managedBy === 'coolify' && r.Spec.Labels.type === 'application')- .map(async (s) => {- const running = JSON.parse(s.Spec.Labels.configuration);- if (- running.repository.id === configuration.repository.id &&- running.repository.branch === configuration.repository.branch &&- running.publish.domain === originalDomain || configuration.publish.domain- ) {- await execShellAsync(`docker stack rm ${s.Spec.Labels['com.docker.stack.namespace']}`);- }- });-}--export async function cleanupStuckedDeploymentsInDB() {- // Cleanup stucked deployments.- await Deployment.updateMany(- { progress: { $in: ['queued', 'inprogress'] } },- { progress: 'failed' }- );-}-export async function purgeImagesContainers(configuration, deleteAll = false) {- const { name, tag } = configuration.build.container;- try {- await execShellAsync('docker container prune -f');- } catch (error) {- //- }- try {- if (deleteAll) {- const IDsToDelete = (- await execShellAsync(- `docker images ls --filter=reference='${name}' --format '{{json .ID }}'`- )- )- .trim()- .replace(/"/g, '')- .split('\n');- if (IDsToDelete.length > 0) await execShellAsync(`docker rmi -f ${IDsToDelete.join(' ')}`);- } else {- const IDsToDelete = (- await execShellAsync(- `docker images ls --filter=reference='${name}' --filter=before='${name}:${tag}' --format '{{json .ID }}'`- )- )- .trim()- .replace(/"/g, '')- .split('\n');- if (IDsToDelete.length > 1) await execShellAsync(`docker rmi -f ${IDsToDelete.join(' ')}`);- }- } catch (error) {- console.log(error);- }- try {- await execShellAsync('docker image prune -f');- } catch (error) {- //- }-}diff --git a/src/lib/api/applications/cloneRepository.ts b/src/lib/api/applications/cloneRepository.tsdeleted file mode 100644index 63c4b80406..0000000000--- a/src/lib/api/applications/cloneRepository.ts+++ /dev/null@@ -1,54 +0,0 @@-import jsonwebtoken from 'jsonwebtoken';-import { execShellAsync } from '../common';--export default async function (configuration) {- try {- const { GITHUB_APP_PRIVATE_KEY } = process.env;- const { workdir, isPreviewDeploymentEnabled, pullRequest } = configuration.general;- const { organization, name, branch } = configuration.repository;- const github = configuration.github;- if (!github.installation.id || !github.app.id) {- throw new Error('Github installation ID is invalid.');- }- const githubPrivateKey = GITHUB_APP_PRIVATE_KEY.replace(/\\n/g, '\n').replace(/"/g, '');-- const payload = {- iat: Math.round(new Date().getTime() / 1000),- exp: Math.round(new Date().getTime() / 1000 + 60),- iss: parseInt(github.app.id)- };-- const jwtToken = jsonwebtoken.sign(payload, githubPrivateKey, {- algorithm: 'RS256'- });-- const { token } = await (- await fetch(- `https://api.github.com/app/installations/${github.installation.id}/access_tokens`,- {- method: 'POST',- headers: {- Authorization: 'Bearer ' + jwtToken,- Accept: 'application/vnd.github.machine-man-preview+json'- }- }- )- ).json();- await execShellAsync(- `mkdir -p ${workdir} && git clone -q -b ${branch} https://x-access-token:${token}@github.com/${organization}/${name}.git ${workdir}/`- );-- if (isPreviewDeploymentEnabled && pullRequest && pullRequest !== 0) {- await execShellAsync(- `cd ${workdir} && git fetch origin pull/${pullRequest}/head:pull_${pullRequest} && git checkout pull_${pullRequest}`- );- }- configuration.build.container.tag = (- await execShellAsync(`cd ${workdir}/ && git rev-parse HEAD`)- )- .replace('\n', '')- .slice(0, 7);- } catch (error) {- console.log(error);- }-}diff --git a/src/lib/api/applications/common.ts b/src/lib/api/applications/common.tsdeleted file mode 100644index 543e6c3a53..0000000000--- a/src/lib/api/applications/common.ts+++ /dev/null@@ -1,18 +0,0 @@-export const baseServiceConfiguration = {- replicas: 1,- restart_policy: {- condition: 'any',- max_attempts: 6- },- update_config: {- parallelism: 1,- delay: '10s',- order: 'start-first'- },- rollback_config: {- parallelism: 1,- delay: '10s',- order: 'start-first',- failure_action: 'rollback'- }-};diff --git a/src/lib/api/applications/configuration.ts b/src/lib/api/applications/configuration.tsdeleted file mode 100644index b4b2706bb6..0000000000--- a/src/lib/api/applications/configuration.ts+++ /dev/null@@ -1,198 +0,0 @@-import cuid from 'cuid';-import crypto from 'crypto';-import { uniqueNamesGenerator, adjectives, colors, animals } from 'unique-names-generator';-import { docker } from '$lib/api/docker';-import { baseServiceConfiguration } from './common';-import { execShellAsync } from '../common';-import { promises as fs } from 'fs';-import Configuration from '$models/Configuration';-function getUniq() {- return uniqueNamesGenerator({ dictionaries: [adjectives, animals, colors], length: 2 });-}--export function setDefaultConfiguration(configuration) {- const nickname = configuration.general.nickname || getUniq();- const deployId = cuid();- const shaBase = JSON.stringify({ path: configuration.publish.path, domain: configuration.publish.domain });- const sha256 = crypto.createHash('sha256').update(shaBase).digest('hex');-- configuration.build.container.name = sha256.slice(0, 15);-- configuration.general.nickname = nickname;- configuration.general.deployId = deployId;- configuration.general.workdir = `/tmp/${deployId}`;- if (configuration.general.isPreviewDeploymentEnabled && configuration.general.pullRequest !== 0) {- configuration.build.container.name = `pr${configuration.general.pullRequest}-${sha256.slice(- 0,- 8- )}`;- configuration.publish.domain = `pr${configuration.general.pullRequest}.${configuration.publish.domain}`;- }- if (!configuration.publish.path) configuration.publish.path = '/';- if (!configuration.publish.port) {- if (- configuration.build.pack === 'nodejs' ||- configuration.build.pack === 'nuxtjs' ||- configuration.build.pack === 'rust' ||- configuration.build.pack === 'nextjs' ||- configuration.build.pack === 'nestjs'- ) {- configuration.publish.port = 3000;- } else if (configuration.build.pack === 'python') {- configuration.publish.port = 4000;- } else {- configuration.publish.port = 80;- }- }- if (!configuration.build.directory) configuration.build.directory = '';- if (configuration.build.directory.startsWith('/'))- configuration.build.directory = configuration.build.directory.replace('/', '');-- if (!configuration.publish.directory) configuration.publish.directory = '';- if (configuration.publish.directory.startsWith('/'))- configuration.publish.directory = configuration.publish.directory.replace('/', '');-- if (configuration.build.pack === 'nodejs') {- if (!configuration.build.command.installation)- configuration.build.command.installation = 'yarn install';- }- if (- configuration.build.pack === 'nodejs' ||- configuration.build.pack === 'vuejs' ||- configuration.build.pack === 'nuxtjs' ||- configuration.build.pack === 'nextjs' ||- configuration.build.pack === 'nestjs'- ) {- if (!configuration.build.command.start) configuration.build.command.start = 'yarn start';- }- if (configuration.build.pack === 'python') {- if (!configuration.build.command.python.module)- configuration.build.command.python.module = 'main';- if (!configuration.build.command.python.instance)- configuration.build.command.python.instance = 'app';- }-- configuration.build.container.baseSHA = crypto- .createHash('sha256')- .update(JSON.stringify(baseServiceConfiguration))- .digest('hex');- configuration.baseServiceConfiguration = baseServiceConfiguration;-- return configuration;-}--export async function precheckDeployment(configuration) {- const services = await Configuration.find({- 'publish.domain': configuration.publish.domain,- 'publish.path': configuration.publish.path- })- // const services = (await docker.engine.listServices()).filter(- // (r) =>- // r.Spec.Labels.managedBy === 'coolify' &&- // r.Spec.Labels.type === 'application' &&- // JSON.parse(r.Spec.Labels.configuration).publish.domain === configuration.publish.domain- // );- let foundService = false;- let configChanged = false;- let imageChanged = false;- let forceUpdate = false;- for (const service of services) {- // const running = JSON.parse(service.Spec.Labels.configuration);- if (- service.repository.id === configuration.repository.id &&- service.repository.branch === configuration.repository.branch- ) {- foundService = true;- // Base service configuration changed- if (- !service.build.container.baseSHA ||- service.build.container.baseSHA !== configuration.build.container.baseSHA- ) {- forceUpdate = true;- }- // If the deployment is in error state, forceUpdate- const state = await execShellAsync(- `docker stack ps ${service.build.container.name} --format '{{ json . }}'`- );- const isError = state- .split('\n')- .filter((n) => n)- .map((s) => JSON.parse(s))- .filter(- (n) =>- n.DesiredState !== 'Running' && n.Image.split(':')[1] === service.build.container.tag- );- if (isError.length > 0) {- forceUpdate = true;- }-- const compareObjects = (a, b) => {- if (a === b) return true;-- if (typeof a != 'object' || typeof b != 'object' || a == null || b == null) return false;-- const keysA = Object.keys(a),- keysB = Object.keys(b);-- if (keysA.length != keysB.length) return false;-- for (const key of keysA) {- if (!keysB.includes(key)) return false;-- if (typeof a[key] === 'function' || typeof b[key] === 'function') {- if (a[key].toString() != b[key].toString()) return false;- } else {- if (!compareObjects(a[key], b[key])) return false;- }- }-- return true;- };-- const runningWithoutContainer = JSON.parse(JSON.stringify(service));- delete runningWithoutContainer.build.container;-- const configurationWithoutContainer = JSON.parse(JSON.stringify(configuration));- delete configurationWithoutContainer.build.container;-- // If only the configuration changed- if (- !compareObjects(runningWithoutContainer.build, configurationWithoutContainer.build) ||- !compareObjects(runningWithoutContainer.publish, configurationWithoutContainer.publish) ||- runningWithoutContainer.general.isPreviewDeploymentEnabled !==- configurationWithoutContainer.general.isPreviewDeploymentEnabled- ) {- configChanged = true;- }-- // If only the image changed- if (service.build.container.tag !== configuration.build.container.tag) imageChanged = true;- // If build pack changed, forceUpdate the service- if (service.build.pack !== configuration.build.pack) forceUpdate = true;- if (- configuration.general.isPreviewDeploymentEnabled &&- configuration.general.pullRequest !== 0- )- forceUpdate = true;- }-- }- if (forceUpdate) {- imageChanged = false;- configChanged = false;- }- return {- foundService,- imageChanged,- configChanged,- forceUpdate- };-}--export async function updateServiceLabels(configuration) {- return await execShellAsync(- `docker service update --label-add configuration='${JSON.stringify(configuration)}' ${- configuration.build.container.name- }_${configuration.build.container.name}`- );-}diff --git a/src/lib/api/applications/copyFiles.ts b/src/lib/api/applications/copyFiles.tsdeleted file mode 100644index 7a6d024248..0000000000--- a/src/lib/api/applications/copyFiles.ts+++ /dev/null@@ -1,69 +0,0 @@-import { promises as fs } from 'fs';-export default async function (configuration) {- const staticDeployments = ['react', 'vuejs', 'static', 'svelte', 'gatsby'];- try {- // TODO: Write full .dockerignore for all deployments!!- if (configuration.build.pack === 'php') {- await fs.writeFile(- `${configuration.general.workdir}/.htaccess`,- `- RewriteEngine On- RewriteBase /- RewriteCond %{REQUEST_FILENAME} !-d- RewriteCond %{REQUEST_FILENAME} !-f- RewriteRule ^(.+)$ index.php [QSA,L]- `- );- }- // await fs.writeFile(`${configuration.general.workdir}/.dockerignore`, 'node_modules')- if (staticDeployments.includes(configuration.build.pack)) {- await fs.writeFile(- `${configuration.general.workdir}/nginx.conf`,- `user nginx;- worker_processes auto;-- error_log /var/log/nginx/error.log warn;- pid /var/run/nginx.pid;-- events {- worker_connections 1024;- }-- http {- include /etc/nginx/mime.types;-- access_log off;- sendfile on;- #tcp_nopush on;- keepalive_timeout 65;-- server {- listen 80;- server_name localhost;-- location / {- root /usr/share/nginx/html;- index index.html;- try_files $uri $uri/index.html $uri/ /index.html =404;- }-- error_page 404 /50x.html;-- # redirect server error pages to the static page /50x.html- #- error_page 500 502 503 504 /50x.html;- location = /50x.html {- root /usr/share/nginx/html;- }-- }-- }- `- );- }- } catch (error) {- console.log(error);- throw new Error(error);- }-}diff --git a/src/lib/api/applications/deploy.ts b/src/lib/api/applications/deploy.tsdeleted file mode 100644index b09a22e374..0000000000--- a/src/lib/api/applications/deploy.ts+++ /dev/null@@ -1,80 +0,0 @@-import { docker } from '$lib/api/docker';-import { saveAppLog } from './logging';-import { promises as fs } from 'fs';-import { deleteSameDeployments, purgeImagesContainers } from './cleanup';-import yaml from 'js-yaml';-import { delay, execShellAsync } from '../common';--export default async function (configuration, nextStep) {- const generateEnvs = {};- for (const secret of configuration.publish.secrets) {- generateEnvs[secret.name] = secret.value;- }- const containerName = configuration.build.container.name;- const containerTag = configuration.build.container.tag;-- // Only save SHA256 of it in the configuration label- const baseServiceConfiguration = configuration.baseServiceConfiguration;- delete configuration.baseServiceConfiguration;-- const stack = {- version: '3.8',- services: {- [containerName]: {- image: `${containerName}:${containerTag}`,- networks: [`${docker.network}`],- environment: generateEnvs,- deploy: {- ...baseServiceConfiguration,- labels: [- 'managedBy=coolify',- 'type=application',- 'configuration=' + JSON.stringify(configuration),- 'traefik.enable=true',- 'traefik.http.services.' +- containerName +- `.loadbalancer.server.port=${configuration.publish.port}`,- 'traefik.http.routers.' + containerName + '.entrypoints=websecure',- 'traefik.http.routers.' +- containerName +- '.rule=Host(`' +- configuration.publish.domain +- '`) && PathPrefix(`' +- configuration.publish.path +- '`)',- 'traefik.http.routers.' + containerName + '.tls.certresolver=letsencrypt',- 'traefik.http.routers.' + containerName + '.middlewares=global-compress'- ]- }- }- },- networks: {- [`${docker.network}`]: {- external: true- }- }- };- await saveAppLog('### Publishing.', configuration);- await fs.writeFile(`${configuration.general.workdir}/stack.yml`, yaml.dump(stack));- if (nextStep === 2) {- // console.log('image changed')- await execShellAsync(- `docker service update --image ${containerName}:${containerTag} ${containerName}_${containerName}`- );- } else {- // console.log('new deployment or force deployment or config changed')- // if (originalDomain !== configuration.publish.domain) {- // await deleteSameDeployments(configuration, originalDomain);- // } else {- // await deleteSameDeployments(configuration);- // }- // await deleteSameDeployments(configuration);- await execShellAsync(- `cat ${configuration.general.workdir}/stack.yml | docker stack deploy --prune -c - ${containerName}`- );- }---- await saveAppLog('### Published done!', configuration);-}diff --git a/src/lib/api/applications/logging.ts b/src/lib/api/applications/logging.tsdeleted file mode 100644index 55cd648eec..0000000000--- a/src/lib/api/applications/logging.ts+++ /dev/null@@ -1,58 +0,0 @@-import Settings from '$models/Settings';-import ServerLog from '$models/ServerLog';-import ApplicationLog from '$models/ApplicationLog';-import dayjs from 'dayjs';-import { version } from '../../../../package.json';--function generateTimestamp() {- return `${dayjs().format('YYYY-MM-DD HH:mm:ss.SSS')} `;-}-const patterns = [- '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',- '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'-].join('|');--export async function saveAppLog(event, configuration, isError?: boolean) {- try {- const deployId = configuration.general.deployId;- const repoId = configuration.repository.id;- const branch = configuration.repository.branch;- if (isError) {- const clearedEvent =- '[ERROR 😱] ' +- generateTimestamp() +- event.replace(new RegExp(patterns, 'g'), '').replace(/(\r\n|\n|\r)/gm, '');- await new ApplicationLog({ repoId, branch, deployId, event: clearedEvent }).save();- } else {- if (event && event !== '\n') {- const clearedEvent =- '[INFO] ' +- generateTimestamp() +- event.replace(new RegExp(patterns, 'g'), '').replace(/(\r\n|\n|\r)/gm, '');- await new ApplicationLog({ repoId, branch, deployId, event: clearedEvent }).save();- }- }- } catch (error) {- console.log(error);- return error;- }-}--export async function saveServerLog(error) {- const settings = await Settings.findOne({ applicationName: 'coolify' });- const payload = {- message: error.message,- stack: error.stack,- type: error.type || 'spaghetticode',- version- };-- const found = await ServerLog.find(payload);- if (found.length === 0 && error.message) await new ServerLog(payload).save();- if (settings && settings.sendErrors && process.env.NODE_ENV === 'production') {- await fetch('https://errors.coollabs.io/api/error', {- method: 'POST',- body: JSON.stringify({ ...payload })- });- }-}diff --git a/src/lib/api/applications/packs/docker/index.ts b/src/lib/api/applications/packs/docker/index.tsdeleted file mode 100644index e3d9f01e3d..0000000000--- a/src/lib/api/applications/packs/docker/index.ts+++ /dev/null@@ -1,17 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';--export default async function (configuration) {- const path = `${configuration.general.workdir}/${- configuration.build.directory ? configuration.build.directory : ''- }`;- if (fs.stat(`${path}/Dockerfile`)) {- const stream = await docker.engine.buildImage(- { src: ['.'], context: path },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);- } else {- throw new Error('No custom dockerfile found.');- }-}diff --git a/src/lib/api/applications/packs/gatsby/index.ts b/src/lib/api/applications/packs/gatsby/index.tsdeleted file mode 100644index 9cb109979d..0000000000--- a/src/lib/api/applications/packs/gatsby/index.ts+++ /dev/null@@ -1,28 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-import { buildImage } from '../helpers';--// 'HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost/ || exit 1',-const publishStaticDocker = (configuration) => {- return [- 'FROM nginx:stable-alpine',- 'COPY nginx.conf /etc/nginx/nginx.conf',- 'WORKDIR /usr/share/nginx/html',- `COPY --from=${configuration.build.container.name}:${configuration.build.container.tag}-cache /usr/src/app/${configuration.publish.directory} ./`,- 'EXPOSE 80',- 'CMD ["nginx", "-g", "daemon off;"]'- ].join('\n');-};--export default async function (configuration) {- await buildImage(configuration, true);- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- publishStaticDocker(configuration)- );- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/helpers.ts b/src/lib/api/applications/packs/helpers.tsdeleted file mode 100644index 74bfabcd11..0000000000--- a/src/lib/api/applications/packs/helpers.ts+++ /dev/null@@ -1,43 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';--const buildImageNodeDocker = (configuration, prodBuild, generateEnvs) => {- return [- 'FROM node:lts',- ...generateEnvs,- 'WORKDIR /usr/src/app',- `COPY ${configuration.build.directory}/package*.json ./`,- configuration.build.command.installation && `RUN ${configuration.build.command.installation}`,- `COPY ./${configuration.build.directory} ./`,- `RUN ${configuration.build.command.build}`,- prodBuild && `RUN rm -fr node_modules && ${configuration.build.command.installation} --prod`- ].join('\n');-};-export async function buildImage(configuration, cacheBuild?: boolean, prodBuild?: boolean) {- // TODO: Edit secrets- // TODO: Add secret from .env file / json- const generateEnvs = [];- const dotEnv = []- for (const secret of configuration.publish.secrets) {- dotEnv.push(`${secret.name}=${secret.value}`)- if (secret.isBuild) generateEnvs.push(`ENV ${secret.name}=${secret.value}`)- }- await fs.writeFile(- `${configuration.general.workdir}/.env`,- dotEnv.join('\n')- )- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- buildImageNodeDocker(configuration, prodBuild, generateEnvs)- );- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- {- t: `${configuration.build.container.name}:${cacheBuild- ? `${configuration.build.container.tag}-cache`- : configuration.build.container.tag- }`- }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/nestjs/index.ts b/src/lib/api/applications/packs/nestjs/index.tsdeleted file mode 100644index 9443f3220b..0000000000--- a/src/lib/api/applications/packs/nestjs/index.ts+++ /dev/null@@ -1,31 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-import { buildImage } from '../helpers';-// `HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost:${configuration.publish.port}${configuration.publish.path} || exit 1`,-const publishNodejsDocker = (configuration) => {- return [- 'FROM node:lts',- 'WORKDIR /usr/src/app',- configuration.build.command.build- ? `COPY --from=${configuration.build.container.name}:${configuration.build.container.tag} /usr/src/app/${configuration.publish.directory} ./`- : `- COPY ${configuration.build.directory}/package*.json ./- RUN ${configuration.build.command.installation}- COPY ./${configuration.build.directory} ./`,- `EXPOSE ${configuration.publish.port}`,- `CMD ${configuration.build.command.start}`- ].join('\n');-};--export default async function (configuration) {- if (configuration.build.command.build) await buildImage(configuration, false, true);- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- publishNodejsDocker(configuration)- );- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/nextjs/index.ts b/src/lib/api/applications/packs/nextjs/index.tsdeleted file mode 100644index 0e550f78ec..0000000000--- a/src/lib/api/applications/packs/nextjs/index.ts+++ /dev/null@@ -1,30 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-import { buildImage } from '../helpers';-// `HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost:${configuration.publish.port}${configuration.publish.path} || exit 1`,-const publishNodejsDocker = (configuration) => {- return [- 'FROM node:lts',- 'WORKDIR /usr/src/app',- configuration.build.command.build- ? `COPY --from=${configuration.build.container.name}:${configuration.build.container.tag} /usr/src/app/${configuration.publish.directory} ./`- : `- COPY ${configuration.build.directory}/package*.json ./- RUN ${configuration.build.command.installation}- COPY ./${configuration.build.directory} ./`,- `EXPOSE ${configuration.publish.port}`,- `CMD ${configuration.build.command.start}`- ].join('\n');-};-export default async function (configuration) {- await buildImage(configuration);- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- publishNodejsDocker(configuration)- );- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/nodejs/index.ts b/src/lib/api/applications/packs/nodejs/index.tsdeleted file mode 100644index eef7842ae4..0000000000--- a/src/lib/api/applications/packs/nodejs/index.ts+++ /dev/null@@ -1,31 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-import { buildImage } from '../helpers';-// `HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost:${configuration.publish.port}${configuration.publish.path} || exit 1`,-const publishNodejsDocker = (configuration) => {- return [- 'FROM node:lts',- 'WORKDIR /usr/src/app',- configuration.build.command.build- ? `COPY --from=${configuration.build.container.name}:${configuration.build.container.tag} /usr/src/app/${configuration.publish.directory} ./`- : `- COPY ${configuration.build.directory}/package*.json ./- RUN ${configuration.build.command.installation}- COPY ./${configuration.build.directory} ./`,- `EXPOSE ${configuration.publish.port}`,- `CMD ${configuration.build.command.start}`- ].join('\n');-};--export default async function (configuration) {- if (configuration.build.command.build) await buildImage(configuration);- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- publishNodejsDocker(configuration)- );- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/nuxtjs/index.ts b/src/lib/api/applications/packs/nuxtjs/index.tsdeleted file mode 100644index a444dcf39b..0000000000--- a/src/lib/api/applications/packs/nuxtjs/index.ts+++ /dev/null@@ -1,31 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-import { buildImage } from '../helpers';-// `HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost:${configuration.publish.port}${configuration.publish.path} || exit 1`,-const publishNodejsDocker = (configuration) => {- return [- 'FROM node:lts',- 'WORKDIR /usr/src/app',- configuration.build.command.build- ? `COPY --from=${configuration.build.container.name}:${configuration.build.container.tag} /usr/src/app/${configuration.publish.directory} ./`- : `- COPY ${configuration.build.directory}/package*.json ./- RUN ${configuration.build.command.installation}- COPY ./${configuration.build.directory} ./`,- `EXPOSE ${configuration.publish.port}`,- `CMD ${configuration.build.command.start}`- ].join('\n');-};--export default async function (configuration) {- await buildImage(configuration);- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- publishNodejsDocker(configuration)- );- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/php/index.ts b/src/lib/api/applications/packs/php/index.tsdeleted file mode 100644index b576018c63..0000000000--- a/src/lib/api/applications/packs/php/index.ts+++ /dev/null@@ -1,25 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-// 'HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost/ || exit 1',-const publishPHPDocker = (configuration) => {- return [- 'FROM php:apache',- 'RUN a2enmod rewrite',- 'WORKDIR /usr/src/app',- `COPY ./${configuration.build.directory} /var/www/html`,- 'EXPOSE 80',- 'CMD ["apache2-foreground"]'- ].join('\n');-};--export default async function (configuration) {- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- publishPHPDocker(configuration)- );- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/python/index.ts b/src/lib/api/applications/packs/python/index.tsdeleted file mode 100644index 9998564fbe..0000000000--- a/src/lib/api/applications/packs/python/index.ts+++ /dev/null@@ -1,24 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-// `HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost:${configuration.publish.port}${configuration.publish.path} || exit 1`,-const publishPython = (configuration) => {- return [- 'FROM python:3-alpine',- 'WORKDIR /usr/src/app',- 'RUN pip install gunicorn',- `COPY ./${configuration.build.directory}/requirements.txt ./`,- `RUN pip install --no-cache-dir -r ./${configuration.build.directory}/requirements.txt`,- `COPY ./${configuration.build.directory}/ .`,- `EXPOSE ${configuration.publish.port}`,- `CMD gunicorn -w=4 ${configuration.build.command.python.module}:${configuration.build.command.python.instance}`- ].join('\n');-};--export default async function (configuration) {- await fs.writeFile(`${configuration.general.workdir}/Dockerfile`, publishPython(configuration));- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/react/index.ts b/src/lib/api/applications/packs/react/index.tsdeleted file mode 100644index 9cb109979d..0000000000--- a/src/lib/api/applications/packs/react/index.ts+++ /dev/null@@ -1,28 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-import { buildImage } from '../helpers';--// 'HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost/ || exit 1',-const publishStaticDocker = (configuration) => {- return [- 'FROM nginx:stable-alpine',- 'COPY nginx.conf /etc/nginx/nginx.conf',- 'WORKDIR /usr/share/nginx/html',- `COPY --from=${configuration.build.container.name}:${configuration.build.container.tag}-cache /usr/src/app/${configuration.publish.directory} ./`,- 'EXPOSE 80',- 'CMD ["nginx", "-g", "daemon off;"]'- ].join('\n');-};--export default async function (configuration) {- await buildImage(configuration, true);- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- publishStaticDocker(configuration)- );- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/rust/index.ts b/src/lib/api/applications/packs/rust/index.tsdeleted file mode 100644index c11a9db328..0000000000--- a/src/lib/api/applications/packs/rust/index.ts+++ /dev/null@@ -1,66 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-import TOML from '@iarna/toml';-import { execShellAsync } from '$lib/api/common';--const publishRustDocker = (configuration, custom) => {- return [- 'FROM rust:latest',- 'WORKDIR /app',- `COPY --from=${configuration.build.container.name}:cache /app/target target`,- `COPY --from=${configuration.build.container.name}:cache /usr/local/cargo /usr/local/cargo`,- 'COPY . .',- `RUN cargo build --release --bin ${custom.name}`,- 'FROM debian:buster-slim',- 'WORKDIR /app',- '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 update-ca-certificates',- `COPY --from=${configuration.build.container.name}:cache /app/target/release/${custom.name} ${custom.name}`,- `EXPOSE ${configuration.publish.port}`,- `CMD ["/app/${custom.name}"]`- ].join('\n');-};--const cacheRustDocker = (configuration, custom) => {- return [- `FROM rust:latest AS planner-${configuration.build.container.name}`,- 'WORKDIR /app',- 'RUN cargo install cargo-chef',- 'COPY . .',- 'RUN cargo chef prepare --recipe-path recipe.json',- 'FROM rust:latest',- 'WORKDIR /app',- 'RUN cargo install cargo-chef',- `COPY --from=planner-${configuration.build.container.name} /app/recipe.json recipe.json`,- 'RUN cargo chef cook --release --recipe-path recipe.json'- ].join('\n');-};--export default async function (configuration) {- const cargoToml = await execShellAsync(`cat ${configuration.general.workdir}/Cargo.toml`);- const parsedToml = TOML.parse(cargoToml);- const custom = {- name: parsedToml.package.name- };- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- cacheRustDocker(configuration, custom)- );-- let stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:cache` }- );- await streamEvents(stream, configuration);-- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- publishRustDocker(configuration, custom)- );-- stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/static/index.ts b/src/lib/api/applications/packs/static/index.tsdeleted file mode 100644index 5f4d5c302e..0000000000--- a/src/lib/api/applications/packs/static/index.ts+++ /dev/null@@ -1,30 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-import { buildImage } from '../helpers';--// 'HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost/ || exit 1',-const publishStaticDocker = (configuration) => {- return [- 'FROM nginx:stable-alpine',- 'COPY nginx.conf /etc/nginx/nginx.conf',- 'WORKDIR /usr/share/nginx/html',- configuration.build.command.build- ? `COPY --from=${configuration.build.container.name}:${configuration.build.container.tag}-cache /usr/src/app/${configuration.publish.directory} ./`- : `COPY ./${configuration.build.directory} ./`,- 'EXPOSE 80',- 'CMD ["nginx", "-g", "daemon off;"]'- ].join('\n');-};--export default async function (configuration) {- if (configuration.build.command.build) await buildImage(configuration, true);- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- publishStaticDocker(configuration)- );- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/svelte/index.ts b/src/lib/api/applications/packs/svelte/index.tsdeleted file mode 100644index 9cb109979d..0000000000--- a/src/lib/api/applications/packs/svelte/index.ts+++ /dev/null@@ -1,28 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-import { buildImage } from '../helpers';--// 'HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost/ || exit 1',-const publishStaticDocker = (configuration) => {- return [- 'FROM nginx:stable-alpine',- 'COPY nginx.conf /etc/nginx/nginx.conf',- 'WORKDIR /usr/share/nginx/html',- `COPY --from=${configuration.build.container.name}:${configuration.build.container.tag}-cache /usr/src/app/${configuration.publish.directory} ./`,- 'EXPOSE 80',- 'CMD ["nginx", "-g", "daemon off;"]'- ].join('\n');-};--export default async function (configuration) {- await buildImage(configuration, true);- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- publishStaticDocker(configuration)- );- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/packs/templates.ts b/src/lib/api/applications/packs/templates.tsdeleted file mode 100644index 07d0faaa63..0000000000--- a/src/lib/api/applications/packs/templates.ts+++ /dev/null@@ -1,66 +0,0 @@-const defaultBuildAndDeploy = {- installation: 'yarn install',- build: 'yarn build',- start: 'yarn start'-};--const templates = {- svelte: {- pack: 'svelte',- ...defaultBuildAndDeploy,- directory: 'public',- name: 'Svelte'- },- '@nestjs/core': {- pack: 'nestjs',- ...defaultBuildAndDeploy,- start: 'yarn start:prod',- port: 3000,- name: 'NestJS'- },- next: {- pack: 'nextjs',- ...defaultBuildAndDeploy,- port: 3000,- name: 'NextJS'- },- nuxt: {- pack: 'nuxtjs',- ...defaultBuildAndDeploy,- port: 3000,- name: 'NuxtJS'- },- 'react-scripts': {- pack: 'react',- ...defaultBuildAndDeploy,- directory: 'build',- name: 'React'- },- 'parcel-bundler': {- pack: 'static',- ...defaultBuildAndDeploy,- directory: 'dist',- name: 'Parcel'- },- '@vue/cli-service': {- pack: 'vuejs',- ...defaultBuildAndDeploy,- directory: 'dist',- port: 80,- name: 'Vue'- },- gatsby: {- pack: 'gatsby',- ...defaultBuildAndDeploy,- directory: 'public',- name: 'Gatsby'- },- 'preact-cli': {- pack: 'react',- ...defaultBuildAndDeploy,- directory: 'build',- name: 'Preact'- }-};--export default templates;diff --git a/src/lib/api/applications/packs/vuejs/index.ts b/src/lib/api/applications/packs/vuejs/index.tsdeleted file mode 100644index d0f688a9af..0000000000--- a/src/lib/api/applications/packs/vuejs/index.ts+++ /dev/null@@ -1,28 +0,0 @@-import { docker, streamEvents } from '$lib/api/docker';-import { promises as fs } from 'fs';-import { buildImage } from '../helpers';--// 'HEALTHCHECK --timeout=10s --start-period=10s --interval=5s CMD curl -I -s -f http://localhost/ || exit 1',-const publishStaticDocker = (configuration) => {- return [- 'FROM nginx:stable-alpine',- 'COPY nginx.conf /etc/nginx/nginx.conf',- 'WORKDIR /usr/share/nginx/html',- `COPY --from=${configuration.build.container.name}:${configuration.build.container.tag}-cache /usr/src/app/${configuration.publish.directory} ./`,- 'EXPOSE 80',- 'CMD ["nginx", "-g", "daemon off;"]'- ].join('\n');-};--export default async function (configuration) {- await buildImage(configuration, true);- await fs.writeFile(- `${configuration.general.workdir}/Dockerfile`,- publishStaticDocker(configuration)- );- const stream = await docker.engine.buildImage(- { src: ['.'], context: configuration.general.workdir },- { t: `${configuration.build.container.name}:${configuration.build.container.tag}` }- );- await streamEvents(stream, configuration);-}diff --git a/src/lib/api/applications/preChecks.ts b/src/lib/api/applications/preChecks.tsdeleted file mode 100644index 738e9353b3..0000000000--- a/src/lib/api/applications/preChecks.ts+++ /dev/null@@ -1,76 +0,0 @@-import Configuration from "$models/Configuration";-import { compareObjects, execShellAsync } from "../common";--export default async function (configuration) {- /*- 0 => nothing changed, no need to redeploy- 1 => force update- 2 => configuration changed- 3 => continue normally- */- const currentConfiguration = await Configuration.findOne({- 'general.nickname': configuration.general.nickname- })- if (currentConfiguration) {- // Base service configuration changed- if (- !currentConfiguration.build.container.baseSHA ||- currentConfiguration.build.container.baseSHA !== configuration.build.container.baseSHA- ) {- return 1- }-- // If the deployment is in error state, forceUpdate- try {- const state = await execShellAsync(- `docker stack ps ${currentConfiguration.build.container.name} --format '{{ json . }}'`- );- const isError = state- .split('\n')- .filter((n) => n)- .map((s) => JSON.parse(s))- .filter(- (n) =>- n.DesiredState !== 'Running' && n.Image.split(':')[1] === currentConfiguration.build.container.tag- );- if (isError.length > 0) {- return 1- }- } catch(error) {- console.log(error)- }--- // If previewDeployments enabled- if (- currentConfiguration.general.isPreviewDeploymentEnabled &&- currentConfiguration.general.pullRequest !== 0- ) {- return 1- }- // If build pack changed, forceUpdate the service- if (currentConfiguration.build.pack !== configuration.build.pack) {- return 1- }-- const currentConfigurationCompare = JSON.parse(JSON.stringify(currentConfiguration));- const configurationCompare = JSON.parse(JSON.stringify(configuration));- delete currentConfigurationCompare.build.container;- delete configurationCompare.build.container;-- if (- !compareObjects(currentConfigurationCompare.build, configurationCompare.build) ||- !compareObjects(currentConfigurationCompare.publish, configurationCompare.publish) ||- currentConfigurationCompare.general.isPreviewDeploymentEnabled !==- configurationCompare.general.isPreviewDeploymentEnabled- ) {- return 1- }-- if (currentConfiguration.build.container.tag !== configuration.build.container.tag) {- return 2- }- return 0- }- return 3-}\ No newline at end of filediff --git a/src/lib/api/applications/preTasks.ts b/src/lib/api/applications/preTasks.tsdeleted file mode 100644index 0c2cb0e78b..0000000000--- a/src/lib/api/applications/preTasks.ts+++ /dev/null@@ -1,44 +0,0 @@-import Configuration from "$models/Configuration";-import Deployment from "$models/Deployment";--export default async function (configuration) {- // Check if deployment is already queued- const alreadyQueued = await Deployment.find({- path: configuration.publish.path,- domain: configuration.publish.domain,- progress: { $in: ['queued', 'inprogress'] }- });- if (alreadyQueued.length > 0) {- return {- status: 200,- body: {- success: false,- message: 'Deployment already queued.'- }- };- }- const { id, organization, name, branch } = configuration.repository;- const { domain, path } = configuration.publish;- const { deployId, nickname } = configuration.general;- // Save new deployment- await new Deployment({- repoId: id,- branch,- deployId,- domain,- organization,- name,- nickname- }).save();-- await Configuration.findOneAndUpdate(- {- 'publish.domain': domain,- 'publish.path': path,- 'general.pullRequest': { $in: [null, 0] }- },- { ...configuration },- { upsert: true, new: true }- );- return-}\ No newline at end of filediff --git a/src/lib/api/applications/queueAndBuild.ts b/src/lib/api/applications/queueAndBuild.tsdeleted file mode 100644index d3342c2c2e..0000000000--- a/src/lib/api/applications/queueAndBuild.ts+++ /dev/null@@ -1,32 +0,0 @@-import Deployment from '$models/Deployment';-import dayjs from 'dayjs';-import buildContainer from './buildContainer';-import { purgeImagesContainers } from './cleanup';-import { updateServiceLabels } from './configuration';-import copyFiles from './copyFiles';-import deploy from './deploy';-import { saveAppLog } from './logging';--export default async function (configuration, nextStep) {- const { id, organization, name, branch } = configuration.repository;- const { domain } = configuration.publish;- const { deployId } = configuration.general;- try {- await saveAppLog(`### Successfully queued.`, configuration);- await copyFiles(configuration);- await buildContainer(configuration);- await deploy(configuration, nextStep);- await Deployment.findOneAndUpdate(- { repoId: id, branch, deployId, organization, name, domain },- { repoId: id, branch, deployId, organization, name, domain, progress: 'done' }- );-- await updateServiceLabels(configuration);- await purgeImagesContainers(configuration);- } catch (error) {- await Deployment.findOneAndUpdate(- { repoId: id, branch, deployId, organization, name, domain },- { repoId: id, branch, deployId, organization, name, domain, progress: 'failed' }- );- }-}diff --git a/src/lib/api/common.ts b/src/lib/api/common.tsdeleted file mode 100644index 82575972df..0000000000--- a/src/lib/api/common.ts+++ /dev/null@@ -1,72 +0,0 @@-import shell from 'shelljs';-import User from '$models/User';-import jsonwebtoken from 'jsonwebtoken';-import { saveServerLog } from './applications/logging';--export function execShellAsync(cmd, opts = {}) {- try {- return new Promise(function (resolve, reject) {- shell.config.silent = true;- shell.exec(cmd, opts, async function (code, stdout, stderr) {- if (code !== 0) {- await saveServerLog({ message: JSON.stringify({ cmd, opts, code, stdout, stderr }) });- return reject(new Error(stderr));- }- return resolve(stdout);- });- });- } catch (error) {- return new Error('Oops');- }-}-export function cleanupTmp(dir) {- if (dir !== '/') shell.rm('-fr', dir);-}--export async function verifyUserId(token) {- const { JWT_SIGN_KEY } = process.env;- try {- const verify = jsonwebtoken.verify(token, JWT_SIGN_KEY);- const found = await User.findOne({ uid: verify.jti });- if (found) {- return Promise.resolve(true);- } else {- return Promise.reject(false);- }- } catch (error) {- console.log(error);- return Promise.reject(false);- }-}--export function delay(t) {- return new Promise(function (resolve) {- setTimeout(function () {- resolve('OK');- }, t);- });-}---export function compareObjects(a, b) {- if (a === b) return true;-- if (typeof a != 'object' || typeof b != 'object' || a == null || b == null) return false;-- const keysA = Object.keys(a),- keysB = Object.keys(b);-- if (keysA.length != keysB.length) return false;-- for (const key of keysA) {- if (!keysB.includes(key)) return false;-- if (typeof a[key] === 'function' || typeof b[key] === 'function') {- if (a[key].toString() != b[key].toString()) return false;- } else {- if (!compareObjects(a[key], b[key])) return false;- }- }-- return true;-};\ No newline at end of filediff --git a/src/lib/api/docker.ts b/src/lib/api/docker.tsdeleted file mode 100644index 0c623e590b..0000000000--- a/src/lib/api/docker.ts+++ /dev/null@@ -1,27 +0,0 @@-import Dockerode from 'dockerode';-import { saveAppLog } from './applications/logging';--const { DOCKER_ENGINE, DOCKER_NETWORK } = process.env;-export const docker = {- engine: new Dockerode({- socketPath: DOCKER_ENGINE- }),- network: DOCKER_NETWORK-};-export async function streamEvents(stream, configuration) {- await new Promise((resolve, reject) => {- docker.engine.modem.followProgress(stream, onFinished, onProgress);- function onFinished(err, res) {- if (err) reject(err);- resolve(res);- }- function onProgress(event) {- if (event.error) {- saveAppLog(event.error, configuration, true);- reject(event.error);- } else if (event.stream) {- saveAppLog(event.stream, configuration);- }- }- });-}diff --git a/src/lib/api/github.ts b/src/lib/api/github.tsdeleted file mode 100644index 7ffef6cc4a..0000000000--- a/src/lib/api/github.ts+++ /dev/null@@ -1,23 +0,0 @@-import type { Request } from '@sveltejs/kit';--export async function githubAPI(- request: Request,- resource: string,- token?: string,- data?: Record<string, unknown>-) {- const base = 'https://api.github.com';- const res = await fetch(`${base}${resource}`, {- method: request.method,- headers: {- 'content-type': 'application/json',- accept: 'application/json',- authorization: token ? `token ${token}` : ''- },- body: data && JSON.stringify(data)- });- return {- status: res.status,- body: await res.json()- };-}diff --git a/src/lib/buildPacks/common.ts b/src/lib/buildPacks/common.tsnew file mode 100644index 0000000000..a156864df1--- /dev/null+++ b/src/lib/buildPacks/common.ts@@ -0,0 +1,191 @@+import { base64Encode } from '$lib/crypto';+import { getDomain, saveBuildLog, version } from '$lib/common';+import * as db from '$lib/database';+import { scanningTemplates } from '$lib/components/templates';+import { promises as fs } from 'fs';+import { staticDeployments } from '$lib/components/common';++export function makeLabelForStandaloneApplication({+ applicationId,+ fqdn,+ name,+ type,+ pullmergeRequestId = null,+ buildPack,+ repository,+ branch,+ projectId,+ port,+ commit,+ installCommand,+ buildCommand,+ startCommand,+ baseDirectory,+ publishDirectory+}) {+ if (pullmergeRequestId) {+ const protocol = fqdn.startsWith('https://') ? 'https' : 'http';+ const domain = getDomain(fqdn);+ fqdn = `${protocol}://${pullmergeRequestId}.${domain}`;+ }+ return [+ '--label coolify.managed=true',+ `--label coolify.version=${version}`,+ `--label coolify.type=standalone-application`,+ `--label coolify.configuration=${base64Encode(+ JSON.stringify({+ applicationId,+ fqdn,+ name,+ type,+ pullmergeRequestId,+ buildPack,+ repository,+ branch,+ projectId,+ port,+ commit,+ installCommand,+ buildCommand,+ startCommand,+ baseDirectory,+ publishDirectory+ })+ )}`+ ];+}+export async function makeLabelForStandaloneDatabase({ id, image, volume }) {+ const database = await db.prisma.database.findFirst({ where: { id } });+ delete database.destinationDockerId;+ delete database.createdAt;+ delete database.updatedAt;+ return [+ 'coolify.managed=true',+ `coolify.version=${version}`,+ `coolify.type=standalone-database`,+ `coolify.configuration=${base64Encode(+ JSON.stringify({+ version,+ image,+ volume,+ ...database+ })+ )}`+ ];+}++export async function makeLabelForPlausibleAnalytics({ id, images, volume }) {+ const service = await db.prisma.service.findFirst({+ where: { id },+ include: { plausibleAnalytics: true }+ });+ delete service.destinationDockerId;+ delete service.createdAt;+ delete service.updatedAt;+ return [+ 'coolify.managed=true',+ `coolify.version=${version}`,+ `coolify.type=service-plausibleanalytics`,+ `coolify.configuration=${base64Encode(+ JSON.stringify({+ version,+ images,+ volume,+ ...service+ })+ )}`+ ];+}++export const setDefaultConfiguration = async (data) => {+ let { buildPack, port, installCommand, startCommand, buildCommand, publishDirectory } = data;+ const template = scanningTemplates[buildPack];+ if (!port) {+ port = template?.port || 3000;++ if (buildPack === 'static') port = 80;+ else if (buildPack === 'node') port = 3000;+ else if (buildPack === 'php') port = 80;+ }+ if (!installCommand) installCommand = template?.installCommand || 'yarn install';+ if (!startCommand) startCommand = template?.startCommand || 'yarn start';+ if (!buildCommand) buildCommand = template?.buildCommand || null;+ if (!publishDirectory) publishDirectory = template?.publishDirectory || null;++ return {+ buildPack,+ port,+ installCommand,+ startCommand,+ buildCommand,+ publishDirectory+ };+};++export async function copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId) {+ try {+ // TODO: Write full .dockerignore for all deployments!!+ if (buildPack === 'php') {+ await fs.writeFile(+ `${workdir}/.htaccess`,+ `+ RewriteEngine On+ RewriteBase /+ RewriteCond %{REQUEST_FILENAME} !-d+ RewriteCond %{REQUEST_FILENAME} !-f+ RewriteRule ^(.+)$ index.php [QSA,L]+ `+ );+ saveBuildLog({ line: 'Copied default configuration file for PHP.', buildId, applicationId });+ } else if (staticDeployments.includes(buildPack)) {+ await fs.writeFile(+ `${workdir}/nginx.conf`,+ `user nginx;+ worker_processes auto;++ error_log /var/log/nginx/error.log warn;+ pid /var/run/nginx.pid;++ events {+ worker_connections 1024;+ }++ http {+ include /etc/nginx/mime.types;++ access_log off;+ sendfile on;+ #tcp_nopush on;+ keepalive_timeout 65;++ server {+ listen 80;+ server_name localhost;++ location / {+ root /usr/share/nginx/html;+ index index.html;+ try_files $uri $uri/index.html $uri/ /index.html =404;+ }++ error_page 404 /50x.html;++ # redirect server error pages to the static page /50x.html+ #+ error_page 500 502 503 504 /50x.html;+ location = /50x.html {+ root /usr/share/nginx/html;+ }++ }++ }+ `+ );+ saveBuildLog({ line: 'Copied default configuration file.', buildId, applicationId });+ }+ } catch (error) {+ console.log(error);+ throw new Error(error);+ }+}diff --git a/src/lib/buildPacks/docker.ts b/src/lib/buildPacks/docker.tsnew file mode 100644index 0000000000..5bc6ce4536--- /dev/null+++ b/src/lib/buildPacks/docker.ts@@ -0,0 +1,36 @@+import { buildImage } from '$lib/docker';+import { promises as fs } from 'fs';++export default async function ({+ applicationId,+ debug,+ tag,+ workdir,+ docker,+ buildId,+ baseDirectory,+ secrets+}) {+ try {+ let file = `${workdir}/Dockerfile`;+ if (baseDirectory) {+ file = `${workdir}/${baseDirectory}/Dockerfile`;+ }++ const Dockerfile: Array<string> = (await fs.readFile(`${file}`, 'utf8'))+ .toString()+ .trim()+ .split('\n');+ if (secrets.length > 0) {+ secrets.forEach((secret) => {+ if (secret.isBuildSecret) {+ Dockerfile.push(`ARG ${secret.name} ${secret.value}`);+ }+ });+ }+ await fs.writeFile(`${file}`, Dockerfile.join('\n'));+ await buildImage({ applicationId, tag, workdir, docker, buildId, debug });+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/buildPacks/gatsby.ts b/src/lib/buildPacks/gatsby.tsnew file mode 100644index 0000000000..fd14959953--- /dev/null+++ b/src/lib/buildPacks/gatsby.ts@@ -0,0 +1,27 @@+import { buildCacheImageWithNode, buildImage } from '$lib/docker';+import { promises as fs } from 'fs';++const createDockerfile = async (data, imageforBuild): Promise<void> => {+ const { applicationId, tag, workdir, publishDirectory } = data;+ const Dockerfile: Array<string> = [];++ Dockerfile.push(`FROM ${imageforBuild}`);+ Dockerfile.push('WORKDIR /usr/share/nginx/html');+ Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);+ Dockerfile.push(`EXPOSE 80`);+ Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));+};++export default async function (data) {+ try {+ const image = 'nginx:stable-alpine';+ const imageForBuild = 'node:lts';++ await buildCacheImageWithNode(data, imageForBuild);+ await createDockerfile(data, image);+ await buildImage(data);+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/api/applications/packs/index.ts b/src/lib/buildPacks/index.tssimilarity index 73%rename from src/lib/api/applications/packs/index.tsrename to src/lib/buildPacks/index.tsindex 5f7c8c9c88..c8b133b5c2 100644--- a/src/lib/api/applications/packs/index.ts+++ b/src/lib/buildPacks/index.ts@@ -1,29 +1,27 @@-import vuejs from './vuejs';+import node from './node';+import staticApp from './static';+import docker from './docker';+import gatsby from './gatsby';import svelte from './svelte';-import Static from './static';-import rust from './rust';import react from './react';-import php from './php';-import nuxtjs from './nuxtjs';-import nodejs from './nodejs';-import nextjs from './nextjs';import nestjs from './nestjs';-import gatsby from './gatsby';-import docker from './docker';-import python from './python';+import nextjs from './nextjs';+import nuxtjs from './nuxtjs';+import vuejs from './vuejs';+import php from './php';+import rust from './rust';export {- vuejs,+ node,+ staticApp as static,+ docker,+ gatsby,svelte,- Static as static,- rust,react,- php,- nuxtjs,- nodejs,- nextjs,nestjs,- gatsby,- docker,- python+ nextjs,+ nuxtjs,+ vuejs,+ php,+ rust};diff --git a/src/lib/buildPacks/nestjs.ts b/src/lib/buildPacks/nestjs.tsnew file mode 100644index 0000000000..0a8bf9f38c--- /dev/null+++ b/src/lib/buildPacks/nestjs.ts@@ -0,0 +1,29 @@+import { buildCacheImageWithNode, buildImage } from '$lib/docker';+import { promises as fs } from 'fs';++const createDockerfile = async (data, image): Promise<void> => {+ const { applicationId, tag, port, startCommand, workdir, baseDirectory } = data;+ const Dockerfile: Array<string> = [];++ Dockerfile.push(`FROM ${image}`);+ Dockerfile.push('WORKDIR /usr/src/app');+ Dockerfile.push(+ `COPY --from=${applicationId}:${tag}-cache /usr/src/app/${baseDirectory || ''} ./`+ );+ Dockerfile.push(`EXPOSE ${port}`);+ Dockerfile.push(`CMD ${startCommand}`);+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));+};++export default async function (data) {+ try {+ const image = 'node:lts';+ const imageForBuild = 'node:lts';++ await buildCacheImageWithNode(data, imageForBuild);+ await createDockerfile(data, image);+ await buildImage(data);+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/buildPacks/nextjs.ts b/src/lib/buildPacks/nextjs.tsnew file mode 100644index 0000000000..53a7f884e3--- /dev/null+++ b/src/lib/buildPacks/nextjs.ts@@ -0,0 +1,45 @@+import { buildImage } from '$lib/docker';+import { promises as fs } from 'fs';++const createDockerfile = async (data, image): Promise<void> => {+ const { workdir, port, installCommand, buildCommand, startCommand, baseDirectory, secrets } =+ data;+ const Dockerfile: Array<string> = [];++ Dockerfile.push(`FROM ${image}`);+ Dockerfile.push('WORKDIR /usr/src/app');+ if (secrets.length > 0) {+ secrets.forEach((secret) => {+ if (secret.isBuildSecret) {+ Dockerfile.push(`ARG ${secret.name} ${secret.value}`);+ }+ });+ }+ 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(`COPY ./${baseDirectory || ''} ./`);+ if (buildCommand) {+ Dockerfile.push(`RUN ${buildCommand}`);+ }+ Dockerfile.push(`EXPOSE ${port}`);+ Dockerfile.push(`CMD ${startCommand}`);+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));+};++export default async function (data) {+ try {+ const image = 'node:lts';+ await createDockerfile(data, image);+ await buildImage(data);+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/buildPacks/node.ts b/src/lib/buildPacks/node.tsnew file mode 100644index 0000000000..53a7f884e3--- /dev/null+++ b/src/lib/buildPacks/node.ts@@ -0,0 +1,45 @@+import { buildImage } from '$lib/docker';+import { promises as fs } from 'fs';++const createDockerfile = async (data, image): Promise<void> => {+ const { workdir, port, installCommand, buildCommand, startCommand, baseDirectory, secrets } =+ data;+ const Dockerfile: Array<string> = [];++ Dockerfile.push(`FROM ${image}`);+ Dockerfile.push('WORKDIR /usr/src/app');+ if (secrets.length > 0) {+ secrets.forEach((secret) => {+ if (secret.isBuildSecret) {+ Dockerfile.push(`ARG ${secret.name} ${secret.value}`);+ }+ });+ }+ 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(`COPY ./${baseDirectory || ''} ./`);+ if (buildCommand) {+ Dockerfile.push(`RUN ${buildCommand}`);+ }+ Dockerfile.push(`EXPOSE ${port}`);+ Dockerfile.push(`CMD ${startCommand}`);+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));+};++export default async function (data) {+ try {+ const image = 'node:lts';+ await createDockerfile(data, image);+ await buildImage(data);+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/buildPacks/nuxtjs.ts b/src/lib/buildPacks/nuxtjs.tsnew file mode 100644index 0000000000..53a7f884e3--- /dev/null+++ b/src/lib/buildPacks/nuxtjs.ts@@ -0,0 +1,45 @@+import { buildImage } from '$lib/docker';+import { promises as fs } from 'fs';++const createDockerfile = async (data, image): Promise<void> => {+ const { workdir, port, installCommand, buildCommand, startCommand, baseDirectory, secrets } =+ data;+ const Dockerfile: Array<string> = [];++ Dockerfile.push(`FROM ${image}`);+ Dockerfile.push('WORKDIR /usr/src/app');+ if (secrets.length > 0) {+ secrets.forEach((secret) => {+ if (secret.isBuildSecret) {+ Dockerfile.push(`ARG ${secret.name} ${secret.value}`);+ }+ });+ }+ 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(`COPY ./${baseDirectory || ''} ./`);+ if (buildCommand) {+ Dockerfile.push(`RUN ${buildCommand}`);+ }+ Dockerfile.push(`EXPOSE ${port}`);+ Dockerfile.push(`CMD ${startCommand}`);+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));+};++export default async function (data) {+ try {+ const image = 'node:lts';+ await createDockerfile(data, image);+ await buildImage(data);+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/buildPacks/php.ts b/src/lib/buildPacks/php.tsnew file mode 100644index 0000000000..cf8e49f987--- /dev/null+++ b/src/lib/buildPacks/php.ts@@ -0,0 +1,25 @@+import { buildImage } from '$lib/docker';+import { promises as fs } from 'fs';++const createDockerfile = async (data, image): Promise<void> => {+ const { workdir, baseDirectory } = data;+ const Dockerfile: Array<string> = [];++ Dockerfile.push(`FROM ${image}`);+ Dockerfile.push('RUN a2enmod rewrite');+ Dockerfile.push('WORKDIR /var/www/html');+ Dockerfile.push(`COPY ./${baseDirectory || ''} /var/www/html`);+ Dockerfile.push(`EXPOSE 80`);+ Dockerfile.push('CMD ["apache2-foreground"]');+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));+};++export default async function (data) {+ try {+ const image = 'php:apache';+ await createDockerfile(data, image);+ await buildImage(data);+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/buildPacks/react.ts b/src/lib/buildPacks/react.tsnew file mode 100644index 0000000000..859544281f--- /dev/null+++ b/src/lib/buildPacks/react.ts@@ -0,0 +1,26 @@+import { buildCacheImageWithNode, buildImage } from '$lib/docker';+import { promises as fs } from 'fs';++const createDockerfile = async (data, image): Promise<void> => {+ const { applicationId, tag, workdir, publishDirectory } = data;+ const Dockerfile: Array<string> = [];++ Dockerfile.push(`FROM ${image}`);+ Dockerfile.push('WORKDIR /usr/share/nginx/html');+ Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);+ Dockerfile.push(`EXPOSE 80`);+ Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));+};++export default async function (data) {+ try {+ const image = 'nginx:stable-alpine';+ const imageForBuild = 'node:lts';+ await buildCacheImageWithNode(data, imageForBuild);+ await createDockerfile(data, image);+ await buildImage(data);+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/buildPacks/rust.ts b/src/lib/buildPacks/rust.tsnew file mode 100644index 0000000000..0af47c44cc--- /dev/null+++ b/src/lib/buildPacks/rust.ts@@ -0,0 +1,43 @@+import { asyncExecShell } from '$lib/common';+import { buildCacheImageWithCargo, buildImage } from '$lib/docker';+import { promises as fs } from 'fs';+import TOML from '@iarna/toml';++const createDockerfile = async (data, image, name): Promise<void> => {+ const { workdir, port, applicationId, tag } = data;+ const Dockerfile: Array<string> = [];+ Dockerfile.push(`FROM ${image}`);+ Dockerfile.push('WORKDIR /usr/src/app');+ Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/target target`);+ Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/local/cargo /usr/local/cargo`);+ Dockerfile.push(`COPY . .`);+ Dockerfile.push(`RUN cargo build --release --bin ${name}`);+ Dockerfile.push('FROM debian:buster-slim');+ Dockerfile.push('WORKDIR /usr/src/app');+ 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/*`+ );+ Dockerfile.push(`RUN update-ca-certificates`);+ Dockerfile.push(+ `COPY --from=${applicationId}:${tag}-cache /usr/src/app/target/release/${name} ${name}`+ );+ Dockerfile.push(`EXPOSE ${port}`);+ Dockerfile.push(`CMD ["/usr/src/app/${name}"]`);+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));+};++export default async function (data) {+ try {+ const { workdir } = data;+ const image = 'rust:latest';+ const imageForBuild = 'rust:latest';+ const { stdout: cargoToml } = await asyncExecShell(`cat ${workdir}/Cargo.toml`);+ const parsedToml: any = TOML.parse(cargoToml);+ const name = parsedToml.package.name;+ await buildCacheImageWithCargo(data, imageForBuild);+ await createDockerfile(data, image, name);+ await buildImage(data);+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/buildPacks/static.ts b/src/lib/buildPacks/static.tsnew file mode 100644index 0000000000..0db1a0c83d--- /dev/null+++ b/src/lib/buildPacks/static.ts@@ -0,0 +1,40 @@+import { buildCacheImageWithNode, buildImage } from '$lib/docker';+import { promises as fs } from 'fs';++const createDockerfile = async (data, image): Promise<void> => {+ const { applicationId, tag, workdir, buildCommand, baseDirectory, publishDirectory, secrets } =+ data;+ const Dockerfile: Array<string> = [];++ Dockerfile.push(`FROM ${image}`);+ Dockerfile.push('WORKDIR /usr/share/nginx/html');+ if (secrets.length > 0) {+ secrets.forEach((secret) => {+ if (secret.isBuildSecret) {+ Dockerfile.push(`ARG ${secret.name} ${secret.value}`);+ }+ });+ }+ if (buildCommand) {+ Dockerfile.push(+ `COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`+ );+ } else {+ Dockerfile.push(`COPY ./${baseDirectory || ''} ./`);+ }+ Dockerfile.push(`EXPOSE 80`);+ Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));+};++export default async function (data) {+ try {+ const image = 'nginx:stable-alpine';+ const imageForBuild = 'node:lts';+ if (data.buildCommand) await buildCacheImageWithNode(data, imageForBuild);+ await createDockerfile(data, image);+ await buildImage(data);+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/buildPacks/svelte.ts b/src/lib/buildPacks/svelte.tsnew file mode 100644index 0000000000..9a730eb63e--- /dev/null+++ b/src/lib/buildPacks/svelte.ts@@ -0,0 +1,27 @@+import { buildCacheImageWithNode, buildImage } from '$lib/docker';+import { promises as fs } from 'fs';++const createDockerfile = async (data, image): Promise<void> => {+ const { applicationId, tag, workdir, publishDirectory } = data;+ const Dockerfile: Array<string> = [];++ Dockerfile.push(`FROM ${image}`);+ Dockerfile.push('WORKDIR /usr/share/nginx/html');+ Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);+ Dockerfile.push(`EXPOSE 80`);+ Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));+};++export default async function (data) {+ try {+ const image = 'nginx:stable-alpine';+ const imageForBuild = 'node:lts';++ await buildCacheImageWithNode(data, imageForBuild);+ await createDockerfile(data, image);+ await buildImage(data);+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/buildPacks/vuejs.ts b/src/lib/buildPacks/vuejs.tsnew file mode 100644index 0000000000..859544281f--- /dev/null+++ b/src/lib/buildPacks/vuejs.ts@@ -0,0 +1,26 @@+import { buildCacheImageWithNode, buildImage } from '$lib/docker';+import { promises as fs } from 'fs';++const createDockerfile = async (data, image): Promise<void> => {+ const { applicationId, tag, workdir, publishDirectory } = data;+ const Dockerfile: Array<string> = [];++ Dockerfile.push(`FROM ${image}`);+ Dockerfile.push('WORKDIR /usr/share/nginx/html');+ Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);+ Dockerfile.push(`EXPOSE 80`);+ Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');+ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));+};++export default async function (data) {+ try {+ const image = 'nginx:stable-alpine';+ const imageForBuild = 'node:lts';+ await buildCacheImageWithNode(data, imageForBuild);+ await createDockerfile(data, image);+ await buildImage(data);+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/common.ts b/src/lib/common.tsindex f9d89679f7..70fd7eebaf 100644--- a/src/lib/common.ts+++ b/src/lib/common.ts@@ -1,9 +1,150 @@-export function dashify(str: string, options?: any) {- if (typeof str !== 'string') return str;- return str- .trim()- .replace(/\W/g, (m) => (/[À-ž]/.test(m) ? m : '-'))- .replace(/^-+|-+$/g, '')- .replace(/-{2,}/g, (m) => (options && options.condense ? '-' : m))- .toLowerCase();-}\ No newline at end of file+import child from 'child_process';+import util from 'util';+import { dev } from '$app/env';+import * as Sentry from '@sentry/node';+import { uniqueNamesGenerator, Config, adjectives, colors, animals } from 'unique-names-generator';++import * as db from '$lib/database';+import { buildLogQueue } from './queues';++import { version as currentVersion } from '../../package.json';+import { dockerInstance } from './docker';+import dayjs from 'dayjs';+import Cookie from 'cookie';++try {+ if (!dev) {+ Sentry.init({+ dsn: process.env['COOLIFY_SENTRY_DSN'],+ tracesSampleRate: 0,+ environment: 'production'+ });+ }+} catch (err) {+ console.log('Could not initialize Sentry, no worries.');+}++const customConfig: Config = {+ dictionaries: [adjectives, colors, animals],+ style: 'capital',+ separator: ' ',+ length: 3+};++export const version = currentVersion;+export const asyncExecShell = util.promisify(child.exec);+export const asyncSleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay));+export const sentry = Sentry;++export const uniqueName = () => uniqueNamesGenerator(customConfig);++export const saveBuildLog = async ({ line, buildId, applicationId }) => {+ const addTimestamp = `${generateTimestamp()} ${line}`;+ return await buildLogQueue.add(buildId, { buildId, line: addTimestamp, applicationId });+};++export const isTeamIdTokenAvailable = (request) => {+ const cookie = request.headers.cookie+ ?.split(';')+ .map((s) => s.trim())+ .find((s) => s.startsWith('teamId='))+ ?.split('=')[1];+ if (!cookie) {+ return getTeam(request);+ } else {+ return cookie;+ }+};++export const getTeam = (event) => {+ const cookies: Cookies = Cookie.parse(event.request.headers.get('cookie'));+ if (cookies.teamId) {+ return cookies.teamId;+ } else if (event.locals.session.data.teamId) {+ return event.locals.session.data.teamId;+ }+ return null;+};++export const getUserDetails = async (event, isAdminRequired = true) => {+ // try {+ const teamId = getTeam(event);+ const userId = event.locals.session.data.uid || null;+ const { permission = 'read' } = await db.prisma.permission.findFirst({+ where: { teamId, userId },+ select: { permission: true },+ rejectOnNotFound: true+ });+ const payload = {+ teamId,+ userId,+ permission,+ status: 200,+ body: {+ message: 'OK'+ }+ };+ if (isAdminRequired && permission !== 'admin' && permission !== 'owner') {+ payload.status = 401;+ payload.body.message =+ 'You do not have permission to do this. \nAsk an admin to modify your permissions.';+ }++ return payload;+ // } catch (err) {+ // console.log(err);+ // return {+ // teamId: null,+ // userId: null,+ // permission: 'read',+ // status: 401,+ // body: {+ // message: 'You do not have permission to do this. \nAsk an admin to modify your permissions.'+ // }+ // };+ // }+};++export function getEngine(engine) {+ return engine === '/var/run/docker.sock' ? 'unix:///var/run/docker.sock' : `tcp://${engine}:2375`;+}++export async function removeContainer(id, engine) {+ const host = getEngine(engine);+ try {+ const { stdout } = await asyncExecShell(+ `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`+ );+ if (JSON.parse(stdout).Running) {+ await asyncExecShell(`DOCKER_HOST=${host} docker stop -t 0 ${id}`);+ await asyncExecShell(`DOCKER_HOST=${host} docker rm ${id}`);+ }+ } catch (error) {+ console.log(error);+ throw error;+ }+}++export const removeDestinationDocker = async ({ id, engine }) => {+ return await removeContainer(id, engine);+};++export const createDirectories = async ({ repository, buildId }) => {+ const repodir = `/tmp/build-sources/${repository}/`;+ const workdir = `/tmp/build-sources/${repository}/${buildId}`;++ await asyncExecShell(`mkdir -p ${workdir}`);++ return {+ workdir,+ repodir+ };+};++export function generateTimestamp() {+ return `${dayjs().format('HH:mm:ss.SSS')} `;+}++export function getDomain(domain) {+ return domain?.replace('https://', '').replace('http://', '');+}diff --git a/src/lib/components/CopyPasswordField.svelte b/src/lib/components/CopyPasswordField.sveltenew file mode 100644index 0000000000..4237f6e8e3--- /dev/null+++ b/src/lib/components/CopyPasswordField.svelte@@ -0,0 +1,148 @@+<script>+ import { browser } from '$app/env';+ import { toast } from '@zerodevx/svelte-toast';+ export let value;+ let showPassword = false;++ export let disabled = false;+ export let isPasswordField = false;+ export let readonly = false;+ export let textarea = false;+ export let required = false;+ export let pattern = null;+ export let id;+ export let name;+ export let placeholder = '';++ let disabledClass = 'bg-coolback disabled:bg-coolblack select-all';+ let actionsShow = false;+ let isHttps = browser && window.location.protocol === 'https:';++ function showActions(value) {+ actionsShow = value;+ // if (value === false) {+ // showPassword = false;+ // }+ }+ function copyToClipboard() {+ if (isHttps && navigator.clipboard) {+ navigator.clipboard.writeText(value);+ toast.push('Copied to clipboard');+ }+ }+</script>++<span+ class="relative"+ on:mouseenter={() => showActions(true)}+ on:mouseleave={() => showActions(false)}+>+ {#if !isPasswordField || showPassword}+ {#if textarea}+ <textarea+ rows="3"+ class={disabledClass}+ {placeholder}+ type="text"+ {id}+ {pattern}+ {required}+ {readonly}+ {disabled}+ {name}>{value}</textarea+ >+ {:else}+ <input+ class={disabledClass}+ type="text"+ {id}+ {name}+ {required}+ {pattern}+ {readonly}+ bind:value+ {disabled}+ {placeholder}+ />+ {/if}+ {:else}+ <input+ class={disabledClass}+ type="password"+ {id}+ {name}+ {readonly}+ {pattern}+ {required}+ bind:value+ {disabled}+ {placeholder}+ />+ {/if}++ {#if actionsShow}+ <div class="absolute top-0 right-0 mx-2 cursor-pointer text-warmGray-600 hover:text-white">+ <div class="flex space-x-2">+ {#if isPasswordField}+ <div on:click={() => (showPassword = !showPassword)}>+ {#if showPassword}+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-6 w-6"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ >+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"+ />+ </svg>+ {:else}+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-6 w-6"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ >+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"+ />+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"+ />+ </svg>+ {/if}+ </div>+ {/if}+ {#if value && isHttps}+ <div on:click={copyToClipboard}>+ <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="8" y="8" width="12" height="12" rx="2" />+ <path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2" />+ </svg>+ </div>+ {/if}+ </div>+ </div>+ {/if}+</span>diff --git a/src/lib/components/DeleteIcon.svelte b/src/lib/components/DeleteIcon.sveltenew file mode 100644index 0000000000..f04b3952ce--- /dev/null+++ b/src/lib/components/DeleteIcon.svelte@@ -0,0 +1,17 @@+<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" />+ <line x1="4" y1="7" x2="20" y2="7" />+ <line x1="10" y1="11" x2="10" y2="17" />+ <line x1="14" y1="11" x2="14" y2="17" />+ <path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" />+ <path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" />+</svg>diff --git a/src/lib/components/Explainer.svelte b/src/lib/components/Explainer.sveltenew file mode 100644index 0000000000..4eaf3a398f--- /dev/null+++ b/src/lib/components/Explainer.svelte@@ -0,0 +1,6 @@+<script>+ export let text;+ export let maxWidthClass = 'max-w-[24rem]';+</script>++<div class="py-1 text-xs text-stone-400 {maxWidthClass}">{@html text}</div>diff --git a/src/lib/components/Loading.svelte b/src/lib/components/Loading.sveltenew file mode 100644index 0000000000..de113e261b--- /dev/null+++ b/src/lib/components/Loading.svelte@@ -0,0 +1,67 @@+<script lang="ts">+ export let fullscreen = true;+ export let cover = false;+</script>++{#if fullscreen}+ <div+ class="main fixed left-0 top-0 flex h-full flex-wrap content-center"+ class:bg-coolblack={cover}+ >+ <span class="loader" />+ </div>+{:else}+ <div class=" main h-64 py-24 left-0 top-0 flex flex-wrap content-center mx-auto">+ <span class="loader" />+ </div>+{/if}++<style lang="postcss">+ .loader {+ width: 8px;+ height: 40px;+ border-radius: 4px;+ display: block;+ margin: 20px auto;+ position: relative;+ background: currentColor;+ color: #fff;+ box-sizing: border-box;+ animation: animloader 0.3s linear infinite alternate;+ }+ .loader::after,+ .loader::before {+ content: '';+ width: 8px;+ height: 4px;+ border-radius: 4px;+ background: currentColor;+ position: absolute;+ top: 50%;+ transform: translateY(-50%);+ left: 20px;+ box-sizing: border-box;+ animation: animloader2 0.3s linear infinite alternate;+ }++ .loader::before {+ left: -20px;+ animation-delay: 0s;+ }+ @keyframes animloader {+ 0% {+ height: 48px;+ }+ 100% {+ height: 4px;+ }+ }+ @keyframes animloader2 {+ 0% {+ height: 4px;+ }+ 100% {+ height: 48px;+ }+ }+</style>diff --git a/src/lib/components/Setting.svelte b/src/lib/components/Setting.sveltenew file mode 100644index 0000000000..4a80e56ae5--- /dev/null+++ b/src/lib/components/Setting.svelte@@ -0,0 +1,68 @@+<script lang="ts">+ import Explainer from '$lib/components/Explainer.svelte';++ export let setting;+ export let title;+ export let description;+ export let isPadding = true;+ export let disabled = false;+ // export let disabledReason = '';+</script>++<li class="flex items-center py-4">+ <div class="flex w-96 flex-col" class:px-4={isPadding} class:pr-32={!isPadding}>+ <p class="text-xs font-bold text-stone-100 md:text-base">{title}</p>+ <Explainer text={description} />+ </div>+ <!-- {#if disabled}+ <div class="flex" class:px-4={isPadding} class:pr-32={!isPadding}>+ <p class="text-xs font-bold text-stone-400">{disabledReason}</p>+ </div>+ {:else} -->+ <div+ type="button"+ on:click+ aria-pressed="false"+ class="relative mx-20 inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out"+ class:opacity-50={disabled}+ class:bg-green-600={setting}+ class:bg-stone-700={!setting}+ >+ <span class="sr-only">Use setting</span>+ <span+ class="pointer-events-none relative inline-block h-5 w-5 transform rounded-full bg-white shadow transition duration-200 ease-in-out"+ class:translate-x-5={setting}+ class:translate-x-0={!setting}+ >+ <span+ class=" absolute inset-0 flex h-full w-full items-center justify-center transition-opacity duration-200 ease-in"+ class:opacity-0={setting}+ class:opacity-100={!setting}+ aria-hidden="true"+ >+ <svg class="h-3 w-3 bg-white text-red-600" fill="none" viewBox="0 0 12 12">+ <path+ d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ />+ </svg>+ </span>+ <span+ class="absolute inset-0 flex h-full w-full items-center justify-center transition-opacity duration-100 ease-out"+ aria-hidden="true"+ class:opacity-100={setting}+ class:opacity-0={!setting}+ >+ <svg class="h-3 w-3 bg-white text-green-600" fill="currentColor" viewBox="0 0 12 12">+ <path+ d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"+ />+ </svg>+ </span>+ </span>+ </div>+ <!-- {/if} -->+</li>diff --git a/src/lib/components/common.ts b/src/lib/components/common.tsnew file mode 100644index 0000000000..3ba845fb0d--- /dev/null+++ b/src/lib/components/common.ts@@ -0,0 +1,33 @@+export const asyncSleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay));+export const dateOptions: DateTimeFormatOptions = {+ year: 'numeric',+ month: 'short',+ day: '2-digit',+ hour: 'numeric',+ minute: 'numeric',+ second: 'numeric',+ hour12: false+};++export async function getGithubToken({ apiUrl, application, githubToken }): Promise<void> {+ const response = await fetch(+ `${apiUrl}/app/installations/${application.gitSource.githubApp.installationId}/access_tokens`,+ {+ method: 'POST',+ headers: {+ Authorization: `Bearer ${githubToken}`+ }+ }+ );+ if (!response.ok) {+ throw new Error('Git Source not configured.');+ }+ const data = await response.json();+ return data.token;+}+export const staticDeployments = ['react', 'vuejs', 'static', 'svelte', 'gatsby', 'php'];+export const notNodeDeployments = ['php', 'docker', 'rust'];++export function getDomain(domain) {+ return domain?.replace('https://', '').replace('http://', '');+}diff --git a/src/lib/components/svg/applications/Docker.svelte b/src/lib/components/svg/applications/Docker.sveltenew file mode 100644index 0000000000..684bc06d3a--- /dev/null+++ b/src/lib/components/svg/applications/Docker.svelte@@ -0,0 +1,73 @@+<svg viewBox="0 0 128 128" class="absolute top-0 left-0 -m-8 h-16 w-16">+ <g+ ><path+ fill-rule="evenodd"+ clip-rule="evenodd"+ fill="#3A4D54"+ d="M73.8 50.8h11.3v11.5h5.7c2.6 0 5.3-.5 7.8-1.3 1.2-.4 2.6-1 3.8-1.7-1.6-2.1-2.4-4.7-2.6-7.3-.3-3.5.4-8.1 2.8-10.8l1.2-1.4 1.4 1.1c3.6 2.9 6.5 6.8 7.1 11.4 4.3-1.3 9.3-1 13.1 1.2l1.5.9-.8 1.6c-3.2 6.2-9.9 8.2-16.4 7.8-9.8 24.3-31 35.8-56.8 35.8-13.3 0-25.5-5-32.5-16.8l-.1-.2-1-2.1c-2.4-5.2-3.1-10.9-2.6-16.6l.2-1.7h9.6v-11.4h11.3v-11.2h22.5v-11.3h13.5v22.5z"+ /><path+ fill="#00AADA"+ d="M110.4 55.1c.8-5.9-3.6-10.5-6.4-12.7-3.1 3.6-3.6 13.2 1.3 17.2-2.8 2.4-8.5 4.7-14.5 4.7h-72.2c-.6 6.2.5 11.9 3 16.8l.8 1.5c.5.9 1.1 1.7 1.7 2.6 3 .2 5.7.3 8.2.2 4.9-.1 8.9-.7 12-1.7.5-.2.9.1 1.1.5.2.5-.1.9-.5 1.1-.4.1-.8.3-1.3.4-2.4.7-5 1.1-8.3 1.3h-.6000000000000001c-1.3.1-2.7.1-4.2.1-1.6 0-3.1 0-4.9-.1 6 6.8 15.4 10.8 27.2 10.8 25 0 46.2-11.1 55.5-35.9 6.7.7 13.1-1 16-6.7-4.5-2.7-10.5-1.8-13.9-.1z"+ /><path+ fill="#28B8EB"+ d="M110.4 55.1c.8-5.9-3.6-10.5-6.4-12.7-3.1 3.6-3.6 13.2 1.3 17.2-2.8 2.4-8.5 4.7-14.5 4.7h-68c-.3 9.5 3.2 16.7 9.5 21 4.9-.1 8.9-.7 12-1.7.5-.2.9.1 1.1.5.2.5-.1.9-.5 1.1-.4.1-.8.3-1.3.4-2.4.7-5.2 1.2-8.5 1.4l-.1-.1c8.5 4.4 20.8 4.3 35-1.1 15.8-6.1 30.6-17.7 40.9-30.9-.2.1-.4.1-.5.2z"+ /><path+ fill="#028BB8"+ d="M18.7 71.8c.4 3.3 1.4 6.4 2.9 9.3l.8 1.5c.5.9 1.1 1.7 1.7 2.6 3 .2 5.7.3 8.2.2 4.9-.1 8.9-.7 12-1.7.5-.2.9.1 1.1.5.2.5-.1.9-.5 1.1-.4.1-.8.3-1.3.4-2.4.7-5.2 1.2-8.5 1.4h-.4c-1.3.1-2.7.1-4.1.1-1.6 0-3.2 0-4.9-.1 6 6.8 15.5 10.8 27.3 10.8 21.4 0 40-8.1 50.8-26h-85.1v-.1z"+ /><path+ fill="#019BC6"+ d="M23.5 71.8c1.3 5.8 4.3 10.4 8.8 13.5 4.9-.1 8.9-.7 12-1.7.5-.2.9.1 1.1.5.2.5-.1.9-.5 1.1-.4.1-.8.3-1.3.4-2.4.7-5.2 1.2-8.6 1.4 8.5 4.4 20.8 4.3 34.9-1.1 8.5-3.3 16.8-8.2 24.2-14.1h-70.6z"+ /><path+ fill-rule="evenodd"+ clip-rule="evenodd"+ fill="#00ACD3"+ d="M28.4 52.7h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zM39.6 41.5h9.8v9.8h-9.8v-9.8zm.9.8h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"+ /><path+ fill-rule="evenodd"+ clip-rule="evenodd"+ fill="#23C2EE"+ d="M39.6 52.7h9.8v9.8h-9.8v-9.8zm.9.8h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"+ /><path+ fill-rule="evenodd"+ clip-rule="evenodd"+ fill="#00ACD3"+ d="M50.9 52.7h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"+ /><path+ fill-rule="evenodd"+ clip-rule="evenodd"+ fill="#23C2EE"+ d="M50.9 41.5h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zM62.2 52.7h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"+ /><path+ fill-rule="evenodd"+ clip-rule="evenodd"+ fill="#00ACD3"+ d="M62.2 41.5h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"+ /><path+ fill-rule="evenodd"+ clip-rule="evenodd"+ fill="#23C2EE"+ d="M62.2 30.2h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"+ /><path+ fill-rule="evenodd"+ clip-rule="evenodd"+ fill="#00ACD3"+ d="M73.5 52.7h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"+ /><path+ fill-rule="evenodd"+ clip-rule="evenodd"+ fill="#D4EEF1"+ d="M48.8 78.3c1.5 0 2.7 1.2 2.7 2.7 0 1.5-1.2 2.7-2.7 2.7-1.5 0-2.7-1.2-2.7-2.7 0-1.5 1.2-2.7 2.7-2.7"+ /><path+ fill-rule="evenodd"+ clip-rule="evenodd"+ fill="#3A4D54"+ d="M48.8 79.1c.2 0 .5 0 .7.1-.2.1-.4.4-.4.7 0 .4.4.8.8.8.3 0 .6-.2.7-.4.1.2.1.5.1.7 0 1.1-.9 1.9-1.9 1.9-1.1 0-1.9-.9-1.9-1.9 0-1 .8-1.9 1.9-1.9M1.1 72.8h125.4c-2.7-.7-8.6-1.6-7.7-5.2-5 5.7-16.9 4-20 1.2-3.4 4.9-23 3-24.3-.8-4.2 5-17.3 5-21.5 0-1.4 3.8-21 5.7-24.3.8-3 2.8-15 4.5-20-1.2 1.1 3.5-4.9 4.5-7.6 5.2"+ /><path+ fill="#BFDBE0"+ d="M56 97.8c-6.7-3.2-10.3-7.5-12.4-12.2-2.5.7-5.5 1.2-8.9 1.4-1.3.1-2.7.1-4.1.1-1.7 0-3.4 0-5.2-.1 6 6 13.6 10.7 27.5 10.8h3.1z"+ /><path+ fill="#D4EEF1"+ d="M46.1 89.9c-.9-1.3-1.8-2.8-2.5-4.3-2.5.7-5.5 1.2-8.9 1.4 2.3 1.2 5.7 2.4 11.4 2.9z"+ /></g+ >+</svg>diff --git a/src/lib/components/svg/applications/Gatsby.svelte b/src/lib/components/svg/applications/Gatsby.sveltenew file mode 100644index 0000000000..af1d7b3b6f--- /dev/null+++ b/src/lib/components/svg/applications/Gatsby.svelte@@ -0,0 +1,6 @@+<svg class="absolute top-0 left-0 -m-4 h-10 w-10" viewBox="0 0 128 128">+ <path+ fill="#64328B"+ d="M64,0C28.7,0,0,28.7,0,64v0c0,35.3,28.7,64,64,64s64-28.7,64-64v0C128,28.7,99.3,0,64,0z M13.2,64L64,114.8 C35.9,114.8,13.2,92.1,13.2,64z M75.4,113.5l-60.9-61C19.7,30,39.9,13.2,64,13.2c16.6,0,31.3,7.9,40.5,20.2l-7.5,7.2 C89.7,30.2,77.7,23.5,64,23.5c-17.6,0-32.5,11.2-38.1,26.8C33.1,57,75.4,98.8,78.1,102c12.7-4.7,22.3-15.5,25.4-28.9H81.9v-9.4 l33,0.2C114.8,88.2,98,108.4,75.4,113.5z"+ />+</svg>diff --git a/src/lib/components/svg/applications/Nestjs.svelte b/src/lib/components/svg/applications/Nestjs.sveltenew file mode 100644index 0000000000..81755e25f4--- /dev/null+++ b/src/lib/components/svg/applications/Nestjs.svelte@@ -0,0 +1,6 @@+<svg class="absolute top-0 left-0 -m-4 h-10 w-10" viewBox="0 0 128 128">+ <path+ fill="#DF234F"+ d="M75.4,0.3c-0.9,0-1.8,0.2-2.6,0.5c1.7,1.1,2.6,2.6,3.1,4.3c0,0.2,0.1,0.4,0.1,0.6c0,0.2,0.1,0.4,0.1,0.6 c0.1,2.9-0.8,3.3-1.4,5c-1,2.2-0.7,4.6,0.5,6.5c0.1,0.2,0.2,0.5,0.4,0.7c-1.3-8.4,5.7-9.6,7-12.2c0.1-2.3-1.8-3.8-3.3-4.9 C77.8,0.5,76.6,0.3,75.4,0.3L75.4,0.3z M85.9,2.1c-0.1,0.8,0,0.6-0.1,1c0,0.3,0,0.6-0.1,0.9c-0.1,0.3-0.1,0.5-0.2,0.8 c-0.1,0.3-0.2,0.5-0.3,0.8C85.1,5.8,85,6,84.9,6.3c-0.1,0.1-0.2,0.3-0.3,0.4c-0.1,0.1-0.1,0.2-0.2,0.3c-0.2,0.2-0.3,0.5-0.5,0.7 c-0.2,0.2-0.4,0.4-0.6,0.6v0c-0.2,0.2-0.4,0.4-0.6,0.5c-0.7,0.5-1.5,0.9-2.2,1.4c-0.2,0.2-0.5,0.3-0.7,0.5 c-0.2,0.2-0.4,0.3-0.6,0.5c-0.2,0.2-0.4,0.4-0.6,0.6c-0.2,0.2-0.4,0.4-0.5,0.7c-0.2,0.2-0.3,0.5-0.5,0.7c-0.1,0.3-0.2,0.5-0.4,0.8 c-0.1,0.3-0.2,0.5-0.3,0.8c-0.1,0.3-0.2,0.6-0.2,0.8c0,0.1,0,0.3-0.1,0.4c0,0.1,0,0.3-0.1,0.4c0,0.3,0,0.6,0,0.8c0,0.2,0,0.4,0,0.6 c0,0.3,0,0.5,0.1,0.8c0,0.3,0.1,0.5,0.2,0.8c0.1,0.3,0.2,0.5,0.3,0.8c0.1,0.2,0.2,0.3,0.2,0.5l-7.6-2.9c-1.3-0.4-2.5-0.7-3.8-1 c-0.7-0.2-1.4-0.3-2.1-0.5c-2-0.4-4-0.7-6-0.9c-0.1,0-0.1,0-0.2,0c-2-0.2-3.9-0.3-5.9-0.3c-1.5,0-2.9,0.1-4.3,0.2 c-2,0.1-4,0.4-6,0.7c-0.5,0.1-1,0.2-1.5,0.3c-1,0.2-2,0.4-3,0.7c-0.5,0.1-1,0.3-1.5,0.4c-0.5,0.2-1,0.4-1.4,0.6 c-0.4,0.2-0.7,0.3-1.1,0.5c-0.1,0-0.1,0-0.2,0.1c-0.3,0.2-0.6,0.3-0.9,0.5c-0.1,0-0.2,0.1-0.2,0.1c-0.4,0.2-0.7,0.4-1,0.5 c-0.2,0.1-0.5,0.2-0.7,0.3c-0.1,0.1-0.2,0.1-0.3,0.2c-0.3,0.2-0.6,0.3-0.9,0.5c-0.3,0.2-0.6,0.3-0.8,0.5c-0.2,0.2-0.5,0.3-0.7,0.5 c0,0-0.1,0-0.1,0.1c-0.2,0.1-0.4,0.3-0.6,0.5c0,0,0,0-0.1,0.1c-0.2,0.1-0.3,0.3-0.5,0.4c-0.1,0-0.1,0.1-0.2,0.1 c-0.2,0.1-0.3,0.3-0.5,0.4c0,0.1-0.1,0.1-0.1,0.1c-0.2,0.2-0.4,0.4-0.6,0.6c0,0,0,0-0.1,0.1c-0.2,0.2-0.4,0.4-0.6,0.6 c0,0,0,0.1-0.1,0.1c-0.2,0.2-0.3,0.3-0.5,0.5c-0.1,0.1-0.2,0.1-0.2,0.2c-0.2,0.2-0.4,0.4-0.6,0.6c0,0.1-0.1,0.1-0.1,0.2 c-0.3,0.3-0.5,0.5-0.8,0.8c0,0-0.1,0.1-0.1,0.1c-0.5,0.6-1.1,1.1-1.7,1.6c-0.6,0.5-1.2,1-1.9,1.5c-0.7,0.5-1.3,0.9-2,1.3 c-0.7,0.4-1.4,0.7-2.1,1c-0.7,0.3-1.4,0.6-2.1,0.8c-1.4,0.3-2.8,0.9-4,1C7.6,33.9,7.3,34,7,34c-0.3,0.1-0.6,0.1-0.8,0.2 c-0.3,0.1-0.5,0.2-0.8,0.3c-0.3,0.1-0.5,0.2-0.8,0.4c-0.2,0.2-0.5,0.3-0.7,0.5c-0.2,0.2-0.5,0.4-0.7,0.6c-0.2,0.2-0.5,0.4-0.7,0.6 c-0.2,0.2-0.4,0.4-0.6,0.7c-0.2,0.3-0.4,0.5-0.5,0.8c-0.2,0.2-0.3,0.5-0.5,0.8c-0.1,0.3-0.3,0.6-0.4,0.9c-0.1,0.3-0.2,0.6-0.3,0.9 c-0.1,0.3-0.1,0.5-0.2,0.8c0,0,0,0.1,0,0.1c-0.1,0.3-0.1,0.7-0.1,0.9C0,42.4,0,42.6,0,42.8c0,0.1,0,0.3,0,0.4 c0,0.2,0.1,0.4,0.1,0.6c0.1,0.2,0.1,0.4,0.2,0.6v0c0.1,0.2,0.2,0.4,0.4,0.6c0.1,0.2,0.3,0.4,0.4,0.6c0.2,0.2,0.4,0.4,0.6,0.5 c0.2,0.2,0.4,0.4,0.6,0.5c0.8,0.7,1,0.9,2,1.5c0.2,0.1,0.3,0.2,0.5,0.3c0,0,0.1,0,0.1,0c0,0.1,0,0.1,0,0.2c0,0.3,0.1,0.5,0.2,0.8 c0.1,0.3,0.2,0.6,0.3,0.8c0.1,0.2,0.2,0.4,0.3,0.6c0,0.1,0.1,0.1,0.1,0.2c0.1,0.3,0.3,0.5,0.4,0.7c0.2,0.2,0.3,0.5,0.5,0.7 c0.2,0.2,0.4,0.4,0.6,0.6c0.2,0.2,0.4,0.4,0.6,0.6c0,0,0,0,0.1,0c0.2,0.2,0.4,0.3,0.6,0.5c0.2,0.2,0.5,0.3,0.7,0.4 c0.2,0.1,0.5,0.3,0.8,0.4c0.2,0.1,0.4,0.2,0.7,0.2c0,0,0.1,0,0.1,0.1c0.1,0,0.3,0.1,0.4,0.1c-0.1,1.8-0.1,3.5,0.1,4.1 c0.3,0.7,1.8-1.4,3.2-3.7c-0.2,2.3-0.3,5,0,5.8c0.4,0.8,2.3-1.8,4.1-4.6c23.4-5.4,44.8,10.8,47.1,33.7C65.4,87,61,85,58.9,85.5 c-1,2.4-2.7,5.6-5.4,7.5c0.2-2.2,0.1-4.4-0.3-6.6c-0.7,3-2.1,5.9-4.1,8.3c-3.1,0.2-6.3-1.3-7.9-3.6c-0.1-0.1-0.2-0.3-0.3-0.4 c-0.1-0.2-0.2-0.5-0.3-0.7c-0.1-0.2-0.2-0.5-0.2-0.7c0-0.2,0-0.5,0-0.7c0-0.2,0-0.3,0-0.5c0-0.2,0.1-0.5,0.2-0.7 c0.1-0.2,0.1-0.5,0.2-0.7c0.1-0.2,0.2-0.5,0.4-0.7c0.6-1.6,0.6-2.9-0.5-3.6c-0.2-0.1-0.4-0.2-0.6-0.3c-0.1,0-0.3-0.1-0.4-0.1 c-0.1,0-0.2-0.1-0.3-0.1c-0.2-0.1-0.5-0.1-0.7-0.2c-0.2-0.1-0.5-0.1-0.7-0.1c-0.2,0-0.5-0.1-0.7-0.1c-0.2,0-0.3,0-0.5,0 c-0.3,0-0.5,0-0.7,0.1c-0.2,0-0.5,0.1-0.7,0.1c-0.2,0.1-0.5,0.1-0.7,0.2c-0.2,0.1-0.4,0.2-0.7,0.3c-0.2,0.1-0.4,0.2-0.6,0.3 c-7.7,5-3.1,16.8,2.1,20.2c-2,0.4-4,0.8-4.6,1.2c0,0-0.1,0.1-0.1,0.1c1.4,0.9,2.9,1.6,4.5,2.2c2.1,0.7,4.4,1.3,5.4,1.6v0 c2.7,0.6,5.5,0.8,8.3,0.6c14.6-1,26.6-12.2,28.8-26.8c0.1,0.3,0.1,0.6,0.2,0.9c0.1,0.6,0.2,1.2,0.3,1.9v0c0.1,0.3,0.1,0.6,0.1,0.9 v0.1c0,0.3,0.1,0.6,0.1,0.9c0,0.4,0.1,0.7,0.1,1.1v0.5c0,0.2,0,0.4,0,0.5c0,0.2,0,0.4,0,0.6v0.5c0,0.2,0,0.4,0,0.7 c0,0.1,0,0.3,0,0.4c0,0.2,0,0.5,0,0.7c0,0.1,0,0.2,0,0.3c0,0.3-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.3-0.1,0.6-0.1,1v0v0 c-0.1,0.3-0.1,0.6-0.2,0.9v0.1c-0.1,0.3-0.1,0.6-0.2,0.9c0,0,0,0.1,0,0.1c-0.1,0.3-0.1,0.6-0.2,0.9v0.1c-0.1,0.3-0.2,0.6-0.3,0.9 c0,0,0,0.1,0,0.1c-0.1,0.3-0.2,0.7-0.3,1c-0.1,0.3-0.2,0.6-0.4,1c-0.1,0.3-0.2,0.7-0.4,1c-0.1,0.3-0.3,0.6-0.4,1h0 c-0.1,0.3-0.3,0.6-0.4,0.9c0,0.1-0.1,0.2-0.1,0.2c0,0,0,0.1-0.1,0.1c-2.1,4.3-5.3,8.1-9.3,11.1c-0.3,0.2-0.5,0.4-0.8,0.6 c-0.1,0.1-0.2,0.1-0.2,0.2c-0.2,0.2-0.5,0.3-0.7,0.5l0.1,0.2h0c0.5-0.1,0.9-0.1,1.4-0.2h0c0.9-0.1,1.7-0.3,2.6-0.5 c0.2,0,0.5-0.1,0.7-0.2c0.2,0,0.3-0.1,0.5-0.1c0.2,0,0.5-0.1,0.7-0.1c0.2-0.1,0.4-0.1,0.6-0.2c3.3-0.8,6.5-1.9,9.6-3.2 c-5.3,7.2-12.3,13-20.5,16.8c3.8-0.3,7.6-0.9,11.3-2c13.3-3.9,24.5-12.9,31.2-25c-1.4,7.6-4.4,14.9-8.9,21.3 c3.2-2.1,6.1-4.6,8.8-7.3c7.4-7.7,12.3-17.6,13.9-28.1c1.1,5.2,1.5,10.6,1,15.9c23.9-33.3,2-67.8-7.2-76.9c0-0.1-0.1-0.1-0.1-0.2 c0,0,0,0,0,0.1c0,0,0,0,0-0.1c0,0.4,0,0.8-0.1,1.2c-0.1,0.8-0.2,1.5-0.3,2.2c-0.2,0.7-0.4,1.5-0.6,2.2c-0.2,0.7-0.5,1.4-0.8,2.1 c-0.3,0.7-0.6,1.4-1,2c-0.4,0.6-0.8,1.3-1.2,1.9c-0.4,0.6-0.9,1.2-1.4,1.8c-0.5,0.6-1,1.1-1.6,1.7c-0.3,0.3-0.6,0.6-1,0.8 c-0.3,0.2-0.5,0.4-0.8,0.7c-0.6,0.5-1.2,0.9-1.9,1.3c-0.6,0.4-1.3,0.8-2,1.1c-0.7,0.3-1.4,0.6-2.1,0.9c-0.7,0.3-1.4,0.5-2.1,0.7 c-0.7,0.2-1.5,0.4-2.2,0.5c-0.8,0.1-1.5,0.2-2.2,0.3c-0.5,0-1.1,0.1-1.6,0.1c-0.8,0-1.5-0.1-2.2-0.1c-0.8-0.1-1.5-0.2-2.2-0.3 c-0.8-0.1-1.5-0.3-2.2-0.6h0c0.7-0.1,1.5-0.1,2.2-0.3c0.8-0.1,1.5-0.3,2.2-0.5c0.7-0.2,1.5-0.4,2.1-0.7c0.7-0.3,1.4-0.6,2.1-0.9 c0.7-0.3,1.3-0.7,2-1.1c0.6-0.4,1.3-0.9,1.9-1.3c0.6-0.5,1.2-1,1.7-1.5c0.6-0.5,1.1-1.1,1.6-1.6c0.5-0.6,1-1.2,1.4-1.8 c0.1-0.1,0.1-0.2,0.2-0.3c0.3-0.5,0.7-1.1,1-1.6c0.4-0.7,0.7-1.3,1-2c0.3-0.7,0.6-1.4,0.8-2.1c0.2-0.7,0.4-1.4,0.6-2.1 c0.1-0.8,0.3-1.5,0.3-2.2c0.1-0.8,0.1-1.5,0.1-2.2c0-0.5,0-1.1-0.1-1.6c-0.1-0.8-0.2-1.5-0.3-2.2c-0.1-0.8-0.3-1.5-0.5-2.2 c-0.2-0.7-0.5-1.4-0.7-2.1c-0.3-0.7-0.6-1.4-0.9-2c-0.4-0.7-0.7-1.3-1.1-2c-0.4-0.6-0.9-1.2-1.3-1.8c-0.5-0.6-1-1.1-1.5-1.7 c-0.3-0.3-0.6-0.6-0.9-0.8c-1.5-1.2-3-2.2-4.6-3.2c-0.2-0.1-0.4-0.2-0.7-0.3C87.9,2.8,86.9,2.5,85.9,2.1L85.9,2.1z"+ />+</svg>diff --git a/src/lib/components/svg/applications/Nextjs.svelte b/src/lib/components/svg/applications/Nextjs.sveltenew file mode 100644index 0000000000..2aec938f1e--- /dev/null+++ b/src/lib/components/svg/applications/Nextjs.svelte@@ -0,0 +1,5 @@+<svg class="absolute top-0 left-0 -m-4 h-10 w-10 fill-current text-blue-500" viewBox="0 0 128 128">+ <path+ d="M64 0C28.7 0 0 28.7 0 64s28.7 64 64 64c11.2 0 21.7-2.9 30.8-7.9L48.4 55.3v36.6h-6.8V41.8h6.8l50.5 75.8C116.4 106.2 128 86.5 128 64c0-35.3-28.7-64-64-64zm22.1 84.6l-7.5-11.3V41.8h7.5v42.8z"+ />+</svg>diff --git a/src/lib/components/svg/applications/Nodejs.svelte b/src/lib/components/svg/applications/Nodejs.sveltenew file mode 100644index 0000000000..3e7e84d28b--- /dev/null+++ b/src/lib/components/svg/applications/Nodejs.svelte@@ -0,0 +1,14 @@+<svg+ class="absolute top-0 left-0 -m-4 h-10 w-10 text-green-500"+ xmlns="http://www.w3.org/2000/svg"+ aria-hidden="true"+ focusable="false"+ data-prefix="fab"+ data-icon="node-js"+ role="img"+ viewBox="0 0 448 512"+ ><path+ fill="currentColor"+ d="M224 508c-6.7 0-13.5-1.8-19.4-5.2l-61.7-36.5c-9.2-5.2-4.7-7-1.7-8 12.3-4.3 14.8-5.2 27.9-12.7 1.4-.8 3.2-.5 4.6.4l47.4 28.1c1.7 1 4.1 1 5.7 0l184.7-106.6c1.7-1 2.8-3 2.8-5V149.3c0-2.1-1.1-4-2.9-5.1L226.8 37.7c-1.7-1-4-1-5.7 0L36.6 144.3c-1.8 1-2.9 3-2.9 5.1v213.1c0 2 1.1 4 2.9 4.9l50.6 29.2c27.5 13.7 44.3-2.4 44.3-18.7V167.5c0-3 2.4-5.3 5.4-5.3h23.4c2.9 0 5.4 2.3 5.4 5.3V378c0 36.6-20 57.6-54.7 57.6-10.7 0-19.1 0-42.5-11.6l-48.4-27.9C8.1 389.2.7 376.3.7 362.4V149.3c0-13.8 7.4-26.8 19.4-33.7L204.6 9c11.7-6.6 27.2-6.6 38.8 0l184.7 106.7c12 6.9 19.4 19.8 19.4 33.7v213.1c0 13.8-7.4 26.7-19.4 33.7L243.4 502.8c-5.9 3.4-12.6 5.2-19.4 5.2zm149.1-210.1c0-39.9-27-50.5-83.7-58-57.4-7.6-63.2-11.5-63.2-24.9 0-11.1 4.9-25.9 47.4-25.9 37.9 0 51.9 8.2 57.7 33.8.5 2.4 2.7 4.2 5.2 4.2h24c1.5 0 2.9-.6 3.9-1.7s1.5-2.6 1.4-4.1c-3.7-44.1-33-64.6-92.2-64.6-52.7 0-84.1 22.2-84.1 59.5 0 40.4 31.3 51.6 81.8 56.6 60.5 5.9 65.2 14.8 65.2 26.7 0 20.6-16.6 29.4-55.5 29.4-48.9 0-59.6-12.3-63.2-36.6-.4-2.6-2.6-4.5-5.3-4.5h-23.9c-3 0-5.3 2.4-5.3 5.3 0 31.1 16.9 68.2 97.8 68.2 58.4-.1 92-23.2 92-63.4z"+ />+</svg>diff --git a/src/lib/components/svg/applications/Nuxtjs.svelte b/src/lib/components/svg/applications/Nuxtjs.sveltenew file mode 100644index 0000000000..738cd715d2--- /dev/null+++ b/src/lib/components/svg/applications/Nuxtjs.svelte@@ -0,0 +1,20 @@+<svg+ class="absolute top-0 left-0 -m-4 h-10 w-10"+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 400 400"+>+ <g fill-rule="nonzero" transform="translate(0 50)" fill="none">+ <path+ d="M227.92099 83.45116l-13.6889 24.10141-46.8148-82.44693L23.7037 278.17052h97.3037c0 13.31084 10.61252 24.10142 23.70371 24.10142H23.70371c-8.46771 0-16.29145-4.59601-20.5246-12.05272-4.23315-7.4567-4.23272-16.64312.00114-24.0994L146.89383 13.05492c4.23415-7.45738 12.0596-12.05138 20.5284-12.05138 8.46878 0 16.29423 4.594 20.52839 12.05138l39.97037 70.39623z"+ fill="#00C58E"+ />+ <path+ d="M331.6642 266.11981l-90.05432-158.56724-13.6889-24.10141-13.68888 24.10141-90.04445 158.56724c-4.23385 7.45629-4.23428 16.64271-.00113 24.09941 4.23314 7.4567 12.05689 12.05272 20.5246 12.05272h166.4c8.46946 0 16.29644-4.591 20.532-12.04837 4.23555-7.45736 4.23606-16.64592.00132-24.10376h.01976zM144.7111 278.17052L227.921 131.65399l83.19012 146.51653h-166.4z"+ fill="#FFF"+ />+ <path+ d="M396.04938 290.22123c-4.23344 7.45557-12.05656 12.0507-20.52345 12.0507H311.1111c13.0912 0 23.7037-10.79057 23.7037-24.10141h40.66173L260.09877 74.98553l-18.4889 32.56704L227.921 83.45116l11.65432-20.51634c4.23416-7.45738 12.0596-12.05138 20.5284-12.05138 8.46879 0 16.29423 4.594 20.52839 12.05138l115.41728 203.185c4.23426 7.457 4.23426 16.6444 0 24.1014z"+ fill="#108775"+ />+ </g>+</svg>diff --git a/src/lib/components/svg/applications/PHP.svelte b/src/lib/components/svg/applications/PHP.sveltenew file mode 100644index 0000000000..554680ad6c--- /dev/null+++ b/src/lib/components/svg/applications/PHP.svelte@@ -0,0 +1,6 @@+<svg viewBox="0 0 128 128" class="absolute top-0 left-0 -m-6 h-14 w-14 text-white">+ <path+ fill="#6181B6"+ d="M64 33.039c-33.74 0-61.094 13.862-61.094 30.961s27.354 30.961 61.094 30.961 61.094-13.862 61.094-30.961-27.354-30.961-61.094-30.961zm-15.897 36.993c-1.458 1.364-3.077 1.927-4.86 2.507-1.783.581-4.052.461-6.811.461h-6.253l-1.733 10h-7.301l6.515-34h14.04c4.224 0 7.305 1.215 9.242 3.432 1.937 2.217 2.519 5.364 1.747 9.337-.319 1.637-.856 3.159-1.614 4.515-.759 1.357-1.75 2.624-2.972 3.748zm21.311 2.968l2.881-14.42c.328-1.688.208-2.942-.361-3.555-.57-.614-1.782-1.025-3.635-1.025h-5.79l-3.731 19h-7.244l6.515-33h7.244l-1.732 9h6.453c4.061 0 6.861.815 8.402 2.231s2.003 3.356 1.387 6.528l-3.031 15.241h-7.358zm40.259-11.178c-.318 1.637-.856 3.133-1.613 4.488-.758 1.357-1.748 2.598-2.971 3.722-1.458 1.364-3.078 1.927-4.86 2.507-1.782.581-4.053.461-6.812.461h-6.253l-1.732 10h-7.301l6.514-34h14.041c4.224 0 7.305 1.215 9.241 3.432 1.935 2.217 2.518 5.418 1.746 9.39zM95.919 54h-5.001l-2.727 14h4.442c2.942 0 5.136-.29 6.576-1.4 1.442-1.108 2.413-2.828 2.918-5.421.484-2.491.264-4.434-.66-5.458-.925-1.024-2.774-1.721-5.548-1.721zM38.934 54h-5.002l-2.727 14h4.441c2.943 0 5.136-.29 6.577-1.4 1.441-1.108 2.413-2.828 2.917-5.421.484-2.491.264-4.434-.66-5.458s-2.772-1.721-5.546-1.721z"+ />+</svg>diff --git a/src/lib/components/svg/applications/Python.svelte b/src/lib/components/svg/applications/Python.sveltenew file mode 100644index 0000000000..791811fce5--- /dev/null+++ b/src/lib/components/svg/applications/Python.svelte@@ -0,0 +1,50 @@+<svg class="absolute top-0 left-0 -m-6 h-14 w-14" viewBox="0 0 128 128">+ <linearGradient+ id="a"+ gradientUnits="userSpaceOnUse"+ x1="70.252"+ y1="1237.476"+ x2="170.659"+ y2="1151.089"+ gradientTransform="matrix(.563 0 0 -.568 -29.215 707.817)"+ ><stop offset="0" stop-color="#5A9FD4" /><stop+ offset="1"+ stop-color="#306998"+ /></linearGradient+ ><path+ fill="url(#a)"+ d="M63.391 1.988c-4.222.02-8.252.379-11.8 1.007-10.45 1.846-12.346 5.71-12.346 12.837v9.411h24.693v3.137h-33.961c-7.176 0-13.46 4.313-15.426 12.521-2.268 9.405-2.368 15.275 0 25.096 1.755 7.311 5.947 12.519 13.124 12.519h8.491v-11.282c0-8.151 7.051-15.34 15.426-15.34h24.665c6.866 0 12.346-5.654 12.346-12.548v-23.513c0-6.693-5.646-11.72-12.346-12.837-4.244-.706-8.645-1.027-12.866-1.008zm-13.354 7.569c2.55 0 4.634 2.117 4.634 4.721 0 2.593-2.083 4.69-4.634 4.69-2.56 0-4.633-2.097-4.633-4.69-.001-2.604 2.073-4.721 4.633-4.721z"+ /><linearGradient+ id="b"+ gradientUnits="userSpaceOnUse"+ x1="209.474"+ y1="1098.811"+ x2="173.62"+ y2="1149.537"+ gradientTransform="matrix(.563 0 0 -.568 -29.215 707.817)"+ ><stop offset="0" stop-color="#FFD43B" /><stop+ offset="1"+ stop-color="#FFE873"+ /></linearGradient+ ><path+ fill="url(#b)"+ d="M91.682 28.38v10.966c0 8.5-7.208 15.655-15.426 15.655h-24.665c-6.756 0-12.346 5.783-12.346 12.549v23.515c0 6.691 5.818 10.628 12.346 12.547 7.816 2.297 15.312 2.713 24.665 0 6.216-1.801 12.346-5.423 12.346-12.547v-9.412h-24.664v-3.138h37.012c7.176 0 9.852-5.005 12.348-12.519 2.578-7.735 2.467-15.174 0-25.096-1.774-7.145-5.161-12.521-12.348-12.521h-9.268zm-13.873 59.547c2.561 0 4.634 2.097 4.634 4.692 0 2.602-2.074 4.719-4.634 4.719-2.55 0-4.633-2.117-4.633-4.719 0-2.595 2.083-4.692 4.633-4.692z"+ /><radialGradient+ id="c"+ cx="1825.678"+ cy="444.45"+ r="26.743"+ gradientTransform="matrix(0 -.24 -1.055 0 532.979 557.576)"+ gradientUnits="userSpaceOnUse"+ ><stop offset="0" stop-color="#B8B8B8" stop-opacity=".498" /><stop+ offset="1"+ stop-color="#7F7F7F"+ stop-opacity="0"+ /></radialGradient+ ><path+ opacity=".444"+ fill="url(#c)"+ enable-background="new"+ d="M97.309 119.597c0 3.543-14.816 6.416-33.091 6.416-18.276 0-33.092-2.873-33.092-6.416 0-3.544 14.815-6.417 33.092-6.417 18.275 0 33.091 2.872 33.091 6.417z"+ />+</svg>diff --git a/src/lib/components/svg/applications/React.svelte b/src/lib/components/svg/applications/React.sveltenew file mode 100644index 0000000000..ed05e65505--- /dev/null+++ b/src/lib/components/svg/applications/React.svelte@@ -0,0 +1,7 @@+<svg class="absolute top-0 left-0 -m-4 h-10 w-10 text-blue-500" viewBox="0 0 128 128">+ <g fill="#61DAFB"+ ><circle cx="64" cy="64" r="11.4" /><path+ d="M107.3 45.2c-2.2-.8-4.5-1.6-6.9-2.3.6-2.4 1.1-4.8 1.5-7.1 2.1-13.2-.2-22.5-6.6-26.1-1.9-1.1-4-1.6-6.4-1.6-7 0-15.9 5.2-24.9 13.9-9-8.7-17.9-13.9-24.9-13.9-2.4 0-4.5.5-6.4 1.6-6.4 3.7-8.7 13-6.6 26.1.4 2.3.9 4.7 1.5 7.1-2.4.7-4.7 1.4-6.9 2.3-12.5 4.8-19.3 11.4-19.3 18.8s6.9 14 19.3 18.8c2.2.8 4.5 1.6 6.9 2.3-.6 2.4-1.1 4.8-1.5 7.1-2.1 13.2.2 22.5 6.6 26.1 1.9 1.1 4 1.6 6.4 1.6 7.1 0 16-5.2 24.9-13.9 9 8.7 17.9 13.9 24.9 13.9 2.4 0 4.5-.5 6.4-1.6 6.4-3.7 8.7-13 6.6-26.1-.4-2.3-.9-4.7-1.5-7.1 2.4-.7 4.7-1.4 6.9-2.3 12.5-4.8 19.3-11.4 19.3-18.8s-6.8-14-19.3-18.8zm-14.8-30.5c4.1 2.4 5.5 9.8 3.8 20.3-.3 2.1-.8 4.3-1.4 6.6-5.2-1.2-10.7-2-16.5-2.5-3.4-4.8-6.9-9.1-10.4-13 7.4-7.3 14.9-12.3 21-12.3 1.3 0 2.5.3 3.5.9zm-11.2 59.3c-1.8 3.2-3.9 6.4-6.1 9.6-3.7.3-7.4.4-11.2.4-3.9 0-7.6-.1-11.2-.4-2.2-3.2-4.2-6.4-6-9.6-1.9-3.3-3.7-6.7-5.3-10 1.6-3.3 3.4-6.7 5.3-10 1.8-3.2 3.9-6.4 6.1-9.6 3.7-.3 7.4-.4 11.2-.4 3.9 0 7.6.1 11.2.4 2.2 3.2 4.2 6.4 6 9.6 1.9 3.3 3.7 6.7 5.3 10-1.7 3.3-3.4 6.6-5.3 10zm8.3-3.3c1.5 3.5 2.7 6.9 3.8 10.3-3.4.8-7 1.4-10.8 1.9 1.2-1.9 2.5-3.9 3.6-6 1.2-2.1 2.3-4.2 3.4-6.2zm-25.6 27.1c-2.4-2.6-4.7-5.4-6.9-8.3 2.3.1 4.6.2 6.9.2 2.3 0 4.6-.1 6.9-.2-2.2 2.9-4.5 5.7-6.9 8.3zm-18.6-15c-3.8-.5-7.4-1.1-10.8-1.9 1.1-3.3 2.3-6.8 3.8-10.3 1.1 2 2.2 4.1 3.4 6.1 1.2 2.2 2.4 4.1 3.6 6.1zm-7-25.5c-1.5-3.5-2.7-6.9-3.8-10.3 3.4-.8 7-1.4 10.8-1.9-1.2 1.9-2.5 3.9-3.6 6-1.2 2.1-2.3 4.2-3.4 6.2zm25.6-27.1c2.4 2.6 4.7 5.4 6.9 8.3-2.3-.1-4.6-.2-6.9-.2-2.3 0-4.6.1-6.9.2 2.2-2.9 4.5-5.7 6.9-8.3zm22.2 21l-3.6-6c3.8.5 7.4 1.1 10.8 1.9-1.1 3.3-2.3 6.8-3.8 10.3-1.1-2.1-2.2-4.2-3.4-6.2zm-54.5-16.2c-1.7-10.5-.3-17.9 3.8-20.3 1-.6 2.2-.9 3.5-.9 6 0 13.5 4.9 21 12.3-3.5 3.8-7 8.2-10.4 13-5.8.5-11.3 1.4-16.5 2.5-.6-2.3-1-4.5-1.4-6.6zm-24.7 29c0-4.7 5.7-9.7 15.7-13.4 2-.8 4.2-1.5 6.4-2.1 1.6 5 3.6 10.3 6 15.6-2.4 5.3-4.5 10.5-6 15.5-13.8-4-22.1-10-22.1-15.6zm28.5 49.3c-4.1-2.4-5.5-9.8-3.8-20.3.3-2.1.8-4.3 1.4-6.6 5.2 1.2 10.7 2 16.5 2.5 3.4 4.8 6.9 9.1 10.4 13-7.4 7.3-14.9 12.3-21 12.3-1.3 0-2.5-.3-3.5-.9zm60.8-20.3c1.7 10.5.3 17.9-3.8 20.3-1 .6-2.2.9-3.5.9-6 0-13.5-4.9-21-12.3 3.5-3.8 7-8.2 10.4-13 5.8-.5 11.3-1.4 16.5-2.5.6 2.3 1 4.5 1.4 6.6zm9-15.6c-2 .8-4.2 1.5-6.4 2.1-1.6-5-3.6-10.3-6-15.6 2.4-5.3 4.5-10.5 6-15.5 13.8 4 22.1 10 22.1 15.6 0 4.7-5.8 9.7-15.7 13.4z"+ /></g+ >+</svg>diff --git a/src/lib/components/svg/applications/Rust.svelte b/src/lib/components/svg/applications/Rust.sveltenew file mode 100644index 0000000000..19ce81f29a--- /dev/null+++ b/src/lib/components/svg/applications/Rust.svelte@@ -0,0 +1,8 @@+<svg class="absolute top-0 left-0 -m-5 h-12 w-12" viewBox="0 0 128 128">+ <path+ d="M62.271 10.880 C 62.082 10.990,61.289 12.128,60.508 13.409 C 58.548 16.626,58.526 16.628,55.893 13.857 C 54.180 12.055,53.766 11.725,53.214 11.729 C 52.855 11.731,52.402 11.853,52.206 12.000 C 52.011 12.147,51.458 13.317,50.978 14.600 C 49.879 17.539,49.826 17.634,49.217 17.751 C 48.842 17.822,48.120 17.420,46.389 16.177 C 45.111 15.258,43.857 14.507,43.603 14.507 C 42.549 14.507,42.252 15.083,41.750 18.100 C 41.112 21.936,41.134 21.923,37.676 20.352 C 36.280 19.719,34.956 19.200,34.733 19.200 C 34.510 19.200,34.087 19.440,33.794 19.733 C 33.262 20.266,33.261 20.268,33.406 23.201 L 33.552 26.137 32.997 26.434 C 32.505 26.697,32.166 26.665,29.988 26.150 C 27.145 25.479,26.545 25.497,25.969 26.272 L 25.548 26.838 26.113 29.259 C 26.423 30.590,26.722 31.872,26.778 32.107 C 26.833 32.341,26.738 32.716,26.566 32.939 C 26.282 33.306,25.980 33.339,23.349 33.299 C 18.896 33.229,18.643 33.611,20.483 37.627 C 21.068 38.902,21.547 40.060,21.547 40.199 C 21.547 40.933,20.962 41.200,18.449 41.610 C 17.043 41.839,15.821 42.027,15.733 42.027 C 15.645 42.027,15.381 42.219,15.147 42.453 C 14.382 43.218,14.599 43.936,16.334 46.385 C 18.495 49.435,18.491 49.446,14.921 50.812 C 10.861 52.365,10.779 52.748,13.870 55.680 C 16.749 58.410,16.752 58.370,13.493 60.419 C 11.024 61.970,10.986 62.007,10.923 62.848 C 10.847 63.871,10.865 63.889,13.813 65.690 C 16.728 67.470,16.728 67.524,13.867 70.231 C 10.790 73.141,10.885 73.566,14.948 75.099 C 18.498 76.438,18.503 76.454,16.338 79.504 C 15.111 81.233,14.720 81.953,14.720 82.487 C 14.720 83.486,15.240 83.741,18.347 84.263 C 20.964 84.704,21.547 84.963,21.547 85.685 C 21.547 85.833,21.067 87.001,20.480 88.279 C 18.654 92.256,18.862 92.587,23.184 92.587 C 27.209 92.587,27.102 92.464,26.235 96.094 C 25.581 98.830,25.571 99.354,26.163 99.945 C 26.616 100.399,27.470 100.348,30.141 99.709 C 32.181 99.222,32.539 99.188,33.012 99.441 L 33.552 99.730 33.406 102.665 C 33.261 105.599,33.262 105.601,33.794 106.134 C 34.087 106.427,34.516 106.667,34.746 106.667 C 34.976 106.667,36.300 106.151,37.689 105.520 C 41.136 103.955,41.114 103.942,41.750 107.766 C 42.254 110.797,42.548 111.360,43.624 111.360 C 43.891 111.360,45.118 110.640,46.352 109.760 C 48.519 108.214,49.081 107.972,49.658 108.339 C 49.807 108.433,50.385 109.703,50.942 111.161 C 51.761 113.305,52.061 113.863,52.517 114.081 C 53.385 114.497,53.922 114.163,55.962 111.941 C 58.425 109.258,58.526 109.271,60.537 112.530 C 62.758 116.128,63.333 116.120,65.610 112.457 C 67.572 109.301,67.549 109.303,70.201 112.073 C 71.962 113.911,72.337 114.204,72.931 114.204 C 73.310 114.204,73.763 114.062,73.936 113.888 C 74.110 113.714,74.686 112.429,75.216 111.033 C 75.746 109.636,76.295 108.420,76.437 108.330 C 76.998 107.973,77.579 108.224,79.743 109.760 C 81.017 110.665,82.216 111.360,82.501 111.360 C 83.559 111.360,83.941 110.609,84.381 107.657 C 84.757 105.140,84.833 104.899,85.328 104.648 C 85.815 104.401,86.107 104.484,88.391 105.521 C 89.780 106.151,91.104 106.667,91.334 106.667 C 91.564 106.667,92.000 106.420,92.301 106.118 L 92.850 105.570 92.699 102.755 C 92.555 100.067,92.568 99.923,92.997 99.535 C 93.438 99.136,93.483 99.138,95.949 99.701 C 98.935 100.383,99.492 100.401,100.053 99.840 C 100.601 99.292,100.595 99.172,99.845 96.009 C 99.004 92.461,98.891 92.587,102.933 92.587 C 105.688 92.587,105.995 92.548,106.346 92.161 C 106.932 91.513,106.793 90.771,105.614 88.258 C 105.019 86.992,104.536 85.840,104.540 85.698 C 104.560 84.951,105.147 84.696,107.860 84.255 C 109.520 83.986,110.762 83.674,110.987 83.471 C 111.741 82.790,111.464 81.904,109.743 79.491 C 107.586 76.467,107.595 76.438,111.049 75.165 C 115.185 73.641,115.303 73.133,112.208 70.192 C 109.341 67.468,109.340 67.483,112.480 65.555 C 116.276 63.225,116.282 62.700,112.547 60.382 C 109.335 58.389,109.337 58.417,112.216 55.683 C 115.304 52.749,115.220 52.365,111.159 50.812 C 107.575 49.441,107.564 49.407,109.742 46.418 C 111.039 44.638,111.360 44.047,111.360 43.437 C 111.360 42.371,110.882 42.132,107.738 41.624 C 105.111 41.200,104.533 40.942,104.533 40.195 C 104.533 40.053,105.013 38.910,105.600 37.653 C 106.749 35.192,106.910 34.207,106.260 33.618 C 105.911 33.302,105.443 33.257,102.939 33.298 C 100.319 33.342,99.984 33.305,99.621 32.940 C 99.224 32.541,99.228 32.485,99.848 29.898 C 100.608 26.728,100.611 26.651,99.986 26.064 C 99.352 25.468,98.956 25.478,96.045 26.163 C 93.924 26.663,93.573 26.696,93.091 26.438 L 92.544 26.145 92.695 23.219 L 92.847 20.294 92.300 19.747 C 91.999 19.446,91.572 19.200,91.350 19.200 C 91.129 19.200,89.812 19.723,88.424 20.361 C 86.106 21.428,85.857 21.499,85.356 21.237 C 84.856 20.975,84.773 20.717,84.346 18.110 C 83.853 15.094,83.548 14.507,82.477 14.507 C 82.223 14.507,80.964 15.262,79.679 16.185 C 77.569 17.701,77.286 17.844,76.760 17.661 C 76.325 17.509,76.072 17.178,75.763 16.355 C 75.534 15.749,75.096 14.581,74.788 13.760 C 74.166 12.104,73.819 11.733,72.887 11.733 C 72.367 11.733,71.896 12.107,70.208 13.860 C 67.555 16.616,67.545 16.615,65.594 13.415 C 64.814 12.136,63.999 10.994,63.782 10.878 C 63.294 10.616,62.720 10.617,62.271 10.880 M64.689 20.515 C 67.000 22.160,65.771 26.027,62.937 26.027 C 60.187 26.027,58.802 22.714,60.766 20.833 C 61.874 19.771,63.463 19.642,64.689 20.515 M61.783 30.729 C 63.298 31.305,63.920 30.959,67.379 27.625 L 69.978 25.119 71.078 25.265 C 74.528 25.723,81.390 28.737,85.333 31.526 C 88.956 34.090,93.771 39.312,95.823 42.903 L 96.262 43.672 94.318 48.052 C 93.248 50.461,92.373 52.685,92.373 52.996 C 92.373 53.713,92.843 54.847,93.296 55.222 C 93.487 55.381,95.302 56.255,97.329 57.164 L 101.013 58.818 101.158 59.755 C 101.345 60.976,101.370 63.975,101.200 64.827 L 101.067 65.493 98.964 65.493 C 96.525 65.493,96.713 65.275,96.581 68.267 C 96.485 70.436,95.961 71.635,94.769 72.411 C 92.827 73.678,89.620 73.448,88.260 71.945 C 88.051 71.714,87.645 70.553,87.357 69.364 C 86.516 65.891,85.386 63.941,83.116 62.044 C 82.399 61.445,81.813 60.886,81.813 60.801 C 81.813 60.717,82.601 60.053,83.565 59.328 C 87.075 56.682,89.093 53.602,89.315 50.551 C 89.738 44.732,85.102 39.308,78.206 37.550 C 76.571 37.133,75.873 37.120,55.646 37.120 C 44.166 37.120,34.773 37.045,34.773 36.954 C 34.773 36.739,37.324 34.263,38.827 33.021 C 42.954 29.609,48.315 26.924,53.867 25.490 L 55.787 24.993 58.515 27.759 C 60.016 29.280,61.487 30.616,61.783 30.729 M27.432 48.526 C 28.689 49.349,29.204 51.417,28.462 52.660 C 27.314 54.584,24.406 54.665,23.257 52.805 C 21.586 50.103,24.804 46.804,27.432 48.526 M101.482 48.631 C 104.770 50.636,102.222 55.568,98.702 54.011 C 96.352 52.971,96.277 49.759,98.575 48.587 C 99.534 48.098,100.636 48.115,101.482 48.631 M37.120 60.907 L 37.120 73.173 31.698 73.173 L 26.276 73.173 25.846 71.307 C 25.000 67.632,24.644 63.830,24.857 60.716 L 25.006 58.528 28.734 56.856 C 31.073 55.808,32.577 55.009,32.771 54.712 C 33.619 53.419,33.538 52.495,32.348 49.867 L 31.792 48.640 34.456 48.640 L 37.120 48.640 37.120 60.907 M68.340 49.174 C 70.662 49.778,71.889 51.007,71.892 52.730 C 71.894 53.995,71.267 54.789,69.712 55.491 C 68.611 55.989,68.436 56.001,61.493 56.069 L 54.400 56.137 54.400 52.495 L 54.400 48.853 60.755 48.853 C 65.719 48.853,67.380 48.923,68.340 49.174 M65.944 66.776 C 67.095 67.096,68.456 68.096,69.154 69.135 C 69.887 70.227,70.316 71.647,71.332 76.351 C 72.190 80.327,72.742 81.627,74.288 83.319 C 76.203 85.414,75.759 85.333,85.325 85.333 C 89.906 85.333,93.653 85.406,93.653 85.496 C 93.653 85.657,90.498 89.387,90.362 89.387 C 90.323 89.387,88.675 89.042,86.700 88.620 C 81.123 87.429,80.922 87.569,79.642 93.546 L 78.819 97.386 78.076 97.752 C 76.836 98.364,72.806 99.624,70.717 100.054 C 67.265 100.764,63.508 101.004,60.206 100.725 C 54.577 100.248,47.123 98.064,46.832 96.805 C 46.770 96.538,46.395 94.810,46.000 92.964 C 45.604 91.118,45.123 89.367,44.931 89.073 C 44.008 87.665,43.037 87.578,38.767 88.523 C 37.150 88.881,35.739 89.173,35.631 89.173 C 35.428 89.173,32.427 85.703,32.427 85.469 C 32.427 85.396,39.555 85.311,48.267 85.281 L 64.107 85.227 64.164 79.600 C 64.204 75.627,64.149 73.886,63.977 73.680 C 63.785 73.448,62.763 73.387,59.067 73.387 L 54.400 73.387 54.400 69.973 L 54.400 66.560 59.787 66.561 C 62.749 66.562,65.520 66.659,65.944 66.776 M41.536 92.365 C 44.055 93.900,42.847 97.922,39.868 97.919 C 36.813 97.917,35.681 93.932,38.284 92.344 C 39.145 91.819,40.658 91.829,41.536 92.365 M87.662 92.533 C 88.897 93.438,89.308 95.321,88.543 96.575 C 86.534 99.870,81.510 97.251,83.188 93.784 C 84.013 92.081,86.206 91.467,87.662 92.533 "+ stroke="none"+ fill="rgb(239, 68, 68)"+ fill-rule="evenodd"+ />+</svg>diff --git a/src/lib/components/svg/applications/Static.svelte b/src/lib/components/svg/applications/Static.sveltenew file mode 100644index 0000000000..d3732b34ba--- /dev/null+++ b/src/lib/components/svg/applications/Static.svelte@@ -0,0 +1,28 @@+<svg+ class="absolute top-0 left-0 -m-4 h-10 w-10 text-white"+ viewBox="0 0 32 32"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ ><g clip-path="url(#HTML5_Clip0_4)"+ ><path+ d="M30.216 0L27.6454 28.7967L16.0907 32L4.56783 28.8012L2 0H30.216Z"+ fill="#E44D26"+ /><path+ d="M16.108 29.5515L25.4447 26.963L27.6415 2.35497H16.108V29.5515Z"+ fill="#F16529"+ /><path+ d="M11.1109 9.4197H16.108V5.88731H7.25053L7.33509 6.83499L8.20327 16.5692H16.108V13.0369H11.4338L11.1109 9.4197Z"+ fill="#EBEBEB"+ /><path+ d="M11.907 18.3354H8.36111L8.856 23.8818L16.0917 25.8904L16.108 25.8859V22.2108L16.0925 22.2149L12.1585 21.1527L11.907 18.3354Z"+ fill="#EBEBEB"+ /><path+ d="M16.0958 16.5692H20.4455L20.0354 21.1504L16.0958 22.2138V25.8887L23.3373 23.8817L23.3904 23.285L24.2205 13.9855L24.3067 13.0369H16.0958V16.5692Z"+ fill="white"+ /><path+ d="M16.0958 9.41105V9.41969H24.6281L24.6989 8.62572L24.8599 6.83499L24.9444 5.88731H16.0958V9.41105Z"+ fill="white"+ /></g+ ><defs><clipPath id="HTML5_Clip0_4"><rect width="32" height="32" fill="white" /></clipPath></defs+ ></svg+>diff --git a/src/lib/components/svg/applications/Svelte.svelte b/src/lib/components/svg/applications/Svelte.sveltenew file mode 100644index 0000000000..ad3d1d82d8--- /dev/null+++ b/src/lib/components/svg/applications/Svelte.svelte@@ -0,0 +1,21 @@+<svg+ class="absolute top-0 left-0 -m-4 h-10 w-10"+ version="1.1"+ id="Layer_1"+ xmlns="http://www.w3.org/2000/svg"+ xmlns:xlink="http://www.w3.org/1999/xlink"+ x="0px"+ y="0px"+ viewBox="0 0 98.1 118"+ style="enable-background:new 0 0 98.1 118;"+ xml:space="preserve"+>+ <path+ fill="#FF3E00"+ d="M91.8,15.6C80.9-0.1,59.2-4.7,43.6,5.2L16.1,22.8C8.6,27.5,3.4,35.2,1.9,43.9c-1.3,7.3-0.2,14.8,3.3,21.3 c-2.4,3.6-4,7.6-4.7,11.8c-1.6,8.9,0.5,18.1,5.7,25.4c11,15.7,32.6,20.3,48.2,10.4l27.5-17.5c7.5-4.7,12.7-12.4,14.2-21.1 c1.3-7.3,0.2-14.8-3.3-21.3c2.4-3.6,4-7.6,4.7-11.8C99.2,32.1,97.1,22.9,91.8,15.6"+ />+ <path+ fill="#FFFFFF"+ d="M40.9,103.9c-8.9,2.3-18.2-1.2-23.4-8.7c-3.2-4.4-4.4-9.9-3.5-15.3c0.2-0.9,0.4-1.7,0.6-2.6l0.5-1.6l1.4,1 c3.3,2.4,6.9,4.2,10.8,5.4l1,0.3l-0.1,1c-0.1,1.4,0.3,2.9,1.1,4.1c1.6,2.3,4.4,3.4,7.1,2.7c0.6-0.2,1.2-0.4,1.7-0.7L65.5,72 c1.4-0.9,2.3-2.2,2.6-3.8c0.3-1.6-0.1-3.3-1-4.6c-1.6-2.3-4.4-3.3-7.1-2.6c-0.6,0.2-1.2,0.4-1.7,0.7l-10.5,6.7 c-1.7,1.1-3.6,1.9-5.6,2.4c-8.9,2.3-18.2-1.2-23.4-8.7c-3.1-4.4-4.4-9.9-3.4-15.3c0.9-5.2,4.1-9.9,8.6-12.7l27.5-17.5 c1.7-1.1,3.6-1.9,5.6-2.5c8.9-2.3,18.2,1.2,23.4,8.7c3.2,4.4,4.4,9.9,3.5,15.3c-0.2,0.9-0.4,1.7-0.7,2.6l-0.5,1.6l-1.4-1 c-3.3-2.4-6.9-4.2-10.8-5.4l-1-0.3l0.1-1c0.1-1.4-0.3-2.9-1.1-4.1c-1.6-2.3-4.4-3.3-7.1-2.6c-0.6,0.2-1.2,0.4-1.7,0.7L32.4,46.1 c-1.4,0.9-2.3,2.2-2.6,3.8s0.1,3.3,1,4.6c1.6,2.3,4.4,3.3,7.1,2.6c0.6-0.2,1.2-0.4,1.7-0.7l10.5-6.7c1.7-1.1,3.6-1.9,5.6-2.5 c8.9-2.3,18.2,1.2,23.4,8.7c3.2,4.4,4.4,9.9,3.5,15.3c-0.9,5.2-4.1,9.9-8.6,12.7l-27.5,17.5C44.8,102.5,42.9,103.3,40.9,103.9"+ />+</svg>diff --git a/src/lib/components/svg/applications/Vuejs.svelte b/src/lib/components/svg/applications/Vuejs.sveltenew file mode 100644index 0000000000..1017f24a3a--- /dev/null+++ b/src/lib/components/svg/applications/Vuejs.svelte@@ -0,0 +1,12 @@+<svg class="absolute top-0 left-0 -m-4 h-10 w-10 text-green-500" viewBox="0 0 128 128">+ <path+ d="m-2.3125e-8 8.9337 49.854 0.1586 14.167 24.47 14.432-24.47 49.547-0.1577-63.834 110.14zm126.98 0.6374-24.36 0.0207-38.476 66.052-38.453-66.052-24.749-0.0194 63.211 107.89zm-25.149-0.008-22.745 0.16758l-15.053 24.647-14.817-24.647-22.794-0.1679 37.731 64.476zM25.997 9.3929l23.002 0.0087M25.997 9.3929l23.002 0.0087"+ fill="none"+ /><path+ d="m25.997 9.3929 23.002 0.0087l15.036 24.958 14.983-24.956 22.982-0.0057-37.85 65.655z"+ fill="#35495e"+ /><path+ d="m0.91068 9.5686 25.066-0.1711 38.151 65.658 37.852-65.654 25.11 0.0263-62.966 108.06z"+ fill="#41b883"+ />+</svg>diff --git a/src/lib/components/svg/databases/Clickhouse.svelte b/src/lib/components/svg/databases/Clickhouse.sveltenew file mode 100644index 0000000000..dd237a48cf--- /dev/null+++ b/src/lib/components/svg/databases/Clickhouse.svelte@@ -0,0 +1,13 @@+<script lang="ts">+ export let isAbsolute = false;+</script>++<svg+ class={isAbsolute ? 'absolute top-0 left-0 -m-5 h-10 w-10' : 'mx-auto w-8 h-8'}+ viewBox="0 0 9 8"+ xmlns="http://www.w3.org/2000/svg"+ ><path d="m0 7h1v1h-1z" fill="#f00" /><path+ d="m0 0h1v7h-1zm2 0h1v8h-1zm2 0h1v8h-1zm2 0h1v8h-1zm2 3.25h1v1.5h-1z"+ fill="#fc0"+ /></svg+>diff --git a/src/lib/components/svg/databases/CouchDB.svelte b/src/lib/components/svg/databases/CouchDB.sveltenew file mode 100644index 0000000000..411c4928d1--- /dev/null+++ b/src/lib/components/svg/databases/CouchDB.svelte@@ -0,0 +1,18 @@+<script lang="ts">+ export let isAbsolute = false;+</script>++<svg+ class={isAbsolute+ ? 'absolute top-0 left-0 -m-5 h-10 w-10 fill-current text-red-500'+ : 'mx-auto w-8 h-8 text-red-500'}+ id="CouchDB"+ fill="currentColor"+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 128 128"+ ><g id="original"+ ><path+ d="M101.4,77.2c0,5-2.7,7.5-7.6,7.7H33.9c-4.9,0-7.6-2.5-7.6-7.7,0-5,2.7-7.5,7.6-7.7H94.1C99,69.7,101.4,72.2,101.4,77.2ZM94.1,88.7H33.9c-4.9,0-7.6,2.4-7.6,7.7,0,5,2.7,7.4,7.6,7.7H94.1c4.9,0,7.6-2.5,7.6-7.7C101.4,91.1,99,88.7,94.1,88.7Zm18.6-42.1h0c-4.9,0-7.6,2.5-7.6,7.4V96.1c0,5,2.7,7.5,7.6,7.7h0c7.4-.2,11.3-7.7,11.3-22.9V62C124,51.8,120.1,46.8,112.7,46.6Zm-97.4,0h0C7.9,46.8,4,51.8,4,62V80.9c0,15.2,3.9,22.7,11.3,22.9h0c4.9,0,7.6-2.4,7.6-7.7V54.3C22.7,49.3,20.2,46.8,15.3,46.6Zm97.4-3.8c0-12.7-6.6-18.7-18.6-18.9H33.9c-12.2.2-18.6,6.5-18.6,18.9h0c7.4,0,11.3,4,11.3,11.5s3.9,11.4,11.3,11.4H90.4c7.3,0,11.3-3.9,11.3-11.4-.3-7.7,3.9-11.2,11-11.5Z"+ /></g+ ></svg+>diff --git a/src/lib/components/svg/databases/MongoDB.svelte b/src/lib/components/svg/databases/MongoDB.sveltenew file mode 100644index 0000000000..b99ffe4da8--- /dev/null+++ b/src/lib/components/svg/databases/MongoDB.svelte@@ -0,0 +1,33 @@+<script lang="ts">+ export let isAbsolute = false;+</script>++<svg+ class={isAbsolute ? 'absolute top-0 left-0 -m-5 h-10 w-10' : 'mx-auto w-8 h-8'}+ xmlns="http://www.w3.org/2000/svg"+ id="Layer_1"+ data-name="Layer 1"+ viewBox="0 0 216.56 448.5"+ ><defs+ ><style>+ .cls-1 {+ fill: #10aa50;+ }+ .cls-2 {+ fill: #b8c4c2;+ }+ .cls-3 {+ fill: #12924f;+ }+ </style></defs+ ><path+ class="cls-1"+ d="M202.8,179.68c-23-101.47-71-128.49-83.18-147.59C113,21.7,106.25,5.91,106.25,5.91c-.66,9-1.83,14.7-9.51,21.54C81.36,41.16,16,94.42,10.51,209.72c-5.12,107.5,79,173.8,90.18,180.65,8.54,4.2,19,.08,24-3.77,40.54-27.84,96-102.07,78.06-206.92"+ /><path+ class="cls-2"+ d="M109.73,333.11c-2.11,26.62-3.63,42.11-9,57.29,0,0,3.54,25.33,6,52.17l8.77,0a488.62,488.62,0,0,1,9.57-56.2C113.71,380.8,110.16,356.46,109.73,333.11Z"+ /><path+ class="cls-3"+ d="M125.06,386.39h0c-11.48-5.3-14.8-30.13-15.31-53.28A1090.8,1090.8,0,0,0,112.2,218.4c-.6-20.07.3-185.92-4.94-210.2,2.12,4.75,7.24,15.91,12.36,23.88,12.23,19.11,60.19,46.13,83.17,147.61C220.7,284.27,165.57,358.37,125.06,386.39Z"+ />+</svg>diff --git a/src/components/Database/SVGs/Mysql.svelte b/src/lib/components/svg/databases/MySQL.sveltesimilarity index 85%rename from src/components/Database/SVGs/Mysql.svelterename to src/lib/components/svg/databases/MySQL.svelteindex 341222f687..0950932144 100644--- a/src/components/Database/SVGs/Mysql.svelte+++ b/src/lib/components/svg/databases/MySQL.svelte@@ -1,16 +1,17 @@-<script>- export let customClass;+<script lang="ts">+ export let isAbsolute = false;</script><svg-class={customClass}-xmlns="http://www.w3.org/2000/svg"-width="64"-height="64"-viewBox="0 0 25.6 25.6"-><path- d="M179.076 94.886c-3.568-.1-6.336.268-8.656 1.25-.668.27-1.74.27-1.828 1.116.357.355.4.936.713 1.428.535.893 1.473 2.096 2.32 2.72l2.855 2.053c1.74 1.07 3.703 1.695 5.398 2.766.982.625 1.963 1.428 2.945 2.098.5.357.803.938 1.428 1.16v-.135c-.312-.4-.402-.98-.713-1.428l-1.34-1.293c-1.293-1.74-2.9-3.258-4.64-4.506-1.428-.982-4.55-2.32-5.13-3.97l-.088-.1c.98-.1 2.14-.447 3.078-.715 1.518-.4 2.9-.312 4.46-.713l2.143-.625v-.4c-.803-.803-1.383-1.874-2.23-2.632-2.275-1.963-4.775-3.882-7.363-5.488-1.383-.892-3.168-1.473-4.64-2.23-.537-.268-1.428-.402-1.74-.848-.805-.98-1.25-2.275-1.83-3.436l-3.658-7.763c-.803-1.74-1.295-3.48-2.275-5.086-4.596-7.585-9.594-12.18-17.268-16.687-1.65-.937-3.613-1.34-5.7-1.83l-3.346-.18c-.715-.312-1.428-1.16-2.053-1.562-2.543-1.606-9.102-5.086-10.977-.5-1.205 2.9 1.785 5.755 2.8 7.228.76 1.026 1.74 2.186 2.277 3.346.3.758.4 1.562.713 2.365.713 1.963 1.383 4.15 2.32 5.98.5.937 1.025 1.92 1.65 2.767.357.5.982.714 1.115 1.517-.625.893-.668 2.23-1.025 3.347-1.607 5.042-.982 11.288 1.293 15 .715 1.115 2.4 3.57 4.686 2.632 2.008-.803 1.56-3.346 2.14-5.577.135-.535.045-.892.312-1.25v.1l1.83 3.703c1.383 2.186 3.793 4.462 5.8 5.98 1.07.803 1.918 2.187 3.256 2.677v-.135h-.088c-.268-.4-.67-.58-1.027-.892-.803-.803-1.695-1.785-2.32-2.677-1.873-2.498-3.523-5.265-4.996-8.12-.715-1.383-1.34-2.9-1.918-4.283-.27-.536-.27-1.34-.715-1.606-.67.98-1.65 1.83-2.143 3.034-.848 1.918-.936 4.283-1.248 6.737-.18.045-.1 0-.18.1-1.426-.356-1.918-1.83-2.453-3.078-1.338-3.168-1.562-8.254-.402-11.913.312-.937 1.652-3.882 1.117-4.774-.27-.848-1.16-1.338-1.652-2.008-.58-.848-1.203-1.918-1.605-2.855-1.07-2.5-1.605-5.265-2.766-7.764-.537-1.16-1.473-2.365-2.232-3.435-.848-1.205-1.783-2.053-2.453-3.48-.223-.5-.535-1.294-.178-1.83.088-.357.268-.5.623-.58.58-.5 2.232.134 2.812.4 1.65.67 3.033 1.294 4.416 2.23.625.446 1.295 1.294 2.098 1.518h.938c1.428.312 3.033.1 4.37.5 2.365.76 4.506 1.874 6.426 3.08 5.844 3.703 10.664 8.968 13.92 15.26.535 1.026.758 1.963 1.25 3.034.938 2.187 2.098 4.417 3.033 6.56.938 2.097 1.83 4.24 3.168 5.98.67.937 3.346 1.427 4.55 1.918.893.4 2.275.76 3.08 1.25 1.516.937 3.033 2.008 4.46 3.034.713.534 2.945 1.65 3.078 2.54zm-45.5-38.772a7.09 7.09 0 0 0-1.828.223v.1h.088c.357.714.982 1.205 1.428 1.83l1.027 2.142.088-.1c.625-.446.938-1.16.938-2.23-.268-.312-.312-.625-.535-.937-.268-.446-.848-.67-1.206-1.026z"- transform="matrix(.390229 0 0 .38781 -46.300037 -16.856717)"- fill-rule="evenodd"- fill="#00678c"></path></svg->\ No newline at end of file+ class={isAbsolute ? 'absolute top-0 left-0 -m-5 h-10 w-10' : 'mx-auto w-8 h-8'}+ xmlns="http://www.w3.org/2000/svg"+ width="64"+ height="64"+ viewBox="0 0 25.6 25.6"+ ><path+ d="M179.076 94.886c-3.568-.1-6.336.268-8.656 1.25-.668.27-1.74.27-1.828 1.116.357.355.4.936.713 1.428.535.893 1.473 2.096 2.32 2.72l2.855 2.053c1.74 1.07 3.703 1.695 5.398 2.766.982.625 1.963 1.428 2.945 2.098.5.357.803.938 1.428 1.16v-.135c-.312-.4-.402-.98-.713-1.428l-1.34-1.293c-1.293-1.74-2.9-3.258-4.64-4.506-1.428-.982-4.55-2.32-5.13-3.97l-.088-.1c.98-.1 2.14-.447 3.078-.715 1.518-.4 2.9-.312 4.46-.713l2.143-.625v-.4c-.803-.803-1.383-1.874-2.23-2.632-2.275-1.963-4.775-3.882-7.363-5.488-1.383-.892-3.168-1.473-4.64-2.23-.537-.268-1.428-.402-1.74-.848-.805-.98-1.25-2.275-1.83-3.436l-3.658-7.763c-.803-1.74-1.295-3.48-2.275-5.086-4.596-7.585-9.594-12.18-17.268-16.687-1.65-.937-3.613-1.34-5.7-1.83l-3.346-.18c-.715-.312-1.428-1.16-2.053-1.562-2.543-1.606-9.102-5.086-10.977-.5-1.205 2.9 1.785 5.755 2.8 7.228.76 1.026 1.74 2.186 2.277 3.346.3.758.4 1.562.713 2.365.713 1.963 1.383 4.15 2.32 5.98.5.937 1.025 1.92 1.65 2.767.357.5.982.714 1.115 1.517-.625.893-.668 2.23-1.025 3.347-1.607 5.042-.982 11.288 1.293 15 .715 1.115 2.4 3.57 4.686 2.632 2.008-.803 1.56-3.346 2.14-5.577.135-.535.045-.892.312-1.25v.1l1.83 3.703c1.383 2.186 3.793 4.462 5.8 5.98 1.07.803 1.918 2.187 3.256 2.677v-.135h-.088c-.268-.4-.67-.58-1.027-.892-.803-.803-1.695-1.785-2.32-2.677-1.873-2.498-3.523-5.265-4.996-8.12-.715-1.383-1.34-2.9-1.918-4.283-.27-.536-.27-1.34-.715-1.606-.67.98-1.65 1.83-2.143 3.034-.848 1.918-.936 4.283-1.248 6.737-.18.045-.1 0-.18.1-1.426-.356-1.918-1.83-2.453-3.078-1.338-3.168-1.562-8.254-.402-11.913.312-.937 1.652-3.882 1.117-4.774-.27-.848-1.16-1.338-1.652-2.008-.58-.848-1.203-1.918-1.605-2.855-1.07-2.5-1.605-5.265-2.766-7.764-.537-1.16-1.473-2.365-2.232-3.435-.848-1.205-1.783-2.053-2.453-3.48-.223-.5-.535-1.294-.178-1.83.088-.357.268-.5.623-.58.58-.5 2.232.134 2.812.4 1.65.67 3.033 1.294 4.416 2.23.625.446 1.295 1.294 2.098 1.518h.938c1.428.312 3.033.1 4.37.5 2.365.76 4.506 1.874 6.426 3.08 5.844 3.703 10.664 8.968 13.92 15.26.535 1.026.758 1.963 1.25 3.034.938 2.187 2.098 4.417 3.033 6.56.938 2.097 1.83 4.24 3.168 5.98.67.937 3.346 1.427 4.55 1.918.893.4 2.275.76 3.08 1.25 1.516.937 3.033 2.008 4.46 3.034.713.534 2.945 1.65 3.078 2.54zm-45.5-38.772a7.09 7.09 0 0 0-1.828.223v.1h.088c.357.714.982 1.205 1.428 1.83l1.027 2.142.088-.1c.625-.446.938-1.16.938-2.23-.268-.312-.312-.625-.535-.937-.268-.446-.848-.67-1.206-1.026z"+ transform="matrix(.390229 0 0 .38781 -46.300037 -16.856717)"+ fill-rule="evenodd"+ fill="#00678c"+ /></svg+>diff --git a/src/lib/components/svg/databases/PostgreSQL.svelte b/src/lib/components/svg/databases/PostgreSQL.sveltenew file mode 100644index 0000000000..3021508a6e--- /dev/null+++ b/src/lib/components/svg/databases/PostgreSQL.svelte@@ -0,0 +1,56 @@+<script lang="ts">+ export let isAbsolute = false;+</script>++<svg+ class={isAbsolute ? 'absolute top-0 left-0 -m-5 h-10 w-10' : 'mx-auto w-8 h-8'}+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 432.071 445.383"+ xml:space="preserve"+>+ <g id="orginal" style="fill-rule:nonzero;clip-rule:nonzero;stroke:#000000;stroke-miterlimit:4;" />+ <g+ id="Layer_x0020_3"+ style="fill-rule:nonzero;clip-rule:nonzero;fill:none;stroke:#FFFFFF;stroke-width:12.4651;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;"+ >+ <path+ style="fill:#000000;stroke:#000000;stroke-width:37.3953;stroke-linecap:butt;stroke-linejoin:miter;"+ d="M323.205,324.227c2.833-23.601,1.984-27.062,19.563-23.239l4.463,0.392c13.517,0.615,31.199-2.174,41.587-7c22.362-10.376,35.622-27.7,13.572-23.148c-50.297,10.376-53.755-6.655-53.755-6.655c53.111-78.803,75.313-178.836,56.149-203.322 C352.514-5.534,262.036,26.049,260.522,26.869l-0.482,0.089c-9.938-2.062-21.06-3.294-33.554-3.496c-22.761-0.374-40.032,5.967-53.133,15.904c0,0-161.408-66.498-153.899,83.628c1.597,31.936,45.777,241.655,98.47,178.31 c19.259-23.163,37.871-42.748,37.871-42.748c9.242,6.14,20.307,9.272,31.912,8.147l0.897-0.765c-0.281,2.876-0.157,5.689,0.359,9.019c-13.572,15.167-9.584,17.83-36.723,23.416c-27.457,5.659-11.326,15.734-0.797,18.367c12.768,3.193,42.305,7.716,62.268-20.224 l-0.795,3.188c5.325,4.26,4.965,30.619,5.72,49.452c0.756,18.834,2.017,36.409,5.856,46.771c3.839,10.36,8.369,37.05,44.036,29.406c29.809-6.388,52.6-15.582,54.677-101.107"+ />+ <path+ style="fill:#336791;stroke:none;"+ d="M402.395,271.23c-50.302,10.376-53.76-6.655-53.76-6.655c53.111-78.808,75.313-178.843,56.153-203.326c-52.27-66.785-142.752-35.2-144.262-34.38l-0.486,0.087c-9.938-2.063-21.06-3.292-33.56-3.496c-22.761-0.373-40.026,5.967-53.127,15.902 c0,0-161.411-66.495-153.904,83.63c1.597,31.938,45.776,241.657,98.471,178.312c19.26-23.163,37.869-42.748,37.869-42.748c9.243,6.14,20.308,9.272,31.908,8.147l0.901-0.765c-0.28,2.876-0.152,5.689,0.361,9.019c-13.575,15.167-9.586,17.83-36.723,23.416 c-27.459,5.659-11.328,15.734-0.796,18.367c12.768,3.193,42.307,7.716,62.266-20.224l-0.796,3.188c5.319,4.26,9.054,27.711,8.428,48.969c-0.626,21.259-1.044,35.854,3.147,47.254c4.191,11.4,8.368,37.05,44.042,29.406c29.809-6.388,45.256-22.942,47.405-50.555 c1.525-19.631,4.976-16.729,5.194-34.28l2.768-8.309c3.192-26.611,0.507-35.196,18.872-31.203l4.463,0.392c13.517,0.615,31.208-2.174,41.591-7c22.358-10.376,35.618-27.7,13.573-23.148z"+ />+ <path+ d="M215.866,286.484c-1.385,49.516,0.348,99.377,5.193,111.495c4.848,12.118,15.223,35.688,50.9,28.045c29.806-6.39,40.651-18.756,45.357-46.051c3.466-20.082,10.148-75.854,11.005-87.281"+ />+ <path+ d="M173.104,38.256c0,0-161.521-66.016-154.012,84.109c1.597,31.938,45.779,241.664,98.473,178.316c19.256-23.166,36.671-41.335,36.671-41.335"+ />+ <path+ d="M260.349,26.207c-5.591,1.753,89.848-34.889,144.087,34.417c19.159,24.484-3.043,124.519-56.153,203.329"+ />+ <path+ style="stroke-linejoin:bevel;"+ d="M348.282,263.953c0,0,3.461,17.036,53.764,6.653c22.04-4.552,8.776,12.774-13.577,23.155c-18.345,8.514-59.474,10.696-60.146-1.069c-1.729-30.355,21.647-21.133,19.96-28.739c-1.525-6.85-11.979-13.573-18.894-30.338 c-6.037-14.633-82.796-126.849,21.287-110.183c3.813-0.789-27.146-99.002-124.553-100.599c-97.385-1.597-94.19,119.762-94.19,119.762"+ />+ <path+ d="M188.604,274.334c-13.577,15.166-9.584,17.829-36.723,23.417c-27.459,5.66-11.326,15.733-0.797,18.365c12.768,3.195,42.307,7.718,62.266-20.229c6.078-8.509-0.036-22.086-8.385-25.547c-4.034-1.671-9.428-3.765-16.361,3.994z"+ />+ <path+ d="M187.715,274.069c-1.368-8.917,2.93-19.528,7.536-31.942c6.922-18.626,22.893-37.255,10.117-96.339c-9.523-44.029-73.396-9.163-73.436-3.193c-0.039,5.968,2.889,30.26-1.067,58.548c-5.162,36.913,23.488,68.132,56.479,64.938"+ />+ <path+ style="fill:#FFFFFF;stroke-width:4.155;stroke-linecap:butt;stroke-linejoin:miter;"+ d="M172.517,141.7c-0.288,2.039,3.733,7.48,8.976,8.207c5.234,0.73,9.714-3.522,9.998-5.559c0.284-2.039-3.732-4.285-8.977-5.015c-5.237-0.731-9.719,0.333-9.996,2.367z"+ />+ <path+ style="fill:#FFFFFF;stroke-width:2.0775;stroke-linecap:butt;stroke-linejoin:miter;"+ d="M331.941,137.543c0.284,2.039-3.732,7.48-8.976,8.207c-5.238,0.73-9.718-3.522-10.005-5.559c-0.277-2.039,3.74-4.285,8.979-5.015c5.239-0.73,9.718,0.333,10.002,2.368z"+ />+ <path+ d="M350.676,123.432c0.863,15.994-3.445,26.888-3.988,43.914c-0.804,24.748,11.799,53.074-7.191,81.435"+ />+ <path style="stroke-width:3;" d="M0,60.232" />+ </g>+</svg>diff --git a/src/components/Database/SVGs/Redis.svelte b/src/lib/components/svg/databases/Redis.sveltesimilarity index 93%rename from src/components/Database/SVGs/Redis.svelterename to src/lib/components/svg/databases/Redis.svelteindex d35b5f9739..2571e601da 100644--- a/src/components/Database/SVGs/Redis.svelte+++ b/src/lib/components/svg/databases/Redis.svelte@@ -1,10 +1,9 @@-<script>- export let customClass;-+<script lang="ts">+ export let isAbsolute = false;</script><svg- class={customClass}+ class={isAbsolute ? 'absolute top-0 left-0 -m-5 h-10 w-10' : 'mx-auto w-8 h-8'}height="64"viewBox="0 0 32 32"width="64"diff --git a/src/lib/components/svg/services/MinIO.svelte b/src/lib/components/svg/services/MinIO.sveltenew file mode 100644index 0000000000..f9688699fc--- /dev/null+++ b/src/lib/components/svg/services/MinIO.svelte@@ -0,0 +1,9 @@+<script lang="ts">+ export let isAbsolute = false;+</script>++<img+ alt="minio logo"+ class={isAbsolute ? 'w-7 absolute top-0 left-0 -m-3 -mt-5' : 'w-4 mx-auto'}+ src="https://cdn.coollabs.io/assets/coolify/services/minio/MINIO_Bird.png"+/>diff --git a/src/lib/components/svg/services/NocoDB.svelte b/src/lib/components/svg/services/NocoDB.sveltenew file mode 100644index 0000000000..3e61a2b8f7--- /dev/null+++ b/src/lib/components/svg/services/NocoDB.svelte@@ -0,0 +1,9 @@+<script lang="ts">+ export let isAbsolute = false;+</script>++<img+ alt="nocodb logo"+ class={isAbsolute ? 'w-10 absolute top-0 left-0 -m-5' : 'w-8 mx-auto'}+ src="https://cdn.coollabs.io/assets/coolify/services/nocodb/nocodb.png"+/>diff --git a/src/lib/components/svg/services/PlausibleAnalytics.svelte b/src/lib/components/svg/services/PlausibleAnalytics.sveltenew file mode 100644index 0000000000..920f2ecf14--- /dev/null+++ b/src/lib/components/svg/services/PlausibleAnalytics.svelte@@ -0,0 +1,9 @@+<script lang="ts">+ export let isAbsolute = false;+</script>++<img+ alt="plausible logo"+ class={isAbsolute ? 'w-10 absolute top-0 left-0 -m-5' : 'w-6 mx-auto'}+ src="https://cdn.coollabs.io/assets/coolify/services/plausible/logo_sm.png"+/>diff --git a/src/lib/components/svg/services/VSCodeServer.svelte b/src/lib/components/svg/services/VSCodeServer.sveltenew file mode 100644index 0000000000..3b100e470c--- /dev/null+++ b/src/lib/components/svg/services/VSCodeServer.svelte@@ -0,0 +1,22 @@+<script lang="ts">+ export let isAbsolute = false;+</script>++<svg+ class={isAbsolute ? 'w-10 h-10 absolute top-0 left-0 -m-5' : 'w-8 mx-auto'}+ viewBox="0 0 128 128"+>+ <path+ d="M3.656 45.043s-3.027-2.191.61-5.113l8.468-7.594s2.426-2.559 4.989-.328l78.175 59.328v28.45s-.039 4.468-5.757 3.976zm0 0"+ fill="#2489ca"+ /><path+ d="M23.809 63.379L3.656 81.742s-2.07 1.543 0 4.305l9.356 8.527s2.222 2.395 5.508-.328l21.359-16.238zm0 0"+ fill="#1070b3"+ /><path+ d="M59.184 63.531l36.953-28.285-.239-28.297S94.32.773 89.055 3.99L39.879 48.851zm0 0"+ fill="#0877b9"+ /><path+ d="M90.14 123.797c2.145 2.203 4.747 1.48 4.747 1.48l28.797-14.222c3.687-2.52 3.171-5.645 3.171-5.645V20.465c0-3.735-3.812-5.024-3.812-5.024L98.082 3.38c-5.453-3.379-9.027.61-9.027.61s4.593-3.317 6.843 2.96v112.317c0 .773-.164 1.53-.492 2.214-.656 1.332-2.086 2.57-5.504 2.051zm0 0"+ fill="#3c99d4"+ />+</svg>diff --git a/src/lib/components/svg/services/Wordpress.svelte b/src/lib/components/svg/services/Wordpress.sveltenew file mode 100644index 0000000000..aaccb931ae--- /dev/null+++ b/src/lib/components/svg/services/Wordpress.svelte@@ -0,0 +1,12 @@+<script lang="ts">+ export let isAbsolute = false;+</script>++<svg class={isAbsolute ? 'w-10 absolute top-0 left-0 -m-5' : 'w-8 mx-auto'} viewBox="0 0 128 128">+ <path+ fill-rule="evenodd"+ clip-rule="evenodd"+ fill="white"+ d="M64.094 126.224c34.275-.052 62.021-27.933 62.021-62.325 0-33.833-27.618-61.697-60.613-62.286C30.85.995 1.894 29.113 1.885 63.21c-.01 35.079 27.612 63.064 62.209 63.014zM63.993 4.63c32.907-.011 59.126 26.725 59.116 60.28-.011 31.679-26.925 58.18-59.092 58.187-32.771.007-59.125-26.563-59.124-59.608.002-32.193 26.766-58.848 59.1-58.859zM39.157 35.896c.538 1.793-.968 2.417-2.569 2.542-1.685.13-3.369.257-5.325.406 6.456 19.234 12.815 38.183 19.325 57.573.464-.759.655-.973.739-1.223 3.574-10.682 7.168-21.357 10.651-32.069.318-.977.16-2.271-.188-3.275-1.843-5.32-4.051-10.524-5.667-15.908-1.105-3.686-2.571-6.071-6.928-5.644-.742.073-1.648-1.524-2.479-2.349 1.005-.6 2.003-1.704 3.017-1.719a849.593 849.593 0 0126.618.008c1.018.017 2.016 1.15 3.021 1.765-.88.804-1.639 2.01-2.668 2.321-1.651.498-3.482.404-5.458.58l19.349 57.56c2.931-9.736 5.658-18.676 8.31-27.639 2.366-8.001.956-15.473-3.322-22.52-1.286-2.119-2.866-4.175-3.595-6.486-.828-2.629-1.516-5.622-1.077-8.259.745-4.469 4.174-6.688 8.814-7.113C74.333.881 34.431 9.317 19.728 34.922c5.66-.261 11.064-.604 16.472-.678 1.022-.013 2.717.851 2.957 1.652zm10.117 77.971c-.118.345-.125.729-.218 1.302 10.943 3.034 21.675 2.815 32.659-.886l-16.78-45.96c-5.37 15.611-10.52 30.575-15.661 45.544zm-8.456-2.078l-25.281-69.35c-11.405 22.278-2.729 56.268 25.281 69.35zm76.428-44.562c.802-10.534-2.832-25.119-5.97-27.125-.35 3.875-.106 8.186-1.218 12.114-2.617 9.255-5.817 18.349-8.899 27.468-3.35 9.912-6.832 19.779-10.257 29.666 16.092-9.539 24.935-23.618 26.344-42.123z"+ />+</svg>diff --git a/src/lib/components/templates.ts b/src/lib/components/templates.tsnew file mode 100644index 0000000000..fb52efddb6--- /dev/null+++ b/src/lib/components/templates.ts@@ -0,0 +1,155 @@+const defaultBuildAndDeploy = {+ installCommand: 'yarn install',+ buildCommand: 'yarn build',+ startCommand: 'yarn start'+};+export const buildPacks = [+ {+ name: 'node',+ installCommand: null,+ buildCommand: null,+ startCommand: null,+ publishDirectory: null,+ port: null,+ fancyName: 'Node.js',+ hoverColor: 'hover:bg-green-700',+ color: 'bg-green-700'+ },++ {+ name: 'static',+ ...defaultBuildAndDeploy,+ publishDirectory: 'dist',+ port: 80,+ fancyName: 'Static',+ hoverColor: 'hover:bg-orange-700',+ color: 'bg-orange-700'+ },+ {+ name: 'docker',+ installCommand: null,+ buildCommand: null,+ startCommand: null,+ publishDirectory: null,+ port: null,+ fancyName: 'Docker',+ hoverColor: 'hover:bg-sky-700',+ color: 'bg-sky-700'+ },+ {+ name: 'svelte',+ ...defaultBuildAndDeploy,+ publishDirectory: 'public',+ port: 80,+ fancyName: 'Svelte',+ hoverColor: 'hover:bg-orange-700',+ color: 'bg-orange-700'+ },+ {+ name: 'nestjs',+ ...defaultBuildAndDeploy,+ startCommand: 'yarn start:prod',+ port: 3000,+ fancyName: 'NestJS',+ hoverColor: 'hover:bg-red-700',+ color: 'bg-red-700'+ },+ {+ name: 'react',+ ...defaultBuildAndDeploy,+ publishDirectory: 'build',+ port: 80,+ fancyName: 'React',+ hoverColor: 'hover:bg-blue-700',+ color: 'bg-blue-700'+ },+ {+ name: 'nextjs',+ ...defaultBuildAndDeploy,+ port: 3000,+ fancyName: 'NextJS',+ hoverColor: 'hover:bg-blue-700',+ color: 'bg-blue-700'+ },+ {+ name: 'gatsby',+ ...defaultBuildAndDeploy,+ publishDirectory: 'public',+ port: 80,+ fancyName: 'Gatsby',+ hoverColor: 'hover:bg-blue-700',+ color: 'bg-blue-700'+ },+ {+ name: 'vuejs',+ ...defaultBuildAndDeploy,+ publishDirectory: 'dist',+ port: 80,+ fancyName: 'VueJS',+ hoverColor: 'hover:bg-green-700',+ color: 'bg-green-700'+ },+ {+ name: 'nuxtjs',+ ...defaultBuildAndDeploy,+ port: 3000,+ fancyName: 'NuxtJS',+ hoverColor: 'hover:bg-green-700',+ color: 'bg-green-700'+ },+ {+ name: 'preact',+ ...defaultBuildAndDeploy,+ publishDirectory: 'build',+ port: 80,+ fancyName: 'Preact',+ hoverColor: 'hover:bg-blue-700',+ color: 'bg-blue-700'+ },+ {+ name: 'php',+ port: 80,+ fancyName: 'PHP',+ hoverColor: 'hover:bg-indigo-700',+ color: 'bg-indigo-700'+ },+ {+ name: 'rust',+ port: 3000,+ fancyName: 'Rust',+ hoverColor: 'hover:bg-pink-700',+ color: 'bg-pink-700'+ }+];+export const scanningTemplates = {+ svelte: {+ buildPack: 'svelte'+ },+ '@nestjs/core': {+ buildPack: 'nestjs'+ },+ next: {+ buildPack: 'nextjs'+ },+ nuxt: {+ buildPack: 'nuxtjs'+ },+ 'react-scripts': {+ buildPack: 'react'+ },+ 'parcel-bundler': {+ buildPack: 'static'+ },+ '@vue/cli-service': {+ buildPack: 'vuejs'+ },+ vuejs: {+ buildPack: 'vuejs'+ },+ gatsby: {+ buildPack: 'gatsby'+ },+ 'preact-cli': {+ buildPack: 'react'+ }+};diff --git a/src/lib/consts.ts b/src/lib/consts.tsdeleted file mode 100644index 37e60e886c..0000000000--- a/src/lib/consts.ts+++ /dev/null@@ -1,8 +0,0 @@-export const publicPages = [- '/',- '/api/v1/login/github/app',- '/api/v1/webhooks/deploy',- '/success',- '/api/v1/login/email'-];-export const VITE_GITHUB_APP_NAME = import.meta.env.VITE_GITHUB_APP_NAME;diff --git a/src/lib/crypto.ts b/src/lib/crypto.tsnew file mode 100644index 0000000000..861a255101--- /dev/null+++ b/src/lib/crypto.ts@@ -0,0 +1,36 @@+import crypto from 'crypto';+const algorithm = 'aes-256-ctr';++export const base64Encode = (text: string) => {+ return Buffer.from(text).toString('base64');+};+export const base64Decode = (text: string) => {+ return Buffer.from(text, 'base64').toString('ascii');+};+export const encrypt = (text: string) => {+ if (text) {+ const iv = crypto.randomBytes(16);+ const cipher = crypto.createCipheriv(algorithm, process.env['COOLIFY_SECRET_KEY'], iv);+ const encrypted = Buffer.concat([cipher.update(text), cipher.final()]);+ return JSON.stringify({+ iv: iv.toString('hex'),+ content: encrypted.toString('hex')+ });+ }+};++export const decrypt = (hashString: string) => {+ if (hashString) {+ const hash: Hash = JSON.parse(hashString);+ const decipher = crypto.createDecipheriv(+ algorithm,+ process.env['COOLIFY_SECRET_KEY'],+ Buffer.from(hash.iv, 'hex')+ );+ const decrpyted = Buffer.concat([+ decipher.update(Buffer.from(hash.content, 'hex')),+ decipher.final()+ ]);+ return decrpyted.toString();+ }+};diff --git a/src/lib/database/applications.ts b/src/lib/database/applications.tsnew file mode 100644index 0000000000..037334873c--- /dev/null+++ b/src/lib/database/applications.ts@@ -0,0 +1,230 @@+import { decrypt, encrypt } from '$lib/crypto';+import { removeProxyConfiguration } from '$lib/haproxy';+import { asyncExecShell, getEngine, removeContainer } from '$lib/common';++import { getDomain, removeDestinationDocker } from '$lib/common';+import { prisma } from './common';++export async function listApplications(teamId) {+ return await prisma.application.findMany({ where: { teams: { some: { id: teamId } } } });+}++export async function newApplication({ name, teamId }) {+ return await prisma.application.create({+ data: {+ name,+ teams: { connect: { id: teamId } },+ settings: { create: { debug: false, previews: false } }+ }+ });+}++export async function importApplication({+ name,+ teamId,+ fqdn,+ port,+ buildCommand,+ startCommand,+ installCommand+}) {+ return await prisma.application.create({+ data: {+ name,+ fqdn,+ port,+ buildCommand,+ startCommand,+ installCommand,+ teams: { connect: { id: teamId } }+ }+ });+}++export async function removeApplication({ id, teamId }) {+ const { fqdn, destinationDockerId, destinationDocker } = await prisma.application.findUnique({+ where: { id },+ include: { destinationDocker: true }+ });+ const domain = getDomain(fqdn);+ if (destinationDockerId) {+ const host = getEngine(destinationDocker.engine);+ const { stdout: containers } = await asyncExecShell(+ `DOCKER_HOST=${host} docker ps -a --filter network=${destinationDocker.network} --filter name=${id} --format '{{json .}}'`+ );+ if (containers) {+ const containersArray = containers.trim().split('\n');+ for (const container of containersArray) {+ const containerObj = JSON.parse(container);+ const id = containerObj.ID;+ const preview = containerObj.Image.split('-')[1];+ await removeDestinationDocker({ id, engine: destinationDocker.engine });+ if (preview) {+ await removeProxyConfiguration({ domain: `${preview}.${domain}` });+ } else {+ await removeProxyConfiguration({ domain });+ }+ }+ }+ }++ await prisma.applicationSettings.deleteMany({ where: { application: { id } } });+ await prisma.buildLog.deleteMany({ where: { applicationId: id } });+ await prisma.secret.deleteMany({ where: { applicationId: id } });+ await prisma.application.deleteMany({ where: { id, teams: { some: { id: teamId } } } });+}++export async function getApplicationWebhook({ projectId, branch }) {+ try {+ let body = await prisma.application.findFirst({+ where: { projectId, branch },+ include: {+ destinationDocker: true,+ settings: true,+ gitSource: { include: { githubApp: true, gitlabApp: true } },+ secrets: true+ }+ });++ if (body.gitSource?.githubApp?.clientSecret) {+ body.gitSource.githubApp.clientSecret = decrypt(body.gitSource.githubApp.clientSecret);+ }+ if (body.gitSource?.githubApp?.webhookSecret) {+ body.gitSource.githubApp.webhookSecret = decrypt(body.gitSource.githubApp.webhookSecret);+ }+ if (body.gitSource?.githubApp?.privateKey) {+ body.gitSource.githubApp.privateKey = decrypt(body.gitSource.githubApp.privateKey);+ }+ if (body?.gitSource?.gitlabApp?.appSecret) {+ body.gitSource.gitlabApp.appSecret = decrypt(body.gitSource.gitlabApp.appSecret);+ }+ if (body?.gitSource?.gitlabApp?.webhookToken) {+ body.gitSource.gitlabApp.webhookToken = decrypt(body.gitSource.gitlabApp.webhookToken);+ }+ if (body?.secrets.length > 0) {+ body.secrets = body.secrets.map((s) => {+ s.value = decrypt(s.value);+ return s;+ });+ }++ return { ...body };+ } catch (e) {+ throw { status: 404, body: { message: e.message } };+ }+}+export async function getApplication({ id, teamId }) {+ let body = await prisma.application.findFirst({+ where: { id, teams: { some: { id: teamId } } },+ include: {+ destinationDocker: true,+ settings: true,+ gitSource: { include: { githubApp: true, gitlabApp: true } },+ secrets: true+ }+ });++ if (body.gitSource?.githubApp?.clientSecret) {+ body.gitSource.githubApp.clientSecret = decrypt(body.gitSource.githubApp.clientSecret);+ }+ if (body.gitSource?.githubApp?.webhookSecret) {+ body.gitSource.githubApp.webhookSecret = decrypt(body.gitSource.githubApp.webhookSecret);+ }+ if (body.gitSource?.githubApp?.privateKey) {+ body.gitSource.githubApp.privateKey = decrypt(body.gitSource.githubApp.privateKey);+ }+ if (body?.gitSource?.gitlabApp?.appSecret) {+ body.gitSource.gitlabApp.appSecret = decrypt(body.gitSource.gitlabApp.appSecret);+ }+ if (body?.secrets.length > 0) {+ body.secrets = body.secrets.map((s) => {+ s.value = decrypt(s.value);+ return s;+ });+ }++ return { ...body };+}++export async function configureGitRepository({ id, repository, branch, projectId, webhookToken }) {+ if (webhookToken) {+ const encryptedWebhookToken = encrypt(webhookToken);+ return await prisma.application.update({+ where: { id },+ data: {+ repository,+ branch,+ projectId,+ gitSource: { update: { gitlabApp: { update: { webhookToken: encryptedWebhookToken } } } }+ }+ });+ } else {+ return await prisma.application.update({+ where: { id },+ data: { repository, branch, projectId }+ });+ }+}++export async function configureBuildPack({ id, buildPack }) {+ return await prisma.application.update({ where: { id }, data: { buildPack } });+}++export async function configureApplication({+ id,+ buildPack,+ name,+ fqdn,+ port,+ installCommand,+ buildCommand,+ startCommand,+ baseDirectory,+ publishDirectory+}) {+ return await prisma.application.update({+ where: { id },+ data: {+ buildPack,+ fqdn,+ port,+ installCommand,+ buildCommand,+ startCommand,+ baseDirectory,+ publishDirectory,+ name+ }+ });+}++export async function setApplicationSettings({ id, debug, previews }) {+ return await prisma.application.update({+ where: { id },+ data: { settings: { update: { debug, previews } } },+ include: { destinationDocker: true }+ });+}++export async function createBuild({+ id,+ applicationId,+ destinationDockerId,+ gitSourceId,+ githubAppId,+ gitlabAppId,+ type+}) {+ return await prisma.build.create({+ data: {+ id,+ applicationId,+ destinationDockerId,+ gitSourceId,+ githubAppId,+ gitlabAppId,+ status: 'running',+ type+ }+ });+}diff --git a/src/lib/database/checks.ts b/src/lib/database/checks.tsnew file mode 100644index 0000000000..884c6d2bd4--- /dev/null+++ b/src/lib/database/checks.ts@@ -0,0 +1,38 @@+import { getDomain } from '$lib/common';+import { prisma, PrismaErrorHandler } from './common';++export async function isBranchAlreadyUsed({ repository, branch, id }) {+ const application = await prisma.application.findUnique({+ where: { id },+ include: { gitSource: true }+ });+ return await prisma.application.findFirst({+ where: { branch, repository, gitSource: { type: application.gitSource.type }, id: { not: id } }+ });+}++export async function isDockerNetworkExists({ network }) {+ return await prisma.destinationDocker.findFirst({ where: { network } });+}++export async function isSecretExists({ id, name }) {+ return await prisma.secret.findFirst({ where: { name, applicationId: id } });+}++export async function isDomainConfigured({ id, fqdn }) {+ const domain = getDomain(fqdn);+ const foundApp = await prisma.application.findFirst({+ where: { fqdn: { endsWith: domain }, id: { not: id } },+ select: { fqdn: true }+ });+ const foundService = await prisma.service.findFirst({+ where: { fqdn: { endsWith: domain }, id: { not: id } },+ select: { fqdn: true }+ });+ const coolifyFqdn = await prisma.setting.findFirst({+ where: { fqdn: { endsWith: domain }, id: { not: id } },+ select: { fqdn: true }+ });+ if (foundApp || foundService || coolifyFqdn) return true;+ return false;+}diff --git a/src/lib/database/common.ts b/src/lib/database/common.tsnew file mode 100644index 0000000000..816082d85e--- /dev/null+++ b/src/lib/database/common.ts@@ -0,0 +1,232 @@+import { dev } from '$app/env';+import { sentry } from '$lib/common';+import * as Prisma from '@prisma/client';+import { default as ProdPrisma } from '@prisma/client';+import generator from 'generate-password';+import forge from 'node-forge';++export function generatePassword(length = 24) {+ return generator.generate({+ length,+ numbers: true,+ strict: true+ });+}++let { PrismaClient } = Prisma;+let P = Prisma.Prisma;+if (!dev) {+ PrismaClient = ProdPrisma.PrismaClient;+ P = ProdPrisma.Prisma;+}+let prismaOptions = {+ rejectOnNotFound: false+};+if (dev) {+ prismaOptions = {+ errorFormat: 'pretty',+ rejectOnNotFound: false,+ log: [+ {+ emit: 'event',+ level: 'query'+ }+ ]+ };+}+export const prisma = new PrismaClient(prismaOptions);++export function PrismaErrorHandler(e) {+ sentry.captureException(e);+ const payload = {+ status: e.status || 500,+ body: {+ message: 'Ooops, something is not okay, are you okay?',+ error: e.error || e.message+ }+ };+ if (e.name === 'NotFoundError') {+ payload.status = 404;+ }+ if (e instanceof P.PrismaClientKnownRequestError) {+ if (e.code === 'P2002') {+ payload.body.message = 'Already exists. Choose another name.';+ }+ }+ // console.error(e)+ return payload;+}+export async function generateSshKeyPair(): Promise<{ publicKey: string; privateKey: string }> {+ return await new Promise(async (resolve, reject) => {+ forge.pki.rsa.generateKeyPair({ bits: 4096, workers: -1 }, function (err, keys) {+ if (keys) {+ resolve({+ publicKey: forge.ssh.publicKeyToOpenSSH(keys.publicKey),+ privateKey: forge.ssh.privateKeyToOpenSSH(keys.privateKey)+ });+ } else {+ reject(keys);+ }+ });+ });+}++export const supportedDatabaseTypesAndVersions = [+ {+ name: 'mongodb',+ fancyName: 'MongoDB',+ baseImage: 'bitnami/mongodb',+ versions: ['5.0.5', '4.4.11', '4.2.18', '4.0.27']+ },+ { name: 'mysql', fancyName: 'MySQL', baseImage: 'bitnami/mysql', versions: ['8.0.27', '5.7.36'] },+ {+ name: 'postgresql',+ fancyName: 'PostgreSQL',+ baseImage: 'bitnami/postgresql',+ versions: ['14.1.0', '13.5.0', '12.9.0', '11.14.0', '10.19.0', '9.6.24']+ },+ {+ name: 'redis',+ fancyName: 'Redis',+ baseImage: 'bitnami/redis',+ versions: ['6.2.6', '6.0.16', '5.0.14']+ },+ { name: 'couchdb', fancyName: 'CouchDB', baseImage: 'bitnami/couchdb', versions: ['3.2.1'] }+];+export const supportedServiceTypesAndVersions = [+ {+ name: 'plausibleanalytics',+ fancyName: 'Plausible Analytics',+ baseImage: 'plausible/analytics',+ versions: ['latest']+ },+ { name: 'nocodb', fancyName: 'NocoDB', baseImage: 'nocodb/nocodb', versions: ['latest'] },+ { name: 'minio', fancyName: 'MinIO', baseImage: 'minio/minio', versions: ['latest'] },+ {+ name: 'vscodeserver',+ fancyName: 'VSCode Server',+ baseImage: 'codercom/code-server',+ versions: ['latest']+ },+ {+ name: 'wordpress',+ fancyName: 'Wordpress',+ baseImage: 'wordpress',+ versions: ['latest', 'php8.1', 'php8.0', 'php7.4', 'php7.3']+ }+];++export function getVersions(type) {+ const found = supportedDatabaseTypesAndVersions.find((t) => t.name === type);+ if (found) {+ return found.versions;+ }+ return [];+}+export function getDatabaseImage(type) {+ const found = supportedDatabaseTypesAndVersions.find((t) => t.name === type);+ if (found) {+ return found.baseImage;+ }+ return '';+}+export function getServiceImage(type) {+ const found = supportedServiceTypesAndVersions.find((t) => t.name === type);+ if (found) {+ return found.baseImage;+ }+ return '';+}+export function generateDatabaseConfiguration(database) {+ const {+ id,+ dbUser,+ dbUserPassword,+ rootUser,+ rootUserPassword,+ defaultDatabase,+ version,+ type,+ settings: { appendOnly }+ } = database;+ const baseImage = getDatabaseImage(type);+ if (type === 'mysql') {+ return {+ // url: `mysql://${dbUser}:${dbUserPassword}@${id}:${isPublic ? port : 3306}/${defaultDatabase}`,+ privatePort: 3306,+ environmentVariables: {+ MYSQL_USER: dbUser,+ MYSQL_PASSWORD: dbUserPassword,+ MYSQL_ROOT_PASSWORD: rootUserPassword,+ MYSQL_ROOT_USER: rootUser,+ MYSQL_DATABASE: defaultDatabase+ },+ image: `${baseImage}:${version}`,+ volume: `${id}-${type}-data:/bitnami/mysql/data`,+ ulimits: {}+ };+ } else if (type === 'mongodb') {+ return {+ // url: `mongodb://${dbUser}:${dbUserPassword}@${id}:${isPublic ? port : 27017}/${defaultDatabase}`,+ privatePort: 27017,+ environmentVariables: {+ MONGODB_ROOT_USER: rootUser,+ MONGODB_ROOT_PASSWORD: rootUserPassword+ },+ image: `${baseImage}:${version}`,+ volume: `${id}-${type}-data:/bitnami/mongodb`,+ ulimits: {}+ };+ } else if (type === 'postgresql') {+ return {+ // url: `psql://${dbUser}:${dbUserPassword}@${id}:${isPublic ? port : 5432}/${defaultDatabase}`,+ privatePort: 5432,+ environmentVariables: {+ POSTGRESQL_PASSWORD: dbUserPassword,+ POSTGRESQL_USERNAME: dbUser,+ POSTGRESQL_DATABASE: defaultDatabase+ },+ image: `${baseImage}:${version}`,+ volume: `${id}-${type}-data:/bitnami/postgresql`,+ ulimits: {}+ };+ } else if (type === 'redis') {+ return {+ // url: `redis://${dbUser}:${dbUserPassword}@${id}:${isPublic ? port : 6379}/${defaultDatabase}`,+ privatePort: 6379,+ environmentVariables: {+ REDIS_PASSWORD: dbUserPassword,+ REDIS_AOF_ENABLED: appendOnly ? 'yes' : 'no'+ },+ image: `${baseImage}:${version}`,+ volume: `${id}-${type}-data:/bitnami/redis/data`,+ ulimits: {}+ };+ } else if (type === 'couchdb') {+ return {+ // url: `couchdb://${dbUser}:${dbUserPassword}@${id}:${isPublic ? port : 5984}/${defaultDatabase}`,+ privatePort: 5984,+ environmentVariables: {+ COUCHDB_PASSWORD: dbUserPassword,+ COUCHDB_USER: dbUser+ },+ image: `${baseImage}:${version}`,+ volume: `${id}-${type}-data:/bitnami/couchdb`,+ ulimits: {}+ };+ }+ // } else if (type === 'clickhouse') {+ // return {+ // url: `clickhouse://${dbUser}:${dbUserPassword}@${id}:${port}/${defaultDatabase}`,+ // privatePort: 9000,+ // image: `bitnami/clickhouse-server:${version}`,+ // volume: `${id}-${type}-data:/var/lib/clickhouse`,+ // ulimits: {+ // nofile: {+ // soft: 262144,+ // hard: 262144+ // }+ // }+ // }+ // }+}diff --git a/src/lib/database/databases.ts b/src/lib/database/databases.tsnew file mode 100644index 0000000000..00afa48273--- /dev/null+++ b/src/lib/database/databases.ts@@ -0,0 +1,148 @@+import { decrypt, encrypt } from '$lib/crypto';+import { dockerInstance } from '$lib/docker';+import cuid from 'cuid';+import { generatePassword } from '.';+import { prisma, PrismaErrorHandler } from './common';+import getPort from 'get-port';+import { asyncExecShell, getEngine, removeContainer } from '$lib/common';++export async function listDatabases(teamId) {+ return await prisma.database.findMany({ where: { teams: { some: { id: teamId } } } });+}+export async function newDatabase({ name, teamId }) {+ const dbUser = cuid();+ const dbUserPassword = encrypt(generatePassword());+ const rootUser = cuid();+ const rootUserPassword = encrypt(generatePassword());+ const defaultDatabase = cuid();++ let publicPort = await getPort();+ let i = 0;++ do {+ const usedPorts = await prisma.database.findMany({ where: { publicPort } });+ if (usedPorts.length === 0) break;+ publicPort = await getPort();+ i++;+ } while (i < 10);+ if (i === 9) {+ throw {+ error: 'No free port found!? Is it possible?'+ };+ }+ return await prisma.database.create({+ data: {+ name,+ publicPort,+ defaultDatabase,+ dbUser,+ dbUserPassword,+ rootUser,+ rootUserPassword,+ teams: { connect: { id: teamId } },+ settings: { create: { isPublic: false } }+ }+ });+}++export async function getDatabase({ id, teamId }) {+ const body = await prisma.database.findFirst({+ where: { id, teams: { some: { id: teamId } } },+ include: { destinationDocker: true, settings: true }+ });++ if (body.dbUserPassword) body.dbUserPassword = decrypt(body.dbUserPassword);+ if (body.rootUserPassword) body.rootUserPassword = decrypt(body.rootUserPassword);++ return { ...body };+}++export async function removeDatabase({ id }) {+ await prisma.databaseSettings.deleteMany({ where: { databaseId: id } });+ await prisma.database.delete({ where: { id } });+ return;+}++export async function configureDatabaseType({ id, type }) {+ return await prisma.database.update({+ where: { id },+ data: { type }+ });+}+export async function setDatabase({+ id,+ version,+ isPublic,+ appendOnly+}: {+ id: string;+ version?: string;+ isPublic?: boolean;+ appendOnly?: boolean;+}) {+ return await prisma.database.update({+ where: { id },+ data: {+ version,+ settings: { upsert: { update: { isPublic, appendOnly }, create: { isPublic, appendOnly } } }+ }+ });+}+export async function updateDatabase({+ id,+ name,+ defaultDatabase,+ dbUser,+ dbUserPassword,+ rootUser,+ rootUserPassword,+ version+}) {+ const encryptedDbUserPassword = dbUserPassword && encrypt(dbUserPassword);+ const encryptedRootUserPassword = rootUserPassword && encrypt(rootUserPassword);+ return await prisma.database.update({+ where: { id },+ data: {+ name,+ defaultDatabase,+ dbUser,+ dbUserPassword: encryptedDbUserPassword,+ rootUser,+ rootUserPassword: encryptedRootUserPassword,+ version+ }+ });+}++// export async function setDatabaseSettings({ id, isPublic }) {+// try {+// await prisma.databaseSettings.update({ where: { databaseId: id }, data: { isPublic } })+// return { status: 201 }+// } catch (e) {+// throw PrismaErrorHandler(e)+// }+// }++export async function stopDatabase(database) {+ let everStarted = false;+ const {+ id,+ destinationDockerId,+ destinationDocker: { engine }+ } = database;+ if (destinationDockerId) {+ try {+ const host = getEngine(engine);+ const { stdout } = await asyncExecShell(+ `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`+ );+ if (stdout) {+ everStarted = true;+ await removeContainer(id, engine);+ }+ } catch (error) {+ //+ }+ }+ return everStarted;+}diff --git a/src/lib/database/destinations.ts b/src/lib/database/destinations.tsnew file mode 100644index 0000000000..a4e5ec228b--- /dev/null+++ b/src/lib/database/destinations.ts@@ -0,0 +1,132 @@+import { asyncExecShell, getEngine } from '$lib/common';+import { dockerInstance } from '$lib/docker';+import { defaultProxyImageHttp, defaultProxyImageTcp, startCoolifyProxy } from '$lib/haproxy';+import { getDatabaseImage } from '.';+import { prisma, PrismaErrorHandler } from './common';++export async function listDestinations(teamId) {+ return await prisma.destinationDocker.findMany({ where: { teams: { some: { id: teamId } } } });+}++export async function configureDestinationForService({ id, destinationId }) {+ return await prisma.service.update({+ where: { id },+ data: { destinationDocker: { connect: { id: destinationId } } }+ });+}+export async function configureDestinationForApplication({ id, destinationId }) {+ return await prisma.application.update({+ where: { id },+ data: { destinationDocker: { connect: { id: destinationId } } }+ });+}+export async function configureDestinationForDatabase({ id, destinationId }) {+ await prisma.database.update({+ where: { id },+ data: { destinationDocker: { connect: { id: destinationId } } }+ });++ const {+ destinationDockerId,+ destinationDocker: { engine },+ version,+ type+ } = await prisma.database.findUnique({ where: { id }, include: { destinationDocker: true } });++ if (destinationDockerId) {+ const host = getEngine(engine);+ if (type && version) {+ const baseImage = getDatabaseImage(type);+ asyncExecShell(`DOCKER_HOST=${host} docker pull ${baseImage}:${version}`);+ asyncExecShell(`DOCKER_HOST=${host} docker pull coollabsio/${defaultProxyImageTcp}`);+ asyncExecShell(`DOCKER_HOST=${host} docker pull coollabsio/${defaultProxyImageHttp}`);+ asyncExecShell(`DOCKER_HOST=${host} docker pull certbot/certbot:latest`);+ asyncExecShell(`DOCKER_HOST=${host} docker pull alpine:latest`);+ }+ }+}+export async function updateDestination({ id, name, engine, network }) {+ return await prisma.destinationDocker.update({ where: { id }, data: { name, engine, network } });+}++export async function newDestination({ name, teamId, engine, network, isCoolifyProxyUsed }) {+ const host = getEngine(engine);+ const docker = dockerInstance({ destinationDocker: { engine, network } });+ const found = await docker.engine.listNetworks({ filters: { name: [`^${network}$`] } });+ if (found.length === 0) {+ await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable ${network}`);+ }+ await prisma.destinationDocker.create({+ data: { name, teams: { connect: { id: teamId } }, engine, network, isCoolifyProxyUsed }+ });+ const destinations = await prisma.destinationDocker.findMany({ where: { engine } });+ const destination = destinations.find((destination) => destination.network === network);++ if (destinations.length > 0) {+ const proxyConfigured = destinations.find(+ (destination) => destination.network !== network && destination.isCoolifyProxyUsed === true+ );+ if (proxyConfigured) {+ if (proxyConfigured.isCoolifyProxyUsed) {+ isCoolifyProxyUsed = true;+ } else {+ isCoolifyProxyUsed = false;+ }+ }+ await prisma.destinationDocker.updateMany({ where: { engine }, data: { isCoolifyProxyUsed } });+ }+ if (isCoolifyProxyUsed) await startCoolifyProxy(engine);+ return destination.id;+}+export async function removeDestination({ id }) {+ const destination = await prisma.destinationDocker.delete({ where: { id } });+ if (destination.isCoolifyProxyUsed) {+ const host = getEngine(destination.engine);+ const { network } = destination;+ const { stdout: found } = await asyncExecShell(+ `DOCKER_HOST=${host} docker ps -a --filter network=${network} --filter name=coolify-haproxy --format '{{.}}'`+ );+ if (found) {+ await asyncExecShell(+ `DOCKER_HOST="${host}" docker network disconnect ${network} coolify-haproxy`+ );+ await asyncExecShell(`DOCKER_HOST="${host}" docker network rm ${network}`);+ }+ }+}++export async function getDestination({ id, teamId }) {+ return await prisma.destinationDocker.findFirst({+ where: { id, teams: { some: { id: teamId } } }+ });+}+export async function getDestinationByApplicationId({ id, teamId }) {+ return await prisma.destinationDocker.findFirst({+ where: { application: { some: { id } }, teams: { some: { id: teamId } } }+ });+}++export async function setDestinationSettings({ engine, isCoolifyProxyUsed }) {+ return await prisma.destinationDocker.updateMany({+ where: { engine },+ data: { isCoolifyProxyUsed }+ });++ // if (isCoolifyProxyUsed) {+ // await installCoolifyProxy(engine)+ // await configureNetworkCoolifyProxy(engine)+ // } else {+ // // TODO: must check if other destination is using the proxy??? or not?+ // const domain = await prisma.setting.findUnique({ where: { name: 'domain' }, rejectOnNotFound: false })+ // if (!domain) {+ // await uninstallCoolifyProxy(engine)+ // } else {+ // return {+ // stastus: 500,+ // body: {+ // message: 'You can not disable the Coolify proxy while the domain is set for Coolify itself.'+ // }+ // }+ // }+ // }+}diff --git a/src/lib/database/gitSources.ts b/src/lib/database/gitSources.tsnew file mode 100644index 0000000000..b2f43a0922--- /dev/null+++ b/src/lib/database/gitSources.ts@@ -0,0 +1,71 @@+import { decrypt, encrypt } from '$lib/crypto';+import { prisma, PrismaErrorHandler } from './common';++export async function listSources(teamId) {+ return await prisma.gitSource.findMany({+ where: { teams: { some: { id: teamId } } },+ include: { githubApp: true, gitlabApp: true }+ });+}++export async function newSource({ name, teamId, type, htmlUrl, apiUrl, organization }) {+ return await prisma.gitSource.create({+ data: {+ teams: { connect: { id: teamId } },+ name,+ type,+ htmlUrl,+ apiUrl,+ organization+ }+ });+}+export async function removeSource({ id }) {+ // TODO: Disconnect application with this sourceId! Maybe not needed?+ const source = await prisma.gitSource.delete({+ where: { id },+ include: { githubApp: true, gitlabApp: true }+ });+ if (source.githubAppId) await prisma.githubApp.delete({ where: { id: source.githubAppId } });+ if (source.gitlabAppId) await prisma.gitlabApp.delete({ where: { id: source.gitlabAppId } });+}++export async function getSource({ id, teamId }) {+ let body = await prisma.gitSource.findFirst({+ where: { id, teams: { some: { id: teamId } } },+ include: { githubApp: true, gitlabApp: true }+ });+ if (body?.githubApp?.clientSecret)+ body.githubApp.clientSecret = decrypt(body.githubApp.clientSecret);+ if (body?.githubApp?.webhookSecret)+ body.githubApp.webhookSecret = decrypt(body.githubApp.webhookSecret);+ if (body?.githubApp?.privateKey) body.githubApp.privateKey = decrypt(body.githubApp.privateKey);+ if (body?.gitlabApp?.appSecret) body.gitlabApp.appSecret = decrypt(body.gitlabApp.appSecret);+ return body;+}+export async function addSource({ id, appId, teamId, oauthId, groupName, appSecret }) {+ const encrptedAppSecret = encrypt(appSecret);+ return await prisma.gitlabApp.create({+ data: {+ teams: { connect: { id: teamId } },+ appId,+ oauthId,+ groupName,+ appSecret: encrptedAppSecret,+ gitSource: { connect: { id } }+ }+ });+}++export async function configureGitsource({ id, gitSourceId }) {+ return await prisma.application.update({+ where: { id },+ data: { gitSource: { connect: { id: gitSourceId } } }+ });+}+export async function updateGitsource({ id, name }) {+ return await prisma.gitSource.update({+ where: { id },+ data: { name }+ });+}diff --git a/src/lib/database/github.ts b/src/lib/database/github.tsnew file mode 100644index 0000000000..46f57159f8--- /dev/null+++ b/src/lib/database/github.ts@@ -0,0 +1,44 @@+import { decrypt, encrypt } from '$lib/crypto';+import { prisma, PrismaErrorHandler } from './common';++export async function addInstallation({ gitSourceId, installation_id }) {+ const source = await prisma.gitSource.findUnique({+ where: { id: gitSourceId },+ include: { githubApp: true }+ });+ return await prisma.githubApp.update({+ where: { id: source.githubAppId },+ data: { installationId: Number(installation_id) }+ });+}++export async function getUniqueGithubApp({ githubAppId }) {+ let body = await prisma.githubApp.findUnique({ where: { id: githubAppId } });+ if (body.privateKey) body.privateKey = decrypt(body.privateKey);+ return body;+}++export async function createGithubApp({+ id,+ client_id,+ slug,+ client_secret,+ pem,+ webhook_secret,+ state+}) {+ const encryptedClientSecret = encrypt(client_secret);+ const encryptedWebhookSecret = encrypt(webhook_secret);+ const encryptedPem = encrypt(pem);+ return await prisma.githubApp.create({+ data: {+ appId: id,+ name: slug,+ clientId: client_id,+ clientSecret: encryptedClientSecret,+ webhookSecret: encryptedWebhookSecret,+ privateKey: encryptedPem,+ gitSource: { connect: { id: state } }+ }+ });+}diff --git a/src/lib/database/gitlab.ts b/src/lib/database/gitlab.tsnew file mode 100644index 0000000000..e8020794bf--- /dev/null+++ b/src/lib/database/gitlab.ts@@ -0,0 +1,37 @@+import { encrypt } from '$lib/crypto';+import { generateSshKeyPair, prisma, PrismaErrorHandler } from './common';++export async function updateDeployKey({ id, deployKeyId }) {+ const application = await prisma.application.findUnique({+ where: { id },+ include: { gitSource: { include: { gitlabApp: true } } }+ });+ return await prisma.gitlabApp.update({+ where: { id: application.gitSource.gitlabApp.id },+ data: { deployKeyId }+ });+}+export async function getSshKey({ id }) {+ const application = await prisma.application.findUnique({+ where: { id },+ include: { gitSource: { include: { gitlabApp: true } } }+ });+ return { status: 200, body: { publicKey: application.gitSource.gitlabApp.publicSshKey } };+}+export async function generateSshKey({ id }) {+ const application = await prisma.application.findUnique({+ where: { id },+ include: { gitSource: { include: { gitlabApp: true } } }+ });+ if (!application.gitSource?.gitlabApp?.privateSshKey) {+ const keys = await generateSshKeyPair();+ const encryptedPrivateKey = encrypt(keys.privateKey);+ await prisma.gitlabApp.update({+ where: { id: application.gitSource.gitlabApp.id },+ data: { privateSshKey: encryptedPrivateKey, publicSshKey: keys.publicKey }+ });+ return { status: 201, body: { publicKey: keys.publicKey } };+ } else {+ return { status: 200 };+ }+}diff --git a/src/lib/database/index.ts b/src/lib/database/index.tsnew file mode 100644index 0000000000..e03b564f79--- /dev/null+++ b/src/lib/database/index.ts@@ -0,0 +1,14 @@+export * from './applications';+export * from './checks';+export * from './common';+export * from './destinations';+export * from './github';+export * from './gitlab';+export * from './gitSources';+export * from './logs';+export * from './settings';+export * from './users';+export * from './teams';+export * from './secrets';+export * from './databases';+export * from './services';diff --git a/src/lib/database/logs.ts b/src/lib/database/logs.tsnew file mode 100644index 0000000000..e4dd7a3e60--- /dev/null+++ b/src/lib/database/logs.ts@@ -0,0 +1,13 @@+import { prisma, PrismaErrorHandler } from './common';++export async function listLogs({ buildId, last = 0 }) {+ try {+ const body = await prisma.buildLog.findMany({+ where: { buildId, time: { gt: last } },+ orderBy: { time: 'asc' }+ });+ return [...body];+ } catch (e) {+ throw PrismaErrorHandler(e);+ }+}diff --git a/src/lib/database/secrets.ts b/src/lib/database/secrets.tsnew file mode 100644index 0000000000..06f6592b2c--- /dev/null+++ b/src/lib/database/secrets.ts@@ -0,0 +1,21 @@+import { encrypt } from '$lib/crypto';+import { prisma, PrismaErrorHandler } from './common';++export async function listSecrets({ applicationId }) {+ return await prisma.secret.findMany({+ where: { applicationId },+ orderBy: { createdAt: 'desc' },+ select: { id: true, createdAt: true, name: true, isBuildSecret: true }+ });+}++export async function createSecret({ id, name, value, isBuildSecret }) {+ value = encrypt(value);+ return await prisma.secret.create({+ data: { name, value, isBuildSecret, application: { connect: { id } } }+ });+}++export async function removeSecret({ id, name }) {+ return await prisma.secret.deleteMany({ where: { applicationId: id, name } });+}diff --git a/src/lib/database/services.ts b/src/lib/database/services.tsnew file mode 100644index 0000000000..6b7ac2f3f6--- /dev/null+++ b/src/lib/database/services.ts@@ -0,0 +1,137 @@+import { decrypt, encrypt } from '$lib/crypto';+import { dockerInstance } from '$lib/docker';+import cuid from 'cuid';+import { generatePassword } from '.';+import { prisma, PrismaErrorHandler } from './common';++export async function listServices(teamId) {+ return await prisma.service.findMany({ where: { teams: { some: { id: teamId } } } });+}++export async function newService({ name, teamId }) {+ return await prisma.service.create({ data: { name, teams: { connect: { id: teamId } } } });+}++export async function getService({ id, teamId }) {+ const body = await prisma.service.findFirst({+ where: { id, teams: { some: { id: teamId } } },+ include: {+ destinationDocker: true,+ plausibleAnalytics: true,+ minio: true,+ vscodeserver: true,+ wordpress: true+ }+ });++ if (body.plausibleAnalytics?.postgresqlPassword)+ body.plausibleAnalytics.postgresqlPassword = decrypt(+ body.plausibleAnalytics.postgresqlPassword+ );+ if (body.plausibleAnalytics?.password)+ body.plausibleAnalytics.password = decrypt(body.plausibleAnalytics.password);+ if (body.plausibleAnalytics?.secretKeyBase)+ body.plausibleAnalytics.secretKeyBase = decrypt(body.plausibleAnalytics.secretKeyBase);++ if (body.minio?.rootUserPassword)+ body.minio.rootUserPassword = decrypt(body.minio.rootUserPassword);++ if (body.vscodeserver?.password) body.vscodeserver.password = decrypt(body.vscodeserver.password);++ if (body.wordpress?.mysqlPassword)+ body.wordpress.mysqlPassword = decrypt(body.wordpress.mysqlPassword);+ if (body.wordpress?.mysqlRootUserPassword)+ body.wordpress.mysqlRootUserPassword = decrypt(body.wordpress.mysqlRootUserPassword);++ return { ...body };+}++export async function configureServiceType({ id, type }) {+ if (type === 'plausibleanalytics') {+ const password = encrypt(generatePassword());+ const postgresqlUser = cuid();+ const postgresqlPassword = encrypt(generatePassword());+ const postgresqlDatabase = 'plausibleanalytics';+ const secretKeyBase = encrypt(generatePassword(64));++ await prisma.service.update({+ where: { id },+ data: {+ type,+ plausibleAnalytics: {+ create: {+ postgresqlDatabase,+ postgresqlUser,+ postgresqlPassword,+ password,+ secretKeyBase+ }+ }+ }+ });+ } else if (type === 'nocodb') {+ await prisma.service.update({+ where: { id },+ data: { type }+ });+ } else if (type === 'minio') {+ const rootUser = cuid();+ const rootUserPassword = encrypt(generatePassword());+ await prisma.service.update({+ where: { id },+ data: { type, minio: { create: { rootUser, rootUserPassword } } }+ });+ } else if (type === 'vscodeserver') {+ const password = encrypt(generatePassword());+ await prisma.service.update({+ where: { id },+ data: { type, vscodeserver: { create: { password } } }+ });+ } else if (type === 'wordpress') {+ const mysqlUser = cuid();+ const mysqlPassword = encrypt(generatePassword());+ const mysqlRootUser = cuid();+ const mysqlRootUserPassword = encrypt(generatePassword());+ await prisma.service.update({+ where: { id },+ data: {+ type,+ wordpress: { create: { mysqlPassword, mysqlRootUserPassword, mysqlRootUser, mysqlUser } }+ }+ });+ }+}+export async function setService({ id, version }) {+ return await prisma.service.update({+ where: { id },+ data: { version }+ });+}++export async function updatePlausibleAnalyticsService({ id, fqdn, email, username, name }) {+ await prisma.plausibleAnalytics.update({ where: { serviceId: id }, data: { email, username } });+ await prisma.service.update({ where: { id }, data: { name, fqdn } });+}+export async function updateNocoDbOrMinioService({ id, fqdn, name }) {+ return await prisma.service.update({ where: { id }, data: { fqdn, name } });+}+export async function updateVsCodeServer({ id, fqdn, name }) {+ return await prisma.service.update({ where: { id }, data: { fqdn, name } });+}+export async function updateWordpress({ id, fqdn, name, mysqlDatabase, extraConfig }) {+ return await prisma.service.update({+ where: { id },+ data: { fqdn, name, wordpress: { update: { mysqlDatabase, extraConfig } } }+ });+}+export async function updateMinioService({ id, publicPort }) {+ return await prisma.minio.update({ where: { serviceId: id }, data: { publicPort } });+}++export async function removeService({ id }) {+ await prisma.plausibleAnalytics.deleteMany({ where: { serviceId: id } });+ await prisma.minio.deleteMany({ where: { serviceId: id } });+ await prisma.vscodeserver.deleteMany({ where: { serviceId: id } });+ await prisma.wordpress.deleteMany({ where: { serviceId: id } });+ await prisma.service.delete({ where: { id } });+}diff --git a/src/lib/database/settings.ts b/src/lib/database/settings.tsnew file mode 100644index 0000000000..31d6b3c04e--- /dev/null+++ b/src/lib/database/settings.ts@@ -0,0 +1,8 @@+import { decrypt } from '$lib/crypto';+import { prisma } from './common';++export async function listSettings() {+ let settings = await prisma.setting.findFirst({});+ if (settings.proxyPassword) settings.proxyPassword = decrypt(settings.proxyPassword);+ return settings;+}diff --git a/src/lib/database/teams.ts b/src/lib/database/teams.tsnew file mode 100644index 0000000000..3e1cf9928f--- /dev/null+++ b/src/lib/database/teams.ts@@ -0,0 +1,20 @@+import { prisma, PrismaErrorHandler } from './common';++export async function listTeams() {+ return await prisma.team.findMany();+}+export async function newTeam({ name, userId }) {+ return await prisma.team.create({+ data: {+ name,+ permissions: { create: { user: { connect: { id: userId } }, permission: 'owner' } },+ users: { connect: { id: userId } }+ }+ });+}+export async function getMyTeams({ userId }) {+ return await prisma.permission.findMany({+ where: { userId },+ include: { team: { include: { _count: { select: { users: true } } } } }+ });+}diff --git a/src/lib/database/users.ts b/src/lib/database/users.tsnew file mode 100644index 0000000000..663ede1a48--- /dev/null+++ b/src/lib/database/users.ts@@ -0,0 +1,125 @@+import cuid from 'cuid';+import bcrypt from 'bcrypt';++import { prisma, PrismaErrorHandler } from './common';+import { asyncExecShell, removeContainer, uniqueName } from '$lib/common';++import * as db from '$lib/database';+import { startCoolifyProxy } from '$lib/haproxy';++export async function login({ email, password }) {+ const saltRounds = 15;+ const users = await prisma.user.count();+ const userFound = await prisma.user.findUnique({+ where: { email },+ include: { teams: true },+ rejectOnNotFound: false+ });+ // Registration disabled if database is not seeded properly+ const { isRegistrationEnabled, id } = await db.listSettings();++ let uid = cuid();+ // Disable registration if we are registering the first user.+ if (users === 0) {+ await prisma.setting.update({ where: { id }, data: { isRegistrationEnabled: false } });+ // Create default network & start Coolify Proxy+ asyncExecShell(`docker network create --attachable coolify`)+ .then(() => {+ console.log('Network created');+ })+ .catch(() => {+ console.log('Network already exists');+ });++ startCoolifyProxy('/var/run/docker.sock')+ .then(() => {+ console.log('Coolify Proxy Started');+ })+ .catch((err) => {+ console.log(err);+ });+ uid = '0';+ }++ if (userFound) {+ if (userFound.type === 'email') {+ const passwordMatch = await bcrypt.compare(password, userFound.password);+ if (!passwordMatch) {+ throw {+ error: 'Wrong password or email address.'+ };+ }+ uid = userFound.id;+ }+ } else {+ // If registration disabled, return 403+ if (!isRegistrationEnabled) {+ throw {+ error: 'Registration disabled by administrator.'+ };+ }++ const hashedPassword = await bcrypt.hash(password, saltRounds);+ if (users === 0) {+ await prisma.user.create({+ data: {+ id: uid,+ email,+ password: hashedPassword,+ type: 'email',+ teams: {+ create: {+ id: uid,+ name: uniqueName(),+ destinationDocker: { connect: { network: 'coolify' } }+ }+ },+ permission: { create: { teamId: uid, permission: 'owner' } }+ },+ include: { teams: true }+ });+ } else {+ await prisma.user.create({+ data: {+ id: uid,+ email,+ password: hashedPassword,+ type: 'email',+ teams: {+ create: {+ id: uid,+ name: uniqueName()+ }+ },+ permission: { create: { teamId: uid, permission: 'owner' } }+ },+ include: { teams: true }+ });+ }+ }++ // const token = jsonwebtoken.sign({}, secretKey, {+ // expiresIn: 15778800,+ // algorithm: 'HS256',+ // audience: 'coolify',+ // issuer: 'coolify',+ // jwtid: uid,+ // subject: `User:${uid}`,+ // notBefore: -1000+ // });++ return {+ status: 200,+ headers: {+ 'Set-Cookie': `teamId=${uid}; HttpOnly; Path=/; Max-Age=15778800;`+ },+ body: {+ uid,+ teamId: uid+ }+ };+}++export async function getUser({ userId }) {+ return await prisma.user.findUnique({ where: { id: userId } });+}diff --git a/src/lib/dayjs.ts b/src/lib/dayjs.tsnew file mode 100644index 0000000000..49859a8c61--- /dev/null+++ b/src/lib/dayjs.ts@@ -0,0 +1,7 @@+import dayjs from 'dayjs';+import utc from 'dayjs/plugin/utc.js';+import relativeTime from 'dayjs/plugin/relativeTime.js';+dayjs.extend(utc);+dayjs.extend(relativeTime);++export { dayjs };diff --git a/src/lib/docker.ts b/src/lib/docker.tsnew file mode 100644index 0000000000..52f5d1befd--- /dev/null+++ b/src/lib/docker.ts@@ -0,0 +1,160 @@+import Dockerode from 'dockerode';+import { promises as fs } from 'fs';+import { saveBuildLog } from './common';++export async function buildCacheImageWithNode(data, imageForBuild) {+ const {+ applicationId,+ tag,+ workdir,+ docker,+ buildId,+ baseDirectory,+ installCommand,+ buildCommand,+ debug,+ secrets+ } = data;+ const Dockerfile: Array<string> = [];+ Dockerfile.push(`FROM ${imageForBuild}`);+ Dockerfile.push('WORKDIR /usr/src/app');+ if (secrets.length > 0) {+ secrets.forEach((secret) => {+ if (!secret.isBuildSecret) {+ Dockerfile.push(`ARG ${secret.name} ${secret.value}`);+ }+ });+ }+ // TODO: If build command defined, install command should be the default yarn install+ 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(`COPY ./${baseDirectory || ''} ./`);+ Dockerfile.push(`RUN ${buildCommand}`);+ await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));+ await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });+}++export async function buildCacheImageWithCargo(data, imageForBuild) {+ const {+ applicationId,+ tag,+ workdir,+ docker,+ buildId,+ baseDirectory,+ installCommand,+ buildCommand,+ debug,+ secrets+ } = data;+ const Dockerfile: Array<string> = [];+ Dockerfile.push(`FROM ${imageForBuild} as planner-${applicationId}`);+ Dockerfile.push('WORKDIR /usr/src/app');+ Dockerfile.push('RUN cargo install cargo-chef');+ Dockerfile.push('COPY . .');+ Dockerfile.push('RUN cargo chef prepare --recipe-path recipe.json');+ Dockerfile.push(`FROM ${imageForBuild}`);+ Dockerfile.push('WORKDIR /usr/src/app');+ Dockerfile.push('RUN cargo install cargo-chef');+ Dockerfile.push(`COPY --from=planner-${applicationId} /usr/src/app/recipe.json recipe.json`);+ Dockerfile.push('RUN cargo chef cook --release --recipe-path recipe.json');+ await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n'));+ await buildImage({ applicationId, tag, workdir, docker, buildId, isCache: true, debug });+}++export async function buildImage({+ applicationId,+ tag,+ workdir,+ docker,+ buildId,+ isCache = false,+ debug = false+}) {+ if (isCache) {+ saveBuildLog({ line: `Building cache image started.`, buildId, applicationId });+ } else {+ saveBuildLog({ line: `Building image started.`, buildId, applicationId });+ }+ if (!debug && isCache) {+ saveBuildLog({+ line: `Debug turned off. To see more details, allow it in the configuration.`,+ buildId,+ applicationId+ });+ }++ const stream = await docker.engine.buildImage(+ { src: ['.'], context: workdir },+ {+ dockerfile: isCache ? 'Dockerfile-cache' : 'Dockerfile',+ t: `${applicationId}:${tag}${isCache ? '-cache' : ''}`+ }+ );+ await streamEvents({ stream, docker, buildId, applicationId, debug });+}++export function dockerInstance({ destinationDocker }): { engine: Dockerode; network: string } {+ // new Docker({protocol:"ssh", host: '188.34.164.25',port: 22, username:'root', sshOptions: {agentForward: true, agent:process.env.SSH_AUTH_SOCK}})+ return {+ engine: new Dockerode({+ socketPath: destinationDocker.engine+ }),+ network: destinationDocker.network+ };+}+export async function streamEvents({ stream, docker, buildId, applicationId, debug }) {+ await new Promise((resolve, reject) => {+ docker.engine.modem.followProgress(stream, onFinished, onProgress);+ function onFinished(err, res) {+ if (err) reject(err);+ resolve(res);+ }+ function onProgress(event) {+ if (event.error) {+ reject(event.error);+ } else if (event.stream) {+ if (event.stream !== '\n') {+ if (debug)+ saveBuildLog({ line: `${event.stream.replace('\n', '')}`, buildId, applicationId });+ }+ }+ }+ });+}++export const baseServiceConfigurationDocker = {+ restart_policy: {+ condition: 'any',+ max_attempts: 6+ }+};++export const baseServiceConfigurationSwarm = {+ replicas: 1,+ restart_policy: {+ condition: 'any',+ max_attempts: 6+ },+ update_config: {+ parallelism: 1,+ delay: '10s',+ order: 'start-first'+ },+ rollback_config: {+ parallelism: 1,+ delay: '10s',+ order: 'start-first',+ failure_action: 'rollback'+ }+};diff --git a/src/lib/form.ts b/src/lib/form.tsnew file mode 100644index 0000000000..08099576d3--- /dev/null+++ b/src/lib/form.ts@@ -0,0 +1,81 @@+import { toast } from '@zerodevx/svelte-toast';+export function errorNotification(message: string) {+ console.error(message);+ if (typeof message !== 'string') {+ toast.push('Ooops, something is not okay, are you okay?');+ } else {+ toast.push(message);+ }+}+export function enhance(+ form: HTMLFormElement,+ {+ beforeSubmit,+ final,+ pending,+ error,+ result+ }: {+ beforeSubmit?: () => Promise<void>;+ final?: () => Promise<void>;+ pending?: (data: FormData, form: HTMLFormElement) => void;+ error?: (res: Response, error: Error, form: HTMLFormElement) => void;+ result?: (res: Response, form: HTMLFormElement) => void;+ }+): { destroy: () => void } {+ let current_token: unknown;++ async function handle_submit(e: Event) {+ const token = (current_token = {});+ e.preventDefault();++ let body = new FormData(form);+ let parsedData = body;++ body.forEach((data, key) => {+ if (data === '' || data === null) parsedData.delete(key);+ });+ body = parsedData;++ if (beforeSubmit) await beforeSubmit();+ if (pending) pending(body, form);++ try {+ const res = await fetch(form.action, {+ method: form.method,+ headers: {+ accept: 'application/json'+ },+ body+ });++ if (token !== current_token) return;++ if (res.ok) {+ if (result) result(res, form);+ } else if (error) {+ error(res, null, form);+ } else {+ // TODO: Add error frontend here+ const { message } = await res.json();+ errorNotification(message);+ }+ } catch (e) {+ if (error) {+ error(null, e, form);+ } else {+ throw e;+ }+ } finally {+ if (final) final();+ }+ }++ form.addEventListener('submit', handle_submit);++ return {+ destroy() {+ form.removeEventListener('submit', handle_submit);+ }+ };+}diff --git a/src/lib/github.ts b/src/lib/github.tsnew file mode 100644index 0000000000..0fb68ea0a1--- /dev/null+++ b/src/lib/github.ts@@ -0,0 +1,9 @@+export function dashify(str: string, options?: any): string {+ if (typeof str !== 'string') return str;+ return str+ .trim()+ .replace(/\W/g, (m) => (/[À-ž]/.test(m) ? m : '-'))+ .replace(/^-+|-+$/g, '')+ .replace(/-{2,}/g, (m) => (options && options.condense ? '-' : m))+ .toLowerCase();+}diff --git a/src/lib/haproxy/index.ts b/src/lib/haproxy/index.tsnew file mode 100644index 0000000000..9dc1942fa2--- /dev/null+++ b/src/lib/haproxy/index.ts@@ -0,0 +1,634 @@+import { dev } from '$app/env';+import { asyncExecShell, getEngine } from '$lib/common';+import got from 'got';+import * as db from '$lib/database';+import { letsEncrypt } from '$lib/letsencrypt';++const url = dev ? 'http://localhost:5555' : 'http://coolify-haproxy:5555';++export const defaultProxyImage = `coolify-haproxy-alpine:latest`;+export const defaultProxyImageTcp = `coolify-haproxy-tcp-alpine:latest`;+export const defaultProxyImageHttp = `coolify-haproxy-http-alpine:latest`;++export async function haproxyInstance() {+ const { proxyPassword } = await db.listSettings();+ return got.extend({+ prefixUrl: url,+ username: 'admin',+ password: proxyPassword+ });+}+export async function getRawConfiguration(): Promise<RawHaproxyConfiguration> {+ return await (await haproxyInstance()).get(`v2/services/haproxy/configuration/raw`).json();+}++export async function getNextTransactionVersion(): Promise<number> {+ const raw = await getRawConfiguration();+ if (raw?._version) {+ return raw._version;+ }+ return 1;+}++export async function getNextTransactionId(): Promise<string> {+ const version = await getNextTransactionVersion();+ const newTransaction: NewTransaction = await (+ await haproxyInstance()+ )+ .post('v2/services/haproxy/transactions', {+ searchParams: {+ version+ }+ })+ .json();+ return newTransaction.id;+}++export async function completeTransaction(transactionId) {+ const haproxy = await haproxyInstance();+ return await haproxy.put(`v2/services/haproxy/transactions/${transactionId}`);+}++export async function removeProxyConfiguration({ domain }) {+ const haproxy = await haproxyInstance();+ const transactionId = await getNextTransactionId();+ const backendFound = await haproxy+ .get(`v2/services/haproxy/configuration/backends/${domain}`)+ .json();+ if (backendFound) {+ await haproxy+ .delete(`v2/services/haproxy/configuration/backends/${domain}`, {+ searchParams: {+ transaction_id: transactionId+ }+ })+ .json();+ await completeTransaction(transactionId);+ }+}+export async function forceSSLOffApplication({ domain }) {+ if (!dev) {+ const haproxy = await haproxyInstance();+ await checkHAProxy(haproxy);+ const transactionId = await getNextTransactionId();+ try {+ const rules: any = await haproxy+ .get(`v2/services/haproxy/configuration/http_request_rules`, {+ searchParams: {+ parent_name: 'http',+ parent_type: 'frontend'+ }+ })+ .json();+ if (rules.data.length > 0) {+ const rule = rules.data.find((rule) => rule.cond_test.includes(`-i ${domain}`));+ if (rule) {+ await haproxy+ .delete(`v2/services/haproxy/configuration/http_request_rules/${rule.index}`, {+ searchParams: {+ transaction_id: transactionId,+ parent_name: 'http',+ parent_type: 'frontend'+ }+ })+ .json();+ }+ }+ } catch (error) {+ console.log(error);+ } finally {+ await completeTransaction(transactionId);+ }+ } else {+ console.log(`[DEBUG] Removing ssl for ${domain}`);+ }+}+export async function forceSSLOnApplication({ domain }) {+ if (!dev) {+ const haproxy = await haproxyInstance();+ await checkHAProxy(haproxy);+ const transactionId = await getNextTransactionId();++ try {+ const rules: any = await haproxy+ .get(`v2/services/haproxy/configuration/http_request_rules`, {+ searchParams: {+ parent_name: 'http',+ parent_type: 'frontend'+ }+ })+ .json();+ let nextRule = 0;+ if (rules.data.length > 0) {+ const rule = rules.data.find((rule) => rule.cond_test.includes(`-i ${domain}`));+ if (rule) return;+ nextRule = rules.data[rules.data.length - 1].index + 1;+ }+ await haproxy+ .post(`v2/services/haproxy/configuration/http_request_rules`, {+ searchParams: {+ transaction_id: transactionId,+ parent_name: 'http',+ parent_type: 'frontend'+ },+ json: {+ index: nextRule,+ cond: 'if',+ cond_test: `{ hdr(Host) -i ${domain} } !{ ssl_fc }`,+ type: 'redirect',+ redir_type: 'scheme',+ redir_value: 'https',+ redir_code: 301+ }+ })+ .json();+ } catch (error) {+ console.log(error);+ throw error;+ } finally {+ await completeTransaction(transactionId);+ }+ } else {+ console.log(`[DEBUG] Adding ssl for ${domain}`);+ }+}++export async function deleteProxy({ id }) {+ const haproxy = await haproxyInstance();+ try {+ await checkHAProxy(haproxy);+ } catch (error) {+ return;+ }+ const transactionId = await getNextTransactionId();+ try {+ await haproxy.get(`v2/services/haproxy/configuration/backends/${id}`).json();+ await haproxy+ .delete(`v2/services/haproxy/configuration/backends/${id}`, {+ searchParams: {+ transaction_id: transactionId+ }+ })+ .json();+ await haproxy.get(`v2/services/haproxy/configuration/frontends/${id}`).json();+ await haproxy+ .delete(`v2/services/haproxy/configuration/frontends/${id}`, {+ searchParams: {+ transaction_id: transactionId+ }+ })+ .json();+ } catch (error) {+ console.log(error.response.body);+ } finally {+ await completeTransaction(transactionId);+ }+}+// export async function configureProxyForDatabase({ id, port, isPublic, privatePort }) {+// const haproxy = await haproxyInstance()+// try {+// await checkHAProxy()+// } catch (error) {+// return+// }++// let alreadyConfigured = false+// try {+// const backend: any = await haproxy.get(`v2/services/haproxy/configuration/backends/${id}`).json()+// const server: any = await haproxy.get(`v2/services/haproxy/configuration/servers/${id}`, {+// searchParams: {+// backend: id+// },+// }).json()+// if (backend.data.name === id) {+// if (server.data.port === privatePort) {+// if (server.data.check === 'enabled') {+// if (server.data.address === id) {+// alreadyConfigured = true+// }+// }+// }+// }+// } catch (error) {+// console.log('error getting backend or server', error.response.body)+// }+// if (alreadyConfigured) return++// const transactionId = await getNextTransactionId()+// try {+// await haproxy.post('v2/services/haproxy/configuration/backends', {+// searchParams: {+// transaction_id: transactionId+// },+// json: {+// "init-addr": "last,libc,none",+// "mode": "tcp",+// "name": id+// }+// })+// await haproxy.post('v2/services/haproxy/configuration/servers', {+// searchParams: {+// transaction_id: transactionId,+// backend: id+// },+// json: {+// "address": id,+// "check": "enabled",+// "name": id,+// "port": privatePort+// }+// })+// await haproxy.post('v2/services/haproxy/configuration/frontends', {+// searchParams: {+// transaction_id: transactionId,+// backend: id+// },+// json: {+// "default_backend": id,+// "mode": "tcp",+// "name": id+// }+// })+// await haproxy.post('v2/services/haproxy/configuration/binds', {+// searchParams: {+// transaction_id: transactionId,+// frontend: id+// },+// json: {+// "address": "*",+// "name": id,+// "port": port+// }+// })+// } catch (error) {+// console.log(error.response.body)+// throw error.response.body+// } finally {+// try {+// await completeTransaction(transactionId)+// } catch (error) {+// console.log(error.response.body)+// }+// }+// await configureDatabaseVisibility({ id, isPublic })+// }+export async function reloadHaproxy(engine) {+ const host = getEngine(engine);+ return await asyncExecShell(`DOCKER_HOST=${host} docker exec coolify-haproxy kill -HUP 1`);+}+export async function configureProxyForApplication({ domain, imageId, applicationId, port }) {+ const haproxy = await haproxyInstance();+ await checkHAProxy(haproxy);++ let serverConfigured = false;+ let backendAvailable: any = null;++ try {+ backendAvailable = await haproxy+ .get(`v2/services/haproxy/configuration/backends/${domain}`)+ .json();+ const server: any = await haproxy+ .get(`v2/services/haproxy/configuration/servers/${imageId}`, {+ searchParams: {+ backend: domain+ }+ })+ .json();++ if (backendAvailable && server) {+ // Very sophisticated way to check if the server is already configured in proxy+ if (backendAvailable.data.forwardfor.enabled === 'enabled') {+ if (backendAvailable.data.name === domain) {+ if (server.data.check === 'enabled') {+ if (server.data.address === applicationId) {+ if (server.data.port === port) {+ serverConfigured = true;+ }+ }+ }+ }+ }+ }+ } catch (error) {+ //console.log('error getting backend or server', error?.response?.body);+ //+ }++ if (serverConfigured) return;+ const transactionId = await getNextTransactionId();+ if (backendAvailable) {+ await haproxy+ .delete(`v2/services/haproxy/configuration/backends/${domain}`, {+ searchParams: {+ transaction_id: transactionId+ }+ })+ .json();+ }+ try {+ await haproxy.post('v2/services/haproxy/configuration/backends', {+ searchParams: {+ transaction_id: transactionId+ },+ json: {+ 'init-addr': 'last,libc,none',+ forwardfor: { enabled: 'enabled' },+ name: domain+ }+ });++ await haproxy.post('v2/services/haproxy/configuration/servers', {+ searchParams: {+ transaction_id: transactionId,+ backend: domain+ },+ json: {+ address: imageId,+ check: 'enabled',+ name: imageId,+ port: port+ }+ });+ } catch (error) {+ throw error?.response?.body || error;+ } finally {+ await completeTransaction(transactionId);+ }+}++export async function configureCoolifyProxyOff({ domain }) {+ const haproxy = await haproxyInstance();+ await checkHAProxy(haproxy);++ try {+ const transactionId = await getNextTransactionId();+ await haproxy.get(`v2/services/haproxy/configuration/backends/${domain}`).json();+ await haproxy+ .delete(`v2/services/haproxy/configuration/backends/${domain}`, {+ searchParams: {+ transaction_id: transactionId+ }+ })+ .json();+ await completeTransaction(transactionId);+ if (!dev) {+ await forceSSLOffApplication({ domain });+ }+ } catch (error) {+ throw error?.response?.body || error;+ }+}+export async function checkHAProxy(haproxy) {+ if (!haproxy) haproxy = await haproxyInstance();+ try {+ await haproxy.get('v2/info');+ } catch (error) {+ throw 'HAProxy is not running, but it should be!';+ }+}+export async function configureCoolifyProxyOn({ domain }) {+ const haproxy = await haproxyInstance();+ await checkHAProxy(haproxy);+ let serverConfigured = false;+ let backendAvailable: any = null;+ try {+ backendAvailable = await haproxy+ .get(`v2/services/haproxy/configuration/backends/${domain}`)+ .json();+ const server: any = await haproxy+ .get(`v2/services/haproxy/configuration/servers/coolify`, {+ searchParams: {+ backend: domain+ }+ })+ .json();+ if (backendAvailable && server) {+ // Very sophisticated way to check if the server is already configured in proxy+ if (backendAvailable.data.forwardfor.enabled === 'enabled') {+ if (backendAvailable.data.name === domain) {+ if (server.data.check === 'enabled') {+ if (server.data.address === dev ? 'host.docker.internal' : 'coolify') {+ if (server.data.port === 3000) {+ serverConfigured = true;+ }+ }+ }+ }+ }+ }+ } catch (error) {}+ if (serverConfigured) return;+ const transactionId = await getNextTransactionId();+ try {+ await haproxy.post('v2/services/haproxy/configuration/backends', {+ searchParams: {+ transaction_id: transactionId+ },+ json: {+ adv_check: 'httpchk',+ httpchk_params: {+ method: 'GET',+ uri: '/undead.json'+ },+ 'init-addr': 'last,libc,none',+ forwardfor: { enabled: 'enabled' },+ name: domain+ }+ });+ await haproxy.post('v2/services/haproxy/configuration/servers', {+ searchParams: {+ transaction_id: transactionId,+ backend: domain+ },+ json: {+ address: dev ? 'host.docker.internal' : 'coolify',+ check: 'enabled',+ fall: 10,+ name: 'coolify',+ port: 3000+ }+ });+ } catch (error) {+ console.log(error);+ throw error;+ } finally {+ await completeTransaction(transactionId);+ }+}++export async function stopTcpHttpProxy(destinationDocker, publicPort) {+ const { engine } = destinationDocker;+ const host = getEngine(engine);+ const containerName = `haproxy-for-${publicPort}`;+ const found = await checkContainer(engine, containerName);+ try {+ if (found) {+ return await asyncExecShell(+ `DOCKER_HOST=${host} docker stop -t 0 ${containerName} && docker rm ${containerName}`+ );+ }+ } catch (error) {+ return error;+ }+}+export async function startTcpProxy(destinationDocker, id, publicPort, privatePort) {+ const { network, engine } = destinationDocker;+ const host = getEngine(engine);++ const containerName = `haproxy-for-${publicPort}`;+ const found = await checkContainer(engine, containerName);+ const foundDB = await checkContainer(engine, id);++ try {+ if (foundDB && !found) {+ return await asyncExecShell(+ `DOCKER_HOST=${host} docker run --restart always -e PORT=${publicPort} -e APP=${id} -e PRIVATE_PORT=${privatePort} --add-host 'host.docker.internal:host-gateway' --network ${network} -p ${publicPort}:${publicPort} --name ${containerName} -d coollabsio/${defaultProxyImageTcp}`+ );+ }+ } catch (error) {+ return error;+ }+}+export async function startHttpProxy(destinationDocker, id, publicPort, privatePort) {+ const { network, engine } = destinationDocker;+ const host = getEngine(engine);++ const containerName = `haproxy-for-${publicPort}`;+ const found = await checkContainer(engine, containerName);+ const foundDB = await checkContainer(engine, id);++ try {+ if (foundDB && !found) {+ return await asyncExecShell(+ `DOCKER_HOST=${host} docker run --restart always -e PORT=${publicPort} -e APP=${id} -e PRIVATE_PORT=${privatePort} --add-host 'host.docker.internal:host-gateway' --network ${network} -p ${publicPort}:${publicPort} --name ${containerName} -d coollabsio/${defaultProxyImageHttp}`+ );+ }+ } catch (error) {+ return error;+ }+}+export async function startCoolifyProxy(engine) {+ const host = getEngine(engine);+ const found = await checkContainer(engine, 'coolify-haproxy');+ const { proxyPassword, proxyUser } = await db.listSettings();+ if (!found) {+ await asyncExecShell(+ `DOCKER_HOST="${host}" docker run -e HAPROXY_USERNAME=${proxyUser} -e HAPROXY_PASSWORD=${proxyPassword} --restart always --add-host 'host.docker.internal:host-gateway' -v coolify-ssl-certs:/usr/local/etc/haproxy/ssl --network coolify-infra -p "80:80" -p "443:443" -p "8404:8404" -p "5555:5555" -p "5000:5000" --name coolify-haproxy -d coollabsio/${defaultProxyImage}`+ );+ }+ await configureNetworkCoolifyProxy(engine);+}+export async function checkContainer(engine, container) {+ const host = getEngine(engine);+ let containerFound = false;++ try {+ const { stdout } = await asyncExecShell(+ `DOCKER_HOST="${host}" docker inspect --format '{{json .State}}' ${container}`+ );++ const parsedStdout = JSON.parse(stdout);+ const status = parsedStdout.Status;+ const isRunning = parsedStdout.Running;++ if (status === 'exited' || status === 'created') {+ await asyncExecShell(`DOCKER_HOST="${host}" docker rm ${container}`);+ }+ if (isRunning) {+ containerFound = true;+ }+ } catch (err) {+ // Container not found+ }+ return containerFound;+}++export async function stopCoolifyProxy(engine) {+ const host = getEngine(engine);+ const found = await checkContainer(engine, 'coolify-haproxy');+ await db.setDestinationSettings({ engine, isCoolifyProxyUsed: false });+ try {+ if (found) {+ await asyncExecShell(+ `DOCKER_HOST="${host}" docker stop -t 0 coolify-haproxy && docker rm coolify-haproxy`+ );+ }+ } catch (error) {+ return error;+ }+}++export async function configureNetworkCoolifyProxy(engine) {+ const host = getEngine(engine);+ const destinations = await db.prisma.destinationDocker.findMany({ where: { engine } });+ destinations.forEach(async (destination) => {+ try {+ await asyncExecShell(+ `DOCKER_HOST="${host}" docker network connect ${destination.network} coolify-haproxy`+ );+ } catch (err) {+ // TODO: handle error+ }+ });+}++export async function configureSimpleServiceProxyOn({ id, domain, port }) {+ const haproxy = await haproxyInstance();+ try {+ await checkHAProxy(haproxy);+ } catch (error) {+ return;+ }+ try {+ await haproxy.get(`v2/services/haproxy/configuration/backends/${domain}`).json();+ return;+ } catch (error) {}+ try {+ const transactionId = await getNextTransactionId();+ await haproxy.post('v2/services/haproxy/configuration/backends', {+ searchParams: {+ transaction_id: transactionId+ },+ json: {+ 'init-addr': 'last,libc,none',+ forwardfor: { enabled: 'enabled' },+ name: domain+ }+ });+ await haproxy.post('v2/services/haproxy/configuration/servers', {+ searchParams: {+ transaction_id: transactionId,+ backend: domain+ },+ json: {+ address: id,+ check: 'enabled',+ name: id,+ port: port+ }+ });+ await completeTransaction(transactionId);+ } catch (error) {+ console.log(error);+ }+}++export async function configureSimpleServiceProxyOff({ domain }) {+ const haproxy = await haproxyInstance();+ await checkHAProxy(haproxy);++ try {+ await haproxy.get(`v2/services/haproxy/configuration/backends/${domain}`).json();+ const transactionId = await getNextTransactionId();++ await haproxy+ .delete(`v2/services/haproxy/configuration/backends/${domain}`, {+ searchParams: {+ transaction_id: transactionId+ }+ })+ .json();+ await completeTransaction(transactionId);+ } catch (error) {}+ return;+}diff --git a/src/lib/importers/github.ts b/src/lib/importers/github.tsnew file mode 100644index 0000000000..e8c4bb79cd--- /dev/null+++ b/src/lib/importers/github.ts@@ -0,0 +1,50 @@+import { asyncExecShell, saveBuildLog } from '$lib/common';+import got from 'got';+import jsonwebtoken from 'jsonwebtoken';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';++export default async function ({+ applicationId,+ debug,+ workdir,+ githubAppId,+ repository,+ branch,+ buildId+}): Promise<any> {+ try {+ saveBuildLog({ line: 'GitHub importer started', buildId, applicationId });+ const { privateKey, appId, installationId } = await db.getUniqueGithubApp({ githubAppId });+ const githubPrivateKey = privateKey.replace(/\\n/g, '\n').replace(/"/g, '');++ const payload = {+ iat: Math.round(new Date().getTime() / 1000),+ exp: Math.round(new Date().getTime() / 1000 + 60),+ iss: appId+ };+ const jwtToken = jsonwebtoken.sign(payload, githubPrivateKey, {+ algorithm: 'RS256'+ });+ const { token } = await got+ .post(`https://api.github.com/app/installations/${installationId}/access_tokens`, {+ headers: {+ Authorization: `Bearer ${jwtToken}`,+ Accept: 'application/vnd.github.machine-man-preview+json'+ }+ })+ .json();+ saveBuildLog({+ line: `Cloning ${repository}:${branch} branch.`,+ buildId,+ applicationId+ });+ await asyncExecShell(+ `git clone -q -b ${branch} https://x-access-token:${token}@github.com/${repository}.git ${workdir}/ && cd ${workdir} && git submodule update --init --recursive && cd ..`+ );+ const { stdout: commit } = await asyncExecShell(`cd ${workdir}/ && git rev-parse HEAD`);+ return commit.replace('\n', '');+ } catch (error) {+ return PrismaErrorHandler(error);+ }+}diff --git a/src/lib/importers/gitlab.ts b/src/lib/importers/gitlab.tsnew file mode 100644index 0000000000..918bf24027--- /dev/null+++ b/src/lib/importers/gitlab.ts@@ -0,0 +1,29 @@+import { asyncExecShell, saveBuildLog } from '$lib/common';+import { PrismaErrorHandler } from '$lib/database';++export default async function ({+ applicationId,+ debug,+ workdir,+ repodir,+ repository,+ branch,+ buildId,+ privateSshKey+}): Promise<any> {+ saveBuildLog({ line: 'GitLab importer started.', buildId, applicationId });+ await asyncExecShell(`echo '${privateSshKey}' > ${repodir}/id.rsa`);+ await asyncExecShell(`chmod 600 ${repodir}/id.rsa`);++ saveBuildLog({+ line: `Cloning ${repository}:${branch} branch.`,+ buildId,+ applicationId+ });++ await asyncExecShell(+ `git clone -q -b ${branch} [email protected]:${repository}.git --config core.sshCommand="ssh -q -i ${repodir}id.rsa -o StrictHostKeyChecking=no" ${workdir}/ && cd ${workdir}/ && git submodule update --init --recursive && cd ..`+ );+ const { stdout: commit } = await asyncExecShell(`cd ${workdir}/ && git rev-parse HEAD`);+ return commit.replace('\n', '');+}diff --git a/src/lib/importers/index.ts b/src/lib/importers/index.tsnew file mode 100644index 0000000000..1934438901--- /dev/null+++ b/src/lib/importers/index.ts@@ -0,0 +1,4 @@+import github from './github';+import gitlab from './gitlab';++export { github, gitlab };diff --git a/src/lib/letsencrypt.ts b/src/lib/letsencrypt.tsnew file mode 100644index 0000000000..9b92cbdcf9--- /dev/null+++ b/src/lib/letsencrypt.ts@@ -0,0 +1,48 @@+import { dev } from '$app/env';+import { forceSSLOffApplication, forceSSLOnApplication, getNextTransactionId } from '$lib/haproxy';+import { asyncExecShell, getEngine } from './common';+import * as db from '$lib/database';++export async function letsEncrypt({ domain, isCoolify = false, id = null }) {+ try {+ if (dev) {+ return await forceSSLOnApplication({ domain });+ } else {+ if (isCoolify) {+ await asyncExecShell(+ `docker run --rm --name certbot -p 9080:9080 -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 9080 -d ${domain} --agree-tos --non-interactive --register-unsafely-without-email`+ );++ const { stderr } = await asyncExecShell(+ `docker run --rm -v "coolify-letsencrypt:/etc/letsencrypt" -v "coolify-ssl-certs:/app/ssl" alpine:latest cat /etc/letsencrypt/live/${domain}/fullchain.pem /etc/letsencrypt/live/${domain}/privkey.pem > /app/ssl/${domain}.pem`+ );+ if (stderr) throw new Error(stderr);+ return;+ }+ let data: any = await db.prisma.application.findUnique({+ where: { id },+ include: { destinationDocker: true }+ });+ if (!data) {+ data = await db.prisma.service.findUnique({+ where: { id },+ include: { destinationDocker: true }+ });+ }+ // Set SSL with Let's encrypt+ if (data.destinationDockerId && data.destinationDocker) {+ const host = getEngine(data.destinationDocker.engine);+ await asyncExecShell(+ `DOCKER_HOST=${host} docker run --rm --name certbot -p 9080:9080 -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 9080 -d ${domain} --agree-tos --non-interactive --register-unsafely-without-email`+ );+ const { stderr } = await asyncExecShell(+ `DOCKER_HOST=${host} docker run --rm --name bash -v "coolify-letsencrypt:/etc/letsencrypt" -v "coolify-ssl-certs:/app/ssl" alpine:latest cat /etc/letsencrypt/live/${domain}/fullchain.pem /etc/letsencrypt/live/${domain}/privkey.pem > /app/ssl/${domain}.pem`+ );+ if (stderr) throw new Error(stderr);+ await forceSSLOnApplication({ domain });+ }+ }+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/queues/builder.ts b/src/lib/queues/builder.tsnew file mode 100644index 0000000000..6ad7e04938--- /dev/null+++ b/src/lib/queues/builder.ts@@ -0,0 +1,256 @@+import crypto from 'crypto';+import * as buildpacks from '../buildPacks';+import * as importers from '../importers';+import { dockerInstance } from '../docker';+import { asyncExecShell, createDirectories, getDomain, getEngine, saveBuildLog } from '../common';+import { configureProxyForApplication, reloadHaproxy } from '../haproxy';+import * as db from '$lib/database';+import { decrypt } from '$lib/crypto';+import {+ copyBaseConfigurationFiles,+ makeLabelForStandaloneApplication,+ setDefaultConfiguration+} from '$lib/buildPacks/common';+import { letsEncrypt } from '$lib/letsencrypt';++export default async function (job) {+ /*+ Edge cases:+ 1 - Change build pack and redeploy, what should happen?+ */+ let {+ id: applicationId,+ repository,+ branch,+ buildPack,+ name,+ destinationDocker,+ destinationDockerId,+ gitSource,+ build_id: buildId,+ configHash,+ port,+ installCommand,+ buildCommand,+ startCommand,+ fqdn,+ baseDirectory,+ publishDirectory,+ projectId,+ secrets,+ type,+ pullmergeRequestId = null,+ sourceBranch = null,+ settings+ } = job.data;+ const { debug } = settings;++ let imageId = applicationId;+ let domain = getDomain(fqdn);+ const isHttps = fqdn.startsWith('https://');++ // Previews, we need to get the source branch and set subdomain+ if (pullmergeRequestId) {+ branch = sourceBranch;+ domain = `${pullmergeRequestId}.${domain}`;+ imageId = `${applicationId}-${pullmergeRequestId}`;+ }++ let deployNeeded = true;+ let destinationType;++ if (destinationDockerId) {+ destinationType = 'docker';+ }+ // Not implemented yet+ // if (destinationKubernetesId) {+ // destinationType = 'kubernetes'+ // }++ if (destinationType === 'docker') {+ const docker = dockerInstance({ destinationDocker });+ const host = getEngine(destinationDocker.engine);++ const build = await db.createBuild({+ id: 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);++ buildPack = configuration.buildPack;+ port = configuration.port;+ installCommand = configuration.installCommand;+ startCommand = configuration.startCommand;+ buildCommand = configuration.buildCommand;+ publishDirectory = configuration.publishDirectory;++ let commit = await importers[gitSource.type]({+ applicationId,+ debug,+ workdir,+ repodir,+ githubAppId: gitSource.githubApp?.id,+ gitlabAppId: gitSource.gitlabApp?.id,+ repository,+ branch,+ buildId: build.id,+ apiUrl: gitSource.apiUrl,+ projectId,+ deployKeyId: gitSource.gitlabApp?.deployKeyId || null,+ privateSshKey: decrypt(gitSource.gitlabApp?.privateSshKey) || null+ });+ let tag = commit.slice(0, 7);+ if (pullmergeRequestId) {+ tag = `${commit.slice(0, 7)}-${pullmergeRequestId}`;+ }++ try {+ await db.prisma.build.update({ where: { id: build.id }, data: { commit } });+ } catch (err) {+ console.log(err);+ }++ if (!pullmergeRequestId) {+ const currentHash = crypto+ .createHash('sha256')+ .update(+ JSON.stringify({+ buildPack,+ port,+ installCommand,+ buildCommand,+ startCommand,+ secrets,+ branch,+ repository,+ fqdn+ })+ )+ .digest('hex');++ if (configHash !== currentHash) {+ await db.prisma.application.update({+ where: { id: applicationId },+ data: { configHash: currentHash }+ });+ deployNeeded = true;+ if (configHash) {+ saveBuildLog({ line: 'Configuration changed.', buildId, applicationId });+ }+ } else {+ deployNeeded = false;+ }+ } else {+ deployNeeded = true;+ }+ const image = await docker.engine.getImage(`${applicationId}:${tag}`);++ let imageFound = false;+ try {+ await image.inspect();+ imageFound = false;+ } catch (error) {+ //+ }+ if (!imageFound || deployNeeded) {+ await copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId);+ if (buildpacks[buildPack])+ await buildpacks[buildPack]({+ buildId: build.id,+ applicationId,+ domain,+ name,+ type,+ pullmergeRequestId,+ buildPack,+ repository,+ branch,+ projectId,+ publishDirectory,+ debug,+ commit,+ tag,+ workdir,+ docker,+ port,+ installCommand,+ buildCommand,+ startCommand,+ baseDirectory,+ secrets+ });+ else {+ saveBuildLog({ line: `Build pack ${buildPack} not found`, buildId, applicationId });+ throw new Error(`Build pack ${buildPack} not found.`);+ }+ deployNeeded = true;+ } else {+ deployNeeded = false;+ saveBuildLog({ line: 'Nothing changed.', buildId, applicationId });+ }++ // Deploy to Docker Engine+ try {+ await asyncExecShell(`DOCKER_HOST=${host} docker stop -t 0 ${imageId}`);+ await asyncExecShell(`DOCKER_HOST=${host} docker rm ${imageId}`);+ } catch (error) {+ //+ }+ const envs = [];+ if (secrets.length > 0) {+ secrets.forEach((secret) => {+ if (!secret.isBuildSecret) {+ envs.push(`--env ${secret.name}=${secret.value}`);+ }+ });+ }+ const labels = makeLabelForStandaloneApplication({+ applicationId,+ fqdn,+ name,+ type,+ pullmergeRequestId,+ buildPack,+ repository,+ branch,+ projectId,+ port,+ commit,+ installCommand,+ buildCommand,+ startCommand,+ baseDirectory,+ publishDirectory+ });+ saveBuildLog({ line: 'Deployment started.', buildId, applicationId });+ const { stderr } = await asyncExecShell(+ `DOCKER_HOST=${host} docker run ${envs.join()} ${labels.join(+ ' '+ )} --name ${imageId} --network ${docker.network} --restart always -d ${applicationId}:${tag}`+ );+ if (stderr) console.log(stderr);+ saveBuildLog({ line: 'Deployment successful!', buildId, applicationId });++ if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {+ saveBuildLog({ line: 'Proxy configuration started!', buildId, applicationId });+ await configureProxyForApplication({ domain, imageId, applicationId, port });+ if (isHttps) await letsEncrypt({ domain, id: applicationId });+ await reloadHaproxy(destinationDocker.engine);+ saveBuildLog({ line: 'Proxy configuration successful!', buildId, applicationId });+ } else {+ saveBuildLog({+ line: 'Coolify Proxy is not configured for this destination. Nothing else to do.',+ buildId,+ applicationId+ });+ }+ }+}diff --git a/src/lib/queues/cleanup.ts b/src/lib/queues/cleanup.tsnew file mode 100644index 0000000000..47d2668e90--- /dev/null+++ b/src/lib/queues/cleanup.ts@@ -0,0 +1,24 @@+import { dev } from '$app/env';+import { asyncExecShell, getEngine } from '$lib/common';+import { prisma } from '$lib/database';++export default async function () {+ if (!dev) {+ const destinationDockers = await prisma.destinationDocker.findMany();+ for (const destinationDocker of destinationDockers) {+ const host = getEngine(destinationDocker.engine);+ 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);+ }+ }+ }+}diff --git a/src/lib/queues/index.ts b/src/lib/queues/index.tsnew file mode 100644index 0000000000..5ebef3106d--- /dev/null+++ b/src/lib/queues/index.ts@@ -0,0 +1,174 @@+import * as Bullmq from 'bullmq';+import { default as ProdBullmq, Job, QueueEvents, QueueScheduler } from 'bullmq';+import cuid from 'cuid';+import { dev } from '$app/env';+import { prisma } from '$lib/database';++import builder from './builder';+import logger from './logger';+import cleanup from './cleanup';+import proxy from './proxy';+import ssl from './ssl';+import sslrenewal from './sslrenewal';++import { asyncExecShell, saveBuildLog } from '$lib/common';++let { Queue, Worker } = Bullmq;+let redisHost = 'localhost';++if (!dev) {+ Queue = ProdBullmq.Queue;+ Worker = ProdBullmq.Worker;+ redisHost = 'coolify-redis';+}++const connectionOptions = {+ connection: {+ host: redisHost+ }+};++const cron = async () => {+ new QueueScheduler('proxy', connectionOptions);+ new QueueScheduler('cleanup', connectionOptions);+ new QueueScheduler('ssl', connectionOptions);+ new QueueScheduler('sslRenew', connectionOptions);++ const queue = {+ proxy: new Queue('proxy', { ...connectionOptions }),+ cleanup: new Queue('cleanup', { ...connectionOptions }),+ ssl: new Queue('ssl', { ...connectionOptions }),+ sslRenew: new Queue('sslRenew', { ...connectionOptions })+ };+ await queue.proxy.drain();+ await queue.cleanup.drain();+ await queue.ssl.drain();+ await queue.sslRenew.drain();++ new Worker(+ 'proxy',+ async () => {+ await proxy();+ },+ {+ ...connectionOptions+ }+ );++ new Worker(+ 'ssl',+ async () => {+ await ssl();+ },+ {+ ...connectionOptions+ }+ );++ new Worker(+ 'cleanup',+ async () => {+ await cleanup();+ },+ {+ ...connectionOptions+ }+ );++ new Worker(+ 'sslRenew',+ async () => {+ await sslrenewal();+ },+ {+ ...connectionOptions+ }+ );++ await queue.proxy.add('proxy', {}, { repeat: { every: 10000 } });+ // await queue.ssl.add('ssl', {}, { repeat: { every: 10000 } });+ await queue.cleanup.add('cleanup', {}, { repeat: { every: 3600000 } });+ await queue.sslRenew.add('sslRenew', {}, { repeat: { every: 1800000 } });++ const events = {+ proxy: new QueueEvents('proxy', { ...connectionOptions }),+ ssl: new QueueEvents('ssl', { ...connectionOptions })+ };++ events.proxy.on('completed', (data) => {+ // console.log(data)+ });+ events.ssl.on('completed', (data) => {+ // console.log(data)+ });+};+cron().catch((error) => {+ console.log('cron failed to start');+ console.log(error);+});++const buildQueueName = dev ? cuid() : 'build_queue';+const buildQueue = new Queue(buildQueueName, connectionOptions);+const buildWorker = new Worker(buildQueueName, async (job) => await builder(job), {+ concurrency: 2,+ ...connectionOptions+});++buildWorker.on('completed', async (job: Bullmq.Job) => {+ try {+ await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'success' } });+ } catch (err) {+ console.log(err);+ } finally {+ await asyncExecShell(`rm -fr ${job.data.workdir}`);+ }+ return;+});++buildWorker.on('failed', async (job: Bullmq.Job, failedReason) => {+ console.log(failedReason);+ try {+ await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'failed' } });+ } catch (error) {+ console.log(error);+ } finally {+ await asyncExecShell(`rm -fr ${job.data.workdir}`);+ }+ saveBuildLog({ line: 'Failed build!', buildId: job.data.build_id, applicationId: job.data.id });+ saveBuildLog({+ line: `Reason: ${failedReason.toString()}`,+ buildId: job.data.build_id,+ applicationId: job.data.id+ });+});++// const letsEncryptQueueName = dev ? cuid() : 'letsencrypt_queue'+// const letsEncryptQueue = new Queue(letsEncryptQueueName, connectionOptions)++// const letsEncryptWorker = new Worker(letsEncryptQueueName, async (job) => await letsencrypt(job), {+// concurrency: 1,+// ...connectionOptions+// })+// letsEncryptWorker.on('completed', async () => {+// // TODO: Save letsencrypt logs as build logs!+// console.log('[DEBUG] Lets Encrypt job completed')+// })++// letsEncryptWorker.on('failed', async (job: Job, failedReason: string) => {+// try {+// await prisma.applicationSettings.updateMany({ where: { applicationId: job.data.id }, data: { forceSSL: false } })+// } catch (error) {+// console.log(error)+// }+// console.log('[DEBUG] Lets Encrypt job failed')+// console.log(failedReason)+// })++const buildLogQueueName = dev ? cuid() : 'log_queue';+const buildLogQueue = new Queue(buildLogQueueName, connectionOptions);+const buildLogWorker = new Worker(buildLogQueueName, async (job) => await logger(job), {+ concurrency: 1,+ ...connectionOptions+});++export { buildQueue, buildLogQueue };diff --git a/src/lib/queues/logger.ts b/src/lib/queues/logger.tsnew file mode 100644index 0000000000..14665b9ade--- /dev/null+++ b/src/lib/queues/logger.ts@@ -0,0 +1,8 @@+import { prisma } from '$lib/database';+import { dev } from '$app/env';++export default async function (job) {+ const { line, applicationId, buildId } = job.data;+ if (dev) console.debug(`[${applicationId}] ${line}`);+ await prisma.buildLog.create({ data: { line, buildId, time: Number(job.id), applicationId } });+}diff --git a/src/lib/queues/proxy.ts b/src/lib/queues/proxy.tsnew file mode 100644index 0000000000..90dedde800--- /dev/null+++ b/src/lib/queues/proxy.ts@@ -0,0 +1,64 @@+import { getDomain } from '$lib/common';+import { prisma } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import {+ checkContainer,+ configureCoolifyProxyOn,+ configureProxyForApplication,+ forceSSLOnApplication,+ reloadHaproxy,+ startCoolifyProxy+} from '$lib/haproxy';+import * as db from '$lib/database';++export default async function () {+ try {+ // Check destination containers and configure proxy if needed+ const destinationDockers = await prisma.destinationDocker.findMany({});+ for (const destination of destinationDockers) {+ if (destination.isCoolifyProxyUsed) {+ const docker = dockerInstance({ destinationDocker: destination });+ const containers = await docker.engine.listContainers();+ const configurations = containers.filter(+ (container) => container.Labels['coolify.managed']+ );+ for (const configuration of configurations) {+ const parsedConfiguration = JSON.parse(+ Buffer.from(configuration.Labels['coolify.configuration'], 'base64').toString()+ );+ if (configuration.Labels['coolify.type'] === 'standalone-application') {+ const { fqdn, applicationId, port, pullmergeRequestId } = parsedConfiguration;+ if (fqdn) {+ const domain = getDomain(fqdn);+ await configureProxyForApplication({+ domain,+ imageId: pullmergeRequestId+ ? `${applicationId}-${pullmergeRequestId}`+ : applicationId,+ applicationId,+ port+ });+ const isHttps = fqdn.startsWith('https://');+ if (isHttps) await forceSSLOnApplication({ domain });+ }+ }+ }+ }+ }+ // Check Coolify FQDN and configure proxy if needed+ const { fqdn } = await db.listSettings();+ if (fqdn) {+ const domain = getDomain(fqdn);+ const found = await checkContainer('/var/run/docker.sock', 'coolify-haproxy');+ if (!found) await startCoolifyProxy('/var/run/docker.sock');+ await configureCoolifyProxyOn({ domain });+ const isHttps = fqdn.startsWith('https://');+ if (isHttps) await forceSSLOnApplication({ domain });+ }+ } catch (error) {+ console.log(error);+ throw error;+ } finally {+ // await reloadHaproxy('/var/run/docker.sock');+ }+}diff --git a/src/lib/queues/ssl.ts b/src/lib/queues/ssl.tsnew file mode 100644index 0000000000..213788db6a--- /dev/null+++ b/src/lib/queues/ssl.ts@@ -0,0 +1,69 @@+import { asyncExecShell, getDomain, getEngine } from '$lib/common';+import { prisma } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import { forceSSLOnApplication } from '$lib/haproxy';+import * as db from '$lib/database';+import { dev } from '$app/env';++export default async function () {+ try {+ const destinationDockers = await prisma.destinationDocker.findMany({});+ for (const destination of destinationDockers) {+ if (destination.isCoolifyProxyUsed) {+ const docker = dockerInstance({ destinationDocker: destination });+ const containers = await docker.engine.listContainers();+ const configurations = containers.filter(+ (container) => container.Labels['coolify.managed']+ );+ for (const configuration of configurations) {+ const parsedConfiguration = JSON.parse(+ Buffer.from(configuration.Labels['coolify.configuration'], 'base64').toString()+ );+ if (configuration.Labels['coolify.type'] === 'standalone-application') {+ const { fqdn } = parsedConfiguration;+ if (fqdn) {+ const domain = getDomain(fqdn);+ const isHttps = fqdn.startsWith('https://');+ if (isHttps) {+ if (dev) {+ console.log('DEV MODE: SSL is enabled');+ } else {+ const host = getEngine(destination.engine);+ await asyncExecShell(+ `DOCKER_HOST=${host} docker run --rm --name certbot -p 9080:9080 -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 9080 -d ${domain} --agree-tos --non-interactive --register-unsafely-without-email`+ );+ const { stderr } = await asyncExecShell(+ `DOCKER_HOST=${host} docker run --rm --name bash -v "coolify-letsencrypt:/etc/letsencrypt" -v "coolify-ssl-certs:/app/ssl" alpine:latest cat /etc/letsencrypt/live/${domain}/fullchain.pem /etc/letsencrypt/live/${domain}/privkey.pem > /app/ssl/${domain}.pem`+ );+ if (stderr) throw new Error(stderr);+ }+ }+ }+ }+ }+ }+ }+ const { fqdn } = await db.listSettings();+ if (fqdn) {+ const domain = getDomain(fqdn);+ const isHttps = fqdn.startsWith('https://');+ if (isHttps) {+ if (dev) {+ console.log('DEV MODE: SSL is enabled');+ } else {+ await asyncExecShell(+ `docker run --rm --name certbot -p 9080:9080 -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 9080 -d ${domain} --agree-tos --non-interactive --register-unsafely-without-email`+ );++ const { stderr } = await asyncExecShell(+ `docker run --rm -v "coolify-letsencrypt:/etc/letsencrypt" -v "coolify-ssl-certs:/app/ssl" alpine:latest cat /etc/letsencrypt/live/${domain}/fullchain.pem /etc/letsencrypt/live/${domain}/privkey.pem > /app/ssl/${domain}.pem`+ );+ if (stderr) throw new Error(stderr);+ }+ }+ }+ } catch (error) {+ console.log(error);+ throw error;+ }+}diff --git a/src/lib/queues/sslrenewal.ts b/src/lib/queues/sslrenewal.tsnew file mode 100644index 0000000000..e16b4e3a1f--- /dev/null+++ b/src/lib/queues/sslrenewal.ts@@ -0,0 +1,11 @@+import { asyncExecShell } from '$lib/common';++export default async function () {+ try {+ return await asyncExecShell(+ `docker run --rm --name certbot-renewal -v "coolify-letsencrypt:/etc/letsencrypt" certbot/certbot --logs-dir /etc/letsencrypt/logs renew`+ );+ } catch (error) {+ throw error;+ }+}diff --git a/src/lib/request.ts b/src/lib/request.tsdeleted file mode 100644index a271422add..0000000000--- a/src/lib/request.ts+++ /dev/null@@ -1,100 +0,0 @@-import { toast } from '@zerodevx/svelte-toast';-import { browser } from '$app/env';--export async function request(- url,- session,- {- method,- body,- customHeaders- }: {- url?: string;- session?: any;- fetch?: any;- method?: string;- body?: any;- customHeaders?: Record<string, unknown>;- } = {}-) {- let fetch;- if (browser) {- fetch = window.fetch;- } else {- fetch = session.fetch;- }- let headers = { 'content-type': 'application/json; charset=UTF-8' };- if (method === 'DELETE') {- delete headers['content-type'];- }- const isGithub = url.match(/api.github.com/);- if (isGithub) {- headers = Object.assign(headers, {- Authorization: `token ${session.ghToken}`- });- }- const config: any = {- method: method || (body ? 'POST' : 'GET'),- cache: isGithub ? 'no-cache' : 'default',- headers: {- ...headers,- ...customHeaders- }- };- if (body) {- config.body = JSON.stringify(body);- }- const response = await fetch(url, config);- if (response.status >= 200 && response.status <= 299) {- if (response.headers.get('content-type').match(/application\/json/)) {- const json = await response.json();- if (json?.success === false) {- browser && json.showToast !== false && toast.push(json.message);- return Promise.reject({- status: response.status,- error: json.message- });- }- return json;- } else if (response.headers.get('content-type').match(/text\/plain/)) {- return await response.text();- } else if (response.headers.get('content-type').match(/multipart\/form-data/)) {- return await response.formData();- } else {- if (response.headers.get('content-disposition')) {- const blob = await response.blob();- const link = document.createElement('a');- link.href = URL.createObjectURL(blob);- link.download = response.headers.get('content-disposition').split('=')[1] || 'backup.gz';- link.target = '_blank';- link.setAttribute('type', 'hidden');- document.body.appendChild(link);- link.click();- link.remove();- return;- }- return await response.blob();- }- } else {- if (response.status === 401) {- browser && toast.push('Unauthorized');- return Promise.reject({- status: response.status,- error: 'Unauthorized'- });- } else if (response.status >= 500) {- const error = (await response.json()).error;- browser && toast.push(error.message || error);- return Promise.reject({- status: response.status,- error: error.message || error || 'Oops, something is not okay. Are you okay?'- });- } else {- browser && toast.push(response.statusText);- return Promise.reject({- status: response.status,- error: response.statusText- });- }- }-}diff --git a/src/lib/settings.ts b/src/lib/settings.tsnew file mode 100644index 0000000000..d9e7cff2cd--- /dev/null+++ b/src/lib/settings.ts@@ -0,0 +1,7 @@+export const publicPaths = [+ '/login',+ '/webhooks/success',+ '/webhooks/github',+ '/webhooks/github/install',+ '/webhooks/gitlab'+];diff --git a/src/models/ApplicationLog.ts b/src/models/ApplicationLog.tsdeleted file mode 100644index 669fa9fb45..0000000000--- a/src/models/ApplicationLog.ts+++ /dev/null@@ -1,12 +0,0 @@-import mongoose from 'mongoose';-const { Schema } = mongoose;--const ApplicationLogsSchema = new Schema({- deployId: { type: String, required: true },- event: { type: String, required: true }-});--ApplicationLogsSchema.set('timestamps', true);--export default mongoose.models['logs-application'] ||- mongoose.model('logs-application', ApplicationLogsSchema);diff --git a/src/models/Configuration.ts b/src/models/Configuration.tsdeleted file mode 100644index 6e37568fd6..0000000000--- a/src/models/Configuration.ts+++ /dev/null@@ -1,59 +0,0 @@-import mongoose from 'mongoose';-const { Schema } = mongoose;-const ConfigurationSchema = new Schema({- github: {- installation: {- id: { type: Number, required: true }- },- app: {- id: { type: Number, required: true }- }- },- repository: {- id: { type: Number, required: true },- organization: { type: String, required: true },- name: { type: String, required: true },- branch: { type: String, required: true }- },- general: {- deployId: { type: String, required: true },- nickname: { type: String, required: true },- workdir: { type: String, required: true },- isPreviewDeploymentEnabled: { type: Boolean, required: true, default: false },- pullRequest: { type: Number, required: true, default: 0 }- },- build: {- pack: { type: String, required: true },- directory: { type: String },- command: {- build: { type: String },- installation: { type: String },- start: { type: String },- python: {- module: { type: String },- instance: { type: String }- }- },- container: {- name: { type: String, required: true },- tag: { type: String, required: true },- baseSHA: { type: String, required: true }- }- },- publish: {- directory: { type: String },- domain: { type: String, required: true },- path: { type: String },- port: { type: Number },- secrets: [{- name: { type: String },- value: { type: String },- isBuild: { type: Boolean, default: false },- }]- }-});--ConfigurationSchema.set('timestamps', true);--export default mongoose.models['configuration'] ||- mongoose.model('configuration', ConfigurationSchema);diff --git a/src/models/Deployment.ts b/src/models/Deployment.tsdeleted file mode 100644index 94a4735393..0000000000--- a/src/models/Deployment.ts+++ /dev/null@@ -1,17 +0,0 @@-import mongoose from 'mongoose';-const { Schema } = mongoose;--const DeploymentSchema = new Schema({- deployId: { type: String, required: true },- nickname: { type: String, required: true },- repoId: { type: Number, required: true },- organization: { type: String, required: true },- name: { type: String, required: true },- branch: { type: String, required: true },- domain: { type: String, required: true },- progress: { type: String, require: true, default: 'queued' }-});--DeploymentSchema.set('timestamps', true);--export default mongoose.models['deployment'] || mongoose.model('deployment', DeploymentSchema);diff --git a/src/models/ServerLog.ts b/src/models/ServerLog.tsdeleted file mode 100644index 8949c22af8..0000000000--- a/src/models/ServerLog.ts+++ /dev/null@@ -1,23 +0,0 @@-import mongoose from 'mongoose';-import { version } from '../../package.json';-const { Schema, Document } = mongoose;--// export interface ILogsServer extends Document {-// version: string;-// type: string;-// message: string;-// stack: string;-// seen: Boolean;-// }--const LogsServerSchema = new Schema({- version: { type: String, default: version },- type: { type: String, required: true },- message: { type: String, required: true },- stack: { type: String },- seen: { type: Boolean, default: false }-});--LogsServerSchema.set('timestamps', { createdAt: 'createdAt', updatedAt: false });--export default mongoose.models['logs-server'] || mongoose.model('logs-server', LogsServerSchema);diff --git a/src/models/Settings.ts b/src/models/Settings.tsdeleted file mode 100644index fcc1fa8175..0000000000--- a/src/models/Settings.ts+++ /dev/null@@ -1,17 +0,0 @@-import mongoose from 'mongoose';-const { Schema } = mongoose;-export interface ISettings extends Document {- applicationName: string;- allowRegistration: string;- sendErrors: boolean;-}--const SettingsSchema = new Schema({- applicationName: { type: String, required: true, default: 'coolify' },- allowRegistration: { type: Boolean, required: true, default: false },- sendErrors: { type: Boolean, required: true, default: true }-});--SettingsSchema.set('timestamps', true);--export default mongoose.models['settings'] || mongoose.model('settings', SettingsSchema);diff --git a/src/models/User.ts b/src/models/User.tsdeleted file mode 100644index 1da375cf6e..0000000000--- a/src/models/User.ts+++ /dev/null@@ -1,21 +0,0 @@-import mongoose from 'mongoose';-const { Schema } = mongoose;-export interface IUser extends Document {- email: string;- avatar?: string;- uid: string;- type: string;- password: string;-}--const UserSchema = new Schema({- email: { type: String, required: true, unique: true },- avatar: { type: String },- uid: { type: String, required: true },- type: { type: String, required: true, default: 'github' },- password: { type: String }-});--UserSchema.set('timestamps', true);--export default mongoose.models['user'] || mongoose.model('user', UserSchema);diff --git a/src/routes/__error.svelte b/src/routes/__error.svelteindex 62f45fc132..6e9d9f1843 100644--- a/src/routes/__error.svelte+++ b/src/routes/__error.svelte@@ -1,15 +1,29 @@<script context="module">+ /** @type {import('@sveltejs/kit').ErrorLoad} */export function load({ error, status }) {+ console.log(error);return {props: {- error: `${status}: ${error.message}`+ error,+ status}};}</script><script>+ export let status;export let error;</script>-<h1 class="text-xl font-bold">{error}</h1>\ No newline at end of file+<div class="mx-auto flex h-screen flex-col items-center justify-center px-4">+ <div class="pb-10 text-7xl font-bold">{status}</div>+ <div class="text-3xl font-bold">Ooops you are lost! But don't be afraid!</div>+ <div class="text-xl">+ You can find your way back <a href="/" class="font-bold uppercase text-sky-400">here</a>+ </div>+ <div class="py-10 text-xs font-bold">+ <pre+ class="w-full whitespace-pre-wrap break-words text-left text-xs tracking-tighter">{error.message} {error.stack}</pre>+ </div>+</div>diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelteindex 46aa43f5d5..b1aec030ad 100644--- a/src/routes/__layout.svelte+++ b/src/routes/__layout.svelte@@ -1,408 +1,568 @@<script context="module" lang="ts">- import { publicPages } from '$lib/consts';- import { request } from '$lib/request';- /**- * @type {import('@sveltejs/kit').Load}- */- export async function load(session) {- const { path } = session.page;- if (!publicPages.includes(path)) {- if (!session.session.isLoggedIn) {- return {- status: 302,- redirect: '/'- };- }+ import type { Load } from '@sveltejs/kit';+ import { publicPaths } from '$lib/settings';++ export const load: Load = async ({ fetch, url, params, session }) => {+ if (!session.uid && !publicPaths.includes(url.pathname)) {+ return {+ status: 302,+ redirect: '/login'+ };+ }+ if (!session.uid) {return {};}- if (!publicPages.includes(path)) {+ const endpoint = `/teams.json`;+ const res = await fetch(endpoint);++ if (res.ok) {return {- status: 302,- redirect: '/'+ props: {+ selectedTeamId: session.teamId,+ ...(await res.json())+ }};}return {};- }+ };</script>-<script lang="ts">- import 'microtip/microtip.css';- import '../app.postcss';- export let initDashboard;- import { onMount } from 'svelte';- import { SvelteToast } from '@zerodevx/svelte-toast';- import { goto } from '$app/navigation';+<script>+ export let teams;+ export let selectedTeamId;+ import { fade } from 'svelte/transition';++ import '../tailwind.css';+ import { SvelteToast, toast } from '@zerodevx/svelte-toast';import { page, session } from '$app/stores';- import { toast } from '@zerodevx/svelte-toast';- import Tooltip from '$components/Tooltip.svelte';- import compareVersions from 'compare-versions';- import packageJson from '../../package.json';- import { dashboard, settings } from '$store';- import { browser } from '$app/env';- $settings.clientId = import.meta.env.VITE_GITHUB_APP_CLIENTID !== 'null' ? import.meta.env.VITE_GITHUB_APP_CLIENTID : null- $dashboard = initDashboard;- const branch =- process.env.NODE_ENV === 'production' &&- browser &&- window.location.hostname !== 'test.andrasbacsai.dev'- ? 'main'- : 'next';- let latest = {- coolify: {}- };- let upgradeAvailable = false;- let upgradeDisabled = false;- let upgradeDone = false;- let showAck = false;- let globalFeatureFlag = browser && localStorage.getItem('globalFeatureFlag');- const options = {- duration: 2000+ import { onMount } from 'svelte';+ import { errorNotification } from '$lib/form';+ import { asyncSleep } from '$lib/components/common';+ import { del, get, post } from '$lib/api';+ import { dev } from '$app/env';+ import Loading from '$lib/components/Loading.svelte';++ let isUpdateAvailable = false;+ let updateStatus = {+ loading: false,+ checking: false,+ success: null};+onMount(async () => {- upgradeAvailable = await checkUpgrade();- browser && localStorage.removeItem('token');- if (!localStorage.getItem('automaticErrorReportsAck')) {- showAck = true;- if (latest?.coolify[branch]?.settings?.sendErrors) {- const settings = {- sendErrors: true- };- await request('/api/v1/settings', $session, { body: { ...settings } });+ if ($session.uid) {+ try {+ await get(`/login.json`);+ } catch ({ error }) {+ await del(`/logout.json`, {});+ window.location.reload();+ return errorNotification(error);+ }+ if ($session.teamId === '0') {+ updateStatus.checking = true;+ try {+ const data = await get(`/update.json`);+ if (data?.isUpdateAvailable) {+ await post(`/update.json`, { type: 'pull' });+ }+ isUpdateAvailable = data?.isUpdateAvailable;+ } catch (error) {+ } finally {+ updateStatus.checking = false;+ }}}});- async function checkUpgrade() {- latest = await fetch(`https://get.coollabs.io/version.json`, {- cache: 'no-cache'- }).then((r) => r.json());-- return compareVersions(latest.coolify[branch].version, packageJson.version) === 1- ? true- : false;+ async function logout() {+ try {+ await del(`/logout.json`, {});+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ }}- async function upgrade() {+ async function switchTeam() {try {- upgradeDisabled = true;- await request('/api/v1/upgrade', $session);- upgradeDone = true;+ await post(`/index.json?from=${$page.url.pathname}`, {+ cookie: 'teamId',+ value: selectedTeamId+ });+ return window.location.reload();} catch (error) {- browser &&- toast.push(- 'Something happened during update. Ooops. Automatic error reporting will happen soon.'- );+ return window.location.reload();}}- async function logout() {- await request('/api/v1/logout', $session, { body: {}, method: 'DELETE' });- location.reload();- }- function reloadInAMin() {- setTimeout(() => {- location.reload();- }, 30000);- }- function ackError() {- localStorage.setItem('automaticErrorReportsAck', 'true');- showAck = false;++ async function update() {+ updateStatus.loading = true;+ if (!dev) {+ try {+ await post(`/update.json`, { type: 'update' });+ toast.push('Update completed. Waiting for the new version to start...');+ let reachable = false;+ let tries = 0;+ do {+ await asyncSleep(4000);+ try {+ await get(`/undead.json`);+ reachable = true;+ } catch (error) {+ reachable = false;+ }+ if (reachable) break;+ tries++;+ } while (!reachable || tries < 120);+ toast.push('New version reachable. Reloading...');+ updateStatus.loading = false;+ updateStatus.success = true;+ await asyncSleep(3000);+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ updateStatus.success = false;+ updateStatus.loading = false;+ }+ } else {+ let reachable = false;+ let tries = 0;+ do {+ await asyncSleep(1000);+ try {+ await get(`/undead.json`);+ reachable = true;+ } catch (error) {+ console.log(error);+ reachable = false;+ }+ console.log(reachable);+ if (reachable) break;+ tries++;+ } while (!reachable || tries < 120);+ toast.push('New version reachable. Reloading...');+ await asyncSleep(2000);+ window.location.reload();+ }}</script>-<SvelteToast {options} />+<svelte:head>+ <title>Coolify</title>+</svelte:head>+<SvelteToast options={{ intro: { y: -64 }, duration: 3000, pausable: true }} />+{#if $session.uid}+ <nav class="nav-main">+ <div class="flex h-screen w-full flex-col items-center transition-all duration-100">+ <div class="my-4 h-10 w-10"><img src="/favicon.png" alt="coolLabs logo" /></div>+ <div class="flex flex-col space-y-4 py-2">+ <a+ sveltekit:prefetch+ href="/"+ class="icons tooltip-right bg-coolgray-200 hover:text-white"+ class:text-white={$page.url.pathname === '/'}+ class:bg-coolgray-500={$page.url.pathname === '/'}+ data-tooltip="Dashboard"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-8 w-8"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path+ d="M19 8.71l-5.333 -4.148a2.666 2.666 0 0 0 -3.274 0l-5.334 4.148a2.665 2.665 0 0 0 -1.029 2.105v7.2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-7.2c0 -.823 -.38 -1.6 -1.03 -2.105"+ />+ <path d="M16 15c-2.21 1.333 -5.792 1.333 -8 0" />+ </svg>+ </a>+ <div class="border-t border-stone-700" />-{#if showAck && $page.path !== '/success' && $page.path !== '/'}- <div class="p-2 fixed top-0 right-0 z-50 w-64 m-2 rounded border-gradient-full bg-black">- <div class="text-white text-xs space-y-2 text-justify font-medium">- <div>We implemented an automatic error reporting feature, which is enabled by default.</div>- <div>Why? Because we would like to hunt down bugs faster and easier.</div>- <div class="py-5">- If you do not like it, you can turn it off in the <button- class="underline font-bold"- on:click={() => goto('/settings')}>Settings menu</button- >.+ <a+ sveltekit:prefetch+ href="/applications"+ class="icons tooltip-right bg-coolgray-200 hover:text-green-500"+ class:text-green-500={$page.url.pathname.startsWith('/applications') ||+ $page.url.pathname.startsWith('/new/application')}+ class:bg-coolgray-500={$page.url.pathname.startsWith('/applications') ||+ $page.url.pathname.startsWith('/new/application')}+ data-tooltip="Applications"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-8 w-8"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentcolor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <rect x="4" y="4" width="6" height="6" rx="1" />+ <rect x="4" y="14" width="6" height="6" rx="1" />+ <rect x="14" y="14" width="6" height="6" rx="1" />+ <line x1="14" y1="7" x2="20" y2="7" />+ <line x1="17" y1="4" x2="17" y2="10" />+ </svg>+ </a>+ <a+ sveltekit:prefetch+ href="/sources"+ class="icons tooltip-right bg-coolgray-200 hover:text-orange-500"+ class:text-orange-500={$page.url.pathname.startsWith('/sources') ||+ $page.url.pathname.startsWith('/new/source')}+ class:bg-coolgray-500={$page.url.pathname.startsWith('/sources') ||+ $page.url.pathname.startsWith('/new/source')}+ data-tooltip="Git Sources"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-8 w-8"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <circle cx="6" cy="6" r="2" />+ <circle cx="18" cy="18" r="2" />+ <path d="M11 6h5a2 2 0 0 1 2 2v8" />+ <polyline points="14 9 11 6 14 3" />+ <path d="M13 18h-5a2 2 0 0 1 -2 -2v-8" />+ <polyline points="10 15 13 18 10 21" />+ </svg>+ </a>+ <div class="border-t border-stone-700" />+ <a+ sveltekit:prefetch+ href="/destinations"+ class="icons tooltip-right bg-coolgray-200 hover:text-sky-500"+ class:text-sky-500={$page.url.pathname.startsWith('/destinations') ||+ $page.url.pathname.startsWith('/new/destination')}+ class:bg-coolgray-500={$page.url.pathname.startsWith('/destinations') ||+ $page.url.pathname.startsWith('/new/destination')}+ data-tooltip="Destinations"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-8 w-8"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path+ d="M22 12.54c-1.804 -.345 -2.701 -1.08 -3.523 -2.94c-.487 .696 -1.102 1.568 -.92 2.4c.028 .238 -.32 1.002 -.557 1h-14c0 5.208 3.164 7 6.196 7c4.124 .022 7.828 -1.376 9.854 -5c1.146 -.101 2.296 -1.505 2.95 -2.46z"+ />+ <path d="M5 10h3v3h-3z" />+ <path d="M8 10h3v3h-3z" />+ <path d="M11 10h3v3h-3z" />+ <path d="M8 7h3v3h-3z" />+ <path d="M11 7h3v3h-3z" />+ <path d="M11 4h3v3h-3z" />+ <path d="M4.571 18c1.5 0 2.047 -.074 2.958 -.78" />+ <line x1="10" y1="16" x2="10" y2="16.01" />+ </svg>+ </a>+ <div class="border-t border-stone-700" />+ <a+ sveltekit:prefetch+ href="/databases"+ class="icons tooltip-right bg-coolgray-200 hover:text-purple-500"+ class:text-purple-500={$page.url.pathname.startsWith('/databases') ||+ $page.url.pathname.startsWith('/new/database')}+ class:bg-coolgray-500={$page.url.pathname.startsWith('/databases') ||+ $page.url.pathname.startsWith('/new/database')}+ data-tooltip="Databases"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-8 w-8"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <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>+ </a>+ <div class="border-t border-stone-700" />+ <a+ sveltekit:prefetch+ href="/services"+ class="icons tooltip-right bg-coolgray-200 hover:text-pink-500"+ class:text-pink-500={$page.url.pathname.startsWith('/services') ||+ $page.url.pathname.startsWith('/new/service')}+ class:bg-coolgray-500={$page.url.pathname.startsWith('/services') ||+ $page.url.pathname.startsWith('/new/service')}+ data-tooltip="Services"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-8 w-8"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-12" />+ </svg>+ </a>+ <div class="border-t border-stone-700" /></div>- <button- class="button p-2 bg-warmGray-800 w-full text-center hover:bg-warmGray-700"- on:click={ackError}>OK</button- >- </div>- </div>-{/if}-<main class:main={$page.path !== '/success' && $page.path !== '/'}>- {#if $page.path !== '/' && $page.path !== '/success'}- <nav class="w-16 bg-warmGray-800 text-white top-0 left-0 fixed min-w-4rem min-h-screen">- <div- class="flex flex-col w-full h-screen items-center transition-all duration-100"- class:border-green-500={$page.path === '/dashboard/applications'}- class:border-purple-500={$page.path === '/dashboard/databases'}- >- <div class="w-10 pt-4 pb-4"><img src="/favicon.png" alt="coolLabs logo" /></div>- {#if $settings.clientId}- <Tooltip position="right" label="Applications">- <div- class="p-2 hover:bg-warmGray-700 rounded hover:text-green-500 mt-4 transition-all duration-100 cursor-pointer"- on:click={() => goto('/dashboard/applications')}- class:text-green-500={$page.path === '/dashboard/applications' ||- $page.path.startsWith('/application')}- class:bg-warmGray-700={$page.path === '/dashboard/applications' ||- $page.path.startsWith('/application')}- >- <svg- class="w-8"+ <div class="flex-1" />++ <div class="flex flex-col space-y-4 py-2">+ {#if $session.teamId === '0'}+ {#if updateStatus.checking}+ <button+ disabled+ in:fade={{ duration: 150 }}+ class="icons tooltip-right bg-gradient-to-r from-purple-500 via-pink-500 to-red-500 text-white duration-75 hover:scale-105"+ data-tooltip="Checking for updates..."+ ><svgxmlns="http://www.w3.org/2000/svg"+ class="h-9 w-8 animate-spin"viewBox="0 0 24 24"- fill="none"+ stroke-width="1.5"stroke="currentColor"- stroke-width="2"+ fill="none"stroke-linecap="round"stroke-linejoin="round"- ><rect x="4" y="4" width="16" height="16" rx="2" ry="2" /><rect- x="9"- y="9"- width="6"- height="6"- /><line x1="9" y1="1" x2="9" y2="4" /><line x1="15" y1="1" x2="15" y2="4" /><line- x1="9"- y1="20"- x2="9"- y2="23"- /><line x1="15" y1="20" x2="15" y2="23" /><line- x1="20"- y1="9"- x2="23"- y2="9"- /><line x1="20" y1="14" x2="23" y2="14" /><line x1="1" y1="9" x2="4" y2="9" /><line- x1="1"- y1="14"- x2="4"- y2="14"- /></svg>- </div>- </Tooltip>- <Tooltip position="right" label="Databases">- <div- class="p-2 hover:bg-warmGray-700 rounded hover:text-purple-500 my-4 transition-all duration-100 cursor-pointer"- on:click={() => goto('/dashboard/databases')}- class:text-purple-500={$page.path === '/dashboard/databases' ||- $page.path.startsWith('/database')}- class:bg-warmGray-700={$page.path === '/dashboard/databases' ||- $page.path.startsWith('/database')}+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M9 4.55a8 8 0 0 1 6 14.9m0 -4.45v5h5" />+ <line x1="5.63" y1="7.16" x2="5.63" y2="7.17" />+ <line x1="4.06" y1="11" x2="4.06" y2="11.01" />+ <line x1="4.63" y1="15.1" x2="4.63" y2="15.11" />+ <line x1="7.16" y1="18.37" x2="7.16" y2="18.38" />+ <line x1="11" y1="19.94" x2="11" y2="19.95" />+ </svg></button>- <svg- class="w-8"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path+ {:else if isUpdateAvailable}+ <button+ disabled={updateStatus.success === false}+ data-tooltip="Update available"+ on:click={update}+ class="icons tooltip-right bg-gradient-to-r from-purple-500 via-pink-500 to-red-500 text-white duration-75 hover:scale-105"+ >+ {#if updateStatus.loading}+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="w-8 h-9 lds-heart"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"stroke-linecap="round"stroke-linejoin="round"- stroke-width="2"- d="M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"- />- </svg>- </div>- </Tooltip>- {:else}- <Tooltip- position="right"- label="Applications disabled, no GitHub Integration detected"- size="large"- >- <div class="p-2 text-warmGray-700 mt-4 transition-all duration-100 cursor-pointer">- <svg- class="w-8"- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- ><rect x="4" y="4" width="16" height="16" rx="2" ry="2" /><rect- x="9"- y="9"- width="6"- height="6"- /><line x1="9" y1="1" x2="9" y2="4" /><line x1="15" y1="1" x2="15" y2="4" /><line- x1="9"- y1="20"- x2="9"- y2="23"- /><line x1="15" y1="20" x2="15" y2="23" /><line- x1="20"- y1="9"- x2="23"- y2="9"- /><line x1="20" y1="14" x2="23" y2="14" /><line x1="1" y1="9" x2="4" y2="9" /><line- x1="1"- y1="14"- x2="4"- y2="14"- /></svg- >- </div>- </Tooltip>- <Tooltip position="right" label="Databases disabled, no GitHub Integration detected" size="large">- <div- class="p-2 text-warmGray-700 my-4 transition-all duration-100 cursor-pointer"- >- <svg- class="w-8"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path+ d="M19.5 13.572l-7.5 7.428l-7.5 -7.428m0 0a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572"+ />+ </svg>+ {:else if updateStatus.success === null}+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="w-8 h-9"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"stroke-linecap="round"stroke-linejoin="round"- stroke-width="2"- d="M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"- />- </svg>- </div>- </Tooltip>+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <circle cx="12" cy="12" r="9" />+ <line x1="12" y1="8" x2="8" y2="12" />+ <line x1="12" y1="8" x2="12" y2="16" />+ <line x1="16" y1="12" x2="12" y2="8" />+ </svg>+ {:else if updateStatus.success}+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" class="w-8 h-9"+ ><path+ fill="#DD2E44"+ d="M11.626 7.488c-.112.112-.197.247-.268.395l-.008-.008L.134 33.141l.011.011c-.208.403.14 1.223.853 1.937.713.713 1.533 1.061 1.936.853l.01.01L28.21 24.735l-.008-.009c.147-.07.282-.155.395-.269 1.562-1.562-.971-6.627-5.656-11.313-4.687-4.686-9.752-7.218-11.315-5.656z"+ /><path+ fill="#EA596E"+ d="M13 12L.416 32.506l-.282.635.011.011c-.208.403.14 1.223.853 1.937.232.232.473.408.709.557L17 17l-4-5z"+ /><path+ fill="#A0041E"+ d="M23.012 13.066c4.67 4.672 7.263 9.652 5.789 11.124-1.473 1.474-6.453-1.118-11.126-5.788-4.671-4.672-7.263-9.654-5.79-11.127 1.474-1.473 6.454 1.119 11.127 5.791z"+ /><path+ fill="#AA8DD8"+ d="M18.59 13.609c-.199.161-.459.245-.734.215-.868-.094-1.598-.396-2.109-.873-.541-.505-.808-1.183-.735-1.862.128-1.192 1.324-2.286 3.363-2.066.793.085 1.147-.17 1.159-.292.014-.121-.277-.446-1.07-.532-.868-.094-1.598-.396-2.11-.873-.541-.505-.809-1.183-.735-1.862.13-1.192 1.325-2.286 3.362-2.065.578.062.883-.057 1.012-.134.103-.063.144-.123.148-.158.012-.121-.275-.446-1.07-.532-.549-.06-.947-.552-.886-1.102.059-.549.55-.946 1.101-.886 2.037.219 2.973 1.542 2.844 2.735-.13 1.194-1.325 2.286-3.364 2.067-.578-.063-.88.057-1.01.134-.103.062-.145.123-.149.157-.013.122.276.446 1.071.532 2.037.22 2.973 1.542 2.844 2.735-.129 1.192-1.324 2.286-3.362 2.065-.578-.062-.882.058-1.012.134-.104.064-.144.124-.148.158-.013.121.276.446 1.07.532.548.06.947.553.886 1.102-.028.274-.167.511-.366.671z"+ /><path+ fill="#77B255"+ d="M30.661 22.857c1.973-.557 3.334.323 3.658 1.478.324 1.154-.378 2.615-2.35 3.17-.77.216-1.001.584-.97.701.034.118.425.312 1.193.095 1.972-.555 3.333.325 3.657 1.479.326 1.155-.378 2.614-2.351 3.17-.769.216-1.001.585-.967.702.033.117.423.311 1.192.095.53-.149 1.084.16 1.233.691.148.532-.161 1.084-.693 1.234-1.971.555-3.333-.323-3.659-1.479-.324-1.154.379-2.613 2.353-3.169.77-.217 1.001-.584.967-.702-.032-.117-.422-.312-1.19-.096-1.974.556-3.334-.322-3.659-1.479-.325-1.154.378-2.613 2.351-3.17.768-.215.999-.585.967-.701-.034-.118-.423-.312-1.192-.096-.532.15-1.083-.16-1.233-.691-.149-.53.161-1.082.693-1.232z"+ /><path+ fill="#AA8DD8"+ d="M23.001 20.16c-.294 0-.584-.129-.782-.375-.345-.432-.274-1.061.156-1.406.218-.175 5.418-4.259 12.767-3.208.547.078.927.584.849 1.131-.078.546-.58.93-1.132.848-6.493-.922-11.187 2.754-11.233 2.791-.186.148-.406.219-.625.219z"+ /><path+ fill="#77B255"+ d="M5.754 16c-.095 0-.192-.014-.288-.042-.529-.159-.829-.716-.67-1.245 1.133-3.773 2.16-9.794.898-11.364-.141-.178-.354-.353-.842-.316-.938.072-.849 2.051-.848 2.071.042.551-.372 1.031-.922 1.072-.559.034-1.031-.372-1.072-.923-.103-1.379.326-4.035 2.692-4.214 1.056-.08 1.933.287 2.552 1.057 2.371 2.951-.036 11.506-.542 13.192-.13.433-.528.712-.958.712z"+ /><circle fill="#5C913B" cx="25.5" cy="9.5" r="1.5" /><circle+ fill="#9266CC"+ cx="2"+ cy="18"+ r="2"+ /><circle fill="#5C913B" cx="32.5" cy="19.5" r="1.5" /><circle+ fill="#5C913B"+ cx="23.5"+ cy="31.5"+ r="1.5"+ /><circle fill="#FFCC4D" cx="28" cy="4" r="2" /><circle+ fill="#FFCC4D"+ cx="32.5"+ cy="8.5"+ r="1.5"+ /><circle fill="#FFCC4D" cx="29.5" cy="12.5" r="1.5" /><circle+ fill="#FFCC4D"+ cx="7.5"+ cy="23.5"+ r="1.5"+ /></svg+ >+ {:else}+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" class="w-8 h-9"+ ><path+ fill="#FFCC4D"+ d="M36 18c0 9.941-8.059 18-18 18S0 27.941 0 18 8.059 0 18 0s18 8.059 18 18"+ /><path+ fill="#664500"+ d="M22 27c0 2.763-1.791 3-4 3-2.21 0-4-.237-4-3 0-2.761 1.79-6 4-6 2.209 0 4 3.239 4 6zm8-12c-.124 0-.25-.023-.371-.072-5.229-2.091-7.372-5.241-7.461-5.374-.307-.46-.183-1.081.277-1.387.459-.306 1.077-.184 1.385.274.019.027 1.93 2.785 6.541 4.629.513.206.763.787.558 1.3-.157.392-.533.63-.929.63zM6 15c-.397 0-.772-.238-.929-.629-.205-.513.044-1.095.557-1.3 4.612-1.844 6.523-4.602 6.542-4.629.308-.456.929-.577 1.387-.27.457.308.581.925.275 1.383-.089.133-2.232 3.283-7.46 5.374C6.25 14.977 6.124 15 6 15z"+ /><path fill="#5DADEC" d="M24 16h4v19l-4-.046V16zM8 35l4-.046V16H8v19z" /><path+ fill="#664500"+ d="M14.999 18c-.15 0-.303-.034-.446-.105-3.512-1.756-7.07-.018-7.105 0-.495.249-1.095.046-1.342-.447-.247-.494-.047-1.095.447-1.342.182-.09 4.498-2.197 8.895 0 .494.247.694.848.447 1.342-.176.35-.529.552-.896.552zm14 0c-.15 0-.303-.034-.446-.105-3.513-1.756-7.07-.018-7.105 0-.494.248-1.094.047-1.342-.447-.247-.494-.047-1.095.447-1.342.182-.09 4.501-2.196 8.895 0 .494.247.694.848.447 1.342-.176.35-.529.552-.896.552z"+ /><ellipse fill="#5DADEC" cx="18" cy="34" rx="18" ry="2" /><ellipse+ fill="#E75A70"+ cx="18"+ cy="27"+ rx="3"+ ry="2"+ /></svg+ >+ {/if}+ </button>+ {/if}{/if}- <Tooltip position="right" label="Services">- <div- class="p-2 hover:bg-warmGray-700 rounded hover:text-blue-500 transition-all duration-100 cursor-pointer"- class:text-blue-500={$page.path === '/dashboard/services' ||- $page.path.startsWith('/service')}- class:bg-warmGray-700={$page.path === '/dashboard/services' ||- $page.path.startsWith('/service')}- on:click={() => goto('/dashboard/services')}+ <a+ sveltekit:prefetch+ href="/teams"+ class="icons tooltip-right bg-coolgray-200 hover:text-cyan-500"+ class:text-cyan-500={$page.url.pathname.startsWith('/teams')}+ class:bg-coolgray-500={$page.url.pathname.startsWith('/teams')}+ data-tooltip="Teams"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-8 w-8"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round">- <svg- xmlns="http://www.w3.org/2000/svg"- class="w-8"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"- />- </svg>- </div>- </Tooltip>- <div class="flex-1" />- {#if globalFeatureFlag}- <Tooltip position="right" label="Servers">- <div- class="p-2 hover:bg-warmGray-700 rounded hover:text-red-500 mb-4 transition-all duration-100 cursor-pointer"- on:click={() => goto('/servers')}- class:text-red-500={$page.path === '/servers' || $page.path.startsWith('/servers')}- class:bg-warmGray-700={$page.path === '/servers' || $page.path.startsWith('/servers')}- >- <svg- class="w-8"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"- />- </svg>- </div>- </Tooltip>- {/if}- <Tooltip position="right" label="Settings">- <button- class="p-2 hover:bg-warmGray-700 rounded hover:text-yellow-500 transition-all duration-100 cursor-pointer"- class:text-yellow-500={$page.path === '/settings'}- class:bg-warmGray-700={$page.path === '/settings'}- on:click={() => goto('/settings')}+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <circle cx="9" cy="7" r="4" />+ <path d="M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2" />+ <path d="M16 3.13a4 4 0 0 1 0 7.75" />+ <path d="M21 21v-2a4 4 0 0 0 -3 -3.85" />+ </svg>+ </a>+ {#if $session.teamId === '0'}+ <a+ sveltekit:prefetch+ href="/settings"+ class="icons tooltip-right bg-coolgray-200 hover:text-yellow-500"+ class:text-yellow-500={$page.url.pathname.startsWith('/settings')}+ class:bg-coolgray-500={$page.url.pathname.startsWith('/settings')}+ data-tooltip="Settings"><svg- class="w-8"xmlns="http://www.w3.org/2000/svg"- fill="none"+ class="h-8 w-8"viewBox="0 0 24 24"+ stroke-width="1.5"stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round">+ <path stroke="none" d="M0 0h24v24H0z" fill="none" /><path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"- />- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"+ d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z"/>+ <circle cx="12" cy="12" r="3" /></svg>- </button>- </Tooltip>- <Tooltip position="right" label="Logout">- <button- class="p-2 hover:bg-warmGray-700 rounded hover:text-red-500 my-4 transition-all duration-100 cursor-pointer"- on:click={logout}+ </a>+ {/if}+ <div+ class="icons tooltip-right bg-coolgray-200 hover:text-red-500"+ data-tooltip="Logout"+ on:click={logout}+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="ml-1 h-7 w-7"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round">- <svg- class="w-7"- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- ><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" /><polyline- points="16 17 21 12 16 7"- /><line x1="21" y1="12" x2="9" y2="12" /></svg- >- </button>- </Tooltip>+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path+ d="M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"+ />+ <path d="M7 12h14l-3 -3m0 6l3 -3" />+ </svg>+ </div>+ </div>+ <div+ class="w-full text-center font-bold text-stone-400 hover:bg-coolgray-200 hover:text-white"+ ><a- href={`https://github.com/coollabsio/coolify/releases/tag/v${packageJson.version}`}- target="_blank"- class="cursor-pointer text-xs font-bold text-warmGray-400 py-2 hover:bg-warmGray-700 w-full text-center"+ class="text-[10px] no-underline"+ href={`https://github.com/coollabsio/coolify/releases/tag/v${$session.version}`}+ target="_blank">v{$session.version}</a>- {packageJson.version}- </a></div>- </nav>- {/if}- <slot />-</main>-{#if upgradeAvailable && $page.path !== '/success' && $page.path !== '/'}- <footer- class="fixed bottom-0 right-0 p-4 px-6 w-auto rounded-tl text-white hover:scale-110 transition duration-100"- >- <div class="flex items-center">- <div />- <div class="flex-1" />- {#if !upgradeDisabled}- <button- class="bg-gradient-to-r from-purple-500 via-pink-500 to-red-500 text-xs font-bold rounded px-2 py-2"- disabled={upgradeDisabled}- on:click={upgrade}>New version available, <br />click here to upgrade!</button- >- {:else if upgradeDone}- <button- use:reloadInAMin- class="font-bold text-xs rounded px-2 cursor-not-allowed"- disabled={upgradeDisabled}>Upgrade done. 🎉 Automatically reloading in 30s.</button- >- {:else}- <button- class="opacity-50 tracking-tight font-bold text-xs rounded px-2 cursor-not-allowed"- disabled={upgradeDisabled}>Upgrading. It could take a while, please wait...</button- >- {/if}</div>- </footer>+ </nav>+ <select+ class="fixed right-0 bottom-0 z-50 m-2 p-2 px-4"+ bind:value={selectedTeamId}+ on:change={switchTeam}+ >+ <option value="" disabled selected>Switch to a different team...</option>+ {#each teams as team}+ <option value={team.teamId}>{team.team.name} - {team.permission}</option>+ {/each}+ </select>{/if}+<main>+ <slot />+</main>diff --git a/src/routes/api/v1/application/check/index.ts b/src/routes/api/v1/application/check/index.tsdeleted file mode 100644index a901537008..0000000000--- a/src/routes/api/v1/application/check/index.ts+++ /dev/null@@ -1,36 +0,0 @@-import { setDefaultConfiguration } from '$lib/api/applications/configuration';-import { saveServerLog } from '$lib/api/applications/logging';-import Configuration from '$models/Configuration';-import type { Request } from '@sveltejs/kit';--export async function post(request: Request) {- try {- const { DOMAIN } = process.env;- const configuration = setDefaultConfiguration(request.body);- const sameDomainAndPath = await Configuration.find({- 'publish.path': configuration.publish.path,- 'publish.domain': configuration.publish.domain- }).select('-_id -__v -createdAt -updatedAt');- if (sameDomainAndPath.length > 1 || configuration.publish.domain === DOMAIN) {- return {- status: 200,- body: {- success: false,- message: 'Domain/path are already in use.'- }- };- }- return {- status: 200,- body: { success: true, message: 'OK' }- };- } catch (error) {- await saveServerLog(error);- return {- status: 500,- body: {- error: error.message || error- }- };- }-}diff --git a/src/routes/api/v1/application/config/index.ts b/src/routes/api/v1/application/config/index.tsdeleted file mode 100644index fe413395cf..0000000000--- a/src/routes/api/v1/application/config/index.ts+++ /dev/null@@ -1,49 +0,0 @@-import { docker } from '$lib/api/docker';-import Configuration from '$models/Configuration';-import type { Request } from '@sveltejs/kit';--export async function post(request: Request) {- const { nickname }: any = request.body || {};- if (nickname) {- const configurationFound = await Configuration.find({- 'general.nickname': nickname- }).select('-_id -__v -createdAt -updatedAt');- if (configurationFound) {- return {- status: 200,- body: {- configuration: [...configurationFound]- }- };- }-- const services = await docker.engine.listServices();- const applications = services.filter(- (r) => r.Spec.Labels.managedBy === 'coolify' && r.Spec.Labels.type === 'application'- );- const found = applications.find((r) => {- const configuration = r.Spec.Labels.configuration- ? JSON.parse(r.Spec.Labels.configuration)- : null;-- if (configuration.general.nickname === nickname) return r;- return null;- });-- if (found) {- return {- status: 200,- body: {- success: true,- ...JSON.parse(found.Spec.Labels.configuration)- }- };- }- return {- status: 500,- body: {- error: 'No configuration found.'- }- };- }-}diff --git a/src/routes/api/v1/application/config/previewDeployment.ts b/src/routes/api/v1/application/config/previewDeployment.tsdeleted file mode 100644index 095e31e027..0000000000--- a/src/routes/api/v1/application/config/previewDeployment.ts+++ /dev/null@@ -1,75 +0,0 @@-import { updateServiceLabels } from '$lib/api/applications/configuration';-import { execShellAsync } from '$lib/api/common';-import { docker } from '$lib/api/docker';-import ApplicationLog from '$models/ApplicationLog';-import Configuration from '$models/Configuration';-import Deployment from '$models/Deployment';-import type { Request } from '@sveltejs/kit';--export async function post(request: Request) {- const { name, organization, branch, isPreviewDeploymentEnabled }: any = request.body || {};- if (name && organization && branch) {- const configuration = await Configuration.findOneAndUpdate(- {- 'repository.name': name,- 'repository.organization': organization,- 'repository.branch': branch- },- {- $set: {- 'general.isPreviewDeploymentEnabled': isPreviewDeploymentEnabled,- 'general.pullRequest': 0- }- },- { new: true }- ).select('-_id -__v -createdAt -updatedAt');- if (!isPreviewDeploymentEnabled) {- const found = await Configuration.find({- 'repository.name': name,- 'repository.organization': organization,- 'repository.branch': branch,- 'general.pullRequest': { $ne: 0 }- });- for (const prDeployment of found) {- await Configuration.findOneAndRemove({- 'repository.name': name,- 'repository.organization': organization,- 'repository.branch': branch,- 'publish.domain': prDeployment.publish.domain- });- const deploys = await Deployment.find({- organization,- branch,- name,- domain: prDeployment.publish.domain- });- for (const deploy of deploys) {- await ApplicationLog.deleteMany({ deployId: deploy.deployId });- await Deployment.deleteMany({ deployId: deploy.deployId });- }- await execShellAsync(`docker stack rm ${prDeployment.build.container.name}`);- }- return {- status: 200,- body: {- organization,- name,- branch- }- };- }- updateServiceLabels(configuration);- return {- status: 200,- body: {- success: true- }- };- }- return {- status: 500,- body: {- error: 'Cannot save.'- }- };-}diff --git a/src/routes/api/v1/application/deploy/index.ts b/src/routes/api/v1/application/deploy/index.tsdeleted file mode 100644index bb9b1a5d7e..0000000000--- a/src/routes/api/v1/application/deploy/index.ts+++ /dev/null@@ -1,56 +0,0 @@-import type { Request } from '@sveltejs/kit';-import Deployment from '$models/Deployment';-import { precheckDeployment, setDefaultConfiguration } from '$lib/api/applications/configuration';-import cloneRepository from '$lib/api/applications/cloneRepository';-import { cleanupTmp } from '$lib/api/common';-import queueAndBuild from '$lib/api/applications/queueAndBuild';-import Configuration from '$models/Configuration';-import preChecks from '$lib/api/applications/preChecks';-import preTasks from '$lib/api/applications/preTasks';--export async function post(request: Request) {- const configuration = setDefaultConfiguration(request.body);- if (!configuration) {- return {- status: 500,- body: {- error: 'Whaaat?'- }- };- }- try {- await cloneRepository(configuration);- const nextStep = await preChecks(configuration);- if (nextStep === 0) {- cleanupTmp(configuration.general.workdir);- return {- status: 200,- body: {- success: false,- message: 'Nothing changed, no need to redeploy.'- }- };- }- await preTasks(configuration)-- queueAndBuild(configuration, nextStep);- return {- status: 201,- body: {- message: 'Deployment queued.',- nickname: configuration.general.nickname,- name: configuration.build.container.name,- deployId: configuration.general.deployId- }- };- } catch (error) {- console.log(error);- await Deployment.findOneAndUpdate({ nickname: configuration.general.nickname }, { $set: { progress: 'failed' } });- return {- status: 500,- body: {- error: error.message || error- }- };- }-}diff --git a/src/routes/api/v1/application/deploy/logs/[deployId].ts b/src/routes/api/v1/application/deploy/logs/[deployId].tsdeleted file mode 100644index 0c449b2242..0000000000--- a/src/routes/api/v1/application/deploy/logs/[deployId].ts+++ /dev/null@@ -1,32 +0,0 @@-import type { Request } from '@sveltejs/kit';-import ApplicationLog from '$models/ApplicationLog';-import Deployment from '$models/Deployment';-import dayjs from 'dayjs';--export async function get(request: Request) {- const { deployId } = request.params;- try {- const logs: any = await ApplicationLog.find({ deployId })- .select('-_id -__v')- .sort({ createdAt: 'asc' });-- const deploy: any = await Deployment.findOne({ deployId }).select('-_id -__v');- const finalLogs: any = {};- finalLogs.progress = deploy.progress;- finalLogs.events = logs.map((log) => log.event);- finalLogs.human = dayjs(deploy.updatedAt).from(dayjs(deploy.updatedAt));- return {- status: 200,- body: {- ...finalLogs- }- };- } catch (error) {- return {- status: 500,- body: {- error: error.message || error- }- };- }-}diff --git a/src/routes/api/v1/application/deploy/logs/index.ts b/src/routes/api/v1/application/deploy/logs/index.tsdeleted file mode 100644index e7f84d805d..0000000000--- a/src/routes/api/v1/application/deploy/logs/index.ts+++ /dev/null@@ -1,42 +0,0 @@-import type { Request } from '@sveltejs/kit';-import dayjs from 'dayjs';-import utc from 'dayjs/plugin/utc.js';-import relativeTime from 'dayjs/plugin/relativeTime.js';-import Deployment from '$models/Deployment';-dayjs.extend(utc);-dayjs.extend(relativeTime);-export async function get(request: Request) {- try {- const repoId = request.query.get('repoId');- const branch = request.query.get('branch');- const page = request.query.get('page');- const onePage = 5;- const show = Number(page) * onePage || 5;- const deploy: any = await Deployment.find({ repoId, branch })- .select('-_id -__v -repoId')- .sort({ createdAt: 'desc' })- .limit(show);- const finalLogs = deploy.map((d) => {- const finalLogs = { ...d._doc };- const updatedAt = dayjs(d.updatedAt).utc();- finalLogs.took = updatedAt.diff(dayjs(d.createdAt)) / 1000;- finalLogs.since = updatedAt.fromNow();- finalLogs.isPr = d.domain.startsWith('pr');- return finalLogs;- });- return {- status: 200,- body: {- success: true,- logs: finalLogs- }- };- } catch (error) {- return {- status: 500,- body: {- error: error.message || error- }- };- }-}diff --git a/src/routes/api/v1/application/logs/index.ts b/src/routes/api/v1/application/logs/index.tsdeleted file mode 100644index 01f478d168..0000000000--- a/src/routes/api/v1/application/logs/index.ts+++ /dev/null@@ -1,28 +0,0 @@-import { saveServerLog } from '$lib/api/applications/logging';-import { docker } from '$lib/api/docker';-import type { Request } from '@sveltejs/kit';--export async function get(request: Request) {- try {- const name = request.query.get('name');- const service = await docker.engine.getService(`${name}_${name}`);- const logs = (await service.logs({ stdout: true, stderr: true, timestamps: true }))- .toString()- .split('\n')- .map((l) => l.slice(8))- .filter((a) => a);- return {- status: 200,- body: { success: true, logs }- };- } catch (error) {- console.log(error);- await saveServerLog(error);- return {- status: 500,- body: {- error: 'No such service. Is it under deployment?'- }- };- }-}diff --git a/src/routes/api/v1/application/remove/index.ts b/src/routes/api/v1/application/remove/index.tsdeleted file mode 100644index b4b3b512a3..0000000000--- a/src/routes/api/v1/application/remove/index.ts+++ /dev/null@@ -1,58 +0,0 @@-import { purgeImagesContainers } from '$lib/api/applications/cleanup';-import Deployment from '$models/Deployment';-import ApplicationLog from '$models/ApplicationLog';-import { delay, execShellAsync } from '$lib/api/common';-import Configuration from '$models/Configuration';--export async function post(request: Request) {- const { nickname } = request.body;- try {- const configurationFound = await Configuration.findOne({- 'general.nickname': nickname- });- if (configurationFound) {- const id = configurationFound._id;- if (configurationFound?.general?.pullRequest === 0) {- // Main deployment deletion request; deleting main + PRs- const allConfiguration = await Configuration.find({- 'publish.domain': { $regex: `.*${configurationFound.publish.domain}`, $options: 'i' },- 'publish.path': configurationFound.publish.path- });- for (const config of allConfiguration) {- await execShellAsync(`docker stack rm ${config.build.container.name}`);- }- await Configuration.deleteMany({- 'publish.domain': { $regex: `.*${configurationFound.publish.domain}`, $options: 'i' },- 'publish.path': configurationFound.publish.path- });- const deploys = await Deployment.find({ nickname });- for (const deploy of deploys) {- await ApplicationLog.deleteMany({ deployId: deploy.deployId });- await Deployment.deleteMany({ deployId: deploy.deployId });- }- } else {- // Delete only PRs- await Configuration.findByIdAndRemove(id);- await execShellAsync(`docker stack rm ${configurationFound.build.container.name}`);- const deploys = await Deployment.find({ nickname });- for (const deploy of deploys) {- await ApplicationLog.deleteMany({ deployId: deploy.deployId });- await Deployment.deleteMany({ deployId: deploy.deployId });- }- }- }-- return {- status: 200,- body: {}- };- } catch (error) {- console.log(error);- return {- status: 500,- error: {- message: 'Nothing to do.'- }- };- }-}diff --git a/src/routes/api/v1/dashboard/index.ts b/src/routes/api/v1/dashboard/index.tsdeleted file mode 100644index fe1ab230cb..0000000000--- a/src/routes/api/v1/dashboard/index.ts+++ /dev/null@@ -1,68 +0,0 @@-import { docker } from '$lib/api/docker';-import type { Request } from '@sveltejs/kit';-import Configuration from '$models/Configuration';-export async function get(request: Request) {- // Should update this to get data from mongodb and update db with the currently running services on start!- const dockerServices = await docker.engine.listServices();- let databases: any = dockerServices.filter(- (r) =>- r.Spec.Labels.managedBy === 'coolify' &&- r.Spec.Labels.type === 'database' &&- r.Spec.Labels.configuration- );- let services: any = dockerServices.filter(- (r) =>- r.Spec.Labels.managedBy === 'coolify' &&- r.Spec.Labels.type === 'service' &&- r.Spec.Labels.configuration- );- databases = databases.map((r) => {- if (JSON.parse(r.Spec.Labels.configuration)) {- return {- configuration: JSON.parse(r.Spec.Labels.configuration)- };- }- return {};- });- services = services.map((r) => {- if (JSON.parse(r.Spec.Labels.configuration)) {- return {- serviceName: r.Spec.Labels.serviceName,- configuration: JSON.parse(r.Spec.Labels.configuration)- };- }- return {};- });- const configurations = await Configuration.find({- 'general.pullRequest': { $in: [null, 0] }- }).select('-_id -__v -createdAt');- const applications = [];- for (const configuration of configurations) {- const foundPRDeployments = await Configuration.find({- 'repository.id': configuration.repository.id,- 'repository.branch': configuration.repository.branch,- 'general.pullRequest': { $ne: 0 }- }).select('-_id -__v -createdAt');- const payload = {- configuration,- UpdatedAt: configuration.updatedAt,- prBuilds: foundPRDeployments.length > 0 ? true : false- };- applications.push(payload);- }- return {- status: 200,- body: {- success: true,- applications: {- deployed: applications- },- databases: {- deployed: databases- },- services: {- deployed: services- }- }- };-}diff --git a/src/routes/api/v1/databases/[deployId]/backup.ts b/src/routes/api/v1/databases/[deployId]/backup.tsdeleted file mode 100644index f8e6f4cbc6..0000000000--- a/src/routes/api/v1/databases/[deployId]/backup.ts+++ /dev/null@@ -1,146 +0,0 @@-import type { Request } from '@sveltejs/kit';-import { saveServerLog } from '$lib/api/applications/logging';-import { execShellAsync } from '$lib/api/common';-import { docker } from '$lib/api/docker';-import fs from 'fs';--export async function post(request: Request) {- const tmpdir = '/tmp/backups';- const { deployId } = request.params;- try {- const now = new Date();- const configuration = JSON.parse(- JSON.parse(await execShellAsync(`docker inspect ${deployId}_${deployId}`))[0].Spec.Labels- .configuration- );- const type = configuration.general.type;- const serviceId = configuration.general.deployId;- const databaseService = (await docker.engine.listContainers()).find(- (r) => r.Labels['com.docker.stack.namespace'] === serviceId && r.State === 'running'- );- const containerID = databaseService.Labels['com.docker.swarm.task.name'];- await execShellAsync(`mkdir -p ${tmpdir}`);- if (type === 'mongodb') {- if (databaseService) {- const username = configuration.database.usernames[0];- const password = configuration.database.passwords[1];- const databaseName = configuration.database.defaultDatabaseName;- const filename = `${databaseName}_${now.getTime()}.gz`;- const fullfilename = `${tmpdir}/${filename}`;- await execShellAsync(- `docker exec -i ${containerID} /bin/bash -c "mkdir -p ${tmpdir};mongodump --uri='mongodb://${username}:${password}@${deployId}:27017' -d ${databaseName} --gzip --archive=${fullfilename}"`- );- await execShellAsync(`docker cp ${containerID}:${fullfilename} ${fullfilename}`);- await execShellAsync(`docker exec -i ${containerID} /bin/bash -c "rm -f ${fullfilename}"`);- return {- status: 200,- headers: {- 'Content-Type': 'application/octet-stream',- 'Content-Transfer-Encoding': 'binary',- 'Content-Disposition': `attachment; filename=${filename}`- },- body: fs.readFileSync(`${fullfilename}`)- };- }- } else if (type === 'postgresql') {- if (databaseService) {- const username = configuration.database.usernames[0];- const password = configuration.database.passwords[0];- const databaseName = configuration.database.defaultDatabaseName;- const filename = `${databaseName}_${now.getTime()}.sql.gz`;- const fullfilename = `${tmpdir}/${filename}`;- await execShellAsync(- `docker exec -i ${containerID} /bin/bash -c "PGPASSWORD=${password} pg_dump --username ${username} -Z 9 ${databaseName}" > ${fullfilename}`- );- return {- status: 200,- headers: {- 'Content-Type': 'application/octet-stream',- 'Content-Transfer-Encoding': 'binary',- 'Content-Disposition': `attachment; filename=${filename}`- },- body: fs.readFileSync(`${fullfilename}`)- };- }- } else if (type === 'couchdb') {- if (databaseService) {- const databaseName = configuration.database.defaultDatabaseName;- const filename = `${databaseName}_${now.getTime()}.tar.gz`;- const fullfilename = `${tmpdir}/${filename}`;- await execShellAsync(- `docker exec -i ${containerID} /bin/bash -c "cd /bitnami/couchdb/data/ && tar -czvf - ." > ${fullfilename}`- );- return {- status: 200,- headers: {- 'Content-Type': 'application/octet-stream',- 'Content-Transfer-Encoding': 'binary',- 'Content-Disposition': `attachment; filename=${filename}`- },- body: fs.readFileSync(`${fullfilename}`)- };- }- } else if (type === 'mysql') {- if (databaseService) {- const username = configuration.database.usernames[0];- const password = configuration.database.passwords[0];- const databaseName = configuration.database.defaultDatabaseName;- const filename = `${databaseName}_${now.getTime()}.sql.gz`;- const fullfilename = `${tmpdir}/${filename}`;- await execShellAsync(- `docker exec -i ${containerID} /bin/bash -c "mysqldump -u ${username} -p${password} ${databaseName} | gzip -9 -" > ${fullfilename}`- );- return {- status: 200,- headers: {- 'Content-Type': 'application/octet-stream',- 'Content-Transfer-Encoding': 'binary',- 'Content-Disposition': `attachment; filename=${filename}`- },- body: fs.readFileSync(`${fullfilename}`)- };- }- } else if (type === 'redis') {- if (databaseService) {- const password = configuration.database.passwords[0];- const databaseName = configuration.database.defaultDatabaseName;- const filename = `${databaseName}_${now.getTime()}.rdb`;- const fullfilename = `${tmpdir}/${filename}`;- await execShellAsync(- `docker exec -i ${containerID} /bin/bash -c "redis-cli --pass ${password} save"`- );- await execShellAsync(- `docker cp ${containerID}:/bitnami/redis/data/dump.rdb ${fullfilename}`- );- await execShellAsync(- `docker exec -i ${containerID} /bin/bash -c "rm -f /bitnami/redis/data/dump.rdb"`- );- return {- status: 200,- headers: {- 'Content-Type': 'application/octet-stream',- 'Content-Transfer-Encoding': 'binary',- 'Content-Disposition': `attachment; filename=${filename}`- },- body: fs.readFileSync(`${fullfilename}`)- };- }- }- return {- status: 501,- body: {- error: `Backup method not implemented yet for ${type}.`- }- };- } catch (error) {- await saveServerLog(error);- return {- status: 500,- body: {- error: error.message || error- }- };- } finally {- await execShellAsync(`rm -fr ${tmpdir}`);- }-}diff --git a/src/routes/api/v1/databases/[deployId]/index.ts b/src/routes/api/v1/databases/[deployId]/index.tsdeleted file mode 100644index a7a5ab7ab5..0000000000--- a/src/routes/api/v1/databases/[deployId]/index.ts+++ /dev/null@@ -1,59 +0,0 @@-import { execShellAsync } from '$lib/api/common';-import { docker } from '$lib/api/docker';-import type { Request } from '@sveltejs/kit';--export async function del(request: Request) {- const { deployId } = request.params;- await execShellAsync(`docker stack rm ${deployId}`);- return {- status: 200,- body: {}- };-}-export async function get(request: Request) {- const { deployId } = request.params;-- try {- const database = (await docker.engine.listServices()).find(- (r) =>- r.Spec.Labels.managedBy === 'coolify' &&- r.Spec.Labels.type === 'database' &&- JSON.parse(r.Spec.Labels.configuration).general.deployId === deployId- );-- if (database) {- const jsonEnvs = {};- if (database.Spec.TaskTemplate.ContainerSpec.Env) {- for (const d of database.Spec.TaskTemplate.ContainerSpec.Env) {- const s = d.split('=');- jsonEnvs[s[0]] = s[1];- }- }- const payload = {- config: JSON.parse(database.Spec.Labels.configuration),- envs: jsonEnvs || null- };-- return {- status: 200,- body: {- ...payload- }- };- } else {- return {- status: 500,- body: {- error: 'No database found.'- }- };- }- } catch (error) {- return {- status: 500,- body: {- error: 'No database found.'- }- };- }-}diff --git a/src/routes/api/v1/databases/deploy.ts b/src/routes/api/v1/databases/deploy.tsdeleted file mode 100644index 4aed627a29..0000000000--- a/src/routes/api/v1/databases/deploy.ts+++ /dev/null@@ -1,167 +0,0 @@-import { saveServerLog } from '$lib/api/applications/logging';-import { docker } from '$lib/api/docker';-import type { Request } from '@sveltejs/kit';-import yaml from 'js-yaml';-import { promises as fs } from 'fs';-import cuid from 'cuid';-import generator from 'generate-password';-import { uniqueNamesGenerator, adjectives, colors, animals } from 'unique-names-generator';-import { execShellAsync } from '$lib/api/common';--function getUniq() {- return uniqueNamesGenerator({ dictionaries: [adjectives, animals, colors], length: 2 });-}--export async function post(request: Request) {- try {- const { type } = request.body;- let { defaultDatabaseName } = request.body;- const passwords = generator.generateMultiple(2, {- length: 24,- numbers: true,- strict: true- });- const usernames = generator.generateMultiple(2, {- length: 10,- numbers: true,- strict: true- });- // TODO: Query for existing db with the same name- const nickname = getUniq();-- if (!defaultDatabaseName) defaultDatabaseName = nickname;-- const deployId = cuid();- const configuration = {- general: {- workdir: `/tmp/${deployId}`,- deployId,- nickname,- type- },- database: {- usernames,- passwords,- defaultDatabaseName- },- deploy: {- name: nickname- }- };- await execShellAsync(`mkdir -p ${configuration.general.workdir}`);- let generateEnvs = {};- let image = null;- let volume = null;- let ulimits = {};- if (type === 'mongodb') {- generateEnvs = {- MONGODB_ROOT_PASSWORD: passwords[0],- MONGODB_USERNAME: usernames[0],- MONGODB_PASSWORD: passwords[1],- MONGODB_DATABASE: defaultDatabaseName- };- image = 'bitnami/mongodb:4.4';- volume = `${configuration.general.deployId}-${type}-data:/bitnami/mongodb`;- } else if (type === 'postgresql') {- generateEnvs = {- POSTGRESQL_PASSWORD: passwords[0],- POSTGRESQL_USERNAME: usernames[0],- POSTGRESQL_DATABASE: defaultDatabaseName- };- image = 'bitnami/postgresql:13.2.0';- volume = `${configuration.general.deployId}-${type}-data:/bitnami/postgresql`;- } else if (type === 'couchdb') {- generateEnvs = {- COUCHDB_PASSWORD: passwords[0],- COUCHDB_USER: usernames[0]- };- image = 'bitnami/couchdb:3';- volume = `${configuration.general.deployId}-${type}-data:/bitnami/couchdb`;- } else if (type === 'mysql') {- generateEnvs = {- MYSQL_ROOT_PASSWORD: passwords[0],- MYSQL_ROOT_USER: usernames[0],- MYSQL_USER: usernames[1],- MYSQL_PASSWORD: passwords[1],- MYSQL_DATABASE: defaultDatabaseName- };- image = 'bitnami/mysql:8.0';- volume = `${configuration.general.deployId}-${type}-data:/bitnami/mysql/data`;- } else if (type === 'clickhouse') {- image = 'yandex/clickhouse-server';- volume = `${configuration.general.deployId}-${type}-data:/var/lib/clickhouse`;- ulimits = {- nofile: {- soft: 262144,- hard: 262144- }- };- } else if (type === 'redis') {- image = 'bitnami/redis';- volume = `${configuration.general.deployId}-${type}-data:/bitnami/redis/data`;- generateEnvs = {- REDIS_PASSWORD: passwords[0]- };- }-- const stack = {- version: '3.8',- services: {- [configuration.general.deployId]: {- image,- networks: [`${docker.network}`],- environment: generateEnvs,- volumes: [volume],- ulimits,- deploy: {- replicas: 1,- update_config: {- parallelism: 0,- delay: '10s',- order: 'start-first'- },- rollback_config: {- parallelism: 0,- delay: '10s',- order: 'start-first'- },- labels: [- 'managedBy=coolify',- 'type=database',- 'configuration=' + JSON.stringify(configuration)- ]- }- }- },- networks: {- [`${docker.network}`]: {- external: true- }- },- volumes: {- [`${configuration.general.deployId}-${type}-data`]: {- external: true- }- }- };- await fs.writeFile(`${configuration.general.workdir}/stack.yml`, yaml.dump(stack));- await execShellAsync(- `cat ${configuration.general.workdir}/stack.yml | docker stack deploy -c - ${configuration.general.deployId}`- );- return {- status: 201,- body: {- message: 'Deployed.'- }- };- } catch (error) {- console.log(error);- await saveServerLog(error);- return {- status: 500,- body: {- error- }- };- }-}diff --git a/src/routes/api/v1/login/email.ts b/src/routes/api/v1/login/email.tsdeleted file mode 100644index 14f3206ba7..0000000000--- a/src/routes/api/v1/login/email.ts+++ /dev/null@@ -1,104 +0,0 @@-import mongoose from 'mongoose';-import Settings from '$models/Settings';-import User from '$models/User';-import bcrypt from 'bcrypt';-import cuid from 'cuid';-import jsonwebtoken from 'jsonwebtoken';-import type { Request } from '@sveltejs/kit';--const saltRounds = 15;--export async function post(request: Request) {- const { email, password } = request.body;- const { JWT_SIGN_KEY } = process.env;- const settings = await Settings.findOne({ applicationName: 'coolify' });- const registeredUsers = await User.find().countDocuments();- const foundUser = await User.findOne({ email });- try {- let uid = cuid();- if (foundUser) {- if (foundUser.type === 'github') {- return {- status: 500,- body: {- error: 'Wrong password or email address.'- }- };- }- uid = foundUser.uid;- if (!(await bcrypt.compare(password, foundUser.password))) {- return {- status: 500,- body: {- error: 'Wrong password or email address.'- }- };- }- } else {- if (registeredUsers === 0) {- const newUser = new User({- _id: new mongoose.Types.ObjectId(),- email,- uid,- type: 'email',- password: await bcrypt.hash(password, saltRounds)- });- const defaultSettings = new Settings({- _id: new mongoose.Types.ObjectId()- });- try {- await newUser.save();- await defaultSettings.save();- } catch (error) {- return {- status: 500,- error: error.message || error- };- }- } else {- if (!settings?.allowRegistration) {- return {- status: 500,- body: {- error: 'Registration disabled, enable it in settings.'- }- };- } else {- const newUser = new User({- _id: new mongoose.Types.ObjectId(),- email,- uid,- type: 'email',- password: await bcrypt.hash(password, saltRounds)- });- try {- await newUser.save();- } catch (error) {- return {- status: 500,- error: error.message || error- };- }- }- }- }- const coolToken = jsonwebtoken.sign({}, JWT_SIGN_KEY, {- expiresIn: 15778800,- algorithm: 'HS256',- audience: 'coolLabs',- issuer: 'coolLabs',- jwtid: uid,- subject: `User:${uid}`,- notBefore: -1000- });- request.locals.session.data = { coolToken, ghToken: null };- return {- status: 200,- body: {- message: 'Successfully logged in.'- }- };- } catch (error) {- return { status: 500, body: { error: error.message || error } };- }-}diff --git a/src/routes/api/v1/login/github/app.ts b/src/routes/api/v1/login/github/app.tsdeleted file mode 100644index 175ee2ab37..0000000000--- a/src/routes/api/v1/login/github/app.ts+++ /dev/null@@ -1,108 +0,0 @@-import type { Request } from '@sveltejs/kit';-import mongoose from 'mongoose';-import User from '$models/User';-import Settings from '$models/Settings';-import cuid from 'cuid';-import jsonwebtoken from 'jsonwebtoken';-import { githubAPI } from '$lib/api/github';--export async function get(request: Request) {- const code = request.query.get('code');- const { GITHUB_APP_CLIENT_SECRET, JWT_SIGN_KEY, VITE_GITHUB_APP_CLIENTID } = process.env;- try {- let uid = cuid();- const { access_token } = await (- await fetch(- `https://github.com/login/oauth/access_token?client_id=${VITE_GITHUB_APP_CLIENTID}&client_secret=${GITHUB_APP_CLIENT_SECRET}&code=${code}`,- { headers: { accept: 'application/json' } }- )- ).json();- const { avatar_url } = await (await githubAPI(request, '/user', access_token)).body;- const email = (await githubAPI(request, '/user/emails', access_token)).body.filter(- (e) => e.primary- )[0].email;- const settings = await Settings.findOne({ applicationName: 'coolify' });- const registeredUsers = await User.find().countDocuments();- const foundUser = await User.findOne({ email });- if (foundUser) {- await User.findOneAndUpdate({ email }, { avatar: avatar_url }, { upsert: true, new: true });- uid = foundUser.uid;- } else {- if (registeredUsers === 0) {- const newUser = new User({- _id: new mongoose.Types.ObjectId(),- email,- avatar: avatar_url,- uid,- type: 'github'- });- const defaultSettings = new Settings({- _id: new mongoose.Types.ObjectId()- });- try {- await newUser.save();- await defaultSettings.save();- } catch (error) {- return {- status: 500,- error: error.message || error- };- }- } else {- if (!settings && registeredUsers > 0) {- return {- status: 500,- body: {- error: 'Registration disabled, enable it in settings.'- }- };- } else {- if (!settings.allowRegistration) {- return {- status: 500,- body: {- error: 'You are not allowed here!'- }- };- } else {- const newUser = new User({- _id: new mongoose.Types.ObjectId(),- email,- avatar: avatar_url,- uid,- type: 'github'- });- try {- await newUser.save();- } catch (error) {- return {- status: 500,- body: {- error: error.message || error- }- };- }- }- }- }- }- const coolToken = jsonwebtoken.sign({}, JWT_SIGN_KEY, {- expiresIn: 15778800,- algorithm: 'HS256',- audience: 'coolLabs',- issuer: 'coolLabs',- jwtid: uid,- subject: `User:${uid}`,- notBefore: -1000- });- request.locals.session.data = { coolToken, ghToken: access_token };- return {- status: 302,- headers: {- location: `/success`- }- };- } catch (error) {- return { status: 500, body: { error: error.message || error } };- }-}diff --git a/src/routes/api/v1/logout/index.ts b/src/routes/api/v1/logout/index.tsdeleted file mode 100644index c06d54eab9..0000000000--- a/src/routes/api/v1/logout/index.ts+++ /dev/null@@ -1,9 +0,0 @@-import type { Request } from '@sveltejs/kit';-export async function del(request: Request) {- request.locals.session.destroy()- return {- body: {- ok: true- }- };-}diff --git a/src/routes/api/v1/servers/cleanups/caches.ts b/src/routes/api/v1/servers/cleanups/caches.tsdeleted file mode 100644index 60d37da55f..0000000000--- a/src/routes/api/v1/servers/cleanups/caches.ts+++ /dev/null@@ -1,27 +0,0 @@-import { saveServerLog } from '$lib/api/applications/logging';-import { execShellAsync } from '$lib/api/common';-import type { Request } from '@sveltejs/kit';--export async function post(request: Request) {- try {- const output = await execShellAsync('docker builder prune -af');- return {- status: 200,- body: {- message: 'OK',- output: output- .replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm, '')- .split('\n')- .pop()- }- };- } catch (error) {- await saveServerLog(error);- return {- status: 500,- body: {- error: error.message || error- }- };- }-}diff --git a/src/routes/api/v1/servers/cleanups/containers.ts b/src/routes/api/v1/servers/cleanups/containers.tsdeleted file mode 100644index af0981d1e1..0000000000--- a/src/routes/api/v1/servers/cleanups/containers.ts+++ /dev/null@@ -1,27 +0,0 @@-import { saveServerLog } from '$lib/api/applications/logging';-import { execShellAsync } from '$lib/api/common';-import type { Request } from '@sveltejs/kit';--export async function post(request: Request) {- try {- const output = await execShellAsync('docker container prune -f');- return {- status: 200,- body: {- message: 'OK',- output: output- .replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm, '')- .split('\n')- .pop()- }- };- } catch (error) {- await saveServerLog(error);- return {- status: 500,- body: {- error: error.message || error- }- };- }-}diff --git a/src/routes/api/v1/servers/cleanups/images.ts b/src/routes/api/v1/servers/cleanups/images.tsdeleted file mode 100644index a139de2b8c..0000000000--- a/src/routes/api/v1/servers/cleanups/images.ts+++ /dev/null@@ -1,27 +0,0 @@-import { saveServerLog } from '$lib/api/applications/logging';-import { execShellAsync } from '$lib/api/common';-import type { Request } from '@sveltejs/kit';--export async function post(request: Request) {- try {- const output = await execShellAsync('docker image prune -af');- return {- status: 200,- body: {- message: 'OK',- output: output- .replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm, '')- .split('\n')- .pop()- }- };- } catch (error) {- await saveServerLog(error);- return {- status: 500,- body: {- error: error.message || error- }- };- }-}diff --git a/src/routes/api/v1/servers/cleanups/volumes.ts b/src/routes/api/v1/servers/cleanups/volumes.tsdeleted file mode 100644index 8f02ee745b..0000000000--- a/src/routes/api/v1/servers/cleanups/volumes.ts+++ /dev/null@@ -1,27 +0,0 @@-import { saveServerLog } from '$lib/api/applications/logging';-import { execShellAsync } from '$lib/api/common';-import type { Request } from '@sveltejs/kit';--export async function post(request: Request) {- try {- const output = await execShellAsync('docker volume prune -f');- return {- status: 200,- body: {- message: 'OK',- output: output- .replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm, '')- .split('\n')- .pop()- }- };- } catch (error) {- await saveServerLog(error);- return {- status: 500,- body: {- error: error.message || error- }- };- }-}diff --git a/src/routes/api/v1/servers/index.ts b/src/routes/api/v1/servers/index.tsdeleted file mode 100644index cece273aa5..0000000000--- a/src/routes/api/v1/servers/index.ts+++ /dev/null@@ -1,34 +0,0 @@-import { saveServerLog } from '$lib/api/applications/logging';-import { execShellAsync } from '$lib/api/common';-import { docker } from '$lib/api/docker';-import type { Request } from '@sveltejs/kit';-import systeminformation from 'systeminformation';--export async function get(request: Request) {- try {- const df = await execShellAsync(`docker system df --format '{{ json . }}'`);- const dockerReclaimable = df- .split('\n')- .filter((n) => n)- .map((s) => JSON.parse(s));-- return {- status: 200,- body: {- hostname: await (await systeminformation.osInfo()).hostname,- filesystems: await (- await systeminformation.fsSize()- ).filter((fs) => !fs.fs.match('/dev/loop') || !fs.fs.match('/var/lib/docker/')),- dockerReclaimable- }- };- } catch (error) {- await saveServerLog(error);- return {- status: 500,- body: {- error: error.message || error- }- };- }-}diff --git a/src/routes/api/v1/services/[serviceName].ts b/src/routes/api/v1/services/[serviceName].tsdeleted file mode 100644index 5b1f1dabf6..0000000000--- a/src/routes/api/v1/services/[serviceName].ts+++ /dev/null@@ -1,52 +0,0 @@-import { execShellAsync } from '$lib/api/common';-import { docker } from '$lib/api/docker';-import type { Request } from '@sveltejs/kit';--export async function get(request: Request) {- const { serviceName } = request.params;-- try {- const service = (await docker.engine.listServices()).find(- (r) =>- r.Spec.Labels.managedBy === 'coolify' &&- r.Spec.Labels.type === 'service' &&- r.Spec.Labels.serviceName === serviceName &&- r.Spec.Name === `${serviceName}_${serviceName}`- );- if (service) {- const payload = {- config: JSON.parse(service.Spec.Labels.configuration)- };- return {- status: 200,- body: {- success: true,- ...payload- }- };- } else {- return {- status: 200,- body: {- success: false,- showToast: false,- message: 'Not found'- }- };- }- } catch (error) {- return {- status: 500,- body: {- success: false,- error: error.message || error- }- };- }-}--export async function del(request: Request) {- const { serviceName } = request.params;- await execShellAsync(`docker stack rm ${serviceName}`);- return { status: 200, body: {} };-}diff --git a/src/routes/api/v1/services/deploy/code-server/index.ts b/src/routes/api/v1/services/deploy/code-server/index.tsdeleted file mode 100644index 8bab4b0028..0000000000--- a/src/routes/api/v1/services/deploy/code-server/index.ts+++ /dev/null@@ -1,74 +0,0 @@-import type { Request } from '@sveltejs/kit';-import yaml from 'js-yaml';-import { promises as fs } from 'fs';-import { docker } from '$lib/api/docker';-import { baseServiceConfiguration } from '$lib/api/applications/common';-import { cleanupTmp, execShellAsync } from '$lib/api/common';--export async function post(request: Request) {- let { baseURL } = request.body;- const traefikURL = baseURL;- baseURL = `https://${baseURL}`;- const workdir = '/tmp/code-server';- const deployId = 'code-server';- // const environment = [- // { name: 'DOCKER_USER', value: 'root' }-- // ];- // const generateEnvsCodeServer = {};- // for (const env of environment) generateEnvsCodeServer[env.name] = env.value;-- const stack = {- version: '3.8',- services: {- [deployId]: {- image: 'codercom/code-server',- command: 'code-server --disable-telemetry',- networks: [`${docker.network}`],- volumes: [`${deployId}-code-server-data:/home/coder`],- // environment: generateEnvsCodeServer,- deploy: {- ...baseServiceConfiguration,- labels: [- 'managedBy=coolify',- 'type=service',- 'serviceName=code-server',- 'configuration=' +- JSON.stringify({- baseURL- }),- 'traefik.enable=true',- 'traefik.http.services.' + deployId + '.loadbalancer.server.port=8080',- 'traefik.http.routers.' + deployId + '.entrypoints=websecure',- 'traefik.http.routers.' +- deployId +- '.rule=Host(`' +- traefikURL +- '`) && PathPrefix(`/`)',- 'traefik.http.routers.' + deployId + '.tls.certresolver=letsencrypt',- 'traefik.http.routers.' + deployId + '.middlewares=global-compress'- ]- }- }- },- networks: {- [`${docker.network}`]: {- external: true- }- },- volumes: {- [`${deployId}-code-server-data`]: {- external: true- }- }- };- await execShellAsync(`mkdir -p ${workdir}`);- await fs.writeFile(`${workdir}/stack.yml`, yaml.dump(stack));- await execShellAsync('docker stack rm code-server');- await execShellAsync(`cat ${workdir}/stack.yml | docker stack deploy --prune -c - ${deployId}`);- cleanupTmp(workdir);- return {- status: 200,- body: { message: 'OK' }- };-}diff --git a/src/routes/api/v1/services/deploy/code-server/password.ts b/src/routes/api/v1/services/deploy/code-server/password.tsdeleted file mode 100644index a9f5f2cd0f..0000000000--- a/src/routes/api/v1/services/deploy/code-server/password.ts+++ /dev/null@@ -1,27 +0,0 @@-import { execShellAsync } from '$lib/api/common';-import type { Request } from '@sveltejs/kit';-import yaml from 'js-yaml';--export async function get(request: Request) {- // const { POSTGRESQL_USERNAME, POSTGRESQL_PASSWORD, POSTGRESQL_DATABASE } = JSON.parse(- // JSON.parse(- // await execShellAsync(- // "docker service inspect code-server_code-server --format='{{json .Spec.Labels.configuration}}'"- // )- // )- // ).generateEnvsPostgres;- const containers = (await execShellAsync("docker ps -a --format='{{json .Names}}'"))- .replace(/"/g, '')- .trim()- .split('\n');- const codeServer = containers.find((container) => container.startsWith('code-server'));- const configYaml = yaml.load(- await execShellAsync(- `docker exec ${codeServer} cat /home/coder/.config/code-server/config.yaml`- )- );- return {- status: 200,- body: { message: 'OK', password: configYaml.password }- };-}diff --git a/src/routes/api/v1/services/deploy/minio/index.ts b/src/routes/api/v1/services/deploy/minio/index.tsdeleted file mode 100644index d51feddbaa..0000000000--- a/src/routes/api/v1/services/deploy/minio/index.ts+++ /dev/null@@ -1,82 +0,0 @@-import type { Request } from '@sveltejs/kit';-import yaml from 'js-yaml';-import generator from 'generate-password';-import { promises as fs } from 'fs';-import { docker } from '$lib/api/docker';-import { baseServiceConfiguration } from '$lib/api/applications/common';-import { cleanupTmp, execShellAsync } from '$lib/api/common';--export async function post(request: Request) {- let { baseURL } = request.body;- const traefikURL = baseURL;- baseURL = `https://${baseURL}`;- const workdir = '/tmp/minio';- const deployId = 'minio';- const secrets = [- {- name: 'MINIO_ROOT_USER',- value: generator.generate({ length: 12, numbers: true, strict: true })- },- {- name: 'MINIO_ROOT_PASSWORD',- value: generator.generate({ length: 24, numbers: true, strict: true })- }- ];- const generateEnvsMinIO = {};- for (const secret of secrets) generateEnvsMinIO[secret.name] = secret.value;-- const stack = {- version: '3.8',- services: {- [deployId]: {- image: 'minio/minio',- command: 'server /data',- networks: [`${docker.network}`],- environment: generateEnvsMinIO,- volumes: [`${deployId}-minio-data:/data`],- deploy: {- ...baseServiceConfiguration,- labels: [- 'managedBy=coolify',- 'type=service',- 'serviceName=minio',- 'configuration=' +- JSON.stringify({- baseURL,- generateEnvsMinIO- }),- 'traefik.enable=true',- 'traefik.http.services.' + deployId + '.loadbalancer.server.port=9000',- 'traefik.http.routers.' + deployId + '.entrypoints=websecure',- 'traefik.http.routers.' +- deployId +- '.rule=Host(`' +- traefikURL +- '`) && PathPrefix(`/`)',- 'traefik.http.routers.' + deployId + '.tls.certresolver=letsencrypt',- 'traefik.http.routers.' + deployId + '.middlewares=global-compress'- ]- }- }- },- networks: {- [`${docker.network}`]: {- external: true- }- },- volumes: {- [`${deployId}-minio-data`]: {- external: true- }- }- };- await execShellAsync(`mkdir -p ${workdir}`);- await fs.writeFile(`${workdir}/stack.yml`, yaml.dump(stack));- await execShellAsync('docker stack rm minio');- await execShellAsync(`cat ${workdir}/stack.yml | docker stack deploy --prune -c - ${deployId}`);- cleanupTmp(workdir);- return {- status: 200,- body: { message: 'OK' }- };-}diff --git a/src/routes/api/v1/services/deploy/nocodb/index.ts b/src/routes/api/v1/services/deploy/nocodb/index.tsdeleted file mode 100644index 82b8b84e00..0000000000--- a/src/routes/api/v1/services/deploy/nocodb/index.ts+++ /dev/null@@ -1,59 +0,0 @@-import type { Request } from '@sveltejs/kit';-import yaml from 'js-yaml';-import { promises as fs } from 'fs';-import { docker } from '$lib/api/docker';-import { baseServiceConfiguration } from '$lib/api/applications/common';-import { cleanupTmp, execShellAsync } from '$lib/api/common';--export async function post(request: Request) {- let { baseURL } = request.body;- const traefikURL = baseURL;- baseURL = `https://${baseURL}`;- const workdir = '/tmp/nocodb';- const deployId = 'nocodb';- const stack = {- version: '3.8',- services: {- [deployId]: {- image: 'nocodb/nocodb',- networks: [`${docker.network}`],- deploy: {- ...baseServiceConfiguration,- labels: [- 'managedBy=coolify',- 'type=service',- 'serviceName=nocodb',- 'configuration=' +- JSON.stringify({- baseURL- }),- 'traefik.enable=true',- 'traefik.http.services.' + deployId + '.loadbalancer.server.port=8080',- 'traefik.http.routers.' + deployId + '.entrypoints=websecure',- 'traefik.http.routers.' +- deployId +- '.rule=Host(`' +- traefikURL +- '`) && PathPrefix(`/`)',- 'traefik.http.routers.' + deployId + '.tls.certresolver=letsencrypt',- 'traefik.http.routers.' + deployId + '.middlewares=global-compress'- ]- }- }- },- networks: {- [`${docker.network}`]: {- external: true- }- }- };- await execShellAsync(`mkdir -p ${workdir}`);- await fs.writeFile(`${workdir}/stack.yml`, yaml.dump(stack));- await execShellAsync('docker stack rm nocodb');- await execShellAsync(`cat ${workdir}/stack.yml | docker stack deploy --prune -c - ${deployId}`);- cleanupTmp(workdir);- return {- status: 200,- body: { message: 'OK' }- };-}diff --git a/src/routes/api/v1/services/deploy/plausible/activate.ts b/src/routes/api/v1/services/deploy/plausible/activate.tsdeleted file mode 100644index 420aa43d15..0000000000--- a/src/routes/api/v1/services/deploy/plausible/activate.ts+++ /dev/null@@ -1,24 +0,0 @@-import { execShellAsync } from '$lib/api/common';-import type { Request } from '@sveltejs/kit';--export async function patch(request: Request) {- const { POSTGRESQL_USERNAME, POSTGRESQL_PASSWORD, POSTGRESQL_DATABASE } = JSON.parse(- JSON.parse(- await execShellAsync(- "docker service inspect plausible_plausible --format='{{json .Spec.Labels.configuration}}'"- )- )- ).generateEnvsPostgres;- const containers = (await execShellAsync("docker ps -a --format='{{json .Names}}'"))- .replace(/"/g, '')- .trim()- .split('\n');- const postgresDB = containers.find((container) => container.startsWith('plausible_plausible_db'));- await execShellAsync(- `docker exec ${postgresDB} psql -H postgresql://${POSTGRESQL_USERNAME}:${POSTGRESQL_PASSWORD}@localhost:5432/${POSTGRESQL_DATABASE} -c "UPDATE users SET email_verified = true;"`- );- return {- status: 200,- body: { message: 'OK' }- };-}diff --git a/src/routes/api/v1/services/deploy/plausible/index.ts b/src/routes/api/v1/services/deploy/plausible/index.tsdeleted file mode 100644index c67f0cb14a..0000000000--- a/src/routes/api/v1/services/deploy/plausible/index.ts+++ /dev/null@@ -1,187 +0,0 @@-import type { Request } from '@sveltejs/kit';-import generator from 'generate-password';-import { promises as fs } from 'fs';-import yaml from 'js-yaml';-import { docker } from '$lib/api/docker';-import { baseServiceConfiguration } from '$lib/api/applications/common';-import { cleanupTmp, execShellAsync } from '$lib/api/common';--export async function post(request: Request) {- const { email, userName, userPassword } = request.body;- let { baseURL } = request.body;- const traefikURL = baseURL;- baseURL = `https://${baseURL}`;- const deployId = 'plausible';- const workdir = '/tmp/plausible';- const secretKey = generator.generate({ length: 64, numbers: true, strict: true });- const generateEnvsPostgres = {- POSTGRESQL_PASSWORD: generator.generate({ length: 24, numbers: true, strict: true }),- POSTGRESQL_USERNAME: generator.generate({ length: 10, numbers: true, strict: true }),- POSTGRESQL_DATABASE: 'plausible'- };-- const secrets = [- { name: 'ADMIN_USER_EMAIL', value: email },- { name: 'ADMIN_USER_NAME', value: userName },- { name: 'ADMIN_USER_PWD', value: userPassword },- { name: 'BASE_URL', value: baseURL },- { name: 'SECRET_KEY_BASE', value: secretKey },- { name: 'DISABLE_AUTH', value: 'false' },- { name: 'DISABLE_REGISTRATION', value: 'true' },- {- name: 'DATABASE_URL',- value: `postgresql://${generateEnvsPostgres.POSTGRESQL_USERNAME}:${generateEnvsPostgres.POSTGRESQL_PASSWORD}@plausible_db:5432/${generateEnvsPostgres.POSTGRESQL_DATABASE}`- },- { name: 'CLICKHOUSE_DATABASE_URL', value: 'http://plausible_events_db:8123/plausible' }- ];-- const generateEnvsClickhouse = {};- for (const secret of secrets) generateEnvsClickhouse[secret.name] = secret.value;-- const clickhouseConfigXml = `- <yandex>- <logger>- <level>warning</level>- <console>true</console>- </logger>-- <!-- Stop all the unnecessary logging -->- <query_thread_log remove="remove"/>- <query_log remove="remove"/>- <text_log remove="remove"/>- <trace_log remove="remove"/>- <metric_log remove="remove"/>- <asynchronous_metric_log remove="remove"/>- </yandex>`;- const clickhouseUserConfigXml = `- <yandex>- <profiles>- <default>- <log_queries>0</log_queries>- <log_query_threads>0</log_query_threads>- </default>- </profiles>- </yandex>`;-- const clickhouseConfigs = [- {- source: 'plausible-clickhouse-user-config.xml',- target: '/etc/clickhouse-server/users.d/logging.xml'- },- {- source: 'plausible-clickhouse-config.xml',- target: '/etc/clickhouse-server/config.d/logging.xml'- },- { source: 'plausible-init.query', target: '/docker-entrypoint-initdb.d/init.query' },- { source: 'plausible-init-db.sh', target: '/docker-entrypoint-initdb.d/init-db.sh' }- ];-- const initQuery = 'CREATE DATABASE IF NOT EXISTS plausible;';- const initScript = 'clickhouse client --queries-file /docker-entrypoint-initdb.d/init.query';- await execShellAsync(`mkdir -p ${workdir}`);- await fs.writeFile(`${workdir}/clickhouse-config.xml`, clickhouseConfigXml);- await fs.writeFile(`${workdir}/clickhouse-user-config.xml`, clickhouseUserConfigXml);- await fs.writeFile(`${workdir}/init.query`, initQuery);- await fs.writeFile(`${workdir}/init-db.sh`, initScript);- const stack = {- version: '3.8',- services: {- [deployId]: {- image: 'plausible/analytics:latest',- command:- 'sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"',- networks: [`${docker.network}`],- volumes: [`${deployId}-postgres-data:/var/lib/postgresql/data`],- environment: generateEnvsClickhouse,- deploy: {- ...baseServiceConfiguration,- labels: [- 'managedBy=coolify',- 'type=service',- 'serviceName=plausible',- 'configuration=' +- JSON.stringify({- email,- userName,- userPassword,- baseURL,- secretKey,- generateEnvsPostgres,- generateEnvsClickhouse- }),- 'traefik.enable=true',- 'traefik.http.services.' + deployId + '.loadbalancer.server.port=8000',- 'traefik.http.routers.' + deployId + '.entrypoints=websecure',- 'traefik.http.routers.' +- deployId +- '.rule=Host(`' +- traefikURL +- '`) && PathPrefix(`/`)',- 'traefik.http.routers.' + deployId + '.tls.certresolver=letsencrypt',- 'traefik.http.routers.' + deployId + '.middlewares=global-compress'- ]- }- },- plausible_db: {- image: 'bitnami/postgresql:13.2.0',- networks: [`${docker.network}`],- environment: generateEnvsPostgres,- deploy: {- ...baseServiceConfiguration,- labels: ['managedBy=coolify', 'type=service', 'serviceName=plausible']- }- },- plausible_events_db: {- image: 'yandex/clickhouse-server:21.3.2.5',- networks: [`${docker.network}`],- volumes: [`${deployId}-clickhouse-data:/var/lib/clickhouse`],- ulimits: {- nofile: {- soft: 262144,- hard: 262144- }- },- configs: [...clickhouseConfigs],- deploy: {- ...baseServiceConfiguration,- labels: ['managedBy=coolify', 'type=service', 'serviceName=plausible']- }- }- },- networks: {- [`${docker.network}`]: {- external: true- }- },- volumes: {- [`${deployId}-clickhouse-data`]: {- external: true- },- [`${deployId}-postgres-data`]: {- external: true- }- },- configs: {- 'plausible-clickhouse-user-config.xml': {- file: `${workdir}/clickhouse-user-config.xml`- },- 'plausible-clickhouse-config.xml': {- file: `${workdir}/clickhouse-config.xml`- },- 'plausible-init.query': {- file: `${workdir}/init.query`- },- 'plausible-init-db.sh': {- file: `${workdir}/init-db.sh`- }- }- };- await fs.writeFile(`${workdir}/stack.yml`, yaml.dump(stack));- await execShellAsync('docker stack rm plausible');- await execShellAsync(`cat ${workdir}/stack.yml | docker stack deploy --prune -c - ${deployId}`);- cleanupTmp(workdir);- return {- status: 200,- body: { message: 'OK' }- };-}diff --git a/src/routes/api/v1/services/deploy/wordpress/index.ts b/src/routes/api/v1/services/deploy/wordpress/index.tsdeleted file mode 100644index d277026d4f..0000000000--- a/src/routes/api/v1/services/deploy/wordpress/index.ts+++ /dev/null@@ -1,170 +0,0 @@-import type { Request } from '@sveltejs/kit';-import yaml from 'js-yaml';-import generator from 'generate-password';-import { promises as fs } from 'fs';-import { docker } from '$lib/api/docker';-import { baseServiceConfiguration } from '$lib/api/applications/common';-import { cleanupTmp, execShellAsync } from '$lib/api/common';--export async function post(request: Request) {- let { baseURL, remoteDB, database, wordpressExtraConfiguration } = request.body;- const traefikURL = baseURL;- baseURL = `https://${baseURL}`;- const workdir = '/tmp/wordpress';- const deployId = `wp-${generator.generate({ length: 5, numbers: true, strict: true })}`;- const defaultDatabaseName = generator.generate({ length: 12, numbers: true, strict: true });- const defaultDatabaseHost = `${deployId}-mysql`;- const defaultDatabaseUser = generator.generate({ length: 12, numbers: true, strict: true });- const defaultDatabasePassword = generator.generate({ length: 24, numbers: true, strict: true });- const defaultDatabaseRootPassword = generator.generate({- length: 24,- numbers: true,- strict: true- });- const defaultDatabaseRootUser = generator.generate({ length: 12, numbers: true, strict: true });- let secrets = [- { name: 'WORDPRESS_DB_HOST', value: defaultDatabaseHost },- { name: 'WORDPRESS_DB_USER', value: defaultDatabaseUser },- { name: 'WORDPRESS_DB_PASSWORD', value: defaultDatabasePassword },- { name: 'WORDPRESS_DB_NAME', value: defaultDatabaseName },- { name: 'WORDPRESS_CONFIG_EXTRA', value: wordpressExtraConfiguration }- ];-- const generateEnvsMySQL = {- MYSQL_ROOT_PASSWORD: defaultDatabaseRootPassword,- MYSQL_ROOT_USER: defaultDatabaseRootUser,- MYSQL_USER: defaultDatabaseUser,- MYSQL_PASSWORD: defaultDatabasePassword,- MYSQL_DATABASE: defaultDatabaseName- };- const image = 'bitnami/mysql:8.0';- const volume = `${deployId}-mysql-data:/bitnami/mysql/data`;-- if (remoteDB) {- secrets = [- { name: 'WORDPRESS_DB_HOST', value: database.host },- { name: 'WORDPRESS_DB_USER', value: database.user },- { name: 'WORDPRESS_DB_PASSWORD', value: database.password },- { name: 'WORDPRESS_DB_NAME', value: database.name },- { name: 'WORDPRESS_TABLE_PREFIX', value: database.tablePrefix },- { name: 'WORDPRESS_CONFIG_EXTRA', value: wordpressExtraConfiguration }- ];- }-- const generateEnvsWordpress = {};- for (const secret of secrets) generateEnvsWordpress[secret.name] = secret.value;- let stack = {- version: '3.8',- services: {- [deployId]: {- image: 'wordpress',- networks: [`${docker.network}`],- environment: generateEnvsWordpress,- volumes: [`${deployId}-wordpress-data:/var/www/html`],- deploy: {- ...baseServiceConfiguration,- labels: [- 'managedBy=coolify',- 'type=service',- 'serviceName=' + deployId,- 'configuration=' +- JSON.stringify({- deployId,- baseURL,- generateEnvsWordpress- }),- 'traefik.enable=true',- 'traefik.http.services.' + deployId + '.loadbalancer.server.port=80',- 'traefik.http.routers.' + deployId + '.entrypoints=websecure',- 'traefik.http.routers.' +- deployId +- '.rule=Host(`' +- traefikURL +- '`) && PathPrefix(`/`)',- 'traefik.http.routers.' + deployId + '.tls.certresolver=letsencrypt',- 'traefik.http.routers.' + deployId + '.middlewares=global-compress'- ]- }- },- [`${deployId}-mysql`]: {- image,- networks: [`${docker.network}`],- environment: generateEnvsMySQL,- volumes: [volume],- deploy: {- ...baseServiceConfiguration,- labels: ['managedBy=coolify', 'type=service', 'serviceName=' + deployId]- }- }- },- networks: {- [`${docker.network}`]: {- external: true- }- },- volumes: {- [`${deployId}-wordpress-data`]: {- external: true- },- [`${deployId}-mysql-data`]: {- external: true- }- }- };- if (remoteDB) {- stack = {- version: '3.8',- services: {- [deployId]: {- image: 'wordpress',- networks: [`${docker.network}`],- environment: generateEnvsWordpress,- volumes: [`${deployId}-wordpress-data:/var/www/html`],- deploy: {- ...baseServiceConfiguration,- labels: [- 'managedBy=coolify',- 'type=service',- 'serviceName=' + deployId,- 'configuration=' +- JSON.stringify({- deployId,- baseURL,- generateEnvsWordpress- }),- 'traefik.enable=true',- 'traefik.http.services.' + deployId + '.loadbalancer.server.port=80',- 'traefik.http.routers.' + deployId + '.entrypoints=websecure',- 'traefik.http.routers.' +- deployId +- '.rule=Host(`' +- traefikURL +- '`) && PathPrefix(`/`)',- 'traefik.http.routers.' + deployId + '.tls.certresolver=letsencrypt',- 'traefik.http.routers.' + deployId + '.middlewares=global-compress'- ]- }- }- },- networks: {- [`${docker.network}`]: {- external: true- }- },- volumes: {- [`${deployId}-wordpress-data`]: {- external: true- }- }- };- }- await execShellAsync(`mkdir -p ${workdir}`);- await fs.writeFile(`${workdir}/stack.yml`, yaml.dump(stack));- await execShellAsync(`docker stack rm ${deployId}`);- await execShellAsync(`cat ${workdir}/stack.yml | docker stack deploy --prune -c - ${deployId}`);- cleanupTmp(workdir);- return {- status: 200,- body: { message: 'OK' }- };-}diff --git a/src/routes/api/v1/settings/index.ts b/src/routes/api/v1/settings/index.tsdeleted file mode 100644index a3d57be634..0000000000--- a/src/routes/api/v1/settings/index.ts+++ /dev/null@@ -1,52 +0,0 @@-import { saveServerLog } from '$lib/api/applications/logging';-import Settings from '$models/Settings';-import type { Request } from '@sveltejs/kit';-const applicationName = 'coolify';--export async function get(request: Request) {- try {- const settings = await Settings.findOne({ applicationName }).select('-_id -__v');- const payload = {- applicationName,- allowRegistration: false,- ...settings._doc- };- return {- status: 200,- body: {- ...payload- }- };- } catch (error) {- await saveServerLog(error);- return {- status: 500,- body: {- error: error.message || error- }- };- }-}-export async function post(request: Request) {- try {- const settings = await Settings.findOneAndUpdate(- { applicationName },- { applicationName, ...request.body },- { upsert: true, new: true }- ).select('-_id -__v');- return {- status: 201,- body: {- ...settings._doc- }- };- } catch (error) {- await saveServerLog(error);- return {- status: 500,- body: {- error: error.message || error- }- };- }-}diff --git a/src/routes/api/v1/upgrade/index.ts b/src/routes/api/v1/upgrade/index.tsdeleted file mode 100644index 8caa19c78a..0000000000--- a/src/routes/api/v1/upgrade/index.ts+++ /dev/null@@ -1,19 +0,0 @@-import { saveServerLog } from '$lib/api/applications/logging';-import { execShellAsync } from '$lib/api/common';-import type { Request } from '@sveltejs/kit';--export async function get(request: Request) {- const upgradeP1 = await execShellAsync(- 'bash -c "$(curl -fsSL https://get.coollabs.io/coolify/upgrade-p1.sh)"'- );- await saveServerLog({ message: upgradeP1, type: 'UPGRADE-P-1' });- execShellAsync(- 'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -u root coolify bash -c "$(curl -fsSL https://get.coollabs.io/coolify/upgrade-p2.sh)"'- );- return {- status: 200,- body: {- message: "I'm trying, okay?"- }- };-}diff --git a/src/routes/api/v1/webhooks/deploy.ts b/src/routes/api/v1/webhooks/deploy.tsdeleted file mode 100644index 21aaf7469e..0000000000--- a/src/routes/api/v1/webhooks/deploy.ts+++ /dev/null@@ -1,230 +0,0 @@-import type { Request } from '@sveltejs/kit';-import crypto from 'crypto';-import Deployment from '$models/Deployment';-import { docker } from '$lib/api/docker';-import { precheckDeployment, setDefaultConfiguration } from '$lib/api/applications/configuration';-import cloneRepository from '$lib/api/applications/cloneRepository';-import { cleanupTmp, execShellAsync } from '$lib/api/common';-import queueAndBuild from '$lib/api/applications/queueAndBuild';-import Configuration from '$models/Configuration';-import ApplicationLog from '$models/ApplicationLog';-import { cleanupStuckedDeploymentsInDB } from '$lib/api/applications/cleanup';-export async function post(request: Request) {- let configuration;- const allowedGithubEvents = ['push', 'pull_request'];- const allowedPRActions = ['opened', 'reopened', 'synchronize', 'closed'];- const githubEvent = request.headers['x-github-event'];- const { GITHUP_APP_WEBHOOK_SECRET } = process.env;- const hmac = crypto.createHmac('sha256', GITHUP_APP_WEBHOOK_SECRET);- const digest = Buffer.from(- 'sha256=' + hmac.update(JSON.stringify(request.body)).digest('hex'),- 'utf8'- );- const checksum = Buffer.from(request.headers['x-hub-signature-256'], 'utf8');- if (checksum.length !== digest.length || !crypto.timingSafeEqual(digest, checksum)) {- return {- status: 500,- body: {- error: 'Invalid request.'- }- };- }-- if (!allowedGithubEvents.includes(githubEvent)) {- return {- status: 500,- body: {- error: 'Event not allowed.'- }- };- }-- // TODO: Monorepo support here. Find all configurations by id and update all deployments! Tough!- try {- const applications = await Configuration.find({- 'repository.id': request.body.repository.id- }).select('-_id -__v -createdAt -updatedAt');- if (githubEvent === 'push') {- configuration = applications.find((r) => {- if (request.body.ref.startsWith('refs')) {- if (r.repository.branch === request.body.ref.split('/')[2]) {- return r;- }- }- return null;- });- } else if (githubEvent === 'pull_request') {- if (!allowedPRActions.includes(request.body.action)) {- return {- status: 500,- body: {- error: 'PR action is not allowed.'- }- };- }- configuration = applications.find(- (r) => r.repository.branch === request.body['pull_request'].base.ref- );- if (configuration) {- if (!configuration.general.isPreviewDeploymentEnabled) {- return {- status: 500,- body: {- error: 'PR deployments are not enabled.'- }- };- }- configuration.general.pullRequest = request.body.number;- }- }- if (!configuration) {- return {- status: 500,- body: {- error: 'No configuration found.'- }- };- }- configuration = setDefaultConfiguration(configuration);- const { id, organization, name, branch } = configuration.repository;- const { domain } = configuration.publish;- const { deployId, nickname, pullRequest } = configuration.general;-- if (request.body.action === 'closed') {- const deploys = await Deployment.find({ organization, branch, name, domain });- for (const deploy of deploys) {- await ApplicationLog.deleteMany({ deployId: deploy.deployId });- await Deployment.deleteMany({ deployId: deploy.deployId });- }- await Configuration.findOneAndRemove({- 'repository.id': id,- 'repository.organization': organization,- 'repository.name': name,- 'repository.branch': branch,- 'general.pullRequest': pullRequest- });- await execShellAsync(`docker stack rm ${configuration.build.container.name}`);- return {- status: 200,- body: {- success: true,- message: 'Removed'- }- };- }- await cloneRepository(configuration);- const { foundService, imageChanged, configChanged, forceUpdate } = await precheckDeployment(- configuration- );- if (foundService && !forceUpdate && !imageChanged && !configChanged) {- cleanupTmp(configuration.general.workdir);- return {- status: 200,- body: {- success: false,- message: 'Nothing changed, no need to redeploy.'- }- };- }- const alreadyQueued = await Deployment.find({- repoId: id,- branch: branch,- organization: organization,- name: name,- domain: domain,- progress: { $in: ['queued', 'inprogress'] }- });- if (alreadyQueued.length > 0) {- return {- status: 200,- body: {- success: false,- message: 'Already in the queue.'- }- };- }-- await new Deployment({- repoId: id,- branch,- deployId,- domain,- organization,- name,- nickname- }).save();-- if (githubEvent === 'pull_request') {- await Configuration.findOneAndUpdate(- {- 'repository.id': id,- 'repository.organization': organization,- 'repository.name': name,- 'repository.branch': branch,- 'general.pullRequest': pullRequest- },- { ...configuration },- { upsert: true, new: true }- );- } else {- await Configuration.findOneAndUpdate(- {- 'repository.id': id,- 'repository.organization': organization,- 'repository.name': name,- 'repository.branch': branch,- 'general.pullRequest': { $in: [null, 0] }- },- { ...configuration },- { upsert: true, new: true }- );- }-- queueAndBuild(configuration, imageChanged);- return {- status: 201,- body: {- message: 'Deployment queued.',- nickname: configuration.general.nickname,- name: configuration.build.container.name,- deployId: configuration.general.deployId- }- };- } catch (error) {- console.log(error);- // console.log(configuration)- if (configuration) {- cleanupTmp(configuration.general.workdir);- await Deployment.findOneAndUpdate(- {- repoId: configuration.repository.id,- branch: configuration.repository.branch,- organization: configuration.repository.organization,- name: configuration.repository.name,- domain: configuration.publish.domain- },- {- repoId: configuration.repository.id,- branch: configuration.repository.branch,- organization: configuration.repository.organization,- name: configuration.repository.name,- domain: configuration.publish.domain,- progress: 'failed'- }- );- }-- return {- status: 500,- body: {- error: error.message || error- }- };- } finally {- try {- await cleanupStuckedDeploymentsInDB();- } catch (error) {- console.log(error);- }- }-}diff --git a/src/routes/application/[nickname]/configuration.svelte b/src/routes/application/[nickname]/configuration.sveltedeleted file mode 100644index 9e90cf014d..0000000000--- a/src/routes/application/[nickname]/configuration.svelte+++ /dev/null@@ -1,6 +0,0 @@-<script>- import Configuration from '$components/Application/Configuration.svelte';--</script>--<Configuration />diff --git a/src/routes/application/[nickname]/logs/[deployId].svelte b/src/routes/application/[nickname]/logs/[deployId].sveltedeleted file mode 100644index 00594c93eb..0000000000--- a/src/routes/application/[nickname]/logs/[deployId].svelte+++ /dev/null@@ -1,83 +0,0 @@-<script>- import { onDestroy, onMount } from 'svelte';- import { fade } from 'svelte/transition';- import Loading from '$components/Loading.svelte';- import { request } from '$lib/request';- import { page, session } from '$app/stores';- import { goto } from '$app/navigation';- import { browser } from '$app/env';- import { application } from '$store';-- let loadLogsInterval;- let logs = [];-- onMount(() => {- loadLogsInterval = setInterval(() => {- loadLogs();- }, 500);- });-- async function loadLogs() {- try {- const { events, progress } = await request(- `/api/v1/application/deploy/logs/${$page.params.deployId}`,- $session- );- logs = [...events];- if (progress === 'done' || progress === 'failed') {- clearInterval(loadLogsInterval);- }- } catch (error) {- browser && goto('/dashboard/applications', { replaceState: true });- }- }- onDestroy(() => {- clearInterval(loadLogsInterval);- });--</script>--<div- class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center"- in:fade={{ duration: 100 }}->- <div>Deployment log</div>- <a- target="_blank"- class="icon mx-2"- href={'https://' + $application.publish.domain + $application.publish.path}- >- <svg- xmlns="http://www.w3.org/2000/svg"- class="h-6 w-6"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"- />- </svg></a- >-</div>-{#await loadLogs()}- <Loading />-{:then}- <div class="text-center px-6" in:fade={{ duration: 100 }}>- <div in:fade={{ duration: 100 }}>- <pre- class="leading-4 text-left text-sm font-semibold tracking-tighter rounded-lg bg-black p-6 whitespace-pre-wrap">- {#if logs.length > 0}- {#each logs as log}- {log + '\n'}- {/each}- {:else}- It's starting soon.- {/if}- </pre>- </div>- </div>-{/await}diff --git a/src/routes/application/[nickname]/logs/index.svelte b/src/routes/application/[nickname]/logs/index.sveltedeleted file mode 100644index 4fa0717c60..0000000000--- a/src/routes/application/[nickname]/logs/index.svelte+++ /dev/null@@ -1,137 +0,0 @@-<script>- import { application, dateOptions } from '$store';- import { fade } from 'svelte/transition';-- import { onDestroy, onMount } from 'svelte';-- import Loading from '$components/Loading.svelte';- import { request } from '$lib/request';- import { session } from '$app/stores';- import { goto } from '$app/navigation';-- let loadDeploymentsInterval = null;- let loadLogsInterval = null;- let deployments = [];- let logs = [];- let page = 1;-- onMount(async () => {- loadApplicationLogs();- loadLogsInterval = setInterval(() => {- loadApplicationLogs();- }, 3000);- loadDeploymentsInterval = setInterval(() => {- loadDeploymentLogs();- }, 1000);- });- onDestroy(() => {- clearInterval(loadDeploymentsInterval);- clearInterval(loadLogsInterval);- });- async function loadMoreDeploymentLogs() {- page = page + 1;- await loadDeploymentLogs();- }- async function loadDeploymentLogs() {- deployments = (- await request(- `/api/v1/application/deploy/logs?repoId=${$application.repository.id}&branch=${$application.repository.branch}&page=${page}`,- $session- )- ).logs;- }- async function loadApplicationLogs() {- logs = (- await request(`/api/v1/application/logs?name=${$application.build.container.name}`, $session)- ).logs;- }-</script>--<div- class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center"- in:fade={{ duration: 100 }}->- <div>Logs</div>-</div>-{#await loadDeploymentLogs()}- <Loading />-{:then}- <div class="text-center px-6" in:fade={{ duration: 100 }}>- <div class="flex pt-2 space-x-4 w-full">- <div class="w-full">- <div class="font-bold text-left pb-2 text-xl">Application logs</div>- {#if logs.length === 0}- <div class="text-xs font-semibold tracking-tighter">Waiting for the logs...</div>- {:else}- <pre- class="leading-4 text-left text-sm font-semibold tracking-tighter rounded-lg bg-black p-6 whitespace-pre-wrap w-full">- {#each logs as log}- {log + '\n'}- {/each}- </pre>- {/if}- </div>- <div>- <div class="font-bold text-left pb-2 text-xl w-300">Deployment logs</div>- {#if deployments.length > 0}- <div class="space-y-2">- {#each deployments as deployment}- <div- in:fade={{ duration: 100 }}- class="flex space-x-4 text-md py-4 hover:shadow mx-auto cursor-pointer transition-all duration-100 border-l-4 border-transparent rounded hover:bg-warmGray-700"- class:hover:border-green-500={deployment.progress === 'done'}- class:border-yellow-300={deployment.progress !== 'done' &&- deployment.progress !== 'failed'}- class:bg-warmGray-800={deployment.progress !== 'done' &&- deployment.progress !== 'failed'}- class:hover:border-red-500={deployment.progress === 'failed'}- on:click={() => goto(`./logs/${deployment.deployId}`)}- >- <div class="flex space-x-2 px-2">- <div class="font-bold text-sm flex justify-center items-center">- {deployment.branch}- </div>- <div class="font-bold text-xs flex justify-center items-center text-warmGray-500">{deployment.isPr ? 'PR' : ''}</div>- </div>- <div class="flex-1" />- <div class="px-3 w-48">- <div- class="text-xs"- title={new Intl.DateTimeFormat('default', dateOptions).format(- new Date(deployment.createdAt)- )}- >- {deployment.since}- </div>- {#if deployment.progress === 'done'}- <div class="text-xs">- Deployed in <span class="font-bold">{deployment.took}s</span>- </div>- {:else if deployment.progress === 'failed'}- <div class="text-xs text-red-500">Failed</div>- {:else}- <div class="text-xs">Deploying...</div>- {/if}- </div>- </div>- {/each}- </div>- <button- class="text-xs bg-green-600 hover:bg-green-500 p-1 rounded text-white px-2 font-medium my-6"- on:click={loadMoreDeploymentLogs}>Show more</button- >- {:else}- <div class="text-left text-sm tracking-tight">No deployments found</div>- {/if}- </div>- </div>- </div>-{:catch}- <div class="text-center font-bold tracking-tight text-xl">No logs found</div>-{/await}--<style lang="postcss">- .w-300 {- width: 300px !important;- }-</style>diff --git a/src/routes/application/__layout.svelte b/src/routes/application/__layout.sveltedeleted file mode 100644index 3db4343b64..0000000000--- a/src/routes/application/__layout.svelte+++ /dev/null@@ -1,137 +0,0 @@-<script context="module" lang="ts">- /**- * @type {import('@sveltejs/kit').Load}- */- export async function load(session) {- if (!browser) {- if (!import.meta.env.VITE_GITHUB_APP_CLIENTID) {- return {- status: 302,- redirect: '/dashboard/services'- };- }- }- return {};- }-</script>--<script>- import { application, initialApplication, initConf, dashboard, prApplication, originalDomain } from '$store';- import { onDestroy } from 'svelte';- import Loading from '$components/Loading.svelte';- import Navbar from '$components/Application/Navbar.svelte';- import { page, session } from '$app/stores';- import { goto } from '$app/navigation';- import { browser } from '$app/env';- import { request } from '$lib/request';-- $application.general.nickname = $page.params.nickname;- async function setConfiguration() {- try {- const { configuration } = await request(`/api/v1/application/config`, $session, {- body: {- nickname: $application.general.nickname- }- });- $prApplication = configuration.filter((c) => c.general.pullRequest !== 0);- $application = configuration.find((c) => c.general.pullRequest === 0);- if (!$application) browser && goto('/dashboard/applications');- } catch (error) {- browser && goto('/dashboard/applications');- }- }- async function loadConfiguration() {- if ($page.path !== '/application/new') {- if (!$dashboard) {- await setConfiguration();- } else {- const found = $dashboard.applications.deployed.find((app) => {- const { domain } = app.configuration.publish;- if (domain === $application.publish.domain) {- return app;- }- });- if (found) {- $application = { ...found.configuration };- $initConf = JSON.parse(JSON.stringify($application));- } else {- await setConfiguration();- }- }- $originalDomain = $application.publish.domain-- } else {- $application = JSON.parse(JSON.stringify(initialApplication));- }- }-- onDestroy(() => {- $application = JSON.parse(JSON.stringify(initialApplication));- });-</script>--{#await loadConfiguration()}- <Loading />-{:then}- <Navbar />- <div class="text-white">- {#if $page.path.endsWith('configuration')}- <div class="min-h-full text-white">- <div class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center">- {$application.publish.domain- ? `${$application.publish.domain}${- $application.publish.path !== '/' ? $application.publish.path : ''- }`- : 'example.com'}- <a- target="_blank"- class="icon mx-2"- href={'https://' + $application.publish.domain + $application.publish.path}- >- <svg- xmlns="http://www.w3.org/2000/svg"- class="h-6 w-6"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"- />- </svg></a- >-- <a- target="_blank"- class="icon"- href={`https://github.com/${$application.repository.organization}/${$application.repository.name}`}- >- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- ><path- d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"- /></svg- ></a- >- </div>- </div>- {:else if $page.path === '/application/new'}- <div class="min-h-full text-white">- <div class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center">- New Application- </div>- </div>- {/if}- <slot />- </div>-{/await}diff --git a/src/routes/application/new.svelte b/src/routes/application/new.sveltedeleted file mode 100644index 21d65c11e2..0000000000--- a/src/routes/application/new.svelte+++ /dev/null@@ -1,5 +0,0 @@-<script>- import Configuration from '$components/Application/Configuration.svelte';-</script>--<Configuration />diff --git a/src/routes/applications/[id]/__layout.svelte b/src/routes/applications/[id]/__layout.sveltenew file mode 100644index 0000000000..72f99c69a5--- /dev/null+++ b/src/routes/applications/[id]/__layout.svelte@@ -0,0 +1,376 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ function checkConfiguration(application): string {+ let configurationPhase = null;+ if (!application.gitSourceId) {+ configurationPhase = 'source';+ } else if (!application.repository && !application.branch) {+ configurationPhase = 'repository';+ } else if (!application.destinationDockerId) {+ configurationPhase = 'destination';+ } else if (!application.buildPack) {+ configurationPhase = 'buildpack';+ }+ return configurationPhase;+ }+ export const load: Load = async ({ fetch, url, params }) => {+ const endpoint = `/applications/${params.id}.json`;+ const res = await fetch(endpoint);+ if (res.ok) {+ const { application, githubToken, ghToken, isRunning, appId } = await res.json();+ if (!application || Object.entries(application).length === 0) {+ return {+ status: 302,+ redirect: '/applications'+ };+ }+ const configurationPhase = checkConfiguration(application);+ if (+ configurationPhase &&+ url.pathname !== `/applications/${params.id}/configuration/${configurationPhase}`+ ) {+ return {+ status: 302,+ redirect: `/applications/${params.id}/configuration/${configurationPhase}`+ };+ }++ return {+ props: {+ application,+ isRunning+ },+ stuff: {+ isRunning,+ ghToken,+ githubToken,+ application,+ appId+ }+ };+ }++ return {+ status: 302,+ redirect: '/applications'+ };+ };+</script>++<script lang="ts">+ export let application;+ export let isRunning;+ import { page, session } from '$app/stores';+ import { errorNotification } from '$lib/form';+ import DeleteIcon from '$lib/components/DeleteIcon.svelte';+ import Loading from '$lib/components/Loading.svelte';+ import { del, post } from '$lib/api';+ import { goto } from '$app/navigation';++ let loading = false;+ const { id } = $page.params;++ async function handleDeploySubmit() {+ try {+ const { buildId } = await post(`/applications/${id}/deploy.json`, { ...application });+ return await goto(`/applications/${id}/logs/build?buildId=${buildId}`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }++ async function deleteApplication(name) {+ const sure = confirm(`Are you sure you would like to delete '${name}'?`);+ if (sure) {+ loading = true;+ try {+ await del(`/applications/${id}/delete.json`, { id });+ return await goto(`/applications`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ }+ async function stopApplication() {+ try {+ loading = true;+ await post(`/applications/${id}/stop.json`, {});+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+</script>++<nav class="nav-side">+ {#if loading}+ <Loading fullscreen cover />+ {:else}+ {#if application.fqdn && application.gitSource && application.repository && application.destinationDocker && application.buildPack}+ {#if isRunning}+ <button+ on:click={stopApplication}+ title="Stop application"+ type="submit"+ disabled={!$session.isAdmin}+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-green-600 hover:text-white"+ data-tooltip={$session.isAdmin+ ? 'Stop application'+ : 'You do not have permission to stop the application.'}+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="w-6 h-6"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <rect x="6" y="5" width="4" height="14" rx="1" />+ <rect x="14" y="5" width="4" height="14" rx="1" />+ </svg>+ </button>+ <form on:submit|preventDefault={handleDeploySubmit}>+ <button+ title="Rebuild application"+ type="submit"+ disabled={!$session.isAdmin}+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-green-600 hover:text-white"+ data-tooltip={$session.isAdmin+ ? 'Rebuild application'+ : 'You do not have permission to rebuild application.'}+ >+ <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="M16.3 5h.7a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h5l-2.82 -2.82m0 5.64l2.82 -2.82"+ transform="rotate(-45 12 12)"+ />+ </svg>+ </button>+ </form>+ {:else}+ <form on:submit|preventDefault={handleDeploySubmit}>+ <button+ title="Build and start application"+ type="submit"+ disabled={!$session.isAdmin}+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-green-600 hover:text-white"+ data-tooltip={$session.isAdmin+ ? 'Build and start application'+ : 'You do not have permission to Build and start application.'}+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="w-6 h-6"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M7 4v16l13 -8z" />+ </svg>+ </button>+ </form>+ {/if}++ <div class="border border-stone-700 h-8" />+ <a+ href="/applications/{id}"+ sveltekit:prefetch+ class="hover:text-yellow-500 rounded"+ class:text-yellow-500={$page.url.pathname === `/applications/${id}`}+ class:bg-coolgray-500={$page.url.pathname === `/applications/${id}`}+ >+ <button+ title="Configurations"+ 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="/applications/{id}/secrets"+ sveltekit:prefetch+ class="hover:text-pink-500 rounded"+ class:text-pink-500={$page.url.pathname === `/applications/${id}/secrets`}+ class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/secrets`}+ >+ <button+ title="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+ >+ <a+ href="/applications/{id}/previews"+ sveltekit:prefetch+ class="hover:text-orange-500 rounded"+ class:text-orange-500={$page.url.pathname === `/applications/${id}/previews`}+ class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/previews`}+ >+ <button+ title="Previews"+ class="icons bg-transparent tooltip-bottom text-sm disabled:text-red-500"+ data-tooltip="Previews"+ >+ <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" />+ <circle cx="7" cy="18" r="2" />+ <circle cx="7" cy="6" r="2" />+ <circle cx="17" cy="12" r="2" />+ <line x1="7" y1="8" x2="7" y2="16" />+ <path d="M7 8a4 4 0 0 0 4 4h4" />+ </svg></button+ ></a+ >+ <div class="border border-stone-700 h-8" />+ <a+ href="/applications/{id}/logs"+ sveltekit:prefetch+ class="hover:text-sky-500 rounded"+ class:text-sky-500={$page.url.pathname === `/applications/${id}/logs`}+ class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/logs`}+ >+ <button+ title="Application Logs"+ class="icons bg-transparent tooltip-bottom text-sm disabled:text-red-500 "+ data-tooltip="Application Logs"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-6 w-6"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />+ <path d="M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />+ <line x1="3" y1="6" x2="3" y2="19" />+ <line x1="12" y1="6" x2="12" y2="19" />+ <line x1="21" y1="6" x2="21" y2="19" />+ </svg>+ </button></a+ >+ <a+ href="/applications/{id}/logs/build"+ sveltekit:prefetch+ class="hover:text-red-500 rounded"+ class:text-red-500={$page.url.pathname === `/applications/${id}/logs/build`}+ class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/logs/build`}+ >+ <button+ title="Build Logs"+ class="icons bg-transparent tooltip-bottom text-sm disabled:text-red-500 "+ data-tooltip="Build Logs"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-6 w-6"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <circle cx="19" cy="13" r="2" />+ <circle cx="4" cy="17" r="2" />+ <circle cx="13" cy="17" r="2" />+ <line x1="13" y1="19" x2="4" y2="19" />+ <line x1="4" y1="15" x2="13" y2="15" />+ <path d="M8 12v-5h2a3 3 0 0 1 3 3v5" />+ <path d="M5 15v-2a1 1 0 0 1 1 -1h7" />+ <path d="M19 11v-7l-6 7" />+ </svg>+ </button></a+ >+ <div class="border border-stone-700 h-8" />+ {/if}++ <button+ on:click={() => deleteApplication(application.name)}+ title="Delete application"+ type="submit"+ disabled={!$session.isAdmin}+ class:hover:text-red-500={$session.isAdmin}+ class="icons bg-transparent tooltip-bottom text-sm"+ data-tooltip={$session.isAdmin+ ? 'Delete application'+ : 'You do not have permission to delete this application'}+ >+ <DeleteIcon />+ </button>+ {/if}+</nav>+<slot />diff --git a/src/routes/applications/[id]/check.json.ts b/src/routes/applications/[id]/check.json.tsnew file mode 100644index 0000000000..d8ed3fa093--- /dev/null+++ b/src/routes/applications/[id]/check.json.ts@@ -0,0 +1,28 @@+import { asyncExecShell, getDomain, getEngine, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } 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 { fqdn } = await event.request.json();+ fqdn = fqdn.toLowerCase();++ try {+ const found = await db.isDomainConfigured({ id, fqdn });+ if (found) {+ throw {+ message: `Domain ${getDomain(fqdn)} is already configured.`+ };+ }+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/configuration/_BuildPack.svelte b/src/routes/applications/[id]/configuration/_BuildPack.sveltenew file mode 100644index 0000000000..df04789c18--- /dev/null+++ b/src/routes/applications/[id]/configuration/_BuildPack.svelte@@ -0,0 +1,44 @@+<script lang="ts">+ import { goto } from '$app/navigation';++ import { page } from '$app/stores';+ import { post } from '$lib/api';+ import { errorNotification } from '$lib/form';++ const { id } = $page.params;+ const from = $page.url.searchParams.get('from');++ export let buildPack;+ export let foundConfig;+ export let scanning;++ async function handleSubmit(name) {+ try {+ const tempBuildPack = JSON.parse(JSON.stringify(buildPack));+ delete tempBuildPack.name;+ delete tempBuildPack.fancyName;+ delete tempBuildPack.color;+ delete tempBuildPack.hoverColor;++ if (foundConfig.buildPack !== name) {+ await post(`/applications/${id}.json`, { ...tempBuildPack });+ }+ await post(`/applications/${id}/configuration/buildpack.json`, { buildPack: name });+ return await goto(from || `/applications/${id}`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<form on:submit|preventDefault={() => handleSubmit(buildPack.name)}>+ <button+ type="submit"+ class="box-selection relative flex text-xl font-bold {buildPack.hoverColor} {foundConfig?.name ===+ buildPack.name && buildPack.color}"+ ><span>{buildPack.fancyName}</span>+ {#if !scanning && foundConfig?.name === buildPack.name}+ <span class="absolute bottom-0 pb-2 text-xs">Choose this one...</span>+ {/if}+ </button>+</form>diff --git a/src/routes/applications/[id]/configuration/_GithubRepositories.svelte b/src/routes/applications/[id]/configuration/_GithubRepositories.sveltenew file mode 100644index 0000000000..61ef2d6651--- /dev/null+++ b/src/routes/applications/[id]/configuration/_GithubRepositories.svelte@@ -0,0 +1,170 @@+<script lang="ts">+ import { goto } from '$app/navigation';++ export let githubToken;+ export let application;++ import { page } from '$app/stores';+ import { get, post } from '$lib/api';+ import { getGithubToken } from '$lib/components/common';+ import { enhance, errorNotification } from '$lib/form';+ import { onMount } from 'svelte';++ const { id } = $page.params;+ const from = $page.url.searchParams.get('from');+ const to = $page.url.searchParams.get('to');++ let htmlUrl = application.gitSource.htmlUrl;+ let apiUrl = application.gitSource.apiUrl;++ let loading = {+ repositories: true,+ branches: false+ };+ let repositories = [];+ let branches = [];++ let selected = {+ projectId: undefined,+ repository: undefined,+ branch: undefined+ };+ let showSave = false;+ let token = null;++ async function loadRepositoriesByPage(page = 0) {+ try {+ return await get(`${apiUrl}/installation/repositories?per_page=100&page=${page}`, {+ Authorization: `token ${token}`+ });+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function loadRepositories() {+ token = await getGithubToken({ apiUrl, githubToken, application });+ let page = 1;+ let reposCount = 0;+ const loadedRepos = await loadRepositoriesByPage();+ repositories = repositories.concat(loadedRepos.repositories);+ reposCount = loadedRepos.total_count;+ if (reposCount > repositories.length) {+ while (reposCount > repositories.length) {+ page = page + 1;+ const repos = await loadRepositoriesByPage(page);+ repositories = repositories.concat(repos.repositories);+ }+ }+ loading.repositories = false;+ }+ async function loadBranches() {+ loading.branches = true;+ selected.branch = undefined;+ selected.projectId = repositories.find((repo) => repo.full_name === selected.repository).id;+ try {+ branches = await get(`${apiUrl}/repos/${selected.repository}/branches`, {+ Authorization: `token ${token}`+ });+ return;+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading.branches = false;+ }+ }+ async function isBranchAlreadyUsed() {+ try {+ return await get(+ `/applications/${id}/configuration/repository.json?repository=${selected.repository}&branch=${selected.branch}`+ );+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ showSave = true;+ }+ }++ onMount(async () => {+ await loadRepositories();+ });+ async function handleSubmit() {+ try {+ await post(`/applications/${id}/configuration/repository.json`, { ...selected });+ if (to) {+ return await goto(`${to}?from=${from}`);+ }+ return await goto(from || `/applications/${id}/configuration/destination`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++{#if repositories.length === 0 && loading.repositories === false}+ <div class="flex-col text-center">+ <div class="pb-4">No repositories configured for your Git Application.</div>+ <a href={`/sources/${application.gitSource.id}`}><button>Configure it now</button></a>+ </div>+{:else}+ <form on:submit|preventDefault={handleSubmit}>+ <div>+ {#if loading.repositories}+ <select name="repository" disabled class="w-96">+ <option selected value="">Loading repositories...</option>+ </select>+ {:else}+ <select+ name="repository"+ class="w-96"+ bind:value={selected.repository}+ on:change={loadBranches}+ >+ <option value="" disabled selected>Please select a repository</option>+ {#each repositories as repository}+ <option value={repository.full_name}>{repository.name}</option>+ {/each}+ </select>+ {/if}+ <input class="hidden" bind:value={selected.projectId} name="projectId" />+ {#if loading.branches}+ <select name="branch" disabled class="w-96">+ <option selected value="">Loading branches...</option>+ </select>+ {:else}+ <select+ name="branch"+ class="w-96"+ disabled={!selected.repository}+ bind:value={selected.branch}+ on:change={isBranchAlreadyUsed}+ >+ {#if !selected.repository}+ <option value="" disabled selected>Select a repository first</option>+ {:else}+ <option value="" disabled selected>Please select a branch</option>+ {/if}++ {#each branches as branch}+ <option value={branch.name}>{branch.name}</option>+ {/each}+ </select>+ {/if}+ </div>+ <div class="pt-5 flex-col flex justify-center items-center space-y-4">+ <button+ class="w-40"+ type="submit"+ disabled={!showSave}+ class:bg-orange-600={showSave}+ class:hover:bg-orange-500={showSave}>Save</button+ >+ <!-- <button class="w-40"+ ><a+ class="no-underline"+ href="{apiUrl}/apps/{application.gitSource.githubApp.name}/installations/new"+ >Modify Repositories</a+ ></button+ > -->+ </div>+ </form>+{/if}diff --git a/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte b/src/routes/applications/[id]/configuration/_GitlabRepositories.sveltenew file mode 100644index 0000000000..a97291debc--- /dev/null+++ b/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte@@ -0,0 +1,334 @@+<script lang="ts">+ export let application;+ export let appId;+ import { page, session } from '$app/stores';+ import { onMount } from 'svelte';+ import { errorNotification } from '$lib/form';+ import { dev } from '$app/env';+ import cuid from 'cuid';+ import { goto } from '$app/navigation';+ import { del, get, post, put } from '$lib/api';++ const { id } = $page.params;+ const from = $page.url.searchParams.get('from');++ const updateDeployKeyIdUrl = `/applications/${id}/configuration/deploykey.json`;++ let loading = {+ base: true,+ projects: false,+ branches: false,+ save: false+ };++ let htmlUrl = application.gitSource.htmlUrl;+ let apiUrl = application.gitSource.apiUrl;++ let username = null;+ let groups = [];+ let projects = [];+ let branches = [];+ let showSave = false;++ let selected = {+ group: undefined,+ project: undefined,+ branch: undefined+ };+ onMount(async () => {+ if (!$session.gitlabToken) {+ getGitlabToken();+ } else {+ loading.base = true;+ try {+ const user = await get(`${apiUrl}/v4/user`, {+ Authorization: `Bearer ${$session.gitlabToken}`+ });+ username = user.username;+ } catch (error) {+ return getGitlabToken();+ }+ try {+ groups = await get(`${apiUrl}/v4/groups?per_page=5000`, {+ Authorization: `Bearer ${$session.gitlabToken}`+ });+ } catch (error) {+ errorNotification(error);+ throw new Error(error);+ } finally {+ loading.base = false;+ }+ }+ });++ function getGitlabToken() {+ const left = screen.width / 2 - 1020 / 2;+ const top = screen.height / 2 - 618 / 2;+ const newWindow = open(+ `${htmlUrl}/oauth/authorize?client_id=${application.gitSource.gitlabApp.appId}&redirect_uri=${window.location.origin}/webhooks/gitlab&response_type=code&scope=api+email+read_repository&state=${$page.params.id}`,+ 'GitLab',+ 'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' ++ top ++ ', left=' ++ left ++ ', toolbar=0, menubar=0, status=0'+ );+ const timer = setInterval(() => {+ if (newWindow?.closed) {+ clearInterval(timer);+ window.location.reload();+ }+ }, 100);+ }++ async function loadProjects() {+ loading.projects = true;+ if (username === selected.group.name) {+ try {+ projects = await get(+ `${apiUrl}/v4/users/${selected.group.name}/projects?min_access_level=40&page=1&per_page=25&archived=false`,+ {+ Authorization: `Bearer ${$session.gitlabToken}`+ }+ );+ } catch (error) {+ errorNotification(error);+ throw new Error(error);+ } finally {+ loading.projects = false;+ }+ } else {+ try {+ projects = await get(+ `${apiUrl}/v4/groups/${selected.group.id}/projects?page=1&per_page=25&archived=false`,+ {+ Authorization: `Bearer ${$session.gitlabToken}`+ }+ );+ } catch (error) {+ errorNotification(error);+ throw new Error(error);+ } finally {+ loading.projects = false;+ }+ }+ }++ async function loadBranches() {+ loading.branches = true;+ try {+ branches = await get(+ `${apiUrl}/v4/projects/${selected.project.id}/repository/branches?per_page=100&page=1`,+ {+ Authorization: `Bearer ${$session.gitlabToken}`+ }+ );+ } catch (error) {+ errorNotification(error);+ throw new Error(error);+ } finally {+ loading.branches = false;+ }+ }++ async function isBranchAlreadyUsed() {+ const url = `/applications/${id}/configuration/repository.json?repository=${selected.project.path_with_namespace}&branch=${selected.branch.name}`;++ try {+ await get(url);+ showSave = true;+ } catch (error) {+ showSave = false;+ return errorNotification('Branch already configured');+ }+ }+ // async function saveDeployKey(deployKeyId: number) {+ // try {+ // await post(updateDeployKeyIdUrl, { deployKeyId });+ // } catch (error) {+ // errorNotification(error);+ // throw new Error(error);+ // }+ // }+ async function checkSSHKey(sshkeyUrl) {+ try {+ return await post(sshkeyUrl, {});+ } catch (error) {+ errorNotification(error);+ throw new Error(error);+ }+ }+ async function setWebhook(url, webhookToken) {+ const host = dev+ ? 'https://webhook.site/0e5beb2c-4e9b-40e2-a89e-32295e570c21'+ : `${window.location.origin}/webhooks/gitlab/events`;+ try {+ await post(+ url,+ {+ id: selected.project.id,+ url: host,+ token: webhookToken,+ push_events: true,+ enable_ssl_verification: true,+ merge_requests_events: true+ },+ {+ Authorization: `Bearer ${$session.gitlabToken}`+ }+ );+ } catch (error) {+ errorNotification(error);+ throw error;+ }+ }+ async function save() {+ loading.save = true;+ let privateSshKey = application.gitSource.gitlabApp.privateSshKey;+ let publicSshKey = application.gitSource.gitlabApp.publicSshKey;++ const deployKeyUrl = `${apiUrl}/v4/projects/${selected.project.id}/deploy_keys`;+ const sshkeyUrl = `/applications/${id}/configuration/sshkey.json`;+ const webhookUrl = `${apiUrl}/v4/projects/${selected.project.id}/hooks`;+ const webhookToken = cuid();++ try {+ if (!privateSshKey || !publicSshKey) {+ const { publicKey } = await checkSSHKey(sshkeyUrl);+ publicSshKey = publicKey;+ }+ const deployKeys = await get(deployKeyUrl, {+ Authorization: `Bearer ${$session.gitlabToken}`+ });+ const deployKeyFound = deployKeys.filter((dk) => dk.title === `${appId}-coolify-deploy-key`);+ if (deployKeyFound.length > 0) {+ for (const deployKey of deployKeyFound) {+ console.log(`${deployKeyUrl}/${deployKey.id}`);+ await del(+ `${deployKeyUrl}/${deployKey.id}`,+ {},+ {+ Authorization: `Bearer ${$session.gitlabToken}`+ }+ );+ }+ }+ const { id } = await post(+ deployKeyUrl,+ {+ title: `${appId}-coolify-deploy-key`,+ key: publicSshKey,+ can_push: false+ },+ {+ Authorization: `Bearer ${$session.gitlabToken}`+ }+ );+ await post(updateDeployKeyIdUrl, { deployKeyId: id });+ } catch (error) {+ console.log(error);+ throw new Error(error);+ }++ try {+ await setWebhook(webhookUrl, webhookToken);+ } catch (err) {+ console.log(err);+ if (!dev) throw new Error(err);+ }++ const url = `/applications/${id}/configuration/repository.json`;+ try {+ await post(url, {+ repository: `${selected.group.full_path}/${selected.project.name}`,+ branch: selected.branch.name,+ projectId: selected.project.id,+ webhookToken+ });+ return await goto(from || `/applications/${id}/configuration/buildpack`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function handleSubmit() {+ try {+ await post(`/applications/{id}/configuration/repository.json`, { ...selected });+ return await goto(from || `/applications/${id}/configuration/destination`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<form on:submit={handleSubmit}>+ <div class="flex flex-col space-y-2 px-4 xl:flex-row xl:space-y-0 xl:space-x-2 ">+ {#if loading.base}+ <select name="group" disabled class="w-96">+ <option selected value="">Loading groups...</option>+ </select>+ {:else}+ <select name="group" class="w-96" bind:value={selected.group} on:change={loadProjects}>+ <option value="" disabled selected>Please select a group</option>+ {#each groups as group}+ <option value={group}>{group.full_name}</option>+ {/each}+ </select>+ {/if}+ {#if loading.projects}+ <select name="project" disabled class="w-96">+ <option selected value="">Loading projects...</option>+ </select>+ {:else if !loading.projects && projects.length > 0}+ <select+ name="project"+ class="w-96"+ bind:value={selected.project}+ on:change={loadBranches}+ disabled={!selected.group}+ >+ <option value="" disabled selected>Please select a project</option>+ {#each projects as project}+ <option value={project}>{project.name}</option>+ {/each}+ </select>+ {:else}+ <select name="project" disabled class="w-96">+ <option disabled selected value="">No projects found</option>+ </select>+ {/if}++ {#if loading.branches}+ <select name="branch" disabled class="w-96">+ <option selected value="">Loading branches...</option>+ </select>+ {:else if !loading.branches && branches.length > 0}+ <select+ name="branch"+ class="w-96"+ bind:value={selected.branch}+ on:change={isBranchAlreadyUsed}+ disabled={!selected.project}+ >+ <option value="" disabled selected>Please select a branch</option>+ {#each branches as branch}+ <option value={branch}>{branch.name}</option>+ {/each}+ </select>+ {:else}+ <select name="project" disabled class="w-96">+ <option disabled selected value="">No branches found</option>+ </select>+ {/if}+ </div>+ <div class="flex flex-col items-center justify-center space-y-4 pt-5">+ <button+ on:click|preventDefault={save}+ class="w-40"+ type="submit"+ disabled={!showSave || loading.save}+ class:bg-orange-600={showSave && !loading.save}+ class:hover:bg-orange-500={showSave && !loading.save}+ >{loading.save ? 'Saving...' : 'Save'}</button+ >+ </div>+</form>diff --git a/src/routes/applications/[id]/configuration/buildpack.json.ts b/src/routes/applications/[id]/configuration/buildpack.json.tsnew file mode 100644index 0000000000..0e798e600d--- /dev/null+++ b/src/routes/applications/[id]/configuration/buildpack.json.ts@@ -0,0 +1,41 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';+import { PrismaErrorHandler } from '$lib/database';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ try {+ const application = await db.getApplication({ id, teamId });+ return {+ status: 200,+ body: {+ type: application.gitSource.type,+ projectId: application.projectId,+ repository: application.repository,+ branch: application.branch,+ apiUrl: application.gitSource.apiUrl+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { buildPack } = await event.request.json();++ try {+ await db.configureBuildPack({ id, buildPack });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/configuration/buildpack.svelte b/src/routes/applications/[id]/configuration/buildpack.sveltenew file mode 100644index 0000000000..b517689a6e--- /dev/null+++ b/src/routes/applications/[id]/configuration/buildpack.svelte@@ -0,0 +1,186 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, url, stuff }) => {+ const { application, ghToken } = stuff;+ if (application?.buildPack && !url.searchParams.get('from')) {+ return {+ status: 302,+ redirect: `/applications/${params.id}`+ };+ }+ const endpoint = `/applications/${params.id}/configuration/buildpack.json`;+ const res = await fetch(endpoint);+ if (res.ok) {+ return {+ props: {+ ...(await res.json()),+ application,+ ghToken+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import { onMount } from 'svelte';++ import { buildPacks, scanningTemplates } from '$lib/components/templates';+ import BuildPack from './_BuildPack.svelte';+ import { page, session } from '$app/stores';+ import { get } from '$lib/api';+ import { errorNotification } from '$lib/form';++ let scanning = true;+ let foundConfig = null;++ export let apiUrl;+ export let projectId;+ export let repository;+ export let branch;+ export let ghToken;+ export let type;+ export let application;++ function checkPackageJSONContents({ key, json }) {+ return json?.dependencies?.hasOwnProperty(key) || json?.devDependencies?.hasOwnProperty(key);+ }+ function checkTemplates({ json }) {+ for (const [key, value] of Object.entries(scanningTemplates)) {+ if (checkPackageJSONContents({ key, json })) {+ return buildPacks.find((bp) => bp.name === value.buildPack);+ }+ }+ }+ async function scanRepository() {+ try {+ if (type === 'gitlab') {+ const files = await get(`${apiUrl}/v4/projects/${projectId}/repository/tree`, {+ Authorization: `Bearer ${$session.gitlabToken}`+ });+ const packageJson = files.find(+ (file) => file.name === 'package.json' && file.type === 'blob'+ );+ const dockerfile = files.find((file) => file.name === 'Dockerfile' && file.type === 'blob');+ const cargoToml = files.find((file) => file.name === 'Cargo.toml' && file.type === 'blob');+ const requirementsTxt = files.find(+ (file) => file.name === 'requirements.txt' && file.type === 'blob'+ );+ const indexHtml = files.find((file) => file.name === 'index.html' && file.type === 'blob');+ const indexPHP = files.find((file) => file.name === 'index.php' && file.type === 'blob');+ if (dockerfile) {+ foundConfig.buildPack = 'docker';+ } else if (packageJson) {+ const path = packageJson.path;+ const data = await get(+ `${apiUrl}/v4/projects/${projectId}/repository/files/${path}/raw?ref=${branch}`,+ {+ Authorization: `Bearer ${$session.gitlabToken}`+ }+ );+ const json = JSON.parse(data) || {};+ foundConfig = checkTemplates({ json });+ } else if (cargoToml) {+ foundConfig = buildPacks.find((bp) => bp.name === 'rust');+ } else if (requirementsTxt) {+ foundConfig = buildPacks.find((bp) => bp.name === 'python');+ } else if (indexHtml) {+ foundConfig = buildPacks.find((bp) => bp.name === 'static');+ } else if (indexPHP) {+ foundConfig = buildPacks.find((bp) => bp.name === 'php');+ }+ } else if (type === 'github') {+ const files = await get(`${apiUrl}/repos/${repository}/contents?ref=${branch}`, {+ Authorization: `Bearer ${ghToken}`,+ Accept: 'application/vnd.github.v2.json'+ });+ const packageJson = files.find(+ (file) => file.name === 'package.json' && file.type === 'file'+ );+ const dockerfile = files.find((file) => file.name === 'Dockerfile' && file.type === 'file');+ const cargoToml = files.find((file) => file.name === 'Cargo.toml' && file.type === 'file');+ const requirementsTxt = files.find(+ (file) => file.name === 'requirements.txt' && file.type === 'file'+ );+ const indexHtml = files.find((file) => file.name === 'index.html' && file.type === 'file');+ const indexPHP = files.find((file) => file.name === 'index.php' && file.type === 'file');+ if (dockerfile) {+ foundConfig.buildPack = 'docker';+ } else if (packageJson) {+ const data = await get(`${packageJson.git_url}`, {+ Authorization: `Bearer ${ghToken}`,+ Accept: 'application/vnd.github.v2.raw'+ });+ const json = JSON.parse(data) || {};+ foundConfig = checkTemplates({ json });+ } else if (cargoToml) {+ foundConfig = buildPacks.find((bp) => bp.name === 'rust');+ } else if (requirementsTxt) {+ foundConfig = buildPacks.find((bp) => bp.name === 'python');+ } else if (indexHtml) {+ foundConfig = buildPacks.find((bp) => bp.name === 'static');+ } else if (indexPHP) {+ foundConfig = buildPacks.find((bp) => bp.name === 'php');+ }+ }+ } catch (error) {+ if (+ error.error === 'invalid_token' ||+ error.error_description ===+ 'Token is expired. You can either do re-authorization or token refresh.' ||+ error.message === '401 Unauthorized'+ ) {+ if (application.gitSource.gitlabAppId) {+ let htmlUrl = application.gitSource.htmlUrl;+ const left = screen.width / 2 - 1020 / 2;+ const top = screen.height / 2 - 618 / 2;+ const newWindow = open(+ `${htmlUrl}/oauth/authorize?client_id=${application.gitSource.gitlabApp.appId}&redirect_uri=${window.location.origin}/webhooks/gitlab&response_type=code&scope=api+email+read_repository&state=${$page.params.id}`,+ 'GitLab',+ 'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' ++ top ++ ', left=' ++ left ++ ', toolbar=0, menubar=0, status=0'+ );+ const timer = setInterval(() => {+ if (newWindow?.closed) {+ clearInterval(timer);+ window.location.reload();+ }+ }, 100);+ }+ }+ return errorNotification(error);+ } finally {+ if (!foundConfig) foundConfig = buildPacks.find((bp) => bp.name === 'node');+ scanning = false;+ }+ }+ onMount(async () => {+ await scanRepository();+ });+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Configure Build Pack</div>+</div>++{#if scanning}+ <div class="flex justify-center space-x-1 p-6 font-bold">+ <div class="text-xl tracking-tight">Scanning repository to suggest a build pack for you...</div>+ </div>+{:else}+ <div class="max-w-7xl mx-auto flex flex-wrap justify-center">+ {#each buildPacks as buildPack}+ <div class="p-2">+ <BuildPack {buildPack} {scanning} bind:foundConfig />+ </div>+ {/each}+ </div>+{/if}diff --git a/src/routes/applications/[id]/configuration/deploykey.json.ts b/src/routes/applications/[id]/configuration/deploykey.json.tsnew file mode 100644index 0000000000..a0a69915ae--- /dev/null+++ b/src/routes/applications/[id]/configuration/deploykey.json.ts@@ -0,0 +1,17 @@+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { id } = event.params;+ let { deployKeyId } = await event.request.json();++ deployKeyId = Number(deployKeyId);++ try {+ await db.updateDeployKey({ id, deployKeyId });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/configuration/destination.json.ts b/src/routes/applications/[id]/configuration/destination.json.tsnew file mode 100644index 0000000000..ef73883db1--- /dev/null+++ b/src/routes/applications/[id]/configuration/destination.json.ts@@ -0,0 +1,19 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { destinationId } = await event.request.json();++ try {+ await db.configureDestinationForApplication({ id, destinationId });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/configuration/destination.svelte b/src/routes/applications/[id]/configuration/destination.sveltenew file mode 100644index 0000000000..2c796b5edd--- /dev/null+++ b/src/routes/applications/[id]/configuration/destination.svelte@@ -0,0 +1,91 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, url, stuff }) => {+ const { application } = stuff;+ if (application?.destinationDockerId && !url.searchParams.get('from')) {+ return {+ status: 302,+ redirect: `/applications/${params.id}`+ };+ }+ const endpoint = `/destinations.json`;+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import type Prisma from '@prisma/client';++ import { page } from '$app/stores';+ import { errorNotification } from '$lib/form';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';++ const { id } = $page.params;+ const from = $page.url.searchParams.get('from');++ export let destinations: Prisma.DestinationDocker[];++ async function handleSubmit(destinationId) {+ try {+ await post(`/applications/${id}/configuration/destination.json`, { destinationId });+ return await goto(from || `/applications/${id}/configuration/buildpack`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Configure Destination</div>+</div>+<div class="flex justify-center">+ {#if !destinations || destinations.length === 0}+ <div class="flex-col">+ <div class="pb-2">No configurable Destination found</div>+ <div class="flex justify-center">+ <a href="/new/destination" sveltekit:prefetch class="add-icon bg-sky-600 hover:bg-sky-500">+ <svg+ class="w-6"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ ><path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 6v6m0 0v6m0-6h6m-6 0H6"+ /></svg+ >+ </a>+ </div>+ </div>+ {:else}+ <div class="flex flex-wrap justify-center">+ {#each destinations as destination}+ <div class="p-2">+ <form on:submit|preventDefault={() => handleSubmit(destination.id)}>+ <button type="submit" class="box-selection hover:bg-sky-700 font-bold">+ <div class="font-bold text-xl text-center truncate">{destination.name}</div>+ <div class="text-center truncate">{destination.network}</div>+ </button>+ </form>+ </div>+ {/each}+ </div>+ {/if}+</div>diff --git a/src/routes/applications/[id]/configuration/repository.json.ts b/src/routes/applications/[id]/configuration/repository.json.tsnew file mode 100644index 0000000000..8e1c3aa167--- /dev/null+++ b/src/routes/applications/[id]/configuration/repository.json.ts@@ -0,0 +1,47 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ const repository = event.url.searchParams.get('repository')?.toLocaleLowerCase() || undefined;+ const branch = event.url.searchParams.get('branch')?.toLocaleLowerCase() || undefined;++ try {+ const found = await db.isBranchAlreadyUsed({ repository, branch, id });+ if (found) {+ throw {+ error: `Branch ${branch} is already used by another application`+ };+ }+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ let { repository, branch, projectId, webhookToken } = await event.request.json();++ repository = repository.toLowerCase();+ branch = branch.toLowerCase();+ projectId = Number(projectId);++ try {+ await db.configureGitRepository({ id, repository, branch, projectId, webhookToken });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/configuration/repository.svelte b/src/routes/applications/[id]/configuration/repository.sveltenew file mode 100644index 0000000000..416292e99c--- /dev/null+++ b/src/routes/applications/[id]/configuration/repository.svelte@@ -0,0 +1,38 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ params, url, stuff }) => {+ const { application, githubToken, appId } = stuff;+ if (application?.branch && application?.repository && !url.searchParams.get('from')) {+ return {+ status: 302,+ redirect: `/applications/${params.id}`+ };+ }+ return {+ props: {+ githubToken,+ application,+ appId+ }+ };+ };+</script>++<script lang="ts">+ export let application;+ export let githubToken;+ export let appId;+ import GithubRepositories from './_GithubRepositories.svelte';+ import GitlabRepositories from './_GitlabRepositories.svelte';+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Select a Repository / Project</div>+</div>+<div class="flex flex-wrap justify-center">+ {#if application.gitSource.type === 'github'}+ <GithubRepositories {application} {githubToken} />+ {:else if application.gitSource.type === 'gitlab'}+ <GitlabRepositories {application} {appId} />+ {/if}+</div>diff --git a/src/routes/applications/[id]/configuration/source.json.ts b/src/routes/applications/[id]/configuration/source.json.tsnew file mode 100644index 0000000000..089dc3063a--- /dev/null+++ b/src/routes/applications/[id]/configuration/source.json.ts@@ -0,0 +1,18 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { gitSourceId } = await event.request.json();+ try {+ await db.configureGitsource({ id, gitSourceId });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/configuration/source.svelte b/src/routes/applications/[id]/configuration/source.sveltenew file mode 100644index 0000000000..00ba5a1b58--- /dev/null+++ b/src/routes/applications/[id]/configuration/source.svelte@@ -0,0 +1,109 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, url, stuff }) => {+ const { application } = stuff;+ if (application?.gitSourceId && !url.searchParams.get('from')) {+ return {+ status: 302,+ redirect: `/applications/${params.id}`+ };+ }+ const endpoint = `/sources.json`;+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import type Prisma from '@prisma/client';++ import { page } from '$app/stores';+ import { enhance, errorNotification } from '$lib/form';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';++ const { id } = $page.params;+ const from = $page.url.searchParams.get('from');++ export let sources: Prisma.GitSource[] & {+ gitlabApp: Prisma.GitlabApp;+ githubApp: Prisma.GithubApp;+ };+ sources = sources.filter(+ (source) =>+ (source.type === 'github' && source.githubAppId && source.githubApp.installationId) ||+ (source.type === 'gitlab' && source.gitlabAppId)+ );+ async function handleSubmit(gitSourceId) {+ try {+ await post(`/applications/${id}/configuration/source.json`, { gitSourceId });+ return await goto(from || `/applications/${id}/configuration/repository`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Select a Git Source</div>+</div>+<div class="flex justify-center">+ {#if !sources || sources.length === 0}+ <div class="flex-col">+ <div class="pb-2">No configurable Git Source found</div>+ <div class="flex justify-center">+ <a href="/new/source" sveltekit:prefetch class="add-icon bg-orange-600 hover:bg-orange-500">+ <svg+ class="w-6"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ ><path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 6v6m0 0v6m0-6h6m-6 0H6"+ /></svg+ >+ </a>+ </div>+ </div>+ {:else}+ <div class="flex flex-wrap justify-center">+ {#each sources as source}+ <div class="p-2">+ <form on:submit|preventDefault={() => handleSubmit(source.id)}>+ <button+ disabled={source.gitlabApp && !source.gitlabAppId}+ type="submit"+ class="disabled:opacity-95 bg-coolgray-200 disabled:text-white box-selection hover:bg-orange-700 group"+ class:border-red-500={source.gitlabApp && !source.gitlabAppId}+ class:border-0={source.gitlabApp && !source.gitlabAppId}+ class:border-l-4={source.gitlabApp && !source.gitlabAppId}+ >+ <div class="font-bold text-xl text-center truncate">{source.name}</div>+ {#if source.gitlabApp && !source.gitlabAppId}+ <div class="font-bold text-center truncate text-red-500 group-hover:text-white">+ Configuration missing+ </div>+ {/if}+ </button>+ </form>+ </div>+ {/each}+ </div>+ {/if}+</div>diff --git a/src/routes/applications/[id]/configuration/sshkey.json.ts b/src/routes/applications/[id]/configuration/sshkey.json.tsnew file mode 100644index 0000000000..4514634f54--- /dev/null+++ b/src/routes/applications/[id]/configuration/sshkey.json.ts@@ -0,0 +1,20 @@+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { id } = event.params;+ try {+ return await db.getSshKey({ id });+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};+export const post: RequestHandler = async (event) => {+ const { id } = event.params;+ try {+ return await db.generateSshKey({ id });+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/delete.json.ts b/src/routes/applications/[id]/delete.json.tsnew file mode 100644index 0000000000..1f3730fc5a--- /dev/null+++ b/src/routes/applications/[id]/delete.json.ts@@ -0,0 +1,19 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const del: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ try {+ await db.removeApplication({ id, teamId });+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/deploy.json.ts b/src/routes/applications/[id]/deploy.json.tsnew file mode 100644index 0000000000..b6b1a0a953--- /dev/null+++ b/src/routes/applications/[id]/deploy.json.ts@@ -0,0 +1,42 @@+import * as db from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';+import cuid from 'cuid';+import crypto from 'crypto';+import { buildQueue } from '$lib/queues';+import { getUserDetails } from '$lib/common';+import { PrismaErrorHandler } from '$lib/database';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ try {+ const buildId = cuid();+ const applicationFound = await db.getApplication({ id, teamId });+ if (!applicationFound.configHash) {+ const configHash = crypto+ .createHash('sha256')+ .update(+ JSON.stringify({+ buildPack: applicationFound.buildPack,+ port: applicationFound.port,+ installCommand: applicationFound.installCommand,+ buildCommand: applicationFound.buildCommand,+ startCommand: applicationFound.startCommand+ })+ )+ .digest('hex');+ await db.prisma.application.update({ where: { id }, data: { configHash } });+ }+ await buildQueue.add(buildId, { build_id: buildId, type: 'manual', ...applicationFound });+ return {+ status: 200,+ body: {+ buildId+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/index.json.ts b/src/routes/applications/[id]/index.json.tsnew file mode 100644index 0000000000..eedd89d9f9--- /dev/null+++ b/src/routes/applications/[id]/index.json.ts@@ -0,0 +1,87 @@+import { getTeam, getUserDetails } from '$lib/common';+import { getGithubToken } from '$lib/components/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { checkContainer } from '$lib/haproxy';+import type { RequestHandler } from '@sveltejs/kit';+import jsonwebtoken from 'jsonwebtoken';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const appId = process.env['COOLIFY_APP_ID'];+ let githubToken = null;+ let ghToken = null;+ let isRunning = false;++ const { id } = event.params;+ try {+ const application = await db.getApplication({ id, teamId });+ const { gitSource } = application;+ if (gitSource?.type === 'github' && gitSource?.githubApp) {+ const payload = {+ iat: Math.round(new Date().getTime() / 1000),+ exp: Math.round(new Date().getTime() / 1000 + 60),+ iss: gitSource.githubApp.appId+ };+ githubToken = jsonwebtoken.sign(payload, gitSource.githubApp.privateKey, {+ algorithm: 'RS256'+ });+ ghToken = await getGithubToken({ apiUrl: gitSource.apiUrl, application, githubToken });+ }+ if (application.destinationDockerId) {+ isRunning = await checkContainer(application.destinationDocker.engine, id);+ }+ return {+ body: {+ isRunning,+ ghToken,+ githubToken,+ application,+ appId+ }+ };+ } catch (error) {+ console.log(error);+ return PrismaErrorHandler(error);+ }+};++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ let {+ name,+ buildPack,+ fqdn,+ port,+ installCommand,+ buildCommand,+ startCommand,+ baseDirectory,+ publishDirectory+ } = await event.request.json();++ if (port) port = Number(port);++ try {+ await db.configureApplication({+ id,+ buildPack,+ name,+ fqdn,+ port,+ installCommand,+ buildCommand,+ startCommand,+ baseDirectory,+ publishDirectory+ });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/index.svelte b/src/routes/applications/[id]/index.sveltenew file mode 100644index 0000000000..91bc1c69f1--- /dev/null+++ b/src/routes/applications/[id]/index.svelte@@ -0,0 +1,390 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, stuff }) => {+ if (stuff?.application?.id) {+ return {+ props: {+ application: stuff.application,+ isRunning: stuff.isRunning+ }+ };+ }+ const endpoint = `/applications/${params.id}.json`;+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${endpoint}`)+ };+ };+</script>++<script lang="ts">+ export let application: Prisma.Application & {+ settings: Prisma.ApplicationSettings;+ gitlabApp: Prisma.GitlabApp;+ gitSource: Prisma.GitSource;+ destinationDocker: Prisma.DestinationDocker;+ };+ export let isRunning;+ import { page, session } from '$app/stores';+ import { errorNotification } from '$lib/form';+ import { onMount } from 'svelte';++ import Explainer from '$lib/components/Explainer.svelte';+ import Setting from '$lib/components/Setting.svelte';+ import type Prisma from '@prisma/client';+ import { getDomain, notNodeDeployments, staticDeployments } from '$lib/components/common';+ import { toast } from '@zerodevx/svelte-toast';+ import { post } from '$lib/api';+ const { id } = $page.params;++ let domainEl: HTMLInputElement;++ let loading = false;+ let debug = application.settings.debug;+ let previews = application.settings.previews;++ onMount(() => {+ domainEl.focus();+ });++ async function changeSettings(name) {+ if (name === 'debug') {+ debug = !debug;+ }+ if (name === 'previews') {+ previews = !previews;+ }+ try {+ await post(`/applications/${id}/settings.json`, { previews, debug });+ return toast.push('Settings saved.');+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function handleSubmit() {+ loading = true;+ try {+ await post(`/applications/${id}/check.json`, { fqdn: application.fqdn });+ await post(`/applications/${id}.json`, { ...application });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+</script>++<div class="flex items-center space-x-2 p-5 px-6 font-bold">+ <div class="md:max-w-64 truncate text-base tracking-tight md:text-2xl lg:block">+ {application.name}+ </div>+ {#if application.fqdn}+ <a+ href={application.fqdn}+ target="_blank"+ class="icons tooltip-bottom flex items-center bg-transparent text-sm"+ ><svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-6 w-6"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M11 7h-5a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-5" />+ <line x1="10" y1="14" x2="20" y2="4" />+ <polyline points="15 4 20 4 20 9" />+ </svg></a+ >+ {/if}+ <a+ href="{application.gitSource.htmlUrl}/{application.repository}/tree/{application.branch}"+ target="_blank"+ class="w-10"+ >+ {#if application.gitSource?.type === 'gitlab'}+ <svg viewBox="0 0 128 128" class="icons">+ <path+ fill="#FC6D26"+ d="M126.615 72.31l-7.034-21.647L105.64 7.76c-.716-2.206-3.84-2.206-4.556 0l-13.94 42.903H40.856L26.916 7.76c-.717-2.206-3.84-2.206-4.557 0L8.42 50.664 1.385 72.31a4.792 4.792 0 001.74 5.358L64 121.894l60.874-44.227a4.793 4.793 0 001.74-5.357"+ /><path fill="#E24329" d="M64 121.894l23.144-71.23H40.856L64 121.893z" /><path+ fill="#FC6D26"+ d="M64 121.894l-23.144-71.23H8.42L64 121.893z"+ /><path+ fill="#FCA326"+ d="M8.42 50.663L1.384 72.31a4.79 4.79 0 001.74 5.357L64 121.894 8.42 50.664z"+ /><path+ fill="#E24329"+ d="M8.42 50.663h32.436L26.916 7.76c-.717-2.206-3.84-2.206-4.557 0L8.42 50.664z"+ /><path fill="#FC6D26" d="M64 121.894l23.144-71.23h32.437L64 121.893z" /><path+ fill="#FCA326"+ d="M119.58 50.663l7.035 21.647a4.79 4.79 0 01-1.74 5.357L64 121.894l55.58-71.23z"+ /><path+ fill="#E24329"+ d="M119.58 50.663H87.145l13.94-42.902c.717-2.206 3.84-2.206 4.557 0l13.94 42.903z"+ />+ </svg>+ {:else if application.gitSource?.type === 'github'}+ <svg viewBox="0 0 128 128" class="icons">+ <g fill="#ffffff"+ ><path+ fill-rule="evenodd"+ clip-rule="evenodd"+ d="M64 5.103c-33.347 0-60.388 27.035-60.388 60.388 0 26.682 17.303 49.317 41.297 57.303 3.017.56 4.125-1.31 4.125-2.905 0-1.44-.056-6.197-.082-11.243-16.8 3.653-20.345-7.125-20.345-7.125-2.747-6.98-6.705-8.836-6.705-8.836-5.48-3.748.413-3.67.413-3.67 6.063.425 9.257 6.223 9.257 6.223 5.386 9.23 14.127 6.562 17.573 5.02.542-3.903 2.107-6.568 3.834-8.076-13.413-1.525-27.514-6.704-27.514-29.843 0-6.593 2.36-11.98 6.223-16.21-.628-1.52-2.695-7.662.584-15.98 0 0 5.07-1.623 16.61 6.19C53.7 35 58.867 34.327 64 34.304c5.13.023 10.3.694 15.127 2.033 11.526-7.813 16.59-6.19 16.59-6.19 3.287 8.317 1.22 14.46.593 15.98 3.872 4.23 6.215 9.617 6.215 16.21 0 23.194-14.127 28.3-27.574 29.796 2.167 1.874 4.097 5.55 4.097 11.183 0 8.08-.07 14.583-.07 16.572 0 1.607 1.088 3.49 4.148 2.897 23.98-7.994 41.263-30.622 41.263-57.294C124.388 32.14 97.35 5.104 64 5.104z"+ /><path+ d="M26.484 91.806c-.133.3-.605.39-1.035.185-.44-.196-.685-.605-.543-.906.13-.31.603-.395 1.04-.188.44.197.69.61.537.91zm2.446 2.729c-.287.267-.85.143-1.232-.28-.396-.42-.47-.983-.177-1.254.298-.266.844-.14 1.24.28.394.426.472.984.17 1.255zM31.312 98.012c-.37.258-.976.017-1.35-.52-.37-.538-.37-1.183.01-1.44.373-.258.97-.025 1.35.507.368.545.368 1.19-.01 1.452zm3.261 3.361c-.33.365-1.036.267-1.552-.23-.527-.487-.674-1.18-.343-1.544.336-.366 1.045-.264 1.564.23.527.486.686 1.18.333 1.543zm4.5 1.951c-.147.473-.825.688-1.51.486-.683-.207-1.13-.76-.99-1.238.14-.477.823-.7 1.512-.485.683.206 1.13.756.988 1.237zm4.943.361c.017.498-.563.91-1.28.92-.723.017-1.308-.387-1.315-.877 0-.503.568-.91 1.29-.924.717-.013 1.306.387 1.306.88zm4.598-.782c.086.485-.413.984-1.126 1.117-.7.13-1.35-.172-1.44-.653-.086-.498.422-.997 1.122-1.126.714-.123 1.354.17 1.444.663zm0 0"+ /></g+ >+ </svg>+ {/if}+ </a>+</div>++<div class="mx-auto max-w-4xl px-6">+ <!-- svelte-ignore missing-declaration -->+ <form on:submit|preventDefault={handleSubmit} class="py-4">+ <div class="flex space-x-1 pb-5 font-bold">+ <div class="title">General</div>+ {#if $session.isAdmin}+ <button+ type="submit"+ class:bg-green-600={!loading}+ class:hover:bg-green-500={!loading}+ disabled={loading}>{loading ? 'Saving...' : 'Save'}</button+ >+ {/if}+ </div>+ <div class="grid grid-flow-row gap-2 px-10">+ <div class="mt-2 grid grid-cols-3 items-center">+ <label for="name">Name</label>+ <div class="col-span-2 ">+ <input+ readonly={!$session.isAdmin}+ name="name"+ id="name"+ bind:value={application.name}+ required+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="gitSource">Git Source</label>+ <div class="col-span-2">+ <a+ href={$session.isAdmin+ ? `/applications/${id}/configuration/source?from=/applications/${id}`+ : ''}+ class="no-underline"+ ><input+ value={application.gitSource.name}+ id="gitSource"+ disabled+ class="cursor-pointer bg-coolgray-200 hover:bg-coolgray-500"+ /></a+ >+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="repository">Git Repository</label>+ <div class="col-span-2">+ <a+ href={$session.isAdmin+ ? `/applications/${id}/configuration/repository?from=/applications/${id}&to=/applications/${id}/configuration/buildpack`+ : ''}+ class="no-underline"+ ><input+ value="{application.repository}/{application.branch}"+ id="repository"+ disabled+ class="cursor-pointer bg-coolgray-200 hover:bg-coolgray-500"+ /></a+ >+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="buildPack">Build Pack</label>+ <div class="col-span-2">+ <a+ href={$session.isAdmin+ ? `/applications/${id}/configuration/buildpack?from=/applications/${id}`+ : ''}+ class="no-underline "+ >+ <input+ value={application.buildPack}+ id="buildPack"+ disabled+ class="cursor-pointer bg-coolgray-200 hover:bg-coolgray-500"+ /></a+ >+ </div>+ </div>+ <div class="grid grid-cols-3 items-center pb-8">+ <label for="destination">Destination</label>+ <div class="col-span-2">+ <div class="no-underline">+ <input+ value={application.destinationDocker.name}+ id="destination"+ disabled+ class="bg-transparent "+ />+ </div>+ </div>+ </div>+ </div>+ <div class="flex space-x-1 py-5 font-bold">+ <div class="title">Application</div>+ </div>+ <div class="grid grid-flow-row gap-2 px-10">+ <div class="grid grid-cols-3">+ <label for="fqdn" class="pt-2">Domain (FQDN)</label>+ <div class="col-span-2">+ <input+ readonly={!$session.isAdmin || isRunning}+ disabled={!$session.isAdmin || isRunning}+ bind:this={domainEl}+ name="fqdn"+ id="fqdn"+ bind:value={application.fqdn}+ pattern="^https?://([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{'{'}2,{'}'}$"+ placeholder="eg: https://coollabs.io"+ required+ />+ <Explainer+ text="If you specify <span class='text-green-600 font-bold'>https</span>, the application will be accessible only over https. SSL certificate will be generated for you.<br>To modify the domain, you must first stop the application."+ />+ </div>+ </div>++ {#if !staticDeployments.includes(application.buildPack)}+ <div class="grid grid-cols-3 items-center">+ <label for="port">Port</label>+ <div class="col-span-2">+ <input+ readonly={!$session.isAdmin}+ name="port"+ id="port"+ bind:value={application.port}+ placeholder="default: 3000"+ />+ </div>+ </div>+ {/if}+ {#if !notNodeDeployments.includes(application.buildPack)}+ <div class="grid grid-cols-3 items-center">+ <label for="installCommand">Install Command</label>+ <div class="col-span-2">+ <input+ readonly={!$session.isAdmin}+ name="installCommand"+ id="installCommand"+ bind:value={application.installCommand}+ placeholder="default: yarn install"+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="buildCommand">Build Command</label>+ <div class="col-span-2">+ <input+ readonly={!$session.isAdmin}+ name="buildCommand"+ id="buildCommand"+ bind:value={application.buildCommand}+ placeholder="default: yarn build"+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="startCommand" class="">Start Command</label>+ <div class="col-span-2">+ <input+ readonly={!$session.isAdmin}+ name="startCommand"+ id="startCommand"+ bind:value={application.startCommand}+ placeholder="default: yarn start"+ />+ </div>+ </div>+ {/if}++ <div class="grid grid-cols-3">+ <label for="baseDirectory" class="pt-2">Base Directory</label>+ <div class="col-span-2">+ <input+ readonly={!$session.isAdmin}+ name="baseDirectory"+ id="baseDirectory"+ bind:value={application.baseDirectory}+ placeholder="default: /"+ />+ <Explainer+ text="Directory to use as the base of all commands. <br> Could be useful with monorepos."+ />+ </div>+ </div>+ {#if !notNodeDeployments.includes(application.buildPack)}+ <div class="grid grid-cols-3">+ <label for="publishDirectory" class="pt-2">Publish Directory</label>+ <div class="col-span-2">+ <input+ readonly={!$session.isAdmin}+ name="publishDirectory"+ id="publishDirectory"+ bind:value={application.publishDirectory}+ placeholder=" default: /"+ />+ <Explainer+ text="Directory containing all the assets for deployment. <br> For example: <span class='text-green-600 font-bold'>dist</span>,<span class='text-green-600 font-bold'>_site</span> or <span class='text-green-600 font-bold'>public</span>."+ />+ </div>+ </div>+ {/if}+ </div>+ </form>+ <div class="flex space-x-1 pb-5 font-bold">+ <div class="title">Features</div>+ </div>+ <div class="px-4 pb-10 sm:px-6">+ <!-- <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> -->+ <ul class="mt-2 divide-y divide-stone-800">+ <Setting+ bind:setting={previews}+ on:click={() => changeSettings('previews')}+ title="Enable MR/PR Previews"+ description="Creates previews from pull and merge requests."+ />+ </ul>+ <ul class="mt-2 divide-y divide-stone-800">+ <Setting+ bind:setting={debug}+ on:click={() => changeSettings('debug')}+ title="Debug Logs"+ description="Enable debug logs during build phase. <br>(<span class='text-red-500'>sensitive information</span> could be visible in logs)"+ />+ </ul>+ </div>+</div>diff --git a/src/routes/applications/[id]/logs/_Loading.svelte b/src/routes/applications/[id]/logs/_Loading.sveltenew file mode 100644index 0000000000..73fbe709e9--- /dev/null+++ b/src/routes/applications/[id]/logs/_Loading.svelte@@ -0,0 +1,41 @@+<div class="lds-ripple absolute left-0">+ <div />+ <div />+</div>++<style>+ .lds-ripple {+ display: inline-block;+ position: relative;+ left: -19px;+ top: -8px;+ width: 40px;+ height: 40px;+ }+ .lds-ripple div {+ position: absolute;+ border: 4px solid #fff;+ opacity: 1;+ border-radius: 50%;+ animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;+ }+ .lds-ripple div:nth-child(2) {+ animation-delay: -0.5s;+ }+ @keyframes lds-ripple {+ 0% {+ top: 1px;+ left: 1px;+ width: 0;+ height: 0;+ opacity: 1;+ }+ 100% {+ top: 0px;+ left: 0px;+ width: 36px;+ height: 36px;+ opacity: 0;+ }+ }+</style>diff --git a/src/routes/applications/[id]/logs/build/_BuildLog.svelte b/src/routes/applications/[id]/logs/build/_BuildLog.sveltenew file mode 100644index 0000000000..98f080dd88--- /dev/null+++ b/src/routes/applications/[id]/logs/build/_BuildLog.svelte@@ -0,0 +1,75 @@+<script lang="ts">+ export let buildId;++ import { createEventDispatcher, onDestroy, onMount } from 'svelte';+ const dispatch = createEventDispatcher();++ import { page } from '$app/stores';++ import Loading from '$lib/components/Loading.svelte';+ import LoadingLogs from '../_Loading.svelte';+ import { get } from '$lib/api';+ import { errorNotification } from '$lib/form';++ let logs = [];+ let loading = true;+ let currentStatus;+ let streamInterval;++ const { id } = $page.params;++ async function streamLogs(sequence = 0) {+ try {+ let { logs: responseLogs, status } = await get(+ `/applications/${id}/logs/build/build.json?buildId=${buildId}&sequence=${sequence}`+ );+ currentStatus = status;+ logs = logs.concat(responseLogs);+ loading = false;+ streamInterval = setInterval(async () => {+ if (status !== 'running') {+ clearInterval(streamInterval);+ return;+ }+ const nextSequence = logs[logs.length - 1].time;+ try {+ const data = await get(+ `/applications/${id}/logs/build/build.json?buildId=${buildId}&sequence=${nextSequence}`+ );+ status = data.status;+ currentStatus = status;+ logs = logs.concat(data.logs);+ dispatch('updateBuildStatus', { status });+ } catch ({ error }) {+ return errorNotification(error);+ }+ }, 1000);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ onDestroy(() => {+ clearInterval(streamInterval);+ });+ onMount(async () => {+ window.scrollTo(0, 0);+ await streamLogs();+ });+</script>++{#if loading}+ <Loading />+{:else}+ <div class="relative">+ {#if currentStatus === 'running'}+ <LoadingLogs />+ {/if}+ <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"+ >+ {#each logs as log}+ <div>{log.line + '\n'}</div>+ {/each}+ </div>+ </div>+{/if}diff --git a/src/routes/applications/[id]/logs/build/build.json.ts b/src/routes/applications/[id]/logs/build/build.json.tsnew file mode 100644index 0000000000..38a51e043d--- /dev/null+++ b/src/routes/applications/[id]/logs/build/build.json.ts@@ -0,0 +1,28 @@+import { getTeam, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const buildId = event.url.searchParams.get('buildId');+ const sequence = Number(event.url.searchParams.get('sequence'));+ try {+ let logs = await db.prisma.buildLog.findMany({+ where: { buildId, time: { gt: sequence } },+ orderBy: { time: 'asc' }+ });+ const { status } = await db.prisma.build.findFirst({ where: { id: buildId } });++ return {+ body: {+ logs,+ status+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/logs/build/index.json.ts b/src/routes/applications/[id]/logs/build/index.json.tsnew file mode 100644index 0000000000..ce58e357b4--- /dev/null+++ b/src/routes/applications/[id]/logs/build/index.json.ts@@ -0,0 +1,40 @@+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dayjs } from '$lib/dayjs';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { id } = event.params;+ const buildId = event.url.searchParams.get('buildId');+ const skip = Number(event.url.searchParams.get('skip')) || 0;++ let builds = [];+ try {+ const buildCount = await db.prisma.build.count({ where: { applicationId: id } });+ if (buildId) {+ builds = await db.prisma.build.findMany({ where: { applicationId: id, id: buildId } });+ } else {+ builds = await db.prisma.build.findMany({+ where: { applicationId: id },+ orderBy: { createdAt: 'desc' },+ take: 5,+ skip+ });+ }+ builds = builds.map((build) => {+ const updatedAt = dayjs(build.updatedAt).utc();+ build.took = updatedAt.diff(dayjs(build.createdAt)) / 1000;+ build.since = updatedAt.fromNow();+ return build;+ });+ return {+ status: 200,+ body: {+ builds,+ buildCount+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/logs/build/index.svelte b/src/routes/applications/[id]/logs/build/index.sveltenew file mode 100644index 0000000000..28740e0310--- /dev/null+++ b/src/routes/applications/[id]/logs/build/index.svelte@@ -0,0 +1,143 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, url, stuff }) => {+ let endpoint = `/applications/${params.id}/logs/build.json?skip=0`;+ const res = await fetch(endpoint);+ if (res.ok) {+ return {+ props: {+ application: stuff.application,+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import { page } from '$app/stores';+ import { dateOptions, getDomain } from '$lib/components/common';++ import BuildLog from './_BuildLog.svelte';+ import { get } from '$lib/api';+ import { errorNotification } from '$lib/form';+ import { goto } from '$app/navigation';++ export let builds;+ export let application;+ export let buildCount;++ let buildId;+ $: buildId;++ let skip = 0;+ let noMoreBuilds = buildCount < 5 || buildCount <= skip;+ const { id } = $page.params;+ let preselectedBuildId = $page.url.searchParams.get('buildId');+ if (preselectedBuildId) buildId = preselectedBuildId;++ async function updateBuildStatus({ detail }) {+ const { status } = detail;+ if (status !== 'running') {+ try {+ const data = await get(`/applications/${id}/logs/build.json?buildId=${buildId}`);+ builds = builds.filter((build) => {+ if (build.id === data.builds[0].id) {+ build.status = data.builds[0].status;+ build.took = data.builds[0].took;+ build.since = data.builds[0].since;+ }+ window.location.reload();+ return build;+ });+ return;+ } catch ({ error }) {+ return errorNotification(error);+ }+ } else {+ builds = builds.filter((build) => {+ if (build.id === buildId) build.status = status;+ return build;+ });+ }+ }+ async function loadMoreBuilds() {+ if (buildCount >= skip) {+ skip = skip + 5;+ noMoreBuilds = buildCount >= skip;+ try {+ const data = await get(`/applications/${id}/logs/build.json?skip=${skip}`);+ builds = builds.concat(data.builds);+ return;+ } catch ({ error }) {+ return errorNotification(error);+ }+ } else {+ noMoreBuilds = true;+ }+ }+ async function loadBuild(build) {+ buildId = build;+ goto(`/applications/${id}/logs/build?buildId=${buildId}`);+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">+ Build logs of <a href={application.fqdn} target="_blank">{getDomain(application.fqdn)}</a>+ </div>+</div>+<div class="flex flex-row justify-start space-x-2 px-10 pt-6 ">+ <div class="min-w-[16rem] space-y-2">+ {#each builds as build (build.id)}+ <div+ data-tooltip={new Intl.DateTimeFormat('default', dateOptions).format(+ new Date(build.createdAt)+ ) + `\n${build.status}`}+ on:click={() => loadBuild(build.id)}+ class="tooltip-top flex cursor-pointer items-center justify-center rounded-r border-l-2 border-transparent py-4 no-underline transition-all duration-100 hover:bg-coolgray-400 hover:shadow-xl"+ class:bg-coolgray-400={buildId === build.id}+ class:border-red-500={build.status === 'failed'}+ class:border-green-500={build.status === 'success'}+ class:border-yellow-500={build.status === 'inprogress'}+ >+ <div class="flex-col px-2">+ <div class="text-sm font-bold">+ {application.branch}+ </div>+ <div class="text-xs">+ {build.type}+ </div>+ </div>+ <div class="flex-1" />++ <div class="w-48 text-center text-xs">+ {#if build.status === 'running'}+ <div class="font-bold">Running</div>+ {:else}+ <div>{build.since}</div>+ <div>Finished in <span class="font-bold">{build.took}s</span></div>+ {/if}+ </div>+ </div>+ {/each}+ {#if buildCount > 0 && !noMoreBuilds}+ <button class="w-full" on:click={loadMoreBuilds}>Load More</button>+ {/if}+ </div>+ <div class="w-96 flex-1">+ {#if buildId}+ {#key buildId}+ <svelte:component this={BuildLog} {buildId} on:updateBuildStatus={updateBuildStatus} />+ {/key}+ {/if}+ </div>+</div>+{#if buildCount === 0}+ <div class="text-center text-xl font-bold">No logs found</div>+{/if}diff --git a/src/routes/applications/[id]/logs/index.json.ts b/src/routes/applications/[id]/logs/index.json.tsnew file mode 100644index 0000000000..0ea806fb47--- /dev/null+++ b/src/routes/applications/[id]/logs/index.json.ts@@ -0,0 +1,53 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dayjs } from '$lib/dayjs';+import { dockerInstance } from '$lib/docker';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ try {+ const { destinationDockerId, destinationDocker } = await db.prisma.application.findUnique({+ where: { id },+ include: { destinationDocker: true }+ });+ if (destinationDockerId) {+ const docker = dockerInstance({ destinationDocker });+ try {+ const container = await docker.engine.getContainer(id);+ if (container) {+ return {+ body: {+ logs: (await container.logs({ stdout: true, stderr: true, timestamps: true }))+ .toString()+ .split('\n')+ .map((l) => l.slice(8))+ .filter((a) => a)+ }+ };+ }+ } catch (error) {+ const { statusCode } = error;+ if (statusCode === 404) {+ return {+ body: {+ logs: []+ }+ };+ }+ }+ }+ return {+ status: 200,+ body: {+ message: 'No logs found.'+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/logs/index.svelte b/src/routes/applications/[id]/logs/index.sveltenew file mode 100644index 0000000000..ae45475fe6--- /dev/null+++ b/src/routes/applications/[id]/logs/index.svelte@@ -0,0 +1,75 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ import { onDestroy, onMount } from 'svelte';+ export const load: Load = async ({ fetch, params, url, stuff }) => {+ let endpoint = `/applications/${params.id}/logs.json`;+ const res = await fetch(endpoint);+ if (res.ok) {+ return {+ props: {+ application: stuff.application,+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ export let application;+ import { page } from '$app/stores';+ import LoadingLogs from './_Loading.svelte';+ import { getDomain } from '$lib/components/common';+ import { get } from '$lib/api';+ import { errorNotification } from '$lib/form';+ let loadLogsInterval = null;+ let logs = [];++ const { id } = $page.params;++ onMount(async () => {+ loadLogs();+ loadLogsInterval = setInterval(() => {+ loadLogs();+ }, 3000);+ });+ onDestroy(() => {+ clearInterval(loadLogsInterval);+ });+ async function loadLogs() {+ try {+ const newLogs = await get(`/applications/${id}/logs.json`);+ logs = newLogs.logs;+ return;+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">+ Application logs of <a href={application.fqdn} target="_blank">{getDomain(application.fqdn)}</a>+ </div>+</div>+<div class="flex flex-row justify-center space-x-2 px-10 pt-6">+ {#if logs.length === 0}+ <div class="text-xl font-bold tracking-tighter">Waiting for the logs...</div>+ {:else}+ <div class="relative w-full">+ <LoadingLogs />+ <div+ class="font-mono leading-6 text-left text-md tracking-tighter rounded bg-coolgray-200 p-6 whitespace-pre-wrap break-words w-full"+ >+ {#each logs as log}+ {log + '\n'}+ {/each}+ </div>+ </div>+ {/if}+</div>diff --git a/src/routes/applications/[id]/previews/index.json.ts b/src/routes/applications/[id]/previews/index.json.tsnew file mode 100644index 0000000000..29ffafdeb0--- /dev/null+++ b/src/routes/applications/[id]/previews/index.json.ts@@ -0,0 +1,44 @@+import { getTeam, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import type { RequestHandler } from '@sveltejs/kit';+import jsonwebtoken from 'jsonwebtoken';++export const get: RequestHandler = async (event) => {+ const { status, body, teamId } = await getUserDetails(event, false);+ if (status === 401) return { status, body };++ const { id } = event.params;+ try {+ const destinationDocker = await db.getDestinationByApplicationId({ id, teamId });+ const docker = dockerInstance({ destinationDocker });+ const listContainers = await docker.engine.listContainers({+ filters: { network: [destinationDocker.network] }+ });+ const containers = listContainers.filter((container) => {+ return (+ container.Labels['coolify.configuration'] &&+ container.Labels['coolify.type'] === 'standalone-application'+ );+ });+ const jsonContainers = containers+ .map((container) =>+ JSON.parse(Buffer.from(container.Labels['coolify.configuration'], 'base64').toString())+ )+ .filter((container) => {+ return (+ container.type !== 'manual' &&+ container.type !== 'webhook_commit' &&+ container.applicationId === id+ );+ });+ return {+ body: {+ containers: jsonContainers+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/previews/index.svelte b/src/routes/applications/[id]/previews/index.sveltenew file mode 100644index 0000000000..28c5efd6ff--- /dev/null+++ b/src/routes/applications/[id]/previews/index.svelte@@ -0,0 +1,51 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, stuff }) => {+ let endpoint = `/applications/${params.id}/previews.json`;+ const res = await fetch(endpoint);+ if (res.ok) {+ 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 containers;+ export let application;++ import { getDomain } from '$lib/components/common';+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">+ Previews for <a href={application.fqdn} target="_blank">{getDomain(application.fqdn)}</a>+ </div>+</div>++<div class="mx-auto max-w-4xl px-6">+ <div class="flex flex-wrap justify-center space-x-2">+ {#if containers.length > 0}+ {#each containers as container}+ <a href={container.fqdn} class="p-2 no-underline" target="_blank">+ <div class="box-selection text-center hover:border-transparent hover:bg-coolgray-200">+ <div class="truncate text-center text-xl font-bold">{getDomain(container.fqdn)}</div>+ </div>+ </a>+ {/each}+ {:else}+ <div class="flex-col">+ <div class="text-center font-bold text-xl">No previews available</div>+ </div>+ {/if}+ </div>+</div>diff --git a/src/routes/applications/[id]/secrets/_Secret.svelte b/src/routes/applications/[id]/secrets/_Secret.sveltenew file mode 100644index 0000000000..fc24a1c630--- /dev/null+++ b/src/routes/applications/[id]/secrets/_Secret.svelte@@ -0,0 +1,133 @@+<script>+ export let name = '';+ export let value = '';+ export let isBuildSecret = false;+ export let isNewSecret = false;+ import { page } from '$app/stores';+ import { del, post } from '$lib/api';+ import { errorNotification } from '$lib/form';++ if (name) value = 'ENCRYPTED';+ const { id } = $page.params;++ async function removeSecret() {+ try {+ await del(`/applications/${id}/secrets.json`, { name });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function saveSecret() {+ try {+ await post(`/applications/${id}/secrets.json`, { name, value, isBuildSecret });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ function setSecretValue() {+ if (isNewSecret) {+ isBuildSecret = !isBuildSecret;+ }+ }+</script>++<div class="mx-auto max-w-3xl pt-4">+ <div class="flex space-x-2">+ <div class="grid grid-flow-row">+ <label for="secretName">Name</label>+ <input+ id="secretName"+ bind:value={name}+ placeholder="EXAMPLE_VARIABLE"+ class="w-64 border-2 border-transparent"+ readonly={!isNewSecret}+ class:hover:bg-coolgray-200={!isNewSecret}+ class:cursor-not-allowed={!isNewSecret}+ />+ </div>+ <div class="grid grid-flow-row">+ <label for="secretValue">Value (will be encrypted)</label>+ <input+ id="secretValue"+ bind:value+ placeholder="J$#@UIO%HO#$U%H"+ class="w-64 border-2 border-transparent"+ class:hover:bg-coolgray-200={!isNewSecret}+ class:cursor-not-allowed={!isNewSecret}+ readonly={!isNewSecret}+ />+ </div>++ <div class="w-32 px-2 text-center">+ <div class="text-xs">Is build variable?</div>++ <div class="mt-2">+ <ul class="divide-y divide-stone-800">+ <li>+ <div+ type="button"+ on:click={setSecretValue}+ aria-pressed="false"+ class="relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out"+ class:bg-green-600={isBuildSecret}+ class:bg-stone-700={!isBuildSecret}+ class:cursor-not-allowed={!isNewSecret}+ class:cursor-pointer={isNewSecret}+ >+ <span class="sr-only">Use isBuildSecret</span>+ <span+ class="pointer-events-none relative inline-block h-5 w-5 transform rounded-full bg-white shadow transition duration-200 ease-in-out"+ class:translate-x-5={isBuildSecret}+ class:translate-x-0={!isBuildSecret}+ >+ <span+ class=" absolute inset-0 flex h-full w-full items-center justify-center transition-opacity duration-200 ease-in"+ class:opacity-0={isBuildSecret}+ class:opacity-100={!isBuildSecret}+ aria-hidden="true"+ >+ <svg class="h-3 w-3 bg-white text-red-600" fill="none" viewBox="0 0 12 12">+ <path+ d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ />+ </svg>+ </span>+ <span+ class="absolute inset-0 flex h-full w-full items-center justify-center transition-opacity duration-100 ease-out"+ aria-hidden="true"+ class:opacity-100={isBuildSecret}+ class:opacity-0={!isBuildSecret}+ >+ <svg+ class="h-3 w-3 bg-white text-green-600"+ fill="currentColor"+ viewBox="0 0 12 12"+ >+ <path+ d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"+ />+ </svg>+ </span>+ </span>+ </div>+ </li>+ </ul>+ </div>+ </div>+ {#if isNewSecret}+ <div class="mt-6">+ <button class="w-20 bg-green-600 hover:bg-green-500" on:click={saveSecret}>Add</button>+ </div>+ {:else}+ <div class="mt-6">+ <button class="w-20 bg-red-600 hover:bg-red-500" on:click={removeSecret}>Remove</button>+ </div>+ {/if}+ </div>+</div>diff --git a/src/routes/applications/[id]/secrets/index.json.ts b/src/routes/applications/[id]/secrets/index.json.tsnew file mode 100644index 0000000000..0487531f6b--- /dev/null+++ b/src/routes/applications/[id]/secrets/index.json.ts@@ -0,0 +1,63 @@+import { getTeam, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ try {+ const secrets = await db.listSecrets({ applicationId: event.params.id });+ return {+ status: 200,+ body: {+ secrets: secrets.sort((a, b) => {+ return ('' + a.name).localeCompare(b.name);+ })+ }+ };+ } catch (error) {+ return PrismaErrorHandler(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 } = await event.request.json();++ try {+ const found = await db.isSecretExists({ id, name });+ if (found) {+ throw {+ error: `Secret ${name} already exists`+ };+ } else {+ await db.createSecret({ id, name, value, isBuildSecret });+ return {+ status: 201+ };+ }+ } catch (error) {+ return PrismaErrorHandler(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.removeSecret({ id, name });+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/secrets/index.svelte b/src/routes/applications/[id]/secrets/index.sveltenew file mode 100644index 0000000000..e751ce513b--- /dev/null+++ b/src/routes/applications/[id]/secrets/index.svelte@@ -0,0 +1,41 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, stuff }) => {+ let endpoint = `/applications/${params.id}/secrets.json`;+ const res = await fetch(endpoint);+ if (res.ok) {+ 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 secrets;+ export let application;+ import Secret from './_Secret.svelte';+ import { getDomain } from '$lib/components/common';+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">+ Secrets for <a href={application.fqdn} target="_blank">{getDomain(application.fqdn)}</a>+ </div>+</div>+<div class="mx-auto max-w-4xl px-6">+ <div class="flex-col justify-start space-y-1">+ {#each secrets as secret}+ <Secret name={secret.name} value={secret.value} isBuildSecret={secret.isBuildSecret} />+ {/each}+ <Secret isNewSecret />+ </div>+</div>diff --git a/src/routes/applications/[id]/settings.json.ts b/src/routes/applications/[id]/settings.json.tsnew file mode 100644index 0000000000..100b2a7ff4--- /dev/null+++ b/src/routes/applications/[id]/settings.json.ts@@ -0,0 +1,19 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { debug, previews } = await event.request.json();++ try {+ await db.setApplicationSettings({ id, debug, previews });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/[id]/stop.json.ts b/src/routes/applications/[id]/stop.json.tsnew file mode 100644index 0000000000..041dc5296b--- /dev/null+++ b/src/routes/applications/[id]/stop.json.ts@@ -0,0 +1,31 @@+import { getDomain, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import { removeProxyConfiguration } from '$lib/haproxy';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ const { destinationDocker, destinationDockerId, fqdn } = await db.getApplication({+ id,+ teamId+ });+ const domain = getDomain(fqdn);+ if (destinationDockerId) {+ const docker = dockerInstance({ destinationDocker });+ await docker.engine.getContainer(id).stop();+ }+ await removeProxyConfiguration({ domain });+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/_Application.svelte b/src/routes/applications/_Application.sveltenew file mode 100644index 0000000000..3de32da8f2--- /dev/null+++ b/src/routes/applications/_Application.svelte@@ -0,0 +1,60 @@+<script lang="ts">+ export let application;+ import Rust from '$lib/components/svg/applications/Rust.svelte';+ import Nodejs from '$lib/components/svg/applications/Nodejs.svelte';+ import React from '$lib/components/svg/applications/React.svelte';+ import Svelte from '$lib/components/svg/applications/Svelte.svelte';+ import Vuejs from '$lib/components/svg/applications/Vuejs.svelte';+ import PHP from '$lib/components/svg/applications/PHP.svelte';+ import Python from '$lib/components/svg/applications/Python.svelte';+ import Static from '$lib/components/svg/applications/Static.svelte';+ import Nestjs from '$lib/components/svg/applications/Nestjs.svelte';+ import Nuxtjs from '$lib/components/svg/applications/Nuxtjs.svelte';+ import Nextjs from '$lib/components/svg/applications/Nextjs.svelte';+ import Gatsby from '$lib/components/svg/applications/Gatsby.svelte';+ import Docker from '$lib/components/svg/applications/Docker.svelte';++ const buildPack = application?.buildPack?.toLowerCase();+</script>++<a href="/applications/{application.id}" class="w-96 p-2 no-underline">+ <div class="box-selection group relative hover:bg-green-600">+ {#if buildPack === 'rust'}+ <Rust />+ {:else if buildPack === 'node'}+ <Nodejs />+ {:else if buildPack === 'react'}+ <React />+ {:else if buildPack === 'svelte'}+ <Svelte />+ {:else if buildPack === 'vuejs'}+ <Vuejs />+ {:else if buildPack === 'php'}+ <PHP />+ {:else if buildPack === 'python'}+ <Python />+ {:else if buildPack === 'static'}+ <Static />+ {:else if buildPack === 'nestjs'}+ <Nestjs />+ {:else if buildPack === 'nuxtjs'}+ <Nuxtjs />+ {:else if buildPack === 'nextjs'}+ <Nextjs />+ {:else if buildPack === 'gatsby'}+ <Gatsby />+ {:else if buildPack === 'docker'}+ <Docker />+ {/if}++ <div class="truncate text-center text-xl font-bold">{application.name}</div>+ {#if application.fqdn}+ <div class="truncate text-center">{application.fqdn}</div>+ {/if}+ {#if !application.gitSourceId || !application.destinationDockerId}+ <div class="truncate text-center font-bold text-red-500 group-hover:text-white">+ Configuration missing+ </div>+ {/if}+ </div>+</a>diff --git a/src/routes/applications/index.json.ts b/src/routes/applications/index.json.tsnew file mode 100644index 0000000000..a7f067082e--- /dev/null+++ b/src/routes/applications/index.json.ts@@ -0,0 +1,21 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ try {+ const applications = await db.listApplications(teamId);+ return {+ status: 200,+ body: {+ applications+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/applications/index.svelte b/src/routes/applications/index.sveltenew file mode 100644index 0000000000..033fa03f94--- /dev/null+++ b/src/routes/applications/index.svelte@@ -0,0 +1,58 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch }) => {+ const endpoint = '/applications.json';+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${endpoint}`)+ };+ };+</script>++<script lang="ts">+ export let applications: Array<Applications>;+ import { session } from '$app/stores';+ import Application from './_Application.svelte';+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl ">Applications</div>+ {#if $session.isAdmin}+ <a href="/new/application" class="add-icon bg-green-600 hover:bg-green-500">+ <svg+ class="w-6"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ ><path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 6v6m0 0v6m0-6h6m-6 0H6"+ /></svg+ >+ </a>+ {/if}+</div>+<div class="flex flex-wrap justify-center">+ {#if !applications || applications.length === 0}+ <div class="flex-col">+ <div class="text-center text-xl font-bold">No applications found</div>+ </div>+ {:else}+ {#each applications as application}+ <Application {application} />+ {/each}+ {/if}+</div>diff --git a/src/routes/common/getUniqueName.json.ts b/src/routes/common/getUniqueName.json.tsnew file mode 100644index 0000000000..b1b4a00501--- /dev/null+++ b/src/routes/common/getUniqueName.json.ts@@ -0,0 +1,10 @@+import { uniqueName } from '$lib/common';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async () => {+ return {+ body: {+ name: uniqueName()+ }+ };+};diff --git a/src/routes/dashboard/__layout.svelte b/src/routes/dashboard/__layout.sveltedeleted file mode 100644index 74f8e2b5cd..0000000000--- a/src/routes/dashboard/__layout.svelte+++ /dev/null@@ -1,44 +0,0 @@-<script context="module" lang="ts">- import { request } from '$lib/request';- /**- * @type {import('@sveltejs/kit').Load}- */- export async function load(session) {- return {- props: {- initDashboard: await request('/api/v1/dashboard', session)- }- };- }-</script>--<script lang="ts">- export let initDashboard;- import { dashboard } from '$store';- import { onDestroy, onMount } from 'svelte';- import { session } from '$app/stores';- $dashboard = initDashboard;- let loadDashboardInterval = null;-- async function loadDashboard() {- try {- $dashboard = await request('/api/v1/dashboard', $session);- } catch (error) {- //- }- }-- onMount(async () => {- await loadDashboard();- loadDashboardInterval = setInterval(async () => {- await loadDashboard();- }, 2000);- });- onDestroy(() => {- clearInterval(loadDashboardInterval);- });-</script>--<div class="min-h-full">- <slot />-</div>diff --git a/src/routes/dashboard/applications.svelte b/src/routes/dashboard/applications.sveltedeleted file mode 100644index aa2ce9ffd3..0000000000--- a/src/routes/dashboard/applications.svelte+++ /dev/null@@ -1,379 +0,0 @@-<script context="module" lang="ts">- import { request } from '$lib/request';- /**- * @type {import('@sveltejs/kit').Load}- */- export async function load(session) {- if (!browser) {- if (!import.meta.env.VITE_GITHUB_APP_CLIENTID) {- return {- status: 302,- redirect: '/dashboard/services'- };- }- }- return {- props: {- initDashboard: await request('/api/v1/dashboard', session)- }- };- }-</script>--<script lang="ts">- import { goto } from '$app/navigation';- import { dashboard, dateOptions, settings } from '$store';- import { fade } from 'svelte/transition';- import { browser } from '$app/env';- import { dashify } from '$lib/common';-</script>--<div- in:fade={{ duration: 100 }}- class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center"->- <div>Applications</div>- <button- class="icon p-1 ml-4 bg-green-500 hover:bg-green-400"- on:click={() => goto('/application/new')}- >- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M12 6v6m0 0v6m0-6h6m-6 0H6"- />- </svg>- </button>-</div>-<div in:fade={{ duration: 100 }}>- {#if $dashboard?.applications?.deployed.length > 0}- <div class="px-4 mx-auto py-5 z-auto">- <div class="flex items-center justify-center flex-wrap">- {#each $dashboard.applications.deployed as application}- <div class="px-4 pb-4">- <div- class="relative rounded-xl p-6 bg-warmGray-800 border-2 border-dashed border-transparent hover:border-green-500 text-white shadow-md cursor-pointer ease-in-out hover:scale-105 duration-100 group"- on:click={() => {- goto(`/application/${application.configuration.general.nickname}/configuration`);- }}- >- <div class="flex items-center">- {#if application.configuration.build.pack === 'static'}- <svg- class="text-white w-10 h-10 absolute top-0 left-0 -m-4"- viewBox="0 0 32 32"- fill="none"- xmlns="http://www.w3.org/2000/svg"- ><g clip-path="url(#HTML5_Clip0_4)"- ><path- d="M30.216 0L27.6454 28.7967L16.0907 32L4.56783 28.8012L2 0H30.216Z"- fill="#E44D26"- /><path- d="M16.108 29.5515L25.4447 26.963L27.6415 2.35497H16.108V29.5515Z"- fill="#F16529"- /><path- d="M11.1109 9.4197H16.108V5.88731H7.25053L7.33509 6.83499L8.20327 16.5692H16.108V13.0369H11.4338L11.1109 9.4197Z"- fill="#EBEBEB"- /><path- d="M11.907 18.3354H8.36111L8.856 23.8818L16.0917 25.8904L16.108 25.8859V22.2108L16.0925 22.2149L12.1585 21.1527L11.907 18.3354Z"- fill="#EBEBEB"- /><path- d="M16.0958 16.5692H20.4455L20.0354 21.1504L16.0958 22.2138V25.8887L23.3373 23.8817L23.3904 23.285L24.2205 13.9855L24.3067 13.0369H16.0958V16.5692Z"- fill="white"- /><path- d="M16.0958 9.41105V9.41969H24.6281L24.6989 8.62572L24.8599 6.83499L24.9444 5.88731H16.0958V9.41105Z"- fill="white"- /></g- ><defs- ><clipPath id="HTML5_Clip0_4"- ><rect width="32" height="32" fill="white" /></clipPath- ></defs- ></svg- >- {:else if application.configuration.build.pack === 'nestjs'}- <svg class="w-10 h-10 absolute top-0 left-0 -m-4" viewBox="0 0 128 128">- <path- fill="#DF234F"- d="M75.4,0.3c-0.9,0-1.8,0.2-2.6,0.5c1.7,1.1,2.6,2.6,3.1,4.3c0,0.2,0.1,0.4,0.1,0.6c0,0.2,0.1,0.4,0.1,0.6 c0.1,2.9-0.8,3.3-1.4,5c-1,2.2-0.7,4.6,0.5,6.5c0.1,0.2,0.2,0.5,0.4,0.7c-1.3-8.4,5.7-9.6,7-12.2c0.1-2.3-1.8-3.8-3.3-4.9 C77.8,0.5,76.6,0.3,75.4,0.3L75.4,0.3z M85.9,2.1c-0.1,0.8,0,0.6-0.1,1c0,0.3,0,0.6-0.1,0.9c-0.1,0.3-0.1,0.5-0.2,0.8 c-0.1,0.3-0.2,0.5-0.3,0.8C85.1,5.8,85,6,84.9,6.3c-0.1,0.1-0.2,0.3-0.3,0.4c-0.1,0.1-0.1,0.2-0.2,0.3c-0.2,0.2-0.3,0.5-0.5,0.7 c-0.2,0.2-0.4,0.4-0.6,0.6v0c-0.2,0.2-0.4,0.4-0.6,0.5c-0.7,0.5-1.5,0.9-2.2,1.4c-0.2,0.2-0.5,0.3-0.7,0.5 c-0.2,0.2-0.4,0.3-0.6,0.5c-0.2,0.2-0.4,0.4-0.6,0.6c-0.2,0.2-0.4,0.4-0.5,0.7c-0.2,0.2-0.3,0.5-0.5,0.7c-0.1,0.3-0.2,0.5-0.4,0.8 c-0.1,0.3-0.2,0.5-0.3,0.8c-0.1,0.3-0.2,0.6-0.2,0.8c0,0.1,0,0.3-0.1,0.4c0,0.1,0,0.3-0.1,0.4c0,0.3,0,0.6,0,0.8c0,0.2,0,0.4,0,0.6 c0,0.3,0,0.5,0.1,0.8c0,0.3,0.1,0.5,0.2,0.8c0.1,0.3,0.2,0.5,0.3,0.8c0.1,0.2,0.2,0.3,0.2,0.5l-7.6-2.9c-1.3-0.4-2.5-0.7-3.8-1 c-0.7-0.2-1.4-0.3-2.1-0.5c-2-0.4-4-0.7-6-0.9c-0.1,0-0.1,0-0.2,0c-2-0.2-3.9-0.3-5.9-0.3c-1.5,0-2.9,0.1-4.3,0.2 c-2,0.1-4,0.4-6,0.7c-0.5,0.1-1,0.2-1.5,0.3c-1,0.2-2,0.4-3,0.7c-0.5,0.1-1,0.3-1.5,0.4c-0.5,0.2-1,0.4-1.4,0.6 c-0.4,0.2-0.7,0.3-1.1,0.5c-0.1,0-0.1,0-0.2,0.1c-0.3,0.2-0.6,0.3-0.9,0.5c-0.1,0-0.2,0.1-0.2,0.1c-0.4,0.2-0.7,0.4-1,0.5 c-0.2,0.1-0.5,0.2-0.7,0.3c-0.1,0.1-0.2,0.1-0.3,0.2c-0.3,0.2-0.6,0.3-0.9,0.5c-0.3,0.2-0.6,0.3-0.8,0.5c-0.2,0.2-0.5,0.3-0.7,0.5 c0,0-0.1,0-0.1,0.1c-0.2,0.1-0.4,0.3-0.6,0.5c0,0,0,0-0.1,0.1c-0.2,0.1-0.3,0.3-0.5,0.4c-0.1,0-0.1,0.1-0.2,0.1 c-0.2,0.1-0.3,0.3-0.5,0.4c0,0.1-0.1,0.1-0.1,0.1c-0.2,0.2-0.4,0.4-0.6,0.6c0,0,0,0-0.1,0.1c-0.2,0.2-0.4,0.4-0.6,0.6 c0,0,0,0.1-0.1,0.1c-0.2,0.2-0.3,0.3-0.5,0.5c-0.1,0.1-0.2,0.1-0.2,0.2c-0.2,0.2-0.4,0.4-0.6,0.6c0,0.1-0.1,0.1-0.1,0.2 c-0.3,0.3-0.5,0.5-0.8,0.8c0,0-0.1,0.1-0.1,0.1c-0.5,0.6-1.1,1.1-1.7,1.6c-0.6,0.5-1.2,1-1.9,1.5c-0.7,0.5-1.3,0.9-2,1.3 c-0.7,0.4-1.4,0.7-2.1,1c-0.7,0.3-1.4,0.6-2.1,0.8c-1.4,0.3-2.8,0.9-4,1C7.6,33.9,7.3,34,7,34c-0.3,0.1-0.6,0.1-0.8,0.2 c-0.3,0.1-0.5,0.2-0.8,0.3c-0.3,0.1-0.5,0.2-0.8,0.4c-0.2,0.2-0.5,0.3-0.7,0.5c-0.2,0.2-0.5,0.4-0.7,0.6c-0.2,0.2-0.5,0.4-0.7,0.6 c-0.2,0.2-0.4,0.4-0.6,0.7c-0.2,0.3-0.4,0.5-0.5,0.8c-0.2,0.2-0.3,0.5-0.5,0.8c-0.1,0.3-0.3,0.6-0.4,0.9c-0.1,0.3-0.2,0.6-0.3,0.9 c-0.1,0.3-0.1,0.5-0.2,0.8c0,0,0,0.1,0,0.1c-0.1,0.3-0.1,0.7-0.1,0.9C0,42.4,0,42.6,0,42.8c0,0.1,0,0.3,0,0.4 c0,0.2,0.1,0.4,0.1,0.6c0.1,0.2,0.1,0.4,0.2,0.6v0c0.1,0.2,0.2,0.4,0.4,0.6c0.1,0.2,0.3,0.4,0.4,0.6c0.2,0.2,0.4,0.4,0.6,0.5 c0.2,0.2,0.4,0.4,0.6,0.5c0.8,0.7,1,0.9,2,1.5c0.2,0.1,0.3,0.2,0.5,0.3c0,0,0.1,0,0.1,0c0,0.1,0,0.1,0,0.2c0,0.3,0.1,0.5,0.2,0.8 c0.1,0.3,0.2,0.6,0.3,0.8c0.1,0.2,0.2,0.4,0.3,0.6c0,0.1,0.1,0.1,0.1,0.2c0.1,0.3,0.3,0.5,0.4,0.7c0.2,0.2,0.3,0.5,0.5,0.7 c0.2,0.2,0.4,0.4,0.6,0.6c0.2,0.2,0.4,0.4,0.6,0.6c0,0,0,0,0.1,0c0.2,0.2,0.4,0.3,0.6,0.5c0.2,0.2,0.5,0.3,0.7,0.4 c0.2,0.1,0.5,0.3,0.8,0.4c0.2,0.1,0.4,0.2,0.7,0.2c0,0,0.1,0,0.1,0.1c0.1,0,0.3,0.1,0.4,0.1c-0.1,1.8-0.1,3.5,0.1,4.1 c0.3,0.7,1.8-1.4,3.2-3.7c-0.2,2.3-0.3,5,0,5.8c0.4,0.8,2.3-1.8,4.1-4.6c23.4-5.4,44.8,10.8,47.1,33.7C65.4,87,61,85,58.9,85.5 c-1,2.4-2.7,5.6-5.4,7.5c0.2-2.2,0.1-4.4-0.3-6.6c-0.7,3-2.1,5.9-4.1,8.3c-3.1,0.2-6.3-1.3-7.9-3.6c-0.1-0.1-0.2-0.3-0.3-0.4 c-0.1-0.2-0.2-0.5-0.3-0.7c-0.1-0.2-0.2-0.5-0.2-0.7c0-0.2,0-0.5,0-0.7c0-0.2,0-0.3,0-0.5c0-0.2,0.1-0.5,0.2-0.7 c0.1-0.2,0.1-0.5,0.2-0.7c0.1-0.2,0.2-0.5,0.4-0.7c0.6-1.6,0.6-2.9-0.5-3.6c-0.2-0.1-0.4-0.2-0.6-0.3c-0.1,0-0.3-0.1-0.4-0.1 c-0.1,0-0.2-0.1-0.3-0.1c-0.2-0.1-0.5-0.1-0.7-0.2c-0.2-0.1-0.5-0.1-0.7-0.1c-0.2,0-0.5-0.1-0.7-0.1c-0.2,0-0.3,0-0.5,0 c-0.3,0-0.5,0-0.7,0.1c-0.2,0-0.5,0.1-0.7,0.1c-0.2,0.1-0.5,0.1-0.7,0.2c-0.2,0.1-0.4,0.2-0.7,0.3c-0.2,0.1-0.4,0.2-0.6,0.3 c-7.7,5-3.1,16.8,2.1,20.2c-2,0.4-4,0.8-4.6,1.2c0,0-0.1,0.1-0.1,0.1c1.4,0.9,2.9,1.6,4.5,2.2c2.1,0.7,4.4,1.3,5.4,1.6v0 c2.7,0.6,5.5,0.8,8.3,0.6c14.6-1,26.6-12.2,28.8-26.8c0.1,0.3,0.1,0.6,0.2,0.9c0.1,0.6,0.2,1.2,0.3,1.9v0c0.1,0.3,0.1,0.6,0.1,0.9 v0.1c0,0.3,0.1,0.6,0.1,0.9c0,0.4,0.1,0.7,0.1,1.1v0.5c0,0.2,0,0.4,0,0.5c0,0.2,0,0.4,0,0.6v0.5c0,0.2,0,0.4,0,0.7 c0,0.1,0,0.3,0,0.4c0,0.2,0,0.5,0,0.7c0,0.1,0,0.2,0,0.3c0,0.3-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.3-0.1,0.6-0.1,1v0v0 c-0.1,0.3-0.1,0.6-0.2,0.9v0.1c-0.1,0.3-0.1,0.6-0.2,0.9c0,0,0,0.1,0,0.1c-0.1,0.3-0.1,0.6-0.2,0.9v0.1c-0.1,0.3-0.2,0.6-0.3,0.9 c0,0,0,0.1,0,0.1c-0.1,0.3-0.2,0.7-0.3,1c-0.1,0.3-0.2,0.6-0.4,1c-0.1,0.3-0.2,0.7-0.4,1c-0.1,0.3-0.3,0.6-0.4,1h0 c-0.1,0.3-0.3,0.6-0.4,0.9c0,0.1-0.1,0.2-0.1,0.2c0,0,0,0.1-0.1,0.1c-2.1,4.3-5.3,8.1-9.3,11.1c-0.3,0.2-0.5,0.4-0.8,0.6 c-0.1,0.1-0.2,0.1-0.2,0.2c-0.2,0.2-0.5,0.3-0.7,0.5l0.1,0.2h0c0.5-0.1,0.9-0.1,1.4-0.2h0c0.9-0.1,1.7-0.3,2.6-0.5 c0.2,0,0.5-0.1,0.7-0.2c0.2,0,0.3-0.1,0.5-0.1c0.2,0,0.5-0.1,0.7-0.1c0.2-0.1,0.4-0.1,0.6-0.2c3.3-0.8,6.5-1.9,9.6-3.2 c-5.3,7.2-12.3,13-20.5,16.8c3.8-0.3,7.6-0.9,11.3-2c13.3-3.9,24.5-12.9,31.2-25c-1.4,7.6-4.4,14.9-8.9,21.3 c3.2-2.1,6.1-4.6,8.8-7.3c7.4-7.7,12.3-17.6,13.9-28.1c1.1,5.2,1.5,10.6,1,15.9c23.9-33.3,2-67.8-7.2-76.9c0-0.1-0.1-0.1-0.1-0.2 c0,0,0,0,0,0.1c0,0,0,0,0-0.1c0,0.4,0,0.8-0.1,1.2c-0.1,0.8-0.2,1.5-0.3,2.2c-0.2,0.7-0.4,1.5-0.6,2.2c-0.2,0.7-0.5,1.4-0.8,2.1 c-0.3,0.7-0.6,1.4-1,2c-0.4,0.6-0.8,1.3-1.2,1.9c-0.4,0.6-0.9,1.2-1.4,1.8c-0.5,0.6-1,1.1-1.6,1.7c-0.3,0.3-0.6,0.6-1,0.8 c-0.3,0.2-0.5,0.4-0.8,0.7c-0.6,0.5-1.2,0.9-1.9,1.3c-0.6,0.4-1.3,0.8-2,1.1c-0.7,0.3-1.4,0.6-2.1,0.9c-0.7,0.3-1.4,0.5-2.1,0.7 c-0.7,0.2-1.5,0.4-2.2,0.5c-0.8,0.1-1.5,0.2-2.2,0.3c-0.5,0-1.1,0.1-1.6,0.1c-0.8,0-1.5-0.1-2.2-0.1c-0.8-0.1-1.5-0.2-2.2-0.3 c-0.8-0.1-1.5-0.3-2.2-0.6h0c0.7-0.1,1.5-0.1,2.2-0.3c0.8-0.1,1.5-0.3,2.2-0.5c0.7-0.2,1.5-0.4,2.1-0.7c0.7-0.3,1.4-0.6,2.1-0.9 c0.7-0.3,1.3-0.7,2-1.1c0.6-0.4,1.3-0.9,1.9-1.3c0.6-0.5,1.2-1,1.7-1.5c0.6-0.5,1.1-1.1,1.6-1.6c0.5-0.6,1-1.2,1.4-1.8 c0.1-0.1,0.1-0.2,0.2-0.3c0.3-0.5,0.7-1.1,1-1.6c0.4-0.7,0.7-1.3,1-2c0.3-0.7,0.6-1.4,0.8-2.1c0.2-0.7,0.4-1.4,0.6-2.1 c0.1-0.8,0.3-1.5,0.3-2.2c0.1-0.8,0.1-1.5,0.1-2.2c0-0.5,0-1.1-0.1-1.6c-0.1-0.8-0.2-1.5-0.3-2.2c-0.1-0.8-0.3-1.5-0.5-2.2 c-0.2-0.7-0.5-1.4-0.7-2.1c-0.3-0.7-0.6-1.4-0.9-2c-0.4-0.7-0.7-1.3-1.1-2c-0.4-0.6-0.9-1.2-1.3-1.8c-0.5-0.6-1-1.1-1.5-1.7 c-0.3-0.3-0.6-0.6-0.9-0.8c-1.5-1.2-3-2.2-4.6-3.2c-0.2-0.1-0.4-0.2-0.7-0.3C87.9,2.8,86.9,2.5,85.9,2.1L85.9,2.1z"- />- </svg>- {:else if application.configuration.build.pack === 'react'}- <svg- class="text-blue-500 w-10 h-10 absolute top-0 left-0 -m-4"- viewBox="0 0 128 128"- >- <g fill="#61DAFB"- ><circle cx="64" cy="64" r="11.4" /><path- d="M107.3 45.2c-2.2-.8-4.5-1.6-6.9-2.3.6-2.4 1.1-4.8 1.5-7.1 2.1-13.2-.2-22.5-6.6-26.1-1.9-1.1-4-1.6-6.4-1.6-7 0-15.9 5.2-24.9 13.9-9-8.7-17.9-13.9-24.9-13.9-2.4 0-4.5.5-6.4 1.6-6.4 3.7-8.7 13-6.6 26.1.4 2.3.9 4.7 1.5 7.1-2.4.7-4.7 1.4-6.9 2.3-12.5 4.8-19.3 11.4-19.3 18.8s6.9 14 19.3 18.8c2.2.8 4.5 1.6 6.9 2.3-.6 2.4-1.1 4.8-1.5 7.1-2.1 13.2.2 22.5 6.6 26.1 1.9 1.1 4 1.6 6.4 1.6 7.1 0 16-5.2 24.9-13.9 9 8.7 17.9 13.9 24.9 13.9 2.4 0 4.5-.5 6.4-1.6 6.4-3.7 8.7-13 6.6-26.1-.4-2.3-.9-4.7-1.5-7.1 2.4-.7 4.7-1.4 6.9-2.3 12.5-4.8 19.3-11.4 19.3-18.8s-6.8-14-19.3-18.8zm-14.8-30.5c4.1 2.4 5.5 9.8 3.8 20.3-.3 2.1-.8 4.3-1.4 6.6-5.2-1.2-10.7-2-16.5-2.5-3.4-4.8-6.9-9.1-10.4-13 7.4-7.3 14.9-12.3 21-12.3 1.3 0 2.5.3 3.5.9zm-11.2 59.3c-1.8 3.2-3.9 6.4-6.1 9.6-3.7.3-7.4.4-11.2.4-3.9 0-7.6-.1-11.2-.4-2.2-3.2-4.2-6.4-6-9.6-1.9-3.3-3.7-6.7-5.3-10 1.6-3.3 3.4-6.7 5.3-10 1.8-3.2 3.9-6.4 6.1-9.6 3.7-.3 7.4-.4 11.2-.4 3.9 0 7.6.1 11.2.4 2.2 3.2 4.2 6.4 6 9.6 1.9 3.3 3.7 6.7 5.3 10-1.7 3.3-3.4 6.6-5.3 10zm8.3-3.3c1.5 3.5 2.7 6.9 3.8 10.3-3.4.8-7 1.4-10.8 1.9 1.2-1.9 2.5-3.9 3.6-6 1.2-2.1 2.3-4.2 3.4-6.2zm-25.6 27.1c-2.4-2.6-4.7-5.4-6.9-8.3 2.3.1 4.6.2 6.9.2 2.3 0 4.6-.1 6.9-.2-2.2 2.9-4.5 5.7-6.9 8.3zm-18.6-15c-3.8-.5-7.4-1.1-10.8-1.9 1.1-3.3 2.3-6.8 3.8-10.3 1.1 2 2.2 4.1 3.4 6.1 1.2 2.2 2.4 4.1 3.6 6.1zm-7-25.5c-1.5-3.5-2.7-6.9-3.8-10.3 3.4-.8 7-1.4 10.8-1.9-1.2 1.9-2.5 3.9-3.6 6-1.2 2.1-2.3 4.2-3.4 6.2zm25.6-27.1c2.4 2.6 4.7 5.4 6.9 8.3-2.3-.1-4.6-.2-6.9-.2-2.3 0-4.6.1-6.9.2 2.2-2.9 4.5-5.7 6.9-8.3zm22.2 21l-3.6-6c3.8.5 7.4 1.1 10.8 1.9-1.1 3.3-2.3 6.8-3.8 10.3-1.1-2.1-2.2-4.2-3.4-6.2zm-54.5-16.2c-1.7-10.5-.3-17.9 3.8-20.3 1-.6 2.2-.9 3.5-.9 6 0 13.5 4.9 21 12.3-3.5 3.8-7 8.2-10.4 13-5.8.5-11.3 1.4-16.5 2.5-.6-2.3-1-4.5-1.4-6.6zm-24.7 29c0-4.7 5.7-9.7 15.7-13.4 2-.8 4.2-1.5 6.4-2.1 1.6 5 3.6 10.3 6 15.6-2.4 5.3-4.5 10.5-6 15.5-13.8-4-22.1-10-22.1-15.6zm28.5 49.3c-4.1-2.4-5.5-9.8-3.8-20.3.3-2.1.8-4.3 1.4-6.6 5.2 1.2 10.7 2 16.5 2.5 3.4 4.8 6.9 9.1 10.4 13-7.4 7.3-14.9 12.3-21 12.3-1.3 0-2.5-.3-3.5-.9zm60.8-20.3c1.7 10.5.3 17.9-3.8 20.3-1 .6-2.2.9-3.5.9-6 0-13.5-4.9-21-12.3 3.5-3.8 7-8.2 10.4-13 5.8-.5 11.3-1.4 16.5-2.5.6 2.3 1 4.5 1.4 6.6zm9-15.6c-2 .8-4.2 1.5-6.4 2.1-1.6-5-3.6-10.3-6-15.6 2.4-5.3 4.5-10.5 6-15.5 13.8 4 22.1 10 22.1 15.6 0 4.7-5.8 9.7-15.7 13.4z"- /></g- >- </svg>- {:else if application.configuration.build.pack === 'gatsby'}- <svg class="w-10 h-10 absolute top-0 left-0 -m-4" viewBox="0 0 128 128">- <path- fill="#64328B"- d="M64,0C28.7,0,0,28.7,0,64v0c0,35.3,28.7,64,64,64s64-28.7,64-64v0C128,28.7,99.3,0,64,0z M13.2,64L64,114.8 C35.9,114.8,13.2,92.1,13.2,64z M75.4,113.5l-60.9-61C19.7,30,39.9,13.2,64,13.2c16.6,0,31.3,7.9,40.5,20.2l-7.5,7.2 C89.7,30.2,77.7,23.5,64,23.5c-17.6,0-32.5,11.2-38.1,26.8C33.1,57,75.4,98.8,78.1,102c12.7-4.7,22.3-15.5,25.4-28.9H81.9v-9.4 l33,0.2C114.8,88.2,98,108.4,75.4,113.5z"- />- </svg>- {:else if application.configuration.build.pack === 'nuxtjs'}- <svg- class="w-10 h-10 absolute top-0 left-0 -m-4"- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 400 400"- >- <g fill-rule="nonzero" transform="translate(0 50)" fill="none">- <path- d="M227.92099 83.45116l-13.6889 24.10141-46.8148-82.44693L23.7037 278.17052h97.3037c0 13.31084 10.61252 24.10142 23.70371 24.10142H23.70371c-8.46771 0-16.29145-4.59601-20.5246-12.05272-4.23315-7.4567-4.23272-16.64312.00114-24.0994L146.89383 13.05492c4.23415-7.45738 12.0596-12.05138 20.5284-12.05138 8.46878 0 16.29423 4.594 20.52839 12.05138l39.97037 70.39623z"- fill="#00C58E"- />- <path- d="M331.6642 266.11981l-90.05432-158.56724-13.6889-24.10141-13.68888 24.10141-90.04445 158.56724c-4.23385 7.45629-4.23428 16.64271-.00113 24.09941 4.23314 7.4567 12.05689 12.05272 20.5246 12.05272h166.4c8.46946 0 16.29644-4.591 20.532-12.04837 4.23555-7.45736 4.23606-16.64592.00132-24.10376h.01976zM144.7111 278.17052L227.921 131.65399l83.19012 146.51653h-166.4z"- fill="#FFF"- />- <path- d="M396.04938 290.22123c-4.23344 7.45557-12.05656 12.0507-20.52345 12.0507H311.1111c13.0912 0 23.7037-10.79057 23.7037-24.10141h40.66173L260.09877 74.98553l-18.4889 32.56704L227.921 83.45116l11.65432-20.51634c4.23416-7.45738 12.0596-12.05138 20.5284-12.05138 8.46879 0 16.29423 4.594 20.52839 12.05138l115.41728 203.185c4.23426 7.457 4.23426 16.6444 0 24.1014z"- fill="#108775"- />- </g>- </svg>- {:else if application.configuration.build.pack === 'svelte'}- <svg- class="w-10 h-10 absolute top-0 left-0 -m-4"- version="1.1"- id="Layer_1"- xmlns="http://www.w3.org/2000/svg"- xmlns:xlink="http://www.w3.org/1999/xlink"- x="0px"- y="0px"- viewBox="0 0 98.1 118"- style="enable-background:new 0 0 98.1 118;"- xml:space="preserve"- >- <path- fill="#FF3E00"- d="M91.8,15.6C80.9-0.1,59.2-4.7,43.6,5.2L16.1,22.8C8.6,27.5,3.4,35.2,1.9,43.9c-1.3,7.3-0.2,14.8,3.3,21.3 c-2.4,3.6-4,7.6-4.7,11.8c-1.6,8.9,0.5,18.1,5.7,25.4c11,15.7,32.6,20.3,48.2,10.4l27.5-17.5c7.5-4.7,12.7-12.4,14.2-21.1 c1.3-7.3,0.2-14.8-3.3-21.3c2.4-3.6,4-7.6,4.7-11.8C99.2,32.1,97.1,22.9,91.8,15.6"- />- <path- fill="#FFFFFF"- d="M40.9,103.9c-8.9,2.3-18.2-1.2-23.4-8.7c-3.2-4.4-4.4-9.9-3.5-15.3c0.2-0.9,0.4-1.7,0.6-2.6l0.5-1.6l1.4,1 c3.3,2.4,6.9,4.2,10.8,5.4l1,0.3l-0.1,1c-0.1,1.4,0.3,2.9,1.1,4.1c1.6,2.3,4.4,3.4,7.1,2.7c0.6-0.2,1.2-0.4,1.7-0.7L65.5,72 c1.4-0.9,2.3-2.2,2.6-3.8c0.3-1.6-0.1-3.3-1-4.6c-1.6-2.3-4.4-3.3-7.1-2.6c-0.6,0.2-1.2,0.4-1.7,0.7l-10.5,6.7 c-1.7,1.1-3.6,1.9-5.6,2.4c-8.9,2.3-18.2-1.2-23.4-8.7c-3.1-4.4-4.4-9.9-3.4-15.3c0.9-5.2,4.1-9.9,8.6-12.7l27.5-17.5 c1.7-1.1,3.6-1.9,5.6-2.5c8.9-2.3,18.2,1.2,23.4,8.7c3.2,4.4,4.4,9.9,3.5,15.3c-0.2,0.9-0.4,1.7-0.7,2.6l-0.5,1.6l-1.4-1 c-3.3-2.4-6.9-4.2-10.8-5.4l-1-0.3l0.1-1c0.1-1.4-0.3-2.9-1.1-4.1c-1.6-2.3-4.4-3.3-7.1-2.6c-0.6,0.2-1.2,0.4-1.7,0.7L32.4,46.1 c-1.4,0.9-2.3,2.2-2.6,3.8s0.1,3.3,1,4.6c1.6,2.3,4.4,3.3,7.1,2.6c0.6-0.2,1.2-0.4,1.7-0.7l10.5-6.7c1.7-1.1,3.6-1.9,5.6-2.5 c8.9-2.3,18.2,1.2,23.4,8.7c3.2,4.4,4.4,9.9,3.5,15.3c-0.9,5.2-4.1,9.9-8.6,12.7l-27.5,17.5C44.8,102.5,42.9,103.3,40.9,103.9"- />- </svg>- {:else if application.configuration.build.pack === 'vuejs'}- <svg- class="text-green-500 w-10 h-10 absolute top-0 left-0 -m-4"- viewBox="0 0 128 128"- >- <path- d="m-2.3125e-8 8.9337 49.854 0.1586 14.167 24.47 14.432-24.47 49.547-0.1577-63.834 110.14zm126.98 0.6374-24.36 0.0207-38.476 66.052-38.453-66.052-24.749-0.0194 63.211 107.89zm-25.149-0.008-22.745 0.16758l-15.053 24.647-14.817-24.647-22.794-0.1679 37.731 64.476zM25.997 9.3929l23.002 0.0087M25.997 9.3929l23.002 0.0087"- fill="none"- /><path- d="m25.997 9.3929 23.002 0.0087l15.036 24.958 14.983-24.956 22.982-0.0057-37.85 65.655z"- fill="#35495e"- /><path- d="m0.91068 9.5686 25.066-0.1711 38.151 65.658 37.852-65.654 25.11 0.0263-62.966 108.06z"- fill="#41b883"- />- </svg>- {:else if application.configuration.build.pack === 'nextjs'}- <svg- class="text-blue-500 w-10 h-10 absolute top-0 left-0 -m-4 fill-current"- viewBox="0 0 128 128"- >- <path- d="M64 0C28.7 0 0 28.7 0 64s28.7 64 64 64c11.2 0 21.7-2.9 30.8-7.9L48.4 55.3v36.6h-6.8V41.8h6.8l50.5 75.8C116.4 106.2 128 86.5 128 64c0-35.3-28.7-64-64-64zm22.1 84.6l-7.5-11.3V41.8h7.5v42.8z"- />- </svg>- {:else if application.configuration.build.pack === 'nodejs'}- <svg- class="text-green-400 w-10 h-10 absolute top-0 left-0 -m-4"- xmlns="http://www.w3.org/2000/svg"- aria-hidden="true"- focusable="false"- data-prefix="fab"- data-icon="node-js"- role="img"- viewBox="0 0 448 512"- ><path- fill="currentColor"- d="M224 508c-6.7 0-13.5-1.8-19.4-5.2l-61.7-36.5c-9.2-5.2-4.7-7-1.7-8 12.3-4.3 14.8-5.2 27.9-12.7 1.4-.8 3.2-.5 4.6.4l47.4 28.1c1.7 1 4.1 1 5.7 0l184.7-106.6c1.7-1 2.8-3 2.8-5V149.3c0-2.1-1.1-4-2.9-5.1L226.8 37.7c-1.7-1-4-1-5.7 0L36.6 144.3c-1.8 1-2.9 3-2.9 5.1v213.1c0 2 1.1 4 2.9 4.9l50.6 29.2c27.5 13.7 44.3-2.4 44.3-18.7V167.5c0-3 2.4-5.3 5.4-5.3h23.4c2.9 0 5.4 2.3 5.4 5.3V378c0 36.6-20 57.6-54.7 57.6-10.7 0-19.1 0-42.5-11.6l-48.4-27.9C8.1 389.2.7 376.3.7 362.4V149.3c0-13.8 7.4-26.8 19.4-33.7L204.6 9c11.7-6.6 27.2-6.6 38.8 0l184.7 106.7c12 6.9 19.4 19.8 19.4 33.7v213.1c0 13.8-7.4 26.7-19.4 33.7L243.4 502.8c-5.9 3.4-12.6 5.2-19.4 5.2zm149.1-210.1c0-39.9-27-50.5-83.7-58-57.4-7.6-63.2-11.5-63.2-24.9 0-11.1 4.9-25.9 47.4-25.9 37.9 0 51.9 8.2 57.7 33.8.5 2.4 2.7 4.2 5.2 4.2h24c1.5 0 2.9-.6 3.9-1.7s1.5-2.6 1.4-4.1c-3.7-44.1-33-64.6-92.2-64.6-52.7 0-84.1 22.2-84.1 59.5 0 40.4 31.3 51.6 81.8 56.6 60.5 5.9 65.2 14.8 65.2 26.7 0 20.6-16.6 29.4-55.5 29.4-48.9 0-59.6-12.3-63.2-36.6-.4-2.6-2.6-4.5-5.3-4.5h-23.9c-3 0-5.3 2.4-5.3 5.3 0 31.1 16.9 68.2 97.8 68.2 58.4-.1 92-23.2 92-63.4z"- />- </svg>- {:else if application.configuration.build.pack === 'php'}- <svg- viewBox="0 0 128 128"- class="text-white w-14 h-14 absolute top-0 left-0 -m-6"- >- <path- fill="#6181B6"- d="M64 33.039c-33.74 0-61.094 13.862-61.094 30.961s27.354 30.961 61.094 30.961 61.094-13.862 61.094-30.961-27.354-30.961-61.094-30.961zm-15.897 36.993c-1.458 1.364-3.077 1.927-4.86 2.507-1.783.581-4.052.461-6.811.461h-6.253l-1.733 10h-7.301l6.515-34h14.04c4.224 0 7.305 1.215 9.242 3.432 1.937 2.217 2.519 5.364 1.747 9.337-.319 1.637-.856 3.159-1.614 4.515-.759 1.357-1.75 2.624-2.972 3.748zm21.311 2.968l2.881-14.42c.328-1.688.208-2.942-.361-3.555-.57-.614-1.782-1.025-3.635-1.025h-5.79l-3.731 19h-7.244l6.515-33h7.244l-1.732 9h6.453c4.061 0 6.861.815 8.402 2.231s2.003 3.356 1.387 6.528l-3.031 15.241h-7.358zm40.259-11.178c-.318 1.637-.856 3.133-1.613 4.488-.758 1.357-1.748 2.598-2.971 3.722-1.458 1.364-3.078 1.927-4.86 2.507-1.782.581-4.053.461-6.812.461h-6.253l-1.732 10h-7.301l6.514-34h14.041c4.224 0 7.305 1.215 9.241 3.432 1.935 2.217 2.518 5.418 1.746 9.39zM95.919 54h-5.001l-2.727 14h4.442c2.942 0 5.136-.29 6.576-1.4 1.442-1.108 2.413-2.828 2.918-5.421.484-2.491.264-4.434-.66-5.458-.925-1.024-2.774-1.721-5.548-1.721zM38.934 54h-5.002l-2.727 14h4.441c2.943 0 5.136-.29 6.577-1.4 1.441-1.108 2.413-2.828 2.917-5.421.484-2.491.264-4.434-.66-5.458s-2.772-1.721-5.546-1.721z"- />- </svg>- {:else if application.configuration.build.pack === 'docker'}- <svg viewBox="0 0 128 128" class="w-16 h-16 absolute top-0 left-0 -m-8">- <g- ><path- fill-rule="evenodd"- clip-rule="evenodd"- fill="#3A4D54"- d="M73.8 50.8h11.3v11.5h5.7c2.6 0 5.3-.5 7.8-1.3 1.2-.4 2.6-1 3.8-1.7-1.6-2.1-2.4-4.7-2.6-7.3-.3-3.5.4-8.1 2.8-10.8l1.2-1.4 1.4 1.1c3.6 2.9 6.5 6.8 7.1 11.4 4.3-1.3 9.3-1 13.1 1.2l1.5.9-.8 1.6c-3.2 6.2-9.9 8.2-16.4 7.8-9.8 24.3-31 35.8-56.8 35.8-13.3 0-25.5-5-32.5-16.8l-.1-.2-1-2.1c-2.4-5.2-3.1-10.9-2.6-16.6l.2-1.7h9.6v-11.4h11.3v-11.2h22.5v-11.3h13.5v22.5z"- /><path- fill="#00AADA"- d="M110.4 55.1c.8-5.9-3.6-10.5-6.4-12.7-3.1 3.6-3.6 13.2 1.3 17.2-2.8 2.4-8.5 4.7-14.5 4.7h-72.2c-.6 6.2.5 11.9 3 16.8l.8 1.5c.5.9 1.1 1.7 1.7 2.6 3 .2 5.7.3 8.2.2 4.9-.1 8.9-.7 12-1.7.5-.2.9.1 1.1.5.2.5-.1.9-.5 1.1-.4.1-.8.3-1.3.4-2.4.7-5 1.1-8.3 1.3h-.6000000000000001c-1.3.1-2.7.1-4.2.1-1.6 0-3.1 0-4.9-.1 6 6.8 15.4 10.8 27.2 10.8 25 0 46.2-11.1 55.5-35.9 6.7.7 13.1-1 16-6.7-4.5-2.7-10.5-1.8-13.9-.1z"- /><path- fill="#28B8EB"- d="M110.4 55.1c.8-5.9-3.6-10.5-6.4-12.7-3.1 3.6-3.6 13.2 1.3 17.2-2.8 2.4-8.5 4.7-14.5 4.7h-68c-.3 9.5 3.2 16.7 9.5 21 4.9-.1 8.9-.7 12-1.7.5-.2.9.1 1.1.5.2.5-.1.9-.5 1.1-.4.1-.8.3-1.3.4-2.4.7-5.2 1.2-8.5 1.4l-.1-.1c8.5 4.4 20.8 4.3 35-1.1 15.8-6.1 30.6-17.7 40.9-30.9-.2.1-.4.1-.5.2z"- /><path- fill="#028BB8"- d="M18.7 71.8c.4 3.3 1.4 6.4 2.9 9.3l.8 1.5c.5.9 1.1 1.7 1.7 2.6 3 .2 5.7.3 8.2.2 4.9-.1 8.9-.7 12-1.7.5-.2.9.1 1.1.5.2.5-.1.9-.5 1.1-.4.1-.8.3-1.3.4-2.4.7-5.2 1.2-8.5 1.4h-.4c-1.3.1-2.7.1-4.1.1-1.6 0-3.2 0-4.9-.1 6 6.8 15.5 10.8 27.3 10.8 21.4 0 40-8.1 50.8-26h-85.1v-.1z"- /><path- fill="#019BC6"- d="M23.5 71.8c1.3 5.8 4.3 10.4 8.8 13.5 4.9-.1 8.9-.7 12-1.7.5-.2.9.1 1.1.5.2.5-.1.9-.5 1.1-.4.1-.8.3-1.3.4-2.4.7-5.2 1.2-8.6 1.4 8.5 4.4 20.8 4.3 34.9-1.1 8.5-3.3 16.8-8.2 24.2-14.1h-70.6z"- /><path- fill-rule="evenodd"- clip-rule="evenodd"- fill="#00ACD3"- d="M28.4 52.7h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zM39.6 41.5h9.8v9.8h-9.8v-9.8zm.9.8h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"- /><path- fill-rule="evenodd"- clip-rule="evenodd"- fill="#23C2EE"- d="M39.6 52.7h9.8v9.8h-9.8v-9.8zm.9.8h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"- /><path- fill-rule="evenodd"- clip-rule="evenodd"- fill="#00ACD3"- d="M50.9 52.7h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"- /><path- fill-rule="evenodd"- clip-rule="evenodd"- fill="#23C2EE"- d="M50.9 41.5h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zM62.2 52.7h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"- /><path- fill-rule="evenodd"- clip-rule="evenodd"- fill="#00ACD3"- d="M62.2 41.5h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"- /><path- fill-rule="evenodd"- clip-rule="evenodd"- fill="#23C2EE"- d="M62.2 30.2h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"- /><path- fill-rule="evenodd"- clip-rule="evenodd"- fill="#00ACD3"- d="M73.5 52.7h9.8v9.8h-9.8v-9.8zm.8.8h.8v8.1h-.8v-8.1zm1.4 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1zm1.5 0h.8v8.1h-.8v-8.1z"- /><path- fill-rule="evenodd"- clip-rule="evenodd"- fill="#D4EEF1"- d="M48.8 78.3c1.5 0 2.7 1.2 2.7 2.7 0 1.5-1.2 2.7-2.7 2.7-1.5 0-2.7-1.2-2.7-2.7 0-1.5 1.2-2.7 2.7-2.7"- /><path- fill-rule="evenodd"- clip-rule="evenodd"- fill="#3A4D54"- d="M48.8 79.1c.2 0 .5 0 .7.1-.2.1-.4.4-.4.7 0 .4.4.8.8.8.3 0 .6-.2.7-.4.1.2.1.5.1.7 0 1.1-.9 1.9-1.9 1.9-1.1 0-1.9-.9-1.9-1.9 0-1 .8-1.9 1.9-1.9M1.1 72.8h125.4c-2.7-.7-8.6-1.6-7.7-5.2-5 5.7-16.9 4-20 1.2-3.4 4.9-23 3-24.3-.8-4.2 5-17.3 5-21.5 0-1.4 3.8-21 5.7-24.3.8-3 2.8-15 4.5-20-1.2 1.1 3.5-4.9 4.5-7.6 5.2"- /><path- fill="#BFDBE0"- d="M56 97.8c-6.7-3.2-10.3-7.5-12.4-12.2-2.5.7-5.5 1.2-8.9 1.4-1.3.1-2.7.1-4.1.1-1.7 0-3.4 0-5.2-.1 6 6 13.6 10.7 27.5 10.8h3.1z"- /><path- fill="#D4EEF1"- d="M46.1 89.9c-.9-1.3-1.8-2.8-2.5-4.3-2.5.7-5.5 1.2-8.9 1.4 2.3 1.2 5.7 2.4 11.4 2.9z"- /></g- >- </svg>- {:else if application.configuration.build.pack === 'rust'}- <svg class="w-14 h-14 absolute top-0 left-0 -m-6" viewBox="0 0 128 128">- <path- d="M62.271 10.880 C 62.082 10.990,61.289 12.128,60.508 13.409 C 58.548 16.626,58.526 16.628,55.893 13.857 C 54.180 12.055,53.766 11.725,53.214 11.729 C 52.855 11.731,52.402 11.853,52.206 12.000 C 52.011 12.147,51.458 13.317,50.978 14.600 C 49.879 17.539,49.826 17.634,49.217 17.751 C 48.842 17.822,48.120 17.420,46.389 16.177 C 45.111 15.258,43.857 14.507,43.603 14.507 C 42.549 14.507,42.252 15.083,41.750 18.100 C 41.112 21.936,41.134 21.923,37.676 20.352 C 36.280 19.719,34.956 19.200,34.733 19.200 C 34.510 19.200,34.087 19.440,33.794 19.733 C 33.262 20.266,33.261 20.268,33.406 23.201 L 33.552 26.137 32.997 26.434 C 32.505 26.697,32.166 26.665,29.988 26.150 C 27.145 25.479,26.545 25.497,25.969 26.272 L 25.548 26.838 26.113 29.259 C 26.423 30.590,26.722 31.872,26.778 32.107 C 26.833 32.341,26.738 32.716,26.566 32.939 C 26.282 33.306,25.980 33.339,23.349 33.299 C 18.896 33.229,18.643 33.611,20.483 37.627 C 21.068 38.902,21.547 40.060,21.547 40.199 C 21.547 40.933,20.962 41.200,18.449 41.610 C 17.043 41.839,15.821 42.027,15.733 42.027 C 15.645 42.027,15.381 42.219,15.147 42.453 C 14.382 43.218,14.599 43.936,16.334 46.385 C 18.495 49.435,18.491 49.446,14.921 50.812 C 10.861 52.365,10.779 52.748,13.870 55.680 C 16.749 58.410,16.752 58.370,13.493 60.419 C 11.024 61.970,10.986 62.007,10.923 62.848 C 10.847 63.871,10.865 63.889,13.813 65.690 C 16.728 67.470,16.728 67.524,13.867 70.231 C 10.790 73.141,10.885 73.566,14.948 75.099 C 18.498 76.438,18.503 76.454,16.338 79.504 C 15.111 81.233,14.720 81.953,14.720 82.487 C 14.720 83.486,15.240 83.741,18.347 84.263 C 20.964 84.704,21.547 84.963,21.547 85.685 C 21.547 85.833,21.067 87.001,20.480 88.279 C 18.654 92.256,18.862 92.587,23.184 92.587 C 27.209 92.587,27.102 92.464,26.235 96.094 C 25.581 98.830,25.571 99.354,26.163 99.945 C 26.616 100.399,27.470 100.348,30.141 99.709 C 32.181 99.222,32.539 99.188,33.012 99.441 L 33.552 99.730 33.406 102.665 C 33.261 105.599,33.262 105.601,33.794 106.134 C 34.087 106.427,34.516 106.667,34.746 106.667 C 34.976 106.667,36.300 106.151,37.689 105.520 C 41.136 103.955,41.114 103.942,41.750 107.766 C 42.254 110.797,42.548 111.360,43.624 111.360 C 43.891 111.360,45.118 110.640,46.352 109.760 C 48.519 108.214,49.081 107.972,49.658 108.339 C 49.807 108.433,50.385 109.703,50.942 111.161 C 51.761 113.305,52.061 113.863,52.517 114.081 C 53.385 114.497,53.922 114.163,55.962 111.941 C 58.425 109.258,58.526 109.271,60.537 112.530 C 62.758 116.128,63.333 116.120,65.610 112.457 C 67.572 109.301,67.549 109.303,70.201 112.073 C 71.962 113.911,72.337 114.204,72.931 114.204 C 73.310 114.204,73.763 114.062,73.936 113.888 C 74.110 113.714,74.686 112.429,75.216 111.033 C 75.746 109.636,76.295 108.420,76.437 108.330 C 76.998 107.973,77.579 108.224,79.743 109.760 C 81.017 110.665,82.216 111.360,82.501 111.360 C 83.559 111.360,83.941 110.609,84.381 107.657 C 84.757 105.140,84.833 104.899,85.328 104.648 C 85.815 104.401,86.107 104.484,88.391 105.521 C 89.780 106.151,91.104 106.667,91.334 106.667 C 91.564 106.667,92.000 106.420,92.301 106.118 L 92.850 105.570 92.699 102.755 C 92.555 100.067,92.568 99.923,92.997 99.535 C 93.438 99.136,93.483 99.138,95.949 99.701 C 98.935 100.383,99.492 100.401,100.053 99.840 C 100.601 99.292,100.595 99.172,99.845 96.009 C 99.004 92.461,98.891 92.587,102.933 92.587 C 105.688 92.587,105.995 92.548,106.346 92.161 C 106.932 91.513,106.793 90.771,105.614 88.258 C 105.019 86.992,104.536 85.840,104.540 85.698 C 104.560 84.951,105.147 84.696,107.860 84.255 C 109.520 83.986,110.762 83.674,110.987 83.471 C 111.741 82.790,111.464 81.904,109.743 79.491 C 107.586 76.467,107.595 76.438,111.049 75.165 C 115.185 73.641,115.303 73.133,112.208 70.192 C 109.341 67.468,109.340 67.483,112.480 65.555 C 116.276 63.225,116.282 62.700,112.547 60.382 C 109.335 58.389,109.337 58.417,112.216 55.683 C 115.304 52.749,115.220 52.365,111.159 50.812 C 107.575 49.441,107.564 49.407,109.742 46.418 C 111.039 44.638,111.360 44.047,111.360 43.437 C 111.360 42.371,110.882 42.132,107.738 41.624 C 105.111 41.200,104.533 40.942,104.533 40.195 C 104.533 40.053,105.013 38.910,105.600 37.653 C 106.749 35.192,106.910 34.207,106.260 33.618 C 105.911 33.302,105.443 33.257,102.939 33.298 C 100.319 33.342,99.984 33.305,99.621 32.940 C 99.224 32.541,99.228 32.485,99.848 29.898 C 100.608 26.728,100.611 26.651,99.986 26.064 C 99.352 25.468,98.956 25.478,96.045 26.163 C 93.924 26.663,93.573 26.696,93.091 26.438 L 92.544 26.145 92.695 23.219 L 92.847 20.294 92.300 19.747 C 91.999 19.446,91.572 19.200,91.350 19.200 C 91.129 19.200,89.812 19.723,88.424 20.361 C 86.106 21.428,85.857 21.499,85.356 21.237 C 84.856 20.975,84.773 20.717,84.346 18.110 C 83.853 15.094,83.548 14.507,82.477 14.507 C 82.223 14.507,80.964 15.262,79.679 16.185 C 77.569 17.701,77.286 17.844,76.760 17.661 C 76.325 17.509,76.072 17.178,75.763 16.355 C 75.534 15.749,75.096 14.581,74.788 13.760 C 74.166 12.104,73.819 11.733,72.887 11.733 C 72.367 11.733,71.896 12.107,70.208 13.860 C 67.555 16.616,67.545 16.615,65.594 13.415 C 64.814 12.136,63.999 10.994,63.782 10.878 C 63.294 10.616,62.720 10.617,62.271 10.880 M64.689 20.515 C 67.000 22.160,65.771 26.027,62.937 26.027 C 60.187 26.027,58.802 22.714,60.766 20.833 C 61.874 19.771,63.463 19.642,64.689 20.515 M61.783 30.729 C 63.298 31.305,63.920 30.959,67.379 27.625 L 69.978 25.119 71.078 25.265 C 74.528 25.723,81.390 28.737,85.333 31.526 C 88.956 34.090,93.771 39.312,95.823 42.903 L 96.262 43.672 94.318 48.052 C 93.248 50.461,92.373 52.685,92.373 52.996 C 92.373 53.713,92.843 54.847,93.296 55.222 C 93.487 55.381,95.302 56.255,97.329 57.164 L 101.013 58.818 101.158 59.755 C 101.345 60.976,101.370 63.975,101.200 64.827 L 101.067 65.493 98.964 65.493 C 96.525 65.493,96.713 65.275,96.581 68.267 C 96.485 70.436,95.961 71.635,94.769 72.411 C 92.827 73.678,89.620 73.448,88.260 71.945 C 88.051 71.714,87.645 70.553,87.357 69.364 C 86.516 65.891,85.386 63.941,83.116 62.044 C 82.399 61.445,81.813 60.886,81.813 60.801 C 81.813 60.717,82.601 60.053,83.565 59.328 C 87.075 56.682,89.093 53.602,89.315 50.551 C 89.738 44.732,85.102 39.308,78.206 37.550 C 76.571 37.133,75.873 37.120,55.646 37.120 C 44.166 37.120,34.773 37.045,34.773 36.954 C 34.773 36.739,37.324 34.263,38.827 33.021 C 42.954 29.609,48.315 26.924,53.867 25.490 L 55.787 24.993 58.515 27.759 C 60.016 29.280,61.487 30.616,61.783 30.729 M27.432 48.526 C 28.689 49.349,29.204 51.417,28.462 52.660 C 27.314 54.584,24.406 54.665,23.257 52.805 C 21.586 50.103,24.804 46.804,27.432 48.526 M101.482 48.631 C 104.770 50.636,102.222 55.568,98.702 54.011 C 96.352 52.971,96.277 49.759,98.575 48.587 C 99.534 48.098,100.636 48.115,101.482 48.631 M37.120 60.907 L 37.120 73.173 31.698 73.173 L 26.276 73.173 25.846 71.307 C 25.000 67.632,24.644 63.830,24.857 60.716 L 25.006 58.528 28.734 56.856 C 31.073 55.808,32.577 55.009,32.771 54.712 C 33.619 53.419,33.538 52.495,32.348 49.867 L 31.792 48.640 34.456 48.640 L 37.120 48.640 37.120 60.907 M68.340 49.174 C 70.662 49.778,71.889 51.007,71.892 52.730 C 71.894 53.995,71.267 54.789,69.712 55.491 C 68.611 55.989,68.436 56.001,61.493 56.069 L 54.400 56.137 54.400 52.495 L 54.400 48.853 60.755 48.853 C 65.719 48.853,67.380 48.923,68.340 49.174 M65.944 66.776 C 67.095 67.096,68.456 68.096,69.154 69.135 C 69.887 70.227,70.316 71.647,71.332 76.351 C 72.190 80.327,72.742 81.627,74.288 83.319 C 76.203 85.414,75.759 85.333,85.325 85.333 C 89.906 85.333,93.653 85.406,93.653 85.496 C 93.653 85.657,90.498 89.387,90.362 89.387 C 90.323 89.387,88.675 89.042,86.700 88.620 C 81.123 87.429,80.922 87.569,79.642 93.546 L 78.819 97.386 78.076 97.752 C 76.836 98.364,72.806 99.624,70.717 100.054 C 67.265 100.764,63.508 101.004,60.206 100.725 C 54.577 100.248,47.123 98.064,46.832 96.805 C 46.770 96.538,46.395 94.810,46.000 92.964 C 45.604 91.118,45.123 89.367,44.931 89.073 C 44.008 87.665,43.037 87.578,38.767 88.523 C 37.150 88.881,35.739 89.173,35.631 89.173 C 35.428 89.173,32.427 85.703,32.427 85.469 C 32.427 85.396,39.555 85.311,48.267 85.281 L 64.107 85.227 64.164 79.600 C 64.204 75.627,64.149 73.886,63.977 73.680 C 63.785 73.448,62.763 73.387,59.067 73.387 L 54.400 73.387 54.400 69.973 L 54.400 66.560 59.787 66.561 C 62.749 66.562,65.520 66.659,65.944 66.776 M41.536 92.365 C 44.055 93.900,42.847 97.922,39.868 97.919 C 36.813 97.917,35.681 93.932,38.284 92.344 C 39.145 91.819,40.658 91.829,41.536 92.365 M87.662 92.533 C 88.897 93.438,89.308 95.321,88.543 96.575 C 86.534 99.870,81.510 97.251,83.188 93.784 C 84.013 92.081,86.206 91.467,87.662 92.533 "- stroke="none"- fill="rgb(239, 68, 68)"- fill-rule="evenodd"- />- </svg>- {:else if application.configuration.build.pack === 'python'}- <svg class="w-14 h-14 absolute top-0 left-0 -m-6" viewBox="0 0 128 128">- <linearGradient- id="a"- gradientUnits="userSpaceOnUse"- x1="70.252"- y1="1237.476"- x2="170.659"- y2="1151.089"- gradientTransform="matrix(.563 0 0 -.568 -29.215 707.817)"- ><stop offset="0" stop-color="#5A9FD4" /><stop- offset="1"- stop-color="#306998"- /></linearGradient- ><path- fill="url(#a)"- d="M63.391 1.988c-4.222.02-8.252.379-11.8 1.007-10.45 1.846-12.346 5.71-12.346 12.837v9.411h24.693v3.137h-33.961c-7.176 0-13.46 4.313-15.426 12.521-2.268 9.405-2.368 15.275 0 25.096 1.755 7.311 5.947 12.519 13.124 12.519h8.491v-11.282c0-8.151 7.051-15.34 15.426-15.34h24.665c6.866 0 12.346-5.654 12.346-12.548v-23.513c0-6.693-5.646-11.72-12.346-12.837-4.244-.706-8.645-1.027-12.866-1.008zm-13.354 7.569c2.55 0 4.634 2.117 4.634 4.721 0 2.593-2.083 4.69-4.634 4.69-2.56 0-4.633-2.097-4.633-4.69-.001-2.604 2.073-4.721 4.633-4.721z"- /><linearGradient- id="b"- gradientUnits="userSpaceOnUse"- x1="209.474"- y1="1098.811"- x2="173.62"- y2="1149.537"- gradientTransform="matrix(.563 0 0 -.568 -29.215 707.817)"- ><stop offset="0" stop-color="#FFD43B" /><stop- offset="1"- stop-color="#FFE873"- /></linearGradient- ><path- fill="url(#b)"- d="M91.682 28.38v10.966c0 8.5-7.208 15.655-15.426 15.655h-24.665c-6.756 0-12.346 5.783-12.346 12.549v23.515c0 6.691 5.818 10.628 12.346 12.547 7.816 2.297 15.312 2.713 24.665 0 6.216-1.801 12.346-5.423 12.346-12.547v-9.412h-24.664v-3.138h37.012c7.176 0 9.852-5.005 12.348-12.519 2.578-7.735 2.467-15.174 0-25.096-1.774-7.145-5.161-12.521-12.348-12.521h-9.268zm-13.873 59.547c2.561 0 4.634 2.097 4.634 4.692 0 2.602-2.074 4.719-4.634 4.719-2.55 0-4.633-2.117-4.633-4.719 0-2.595 2.083-4.692 4.633-4.692z"- /><radialGradient- id="c"- cx="1825.678"- cy="444.45"- r="26.743"- gradientTransform="matrix(0 -.24 -1.055 0 532.979 557.576)"- gradientUnits="userSpaceOnUse"- ><stop offset="0" stop-color="#B8B8B8" stop-opacity=".498" /><stop- offset="1"- stop-color="#7F7F7F"- stop-opacity="0"- /></radialGradient- ><path- opacity=".444"- fill="url(#c)"- enable-background="new"- d="M97.309 119.597c0 3.543-14.816 6.416-33.091 6.416-18.276 0-33.092-2.873-33.092-6.416 0-3.544 14.815-6.417 33.092-6.417 18.275 0 33.091 2.872 33.091 6.417z"- />- </svg>- {/if}- <div class="flex flex-col justify-center items-center w-full">- <div class="text-base font-bold text-center w-full text-white pb-6">- {application.configuration.publish.domain}{application.configuration.publish- .path !== '/'- ? application.configuration.publish.path- : ''}- </div>- <div- class="text-xs font-bold text-center w-full text-warmGray-300 group-hover:text-white"- >- Last deployment<br />- {new Intl.DateTimeFormat('default', dateOptions).format(- new Date(application.UpdatedAt)- )}- </div>- </div>- </div>- </div>- </div>- {/each}- </div>- </div>- {:else}- <div class="text-2xl font-bold text-center">No applications found</div>- {/if}-</div>diff --git a/src/routes/dashboard/databases.svelte b/src/routes/dashboard/databases.sveltedeleted file mode 100644index f3181c5f04..0000000000--- a/src/routes/dashboard/databases.svelte+++ /dev/null@@ -1,100 +0,0 @@-<script context="module" lang="ts">- /**- * @type {import('@sveltejs/kit').Load}- */- export async function load(session) {- if (!browser && !process.env.VITE_GITHUB_APP_CLIENTID) {- return {- status: 302,- redirect: '/dashboard/services'- };- }- return {};- }-</script>--<script>- import { goto } from '$app/navigation';- import MongoDb from '$components/Database/SVGs/MongoDb.svelte';- import Postgresql from '$components/Database/SVGs/Postgresql.svelte';- import Clickhouse from '$components/Database/SVGs/Clickhouse.svelte';- import CouchDb from '$components/Database/SVGs/CouchDb.svelte';- import Mysql from '$components/Database/SVGs/Mysql.svelte';- import { dashboard } from '$store';- import { fade } from 'svelte/transition';- import Redis from '$components/Database/SVGs/Redis.svelte';- import { browser } from '$app/env';-</script>--<div class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center">- <div in:fade={{ duration: 100 }}>Databases</div>- <button- class="icon p-1 ml-4 bg-purple-500 hover:bg-purple-400"- on:click={() => goto('/database/new')}- >- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M12 6v6m0 0v6m0-6h6m-6 0H6"- />- </svg>- </button>-</div>-<div in:fade={{ duration: 100 }}>- {#if $dashboard.databases?.deployed.length > 0}- <div class="px-4 mx-auto py-5">- <div class="flex items-center justify-center flex-wrap">- {#each $dashboard.databases.deployed as database}- <div- in:fade={{ duration: 200 }}- class="px-4 pb-4"- on:click={() =>- goto(`/database/${database.configuration.general.deployId}/configuration`)}- >- <div- class="relative rounded-xl p-6 bg-warmGray-800 border-2 border-dashed border-transparent hover:border-purple-500 text-white shadow-md cursor-pointer ease-in-out hover:scale-105 duration-100 group"- >- <div class="flex items-center">- {#if database.configuration.general.type == 'mongodb'}- <MongoDb customClass="w-10 h-10 absolute top-0 left-0 -m-4" />- {:else if database.configuration.general.type == 'postgresql'}- <Postgresql customClass="w-10 h-10 absolute top-0 left-0 -m-4" />- {:else if database.configuration.general.type == 'mysql'}- <Mysql customClass="w-10 h-10 absolute top-0 left-0 -m-4" />- {:else if database.configuration.general.type == 'couchdb'}- <CouchDb- customClass="w-10 h-10 fill-current text-red-600 absolute top-0 left-0 -m-4"- />- {:else if database.configuration.general.type == 'redis'}- <Redis customClass="w-10 h-10 absolute top-0 left-0 -m-4" />- {:else if database.configuration.general.type == 'clickhouse'}- <Clickhouse- customClass="w-10 h-10 fill-current text-red-600 absolute top-0 left-0 -m-4"- />- {/if}- <div class="text-center w-full">- <div class="text-base font-bold text-white group-hover:text-white">- {database.configuration.general.nickname}- </div>- <div class="text-xs font-bold text-warmGray-300 ">- ({database.configuration.general.type})- </div>- </div>- </div>- </div>- </div>- {/each}- </div>- </div>- {:else}- <div class="text-2xl font-bold text-center">No databases found</div>- {/if}-</div>diff --git a/src/routes/dashboard/services.svelte b/src/routes/dashboard/services.sveltedeleted file mode 100644index 0a230a161d..0000000000--- a/src/routes/dashboard/services.svelte+++ /dev/null@@ -1,124 +0,0 @@-<script>- import { goto } from '$app/navigation';- import { dashboard } from '$store';- import { fade } from 'svelte/transition';- async function openConfiguration(service) {- if (service.serviceName === 'wordpress') {- goto(`/service/${service.configuration.deployId}/configuration`);- } else {- goto(`/service/${service.serviceName}/configuration`);- }- }--</script>--<div- in:fade={{ duration: 100 }}- class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center"->- <div>Services</div>- <button class="icon p-1 ml-4 bg-blue-500 hover:bg-blue-400" on:click={() => goto('/service/new')}>- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M12 6v6m0 0v6m0-6h6m-6 0H6"- />- </svg>- </button>-</div>-<div in:fade={{ duration: 100 }}>- {#if $dashboard?.services?.deployed.length > 0}- <div class="px-4 mx-auto py-5">- <div class="flex items-center justify-center flex-wrap">- {#each $dashboard?.services?.deployed as service}- <div- in:fade={{ duration: 200 }}- class="px-4 pb-4"- on:click={() => openConfiguration(service)}- >- <div- class="relative rounded-xl p-6 bg-warmGray-800 border-2 border-dashed border-transparent hover:border-blue-500 text-white shadow-md cursor-pointer ease-in-out hover:scale-105 duration-100 group"- >- <div class="flex items-center">- {#if service.serviceName == 'plausible'}- <div>- <img- alt="plausible logo"- class="w-10 absolute top-0 left-0 -m-6"- src="https://cdn.coollabs.io/assets/coolify/services/plausible/logo_sm.png"- />- <div class="text-white font-bold">Plausible Analytics</div>- </div>- {:else if service.serviceName == 'nocodb'}- <div>- <img- alt="nocodedb"- class="w-10 absolute top-0 left-0 -m-6"- src="https://cdn.coollabs.io/assets/coolify/services/nocodb/nocodb.png"- />- <div class="text-white font-bold">NocoDB</div>- </div>- {:else if service.serviceName == 'code-server'}- <div>- <svg class="w-10 absolute top-0 left-0 -m-6" viewBox="0 0 128 128">- <path- d="M3.656 45.043s-3.027-2.191.61-5.113l8.468-7.594s2.426-2.559 4.989-.328l78.175 59.328v28.45s-.039 4.468-5.757 3.976zm0 0"- fill="#2489ca"- /><path- d="M23.809 63.379L3.656 81.742s-2.07 1.543 0 4.305l9.356 8.527s2.222 2.395 5.508-.328l21.359-16.238zm0 0"- fill="#1070b3"- /><path- d="M59.184 63.531l36.953-28.285-.239-28.297S94.32.773 89.055 3.99L39.879 48.851zm0 0"- fill="#0877b9"- /><path- d="M90.14 123.797c2.145 2.203 4.747 1.48 4.747 1.48l28.797-14.222c3.687-2.52 3.171-5.645 3.171-5.645V20.465c0-3.735-3.812-5.024-3.812-5.024L98.082 3.38c-5.453-3.379-9.027.61-9.027.61s4.593-3.317 6.843 2.96v112.317c0 .773-.164 1.53-.492 2.214-.656 1.332-2.086 2.57-5.504 2.051zm0 0"- fill="#3c99d4"- />- </svg>-- <div class="text-white font-bold">VSCode Server</div>- </div>- {:else if service.serviceName == 'minio'}- <div>- <img- alt="minio"- class="w-7 absolute top-0 left-0 -my-7 -mx-3"- src="https://cdn.coollabs.io/assets/coolify/services/minio/MINIO_Bird.png"- />-- <div class="text-white font-bold">MinIO</div>- </div>- {:else if service.serviceName.match(/wp-/)}- <svg class="w-10 absolute top-0 left-0 -m-6" viewBox="0 0 128 128">- <path- fill-rule="evenodd"- clip-rule="evenodd"- fill="white"- d="M64.094 126.224c34.275-.052 62.021-27.933 62.021-62.325 0-33.833-27.618-61.697-60.613-62.286C30.85.995 1.894 29.113 1.885 63.21c-.01 35.079 27.612 63.064 62.209 63.014zM63.993 4.63c32.907-.011 59.126 26.725 59.116 60.28-.011 31.679-26.925 58.18-59.092 58.187-32.771.007-59.125-26.563-59.124-59.608.002-32.193 26.766-58.848 59.1-58.859zM39.157 35.896c.538 1.793-.968 2.417-2.569 2.542-1.685.13-3.369.257-5.325.406 6.456 19.234 12.815 38.183 19.325 57.573.464-.759.655-.973.739-1.223 3.574-10.682 7.168-21.357 10.651-32.069.318-.977.16-2.271-.188-3.275-1.843-5.32-4.051-10.524-5.667-15.908-1.105-3.686-2.571-6.071-6.928-5.644-.742.073-1.648-1.524-2.479-2.349 1.005-.6 2.003-1.704 3.017-1.719a849.593 849.593 0 0126.618.008c1.018.017 2.016 1.15 3.021 1.765-.88.804-1.639 2.01-2.668 2.321-1.651.498-3.482.404-5.458.58l19.349 57.56c2.931-9.736 5.658-18.676 8.31-27.639 2.366-8.001.956-15.473-3.322-22.52-1.286-2.119-2.866-4.175-3.595-6.486-.828-2.629-1.516-5.622-1.077-8.259.745-4.469 4.174-6.688 8.814-7.113C74.333.881 34.431 9.317 19.728 34.922c5.66-.261 11.064-.604 16.472-.678 1.022-.013 2.717.851 2.957 1.652zm10.117 77.971c-.118.345-.125.729-.218 1.302 10.943 3.034 21.675 2.815 32.659-.886l-16.78-45.96c-5.37 15.611-10.52 30.575-15.661 45.544zm-8.456-2.078l-25.281-69.35c-11.405 22.278-2.729 56.268 25.281 69.35zm76.428-44.562c.802-10.534-2.832-25.119-5.97-27.125-.35 3.875-.106 8.186-1.218 12.114-2.617 9.255-5.817 18.349-8.899 27.468-3.35 9.912-6.832 19.779-10.257 29.666 16.092-9.539 24.935-23.618 26.344-42.123z"- />- </svg>- <div class="text-white font-bold text-center">- Wordpress<span- class="flex text-xs items-center justify-center text-warmGray-300 group-hover:text-white"- >({service.configuration.baseURL.replace('https://', '')})</span- >- </div>- {/if}- </div>- </div>- </div>- {/each}- </div>- </div>- {:else}- <div class="text-2xl font-bold text-center">No services found</div>- {/if}-</div>diff --git a/src/routes/database/[name]/configuration.svelte b/src/routes/database/[name]/configuration.sveltedeleted file mode 100644index 2288d6b121..0000000000--- a/src/routes/database/[name]/configuration.svelte+++ /dev/null@@ -1,123 +0,0 @@-<script>- import { database } from '$store';- import { page, session } from '$app/stores';- import { request } from '$lib/request';- import { fade } from 'svelte/transition';- import { goto } from '$app/navigation';- import MongoDb from '$components/Database/SVGs/MongoDb.svelte';- import Postgresql from '$components/Database/SVGs/Postgresql.svelte';- import Mysql from '$components/Database/SVGs/Mysql.svelte';- import CouchDb from '$components/Database/SVGs/CouchDb.svelte';- import Loading from '$components/Loading.svelte';- import PasswordField from '$components/PasswordField.svelte';- import { browser } from '$app/env';- import { toast } from '@zerodevx/svelte-toast';- import Redis from '$components/Database/SVGs/Redis.svelte';-- async function backup() {- try {- await request(`/api/v1/databases/${$page.params.name}/backup`, $session, { body: {} });-- browser && toast.push(`Successfully created backup.`);- } catch (error) {- console.log(error);- if (error.code === 501) {- browser && toast.push(error.error);- } else {- browser && toast.push(`Error occured during database backup!`);- }- }- }- async function loadDatabaseConfig() {- if ($page.params.name) {- try {- $database = await request(`/api/v1/databases/${$page.params.name}`, $session);- } catch (error) {- browser && goto(`/dashboard/databases`, { replaceState: true });- }- } else {- browser && goto(`/dashboard/databases`, { replaceState: true });- }- }--</script>--{#await loadDatabaseConfig()}- <Loading />-{:then}- <div class="min-h-full text-white">- <div class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center">- <div>{$database.config.general.nickname}</div>- <div class="px-4">- {#if $database.config.general.type === 'mongodb'}- <MongoDb customClass="w-8 h-8" />- {:else if $database.config.general.type === 'postgresql'}- <Postgresql customClass="w-8 h-8" />- {:else if $database.config.general.type === 'mysql'}- <Mysql customClass="w-8 h-8" />- {:else if $database.config.general.type === 'couchdb'}- <CouchDb customClass="w-8 h-8 fill-current text-red-600" />- {:else if $database.config.general.type === 'redis'}- <Redis customClass="w-8 h-8" />- {/if}- </div>- </div>- </div>- <div class="text-left max-w-6xl mx-auto px-6" in:fade={{ duration: 100 }}>- <div class="pb-2 pt-5 space-y-4">- <div class="text-2xl font-bold border-gradient w-32">Database</div>- <div class="flex items-center pt-4">- <div class="font-bold w-64 text-warmGray-400">Connection string</div>- {#if $database.config.general.type === 'mongodb'}- <PasswordField- value={`mongodb://${$database.envs.MONGODB_USERNAME}:${$database.envs.MONGODB_PASSWORD}@${$database.config.general.deployId}:27017/${$database.envs.MONGODB_DATABASE}`}- />- {:else if $database.config.general.type === 'postgresql'}- <PasswordField- value={`postgresql://${$database.envs.POSTGRESQL_USERNAME}:${$database.envs.POSTGRESQL_PASSWORD}@${$database.config.general.deployId}:5432/${$database.envs.POSTGRESQL_DATABASE}`}- />- {:else if $database.config.general.type === 'mysql'}- <PasswordField- value={`mysql://${$database.envs.MYSQL_USER}:${$database.envs.MYSQL_PASSWORD}@${$database.config.general.deployId}:3306/${$database.envs.MYSQL_DATABASE}`}- />- {:else if $database.config.general.type === 'couchdb'}- <PasswordField- value={`http://${$database.envs.COUCHDB_USER}:${$database.envs.COUCHDB_PASSWORD}@${$database.config.general.deployId}:5984`}- />- {:else if $database.config.general.type === 'redis'}- <PasswordField- value={`redis://${$database.envs.REDIS_PASSWORD}@${$database.config.general.deployId}:6379`}- />- {:else if $database.config.general.type === 'clickhouse'}- <!-- {JSON.stringify($database)} -->- <!-- <textarea- disabled- class="w-full"- value="{`postgresql://${$database.envs.POSTGRESQL_USERNAME}:${$database.envs.POSTGRESQL_PASSWORD}@${$database.config.general.deployId}:5432/${$database.envs.POSTGRESQL_DATABASE}`}"- ></textarea> -->- {/if}- </div>- </div>- {#if $database.config.general.type === 'mongodb'}- <div class="flex items-center">- <div class="font-bold w-64 text-warmGray-400">Root password</div>- <PasswordField value={$database.envs.MONGODB_ROOT_PASSWORD} />- </div>- {/if}- {#if $database.config.general.type === 'redis'}- <div class="flex items-center">- <div class="font-bold w-64 text-warmGray-400">Redis password</div>- <PasswordField value={$database.envs.REDIS_PASSWORD} />- </div>- {/if}- <div class="pb-2 pt-5 space-y-4">- <div class="text-2xl font-bold border-gradient w-32">Backup</div>- <div class="pt-4">- <button- class="button hover:bg-warmGray-700 bg-warmGray-800 rounded p-2 font-bold "- on:click={backup}>Download database backup</button- >- </div>- </div>- </div>-{/await}diff --git a/src/routes/database/__layout.svelte b/src/routes/database/__layout.sveltedeleted file mode 100644index 00edc53daf..0000000000--- a/src/routes/database/__layout.svelte+++ /dev/null@@ -1,78 +0,0 @@-<script>- import { browser } from '$app/env';-- import { goto } from '$app/navigation';- import { page, session } from '$app/stores';- import Tooltip from '$components/Tooltip.svelte';- import { request } from '$lib/request';- import { database, initialDatabase } from '$store';- import { toast } from '@zerodevx/svelte-toast';- import { onDestroy } from 'svelte';-- onDestroy(() => {- $database = JSON.parse(JSON.stringify(initialDatabase));- });-- async function removeDB() {- await request(`/api/v1/databases/${$page.params.name}`, $session, {- method: 'DELETE'- });- if (browser) {- toast.push('Database removed.');- goto(`/dashboard/databases`, { replaceState: true });- }- }-</script>--{#if $page.path !== '/database/new'}- <nav class="flex text-white justify-end items-center m-4 fixed right-0 top-0 space-x-4">- <Tooltip position="bottom" label="Delete">- <button title="Delete" class="icon hover:text-red-500" on:click={removeDB}>- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"- />- </svg>- </button>- </Tooltip>- <div class="border border-warmGray-700 h-8" />- <Tooltip position="bottom-left" label="Configuration">- <button- class="icon hover:text-yellow-400"- disabled={$page.path === '/database/new'}- class:text-yellow-400={$page.path.endsWith('configuration') ||- $page.path === '/database/new'}- class:bg-warmGray-700={$page.path.endsWith('configuration') ||- $page.path === '/database/new'}- on:click={() => goto(`/database/${$page.params.name}/configuration`)}- >- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"- />- </svg>- </button>- </Tooltip>- </nav>-{/if}-<div class="text-white">- <slot />-</div>diff --git a/src/routes/database/new.svelte b/src/routes/database/new.sveltedeleted file mode 100644index 4253673dc2..0000000000--- a/src/routes/database/new.svelte+++ /dev/null@@ -1,11 +0,0 @@-<script>- import Configuration from '$components/Database/Configuration.svelte';-</script>--<div class="min-h-full text-white">- <div class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center">- Select a database- </div>-</div>--<Configuration />diff --git a/src/routes/databases/[id]/_Databases/_CouchDb.svelte b/src/routes/databases/[id]/_Databases/_CouchDb.sveltenew file mode 100644index 0000000000..0d41ec1848--- /dev/null+++ b/src/routes/databases/[id]/_Databases/_CouchDb.svelte@@ -0,0 +1,78 @@+<script>+ export let database;+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';+</script>++<div class="flex space-x-1 py-5 font-bold">+ <div class="title">CouchDB</div>+</div>+<div class="px-10">+ <div class="grid grid-cols-3 items-center">+ <label for="defaultDatabase">Default Database</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ required+ readonly={database.defaultDatabase}+ disabled={database.defaultDatabase}+ placeholder="eg: mydb"+ id="defaultDatabase"+ name="defaultDatabase"+ bind:value={database.defaultDatabase}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="dbUser">User</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ placeholder="Generated automatically after start"+ id="dbUser"+ name="dbUser"+ value={database.dbUser}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="dbUserPassword">Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ placeholder="Generated automatically after start"+ isPasswordField+ id="dbUserPassword"+ name="dbUserPassword"+ value={database.dbUserPassword}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="rootUser">Root User</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ placeholder="Generated automatically after start"+ id="rootUser"+ name="rootUser"+ value={database.rootUser}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="rootUserPassword">Root's Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ placeholder="Generated automatically after start"+ isPasswordField+ id="rootUserPassword"+ name="rootUserPassword"+ value={database.rootUserPassword}+ />+ </div>+ </div>+</div>diff --git a/src/routes/databases/[id]/_Databases/_Databases.svelte b/src/routes/databases/[id]/_Databases/_Databases.sveltenew file mode 100644index 0000000000..1483cab1b4--- /dev/null+++ b/src/routes/databases/[id]/_Databases/_Databases.svelte@@ -0,0 +1,209 @@+<script lang="ts">+ export let database;+ export let privatePort;+ export let settings;+ import { page, session } from '$app/stores';+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';+ import Setting from '$lib/components/Setting.svelte';+ import { errorNotification } from '$lib/form';++ import MySql from './_MySQL.svelte';+ import MongoDb from './_MongoDB.svelte';+ import PostgreSql from './_PostgreSQL.svelte';+ import Redis from './_Redis.svelte';+ import CouchDb from './_CouchDb.svelte';+ import { browser } from '$app/env';+ import { post } from '$lib/api';+ import { getDomain } from '$lib/components/common';++ const { id } = $page.params;+ let loading = false;+ let isPublic = database.settings.isPublic || false;+ let appendOnly = database.settings.appendOnly;++ let databaseDefault = database.defaultDatabase;+ let databaseDbUser = database.dbUser;+ let databaseDbUserPassword = database.dbUserPassword;+ if (database.type === 'mongodb') {+ databaseDefault = '?readPreference=primary&ssl=false';+ databaseDbUser = database.rootUser;+ databaseDbUserPassword = database.rootUserPassword;+ } else if (database.type === 'redis') {+ databaseDefault = '';+ databaseDbUser = '';+ }+ let databaseUrl = generateUrl();++ function generateUrl() {+ return browser+ ? `${database.type}://${+ databaseDbUser ? databaseDbUser + ':' : ''+ }${databaseDbUserPassword}@${+ isPublic+ ? settings.fqdn+ ? getDomain(settings.fqdn)+ : window.location.hostname+ : database.id+ }:${isPublic ? database.publicPort : privatePort}/${databaseDefault}`+ : 'Loading...';+ }++ async function changeSettings(name) {+ if (name === 'isPublic') {+ isPublic = !isPublic;+ }+ if (name === 'appendOnly') {+ appendOnly = !appendOnly;+ }+ try {+ await post(`/databases/${id}/settings.json`, { isPublic, appendOnly });+ databaseUrl = generateUrl();+ return;+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function handleSubmit() {+ try {+ await post(`/databases/${id}.json`, { ...database });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="mx-auto max-w-4xl px-6">+ <form on:submit|preventDefault={handleSubmit} class="py-4">+ <div class="flex space-x-1 pb-5 font-bold">+ <div class="title">General</div>+ {#if $session.isAdmin}+ <button+ type="submit"+ class:bg-purple-600={!loading}+ class:hover:bg-purple-500={!loading}+ disabled={loading}>{loading ? 'Saving...' : 'Save'}</button+ >+ {/if}+ </div>++ <div class="grid grid-flow-row gap-2 px-10">+ <div class="grid grid-cols-3 items-center">+ <label for="name">Name</label>+ <div class="col-span-2 ">+ <input+ readonly={!$session.isAdmin}+ name="name"+ id="name"+ bind:value={database.name}+ required+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="destination">Destination</label>+ <div class="col-span-2">+ {#if database.destinationDockerId}+ <div class="no-underline">+ <input+ value={database.destinationDocker.name}+ id="destination"+ disabled+ readonly+ class="bg-transparent "+ />+ </div>+ {/if}+ </div>+ </div>++ <div class="grid grid-cols-3 items-center">+ <label for="version">Version</label>+ <div class="col-span-2 ">+ <input value={database.version} readonly disabled class="bg-transparent " />+ </div>+ </div>+ </div>++ <div class="grid grid-flow-row gap-2 px-10">+ <div class="grid grid-cols-3 items-center">+ <label for="host">Host</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ placeholder="Generated automatically after start"+ isPasswordField={false}+ readonly+ disabled+ id="host"+ name="host"+ value={database.id}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="publicPort">Port</label>+ <div class="col-span-2">+ <CopyPasswordField+ placeholder="Generated automatically after start"+ id="publicPort"+ readonly+ disabled+ name="publicPort"+ value={isPublic ? database.publicPort : privatePort}+ />+ </div>+ </div>+ </div>+ <div class="grid grid-flow-row gap-2">+ {#if database.type === 'mysql'}+ <MySql bind:database />+ {:else if database.type === 'postgresql'}+ <PostgreSql bind:database />+ {:else if database.type === 'mongodb'}+ <MongoDb {database} />+ {:else if database.type === 'redis'}+ <Redis {database} />+ {:else if database.type === 'couchdb'}+ <CouchDb bind:database />+ {/if}+ <div class="grid grid-cols-3 items-center px-10 pb-8">+ <label for="url">Connection String</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ textarea={true}+ placeholder="Generated automatically after start"+ isPasswordField={false}+ id="url"+ name="url"+ readonly+ disabled+ value={databaseUrl}+ />+ </div>+ </div>+ </div>+ </form>+ <div class="flex space-x-1 pb-5 font-bold">+ <div class="title">Features</div>+ </div>+ <div class="px-4 pb-10 sm:px-6">+ <ul class="mt-2 divide-y divide-stone-800">+ <Setting+ bind:setting={isPublic}+ on:click={() => changeSettings('isPublic')}+ title="Set it public"+ description="Your database will be reachable over the internet. <br>Take security seriously in this case!"+ />+ </ul>+ {#if database.type === 'redis'}+ <ul class="mt-2 divide-y divide-stone-800">+ <Setting+ bind:setting={appendOnly}+ on:click={() => changeSettings('appendOnly')}+ title="Change append only mode"+ description="Useful if you would like to restore redis data from a backup.<br><span class='font-bold text-white'>Database restart is required.</span>"+ />+ </ul>+ {/if}+ </div>+</div>diff --git a/src/routes/databases/[id]/_Databases/_MongoDB.svelte b/src/routes/databases/[id]/_Databases/_MongoDB.sveltenew file mode 100644index 0000000000..cbf3ffe358--- /dev/null+++ b/src/routes/databases/[id]/_Databases/_MongoDB.svelte@@ -0,0 +1,37 @@+<script>+ export let database;+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';+</script>++<div class="flex space-x-1 py-5 font-bold">+ <div class="title">MongoDB</div>+</div>+<div class="px-10">+ <div class="grid grid-cols-3 items-center">+ <label for="rootUser">Root User</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ placeholder="Generated automatically after start"+ id="rootUser"+ readonly+ disabled+ name="rootUser"+ value={database.rootUser}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="rootUserPassword">Root's Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ placeholder="Generated automatically after start"+ isPasswordField={true}+ readonly+ disabled+ id="rootUserPassword"+ name="rootUserPassword"+ value={database.rootUserPassword}+ />+ </div>+ </div>+</div>diff --git a/src/routes/databases/[id]/_Databases/_MySQL.svelte b/src/routes/databases/[id]/_Databases/_MySQL.sveltenew file mode 100644index 0000000000..e361cc9fe0--- /dev/null+++ b/src/routes/databases/[id]/_Databases/_MySQL.svelte@@ -0,0 +1,78 @@+<script>+ export let database;+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';+</script>++<div class="flex space-x-1 py-5 font-bold">+ <div class="title">MySQL</div>+</div>+<div class=" px-10">+ <div class="grid grid-cols-3 items-center">+ <label for="defaultDatabase">Default Database</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ required+ readonly={database.defaultDatabase}+ disabled={database.defaultDatabase}+ placeholder="eg: mydb"+ id="defaultDatabase"+ name="defaultDatabase"+ bind:value={database.defaultDatabase}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="dbUser">User</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ placeholder="Generated automatically after start"+ id="dbUser"+ name="dbUser"+ value={database.dbUser}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="dbUserPassword">Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ placeholder="Generated automatically after start"+ isPasswordField+ id="dbUserPassword"+ name="dbUserPassword"+ value={database.dbUserPassword}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="rootUser">Root User</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ placeholder="Generated automatically after start"+ id="rootUser"+ name="rootUser"+ value={database.rootUser}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="rootUserPassword">Root's Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ placeholder="Generated automatically after start"+ isPasswordField+ id="rootUserPassword"+ name="rootUserPassword"+ value={database.rootUserPassword}+ />+ </div>+ </div>+</div>diff --git a/src/routes/databases/[id]/_Databases/_PostgreSQL.svelte b/src/routes/databases/[id]/_Databases/_PostgreSQL.sveltenew file mode 100644index 0000000000..dc585c8e49--- /dev/null+++ b/src/routes/databases/[id]/_Databases/_PostgreSQL.svelte@@ -0,0 +1,51 @@+<script>+ export let database;+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';+</script>++<div class="flex space-x-1 py-5 font-bold">+ <div class="title">PostgreSQL</div>+</div>+<div class="px-10">+ <div class="grid grid-cols-3 items-center">+ <label for="defaultDatabase">Default Database</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ required+ readonly={database.defaultDatabase}+ disabled={database.defaultDatabase}+ placeholder="eg: mydb"+ id="defaultDatabase"+ name="defaultDatabase"+ bind:value={database.defaultDatabase}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="dbUser">User</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ placeholder="Generated automatically after start"+ id="dbUser"+ name="dbUser"+ value={database.dbUser}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="dbUserPassword">Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ placeholder="Generated automatically after start"+ isPasswordField+ id="dbUserPassword"+ name="dbUserPassword"+ value={database.dbUserPassword}+ />+ </div>+ </div>+</div>diff --git a/src/routes/databases/[id]/_Databases/_Redis.svelte b/src/routes/databases/[id]/_Databases/_Redis.sveltenew file mode 100644index 0000000000..ff8f831130--- /dev/null+++ b/src/routes/databases/[id]/_Databases/_Redis.svelte@@ -0,0 +1,64 @@+<script>+ export let database;+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';+</script>++<div class="flex space-x-1 py-5 font-bold">+ <div class="title">Redis</div>+</div>+<div class="px-10">+ <!-- <div class="grid grid-cols-3 items-center">+ <label for="dbUser">User</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ placeholder="Generated automatically after start"+ id="dbUser"+ name="dbUser"+ bind:value={database.dbUser}+ />+ </div>+ </div> -->+ <div class="grid grid-cols-3 items-center">+ <label for="dbUserPassword">Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ disabled+ readonly+ placeholder="Generated automatically after start"+ isPasswordField+ id="dbUserPassword"+ name="dbUserPassword"+ value={database.dbUserPassword}+ />+ </div>+ </div>+ <!-- <div class="grid grid-cols-3 items-center">+ <label for="rootUser">Root User</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ disabled+ readonly+ placeholder="Generated automatically after start"+ id="rootUser"+ name="rootUser"+ value={database.rootUser}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="rootUserPassword">Root's Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ disabled+ readonly+ placeholder="Generated automatically after start"+ isPasswordField+ id="rootUserPassword"+ name="rootUserPassword"+ value={database.rootUserPassword}+ />+ </div>+ </div> -->+</div>diff --git a/src/routes/databases/[id]/__layout.svelte b/src/routes/databases/[id]/__layout.sveltenew file mode 100644index 0000000000..2da5429935--- /dev/null+++ b/src/routes/databases/[id]/__layout.svelte@@ -0,0 +1,182 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ function checkConfiguration(database): string {+ let configurationPhase = null;+ if (!database.type) {+ configurationPhase = 'type';+ } else if (!database.version) {+ configurationPhase = 'version';+ } else if (!database.destinationDockerId) {+ configurationPhase = 'destination';+ }+ return configurationPhase;+ }+ export const load: Load = async ({ fetch, params, url }) => {+ const endpoint = `/databases/${params.id}.json`;+ const res = await fetch(endpoint);+ if (res.ok) {+ const { database, state, versions, privatePort, settings } = await res.json();+ if (!database || Object.entries(database).length === 0) {+ return {+ status: 302,+ redirect: '/databases'+ };+ }+ const configurationPhase = checkConfiguration(database);+ if (+ configurationPhase &&+ url.pathname !== `/databases/${params.id}/configuration/${configurationPhase}`+ ) {+ return {+ status: 302,+ redirect: `/databases/${params.id}/configuration/${configurationPhase}`+ };+ }+ return {+ props: {+ database,+ state,+ versions,+ privatePort+ },+ stuff: {+ database,+ state,+ versions,+ privatePort,+ settings+ }+ };+ }++ return {+ status: 302,+ redirect: '/databases'+ };+ };+</script>++<script>+ import { session } from '$app/stores';+ import { errorNotification } from '$lib/form';+ import DeleteIcon from '$lib/components/DeleteIcon.svelte';+ import Loading from '$lib/components/Loading.svelte';+ import { del, post } from '$lib/api';+ import { goto } from '$app/navigation';++ export let database;+ export let state;+ let loading = false;++ async function deleteDatabase() {+ const sure = confirm(`Are you sure you would like to delete '${database.name}'?`);+ if (sure) {+ loading = true;+ try {+ await del(`/databases/${database.id}/delete.json`, { id: database.id });+ return await goto('/databases');+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+ }+ async function stopDatabase() {+ const sure = confirm(`Are you sure you would like to stop '${database.name}'?`);+ if (sure) {+ loading = true;+ try {+ await post(`/databases/${database.id}/stop.json`, {});+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+ }+ async function startDatabase() {+ loading = true;+ try {+ await post(`/databases/${database.id}/start.json`, {});+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+</script>++<nav class="nav-side">+ {#if loading}+ <Loading fullscreen cover />+ {:else}+ {#if database.type && database.destinationDockerId && database.version && database.defaultDatabase}+ {#if state === 'running'}+ <button+ on:click={stopDatabase}+ title="Stop database"+ type="submit"+ disabled={!$session.isAdmin}+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-purple-600 hover:text-white"+ data-tooltip={$session.isAdmin+ ? 'Stop database'+ : 'You do not have permission to stop the database.'}+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="w-6 h-6"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <rect x="6" y="5" width="4" height="14" rx="1" />+ <rect x="14" y="5" width="4" height="14" rx="1" />+ </svg>+ </button>+ {:else if state === 'not started'}+ <button+ on:click={startDatabase}+ title="Start database"+ type="submit"+ disabled={!$session.isAdmin}+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-purple-600 hover:text-white"+ data-tooltip={$session.isAdmin+ ? 'Start database'+ : 'You do not have permission to start the database.'}+ ><svg+ xmlns="http://www.w3.org/2000/svg"+ class="w-6 h-6"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M7 4v16l13 -8z" />+ </svg>+ </button>+ {/if}+ {/if}+ <button+ on:click={deleteDatabase}+ title="Delete Database"+ type="submit"+ disabled={!$session.isAdmin}+ class:hover:text-red-500={$session.isAdmin}+ class="icons bg-transparent tooltip-bottom text-sm"+ data-tooltip={$session.isAdmin+ ? 'Delete Database'+ : 'You do not have permission to delete a Database'}><DeleteIcon /></button+ >+ {/if}+</nav>+<slot />diff --git a/src/routes/databases/[id]/configuration/destination.json.ts b/src/routes/databases/[id]/configuration/destination.json.tsnew file mode 100644index 0000000000..24373beed5--- /dev/null+++ b/src/routes/databases/[id]/configuration/destination.json.ts@@ -0,0 +1,19 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { destinationId } = await event.request.json();++ try {+ await db.configureDestinationForDatabase({ id, destinationId });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/databases/[id]/configuration/destination.svelte b/src/routes/databases/[id]/configuration/destination.sveltenew file mode 100644index 0000000000..1a8afc8179--- /dev/null+++ b/src/routes/databases/[id]/configuration/destination.svelte@@ -0,0 +1,93 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, url, stuff }) => {+ const { database } = stuff;+ if (database?.destinationDockerId && !url.searchParams.get('from')) {+ return {+ status: 302,+ redirect: `/database/${params.id}`+ };+ }++ const endpoint = `/destinations.json`;+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import type Prisma from '@prisma/client';++ import { page } from '$app/stores';+ import { errorNotification } from '$lib/form';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';++ const { id } = $page.params;+ const from = $page.url.searchParams.get('from');++ export let destinations: Prisma.DestinationDocker[];+ async function handleSubmit(destinationId) {+ try {+ await post(`/databases/${id}/configuration/destination.json`, {+ destinationId+ });+ return await goto(from || `/databases/${id}`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Configure Destination</div>+</div>+<div class="flex justify-center">+ {#if !destinations || destinations.length === 0}+ <div class="flex-col">+ <div class="pb-2">No configurable Destination found</div>+ <div class="flex justify-center">+ <a href="/new/destination" sveltekit:prefetch class="add-icon bg-sky-600 hover:bg-sky-500">+ <svg+ class="w-6"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ ><path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 6v6m0 0v6m0-6h6m-6 0H6"+ /></svg+ >+ </a>+ </div>+ </div>+ {:else}+ <div class="flex flex-wrap justify-center">+ {#each destinations as destination}+ <div class="p-2">+ <form on:submit|preventDefault={() => handleSubmit(destination.id)}>+ <button type="submit" class="box-selection hover:bg-sky-700 font-bold">+ <div class="font-bold text-xl text-center truncate">{destination.name}</div>+ <div class="text-center truncate">{destination.network}</div>+ </button>+ </form>+ </div>+ {/each}+ </div>+ {/if}+</div>diff --git a/src/routes/databases/[id]/configuration/type.json.ts b/src/routes/databases/[id]/configuration/type.json.tsnew file mode 100644index 0000000000..63685a9c5b--- /dev/null+++ b/src/routes/databases/[id]/configuration/type.json.ts@@ -0,0 +1,32 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler, supportedDatabaseTypesAndVersions } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };+ return {+ status: 200,+ body: {+ types: supportedDatabaseTypesAndVersions+ }+ };+};++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { type } = await event.request.json();++ try {+ await db.configureDatabaseType({ id, type });+ return {+ status: 201+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/databases/[id]/configuration/type.svelte b/src/routes/databases/[id]/configuration/type.sveltenew file mode 100644index 0000000000..2d527a7b99--- /dev/null+++ b/src/routes/databases/[id]/configuration/type.svelte@@ -0,0 +1,81 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, url, stuff }) => {+ const { database } = stuff;+ if (database?.type && !url.searchParams.get('from')) {+ return {+ status: 302,+ redirect: `/databases/${params.id}`+ };+ }+ const endpoint = `/databases/${params.id}/configuration/type.json`;+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import { page } from '$app/stores';+ import { errorNotification } from '$lib/form';++ const { id } = $page.params;+ const from = $page.url.searchParams.get('from');++ export let types;+ import Clickhouse from '$lib/components/svg/databases/Clickhouse.svelte';+ import CouchDB from '$lib/components/svg/databases/CouchDB.svelte';+ import MongoDB from '$lib/components/svg/databases/MongoDB.svelte';+ import MySQL from '$lib/components/svg/databases/MySQL.svelte';+ import PostgreSQL from '$lib/components/svg/databases/PostgreSQL.svelte';+ import Redis from '$lib/components/svg/databases/Redis.svelte';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';+ async function handleSubmit(type) {+ try {+ await post(`/databases/${id}/configuration/type.json`, { type });+ return await goto(from || `/databases/${id}/configuration/version`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Select a Database type</div>+</div>++<div class="flex flex-wrap justify-center">+ {#each types as type}+ <div class="p-2">+ <form on:submit|preventDefault={() => handleSubmit(type.name)}>+ <button type="submit" class="box-selection relative text-xl font-bold hover:bg-purple-700">+ {#if type.name === 'clickhouse'}+ <Clickhouse isAbsolute />+ {:else if type.name === 'couchdb'}+ <CouchDB isAbsolute />+ {:else if type.name === 'mongodb'}+ <MongoDB isAbsolute />+ {:else if type.name === 'mysql'}+ <MySQL isAbsolute />+ {:else if type.name === 'postgresql'}+ <PostgreSQL isAbsolute />+ {:else if type.name === 'redis'}+ <Redis isAbsolute />+ {/if}{type.fancyName}+ </button>+ </form>+ </div>+ {/each}+</div>diff --git a/src/routes/databases/[id]/configuration/version.json.ts b/src/routes/databases/[id]/configuration/version.json.tsnew file mode 100644index 0000000000..37d82fcafe--- /dev/null+++ b/src/routes/databases/[id]/configuration/version.json.ts@@ -0,0 +1,36 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler, supportedDatabaseTypesAndVersions } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { type } = await db.getDatabase({ id, teamId });++ return {+ status: 200,+ body: {+ versions: supportedDatabaseTypesAndVersions.find((name) => name.name === type).versions+ }+ };+};++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { version } = await event.request.json();++ try {+ await db.setDatabase({ id, version });+ return {+ status: 201+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/databases/[id]/configuration/version.svelte b/src/routes/databases/[id]/configuration/version.sveltenew file mode 100644index 0000000000..9e07611309--- /dev/null+++ b/src/routes/databases/[id]/configuration/version.svelte@@ -0,0 +1,63 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, url, stuff }) => {+ const { database } = stuff;+ if (database?.version && !url.searchParams.get('from')) {+ return {+ status: 302,+ redirect: `/databases/${params.id}`+ };+ }+ const endpoint = `/databases/${params.id}/configuration/version.json`;+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import { page } from '$app/stores';+ import { enhance, errorNotification } from '$lib/form';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';++ const { id } = $page.params;+ const from = $page.url.searchParams.get('from');++ export let versions;+ async function handleSubmit(version) {+ try {+ await post(`/databases/${id}/configuration/version.json`, { version });+ return await goto(from || `/databases/${id}/configuration/destination`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Select a Database version</div>+</div>++<div class="flex flex-wrap justify-center">+ {#each versions as version}+ <div class="p-2">+ <form on:submit|preventDefault={() => handleSubmit(version)}>+ <button type="submit" class="box-selection text-xl font-bold hover:bg-purple-700"+ >{version}</button+ >+ </form>+ </div>+ {/each}+</div>diff --git a/src/routes/databases/[id]/delete.json.ts b/src/routes/databases/[id]/delete.json.tsnew file mode 100644index 0000000000..7cbd5b756d--- /dev/null+++ b/src/routes/databases/[id]/delete.json.ts@@ -0,0 +1,22 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler, stopDatabase } from '$lib/database';+import { deleteProxy } from '$lib/haproxy';+import type { RequestHandler } from '@sveltejs/kit';++export const del: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };+ const { id } = event.params;+ try {+ const database = await db.getDatabase({ id, teamId });+ if (database.destinationDockerId) {+ const everStarted = await stopDatabase(database);+ if (everStarted) await deleteProxy({ id });+ }+ await db.removeDatabase({ id });+ return { status: 200 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/databases/[id]/index.json.ts b/src/routes/databases/[id]/index.json.tsnew file mode 100644index 0000000000..1f08ab7e61--- /dev/null+++ b/src/routes/databases/[id]/index.json.ts@@ -0,0 +1,71 @@+import { asyncExecShell, getEngine, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { generateDatabaseConfiguration, getVersions, PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ try {+ const database = await db.getDatabase({ id, teamId });+ const { destinationDockerId, destinationDocker } = database;++ let state = 'not started';+ if (destinationDockerId) {+ const host = getEngine(destinationDocker.engine);++ try {+ const { stdout } = await asyncExecShell(+ `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`+ );++ if (JSON.parse(stdout).Running) {+ state = 'running';+ }+ } catch (error) {+ // if (!error.stderr.includes('No such object')) {+ // console.log(error)+ // }+ }+ }+ const configuration = generateDatabaseConfiguration(database);+ const settings = await db.listSettings();+ return {+ body: {+ privatePort: configuration?.privatePort,+ database,+ state,+ versions: getVersions(database.type),+ settings+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };+ const { id } = event.params;+ const { name, defaultDatabase, dbUser, dbUserPassword, rootUser, rootUserPassword, version } =+ await event.request.json();++ try {+ await db.updateDatabase({+ id,+ name,+ defaultDatabase,+ dbUser,+ dbUserPassword,+ rootUser,+ rootUserPassword,+ version+ });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/databases/[id]/index.svelte b/src/routes/databases/[id]/index.sveltenew file mode 100644index 0000000000..d7d2626998--- /dev/null+++ b/src/routes/databases/[id]/index.svelte@@ -0,0 +1,67 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ import Databases from './_Databases/_Databases.svelte';+ export const load: Load = async ({ fetch, params, stuff }) => {+ if (stuff?.database?.id) {+ return {+ props: {+ database: stuff.database,+ versions: stuff.versions,+ privatePort: stuff.privatePort,+ settings: stuff.settings+ }+ };+ }+ const endpoint = `/databases/${params.id}.json`;+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${endpoint}`)+ };+ };+</script>++<script lang="ts">+ import Clickhouse from '$lib/components/svg/databases/Clickhouse.svelte';+ import CouchDb from '$lib/components/svg/databases/CouchDB.svelte';+ import MongoDb from '$lib/components/svg/databases/MongoDB.svelte';+ import MySql from '$lib/components/svg/databases/MySQL.svelte';+ import PostgreSql from '$lib/components/svg/databases/PostgreSQL.svelte';+ import Redis from '$lib/components/svg/databases/Redis.svelte';++ export let database;+ export let settings;+ export let privatePort;+</script>++<div class="flex items-center space-x-2 p-6 text-2xl font-bold">+ <div class="md:max-w-64 truncate text-base tracking-tight md:block md:text-2xl">+ {database.name}+ </div>+ <span class="relative">+ {#if database.type === 'clickhouse'}+ <Clickhouse />+ {:else if database.type === 'couchdb'}+ <CouchDb />+ {:else if database.type === 'mongodb'}+ <MongoDb />+ {:else if database.type === 'mysql'}+ <MySql />+ {:else if database.type === 'postgresql'}+ <PostgreSql />+ {:else if database.type === 'redis'}+ <Redis />+ {/if}+ </span>+</div>++<Databases bind:database {privatePort} {settings} />diff --git a/src/routes/databases/[id]/settings.json.ts b/src/routes/databases/[id]/settings.json.tsnew file mode 100644index 0000000000..bda37c8db3--- /dev/null+++ b/src/routes/databases/[id]/settings.json.ts@@ -0,0 +1,34 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { generateDatabaseConfiguration, PrismaErrorHandler } from '$lib/database';+import { startTcpProxy, stopTcpHttpProxy } from '$lib/haproxy';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { status, body, teamId } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { isPublic, appendOnly = true } = await event.request.json();++ try {+ await db.setDatabase({ id, isPublic, appendOnly });+ const database = await db.getDatabase({ id, teamId });+ const { destinationDockerId, destinationDocker, publicPort } = database;+ const { privatePort } = generateDatabaseConfiguration(database);++ if (destinationDockerId) {+ if (isPublic) {+ await startTcpProxy(destinationDocker, id, publicPort, privatePort);+ } else {+ await stopTcpHttpProxy(destinationDocker, publicPort);+ }+ }++ return {+ status: 201+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/databases/[id]/start.json.ts b/src/routes/databases/[id]/start.json.tsnew file mode 100644index 0000000000..30c18f66f8--- /dev/null+++ b/src/routes/databases/[id]/start.json.ts@@ -0,0 +1,82 @@+import { asyncExecShell, createDirectories, getEngine, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { generateDatabaseConfiguration, PrismaErrorHandler } from '$lib/database';+import { promises as fs } from 'fs';+import yaml from 'js-yaml';+import type { RequestHandler } from '@sveltejs/kit';+import { makeLabelForStandaloneDatabase } from '$lib/buildPacks/common';+import { startTcpProxy } from '$lib/haproxy';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ const database = await db.getDatabase({ id, teamId });+ const {+ type,+ destinationDockerId,+ destinationDocker,+ publicPort,+ settings: { isPublic }+ } = database;+ const { privatePort, environmentVariables, image, volume, ulimits } =+ generateDatabaseConfiguration(database);++ const network = destinationDockerId && destinationDocker.network;+ const host = getEngine(destinationDocker.engine);+ const engine = destinationDocker.engine;+ const volumeName = volume.split(':')[0];+ const labels = await makeLabelForStandaloneDatabase({ id, image, volume });++ const { workdir } = await createDirectories({ repository: type, buildId: id });++ const composeFile = {+ version: '3.8',+ services: {+ [id]: {+ container_name: id,+ image,+ networks: [network],+ environment: environmentVariables,+ volumes: [volume],+ ulimits,+ labels,+ restart: 'always'+ }+ },+ networks: {+ [network]: {+ external: true+ }+ },+ volumes: {+ [volumeName]: {+ external: true+ }+ }+ };+ const composeFileDestination = `${workdir}/docker-compose.yaml`;+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));+ try {+ await asyncExecShell(`DOCKER_HOST=${host} docker volume create ${volumeName}`);+ } catch (error) {+ console.log(error);+ }+ try {+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);+ if (isPublic) await startTcpProxy(destinationDocker, id, publicPort, privatePort);+ return {+ status: 200+ };+ } catch (error) {+ throw {+ error+ };+ }+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/databases/[id]/stop.json.ts b/src/routes/databases/[id]/stop.json.tsnew file mode 100644index 0000000000..42b9644038--- /dev/null+++ b/src/routes/databases/[id]/stop.json.ts@@ -0,0 +1,25 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler, stopDatabase } from '$lib/database';+import { stopTcpHttpProxy } from '$lib/haproxy';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ const database = await db.getDatabase({ id, teamId });+ const everStarted = await stopDatabase(database);+ if (everStarted) await stopTcpHttpProxy(database.destinationDocker, database.publicPort);+ await db.setDatabase({ id, isPublic: false });++ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/databases/index.json.ts b/src/routes/databases/index.json.tsnew file mode 100644index 0000000000..ae9b059e82--- /dev/null+++ b/src/routes/databases/index.json.ts@@ -0,0 +1,20 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };+ try {+ const databases = await db.listDatabases(teamId);+ return {+ status: 200,+ body: {+ databases+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/databases/index.svelte b/src/routes/databases/index.sveltenew file mode 100644index 0000000000..f476b3c66c--- /dev/null+++ b/src/routes/databases/index.svelte@@ -0,0 +1,87 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch }) => {+ const url = `/databases.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ export let databases;+ import Clickhouse from '$lib/components/svg/databases/Clickhouse.svelte';+ import CouchDB from '$lib/components/svg/databases/CouchDB.svelte';+ import MongoDB from '$lib/components/svg/databases/MongoDB.svelte';+ import MySQL from '$lib/components/svg/databases/MySQL.svelte';+ import PostgreSQL from '$lib/components/svg/databases/PostgreSQL.svelte';+ import Redis from '$lib/components/svg/databases/Redis.svelte';+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Databases</div>+ <a href="/new/database" class="add-icon bg-purple-600 hover:bg-purple-500">+ <svg+ class="w-6"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ ><path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 6v6m0 0v6m0-6h6m-6 0H6"+ /></svg+ >+ </a>+</div>++<div class="flex flex-wrap justify-center">+ {#if !databases || databases.length === 0}+ <div class="flex-col">+ <div class="text-center text-xl font-bold">No databases found</div>+ </div>+ {:else}+ {#each databases as database}+ <a href="/databases/{database.id}" class="no-underline p-2 w-96">+ <div class="box-selection relative hover:bg-purple-600 group">+ {#if database.type === 'clickhouse'}+ <Clickhouse isAbsolute />+ {:else if database.type === 'couchdb'}+ <CouchDB isAbsolute />+ {:else if database.type === 'mongodb'}+ <MongoDB isAbsolute />+ {:else if database.type === 'mysql'}+ <MySQL isAbsolute />+ {:else if database.type === 'postgresql'}+ <PostgreSQL isAbsolute />+ {:else if database.type === 'redis'}+ <Redis isAbsolute />+ {/if}+ <div class="font-bold text-xl text-center truncate">+ {database.name}+ </div>+ {#if !database.type}+ <div class="font-bold text-center truncate text-red-500 group-hover:text-white">+ Configuration missing+ </div>+ {:else}+ <div class="text-center truncate">{database.type}</div>+ {/if}+ </div>+ </a>+ {/each}+ {/if}+</div>diff --git a/src/routes/destinations/[id]/_FoundApp.svelte b/src/routes/destinations/[id]/_FoundApp.sveltenew file mode 100644index 0000000000..f183388faf--- /dev/null+++ b/src/routes/destinations/[id]/_FoundApp.svelte@@ -0,0 +1,77 @@+<script lang="ts">+ export let app;+ import { onMount } from 'svelte';+ import { page } from '$app/stores';+ const { id } = $page.params;+ let loading = true;+ async function checkApp() {+ const form = new FormData();+ form.append('name', app.name);+ form.append('domain', app.domain);+ form.append('projectId', app.projectId);+ form.append('repository', app.repository);+ form.append('branch', app.branch);+ const response = await fetch(`/destinations/${id}/scan.json`, {+ method: 'POST',+ headers: {+ accept: 'application/json'+ },+ body: form+ });+ if (response.ok) {+ const { by, name } = await response.json();+ if (by === 'domain') {+ app.foundByDomain = true;+ } else if (by === 'repository') {+ app.foundByRepository = true;+ }+ app.foundName = name;+ }+ }+ onMount(async () => {+ await checkApp();+ loading = false;+ });+ async function addToCoolify() {+ const form = new FormData();+ form.append('name', app.name);+ form.append('domain', app.domain);+ if (app.port) form.append('port', app.port);+ if (app.buildCommand) form.append('buildCommand', app.buildCommand);+ if (app.startCommand) form.append('startCommand', app.startCommand);+ if (app.installCommand) form.append('installCommand', app.installCommand);++ const response = await fetch(`/new/application/import.json`, {+ method: 'POST',+ headers: {+ accept: 'application/json'+ },+ body: form+ });+ if (response.ok) {+ const { id } = await response.json();+ window.location.replace(`/applications/${id}`);+ }+ }+</script>++<div class="box-selection hover:border-transparent hover:bg-coolgray-200">+ <div class="truncate pb-2 text-center text-xl font-bold">{app.domain}</div>+ {#if loading}+ <div class="w-full text-center font-bold">Loading...</div>+ {:else if app.foundByDomain}+ <div class="w-full bg-coolgray-200 text-xs">+ <span class="text-red-500">Domain</span> already configured for+ <span class="text-red-500">{app.foundName}</span>+ </div>+ {:else if app.foundByRepository}+ <div class="w-full bg-coolgray-200 text-xs">+ <span class="text-red-500">Repository</span> already configured for+ <span class="text-red-500">{app.foundName}</span>+ </div>+ {:else}+ <button class="bg-green-600 hover:bg-green-500 w-full" on:click={addToCoolify}+ >Add to Coolify</button+ >+ {/if}+</div>diff --git a/src/routes/destinations/[id]/_LocalDocker.svelte b/src/routes/destinations/[id]/_LocalDocker.sveltenew file mode 100644index 0000000000..76d2c41bdb--- /dev/null+++ b/src/routes/destinations/[id]/_LocalDocker.svelte@@ -0,0 +1,188 @@+<script lang="ts">+ export let destination;+ export let settings;+ export let state;++ import { toast } from '@zerodevx/svelte-toast';+ import { page } from '$app/stores';+ import Setting from '$lib/components/Setting.svelte';+ import { errorNotification } from '$lib/form';+ import { post } from '$lib/api';+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';+ import { onMount } from 'svelte';+ const { id } = $page.params;+ let cannotDisable = settings.fqdn && destination.engine === '/var/run/docker.sock';+ // let scannedApps = [];+ let loading = false;+ async function handleSubmit() {+ loading = true;+ try {+ return await post(`/destinations/${id}.json`, { ...destination });+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+ // async function scanApps() {+ // scannedApps = [];+ // const data = await fetch(`/destinations/${id}/scan.json`);+ // const { containers } = await data.json();+ // scannedApps = containers;+ // }+ onMount(async () => {+ if (state === false && destination.isCoolifyProxyUsed === true) {+ destination.isCoolifyProxyUsed = !destination.isCoolifyProxyUsed;+ try {+ await post(`/destinations/${id}/settings.json`, {+ isCoolifyProxyUsed: destination.isCoolifyProxyUsed,+ engine: destination.engine+ });+ await stopProxy();+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ });+ async function changeProxySetting() {+ if (!cannotDisable) {+ const isProxyActivated = destination.isCoolifyProxyUsed;+ if (isProxyActivated) {+ const sure = confirm(+ `Are you sure you want to ${+ destination.isCoolifyProxyUsed ? 'disable' : 'enable'+ } Coolify proxy? It will remove the proxy for all configured networks and all deployments on '${+ destination.engine+ }'! Nothing will be reachable if you do it!`+ );+ if (!sure) return;+ }+ destination.isCoolifyProxyUsed = !destination.isCoolifyProxyUsed;+ try {+ await post(`/destinations/${id}/settings.json`, {+ isCoolifyProxyUsed: destination.isCoolifyProxyUsed,+ engine: destination.engine+ });+ if (isProxyActivated) {+ await stopProxy();+ } else {+ await startProxy();+ }+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ }+ async function stopProxy() {+ try {+ await post(`/destinations/${id}/stop.json`, { engine: destination.engine });+ return toast.push('Coolify Proxy stopped!');+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function startProxy() {+ try {+ await post(`/destinations/${id}/start.json`, { engine: destination.engine });+ return toast.push('Coolify Proxy started!');+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex justify-center px-6 pb-8">+ <form on:submit|preventDefault={handleSubmit} class="grid grid-flow-row gap-2 py-4">+ <div class="flex h-8 items-center space-x-2">+ <div class="text-xl font-bold text-white">Configuration</div>+ <button+ type="submit"+ class="bg-sky-600 hover:bg-sky-500"+ class:bg-sky-600={!loading}+ class:hover:bg-sky-500={!loading}+ disabled={loading}+ >{loading ? 'Saving...' : 'Save'}+ </button>+ <!-- <button type="button" class="bg-coollabs hover:bg-coollabs-100" on:click={scanApps}+ >Scan for applications</button+ > -->+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="name">Name</label>+ <div class="col-span-2">+ <input name="name" placeholder="name" bind:value={destination.name} />+ </div>+ </div>++ <div class="grid grid-cols-3 items-center">+ <label for="engine">Engine</label>+ <div class="col-span-2">+ <CopyPasswordField+ id="engine"+ readonly+ disabled+ name="engine"+ placeholder="eg: /var/run/docker.sock"+ value={destination.engine}+ />+ </div>+ </div>+ <!-- <div class="flex items-center">+ <label for="remoteEngine">Remote Engine?</label>+ <input name="remoteEngine" type="checkbox" bind:checked={payload.remoteEngine} />+ </div> -->+ <div class="grid grid-cols-3 items-center">+ <label for="network">Network</label>+ <div class="col-span-2">+ <CopyPasswordField+ id="network"+ readonly+ disabled+ name="network"+ placeholder="default: coolify"+ value={destination.network}+ />+ </div>+ </div>+ <div class="flex justify-start">+ <ul class="mt-2 divide-y divide-stone-800">+ <Setting+ disabled={cannotDisable}+ bind:setting={destination.isCoolifyProxyUsed}+ on:click={changeProxySetting}+ isPadding={false}+ title="Use Coolify Proxy?"+ description={`This will install a proxy on the destination to allow you to access your applications and services without any manual configuration. Databases will have their own proxy. <br><br>${+ cannotDisable+ ? '<span class="font-bold text-white">You cannot disable this proxy as FQDN is configured for Coolify.</span>'+ : ''+ }`}+ />+ </ul>+ </div>+ </form>+</div>+<!-- <div class="flex justify-center">+ {#if payload.isCoolifyProxyUsed}+ {#if state}+ <button on:click={stopProxy}>Stop proxy</button>+ {:else}+ <button on:click={startProxy}>Start proxy</button>+ {/if}+ {/if}+</div> -->++<!-- {#if scannedApps.length > 0}+ <div class="flex justify-center px-6 pb-10">+ <div class="flex space-x-2 h-8 items-center">+ <div class="font-bold text-xl text-white">Found applications</div>+ </div>+ </div>+ <div class="max-w-4xl mx-auto px-6">+ <div class="flex space-x-2 justify-center">+ {#each scannedApps as app}+ <FoundApp {app} />+ {/each}+ </div>+ </div>+{/if} -->diff --git a/src/routes/destinations/[id]/__layout.svelte b/src/routes/destinations/[id]/__layout.sveltenew file mode 100644index 0000000000..9d92410976--- /dev/null+++ b/src/routes/destinations/[id]/__layout.svelte@@ -0,0 +1,68 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params }) => {+ const url = `/destinations/${params.id}.json`;+ const res = await fetch(url);+ if (res.ok) {+ const { destination, state, settings } = await res.json();+ if (!destination || Object.entries(destination).length === 0) {+ return {+ status: 302,+ redirect: '/destinations'+ };+ }+ return {+ props: {+ destination,+ state+ },+ stuff: {+ destination,+ settings,+ state+ }+ };+ }++ return {+ status: 302,+ redirect: '/destinations'+ };+ };+</script>++<script>+ import { session } from '$app/stores';+ import { errorNotification } from '$lib/form';+ import DeleteIcon from '$lib/components/DeleteIcon.svelte';+ import { del } from '$lib/api';+ import { goto } from '$app/navigation';++ export let destination;+ async function deleteDestination(destination) {+ const sure = confirm(`Are you sure you would like to delete '${destination.name}'?`);+ if (sure) {+ try {+ await del(`/destinations/${destination.id}.json`, { id: destination.id });+ return await goto('/destinations');+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ }+</script>++<nav class="nav-side">+ <button+ on:click={() => deleteDestination(destination)}+ title="Delete Destination"+ type="submit"+ disabled={!$session.isAdmin}+ class:hover:text-red-500={$session.isAdmin}+ class="icons tooltip-bottom bg-transparent text-sm"+ data-tooltip={$session.isAdmin+ ? 'Delete Git Source'+ : 'You do not have permission to delete a Git Source'}><DeleteIcon /></button+ >+</nav>+<slot />diff --git a/src/routes/destinations/[id]/index.json.ts b/src/routes/destinations/[id]/index.json.tsnew file mode 100644index 0000000000..3b878f9ca1--- /dev/null+++ b/src/routes/destinations/[id]/index.json.ts@@ -0,0 +1,55 @@+import { asyncExecShell, getEngine, getTeam, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { checkContainer } from '$lib/haproxy';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ try {+ const destination = await db.getDestination({ id, teamId });+ const settings = await db.listSettings();+ const state = await checkContainer(destination.engine, 'coolify-haproxy');+ return {+ status: 200,+ body: {+ destination,+ settings,+ state+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};+export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { name, engine, network } = await event.request.json();++ try {+ await db.updateDestination({ id, name, engine, network });+ return { status: 200 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++export const del: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ await db.removeDestination({ id });+ return { status: 200 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/destinations/[id]/index.svelte b/src/routes/destinations/[id]/index.sveltenew file mode 100644index 0000000000..a4527d46eb--- /dev/null+++ b/src/routes/destinations/[id]/index.svelte@@ -0,0 +1,46 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, stuff }) => {+ if (stuff?.destination.id) {+ return {+ props: {+ destination: stuff.destination,+ state: stuff.state,+ settings: stuff.settings+ }+ };+ }+ const url = `/destinations/${params.id}.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ export let destination: Prisma.DestinationDocker;+ export let settings;+ export let state;++ import type Prisma from '@prisma/client';+ import LocalDocker from './_LocalDocker.svelte';+</script>++<div class="flex space-x-1 p-6 text-2xl font-bold">+ <div class="tracking-tight">Destination</div>+ <span class="arrow-right-applications px-1">></span>+ <span class="pr-2">{destination.name}</span>+</div>++<LocalDocker bind:destination {settings} {state} />diff --git a/src/routes/destinations/[id]/scan.json.ts b/src/routes/destinations/[id]/scan.json.tsnew file mode 100644index 0000000000..ab02cd2e6a--- /dev/null+++ b/src/routes/destinations/[id]/scan.json.ts@@ -0,0 +1,64 @@+import { asyncExecShell, getTeam, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (request) => {+ const { teamId, status, body } = await getUserDetails(request);+ if (status === 401) return { status, body };++ const { id } = request.params;++ const destinationDocker = await db.getDestination({ id, teamId });+ const docker = dockerInstance({ destinationDocker });+ const listContainers = await docker.engine.listContainers({+ filters: { network: [destinationDocker.network] }+ });+ const containers = listContainers.filter((container) => {+ return container.Labels['coolify.configuration'];+ });+ const jsonContainers = containers+ .map((container) =>+ JSON.parse(Buffer.from(container.Labels['coolify.configuration'], 'base64').toString())+ )+ .filter((container) => container.type === 'manual');+ return {+ body: {+ containers: jsonContainers+ }+ };+};++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ let { fqdn, projectId, repository, branch } = await event.request.json();+ if (fqdn) fqdn = fqdn.toLowerCase();+ if (projectId) projectId = Number(projectId);++ try {+ const foundByDomain = await db.prisma.application.findFirst({ where: { fqdn } });+ const foundByRepository = await db.prisma.application.findFirst({+ where: { repository, branch, projectId }+ });+ if (foundByDomain) {+ return {+ status: 200,+ body: { by: 'domain', name: foundByDomain.name }+ };+ }+ if (foundByRepository) {+ return {+ status: 200,+ body: { by: 'repository', name: foundByRepository.name }+ };+ }+ return {+ status: 404+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/destinations/[id]/settings.json.ts b/src/routes/destinations/[id]/settings.json.tsnew file mode 100644index 0000000000..952acf92f2--- /dev/null+++ b/src/routes/destinations/[id]/settings.json.ts@@ -0,0 +1,18 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { engine, isCoolifyProxyUsed } = await event.request.json();++ try {+ await db.setDestinationSettings({ engine, isCoolifyProxyUsed });+ return { status: 200 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/destinations/[id]/start.json.ts b/src/routes/destinations/[id]/start.json.tsnew file mode 100644index 0000000000..b0d943bf9c--- /dev/null+++ b/src/routes/destinations/[id]/start.json.ts@@ -0,0 +1,21 @@+import { getUserDetails } from '$lib/common';+import { PrismaErrorHandler } from '$lib/database';+import { startCoolifyProxy, stopCoolifyProxy } from '$lib/haproxy';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { engine } = await event.request.json();++ try {+ await startCoolifyProxy(engine);+ return {+ status: 200+ };+ } catch (error) {+ await stopCoolifyProxy(engine);+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/destinations/[id]/stop.json.ts b/src/routes/destinations/[id]/stop.json.tsnew file mode 100644index 0000000000..9735e2c64a--- /dev/null+++ b/src/routes/destinations/[id]/stop.json.ts@@ -0,0 +1,19 @@+import { getUserDetails } from '$lib/common';+import { PrismaErrorHandler } from '$lib/database';+import { stopCoolifyProxy } from '$lib/haproxy';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { engine } = await event.request.json();+ try {+ await stopCoolifyProxy(engine);+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/destinations/index.json.ts b/src/routes/destinations/index.json.tsnew file mode 100644index 0000000000..881dc29dd2--- /dev/null+++ b/src/routes/destinations/index.json.ts@@ -0,0 +1,19 @@+import { getTeam, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (request) => {+ const { teamId, status, body } = await getUserDetails(request);+ if (status === 401) return { status, body };++ try {+ return {+ body: {+ destinations: await db.listDestinations(teamId)+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/destinations/index.svelte b/src/routes/destinations/index.sveltenew file mode 100644index 0000000000..01f860b212--- /dev/null+++ b/src/routes/destinations/index.svelte@@ -0,0 +1,66 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch }) => {+ const url = `/destinations.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import type Prisma from '@prisma/client';++ import { session } from '$app/stores';+ export let destinations: Prisma.DestinationDocker[];+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Destinations</div>+ {#if $session.isAdmin}+ <a href="/new/destination" class="add-icon bg-sky-600 hover:bg-sky-500">+ <svg+ class="w-6"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ ><path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 6v6m0 0v6m0-6h6m-6 0H6"+ /></svg+ >+ </a>+ {/if}+</div>+<div class="flex justify-center">+ {#if !destinations || destinations.length === 0}+ <div class="flex-col">+ <div class="text-center text-xl font-bold">No destination found</div>+ </div>+ {:else}+ <div class="flex flex-wrap justify-center">+ {#each destinations as destination}+ <a href="/destinations/{destination.id}" class="no-underline p-2 w-96">+ <div class="box-selection hover:bg-sky-600">+ <div class="font-bold text-xl text-center truncate">{destination.name}</div>+ <div class="text-center truncate">{destination.network}</div>+ </div>+ </a>+ {/each}+ </div>+ {/if}+</div>diff --git a/src/routes/index.json.ts b/src/routes/index.json.tsnew file mode 100644index 0000000000..562c1186f1--- /dev/null+++ b/src/routes/index.json.ts@@ -0,0 +1,50 @@+import { getTeam, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { userId, teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ try {+ const applicationsCount = await (await db.listApplications(teamId)).length;+ const sourcesCount = await (await db.listSources(teamId)).length;+ const destinationsCount = await (await db.listDestinations(teamId)).length;+ const teamsCount = await (await db.getMyTeams({ userId })).length;+ const databasesCount = await (await db.listDatabases(teamId)).length;+ const servicesCount = await (await db.listServices(teamId)).length;+ return {+ body: {+ applicationsCount,+ sourcesCount,+ destinationsCount,+ teamsCount,+ databasesCount,+ servicesCount+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++export const post: RequestHandler = async (event) => {+ const { status, body } = await getUserDetails(event, false);+ if (status === 401) return { status, body };++ const { cookie, value } = await event.request.json();+ const from = event.url.searchParams.get('from') || '/';++ return {+ status: 302,+ body: {},+ headers: {+ 'set-cookie': [+ `${cookie}=${value}; HttpOnly; Path=/; Max-Age=15778800;`,+ 'gitlabToken=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'+ ],+ Location: from+ }+ };+};diff --git a/src/routes/index.svelte b/src/routes/index.svelteindex e9f851d20d..8abfe0fc7f 100644--- a/src/routes/index.svelte+++ b/src/routes/index.svelte@@ -1,116 +1,108 @@-<script>- import { browser } from '$app/env';- import { goto } from '$app/navigation';- import { session } from '$app/stores';- import { toast } from '@zerodevx/svelte-toast';- import PasswordField from '$components/PasswordField.svelte';- import { request } from '$lib/request';- import { settings } from '$store';- import Loading from '$components/Loading.svelte';- let loading = false;- let email = null;- let password = null;- async function login() {- const left = screen.width / 2 - 1020 / 2;- const top = screen.height / 2 - 618 / 2;- const newWindow = open(- `https://github.com/login/oauth/authorize?client_id=${- import.meta.env.VITE_GITHUB_APP_CLIENTID- }`,- 'Authenticate',- 'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' +- top +- ', left=' +- left +- ', toolbar=0, menubar=0, status=0'- );- const timer = setInterval(() => {- if (newWindow?.closed) {- clearInterval(timer);- // WHY need to navigate to / to get cookies?!- browser && window.location.replace('/')- }- }, 100);- }- async function loginWithEmail() {- try {- loading = true;- const { message } = await request('/api/v1/login/email', $session, {- body: {- email,- password+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, session }) => {+ const url = `/index.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())}- });- toast.push(message);- setTimeout(() => {- // WHY need to navigate to / to get cookies?!- browser && window.location.replace('/')- }, 1000);- } catch (error) {- loading = false;- browser && toast.push(error.error || error || 'Ooops something went wrong.');+ };}- }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ export let applicationsCount: number;+ export let sourcesCount: number;+ export let destinationsCount: number;+ export let teamsCount: number;+ export let databasesCount: number;+ export let servicesCount: number;</script>-<div class="flex justify-center items-center h-screen w-full bg-warmGray-900">- <div class="max-w-7xl mx-auto px-4 sm:py-24 sm:px-6 lg:px-8">- <div class="text-center">- <p- class="mt-1 pb-8 font-extrabold text-white text-5xl sm:tracking-tight lg:text-6xl text-center"- >- <span class="border-gradient">Coolify</span>- </p>- <h2 class="text-2xl md:text-3xl font-extrabold text-white py-10">- An open-source, hassle-free, self-hostable<br />- <span class="text-indigo-400">Heroku</span>- & <span class="text-green-400">Netlify</span> alternative- </h2>- {#if loading}- <Loading fullscreen={false} />- {:else}- <div class="text-center py-10 max-w-7xl">- {#if !$session.isLoggedIn}- {#if $settings.clientId}- <button- class="text-white bg-warmGray-800 hover:bg-warmGray-700 rounded p-2 px-10 font-bold"- on:click={login}>Login with GitHub</button- >- {:else}- <div>- <div class="grid grid-flow-row gap-2 items-center pb-6">- <div class="grid grid-flow-row">- <label for="Email" class="">Email address</label>- <input- class="border-2"- id="Email"- bind:value={email}- placeholder="[email protected]"- />- </div>- <div class="grid grid-flow-row">- <label for="Password" class="">Password</label>- <PasswordField bind:value={password} isEditable />- </div>- </div>- <div class="space-x-4 pt-10">- <button- class="text-white bg-warmGray-800 hover:bg-warmGray-700 rounded p-2 px-10 font-bold"- on:click={loginWithEmail}>Login with Email</button- >- </div>- </div>- {/if}- {:else}- <button- class="text-white bg-warmGray-800 hover:bg-warmGray-700 rounded p-2 px-10 font-bold"- on:click={() =>- $settings.clientId ? goto('/dashboard/applications') : goto('/dashboard/services')}- >Get Started</button- >- {/if}- </div>- {/if}+<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Dashboard</div>+</div>++<div class="mt-10 pb-12 tracking-tight sm:pb-16">+ <div class="relative">+ <div class="absolute inset-0 h-1/2" />+ <div class="relative mx-auto px-4 sm:px-6 lg:px-8">+ <div class="mx-auto max-w-4xl">+ <dl class="gap-5 gap-y-16 sm:grid sm:grid-cols-3">+ <a+ href="/applications"+ sveltekit:prefetch+ class="flex cursor-pointer flex-col rounded p-6 text-center text-green-500 no-underline transition duration-150 hover:bg-green-500 hover:text-white"+ >+ <dt class="order-2 mt-2 text-sm font-bold uppercase leading-6 text-white">+ Applications+ </dt>+ <dd class="order-1 text-5xl font-extrabold ">+ {applicationsCount}+ </dd>+ </a>+ <a+ href="/destinations"+ sveltekit:prefetch+ class="flex cursor-pointer flex-col rounded p-6 text-center text-sky-500 no-underline transition duration-150 hover:bg-sky-500 hover:text-white"+ >+ <dt class="order-2 mt-2 text-sm font-bold uppercase leading-6 text-white">+ Destinations+ </dt>+ <dd class="order-1 text-5xl font-extrabold ">+ {destinationsCount}+ </dd>+ </a>+ <a+ href="/sources"+ sveltekit:prefetch+ class="flex cursor-pointer flex-col rounded p-6 text-center text-orange-500 no-underline transition duration-150 hover:bg-orange-500 hover:text-white"+ >+ <dt class="order-2 mt-2 text-sm font-bold uppercase leading-6 text-white">+ Git Sources+ </dt>+ <dd class="order-1 text-5xl font-extrabold ">+ {sourcesCount}+ </dd>+ </a>+ <a+ href="/databases"+ sveltekit:prefetch+ class="flex cursor-pointer flex-col rounded p-6 text-center text-purple-500 no-underline transition duration-150 hover:bg-purple-500 hover:text-white"+ >+ <dt class="order-2 mt-2 text-sm font-bold uppercase leading-6 text-white">Databases</dt>+ <dd class="order-1 text-5xl font-extrabold ">{databasesCount}</dd>+ </a>+ <a+ href="/services"+ sveltekit:prefetch+ class="flex cursor-pointer flex-col rounded p-6 text-center text-pink-500 no-underline transition duration-150 hover:bg-pink-500 hover:text-white"+ >+ <dt class="order-2 mt-2 text-sm font-bold uppercase leading-6 text-white">Services</dt>+ <dd class="order-1 text-5xl font-extrabold ">{servicesCount}</dd>+ </a>++ <a+ href="/teams"+ sveltekit:prefetch+ class="flex cursor-pointer flex-col rounded p-6 text-center text-cyan-500 no-underline transition duration-150 hover:bg-cyan-500 hover:text-white"+ >+ <dt class="order-2 mt-2 text-sm font-bold uppercase leading-6 text-white">Teams</dt>+ <dd class="order-1 text-5xl font-extrabold ">+ {teamsCount}+ </dd>+ </a>+ </dl>+ </div></div></div></div>diff --git a/src/routes/login/index.json.ts b/src/routes/login/index.json.tsnew file mode 100644index 0000000000..26c912a932--- /dev/null+++ b/src/routes/login/index.json.ts@@ -0,0 +1,33 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { email, password } = await event.request.json();++ try {+ const { body } = await db.login({ email, password });+ event.locals.session.data = body;+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++export const get: RequestHandler = async (event) => {+ const { userId } = await getUserDetails(event, false);+ if (!userId) {+ return {+ status: 401+ };+ }+ try {+ await db.getUser({ userId });+ return { status: 200 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/login/index.svelte b/src/routes/login/index.sveltenew file mode 100644index 0000000000..25da6b2744--- /dev/null+++ b/src/routes/login/index.svelte@@ -0,0 +1,74 @@+<script lang="ts">+ import { browser } from '$app/env';+ import { goto } from '$app/navigation';+ import { session } from '$app/stores';+ import { post } from '$lib/api';+ import { errorNotification } from '$lib/form';+ import { onMount } from 'svelte';+ let loading = false;+ let emailEl;+ let email, password;++ if (browser && $session.uid) {+ goto('/');+ }+ onMount(() => {+ emailEl.focus();+ });+ async function handleSubmit() {+ loading = true;+ try {+ const { teamId } = await post(`/login.json`, { email, password });+ if (teamId === '0') {+ window.location.replace('/settings');+ } else {+ window.location.replace('/');+ }+ return;+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+</script>++<div class="flex h-screen flex-col items-center justify-center">+ {#if $session.uid}+ <div class="flex justify-center px-4 text-xl font-bold">Already logged in...</div>+ {:else}+ <div class="flex justify-center px-4">+ <form on:submit|preventDefault={handleSubmit} class="flex flex-col py-4 space-y-2">+ <div class="text-6xl font-bold border-gradient w-48 mx-auto border-b-4">Coolify</div>+ <div class="text-xs text-center font-bold pb-10">v{$session.version}</div>+ <input+ type="email"+ name="email"+ placeholder="Email"+ autocomplete="off"+ required+ bind:this={emailEl}+ bind:value={email}+ />+ <input+ type="password"+ name="password"+ placeholder="Password"+ bind:value={password}+ required+ />++ <div class="flex space-x-2 h-8 items-center justify-center pt-14">+ <button+ type="submit"+ disabled={loading}+ class="hover:opacity-90 text-white"+ class:bg-transparent={loading}+ class:text-stone-600={loading}+ class:bg-coollabs={!loading}>{loading ? 'Authenticating...' : 'Login'}</button+ >+ </div>+ </form>+ </div>+ {/if}+</div>diff --git a/src/routes/logout/index.json.ts b/src/routes/logout/index.json.tsnew file mode 100644index 0000000000..08ec57ac52--- /dev/null+++ b/src/routes/logout/index.json.ts@@ -0,0 +1,15 @@+export async function del({ locals }) {+ locals.session.destroy();++ return {+ headers: {+ 'set-cookie': [+ 'teamId=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT',+ 'gitlabToken=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'+ ]+ },+ body: {+ ok: true+ }+ };+}diff --git a/src/routes/new/application/import.json.ts b/src/routes/new/application/import.json.tsnew file mode 100644index 0000000000..4bfe22268b--- /dev/null+++ b/src/routes/new/application/import.json.ts@@ -0,0 +1,29 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ let { name, fqdn, port, buildCommand, startCommand, installCommand } = await event.request.json();++ if (fqdn) fqdn = fqdn.toLowerCase();+ if (port) port = Number(port);++ try {+ const { id } = await db.importApplication({+ name,+ teamId,+ fqdn,+ port,+ buildCommand,+ startCommand,+ installCommand+ });+ return { status: 201, body: { id } };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/new/application/index.json.ts b/src/routes/new/application/index.json.tsnew file mode 100644index 0000000000..0d685af218--- /dev/null+++ b/src/routes/new/application/index.json.ts@@ -0,0 +1,19 @@+import { getUserDetails, uniqueName } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { name } = await event.request.json();+ if (!name) return { status: 400, body: { error: 'Missing name.' } };++ try {+ const { id } = await db.newApplication({ name, teamId });+ return { status: 201, body: { id } };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/new/application/index.svelte b/src/routes/new/application/index.sveltenew file mode 100644index 0000000000..0f267fd858--- /dev/null+++ b/src/routes/new/application/index.svelte@@ -0,0 +1,53 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch }) => {+ const url = `/common/getUniqueName.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ export let name;+ import { onMount } from 'svelte';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';+ import { errorNotification } from '$lib/form';++ let nameEl: HTMLInputElement;+ onMount(() => {+ nameEl.focus();+ });+ async function handleSubmit() {+ try {+ const { id } = await post('/new/application.json', { name });+ return await goto(`/applications/${id}`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Add New Application</div>+</div>+<div class="pt-10">+ <form on:submit|preventDefault={handleSubmit}>+ <div class="flex flex-col items-center space-y-4">+ <input name="name" placeholder="Application name" bind:this={nameEl} bind:value={name} />+ <button type="submit" class="bg-green-600 hover:bg-green-500">Save</button>+ </div>+ </form>+</div>diff --git a/src/routes/new/database/index.json.ts b/src/routes/new/database/index.json.tsnew file mode 100644index 0000000000..e6b46ad42f--- /dev/null+++ b/src/routes/new/database/index.json.ts@@ -0,0 +1,18 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { name } = await event.request.json();++ try {+ const { id } = await db.newDatabase({ name, teamId });+ return { status: 201, body: { id } };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/new/database/index.svelte b/src/routes/new/database/index.sveltenew file mode 100644index 0000000000..4ee9ee6fbb--- /dev/null+++ b/src/routes/new/database/index.svelte@@ -0,0 +1,59 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, session }) => {+ const url = `/common/getUniqueName.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ export let name;+ import { errorNotification } from '$lib/form';+ import { onMount } from 'svelte';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';+ let autofocus;++ onMount(() => {+ autofocus.focus();+ });+ async function handleSubmit() {+ try {+ const { id } = await post('/new/database.json', { name });+ return await goto(`/databases/${id}`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Add New Database</div>+</div>+<div class="pt-10">+ <form on:submit|preventDefault={handleSubmit}>+ <div class="flex flex-col items-center space-y-4">+ <input+ name="name"+ placeholder="Database name"+ required+ bind:this={autofocus}+ bind:value={name}+ />+ <button type="submit" class="bg-purple-600 hover:bg-purple-500">Save</button>+ </div>+ </form>+</div>diff --git a/src/routes/new/destination/_Docker.svelte b/src/routes/new/destination/_Docker.sveltenew file mode 100644index 0000000000..044d0f24b4--- /dev/null+++ b/src/routes/new/destination/_Docker.svelte@@ -0,0 +1,101 @@+<script lang="ts">+ import { goto } from '$app/navigation';++ export let payload;++ import { post } from '$lib/api';+ import Setting from '$lib/components/Setting.svelte';+ import { enhance, errorNotification } from '$lib/form';++ let loading = false;++ async function handleSubmit() {+ try {+ await post('/new/destination/check.json', { network: payload.network });+ const { id } = await post('/new/destination/docker.json', {+ ...payload+ });+ return await goto(`/destinations/${id}`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex justify-center px-6 pb-8">+ <form on:submit|preventDefault={handleSubmit} class="grid grid-flow-row gap-2 py-4">+ <div class="flex h-8 items-center space-x-2">+ <div class="text-xl font-bold text-white">Configuration</div>+ <button+ type="submit"+ class:bg-sky-600={!loading}+ class:hover:bg-sky-500={!loading}+ disabled={loading}+ >{loading+ ? payload.isCoolifyProxyUsed+ ? 'Saving and configuring proxy...'+ : 'Saving...'+ : 'Save'}</button+ >+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="name">Name</label>+ <div class="col-span-2">+ <input required name="name" placeholder="name" bind:value={payload.name} />+ </div>+ </div>++ <div class="grid grid-cols-3 items-center">+ <label for="engine">Engine</label>+ <div class="col-span-2">+ <input+ required+ name="engine"+ placeholder="eg: /var/run/docker.sock"+ bind:value={payload.engine}+ />+ <!-- <Explainer text="You can use remote Docker Engine with over SSH." /> -->+ </div>+ </div>+ <!-- <div class="flex items-center">+ <label for="remoteEngine">Remote Docker Engine?</label>+ <input name="remoteEngine" type="checkbox" bind:checked={payload.remoteEngine} />+ </div>+ {#if payload.remoteEngine}+ <div class="grid grid-cols-3 items-center">+ <label for="user">User</label>+ <div class="col-span-2">+ <input required name="user" placeholder="eg: root" bind:value={payload.user} />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="port">Port</label>+ <div class="col-span-2">+ <input required name="port" placeholder="eg: 22" bind:value={payload.port} />+ </div>+ </div>+ {/if} -->+ <div class="grid grid-cols-3 items-center">+ <label for="network">Network</label>+ <div class="col-span-2">+ <input+ required+ name="network"+ placeholder="default: coolify"+ bind:value={payload.network}+ />+ </div>+ </div>+ <div class="flex justify-start">+ <ul class="mt-2 divide-y divide-stone-800">+ <Setting+ bind:setting={payload.isCoolifyProxyUsed}+ on:click={() => (payload.isCoolifyProxyUsed = !payload.isCoolifyProxyUsed)}+ isPadding={false}+ title="Use Coolify Proxy?"+ description="This will install a proxy on the destination to allow you to access your applications and services without any manual configuration (recommended for Docker). Databases will have their own proxy."+ />+ </ul>+ </div>+ </form>+</div>diff --git a/src/routes/new/destination/check.json.ts b/src/routes/new/destination/check.json.tsnew file mode 100644index 0000000000..bb8f8f50f0--- /dev/null+++ b/src/routes/new/destination/check.json.ts@@ -0,0 +1,23 @@+import { getUserDetails } from '$lib/common';+import { isDockerNetworkExists, PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { network } = await event.request.json();+ try {+ const found = await isDockerNetworkExists({ network });+ if (found) {+ throw {+ error: `Network ${network} already configured for another team!`+ };+ }+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/new/destination/docker.json.ts b/src/routes/new/destination/docker.json.tsnew file mode 100644index 0000000000..aaef77bf9e--- /dev/null+++ b/src/routes/new/destination/docker.json.ts@@ -0,0 +1,19 @@+import { asyncExecShell, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { name, engine, network, isCoolifyProxyUsed } = await event.request.json();++ try {+ const id = await db.newDestination({ name, teamId, engine, network, isCoolifyProxyUsed });+ return { status: 200, body: { id } };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/new/destination/index.svelte b/src/routes/new/destination/index.sveltenew file mode 100644index 0000000000..b95c2a0676--- /dev/null+++ b/src/routes/new/destination/index.svelte@@ -0,0 +1,43 @@+<script>+ import Docker from './_Docker.svelte';++ let payload = {};+ let selected = 'docker';++ function setPredefined(type) {+ selected = type;+ switch (type) {+ case 'docker':+ payload = {+ name: 'Local Docker',+ engine: '/var/run/docker.sock',+ remoteEngine: false,+ user: 'root',+ port: 22,+ privateKey: null,+ network: 'coolify',+ isCoolifyProxyUsed: true+ };+ break;++ default:+ break;+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Add New Destination</div>+</div>+<div class="flex-col space-y-2 pb-10 text-center">+ <div class="text-xl font-bold text-white">Predefined destinations</div>+ <div class="flex justify-center space-x-2">+ <button class="w-32" on:click={() => setPredefined('docker')}>Docker</button>+ <button class="w-32" on:click={() => setPredefined('kubernetes')}>Kubernetes</button>+ </div>+</div>+{#if selected === 'docker'}+ <Docker {payload} />+{:else}+ <div class="text-center font-bold text-4xl py-10">Not implemented yet</div>+{/if}diff --git a/src/routes/new/service/index.json.ts b/src/routes/new/service/index.json.tsnew file mode 100644index 0000000000..4a42c65dc9--- /dev/null+++ b/src/routes/new/service/index.json.ts@@ -0,0 +1,18 @@+import { getUserDetails, uniqueName } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { name } = await event.request.json();++ try {+ const { id } = await db.newService({ name, teamId });+ return { status: 201, body: { id } };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/new/service/index.svelte b/src/routes/new/service/index.sveltenew file mode 100644index 0000000000..f658a4ec20--- /dev/null+++ b/src/routes/new/service/index.svelte@@ -0,0 +1,59 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, session }) => {+ const url = `/common/getUniqueName.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ export let name;+ import { enhance, errorNotification } from '$lib/form';+ import { onMount } from 'svelte';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';+ let autofocus;++ onMount(() => {+ autofocus.focus();+ });+ async function handleSubmit() {+ try {+ const { id } = await post(`/new/service.json`, { name });+ return await goto(`/services/${id}`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Add New Service</div>+</div>+<div class="pt-10">+ <form on:submit|preventDefault={handleSubmit}>+ <div class="flex flex-col items-center space-y-4">+ <input+ name="name"+ placeholder="Service name"+ required+ bind:this={autofocus}+ bind:value={name}+ />+ <button type="submit" class="bg-pink-600 hover:bg-pink-500">Save</button>+ </div>+ </form>+</div>diff --git a/src/routes/new/source/_Github.svelte b/src/routes/new/source/_Github.sveltenew file mode 100644index 0000000000..d1d5f5c881--- /dev/null+++ b/src/routes/new/source/_Github.svelte@@ -0,0 +1,101 @@+<script lang="ts">+ export let gitSource;+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';++ import Explainer from '$lib/components/Explainer.svelte';++ import { errorNotification } from '$lib/form';+ import { onMount } from 'svelte';++ let nameEl;+ let organizationEl;++ onMount(() => {+ nameEl.focus();+ });+ async function handleSubmit() {+ try {+ const { id } = await post(`/new/source.json`, { ...gitSource });+ return await goto(`/sources/${id}/`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex justify-center pb-8">+ <form on:submit|preventDefault={handleSubmit} class="grid grid-flow-row gap-2 py-4">+ <div class="flex h-8 items-center space-x-2">+ <div class="text-xl font-bold text-white">Configuration</div>+ <button type="submit" class="bg-orange-600 hover:bg-orange-500">Save</button>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="type">Type</label>++ <div class="col-span-2">+ <select name="type" id="type" class="w-96" bind:value={gitSource.type}>+ <option value="github">GitHub</option>+ <option value="gitlab">GitLab</option>+ <option value="bitbucket">BitBucket</option>+ </select>+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="name">Name</label>+ <div class="col-span-2">+ <input+ name="name"+ id="name"+ placeholder="GitHub.com"+ required+ bind:this={nameEl}+ bind:value={gitSource.name}+ />+ </div>+ </div>++ <div class="grid grid-cols-3 items-center">+ <label for="htmlUrl">HTML URL</label>+ <div class="col-span-2">+ <input+ type="url"+ name="htmlUrl"+ id="htmlUrl"+ placeholder="eg: https://github.com"+ required+ bind:value={gitSource.htmlUrl}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="apiUrl">API URL</label>+ <div class="col-span-2">+ <input+ name="apiUrl"+ type="url"+ id="apiUrl"+ placeholder="eg: https://api.github.com"+ required+ bind:value={gitSource.apiUrl}+ />+ </div>+ </div>+ <div class="grid grid-cols-3">+ <label for="organization" class="pt-2">Organization</label>+ <div class="col-span-2">+ <input+ name="organization"+ id="organization"+ placeholder="eg: coollabsio"+ bind:value={gitSource.organization}+ bind:this={organizationEl}+ />+ <Explainer+ text="Fill it if you would like to use an organization's as your Git Source. Otherwise your+ user will be used."+ />+ </div>+ </div>+ </form>+</div>diff --git a/src/routes/new/source/_Gitlab.svelte b/src/routes/new/source/_Gitlab.sveltenew file mode 100644index 0000000000..5e7ad866ef--- /dev/null+++ b/src/routes/new/source/_Gitlab.svelte@@ -0,0 +1,82 @@+<script lang="ts">+ export let gitSource;+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';++ import { errorNotification } from '$lib/form';+ import { onMount } from 'svelte';++ let nameEl;++ onMount(() => {+ nameEl.focus();+ });+ async function handleSubmit() {+ try {+ const { id } = await post(`/new/source.json`, { ...gitSource });+ return await goto(`/sources/${id}/`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex justify-center pb-8">+ <form on:submit|preventDefault={handleSubmit} class="grid grid-flow-row gap-2 py-4">+ <div class="flex h-8 items-center space-x-2">+ <div class="text-xl font-bold text-white">Configuration</div>+ <button type="submit" class="bg-orange-600 hover:bg-orange-500">Save</button>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="type">Type</label>++ <div class="col-span-2">+ <select name="type" id="type" class="w-96" bind:value={gitSource.type}>+ <option value="github">GitHub</option>+ <option value="gitlab">GitLab</option>+ <option value="bitbucket">BitBucket</option>+ </select>+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="name">Name</label>+ <div class="col-span-2">+ <input+ name="name"+ id="name"+ placeholder="GitHub.com"+ required+ bind:this={nameEl}+ bind:value={gitSource.name}+ />+ </div>+ </div>++ <div class="grid grid-cols-3 items-center">+ <label for="htmlUrl">HTML URL</label>+ <div class="col-span-2">+ <input+ type="url"+ name="htmlUrl"+ id="htmlUrl"+ placeholder="eg: https://github.com"+ required+ bind:value={gitSource.htmlUrl}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="apiUrl">API URL</label>+ <div class="col-span-2">+ <input+ name="apiUrl"+ type="url"+ id="apiUrl"+ placeholder="eg: https://api.github.com"+ required+ bind:value={gitSource.apiUrl}+ />+ </div>+ </div>+ </form>+</div>diff --git a/src/routes/new/source/index.json.ts b/src/routes/new/source/index.json.tsnew file mode 100644index 0000000000..3debc81d6f--- /dev/null+++ b/src/routes/new/source/index.json.ts@@ -0,0 +1,17 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { name, type, htmlUrl, apiUrl, organization } = await event.request.json();+ try {+ const { id } = await db.newSource({ name, teamId, type, htmlUrl, apiUrl, organization });+ return { status: 201, body: { id } };+ } catch (e) {+ return PrismaErrorHandler(e);+ }+};diff --git a/src/routes/new/source/index.svelte b/src/routes/new/source/index.sveltenew file mode 100644index 0000000000..7c9b4973cc--- /dev/null+++ b/src/routes/new/source/index.svelte@@ -0,0 +1,66 @@+<script lang="ts">+ import Github from './_Github.svelte';+ import Gitlab from './_Gitlab.svelte';+ let gitSource = {+ name: undefined,+ type: 'github',+ htmlUrl: undefined,+ apiUrl: undefined,+ organization: undefined+ };+ function setPredefined(type) {+ switch (type) {+ case 'github':+ gitSource = {+ name: 'GitHub.com',+ type,+ htmlUrl: 'https://github.com',+ apiUrl: 'https://api.github.com',+ organization: undefined+ };+ break;+ case 'gitlab':+ gitSource = {+ name: 'GitLab.com',+ type,+ htmlUrl: 'https://gitlab.com',+ apiUrl: 'https://gitlab.com/api',+ organization: undefined+ };+ break;+ case 'bitbucket':+ gitSource = {+ name: 'BitBucket.com',+ type,+ htmlUrl: 'https://bitbucket.com',+ apiUrl: 'https://bitbucket.com',+ organization: undefined+ };+ break;+ default:+ break;+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Add New Git Source</div>+</div>++<div class="flex-col space-y-2 pb-10 text-center">+ <div class="text-xl font-bold text-white">Offical providers</div>+ <div class="flex justify-center space-x-2">+ <button class="w-32" on:click={() => setPredefined('github')}>GitHub.com</button>+ <button class="w-32" on:click={() => setPredefined('gitlab')}>GitLab.com</button>+ <button class="w-32" on:click={() => setPredefined('bitbucket')}>Bitbucket.com</button>+ </div>+</div>+<div class="px-6">+ {#if gitSource.type === 'github'}+ <Github {gitSource} />+ {:else if gitSource.type === 'gitlab'}+ <Gitlab {gitSource} />+ {:else if gitSource.type === 'bitbucket'}+ <div class="text-center font-bold text-4xl py-10">Not implemented yet</div>+ {/if}+</div>diff --git a/src/routes/new/team/index.json.ts b/src/routes/new/team/index.json.tsnew file mode 100644index 0000000000..e8eae866d5--- /dev/null+++ b/src/routes/new/team/index.json.ts@@ -0,0 +1,18 @@+import { getUserDetails, uniqueName } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { userId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { name } = await event.request.json();++ try {+ const { id } = await db.newTeam({ name, userId });+ return { status: 201, body: { id } };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/new/team/index.svelte b/src/routes/new/team/index.sveltenew file mode 100644index 0000000000..75c75ced26--- /dev/null+++ b/src/routes/new/team/index.svelte@@ -0,0 +1,56 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, session }) => {+ const url = `/common/getUniqueName.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ export let name;+ import { errorNotification } from '$lib/form';+ import { onMount } from 'svelte';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';++ let autofocus;+ onMount(() => {+ autofocus.focus();+ });+ async function handleSubmit() {+ if (name) {+ try {+ const { id } = await post('/new/team.json', { name });+ return await goto(`/teams/${id}`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Add New Team</div>+</div>++<div class="pt-10">+ <form on:submit|preventDefault={handleSubmit}>+ <div class="flex flex-col items-center space-y-4">+ <input name="name" placeholder="Team name" required bind:this={autofocus} bind:value={name} />+ <button type="submit" class="bg-green-600 hover:bg-green-500">Save</button>+ </div>+ </form>+</div>diff --git a/src/routes/servers/index.svelte b/src/routes/servers/index.sveltedeleted file mode 100644index ce68b4a9b0..0000000000--- a/src/routes/servers/index.svelte+++ /dev/null@@ -1,101 +0,0 @@-<script context="module">- /**- * @type {import('@sveltejs/kit').Load}- */- export async function load({ fetch }) {- try {- const { hostname, filesystems,dockerReclaimable } = await (await fetch(`/api/v1/servers`)).json();- return {- props: {- hostname,- filesystems,- dockerReclaimable- }- };- } catch (error) {- return {- props: {- hostname: null,- filesystems: null,- dockerReclaimable: null- }- };- }- }--</script>--<script>- export let hostname;- export let filesystems;- export let dockerReclaimable;- import { browser } from '$app/env';- import { session } from '$app/stores';- import { request } from '$lib/request';- import { toast } from '@zerodevx/svelte-toast';- import { fade } from 'svelte/transition';- async function refetch() {- const data = await request('/api/v1/servers', $session)- filesystems = data.filesystems- dockerReclaimable = data.dockerReclaimable- }- async function cleanupVolumes() {- const { output } = await request('/api/v1/servers/cleanups/volumes', $session, {- body: {}- });- browser && toast.push(output);- await refetch()- }- async function cleanupImages() {- const { output } = await request('/api/v1/servers/cleanups/images', $session, {- body: {}- });- browser && toast.push(output);- await refetch()- }- async function cleanupBuildCache() {- const { output } = await request('/api/v1/servers/cleanups/caches', $session, {- body: {}- });- browser && toast.push(output);- await refetch()- }- async function cleanupContainers() {- const { output } = await request('/api/v1/servers/cleanups/containers', $session, {- body: {}- });- browser && toast.push(output);- await refetch()- }--</script>--<div class="min-h-full text-white" in:fade={{ duration: 100 }}>- <div class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center">- <div>Servers</div>- </div>-</div>--<div in:fade={{ duration: 100 }}>- <div class="max-w-4xl mx-auto px-6 pb-4 h-64 ">- <div class="text-center font-bold text-xl">{hostname}</div>- <div class="font-bold">Filesystem Usage</div>- {#each filesystems as filesystem}- <!-- <div>{JSON.stringify(filesystem)}</div> -->- <div class="text-xs">- {filesystem.mount}: {(filesystem.available / 1024 / 1024).toFixed()}MB ({filesystem.use}%) free of {(filesystem.size /1024 /1024).toFixed()}MB- </div>- {/each}- <div class="font-bold">Docker Reclaimable</div>- {#each dockerReclaimable as reclaimable}- <div class="text-xs">- {reclaimable.Type}: {reclaimable.Reclaimable} of {reclaimable.Size}- </div>- {/each}-- <button class="button hover:bg-warmGray-700 bg-warmGray-800 rounded p-2 font-bold" on:click={cleanupVolumes}>Cleanup unused volumes</button>- <button class="button hover:bg-warmGray-700 bg-warmGray-800 rounded p-2 font-bold" on:click={cleanupImages}>Cleanup unused images</button>- <button class="button hover:bg-warmGray-700 bg-warmGray-800 rounded p-2 font-bold" on:click={cleanupBuildCache}>Cleanup build caches</button>- <button class="button hover:bg-warmGray-700 bg-warmGray-800 rounded p-2 font-bold" on:click={cleanupContainers}>Cleanup containers</button>- </div>-</div>diff --git a/src/routes/service/[name]/__layout.svelte b/src/routes/service/[name]/__layout.sveltedeleted file mode 100644index 5fcc23a3e0..0000000000--- a/src/routes/service/[name]/__layout.svelte+++ /dev/null@@ -1,71 +0,0 @@-<script>- import { browser } from '$app/env';-- import { goto } from '$app/navigation';-- import { page, session } from '$app/stores';- import Tooltip from '$components/Tooltip.svelte';- import { request } from '$lib/request';-- import { toast } from '@zerodevx/svelte-toast';-- async function removeService() {- await request(`/api/v1/services/${$page.params.name}`, $session, {- method: 'DELETE'- });- if (browser) {- toast.push('Service removed.');- goto(`/dashboard/services`, { replaceState: true });- }- }-</script>--<nav class="flex text-white justify-end items-center m-4 fixed right-0 top-0 space-x-4">- <Tooltip position="bottom" label="Delete">- <button title="Delete" class="icon hover:text-red-500" on:click={removeService}>- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"- />- </svg>- </button>- </Tooltip>- <div class="border border-warmGray-700 h-8" />- <Tooltip position="bottom-left" label="Configuration">- <button- class="icon hover:text-yellow-400"- disabled={$page.path === '/service/new'}- class:text-yellow-400={$page.path.startsWith('/service')}- class:bg-warmGray-700={$page.path.startsWith('/service')}- on:click={() => goto(`/service/${$page.params.name}/configuration`)}- >- <svg- class="w-6"- xmlns="http://www.w3.org/2000/svg"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"- />- </svg>- </button>- </Tooltip>-</nav>--<div class="text-white">- <slot />-</div>diff --git a/src/routes/service/[name]/configuration.svelte b/src/routes/service/[name]/configuration.sveltedeleted file mode 100644index 44a8c9ffa8..0000000000--- a/src/routes/service/[name]/configuration.svelte+++ /dev/null@@ -1,126 +0,0 @@-<script>- import { fade } from 'svelte/transition';- import { toast } from '@zerodevx/svelte-toast';-- import { page, session } from '$app/stores';- import { request } from '$lib/request';- import { goto } from '$app/navigation';- import Loading from '$components/Loading.svelte';- import Plausible from '$components/Service/Plausible.svelte';- import { browser } from '$app/env';- import CodeServer from '$components/Service/CodeServer.svelte';- import MinIo from '$components/Service/MinIO.svelte';- let service = {};- async function loadServiceConfig() {- if ($page.params.name) {-- try {- service = await request(`/api/v1/services/${$page.params.name}`, $session);- } catch (error) {- if (browser) {- toast.push(`Cannot find service ${$page.params.name}?!`);- goto(`/dashboard/services`, { replaceState: true });- }- }- }- }--</script>--{#await loadServiceConfig()}- <Loading />-{:then}- <div class="min-h-full text-white">- <div class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center">- {#if $page.params.name === 'plausible'}- <div>Plausible Analytics</div>- {:else if $page.params.name === 'nocodb'}- <div>NocoDB</div>- {:else if $page.params.name === 'code-server'}- <div>VSCode Server</div>- {:else if $page.params.name === 'minio'}- <div>MinIO</div>- {:else if $page.params.name.match(/wp-/)}- <div>Wordpress<span class="flex text-xs items-center justify-center">({service.config.baseURL.replace('https://','')})</span></div>- {/if}-- <div class="px-4">- {#if $page.params.name === 'plausible'}- <img- alt="plausible logo"- class="w-6 mx-auto"- src="https://cdn.coollabs.io/assets/coolify/services/plausible/logo_sm.png"- />- {:else if $page.params.name === 'nocodb'}- <img- alt="nocodb logo"- class="w-8 mx-auto"- src="https://cdn.coollabs.io/assets/coolify/services/nocodb/nocodb.png"- />- {:else if $page.params.name === 'code-server'}- <svg class="w-8 mx-auto" viewBox="0 0 128 128">- <path- d="M3.656 45.043s-3.027-2.191.61-5.113l8.468-7.594s2.426-2.559 4.989-.328l78.175 59.328v28.45s-.039 4.468-5.757 3.976zm0 0"- fill="#2489ca"- /><path- d="M23.809 63.379L3.656 81.742s-2.07 1.543 0 4.305l9.356 8.527s2.222 2.395 5.508-.328l21.359-16.238zm0 0"- fill="#1070b3"- /><path- d="M59.184 63.531l36.953-28.285-.239-28.297S94.32.773 89.055 3.99L39.879 48.851zm0 0"- fill="#0877b9"- /><path- d="M90.14 123.797c2.145 2.203 4.747 1.48 4.747 1.48l28.797-14.222c3.687-2.52 3.171-5.645 3.171-5.645V20.465c0-3.735-3.812-5.024-3.812-5.024L98.082 3.38c-5.453-3.379-9.027.61-9.027.61s4.593-3.317 6.843 2.96v112.317c0 .773-.164 1.53-.492 2.214-.656 1.332-2.086 2.57-5.504 2.051zm0 0"- fill="#3c99d4"- />- </svg>- {:else if $page.params.name === 'minio'}- <img- alt="minio logo"- class="w-7 mx-auto"- src="https://cdn.coollabs.io/assets/coolify/services/minio/MINIO_Bird.png"- />- {:else if $page.params.name.match(/wp-/)}- <svg class="w-8 mx-auto" viewBox="0 0 128 128">- <path- fill-rule="evenodd"- clip-rule="evenodd"- fill="white"- d="M64.094 126.224c34.275-.052 62.021-27.933 62.021-62.325 0-33.833-27.618-61.697-60.613-62.286C30.85.995 1.894 29.113 1.885 63.21c-.01 35.079 27.612 63.064 62.209 63.014zM63.993 4.63c32.907-.011 59.126 26.725 59.116 60.28-.011 31.679-26.925 58.18-59.092 58.187-32.771.007-59.125-26.563-59.124-59.608.002-32.193 26.766-58.848 59.1-58.859zM39.157 35.896c.538 1.793-.968 2.417-2.569 2.542-1.685.13-3.369.257-5.325.406 6.456 19.234 12.815 38.183 19.325 57.573.464-.759.655-.973.739-1.223 3.574-10.682 7.168-21.357 10.651-32.069.318-.977.16-2.271-.188-3.275-1.843-5.32-4.051-10.524-5.667-15.908-1.105-3.686-2.571-6.071-6.928-5.644-.742.073-1.648-1.524-2.479-2.349 1.005-.6 2.003-1.704 3.017-1.719a849.593 849.593 0 0126.618.008c1.018.017 2.016 1.15 3.021 1.765-.88.804-1.639 2.01-2.668 2.321-1.651.498-3.482.404-5.458.58l19.349 57.56c2.931-9.736 5.658-18.676 8.31-27.639 2.366-8.001.956-15.473-3.322-22.52-1.286-2.119-2.866-4.175-3.595-6.486-.828-2.629-1.516-5.622-1.077-8.259.745-4.469 4.174-6.688 8.814-7.113C74.333.881 34.431 9.317 19.728 34.922c5.66-.261 11.064-.604 16.472-.678 1.022-.013 2.717.851 2.957 1.652zm10.117 77.971c-.118.345-.125.729-.218 1.302 10.943 3.034 21.675 2.815 32.659-.886l-16.78-45.96c-5.37 15.611-10.52 30.575-15.661 45.544zm-8.456-2.078l-25.281-69.35c-11.405 22.278-2.729 56.268 25.281 69.35zm76.428-44.562c.802-10.534-2.832-25.119-5.97-27.125-.35 3.875-.106 8.186-1.218 12.114-2.617 9.255-5.817 18.349-8.899 27.468-3.35 9.912-6.832 19.779-10.257 29.666 16.092-9.539 24.935-23.618 26.344-42.123z"- />- </svg>- {/if}- </div>- <a target="_blank" class="icon mx-2" href={service.config.baseURL}>- <svg- xmlns="http://www.w3.org/2000/svg"- class="h-6 w-6"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"- />- </svg></a- >- </div>- </div>- <div class="space-y-2 max-w-4xl mx-auto px-6" in:fade={{ duration: 100 }}>- <div class="block text-center py-4">- {#if $page.params.name === 'plausible'}- <Plausible {service} />- {:else if $page.params.name === 'nocodb'}- <div class="font-bold">Nothing to show here. Enjoy using NocoDB!</div>- {:else if $page.params.name === 'code-server'}- <CodeServer {service} />- {:else if $page.params.name === 'minio'}- <MinIo {service} />- {:else if $page.params.name.match(/wp-/)}- <div class="font-bold">Nothing to show here. Enjoy using WordPress!</div>- {/if}- </div>- </div>-{/await}diff --git a/src/routes/service/new/[type]/__layout.svelte b/src/routes/service/new/[type]/__layout.sveltedeleted file mode 100644index 1846ab5760..0000000000--- a/src/routes/service/new/[type]/__layout.svelte+++ /dev/null@@ -1,38 +0,0 @@-<script>- import { browser } from '$app/env';- import { goto } from '$app/navigation';- import { page, session } from '$app/stores';- import Loading from '$components/Loading.svelte';- import { request } from '$lib/request';- import { initialNewService, newService } from '$store';-- import { toast } from '@zerodevx/svelte-toast';- import { onDestroy } from 'svelte';-- async function checkService() {- try {- const data = await request(`/api/v1/services/${$page.params.type}`, $session);- if (data?.success) {- if (browser) {- goto(`/service/${$page.params.type}/configuration`, { replaceState: true });- toast.push(- `Service already deployed.`- );- }- }- } catch (error) {- //- }- }- onDestroy(() => {- $newService = JSON.parse(JSON.stringify(initialNewService));- });-</script>--{#await checkService()}- <Loading />-{:then}- <div class="text-white">- <slot />- </div>-{/await}diff --git a/src/routes/service/new/[type]/index.svelte b/src/routes/service/new/[type]/index.sveltedeleted file mode 100644index 93ae461b6e..0000000000--- a/src/routes/service/new/[type]/index.svelte+++ /dev/null@@ -1,509 +0,0 @@-<script>- import { fade } from 'svelte/transition';-- import { toast } from '@zerodevx/svelte-toast';- import { newService, newWordpressService } from '$store';- import { page, session } from '$app/stores';- import { request } from '$lib/request';- import { goto } from '$app/navigation';- import Loading from '$components/Loading.svelte';- import TooltipInfo from '$components/TooltipInfo.svelte';- import { browser } from '$app/env';-- $: deployablePlausible =- $newService.baseURL === '' ||- $newService.baseURL === null ||- $newService.email === '' ||- $newService.email === null ||- $newService.userName === '' ||- $newService.userName === null ||- $newService.userPassword === '' ||- $newService.userPassword === null ||- $newService.userPassword.length <= 6 ||- $newService.userPassword !== $newService.userPasswordAgain;-- $: deployableNocoDB = $newService.baseURL === '' || $newService.baseURL === null;- $: deployableCodeServer = $newService.baseURL === '' || $newService.baseURL === null;- $: deployableMinIO = $newService.baseURL === '' || $newService.baseURL === null;- $: deployableWordpress = false- let loading = false;- async function deployPlausible() {- try {- loading = true;- const payload = $newService;- delete payload.userPasswordAgain;- await request(`/api/v1/services/deploy/${$page.params.type}`, $session, {- body: payload- });- if (browser) {- toast.push(- 'Service deployment queued.<br><br><br>It could take 2-5 minutes to be ready, be patient and grab a coffee/tea!',- { duration: 4000 }- );- goto(`/dashboard/services`, { replaceState: true });- }- } catch (error) {- console.log(error);- browser && toast.push('Oops something went wrong. See console.log.');- } finally {- loading = false;- }- }- async function deployNocodb() {- try {- loading = true;- await request(`/api/v1/services/deploy/${$page.params.type}`, $session, {- body: {- baseURL: $newService.baseURL- }- });- if (browser) {- toast.push(- 'Service deployment queued.<br><br><br>It could take 2-5 minutes to be ready, be patient and grab a coffee/tea!',- { duration: 4000 }- );- goto(`/dashboard/services`, { replaceState: true });- }- } catch (error) {- console.log(error);- browser && toast.push('Oops something went wrong. See console.log.');- } finally {- loading = false;- }- }- async function deployCodeServer() {- try {- loading = true;- await request(`/api/v1/services/deploy/${$page.params.type}`, $session, {- body: {- baseURL: $newService.baseURL- }- });- if (browser) {- toast.push(- 'Service deployment queued.<br><br><br>It could take 2-5 minutes to be ready, be patient and grab a coffee/tea!',- { duration: 4000 }- );- goto(`/dashboard/services`, { replaceState: true });- }- } catch (error) {- console.log(error);- browser && toast.push('Oops something went wrong. See console.log.');- } finally {- loading = false;- }- }- async function deployMinIO() {- try {- loading = true;- await request(`/api/v1/services/deploy/${$page.params.type}`, $session, {- body: {- baseURL: $newService.baseURL- }- });- if (browser) {- toast.push(- 'Service deployment queued.<br><br><br>It could take 2-5 minutes to be ready, be patient and grab a coffee/tea!',- { duration: 4000 }- );- goto(`/dashboard/services`, { replaceState: true });- }- } catch (error) {- console.log(error);- browser && toast.push('Oops something went wrong. See console.log.');- } finally {- loading = false;- }- }- async function deployWordpress() {- try {- loading = true;- await request(`/api/v1/services/deploy/${$page.params.type}`, $session, {- body: {- ...$newWordpressService- }- });- if (browser) {- toast.push(- 'Service deployment queued.<br><br><br>It could take 2-5 minutes to be ready, be patient and grab a coffee/tea!',- { duration: 4000 }- );- goto(`/dashboard/services`, { replaceState: true });- }- } catch (error) {- console.log(error);- browser && toast.push('Oops something went wrong. See console.log.');- } finally {- loading = false;- }- }--</script>--<div class="min-h-full text-white">- <div class="py-5 text-left px-6 text-3xl tracking-tight font-bold">- Deploy new- {#if $page.params.type === 'plausible'}- <span class="text-blue-500 px-2 capitalize">Plausible Analytics</span>- {:else if $page.params.type === 'nocodb'}- <span class="text-blue-500 px-2 capitalize">NocoDB</span>- {:else if $page.params.type === 'code-server'}- <span class="text-blue-500 px-2 capitalize">VSCode Server</span>- {:else if $page.params.type === 'minio'}- <span class="text-blue-500 px-2 capitalize">MinIO</span>- {:else if $page.params.type === 'wordpress'}- <span class="text-blue-500 px-2 capitalize">Wordpress</span>- {/if}- </div>-</div>-{#if loading}- <Loading />-{:else if $page.params.type === 'plausible'}- <div class="space-y-2 max-w-xl mx-auto px-6 flex-col text-center" in:fade={{ duration: 100 }}>- <div class="grid grid-flow-row">- <label for="Domain"- >Domain <TooltipInfo- position="right"- label={`You could reach your Plausible Analytics instance here.`}- /></label- >- <input- id="Domain"- class:border-red-500={$newService.baseURL == null || $newService.baseURL == ''}- bind:value={$newService.baseURL}- placeholder="analytics.coollabs.io"- />- </div>- <div class="grid grid-flow-row">- <label for="Email">Email</label>- <input- id="Email"- class:border-red-500={$newService.email == null || $newService.email == ''}- bind:value={$newService.email}- placeholder="[email protected]"- />- </div>- <div class="grid grid-flow-row">- <label for="Username">Username </label>- <input- id="Username"- class:border-red-500={$newService.userName == null || $newService.userName == ''}- bind:value={$newService.userName}- placeholder="admin"- />- </div>- <div class="grid grid-flow-row">- <label for="Password"- >Password <TooltipInfo position="right" label={`Must be at least 7 characters.`} /></label- >- <input- id="Password"- type="password"- class:border-red-500={$newService.userPassword == null ||- $newService.userPassword == '' ||- $newService.userPassword.length <= 6}- bind:value={$newService.userPassword}- />- </div>- <div class="grid grid-flow-row pb-5">- <label for="PasswordAgain">Password again </label>- <input- id="PasswordAgain"- type="password"- class:placeholder-red-500={$newService.userPassword !== $newService.userPasswordAgain}- class:border-red-500={$newService.userPassword !== $newService.userPasswordAgain}- bind:value={$newService.userPasswordAgain}- />- </div>- <button- disabled={deployablePlausible}- class:cursor-not-allowed={deployablePlausible}- class:bg-blue-500={!deployablePlausible}- class:hover:bg-blue-400={!deployablePlausible}- class:hover:bg-transparent={deployablePlausible}- class:text-warmGray-700={deployablePlausible}- class:text-white={!deployablePlausible}- class="button p-2"- on:click={deployPlausible}- >- Deploy- </button>- </div>-{:else if $page.params.type === 'nocodb'}- <div class="space-y-2 max-w-xl mx-auto px-6 flex-col text-center" in:fade={{ duration: 100 }}>- <div class="grid grid-flow-row pb-5">- <label for="Domain"- >Domain <TooltipInfo- position="right"- label={`You could reach your NocoDB instance here.`}- /></label- >- <input- id="Domain"- class:border-red-500={$newService.baseURL == null || $newService.baseURL == ''}- bind:value={$newService.baseURL}- placeholder="nocodb.coollabs.io"- />- </div>-- <button- disabled={deployableNocoDB}- class:cursor-not-allowed={deployableNocoDB}- class:bg-blue-500={!deployableNocoDB}- class:hover:bg-blue-400={!deployableNocoDB}- class:hover:bg-transparent={deployableNocoDB}- class:text-warmGray-700={deployableNocoDB}- class:text-white={!deployableNocoDB}- class="button p-2 w-64 bg-blue-500 hover:bg-blue-400 text-white"- on:click={deployNocodb}- >- Deploy- </button>- </div>-{:else if $page.params.type === 'code-server'}- <div class="space-y-2 max-w-xl mx-auto px-6 flex-col text-center" in:fade={{ duration: 100 }}>- <div class="grid grid-flow-row pb-5">- <label for="Domain"- >Domain <TooltipInfo- position="right"- label={`You could reach your Code Server instance here.`}- /></label- >- <input- id="Domain"- class:border-red-500={$newService.baseURL == null || $newService.baseURL == ''}- bind:value={$newService.baseURL}- placeholder="code.coollabs.io"- />- </div>-- <button- disabled={deployableCodeServer}- class:cursor-not-allowed={deployableCodeServer}- class:bg-blue-500={!deployableCodeServer}- class:hover:bg-blue-400={!deployableCodeServer}- class:hover:bg-transparent={deployableCodeServer}- class:text-warmGray-700={deployableCodeServer}- class:text-white={!deployableCodeServer}- class="button p-2 w-64 bg-blue-500 hover:bg-blue-400 text-white"- on:click={deployCodeServer}- >- Deploy- </button>- </div>-{:else if $page.params.type === 'minio'}- <div class="space-y-2 max-w-xl mx-auto px-6 flex-col text-center" in:fade={{ duration: 100 }}>- <div class="grid grid-flow-row pb-5">- <label for="Domain"- >Domain <TooltipInfo- position="right"- label={`You could reach your MinIO instance here.`}- /></label- >- <input- id="Domain"- class:border-red-500={$newService.baseURL == null || $newService.baseURL == ''}- bind:value={$newService.baseURL}- placeholder="minio.coollabs.io"- />- </div>-- <button- disabled={deployableMinIO}- class:cursor-not-allowed={deployableMinIO}- class:bg-blue-500={!deployableMinIO}- class:hover:bg-blue-400={!deployableMinIO}- class:hover:bg-transparent={deployableMinIO}- class:text-warmGray-700={deployableMinIO}- class:text-white={!deployableMinIO}- class="button p-2 w-64 bg-blue-500 hover:bg-blue-400 text-white"- on:click={deployMinIO}- >- Deploy- </button>- </div>-{:else if $page.params.type === 'wordpress'}- <div class="space-y-2 max-w-xl mx-auto px-6 flex-col text-center" in:fade={{ duration: 100 }}>- <div class="grid grid-flow-row pb-5">- <label for="Domain"- >Domain <TooltipInfo- position="right"- label={`You could reach your Wordpress instance here.`}- /></label- >- <input- id="Domain"- class:border-red-500={$newWordpressService.baseURL == null || $newWordpressService.baseURL == ''}- bind:value={$newWordpressService.baseURL}- placeholder="wordpress.coollabs.io"- />- </div>- <div class="">- <div class="px-4 sm:px-6">- <ul class="divide-y divide-warmGray-800">- <li class="py-4 flex items-center justify-between text-left">- <div class="flex flex-col">- <p class="text-base font-bold text-warmGray-100">Use remote MySQL database?</p>- <p class="text-sm font-medium text-warmGray-400">- If not, Coolify will create a local database for you.- </p>- </div>- <button- type="button"- on:click={() => ($newWordpressService.remoteDB = !$newWordpressService.remoteDB)}- aria-pressed="true"- class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200"- class:bg-green-600={$newWordpressService.remoteDB}- class:bg-warmGray-700={!$newWordpressService.remoteDB}- >- <span class="sr-only">Use setting</span>- <span- class="pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white shadow transition ease-in-out duration-200 transform"- class:translate-x-5={$newWordpressService.remoteDB}- class:translate-x-0={!$newWordpressService.remoteDB}- >- <span- class=" ease-in duration-200 absolute inset-0 h-full w-full flex items-center justify-center transition-opacity"- class:opacity-0={$newWordpressService.remoteDB}- class:opacity-100={!$newWordpressService.remoteDB}- aria-hidden="true"- >- <svg class="bg-white h-3 w-3 text-red-600" fill="none" viewBox="0 0 12 12">- <path- d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- />- </svg>- </span>- <span- class="ease-out duration-100 absolute inset-0 h-full w-full flex items-center justify-center transition-opacity"- aria-hidden="true"- class:opacity-100={$newWordpressService.remoteDB}- class:opacity-0={!$newWordpressService.remoteDB}- >- <svg- class="bg-white h-3 w-3 text-green-600"- fill="currentColor"- viewBox="0 0 12 12"- >- <path- d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"- />- </svg>- </span>- </span>- </button>- </li>- </ul>- </div>- {#if $newWordpressService.remoteDB}- <div class="grid grid-flow-row pb-5">- <label for="database.host"- >DB Host <TooltipInfo- position="right"- label={`IP address of a remote Mysql instance.`}- /></label- >- <input- id="database.host"- class:border-red-500={$newWordpressService.database.host == null ||- $newWordpressService.database.host == ''}- bind:value={$newWordpressService.database.host}- placeholder="10.10.10.10:3306"- />- </div>- <div class="grid grid-flow-row pb-5">- <label for="database.user"- >DB User <TooltipInfo position="right" label={`Database user.`} /></label- >- <input- id="database.user"- class:border-red-500={$newWordpressService.database.user == null ||- $newWordpressService.database.user == ''}- bind:value={$newWordpressService.database.user}- placeholder="wordpressuser"- />- </div>- <div class="grid grid-flow-row pb-5">- <label for="database.password"- >DB Password <TooltipInfo- position="right"- label={`Database password for the database user.`}- /></label- >- <input- id="database.password"- class:border-red-500={$newWordpressService.database.password == null ||- $newWordpressService.database.password == ''}- bind:value={$newWordpressService.database.password}- placeholder="supersecretuserpasswordforwordpress"- />- </div>- <div class="grid grid-flow-row pb-5">- <label for="database.name"- >DB Name<TooltipInfo- position="right"- label={`Database name`}- /></label- >- <input- id="database.name"- class:border-red-500={$newWordpressService.database.name == null ||- $newWordpressService.database.name == ''}- bind:value={$newWordpressService.database.name}- placeholder="wordpress"- />- </div>- <div class="grid grid-flow-row pb-5">- <label for="database.tablePrefix"- >DB Table Prefix <TooltipInfo- position="right"- label={`Table prefix for wordpress`}- /></label- >- <input- id="database.tablePrefix"- class:border-red-500={$newWordpressService.database.tablePrefix == null ||- $newWordpressService.database.tablePrefix == ''}- bind:value={$newWordpressService.database.tablePrefix}- placeholder="wordpress"- />- </div>- {/if}- <div class="grid grid-flow-row py-5">- <label for="wordpressExtraConfiguration"- >Wordpress Configuration Extra <TooltipInfo- position="right"- label={`Database password for the database user.`}- /></label- >- <textarea- class="h-32"- id="wordpressExtraConfiguration"- bind:value={$newWordpressService.wordpressExtraConfiguration}- placeholder="// Example Extra Configuration-define('WP_ALLOW_MULTISITE', true );-define('MULTISITE', true);-define('SUBDOMAIN_INSTALL', false);"- />- </div>- </div>-- <button- disabled={deployableWordpress}- class:cursor-not-allowed={deployableWordpress}- class:bg-blue-500={!deployableWordpress}- class:hover:bg-blue-400={!deployableWordpress}- class:hover:bg-transparent={deployableWordpress}- class:text-warmGray-700={deployableWordpress}- class:text-white={!deployableWordpress}- class="button p-2 w-64 bg-blue-500 hover:bg-blue-400 text-white"- on:click={deployWordpress}- >- Deploy- </button>- </div>-{/if}diff --git a/src/routes/service/new/index.svelte b/src/routes/service/new/index.sveltedeleted file mode 100644index f100cddb94..0000000000--- a/src/routes/service/new/index.svelte+++ /dev/null@@ -1,90 +0,0 @@-<script>- import { goto } from '$app/navigation';- import { page } from '$app/stores';- import { fade } from 'svelte/transition';--</script>--<div class="min-h-full text-white">- <div class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center">- Select a service- </div>-</div>-<div class="text-center space-y-2 max-w-7xl mx-auto px-6" in:fade={{ duration: 100 }}>- {#if $page.path === '/service/new'}- <div class="flex justify-center font-bold pb-6 flex-wrap">- <div- class="text-center flex-col items-center cursor-pointer ease-in-out hover:scale-105 duration-100 border-2 border-dashed border-transparent hover:border-blue-500 p-2 m-2 rounded bg-warmGray-800 w-48"- on:click={() => goto('/service/new/plausible')}- >- <img- alt="plausible logo"- class="w-12 mx-auto"- src="https://cdn.coollabs.io/assets/coolify/services/plausible/logo_sm.png"- />- <div class="text-white">Plausible Analytics</div>- </div>- <div- class="text-center flex-col items-center cursor-pointer ease-in-out hover:scale-105 duration-100 border-2 border-dashed border-transparent hover:border-blue-500 p-2 m-2 rounded bg-warmGray-800 w-48"- on:click={() => goto('/service/new/nocodb')}- >- <img- alt="nocodb logo"- class="w-14 mx-auto pb-2"- src="https://cdn.coollabs.io/assets/coolify/services/nocodb/nocodb.png"- />- <div class="flex-1" />- <div class="text-white">NocoDB</div>- </div>- <div- class="text-center flex-col items-center cursor-pointer ease-in-out hover:scale-105 duration-100 border-2 border-dashed border-transparent hover:border-blue-500 p-2 m-2 rounded bg-warmGray-800 w-48"- on:click={() => goto('/service/new/code-server')}- >- <svg class="w-14 mx-auto pb-2" viewBox="0 0 128 128">- <path- d="M3.656 45.043s-3.027-2.191.61-5.113l8.468-7.594s2.426-2.559 4.989-.328l78.175 59.328v28.45s-.039 4.468-5.757 3.976zm0 0"- fill="#2489ca"- /><path- d="M23.809 63.379L3.656 81.742s-2.07 1.543 0 4.305l9.356 8.527s2.222 2.395 5.508-.328l21.359-16.238zm0 0"- fill="#1070b3"- /><path- d="M59.184 63.531l36.953-28.285-.239-28.297S94.32.773 89.055 3.99L39.879 48.851zm0 0"- fill="#0877b9"- /><path- d="M90.14 123.797c2.145 2.203 4.747 1.48 4.747 1.48l28.797-14.222c3.687-2.52 3.171-5.645 3.171-5.645V20.465c0-3.735-3.812-5.024-3.812-5.024L98.082 3.38c-5.453-3.379-9.027.61-9.027.61s4.593-3.317 6.843 2.96v112.317c0 .773-.164 1.53-.492 2.214-.656 1.332-2.086 2.57-5.504 2.051zm0 0"- fill="#3c99d4"- />- </svg>- <div class="flex-1" />- <div class="text-white">VSCode Server</div>- </div>- <div- class="text-center flex-col items-center cursor-pointer ease-in-out hover:scale-105 duration-100 border-2 border-dashed border-transparent hover:border-blue-500 p-2 m-2 rounded bg-warmGray-800 w-48"- on:click={() => goto('/service/new/minio')}- >- <img- alt="minio logo"- class="w-7 mx-auto pb-2"- src="https://cdn.coollabs.io/assets/coolify/services/minio/MINIO_Bird.png"- />- <div class="flex-1" />- <div class="text-white">MinIO</div>- </div>- <div- class="text-center flex-col items-center cursor-pointer ease-in-out hover:scale-105 duration-100 border-2 border-dashed border-transparent hover:border-blue-500 p-2 m-2 rounded bg-warmGray-800 w-48"- on:click={() => goto('/service/new/wordpress')}- >- <svg class="w-14 mx-auto pb-2" viewBox="0 0 128 128">- <path- fill-rule="evenodd"- clip-rule="evenodd"- fill="white"- d="M64.094 126.224c34.275-.052 62.021-27.933 62.021-62.325 0-33.833-27.618-61.697-60.613-62.286C30.85.995 1.894 29.113 1.885 63.21c-.01 35.079 27.612 63.064 62.209 63.014zM63.993 4.63c32.907-.011 59.126 26.725 59.116 60.28-.011 31.679-26.925 58.18-59.092 58.187-32.771.007-59.125-26.563-59.124-59.608.002-32.193 26.766-58.848 59.1-58.859zM39.157 35.896c.538 1.793-.968 2.417-2.569 2.542-1.685.13-3.369.257-5.325.406 6.456 19.234 12.815 38.183 19.325 57.573.464-.759.655-.973.739-1.223 3.574-10.682 7.168-21.357 10.651-32.069.318-.977.16-2.271-.188-3.275-1.843-5.32-4.051-10.524-5.667-15.908-1.105-3.686-2.571-6.071-6.928-5.644-.742.073-1.648-1.524-2.479-2.349 1.005-.6 2.003-1.704 3.017-1.719a849.593 849.593 0 0126.618.008c1.018.017 2.016 1.15 3.021 1.765-.88.804-1.639 2.01-2.668 2.321-1.651.498-3.482.404-5.458.58l19.349 57.56c2.931-9.736 5.658-18.676 8.31-27.639 2.366-8.001.956-15.473-3.322-22.52-1.286-2.119-2.866-4.175-3.595-6.486-.828-2.629-1.516-5.622-1.077-8.259.745-4.469 4.174-6.688 8.814-7.113C74.333.881 34.431 9.317 19.728 34.922c5.66-.261 11.064-.604 16.472-.678 1.022-.013 2.717.851 2.957 1.652zm10.117 77.971c-.118.345-.125.729-.218 1.302 10.943 3.034 21.675 2.815 32.659-.886l-16.78-45.96c-5.37 15.611-10.52 30.575-15.661 45.544zm-8.456-2.078l-25.281-69.35c-11.405 22.278-2.729 56.268 25.281 69.35zm76.428-44.562c.802-10.534-2.832-25.119-5.97-27.125-.35 3.875-.106 8.186-1.218 12.114-2.617 9.255-5.817 18.349-8.899 27.468-3.35 9.912-6.832 19.779-10.257 29.666 16.092-9.539 24.935-23.618 26.344-42.123z"- />- </svg>- <div class="flex-1" />- <div class="text-white">Wordpress</div>- </div>- </div>- {/if}-</div>diff --git a/src/routes/services/[id]/_Services/_MinIO.svelte b/src/routes/services/[id]/_Services/_MinIO.sveltenew file mode 100644index 0000000000..2cf4e5823c--- /dev/null+++ b/src/routes/services/[id]/_Services/_MinIO.svelte@@ -0,0 +1,48 @@+<script lang="ts">+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';++ export let service;+</script>++<div class="flex space-x-1 py-5 font-bold">+ <div class="title">MinIO Server</div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="rootUser">Root User</label>+ <div class="col-span-2 ">+ <input+ name="rootUser"+ id="rootUser"+ placeholder="User to login"+ value={service.minio.rootUser}+ disabled+ readonly+ />+ </div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="rootUserPassword">Root's Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ id="rootUserPassword"+ isPasswordField+ readonly+ disabled+ name="rootUserPassword"+ value={service.minio.rootUserPassword}+ />+ </div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="publicPort">API Port</label>+ <div class="col-span-2 ">+ <input+ name="publicPort"+ id="publicPort"+ value={service.minio.publicPort}+ disabled+ readonly+ placeholder="Generated automatically after start"+ />+ </div>+</div>diff --git a/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte b/src/routes/services/[id]/_Services/_PlausibleAnalytics.sveltenew file mode 100644index 0000000000..5b9550354c--- /dev/null+++ b/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte@@ -0,0 +1,103 @@+<script lang="ts">+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';+ export let service;+ export let readOnly;+</script>++<div class="flex space-x-1 py-5 font-bold">+ <div class="title">Plausible Analytics</div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="email">Email Address</label>+ <div class="col-span-2">+ <input+ name="email"+ id="email"+ disabled={readOnly}+ readonly={readOnly}+ placeholder="Email address"+ bind:value={service.plausibleAnalytics.email}+ required+ />+ </div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="username">Username</label>+ <div class="col-span-2">+ <CopyPasswordField+ name="username"+ id="username"+ disabled={readOnly}+ readonly={readOnly}+ placeholder="User to login"+ bind:value={service.plausibleAnalytics.username}+ required+ />+ </div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="password">Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ id="password"+ isPasswordField+ readonly+ disabled+ name="password"+ value={service.plausibleAnalytics.password}+ />+ </div>+</div>+<div class="flex space-x-1 py-5 font-bold">+ <div class="title">PostgreSQL</div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="postgresqlUser">Username</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ name="postgresqlUser"+ id="postgresqlUser"+ value={service.plausibleAnalytics.postgresqlUser}+ readonly+ disabled+ />+ </div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="postgresqlPassword">Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ id="postgresqlPassword"+ isPasswordField+ readonly+ disabled+ name="postgresqlPassword"+ value={service.plausibleAnalytics.postgresqlPassword}+ />+ </div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="postgresqlDatabase">Database</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ name="postgresqlDatabase"+ id="postgresqlDatabase"+ value={service.plausibleAnalytics.postgresqlDatabase}+ readonly+ disabled+ />+ </div>+</div>+<!-- <div class="grid grid-cols-3 items-center">+ <label for="postgresqlPublicPort">Public Port</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ placeholder="Generated automatically after start"+ readonly+ disabled+ id="postgresqlPublicPort"+ name="postgresqlPublicPort"+ value={service.plausibleAnalytics.postgresqlPublicPort}+ />+ </div>+</div> -->diff --git a/src/routes/services/[id]/_Services/_Services.svelte b/src/routes/services/[id]/_Services/_Services.sveltenew file mode 100644index 0000000000..0b1d6f6227--- /dev/null+++ b/src/routes/services/[id]/_Services/_Services.svelte@@ -0,0 +1,157 @@+<script lang="ts">+ export let service;+ export let isRunning;+ export let readOnly;++ import { page, session } from '$app/stores';+ import { post } from '$lib/api';+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';+ import Explainer from '$lib/components/Explainer.svelte';+ import { errorNotification } from '$lib/form';+ import { toast } from '@zerodevx/svelte-toast';+ import MinIo from './_MinIO.svelte';+ import PlausibleAnalytics from './_PlausibleAnalytics.svelte';+ import VsCodeServer from './_VSCodeServer.svelte';+ import Wordpress from './_Wordpress.svelte';++ const { id } = $page.params;++ let loading = false;+ let loadingVerification = false;++ async function handleSubmit() {+ loading = true;+ try {+ await post(`/services/${id}/check.json`, { fqdn: service.fqdn });+ await post(`/services/${id}/${service.type}.json`, { ...service });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+ async function setEmailsToVerified() {+ loadingVerification = true;+ try {+ await post(`/services/${id}/${service.type}/activate.json`, { id: service.id });+ toast.push('All email verified. You can login now.');+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loadingVerification = false;+ }+ }+</script>++<div class="mx-auto max-w-4xl px-6">+ <form on:submit|preventDefault={handleSubmit} class="py-4">+ <div class="flex space-x-1 pb-5 font-bold">+ <div class="title">General</div>+ {#if $session.isAdmin}+ <button+ type="submit"+ class:bg-pink-600={!loading}+ class:hover:bg-pink-500={!loading}+ disabled={loading}>{loading ? 'Saving...' : 'Save'}</button+ >+ {/if}+ {#if service.type === 'plausibleanalytics' && isRunning}+ <button+ on:click|preventDefault={setEmailsToVerified}+ class:bg-pink-600={!loadingVerification}+ class:hover:bg-pink-500={!loadingVerification}+ disabled={loadingVerification}+ >{loadingVerification ? 'Verifying' : 'Verify emails without SMTP'}</button+ >+ {/if}+ </div>++ <div class="grid grid-flow-row gap-2 px-10">+ <div class="mt-2 grid grid-cols-3 items-center">+ <label for="name">Name</label>+ <div class="col-span-2 ">+ <input+ readonly={!$session.isAdmin}+ name="name"+ id="name"+ bind:value={service.name}+ required+ />+ </div>+ </div>++ <div class="grid grid-cols-3 items-center">+ <label for="destination">Destination</label>+ <div class="col-span-2">+ {#if service.destinationDockerId}+ <div class="no-underline">+ <input+ value={service.destinationDocker.name}+ id="destination"+ disabled+ class="bg-transparent "+ />+ </div>+ {/if}+ </div>+ </div>+ <div class="grid grid-cols-3">+ <label for="fqdn" class="pt-2">Domain (FQDN)</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ placeholder="eg: https://analytics.coollabs.io"+ readonly={!$session.isAdmin && !isRunning}+ disabled={!$session.isAdmin || isRunning}+ name="fqdn"+ id="fqdn"+ pattern="^https?://([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{'{'}2,{'}'}$"+ bind:value={service.fqdn}+ required+ />+ <Explainer+ text="If you specify <span class='text-green-600 font-bold'>https</span>, the application will be accessible only over https. SSL certificate will be generated for you."+ />+ </div>+ <!-- {:else}+ <label for="fqdn" class="pt-2">Domain (FQDN)</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ placeholder="eg: https://analytics.coollabs.io"+ readonly={!$session.isAdmin}+ name="fqdn"+ id="fqdn"+ bind:value={service.fqdn}+ required+ />+ <Explainer+ text="If you specify <span class='text-green-600'>https</span>, the application will be accessible only over https. SSL certificate will be generated for you."+ />+ </div>+ {/if} -->+ </div>+ {#if service.type === 'plausibleanalytics'}+ <PlausibleAnalytics bind:service {readOnly} />+ {:else if service.type === 'minio'}+ <MinIo {service} />+ {:else if service.type === 'vscodeserver'}+ <VsCodeServer {service} />+ {:else if service.type === 'wordpress'}+ <Wordpress bind:service {isRunning} {readOnly} />+ {/if}+ </div>+ </form>+ <!-- <div class="font-bold flex space-x-1 pb-5">+ <div class="text-xl tracking-tight mr-4">Features</div>+ </div>+ <div class="px-4 sm:px-6 pb-10">+ <ul class="mt-2 divide-y divide-stone-800">+ <Setting+ bind:setting={isPublic}+ on:click={() => changeSettings('isPublic')}+ title="Set it public"+ description="Your database will be reachable over the internet. <br>Take security seriously in this case!"+ />+ </ul>+ </div> -->+</div>diff --git a/src/routes/services/[id]/_Services/_VSCodeServer.svelte b/src/routes/services/[id]/_Services/_VSCodeServer.sveltenew file mode 100644index 0000000000..4305b612a9--- /dev/null+++ b/src/routes/services/[id]/_Services/_VSCodeServer.svelte@@ -0,0 +1,22 @@+<script lang="ts">+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';++ export let service;+</script>++<div class="flex space-x-1 py-5 font-bold">+ <div class="title">VSCode Server</div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="password">Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ id="password"+ isPasswordField+ readonly+ disabled+ name="password"+ value={service.vscodeserver.password}+ />+ </div>+</div>diff --git a/src/routes/services/[id]/_Services/_Wordpress.svelte b/src/routes/services/[id]/_Services/_Wordpress.sveltenew file mode 100644index 0000000000..93dcbe5f39--- /dev/null+++ b/src/routes/services/[id]/_Services/_Wordpress.svelte@@ -0,0 +1,94 @@+<script lang="ts">+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';++ export let service;+ export let isRunning;+ export let readOnly;+</script>++<div class="flex space-x-1 py-5 font-bold">+ <div class="title">Wordpress</div>+</div>++<div class="grid grid-cols-3 items-center">+ <label for="extraConfig">Extra Config</label>+ <div class="col-span-2 ">+ <textarea+ disabled={isRunning}+ readonly={isRunning}+ class:resize-none={isRunning}+ rows={isRunning ? 1 : 5}+ name="extraConfig"+ id="extraConfig"+ placeholder={!isRunning+ ? `eg:++define('WP_ALLOW_MULTISITE', true);+define('MULTISITE', true);+define('SUBDOMAIN_INSTALL', false);`+ : null}>{service.wordpress.extraConfig}</textarea+ >+ </div>+</div>+<div class="flex space-x-1 py-5 font-bold">+ <div class="title">MySQL</div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="mysqlDatabase">Database</label>+ <div class="col-span-2 ">+ <input+ name="mysqlDatabase"+ id="mysqlDatabase"+ required+ readonly={readOnly}+ disabled={readOnly}+ bind:value={service.wordpress.mysqlDatabase}+ placeholder="eg: wordpress_db"+ />+ </div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="mysqlRootUser">Root User</label>+ <div class="col-span-2 ">+ <input+ name="mysqlRootUser"+ id="mysqlRootUser"+ placeholder="MySQL Root User"+ value={service.wordpress.mysqlRootUser}+ disabled+ readonly+ />+ </div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="mysqlRootUserPassword">Root's Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ id="mysqlRootUserPassword"+ isPasswordField+ readonly+ disabled+ name="mysqlRootUserPassword"+ value={service.wordpress.mysqlRootUserPassword}+ />+ </div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="mysqlUser">User</label>+ <div class="col-span-2 ">+ <input name="mysqlUser" id="mysqlUser" value={service.wordpress.mysqlUser} disabled readonly />+ </div>+</div>+<div class="grid grid-cols-3 items-center">+ <label for="mysqlPassword">Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ id="mysqlPassword"+ isPasswordField+ readonly+ disabled+ name="mysqlPassword"+ value={service.wordpress.mysqlPassword}+ />+ </div>+</div>diff --git a/src/routes/services/[id]/__layout.svelte b/src/routes/services/[id]/__layout.sveltenew file mode 100644index 0000000000..0beb4df6c1--- /dev/null+++ b/src/routes/services/[id]/__layout.svelte@@ -0,0 +1,202 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ function checkConfiguration(service): string {+ let configurationPhase = null;+ if (!service.type) {+ configurationPhase = 'type';+ } else if (!service.version) {+ configurationPhase = 'version';+ } else if (!service.destinationDockerId) {+ configurationPhase = 'destination';+ }+ return configurationPhase;+ }+ export const load: Load = async ({ fetch, params, url }) => {+ let readOnly = false;+ const endpoint = `/services/${params.id}.json`;+ const res = await fetch(endpoint);+ if (res.ok) {+ const { service, isRunning } = await res.json();+ if (!service || Object.entries(service).length === 0) {+ return {+ status: 302,+ redirect: '/databases'+ };+ }+ const configurationPhase = checkConfiguration(service);+ if (+ configurationPhase &&+ url.pathname !== `/services/${params.id}/configuration/${configurationPhase}`+ ) {+ return {+ status: 302,+ redirect: `/services/${params.id}/configuration/${configurationPhase}`+ };+ }+ if (service.plausibleAnalytics?.email && service.plausibleAnalytics.username) readOnly = true;+ if (service.wordpress?.mysqlDatabase) readOnly = true;++ return {+ props: {+ service,+ isRunning+ },+ stuff: {+ service,+ isRunning,+ readOnly+ }+ };+ }++ return {+ status: 302,+ redirect: '/services'+ };+ };+</script>++<script>+ import { session } from '$app/stores';+ import { errorNotification } from '$lib/form';+ import DeleteIcon from '$lib/components/DeleteIcon.svelte';+ import Loading from '$lib/components/Loading.svelte';+ import { del, post } from '$lib/api';+ import { goto } from '$app/navigation';+ import { onMount } from 'svelte';++ export let service;+ export let isRunning;++ let loading = false;++ async function deleteService() {+ const sure = confirm(`Are you sure you would like to delete '${service.name}'?`);+ if (sure) {+ loading = true;+ try {+ if (service.type) await post(`/services/${service.id}/${service.type}/stop.json`, {});+ await del(`/services/${service.id}/delete.json`, { id: service.id });+ return await goto(`/services`);+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+ }+ async function stopService() {+ const sure = confirm(`Are you sure you would like to stop '${service.name}'?`);+ if (sure) {+ loading = true;+ try {+ await post(`/services/${service.id}/${service.type}/stop.json`, {});+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+ }+ async function startService() {+ loading = true;+ try {+ await post(`/services/${service.id}/${service.type}/start.json`, {});+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ 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>++<nav class="nav-side">+ {#if loading}+ <Loading fullscreen cover />+ {:else}+ {#if service.type && service.destinationDockerId && service.version && service.fqdn}+ {#if isRunning}+ <button+ on:click={stopService}+ title="Stop Service"+ type="submit"+ disabled={!$session.isAdmin}+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-pink-600 hover:text-white"+ data-tooltip={$session.isAdmin+ ? 'Stop Service'+ : 'You do not have permission to stop the service.'}+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="w-6 h-6"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <rect x="6" y="5" width="4" height="14" rx="1" />+ <rect x="14" y="5" width="4" height="14" rx="1" />+ </svg>+ </button>+ {:else}+ <button+ on:click={startService}+ title="Start Service"+ type="submit"+ disabled={!$session.isAdmin}+ class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-pink-600 hover:text-white"+ data-tooltip={$session.isAdmin+ ? 'Start Service'+ : 'You do not have permission to start the service.'}+ ><svg+ xmlns="http://www.w3.org/2000/svg"+ class="w-6 h-6"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M7 4v16l13 -8z" />+ </svg>+ </button>+ {/if}+ {/if}+ <button+ on:click={deleteService}+ title="Delete Service"+ type="submit"+ disabled={!$session.isAdmin}+ class:hover:text-red-500={$session.isAdmin}+ class="icons bg-transparent tooltip-bottom text-sm"+ data-tooltip={$session.isAdmin+ ? 'Delete Service'+ : 'You do not have permission to delete a service.'}><DeleteIcon /></button+ >+ {/if}+</nav>+<slot />diff --git a/src/routes/services/[id]/check.json.ts b/src/routes/services/[id]/check.json.tsnew file mode 100644index 0000000000..6aff4c7a20--- /dev/null+++ b/src/routes/services/[id]/check.json.ts@@ -0,0 +1,26 @@+import { asyncExecShell, getDomain, getEngine, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } 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 { fqdn } = await event.request.json();++ if (fqdn) fqdn = fqdn.toLowerCase();++ try {+ const found = await db.isDomainConfigured({ id, fqdn });+ return {+ status: found ? 500 : 200,+ body: {+ error: found && `Domain ${getDomain(fqdn)} is already configured`+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/configuration/destination.json.ts b/src/routes/services/[id]/configuration/destination.json.tsnew file mode 100644index 0000000000..7a2556b4b5--- /dev/null+++ b/src/routes/services/[id]/configuration/destination.json.ts@@ -0,0 +1,19 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };+ const { id } = event.params;++ const { destinationId } = await event.request.json();++ try {+ await db.configureDestinationForService({ id, destinationId });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/configuration/destination.svelte b/src/routes/services/[id]/configuration/destination.sveltenew file mode 100644index 0000000000..d7220df870--- /dev/null+++ b/src/routes/services/[id]/configuration/destination.svelte@@ -0,0 +1,91 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, url, stuff }) => {+ const { service } = stuff;+ if (service?.destinationDockerId && !url.searchParams.get('from')) {+ return {+ status: 302,+ redirect: `/service/${params.id}`+ };+ }++ const endpoint = `/destinations.json`;+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import type Prisma from '@prisma/client';++ import { page } from '$app/stores';+ import { enhance, errorNotification } from '$lib/form';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';++ const { id } = $page.params;+ const from = $page.url.searchParams.get('from');++ export let destinations: Prisma.DestinationDocker[];+ async function handleSubmit(destinationId) {+ try {+ await post(`/services/${id}/configuration/destination.json`, { destinationId });+ return await goto(from || `/services/${id}`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Configure Destination</div>+</div>+<div class="flex justify-center">+ {#if !destinations || destinations.length === 0}+ <div class="flex-col">+ <div class="pb-2">No configurable Destination found</div>+ <div class="flex justify-center">+ <a href="/new/destination" sveltekit:prefetch class="add-icon bg-sky-600 hover:bg-sky-500">+ <svg+ class="w-6"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ ><path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 6v6m0 0v6m0-6h6m-6 0H6"+ /></svg+ >+ </a>+ </div>+ </div>+ {:else}+ <div class="flex flex-wrap justify-center">+ {#each destinations as destination}+ <div class="p-2">+ <form on:submit|preventDefault={() => handleSubmit(destination.id)}>+ <button type="submit" class="box-selection hover:bg-sky-700 font-bold">+ <div class="font-bold text-xl text-center truncate">{destination.name}</div>+ <div class="text-center truncate">{destination.network}</div>+ </button>+ </form>+ </div>+ {/each}+ </div>+ {/if}+</div>diff --git a/src/routes/services/[id]/configuration/type.json.ts b/src/routes/services/[id]/configuration/type.json.tsnew file mode 100644index 0000000000..02595a0c22--- /dev/null+++ b/src/routes/services/[id]/configuration/type.json.ts@@ -0,0 +1,32 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler, supportedServiceTypesAndVersions } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };+ return {+ status: 200,+ body: {+ types: supportedServiceTypesAndVersions+ }+ };+};++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { type } = await event.request.json();++ try {+ await db.configureServiceType({ id, type });+ return {+ status: 201+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/configuration/type.svelte b/src/routes/services/[id]/configuration/type.sveltenew file mode 100644index 0000000000..5fb0a05598--- /dev/null+++ b/src/routes/services/[id]/configuration/type.svelte@@ -0,0 +1,79 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, url, stuff }) => {+ const { service } = stuff;+ if (service?.type && !url.searchParams.get('from')) {+ return {+ status: 302,+ redirect: `/services/${params.id}`+ };+ }+ const endpoint = `/services/${params.id}/configuration/type.json`;+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import { page } from '$app/stores';+ import { errorNotification } from '$lib/form';+ import PlausibleAnalytics from '$lib/components/svg/services/PlausibleAnalytics.svelte';+ import NocoDb from '$lib/components/svg/services/NocoDB.svelte';+ import MinIo from '$lib/components/svg/services/MinIO.svelte';+ import VsCodeServer from '$lib/components/svg/services/VSCodeServer.svelte';+ import Wordpress from '$lib/components/svg/services/Wordpress.svelte';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';++ const { id } = $page.params;+ const from = $page.url.searchParams.get('from');++ export let types;++ async function handleSubmit(type) {+ try {+ await post(`/services/${id}/configuration/type.json`, { type });+ return await goto(from || `/services/${id}`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Select a Service</div>+</div>++<div class="flex flex-wrap justify-center">+ {#each types as type}+ <div class="p-2">+ <form on:submit|preventDefault={() => handleSubmit(type.name)}>+ <button type="submit" class="box-selection relative text-xl font-bold hover:bg-pink-600">+ {#if type.name === 'plausibleanalytics'}+ <PlausibleAnalytics isAbsolute />+ {:else if type.name === 'nocodb'}+ <NocoDb isAbsolute />+ {:else if type.name === 'minio'}+ <MinIo isAbsolute />+ {:else if type.name === 'vscodeserver'}+ <VsCodeServer isAbsolute />+ {:else if type.name === 'wordpress'}+ <Wordpress isAbsolute />+ {/if}{type.fancyName}+ </button>+ </form>+ </div>+ {/each}+</div>diff --git a/src/routes/services/[id]/configuration/version.json.ts b/src/routes/services/[id]/configuration/version.json.tsnew file mode 100644index 0000000000..e1e68e69b2--- /dev/null+++ b/src/routes/services/[id]/configuration/version.json.ts@@ -0,0 +1,40 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler, supportedServiceTypesAndVersions } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ const { type } = await db.getService({ id, teamId });+ return {+ status: 200,+ body: {+ versions: supportedServiceTypesAndVersions.find((name) => name.name === type).versions+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { version } = await event.request.json();++ try {+ await db.setService({ id, version });+ return {+ status: 201+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/configuration/version.svelte b/src/routes/services/[id]/configuration/version.sveltenew file mode 100644index 0000000000..5f29304877--- /dev/null+++ b/src/routes/services/[id]/configuration/version.svelte@@ -0,0 +1,63 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, url, stuff }) => {+ const { service } = stuff;+ if (service?.version && !url.searchParams.get('from')) {+ return {+ status: 302,+ redirect: `/services/${params.id}`+ };+ }+ const endpoint = `/services/${params.id}/configuration/version.json`;+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import { page } from '$app/stores';+ import { errorNotification } from '$lib/form';+ import { goto } from '$app/navigation';+ import { post } from '$lib/api';++ const { id } = $page.params;+ const from = $page.url.searchParams.get('from');++ export let versions;+ async function handleSubmit(version) {+ try {+ await post(`/services/${id}/configuration/version.json`, { version });+ return await goto(from || `/services/${id}`);+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Select a Service version</div>+</div>++<div class="flex flex-wrap justify-center">+ {#each versions as version}+ <div class="p-2">+ <form on:submit|preventDefault={() => handleSubmit(version)}>+ <button type="submit" class="box-selection text-xl font-bold hover:bg-pink-600"+ >{version}</button+ >+ </form>+ </div>+ {/each}+</div>diff --git a/src/routes/services/[id]/delete.json.ts b/src/routes/services/[id]/delete.json.tsnew file mode 100644index 0000000000..6608827473--- /dev/null+++ b/src/routes/services/[id]/delete.json.ts@@ -0,0 +1,18 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const del: RequestHandler = async (events) => {+ const { teamId, status, body } = await getUserDetails(events);+ if (status === 401) return { status, body };++ const { id } = events.params;++ try {+ await db.removeService({ id });+ return { status: 200 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/index.json.ts b/src/routes/services/[id]/index.json.tsnew file mode 100644index 0000000000..eefed08b05--- /dev/null+++ b/src/routes/services/[id]/index.json.ts@@ -0,0 +1,69 @@+import { asyncExecShell, getEngine, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import {+ generateDatabaseConfiguration,+ getServiceImage,+ getVersions,+ PrismaErrorHandler+} from '$lib/database';+import { dockerInstance } from '$lib/docker';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ try {+ const service = await db.getService({ id, teamId });+ const { destinationDockerId, destinationDocker, type, version } = service;++ let isRunning = false;+ if (destinationDockerId) {+ const host = getEngine(destinationDocker.engine);+ const docker = dockerInstance({ destinationDocker });+ const baseImage = getServiceImage(type);+ docker.engine.pull(`${baseImage}:${version}`);+ try {+ const { stdout } = await asyncExecShell(+ `DOCKER_HOST=${host} docker inspect --format '{{json .State}}' ${id}`+ );++ if (JSON.parse(stdout).Running) {+ isRunning = true;+ }+ } catch (error) {+ //+ }+ }+ return {+ body: {+ isRunning,+ service+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++// export const post: RequestHandler<Locals, FormData> = async (request) => {+// const { teamId, status, body } = await getUserDetails(request);+// if (status === 401) return { status, body }+// const { id } = request.params++// const name = request.body.get('name')+// const defaultDatabase = request.body.get('defaultDatabase')+// const dbUser = request.body.get('dbUser')+// const dbUserPassword = request.body.get('dbUserPassword')+// const rootUser = request.body.get('rootUser')+// const rootUserPassword = request.body.get('rootUserPassword')+// const version = request.body.get('version')++// try {+// return await db.updateDatabase({ id, name, defaultDatabase, dbUser, dbUserPassword, rootUser, rootUserPassword, version })+// } catch (err) {+// return err+// }++// }diff --git a/src/routes/services/[id]/index.svelte b/src/routes/services/[id]/index.sveltenew file mode 100644index 0000000000..06dace107c--- /dev/null+++ b/src/routes/services/[id]/index.svelte@@ -0,0 +1,101 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, stuff }) => {+ if (stuff?.service?.id) {+ return {+ props: {+ service: stuff.service,+ isRunning: stuff.isRunning,+ readOnly: stuff.readOnly+ }+ };+ }+ const endpoint = `/services/${params.id}.json`;+ const res = await fetch(endpoint);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${endpoint}`)+ };+ };+</script>++<script lang="ts">+ import PlausibleAnalytics from '$lib/components/svg/services/PlausibleAnalytics.svelte';+ import NocoDb from '$lib/components/svg/services/NocoDB.svelte';+ import MinIo from '$lib/components/svg/services/MinIO.svelte';+ import VsCodeServer from '$lib/components/svg/services/VSCodeServer.svelte';+ import Wordpress from '$lib/components/svg/services/Wordpress.svelte';+ import Services from './_Services/_Services.svelte';+ import { getDomain } from '$lib/components/common';++ export let service;+ export let isRunning;+ export let readOnly;+</script>++<div+ class="flex items-center space-x-3 px-6 text-2xl font-bold"+ class:p-5={service.fqdn}+ class:p-6={!service.fqdn}+>+ <div class="md:max-w-64 truncate text-base tracking-tight md:text-2xl lg:block">+ {service.name}+ </div>+ {#if service.fqdn}+ <a+ href={service.fqdn}+ target="_blank"+ class="icons tooltip-bottom flex items-center bg-transparent text-sm"+ ><svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-6 w-6"+ viewBox="0 0 24 24"+ stroke-width="1.5"+ stroke="currentColor"+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />+ <path d="M11 7h-5a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-5" />+ <line x1="10" y1="14" x2="20" y2="4" />+ <polyline points="15 4 20 4 20 9" />+ </svg></a+ >+ {/if}++ <div>+ {#if service.type === 'plausibleanalytics'}+ <a href="https://plausible.io" target="_blank">+ <PlausibleAnalytics />+ </a>+ {:else if service.type === 'nocodb'}+ <a href="https://nocodb.com" target="_blank">+ <NocoDb />+ </a>+ {:else if service.type === 'minio'}+ <a href="https://min.io" target="_blank">+ <MinIo />+ </a>+ {:else if service.type === 'vscodeserver'}+ <a href="https://coder.com" target="_blank">+ <VsCodeServer />+ </a>+ {:else if service.type === 'wordpress'}+ <a href="https://wordpress.org" target="_blank">+ <Wordpress />+ </a>+ {/if}+ </div>+</div>++<Services bind:service {isRunning} {readOnly} />diff --git a/src/routes/services/[id]/minio/index.json.ts b/src/routes/services/[id]/minio/index.json.tsnew file mode 100644index 0000000000..d025604b58--- /dev/null+++ b/src/routes/services/[id]/minio/index.json.ts@@ -0,0 +1,21 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } 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.updateNocoDbOrMinioService({ id, fqdn, name });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/minio/start.json.ts b/src/routes/services/[id]/minio/start.json.tsnew file mode 100644index 0000000000..3b7d785250--- /dev/null+++ b/src/routes/services/[id]/minio/start.json.ts@@ -0,0 +1,107 @@+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 { letsEncrypt } from '$lib/letsencrypt';+import {+ configureSimpleServiceProxyOn,+ reloadHaproxy,+ startHttpProxy,+ startTcpProxy+} from '$lib/haproxy';+import getPort from 'get-port';+import { getDomain } from '$lib/components/common';+import { PrismaErrorHandler } from '$lib/database';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ const service = await db.getService({ id, teamId });+ const {+ type,+ version,+ fqdn,+ destinationDockerId,+ destinationDocker,+ minio: { rootUser, rootUserPassword }+ } = service;++ const domain = getDomain(fqdn);+ const isHttps = fqdn.startsWith('https://');++ const network = destinationDockerId && destinationDocker.network;+ const host = getEngine(destinationDocker.engine);+ const publicPort = await getPort();+ const consolePort = 9001;+ const apiPort = 9000;+ const { workdir } = await createDirectories({ repository: type, buildId: id });++ const config = {+ image: `minio/minio:${version}`,+ volume: `${id}-minio-data:/data`,+ environmentVariables: {+ MINIO_ROOT_USER: rootUser,+ MINIO_ROOT_PASSWORD: rootUserPassword,+ MINIO_BROWSER_REDIRECT_URL: fqdn+ }+ };+ const composeFile = {+ version: '3.8',+ services: {+ [id]: {+ container_name: id,+ image: `minio/minio:${version}`,+ command: `server /data --console-address ":${consolePort}"`,+ environment: config.environmentVariables,+ networks: [network],+ volumes: [config.volume],+ restart: 'always'+ }+ },+ networks: {+ [network]: {+ external: true+ }+ },+ volumes: {+ [config.volume.split(':')[0]]: {+ external: true+ }+ }+ };+ const composeFileDestination = `${workdir}/docker-compose.yaml`;+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));+ try {+ await asyncExecShell(+ `DOCKER_HOST=${host} docker volume create ${config.volume.split(':')[0]}`+ );+ } catch (error) {+ console.log(error);+ }+ try {+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);+ await configureSimpleServiceProxyOn({ id, domain, port: consolePort });++ await db.updateMinioService({ id, publicPort });+ await startHttpProxy(destinationDocker, id, publicPort, apiPort);++ if (isHttps) {+ await letsEncrypt({ domain, id });+ }+ await reloadHaproxy(destinationDocker.engine);+ return {+ status: 200+ };+ } catch (error) {+ console.log(error);+ return PrismaErrorHandler(error);+ }+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/minio/stop.json.ts b/src/routes/services/[id]/minio/stop.json.tsnew file mode 100644index 0000000000..94e4f4be62--- /dev/null+++ b/src/routes/services/[id]/minio/stop.json.ts@@ -0,0 +1,46 @@+import { getEngine, getUserDetails, removeDestinationDocker } from '$lib/common';+import { getDomain } from '$lib/components/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import { checkContainer, configureSimpleServiceProxyOff, stopTcpHttpProxy } from '$lib/haproxy';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ const service = await db.getService({ id, teamId });+ const {+ destinationDockerId,+ destinationDocker,+ fqdn,+ minio: { publicPort }+ } = service;+ await db.updateMinioService({ id, publicPort: null });+ const domain = getDomain(fqdn);+ if (destinationDockerId) {+ const engine = destinationDocker.engine;++ try {+ const found = await checkContainer(engine, id);+ if (found) {+ await removeDestinationDocker({ id, engine });+ }+ } catch (error) {+ console.error(error);+ }+ await stopTcpHttpProxy(destinationDocker, publicPort);+ await configureSimpleServiceProxyOff({ domain });+ }++ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/nocodb/index.json.ts b/src/routes/services/[id]/nocodb/index.json.tsnew file mode 100644index 0000000000..920ab24d89--- /dev/null+++ b/src/routes/services/[id]/nocodb/index.json.ts@@ -0,0 +1,20 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } 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.updateNocoDbOrMinioService({ id, fqdn, name });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/nocodb/start.json.ts b/src/routes/services/[id]/nocodb/start.json.tsnew file mode 100644index 0000000000..6d7d214a8a--- /dev/null+++ b/src/routes/services/[id]/nocodb/start.json.ts@@ -0,0 +1,66 @@+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 { letsEncrypt } from '$lib/letsencrypt';+import { configureSimpleServiceProxyOn, reloadHaproxy } from '$lib/haproxy';+import { getDomain } from '$lib/components/common';+import { PrismaErrorHandler } from '$lib/database';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ const service = await db.getService({ id, teamId });+ const { type, version, fqdn, destinationDockerId, destinationDocker } = service;++ const domain = getDomain(fqdn);+ const isHttps = fqdn.startsWith('https://');++ const network = destinationDockerId && destinationDocker.network;+ const host = getEngine(destinationDocker.engine);++ const { workdir } = await createDirectories({ repository: type, buildId: id });++ const composeFile = {+ version: '3.8',+ services: {+ [id]: {+ container_name: id,+ image: `nocodb/nocodb:${version}`,+ networks: [network],+ restart: 'always'+ }+ },+ networks: {+ [network]: {+ external: true+ }+ }+ };+ const composeFileDestination = `${workdir}/docker-compose.yaml`;+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));++ try {+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);+ await configureSimpleServiceProxyOn({ id, domain, port: 8080 });++ if (isHttps) {+ await letsEncrypt({ domain, id });+ }+ await reloadHaproxy(destinationDocker.engine);+ return {+ status: 200+ };+ } catch (error) {+ console.log(error);+ return PrismaErrorHandler(error);+ }+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/nocodb/stop.json.ts b/src/routes/services/[id]/nocodb/stop.json.tsnew file mode 100644index 0000000000..64a3141b38--- /dev/null+++ b/src/routes/services/[id]/nocodb/stop.json.ts@@ -0,0 +1,39 @@+import { getUserDetails, removeDestinationDocker } from '$lib/common';+import { getDomain } from '$lib/components/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import { checkContainer, configureSimpleServiceProxyOff } 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;+ const domain = getDomain(fqdn);+ if (destinationDockerId) {+ const engine = destinationDocker.engine;++ try {+ const found = await checkContainer(engine, id);+ if (found) {+ await removeDestinationDocker({ id, engine });+ }+ } catch (error) {+ console.error(error);+ }+ await configureSimpleServiceProxyOff({ domain });+ }++ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/plausibleanalytics/activate.json.ts b/src/routes/services/[id]/plausibleanalytics/activate.json.tsnew file mode 100644index 0000000000..2200fff3d1--- /dev/null+++ b/src/routes/services/[id]/plausibleanalytics/activate.json.ts@@ -0,0 +1,33 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = await event.request.json();++ try {+ const {+ destinationDockerId,+ destinationDocker,+ plausibleAnalytics: { postgresqlUser, postgresqlPassword, postgresqlDatabase }+ } = await db.getService({ id, teamId });+ if (destinationDockerId) {+ const docker = dockerInstance({ destinationDocker });+ const container = await docker.engine.getContainer(id);+ const command = await container.exec({+ Cmd: [+ `psql -H postgresql://${postgresqlUser}:${postgresqlPassword}@localhost:5432/${postgresqlDatabase} -c "UPDATE users SET email_verified = true;"`+ ]+ });+ await command.start();+ }+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/plausibleanalytics/index.json.ts b/src/routes/services/[id]/plausibleanalytics/index.json.tsnew file mode 100644index 0000000000..cd149685c6--- /dev/null+++ b/src/routes/services/[id]/plausibleanalytics/index.json.ts@@ -0,0 +1,26 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } 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,+ plausibleAnalytics: { email, username }+ } = await event.request.json();++ if (fqdn) fqdn = fqdn.toLowerCase();+ if (email) email = email.toLowerCase();++ try {+ await db.updatePlausibleAnalyticsService({ id, fqdn, name, email, username });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/plausibleanalytics/start.json.ts b/src/routes/services/[id]/plausibleanalytics/start.json.tsnew file mode 100644index 0000000000..406e67adc7--- /dev/null+++ b/src/routes/services/[id]/plausibleanalytics/start.json.ts@@ -0,0 +1,195 @@+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 { letsEncrypt } from '$lib/letsencrypt';+import { configureSimpleServiceProxyOn, reloadHaproxy } from '$lib/haproxy';+import { getDomain } from '$lib/components/common';+import { PrismaErrorHandler } from '$lib/database';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ const service = await db.getService({ id, teamId });+ const {+ type,+ version,+ fqdn,+ destinationDockerId,+ destinationDocker,+ plausibleAnalytics: {+ id: plausibleDbId,+ username,+ email,+ password,+ postgresqlDatabase,+ postgresqlPassword,+ postgresqlUser,+ secretKeyBase+ }+ } = service;++ const domain = getDomain(fqdn);+ const isHttps = fqdn.startsWith('https://');++ const config = {+ plausibleAnalytics: {+ image: `plausible/analytics:${version}`,+ environmentVariables: {+ ADMIN_USER_EMAIL: email,+ ADMIN_USER_NAME: username,+ ADMIN_USER_PWD: password,+ BASE_URL: fqdn,+ SECRET_KEY_BASE: secretKeyBase,+ DISABLE_AUTH: 'false',+ DISABLE_REGISTRATION: 'true',+ DATABASE_URL: `postgresql://${postgresqlUser}:${postgresqlPassword}@${id}-postgresql:5432/${postgresqlDatabase}`,+ CLICKHOUSE_DATABASE_URL: `http://${id}-clickhouse:8123/plausible`+ }+ },+ postgresql: {+ volume: `${plausibleDbId}-postgresql-data:/var/lib/postgresql/data`,+ image: 'bitnami/postgresql:13.2.0',+ environmentVariables: {+ POSTGRESQL_PASSWORD: postgresqlPassword,+ POSTGRESQL_USERNAME: postgresqlUser,+ POSTGRESQL_DATABASE: postgresqlDatabase+ }+ },+ clickhouse: {+ volume: `${plausibleDbId}-clickhouse-data:/var/lib/clickhouse`,+ image: 'yandex/clickhouse-server:21.3.2.5',+ environmentVariables: {},+ ulimits: {+ nofile: {+ soft: 262144,+ hard: 262144+ }+ }+ }+ };+ const network = destinationDockerId && destinationDocker.network;+ const host = getEngine(destinationDocker.engine);+ const engine = destinationDocker.engine;+ // const labels = await makeLabelForPlausibleAnalytics({ id, })++ const { workdir } = await createDirectories({ repository: type, buildId: id });++ const clickhouseConfigXml = `+ <yandex>+ <logger>+ <level>warning</level>+ <console>true</console>+ </logger>++ <!-- Stop all the unnecessary logging -->+ <query_thread_log remove="remove"/>+ <query_log remove="remove"/>+ <text_log remove="remove"/>+ <trace_log remove="remove"/>+ <metric_log remove="remove"/>+ <asynchronous_metric_log remove="remove"/>+ </yandex>`;+ const clickhouseUserConfigXml = `+ <yandex>+ <profiles>+ <default>+ <log_queries>0</log_queries>+ <log_query_threads>0</log_query_threads>+ </default>+ </profiles>+ </yandex>`;++ const initQuery = 'CREATE DATABASE IF NOT EXISTS plausible;';+ const initScript = 'clickhouse client --queries-file /docker-entrypoint-initdb.d/init.query';+ await fs.writeFile(`${workdir}/clickhouse-config.xml`, clickhouseConfigXml);+ await fs.writeFile(`${workdir}/clickhouse-user-config.xml`, clickhouseUserConfigXml);+ await fs.writeFile(`${workdir}/init.query`, initQuery);+ await fs.writeFile(`${workdir}/init-db.sh`, initScript);++ const Dockerfile = `+FROM ${config.clickhouse.image}+COPY ./clickhouse-config.xml /etc/clickhouse-server/users.d/logging.xml+COPY ./clickhouse-user-config.xml /etc/clickhouse-server/config.d/logging.xml+COPY ./init.query /docker-entrypoint-initdb.d/init.query+COPY ./init-db.sh /docker-entrypoint-initdb.d/init-db.sh`;++ await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile);+ const composeFile = {+ version: '3.8',+ services: {+ [id]: {+ container_name: id,+ image: config.plausibleAnalytics.image,+ command:+ 'sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"',+ networks: [network],+ environment: config.plausibleAnalytics.environmentVariables,+ volumes: [config.postgresql.volume],+ restart: 'always',+ depends_on: [`${id}-postgresql`, `${id}-clickhouse`]+ },+ [`${id}-postgresql`]: {+ container_name: `${id}-postgresql`,+ image: config.postgresql.image,+ networks: [network],+ environment: config.postgresql.environmentVariables,+ volumes: [config.postgresql.volume],+ restart: 'always'+ },+ [`${id}-clickhouse`]: {+ build: workdir,+ container_name: `${id}-clickhouse`,+ networks: [network],+ environment: config.clickhouse.environmentVariables,+ volumes: [config.clickhouse.volume],+ restart: 'always'+ }+ },+ networks: {+ [network]: {+ external: true+ }+ },+ volumes: {+ [config.postgresql.volume.split(':')[0]]: {+ external: true+ },+ [config.clickhouse.volume.split(':')[0]]: {+ external: true+ }+ }+ };+ const composeFileDestination = `${workdir}/docker-compose.yaml`;+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));+ try {+ await asyncExecShell(+ `DOCKER_HOST=${host} docker volume create ${config.postgresql.volume.split(':')[0]}`+ );+ await asyncExecShell(+ `DOCKER_HOST=${host} docker volume create ${config.clickhouse.volume.split(':')[0]}`+ );+ } catch (error) {+ console.log(error);+ }+ await asyncExecShell(+ `DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up --build -d`+ );+ await configureSimpleServiceProxyOn({ id, domain, port: 8000 });++ if (isHttps) {+ await letsEncrypt({ domain, id });+ }+ await reloadHaproxy(destinationDocker.engine);+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/plausibleanalytics/stop.json.ts b/src/routes/services/[id]/plausibleanalytics/stop.json.tsnew file mode 100644index 0000000000..1c7fc95157--- /dev/null+++ b/src/routes/services/[id]/plausibleanalytics/stop.json.ts@@ -0,0 +1,49 @@+import { getUserDetails, removeDestinationDocker } from '$lib/common';+import { getDomain } from '$lib/components/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import { checkContainer, configureSimpleServiceProxyOff } 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;+ const domain = getDomain(fqdn);++ if (destinationDockerId) {+ const engine = destinationDocker.engine;++ try {+ let found = await checkContainer(engine, id);+ if (found) {+ await removeDestinationDocker({ id, engine });+ }+ found = await checkContainer(engine, `${id}-postgresql`);+ if (found) {+ await removeDestinationDocker({ id: `${id}-postgresql`, engine });+ }+ found = await checkContainer(engine, `${id}-clickhouse`);+ if (found) {+ await removeDestinationDocker({ id: `${id}-clickhouse`, engine });+ }+ } catch (error) {+ console.error(error);+ }++ await configureSimpleServiceProxyOff({ domain });+ }++ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/vscodeserver/index.json.ts b/src/routes/services/[id]/vscodeserver/index.json.tsnew file mode 100644index 0000000000..6824a31dd4--- /dev/null+++ b/src/routes/services/[id]/vscodeserver/index.json.ts@@ -0,0 +1,21 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } 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.updateVsCodeServer({ id, fqdn, name });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/vscodeserver/start.json.ts b/src/routes/services/[id]/vscodeserver/start.json.tsnew file mode 100644index 0000000000..4e762c7c78--- /dev/null+++ b/src/routes/services/[id]/vscodeserver/start.json.ts@@ -0,0 +1,93 @@+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 { letsEncrypt } from '$lib/letsencrypt';+import { configureSimpleServiceProxyOn, reloadHaproxy } from '$lib/haproxy';+import { getDomain } from '$lib/components/common';+import { PrismaErrorHandler } from '$lib/database';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ const service = await db.getService({ id, teamId });+ const {+ type,+ version,+ fqdn,+ destinationDockerId,+ destinationDocker,+ vscodeserver: { password }+ } = service;++ const domain = getDomain(fqdn);+ const isHttps = fqdn.startsWith('https://');++ const network = destinationDockerId && destinationDocker.network;+ const host = getEngine(destinationDocker.engine);++ const { workdir } = await createDirectories({ repository: type, buildId: id });+ const config = {+ image: `codercom/code-server:${version}`,+ volume: `${id}-vscodeserver-data:/home/coder`,+ environmentVariables: {+ PASSWORD: password+ }+ };+ const composeFile = {+ version: '3.8',+ services: {+ [id]: {+ container_name: id,+ image: config.image,+ environment: config.environmentVariables,+ networks: [network],+ volumes: [config.volume],+ restart: 'always'+ }+ },+ networks: {+ [network]: {+ external: true+ }+ },+ volumes: {+ [config.volume.split(':')[0]]: {+ external: true+ }+ }+ };+ const composeFileDestination = `${workdir}/docker-compose.yaml`;+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));++ try {+ await asyncExecShell(+ `DOCKER_HOST=${host} docker volume create ${config.volume.split(':')[0]}`+ );+ } catch (error) {+ console.log(error);+ }++ try {+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);+ await configureSimpleServiceProxyOn({ id, domain, port: 8080 });++ if (isHttps) {+ await letsEncrypt({ domain, id });+ }+ await reloadHaproxy(destinationDocker.engine);+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/vscodeserver/stop.json.ts b/src/routes/services/[id]/vscodeserver/stop.json.tsnew file mode 100644index 0000000000..e3faf42b5a--- /dev/null+++ b/src/routes/services/[id]/vscodeserver/stop.json.ts@@ -0,0 +1,38 @@+import { getUserDetails, removeDestinationDocker } from '$lib/common';+import { getDomain } from '$lib/components/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import { checkContainer, configureSimpleServiceProxyOff } 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;+ const domain = getDomain(fqdn);+ if (destinationDockerId) {+ const engine = destinationDocker.engine;++ try {+ const found = await checkContainer(engine, id);+ if (found) {+ await removeDestinationDocker({ id, engine });+ }+ } catch (error) {+ console.error(error);+ }+ await configureSimpleServiceProxyOff({ domain });+ }+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/wordpress/index.json.ts b/src/routes/services/[id]/wordpress/index.json.tsnew file mode 100644index 0000000000..ec49b77bad--- /dev/null+++ b/src/routes/services/[id]/wordpress/index.json.ts@@ -0,0 +1,24 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } 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,+ wordpress: { extraConfig, mysqlDatabase }+ } = await event.request.json();+ if (fqdn) fqdn = fqdn.toLowerCase();++ try {+ await db.updateWordpress({ id, fqdn, name, extraConfig, mysqlDatabase });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/wordpress/start.json.ts b/src/routes/services/[id]/wordpress/start.json.tsnew file mode 100644index 0000000000..ffb0c11e72--- /dev/null+++ b/src/routes/services/[id]/wordpress/start.json.ts@@ -0,0 +1,131 @@+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 { letsEncrypt } from '$lib/letsencrypt';+import { configureSimpleServiceProxyOn, reloadHaproxy } from '$lib/haproxy';+import { getDomain } from '$lib/components/common';+import { PrismaErrorHandler } from '$lib/database';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ const service = await db.getService({ id, teamId });+ const {+ type,+ version,+ fqdn,+ destinationDockerId,+ destinationDocker,+ wordpress: {+ mysqlDatabase,+ mysqlUser,+ mysqlPassword,+ extraConfig,+ mysqlRootUser,+ mysqlRootUserPassword+ }+ } = service;++ const domain = getDomain(fqdn);+ const isHttps = fqdn.startsWith('https://');++ const network = destinationDockerId && destinationDocker.network;+ const host = getEngine(destinationDocker.engine);++ const { workdir } = await createDirectories({ repository: type, buildId: id });+ const config = {+ wordpress: {+ image: `wordpress:${version}`,+ volume: `${id}-wordpress-data:/var/www/html`,+ environmentVariables: {+ WORDPRESS_DB_HOST: `${id}-mysql`,+ WORDPRESS_DB_USER: mysqlUser,+ WORDPRESS_DB_PASSWORD: mysqlPassword,+ WORDPRESS_DB_NAME: mysqlDatabase,+ WORDPRESS_CONFIG_EXTRA: extraConfig+ }+ },+ mysql: {+ image: `bitnami/mysql:5.7`,+ volume: `${id}-mysql-data:/bitnami/mysql/data`,+ environmentVariables: {+ MYSQL_ROOT_PASSWORD: mysqlRootUserPassword,+ MYSQL_ROOT_USER: mysqlRootUser,+ MYSQL_USER: mysqlUser,+ MYSQL_PASSWORD: mysqlPassword,+ MYSQL_DATABASE: mysqlDatabase+ }+ }+ };+ const composeFile = {+ version: '3.8',+ services: {+ [id]: {+ container_name: id,+ image: config.wordpress.image,+ environment: config.wordpress.environmentVariables,+ networks: [network],+ restart: 'always',+ depends_on: [`${id}-mysql`]+ },+ [`${id}-mysql`]: {+ container_name: `${id}-mysql`,+ image: config.mysql.image,+ environment: config.mysql.environmentVariables,+ networks: [network],+ restart: 'always'+ }+ },+ networks: {+ [network]: {+ external: true+ }+ },+ volumes: {+ [config.mysql.volume.split(':')[0]]: {+ external: true+ },+ [config.wordpress.volume.split(':')[0]]: {+ external: true+ }+ }+ };+ const composeFileDestination = `${workdir}/docker-compose.yaml`;+ await fs.writeFile(composeFileDestination, yaml.dump(composeFile));++ try {+ await asyncExecShell(+ `DOCKER_HOST=${host} docker volume create ${config.mysql.volume.split(':')[0]}`+ );+ await asyncExecShell(+ `DOCKER_HOST=${host} docker volume create ${config.wordpress.volume.split(':')[0]}`+ );+ } catch (error) {+ console.log(error);+ }++ try {+ await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);+ await configureSimpleServiceProxyOn({ id, domain, port: 80 });++ if (isHttps) {+ await letsEncrypt({ domain, id });+ }+ await reloadHaproxy(destinationDocker.engine);+ return {+ status: 200+ };+ } catch (error) {+ console.log(error);+ return PrismaErrorHandler(error);+ }+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/[id]/wordpress/stop.json.ts b/src/routes/services/[id]/wordpress/stop.json.tsnew file mode 100644index 0000000000..f8f9d31ddb--- /dev/null+++ b/src/routes/services/[id]/wordpress/stop.json.ts@@ -0,0 +1,42 @@+import { getUserDetails, removeDestinationDocker } from '$lib/common';+import { getDomain } from '$lib/components/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dockerInstance } from '$lib/docker';+import { checkContainer, configureSimpleServiceProxyOff } 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;+ const domain = getDomain(fqdn);+ if (destinationDockerId) {+ const engine = destinationDocker.engine;+ try {+ let found = await checkContainer(engine, id);+ if (found) {+ await removeDestinationDocker({ id, engine });+ }+ found = await checkContainer(engine, `${id}-mysql`);+ if (found) {+ await removeDestinationDocker({ id: `${id}-mysql`, engine });+ }+ } catch (error) {+ console.error(error);+ }+ await configureSimpleServiceProxyOff({ domain });+ }++ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/index.json.ts b/src/routes/services/index.json.tsnew file mode 100644index 0000000000..f1a8afbf99--- /dev/null+++ b/src/routes/services/index.json.ts@@ -0,0 +1,20 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ try {+ const services = await db.listServices(teamId);+ return {+ body: {+ services+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/services/index.svelte b/src/routes/services/index.sveltenew file mode 100644index 0000000000..1800c5ed17--- /dev/null+++ b/src/routes/services/index.svelte@@ -0,0 +1,85 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch }) => {+ const url = `/services.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import PlausibleAnalytics from '$lib/components/svg/services/PlausibleAnalytics.svelte';+ import NocoDb from '$lib/components/svg/services/NocoDB.svelte';+ import MinIo from '$lib/components/svg/services/MinIO.svelte';+ import VsCodeServer from '$lib/components/svg/services/VSCodeServer.svelte';+ import Wordpress from '$lib/components/svg/services/Wordpress.svelte';++ export let services;+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Services</div>+ <a href="/new/service" class="add-icon bg-pink-600 hover:bg-pink-500">+ <svg+ class="w-6"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ ><path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 6v6m0 0v6m0-6h6m-6 0H6"+ /></svg+ >+ </a>+</div>++<div class="flex flex-wrap justify-center">+ {#if !services || services.length === 0}+ <div class="flex-col">+ <div class="text-center text-xl font-bold">No services found</div>+ </div>+ {:else}+ {#each services as service}+ <a href="/services/{service.id}" class="no-underline p-2 w-96">+ <div class="box-selection relative hover:bg-pink-600 group">+ {#if service.type === 'plausibleanalytics'}+ <PlausibleAnalytics isAbsolute />+ {:else if service.type === 'nocodb'}+ <NocoDb isAbsolute />+ {:else if service.type === 'minio'}+ <MinIo isAbsolute />+ {:else if service.type === 'vscodeserver'}+ <VsCodeServer isAbsolute />+ {:else if service.type === 'wordpress'}+ <Wordpress isAbsolute />+ {/if}+ <div class="font-bold text-xl text-center truncate">+ {service.name}+ </div>+ {#if !service.type || !service.fqdn}+ <div class="font-bold text-center truncate text-red-500 group-hover:text-white">+ Configuration missing+ </div>+ {:else}+ <div class="text-center truncate">{service.type}</div>+ {/if}+ </div>+ </a>+ {/each}+ {/if}+</div>diff --git a/src/routes/settings.svelte b/src/routes/settings.sveltedeleted file mode 100644index 3001a22821..0000000000--- a/src/routes/settings.svelte+++ /dev/null@@ -1,190 +0,0 @@-<script context="module">- /**- * @type {import('@sveltejs/kit').Load}- */- export async function load({ fetch }) {- try {- const { allowRegistration, sendErrors } = await (await fetch(`/api/v1/settings`)).json();- return {- props: {- allowRegistration,- sendErrors- }- };- } catch (error) {- return {- props: {- allowRegistration: null,- sendErrors: null- }- };- }- }--</script>--<script>- export let allowRegistration;- export let sendErrors;-- import { browser } from '$app/env';- import { session } from '$app/stores';- import { request } from '$lib/request';- import { toast } from '@zerodevx/svelte-toast';- import { fade } from 'svelte/transition';- let settings = {- allowRegistration,- sendErrors- };- async function changeSettings(value) {- try {- settings[value] = !settings[value];- await request(`/api/v1/settings`, $session, {- body: {- ...settings- }- });- browser && toast.push('Configuration saved.');- } catch (error) {- console.log(error);- }- }--</script>--<div class="min-h-full text-white" in:fade={{ duration: 100 }}>- <div class="py-5 text-left px-6 text-3xl tracking-tight font-bold flex items-center">- <div>Settings</div>- </div>-</div>--<div in:fade={{ duration: 100 }}>- <div class="max-w-4xl mx-auto px-6 pb-4">- <div>- <div class="text-2xl font-bold border-gradient w-32 pt-4 text-white">General</div>- <div class=" pt-4">- <div class="px-4 sm:px-6">- <ul class="mt-2 divide-y divide-warmGray-800">- <li class="py-4 flex items-center justify-between">- <div class="flex flex-col">- <p class="text-base font-bold text-warmGray-100">Registration allowed?</p>- <p class="text-sm font-medium text-warmGray-400">- Allow further registrations to the application. It's turned off after the first- registration.- </p>- </div>- <button- type="button"- on:click={() => changeSettings('allowRegistration')}- aria-pressed="false"- class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200"- class:bg-green-600={settings?.allowRegistration}- class:bg-warmGray-700={!settings?.allowRegistration}- >- <span class="sr-only">Use setting</span>- <span- class="pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white shadow transition ease-in-out duration-200 transform"- class:translate-x-5={settings?.allowRegistration}- class:translate-x-0={!settings?.allowRegistration}- >- <span- class=" ease-in duration-200 absolute inset-0 h-full w-full flex items-center justify-center transition-opacity"- class:opacity-0={settings?.allowRegistration}- class:opacity-100={!settings?.allowRegistration}- aria-hidden="true"- >- <svg class="bg-white h-3 w-3 text-red-600" fill="none" viewBox="0 0 12 12">- <path- d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- />- </svg>- </span>- <span- class="ease-out duration-100 absolute inset-0 h-full w-full flex items-center justify-center transition-opacity"- aria-hidden="true"- class:opacity-100={settings?.allowRegistration}- class:opacity-0={!settings?.allowRegistration}- >- <svg- class="bg-white h-3 w-3 text-green-600"- fill="currentColor"- viewBox="0 0 12 12"- >- <path- d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"- />- </svg>- </span>- </span>- </button>- </li>- <li class="py-4 flex items-center justify-between">- <div class="flex flex-col">- <p class="text-base font-bold text-warmGray-100">Send errors automatically?</p>- <p class="text-sm font-medium text-warmGray-400">- Allow to send errors automatically to developer(s) at coolLabs (<a- href="https://twitter.com/andrasbacsai"- target="_blank"- class="underline text-white font-bold hover:text-blue-400">Andras Bacsai</a- >). This will help to fix bugs quicker. 🙏- </p>- </div>- <button- type="button"- on:click={() => changeSettings('sendErrors')}- aria-pressed="true"- class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200"- class:bg-green-600={settings?.sendErrors}- class:bg-warmGray-700={!settings?.sendErrors}- >- <span class="sr-only">Use setting</span>- <span- class="pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white shadow transition ease-in-out duration-200 transform"- class:translate-x-5={settings?.sendErrors}- class:translate-x-0={!settings?.sendErrors}- >- <span- class=" ease-in duration-200 absolute inset-0 h-full w-full flex items-center justify-center transition-opacity"- class:opacity-0={settings?.sendErrors}- class:opacity-100={!settings?.sendErrors}- aria-hidden="true"- >- <svg class="bg-white h-3 w-3 text-red-600" fill="none" viewBox="0 0 12 12">- <path- d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- />- </svg>- </span>- <span- class="ease-out duration-100 absolute inset-0 h-full w-full flex items-center justify-center transition-opacity"- aria-hidden="true"- class:opacity-100={settings?.sendErrors}- class:opacity-0={!settings?.sendErrors}- >- <svg- class="bg-white h-3 w-3 text-green-600"- fill="currentColor"- viewBox="0 0 12 12"- >- <path- d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"- />- </svg>- </span>- </span>- </button>- </li>- </ul>- </div>- </div>- </div>- </div>-</div>diff --git a/src/routes/settings/check.json.ts b/src/routes/settings/check.json.tsnew file mode 100644index 0000000000..78e770421a--- /dev/null+++ b/src/routes/settings/check.json.ts@@ -0,0 +1,25 @@+import { asyncExecShell, getEngine, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } 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 { fqdn } = await event.request.json();+ if (fqdn) fqdn = fqdn.toLowerCase();++ try {+ const found = await db.isDomainConfigured({ id, fqdn });+ return {+ status: found ? 500 : 200,+ body: {+ error: found && `Domain ${fqdn} is already configured`+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/settings/index.json.ts b/src/routes/settings/index.json.tsnew file mode 100644index 0000000000..3a2498179f--- /dev/null+++ b/src/routes/settings/index.json.ts@@ -0,0 +1,112 @@+import { dev } from '$app/env';+import { getDomain, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { listSettings, PrismaErrorHandler } from '$lib/database';+import {+ checkContainer,+ configureCoolifyProxyOff,+ configureCoolifyProxyOn,+ forceSSLOffApplication,+ forceSSLOnApplication,+ reloadHaproxy,+ startCoolifyProxy+} from '$lib/haproxy';+import { letsEncrypt } from '$lib/letsencrypt';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ try {+ const settings = await listSettings();+ return {+ status: 200,+ body: {+ settings+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++export const del: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (teamId !== '0')+ return {+ status: 401,+ body: {+ message: 'You do not have permission to do this. \nAsk an admin to modify your permissions.'+ }+ };+ if (status === 401) return { status, body };++ const { fqdn } = await event.request.json();++ try {+ await db.prisma.setting.update({ where: { fqdn }, data: { fqdn: null } });+ const domain = getDomain(fqdn);+ await configureCoolifyProxyOff({ domain });+ return {+ status: 201+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};+export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (teamId !== '0')+ return {+ status: 401,+ body: {+ message: 'You do not have permission to do this. \nAsk an admin to modify your permissions.'+ }+ };+ if (status === 401) return { status, body };++ const { fqdn, isRegistrationEnabled } = await event.request.json();+ try {+ const {+ id,+ fqdn: oldFqdn,+ isRegistrationEnabled: oldIsRegistrationEnabled+ } = await db.listSettings();+ if (oldIsRegistrationEnabled !== isRegistrationEnabled) {+ await db.prisma.setting.update({ where: { id }, data: { isRegistrationEnabled } });+ }+ if (oldFqdn && oldFqdn !== fqdn) {+ const oldDomain = getDomain(oldFqdn);+ if (oldFqdn) {+ await configureCoolifyProxyOff({ domain: oldDomain });+ }+ }+ if (fqdn) {+ const found = await checkContainer('/var/run/docker.sock', 'coolify-haproxy');+ if (!found) await startCoolifyProxy('/var/run/docker.sock');+ const domain = getDomain(fqdn);+ const isHttps = fqdn.startsWith('https://');+ if (domain) {+ await configureCoolifyProxyOn({ domain });+ if (isHttps && !dev) {+ await letsEncrypt({ domain, isCoolify: true });+ await forceSSLOnApplication({ domain });+ await reloadHaproxy('/var/run/docker.sock');+ }+ }++ await db.prisma.setting.update({ where: { id }, data: { fqdn } });+ await db.prisma.destinationDocker.updateMany({+ where: { engine: '/var/run/docker.sock' },+ data: { isCoolifyProxyUsed: true }+ });+ }++ return {+ status: 201+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/settings/index.svelte b/src/routes/settings/index.sveltenew file mode 100644index 0000000000..48407e8b3c--- /dev/null+++ b/src/routes/settings/index.svelte@@ -0,0 +1,175 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch }) => {+ const url = `/settings.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import { session } from '$app/stores';++ export let settings;+ import Setting from '$lib/components/Setting.svelte';+ import Explainer from '$lib/components/Explainer.svelte';+ import { errorNotification } from '$lib/form';+ import { del, post } from '$lib/api';+ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';+ import { browser } from '$app/env';+ import { getDomain } from '$lib/components/common';++ let isRegistrationEnabled = settings.isRegistrationEnabled;+ let fqdn = settings.fqdn;+ let isFqdnSet = settings.fqdn;+ let loading = {+ save: false,+ remove: false+ };++ async function removeFqdn() {+ if (fqdn) {+ loading.remove = true;+ try {+ await del(`/settings.json`, { fqdn });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading.remove = false;+ }+ }+ }+ async function changeSettings(name) {+ try {+ if (name === 'isRegistrationEnabled') {+ isRegistrationEnabled = !isRegistrationEnabled;+ }+ return await post(`/settings.json`, { isRegistrationEnabled });+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function handleSubmit() {+ try {+ loading.save = true;+ if (fqdn) {+ await post(`/settings/check.json`, { fqdn });+ await post(`/settings.json`, { fqdn });+ return window.location.reload();+ }+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading.save = false;+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Settings</div>+</div>+{#if $session.teamId === '0'}+ <div class="mx-auto max-w-2xl">+ <form on:submit|preventDefault={handleSubmit}>+ <div class="flex space-x-1 p-6 font-bold">+ <div class="title">Global Settings</div>+ <button+ type="submit"+ disabled={loading.save}+ class:bg-green-600={!loading.save}+ class:hover:bg-green-500={!loading.save}+ class="mx-2 ">{loading.save ? 'Saving...' : 'Save'}</button+ >+ {#if isFqdnSet}+ <button+ on:click|preventDefault={removeFqdn}+ disabled={loading.remove}+ class:bg-red-600={!loading.remove}+ class:hover:bg-red-500={!loading.remove}+ >{loading.remove ? 'Removing...' : 'Remove domain'}</button+ >+ {/if}+ </div>+ <div class="px-4 sm:px-6">+ <div class="flex space-x-4 py-4 px-4">+ <p class="pt-2 text-base font-bold text-stone-100">Domain (FQDN)</p>+ <div class="justify-center text-center">+ <input+ bind:value={fqdn}+ readonly={!$session.isAdmin || isFqdnSet}+ disabled={!$session.isAdmin || isFqdnSet}+ name="fqdn"+ id="fqdn"+ pattern="^https?://([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{'{'}2,{'}'}$"+ placeholder="eg: https://coolify.io"+ required+ />+ <Explainer+ text="Set the fully qualified domain name for your Coolify instance. <br>If you specify <span class='text-green-600 font-bold'>https</span>, it will be accessible only over https. <br>SSL certificate will be generated for you."+ />+ </div>+ </div>+ <ul class="mt-2 divide-y divide-stone-800">+ <Setting+ bind:setting={isRegistrationEnabled}+ title="Registration allowed?"+ description="Allow further registrations to the application. <br>It's turned off after the first registration. "+ on:click={() => changeSettings('isRegistrationEnabled')}+ />+ </ul>+ </div>+ </form>+ <div class="mx-auto max-w-4xl px-6">+ <div class="flex space-x-1 pt-5 font-bold">+ <div class="title">HAProxy Settings</div>+ </div>+ <Explainer+ text={`Credentials for <a class="text-white font-bold" href=${+ fqdn+ ? 'http://' + getDomain(fqdn) + ':8404'+ : browser && 'http://' + window.location.hostname + ':8404'+ } target="_blank">stats</a> page.`}+ />++ <div class="grid grid-cols-3 items-center px-4 pt-5">+ <label for="proxyUser">User</label>++ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ id="proxyUser"+ name="proxyUser"+ value={settings.proxyUser}+ />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center px-4">+ <label for="proxyPassword">Password</label>+ <div class="col-span-2 ">+ <CopyPasswordField+ readonly+ disabled+ id="proxyPassword"+ name="proxyPassword"+ isPasswordField+ value={settings.proxyPassword}+ />+ </div>+ </div>+ </div>+ </div>+{/if}diff --git a/src/routes/sources/[id]/_Github.svelte b/src/routes/sources/[id]/_Github.sveltenew file mode 100644index 0000000000..b3285fd6d4--- /dev/null+++ b/src/routes/sources/[id]/_Github.svelte@@ -0,0 +1,91 @@+<script lang="ts">+ export let source;+ import { page, session } from '$app/stores';+ import { post } from '$lib/api';+ import { errorNotification } from '$lib/form';+ const { id } = $page.params;++ let loading = false;+ async function handleSubmit() {+ loading = true;+ try {+ return await post(`/sources/${id}.json`, { name: source.name });+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }++ async function installRepositories(source) {+ const { htmlUrl } = source;+ const left = screen.width / 2 - 1020 / 2;+ const top = screen.height / 2 - 1000 / 2;+ const newWindow = open(+ `${htmlUrl}/apps/${source.githubApp.name}/installations/new`,+ 'GitHub',+ 'resizable=1, scrollbars=1, fullscreen=0, height=1000, width=1020,top=' ++ top ++ ', left=' ++ left ++ ', toolbar=0, menubar=0, status=0'+ );+ const timer = setInterval(() => {+ if (newWindow?.closed) {+ clearInterval(timer);+ window.location.reload();+ }+ }, 100);+ }++ function newGithubApp() {+ const left = screen.width / 2 - 1020 / 2;+ const top = screen.height / 2 - 618 / 2;+ const newWindow = open(+ `/sources/${id}/newGithubApp`,+ 'New Github App',+ 'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' ++ top ++ ', left=' ++ left ++ ', toolbar=0, menubar=0, status=0'+ );+ const timer = setInterval(() => {+ if (newWindow?.closed) {+ clearInterval(timer);+ window.location.reload();+ }+ }, 100);+ }+</script>++{#if !source.githubAppId}+ <button on:click={newGithubApp}>Create new GitHub App</button>+{:else if source.githubApp?.installationId}+ <div class="mx-auto max-w-4xl px-6">+ <form on:submit|preventDefault={handleSubmit} class="py-4">+ <div class="flex space-x-1 pb-5 font-bold">+ <div class="title">General</div>+ {#if $session.isAdmin}+ <button+ type="submit"+ class:bg-orange-600={!loading}+ class:hover:bg-orange-500={!loading}+ disabled={loading}>{loading ? 'Saving...' : 'Save'}</button+ >+ <button on:click={() => installRepositories(source)}>Change GitHub App Settings</button>+ {/if}+ </div>+ <div class="grid grid-flow-row gap-2 px-10">+ <div class="mt-2 grid grid-cols-3 items-center">+ <label for="name">Name</label>+ <div class="col-span-2 ">+ <input name="name" id="name" required bind:value={source.name} />+ </div>+ </div>+ </div>+ </form>+ </div>+{:else}+ <button on:click={() => installRepositories(source)}>Install Repositories</button>+{/if}diff --git a/src/routes/sources/[id]/_Gitlab.svelte b/src/routes/sources/[id]/_Gitlab.sveltenew file mode 100644index 0000000000..4530cc0e03--- /dev/null+++ b/src/routes/sources/[id]/_Gitlab.svelte@@ -0,0 +1,215 @@+<script lang="ts">+ export let source;+ import Explainer from '$lib/components/Explainer.svelte';+ import { enhance, errorNotification } from '$lib/form';+ import { page, session } from '$app/stores';+ import { onMount } from 'svelte';+ import { post } from '$lib/api';+ const { id } = $page.params;++ let loading = false;+ let oauthIdEl;+ let payload = {+ oauthId: undefined,+ groupName: undefined,+ appId: undefined,+ appSecret: undefined,+ applicationType: 'user'+ };+ onMount(() => {+ oauthIdEl && oauthIdEl.focus();+ });+ async function handleSubmitSave() {+ loading = true;+ try {+ return await post(`/sources/${id}.json`, { name: source.name });+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+ async function changeSettings() {+ const {+ htmlUrl,+ gitlabApp: { oauthId }+ } = source;+ const left = screen.width / 2 - 1020 / 2;+ const top = screen.height / 2 - 1000 / 2;+ const newWindow = open(+ `${htmlUrl}/oauth/applications/${oauthId}`,+ 'GitLab',+ 'resizable=1, scrollbars=1, fullscreen=0, height=1000, width=1020,top=' ++ top ++ ', left=' ++ left ++ ', toolbar=0, menubar=0, status=0'+ );+ const timer = setInterval(() => {+ if (newWindow?.closed) {+ clearInterval(timer);+ }+ }, 100);+ }+ async function checkOauthId() {+ if (payload.oauthId) {+ try {+ await post(`/sources/${id}/check.json`, { oauthId: payload.oauthId });+ } catch ({ error }) {+ payload.oauthId = null;+ oauthIdEl.focus();+ return errorNotification(error);+ }+ }+ }+ function newApp() {+ switch (payload.applicationType) {+ case 'user':+ window.open(`${source.htmlUrl}/-/profile/applications`);+ break;+ case 'group':+ window.open(`${source.htmlUrl}/groups/${payload.groupName}/-/settings/applications`);+ break;+ case 'instance':+ // TODO: This is not correct+ // window.location.assign(`${source.htmlUrl}/-/profile/applications`);+ break;+ default:+ break;+ }+ }+ async function handleSubmit() {+ loading = true;+ try {+ await post(`/sources/${id}/gitlab.json`, { ...payload });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ } finally {+ loading = false;+ }+ }+</script>++<div class="flex flex-col justify-center">+ {#if !source.gitlabApp?.appId}+ <form class="grid grid-flow-row gap-2 py-4" on:submit|preventDefault={newApp}>+ <div class="grid grid-cols-3 items-center">+ <label for="type">GitLab Application Type</label>+ <div class="col-span-2">+ <select name="type" id="type" class="w-96" bind:value={payload.applicationType}>+ <option value="user">User owned application</option>+ <option value="group">Group owned application</option>+ {#if source.htmlUrl !== 'https://gitlab.com'}+ <option value="instance">Instance-wide application (self-hosted)</option>+ {/if}+ </select>+ </div>+ </div>+ {#if payload.applicationType === 'group'}+ <div class="grid grid-cols-3 items-center">+ <label for="groupName">Group Name</label>+ <div class="col-span-2">+ <input name="groupName" id="groupName" required bind:value={payload.groupName} />+ </div>+ </div>+ {/if}++ <div class="w-full pt-10 text-center">+ <button class="w-96 bg-orange-600 hover:bg-orange-500" type="submit"+ >Register new OAuth application on GitLab</button+ >+ </div>++ <Explainer+ maxWidthClass="w-full"+ text="<span class='font-bold text-base'>Scopes required:</span>+ <br>- api (Access the authenticated user's API)+ <br>- read_repository (Allows read-only access to the repository)+ <br>- email (Allows read-only access to the user's primary email address using OpenID Connect)+ <br>+ <br>For extra security, you can add Expire access tokens!"+ />+ </form>+ <form on:submit|preventDefault={handleSubmit} class="grid grid-flow-row gap-2 py-4 pt-10">+ <div class="flex h-8 items-center space-x-2">+ <div class="text-xl font-bold text-white">Configuration</div>+ <button+ type="submit"+ class:bg-orange-600={!loading}+ class:hover:bg-orange-500={!loading}+ disabled={loading}>{loading ? 'Saving...' : 'Save'}</button+ >+ </div>++ <div class="grid grid-cols-3 items-start">+ <label for="oauthId" class="pt-2">OAuth ID</label>+ <div class="col-span-2">+ <input+ on:change={checkOauthId}+ bind:this={oauthIdEl}+ name="oauthId"+ id="oauthId"+ type="number"+ required+ bind:value={payload.oauthId}+ />+ <Explainer+ text="The OAuth ID is the unique identifier of the GitLab application. <br>You can find it <span class='font-bold text-orange-600' >in the URL</span> of your GitLab OAuth Application."+ />+ </div>+ </div>+ {#if payload.applicationType === 'group'}+ <div class="grid grid-cols-3 items-center">+ <label for="groupName">Group Name</label>+ <div class="col-span-2">+ <input name="groupName" id="groupName" required bind:value={payload.groupName} />+ </div>+ </div>+ {/if}+ <div class="grid grid-cols-3 items-center">+ <label for="appId">Application ID</label>+ <div class="col-span-2">+ <input name="appId" id="appId" required bind:value={payload.appId} />+ </div>+ </div>+ <div class="grid grid-cols-3 items-center">+ <label for="appSecret">Secret</label>+ <div class="col-span-2">+ <input+ name="appSecret"+ id="appSecret"+ type="password"+ required+ bind:value={payload.appSecret}+ />+ </div>+ </div>+ </form>+ {:else}+ <div class="mx-auto max-w-4xl px-6">+ <form on:submit|preventDefault={handleSubmitSave} class="py-4">+ <div class="flex space-x-1 pb-5 font-bold">+ <div class="title">General</div>+ {#if $session.isAdmin}+ <button+ type="submit"+ class:bg-orange-600={!loading}+ class:hover:bg-orange-500={!loading}+ disabled={loading}>{loading ? 'Saving...' : 'Save'}</button+ >+ <button on:click|preventDefault={changeSettings}>Change GitLab App Settings</button>+ {/if}+ </div>+ <div class="grid grid-flow-row gap-2 px-10">+ <div class="mt-2 grid grid-cols-3 items-center">+ <label for="name">Name</label>+ <div class="col-span-2 ">+ <input name="name" id="name" required bind:value={source.name} />+ </div>+ </div>+ </div>+ </form>+ </div>+ {/if}+</div>diff --git a/src/routes/sources/[id]/__layout.svelte b/src/routes/sources/[id]/__layout.sveltenew file mode 100644index 0000000000..0f51395585--- /dev/null+++ b/src/routes/sources/[id]/__layout.svelte@@ -0,0 +1,68 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params }) => {+ const url = `/sources/${params.id}.json`;+ const res = await fetch(url);+ if (res.ok) {+ const { source, settings } = await res.json();+ if (!source || Object.entries(source).length === 0) {+ return {+ status: 302,+ redirect: '/sources'+ };+ }+ return {+ props: {+ source+ },+ stuff: {+ source,+ settings+ }+ };+ }++ return {+ status: 302,+ redirect: '/sources'+ };+ };+</script>++<script>+ export let source;+ import { page, session } from '$app/stores';+ import { errorNotification } from '$lib/form';+ import DeleteIcon from '$lib/components/DeleteIcon.svelte';+ const { id } = $page.params;++ async function deleteSource(name) {+ const sure = confirm(`Are you sure you would like to delete '${name}'?`);+ if (sure) {+ const response = await fetch(`/sources/${id}.json`, {+ method: 'delete'+ });+ if (!response.ok) {+ const { message } = await response.json();+ errorNotification(message);+ } else {+ window.location.assign('/sources');+ }+ }+ }+</script>++<nav class="nav-side">+ <button+ on:click={() => deleteSource(source.name)}+ title="Delete Git Source"+ type="submit"+ disabled={!$session.isAdmin}+ class:hover:text-red-500={$session.isAdmin}+ class="icons tooltip-bottom bg-transparent text-sm"+ data-tooltip={$session.isAdmin+ ? 'Delete Git Source'+ : 'You do not have permission to delete a Git Source'}><DeleteIcon /></button+ >+</nav>+<slot />diff --git a/src/routes/sources/[id]/check.json.ts b/src/routes/sources/[id]/check.json.tsnew file mode 100644index 0000000000..e30b709429--- /dev/null+++ b/src/routes/sources/[id]/check.json.ts@@ -0,0 +1,21 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };+ try {+ const { oauthId } = await event.request.json();+ const found = await db.prisma.gitlabApp.findFirst({ where: { oauthId: Number(oauthId) } });+ if (found) {+ throw {+ message: `GitLab App is already configured.`+ };+ }+ return { status: 200 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/sources/[id]/gitlab.json.ts b/src/routes/sources/[id]/gitlab.json.tsnew file mode 100644index 0000000000..b4f40d8aa6--- /dev/null+++ b/src/routes/sources/[id]/gitlab.json.ts@@ -0,0 +1,21 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { teamId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };+ const { id } = event.params;++ try {+ let { oauthId, groupName, appId, appSecret } = await event.request.json();++ oauthId = Number(oauthId);++ await db.addSource({ id, teamId, oauthId, groupName, appId, appSecret });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/sources/[id]/index.json.ts b/src/routes/sources/[id]/index.json.tsnew file mode 100644index 0000000000..1a30527638--- /dev/null+++ b/src/routes/sources/[id]/index.json.ts@@ -0,0 +1,54 @@+import { getTeam, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (request) => {+ const { teamId, status, body } = await getUserDetails(request);+ if (status === 401) return { status, body };++ const { id } = request.params;+ try {+ const source = await db.getSource({ id, teamId });+ const settings = await db.listSettings();+ return {+ status: 200,+ body: {+ source,+ settings+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++export const del: RequestHandler = async (request) => {+ const { status, body } = await getUserDetails(request);+ if (status === 401) return { status, body };++ const { id } = request.params;++ try {+ await db.removeSource({ id });+ return { status: 200 };+ } catch (error) {+ return PrismaErrorHandler(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 } = await event.request.json();++ try {+ await db.updateGitsource({ id, name });+ return { status: 201 };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/sources/[id]/index.svelte b/src/routes/sources/[id]/index.sveltenew file mode 100644index 0000000000..8f861c6dd0--- /dev/null+++ b/src/routes/sources/[id]/index.svelte@@ -0,0 +1,49 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params, stuff }) => {+ if (stuff?.source) {+ return {+ props: {+ source: stuff.source,+ settings: stuff.settings+ }+ };+ }+ const url = `/sources/${params.id}.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ export let source: Prisma.GitSource;+ import type Prisma from '@prisma/client';+ import Github from './_Github.svelte';+ import Gitlab from './_Gitlab.svelte';+</script>++<div class="flex space-x-1 p-6 px-6 text-2xl font-bold">+ <div class="tracking-tight">Git Source</div>+ <span class="arrow-right-applications px-1 text-orange-500">></span>+ <span class="pr-2">{source.name}</span>+</div>++<div class="flex justify-center space-x-2 px-6 py-3">+ {#if source.type === 'github'}+ <Github bind:source />+ {:else if source.type === 'gitlab'}+ <Gitlab bind:source />+ {/if}+</div>diff --git a/src/routes/sources/[id]/newGithubApp.svelte b/src/routes/sources/[id]/newGithubApp.sveltenew file mode 100644index 0000000000..80139acc23--- /dev/null+++ b/src/routes/sources/[id]/newGithubApp.svelte@@ -0,0 +1,89 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ import { onMount } from 'svelte';+ export const load: Load = async ({ fetch, params, stuff }) => {+ if (stuff?.source) {+ return {+ props: {+ source: stuff.source,+ settings: stuff.settings+ }+ };+ }+ const url = `/sources/${params.id}.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script>+ import { dev } from '$app/env';+ import { getDomain } from '$lib/components/common';+ import { dashify } from '$lib/github';++ export let source;+ export let settings;+ onMount(() => {+ const { organization, id, htmlUrl } = source;+ const { fqdn } = settings;+ const host = dev+ ? 'http://localhost:3000'+ : fqdn+ ? fqdn+ : `http://${window.location.host}` || '';+ const domain = getDomain(fqdn);++ let url = 'settings/apps/new';+ if (organization) url = `organizations/${organization}/settings/apps/new`;+ const name = dashify(domain) || 'app';+ const data = JSON.stringify({+ name: `coolify-${name}`,+ url: host,+ hook_attributes: {+ url: dev+ ? 'https://webhook.site/0e5beb2c-4e9b-40e2-a89e-32295e570c21/events'+ : `${host}/webhooks/github/events`+ },+ redirect_url: `${host}/webhooks/github`,+ callback_urls: [`${host}/login/github/app`],+ public: false,+ request_oauth_on_install: false,+ setup_url: `${host}/webhooks/github/install?gitSourceId=${id}`,+ setup_on_update: true,+ default_permissions: {+ contents: 'read',+ metadata: 'read',+ pull_requests: 'read',+ emails: 'read'+ },+ default_events: ['pull_request', 'push']+ });+ const form = document.createElement('form');+ form.setAttribute('method', 'post');+ form.setAttribute('action', `${htmlUrl}/${url}?state=${id}`);+ const input = document.createElement('input');+ input.setAttribute('id', 'manifest');+ input.setAttribute('name', 'manifest');+ input.setAttribute('type', 'hidden');+ input.setAttribute('value', data);+ form.appendChild(input);+ document.getElementsByTagName('body')[0].appendChild(form);+ form.submit();+ });+</script>++<div class="flex h-screen items-center justify-center text-3xl font-bold">+ Redirecting to Github...+</div>diff --git a/src/routes/sources/index.json.ts b/src/routes/sources/index.json.tsnew file mode 100644index 0000000000..bf774698ed--- /dev/null+++ b/src/routes/sources/index.json.ts@@ -0,0 +1,16 @@+import { getTeam, getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (request) => {+ const { teamId, status, body } = await getUserDetails(request);+ if (status === 401) return { status, body };++ try {+ const sources = await db.listSources(teamId);+ return { status: 200, body: { sources } };+ } catch (err) {+ return PrismaErrorHandler(err);+ }+};diff --git a/src/routes/sources/index.svelte b/src/routes/sources/index.sveltenew file mode 100644index 0000000000..bd90395145--- /dev/null+++ b/src/routes/sources/index.svelte@@ -0,0 +1,75 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch }) => {+ const url = `/sources.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ export let sources;+ import { session } from '$app/stores';+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Git Sources</div>+ {#if $session.isAdmin}+ <a href="/new/source" sveltekit:prefetch class="add-icon bg-orange-600 hover:bg-orange-500">+ <svg+ class="w-6"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ ><path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 6v6m0 0v6m0-6h6m-6 0H6"+ /></svg+ >+ </a>+ {/if}+</div>+<div class="flex justify-center">+ {#if !sources || sources.length === 0}+ <div class="flex-col">+ <div class="text-center text-xl font-bold">No git sources found</div>+ </div>+ {:else}+ <div class="flex flex-wrap justify-center">+ {#each sources as source}+ <a href="/sources/{source.id}" class="no-underline p-2 w-96">+ <div+ class="box-selection hover:bg-orange-600 group"+ class:border-red-500={source.gitlabApp && !source.gitlabAppId}+ class:border-0={source.gitlabApp && !source.gitlabAppId}+ class:border-l-4={source.gitlabApp && !source.gitlabAppId}+ >+ <div class="font-bold text-xl text-center truncate">{source.name}</div>+ {#if (source.type === 'gitlab' && !source.gitlabAppId) || (source.type === 'github' && !source.githubAppId && !source.githubApp?.installationId)}+ <div class="font-bold text-center truncate text-red-500 group-hover:text-white">+ Configuration missing+ </div>+ {:else}+ <div class="truncate text-center">{source.htmlUrl}</div>+ {/if}+ </div>+ </a>+ {/each}+ </div>+ {/if}+</div>diff --git a/src/routes/success.svelte b/src/routes/success.sveltedeleted file mode 100644index 796b7dfa41..0000000000--- a/src/routes/success.svelte+++ /dev/null@@ -1,13 +0,0 @@-<script>- import { browser } from '$app/env';- if (browser) {- setTimeout(() => {- window.close();- }, 1000);- }--</script>--<div class="flex w-full h-screen justify-center items-center">- <div class="text-3xl font-bold">Succesfully logged in! 🎉</div>-</div>diff --git a/src/routes/teams/[id]/__layout.svelte b/src/routes/teams/[id]/__layout.sveltenew file mode 100644index 0000000000..9ad4eb110d--- /dev/null+++ b/src/routes/teams/[id]/__layout.svelte@@ -0,0 +1,28 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params }) => {+ const url = `/teams/${params.id}.json`;+ const res = await fetch(url);+ if (res.ok) {+ const data = await res.json();+ if (!data.permissions || Object.entries(data.permissions).length === 0) {+ return {+ status: 302,+ redirect: '/teams'+ };+ }+ return {+ stuff: {+ ...data+ }+ };+ }++ return {+ status: 302,+ redirect: '/teams'+ };+ };+</script>++<slot />diff --git a/src/routes/teams/[id]/index.json.ts b/src/routes/teams/[id]/index.json.tsnew file mode 100644index 0000000000..fc3a441958--- /dev/null+++ b/src/routes/teams/[id]/index.json.ts@@ -0,0 +1,55 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { userId, status, body } = await getUserDetails(event, false);+ if (status === 401) return { status, body };++ const { id } = event.params;++ try {+ const user = await db.prisma.user.findFirst({+ where: { id: userId, teams: { some: { id } } },+ include: { permission: true }+ });+ if (!user) {+ return {+ status: 401+ };+ }+ const permissions = await db.prisma.permission.findMany({+ where: { teamId: id },+ include: { user: { select: { id: true, email: true } } }+ });+ const team = await db.prisma.team.findUnique({ where: { id }, include: { permissions: true } });+ const invitations = await db.prisma.teamInvitation.findMany({ where: { teamId: team.id } });+ return {+ body: {+ team,+ permissions,+ invitations+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++export const post: RequestHandler = async (event) => {+ const { status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = event.params;+ const { name } = await event.request.json();++ try {+ await db.prisma.team.update({ where: { id }, data: { name: { set: name } } });+ return {+ status: 201+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/teams/[id]/index.svelte b/src/routes/teams/[id]/index.sveltenew file mode 100644index 0000000000..c4f81d31e9--- /dev/null+++ b/src/routes/teams/[id]/index.svelte@@ -0,0 +1,214 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch, params }) => {+ const url = `/teams/${params.id}.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ export let permissions;+ export let team;+ export let invitations;+ import { page, session } from '$app/stores';+ import Explainer from '$lib/components/Explainer.svelte';+ import { errorNotification } from '$lib/form';+ import { post } from '$lib/api';+ const { id } = $page.params;++ let invitation = {+ teamName: team.name,+ email: null,+ permission: 'read'+ };+ let myPermission = permissions.find((u) => u.user.id === $session.uid).permission;+ function isAdmin(permission = myPermission) {+ if (myPermission === 'admin' || myPermission === 'owner') {+ return true;+ }++ return false;+ }++ async function sendInvitation() {+ try {+ await post(`/teams/${id}/invitation/invite.json`, {+ teamId: team.id,+ teamName: invitation.teamName,+ email: invitation.email,+ permission: invitation.permission+ });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function revokeInvitation(id) {+ try {+ await post(`/teams/${id}/invitation/revoke.json`, { id });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function removeFromTeam(uid) {+ try {+ await post(`/teams/${id}/remove/user.json`, { teamId: team.id, uid });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function changePermission(userId, permissionId, currentPermission) {+ let newPermission = 'read';+ if (currentPermission === 'read') {+ newPermission = 'admin';+ }+ try {+ await post(`/teams/${id}/permission/change.json`, { userId, newPermission, permissionId });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function handleSubmit() {+ try {+ await post(`/teams/${id}.json`, { ...team });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 px-6 text-2xl font-bold">+ <div class="tracking-tight">Team</div>+ <span class="arrow-right-applications px-1 text-cyan-500">></span>+ <span class="pr-2">{team.name}</span>+</div>+<div class="mx-auto max-w-2xl">+ <form on:submit|preventDefault={handleSubmit}>+ <div class="flex space-x-1 p-6 font-bold">+ <div class="title">Settings</div>+ <div class="text-center">+ <button class="bg-cyan-600 hover:bg-cyan-500" type="submit">Save</button>+ </div>+ </div>++ <div class="mx-2 flex items-center space-x-2 px-4 sm:px-6">+ <label for="name">Name</label>+ <input id="name" name="name" placeholder="name" bind:value={team.name} />+ </div>+ {#if team.id === '0'}+ <div class="px-20 pt-4 text-center">+ <Explainer+ maxWidthClass="w-full"+ text="This is the <span class='text-red-500 font-bold'>root</span> team. <br><br>That means members of this group can manage instance wide settings and have all the priviliges in Coolify. (imagine like root user on Linux)"+ />+ </div>+ {/if}+ </form>++ <div class="flex space-x-1 py-5 px-6 pt-10 font-bold">+ <div class="title">Members</div>+ </div>+ <div class="px-4 sm:px-6">+ <table class="mx-2 w-full table-auto text-left">+ <tr class="h-8 border-b border-coolgray-400">+ <th scope="col">Email</th>+ <th scope="col">Permission</th>+ <th scope="col" class="text-center">Actions</th>+ </tr>+ {#each permissions as permission}+ <tr class="text-xs">+ <td class="py-4"+ >{permission.user.email}+ <span class="font-bold">{permission.user.id === $session.uid ? '(You)' : ''}</span></td+ >+ <td class="py-4">{permission.permission}</td>+ {#if $session.isAdmin && permission.user.id !== $session.uid && permission.permission !== 'owner'}+ <td class="flex flex-col items-center justify-center space-y-2 py-4 text-center">+ <button+ class="w-52 bg-red-600 hover:bg-red-500"+ on:click={() => removeFromTeam(permission.user.id)}>Remove</button+ >+ <button+ class="w-52"+ on:click={() =>+ changePermission(permission.user.id, permission.id, permission.permission)}+ >Promote to {permission.permission === 'admin' ? 'read' : 'admin'}</button+ >+ </td>+ {:else}+ <td class="text-center py-4 flex-col space-y-2"> No actions available </td>+ {/if}+ </tr>+ {/each}++ {#each invitations as invitation}+ <tr class="text-xs">+ <td class="py-4 font-bold text-yellow-500">{invitation.email} </td>+ <td class="py-4 font-bold text-yellow-500">{invitation.permission}</td>+ {#if isAdmin(team.permissions[0].permission)}+ <td class="flex-col space-y-2 py-4 text-center">+ <button+ class="w-52 bg-red-600 hover:bg-red-500"+ on:click={() => revokeInvitation(invitation.id)}>Revoke invitation</button+ >+ </td>+ {:else}+ <td class="text-center py-4 flex-col space-y-2">Pending invitation</td>+ {/if}+ </tr>+ {/each}+ </table>+ </div>+</div>+{#if $session.isAdmin}+ <div class="mx-auto max-w-2xl pt-8">+ <form on:submit|preventDefault={sendInvitation}>+ <div class="flex space-x-1 p-6 font-bold">+ <div class="title">Invite new member</div>+ <div class="text-center">+ <button class="bg-cyan-600 hover:bg-cyan-500" type="submit">Send invitation</button>+ </div>+ </div>+ <div class="flex-col space-y-2 px-4 sm:px-6">+ <div class="flex space-x-0">+ <input+ bind:value={invitation.email}+ placeholder="Email address"+ class="mr-2 w-full"+ required+ />+ <div class="flex-1" />+ <button+ on:click={() => (invitation.permission = 'read')}+ class="rounded-none rounded-l"+ type="button"+ class:bg-pink-500={invitation.permission === 'read'}>Read</button+ >+ <button+ on:click={() => (invitation.permission = 'admin')}+ class="rounded-none rounded-r"+ type="button"+ class:bg-red-500={invitation.permission === 'admin'}>Admin</button+ >+ </div>+ </div>+ </form>+ </div>+{/if}diff --git a/src/routes/teams/[id]/invitation/accept.json.ts b/src/routes/teams/[id]/invitation/accept.json.tsnew file mode 100644index 0000000000..253e483665--- /dev/null+++ b/src/routes/teams/[id]/invitation/accept.json.ts@@ -0,0 +1,36 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dayjs } from '$lib/dayjs';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { userId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = await event.request.json();++ try {+ const invitation = await db.prisma.teamInvitation.findFirst({+ where: { uid: userId },+ rejectOnNotFound: true+ });+ await db.prisma.team.update({+ where: { id: invitation.teamId },+ data: { users: { connect: { id: userId } } }+ });+ await db.prisma.permission.create({+ data: {+ user: { connect: { id: userId } },+ permission: invitation.permission,+ team: { connect: { id: invitation.teamId } }+ }+ });+ await db.prisma.teamInvitation.delete({ where: { id } });+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/teams/[id]/invitation/invite.json.ts b/src/routes/teams/[id]/invitation/invite.json.tsnew file mode 100644index 0000000000..076fa22dfb--- /dev/null+++ b/src/routes/teams/[id]/invitation/invite.json.ts@@ -0,0 +1,69 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dayjs } from '$lib/dayjs';+import type { RequestHandler } from '@sveltejs/kit';++async function createInvitation({ email, uid, teamId, teamName, permission }) {+ return await db.prisma.teamInvitation.create({+ data: { email, uid, teamId, teamName, permission }+ });+}++export const post: RequestHandler = async (event) => {+ const { userId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { email, permission, teamId, teamName } = await event.request.json();++ try {+ const userFound = await db.prisma.user.findUnique({ where: { email } });+ if (!userFound) {+ throw {+ error: `No user found with '${email}' email address.`+ };+ }+ const uid = userFound.id;+ // Invitation to yourself?!+ if (uid === userId) {+ throw {+ error: `Invitation to yourself? Whaaaaat?`+ };+ }+ const alreadyInTeam = await db.prisma.team.findFirst({+ where: { id: teamId, users: { some: { id: uid } } }+ });+ if (alreadyInTeam) {+ throw {+ error: `Already in the team.`+ };+ }+ const invitationFound = await db.prisma.teamInvitation.findFirst({ where: { uid, teamId } });+ if (invitationFound) {+ if (dayjs().toDate() < dayjs(invitationFound.createdAt).add(1, 'day').toDate()) {+ throw {+ error: 'Invitiation already pending on user confirmation.'+ };+ } else {+ await db.prisma.teamInvitation.delete({ where: { id: invitationFound.id } });+ await createInvitation({ email, uid, teamId, teamName, permission });+ return {+ status: 200,+ body: {+ message: 'Invitiation sent.'+ }+ };+ }+ } else {+ await createInvitation({ email, uid, teamId, teamName, permission });+ return {+ status: 200,+ body: {+ message: 'Invitiation sent.'+ }+ };+ }+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/teams/[id]/invitation/revoke.json.ts b/src/routes/teams/[id]/invitation/revoke.json.tsnew file mode 100644index 0000000000..07f7a2387c--- /dev/null+++ b/src/routes/teams/[id]/invitation/revoke.json.ts@@ -0,0 +1,20 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import { dayjs } from '$lib/dayjs';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { userId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { id } = await event.request.json();+ try {+ await db.prisma.teamInvitation.delete({ where: { id } });+ return {+ status: 200+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/teams/[id]/permission/change.json.ts b/src/routes/teams/[id]/permission/change.json.tsnew file mode 100644index 0000000000..018b7772b5--- /dev/null+++ b/src/routes/teams/[id]/permission/change.json.ts@@ -0,0 +1,23 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { userId, newPermission, permissionId } = await event.request.json();++ try {+ await db.prisma.permission.updateMany({+ where: { id: permissionId, userId },+ data: { permission: { set: newPermission } }+ });+ return {+ status: 201+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/teams/[id]/remove/user.json.ts b/src/routes/teams/[id]/remove/user.json.tsnew file mode 100644index 0000000000..6a82de694e--- /dev/null+++ b/src/routes/teams/[id]/remove/user.json.ts@@ -0,0 +1,24 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const post: RequestHandler = async (event) => {+ const { userId, status, body } = await getUserDetails(event);+ if (status === 401) return { status, body };++ const { teamId, uid } = await event.request.json();++ try {+ await db.prisma.team.update({+ where: { id: teamId },+ data: { users: { disconnect: { id: uid } } }+ });+ await db.prisma.permission.deleteMany({ where: { userId: uid, teamId } });+ return {+ status: 201+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/teams/index.json.ts b/src/routes/teams/index.json.tsnew file mode 100644index 0000000000..d004ecb5da--- /dev/null+++ b/src/routes/teams/index.json.ts@@ -0,0 +1,26 @@+import { getUserDetails } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const get: RequestHandler = async (event) => {+ const { userId, status, body } = await getUserDetails(event, false);+ if (status === 401) return { status, body };++ try {+ const teams = await db.prisma.permission.findMany({+ where: { userId },+ include: { team: { include: { _count: { select: { users: true } } } } }+ });+ const invitations = await db.prisma.teamInvitation.findMany({ where: { uid: userId } });+ return {+ status: 200,+ body: {+ teams,+ invitations+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/teams/index.svelte b/src/routes/teams/index.sveltenew file mode 100644index 0000000000..c8572d5fc1--- /dev/null+++ b/src/routes/teams/index.svelte@@ -0,0 +1,113 @@+<script context="module" lang="ts">+ import type { Load } from '@sveltejs/kit';+ export const load: Load = async ({ fetch }) => {+ const url = `/teams.json`;+ const res = await fetch(url);++ if (res.ok) {+ return {+ props: {+ ...(await res.json())+ }+ };+ }++ return {+ status: res.status,+ error: new Error(`Could not load ${url}`)+ };+ };+</script>++<script lang="ts">+ import { errorNotification } from '$lib/form';+ import { session } from '$app/stores';+ import { post } from '$lib/api';++ export let teams;+ export let invitations;++ async function acceptInvitation(id, teamId) {+ try {+ await post(`/teams/${teamId}/invitation/accept.json`, { id });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+ async function revokeInvitation(id, teamId) {+ try {+ await post(`/teams/${teamId}/invitation/revoke.json`, { id });+ return window.location.reload();+ } catch ({ error }) {+ return errorNotification(error);+ }+ }+</script>++<div class="flex space-x-1 p-6 font-bold">+ <div class="mr-4 text-2xl tracking-tight">Teams</div>+ {#if $session.isAdmin}+ <a href="/new/team" class="add-icon bg-cyan-600 hover:bg-cyan-500">+ <svg+ class="w-6"+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ ><path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 6v6m0 0v6m0-6h6m-6 0H6"+ /></svg+ >+ </a>+ {/if}+</div>++{#if invitations.length > 0}+ <div class="mx-auto max-w-2xl pb-10">+ <div class="flex space-x-1 p-6 font-bold">+ <div class="title">Pending invitations</div>+ </div>+ <div class="text-center">+ {#each invitations as invitation}+ <div class="flex justify-center space-x-2">+ <div>+ Invited to <span class="font-bold text-pink-600">{invitation.teamName}</span> with+ <span class="font-bold text-rose-600">{invitation.permission}</span> permission.+ </div>+ <button+ class="hover:bg-green-500"+ on:click={() => acceptInvitation(invitation.id, invitation.teamId)}>Accept</button+ >+ <button+ class="hover:bg-red-600"+ on:click={() => revokeInvitation(invitation.id, invitation.teamId)}>Delete</button+ >+ </div>+ {/each}+ </div>+ </div>+{/if}+<div class="mx-auto max-w-2xl">+ <div class="flex flex-wrap justify-center">+ {#each teams as team}+ <a href="/teams/{team.teamId}" class="w-96 p-2 no-underline">+ <div+ class="box-selection relative"+ class:hover:bg-cyan-600={team.team?.id !== '0'}+ class:hover:bg-red-500={team.team?.id === '0'}+ >+ <div class="truncate text-center text-xl font-bold">{team.team.name}</div>+ <div class="text-center text-xs">+ ({team.team?.id === '0' ? 'root team - ' : ''}{team.permission})+ </div>++ <div class="mt-1 text-center">{team.team._count.users} member(s)</div>+ </div>+ </a>+ {/each}+ </div>+</div>diff --git a/src/routes/undead.json.ts b/src/routes/undead.json.tsnew file mode 100644index 0000000000..bf9423d744--- /dev/null+++ b/src/routes/undead.json.ts@@ -0,0 +1,8 @@+export const get = async () => {+ return {+ status: 200,+ body: {+ message: 'Nope'+ }+ };+};diff --git a/src/routes/update.json.ts b/src/routes/update.json.tsnew file mode 100644index 0000000000..505f307dbf--- /dev/null+++ b/src/routes/update.json.ts@@ -0,0 +1,73 @@+import { dev } from '$app/env';+import { asyncExecShell, version } from '$lib/common';+import { asyncSleep } from '$lib/components/common';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';+import compare from 'compare-versions';+import got from 'got';++export const get: RequestHandler = async () => {+ try {+ const currentVersion = version;+ const versions = await got+ .get(`https://get.coollabs.io/versions.json?appId=${process.env['COOLIFY_APP_ID']}`)+ .json();+ const latestVersion = versions['coolify'].main.version;+ const isUpdateAvailable = compare(latestVersion, currentVersion);+ return {+ body: {+ isUpdateAvailable: isUpdateAvailable === 1,+ latestVersion+ }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};++export const post: RequestHandler = async (event) => {+ const { type } = await event.request.json();+ if (type === 'pull') {+ try {+ if (!dev) {+ await asyncExecShell(`env | grep COOLIFY > .env`);+ await asyncExecShell(`docker compose pull`);+ return {+ status: 200,+ body: {}+ };+ } else {+ await asyncSleep(2000);+ return {+ status: 200,+ body: {}+ };+ }+ } catch (error) {+ return PrismaErrorHandler(error);+ }+ } else if (type === 'update') {+ try {+ if (!dev) {+ await asyncExecShell(+ `docker run --rm -tid --env-file .env -v /var/run/docker.sock:/var/run/docker.sock -v coolify-db coollabsio/coolify:latest /bin/sh -c "env | grep COOLIFY > .env && docker stop -t 0 coolify && docker stop -t 0 coolify-redis && docker compose up -d --force-recreate"`+ );+ return {+ status: 200,+ body: {}+ };+ } else {+ await asyncSleep(2000);+ return {+ status: 200,+ body: {}+ };+ }+ } catch (error) {+ return PrismaErrorHandler(error);+ }+ }+ return {+ status: 500+ };+};diff --git a/src/routes/webhooks/github/events.ts b/src/routes/webhooks/github/events.tsnew file mode 100644index 0000000000..a370dc42cf--- /dev/null+++ b/src/routes/webhooks/github/events.ts@@ -0,0 +1,177 @@+import { getDomain, getTeam, getUserDetails, removeDestinationDocker } from '$lib/common';+import * as db from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';+import cuid from 'cuid';+import crypto from 'crypto';+import { buildQueue } from '$lib/queues';+import { checkContainer, removeProxyConfiguration } from '$lib/haproxy';++export const options: RequestHandler = async () => {+ return {+ status: 200,+ headers: {+ 'Access-Control-Allow-Origin': '*',+ 'Access-Control-Allow-Headers': 'Content-Type, Authorization',+ 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'+ }+ };+};++export const post: RequestHandler = async (event) => {+ try {+ const buildId = cuid();+ const allowedGithubEvents = ['push', 'pull_request'];+ const allowedActions = ['opened', 'reopened', 'synchronize', 'closed'];+ const githubEvent = event.request.headers.get('x-github-event').toLowerCase();+ const githubSignature = event.request.headers.get('x-hub-signature-256').toLowerCase();+ if (!allowedGithubEvents.includes(githubEvent)) {+ return {+ status: 500,+ body: {+ message: 'Event not allowed.'+ }+ };+ }+ let repository, projectId, branch;+ const body = await event.request.json();++ if (githubEvent === 'push') {+ repository = body.repository;+ projectId = repository.id;+ branch = body.ref.split('/')[2];+ } else if (githubEvent === 'pull_request') {+ repository = body.pull_request.head.repo;+ projectId = repository.id;+ branch = body.pull_request.head.ref.split('/')[2];+ }++ const applicationFound = await db.getApplicationWebhook({ projectId, branch });+ if (applicationFound) {+ const webhookSecret = applicationFound.gitSource.githubApp.webhookSecret;+ const hmac = crypto.createHmac('sha256', webhookSecret);+ const digest = Buffer.from(+ 'sha256=' + hmac.update(JSON.stringify(body)).digest('hex'),+ 'utf8'+ );+ const checksum = Buffer.from(githubSignature, 'utf8');+ if (checksum.length !== digest.length || !crypto.timingSafeEqual(digest, checksum)) {+ return {+ status: 500,+ body: {+ message: 'SHA256 checksum failed. Are you doing something fishy?'+ }+ };+ }+ if (githubEvent === 'push') {+ if (!applicationFound.configHash) {+ const configHash = crypto+ .createHash('sha256')+ .update(+ JSON.stringify({+ buildPack: applicationFound.buildPack,+ port: applicationFound.port,+ installCommand: applicationFound.installCommand,+ buildCommand: applicationFound.buildCommand,+ startCommand: applicationFound.startCommand+ })+ )+ .digest('hex');+ await db.prisma.application.updateMany({+ where: { branch, projectId },+ data: { configHash }+ });+ }+ await buildQueue.add(buildId, {+ build_id: buildId,+ type: 'webhook_commit',+ ...applicationFound+ });+ return {+ status: 200,+ body: {+ message: 'Queued. Thank you!'+ }+ };+ } else if (githubEvent === 'pull_request') {+ const pullmergeRequestId = body.number;+ const pullmergeRequestAction = body.action;+ const sourceBranch = body.pull_request.head.ref;+ if (!allowedActions.includes(pullmergeRequestAction)) {+ return {+ status: 500,+ body: {+ message: 'Action not allowed.'+ }+ };+ }++ if (applicationFound.settings.previews) {+ if (applicationFound.destinationDockerId) {+ const isRunning = await checkContainer(+ applicationFound.destinationDocker.engine,+ applicationFound.id+ );+ if (!isRunning) {+ return {+ status: 500,+ body: {+ message: 'Application not running.'+ }+ };+ }+ }+ if (pullmergeRequestAction === 'opened' || pullmergeRequestAction === 'reopened') {+ await buildQueue.add(buildId, {+ build_id: buildId,+ type: 'webhook_pr',+ ...applicationFound,+ sourceBranch,+ pullmergeRequestId+ });+ return {+ status: 200,+ body: {+ message: 'Queued. Thank you!'+ }+ };+ } else if (pullmergeRequestAction === 'closed') {+ if (applicationFound.destinationDockerId) {+ const domain = getDomain(applicationFound.fqdn);+ const id = `${applicationFound.id}-${pullmergeRequestId}`;+ const engine = applicationFound.destinationDocker.engine;+ await removeDestinationDocker({ id, engine });+ await removeProxyConfiguration({ domain: `${pullmergeRequestId}.${domain}` });+ }+ return {+ status: 200,+ body: {+ message: 'Removed preview. Thank you!'+ }+ };+ }+ } else {+ return {+ status: 500,+ body: {+ message: 'Pull request previews are not enabled.'+ }+ };+ }+ }+ }+ return {+ status: 500,+ body: {+ message: 'Not handled event.'+ }+ };+ } catch (err) {+ console.log(err);+ return {+ status: 500,+ body: {+ message: err.message+ }+ };+ }+};diff --git a/src/routes/webhooks/github/index.ts b/src/routes/webhooks/github/index.tsnew file mode 100644index 0000000000..b8fdd2e14c--- /dev/null+++ b/src/routes/webhooks/github/index.ts@@ -0,0 +1,41 @@+import { dev } from '$app/env';+import { getTeam } from '$lib/common';+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const options = async () => {+ return {+ status: 200,+ headers: {+ 'Access-Control-Allow-Origin': '*',+ 'Access-Control-Allow-Headers': 'Content-Type, Authorization',+ 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'+ }+ };+};++export const get: RequestHandler = async (request) => {+ const teamId = undefined;+ const code = request.url.searchParams.get('code');+ const state = request.url.searchParams.get('state');+ try {+ const { apiUrl } = await db.getSource({ id: state, teamId });+ const response = await fetch(`${apiUrl}/app-manifests/${code}/conversions`, { method: 'POST' });+ if (!response.ok) {+ const error = await response.json();+ return {+ status: 500,+ body: { ...error }+ };+ }+ const { id, client_id, slug, client_secret, pem, webhook_secret } = await response.json();+ await db.createGithubApp({ id, client_id, slug, client_secret, pem, webhook_secret, state });+ return {+ status: 302,+ headers: { Location: `/webhooks/success` }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/webhooks/github/install.ts b/src/routes/webhooks/github/install.tsnew file mode 100644index 0000000000..c535fb85b7--- /dev/null+++ b/src/routes/webhooks/github/install.ts@@ -0,0 +1,29 @@+import * as db from '$lib/database';+import { PrismaErrorHandler } from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';++export const options = async () => {+ return {+ status: 200,+ headers: {+ 'Access-Control-Allow-Origin': '*',+ 'Access-Control-Allow-Headers': 'Content-Type, Authorization',+ 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'+ }+ };+};++export const get: RequestHandler = async (request) => {+ const gitSourceId = request.url.searchParams.get('gitSourceId');+ const installation_id = request.url.searchParams.get('installation_id');++ try {+ await db.addInstallation({ gitSourceId, installation_id });+ return {+ status: 302,+ headers: { Location: `/webhooks/success` }+ };+ } catch (error) {+ return PrismaErrorHandler(error);+ }+};diff --git a/src/routes/webhooks/gitlab/events.ts b/src/routes/webhooks/gitlab/events.tsnew file mode 100644index 0000000000..d89507a7cf--- /dev/null+++ b/src/routes/webhooks/gitlab/events.ts@@ -0,0 +1,182 @@+import { getTeam, getUserDetails, getDomain, removeDestinationDocker } from '$lib/common';+import { checkContainer, removeProxyConfiguration } from '$lib/haproxy';+import * as db from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';+import cuid from 'cuid';+import crypto from 'crypto';+import { buildQueue } from '$lib/queues';+import { dev } from '$app/env';++export const options: RequestHandler = async () => {+ return {+ status: 200,+ headers: {+ 'Access-Control-Allow-Origin': '*',+ 'Access-Control-Allow-Headers': 'Content-Type, Authorization',+ 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'+ }+ };+};++export const post: RequestHandler = async (event) => {+ const allowedActions = ['opened', 'reopen', 'close', 'open', 'update'];+ const body = await event.request.json();+ const buildId = cuid();+ try {+ const { object_kind: objectKind } = body;+ if (objectKind === 'push') {+ const { ref } = body;+ const projectId = Number(body['project_id']);+ const branch = ref.split('/')[2];+ const applicationFound = await db.getApplicationWebhook({ projectId, branch });+ if (applicationFound) {+ if (!applicationFound.configHash) {+ const configHash = crypto+ .createHash('sha256')+ .update(+ JSON.stringify({+ buildPack: applicationFound.buildPack,+ port: applicationFound.port,+ installCommand: applicationFound.installCommand,+ buildCommand: applicationFound.buildCommand,+ startCommand: applicationFound.startCommand+ })+ )+ .digest('hex');+ await db.prisma.application.updateMany({+ where: { branch, projectId },+ data: { configHash }+ });+ }+ await buildQueue.add(buildId, {+ build_id: buildId,+ type: 'webhook_commit',+ ...applicationFound+ });+ return {+ status: 200,+ body: {+ message: 'Queued. Thank you!'+ }+ };+ }+ } else if (objectKind === 'merge_request') {+ const webhookToken = event.request.headers.get('x-gitlab-token');+ if (!webhookToken) {+ return {+ status: 500,+ body: {+ message: 'Ooops, something is not okay, are you okay?'+ }+ };+ }++ const isDraft = body.object_attributes.work_in_progress;+ const action = body.object_attributes.action;+ const projectId = Number(body.project.id);+ const sourceBranch = body.object_attributes.source_branch;+ const targetBranch = body.object_attributes.target_branch;+ const pullmergeRequestId = body.object_attributes.iid;+ if (!allowedActions.includes(action)) {+ return {+ status: 500,+ body: {+ message: 'Action not allowed.'+ }+ };+ }+ if (isDraft) {+ return {+ status: 500,+ body: {+ message: 'Draft MR, do nothing.'+ }+ };+ }++ const applicationFound = await db.getApplicationWebhook({ projectId, branch: targetBranch });+ if (applicationFound) {+ if (applicationFound.settings.previews) {+ if (applicationFound.destinationDockerId) {+ const isRunning = await checkContainer(+ applicationFound.destinationDocker.engine,+ applicationFound.id+ );+ if (!isRunning) {+ return {+ status: 500,+ body: {+ message: 'Application not running.'+ }+ };+ }+ }+ if (!dev && applicationFound.gitSource.gitlabApp.webhookToken !== webhookToken) {+ return {+ status: 500,+ body: {+ message: 'Ooops, something is not okay, are you okay?'+ }+ };+ }+ if (+ action === 'opened' ||+ action === 'reopen' ||+ action === 'open' ||+ action === 'update'+ ) {+ await buildQueue.add(buildId, {+ build_id: buildId,+ type: 'webhook_mr',+ ...applicationFound,+ sourceBranch,+ pullmergeRequestId+ });+ return {+ status: 200,+ body: {+ message: 'Queued. Thank you!'+ }+ };+ } else if (action === 'close') {+ if (applicationFound.destinationDockerId) {+ const domain = getDomain(applicationFound.fqdn);+ const id = `${applicationFound.id}-${pullmergeRequestId}`;+ const engine = applicationFound.destinationDocker.engine;+ await removeProxyConfiguration({ domain: `${pullmergeRequestId}.${domain}` });+ await removeDestinationDocker({ id, engine });+ }++ return {+ status: 200,+ body: {+ message: 'Removed preview. Thank you!'+ }+ };+ }+ }+ return {+ status: 500,+ body: {+ message: 'Merge request previews are not enabled.'+ }+ };+ }+ }++ return {+ status: 500,+ body: {+ message: 'Not handled event.'+ }+ };+ } catch (err) {+ console.log(err);+ return {+ status: 500,+ body: {+ message: err.message+ }+ };+ }+};diff --git a/src/routes/webhooks/gitlab/index.ts b/src/routes/webhooks/gitlab/index.tsnew file mode 100644index 0000000000..9f953bc88f--- /dev/null+++ b/src/routes/webhooks/gitlab/index.ts@@ -0,0 +1,59 @@+import { dev } from '$app/env';+import { getTeam } from '$lib/common';+import * as db from '$lib/database';+import type { RequestHandler } from '@sveltejs/kit';+import got from 'got';+import cookie from 'cookie';++export const options: RequestHandler = async () => {+ return {+ status: 200,+ headers: {+ 'Access-Control-Allow-Origin': '*',+ 'Access-Control-Allow-Headers': 'Content-Type, Authorization',+ 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'+ }+ };+};++export const get: RequestHandler = async (event) => {+ const teamId = undefined;+ const code = event.url.searchParams.get('code');+ const state = event.url.searchParams.get('state');+ try {+ const application = await db.getApplication({ id: state, teamId });+ const { fqdn } = application;+ const { appId, appSecret } = application.gitSource.gitlabApp;+ const { htmlUrl } = application.gitSource;++ let domain = `http://${event.url.host}`;+ if (fqdn) domain = fqdn;++ const { access_token } = await got+ .post(`${htmlUrl}/oauth/token`, {+ searchParams: {+ client_id: appId,+ client_secret: appSecret,+ code,+ state,+ grant_type: 'authorization_code',+ redirect_uri: `${domain}/webhooks/gitlab`+ }+ })+ .json();++ return {+ status: 302,+ headers: {+ Location: `/webhooks/success`,+ 'Set-Cookie': [`gitlabToken=${access_token}; HttpOnly; Path=/; Max-Age=15778800;`]+ }+ };+ } catch (err) {+ console.log(err);+ return {+ status: 500,+ body: err.message+ };+ }+};diff --git a/src/routes/webhooks/success/index.svelte b/src/routes/webhooks/success/index.sveltenew file mode 100644index 0000000000..9dd61a089d--- /dev/null+++ b/src/routes/webhooks/success/index.svelte@@ -0,0 +1,3 @@+<script lang="ts">+ window.close();+</script>diff --git a/src/store/index.ts b/src/store/index.tsdeleted file mode 100644index 0c76db7b51..0000000000--- a/src/store/index.ts+++ /dev/null@@ -1,183 +0,0 @@-import type {- Application,- Dashboard,- Database,- DateTimeFormatOptions,- GithubInstallations-} from 'src/global';-import { writable } from 'svelte/store';-export const settings = writable({- clientId: null-});-export const dashboard = writable<Dashboard>({- databases: {- deployed: []- },- applications: {- deployed: []- },- services: {- deployed: []- }-});-export const dateOptions: DateTimeFormatOptions = {- year: 'numeric',- month: 'short',- day: '2-digit',- hour: 'numeric',- minute: 'numeric',- second: 'numeric',- hour12: false-};--export const githubRepositories = writable([]);-export const githubInstallations = writable<GithubInstallations>([]);-export const originalDomain = writable(null)-export const application = writable<Application>({- github: {- installation: {- id: null- },- app: {- id: null- }- },- repository: {- id: null,- organization: 'new',- name: 'start',- branch: null- },- general: {- deployId: null,- nickname: null,- workdir: null,- isPreviewDeploymentEnabled: false,- pullRequest: 0- },- build: {- pack: 'static',- directory: null,- command: {- build: null,- installation: null,- start: null,- python: {- module: null,- instance: null- }- },- container: {- name: null,- tag: null,- baseSHA: null- }- },- publish: {- directory: null,- domain: null,- path: '/',- port: null,- secrets: []- }-});-export const prApplication = writable([]);-export const initConf = writable({});-export const initialApplication: Application = {- github: {- installation: {- id: null- },- app: {- id: null- }- },- repository: {- id: null,- organization: null,- name: null,- branch: null- },- general: {- deployId: null,- nickname: null,- workdir: null,- isPreviewDeploymentEnabled: false,- pullRequest: 0- },- build: {- pack: 'static',- directory: null,- command: {- build: null,- installation: null,- start: null,- python: {- module: null,- instance: null- }- },- container: {- name: null,- tag: null,- baseSHA: null- }- },- publish: {- directory: null,- domain: null,- path: '/',- port: null,- secrets: []- }-};-export const initialDatabase: Database = {- config: {- general: {- workdir: null,- deployId: null,- nickname: null,- type: null- },- database: {- username: null,- passwords: [],- defaultDatabaseName: null- },- deploy: {- name: null- }- },- envs: {}-};-export const database = writable<Database>({- config: {},- envs: []-});-export const newService = writable({- email: null,- userName: 'admin',- userPassword: null,- userPasswordAgain: null,- baseURL: null-});-export const initialNewService = {- email: null,- userName: 'admin',- userPassword: null,- userPasswordAgain: null,- baseURL: null-};-export const newWordpressService = writable({- baseURL: null,- remoteDB: false,- database: {- host: null,- name: 'wordpress',- user: null,- password: null,- tablePrefix: 'wordpress'- },- wordpressExtraConfiguration: null-});-export const isPullRequestPermissionsGranted = writable(false);diff --git a/src/tailwind.css b/src/tailwind.cssnew file mode 100644index 0000000000..3bae891908--- /dev/null+++ b/src/tailwind.css@@ -0,0 +1,288 @@+@tailwind base;+@tailwind components;+@tailwind utilities;++html {+ @apply h-full min-h-full;+}+body {+ @apply min-h-screen overflow-x-hidden bg-coolblack text-sm text-white;+}++main,+.main {+ width: calc(100% - 4rem);+ margin-left: 4rem;+}++input {+ @apply w-96 select-all rounded border border-transparent bg-transparent bg-coolgray-200 p-2 text-xs tracking-tight text-white placeholder-stone-600 outline-none transition duration-150 hover:bg-coolgray-500 focus:bg-coolgray-500 disabled:bg-transparent md:text-sm;+}+textarea {+ @apply w-96 select-all rounded border border-transparent bg-transparent bg-coolgray-200 p-2 text-xs tracking-tight text-white placeholder-stone-600 outline-none transition duration-150 hover:bg-coolgray-500 focus:bg-coolgray-500 disabled:bg-transparent md:text-sm;+}++select {+ @apply 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;+}++label {+ @apply inline-block w-64 text-xs tracking-tight md:text-sm;+}++button {+ @apply rounded bg-coolgray-200 p-1 px-4 py-2 text-xs font-bold outline-none transition-all duration-100 hover:bg-coolgray-500 disabled:cursor-not-allowed disabled:bg-coolblack disabled:text-stone-600 md:text-sm;+}++a {+ @apply underline hover:text-white;+}++.content {+ @apply p-2 px-4;+}++.title {+ @apply mr-4 text-base tracking-tight md:text-2xl;+}+.nav-main {+ @apply fixed top-0 left-0 min-h-screen w-16 min-w-[4rem] border-r border-stone-800 bg-coolgray-200;+}++.nav-side {+ @apply absolute right-0 top-0 z-50 m-5 flex items-center justify-end space-x-2 bg-coolblack/40 text-white;+}++.add-icon {+ @apply rounded p-1 transition duration-200;+}++.icons {+ @apply rounded p-2 transition duration-200 hover:bg-coolgray-500 disabled:bg-coolblack !important;+}++.arrow-right-applications {+ @apply -ml-6 px-2 font-bold text-green-500;+}++.border-gradient {+ border-bottom: 2px solid transparent;+ -o-border-image: linear-gradient(+ 0.25turn,+ rgba(255, 249, 34),+ rgba(255, 0, 128),+ rgba(56, 2, 155, 0)+ );+ border-image: linear-gradient(+ 0.25turn,+ rgba(255, 249, 34),+ rgba(255, 0, 128),+ rgba(56, 2, 155, 0)+ );+ border-image-slice: 1;+}+.border-gradient-full {+ border: 4px solid transparent;+ -o-border-image: linear-gradient(+ 0.25turn,+ rgba(255, 249, 34),+ rgba(255, 0, 128),+ rgba(56, 2, 155, 0)+ );+ border-image: linear-gradient(+ 0.25turn,+ rgba(255, 249, 34),+ rgba(255, 0, 128),+ rgba(56, 2, 155, 0)+ );+ border-image-slice: 1;+}+/**+ * Tooltip Styles+ */++/* Base styles for the element that has a tooltip */+[data-tooltip],+.tooltip {+ position: relative;+ cursor: pointer;+}++/* Base styles for the entire tooltip */+[data-tooltip]:before,+[data-tooltip]:after,+.tooltip:before,+.tooltip:after {+ position: absolute;+ visibility: hidden;+ opacity: 0;+ transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out,+ transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);+ transform: translate3d(0, 0, 0);+ pointer-events: none;+}++/* Show the entire tooltip on hover and focus */+[data-tooltip]:hover:before,+[data-tooltip]:hover:after,+[data-tooltip]:focus:before,+[data-tooltip]:focus:after,+.tooltip:hover:before,+.tooltip:hover:after,+.tooltip:focus:before,+.tooltip:focus:after {+ visibility: visible;+ opacity: 1;+}++/* Base styles for the tooltip's directional arrow */+.tooltip:before,+[data-tooltip]:before {+ z-index: 1001;+ border: 6px solid transparent;+ background: transparent;+ content: '';+}++/* Base styles for the tooltip's content area */+.tooltip:after,+[data-tooltip]:after {+ z-index: 1000;+ padding: 8px;+ color: #fff;+ content: attr(data-tooltip);+ @apply min-w-[100px] rounded bg-coollabs text-center font-normal;+}++/* Directions */++/* Top (default) */+[data-tooltip]:before,+[data-tooltip]:after,+.tooltip:before,+.tooltip:after,+.tooltip-top:before,+.tooltip-top:after {+ bottom: 100%;+ left: 50%;+}++/* Horizontally align top/bottom tooltips */+[data-tooltip]:after,+.tooltip:after,+.tooltip-top:after {+ margin-left: -80px;+}++[data-tooltip]:hover:before,+[data-tooltip]:hover:after,+[data-tooltip]:focus:before,+[data-tooltip]:focus:after,+.tooltip:hover:before,+.tooltip:hover:after,+.tooltip:focus:before,+.tooltip:focus:after,+.tooltip-top:hover:before,+.tooltip-top:hover:after,+.tooltip-top:focus:before,+.tooltip-top:focus:after {+ transform: translateY(-12px);+}++/* Left */+.tooltip-left:before,+.tooltip-left:after {+ right: 100%;+ bottom: 50%;+ left: auto;+}++.tooltip-left:hover:before,+.tooltip-left:hover:after,+.tooltip-left:focus:before,+.tooltip-left:focus:after {+ transform: translateX(-12px);+}++/* Bottom */+.tooltip-bottom:before,+.tooltip-bottom:after {+ top: 100%;+ bottom: auto;+ left: 50%;+}++.tooltip-bottom:hover:before,+.tooltip-bottom:hover:after,+.tooltip-bottom:focus:before,+.tooltip-bottom:focus:after {+ transform: translateY(12px);+}++/* Right */+.tooltip-right:before,+.tooltip-right:after {+ bottom: 50%;+ left: 100%;+}++.tooltip-right:hover:before,+.tooltip-right:hover:after,+.tooltip-right:focus:before,+.tooltip-right:focus:after {+ transform: translateX(12px);+}++/* Move directional arrows down a bit for left/right tooltips */+.tooltip-left:before,+.tooltip-right:before {+ top: 12px;+}++/* Vertically center tooltip content for left/right tooltips */+.tooltip-left:after,+.tooltip-right:after {+ margin-left: 0;+ margin-bottom: -16px;+}++.box-selection {+ @apply min-w-[16rem] max-w-[24rem] justify-center rounded-lg border-transparent bg-coolgray-200 p-6 shadow-lg transition duration-150 hover:scale-105 hover:border-transparent hover:bg-coolgray-400;+}++._toastBar {+ @apply hidden !important;+}+._toastMsg {+ @apply text-xs !important;+}+._toastBtn {+ @apply text-xs !important;+}+._toastItem {+ @apply bg-coollabs bg-opacity-80 !important;+}++.lds-heart {+ animation: lds-heart 1.2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);+}+@keyframes lds-heart {+ 0% {+ transform: scale(1);+ }+ 5% {+ transform: scale(1.2);+ }+ 39% {+ transform: scale(0.85);+ }+ 45% {+ transform: scale(1);+ }+ 60% {+ transform: scale(0.95);+ }+ 100% {+ transform: scale(0.9);+ }+}diff --git a/svelte.config.js b/svelte.config.jsindex d024846fcc..4e8bc89664 100644--- a/svelte.config.js+++ b/svelte.config.js@@ -1,39 +1,20 @@-import dotEnvExtended from 'dotenv-extended';-dotEnvExtended.load();import preprocess from 'svelte-preprocess';-import path from 'path';import adapter from '@sveltejs/adapter-node';-/** @type {import('@sveltejs/kit').Config} */-export default {- preprocess: [- preprocess({- postcss: true- })- ],++const config = {+ preprocess: preprocess(),kit: {- adapter: adapter({- out: 'build'- }),- target: '#svelte',- hostHeader: 'X-Forwarded-Host',- floc: true,+ adapter: adapter(),prerender: {enabled: false},+ floc: true,vite: {- server: {- hmr: {- port: 23456- }- },- resolve: {- alias: {- $components: path.resolve('./src/components/'),- $store: path.resolve('./src/store/index.ts'),- $api: path.resolve('./src/routes/api/'),- $models: path.resolve('./src/models/')- }+ optimizeDeps: {+ exclude: ['svelte-kit-cookie-session']}}}};++export default config;diff --git a/tailwind.config.cjs b/tailwind.config.cjsindex c34d59038f..2d119a2683 100644--- a/tailwind.config.cjs+++ b/tailwind.config.cjs@@ -1,13 +1,7 @@const defaultTheme = require('tailwindcss/defaultTheme');const colors = require('tailwindcss/colors');-const { tailwindExtractor } = require('tailwindcss/lib/lib/purgeUnusedStyles');--const svelteClassColonExtractor = (content) => {- return content.match(/(?<=class:)([a-zA-Z0-9_-]+)/gm) || [];-};module.exports = {- mode: 'jit',- purge: ['./**/*.html', './src/**/*.{js,jsx,ts,tsx,svelte}'],+ content: ['./**/*.html', './src/**/*.{js,jsx,ts,tsx,svelte}'],important: true,theme: {extend: {@@ -21,22 +15,23 @@ module.exports = {wiggle: 'wiggle 0.5s ease-in-out infinite'},fontFamily: {- sans: ['Montserrat', ...defaultTheme.fontFamily.sans]+ sans: ['Poppins', ...defaultTheme.fontFamily.sans]},colors: {...colors,+ coollabs: '#6B16ED',+ 'coollabs-100': '#7317FF',coolblack: '#161616','coolgray-100': '#181818','coolgray-200': '#202020',- 'coolgray-300': '#242424'+ 'coolgray-300': '#242424',+ 'coolgray-400': '#282828',+ 'coolgray-500': '#323232'}}},variants: {- extend: {- opacity: ['disabled'],- animation: ['hover', 'focus']- }+ extend: {}},plugins: []};diff --git a/tsconfig.json b/tsconfig.jsonindex 623afac644..0555d526aa 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -2,8 +2,8 @@"compilerOptions": {"moduleResolution": "node","module": "es2020",- "lib": ["es2020"],- "target": "es2019",+ "lib": ["es2020", "DOM"],+ "target": "es2020",/**svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScriptto enforce using \`import type\` instead of \`import\` for Types.@@ -17,18 +17,14 @@*/"sourceMap": true,"esModuleInterop": true,- "allowSyntheticDefaultImports": true,"skipLibCheck": true,"forceConsistentCasingInFileNames": true,"baseUrl": ".","allowJs": true,"checkJs": true,"paths": {- "$lib/*": ["src/lib/*"],- "$store": ["src/store/index.ts"],- "$api/*": ["src/routes/api/*"],- "$models/*": ["src/models/*"],- "$components/*": ["src/components/*"]+ "$lib": ["src/lib"],+ "$lib/*": ["src/lib/*"]}},"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]