diff --git a/config.yml.tpl b/config.yml.tpl index ba58274..5fcb262 100644 --- a/config.yml.tpl +++ b/config.yml.tpl @@ -4,7 +4,7 @@ origin: store_dir_path: /tmp/domani_dev_env/origin domain: store_dir_path: /tmp/domani_dev_env/domain - builtins: + builtin_domains: domani-test.localhost: kind: git url: https://code.betamike.com/micropelago/domani.git diff --git a/src/service/http.rs b/src/service/http.rs index 7923596..4bd7f25 100644 --- a/src/service/http.rs +++ b/src/service/http.rs @@ -19,6 +19,7 @@ use crate::{domain, service, task_stack}; struct BasePresenter<'a, T> { page_name: &'a str, form_method: &'a str, + http_scheme: &'a str, data: T, } @@ -123,6 +124,13 @@ impl Service { self.serve(status_code, name, rendered.into()) } + fn presenter_http_scheme(&self) -> &str { + if self.config.http.https_addr.is_some() { + return "https"; + } + return "http"; + } + fn render_error_page(&self, status_code: u16, e: &str) -> Response
{ #[derive(Serialize)] struct Response<'a> { @@ -135,6 +143,7 @@ impl Service { BasePresenter { page_name: "/error.html", form_method: self.config.http.form_method.as_str(), + http_scheme: self.presenter_http_scheme(), data: &Response { error_msg: e }, }, ) @@ -158,6 +167,7 @@ impl Service { BasePresenter { page_name: name, form_method: self.config.http.form_method.as_str(), + http_scheme: self.presenter_http_scheme(), data, }, ) @@ -304,7 +314,7 @@ impl Service { return self.render_error_page(401, "Incorrect passphrase"); } - let settings: domain::Settings = match args.url_encoded_domain_settings.try_into() { + let settings: domain::Settings = match args.url_encoded_domain_settings.clone().try_into() { Ok(settings) => settings, Err(e) => { return self @@ -320,25 +330,59 @@ impl Service { #[derive(Serialize)] struct Data { domain: domain::Name, + url_encoded_domain_settings: util::UrlEncodedDomainSettings, + passphrase: String, + error_msg: OptionThis step requires a passphrase that has been given to you by the administrator of the Domani server:
@@ -18,7 +18,7 @@ administrator of the Domani server: -Next you will need to configure your DNS server to point to Domani. There are +
Next you will need to configure your nameserver to point to Domani. There are two entries you will need to add. The first entry tells the Domani server that it is allowed to serve this domain with your given configuration:
@@ -59,12 +59,13 @@ query for your domain name. It can be one or more of: {{ #if data.dns_records_have_cname }} -(Please note that not all DNS providers support putting a CNAME at the zone -apex, while others support it via an alternative record type like ALIAS or -ANAME.)
+(Please note that not all nameserver support using a CNAME in all cases, +while others support it via an alternative record type like ALIAS or ANAME. If +one of those are available they can be used instead.)
{{ /if }}Once both entries are installed, you can hit the following button to check -your configuration and set up your domain.
+your configuration and set up your domain. Note that this step may take a long +time to complete, so if nothing happens immediately please don't panic. diff --git a/src/service/http/tpl/domain_sync.html b/src/service/http/tpl/domain_sync.html index 2d9aef1..c938d44 100644 --- a/src/service/http/tpl/domain_sync.html +++ b/src/service/http/tpl/domain_sync.html @@ -3,11 +3,35 @@Your domain is not yet set up.
{{ data.error_msg }}
+{{#if data.retryable}} ++It's very possible that you have input your nameserver records correctly, but +that the changes haven't yet propagated to Domani. Propagation of nameserver +changes can take up to a couple of hours. You can use the button below to retry. +
+ + +{{/if}} + {{ else }}Congratulations! Your domain has been successfully configured. You can visit it at:
- + {{/if}} diff --git a/src/service/http/tpl/domains.html b/src/service/http/tpl/domains.html index e7f0e59..23b380a 100644 --- a/src/service/http/tpl/domains.html +++ b/src/service/http/tpl/domains.html @@ -6,7 +6,7 @@ serving