underpost 2.7.5 → 2.7.6
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.
- package/.env.development +0 -2
- package/.env.production +0 -2
- package/.env.test +0 -2
- package/.github/workflows/publish.yml +3 -3
- package/CHANGELOG.md +19 -57
- package/Dockerfile +1 -1
- package/README.md +1 -1
- package/bin/deploy.js +45 -0
- package/bin/index.js +1 -1
- package/docker-compose.yml +1 -1
- package/package.json +3 -8
- package/src/api/file/file.service.js +4 -0
- package/src/client/components/core/CommonJs.js +7 -0
- package/src/client/components/core/Docs.js +9 -7
- package/src/client/components/core/LoadingAnimation.js +1 -1
- package/src/client/ssr/body-components/CacheControl.js +1 -1
- package/src/index.js +1 -0
- package/src/server/client-icons.js +4 -2
- package/src/server/conf.js +29 -0
- package/startup.js +1 -1
- package/setup.sh +0 -25
package/.env.development
CHANGED
package/.env.production
CHANGED
package/.env.test
CHANGED
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
- uses: actions/checkout@v4
|
|
15
15
|
- uses: actions/setup-node@v4
|
|
16
16
|
with:
|
|
17
|
-
node-version: '
|
|
17
|
+
node-version: '22.x'
|
|
18
18
|
registry-url: 'https://registry.npmjs.org'
|
|
19
19
|
|
|
20
20
|
- name: Install Dependencies
|
|
@@ -25,7 +25,7 @@ jobs:
|
|
|
25
25
|
# Publish to npm
|
|
26
26
|
- uses: actions/setup-node@v4
|
|
27
27
|
with:
|
|
28
|
-
node-version: '
|
|
28
|
+
node-version: '22.x'
|
|
29
29
|
registry-url: 'https://registry.npmjs.org'
|
|
30
30
|
# Defaults to the user or organization that owns the workflow file
|
|
31
31
|
# scope: '@underpostnet'
|
|
@@ -38,7 +38,7 @@ jobs:
|
|
|
38
38
|
- name: Setup node to publish to GitHub Packages
|
|
39
39
|
uses: actions/setup-node@v4
|
|
40
40
|
with:
|
|
41
|
-
node-version:
|
|
41
|
+
node-version: 22.x
|
|
42
42
|
registry-url: 'https://npm.pkg.github.com'
|
|
43
43
|
# Defaults to the user or organization that owns the workflow file
|
|
44
44
|
scope: '@underpostnet'
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
#### [v2.7.2](https://github.com/underpostnet/engine/compare/v2.7.1...v2.7.2)
|
|
8
|
+
|
|
9
|
+
> 8 October 2024
|
|
10
|
+
|
|
11
|
+
- underpost panel advance [`60087d5`](https://github.com/underpostnet/engine/commit/60087d55920ae9ddf7d7a3396606088d028cc996)
|
|
12
|
+
- file explorer content ui ux refactor [`38e87a0`](https://github.com/underpostnet/engine/commit/38e87a0f0bd222e1d8c9d76904d086aa9d2125ea)
|
|
13
|
+
- add macro db restore logic [`9cfd41c`](https://github.com/underpostnet/engine/commit/9cfd41c5d7adcd309976e7d327af800ffcf92dac)
|
|
14
|
+
|
|
15
|
+
#### [v2.7.1](https://github.com/underpostnet/engine/compare/v2.6.3...v2.7.1)
|
|
16
|
+
|
|
17
|
+
> 19 September 2024
|
|
18
|
+
|
|
19
|
+
- update version 2.7.0 [`03c5c35`](https://github.com/underpostnet/engine/commit/03c5c35a71e7ffb35203a668bfa2f8e2f86125e0)
|
|
20
|
+
- update [`d410da6`](https://github.com/underpostnet/engine/commit/d410da62fadbbb841eb9dcfa5922f105d35ad81d)
|
|
21
|
+
- add changelog generator [`28b3256`](https://github.com/underpostnet/engine/commit/28b3256ab9cebaa9caf2b52426e48f0b3105c8b7)
|
|
22
|
+
|
|
7
23
|
#### [v2.6.3](https://github.com/underpostnet/engine/compare/v2.6.2...v2.6.3)
|
|
8
24
|
|
|
9
25
|
> 14 September 2024
|
|
@@ -12,80 +28,26 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
12
28
|
- update refactor docs and coverage [`b455016`](https://github.com/underpostnet/engine/commit/b455016f5f2b2bdc142aacb4dfd66ab890125662)
|
|
13
29
|
- update [`b8f01f2`](https://github.com/underpostnet/engine/commit/b8f01f258999c9ebc1173b0616f0f7b8f7171048)
|
|
14
30
|
|
|
15
|
-
#### [v2.6.2](https://github.com/underpostnet/engine/compare/v2.5.
|
|
31
|
+
#### [v2.6.2](https://github.com/underpostnet/engine/compare/v2.5.1...v2.6.2)
|
|
16
32
|
|
|
17
33
|
> 13 September 2024
|
|
18
34
|
|
|
19
35
|
- update version 2.6.2 [`0895afb`](https://github.com/underpostnet/engine/commit/0895afbde42dd5a573507ccfcb07c328648b4eb0)
|
|
20
|
-
- update [`344d303`](https://github.com/underpostnet/engine/commit/344d303702ebce22dff50d8c0f8d8d870a2860ee)
|
|
21
|
-
|
|
22
|
-
#### [v2.5.6](https://github.com/underpostnet/engine/compare/v2.5.2...v2.5.6)
|
|
23
|
-
|
|
24
|
-
> 13 September 2024
|
|
25
|
-
|
|
26
36
|
- update version 2.5.6 [`ca57b87`](https://github.com/underpostnet/engine/commit/ca57b87c56a544e7b7e53baa5a6e15415e16b99b)
|
|
27
37
|
- update [`eec4943`](https://github.com/underpostnet/engine/commit/eec49433f50b4dfa7b7bbff48891a60f5be25545)
|
|
28
|
-
- update [`5f0a6ac`](https://github.com/underpostnet/engine/commit/5f0a6aca1ae971bc42f654cf3f2bf7ace7fe613d)
|
|
29
|
-
|
|
30
|
-
#### [v2.5.2](https://github.com/underpostnet/engine/compare/v2.5.1...v2.5.2)
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- update dependebot security [`1289b96`](https://github.com/underpostnet/engine/commit/1289b9627dc59bf08e66edbef1bf7bf08e53984c)
|
|
35
|
-
- update [`ec11af8`](https://github.com/underpostnet/engine/commit/ec11af86e884ca3eeaeaa12695edddaa8b46492d)
|
|
36
|
-
- remove toast-ui [`40c207f`](https://github.com/underpostnet/engine/commit/40c207f13f3e6d7ab71fc4cc203ce6ff02101bb5)
|
|
37
|
-
|
|
38
|
-
#### [v2.5.1](https://github.com/underpostnet/engine/compare/v2.5.0...v2.5.1)
|
|
39
|
+
#### [v2.5.1](https://github.com/underpostnet/engine/compare/v2.0.0...v2.5.1)
|
|
39
40
|
|
|
40
41
|
> 27 August 2024
|
|
41
42
|
|
|
42
|
-
- refactor ssr [`4fa5d24`](https://github.com/underpostnet/engine/commit/4fa5d24531f791fa860a4ba38b9784491f084a68)
|
|
43
|
-
- bucket to document [`747cb0b`](https://github.com/underpostnet/engine/commit/747cb0bf5198e4b97df186e642413fa49ed9383f)
|
|
44
|
-
- add user control table managements [`2cfb710`](https://github.com/underpostnet/engine/commit/2cfb7103a591b941897ff3834ad5874565cba6b4)
|
|
45
|
-
|
|
46
|
-
#### [v2.5.0](https://github.com/underpostnet/engine/compare/v2.0.0...v2.5.0)
|
|
47
|
-
|
|
48
|
-
> 23 August 2024
|
|
49
|
-
|
|
50
43
|
- css refactor [`49b1904`](https://github.com/underpostnet/engine/commit/49b1904e83162f9066fbf843ced37d4e87db5581)
|
|
51
44
|
- refactor [`dad4f95`](https://github.com/underpostnet/engine/commit/dad4f9567629b737254702ce8be6b243e68fb01e)
|
|
52
45
|
- add sitemap builder [`53d05a6`](https://github.com/underpostnet/engine/commit/53d05a62d03ea327df3d37181a4b5c272d417289)
|
|
53
46
|
|
|
54
|
-
|
|
47
|
+
#### v2.0.0
|
|
55
48
|
|
|
56
49
|
> 30 March 2024
|
|
57
50
|
|
|
58
51
|
- seed-city assets [`6d9decb`](https://github.com/underpostnet/engine/commit/6d9decbae96b828aa001777f96dd75aab3fc71d1)
|
|
59
52
|
- update [`1069fc5`](https://github.com/underpostnet/engine/commit/1069fc5268aa5ef7c101695393de59edfc14daf8)
|
|
60
53
|
- update [`41ae7d4`](https://github.com/underpostnet/engine/commit/41ae7d4c969cce0608171c820e05ebab42610a7f)
|
|
61
|
-
|
|
62
|
-
#### [v1.0.4](https://github.com/underpostnet/engine/compare/v1.0.3...v1.0.4)
|
|
63
|
-
|
|
64
|
-
> 14 January 2023
|
|
65
|
-
|
|
66
|
-
- update [`8109700`](https://github.com/underpostnet/engine/commit/81097008baa95ac50efb760b228dc4abae63c379)
|
|
67
|
-
- update [`b6bb47f`](https://github.com/underpostnet/engine/commit/b6bb47f95bd56c0062066ecae5f03813cf1ed6f8)
|
|
68
|
-
- update [`15c0ca9`](https://github.com/underpostnet/engine/commit/15c0ca9f9a8203bec53a9677d5a8edcd04a7f1df)
|
|
69
|
-
|
|
70
|
-
#### [v1.0.3](https://github.com/underpostnet/engine/compare/v1.0.2...v1.0.3)
|
|
71
|
-
|
|
72
|
-
> 21 December 2022
|
|
73
|
-
|
|
74
|
-
- update [`69418ba`](https://github.com/underpostnet/engine/commit/69418ba34831983e07aa458d1ea4a742c7b66096)
|
|
75
|
-
- update [`003412f`](https://github.com/underpostnet/engine/commit/003412fadf3efe6b819f037e99855192f13ccd7e)
|
|
76
|
-
|
|
77
|
-
#### [v1.0.2](https://github.com/underpostnet/engine/compare/v1.0.1...v1.0.2)
|
|
78
|
-
|
|
79
|
-
> 21 December 2022
|
|
80
|
-
|
|
81
|
-
- update [`470f07a`](https://github.com/underpostnet/engine/commit/470f07a72398792ac9ecf07bf1ba5170bc427dc5)
|
|
82
|
-
- update [`dacc20a`](https://github.com/underpostnet/engine/commit/dacc20a14971388bcf2a5077286989a77197aadc)
|
|
83
|
-
- update [`d2efee0`](https://github.com/underpostnet/engine/commit/d2efee08f9b31dd9fca31a3b1b15bdaa0e75faea)
|
|
84
|
-
|
|
85
|
-
#### v1.0.1
|
|
86
|
-
|
|
87
|
-
> 11 October 2022
|
|
88
|
-
|
|
89
|
-
- update [`bd40237`](https://github.com/underpostnet/engine/commit/bd402372513151a15a972a7727f7d77d014739f1)
|
|
90
|
-
- update [`39dd3b9`](https://github.com/underpostnet/engine/commit/39dd3b9a5a6b4292b899840dd5cd333cc80410d1)
|
|
91
|
-
- First Commit [`ad7b2a3`](https://github.com/underpostnet/engine/commit/ad7b2a3be0746b34fa19ba896d3faa7f1b4f40dc)
|
package/Dockerfile
CHANGED
|
@@ -37,7 +37,7 @@ RUN apt-get install -yq --no-install-recommends \
|
|
|
37
37
|
gnupg
|
|
38
38
|
|
|
39
39
|
# install nodejs https://github.com/nodesource/distributions/blob/master/README.md#deb
|
|
40
|
-
RUN curl -fsSL https://deb.nodesource.com/
|
|
40
|
+
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
|
|
41
41
|
apt-get install -y nodejs \
|
|
42
42
|
build-essential && \
|
|
43
43
|
node --version && \
|
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ template
|
|
|
16
16
|
|
|
17
17
|
<div align="center">
|
|
18
18
|
|
|
19
|
-
<a target="_top" href='https://www.npmjs.com/package/npm/v/10.2.3' ><img alt='npm' src='https://img.shields.io/badge/npm v10.2.3-100000?style=flat&logo=npm&logoColor=white&labelColor=CB3837&color=727273'/></a> <a target="_top" href='https://nodejs.org/download/release/
|
|
19
|
+
<a target="_top" href='https://www.npmjs.com/package/npm/v/10.2.3' ><img alt='npm' src='https://img.shields.io/badge/npm v10.2.3-100000?style=flat&logo=npm&logoColor=white&labelColor=CB3837&color=727273'/></a> <a target="_top" href='https://nodejs.org/download/release/v22.9.0/' ><img alt='nodedotjs' src='https://img.shields.io/badge/node v22.9.0-100000?style=flat&logo=nodedotjs&logoColor=white&labelColor=5FA04E&color=727273'/></a> <a target="_top" href='https://pgp.mongodb.com/' ><img alt='mongodb' src='https://img.shields.io/badge/mongodb_server v7.0-100000?style=flat&logo=mongodb&logoColor=white&labelColor=47A248&color=727273'/></a>
|
|
20
20
|
|
|
21
21
|
</div>
|
|
22
22
|
|
package/bin/deploy.js
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
buildReplicaId,
|
|
26
26
|
Cmd,
|
|
27
27
|
restoreMacroDb,
|
|
28
|
+
fixDependencies,
|
|
28
29
|
} from '../src/server/conf.js';
|
|
29
30
|
import { buildClient } from '../src/server/client-build.js';
|
|
30
31
|
import { range, setPad, timer, uniqueArray } from '../src/client/components/core/CommonJs.js';
|
|
@@ -568,6 +569,9 @@ try {
|
|
|
568
569
|
fs.readFileSync(`./bin/index.js`, 'utf8').replaceAll(`${version}`, `${newVersion}`),
|
|
569
570
|
'utf8',
|
|
570
571
|
);
|
|
572
|
+
|
|
573
|
+
// only engine
|
|
574
|
+
// shellExec(`node bin/deploy update-package`);
|
|
571
575
|
}
|
|
572
576
|
break;
|
|
573
577
|
|
|
@@ -612,6 +616,47 @@ ${uniqueArray(logs.all.map((log) => `- ${log.author_name} ([${log.author_email}]
|
|
|
612
616
|
|
|
613
617
|
case 'lampp': {
|
|
614
618
|
await Lampp.install();
|
|
619
|
+
break;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
case 'heb': {
|
|
623
|
+
// https://besu.hyperledger.org/
|
|
624
|
+
// https://github.com/hyperledger/besu/archive/refs/tags/24.9.1.tar.gz
|
|
625
|
+
|
|
626
|
+
switch (process.platform) {
|
|
627
|
+
case 'linux':
|
|
628
|
+
{
|
|
629
|
+
shellCd(`..`);
|
|
630
|
+
|
|
631
|
+
// Download the Linux binary
|
|
632
|
+
shellExec(`wget https://github.com/hyperledger/besu/releases/download/24.9.1/besu-24.9.1.tar.gz`);
|
|
633
|
+
|
|
634
|
+
// Unzip the file:
|
|
635
|
+
shellExec(`tar -xvzf besu-24.9.1.tar.gz`);
|
|
636
|
+
|
|
637
|
+
shellCd(`besu-24.9.1`);
|
|
638
|
+
|
|
639
|
+
shellExec(`bin/besu --help`);
|
|
640
|
+
|
|
641
|
+
// Set env path
|
|
642
|
+
// export PATH=$PATH:/dd/besu-24.9.1/bin
|
|
643
|
+
|
|
644
|
+
// Open src
|
|
645
|
+
// shellExec(`sudo code /dd/besu-24.9.1 --user-data-dir="/root/.vscode-root" --no-sandbox`);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
break;
|
|
649
|
+
|
|
650
|
+
default:
|
|
651
|
+
break;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
break;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
case 'fix-deps': {
|
|
658
|
+
await fixDependencies();
|
|
659
|
+
break;
|
|
615
660
|
}
|
|
616
661
|
|
|
617
662
|
default:
|
package/bin/index.js
CHANGED
package/docker-compose.yml
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"main": "src/index.js",
|
|
4
4
|
"name": "underpost",
|
|
5
|
-
"version": "2.7.
|
|
5
|
+
"version": "2.7.6",
|
|
6
6
|
"description": "pwa api rest template",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
|
|
@@ -39,10 +39,7 @@
|
|
|
39
39
|
"url": "git+https://github.com/underpostnet/pwa-microservices-template.git"
|
|
40
40
|
},
|
|
41
41
|
"keywords": [
|
|
42
|
-
"
|
|
43
|
-
"template",
|
|
44
|
-
"microservices",
|
|
45
|
-
"api",
|
|
42
|
+
"engine",
|
|
46
43
|
"server",
|
|
47
44
|
"proxy",
|
|
48
45
|
"client"
|
|
@@ -57,7 +54,6 @@
|
|
|
57
54
|
"@fortawesome/fontawesome-free": "^6.4.2",
|
|
58
55
|
"@loadingio/css-spinner": "^2.0.2",
|
|
59
56
|
"@neodrag/vanilla": "^2.0.3",
|
|
60
|
-
"@pinata/sdk": "^2.1.0",
|
|
61
57
|
"@xenova/transformers": "^2.17.2",
|
|
62
58
|
"adm-zip": "^0.5.10",
|
|
63
59
|
"ag-grid-community": "31.0.0",
|
|
@@ -114,12 +110,11 @@
|
|
|
114
110
|
"simple-git": "^3.26.0",
|
|
115
111
|
"simple-icons": "^13.9.0",
|
|
116
112
|
"sitemap": "^7.1.1",
|
|
117
|
-
"socket.io": "^4.
|
|
113
|
+
"socket.io": "^4.8.0",
|
|
118
114
|
"sortablejs": "^1.15.0",
|
|
119
115
|
"split-file": "^2.3.0",
|
|
120
116
|
"swagger-ui-express": "^5.0.0",
|
|
121
117
|
"systeminformation": "^5.21.17",
|
|
122
|
-
"text-to-image": "^5.2.0",
|
|
123
118
|
"uglify-js": "^3.17.4",
|
|
124
119
|
"validator": "^13.11.0",
|
|
125
120
|
"winston": "^3.11.0"
|
|
@@ -681,6 +681,12 @@ function rgbToHex(rgb) {
|
|
|
681
681
|
|
|
682
682
|
const getCapVariableName = (value = 'default') => cap(value.replaceAll('-', ' ')).replaceAll(' ', '');
|
|
683
683
|
|
|
684
|
+
const hexToNumber = (hex = 0xdc) => Number(hex) || parseFloat(hex, 16);
|
|
685
|
+
|
|
686
|
+
// 0x = Hexadecimal
|
|
687
|
+
// 0b = Binary
|
|
688
|
+
// 0o = Octal
|
|
689
|
+
|
|
684
690
|
export {
|
|
685
691
|
s4,
|
|
686
692
|
range,
|
|
@@ -732,4 +738,5 @@ export {
|
|
|
732
738
|
componentFromStr,
|
|
733
739
|
rgbToHex,
|
|
734
740
|
getCapVariableName,
|
|
741
|
+
hexToNumber,
|
|
735
742
|
};
|
|
@@ -63,7 +63,7 @@ const Docs = {
|
|
|
63
63
|
icon: html`<i class="fa-brands fa-osi"></i>`,
|
|
64
64
|
text: 'Source Docs',
|
|
65
65
|
url: function () {
|
|
66
|
-
return `${getProxyPath()}docs/engine/2.7.
|
|
66
|
+
return `${getProxyPath()}docs/engine/2.7.6`;
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
{
|
|
@@ -82,9 +82,10 @@ const Docs = {
|
|
|
82
82
|
return `${getProxyPath()}docs/coverage`;
|
|
83
83
|
},
|
|
84
84
|
themeEvent: () => {
|
|
85
|
-
s(`.doc-icon-coverage`)
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
if (s(`.doc-icon-coverage`))
|
|
86
|
+
s(`.doc-icon-coverage`).src = `https://cdn.simpleicons.org/coveralls/${rgbToHex(
|
|
87
|
+
window.getComputedStyle(s('html')).color,
|
|
88
|
+
)}`;
|
|
88
89
|
},
|
|
89
90
|
},
|
|
90
91
|
{
|
|
@@ -95,9 +96,10 @@ const Docs = {
|
|
|
95
96
|
return `https://coveralls.io/github/underpostnet/engine`;
|
|
96
97
|
},
|
|
97
98
|
themeEvent: () => {
|
|
98
|
-
s(`.doc-icon-coverage-link`)
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
if (s(`.doc-icon-coverage-link`))
|
|
100
|
+
s(`.doc-icon-coverage-link`).src = `https://cdn.simpleicons.org/coveralls/${rgbToHex(
|
|
101
|
+
window.getComputedStyle(s('html')).color,
|
|
102
|
+
)}`;
|
|
101
103
|
},
|
|
102
104
|
},
|
|
103
105
|
].concat(
|
|
@@ -109,6 +109,6 @@ SrrComponent = ({ ttiLoadTimeLimit }) => {
|
|
|
109
109
|
const CacheControl = ${CacheControl};
|
|
110
110
|
CacheControl({ ttiLoadTimeLimit: ${ttiLoadTimeLimit ? ttiLoadTimeLimit : 1000 * 70 * 1} });
|
|
111
111
|
</script>
|
|
112
|
-
<div class="clean-cache-container">v2.7.
|
|
112
|
+
<div class="clean-cache-container">v2.7.6</div>
|
|
113
113
|
`;
|
|
114
114
|
};
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { favicons } from 'favicons';
|
|
2
|
-
|
|
2
|
+
// TODO: search alternatives
|
|
3
|
+
// import textToImage from 'text-to-image';
|
|
3
4
|
import { loggerFactory } from './logger.js';
|
|
4
5
|
import fs from 'fs-extra';
|
|
5
6
|
import { png3x } from 'font-awesome-assets';
|
|
@@ -52,7 +53,7 @@ const defaultBaseTextImgOptionsSizes = {
|
|
|
52
53
|
|
|
53
54
|
const buildTextImg = async (text = 'APP', options, size = '1200x1200') => {
|
|
54
55
|
options = { ...defaultBaseTextImgOptions, ...defaultBaseTextImgOptionsSizes[size], ...options };
|
|
55
|
-
await textToImage.generate(text, options);
|
|
56
|
+
// await textToImage.generate(text, options);
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
const getBufferPngText = async ({ text, textColor, bgColor, size, debugFilename }) => {
|
|
@@ -62,6 +63,7 @@ const getBufferPngText = async ({ text, textColor, bgColor, size, debugFilename
|
|
|
62
63
|
if (!size) size = '100x300';
|
|
63
64
|
if (!debugFilename) debugFilename = `./${s4()}${s4()}${s4()}.png`;
|
|
64
65
|
await buildTextImg(text, { textColor, bgColor, size, debugFilename }, size);
|
|
66
|
+
if (!fs.existsSync(debugFilename)) return Buffer.alloc(0); // Return empty buffer if file not found
|
|
65
67
|
const bufferImage = fs.readFileSync(debugFilename);
|
|
66
68
|
fs.removeSync(debugFilename);
|
|
67
69
|
return bufferImage;
|
package/src/server/conf.js
CHANGED
|
@@ -12,6 +12,16 @@ import { DefaultConf } from '../../conf.js';
|
|
|
12
12
|
import ncp from 'copy-paste';
|
|
13
13
|
import read from 'read';
|
|
14
14
|
import splitFile from 'split-file';
|
|
15
|
+
import axios from 'axios';
|
|
16
|
+
import https from 'https';
|
|
17
|
+
|
|
18
|
+
// axios.defaults.baseURL = BASE_URL;
|
|
19
|
+
|
|
20
|
+
const httpsAgent = new https.Agent({
|
|
21
|
+
rejectUnauthorized: false,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
axios.defaults.httpsAgent = httpsAgent;
|
|
15
25
|
|
|
16
26
|
colors.enable();
|
|
17
27
|
dotenv.config();
|
|
@@ -585,6 +595,7 @@ const validateTemplatePath = (absolutePath = '') => {
|
|
|
585
595
|
) {
|
|
586
596
|
return false;
|
|
587
597
|
}
|
|
598
|
+
if (absolutePath.match('hardhat/')) return false;
|
|
588
599
|
if (
|
|
589
600
|
absolutePath.match('/client') &&
|
|
590
601
|
absolutePath.match('.index.js') &&
|
|
@@ -829,6 +840,23 @@ const Cmd = {
|
|
|
829
840
|
syncPorts: (deployGroupId) => `node bin/deploy sync-env-port ${deployGroupId}`,
|
|
830
841
|
};
|
|
831
842
|
|
|
843
|
+
const fixDependencies = async () => {
|
|
844
|
+
// sed -i "$line_number s,.*,$new_text," "$file"
|
|
845
|
+
// sed -i "$line_number c \\$new_text" "$file"
|
|
846
|
+
const dep = fs.readFileSync(`./node_modules/peer/dist/module.mjs`, 'utf8');
|
|
847
|
+
const errorLine = `import {WebSocketServer as $hSjDC$WebSocketServer} from "ws";`;
|
|
848
|
+
|
|
849
|
+
fs.writeFileSync(
|
|
850
|
+
`./node_modules/peer/dist/module.mjs`,
|
|
851
|
+
dep.replaceAll(
|
|
852
|
+
errorLine,
|
|
853
|
+
`import WebSocketServer from "ws";
|
|
854
|
+
let $hSjDC$WebSocketServer = WebSocketServer.Server;`,
|
|
855
|
+
),
|
|
856
|
+
'utf8',
|
|
857
|
+
);
|
|
858
|
+
};
|
|
859
|
+
|
|
832
860
|
export {
|
|
833
861
|
Cmd,
|
|
834
862
|
Config,
|
|
@@ -857,4 +885,5 @@ export {
|
|
|
857
885
|
getCronBackUpFolder,
|
|
858
886
|
getRestoreCronCmd,
|
|
859
887
|
mergeBackUp,
|
|
888
|
+
fixDependencies,
|
|
860
889
|
};
|
package/startup.js
CHANGED
package/setup.sh
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
sudo apt update
|
|
2
|
-
sudo apt upgrade
|
|
3
|
-
|
|
4
|
-
# Install the MongoDB 4.4 GPG key:
|
|
5
|
-
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
|
|
6
|
-
|
|
7
|
-
# Add the source location for the MongoDB packages:
|
|
8
|
-
# echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
|
|
9
|
-
echo "deb [ arch=arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
|
|
10
|
-
|
|
11
|
-
# Download the package details for the MongoDB packages:
|
|
12
|
-
sudo apt-get update
|
|
13
|
-
|
|
14
|
-
# Install MongoDB:
|
|
15
|
-
sudo apt-get install -y mongodb-org
|
|
16
|
-
# sudo apt-get install mongodb
|
|
17
|
-
|
|
18
|
-
# Ensure mongod config is picked up:
|
|
19
|
-
sudo systemctl daemon-reload
|
|
20
|
-
|
|
21
|
-
# Tell systemd to run mongod on reboot:
|
|
22
|
-
sudo systemctl enable mongod
|
|
23
|
-
|
|
24
|
-
# Start up mongod!
|
|
25
|
-
sudo systemctl start mongod
|