This commit is contained in:
Aly 2024-05-26 04:26:29 +10:00
parent c6def505cf
commit dfeef0073e
21 changed files with 7 additions and 1645 deletions

View file

201
LICENSE
View file

@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -1,91 +0,0 @@
## Repo for CapRover One Click Apps
### How to create a one-click app (as of v1.8.0):
First, have a look at [this simple example](https://github.com/caprover/one-click-apps/blob/master/public/v4/apps/privatebin.yml). Now, read on for more details:
- Find/create a docker-compose file for the app you're interested in.
- Add `captainVersion: 4` to the very top of the yaml file.
- Add this section to the end of the yaml file:
```yaml
caproverOneClickApp:
variables:
- id: '$$cap_myapp_version'
label: Awesome App Version
defaultValue: '1.2.3'
description: Check out their Docker page for the valid tags https://hub.docker.com/r/....../tags
validRegex: '/.{1,}/'
instructions:
start: |-
A description that will be displayed to the user when they
are installing one click app!
It can be multiline and contain more details and probably special
hardware requirements!
end: |-
A summary when the app is deployed!
It can be multiline.
It can also include the dynamic parameters such as
$$cap_appname and $$cap_other_random_char
displayName: The Awesome App
isOfficial: true ## Only if all images used here are official or from a trusted source.
description: A relatively short description, less than 200 characters.
documentation: This docker-compose is taken from example.com
```
### Variables:
- Variables are prefixed with `$$cap`
- Variables can be anywhere in the content and they will be replaced by what user enters
- There are 3 special variables that are built-in for all oneclick apps: `$$cap_appname`, `$$cap_root_domain`, and `$$cap_gen_random_hex(length)`. For example, if your app needs environment variables with the URL value of the app, you can use `$$cap_appname.$$cap_root_domain` which resolves to something like `myappname.rootdomain.com`. Also If you need a default password, you can use `$$cap_gen_random_hex(10)`
- Each custom variable must have `id`, `label`. They could also have `defaultValue`, `validRegex`, `description`.
- IMPORTANT: by default, fields are not required to be filled. If validRegex is not set, the field can be set as empty and ignored by the user.
### Services:
- Other than `image`, `environment`, `ports`, `volumes`, `depends_on`, and `hostname`, other parameters are currently being ignored by CapRover. If you need a particular parameter, please file an issue, and we'll add it to the respected list.
- Services have a special subsection specific to CapRover called `caproverExtra` which contains service specific parameters that are only available via CapRover and not docker compose. Currently this field can take the following variables:
- `dockerfileLines` which is a multiline variable, and can be used instead of `image` property in the service. You must delete the `image` property if you want to use this parameter.
- `containerHttpPort` is useful when the underlying service uses a custom port for HTTP. If not provided, the default will be `"80"`
- `notExposeAsWebApp` can be set to `"true"` when the underlying service is not an HTTP app. This is useful for databases and other internally used services.
- `websocketSupport` can be set to `"true"` to automatically enable Websocket Support. Only supported in versions 1.12+
### Icon
- Make sure you add an app icon to the logos directory!
---------
## Test your One Click Apps
After creating your One-Click app yaml file, you need to test it before creating a Pull Request. Here is how you test it:
- Login to your CapRover dashboard
- Go to **apps** and click on **One-Click Apps/Databases**
- Select **>> TEMPLATE <<** at the bottom of the dropdown list
- Copy and paste your YAML into the text area, and click **NEXT**.
- Enter values and make sure it's working as expected.
---------
## Build your own one-click app repository
You may want to build your own private repository. CapRover supports having multiple repositories. You can add new repository URLs to the one click app page. The official one, this one, is available as `https://oneclickapps.caprover.com`.
To create your own repository:
- Fork this repository
- Delete all existing apps (to avoid duplicate apps), and add your own apps.
- Run `npm i`
- Run `npm run validate_apps`
- Run `npm run formatter-write`
- Run `npm run build`
- Now you can host the static content placed in `./dist` directory anywhere you want, the official repo uses [github pages](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site) to publish the content. Make sure to update [CNAME](https://github.com/caprover/one-click-apps/blob/master/public/CNAME) to your own URL if you decide to do so.
### Third party One Click Apps
In order to add a third party repository:
- Login to your CapRover dashboard
- Go to **apps** and click on **One-Click Apps/Databases** and scrolldown to the bottom
- Under **3rd party repositories:** copy the URL, (for example: `https://Awes0meHub.github.io/caprover-one-click-apps`) and paste it in to the text box
- Click the **_Connect New Repository_** button
#### 3rd party repositories
- Awes0meHub: [Github](https://github.com/caproverhub/caprover-one-click-apps) repository: `https://caproverhub.github.io/caprover-one-click-apps`
- Jordan-hall: [Github](https://github.com/Jordan-Hall/caprover-one-click-apps) repository: `https://oneclickapps.libertyware.io`

578
package-lock.json generated
View file

@ -1,578 +0,0 @@
{
"name": "caprover-one-click-apps",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "caprover-one-click-apps",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"fs-extra": "^9.0.1",
"gh-pages": "^3.1.0",
"prettier": "^2.0.5",
"yaml": "^1.10.0"
}
},
"node_modules/array-union": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
"integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
"dependencies": {
"array-uniq": "^1.0.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/array-uniq": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
"integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dependencies": {
"lodash": "^4.17.14"
}
},
"node_modules/at-least-node": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
"integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
"engines": {
"node": ">= 4.0.0"
}
},
"node_modules/balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"node_modules/commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
},
"node_modules/commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs="
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"node_modules/email-addresses": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz",
"integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg=="
},
"node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/filename-reserved-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-1.0.0.tgz",
"integrity": "sha1-5hz4BfDeHJhFZ9A4bcXfUO5a9+Q=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/filenamify": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/filenamify/-/filenamify-1.2.1.tgz",
"integrity": "sha1-qfL/0RxQO+0wABUCknI3jx8TZaU=",
"dependencies": {
"filename-reserved-regex": "^1.0.0",
"strip-outer": "^1.0.0",
"trim-repeated": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/filenamify-url": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/filenamify-url/-/filenamify-url-1.0.0.tgz",
"integrity": "sha1-syvYExnvWGO3MHi+1Q9GpPeXX1A=",
"dependencies": {
"filenamify": "^1.0.0",
"humanize-url": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/find-cache-dir": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
"integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==",
"dependencies": {
"commondir": "^1.0.1",
"make-dir": "^3.0.2",
"pkg-dir": "^4.1.0"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/avajs/find-cache-dir?sponsor=1"
}
},
"node_modules/find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dependencies": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/fs-extra": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz",
"integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==",
"dependencies": {
"at-least-node": "^1.0.0",
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^1.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"node_modules/gh-pages": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-3.1.0.tgz",
"integrity": "sha512-3b1rly9kuf3/dXsT8+ZxP0UhNLOo1CItj+3e31yUVcaph/yDsJ9RzD7JOw5o5zpBTJVQLlJAASNkUfepi9fe2w==",
"dependencies": {
"async": "^2.6.1",
"commander": "^2.18.0",
"email-addresses": "^3.0.1",
"filenamify-url": "^1.0.0",
"find-cache-dir": "^3.3.1",
"fs-extra": "^8.1.0",
"globby": "^6.1.0"
},
"bin": {
"gh-pages": "bin/gh-pages.js",
"gh-pages-clean": "bin/gh-pages-clean.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/gh-pages/node_modules/fs-extra": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
"integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
},
"engines": {
"node": ">=6 <7 || >=8"
}
},
"node_modules/gh-pages/node_modules/jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/gh-pages/node_modules/universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"engines": {
"node": ">= 4.0.0"
}
},
"node_modules/glob": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/globby": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
"integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
"dependencies": {
"array-union": "^1.0.1",
"glob": "^7.0.3",
"object-assign": "^4.0.1",
"pify": "^2.0.0",
"pinkie-promise": "^2.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/graceful-fs": {
"version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw=="
},
"node_modules/humanize-url": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/humanize-url/-/humanize-url-1.0.1.tgz",
"integrity": "sha1-9KuZ4NKIF0yk4eUEB8VfuuRk7/8=",
"dependencies": {
"normalize-url": "^1.0.0",
"strip-url-auth": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/is-plain-obj": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
"integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/jsonfile": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz",
"integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==",
"dependencies": {
"universalify": "^1.0.0"
},
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dependencies": {
"p-locate": "^4.1.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
},
"node_modules/make-dir": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
"integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
"dependencies": {
"semver": "^6.0.0"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/normalize-url": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz",
"integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=",
"dependencies": {
"object-assign": "^4.0.1",
"prepend-http": "^1.0.0",
"query-string": "^4.1.0",
"sort-keys": "^1.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dependencies": {
"p-try": "^2.0.0"
},
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dependencies": {
"p-limit": "^2.2.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"engines": {
"node": ">=8"
}
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/pinkie": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
"integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/pinkie-promise": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
"dependencies": {
"pinkie": "^2.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/pkg-dir": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
"dependencies": {
"find-up": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/prepend-http": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz",
"integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/prettier": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz",
"integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==",
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/query-string": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz",
"integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=",
"dependencies": {
"object-assign": "^4.1.0",
"strict-uri-encode": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/sort-keys": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz",
"integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=",
"dependencies": {
"is-plain-obj": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/strict-uri-encode": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
"integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/strip-outer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz",
"integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==",
"dependencies": {
"escape-string-regexp": "^1.0.2"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/strip-url-auth": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/strip-url-auth/-/strip-url-auth-1.0.1.tgz",
"integrity": "sha1-IrD6OkE4WzO+PzMVUbu4N/oM164=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/trim-repeated": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz",
"integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=",
"dependencies": {
"escape-string-regexp": "^1.0.2"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/universalify": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz",
"integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==",
"engines": {
"node": ">= 10.0.0"
}
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
},
"node_modules/yaml": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz",
"integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==",
"engines": {
"node": ">= 6"
}
}
}
}

View file

@ -1,28 +0,0 @@
{
"name": "caprover-one-click-apps",
"version": "1.0.0",
"description": "One Click App Repository for CapRover",
"scripts": {
"formatter": "prettier --check \"./public/**/*.(json|yml)\"",
"formatter-write": "prettier --write \"./public/**/*.(json|yml)\"",
"build": "rm -rf ./dist/ && mkdir -p dist && node ./scripts/build_one_click_apps.js && node ./scripts/build_one_click_apps_from_v4.js",
"validate_apps": "node ./scripts/validate_apps.js",
"publish": "npm run build && ./scripts/publish-from-actions.sh"
},
"repository": {
"type": "git",
"url": "git+https://github.com/caprover/one-click-apps.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/caprover/one-click-apps/issues"
},
"homepage": "https://github.com/caprover/one-click-apps",
"dependencies": {
"fs-extra": "^9.0.1",
"gh-pages": "^3.1.0",
"prettier": "^2.0.5",
"yaml": "^1.10.0"
}
}

View file

@ -1,34 +0,0 @@
captainVersion: 4
services:
'$$cap_appname':
caproverExtra:
containerHttpPort: '3000'
dockerfileLines:
- 'FROM zefhemel/silverbullet'
volumes:
- '$$cap_appname-data:/space'
- '$$cap_appname-pub:/space/pub'
environment:
SB_USER: $$cap_sb_user
'$$cap_appname-pub':
caproverExtra:
containerHttpPort: '3000'
dockerfileLines:
- 'FROM dannyben/madness'
- 'ENTRYPOINT ["madness", "server"]'
volumes:
- '$$cap_appname-pub:/docs'
caproverOneClickApp:
variables:
- id: $$cap_sb_user
label: Authentication
defaultValue: 'admin:ChangeThisPassword!!!'
description: Authentication is disabled if not set. This authentication does not apply to files in pub/
displayName: Silverbullet.md
description: SilverBullet is a note-taking application optimized for people with a hacker mindset.
documentation: https://silverbullet.md/
instructions:
start: Make sure you change the authentication defaults
end: "Let me know if you encounter any issues: https://git.aly.pet/aly/caprover-apps"

View file

@ -1,168 +0,0 @@
/*jshint esversion: 6 */
const path = require('path');
const yaml = require('yaml');
const fs = require('fs-extra');
// Next, for V4:
// ============================================================================
// ============================================================================
// *********** THIS IS ONLY TO BE DONE AFTER CAPROVER 1.8 RELEASE *************
// ============================================================================
// ============================================================================
//
// 1- DUPLICATE this script. The new script is to ONLY read from /public/v4/*.yaml
// 2- Test with a new YAML file
// 3- Write script to convert all v2 JSON to V4 yaml and place them in /public/v4/*.yaml
// 4- Update readme!!!!
// 5- Push all 3 steps above at the same time to GITHUB
const pathOfPublic = path.join(__dirname, '..', `public`);
const pathOfDist = path.join(__dirname, '..', `dist`);
const pathOfDistV2 = path.join(pathOfDist, 'v2');
const pathOfDistV3 = path.join(pathOfDist, 'v3');
const pathOfDistV4 = path.join(pathOfDist, 'v4');
const pathOfSourceDirectory = path.join(pathOfPublic, 'v2');
const pathOfSourceDirectoryApps = path.join(pathOfSourceDirectory, 'apps');
const pathOfSourceDirectoryLogos = path.join(pathOfSourceDirectory, 'logos');
function createAppList(appsList, pathOfApps) {
const apps = appsList.filter(v => v.includes('.json'));
const appDetails = [];
for (var i = 0; i < apps.length; i++) {
const contentString = fs.readFileSync(path.join(pathOfApps, apps[i]));
const content = JSON.parse(contentString);
const captainVersion = (content.captainVersion + '');
apps[i] = apps[i].replace('.json', '');
if (captainVersion + '' === '2') {
if (!content.displayName) {
content.displayName = apps[i];
content.displayName = content.displayName.substr(0, 1).toUpperCase() + content.displayName.substring(1, content.displayName.length);
}
if (!content.description) content.description = '';
appDetails[i] = {
name: apps[i],
displayName: content.displayName,
description: content.description,
isOfficial: `${content.isOfficial}`.toLowerCase() === 'true',
logoUrl: apps[i] + '.png'
};
} else {
throw new Error('Unknown captain-version: ' + captainVersion);
}
}
return {
appList: apps,
appDetails: appDetails
};
}
function convertV2toV4(v2String) {
const parsed = JSON.parse(v2String);
if (`${parsed.captainVersion}` !== '2') {
throw new Error('CaptainVersion must be 2 for this conversion');
}
function moveProperty(propertyName) {
parsed.caproverOneClickApp[propertyName] = parsed[propertyName];
parsed[propertyName] = undefined;
}
parsed.services = parsed.dockerCompose.services;
parsed.dockerCompose = undefined;
parsed.captainVersion = 4;
parsed.caproverOneClickApp = {};
moveProperty('variables');
moveProperty('instructions');
moveProperty('displayName');
moveProperty('isOfficial');
moveProperty('description');
moveProperty('documentation');
Object.keys(parsed.services).forEach(serviceName => {
const service = parsed.services[serviceName];
if (service.containerHttpPort) {
service.caproverExtra = service.caproverExtra || {};
service.caproverExtra.containerHttpPort = service.containerHttpPort;
}
if (service.dockerfileLines) {
service.caproverExtra = service.caproverExtra || {};
service.caproverExtra.dockerfileLines = service.dockerfileLines;
}
if (service.notExposeAsWebApp) {
service.caproverExtra = service.caproverExtra || {};
service.caproverExtra.notExposeAsWebApp = service.notExposeAsWebApp;
}
service.containerHttpPort = undefined;
service.dockerfileLines = undefined;
service.notExposeAsWebApp = undefined;
});
return parsed;
}
function buildDist() {
return Promise.resolve()
.then(function () {
if (!fs.existsSync(pathOfSourceDirectoryApps)) {
return [];
}
return fs.readdir(pathOfSourceDirectoryApps);
})
.then(function (appsFileNames) { // [ app1.json app2.json .... ]
if (appsFileNames.length === 0) {
return;
}
appsFileNames.forEach(appFileName => {
const pathOfAppFileInSource = path.join(pathOfSourceDirectoryApps, appFileName);
//v2
fs.copySync(pathOfAppFileInSource, path.join(pathOfDistV2, `apps`, appFileName));
//v3
fs.copySync(pathOfAppFileInSource, path.join(pathOfDistV3, `apps`, appFileName.split('.')[0]));
//v4
const contentString = fs.readFileSync(pathOfAppFileInSource);
fs.outputJsonSync(path.join(pathOfDistV4, `apps`, appFileName.split('.')[0]), convertV2toV4(contentString));
});
fs.copySync(pathOfSourceDirectoryLogos, path.join(pathOfDistV2, `logos`));
fs.copySync(pathOfSourceDirectoryLogos, path.join(pathOfDistV3, `logos`));
fs.copySync(pathOfSourceDirectoryLogos, path.join(pathOfDistV4, `logos`));
const allAppsList = createAppList(appsFileNames, pathOfSourceDirectoryApps);
const v3List = {
oneClickApps: allAppsList.appDetails
};
fs.outputJsonSync(path.join(pathOfDistV2, 'autoGeneratedList.json'), allAppsList);
fs.outputJsonSync(path.join(pathOfDistV2, 'list'), v3List); // TODO delete oneClickApps:
fs.outputJsonSync(path.join(pathOfDistV3, 'list'), v3List);
fs.outputJsonSync(path.join(pathOfDistV4, 'list'), v3List);
return fs.copySync(path.join(pathOfPublic, 'CNAME'), path.join(pathOfDist, 'CNAME'));
});
}
Promise.resolve()
.then(function () {
return buildDist();
})
.catch(function (err) {
console.error(err);
process.exit(127);
});

View file

@ -1,195 +0,0 @@
/*jshint esversion: 6 */
const path = require('path');
const yaml = require('yaml');
const fs = require('fs-extra');
const pathOfPublic = path.join(__dirname, '..', `public`);
const pathOfDist = path.join(__dirname, '..', `dist`);
const pathOfDistV2 = path.join(pathOfDist, 'v2');
const pathOfDistV3 = path.join(pathOfDist, 'v3');
const pathOfDistV4 = path.join(pathOfDist, 'v4');
const pathOfSourceDirectory = path.join(pathOfPublic, 'v4');
const pathOfSourceDirectoryApps = path.join(pathOfSourceDirectory, 'apps');
const pathOfSourceDirectoryLogos = path.join(pathOfSourceDirectory, 'logos');
/**
* Creates a listing of apps for GET http://oneclickapps.caprover.com/v4
* {
"oneClickApps": [
{
"name": "adminer",
"displayName": "Adminer",
"description": "Adminer (formerly phpMinAdmin) is a full-featured database management tool written in PHP",
"isOfficial": true,
"logoUrl": "adminer.png"
},.....]}
*/
function createAppList(appsFileNames, pathOfApps) {
const apps = appsFileNames.filter(v => `${v}`.endsWith('.yml'));
if (apps.length !== appsFileNames.length) {
throw new Error('All files in v4 must end with .yml extension!');
}
const appDetails = [];
for (var i = 0; i < apps.length; i++) {
const contentString = fs.readFileSync(path.join(pathOfApps, apps[i]), 'utf-8');
const content = yaml.parse(contentString);
const captainVersion = `${content.captainVersion}`;
apps[i] = apps[i].replace('.yml', '');
const caproverOneClickApp = content.caproverOneClickApp;
if (captainVersion === '4') {
if (!caproverOneClickApp.displayName) {
caproverOneClickApp.displayName = apps[i];
caproverOneClickApp.displayName = caproverOneClickApp.displayName.substr(0, 1).toUpperCase() +
caproverOneClickApp.displayName.substring(1, caproverOneClickApp.displayName.length);
}
if (!caproverOneClickApp.description) caproverOneClickApp.description = '';
appDetails[i] = {
name: apps[i],
displayName: caproverOneClickApp.displayName,
description: caproverOneClickApp.description,
isOfficial: `${caproverOneClickApp.isOfficial}`.toLowerCase().trim() === 'true',
logoUrl: apps[i] + '.png'
};
} else {
throw new Error('Unknown captain-version: ' + captainVersion);
}
}
return {
appList: apps,
appDetails: appDetails
};
}
function convertV4toV2(v4String) {
const parsed = JSON.parse(v4String);
if (`${parsed.captainVersion}` !== '4') {
throw new Error('CaptainVersion must be 4 for this conversion');
}
function moveProperty(propertyName) {
parsed[propertyName] = parsed.caproverOneClickApp[propertyName];
}
parsed.dockerCompose = {
services: parsed.services
};
parsed.services = undefined;
parsed.captainVersion = 2;
moveProperty('variables');
moveProperty('instructions');
moveProperty('displayName');
moveProperty('isOfficial');
moveProperty('description');
moveProperty('documentation');
Object.keys(parsed.dockerCompose.services).forEach(serviceName => {
const service = parsed.dockerCompose.services[serviceName];
if (!service.caproverExtra) {
return;
}
if (service.caproverExtra.containerHttpPort) {
service.containerHttpPort = service.caproverExtra.containerHttpPort;
}
if (service.caproverExtra.dockerfileLines) {
service.dockerfileLines = service.caproverExtra.dockerfileLines;
}
if (service.caproverExtra.notExposeAsWebApp) {
service.notExposeAsWebApp = service.caproverExtra.notExposeAsWebApp;
}
service.caproverExtra = undefined;
});
parsed.caproverOneClickApp = undefined;
return parsed;
}
function buildDist() {
return fs.readdir(pathOfSourceDirectoryApps)
.then(function (appsFileNames) { // [ app1.yml app2.yml .... ]
appsFileNames.forEach(appFileName => {
console.log('Building dist for ' + appFileName);
const pathOfAppFileInSource = path.join(pathOfSourceDirectoryApps, appFileName);
const contentParsed = yaml.parse(fs.readFileSync(pathOfAppFileInSource, 'utf-8'));
//v4
fs.outputJsonSync(path.join(pathOfDistV4, `apps`, appFileName.split('.')[0]), contentParsed);
//v3
fs.outputJsonSync(path.join(pathOfDistV3, `apps`, appFileName.split('.')[0]), convertV4toV2(JSON.stringify(contentParsed)));
//v2
fs.outputJsonSync(path.join(pathOfDistV2, `apps`, appFileName.split('.')[0] + '.json'), convertV4toV2(JSON.stringify(contentParsed)));
});
fs.copySync(pathOfSourceDirectoryLogos, path.join(pathOfDistV2, `logos`));
fs.copySync(pathOfSourceDirectoryLogos, path.join(pathOfDistV3, `logos`));
fs.copySync(pathOfSourceDirectoryLogos, path.join(pathOfDistV4, `logos`));
const allAppsList = createAppList(appsFileNames, pathOfSourceDirectoryApps);
const v3List = {
oneClickApps: allAppsList.appDetails
};
// Remove once we are fully on V4
if (fs.existsSync(path.join(pathOfDistV3, 'list'))) {
const v3ListExisting = fs.readFileSync(path.join(pathOfDistV3, 'list'), 'utf-8');
if (v3ListExisting && JSON.parse(v3ListExisting).oneClickApps) {
v3List.oneClickApps = [...v3List.oneClickApps, ...JSON.parse(v3ListExisting).oneClickApps];
const names = {};
const list = [];
v3List.oneClickApps.forEach(a => {
if (!names[a.name]) {
list.push(a);
names[a.name] = true;
}
});
v3List.oneClickApps = list.sort(function (a, b) {
return `${a.name}`.localeCompare(b.name);
});
allAppsList.appList = list.map(l => l.name);
allAppsList.appDetails = v3List.oneClickApps;
}
}
fs.outputJsonSync(path.join(pathOfDistV2, 'autoGeneratedList.json'), allAppsList);
fs.outputJsonSync(path.join(pathOfDistV2, 'list'), v3List);
fs.outputJsonSync(path.join(pathOfDistV3, 'list'), v3List);
fs.outputJsonSync(path.join(pathOfDistV4, 'list'), v3List);
})
.then(function () {
return fs.copySync(path.join(pathOfPublic, 'CNAME'), path.join(pathOfDist, 'CNAME'));
});
}
Promise.resolve()
.then(function () {
return buildDist();
})
.catch(function (err) {
console.error(err);
process.exit(127);
});

View file

@ -1,111 +0,0 @@
/*jshint esversion: 6 */
const path = require('path');
const yaml = require('yaml');
const types = require('yaml/types');
const fs = require('fs-extra');
types.strOptions.fold.lineWidth = 0;
// Next, for V4:
// ============================================================================
// ============================================================================
// *********** THIS IS ONLY TO BE DONE AFTER CAPROVER 1.8 RELEASE *************
// ============================================================================
// ============================================================================
//
// 1- DUPLICATE this script. The new script is to ONLY read from /public/v4/*.yaml
// 2- Test with a new YAML file
// 3- Write script to convert all v2 JSON to V4 yaml and place them in /public/v4/*.yaml
// 4- Update readme!!!!
// 5- Push all 3 steps above at the same time to GITHUB
const pathOfPublic = path.join(__dirname, '..', `public`);
const pathOfDist = path.join(__dirname, '..', `dist`);
const pathOfDistV2 = path.join(pathOfDist, 'v2');
const pathOfDistV3 = path.join(pathOfDist, 'v3');
const pathOfDistV4 = path.join(pathOfDist, 'v4');
const pathOfSourceDirectoryV2 = path.join(pathOfPublic, 'v2');
const pathOfSourceDirectoryAppsV2 = path.join(pathOfSourceDirectoryV2, 'apps');
const pathOfSourceDirectoryLogosV2 = path.join(pathOfSourceDirectoryV2, 'logos');
function convertV2toV4(v2String) {
const parsed = JSON.parse(v2String);
if (`${parsed.captainVersion}` !== '2') {
throw new Error('CaptainVersion must be 2 for this conversion');
}
function moveProperty(propertyName) {
parsed.caproverOneClickApp[propertyName] = parsed[propertyName];
parsed[propertyName] = undefined;
}
parsed.services = parsed.dockerCompose.services;
parsed.dockerCompose = undefined;
parsed.captainVersion = 4;
parsed.caproverOneClickApp = {};
moveProperty('variables');
moveProperty('instructions');
moveProperty('displayName');
moveProperty('isOfficial');
moveProperty('description');
moveProperty('documentation');
Object.keys(parsed.services).forEach(serviceName => {
const service = parsed.services[serviceName];
if (service.containerHttpPort) {
service.caproverExtra = service.caproverExtra || {};
service.caproverExtra.containerHttpPort = service.containerHttpPort;
}
if (service.dockerfileLines) {
service.caproverExtra = service.caproverExtra || {};
service.caproverExtra.dockerfileLines = service.dockerfileLines;
}
if (service.notExposeAsWebApp) {
service.caproverExtra = service.caproverExtra || {};
service.caproverExtra.notExposeAsWebApp = service.notExposeAsWebApp;
}
service.containerHttpPort = undefined;
service.dockerfileLines = undefined;
service.notExposeAsWebApp = undefined;
});
return JSON.parse(JSON.stringify(parsed));
}
function buildDist() {
return fs.readdir(pathOfSourceDirectoryAppsV2)
.then(function (appsFileNames) { // [ app1.json app2.json .... ]
appsFileNames.forEach(appFileName => {
const pathOfAppFileInSource = path.join(pathOfSourceDirectoryAppsV2, appFileName);
//v4
const pathOfSourceDirectoryV4 = path.join(pathOfPublic, 'v4');
const contentString = fs.readFileSync(pathOfAppFileInSource);
fs.outputFileSync(path.join(pathOfSourceDirectoryV4, `apps`, appFileName.split('.')[0] + '.yml'), yaml.stringify(convertV2toV4(contentString)));
fs.moveSync(path.join(pathOfSourceDirectoryV2, `logos`, appFileName.split('.')[0] + '.png'),
path.join(pathOfSourceDirectoryV4, `logos`, appFileName.split('.')[0] + '.png'));
fs.removeSync(path.join(pathOfSourceDirectoryV2, `apps`, appFileName.split('.')[0] + '.json'));
});
});
}
Promise.resolve()
.then(function () {
return buildDist();
})
.catch(function (err) {
console.error(err);
process.exit(127);
});

View file

@ -1,90 +0,0 @@
#!/bin/bash
# FROM: https://raw.githubusercontent.com/maxheld83/ghpages/master/LICENSE
# MIT License
# Copyright (c) 2019 Maximilian Held
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
set -e
BUILD_DIR=dist
SOURCE_DIRECTORY_DEPLOY_GH=~/temp-gh-deploy-src
CLONED_DIRECTORY_DEPLOY_GH=~/temp-gh-deploy-cloned
echo "#############################################"
echo "######### making directories"
echo "######### $SOURCE_DIRECTORY_DEPLOY_GH"
echo "######### $CLONED_DIRECTORY_DEPLOY_GH"
echo "#############################################"
mkdir -p $SOURCE_DIRECTORY_DEPLOY_GH
mkdir -p $CLONED_DIRECTORY_DEPLOY_GH
echo "#############################################"
echo "######### Setting env vars"
echo "#############################################"
REMOTE_REPO="https://${GITHUB_PERSONAL_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
REPONAME="$(echo $GITHUB_REPOSITORY| cut -d'/' -f 2)"
OWNER="$(echo $GITHUB_REPOSITORY| cut -d'/' -f 1)"
GHIO="${OWNER}.github.io"
if [[ "$REPONAME" == "$GHIO" ]]; then
REMOTE_BRANCH="master"
else
REMOTE_BRANCH="gh-pages"
fi
sleep 1s
echo "#############################################"
echo "######### CLONING REMOTE_BRANCH: $REMOTE_BRANCH"
echo "#############################################"
cp -r $BUILD_DIR $SOURCE_DIRECTORY_DEPLOY_GH/
git clone --single-branch --branch=$REMOTE_BRANCH $REMOTE_REPO $CLONED_DIRECTORY_DEPLOY_GH
sleep 1s
echo "#############################################"
echo "######### Removing old files"
echo "#############################################"
cd $CLONED_DIRECTORY_DEPLOY_GH && git rm -rf . && git clean -fdx
sleep 1s
echo "#############################################"
echo "######### Copying files"
echo "#############################################"
cp -r $SOURCE_DIRECTORY_DEPLOY_GH/$BUILD_DIR $CLONED_DIRECTORY_DEPLOY_GH/$BUILD_DIR
mv $CLONED_DIRECTORY_DEPLOY_GH/.git $CLONED_DIRECTORY_DEPLOY_GH/$BUILD_DIR/
cd $CLONED_DIRECTORY_DEPLOY_GH/$BUILD_DIR/
sleep 1s
echo "#############################################"
echo "######### Content pre-commit ###"
echo "#############################################"
ls -la
echo "#############################################"
echo "######### Commit and push ###"
echo "#############################################"
sleep 1s
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
echo `date` >> forcebuild.date
git add -A
git commit -m 'Deploy to GitHub Pages'
git push $REMOTE_REPO $REMOTE_BRANCH:$REMOTE_BRANCH

View file

@ -1,149 +0,0 @@
/*jshint esversion: 6 */
const path = require('path');
const yaml = require('yaml');
const fs = require('fs-extra');
const PUBLIC = `public`;
const pathOfPublic = path.join(__dirname, '..', PUBLIC);
// validating version 4
function validateV4() {
const version = '4';
const pathOfVersion = path.join(pathOfPublic, 'v' + version);
const pathOfApps = path.join(pathOfVersion, 'apps');
return fs.readdir(pathOfApps)
.then(function (items) {
const apps = items.filter(v => v.includes('.yml'));
if (items.length !== apps.length) {
throw new Error('All files in v4 must end with .yml');
}
for (var i = 0; i < apps.length; i++) {
const contentString = fs.readFileSync(path.join(pathOfApps, apps[i]), 'utf-8');
const content = yaml.parse(contentString);
const captainVersion = (content.captainVersion + '');
const versionString = (version + '');
if (versionString !== captainVersion)
throw new Error(`unmatched versions ${versionString} ${captainVersion} for ${apps[i]}`);
apps[i] = apps[i].replace('.yml', '');
if (!content.caproverOneClickApp) {
throw new Error(`Cannot find caproverOneClickApp for ${apps[i]}`);
}
if (!content.caproverOneClickApp.description) {
throw new Error(`Cannot find description for ${apps[i]}`);
}
if (content.caproverOneClickApp.description.length > 200) {
throw new Error(`Description too long for ${apps[i]} - keep it below 200 chars`);
}
if (!content.caproverOneClickApp.instructions ||
!content.caproverOneClickApp.instructions.start ||
!content.caproverOneClickApp.instructions.end) {
throw new Error(`Cannot find instructions.start or instructions.end for ${apps[i]}`);
}
if (!content.services) {
throw new Error(`Cannot find services for ${apps[i]}`);
}
Object.keys(content.services).forEach(
(serviceName) => { // jshint ignore:line
const s = content.services[serviceName];
if (s.image && s.image.endsWith(':latest')) {
// throw new Error(`"latest" tag is not allowed as it can change and break the setup, see ${apps[i]}`);
}
});
const logoFileName = apps[i] + '.png';
const logoFullPath = path.join(pathOfVersion, 'logos', logoFileName);
if (!fs.existsSync(logoFullPath) ||
!fs.statSync(logoFullPath).isFile()) {
let printablePath = logoFullPath;
printablePath = printablePath.substr(printablePath.indexOf(`/${PUBLIC}`));
throw new Error(`Cannot find logo for ${apps[i]} ${printablePath}`);
}
console.log(`Validated ${apps[i]}`);
}
});
}
// validating version 2
function validateV2() {
const version = '2';
const pathOfVersion = path.join(pathOfPublic, 'v' + version);
const pathOfApps = path.join(pathOfVersion, 'apps');
if (!fs.existsSync(pathOfApps)) {
return;
}
return fs.readdir(pathOfApps)
.then(function (items) {
const apps = items.filter(v => v.includes('.json'));
if (items.length !== apps.length) {
throw new Error('All files in v2 must end with .json');
}
for (var i = 0; i < apps.length; i++) {
const contentString = fs.readFileSync(path.join(pathOfApps, apps[i]));
const content = JSON.parse(contentString);
const captainVersion = (content.captainVersion + '');
const versionString = (version + '');
if (versionString !== captainVersion)
throw new Error(`unmatched versions ${versionString} ${captainVersion} for ${apps[i]}`);
apps[i] = apps[i].replace('.json', '');
if (!content.description) {
throw new Error(`Cannot find description for ${apps[i]}`);
}
if (content.description.length > 200) {
throw new Error(`Description too long for ${apps[i]} - keep it below 200 chars`);
}
const logoFileName = apps[i] + '.png';
const logoFullPath = path.join(pathOfVersion, 'logos', logoFileName);
if (!fs.existsSync(logoFullPath) ||
!fs.statSync(logoFullPath).isFile()) {
let printablePath = logoFullPath;
printablePath = printablePath.substr(printablePath.indexOf(`/${PUBLIC}`));
throw new Error(`Cannot find logo for ${apps[i]} ${printablePath}`);
}
console.log(`Validated ${apps[i]}`);
}
});
}
Promise.resolve()
.then(function () {
return validateV2();
})
.then(function () {
return validateV4();
})
.catch(function (err) {
console.error(err);
process.exit(127);
});

View file

@ -0,0 +1 @@
{"captainVersion":2,"dockerCompose":{"services":{"$$cap_appname":{"volumes":["$$cap_appname-data:/space","$$cap_appname-pub:/space/pub"],"environment":{"SB_USER":"$$cap_sb_user"},"containerHttpPort":"3000","dockerfileLines":["FROM zefhemel/silverbullet"]},"$$cap_appname-pub":{"volumes":["$$cap_appname-pub:/docs"],"containerHttpPort":"3000","dockerfileLines":["FROM dannyben/madness","ENTRYPOINT [\"madness\", \"server\"]"]}}},"variables":[{"id":"$$cap_sb_user","label":"Authentication","defaultValue":"admin:ChangeThisPassword!!!","description":"Authentication is disabled if not set. This authentication does not apply to files in pub/"}],"instructions":{"start":"Make sure you change the authentication defaults","end":"Let me know if you encounter any issues: https://git.aly.pet/aly/caprover-apps"},"displayName":"Silverbullet.md","description":"SilverBullet is a note-taking application optimized for people with a hacker mindset.","documentation":"https://silverbullet.md/"}

View file

@ -0,0 +1 @@
{"appList":["silverbullet-pub"],"appDetails":[{"name":"silverbullet-pub","displayName":"Silverbullet.md","description":"SilverBullet is a note-taking application optimized for people with a hacker mindset.","isOfficial":false,"logoUrl":"silverbullet-pub.png"}]}

1
v2/list Normal file
View file

@ -0,0 +1 @@
{"oneClickApps":[{"name":"silverbullet-pub","displayName":"Silverbullet.md","description":"SilverBullet is a note-taking application optimized for people with a hacker mindset.","isOfficial":false,"logoUrl":"silverbullet-pub.png"}]}

View file

Before

Width:  |  Height:  |  Size: 239 KiB

After

Width:  |  Height:  |  Size: 239 KiB

1
v3/apps/silverbullet-pub Normal file
View file

@ -0,0 +1 @@
{"captainVersion":2,"dockerCompose":{"services":{"$$cap_appname":{"volumes":["$$cap_appname-data:/space","$$cap_appname-pub:/space/pub"],"environment":{"SB_USER":"$$cap_sb_user"},"containerHttpPort":"3000","dockerfileLines":["FROM zefhemel/silverbullet"]},"$$cap_appname-pub":{"volumes":["$$cap_appname-pub:/docs"],"containerHttpPort":"3000","dockerfileLines":["FROM dannyben/madness","ENTRYPOINT [\"madness\", \"server\"]"]}}},"variables":[{"id":"$$cap_sb_user","label":"Authentication","defaultValue":"admin:ChangeThisPassword!!!","description":"Authentication is disabled if not set. This authentication does not apply to files in pub/"}],"instructions":{"start":"Make sure you change the authentication defaults","end":"Let me know if you encounter any issues: https://git.aly.pet/aly/caprover-apps"},"displayName":"Silverbullet.md","description":"SilverBullet is a note-taking application optimized for people with a hacker mindset.","documentation":"https://silverbullet.md/"}

1
v3/list Normal file
View file

@ -0,0 +1 @@
{"oneClickApps":[{"name":"silverbullet-pub","displayName":"Silverbullet.md","description":"SilverBullet is a note-taking application optimized for people with a hacker mindset.","isOfficial":false,"logoUrl":"silverbullet-pub.png"}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB

1
v4/apps/silverbullet-pub Normal file
View file

@ -0,0 +1 @@
{"captainVersion":4,"services":{"$$cap_appname":{"caproverExtra":{"containerHttpPort":"3000","dockerfileLines":["FROM zefhemel/silverbullet"]},"volumes":["$$cap_appname-data:/space","$$cap_appname-pub:/space/pub"],"environment":{"SB_USER":"$$cap_sb_user"}},"$$cap_appname-pub":{"caproverExtra":{"containerHttpPort":"3000","dockerfileLines":["FROM dannyben/madness","ENTRYPOINT [\"madness\", \"server\"]"]},"volumes":["$$cap_appname-pub:/docs"]}},"caproverOneClickApp":{"variables":[{"id":"$$cap_sb_user","label":"Authentication","defaultValue":"admin:ChangeThisPassword!!!","description":"Authentication is disabled if not set. This authentication does not apply to files in pub/"}],"displayName":"Silverbullet.md","description":"SilverBullet is a note-taking application optimized for people with a hacker mindset.","documentation":"https://silverbullet.md/","instructions":{"start":"Make sure you change the authentication defaults","end":"Let me know if you encounter any issues: https://git.aly.pet/aly/caprover-apps"}}}

1
v4/list Normal file
View file

@ -0,0 +1 @@
{"oneClickApps":[{"name":"silverbullet-pub","displayName":"Silverbullet.md","description":"SilverBullet is a note-taking application optimized for people with a hacker mindset.","isOfficial":false,"logoUrl":"silverbullet-pub.png"}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB