pinokiod 1.3.98 → 1.3.99
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/kernel/util.js +2 -0
- package/package.json +1 -1
- package/pipe/index.js +15 -11
- package/server/index.js +1 -0
- package/server/views/fullscreen_editor.ejs +1 -0
- package/server/views/settings.ejs +9 -9
- package/server/views/share_editor.ejs +2 -2
package/kernel/util.js
CHANGED
|
@@ -87,6 +87,7 @@ const escapeStringRegexp = (string) => {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
const update_env = async (filepath, changes) => {
|
|
90
|
+
console.log("update_env", { filepath, changes })
|
|
90
91
|
const env = await fs.promises.readFile(filepath, "utf8")
|
|
91
92
|
let append = false;
|
|
92
93
|
const newval = Object.keys(changes).reduce((result, varname) => {
|
|
@@ -95,6 +96,7 @@ const update_env = async (filepath, changes) => {
|
|
|
95
96
|
.replace(returnPattern, returnReplacement)
|
|
96
97
|
.trim();
|
|
97
98
|
const safeName = escapeStringRegexp(varname);
|
|
99
|
+
console.log({ value, safeName, result, varname })
|
|
98
100
|
const varPattern = new RegExp(`^(${h}*${safeName}${h}*=${h}*)\\S*(${h}*)$`, "gm");
|
|
99
101
|
if (varPattern.test(result)) {
|
|
100
102
|
const safeValue = value.replace(groupPattern, groupReplacement);
|
package/package.json
CHANGED
package/pipe/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { createProxyMiddleware } = require('http-proxy-middleware');
|
|
2
|
-
const { yellow, green, blue } = require('kleur');
|
|
2
|
+
const { red, yellow, green, blue } = require('kleur');
|
|
3
3
|
|
|
4
4
|
const path = require('path')
|
|
5
5
|
const { createHttpTerminator } = require('http-terminator')
|
|
@@ -56,21 +56,25 @@ class Pipe {
|
|
|
56
56
|
ip,
|
|
57
57
|
agent
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
this.kernel.api.ondata({
|
|
60
|
+
id: scriptPath,
|
|
61
|
+
type: "notify",
|
|
62
|
+
data: {
|
|
63
|
+
silent: true,
|
|
64
|
+
html: `<div><b>[${password}] ${event.ip}</b><br><div>${event.time}</div><div>${event.agent}</div>`
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
let passcode_log = red(password)
|
|
69
|
+
let timestamp_log = yellow(event.time)
|
|
70
|
+
let ip_log = blue(event.ip)
|
|
71
|
+
let browser_log = event.agent
|
|
68
72
|
this.kernel.api.ondata({
|
|
69
73
|
type: "stream",
|
|
70
74
|
kernel: true,
|
|
71
75
|
id: scriptPath,
|
|
72
76
|
data: {
|
|
73
|
-
raw:
|
|
77
|
+
raw: `\r\n[${passcode_log}]\t${timestamp_log}\t${ip_log}\t${browser_log}\r\n`
|
|
74
78
|
}
|
|
75
79
|
})
|
|
76
80
|
req.session.authenticated = true;
|
package/server/index.js
CHANGED
|
@@ -1993,6 +1993,7 @@ class Server {
|
|
|
1993
1993
|
//let home = this.kernel.homedir
|
|
1994
1994
|
let home = this.kernel.store.get("home")
|
|
1995
1995
|
this.app.get("/", async (req, res) => {
|
|
1996
|
+
console.log("req", req)
|
|
1996
1997
|
if (req.query.mode !== "settings" && !home) {
|
|
1997
1998
|
res.redirect("/?mode=settings")
|
|
1998
1999
|
return
|
|
@@ -295,15 +295,6 @@ hr {
|
|
|
295
295
|
<i class="fa-solid fa-circle-notch fa-spin"></i> Stand by. Do not close this window..
|
|
296
296
|
</div>
|
|
297
297
|
<% if (locals.bin) { %>
|
|
298
|
-
<hr/>
|
|
299
|
-
<div class='advanced'>
|
|
300
|
-
<h1>Advanced Settings</h1>
|
|
301
|
-
<br>
|
|
302
|
-
<br>
|
|
303
|
-
<div>Edit the system ENVIRONMENT file to customize pinokio system wide settings, such as where files are stored, terminal behavior, etc.</div>
|
|
304
|
-
<br>
|
|
305
|
-
<a class='btn' href="/env"><i class="fa-regular fa-pen-to-square"></i> Edit ENVIRONMENT</a>
|
|
306
|
-
</div>
|
|
307
298
|
<hr/>
|
|
308
299
|
<div class='troubleshoot'>
|
|
309
300
|
<h1>Troubleshoot</h1>
|
|
@@ -352,6 +343,15 @@ hr {
|
|
|
352
343
|
</div>
|
|
353
344
|
</div>
|
|
354
345
|
<hr/>
|
|
346
|
+
<div class='advanced'>
|
|
347
|
+
<h1>Advanced Settings</h1>
|
|
348
|
+
<br>
|
|
349
|
+
<br>
|
|
350
|
+
<div>Edit the system ENVIRONMENT file to customize pinokio system wide settings, such as where files are stored, terminal behavior, etc.</div>
|
|
351
|
+
<br>
|
|
352
|
+
<a class='btn' href="/env"><i class="fa-regular fa-pen-to-square"></i> Edit ENVIRONMENT</a>
|
|
353
|
+
</div>
|
|
354
|
+
<hr/>
|
|
355
355
|
<% } %>
|
|
356
356
|
</div>
|
|
357
357
|
</div>
|
|
@@ -300,9 +300,9 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
300
300
|
</div>
|
|
301
301
|
<div class='env-item'>
|
|
302
302
|
<% if (config.PINOKIO_SHARE_LOCAL.toString() === "true") { %>
|
|
303
|
-
<input type="checkbox" id="PINOKIO_SHARE_LOCAL" name="local" checked />
|
|
303
|
+
<input type="checkbox" data-id="PINOKIO_SHARE_LOCAL" name="local" checked />
|
|
304
304
|
<% } else { %>
|
|
305
|
-
<input type="checkbox" id="PINOKIO_SHARE_LOCAL" name="local" />
|
|
305
|
+
<input type="checkbox" data-id="PINOKIO_SHARE_LOCAL" name="local" />
|
|
306
306
|
<% } %>
|
|
307
307
|
<label for="local"><i class="fa-solid fa-network-wired"></i> Share with Local Network</label>
|
|
308
308
|
<ul>
|