Skip to main content

Crate ryra_core

Crate ryra_core 

Source

Re-exports§

pub use capability::Capability;
pub use capability::any_installed_provider;
pub use capability::find_installed_provider;
pub use capability::installed_provides;
pub use capability::service_provides;
pub use configure::ConfigureChange;
pub use configure::ConfigureResult;
pub use configure::EnvKeyChange;
pub use configure::ExposureChange;
pub use configure::Overrides as ConfigureOverrides;
pub use configure::ServiceReconcile;
pub use configure::configure_service;
pub use configure::reconcile_service;
pub use exposure::Exposure;
pub use exposure::check_auth_exposure_compat;
pub use exposure::is_caddy_local_url;
pub use exposure::is_public_url;
pub use exposure::is_tailscale_url;
pub use generate::GeneratedFile;
pub use manifest::ManifestEntry;
pub use manifest::manifest_path;
pub use metadata::Metadata;
pub use metadata::load_metadata;
pub use paths::CONFIG_DIR_ENV;
pub use paths::DATA_DIR_ENV;
pub use paths::DEFAULT_REGISTRY_URL;
pub use paths::REGISTRY_DEFAULT;
pub use paths::REGISTRY_DIR_ENV;
pub use paths::metadata_path;
pub use paths::quadlet_dir;
pub use paths::service_data_root;
pub use paths::service_home;
pub use paths::systemd_user_dir;
pub use plan::AddResult;
pub use plan::RemoveResult;
pub use plan::ResetResult;
pub use plan::Step;
pub use plan::TailscalePort;
pub use plan::TrackedEnv;
pub use plan::Warning;
pub use upgrade::BackupSnapshot;
pub use upgrade::DEFAULT_BACKUP_KEEP;
pub use upgrade::DiffEntry;
pub use upgrade::DiffKind;
pub use upgrade::DiffResult;
pub use upgrade::EnvAddition;
pub use upgrade::RevertResult;
pub use upgrade::UpgradeResult;
pub use upgrade::diff_service;
pub use upgrade::list_backups;
pub use upgrade::prune_backups;
pub use upgrade::revert_service;
pub use upgrade::upgrade_service;
pub use well_known::WellKnownService;

Modules§

auth_bridge
Auth bridge: artifacts that let an auth-enabled service talk to Caddy+Authelia.
authelia
backup
Backup planning. Pure functions that take service install state + the user’s backup config and produce typed plans the CLI executes.
caddy
capability
Capabilities a service provides to other services.
config
configure
ryra configure <service> — re-plan an installed service with a caller-supplied set of Overrides applied on top of its current recorded state.
data
Per-service data enumeration for ryra list + the data-preserving variant of ryra remove.
deploy
Blue/green deploy: the runtime-agnostic step sequence for a zero-downtime color swap.
error
exposure
How a service is exposed to clients. Decided once at install time (--url, --tailscale, the interactive prompt, or auto-derived) and threaded through the planner so every code path that needs to know “where does this service live?” pattern-matches a single typed value instead of juggling a parallel (Option<url>, bool) pair where some combinations were silently invalid (e.g. a *.ts.net URL with tailscale_enabled = false).
from_protocol
Convert the wire protocol’s request payloads (ryra_protocol) into the engine’s ops request types. The protocol crate is deliberately engine-free, so the mapping lives here, where both types are in scope. Every field is mirrored by name, so a shape change on either side surfaces as a compile error.
generate
manifest
Render manifest for an installed service. One per install, persisted to ~/.local/share/services/<svc>/service.manifest.
metadata
Per-install record. Written at ryra add time, read by every command that needs to know how a service was set up. Mirrors the data that used to live in # Service-* quadlet header comments.
metrics_bridge
Wiring between metrics-store providers (prometheus), services that expose a [metrics] endpoint, and metrics-dashboard providers (grafana).
ops
Frontend-neutral operation vocabulary.
paths
Filesystem paths ryra reads and writes.
plan
Typed steps the CLI executes, the warnings it surfaces, and the result shapes returned from add / remove / reset. Pattern matching ensures every step type is handled — no string parsing or if-chains.
registry
system
to_protocol
The reverse of crate::from_protocol: turn the engine’s ops request types into the wire protocol’s payloads. A client that builds ops requests (e.g. ryra-api, which constructs them to authorize) uses these to send the request over rpc. Field-by-field, so a shape change is a compile error.
upgrade
Diff and upgrade flows for already-installed services.
well_known
Infrastructure services ryra knows about for cross-service integration (joining networks, configuring OIDC, setting up TLS).

