diff --git a/.env.dev b/.env.dev index 59bb4b3..a524b5e 100644 --- a/.env.dev +++ b/.env.dev @@ -1,6 +1,6 @@ -export DOMIPLY_HTTP_DOMAIN=localhost -export DOMIPLY_PASSPHRASE=foobar -export DOMIPLY_ORIGIN_STORE_GIT_DIR_PATH=/tmp/domiply_dev_env/origin/git -export DOMIPLY_DOMAIN_CHECKER_TARGET_A=127.0.0.1 -export DOMIPLY_DOMAIN_CONFIG_STORE_DIR_PATH=/tmp/domiply_dev_env/domain/config -export DOMIPLY_DOMAIN_ACME_STORE_DIR_PATH=/tmp/domiply_dev_env/domain/acme +export DOMANI_HTTP_DOMAIN=localhost +export DOMANI_PASSPHRASE=foobar +export DOMANI_ORIGIN_STORE_GIT_DIR_PATH=/tmp/domani_dev_env/origin/git +export DOMANI_DOMAIN_CHECKER_TARGET_A=127.0.0.1 +export DOMANI_DOMAIN_CONFIG_STORE_DIR_PATH=/tmp/domani_dev_env/domain/config +export DOMANI_DOMAIN_ACME_STORE_DIR_PATH=/tmp/domani_dev_env/domain/acme diff --git a/Cargo.lock b/Cargo.lock index 5a33bd8..8bea9eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -444,7 +444,7 @@ dependencies = [ ] [[package]] -name = "domiply" +name = "domani" version = "0.1.0" dependencies = [ "acme2", diff --git a/Cargo.toml b/Cargo.toml index e954671..0251505 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "domiply" +name = "domani" version = "0.1.0" edition = "2021" diff --git a/README.md b/README.md index b8425dd..7e6bd62 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -# Domiply +# Domani -Domiply is a self-hosted rust service which connects a DNS hostname to a data +Domani is a self-hosted rust service which connects a DNS hostname to a data 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. -[Demo which may or may not be live](https://domiply.mediocregopher.com) +[Demo which may or may not be live](https://domani.mediocregopher.com) ## Build -Domiply uses nix flakes for building and setting up the development environment. +Domani uses nix flakes for building and setting up the development environment. In order to create a release binary: @@ -21,38 +21,38 @@ A statically compiled binary will be placed in the `result` directory. ## Configuration -Domiply is configured via command-line arguments or environment variables: +Domani is configured via command-line arguments or environment variables: ``` --http-domain - [env: DOMIPLY_HTTP_DOMAIN=] + [env: DOMANI_HTTP_DOMAIN=] --http-listen-addr - [env: DOMIPLY_HTTP_LISTEN_ADDR=] [default: [::]:3030] + [env: DOMANI_HTTP_LISTEN_ADDR=] [default: [::]:3030] --https-listen-addr - E.g. '[::]:443', if given then SSL certs will automatically be retrieved for all domains using LetsEncrypt [env: DOMIPLY_HTTPS_LISTEN_ADDR=] + E.g. '[::]:443', if given then SSL certs will automatically be retrieved for all domains using LetsEncrypt [env: DOMANI_HTTPS_LISTEN_ADDR=] --passphrase - [env: DOMIPLY_PASSPHRASE=] + [env: DOMANI_PASSPHRASE=] --origin-store-git-dir-path - [env: DOMIPLY_ORIGIN_STORE_GIT_DIR_PATH=] + [env: DOMANI_ORIGIN_STORE_GIT_DIR_PATH=] --domain-checker-target-a - [env: DOMIPLY_DOMAIN_CHECKER_TARGET_A=] + [env: DOMANI_DOMAIN_CHECKER_TARGET_A=] --domain-checker-resolver-addr - [env: DOMIPLY_DOMAIN_CHECKER_RESOLVER_ADDR=] [default: 1.1.1.1:53] + [env: DOMANI_DOMAIN_CHECKER_RESOLVER_ADDR=] [default: 1.1.1.1:53] --domain-config-store-dir-path - [env: DOMIPLY_DOMAIN_CONFIG_STORE_DIR_PATH=] + [env: DOMANI_DOMAIN_CONFIG_STORE_DIR_PATH=] --domain-acme-store-dir-path - [env: DOMIPLY_DOMAIN_ACME_STORE_DIR_PATH=] + [env: DOMANI_DOMAIN_ACME_STORE_DIR_PATH=] --domain-acme-contact-email - [env: DOMIPLY_DOMAIN_ACME_CONTACT_EMAIL=] + [env: DOMANI_DOMAIN_ACME_CONTACT_EMAIL=] -h, --help Print help @@ -63,8 +63,8 @@ Domiply is configured via command-line arguments or environment variables: ### HTTPS Support -Domiply will automatically handle setting up HTTPS via LetsEncrypt for both the -domiply frontend site and all domains which it has been configured to serve. +Domani will automatically handle setting up HTTPS via LetsEncrypt for both the +domani frontend site and all domains which it has been configured to serve. By default HTTPS is not enabled, but can be easily enabled by setting the following arguments: @@ -81,7 +81,7 @@ secured as best as possible. ## Development -Domiply uses nix flakes for building and setting up the development environment. +Domani uses nix flakes for building and setting up the development environment. In order to open a shell with all necessary tooling (expected rust toolchain versions, etc...) simply do: diff --git a/src/domain/checker.rs b/src/domain/checker.rs index 962457c..f4e0032 100644 --- a/src/domain/checker.rs +++ b/src/domain/checker.rs @@ -90,7 +90,7 @@ impl DNSChecker { // check that the TXT record with the challenge token is correctly installed on the domain { - let domain = Name::from_str("_domiply_challenge") + let domain = Name::from_str("_domani_challenge") .or_unexpected_while("parsing TXT name")? .append_domain(domain) .or_unexpected_while("appending domain to TXT")?; diff --git a/src/main.rs b/src/main.rs index 24a7c05..936fc1d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,53 +10,53 @@ use std::str::FromStr; #[derive(Parser, Debug)] #[command(version)] -#[command(about = "A domiply to another dimension")] +#[command(about = "A domani to another dimension")] struct Cli { #[arg( long, help = "OFF, ERROR, WARN, INFO, DEBUG, or TRACE", default_value_t = log::LevelFilter::Info, - env = "DOMIPLY_LOG_LEVEL" + env = "DOMANI_LOG_LEVEL" )] log_level: log::LevelFilter, - #[arg(long, default_value_t = false, env = "DOMIPLY_LOG_TIMESTAMP")] + #[arg(long, default_value_t = false, env = "DOMANI_LOG_TIMESTAMP")] log_timestamp: bool, - #[arg(long, required = true, env = "DOMIPLY_HTTP_DOMAIN")] - http_domain: domiply::domain::Name, + #[arg(long, required = true, env = "DOMANI_HTTP_DOMAIN")] + http_domain: domani::domain::Name, - #[arg(long, default_value_t = SocketAddr::from_str("[::]:3030").unwrap(), env = "DOMIPLY_HTTP_LISTEN_ADDR")] + #[arg(long, default_value_t = SocketAddr::from_str("[::]:3030").unwrap(), env = "DOMANI_HTTP_LISTEN_ADDR")] http_listen_addr: SocketAddr, #[arg( long, help = "E.g. '[::]:443', if given then SSL certs will automatically be retrieved for all domains using LetsEncrypt", - env = "DOMIPLY_HTTPS_LISTEN_ADDR", + env = "DOMANI_HTTPS_LISTEN_ADDR", requires = "domain_acme_contact_email", requires = "domain_acme_store_dir_path" )] https_listen_addr: Option, - #[arg(long, required = true, env = "DOMIPLY_PASSPHRASE")] + #[arg(long, required = true, env = "DOMANI_PASSPHRASE")] passphrase: String, - #[arg(long, required = true, env = "DOMIPLY_ORIGIN_STORE_GIT_DIR_PATH")] + #[arg(long, required = true, env = "DOMANI_ORIGIN_STORE_GIT_DIR_PATH")] origin_store_git_dir_path: path::PathBuf, - #[arg(long, required = true, env = "DOMIPLY_DOMAIN_CHECKER_TARGET_A")] + #[arg(long, required = true, env = "DOMANI_DOMAIN_CHECKER_TARGET_A")] domain_checker_target_a: std::net::Ipv4Addr, - #[arg(long, default_value_t = String::from("1.1.1.1:53"), env = "DOMIPLY_DOMAIN_CHECKER_RESOLVER_ADDR")] + #[arg(long, default_value_t = String::from("1.1.1.1:53"), env = "DOMANI_DOMAIN_CHECKER_RESOLVER_ADDR")] domain_checker_resolver_addr: String, - #[arg(long, required = true, env = "DOMIPLY_DOMAIN_CONFIG_STORE_DIR_PATH")] + #[arg(long, required = true, env = "DOMANI_DOMAIN_CONFIG_STORE_DIR_PATH")] domain_config_store_dir_path: path::PathBuf, - #[arg(long, env = "DOMIPLY_DOMAIN_ACME_STORE_DIR_PATH")] + #[arg(long, env = "DOMANI_DOMAIN_ACME_STORE_DIR_PATH")] domain_acme_store_dir_path: Option, - #[arg(long, env = "DOMIPLY_DOMAIN_ACME_CONTACT_EMAIL")] + #[arg(long, env = "DOMANI_DOMAIN_ACME_CONTACT_EMAIL")] domain_acme_contact_email: Option, } @@ -73,23 +73,23 @@ async fn main() { ) .init(); - let origin_store = domiply::origin::store::git::new(config.origin_store_git_dir_path) + let origin_store = domani::origin::store::git::new(config.origin_store_git_dir_path) .expect("git origin store initialization failed"); - let domain_checker = domiply::domain::checker::new( + let domain_checker = domani::domain::checker::new( config.domain_checker_target_a, &config.domain_checker_resolver_addr, ) .await .expect("domain checker initialization failed"); - let domain_config_store = domiply::domain::config::new(&config.domain_config_store_dir_path) + let domain_config_store = domani::domain::config::new(&config.domain_config_store_dir_path) .expect("domain config store initialization failed"); let domain_acme_manager = if config.https_listen_addr.is_some() { let domain_acme_store_dir_path = config.domain_acme_store_dir_path.unwrap(); - let domain_acme_store = domiply::domain::acme::store::new(&domain_acme_store_dir_path) + let domain_acme_store = domani::domain::acme::store::new(&domain_acme_store_dir_path) .expect("domain acme store initialization failed"); // if https_listen_addr is set then domain_acme_contact_email is required, see the Cli/clap @@ -97,7 +97,7 @@ async fn main() { let domain_acme_contact_email = config.domain_acme_contact_email.unwrap(); Some( - domiply::domain::acme::manager::new(domain_acme_store, &domain_acme_contact_email) + domani::domain::acme::manager::new(domain_acme_store, &domain_acme_contact_email) .await .expect("domain acme manager initialization failed"), ) @@ -105,9 +105,9 @@ async fn main() { None }; - let mut task_stack = domiply::util::TaskStack::new(); + let mut task_stack = domani::util::TaskStack::new(); - let domain_manager = domiply::domain::manager::new( + let domain_manager = domani::domain::manager::new( &mut task_stack, origin_store, domain_config_store, @@ -115,7 +115,7 @@ async fn main() { domain_acme_manager, ); - let _ = domiply::service::http::new( + let _ = domani::service::http::new( &mut task_stack, domain_manager.clone(), config.domain_checker_target_a, @@ -124,7 +124,7 @@ async fn main() { config.http_domain.clone(), config .https_listen_addr - .map(|listen_addr| domiply::service::http::HTTPSParams { + .map(|listen_addr| domani::service::http::HTTPSParams { listen_addr, cert_resolver: domain_manager.clone(), }), diff --git a/src/service/http.rs b/src/service/http.rs index c8b1937..f7b5c08 100644 --- a/src/service/http.rs +++ b/src/service/http.rs @@ -378,7 +378,7 @@ impl<'svc> Service { return self.serve_origin(domain, req.uri().path()); } - // Serve main domiply site + // Serve main domani site if method == Method::GET && path.starts_with("/static/") { return self.render(200, path, ()); diff --git a/src/service/http/tpl/base.html b/src/service/http/tpl/base.html index b55a287..ebadcd0 100644 --- a/src/service/http/tpl/base.html +++ b/src/service/http/tpl/base.html @@ -6,7 +6,7 @@ - Domiply - The universal, zero-authentication hosting service + Domani - The universal, zero-authentication hosting service @@ -28,7 +28,7 @@
-

Domiply

+

Domani

The universal, zero-authentication hosting service
diff --git a/src/service/http/tpl/domain.html b/src/service/http/tpl/domain.html index 4f90dd0..02351a2 100644 --- a/src/service/http/tpl/domain.html +++ b/src/service/http/tpl/domain.html @@ -5,19 +5,19 @@ {{# if data.config }}

Your domain {{ data.domain }} is already configured with -Domiply. You can see the existing configuration below. If you modify any values +Domani. You can see the existing configuration below. If you modify any values you will need to hit the "Next" button to complete the update.

{{ else }} -

Your domain {{ data.domain }} is not yet configured with Domiply. +

Your domain {{ data.domain }} is not yet configured with Domani. To get started, please input the details of a public git repo which will be used to serve your domain. When you update the given branch, your domain will be automatically updated too!

{{/if}} -

In the future Domiply will support more backends than just git +

In the future Domani will support more backends than just git repos.

diff --git a/src/service/http/tpl/domain_init.html b/src/service/http/tpl/domain_init.html index a5a883a..7b99ff6 100644 --- a/src/service/http/tpl/domain_init.html +++ b/src/service/http/tpl/domain_init.html @@ -1,6 +1,6 @@

Configure DNS

-

Next you will need to configure your DNS server to point to Domiply. There +

Next you will need to configure your DNS server to point to Domani. There are two entries you will need to add:

    @@ -9,7 +9,7 @@ are two entries you will need to add:

    {{ data.target_a }}
  • - A TXT _domiply_challenge.{{ data.domain }} entry with the value + A TXT _domani_challenge.{{ data.domain }} entry with the value {{ data.challenge_token }}
diff --git a/src/service/http/tpl/domains.html b/src/service/http/tpl/domains.html index 7779b4f..e7f0e59 100644 --- a/src/service/http/tpl/domains.html +++ b/src/service/http/tpl/domains.html @@ -1,6 +1,6 @@

All Domains

-

Below are listed all domains which this Domiply instance is currently +

Below are listed all domains which this Domani instance is currently serving

    diff --git a/src/service/http/tpl/index.html b/src/service/http/tpl/index.html index 6ed880e..e8e9de7 100644 --- a/src/service/http/tpl/index.html +++ b/src/service/http/tpl/index.html @@ -1,11 +1,11 @@ -

    Domiply connects your domain to whatever you want to host on it, all with no +

    Domani connects your domain to whatever you want to host on it, all with no account needed. Just input your desired backend, add two entries to your DNS server, and you're done!

    YOU SHOULD NOT USE THIS FOR ANYTHING YOU CARE ABOUT AT THIS TIME.

    -

    Domiply is currently only a proof-of-concept with limited features, +

    Domani is currently only a proof-of-concept with limited features, but will continue to be expanded as development time permits.

    Get Started

    @@ -30,20 +30,20 @@ been set up.

    About

    -

    Domiply is an open-source project which is designed to be hosted by +

    Domani is an open-source project which is designed to be hosted by individuals for their community of friends and family. By making it super easy to set up a domain we can help our non-technical folk own their own slice of the internet, the way it was always intended.

    Roadmap

    -

    Domiply is very much a work in progress. The following functionality is +

    Domani is very much a work in progress. The following functionality is planned but not yet implemented: