After updating deno and silverbullet today (and setting it up as systemd-service), I now get this error:
ReferenceError: window is not defined
Silverbullet output
Using KV as a database backend (/opt/silverbullet/.silverbullet.db).
Going to start SilverBullet binding to 127.0.0.1:3000
SilverBullet will only be available locally, to allow outside connections, pass -L0.0.0.0 as a flag, and put a TLS terminator on top.
Using local disk as a storage backend: /opt/silverbullet
Unhandled rejection: PromiseRejectionEvent {
bubbles: false,
cancelable: true,
composed: false,
currentTarget: Window {},
defaultPrevented: false,
eventPhase: 2,
srcElement: null,
target: Window {},
returnValue: true,
timeStamp: 0,
type: "unhandledrejection",
promise: Promise {
<rejected> ReferenceError: window is not defined
at IV.hashSHA256 (https://get.silverbullet.md/:87:33860)
at IV.init (https://get.silverbullet.md/:87:33272)
at eventLoopTick (ext:core/01_core.js:175:7)
at async zX.init (https://get.silverbullet.md/:2384:18073)
at async rX.start (https://get.silverbullet.md/:2385:7437)
at async F.gj [as actionHandler] (https://get.silverbullet.md/:2385:13469244)
at async F.execute (https://get.silverbullet.md/:24:8601)
at async F.parseCommand (https://get.silverbullet.md/:24:6314)
at async https://get.silverbullet.md/:2418:6541
},
reason: ReferenceError: window is not defined
at IV.hashSHA256 (https://get.silverbullet.md/:87:33860)
at IV.init (https://get.silverbullet.md/:87:33272)
at eventLoopTick (ext:core/01_core.js:175:7)
at async zX.init (https://get.silverbullet.md/:2384:18073)
at async rX.start (https://get.silverbullet.md/:2385:7437)
at async F.gj [as actionHandler] (https://get.silverbullet.md/:2385:13469244)
at async F.execute (https://get.silverbullet.md/:24:8601)
at async F.parseCommand (https://get.silverbullet.md/:24:6314)
at async https://get.silverbullet.md/:2418:6541
}
My start script is:
#!/bin/bash
exec /home/silverbullet/.deno/bin/deno run --allow-all --unstable-kv --unstable-worker-options --no-config 'https://get.silverbullet.md/' "/opt/silverbullet" --user "username:password"
The working start script is:
#!/bin/sh
exec deno run --allow-all --unstable-kv --unstable-worker-options --no-config 'https://get.silverbullet.md/' "$@"
The only difference is the used shell and the user with password.
And it works when only specifying the directory, but doesnt work specifying the user and password
[Update 1]
The problem seems to have been the order of arguments:
When I passed the --user before the folder, it worked. Passing the --user after the folder doesnt work anymore.
[Update 2]
It worked once, but when trying to start it again, it didnt work anymore.
[Update 3]
It only works when I dont use the --user argument. For now I solved it by not setting a silverbullet, but an apache2 authentication check.