miolo 3.0.0-beta.150 → 3.0.0-beta.151
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/package.json +1 -1
- package/src/server.mjs +5 -5
- package/template/.env +21 -15
- package/template/.env.production +19 -6
- package/template/package.json +3 -3
- package/template/src/server/utils/pwdfor.mjs +29 -0
package/package.json
CHANGED
package/src/server.mjs
CHANGED
|
@@ -10,12 +10,12 @@ import { init_rate_limit_middleware } from './middleware/http/ratelimit.mjs
|
|
|
10
10
|
import { init_static_middleware } from './middleware/static/index.mjs'
|
|
11
11
|
import { init_request_middleware } from './middleware/http/request.mjs'
|
|
12
12
|
import { init_route_robots } from './middleware/routes/robots.mjs'
|
|
13
|
-
import { init_route_catch_js_error}
|
|
13
|
+
import { init_route_catch_js_error } from './middleware/routes/catch_js_error.mjs'
|
|
14
14
|
|
|
15
|
-
import {init_guest_auth_middleware}
|
|
16
|
-
import {init_basic_auth_middleware}
|
|
17
|
-
import {init_credentials_auth_middleware}
|
|
18
|
-
import {init_custom_auth_middleware}
|
|
15
|
+
import { init_guest_auth_middleware } from './middleware/auth/guest.mjs'
|
|
16
|
+
import { init_basic_auth_middleware } from './middleware/auth/basic.mjs'
|
|
17
|
+
import { init_credentials_auth_middleware }from './middleware/auth/credentials/index.mjs'
|
|
18
|
+
import { init_custom_auth_middleware } from './middleware/auth/custom.mjs'
|
|
19
19
|
|
|
20
20
|
import { init_extra_middlewares } from './middleware/extra.mjs'
|
|
21
21
|
import { init_router } from './middleware/routes/router/index.mjs'
|
package/template/.env
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
#
|
|
2
|
-
#
|
|
2
|
+
# General
|
|
3
3
|
#
|
|
4
|
+
|
|
4
5
|
MIOLO_NAME=miolo-sample
|
|
5
6
|
MIOLO_INTRE_LOCALE=es
|
|
6
7
|
|
|
7
8
|
#
|
|
8
9
|
# HTTP
|
|
9
10
|
#
|
|
11
|
+
|
|
10
12
|
MIOLO_PORT=8001
|
|
11
13
|
MIOLO_HOSTNAME=localhost
|
|
12
14
|
MIOLO_HOSTNAME_DOCKER=0.0.0.0
|
|
@@ -19,46 +21,47 @@ MIOLO_REQUEST_SLOW=4 # seconds to consider slow a request
|
|
|
19
21
|
MIOLO_GEOIP_ENABLED=true
|
|
20
22
|
MIOLO_GEOIP_LOCAL_IPS=127.0.0.1,172.22.0.1,172.19.0.1
|
|
21
23
|
|
|
22
|
-
|
|
23
24
|
#
|
|
24
25
|
# Session
|
|
25
26
|
#
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
MIOLO_SESSION_SALT=00000000-0000-0000-0000-000000000000
|
|
29
|
+
MIOLO_SESSION_SECRET=00000000-0000-0000-0000-000000000000
|
|
28
30
|
MIOLO_SESSION_MAX_AGE=864000000
|
|
29
31
|
MIOLO_SESSION_SECURE=false
|
|
30
32
|
MIOLO_SESSION_RENEW=true
|
|
31
33
|
MIOLO_SESSION_SAME_SITE=strict # lax | strict
|
|
32
34
|
|
|
33
|
-
|
|
34
35
|
#
|
|
35
36
|
# Database
|
|
36
37
|
#
|
|
38
|
+
|
|
37
39
|
MIOLO_DB_DIALECT=postgres
|
|
38
|
-
MIOLO_DB_DATABASE=miolo
|
|
40
|
+
MIOLO_DB_DATABASE=miolo-sample
|
|
39
41
|
MIOLO_DB_USER=postgres
|
|
40
42
|
MIOLO_DB_PASSWORD=postgres
|
|
41
43
|
|
|
42
|
-
|
|
43
44
|
#
|
|
44
45
|
# Logging
|
|
45
46
|
#
|
|
47
|
+
|
|
46
48
|
MIOLO_LOG_LEVEL=info
|
|
47
49
|
MIOLO_LOG_CONSOLE_ENABLED=true
|
|
48
50
|
MIOLO_LOG_FILE_ENABLED=false
|
|
49
51
|
MIOLO_LOG_MAIL_ENABLED=false
|
|
50
52
|
#MIOLO_LOG_MAIL_LEVEL=warn
|
|
51
|
-
MIOLO_LOG_MAIL_FROM=miolo-sample@
|
|
52
|
-
MIOLO_LOG_MAIL_TO=
|
|
53
|
+
MIOLO_LOG_MAIL_FROM=miolo-sample@miolo-sample.com
|
|
54
|
+
MIOLO_LOG_MAIL_TO=miolo-sample@miolo-sample.com
|
|
53
55
|
|
|
54
56
|
#
|
|
55
57
|
# Mailer
|
|
56
58
|
#
|
|
59
|
+
|
|
57
60
|
MIOLO_MAILER_SILENT=true
|
|
58
|
-
MIOLO_MAILER_HOST=mail.
|
|
61
|
+
MIOLO_MAILER_HOST=mail.miolo-sample.com
|
|
59
62
|
MIOLO_MAILER_PORT=25
|
|
60
|
-
MIOLO_MAILER_FROM=miolo-sample@
|
|
61
|
-
MIOLO_MAILER_TO=
|
|
63
|
+
MIOLO_MAILER_FROM=miolo-sample@miolo-sample.com
|
|
64
|
+
MIOLO_MAILER_TO=miolo-sample@miolo-sample.com
|
|
62
65
|
|
|
63
66
|
# MIOLO_MAILER_AUTH_METHOD=PLAIN # PLAIN / LOGIN
|
|
64
67
|
# # If LOGIN, you need to specify:
|
|
@@ -68,25 +71,28 @@ MIOLO_MAILER_TO=devel@afialapis.com
|
|
|
68
71
|
#
|
|
69
72
|
# Cache
|
|
70
73
|
#
|
|
74
|
+
|
|
71
75
|
MIOLO_REDIS_HOSTNAME=127.0.0.1
|
|
72
76
|
MIOLO_REDIS_HOSTNAME_DOCKER=redis
|
|
73
77
|
MIOLO_REDIS_PORT=6379
|
|
74
78
|
|
|
75
79
|
MIOLO_CACHE_TYPE=redis
|
|
76
|
-
MIOLO_CACHE_VERSION=
|
|
77
|
-
MIOLO_CACHE_CALUSTRA_VERSION=
|
|
80
|
+
MIOLO_CACHE_VERSION=1
|
|
81
|
+
MIOLO_CACHE_CALUSTRA_VERSION=1
|
|
78
82
|
MIOLO_CACHE_CALUSTRA_TTL=86400000
|
|
79
|
-
MIOLO_CACHE_SESSION_VERSION=
|
|
83
|
+
MIOLO_CACHE_SESSION_VERSION=1
|
|
80
84
|
MIOLO_CACHE_SESSION_TTL=864000000
|
|
81
85
|
|
|
82
86
|
#
|
|
83
87
|
# Others
|
|
84
88
|
#
|
|
89
|
+
|
|
85
90
|
MIOLO_DOTENVX_DEBUG=false
|
|
86
91
|
|
|
87
92
|
#
|
|
88
93
|
# Build
|
|
89
94
|
#
|
|
95
|
+
|
|
90
96
|
MIOLO_BUILD_HTML_FILE=./src/cli/index.html
|
|
91
97
|
MIOLO_BUILD_CLIENT_ENTRY=./src/cli/entry-cli.jsx
|
|
92
98
|
MIOLO_BUILD_CLIENT_DEST=./build/cli
|
package/template/.env.production
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
#
|
|
1
2
|
# General
|
|
2
3
|
#
|
|
4
|
+
|
|
3
5
|
MIOLO_NAME=miolo-sample
|
|
4
6
|
MIOLO_INTRE_LOCALE=es
|
|
5
7
|
|
|
6
8
|
#
|
|
7
9
|
# HTTP
|
|
8
10
|
#
|
|
11
|
+
|
|
9
12
|
MIOLO_PORT=8001
|
|
10
13
|
MIOLO_HOSTNAME=localhost
|
|
11
14
|
MIOLO_HOSTNAME_DOCKER=0.0.0.0
|
|
@@ -21,37 +24,44 @@ MIOLO_GEOIP_LOCAL_IPS=127.0.0.1,172.22.0.1,172.19.0.1
|
|
|
21
24
|
#
|
|
22
25
|
# Session
|
|
23
26
|
#
|
|
27
|
+
|
|
24
28
|
MIOLO_SESSION_SALT=00000000-0000-0000-0000-000000000000
|
|
25
29
|
MIOLO_SESSION_SECRET=00000000-0000-0000-0000-000000000000
|
|
26
30
|
MIOLO_SESSION_MAX_AGE=864000000
|
|
27
31
|
MIOLO_SESSION_SECURE=false
|
|
28
32
|
MIOLO_SESSION_RENEW=true
|
|
29
33
|
MIOLO_SESSION_SAME_SITE=lax # lax | strict
|
|
34
|
+
|
|
30
35
|
#
|
|
31
36
|
# Database
|
|
32
37
|
#
|
|
33
|
-
|
|
38
|
+
|
|
39
|
+
MIOLO_DB_DIALECT=postgres
|
|
40
|
+
MIOLO_DB_DATABASE=miolo-sample
|
|
34
41
|
MIOLO_DB_USER=postgres
|
|
35
42
|
MIOLO_DB_PASSWORD=postgres
|
|
36
43
|
|
|
37
44
|
#
|
|
38
45
|
# Logging
|
|
39
46
|
#
|
|
47
|
+
|
|
40
48
|
MIOLO_LOG_LEVEL=info
|
|
41
49
|
MIOLO_LOG_CONSOLE_ENABLED=false
|
|
42
50
|
MIOLO_LOG_FILE_ENABLED=true
|
|
43
51
|
MIOLO_LOG_MAIL_ENABLED=true
|
|
44
52
|
MIOLO_LOG_MAIL_LEVEL=error
|
|
45
|
-
MIOLO_LOG_MAIL_FROM=miolo@
|
|
46
|
-
MIOLO_LOG_MAIL_TO=
|
|
53
|
+
MIOLO_LOG_MAIL_FROM=miolo-sample@miolo-sample.com
|
|
54
|
+
MIOLO_LOG_MAIL_TO=miolo-sample@miolo-sample.com
|
|
47
55
|
|
|
48
56
|
#
|
|
49
57
|
# Mailer
|
|
50
58
|
#
|
|
59
|
+
|
|
51
60
|
MIOLO_MAILER_SILENT=false
|
|
52
|
-
MIOLO_MAILER_HOST=mail.
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
MIOLO_MAILER_HOST=mail.miolo-sample.com
|
|
62
|
+
MIOLO_MAILER_PORT=25
|
|
63
|
+
MIOLO_MAILER_FROM=miolo-sample@miolo-sample.com
|
|
64
|
+
MIOLO_MAILER_TO=miolo-sample@miolo-sample.com
|
|
55
65
|
|
|
56
66
|
MIOLO_MAILER_PORT=465
|
|
57
67
|
MIOLO_MAILER_AUTH_METHOD=LOGIN
|
|
@@ -61,6 +71,7 @@ MIOLO_MAILER_SMTP_PASS=<pass>
|
|
|
61
71
|
#
|
|
62
72
|
# Cache
|
|
63
73
|
#
|
|
74
|
+
|
|
64
75
|
MIOLO_REDIS_HOSTNAME=127.0.0.1
|
|
65
76
|
MIOLO_REDIS_HOSTNAME_DOCKER=redis
|
|
66
77
|
MIOLO_REDIS_PORT=6379
|
|
@@ -75,11 +86,13 @@ MIOLO_CACHE_SESSION_TTL=864000000
|
|
|
75
86
|
#
|
|
76
87
|
# Others
|
|
77
88
|
#
|
|
89
|
+
|
|
78
90
|
MIOLO_DOTENVX_DEBUG=false
|
|
79
91
|
|
|
80
92
|
#
|
|
81
93
|
# Build
|
|
82
94
|
#
|
|
95
|
+
|
|
83
96
|
MIOLO_BUILD_HTML_FILE=./src/cli/index.html
|
|
84
97
|
MIOLO_BUILD_CLIENT_ENTRY=./src/cli/entry-cli.jsx
|
|
85
98
|
MIOLO_BUILD_CLIENT_DEST=./build/cli
|
package/template/package.json
CHANGED
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"intre": "^3.0.0-beta.3",
|
|
46
46
|
"joi": "^18.0.2",
|
|
47
47
|
"lucide-react": "^0.563.0",
|
|
48
|
-
"miolo-cli": "^3.0.0-beta.
|
|
49
|
-
"miolo-react": "^3.0.0-beta.
|
|
48
|
+
"miolo-cli": "^3.0.0-beta.151",
|
|
49
|
+
"miolo-react": "^3.0.0-beta.151",
|
|
50
50
|
"next-themes": "^0.4.6",
|
|
51
51
|
"radix-ui": "^1.4.3",
|
|
52
52
|
"react": "^19.2.4",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"tw-animate-css": "^1.4.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"miolo": "^3.0.0-beta.
|
|
63
|
+
"miolo": "^3.0.0-beta.151",
|
|
64
64
|
"sass-embedded": "^1.97.3",
|
|
65
65
|
"xeira": "^2.0.0-beta.10"
|
|
66
66
|
},
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { sha512 } from './crypt.mjs'
|
|
2
|
+
|
|
3
|
+
import fs from 'node:fs'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
|
|
7
|
+
function _loadSalt() {
|
|
8
|
+
let dir = path.dirname(fileURLToPath(import.meta.url))
|
|
9
|
+
while (dir !== path.parse(dir).root && !fs.existsSync(path.join(dir, 'package.json'))) {
|
|
10
|
+
dir = path.dirname(dir)
|
|
11
|
+
}
|
|
12
|
+
const env = fs.readFileSync(path.join(dir, '.env'), 'utf8')
|
|
13
|
+
return env.match(/^MIOLO_SESSION_SALT=(.*)$/m)?.[1]?.trim()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
async function _pwd_for() {
|
|
20
|
+
const args = process.argv.slice(2)
|
|
21
|
+
const pwd = args[0]
|
|
22
|
+
|
|
23
|
+
const salt = _loadSalt()
|
|
24
|
+
|
|
25
|
+
const cpwd = sha512(pwd, salt)
|
|
26
|
+
console.log([salt, cpwd])
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_pwd_for()
|