Structs§

AddServiceParams
Inputs to add_service. One typed request instead of a positional argument list, so call sites (CLI today, other frontends later) name what they’re asking for and the retry path can’t drift out of sync with the original call.
RecordPendingParams
Parameters for record_pending.
SearchResult
ServiceDetail
ServiceTestInfo

Enums§

AuthChoice
The user’s auth decision for one install.
Lifecycle
A lifecycle transition applied to an installed service’s unit family.
PlanMode
Why the planner is running. The render path is shared between fresh installs and re-renders (ryra upgrade); the side-effect steps are not — re-registering an OIDC client on upgrade would mint a new client_id/client_secret against authelia’s existing entry, and patching every other installed service’s quadlet (retroactive network joins) is install-time work. The mode gates those.
RemoveMode
How destructive remove_service should be.

Functions§

add_service
Add a service: generate config, return steps to execute.
finalize_remove
Drop the cached [auth] block when the auth provider is removed — otherwise a later ryra add <svc> --auth thinks auth is still configured and skips the auto-install path, then bombs out trying to register an OIDC client against a non-existent authelia config. The function name is preserved for caller compatibility; quadlet removal is what actually finalises the install state.
finalize_reset
Called after reset steps succeed — removes ryra’s config directory.
is_service_installed
True if the named service is ryra-managed and fully installed — the marker’d .container is present AND metadata.toml exists. A partial install (quadlets written but the install plan errored before metadata.toml landed) is treated as not-installed so that ryra remove <svc> --purge routes through the orphan-cleanup path instead of failing with “service is not installed”. Same source of truth as list_installed.
lifecycle_steps
Plan a start/stop of an installed service’s full unit family (main container + sidecars). Errors with Error::ServiceNotInstalled if the service isn’t installed.
list_installed
List installed services. Quadlet directory is the source of truth — every service whose main .container file carries our marker is reconstructed from its on-disk headers + .env. The preferences file is only consulted as a fallback for entries the scan can’t see (e.g. partially-rolled-out installs from older ryra versions before metadata headers landed).
orphan_purge_steps
quadlet_belongs_to
Check if a quadlet filename belongs to a service.
record_pending
Record a service as pending installation (installed: false). Called BEFORE executing steps so that partial failures are recoverable. Persist install-time scaffolding to preferences.toml. This is now the only side-effect — quadlet headers track the install itself, preferences just remembers cross-cutting defaults so the next ryra add --auth doesn’t have to re-prompt for the OIDC issuer.
remove_service
Remove a service: update state, return cleanup steps.
reset
Reset ryra: tear down all services, infrastructure, and config.
resolve_registry_dir
Resolve the registry directory for a service reference.
scan_managed_services
Scan the user’s quadlet directory for ryra-managed services. A .container file is considered ryra-managed iff it carries a # Service-Source: registry/<name> comment within its first 16 lines (added at install time). Returns the deduplicated set of service names found.
search_services
Search available services in a repo, optionally filtered by query.
service_info
Get detailed info about a service from a repo.
service_ref_from_installed
Build a ServiceRef from an installed service’s stored registry name.
service_tests
Get test definitions for an installed service by reading its test.toml.
status
Get the current status of the ryra installation. Considers ryra “initialized” when EITHER a marker’d quadlet is on disk OR a preferences.toml exists — quadlets are the source of truth for installed services, but a preferences-only state (e.g. an SMTP relay configured before any service install) still counts.