create-steedos-app 2.2.52-beta.6 → 2.2.53-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/LICENSE.txt +2 -5
  2. package/README.md +40 -2
  3. package/dist/create-app.d.ts +10 -0
  4. package/dist/default/README-template.md +32 -0
  5. package/dist/default/docker-compose.yml +29 -0
  6. package/dist/default/env +32 -0
  7. package/dist/default/gitignore +17 -0
  8. package/{templates → dist}/default/steedos-app/main/default/client/analytics.baidu.client.js +0 -0
  9. package/dist/default/steedos-app/package.json +6 -0
  10. package/{templates → dist}/default/steedos-app/package.service.js +0 -0
  11. package/dist/default/steedos.config.js +18 -0
  12. package/dist/gitignore +17 -0
  13. package/dist/helpers/examples.d.ts +12 -0
  14. package/dist/helpers/get-pkg-manager.d.ts +2 -0
  15. package/dist/helpers/git.d.ts +1 -0
  16. package/dist/helpers/install.d.ts +22 -0
  17. package/dist/helpers/is-folder-empty.d.ts +1 -0
  18. package/dist/helpers/is-online.d.ts +1 -0
  19. package/dist/helpers/is-writeable.d.ts +1 -0
  20. package/dist/helpers/make-dir.d.ts +3 -0
  21. package/dist/helpers/validate-pkg.d.ts +4 -0
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +385 -0
  24. package/package.json +35 -22
  25. package/createSteedosApp.js +0 -127
  26. package/index.js +0 -19
  27. package/templates/default/.scripts/env.sh +0 -7
  28. package/templates/default/.scripts/flush_cacher_db.js +0 -7
  29. package/templates/default/.scripts/setup.sh +0 -8
  30. package/templates/default/.scripts/tailscale.sh +0 -7
  31. package/templates/default/.scripts/tailscaled.sh +0 -6
  32. package/templates/default/.steedos/_package.json +0 -11
  33. package/templates/default/.steedos/steedos-packages.yml +0 -30
  34. package/templates/default/.steedos/yarn.lock +0 -35
  35. package/templates/default/.vscode/extensions.json +0 -5
  36. package/templates/default/.vscode/settings.json +0 -17
  37. package/templates/default/Dockerfile +0 -21
  38. package/templates/default/Dockerfile-codeserver +0 -37
  39. package/templates/default/README.md +0 -99
  40. package/templates/default/_package.json +0 -60
  41. package/templates/default/docker-compose.yml +0 -59
  42. package/templates/default/env +0 -35
  43. package/templates/default/gitignore +0 -35
  44. package/templates/default/gitpod.Dockerfile +0 -52
  45. package/templates/default/gitpod.yml +0 -47
  46. package/templates/default/index.js +0 -0
  47. package/templates/default/jsreport-app/_package.json +0 -16
  48. package/templates/default/jsreport-app/jsreport.config.json +0 -43
  49. package/templates/default/jsreport-app/server.js +0 -14
  50. package/templates/default/lerna.json +0 -10
  51. package/templates/default/moleculer.config.js +0 -268
  52. package/templates/default/node-red-app/LICENSE.txt +0 -706
  53. package/templates/default/node-red-app/README.md +0 -78
  54. package/templates/default/node-red-app/_package.json +0 -26
  55. package/templates/default/node-red-app/index.js +0 -137
  56. package/templates/default/node-red-app/public/css/simplegrid.css +0 -145
  57. package/templates/default/node-red-app/public/css/style.css +0 -482
  58. package/templates/default/node-red-app/public/favicon.ico +0 -0
  59. package/templates/default/node-red-app/public/first-run.html +0 -280
  60. package/templates/default/node-red-app/public/fonts/css.css +0 -224
  61. package/templates/default/node-red-app/public/images/progress-bar.png +0 -0
  62. package/templates/default/node-red-app/public/images/progress-left.png +0 -0
  63. package/templates/default/node-red-app/public/images/progress-middle.png +0 -0
  64. package/templates/default/node-red-app/public/images/progress-o-bar.png +0 -0
  65. package/templates/default/node-red-app/public/images/progress-o-left.png +0 -0
  66. package/templates/default/node-red-app/public/images/progress-o-middle.png +0 -0
  67. package/templates/default/node-red-app/public/images/progress-o-right.png +0 -0
  68. package/templates/default/node-red-app/public/images/progress-right.png +0 -0
  69. package/templates/default/node-red-app/public/images/spin.svg +0 -41
  70. package/templates/default/node-red-app/public/images/title-wave.png +0 -0
  71. package/templates/default/node-red-app/public/index.html +0 -220
  72. package/templates/default/node-red-app/public/scripts/jquery-1.11.2.min.js +0 -4
  73. package/templates/default/node-red-app/public/scripts/zxcvbn.js +0 -28
  74. package/templates/default/node-red-app/public/steedos.png +0 -0
  75. package/templates/default/node-red-app/red.js +0 -294
  76. package/templates/default/node-red-app/routers/health.js +0 -13
  77. package/templates/default/node-red-app/settings.js +0 -121
  78. package/templates/default/services/community.service.js +0 -19
  79. package/templates/default/services/enterprise.service.js +0 -26
  80. package/templates/default/services/sidecar-server.service.js +0 -7
  81. package/templates/default/steedos-app/README.md +0 -5
  82. package/templates/default/steedos-app/_package.json +0 -9
  83. package/templates/default/steedos-app/tsconfig.json +0 -74
  84. package/templates/default/steedos-config.yml +0 -95
  85. package/templates/default/steedos-packages/README.md +0 -1
  86. package/templates/default/steedos-packages/my-package/README.md +0 -3
  87. package/templates/default/steedos-packages/my-package/_package.json +0 -9
  88. package/templates/default/steedos-packages/my-package/main/default/client/analytics.baidu.client.js +0 -24
  89. package/templates/default/steedos-packages/my-package/package.service.js +0 -69
