Report onion service status
I've started working on a branch to report OnionServiceStatus
events from an onion service. But before I get too much farther I'd like to figure out what we actually want the status object to look like.
As far as I can tell, this might be as simple as:
enum State {
/// We have been offline, or we just initialized. We are trying to publish
/// and haven't hit any significant problems yet.
Bootstrapping,
/// Publication has been successful
Running,
/// We have encountered a problem (like a dead intro point) and are recovering
/// from it and have not yet failed.
Recovering, // <--- not sure about this one.
/// There is a problem with this onion service from which we have not been
/// able to recover
Broken,
}
impl OnionServiceStatus {
pub fn state(&self) -> State;
pub fn current_problem(&self) -> Option<&tor_hsservice::Error>
}
@gabi-250 @Diziet Please refine?
Also, once we have support externally provisioned keys, we will want to have a way to tell the user, "We are not yet in trouble because of missing key X, but we will need it soon." I am not sure if that is a new State
, or if it is orthogonal.
(Also: There is other data we might want to eventually expose from an onion service, like: the total number of incoming connections received, the fraction of incoming connections rejected, the number of active introduction points, the fraction of directories we've been able to publish to, how many active blinded identities we have, etc. I suggest that we should not include these in OnionServiceStatus
.)
Also see TODO (#1083)
comments in the code!