pub enum Exposure {
Loopback,
Internal {
url: String,
},
Tailscale {
url: String,
},
Public {
url: String,
},
}Expand description
Serialized form on disk uses an internal kind tag so the variant
is explicit in the TOML — no guessing whether url = "foo.ts.net"
implies Tailscale-mode or not.
Variants§
Loopback
No public-facing URL. Service runs on http://127.0.0.1:<port>
only — reachable from the host but nothing routes external
traffic to it. Used for services that don’t need a domain
(e.g. inbucket when the user only hits it via localhost).
Internal
LAN-only via Caddy at a *.internal hostname. Self-signed
certs from Caddy’s internal CA — useful on a single machine
where the user has imported ryra’s CA into their browser.
Tailscale
Exposed on the user’s tailnet at <service>.<tailnet>.ts.net
via tailscale serve on the host. Real cert from the
Tailscale-managed CA, no Caddyfile entry needed.
Public
A public hostname. Caddy is the reverse proxy when installed
(LE or self-signed depending on tls.caddy); without Caddy,
the user is fronting with their own proxy (Cloudflare Tunnel,
nginx, etc.) and ryra leaves routing alone.
Implementations§
Source§impl Exposure
impl Exposure
Sourcepub fn url(&self) -> Option<&str>
pub fn url(&self) -> Option<&str>
Browser-visible URL, if any. Convenient when something
downstream is OK with Option<&str> (template context, OIDC
redirects) and doesn’t care about the routing variant.
Sourcepub fn is_tailscale(&self) -> bool
pub fn is_tailscale(&self) -> bool
True when this exposure is reached via tailscale serve instead
of Caddy. Used to skip Caddyfile routes for *.ts.net URLs.
Sourcepub fn tailscale_svc_name(&self) -> Option<String>
pub fn tailscale_svc_name(&self) -> Option<String>
For Tailscale exposures, the Tailscale Service name (the part
after svc: — i.e. the first DNS label of the URL host). With
per-host scoping this is <service>-<host> (e.g.
vikunja-debian). Used by remove/reset paths to address the
admin-API service definition without re-deriving the host from
tailscale status (the URL was captured at install time, so
renaming the host post-install doesn’t break teardown).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Exposure
impl<'de> Deserialize<'de> for Exposure
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>,
impl Eq for Exposure
impl StructuralPartialEq for Exposure
Auto Trait Implementations§
impl Freeze for Exposure
impl RefUnwindSafe for Exposure
impl Send for Exposure
impl Sync for Exposure
impl Unpin for Exposure
impl UnsafeUnpin for Exposure
impl UnwindSafe for Exposure
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.