Skip to main content

Crate arks_server

Crate arks_server 

Source
Expand description

arks-server — Git server role (M11 / M25 / Phase Sv + Sv2). Claimed: smart HTTP (G15), dumb/SSH/v2/git:// (G29–G32), additive WebDAV write for dumb HTTP push (R2), optional HTTP Basic (G36), receive-pack githooks honor list (pre-receive/update/post-receive), and native info/lfs Batch + Basic Transfer server (E7).

Re-exports§

pub use web_ui::WEB_UI_CSP;
pub use web_ui::handle_web_ui;
pub use web_ui::html_escape;
pub use web_ui::web_ui_page_handler;

Modules§

lfs
Native Git LFS server endpoints for arks serve (info/lfs, E7).
web_ui
Embedded single-binary SSR Web UI for arks serve (E8).

Structs§

BasicAuthConfig
Configured Basic auth store (one or more credentials).
BasicCredential
One plaintext Basic credential (userid + password).
DaemonListeners
Bound listening sockets (bind first, drop privileges, then serve).
DaemonLog
Shared daemon logger (cheap to clone; one sink per process).
DaemonOptions
Request-serving options of git daemon (everything except socket setup and process control, which the CLI owns).
HostInfo
Result of resolving the host name a client sent with host=.
HttpRequest
HttpResponse
Pusher
What the transport knows about the pusher.
RefUpdate
One requested ref update; an all-zero old creates, an all-zero new deletes.
ServeHttpOptions
ServeSshOptions
Options for the in-process SSH git listener.
ServicePolicy
Site-wide default for one service.
ServiceTable
Site-wide policy of every service (git defaults: only upload-pack enabled, every service overridable).
StdPlatform
Standard-library implementation.

Enums§

DaemonOutcome
What happened to one request.
DaemonService
A git:// service the daemon can run.
LogDestination
Where log lines go.
ServerError

Constants§

BASIC_REALM
Default realm advertised in WWW-Authenticate challenges.
DEFAULT_DAEMON_PORT
Default git:// port (IANA git, git DEFAULT_GIT_PORT).
SYSLOG_IDENT
Syslog identifier used by arks daemon.
SYSLOG_SOCKET
Default local syslog socket.

Traits§

DaemonPlatform
OS services used while resolving a request.
PushPolicy
Decides, per ref update, whether a push may proceed.

Functions§

base64_encode
Encode bytes as standard Base64 (no wrapping) — used by tests / header builders.
basic_authorization_header
bind_daemon
Bind every address of every --listen host on port. With no host, bind all interfaces as git does. Fails only when nothing could be bound.
default_authorized_keys_path
Default authorized_keys: ARKS_SERVE_SSH_AUTHORIZED_KEYS or ~/.config/arks/ssh/authorized_keys.
default_host_key_path
Default host key: ARKS_SERVE_SSH_HOST_KEY or ~/.config/arks/ssh/host_key.
dumb_info_refs_body
Build dumb info/refs body (TAB-separated; no HEAD; C-locale sort).
handle_smart_http
Handle one HTTP request against an open repository (smart + dumb + v2).
handle_smart_http_auth
Like handle_smart_http, with optional Basic auth gate (LFS enabled by default).
handle_v2_request
Handle a v2 command request body (after capability advertisement).
install_push_policy
Install (or clear) the process-wide policy used by the serving receive-pack paths.
installed_push_policy
The installed policy, if any.
load_server_config
Load a rustls ServerConfig from operator-supplied PEM cert + key paths.
receive_advertisement
Smart-HTTP receive-pack advertisement.
receive_pack
receive-pack with the installed push policy and a local pusher.
receive_pack_advertisement
Pack-protocol duplex receive-pack advertisement (SSH / stdio).
receive_pack_as
receive-pack with the installed push policy (crate::install_push_policy).
receive_pack_session
receive_pack_stream
receive_pack_stream_as
receive_pack_stream for a known transport pusher (push policy input).
receive_pack_with
receive-pack gated by an explicit push policy: each refused ref is reported ng <ref> <reason> and left unchanged; other refs proceed.
serve_daemon
Serve git:// on listeners until stop is set.
serve_daemon_inetd
--inetd: serve exactly one connection on input/output. peer is the remote address when the CLI could read it from the inherited socket.
serve_dumb_path
Resolve a dumb HTTP GET path under the repository to bytes + content-type.
serve_http
Bind addr and serve git_dir over smart HTTP until stop is set or accept fails.
serve_http_scheme
Scheme label for listen banners (http or https).
serve_http_with_opts
serve_ssh_listener
Run an in-process SSH listener (durable accept per SoT §17(c)).
spawn_loopback
Bind an ephemeral port; return (bound addr, join handle, stop flag).
spawn_loopback_daemon
Bind an ephemeral loopback daemon; return (addr, stop, join).
spawn_loopback_ssh
Ephemeral loopback SSH listener for arks serve ssh-smoke --git-pack.
spawn_loopback_with_opts
spawn_ssh_listener
Spawn durable SSH listener on a background thread (cohost with HTTP/forge).
update_server_info
Write info/refs and objects/info/packs for dumb HTTP clients.
upload_advertisement
Smart-HTTP upload-pack advertisement (# service=git-upload-pack).
upload_pack_advertisement
Pack-protocol duplex advertisement (SSH / git:// / stdio) — no HTTP service line.
upload_pack_result
upload_pack_session
Separate read/write halves (CLI stdio).
upload_pack_stream
Single duplex stream (git:// TcpStream).
v2_capability_advertisement
v2_capability_lines
Capability lines advertised for v2 (commands + agent).

Type Aliases§

ListenRebindSlot
Shared slot: when set to Some(addr), the HTTP accept loop performs a bounded dual-bind rebind. B7 is Claimed for the evidenced HTTP scenario; SSH/forge rebind and OpenSSH-class interop are separate gates.
PageHandler
Optional page handler consulted for GET requests before git HTTP; it answers Some(response) for the paths it owns and None for the rest (used by instaweb for its repository browser pages).
ProductTlsServerConfig
Operator-supplied in-process TLS server config (B9); avoids naming rustls in CLI crates.