From c48762263323ec88b98894780895d23c80d6b81d Mon Sep 17 00:00:00 2001 From: Alexander Cobleigh Date: Thu, 11 Mar 2021 10:44:49 +0100 Subject: [PATCH 1/4] flesh out development instructions --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3542138..276d055 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,24 @@ Usage of ./server: print version number and build date ``` -If you are working on the sqlite migrations, html templates or website assets, build the server with `go build -tags dev`. -This way it won't use the assets that are embedded in the binary but read them directly from the local filesystem. +If you want to view the development server in your browser: +```sh +cd cmd/server && go build -tags dev && ./server +# and visit http://localhost:3000 +``` -Once you are done with your changes run `go generate` in the changed packages to update them. +This can be useful if you are working on: +* the sqlite migrations, +* html templates, +* or website assets + +This way the build won't use the assets embedded in the binary, but instead read them directly from the local filesystem. + +Once you are done with your changes run and want to update the embedded assets: +```sh +go generate +``` +**Note**: you need to run generate in each changed package. ## Tooling ### Mocks From 4a8ed9f9b38e1d0fe3e4a927cff24766e3425502 Mon Sep 17 00:00:00 2001 From: Alexander Cobleigh Date: Fri, 12 Mar 2021 10:48:42 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 276d055..c24e445 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,32 @@ # Go-SSB Room -This repository contains code for a [Secure-Scuttlebutt Room v2](https://github.com/ssb-ngi-pointer/rooms2/) server written in Go. +This repository contains code for a [Secure Scuttlebutt](https://ssb.nz) [Room (v1+v2) server](https://github.com/ssb-ngi-pointer/rooms2), written in Go. -It not only includes the secret-handshake+boxstream setup and muxrpc handlers for tunneling connections but also a fully embedded http/html interface for administering the room. +It includes: +* a secret-handshake+boxstream setup +* muxrpc handlers for tunneling connections +* a fully embedded server & frontend, for administering the room ## Features * [x] Rooms v1 (`tunnel.connect`, `tunnel.endpoints`, etc.) +* [x] Simple allow-listing + Currently via `.ssb-go-rooms/authorized_keys`. + To be replaced with an authorization list on the dashboard. * [ ] Sign-in with SSB -* [x] Simple allow-listing - Currently via `.ssb-go-rooms/authorized_keys`. - To be replaced with a authorization list on the dashboard. * [ ] Alias managment ## Development To get started, you need a recent version of [Go](https://golang.org). v1.16 and onward should be sufficient. -To build the server and see a list of it's options, run the following: +To build the server and see a list of its options: ```bash -$ cd cmd/server -$ go build -$ ./server -h +cd cmd/server +go build +./server -h + Usage of ./server: -dbg string listen addr for metrics and pprof HTTP server (default "localhost:6078") @@ -44,6 +48,9 @@ Usage of ./server: If you want to view the development server in your browser: ```sh +# change to the root of the project (e.g. cd go-ssb-room) and generate the frontend's styling; requires npm +go generate -tags dev ./... +# now let's build & run the development server cd cmd/server && go build -tags dev && ./server # and visit http://localhost:3000 ``` @@ -53,13 +60,13 @@ This can be useful if you are working on: * html templates, * or website assets -This way the build won't use the assets embedded in the binary, but instead read them directly from the local filesystem. +This way, the build won't use the assets embedded in the binary, but instead read them directly from the local filesystem. -Once you are done with your changes run and want to update the embedded assets: +Once you are done with your changes and want to update the embedded assets: ```sh -go generate +# cd to the root of the folder, and then run go generate +go generate -tags dev ./... ``` -**Note**: you need to run generate in each changed package. ## Tooling ### Mocks From 7ac4cda00aaa5990fc3c0814fca4561b61df7a20 Mon Sep 17 00:00:00 2001 From: Alexander Cobleigh Date: Fri, 12 Mar 2021 11:24:12 +0100 Subject: [PATCH 3/4] Update README.md Co-authored-by: Henry <111202+cryptix@users.noreply.github.com> --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index c24e445..33db132 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ It includes: * [x] Rooms v1 (`tunnel.connect`, `tunnel.endpoints`, etc.) * [x] Simple allow-listing Currently via `.ssb-go-rooms/authorized_keys`. - To be replaced with an authorization list on the dashboard. * [ ] Sign-in with SSB * [ ] Alias managment From d0c480d6659edc185ec7503ef5949e3fed0c34a8 Mon Sep 17 00:00:00 2001 From: Alexander Cobleigh Date: Fri, 12 Mar 2021 11:33:01 +0100 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Henry <111202+cryptix@users.noreply.github.com> --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 33db132..df66a40 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,14 @@ This repository contains code for a [Secure Scuttlebutt](https://ssb.nz) [Room (v1+v2) server](https://github.com/ssb-ngi-pointer/rooms2), written in Go. It includes: -* a secret-handshake+boxstream setup +* secret-handshake+boxstream network transport, sometimes referred to as SHS, using [secretstream](https://github.com/cryptoscope/secretstream) * muxrpc handlers for tunneling connections -* a fully embedded server & frontend, for administering the room +* a fully embedded HTTP server & HTML frontend, for administering the room ## Features * [x] Rooms v1 (`tunnel.connect`, `tunnel.endpoints`, etc.) -* [x] Simple allow-listing - Currently via `.ssb-go-rooms/authorized_keys`. +* [x] Simple allow-listing, administerd via the web dashboard * [ ] Sign-in with SSB * [ ] Alias managment