Skip to content

Commit

Permalink
Add https-dns option #192
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Feb 10, 2023
1 parent 4ae12ab commit 065748f
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 79 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See [STATUS.md](server/STATUS.md) to learn more about which features will remain
- Meta tags server side #577
- Include JSON-AD in initial response, speed up first render #511
- Remove feature to index external RDF files and search them #579
- Replace `acme_lib` with `instant-acme`, drop OpenSSL dependency #192
- Replace `acme_lib` with `instant-acme`, drop OpenSSL dependency, add DNS verification for TLS option with `--https-dns` #192
- Add staging environment #588
- Add systemd instructions to readme #271

Expand Down
4 changes: 2 additions & 2 deletions lib/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
/// Checks the datatypes for the Values.
/// Ignores all atoms where the subject is different.
/// WARNING: Calls store methods, and is called by store methods, might get stuck in a loop!
#[tracing::instrument(skip(store))]
#[tracing::instrument(skip(store), level = "info")]
pub fn fetch_resource(
subject: &str,
store: &impl Storelike,
Expand Down Expand Up @@ -63,7 +63,7 @@ pub fn fetch_body(url: &str, content_type: &str, for_agent: Option<Agent>) -> At
.get(url)
.set("Accept", content_type)
.call()
.map_err(|e| format!("Error when fetching {} : {}", url, e))?;
.map_err(|e| format!("Error when server tried fetching {} : {}", url, e))?;
let status = resp.status();
let body = resp
.into_string()
Expand Down
24 changes: 17 additions & 7 deletions server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,37 @@ pub struct Opts {
#[clap(long, default_value = "localhost", env = "ATOMIC_DOMAIN")]
pub domain: String,

/// The contact mail address for Let's Encrypt HTTPS setup
#[clap(long, env = "ATOMIC_EMAIL")]
pub email: Option<String>,

// 9.883 is decimal for the `⚛` character.
/// The port where the HTTP app is available. Set to 80 if you want this to be available on the network.
#[clap(short, long, default_value = "9883", env = "ATOMIC_PORT")]
pub port: u32,

/// The port where the HTTPS app is available. Sert to 443 if you want this to be available on the network.
#[clap(long, default_value = "9884", env = "ATOMIC_PORT_HTTPS")]
/// The port where the HTTPS app is available. Set to 443 if you want this to be available on the network.
#[clap(
long,
default_value = "9884",
env = "ATOMIC_PORT_HTTPS",
requires = "https"
)]
pub port_https: u32,

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

/// Use HTTPS instead of HTTP.
/// Will get certificates from LetsEncrypt.
/// Will get certificates from LetsEncrypt fully automated.
#[clap(long, env = "ATOMIC_HTTPS")]
pub https: bool,

/// Initializes DNS-01 challenge for LetsEncrypt. Use this if you want to use subdomains.
#[clap(long, env = "ATOMIC_HTTPS_DNS", requires = "https")]
pub https_dns: bool,

/// The contact mail address for Let's Encrypt HTTPS setup
#[clap(long, env = "ATOMIC_EMAIL")]
pub email: Option<String>,

/// Endpoint where the front-end assets are hosted
#[clap(long, default_value = "/app_assets", env = "ATOMIC_ASSET_URL")]
pub asset_url: String,
Expand Down Expand Up @@ -86,6 +95,7 @@ pub struct Opts {
pub log_level: LogLevel,

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

0 comments on commit 065748f

Please sign in to comment.