<!--
Copyright (C) 2026 Ordinary Labs, LLC.

SPDX-License-Identifier: AGPL-3.0-only
-->

# Ordinary Server

[![crates.io](https://img.shields.io/crates/v/ordinaryd.svg)](https://crates.io/crates/ordinaryd/0.6.0-pre.8)
[![docs.rs](https://img.shields.io/docsrs/ordinaryd/0.6.0-pre.8)](https://docs.rs/ordinaryd/0.6.0-pre.8)
[![dependency status](https://deps.rs/crate/ordinaryd/0.6.0-pre.8/status.svg)](https://deps.rs/crate/ordinaryd/0.6.0-pre.8)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

Server daemon for Ordinary.

The Ordinary Server is primarily built on [axum](https://docs.rs/axum/latest/axum/)
and [Tokio](https://docs.rs/tokio/latest/tokio/).

OpenAPI docs are generated with [Utoipa](https://docs.rs/utoipa/latest/utoipa/).

CNAME verification is performed using [Hickory DNS](https://crates.io/crates/hickory-client).

## Installation

From [releases](https://codeberg.org/ordinarylabs/Ordinary/releases) or using cargo.

```sh
cargo install ordinaryd@0.6.0-pre.8
```

## Quick Start

Initialize a new instance.

```sh
ordinaryd init \
    --password '******' \
    --environment development \
    --api-domain ordinaryd.local \
    --storage-size 10000000
```

Start initialized instance.

```sh
ordinaryd api \
    --environment development \
    --api-domain ordinaryd.local \
    --provision localhost \
    --insecure \
    --port 4433 \
    --redirect-port 8080 \
    --storage-size 10000000 \
    --stdio-logs \
    --swagger
```

## CLI Documentation

```sh
ordinaryd --help
```

See: [docs/cli-reference.md](https://codeberg.org/ordinarylabs/Ordinary/src/branch/main/core/apps/daemon/docs/cli-reference.md).

## On Shutdown (terminate/ctrl-c)

When shutdown, the daemon will "gracefully" shut down all open http1/http2 connections
via [`hyper`'s](https://docs.rs/hyper/latest/hyper/)
[
`graceful_shutdown`](https://docs.rs/hyper-util/latest/hyper_util/server/conn/auto/struct.UpgradeableConnection.html#method.graceful_shutdown)
method; this should allow for all connection dependent tasks to resolve prior to termination.

Non-connection based background tasks (cache and log syncing) still need to be set up to run a final time prior to
termination
and after all connections have been closed.

## License

Copyright 2026 Ordinary Labs, LLC

Licensed under the GNU `AGPLv3`: <https://www.gnu.org/licenses/agpl-3.0.html>

## Security

THIS CODE HAS NOT BEEN AUDITED OR REVIEWED. USE AT YOUR OWN RISK.

Refer to the [Security Policy](https://codeberg.org/ordinarylabs/Ordinary/src/branch/main/SECURITY.md).
