domani/README.md

153 lines
4.3 KiB
Markdown
Raw Normal View History

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-06-25 11:35:59 +00:00
[Demo which may or may not be live](https://domani.mediocregopher.com)
2023-05-15 19:46:40 +00:00
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.
## Configuration
Domani is configured via a YAML file whose path is given on the command-line.
The format of the YAML file, along with all default values, is as follows:
2023-05-20 13:03:11 +00:00
```yaml
origin:
2023-05-20 13:03:11 +00:00
# Path under which all origin data (i.e. git repositories, file caches,
# etc...) will be stored.
#
# This should be different than any other store_dir_paths.
#store_dir_path: REQUIRED
2023-05-20 13:03:11 +00:00
domain:
2023-05-20 13:03:11 +00:00
# Path under which all domain data (i.e. domains configured by users, HTTPS
# certificates, etc...) will be stored.
#
# This should be different than any other store_dir_paths.
#store_dir_path: REQUIRED
2023-05-20 13:03:11 +00:00
#dns:
2023-05-20 13:03:11 +00:00
# Address of DNS resolver to use.
#resolver_addr: "1.1.1.1:53"
2023-05-20 13:03:11 +00:00
#acme:
2023-05-20 13:03:11 +00:00
# Contact email to use when creating HTTPS certificates using LetsEncrypt.
# This email will be used for notifying you if certificates are not being
# renewed.
#contact_email: REQUIRED if service.http.https_addr is set
2023-05-20 13:03:11 +00:00
2023-07-15 17:41:11 +00:00
# builtins are domains whose configuration is built into domani. These domains
# are not able to be configured via the web interface, and will be hidden from
# it unless the `public` key is set to true.
#builtins:
# An example built-in domain backed by a git repo.
#git.example.com:
2023-07-15 17:41:11 +00:00
# kind: git
# url: "https://somewhere.com/some/repo.git"
# branch_name: main
2023-07-15 17:41:11 +00:00
# public: false
# An example built-in domain backed by a reverse-proxy to some other
# web-service. Proxies are currently limited in the following ways:
# * url must be to an http endpoint (not https)
# * dns.resolver_addr is ignored and the system-wide dns is used
#
#proxy.example.com:
# kind: proxy
# url: "http://some.other.service.com"
# public: false
service:
2023-05-20 13:03:11 +00:00
# Passphrase which must be given by users who are configuring new domains via
# the web interface.
#passphrase: REQUIRED
2023-05-20 13:03:11 +00:00
# DNS records which users must add to their domain's DNS so that
# Domani can serve the domains. All records given must route to this Domani
2023-07-11 17:16:09 +00:00
# instance.
#
# A CNAME record with the primary_domain of this server is automatically
# included.
dns_records:
2023-07-15 17:41:11 +00:00
#- kind: A
# addr: 127.0.0.1
2023-05-20 13:03:11 +00:00
2023-07-15 17:41:11 +00:00
#- kind: AAAA
2023-07-10 16:22:37 +00:00
# addr: ::1
2023-07-11 17:16:09 +00:00
# NOTE that the name given here must resolve to the Domani server.
2023-07-15 17:41:11 +00:00
#- kind: CNAME
2023-07-11 17:16:09 +00:00
# name: domain.com
# The domain name which will be used to serve the web interface of Domani. If
# service.http.https_addr is enabled then an HTTPS certificate for this domain
# will be retrieved automatically.
2023-07-10 16:22:37 +00:00
#primary_domain: "localhost"
2023-05-20 13:03:11 +00:00
#http:
# The address to listen for HTTP requests on. This must use port 80 if
# https_addr is set.
#http_addr: "[::]:3030"
2023-05-20 13:03:11 +00:00
# The address to listen for HTTPS requests on. This is optional.
#https_addr: "[::]:443"
```
2023-05-20 13:03:11 +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
```
domani --config-path <path>
2023-05-20 13:03:11 +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:
```
nix develop
```
Within the shell which opens you can do `cargo run` to start a local instance.
## Roadmap
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-04 17:09:07 +00:00
* Google Drive
* Dropbox