2023-06-25 11:35:59 +00:00
|
|
|
# Domani
|
2023-05-15 19:46:40 +00:00
|
|
|
|
2023-06-25 11:35:59 +00:00
|
|
|
Domani is a self-hosted rust service which connects a DNS hostname to a data
|
2023-05-15 19:46:40 +00:00
|
|
|
backend (e.g. a git repository), all with no account needed. The user only
|
|
|
|
inputs their domain name, their desired backend, and then adds two entries to
|
|
|
|
their DNS server.
|
|
|
|
|
2023-08-04 14:16:55 +00:00
|
|
|
[Demo](https://domani.micropelago.net)
|
2023-05-15 19:46:40 +00:00
|
|
|
|
2023-07-31 18:46:54 +00:00
|
|
|
Domani supports serving domains using the following protocols:
|
|
|
|
|
|
|
|
- HTTP
|
|
|
|
- HTTPS (with SSL certificates automatically retrieved using LetsEncrypt)
|
|
|
|
- [Gemini](https://gemini.circumlunar.space/)
|
|
|
|
|
|
|
|
Files are served as-is, with their extension being used to determine
|
|
|
|
Content-Type. If a directory is requested (e.g. `/some/dir/`) then `index.html`
|
|
|
|
will be requested if the protocol is HTTP, or `index.gmi` if the protocol is
|
|
|
|
gemini.
|
|
|
|
|
2023-05-20 13:03:11 +00:00
|
|
|
## Build
|
|
|
|
|
2023-06-25 11:35:59 +00:00
|
|
|
Domani uses nix flakes for building and setting up the development environment.
|
2023-05-20 13:03:11 +00:00
|
|
|
|
|
|
|
In order to create a release binary:
|
|
|
|
|
|
|
|
```
|
|
|
|
nix build
|
|
|
|
```
|
|
|
|
|
|
|
|
A statically compiled binary will be placed in the `result` directory.
|
|
|
|
|
2024-01-09 10:24:54 +00:00
|
|
|
A full release, which cross-compiles binaries for all supported platforms, can
|
|
|
|
be generated by doing:
|
|
|
|
|
|
|
|
```
|
|
|
|
nix build '.#release'
|
|
|
|
```
|
|
|
|
|
|
|
|
*NOTE* that cross-compiling will download a separate build environment for each
|
|
|
|
target platform, which can take up quite a bit of disk space (>10GB).
|
|
|
|
gigs).
|
|
|
|
|
2023-05-20 13:03:11 +00:00
|
|
|
## Configuration
|
|
|
|
|
2023-07-09 15:13:25 +00:00
|
|
|
Domani is configured via a YAML file whose path is given on the command-line.
|
2023-08-25 16:44:55 +00:00
|
|
|
The format of the YAML file, along with all default values, can be found in the
|
|
|
|
`config.yml` file in this repo.
|
2023-05-20 13:03:11 +00:00
|
|
|
|
2023-07-09 15:13:25 +00:00
|
|
|
The YAML config file can be passed to the Domani process via the `--config-path`
|
|
|
|
CLI parameter:
|
2023-05-20 13:03:11 +00:00
|
|
|
|
|
|
|
```
|
2023-07-09 15:13:25 +00:00
|
|
|
domani --config-path <path>
|
2023-05-20 13:03:11 +00:00
|
|
|
```
|
|
|
|
|
2023-07-09 15:13:25 +00:00
|
|
|
### HTTPS Support
|
|
|
|
|
|
|
|
By default HTTPS is not enabled, but can be enabled by setting the
|
|
|
|
`service.http.https_addr` field in the YAML config. There are a few other fields
|
|
|
|
in the configuration file which must be correctly configured if HTTPS is set up,
|
|
|
|
please read through the example file above carefully.
|
|
|
|
|
|
|
|
Once HTTPS is enabled, Domani will automatically handle setting it up via
|
|
|
|
LetsEncrypt for both the Domani web interface and all domains which it is
|
|
|
|
configured to serve.
|
2023-05-20 13:03:11 +00:00
|
|
|
|
2023-05-15 19:46:40 +00:00
|
|
|
## Development
|
|
|
|
|
2023-06-25 11:35:59 +00:00
|
|
|
Domani uses nix flakes for building and setting up the development environment.
|
2023-05-15 19:46:40 +00:00
|
|
|
In order to open a shell with all necessary tooling (expected rust toolchain
|
|
|
|
versions, etc...) simply do:
|
|
|
|
|
|
|
|
```
|
2023-08-25 16:44:55 +00:00
|
|
|
cp config-dev.yml.tpl config-dev.yml
|
2023-05-15 19:46:40 +00:00
|
|
|
nix develop
|
|
|
|
```
|
|
|
|
|
|
|
|
Within the shell which opens you can do `cargo run` to start a local instance.
|
|
|
|
|
2023-07-31 18:46:54 +00:00
|
|
|
Using the default configuration, the domain `domani-test.localhost` should be
|
|
|
|
immediately available at:
|
|
|
|
|
|
|
|
* `http://domani-test.localhost:3080`
|
|
|
|
* `gemini://domani-test.localhost:3965`
|
|
|
|
|
2023-05-15 19:46:40 +00:00
|
|
|
## Roadmap
|
|
|
|
|
2023-07-31 18:46:54 +00:00
|
|
|
* Tutorials aimed at beginner users.
|
|
|
|
|
2023-07-04 17:09:07 +00:00
|
|
|
* Support for more backends than just git repositories, including:
|
|
|
|
* IPFS/IPNS
|
2023-07-15 17:41:11 +00:00
|
|
|
* Small static files (e.g. for well-knowns)
|
2023-07-31 18:46:54 +00:00
|
|
|
|
|
|
|
* Automatic HTTP/gemtext rendering for markdown files.
|
|
|
|
* Automatic HTTP rendering for gemtext files.
|