Skip to content

Commit 6fc885e

Browse files
committed
Add https-dns option #192
1 parent 4ae12ab commit 6fc885e

File tree

5 files changed

+139
-80
lines changed

5 files changed

+139
-80
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ See [STATUS.md](server/STATUS.md) to learn more about which features will remain
1919
- Meta tags server side #577
2020
- Include JSON-AD in initial response, speed up first render #511
2121
- Remove feature to index external RDF files and search them #579
22-
- Replace `acme_lib` with `instant-acme`, drop OpenSSL dependency #192
22+
- Replace `acme_lib` with `instant-acme`, drop OpenSSL dependency, add DNS verification for TLS option with `--https-dns` #192
2323
- Add staging environment #588
2424
- Add systemd instructions to readme #271
2525

lib/src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::{
1313
/// Checks the datatypes for the Values.
1414
/// Ignores all atoms where the subject is different.
1515
/// WARNING: Calls store methods, and is called by store methods, might get stuck in a loop!
16-
#[tracing::instrument(skip(store))]
16+
#[tracing::instrument(skip(store), level = "info")]
1717
pub fn fetch_resource(
1818
subject: &str,
1919
store: &impl Storelike,
@@ -63,7 +63,7 @@ pub fn fetch_body(url: &str, content_type: &str, for_agent: Option<Agent>) -> At
6363
.get(url)
6464
.set("Accept", content_type)
6565
.call()
66-
.map_err(|e| format!("Error when fetching {} : {}", url, e))?;
66+
.map_err(|e| format!("Error when server tried fetching {} : {}", url, e))?;
6767
let status = resp.status();
6868
let body = resp
6969
.into_string()

server/src/config.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,37 @@ pub struct Opts {
3131
#[clap(long, default_value = "localhost", env = "ATOMIC_DOMAIN")]
3232
pub domain: String,
3333

34-
/// The contact mail address for Let's Encrypt HTTPS setup
35-
#[clap(long, env = "ATOMIC_EMAIL")]
36-
pub email: Option<String>,
37-
3834
// 9.883 is decimal for the `⚛` character.
3935
/// The port where the HTTP app is available. Set to 80 if you want this to be available on the network.
4036
#[clap(short, long, default_value = "9883", env = "ATOMIC_PORT")]
4137
pub port: u32,
4238

43-
/// The port where the HTTPS app is available. Sert to 443 if you want this to be available on the network.
44-
#[clap(long, default_value = "9884", env = "ATOMIC_PORT_HTTPS")]
39+
/// The port where the HTTPS app is available. Set to 443 if you want this to be available on the network.
40+
#[clap(
41+
long,
42+
default_value = "9884",
43+
env = "ATOMIC_PORT_HTTPS",
44+
requires = "https"
45+
)]
4546
pub port_https: u32,
4647

4748
/// The IP address of the server. Set to :: if you want this to be available to other devices on your network.
4849
#[clap(long, default_value = "::", env = "ATOMIC_IP")]
4950
pub ip: IpAddr,
5051

5152
/// Use HTTPS instead of HTTP.
52-
/// Will get certificates from LetsEncrypt.
53+
/// Will get certificates from LetsEncrypt fully automated.
5354
#[clap(long, env = "ATOMIC_HTTPS")]
5455
pub https: bool,
5556

57+
/// Initializes DNS-01 challenge for LetsEncrypt. Use this if you want to use subdomains.
58+
#[clap(long, env = "ATOMIC_HTTPS_DNS", requires = "https")]
59+
pub https_dns: bool,
60+
61+
/// The contact mail address for Let's Encrypt HTTPS setup
62+
#[clap(long, env = "ATOMIC_EMAIL")]
63+
pub email: Option<String>,
64+
5665
/// Endpoint where the front-end assets are hosted
5766
#[clap(long, default_value = "/app_assets", env = "ATOMIC_ASSET_URL")]
5867
pub asset_url: String,
@@ -86,6 +95,7 @@ pub struct Opts {
8695
pub log_level: LogLevel,
8796

8897
/// How you want to trace what's going on with the server. Useful for monitoring performance and errors in production.
98+
/// Combine with `log_level` to get more or less data (`trace` is the most verbose)
8999
#[clap(arg_enum, long, env = "ATOMIC_TRACING", default_value = "stdout")]
90100
pub trace: Tracing,
91101
}

0 commit comments

Comments
 (0)