pub struct Config {
pub phc_url: UrlPwa,
pub log: Option<LogConfig>,
pub(crate) preparation_state: PreparationState,
pub host_aliases: HostAliases,
pub wd: PathBuf,
pub phc: Option<ServerConfig<ExtraConfig>>,
pub transcryptor: Option<ServerConfig<ExtraConfig>>,
pub auths: Option<ServerConfig<ExtraConfig>>,
}Expand description
Configuration for one, or several, of the PubHubs servers
Also used for the pubhubs admin cli command. In that case only phc_url needs to be set.
Fields§
§phc_url: UrlPwaURL of the PubHubs Central server.
Any information on the other servers that can be stored at PHC is stored at PHC.
log: Option<LogConfig>Configure logging. Overwrites what’s passed through RUST_LOG.
preparation_state: PreparationState§host_aliases: HostAliasesSpecify abbreviations for an IP address that are only valid in this configuration file.
Any UrlPwa that contains one of the aliases as host name exactly (so no subdomain) will be modified to have as host name the associated IP address.
wd: PathBufPath with respect to which relative paths are interpretted.
phc: Option<ServerConfig<ExtraConfig>>Configuration to run PubHubs Central
transcryptor: Option<ServerConfig<ExtraConfig>>Configuration to run the Transcryptor
auths: Option<ServerConfig<ExtraConfig>>Configuration to run the Authentication Server
Implementations§
Source§impl Config
impl Config
Sourcepub fn load_from_path(path: &Path) -> Result<Option<Self>>
pub fn load_from_path(path: &Path) -> Result<Option<Self>>
pub fn preliminary_prep(&mut self) -> Result<()>
Sourcepub async fn prepare_for(&self, server: Name) -> Result<Self>
pub async fn prepare_for(&self, server: Name) -> Result<Self>
Clones this configuration and strips out everything that’s not needed to run the specified server. Also generated any random values not yet set.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PrepareConfig<Rc<Extensions>> for Config
impl PrepareConfig<Rc<Extensions>> for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more