-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
93 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## REST API | ||
|
||
### `/api/sites` | ||
|
||
A `POST` to `/api/sites` can be used to add a new site associated with a key. | ||
|
||
A `GET` to `/api/sites` can be used to get a list of all the sites belonging to a key. | ||
|
||
### `/api/config` | ||
|
||
A `GET` to `/api/config` will return the list of available themes and the currently selected theme. | ||
|
||
A `PUT` to `/api/config` can be used to change the site's theme. | ||
|
||
NB: All requests require a [NIP-98](https://github.com/nostr-protocol/nips/blob/master/98.md) authorization header to be present! | ||
|
||
## Blossom API | ||
|
||
Servus implements the [Blossom API](https://github.com/hzrd149/blossom) and therefore acts as your personal Blossom server. | ||
|
||
* PUT `/upload` | ||
* GET `/list/<pubkey>` | ||
* DELETE `/<sha256>` | ||
|
||
## NIP-96 API | ||
|
||
Servus implements [NIP-96](https://github.com/nostr-protocol/nips/blob/master/96.md) file storage. | ||
|
||
* POST `/api/files` | ||
* DELETE `/api/files/<sha256>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Building from source | ||
|
||
* `cargo build` - this builds the "debug" version | ||
* `cargo build --target x86_64-unknown-linux-musl --release` - this builds the "release" version using `musl` (which you can run on your VPS, for example) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
## Directory structure | ||
|
||
You can run the **Servus** executable from any directory. On start, it looks for a directory named `themes` and a directory named `sites` and loads all available themes and sites that it finds. | ||
|
||
Themes are expected to be **Zola** themes. | ||
|
||
A "site" is identified by the domain name, which is passed by the browser using the [`Host` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/host). | ||
|
||
``` | ||
. | ||
├── themes | ||
│ ├── hyde | ||
│ ├── ... | ||
│ └── ... | ||
└── sites | ||
├── domain1.com | ||
├── domain2.com | ||
└── domain3.com | ||
``` | ||
|
||
Each of these "sites" has the following structure: | ||
|
||
``` | ||
├── _config.toml | ||
├── _content | ||
│ ├── notes | ||
│ │ ├── <event_id>.md | ||
│ │ └── [...] | ||
│ ├── pages | ||
│ │ ├── page1.md | ||
│ │ └── [...] | ||
| └── posts | ||
│ ├── post1.md | ||
│ └── [...] | ||
└── [...] | ||
``` | ||
|
||
Files and directories starting with "." are ignored. | ||
|
||
Files and directories starting with "_" have special meaning: `_config.toml`, `_content`. | ||
|
||
Anything else will be directly served to the clients requesting it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Themes | ||
|
||
**Servus** uses Zola themes. First time you run **Servus** it will ask you whether you want to download the themes, but you can also install/create your own themes! |