From a2e165fa851c951e8730e8c17e9505a6ad081677 Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 03:22:47 +0200 Subject: [PATCH 1/8] create environment variables --- .env | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..7e3d4a3 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +DIRECTORY= ~/space +PORT=3000 \ No newline at end of file From 61625772795238337d6181b1ec7a31160ee2080b Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 03:23:27 +0200 Subject: [PATCH 2/8] create dockerfile --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b672517 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:slim + +RUN mkdir /space +RUN chown node:node /space +USER node +WORKDIR /space + +EXPOSE 3000 + +CMD ["sh","-c","npx --yes @silverbulletmd/server --port 3000 /space"] \ No newline at end of file From d6398d7d89c9fee0e40ad2f6f8855d2d76ef84ff Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 03:24:51 +0200 Subject: [PATCH 3/8] create docker compose --- docker-compose.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..4ff35c7 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + sb: + build: ./ + image: sb + container_name: sb + ports: + - ${PORT}:3000 + volumes: + - type: bind + source: ${DIRECTORY} + target: /space \ No newline at end of file From d56f1b87d3593815ad86201bf3ddef0ffd735d91 Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 03:32:08 +0200 Subject: [PATCH 4/8] add docker setup --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 78d79f7..34b5e21 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,22 @@ More documentation can be found in the [docs space](https://github.com/zefhemel/ * **Extensible** through plugs. ## Installing and running Silver Bullet + +## Start with docker +First you have to clone the repo, then configure your port, space/directory in .env file + +then run +``` +docker compose up +``` +then open your browser and ROCK! + +e.g. +``` +localhost:PORT +``` + +## Start without docker To run a release version, you need to have a recent version of npm (8+) and node.js (16+) installed as well as some basic build infrastructure (make, cpp). Silver Bullet has only been tested on MacOS and Linux thus far. To install and run, create a folder for your pages (can be empty or an existing folder with `.md` files) and run: From ee60ca482c43d96744c9eb6bd4b7ef3f95983dcf Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Mon, 18 Jul 2022 15:23:43 +0000 Subject: [PATCH 5/8] Plug directory --- website/πŸ”Œ Plug Directory.md | 8 ++++++++ website/πŸ”Œ Plugs.md | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 website/πŸ”Œ Plug Directory.md diff --git a/website/πŸ”Œ Plug Directory.md b/website/πŸ”Œ Plug Directory.md new file mode 100644 index 0000000..336520a --- /dev/null +++ b/website/πŸ”Œ Plug Directory.md @@ -0,0 +1,8 @@ +Here is a list of plugs you can install. If you know of any more, please let us know by issuing a PR [to the repo](https://github.com/silverbulletmd/silverbullet/tree/main/website)! + +* [Git](https://github.com/silverbulletmd/silverbullet-git): adds very rudimentary git sync plug, to synchronize your pages with a git repository. +* [Github](https://github.com/silverbulletmd/silverbullet-github): adds `gh-events` and `gh-pulls` as a query provider. +* [Ghost](https://github.com/silverbulletmd/silverbullet-ghost): adds the ability to publish pages to [Ghost](https://ghost.org/). +* [Mount](https://github.com/silverbulletmd/silverbullet-mount): adds the ability to β€œmount” external directories and SB instances into your space. +* [Backlinks](https://github.com/Willyfrog/silverbullet-backlinks): persistently shows your page’s backlinks in a side panel. +* [Mattermost](https://github.com/silverbulletmd/silverbullet-mattermost): a basic Mattermost plug exposing saved posts as a query source. \ No newline at end of file diff --git a/website/πŸ”Œ Plugs.md b/website/πŸ”Œ Plugs.md index 2312f76..b4f4412 100644 --- a/website/πŸ”Œ Plugs.md +++ b/website/πŸ”Œ Plugs.md @@ -2,6 +2,8 @@ Silver Bullet at its core is bare bones in terms of functionality, most of its p Plugs are an extension mechanism (implemented using a library called `plugos` that runs plug code on the server in a sandboxed v8 node.js process, and in the browser using web workers). Plugs can hook into SB in various ways: plugs can extend the Markdown parser and its syntax, define new commands and keybindings, respond to various events triggered either on the server or client side, as well as run recurring and background tasks. Plugs can even define their own extension mechanisms through custom events. Each plug runs in its own sandboxed environment and communicates with SB via _syscalls_ that expose a vast range of functionality. Plugs can be loaded, unloaded and updated without having to restart SB itself. +[[πŸ”Œ Plug Directory]] + Examples of functionality implemented as plugs: * _Core functionality_ such as: From d7dc914d98a1a235509338337984c98551d2c3e4 Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 19:48:19 +0200 Subject: [PATCH 6/8] Update Dockerfile --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b672517..2539beb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ -FROM node:slim +FROM node:18.6.0-slim RUN mkdir /space RUN chown node:node /space USER node WORKDIR /space +RUN npx --yes @silverbulletmd/server || true + EXPOSE 3000 -CMD ["sh","-c","npx --yes @silverbulletmd/server --port 3000 /space"] \ No newline at end of file +CMD ["sh","-c","npx --yes @silverbulletmd/server --port 3000 /space"] From a6a80e8171b16f752f33842341c7fbc571cfccc4 Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 19:48:58 +0200 Subject: [PATCH 7/8] Update .env --- .env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 7e3d4a3..9c4c53c 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -DIRECTORY= ~/space -PORT=3000 \ No newline at end of file +DIRECTORY= +PORT=3000 From df8d18a0eb943b6d92a69c82bc421733c21bf457 Mon Sep 17 00:00:00 2001 From: Jim Tittsler Date: Tue, 19 Jul 2022 13:55:18 +0900 Subject: [PATCH 8/8] Fix docs/website link another link needed updating after docs move --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34b5e21..f90e928 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ I know, right? **Disclaimer:** Silver Bullet is under heavy development and significant changes under the hood happen constantly. It’s also low on automated tests and documentation. All this will improve over time. I’ll do better, I promise. -More documentation can be found in the [docs space](https://github.com/zefhemel/silverbullet/tree/main/docs) +More documentation can be found in the [website space](https://github.com/zefhemel/silverbullet/tree/main/website) ## Features * **Free and open source**