1
0
silverbullet/website/Install/Deno Deploy.md

36 lines
1.8 KiB
Markdown
Raw Normal View History

> **warning** Experimental
2023-12-15 17:58:12 +00:00
> This setup is not battle-tested, use it at your own risk
2023-07-24 09:40:32 +00:00
2023-12-19 11:58:18 +00:00
You can deploy SilverBullet to [Deno Deploy](https://deno.com/deploy) for free, and store space content in [Deno KV](https://deno.com/kv). This is a convenient option to deploy SilverBullet in the cloud, without having to run or pay for a server.
2023-05-24 04:11:52 +00:00
# Steps
Sign up for a (free) [Deno Deploy account](https://dash.deno.com/projects) and “Create an empty project” there.
2023-05-24 04:11:52 +00:00
2023-12-15 17:58:12 +00:00
Jump to the “Settings”, give your project a nicer name, and configure the following environment variables:
2023-05-24 04:11:52 +00:00
* `SB_FOLDER`: `db://`
* `SB_PORT`: `8000`
2023-12-15 17:58:12 +00:00
* `SB_SYNC_ONLY`: `1` (Deno Deploy does not currently support Workers, so running indexing etc. on the server will not work)
* `SB_USER`: (e.g. `pete:letmein`) — this is **super important** otherwise your space will be open to anybody without any authentication
* `SB_AUTH_TOKEN`: (Optional) If you would like to migrate existing content from elsewhere (e.g. a local folder) using [[Sync]], you will want to configure an authentication token here (pick something secure).
2023-05-24 04:11:52 +00:00
Make sure you have [installed Deno locally](https://docs.deno.com/runtime/manual/getting_started/installation) on your machine.
2023-05-24 04:11:52 +00:00
Then, install `deployctl` via:
2023-05-24 04:11:52 +00:00
```shell
$ deno install -Arf https://deno.land/x/deploy/deployctl.ts
```
2023-05-24 04:11:52 +00:00
To deploy, run:
2023-05-24 04:11:52 +00:00
```shell
2023-12-19 11:58:18 +00:00
$ deployctl deploy -p=your-project --entrypoint=https://silverbullet.md/silverbullet.js --include= --prod
2023-05-24 04:11:52 +00:00
```
2023-12-19 11:58:18 +00:00
This will ask you to authenticate with your Deno Deploy account, and then deploy SilverBullet.
# Migrating and backing up content
2023-12-19 11:58:18 +00:00
This setup stores you [[Spaces]] content in Denos KV database, which is still a beta feature and not specifically designed for this purpose. Therefore its recommended to use something like [[Sync]] to make backups elsewhere.
2023-12-19 11:58:18 +00:00
For this, be sure to also configure a `SB_AUTH_TOKEN` variable.