aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adenosine-pds/src/bin/adenosine-pds.rs19
-rw-r--r--adenosine-pds/src/lib.rs8
-rw-r--r--adenosine-pds/templates/error.html2
3 files changed, 14 insertions, 15 deletions
diff --git a/adenosine-pds/src/bin/adenosine-pds.rs b/adenosine-pds/src/bin/adenosine-pds.rs
index 5efa190..b2044e1 100644
--- a/adenosine-pds/src/bin/adenosine-pds.rs
+++ b/adenosine-pds/src/bin/adenosine-pds.rs
@@ -1,4 +1,3 @@
-use adenosine_cli::identifiers::Did;
use adenosine_pds::models::AccountRequest;
use adenosine_pds::*;
use anyhow::Result;
@@ -71,10 +70,10 @@ enum Command {
#[structopt(long = "--invite-code", env = "ATP_PDS_INVITE_CODE")]
invite_code: Option<String>,
- /// Optionally, override domain name check and force the homepage to display this user page
- /// for this DID
- #[structopt(long = "--homepage-did", env = "ATP_PDS_HOMEPAGE_DID")]
- homepage_did: Option<Did>,
+ /// Optionally, override domain name check and force the homepage to display the account
+ /// page for this handle
+ #[structopt(long = "--homepage-handle", env = "ATP_PDS_HOMEPAGE_HANDLE")]
+ homepage_handle: Option<String>,
},
/// Helper to import an IPLD CARv1 file in to sqlite data store
@@ -153,7 +152,7 @@ fn main() -> Result<()> {
registration_domain,
public_url,
invite_code,
- homepage_did,
+ homepage_handle,
} => {
let keypair = KeyPair::from_hex(&pds_secret_key)?;
// clean up config a bit
@@ -169,10 +168,10 @@ fn main() -> Result<()> {
};
let config = AtpServiceConfig {
listen_host_port: format!("localhost:{}", port),
- public_url: public_url,
- registration_domain: registration_domain,
- invite_code: invite_code,
- homepage_did: homepage_did,
+ public_url,
+ registration_domain,
+ invite_code,
+ homepage_handle,
};
log::info!("PDS config: {:?}", config);
let srv = AtpService::new(&opt.blockstore_db_path, &opt.atp_db_path, keypair, config)?;
diff --git a/adenosine-pds/src/lib.rs b/adenosine-pds/src/lib.rs
index 3d70d08..2414b79 100644
--- a/adenosine-pds/src/lib.rs
+++ b/adenosine-pds/src/lib.rs
@@ -48,7 +48,7 @@ pub struct AtpServiceConfig {
pub public_url: String,
pub registration_domain: Option<String>,
pub invite_code: Option<String>,
- pub homepage_did: Option<Did>,
+ pub homepage_handle: Option<String>,
}
impl Default for AtpServiceConfig {
@@ -58,7 +58,7 @@ impl Default for AtpServiceConfig {
public_url: "http://localhost".to_string(),
registration_domain: None,
invite_code: None,
- homepage_did: None,
+ homepage_handle: None,
}
}
}
@@ -199,8 +199,8 @@ impl AtpService {
(GET) ["/u/{handle}", handle: String] => {
web_wrap(account_view_handler(&srv, &handle, request))
},
- (GET) ["/u/{did}/post/{tid}", did: Did, tid: Tid] => {
- web_wrap(thread_view_handler(&srv, &did, &tid, request))
+ (GET) ["/u/{handle}/post/{tid}", handle: String, tid: Tid] => {
+ web_wrap(thread_view_handler(&srv, &handle, &tid, request))
},
(GET) ["/at/{did}", did: Did] => {
web_wrap(repo_view_handler(&srv, &did, request))
diff --git a/adenosine-pds/templates/error.html b/adenosine-pds/templates/error.html
index dd19629..885945a 100644
--- a/adenosine-pds/templates/error.html
+++ b/adenosine-pds/templates/error.html
@@ -1,6 +1,6 @@
{% extends "base.html" %}
-{% block content %}
+{% block main %}
<center>
<h1>{{ status_code }}</h1>
<span style="font-size: larger;">{{ error_message }}</span>