pinokiod 1.3.98 → 2.0.0

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.
@@ -16,8 +16,6 @@ class C {
16
16
  => cloudflared tunnel --url http://localhost:8080
17
17
  */
18
18
 
19
- console.log("*tunnel", req.params)
20
-
21
19
  let pipe_uri
22
20
  if (req.params.passcode) {
23
21
  // 1. start a pipe server => needed for authentication
@@ -293,11 +293,9 @@ const init_folders = async (homedir) => {
293
293
 
294
294
  // Get the actual environment variable at specific path
295
295
  const get2 = async (filepath, kernel) => {
296
- console.log("Get2")
297
296
  let api_path = Util.api_path(filepath, kernel)
298
297
  let default_env = await get(kernel.homedir)
299
298
  let api_env = await get(api_path)
300
- console.log({ api_path, default_env, api_env, process_env: process.env })
301
299
  let current_env = Object.assign({}, process.env, default_env, api_env)
302
300
  return current_env
303
301
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "1.3.98",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
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
- let log = `\r\n[${event.time}] Login from ${event.ip} | ${event.agent}\r\n`
60
- console.log(log)
61
- // this.kernel.api.ondata({
62
- // id: scriptPath,
63
- // type: "notify",
64
- // data: {
65
- // html: `<div><h6>${event.time}</h6><div>IP: ${event.ip}</div>`
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: yellow(log)
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;
@@ -389,6 +389,7 @@ document.addEventListener("DOMContentLoaded", async () => {
389
389
  if (packet.data.type) {
390
390
  payload.type = packet.data.type
391
391
  }
392
+ payload.silent = packet.data.silent
392
393
  payload.callbacks = {
393
394
  onClick: () => {
394
395
  let params = packet.data
@@ -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>