underpost 2.8.872 → 2.8.873
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 +2 -1
- package/.env.production +2 -1
- package/.env.test +2 -1
- package/.github/workflows/ghpkg.ci.yml +1 -1
- package/.github/workflows/npmpkg.ci.yml +1 -1
- package/.github/workflows/pwa-microservices-template-page.cd.yml +1 -1
- package/.github/workflows/pwa-microservices-template-test.ci.yml +1 -1
- package/.github/workflows/release.cd.yml +2 -4
- package/README.md +22 -2
- package/bin/build.js +4 -0
- package/bin/deploy.js +4 -0
- package/cli.md +3 -2
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +138 -0
- package/manifests/deployment/dd-test-development/proxy.yaml +26 -0
- package/package.json +5 -1
- package/src/api/core/core.router.js +2 -1
- package/src/api/default/default.controller.js +6 -1
- package/src/api/default/default.router.js +6 -2
- package/src/api/default/default.service.js +10 -1
- package/src/api/file/file.router.js +2 -1
- package/src/api/test/test.router.js +1 -1
- package/src/api/user/postman_collection.json +216 -0
- package/src/api/user/user.controller.js +25 -60
- package/src/api/user/user.model.js +29 -7
- package/src/api/user/user.router.js +6 -3
- package/src/api/user/user.service.js +80 -32
- package/src/cli/baremetal.js +33 -3
- package/src/cli/cloud-init.js +11 -0
- package/src/cli/deploy.js +5 -2
- package/src/cli/index.js +1 -0
- package/src/cli/lxd.js +7 -0
- package/src/cli/run.js +17 -5
- package/src/cli/ssh.js +20 -6
- package/src/client/components/core/AgGrid.js +28 -6
- package/src/client/components/core/Auth.js +98 -55
- package/src/client/components/core/LogIn.js +16 -23
- package/src/client/components/core/LogOut.js +5 -1
- package/src/client/components/core/Pagination.js +202 -9
- package/src/client/components/core/Router.js +30 -3
- package/src/client/components/core/SignUp.js +1 -2
- package/src/client/components/default/LogInDefault.js +0 -6
- package/src/client/components/default/LogOutDefault.js +0 -16
- package/src/client/services/core/core.service.js +5 -1
- package/src/client/services/default/default.management.js +115 -18
- package/src/client/services/default/default.service.js +9 -4
- package/src/client/services/user/user.management.js +6 -0
- package/src/client/services/user/user.service.js +11 -4
- package/src/index.js +24 -2
- package/src/runtime/lampp/Lampp.js +89 -2
- package/src/runtime/xampp/Xampp.js +48 -1
- package/src/server/auth.js +518 -155
- package/src/server/conf.js +19 -1
- package/src/server/runtime.js +62 -228
- package/src/server/ssr.js +85 -0
- package/src/server/valkey.js +2 -1
|
@@ -13,6 +13,7 @@ const UserManagement = {
|
|
|
13
13
|
add: role === 'admin',
|
|
14
14
|
remove: role === 'admin',
|
|
15
15
|
},
|
|
16
|
+
usePagination: true,
|
|
16
17
|
columnDefs: [
|
|
17
18
|
{ field: 'username', headerName: 'username', editable: role === 'admin' },
|
|
18
19
|
{ field: 'email', headerName: 'email', editable: role === 'admin' },
|
|
@@ -44,6 +45,11 @@ const UserManagement = {
|
|
|
44
45
|
],
|
|
45
46
|
defaultColKeyFocus: 'username',
|
|
46
47
|
ServiceProvider: UserService,
|
|
48
|
+
serviceOptions: {
|
|
49
|
+
get: {
|
|
50
|
+
id: 'all',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
47
53
|
});
|
|
48
54
|
},
|
|
49
55
|
};
|
|
@@ -36,9 +36,15 @@ const UserService = {
|
|
|
36
36
|
return reject(error);
|
|
37
37
|
}),
|
|
38
38
|
),
|
|
39
|
-
get: (options = { id: '' }) =>
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
get: (options = { id: '', page: 1, limit: 10 }) => {
|
|
40
|
+
const { id = '', page, limit } = options;
|
|
41
|
+
const query = new URLSearchParams();
|
|
42
|
+
if (page) query.set('page', page);
|
|
43
|
+
if (limit) query.set('limit', limit);
|
|
44
|
+
const queryString = query.toString();
|
|
45
|
+
const url = `${getApiBaseUrl({ id, endpoint })}${queryString ? (id.includes('?') ? '&' : '?') + queryString : ''}`;
|
|
46
|
+
return new Promise((resolve, reject) =>
|
|
47
|
+
fetch(url, {
|
|
42
48
|
method: 'GET',
|
|
43
49
|
headers: headersFactory(),
|
|
44
50
|
})
|
|
@@ -53,7 +59,8 @@ const UserService = {
|
|
|
53
59
|
logger.error(error);
|
|
54
60
|
return reject(error);
|
|
55
61
|
}),
|
|
56
|
-
)
|
|
62
|
+
);
|
|
63
|
+
},
|
|
57
64
|
delete: (options = { id: '', body: {} }) =>
|
|
58
65
|
new Promise((resolve, reject) =>
|
|
59
66
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
package/src/index.js
CHANGED
|
@@ -35,7 +35,7 @@ class Underpost {
|
|
|
35
35
|
* @type {String}
|
|
36
36
|
* @memberof Underpost
|
|
37
37
|
*/
|
|
38
|
-
static version = 'v2.8.
|
|
38
|
+
static version = 'v2.8.873';
|
|
39
39
|
/**
|
|
40
40
|
* Repository cli API
|
|
41
41
|
* @static
|
|
@@ -171,6 +171,28 @@ const up = Underpost;
|
|
|
171
171
|
|
|
172
172
|
const underpost = Underpost;
|
|
173
173
|
|
|
174
|
-
export {
|
|
174
|
+
export {
|
|
175
|
+
underpost,
|
|
176
|
+
up,
|
|
177
|
+
Underpost,
|
|
178
|
+
UnderpostBaremetal,
|
|
179
|
+
UnderpostCloudInit,
|
|
180
|
+
UnderpostCluster,
|
|
181
|
+
UnderpostCron,
|
|
182
|
+
UnderpostDB,
|
|
183
|
+
UnderpostDeploy,
|
|
184
|
+
UnderpostRootEnv,
|
|
185
|
+
UnderpostFileStorage,
|
|
186
|
+
UnderpostImage,
|
|
187
|
+
UnderpostLxd,
|
|
188
|
+
UnderpostMonitor,
|
|
189
|
+
UnderpostRepository,
|
|
190
|
+
UnderpostRun,
|
|
191
|
+
UnderpostScript,
|
|
192
|
+
UnderpostSecret,
|
|
193
|
+
UnderpostSSH,
|
|
194
|
+
UnderpostTest,
|
|
195
|
+
UnderpostStartUp,
|
|
196
|
+
};
|
|
175
197
|
|
|
176
198
|
export default Underpost;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
|
-
import { shellCd, shellExec } from '../../server/process.js';
|
|
3
|
-
import { timer } from '../../client/components/core/CommonJs.js';
|
|
2
|
+
import { getRootDirectory, shellCd, shellExec } from '../../server/process.js';
|
|
4
3
|
import { loggerFactory } from '../../server/logger.js';
|
|
5
4
|
|
|
6
5
|
const logger = loggerFactory(import.meta);
|
|
@@ -107,6 +106,94 @@ const Lampp = {
|
|
|
107
106
|
break;
|
|
108
107
|
}
|
|
109
108
|
},
|
|
109
|
+
createApp: async ({ port, host, path, directory, rootHostPath, redirect, redirectTarget }) => {
|
|
110
|
+
if (!Lampp.enabled()) return { disabled: true };
|
|
111
|
+
if (!Lampp.ports.includes(port)) Lampp.ports.push(port);
|
|
112
|
+
if (currentPort === initPort) Lampp.removeRouter();
|
|
113
|
+
Lampp.appendRouter(`
|
|
114
|
+
Listen ${port}
|
|
115
|
+
|
|
116
|
+
<VirtualHost *:${port}>
|
|
117
|
+
DocumentRoot "${directory ? directory : `${getRootDirectory()}${rootHostPath}`}"
|
|
118
|
+
ServerName ${host}:${port}
|
|
119
|
+
|
|
120
|
+
<Directory "${directory ? directory : `${getRootDirectory()}${rootHostPath}`}">
|
|
121
|
+
Options Indexes FollowSymLinks MultiViews
|
|
122
|
+
AllowOverride All
|
|
123
|
+
Require all granted
|
|
124
|
+
</Directory>
|
|
125
|
+
|
|
126
|
+
${
|
|
127
|
+
redirect
|
|
128
|
+
? `
|
|
129
|
+
RewriteEngine on
|
|
130
|
+
|
|
131
|
+
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge
|
|
132
|
+
RewriteRule ^(.*)$ ${redirectTarget}%{REQUEST_URI} [R=302,L]
|
|
133
|
+
`
|
|
134
|
+
: ''
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
ErrorDocument 400 ${path === '/' ? '' : path}/400.html
|
|
138
|
+
ErrorDocument 404 ${path === '/' ? '' : path}/400.html
|
|
139
|
+
ErrorDocument 500 ${path === '/' ? '' : path}/500.html
|
|
140
|
+
ErrorDocument 502 ${path === '/' ? '' : path}/500.html
|
|
141
|
+
ErrorDocument 503 ${path === '/' ? '' : path}/500.html
|
|
142
|
+
ErrorDocument 504 ${path === '/' ? '' : path}/500.html
|
|
143
|
+
|
|
144
|
+
</VirtualHost>
|
|
145
|
+
|
|
146
|
+
`);
|
|
147
|
+
// ERR too many redirects:
|
|
148
|
+
// Check: SELECT * FROM database.wp_options where option_name = 'siteurl' or option_name = 'home';
|
|
149
|
+
// Check: wp-config.php
|
|
150
|
+
// if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
|
|
151
|
+
// $_SERVER['HTTPS'] = 'on';
|
|
152
|
+
// }
|
|
153
|
+
// For plugins:
|
|
154
|
+
// define( 'FS_METHOD', 'direct' );
|
|
155
|
+
|
|
156
|
+
// ErrorDocument 404 /custom_404.html
|
|
157
|
+
// ErrorDocument 500 /custom_50x.html
|
|
158
|
+
// ErrorDocument 502 /custom_50x.html
|
|
159
|
+
// ErrorDocument 503 /custom_50x.html
|
|
160
|
+
// ErrorDocument 504 /custom_50x.html
|
|
161
|
+
|
|
162
|
+
// Respond When Error Pages are Directly Requested
|
|
163
|
+
|
|
164
|
+
// <Files "custom_404.html">
|
|
165
|
+
// <If "-z %{ENV:REDIRECT_STATUS}">
|
|
166
|
+
// RedirectMatch 404 ^/custom_404.html$
|
|
167
|
+
// </If>
|
|
168
|
+
// </Files>
|
|
169
|
+
|
|
170
|
+
// <Files "custom_50x.html">
|
|
171
|
+
// <If "-z %{ENV:REDIRECT_STATUS}">
|
|
172
|
+
// RedirectMatch 404 ^/custom_50x.html$
|
|
173
|
+
// </If>
|
|
174
|
+
// </Files>
|
|
175
|
+
|
|
176
|
+
// Add www or https with htaccess rewrite
|
|
177
|
+
|
|
178
|
+
// Options +FollowSymLinks
|
|
179
|
+
// RewriteEngine On
|
|
180
|
+
// RewriteCond %{HTTP_HOST} ^ejemplo.com [NC]
|
|
181
|
+
// RewriteRule ^(.*)$ http://ejemplo.com/$1 [R=301,L]
|
|
182
|
+
|
|
183
|
+
// Redirect http to https with htaccess rewrite
|
|
184
|
+
|
|
185
|
+
// RewriteEngine On
|
|
186
|
+
// RewriteCond %{SERVER_PORT} 80
|
|
187
|
+
// RewriteRule ^(.*)$ https://www.ejemplo.com/$1 [R,L]
|
|
188
|
+
|
|
189
|
+
// Redirect to HTTPS with www subdomain
|
|
190
|
+
|
|
191
|
+
// RewriteEngine On
|
|
192
|
+
// RewriteCond %{HTTPS} off [OR]
|
|
193
|
+
// RewriteCond %{HTTP_HOST} ^www\. [NC]
|
|
194
|
+
// RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
|
|
195
|
+
// RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
|
|
196
|
+
},
|
|
110
197
|
};
|
|
111
198
|
|
|
112
199
|
export { Lampp };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
|
-
import { shellExec } from '../../server/process.js';
|
|
2
|
+
import { shellExec, getRootDirectory } from '../../server/process.js';
|
|
3
3
|
|
|
4
4
|
const Xampp = {
|
|
5
5
|
ports: [],
|
|
@@ -31,6 +31,53 @@ const Xampp = {
|
|
|
31
31
|
this.router = undefined;
|
|
32
32
|
if (fs.existsSync(`./tmp/xampp-router.conf`)) fs.rmSync(`./tmp/xampp-router.conf`);
|
|
33
33
|
},
|
|
34
|
+
createApp: async ({ port, host, path, directory, rootHostPath, redirect, redirectTarget }) => {
|
|
35
|
+
if (!Xampp.enabled()) {
|
|
36
|
+
return { disabled: true };
|
|
37
|
+
}
|
|
38
|
+
if (!Xampp.ports.includes(port)) Xampp.ports.push(port);
|
|
39
|
+
if (currentPort === initPort) Xampp.removeRouter();
|
|
40
|
+
Xampp.appendRouter(`
|
|
41
|
+
Listen ${port}
|
|
42
|
+
|
|
43
|
+
<VirtualHost *:${port}>
|
|
44
|
+
DocumentRoot "${directory ? directory : `${getRootDirectory()}${rootHostPath}`}"
|
|
45
|
+
ServerName ${host}:${port}
|
|
46
|
+
|
|
47
|
+
<Directory "${directory ? directory : `${getRootDirectory()}${rootHostPath}`}">
|
|
48
|
+
Options Indexes FollowSymLinks MultiViews
|
|
49
|
+
AllowOverride All
|
|
50
|
+
Require all granted
|
|
51
|
+
</Directory>
|
|
52
|
+
|
|
53
|
+
${
|
|
54
|
+
redirect
|
|
55
|
+
? `
|
|
56
|
+
RewriteEngine on
|
|
57
|
+
|
|
58
|
+
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge
|
|
59
|
+
RewriteRule ^(.*)$ ${redirectTarget}%{REQUEST_URI} [R=302,L]
|
|
60
|
+
`
|
|
61
|
+
: ''
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
ErrorDocument 400 ${path === '/' ? '' : path}/400.html
|
|
65
|
+
ErrorDocument 404 ${path === '/' ? '' : path}/400.html
|
|
66
|
+
ErrorDocument 500 ${path === '/' ? '' : path}/500.html
|
|
67
|
+
ErrorDocument 502 ${path === '/' ? '' : path}/500.html
|
|
68
|
+
ErrorDocument 503 ${path === '/' ? '' : path}/500.html
|
|
69
|
+
ErrorDocument 504 ${path === '/' ? '' : path}/500.html
|
|
70
|
+
|
|
71
|
+
</VirtualHost>
|
|
72
|
+
|
|
73
|
+
`);
|
|
74
|
+
// ERR too many redirects:
|
|
75
|
+
// Check: SELECT * FROM database.wp_options where option_name = 'siteurl' or option_name = 'home';
|
|
76
|
+
// Check: wp-config.php
|
|
77
|
+
// if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
|
|
78
|
+
// $_SERVER['HTTPS'] = 'on';
|
|
79
|
+
// }
|
|
80
|
+
},
|
|
34
81
|
};
|
|
35
82
|
|
|
36
83
|
export { Xampp };
|