@@ -1,78 +0,0 @@
1
- <p align="center">
2
- <a href="https://cloud.ibm.com">
3
- <img src="https://cloud.ibm.com/media/docs/developer-appservice/resources/ibm-cloud.svg" height="100" alt="IBM Cloud">
4
- </a>
5
- </p>
6
- <p align="center">
7
- <a href="https://cloud.ibm.com">
8
- <img src="https://img.shields.io/badge/IBM%20Cloud-powered-blue.svg" alt="IBM Cloud">
9
- </a>
10
- <img src="https://img.shields.io/badge/platform-node-lightgrey.svg?style=flat" alt="platform">
11
- <img src="https://img.shields.io/badge/license-Apache2-blue.svg?style=flat" alt="Apache 2">
12
- </p>
13
-
14
-
15
- Node-RED IBM Cloud Starter Application
16
- ====================================
17
-
18
-
19
- ### Node-RED on IBM Cloud
20
-
21
- This repository is an example Node-RED application that can be deployed into
22
- IBM Cloud with only a couple clicks. Try it out for yourself right now by clicking:
23
-
24
- <p align="center">
25
- <a href="https://cloud.ibm.com/developer/appservice/starter-kits/nodered">
26
- <img src="https://cloud.ibm.com/devops/setup/deploy/button_x2.png" alt="Deploy to IBM Cloud">
27
- </a>
28
- </p>
29
-
30
- ### How does this work?
31
-
32
- When you click the button, you are taken to IBM Cloud where you get a pick a name
33
- for your application at which point the platform takes over, grabs the code from
34
- this repository and gets it deployed.
35
-
36
- It will automatically create an instance of the Cloudant service and bind it to
37
- your app. This is where your Node-RED instance will store its data.
38
-
39
- When you first access the application, you'll be asked to set some security options
40
- to ensure your flow editor remains secure from unauthorised access.
41
-
42
- It includes a set of default flows that are automatically deployed the first time
43
- Node-RED runs.
44
-
45
- ### Customising Node-RED
46
-
47
- This repository is here to be cloned, modified and re-used to allow anyone create
48
- their own Node-RED based application that can be quickly deployed to IBM Cloud.
49
-
50
- The default flows are stored in the `defaults` directory in the file called `flow.json`.
51
- When the application is first started, this flow is copied to the attached Cloudant
52
- instance. When a change is deployed from the editor, the version in cloudant will
53
- be updated - not this file.
54
-
55
- The web content you get when you go to the application's URL is stored under the
56
- `public` directory.
57
-
58
- Additional nodes can be added to the `package.json` file and all other Node-RED
59
- configuration settings can be set in `bluemix-settings.js`.
60
-
61
- If you do clone this repository, make sure you update this `README.md` file to point
62
- the `Deploy to IBM Cloud` button at your repository.
63
-
64
- If you want to change the name of the Cloudant instance that gets created, the memory
65
- allocated to the application or other deploy-time options, have a look in `manifest.yml`.
66
-
67
- ### Environment Variables
68
-
69
- The following environment variables can be used to configure the application:
70
-
71
- - `NODE_RED_STORAGE_NAME` - the Cloudant service name as exposed in `VCAP_SERVICES`
72
- - `NODE_RED_STORAGE_DB_NAME` - the name of the database to use on Cloudant
73
- - `NODE_RED_STORAGE_APP_NAME` - the prefix used in document names, allowing multiple instances
74
- to share the same database.
75
- - `NODE_RED_USERNAME`, `NODE_RED_PASSWORD` - if set, used to secure the editor
76
- - `NODE_RED_GUEST_ACCESS` - if the editor is secured, this will allow anonymous,
77
- read-only access
78
- - `NODE_RED_USE_APPMETRICS` - enables the appmetrics dashboard
@@ -1,26 +0,0 @@
1
- {
2
- "name": "node-red-app",
3
- "version": "2.1.60",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "start": "node --max-old-space-size=160 index.js --settings ./settings.js -v"
8
- },
9
- "dependencies": {
10
- "@steedos/node-red-contrib-mongodb-storage": "2.0.1",
11
- "@steedos/node-red-contrib-steedos": "2.0.1",
12
- "bcrypt": "^5.0.1",
13
- "body-parser": "1.x",
14
- "dotenv-flow": "^3.2.0",
15
- "express": "4.x",
16
- "http-shutdown": "1.2.2",
17
- "lodash": "^4.17.21",
18
- "moment": "^2.29.1",
19
- "mongoose": "^5.12.13",
20
- "node-red": "^1.3.5",
21
- "node-red-contrib-redis": "^1.3.9",
22
- "validator": "^13.6.0"
23
- },
24
- "author": "",
25
- "license": "ISC"
26
- }
@@ -1,137 +0,0 @@
1
- /**
2
- * Copyright 2017, 2019 IBM Corp.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- **/
16
- require('dotenv-flow').config(__dirname);
17
-
18
- var bcrypt = require("bcrypt");
19
- var util = require("util");
20
- var path = require("path");
21
- var RED = require('node-red');
22
-
23
- util.log("Starting Node-RED on Steedos bootstrap");
24
- util.log("Loading settings.js");
25
- var settings = require("./settings.js");
26
-
27
- if (!settings.adminAuth) {
28
- // No user-defined security
29
- var storage;
30
- if (settings.storageModule) {
31
- storage = settings.storageModule;
32
- } else {
33
- storage = require('./node_modules/@node-red/runtime/lib/storage/localfilesystem');
34
- }
35
- util.log("Loading application settings");
36
- storage.init(settings).then(storage.getSettings).then(runtimeSettings => {
37
- if (process.env.NODE_RED_USERNAME && process.env.NODE_RED_PASSWORD) {
38
- util.log("Enabling adminAuth using NODE_RED_USERNAME/NODE_RED_PASSWORD");
39
- var config = {
40
- adminAuth: {
41
- username: process.env.NODE_RED_USERNAME,
42
- password: bcrypt.hashSync(process.env.NODE_RED_PASSWORD, 8),
43
- allowAnonymous: (process.env.NODE_RED_GUEST_ACCESS === 'true')
44
- }
45
- };
46
-
47
- if (runtimeSettings.bluemixConfig && runtimeSettings.bluemixConfig.hasOwnProperty('adminAuth')) {
48
- delete runtimeSettings.bluemixConfig.adminAuth;
49
- storage.saveSettings(runtimeSettings).then(() => {
50
- startNodeRED(config);
51
- });
52
- } else {
53
- startNodeRED(config);
54
- }
55
- } else if (runtimeSettings.bluemixConfig) {
56
- util.log("Using runtime settings for adminAuth");
57
- startNodeRED(runtimeSettings.bluemixConfig);
58
- } else {
59
- util.log("Starting first-use setup");
60
- var server;
61
- var express = require('express');
62
- var bodyParser = require('body-parser');
63
- var app = express();
64
- app.use(bodyParser.json());
65
- app.get("/", function (req, res) {
66
- res.sendFile(path.join(__dirname, "public", "first-run.html"));
67
- });
68
- app.post("/setup", function (req, res) {
69
- if (req.body.adminAuth && req.body.adminAuth.password) {
70
- req.body.adminAuth.password = bcrypt.hashSync(req.body.adminAuth.password, 8);
71
- }
72
- runtimeSettings.bluemixConfig = req.body;
73
- util.log("Received first-use setup configuration");
74
- storage.saveSettings(runtimeSettings).then(() => {
75
- res.status(200).end();
76
- setTimeout(function () {
77
- util.log("Stopping first-use setup application");
78
- server.shutdown(() => {
79
- startNodeRED(req.body);
80
- });
81
- }, 1000);
82
- }).catch(err => {
83
- util.log("Failed to save configuration");
84
- util.log(err);
85
- res.status(200).end();
86
- });
87
- });
88
- app.use("/", express.static(path.join(__dirname, "public")));
89
-
90
- require('./routers/health')(app);
91
-
92
- var http = require('http');
93
- server = http.createServer(function (req, res) { app(req, res); });
94
- server = require('http-shutdown')(server);
95
- server.listen(settings.uiPort, settings.uiHost, function () { });
96
- util.log("Waiting for first-use setup to complete");
97
- util.log("Server now running at http://localhost:"+settings.uiPort);
98
- }
99
- }).catch(err => {
100
- console.log("Failed to initialize storage module");
101
- console.log(err);
102
- });
103
- } else {
104
- startNodeRED({});
105
- }
106
-
107
- function startNodeRED(config) {
108
- if (config.adminAuth && !settings.adminAuth) {
109
- util.log("Enabling adminAuth security - set NODE_RED_USERNAME and NODE_RED_PASSWORD to change credentials");
110
- settings.adminAuth = {
111
- type: "credentials",
112
- users: function (username) {
113
- if (config.adminAuth.username == username) {
114
- return Promise.resolve({ username: username, permissions: "*" });
115
- } else {
116
- return Promise.resolve(null);
117
- }
118
- },
119
- authenticate: function (username, password) {
120
- if (config.adminAuth.username === username && bcrypt.compareSync(password, config.adminAuth.password)) {
121
- return Promise.resolve({ username: username, permissions: "*" });
122
- } else {
123
- return Promise.resolve(null);
124
- }
125
- }
126
- };
127
- if ((process.env.NODE_RED_GUEST_ACCESS === 'true') || (process.env.NODE_RED_GUEST_ACCESS === undefined && config.adminAuth.allowAnonymous)) {
128
- util.log("Enabling anonymous read-only access - set NODE_RED_GUEST_ACCESS to 'false' to disable");
129
- settings.adminAuth.default = function () {
130
- return Promise.resolve({ anonymous: true, permissions: "read" });
131
- };
132
- } else {
133
- util.log("Disabled anonymous read-only access - set NODE_RED_GUEST_ACCESS to 'true' to enable");
134
- }
135
- }
136
- require('./red.js')(settings);
137
- }
@@ -1,145 +0,0 @@
1
- /*
2
- Simple Grid
3
- Learn More - http://dallasbass.com/simple-grid-a-lightweight-responsive-css-grid/
4
- Project Page - http://thisisdallas.github.com/Simple-Grid/
5
- Author - Dallas Bass
6
- Site - dallasbass.com
7
- */
8
-
9
- *, *:after, *:before {
10
- -webkit-box-sizing: border-box;
11
- -moz-box-sizing: border-box;
12
- box-sizing: border-box;
13
- }
14
-
15
- body {
16
- margin: 0px;
17
- }
18
-
19
- [class*='col-'] {
20
- float: left;
21
- padding-left: 17px;
22
- padding-right: 17px;
23
- }
24
-
25
- [class*='col-']:last-of-type {
26
- padding-right: 0px;
27
- }
28
- [class*='col-']:first-of-type {
29
- padding-left: 0px;
30
- }
31
-
32
- .grid {
33
- width: 100%;
34
- max-width: 1155px;
35
- min-width: 755px;
36
- margin: 0 auto;
37
- overflow: hidden;
38
- padding: 0px 75px 0 75px;
39
- }
40
-
41
- .grid:after {
42
- content: "";
43
- display: table;
44
- clear: both;
45
- }
46
-
47
-
48
- /* Content Columns */
49
-
50
- .col-1-1 {
51
- width: 100%;
52
- }
53
- .col-2-3, .col-8-12 {
54
- width: 66.66%;
55
- }
56
-
57
- .col-1-2, .col-6-12 {
58
- width: 50%;
59
- }
60
-
61
- .col-1-3, .col-4-12 {
62
- width: 33.33%;
63
- }
64
-
65
- .col-1-4, .col-3-12 {
66
- width: 25%;
67
- }
68
-
69
- .col-1-5 {
70
- width: 20%;
71
- }
72
-
73
- .col-1-6, .col-2-12 {
74
- width: 16.667%;
75
- }
76
-
77
- .col-1-7 {
78
- width: 14.28%;
79
- }
80
-
81
- .col-1-8 {
82
- width: 12.5%;
83
- }
84
-
85
- .col-1-9 {
86
- width: 11.1%;
87
- }
88
-
89
- .col-1-10 {
90
- width: 10%;
91
- }
92
-
93
- .col-1-11 {
94
- width: 9.09%;
95
- }
96
-
97
- .col-1-12 {
98
- width: 8.33%
99
- }
100
-
101
- /* Layout Columns */
102
-
103
- .col-11-12 {
104
- width: 91.66%
105
- }
106
-
107
- .col-10-12 {
108
- width: 83.333%;
109
- }
110
-
111
- .col-9-12 {
112
- width: 75%;
113
- }
114
-
115
- .col-5-12 {
116
- width: 41.66%;
117
- }
118
-
119
- .col-7-12 {
120
- width: 58.33%
121
- }
122
-
123
- @media handheld, only screen and (max-width: 767px) {
124
-
125
-
126
- .grid {
127
- width: 100%;
128
- min-width: 0;
129
- margin-left: 0px;
130
- margin-right: 0px;
131
- padding-left: 0px;
132
- padding-right: 0px;
133
- }
134
-
135
- [class*='col-'] {
136
- width: auto;
137
- float: none;
138
- margin-left: 0px;
139
- margin-right: 0px;
140
- margin-top: 10px;
141
- margin-bottom: 10px;
142
- padding-left: 20px !important;
143
- padding-right: 20px !important;
144
- }
145
- }