Implement dual host configuration: bind_host and hostname
- Replace 'host' config with separate 'bind_host' and 'hostname' - bind_host: IP/interface for server binding (default 0.0.0.0) - hostname: Domain for URI validation (required) - Update all parsing and validation code - Create dist/ directory with systemd service, config, and install guide - Add comprehensive INSTALL.md with setup instructions
This commit is contained in:
parent
1665df65da
commit
ea8083fe1f
7 changed files with 333 additions and 13 deletions
|
|
@ -6,7 +6,7 @@ pub enum PathResolutionError {
|
|||
NotFound,
|
||||
}
|
||||
|
||||
pub fn parse_gemini_url(request: &str, expected_host: &str, expected_port: u16) -> Result<String, ()> {
|
||||
pub fn parse_gemini_url(request: &str, hostname: &str, expected_port: u16) -> Result<String, ()> {
|
||||
if let Some(url) = request.strip_prefix("gemini://") {
|
||||
let host_port_end = url.find('/').unwrap_or(url.len());
|
||||
let host_port = &url[..host_port_end];
|
||||
|
|
@ -21,7 +21,7 @@ pub fn parse_gemini_url(request: &str, expected_host: &str, expected_port: u16)
|
|||
};
|
||||
|
||||
// Validate host
|
||||
if host != expected_host {
|
||||
if host != hostname {
|
||||
return Err(()); // Hostname mismatch
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue