From 6c32af061bcba241512d6245baae3a5ad65e84f8 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Mon, 15 May 2023 21:34:50 +0200 Subject: [PATCH] Polish up the FE a bit --- src/service.rs | 10 +++--- src/service/http_tpl/base.html | 6 ++++ src/service/http_tpl/domain.html | 5 --- src/service/http_tpl/domain_init.html | 8 +++++ src/service/http_tpl/index.html | 51 ++++++++++++++++----------- 5 files changed, 50 insertions(+), 30 deletions(-) diff --git a/src/service.rs b/src/service.rs index 22f25dd..fdd13e1 100644 --- a/src/service.rs +++ b/src/service.rs @@ -52,12 +52,12 @@ struct DomainGetArgs { #[derive(Deserialize)] struct DomainInitArgs { domain: domain::Name, - passphrase: String, } #[derive(Deserialize)] struct DomainSyncArgs { domain: domain::Name, + passphrase: String, } impl<'svc> Service<'svc> { @@ -195,10 +195,6 @@ impl<'svc> Service<'svc> { } fn domain_init(&self, args: DomainInitArgs, domain_config: util::FlatConfig) -> SvcResponse { - if args.passphrase != self.passphrase.as_str() { - return self.render_error_page(401, "Incorrect passphrase"); - } - #[derive(Serialize)] struct Response { domain: domain::Name, @@ -239,6 +235,10 @@ impl<'svc> Service<'svc> { args: DomainSyncArgs, domain_config: util::FlatConfig, ) -> SvcResponse { + if args.passphrase != self.passphrase.as_str() { + return self.render_error_page(401, "Incorrect passphrase"); + } + let config: domain::config::Config = match domain_config.try_into() { Ok(Some(config)) => config, Ok(None) => return self.render_error_page(400, "domain config is required"), diff --git a/src/service/http_tpl/base.html b/src/service/http_tpl/base.html index be24126..b55a287 100644 --- a/src/service/http_tpl/base.html +++ b/src/service/http_tpl/base.html @@ -17,6 +17,12 @@ + + diff --git a/src/service/http_tpl/domain.html b/src/service/http_tpl/domain.html index 186c3e1..4d78193 100644 --- a/src/service/http_tpl/domain.html +++ b/src/service/http_tpl/domain.html @@ -14,11 +14,6 @@ automatically updated too!

- -
Git Repository

diff --git a/src/service/http_tpl/domain_init.html b/src/service/http_tpl/domain_init.html index 56dc4e9..8475905 100644 --- a/src/service/http_tpl/domain_init.html +++ b/src/service/http_tpl/domain_init.html @@ -22,5 +22,13 @@ and set up your domain.

{{ #each data.flat_config }} {{ /each }} + +
+ +
+ diff --git a/src/service/http_tpl/index.html b/src/service/http_tpl/index.html index 13ff2a8..8d4b355 100644 --- a/src/service/http_tpl/index.html +++ b/src/service/http_tpl/index.html @@ -5,27 +5,20 @@ server, and you're done!

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

-

The following backends are supported for serving a domain:

- - -

Get Started

-

Input your domain name below to set it up, or reconfigure it if you have used -it before:

+

Input your domain name below to set it up, or to reconfigure it has already +been set up.

- + +
+ + +
@@ -33,10 +26,9 @@ it before:

Alternatively you can do any of the following alternative actions:

About

@@ -45,3 +37,22 @@ it before:

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 +planned but not yet implemented:

+ +