Live updates to a read-only instance?

I am wondering if it’s possible to create two instances of SB pointed at the same directory, where one instance supports edits and the other is read-only. This seems like a simple way of hosting a blog.

But I tried this and I keep getting “failed to update read-only database” errors from the read-only SB instance.

It seems that maybe each space directory can only support one SB instance at a time. Is that true?

If so, is the recommended workflow to somehow continuously replicate from one source to the read-only replica?

I think you will have issues because the db is in the root of the space. And you need two different db for two different instances.

One solution would be to have the read-only instance in a sub-directory of your admin instance. I saw someone with a setup like this in the forum.

Other possible solutions would be to use some containers volume mapping to point different db on the host system while using the same path in both containers.

1 Like

This is currently how im using silverbullet. You can take a look at my blog.

However, i found some issues with the original method of accessing the admin site. You can read the issue i was having here. Essentially, the admin side can’t be password protected. I removed the admin route in nginx and removed the environment user/pass. I then setup cloudflare tunnel access to get to the admin on localhost. I’m in the process of redoing that blog with this current admin solution.

For now, you can check out this video that i used to setup my admin side. This one is good too. There are some other good videos as well that describe the same setup. I set mine up to only allow my email and authentication is through github. It’s worth mentioning that if you are running silverbullet in docker, when you setup cloudflare tunnel, do not do the docker setup for that. Install cloudflare tunnel locally on your host. It will save you hours of pulling your hair out troubleshooting the complexities of docker network routing. I did eventually find a way, but i wouldnt recommend it to others due to it being a very new feature docker has added, and im not too familiar with how well its supported.