Cannot wrap my head around plugs/env vars/etc

Sorry for probably very dumb questions, but I should ask anyway.

I spin my SilverBullet instance locally from a binary file on a Raspberry Pi. Since it has a free local Wlan0 IP, to lighten the mood, I decided to try configuring SilverBullet instead of a reverse proxy first. And then I totally lost my mind with the JSON configuration of plugs.

Maybe someone can look at this and tell me where I should dig to finally see that treeview x)

  • Should I use the same syntax as “config.set” like in the first into second code blocks? Or {} is just fine without a string?
    Do I need to have a local copy of the go-repo to be able to compile plugs?

The second part of my question is more about “production” of some sort. How to change env variables? Does it mean that my shell should have all those variables set up to be able to modify port/index page/url_prefix, etc? If I understand this correctly, is there any other way to set them, like params for binary (like with --port )?

Thank you for your answers and time. Sorry for the dumb questions.

I’m a bit confused here due to the wide range of questions. To be clear, your mention of wlan0 and reverse proxy don’t have anything to do with your questions, right?

config.set supports different ways of passing in arguments, one is a table with key/values, another to simply pass in a single key and value as string. So either is fine. I thought this was a cool idea at some point, but since believe it causes more confusion than that it really helps. The new default generated CONFIG base only uses the config.set("something", "value") format. As a side-note, none of this is JSON, it’s all in Lua syntax.

In general I’d now recommend to just use config.set("treeview", {...})

I’m going to assume this is an unrelated question. You do not need a clone of the silverbullet main repo (which contains everything, including the server and client). All you need is Deno installed, and then base your code off of GitHub - silverbulletmd/silverbullet-plug-template: Template for starting a new plug

A very limited set of options (like -p for port) is available as command line options, the vast majority is configured via env variables only. If you use the binary distribution and want to run your server in one go, you can just do something like this:

SB_INDEX_PAGE=Welcome SB_PORT=3001 silverbullet /path/to/my/space

Thank you so much for your swift answer! I am just a newbie to all of this stuff, so a lot of it gets me easily confused, and my questions are coming out of confusion. Sorry for misleading.

Yeah, sorry, that was just “setup description”. That part works perfectly fine as I would like to x)

Oh, thank you for the clarification (JSON Schema error checker get me confused). I formatted a bit of that config, added a few reboots, and magically everything works now! :wink: I hope I`ll get more knowledge about this software along the way.

1 Like