diff options
Diffstat
| -rw-r--r-- | .cargo/config.toml | 5 | +5 −0 |
| -rw-r--r-- | .dockerignore | 9 | +0 −9 |
| -rw-r--r-- | .editorconfig | 26 | +0 −26 |
| -rw-r--r-- | .github/workflows/build.yml | 278 | +87 −191 |
| -rw-r--r-- | .github/workflows/cla.yml | 30 | +30 −0 |
| -rw-r--r-- | .github/workflows/legal.yml | 35 | +0 −35 |
| -rw-r--r-- | .gitignore | 10 | +3 −7 |
| -rw-r--r-- | .mailmap | 7 | +0 −7 |
| -rw-r--r-- | CLA.md | 111 | +69 −42 |
| -rw-r--r-- | CODEOWNERS | 4 | +0 −4 |
| -rw-r--r-- | Cargo.lock | 798 | +422 −376 |
| -rw-r--r-- | Cargo.toml | 6 | +3 −3 |
| -rw-r--r-- | Dockerfile | 29 | +0 −29 |
| -rw-r--r-- | LICENSES/CC-BY-3.0.txt | 319 | +0 −319 |
| -rw-r--r-- | LICENSES/CC-BY-4.0.txt | 156 | +0 −156 |
| -rw-r--r-- | Makefile | 48 | +48 −0 |
| -rw-r--r-- | README.md | 99 | +32 −67 |
| -rw-r--r-- | REUSE.toml | 40 | +10 −30 |
| -rw-r--r-- | charts/tesor/Chart.yaml | 10 | +0 −10 |
| -rw-r--r-- | charts/tesor/templates/_helpers.tpl | 37 | +0 −37 |
| -rw-r--r-- | charts/tesor/templates/configmap.yaml | 46 | +0 −46 |
| -rw-r--r-- | charts/tesor/templates/deployment.yaml | 97 | +0 −97 |
| -rw-r--r-- | charts/tesor/templates/httproute.yaml | 26 | +0 −26 |
| -rw-r--r-- | charts/tesor/templates/pvc.yaml | 22 | +0 −22 |
| -rw-r--r-- | charts/tesor/templates/service.yaml | 19 | +0 −19 |
| -rw-r--r-- | charts/tesor/values.yaml | 78 | +0 −78 |
| -rw-r--r-- | crates/base/Cargo.toml | 2 | +1 −1 |
| -rw-r--r-- | crates/base/src/lib.rs | 2 | +1 −1 |
| -rw-r--r-- | crates/base/src/serde.rs | 2 | +1 −1 |
| -rw-r--r-- | crates/repos/Cargo.toml | 2 | +1 −1 |
| -rw-r--r-- | crates/repos/src/go.rs | 6 | +3 −3 |
| -rw-r--r-- | crates/repos/src/lib.rs | 2 | +1 −1 |
| -rw-r--r-- | crates/repos/src/zig.rs | 2 | +1 −1 |
| -rw-r--r-- | crates/tesor/build.rs | 30 | +0 −30 |
| -rw-r--r-- | crates/zorian/Cargo.toml (renamed from crates/tesor/Cargo.toml) | 10 | +7 −3 |
| -rw-r--r-- | crates/zorian/build.rs | 13 | +13 −0 |
| -rw-r--r-- | crates/zorian/src/assets/apple-touch-icon.png (renamed from crates/tesor/src/assets/apple-touch-icon.png) | bin | 715 -> 715 bytes |
| -rw-r--r-- | crates/zorian/src/assets/base.css (renamed from crates/tesor/src/assets/base.css) | 2 | +1 −1 |
| -rw-r--r-- | crates/zorian/src/assets/favicon-192.png (renamed from crates/tesor/src/assets/favicon-192.png) | bin | 715 -> 715 bytes |
| -rw-r--r-- | crates/zorian/src/assets/favicon-512.png (renamed from crates/tesor/src/assets/favicon-512.png) | bin | 2329 -> 2329 bytes |
| -rw-r--r-- | crates/zorian/src/assets/favicon.ico (renamed from crates/tesor/src/assets/favicon.ico) | bin | 32038 -> 32038 bytes |
| -rw-r--r-- | crates/zorian/src/assets/favicon.svg (renamed from crates/tesor/src/assets/favicon.svg) | 0 | +0 −0 |
| -rw-r--r-- | crates/zorian/src/assets/jetbrainsmono/JetBrainsMono-Italic[wght].woff2 (renamed from crates/tesor/src/assets/jetbrainsmono/JetBrainsMono-Italic[wght].woff2) | bin | 122452 -> 122452 bytes |
| -rw-r--r-- | crates/zorian/src/assets/jetbrainsmono/JetBrainsMono[wght].woff2 (renamed from crates/tesor/src/assets/jetbrainsmono/JetBrainsMono[wght].woff2) | bin | 113700 -> 113700 bytes |
| -rw-r--r-- | crates/zorian/src/assets/manifest.webmanifest (renamed from crates/tesor/src/assets/manifest.webmanifest) | 2 | +1 −1 |
| -rw-r--r-- | crates/zorian/src/assets/robots.txt (renamed from crates/tesor/src/assets/robots.txt) | 0 | +0 −0 |
| -rw-r--r-- | crates/zorian/src/config.rs (renamed from crates/tesor/src/config.rs) | 10 | +5 −5 |
| -rw-r--r-- | crates/zorian/src/controller_backend.rs (renamed from crates/tesor/src/controller_backend.rs) | 2 | +1 −1 |
| -rw-r--r-- | crates/zorian/src/controller_web.rs (renamed from crates/tesor/src/controller_web.rs) | 18 | +9 −9 |
| -rw-r--r-- | crates/zorian/src/main.rs (renamed from crates/tesor/src/main.rs) | 10 | +5 −5 |
| -rw-r--r-- | crates/zorian/src/proxy.rs (renamed from crates/tesor/src/proxy.rs) | 4 | +2 −2 |
| -rw-r--r-- | crates/zorian/src/storage.rs (renamed from crates/tesor/src/storage.rs) | 2 | +1 −1 |
| -rw-r--r-- | crates/zorian/src/telemetry.rs (renamed from crates/tesor/src/telemetry.rs) | 6 | +3 −3 |
| -rw-r--r-- | deny.toml | 5 | +3 −2 |
| -rw-r--r-- | mise.lock | 73 | +0 −73 |
| -rw-r--r-- | mise.toml | 65 | +0 −65 |
| -rw-r--r-- | nfpm.yaml | 26 | +13 −13 |
| -rw-r--r-- | pkg/logo.svg | 5 | +5 −0 |
| -rw-r--r-- | pkg/scripts/postinstall.sh | 6 | +3 −3 |
| -rw-r--r-- | pkg/scripts/preinstall.sh | 15 | +8 −7 |
| -rw-r--r-- | pkg/scripts/preremove.sh | 8 | +4 −4 |
| -rw-r--r-- | pkg/zorian.service (renamed from pkg/tesor.service) | 12 | +6 −6 |
| -rw-r--r-- | pkg/zorian.toml (renamed from pkg/tesor.toml) | 22 | +11 −11 |
| -rw-r--r-- | tests/smoke/Cargo.toml | 2 | +1 −1 |
| -rwxr-xr-x | tests/smoke/run-local.sh | 28 | +15 −13 |
| -rw-r--r-- | tests/smoke/src/main.rs | 38 | +19 −19 |
| -rw-r--r-- | xtask/Cargo.toml | 16 | +16 −0 |
| -rw-r--r-- | xtask/build.rs | 9 | +9 −0 |
| -rw-r--r-- | xtask/src/lib.rs | 4 | +4 −0 |
| -rw-r--r-- | xtask/src/licenses.rs | 615 | +615 −0 |
| -rw-r--r-- | xtask/src/main.rs | 19 | +19 −0 |
71 files changed, 1517 insertions, 1923 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> +# SPDX-License-Identifier: AGPL-3.0-or-later + +[alias] +xtask = "run --release --package xtask --" diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 --- a/.dockerignore +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -.git -.github -.tesor-state -dist -target -*.lcov diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 --- a/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -indent_style = space -indent_size = 4 - -[*.md] -# double whitespace at end of line -# denotes a line break in Markdown -trim_trailing_whitespace = false - -[*.rs] -max_line_length = 100 - -[*.yml] -indent_size = 2 - -[{Makefile,*.mk}] -indent_style = tab diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4078821..7e70498 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later name: Build @@ -10,16 +10,9 @@ on: pull_request: branches: [main] -permissions: - contents: read - -concurrency: - group: tesor-build-${{ github.ref }} - cancel-in-progress: true - env: CARGO_TERM_COLOR: always - RELEASE_TAG: nightly + RELEASE_TAG: dev jobs: lint: @@ -28,23 +21,20 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 - with: - version: 2026.7.5 - experimental: true - install: false - - name: Install dependencies - run: mise bootstrap --locked --yes --update + - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 - - name: formatting - run: cargo fmt --all --check + - name: Check licenses + uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0 + + - name: Check dependencies + uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # 0.19.0 - - name: shellcheck - run: shellcheck pkg/scripts/*.sh tests/smoke/*.sh + - name: Check formatting + run: cargo fmt --all --check - - name: clippy - run: cargo clippy --workspace --all-targets --all-features --release --locked -- -D warnings + - name: Run clippy + run: cargo clippy --all-targets --all-features -- -D warnings build: name: Build (${{ matrix.arch }}) @@ -61,41 +51,46 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 + - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable with: - version: 2026.7.5 - experimental: true - install: false - - name: Install dependencies - run: mise bootstrap --locked --yes --update + components: llvm-tools-preview - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 - - run: cargo clippy --workspace --locked --all-targets --all-features --release -- -D warnings + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec #v6.3.0 + with: + passphrase: ${{ secrets.GPG_PASSPHRASE }} + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + + - run: cargo build --release - run: cargo test --all-features --release --locked - - run: cargo build --package tesor --bin tesor --release --locked + + - name: Install nfpm + run: | + echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list + sudo apt update && sudo apt install nfpm - name: Build packages run: | - PKG_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "tesor") | .version') - if [[ "$GITHUB_REF" == refs/tags/v* ]]; then - VERSION="${GITHUB_REF_NAME#v}" - if [[ "$VERSION" != "$PKG_VERSION" ]]; then - echo "Tag version $VERSION does not match Cargo.toml version $PKG_VERSION" >&2 - exit 1 - fi - else - VERSION="$PKG_VERSION~nightly.$(git log -1 --format=%ct)" - fi - - mise run package -- \ - --version "$VERSION" \ - --arch "${{ matrix.arch }}" \ - --output dist \ - deb rpm + export SIGNING_PRIVATE_KEY="/tmp/private.asc" + printf '%s' "$GPG_PRIVATE_KEY" > $SIGNING_PRIVATE_KEY + chmod 600 $SIGNING_PRIVATE_KEY + + PKG_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "zorian") | .version') + export VERSION="${PKG_VERSION}~dev.$(git log -1 --format=%ct)" + export ARCH=${{ matrix.arch }} + + mkdir -p dist/ + for pkg in deb rpm; do + nfpm package --packager $pkg --target dist/ + done env: GPG_KEY_ID: ${{ vars.GPG_KEY_ID }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + NFPM_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + + - name: Install tools + run: make setup - name: Generate coverage (lcov) run: cargo llvm-cov --all-features --workspace --lcov --output-path coverage.lcov @@ -111,56 +106,33 @@ jobs: name: packages-${{ matrix.arch }} path: dist/* - - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: binary-${{ matrix.arch }} - path: target/release/tesor - smoke: name: Smoke tests runs-on: ubuntu-24.04 needs: [build] + if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 - with: - version: 2026.7.5 - experimental: true - install: false - - name: Install dependencies - run: mise bootstrap --locked --yes --update - - - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 - with: - name: binary-amd64 - path: target/release/ + - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable + - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 - name: Run smoke tests against local instance - run: | - chmod +x target/release/tesor - ./tests/smoke/run-local.sh + run: ./tests/smoke/run-local.sh publish: - name: Publish nightly build + name: Publish dev build runs-on: ubuntu-latest needs: [build, smoke] - concurrency: - group: package-publish-tesor-nightly - cancel-in-progress: false if: github.ref == 'refs/heads/main' permissions: contents: write steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 - with: - version: 2026.7.5 - experimental: true - install: false - - name: Install dependencies - run: mise bootstrap --locked --yes --update + - name: Install tools + run: | + sudo apt-get update + sudo apt-get install -y aptly rclone createrepo-c - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: @@ -168,8 +140,19 @@ jobs: path: dist merge-multiple: true + # Configure GPG keys + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec #v6.3.0 + with: + passphrase: ${{ secrets.GPG_PASSPHRASE }} + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + - name: Export GPG public key + run: printf '%s' "$GPG_PUBLIC_KEY" > dist/public.gpg + env: + GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} + # Update Github Release - - name: Update 'nightly' tag + - name: Update 'dev' tag run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" @@ -196,117 +179,30 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish package repositories - run: | - mise run publish -- \ - --service tesor \ - --channel nightly \ - --input dist \ - deb rpm - env: - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - GPG_KEY_ID: ${{ vars.GPG_KEY_ID }} - PACKAGE_KEY_VERSION: ${{ vars.PACKAGE_KEY_VERSION }} - S3_BUCKET: ${{ vars.S3_BUCKET }} - S3_ENDPOINT: ${{ vars.S3_ENDPOINT }} - S3_PUBLIC_URL: ${{ vars.S3_PUBLIC_URL }} - S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} - S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }} - - oci: - name: OCI artifacts - needs: [smoke] - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 - with: - version: 2026.7.5 - experimental: true - install: false - - - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 - with: - pattern: binary-* - path: .container - - - uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4 - - - name: Determine artifact version - id: artifact - shell: bash + # Update APT/RPM repos on s3 + - name: Create APT repository run: | - base_version=$(python3 -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["workspace"]["package"]["version"])') - if [[ "$GITHUB_REF" == refs/heads/main ]]; then - version="$base_version-nightly.$(git log -1 --format=%ct)" - elif [[ "$GITHUB_REF" == refs/tags/v* ]]; then - version="${GITHUB_REF_NAME#v}" - if [[ "$version" != "$base_version" ]]; then - echo "Tag version $version does not match Cargo.toml version $base_version" >&2 - exit 1 - fi - else - version="$base_version-pr.$GITHUB_RUN_NUMBER" - fi - echo "version=$version" >> "$GITHUB_OUTPUT" - - - name: Log in to GHCR - if: github.event_name != 'pull_request' - uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Log Helm in to GHCR - if: github.event_name != 'pull_request' - env: - GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }} + aptly repo create -distribution=dev -component=main zorian + aptly repo add zorian dist/*.deb + aptly publish repo -architectures=amd64,arm64 -gpg-key="${{vars.GPG_KEY_ID}}" zorian + - name: Create RPM repository run: | - printf '%s' "$GHCR_TOKEN" | mise x helm@4.1.1 -- \ - helm registry login ghcr.io --username "$GITHUB_ACTOR" --password-stdin - - - name: Build and publish OCI artifacts - shell: bash + mkdir -p rpm-repo + cp dist/*.rpm rpm-repo/ + createrepo_c rpm-repo/ + gpg --default-key="${{vars.GPG_KEY_ID}}" --detach-sign --armor rpm-repo/repodata/repomd.xml + - name: Upload RPM to S3 run: | - version="${{ steps.artifact.outputs.version }}" - image="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/tesor" - tags=( - --tag "$image:sha-$GITHUB_SHA" - --tag "$image:$version" - ) - labels=( - --label "org.opencontainers.image.revision=$GITHUB_SHA" - --label "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" - --label "org.opencontainers.image.version=$version" - ) - image_output=() - chart_output=() - - if [[ "$GITHUB_REF" == refs/heads/main ]]; then - tags+=(--tag "$image:nightly") - elif [[ "$GITHUB_REF" == refs/tags/v* ]]; then - tags+=(--tag "$image:latest") - fi - if [[ "${{ github.event_name }}" != pull_request ]]; then - image_output+=(--push) - chart_output+=(--push "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/charts") - fi - - mise run container -- \ - --context . \ - --file Dockerfile \ - --platform linux/amd64,linux/arm64 \ - --cache-scope tesor \ - "${tags[@]}" "${labels[@]}" "${image_output[@]}" - - mise run chart -- \ - --chart charts/tesor \ - --version "$version" \ - --app-version "$version" \ - "${chart_output[@]}" + mkdir -p ~/.config/rclone + cat > ~/.config/rclone/rclone.conf << EOF + [hetzner] + type = s3 + provider = Other + acl = public-read + endpoint = ${{vars.S3_ENDPOINT}} + access_key_id = ${{secrets.S3_ACCESS_KEY_ID}} + secret_access_key = ${{secrets.S3_SECRET_ACCESS_KEY}} + EOF + + rclone sync rpm-repo/ "hetzner:${{vars.S3_BUCKET}}/rpm/" --progress + rclone sync ~/.aptly/public/ "hetzner:${{vars.S3_BUCKET}}/apt/" --progress diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml new file mode 100644 --- /dev/null +++ b/.github/workflows/cla.yml @@ -0,0 +1,30 @@ +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> +# SPDX-License-Identifier: AGPL-3.0-or-later + +name: "CLA Assistant" + +on: + issue_comment: + types: [created] + pull_request_target: + types: [opened, closed, synchronize] + +jobs: + CLAAssistant: + runs-on: ubuntu-latest + permissions: + actions: write + contents: write + statuses: write + pull-requests: write + steps: + - name: "CLA Assistant" + if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' + uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + branch: "main" + allowlist: mrdimidium + path-to-signatures: "LICENSES/cla.json" + path-to-document: "https://github.com/mrdimidium/Zorian/blob/main/CLA.md" diff --git a/.github/workflows/legal.yml b/.github/workflows/legal.yml deleted file mode 100644 --- a/.github/workflows/legal.yml +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -name: Legal - -on: - push: - branches: [main] - tags: ["v*"] - pull_request: - branches: [main] - -permissions: - contents: read - -jobs: - legal: - name: Legal checks - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - fetch-depth: 0 - - - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 - with: - version: 2026.7.5 - experimental: true - install: false - - - name: Check contribution sign-off - run: mise run signoff - - - name: Check licensing policy - run: mise run licenses diff --git a/.gitignore b/.gitignore index 2c7fb07..0575fa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,6 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later -/dist /target -mise.local.toml -mise.*.local.toml - -/.container -/.tesor-state +/dist +/.zorian-state diff --git a/.mailmap b/.mailmap deleted file mode 100644 --- a/.mailmap +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later -# -# Add new entries in alphabetical order - -Nikolay Govorov <me@govorov.online> -Nikolay Govorov <mr@dimidiumlabs.io> diff --git a/CLA.md b/CLA.md index c0418c8..03ff421 100644 --- a/CLA.md +++ b/CLA.md @@ -1,45 +1,43 @@ -# Tesor Individual Contributor License Agreement +# Zorian Grant and Contributor License Agreement -Version 1.0 +> This agreement is based on the Harmony Combined Contributor Agreement +> Version 1.0 licensed under a [Creative Commons Attribution 3.0 Unported License](http://creativecommons.org/licenses/by/3.0/). -> This agreement is based on the Harmony Individual Contributor License -> Agreement Version 1.0 licensed under a -> [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/). - -Thank you for your interest in contributing to Tesor (the "Project"). In this -Agreement, "We" and "Us" mean Nikolay Govorov. - -This contributor agreement ("Agreement") documents the rights granted by -contributors to Us. To make this document effective, You must personally add -the following trailers to every commit You Submit: - -```text -CLA-Version: 1.0 -Signed-off-by: Your Name <your.email@example.com> -``` - -The name and email address in `Signed-off-by` must identify You and match the -commit author. By Submitting a commit containing these trailers, You -electronically sign and accept this Agreement. No other person or automated -system may add the `Signed-off-by` trailer on Your behalf. This is a legally -binding document, so please read it carefully before agreeing to it. +Thank you for your interest in contributing to Zorian ("We" or "Us"). In order +to clarify the intellectual property license granted with Contributions from any +person or entity, We must have a Contributor License Agreement ("CLA") on file +that has been signed, accepted or otherwise agreed to by each contributor, +indicating agreement to the license terms below. This license is for your +protection as a contributor as well as the protection of the Us and our users; +it does not change your rights to use your own Contributions for any other +purpose. ## 1. Definitions -"You" means the individual who Submits a Contribution to Us. +"You" (Individual) means the individual who Submits a Contribution to Us. + +"You" (Entity) means any Legal Entity on behalf of whom a Contribution has been +received by Us. "Legal Entity" means an entity which is not a natural person. +"Affiliates" means other Legal Entities that control, are controlled by, or +under common control with that Legal Entity. For the purposes of this +definition, "control" means (i) the power, direct or indirect, to cause the +direction or management of such Legal Entity, whether by contract or otherwise, +(ii) ownership of fifty percent (50%) or more of the outstanding shares or +securities which vote to elect the management or other persons who direct such +Legal Entity or (iii) beneficial ownership of such entity. "Contribution" means any work of authorship that is Submitted by You to Us in -which You own or assert ownership of the Copyright. If You do not own the -Copyright in the entire work of authorship, please follow the instructions in -Section 3(d). +which You own or assert ownership of the Copyright. "Copyright" means all rights protecting works of authorship owned or controlled -by You, including copyright, moral and neighboring rights, as appropriate, for -the full term of their existence including any extensions by You. +by You [or Your Affiliates], including copyright, moral and neighboring rights, +as appropriate, for the full term of their existence including any extensions by +You. "Material" means the work of authorship which is made available by Us to third -parties as part of the Project. After You Submit the Contribution, it may be -included in the Material. +parties. When this Agreement covers more than one software project, the Material +means the work of authorship to which the Contribution was Submitted. After You +Submit the Contribution, it may be included in the Material. "Submit" means any form of electronic, verbal, or written communication sent to Us or our representatives, including but not limited to electronic mailing @@ -71,10 +69,40 @@ modify, display, perform and distribute the Contribution as part of the Material; provided that this license is conditioned upon compliance with Section 2.3. +### 2.1 Copyright Assignment + +(a) At the time the Contribution is Submitted, You assign to Us all right, +title, and interest worldwide in all Copyright covering the Contribution; +provided that this transfer is conditioned upon compliance with Section 2.3. + +(b) To the extent that any of the rights in Section 2.1(a) cannot be assigned by +You to Us, You grant to Us a perpetual, worldwide, exclusive, royalty-free, +transferable, irrevocable license under such non-assigned rights, with rights to +sublicense through multiple tiers of sublicensees, to practice such non-assigned +rights, including, but not limited to, the right to reproduce, modify, display, +perform and distribute the Contribution; provided that this license is +conditioned upon compliance with Section 2.3. + +(c) To the extent that any of the rights in Section 2.1(a) can neither be +assigned nor licensed by You to Us, You irrevocably waive and agree never to +assert such rights against Us, any of our successors in interest, or any of our +licensees, either direct or indirect; provided that this agreement not to assert +is conditioned upon compliance with Section 2.3. + +(d) Upon such transfer of rights to Us, to the maximum extent possible, We +immediately grant to You a perpetual, worldwide, non-exclusive, royalty-free, +transferable, irrevocable license under such rights covering the Contribution, +with rights to sublicense through multiple tiers of sublicensees, to reproduce, +modify, display, perform, and distribute the Contribution. The intention of the +parties is that this license will be as broad as possible and to provide You +with rights as similar as possible to the owner of the rights that You +transferred. This license back is limited to the Contribution and does not +provide any rights to the Material. + ### 2.2 Patent License For patent claims including, without limitation, method, process, and apparatus -claims which You own, control or have the right to grant, +claims which You [or Your Affiliates] own, control or have the right to grant, now or in the future, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable patent license, with the right to sublicense these rights to multiple tiers of sublicensees, to make, have made, @@ -106,7 +134,7 @@ the Material and may decide to include any Contribution We consider appropriate. ### 2.6 Reservation of Rights -Any rights not expressly licensed under this section are expressly +Any rights not expressly [assigned or] licensed under this section are expressly reserved by You. ## 3. Agreement @@ -115,32 +143,31 @@ You confirm that: (a) You have the legal authority to enter into this Agreement. -(b) You own the Copyright and patent claims covering the +(b) You [or Your Affiliates] own the Copyright and patent claims covering the Contribution which are required to grant the rights under Section 2. -(c) The grant of rights under Section 2 does not violate any grant +(c) (Individual) The grant of rights under Section 2 does not violate any grant of rights which You have made to third parties, including Your employer. If You are an employee, You have had Your employer approve this Agreement or sign the Entity version of this document. If You are less than eighteen years old, please have Your parents or guardian sign the Agreement. -(d) If You do not own the Copyright in the entire work of authorship Submitted, -You have clearly identified the third-party work, its source, and its license in -the Submission. +(c) (Entity) The grant of rights under Section 2 does not violate any grant of +rights which You or Your Affiliates have made to third parties. ## 4. Disclaimer EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US. -TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY +PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US [AND BY US TO +YOU]. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW. ## 5. Consequential Damage Waiver -TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU BE -LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU [OR US] +BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED. diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 --- a/CODEOWNERS +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -* @mrdimidium diff --git a/Cargo.lock b/Cargo.lock index d2e2df0..ee96265 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,24 +49,24 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.102" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "arc-swap" -version = "1.8.2" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f3647c145568cec02c42054e07bdf9a5a698e15b466fb2341bfc393cd24aa5" +checksum = "9ded5f9a03ac8f24d1b8a25101ee812cd32cdc8c50a4c50237de2c4915850e73" dependencies = [ "rustversion", ] [[package]] name = "async-compression" -version = "0.4.41" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f9ee0f6e02ffd7ad5816e9464499fba7b3effd01123b515c41d1697c43dad1" +checksum = "d10e4f991a553474232bc0a31799f6d24b034a84c0971d80d2e2f78b2e576e40" dependencies = [ "compression-codecs", "compression-core", @@ -229,9 +229,9 @@ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitflags" -version = "2.11.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" dependencies = [ "serde_core", ] @@ -268,9 +268,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.20.2" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "byteorder" @@ -294,10 +294,19 @@ dependencies = [ ] [[package]] +name = "camino" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +dependencies = [ + "serde_core", +] + +[[package]] name = "cc" -version = "1.2.57" +version = "1.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29" dependencies = [ "find-msvc-tools", "jobserver", @@ -306,6 +315,15 @@ dependencies = [ ] [[package]] +name = "cfg-expr" +version = "0.20.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78cef5b5a1a6827c7322ae2a636368a573006b27cfa76c7ebd53e834daeaab6a" +dependencies = [ + "smallvec", +] + +[[package]] name = "cfg-if" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -313,9 +331,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chrono" -version = "0.4.44" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" dependencies = [ "iana-time-zone", "js-sys", @@ -327,9 +345,9 @@ dependencies = [ [[package]] name = "compression-codecs" -version = "0.4.37" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb7b51a7d9c967fc26773061ba86150f19c50c0d65c887cb1fbe295fd16619b7" +checksum = "00828ba6fd27b45a448e57dbfe84f1029d4c9f26b368157e9a448a5f49a2ec2a" dependencies = [ "brotli", "compression-core", @@ -362,6 +380,16 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" @@ -410,6 +438,25 @@ dependencies = [ ] [[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] name = "crossbeam-queue" version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -510,7 +557,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -548,6 +595,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + +[[package]] name = "flate2" version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -622,9 +675,9 @@ dependencies = [ [[package]] name = "fs-err" -version = "3.3.0" +version = "3.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fde052dbfc920003cfd2c8e2c6e6d4cc7c1091538c3a24226cec0665ab08c0" +checksum = "baf68cef89750956493a66a10f512b9e58d9db21f2a573c079c0bdf1207a54a7" dependencies = [ "autocfg", "tokio", @@ -632,9 +685,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.32" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -642,15 +695,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.32" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.32" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -670,15 +723,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.32" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.32" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -687,15 +740,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.32" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.32" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" @@ -705,9 +758,9 @@ checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.32" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-io", @@ -716,6 +769,7 @@ dependencies = [ "futures-task", "memchr", "pin-project-lite", + "pin-utils", "slab", ] @@ -749,25 +803,12 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "r-efi 5.3.0", + "r-efi", "wasip2", "wasm-bindgen", ] [[package]] -name = "getrandom" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" -dependencies = [ - "cfg-if", - "libc", - "r-efi 6.0.0", - "wasip2", - "wasip3", -] - -[[package]] name = "governor" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -792,9 +833,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.16" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9f37a958b41b3b19ee2707c06439c0e9e547e847223eb791ecb0cb821c65e27" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" dependencies = [ "atomic-waker", "bytes", @@ -1111,12 +1152,6 @@ dependencies = [ ] [[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - -[[package]] name = "idna" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1145,15 +1180,13 @@ checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", "hashbrown 0.16.1", - "serde", - "serde_core", ] [[package]] name = "ipnet" -version = "2.12.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" @@ -1176,9 +1209,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.18" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "jobserver" @@ -1192,15 +1225,29 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.91" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" dependencies = [ "once_cell", "wasm-bindgen", ] [[package]] +name = "krates" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c432bb7d7a968a338f6c7cbd8782f38ffd87a793ff06c3a20257f45e1d003f6d" +dependencies = [ + "camino", + "cfg-expr", + "petgraph", + "semver", + "serde", + "serde_json", +] + +[[package]] name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1210,16 +1257,10 @@ dependencies = [ ] [[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - -[[package]] name = "libc" -version = "0.2.183" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "libm" @@ -1229,14 +1270,13 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" -version = "0.1.14" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a" +checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" dependencies = [ "bitflags", "libc", - "plain", - "redox_syscall 0.7.3", + "redox_syscall 0.7.0", ] [[package]] @@ -1252,9 +1292,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.12.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" @@ -1328,9 +1368,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.8.0" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "mime" @@ -1361,17 +1401,17 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.18" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ "libc", "log", "openssl", - "openssl-probe", + "openssl-probe 0.1.6", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] @@ -1445,15 +1485,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.4" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "openssl" -version = "0.10.76" +version = "0.10.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "951c002c75e16ea2c65b8c7e4d3d51d5530d8dfa7d060b4776828c88cfb18ecf" +checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" dependencies = [ "bitflags", "cfg-if", @@ -1477,15 +1517,21 @@ dependencies = [ [[package]] name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-probe" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] name = "openssl-sys" -version = "0.9.112" +version = "0.9.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d55af3b3e226502be1526dfdba67ab0e9c96fc293004e79576b2b9edb0dbdb" +checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" dependencies = [ "cc", "libc", @@ -1534,9 +1580,9 @@ dependencies = [ [[package]] name = "opentelemetry-otlp" -version = "0.31.1" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f69cd6acbb9af919df949cd1ec9e5e7fdc2ef15d234b6b795aaa525cc02f71f" +checksum = "7a2366db2dca4d2ad033cad11e6ee42844fd727007af5ad04a1730f4cb8163bf" dependencies = [ "http", "opentelemetry", @@ -1632,19 +1678,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] +name = "petgraph" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" +dependencies = [ + "fixedbitset", + "hashbrown 0.15.5", + "indexmap", +] + +[[package]] name = "pin-project" -version = "1.1.11" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.11" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", @@ -1653,9 +1710,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1691,12 +1748,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" - -[[package]] name = "portable-atomic" version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1721,16 +1772,6 @@ dependencies = [ ] [[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn", -] - -[[package]] name = "proc-macro2" version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1816,9 +1857,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.45" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" dependencies = [ "proc-macro2", ] @@ -1830,12 +1871,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] -name = "r-efi" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" - -[[package]] name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1913,6 +1948,26 @@ dependencies = [ ] [[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] name = "redox_syscall" version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1923,14 +1978,26 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.7.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" +checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27" dependencies = [ "bitflags", ] [[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] name = "regex-automata" version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1943,9 +2010,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.10" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" [[package]] name = "repos" @@ -2069,22 +2136,22 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "rustls" -version = "0.23.37" +version = "0.23.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" +checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ "log", "once_cell", @@ -2101,10 +2168,10 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" dependencies = [ - "openssl-probe", + "openssl-probe 0.2.1", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 3.5.1", ] [[package]] @@ -2118,9 +2185,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.13" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "ring", "rustls-pki-types", @@ -2147,15 +2214,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.23" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" [[package]] name = "schannel" -version = "0.1.29" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ "windows-sys 0.61.2", ] @@ -2177,12 +2244,25 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.7.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags", - "core-foundation", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -2190,9 +2270,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.17.0" +version = "2.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", @@ -2203,6 +2283,10 @@ name = "semver" version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +dependencies = [ + "serde", + "serde_core", +] [[package]] name = "serde" @@ -2374,12 +2458,24 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", +] + +[[package]] +name = "spdx" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afd765179d12cdd06192e02b1d8c6b0d46bd26de9bf16ce04c881428ca2cc7ed" +dependencies = [ + "regex", + "smallvec", + "unicode-normalization", + "zstd", ] [[package]] @@ -2648,9 +2744,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.117" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", @@ -2679,60 +2775,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.27.0" +version = "3.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" dependencies = [ "fastrand", - "getrandom 0.4.2", + "getrandom 0.3.4", "once_cell", "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "tesor" -version = "0.1.0" -dependencies = [ - "async-trait", - "axum", - "axum-server", - "base", - "bytes", - "bytesize", - "chrono", - "crc32fast", - "hex", - "http-body-util", - "hyper", - "hyper-tls", - "hyper-util", - "maud", - "opentelemetry", - "opentelemetry-appender-tracing", - "opentelemetry-otlp", - "opentelemetry-semantic-conventions", - "opentelemetry_sdk", - "repos", - "rustls", - "sd-notify", - "serde", - "serde_json", - "sqlx", - "tempfile", - "thiserror 2.0.18", - "tokio", - "tokio-util", - "toml", - "tonic", - "tower", - "tower-http", - "tower_governor", - "tracing", - "tracing-opentelemetry", - "tracing-subscriber", - "url", - "uuid", + "windows-sys 0.61.2", ] [[package]] @@ -2796,9 +2847,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.11.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -2811,9 +2862,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.50.0" +version = "1.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" dependencies = [ "bytes", "libc", @@ -2827,9 +2878,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.6.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", @@ -2882,9 +2933,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.12+spec-1.1.0" +version = "0.9.11+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" +checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46" dependencies = [ "indexmap", "serde_core", @@ -2892,7 +2943,7 @@ dependencies = [ "toml_datetime", "toml_parser", "toml_writer", - "winnow 0.7.15", + "winnow", ] [[package]] @@ -2906,24 +2957,24 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.0.10+spec-1.1.0" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7df25b4befd31c4816df190124375d5a20c6b6921e2cad937316de3fccd63420" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" dependencies = [ - "winnow 1.0.0", + "winnow", ] [[package]] name = "toml_writer" -version = "1.0.7+spec-1.1.0" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17aaa1c6e3dc22b1da4b6bba97d066e354c7945cac2f7852d4e4e7ca7a6b56d" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" [[package]] name = "tonic" -version = "0.14.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec" +checksum = "a286e33f82f8a1ee2df63f4fa35c0becf4a85a0cb03091a15fd7bf0b402dc94a" dependencies = [ "async-trait", "axum", @@ -2952,9 +3003,9 @@ dependencies = [ [[package]] name = "tonic-prost" -version = "0.14.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309" +checksum = "d6c55a2d6a14174563de34409c9f92ff981d006f56da9c6ecd40d9d4a31500b0" dependencies = [ "bytes", "prost", @@ -3106,9 +3157,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.23" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" dependencies = [ "matchers", "nu-ansi-term", @@ -3151,9 +3202,9 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.24" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-normalization" @@ -3171,12 +3222,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" [[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] name = "untrusted" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3203,11 +3248,11 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.22.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" +checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" dependencies = [ - "getrandom 0.4.2", + "getrandom 0.3.4", "js-sys", "sha1_smol", "wasm-bindgen", @@ -3265,15 +3310,6 @@ dependencies = [ ] [[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" -dependencies = [ - "wit-bindgen", -] - -[[package]] name = "wasite" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3281,9 +3317,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.114" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" dependencies = [ "cfg-if", "once_cell", @@ -3294,9 +3330,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.64" +version = "0.4.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" +checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" dependencies = [ "cfg-if", "futures-util", @@ -3308,9 +3344,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.114" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3318,9 +3354,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.114" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" dependencies = [ "bumpalo", "proc-macro2", @@ -3331,52 +3367,18 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.114" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" dependencies = [ "unicode-ident", ] [[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags", - "hashbrown 0.15.5", - "indexmap", - "semver", -] - -[[package]] name = "web-sys" -version = "0.3.91" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" dependencies = [ "js-sys", "wasm-bindgen", @@ -3503,6 +3505,15 @@ dependencies = [ [[package]] name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" @@ -3534,7 +3545,7 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", @@ -3542,6 +3553,23 @@ dependencies = [ ] [[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3554,6 +3582,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3566,6 +3600,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3578,12 +3618,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3596,6 +3648,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3608,6 +3666,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3620,6 +3684,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3632,112 +3702,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "winnow" -version = "0.7.15" +name = "windows_x86_64_msvc" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" -version = "1.0.0" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" [[package]] name = "wit-bindgen" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck", - "indexmap", - "prettyplease", - "syn", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", -] [[package]] -name = "wit-component" -version = "0.244.0" +name = "writeable" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +name = "xtask" +version = "0.0.0" dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver", + "krates", + "rayon", "serde", - "serde_derive", "serde_json", - "unicode-xid", - "wasmparser", + "spdx", + "tracing", ] [[package]] -name = "writeable" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" - -[[package]] name = "yoke" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3762,18 +3762,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.47" +version = "0.8.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbb2a062be311f2ba113ce66f697a4dc589f85e78a4aea276200804cea0ed87" +checksum = "57cf3aa6855b23711ee9852dfc97dfaa51c45feaba5b645d0c777414d494a961" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.47" +version = "0.8.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e8bc7269b54418e7aeeef514aa68f8690b8c0489a06b0136e5f57c4c5ccab89" +checksum = "8a616990af1a287837c4fe6596ad77ef57948f787e46ce28e166facc0cc1cb75" dependencies = [ "proc-macro2", "quote", @@ -3842,9 +3842,55 @@ dependencies = [ [[package]] name = "zmij" -version = "1.0.21" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +checksum = "3ff05f8caa9038894637571ae6b9e29466c1f4f829d26c9b28f869a29cbe3445" + +[[package]] +name = "zorian" +version = "0.1.0" +dependencies = [ + "async-trait", + "axum", + "axum-server", + "base", + "bytes", + "bytesize", + "chrono", + "crc32fast", + "hex", + "http-body-util", + "hyper", + "hyper-tls", + "hyper-util", + "maud", + "opentelemetry", + "opentelemetry-appender-tracing", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "opentelemetry_sdk", + "repos", + "rustls", + "sd-notify", + "serde", + "serde_json", + "sqlx", + "tempfile", + "thiserror 2.0.18", + "tokio", + "tokio-util", + "toml", + "tonic", + "tower", + "tower-http", + "tower_governor", + "tracing", + "tracing-opentelemetry", + "tracing-subscriber", + "url", + "uuid", + "xtask", +] [[package]] name = "zstd" diff --git a/Cargo.toml b/Cargo.toml index 19cca99..d073fdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later [workspace] -members = ["crates/*", "tests/smoke"] +members = ["crates/*", "tests/smoke", "xtask"] resolver = "3" [workspace.package] @@ -12,7 +12,7 @@ version = "0.1.0" license = "AGPL-3.0-or-later" authors = ["Nikolay Govorov <me@govorov.online>"] homepage = "https://pkg.earth" -repository = "https://git.dimidiumlabs.io/tesor" +repository = "https://github.com/mrdimidium/Zorian" [workspace.dependencies] # local dependencies diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 --- a/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# syntax=docker/dockerfile:1.7@sha256:a57df69d0ea827fb7266491f2813635de6f17269be881f696fbfdf2d83dda33e -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -ARG ALPINE_VERSION=3.23.5 -ARG ALPINE_DIGEST=sha256:fd791d74b68913cbb027c6546007b3f0d3bc45125f797758156952bc2d6daf40 -ARG DISTROLESS_DIGEST=sha256:a77defd6fedbb3392b175ba8ea3d1c22be963c1597c248c3ba987ddd80bfb512 - -FROM --platform=$BUILDPLATFORM docker.io/library/alpine:${ALPINE_VERSION}@${ALPINE_DIGEST} AS rootfs -RUN install -d -m 0750 /rootfs/var/lib/tesor - -FROM gcr.io/distroless/cc-debian13:nonroot@${DISTROLESS_DIGEST} - -ARG TARGETARCH - -LABEL org.opencontainers.image.source="https://git.dimidiumlabs.io/tesor" \ - org.opencontainers.image.licenses="AGPL-3.0-or-later" - -COPY --chown=root:root --chmod=0755 .container/binary-${TARGETARCH}/tesor /usr/local/bin/tesor -COPY --from=rootfs --chown=10000:10000 /rootfs/var/lib/tesor /var/lib/tesor -COPY --chown=root:root pkg/tesor.toml /etc/tesor.toml -COPY --chown=root:root LICENSE README.md /usr/share/doc/tesor/ - -USER 10000:10000 -EXPOSE 2000 -VOLUME ["/var/lib/tesor"] - -ENTRYPOINT ["/usr/local/bin/tesor"] -CMD ["--config=/etc/tesor.toml"] diff --git a/LICENSES/CC-BY-3.0.txt b/LICENSES/CC-BY-3.0.txt deleted file mode 100644 --- a/LICENSES/CC-BY-3.0.txt +++ /dev/null @@ -1,319 +0,0 @@ -Creative Commons Legal Code - -Attribution 3.0 Unported - - CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE - LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN - ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS - INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES - REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR - DAMAGES RESULTING FROM ITS USE. - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE -COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY -COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS -AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY -BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS -CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. - -1. Definitions - - a. "Adaptation" means a work based upon the Work, or upon the Work and - other pre-existing works, such as a translation, adaptation, - derivative work, arrangement of music or other alterations of a - literary or artistic work, or phonogram or performance and includes - cinematographic adaptations or any other form in which the Work may be - recast, transformed, or adapted including in any form recognizably - derived from the original, except that a work that constitutes a - Collection will not be considered an Adaptation for the purpose of - this License. For the avoidance of doubt, where the Work is a musical - work, performance or phonogram, the synchronization of the Work in - timed-relation with a moving image ("synching") will be considered an - Adaptation for the purpose of this License. - b. "Collection" means a collection of literary or artistic works, such as - encyclopedias and anthologies, or performances, phonograms or - broadcasts, or other works or subject matter other than works listed - in Section 1(f) below, which, by reason of the selection and - arrangement of their contents, constitute intellectual creations, in - which the Work is included in its entirety in unmodified form along - with one or more other contributions, each constituting separate and - independent works in themselves, which together are assembled into a - collective whole. A work that constitutes a Collection will not be - considered an Adaptation (as defined above) for the purposes of this - License. - c. "Distribute" means to make available to the public the original and - copies of the Work or Adaptation, as appropriate, through sale or - other transfer of ownership. - d. "Licensor" means the individual, individuals, entity or entities that - offer(s) the Work under the terms of this License. - e. "Original Author" means, in the case of a literary or artistic work, - the individual, individuals, entity or entities who created the Work - or if no individual or entity can be identified, the publisher; and in - addition (i) in the case of a performance the actors, singers, - musicians, dancers, and other persons who act, sing, deliver, declaim, - play in, interpret or otherwise perform literary or artistic works or - expressions of folklore; (ii) in the case of a phonogram the producer - being the person or legal entity who first fixes the sounds of a - performance or other sounds; and, (iii) in the case of broadcasts, the - organization that transmits the broadcast. - f. "Work" means the literary and/or artistic work offered under the terms - of this License including without limitation any production in the - literary, scientific and artistic domain, whatever may be the mode or - form of its expression including digital form, such as a book, - pamphlet and other writing; a lecture, address, sermon or other work - of the same nature; a dramatic or dramatico-musical work; a - choreographic work or entertainment in dumb show; a musical - composition with or without words; a cinematographic work to which are - assimilated works expressed by a process analogous to cinematography; - a work of drawing, painting, architecture, sculpture, engraving or - lithography; a photographic work to which are assimilated works - expressed by a process analogous to photography; a work of applied - art; an illustration, map, plan, sketch or three-dimensional work - relative to geography, topography, architecture or science; a - performance; a broadcast; a phonogram; a compilation of data to the - extent it is protected as a copyrightable work; or a work performed by - a variety or circus performer to the extent it is not otherwise - considered a literary or artistic work. - g. "You" means an individual or entity exercising rights under this - License who has not previously violated the terms of this License with - respect to the Work, or who has received express permission from the - Licensor to exercise rights under this License despite a previous - violation. - h. "Publicly Perform" means to perform public recitations of the Work and - to communicate to the public those public recitations, by any means or - process, including by wire or wireless means or public digital - performances; to make available to the public Works in such a way that - members of the public may access these Works from a place and at a - place individually chosen by them; to perform the Work to the public - by any means or process and the communication to the public of the - performances of the Work, including by public digital performance; to - broadcast and rebroadcast the Work by any means including signs, - sounds or images. - i. "Reproduce" means to make copies of the Work by any means including - without limitation by sound or visual recordings and the right of - fixation and reproducing fixations of the Work, including storage of a - protected performance or phonogram in digital form or other electronic - medium. - -2. Fair Dealing Rights. Nothing in this License is intended to reduce, -limit, or restrict any uses free from copyright or rights arising from -limitations or exceptions that are provided for in connection with the -copyright protection under copyright law or other applicable laws. - -3. License Grant. Subject to the terms and conditions of this License, -Licensor hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license to -exercise the rights in the Work as stated below: - - a. to Reproduce the Work, to incorporate the Work into one or more - Collections, and to Reproduce the Work as incorporated in the - Collections; - b. to create and Reproduce Adaptations provided that any such Adaptation, - including any translation in any medium, takes reasonable steps to - clearly label, demarcate or otherwise identify that changes were made - to the original Work. For example, a translation could be marked "The - original work was translated from English to Spanish," or a - modification could indicate "The original work has been modified."; - c. to Distribute and Publicly Perform the Work including as incorporated - in Collections; and, - d. to Distribute and Publicly Perform Adaptations. - e. For the avoidance of doubt: - - i. Non-waivable Compulsory License Schemes. In those jurisdictions in - which the right to collect royalties through any statutory or - compulsory licensing scheme cannot be waived, the Licensor - reserves the exclusive right to collect such royalties for any - exercise by You of the rights granted under this License; - ii. Waivable Compulsory License Schemes. In those jurisdictions in - which the right to collect royalties through any statutory or - compulsory licensing scheme can be waived, the Licensor waives the - exclusive right to collect such royalties for any exercise by You - of the rights granted under this License; and, - iii. Voluntary License Schemes. The Licensor waives the right to - collect royalties, whether individually or, in the event that the - Licensor is a member of a collecting society that administers - voluntary licensing schemes, via that society, from any exercise - by You of the rights granted under this License. - -The above rights may be exercised in all media and formats whether now -known or hereafter devised. The above rights include the right to make -such modifications as are technically necessary to exercise the rights in -other media and formats. Subject to Section 8(f), all rights not expressly -granted by Licensor are hereby reserved. - -4. Restrictions. The license granted in Section 3 above is expressly made -subject to and limited by the following restrictions: - - a. You may Distribute or Publicly Perform the Work only under the terms - of this License. You must include a copy of, or the Uniform Resource - Identifier (URI) for, this License with every copy of the Work You - Distribute or Publicly Perform. You may not offer or impose any terms - on the Work that restrict the terms of this License or the ability of - the recipient of the Work to exercise the rights granted to that - recipient under the terms of the License. You may not sublicense the - Work. You must keep intact all notices that refer to this License and - to the disclaimer of warranties with every copy of the Work You - Distribute or Publicly Perform. When You Distribute or Publicly - Perform the Work, You may not impose any effective technological - measures on the Work that restrict the ability of a recipient of the - Work from You to exercise the rights granted to that recipient under - the terms of the License. This Section 4(a) applies to the Work as - incorporated in a Collection, but this does not require the Collection - apart from the Work itself to be made subject to the terms of this - License. If You create a Collection, upon notice from any Licensor You - must, to the extent practicable, remove from the Collection any credit - as required by Section 4(b), as requested. If You create an - Adaptation, upon notice from any Licensor You must, to the extent - practicable, remove from the Adaptation any credit as required by - Section 4(b), as requested. - b. If You Distribute, or Publicly Perform the Work or any Adaptations or - Collections, You must, unless a request has been made pursuant to - Section 4(a), keep intact all copyright notices for the Work and - provide, reasonable to the medium or means You are utilizing: (i) the - name of the Original Author (or pseudonym, if applicable) if supplied, - and/or if the Original Author and/or Licensor designate another party - or parties (e.g., a sponsor institute, publishing entity, journal) for - attribution ("Attribution Parties") in Licensor's copyright notice, - terms of service or by other reasonable means, the name of such party - or parties; (ii) the title of the Work if supplied; (iii) to the - extent reasonably practicable, the URI, if any, that Licensor - specifies to be associated with the Work, unless such URI does not - refer to the copyright notice or licensing information for the Work; - and (iv) , consistent with Section 3(b), in the case of an Adaptation, - a credit identifying the use of the Work in the Adaptation (e.g., - "French translation of the Work by Original Author," or "Screenplay - based on original Work by Original Author"). The credit required by - this Section 4 (b) may be implemented in any reasonable manner; - provided, however, that in the case of a Adaptation or Collection, at - a minimum such credit will appear, if a credit for all contributing - authors of the Adaptation or Collection appears, then as part of these - credits and in a manner at least as prominent as the credits for the - other contributing authors. For the avoidance of doubt, You may only - use the credit required by this Section for the purpose of attribution - in the manner set out above and, by exercising Your rights under this - License, You may not implicitly or explicitly assert or imply any - connection with, sponsorship or endorsement by the Original Author, - Licensor and/or Attribution Parties, as appropriate, of You or Your - use of the Work, without the separate, express prior written - permission of the Original Author, Licensor and/or Attribution - Parties. - c. Except as otherwise agreed in writing by the Licensor or as may be - otherwise permitted by applicable law, if You Reproduce, Distribute or - Publicly Perform the Work either by itself or as part of any - Adaptations or Collections, You must not distort, mutilate, modify or - take other derogatory action in relation to the Work which would be - prejudicial to the Original Author's honor or reputation. Licensor - agrees that in those jurisdictions (e.g. Japan), in which any exercise - of the right granted in Section 3(b) of this License (the right to - make Adaptations) would be deemed to be a distortion, mutilation, - modification or other derogatory action prejudicial to the Original - Author's honor and reputation, the Licensor will waive or not assert, - as appropriate, this Section, to the fullest extent permitted by the - applicable national law, to enable You to reasonably exercise Your - right under Section 3(b) of this License (right to make Adaptations) - but not otherwise. - -5. Representations, Warranties and Disclaimer - -UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR -OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY -KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, -INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, -FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF -LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, -WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION -OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. - -6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE -LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR -ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES -ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS -BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. Termination - - a. This License and the rights granted hereunder will terminate - automatically upon any breach by You of the terms of this License. - Individuals or entities who have received Adaptations or Collections - from You under this License, however, will not have their licenses - terminated provided such individuals or entities remain in full - compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will - survive any termination of this License. - b. Subject to the above terms and conditions, the license granted here is - perpetual (for the duration of the applicable copyright in the Work). - Notwithstanding the above, Licensor reserves the right to release the - Work under different license terms or to stop distributing the Work at - any time; provided, however that any such election will not serve to - withdraw this License (or any other license that has been, or is - required to be, granted under the terms of this License), and this - License will continue in full force and effect unless terminated as - stated above. - -8. Miscellaneous - - a. Each time You Distribute or Publicly Perform the Work or a Collection, - the Licensor offers to the recipient a license to the Work on the same - terms and conditions as the license granted to You under this License. - b. Each time You Distribute or Publicly Perform an Adaptation, Licensor - offers to the recipient a license to the original Work on the same - terms and conditions as the license granted to You under this License. - c. If any provision of this License is invalid or unenforceable under - applicable law, it shall not affect the validity or enforceability of - the remainder of the terms of this License, and without further action - by the parties to this agreement, such provision shall be reformed to - the minimum extent necessary to make such provision valid and - enforceable. - d. No term or provision of this License shall be deemed waived and no - breach consented to unless such waiver or consent shall be in writing - and signed by the party to be charged with such waiver or consent. - e. This License constitutes the entire agreement between the parties with - respect to the Work licensed here. There are no understandings, - agreements or representations with respect to the Work not specified - here. Licensor shall not be bound by any additional provisions that - may appear in any communication from You. This License may not be - modified without the mutual written agreement of the Licensor and You. - f. The rights granted under, and the subject matter referenced, in this - License were drafted utilizing the terminology of the Berne Convention - for the Protection of Literary and Artistic Works (as amended on - September 28, 1979), the Rome Convention of 1961, the WIPO Copyright - Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 - and the Universal Copyright Convention (as revised on July 24, 1971). - These rights and subject matter take effect in the relevant - jurisdiction in which the License terms are sought to be enforced - according to the corresponding provisions of the implementation of - those treaty provisions in the applicable national law. If the - standard suite of rights granted under applicable copyright law - includes additional rights not granted under this License, such - additional rights are deemed to be included in the License; this - License is not intended to restrict the license of any rights under - applicable law. - - -Creative Commons Notice - - Creative Commons is not a party to this License, and makes no warranty - whatsoever in connection with the Work. Creative Commons will not be - liable to You or any party on any legal theory for any damages - whatsoever, including without limitation any general, special, - incidental or consequential damages arising in connection to this - license. Notwithstanding the foregoing two (2) sentences, if Creative - Commons has expressly identified itself as the Licensor hereunder, it - shall have all rights and obligations of Licensor. - - Except for the limited purpose of indicating to the public that the - Work is licensed under the CCPL, Creative Commons does not authorize - the use by either party of the trademark "Creative Commons" or any - related trademark or logo of Creative Commons without the prior - written consent of Creative Commons. Any permitted use will be in - compliance with Creative Commons' then-current trademark usage - guidelines, as may be published on its website or otherwise made - available upon request from time to time. For the avoidance of doubt, - this trademark restriction does not form part of this License. - - Creative Commons may be contacted at https://creativecommons.org/. diff --git a/LICENSES/CC-BY-4.0.txt b/LICENSES/CC-BY-4.0.txt deleted file mode 100644 --- a/LICENSES/CC-BY-4.0.txt +++ /dev/null @@ -1,156 +0,0 @@ -Creative Commons Attribution 4.0 International - - Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. - -Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. - -Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. - -Creative Commons Attribution 4.0 International Public License - -By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. - -Section 1 – Definitions. - - a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. - - c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. - - d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. - - e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. - - f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. - - g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. - - h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. - - i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. - - j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. - - k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. - -Section 2 – Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: - - A. reproduce and Share the Licensed Material, in whole or in part; and - - B. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. - - 3. Term. The term of this Public License is specified in Section 6(a). - - 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. - - 5. Downstream recipients. - - A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. - - B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. - - 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). - -b. Other rights. - - 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this Public License. - - 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. - -Section 3 – License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified form), You must: - - A. retain the following if it is supplied by the Licensor with the Licensed Material: - - i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of warranties; - - v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; - - B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and - - C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. - - 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. - - 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. - -Section 4 – Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; - - b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and - - c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. -For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. - -Section 5 – Disclaimer of Warranties and Limitation of Liability. - - a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. - - b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. - - c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. - -Section 6 – Term and Termination. - - a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or - - 2. upon express reinstatement by the Licensor. - - c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. - - d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. - - e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. - -Section 7 – Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. - -Section 8 – Interpretation. - - a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. - - c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. - - d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. - -Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/Makefile b/Makefile new file mode 100644 --- /dev/null +++ b/Makefile @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> +# SPDX-License-Identifier: AGPL-3.0-or-later + +CARGO_DENY_VERSION = ^0.19 +CARGO_LLVM_COV_VERSION = ^0.8 + +all: fmt clippy test deps licenses + +.PHONY: setup +setup: + cargo install \ + cargo-deny@$(CARGO_DENY_VERSION) \ + cargo-llvm-cov@$(CARGO_LLVM_COV_VERSION) + +.PHONY: licenses +licenses: + reuse lint + +.PHONY: fmt +fmt: + cargo fmt --all --check + +.PHONY: deps +deps: + cargo deny check + +.PHONY: clippy +clippy: + cargo clippy --all-targets --all-features -- -D warnings + +.PHONY: test +test: + cargo build --release + cargo test --all-features --release --locked + +.PHONY: smoke +smoke: + cargo run -p smoke + +.PHONY: smoke-local +smoke-local: + ./tests/smoke/run-local.sh + +.PHONY: coverage +coverage: + mkdir -p target/coverage/ + cargo llvm-cov --all-features --workspace --lcov --output-path target/coverage/lcov.info + cargo llvm-cov --all-features --workspace --html --output-dir target/coverage/html diff --git a/README.md b/README.md index 2c51ae4..3e75d70 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Tesor — tiny packages caching proxy +# Zorian — tiny packages caching proxy Soon humanity will go to Mars and in order for the colonists to be able to program, we will need a local mirror of packages. @@ -13,89 +13,54 @@ is **not** intended for production use. ```bash sudo apt install curl gnupg -curl -fsSL https://pkg.dimidiumlabs.io/packages.gpg | sudo gpg --dearmor -o /usr/share/keyrings/dimidiumlabs.gpg -echo "deb [signed-by=/usr/share/keyrings/dimidiumlabs.gpg] https://pkg.dimidiumlabs.io/tesor/apt/ nightly main" | sudo tee /etc/apt/sources.list.d/tesor.list -sudo apt update && sudo apt install tesor +curl -fsSL https://github.com/mrdimidium/Zorian/releases/download/dev/public.gpg | sudo gpg --dearmor -o /usr/share/keyrings/zorian.gpg +echo "deb [signed-by=/usr/share/keyrings/zorian.gpg] https://zorian.hel1.your-objectstorage.com/apt/ dev main" | sudo tee /etc/apt/sources.list.d/zorian.list +sudo apt update && sudo apt install zorian -sudo systemctl enable --now tesor +sudo systemctl enable --now zorian ``` -**Fedora/RHEL:** +**Fedora/RedHat:** ```bash -# DNF5 (Fedora 41+, RHEL 10+) -sudo dnf config-manager addrepo --from-repofile=https://pkg.dimidiumlabs.io/tesor/rpm/nightly/tesor-nightly.repo +sudo rpm --import https://github.com/mrdimidium/Zorian/releases/download/dev/public.gpg +sudo dnf config-manager --add-repo https://zorian.hel1.your-objectstorage.com/rpm/ +sudo dnf install zorian -# DNF4 (Fedora 40 and older, RHEL 8/9) -sudo curl -o /etc/yum.repos.d/tesor-nightly.repo https://pkg.dimidiumlabs.io/tesor/rpm/nightly/tesor-nightly.repo - -sudo dnf install tesor -sudo systemctl enable --now tesor -``` - -**openSUSE:** - -```bash -sudo rpm --import https://pkg.dimidiumlabs.io/packages.gpg -sudo zypper addrepo https://pkg.dimidiumlabs.io/tesor/rpm/nightly/ tesor-nightly -sudo zypper refresh -sudo zypper install tesor - -sudo systemctl enable --now tesor +sudo systemctl enable --now zorian ``` ## Build from source -1. Clone repo: `git clone https://git.dimidiumlabs.io/tesor.git && cd tesor` -1. Provision the toolchain and system build dependencies: `mise bootstrap` -1. Build from source: `mise exec -- cargo build --release` +1. Install build dependencies: + - Fedora/RedHat: `sudo dnf install gcc openssl-devel pkg-config` + - Debian/Ubuntu: `sudo apt install build-essential libssl-dev pkg-config` +1. Clone repo: `git clone https://github.com/mrdimidium/Zorian.git && cd Zorian` +1. Build from source: `cargo build --release` 1. Install manually ```bash - sudo groupadd --system tesor - sudo useradd --system --gid tesor --no-create-home --shell /usr/sbin/nologin tesor - sudo install -m 700 -o tesor ./pkg/tesor.toml /etc/ - sudo install -m 755 -o root ./pkg/tesor.service /usr/lib/systemd/system - sudo install -m 755 -o root target/release/tesor /usr/local/bin/ + sudo groupadd --system zorian + sudo useradd --system --gid zorian --no-create-home --shell /usr/sbin/nologin zorian + sudo install -m 700 -o zorian ./pkg/zorian.toml /etc/ + sudo install -m 755 -o root ./pkg/zorian.service /usr/lib/systemd/system + sudo install -m 755 -o root target/release/zorian /usr/local/bin/ ``` -1. start systemd service: `sudo systemctl enable --now tesor` - -## Contributing - -We welcome your contributions, including code, bug reports, ideas, and success -stories. - -If you are making a contribution for the first time or from a new email, please -add yourself to the `.mailmap`. - -### Signoff - -To include your code, we ask that you read and agree to the [CLA](./CLA.md). To -sign, add a `CLA-Version: 1.0` and a `Signed-off-by` trailer to every commit -(`git commit -s --trailer "CLA-Version: 1.0"`). Each commit in a pull request -must carry a valid `Signed-off-by` line matching the commit author. Please use -your real name. We cannot include code from anonymous contributors. - -AI agents MUST NOT add Signed-off-by tags. Only humans can legally certify the -Contributor License Agreement. - -### AI policy - -You may use AI agents when writing code and documentation. AI is not allowed for -media including images, videos, fonts at all. You must fully read, understand, -and cleanup any code generated by the agent. We ask that you disclose the -agent's use and indicate the tool, model, and extent of contribution. +1. start systemd service: `sudo systemctl enable --now zorian` -Contributions should include an Assisted-by tag in the following format: -`Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]`, for example: -`Assisted-by: Claude:claude-4.6-opus coccinelle sparse` +## License -Remember, AI agents should make software better, not worse. +Copyright (C) 2026 Nikolay Govorov -## Licensing +This program is free software: you can redistribute it and/or modify it under +the terms of the GNU Affero General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) any +later version. -Tesor source code is licensed under AGPL-3.0-or-later. Documentation is -licensed under CC-BY-4.0. +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -The bundled JetBrains Mono font files are licensed under OFL-1.1. +You should have received a copy of the GNU Affero General Public License along +with this program. If not, see <https://www.gnu.org/licenses/>. diff --git a/REUSE.toml b/REUSE.toml index ca825f7..86e2035 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -1,44 +1,24 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - version = 1 [[annotations]] path = [ + "CLA.md", + "README.md", "Cargo.toml", "Cargo.lock", - "mise.lock", - - "pkg/*.svg", - "charts/tesor/templates/*", - - "crates/tesor/src/assets/*.svg", - "crates/tesor/src/assets/*.ico", - "crates/tesor/src/assets/*.png", - "crates/tesor/src/assets/robots.txt", - "crates/tesor/src/assets/manifest.webmanifest", ] -SPDX-FileCopyrightText = "2026 Nikolay Govorov" +SPDX-FileCopyrightText = "2026 Nikolay Govorov <me@govorov.online>" SPDX-License-Identifier = "AGPL-3.0-or-later" [[annotations]] path = [ - "README.md", -] -SPDX-FileCopyrightText = "2026 Nikolay Govorov" -SPDX-License-Identifier = "CC-BY-4.0" - -[[annotations]] -path = [ - "CLA.md", -] -SPDX-FileCopyrightText = "2026 Nikolay Govorov" -SPDX-License-Identifier = "CC-BY-3.0" - -[[annotations]] -path = [ - "crates/tesor/src/assets/jetbrainsmono/OFL.txt", - "crates/tesor/src/assets/jetbrainsmono/*.woff2", + "pkg/*.svg", + "crates/zorian/src/assets/*.svg", + "crates/zorian/src/assets/*.ico", + "crates/zorian/src/assets/*.png", + "crates/zorian/src/assets/manifest.webmanifest", + "crates/zorian/src/assets/jetbrainsmono/OFL.txt", + "crates/zorian/src/assets/jetbrainsmono/*.woff2", ] SPDX-FileCopyrightText = "Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)" SPDX-License-Identifier = "OFL-1.1" diff --git a/charts/tesor/Chart.yaml b/charts/tesor/Chart.yaml deleted file mode 100644 --- a/charts/tesor/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -apiVersion: v2 -type: application -version: 0.1.0 - -name: tesor -home: https://git.dimidiumlabs.io/tesor -description: Tiny package caching proxy diff --git a/charts/tesor/templates/_helpers.tpl b/charts/tesor/templates/_helpers.tpl deleted file mode 100644 --- a/charts/tesor/templates/_helpers.tpl +++ /dev/null @@ -1,37 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -{{- define "tesor.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{- define "tesor.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name (include "tesor.name" .) | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} - -{{- define "tesor.labels" -}} -helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" }} -app.kubernetes.io/name: {{ include "tesor.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - -{{- define "tesor.selectorLabels" -}} -app.kubernetes.io/name: {{ include "tesor.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end -}} - -{{- define "tesor.image" -}} -{{- if .Values.image.digest -}} -{{- printf "%s@%s" .Values.image.repository .Values.image.digest -}} -{{- else -}} -{{- printf "%s:%s" .Values.image.repository (default .Chart.AppVersion .Values.image.tag) -}} -{{- end -}} -{{- end -}} - -# vim: set filetype=helm: diff --git a/charts/tesor/templates/configmap.yaml b/charts/tesor/templates/configmap.yaml deleted file mode 100644 --- a/charts/tesor/templates/configmap.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -{{- if not .Values.config.existingConfigMap }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "tesor.fullname" . }} - labels: - {{- include "tesor.labels" . | nindent 4 }} -data: - tesor.toml: | - appname = {{ .Values.config.appname | quote }} - dirname = "/var/lib/tesor" - - [server] - max_body_size = {{ .Values.config.server.maxBodySize | quote }} - max_concurrent_requests = {{ .Values.config.server.maxConcurrentRequests }} - - rate_limit_period = {{ .Values.config.server.rateLimitPeriod }} - rate_limit_burst_size = {{ .Values.config.server.rateLimitBurstSize }} - - request_timeout = {{ .Values.config.server.requestTimeout }} - shutdown_timeout = {{ .Values.config.server.shutdownTimeout }} - - [[listen]] - addr = "0.0.0.0:2000" - hostnames = {{ .Values.config.hostnames | toJson }} - - {{- range $name, $backend := .Values.config.backends }} - [backends.{{ $name }}] - enabled = {{ $backend.enabled }} - refresh_interval = {{ $backend.refreshInterval }} - - {{- end }} - [telemetry.stdout] - enabled = {{ .Values.config.log.enabled }} - log_level = {{ .Values.config.log.level | quote }} - log_format = {{ .Values.config.log.format | quote }} - {{- with .Values.config.extra }} - -{{ . | indent 4 }} - {{- end }} -{{- end }} - -# vim: set filetype=helm: diff --git a/charts/tesor/templates/deployment.yaml b/charts/tesor/templates/deployment.yaml deleted file mode 100644 --- a/charts/tesor/templates/deployment.yaml +++ /dev/null @@ -1,97 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "tesor.fullname" . }} - labels: - {{- include "tesor.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.replicaCount }} - strategy: - type: Recreate - selector: - matchLabels: - {{- include "tesor.selectorLabels" . | nindent 6 }} - template: - metadata: - annotations: - {{- if not .Values.config.existingConfigMap }} - checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} - {{- end }} - {{- with .Values.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "tesor.selectorLabels" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - automountServiceAccountToken: false - terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: tesor - image: {{ include "tesor.image" . | quote }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - args: ["--config=/etc/tesor/tesor.toml"] - ports: - - name: http - containerPort: 2000 - protocol: TCP - startupProbe: - tcpSocket: - port: http - failureThreshold: 60 - periodSeconds: 5 - readinessProbe: - tcpSocket: - port: http - periodSeconds: 10 - livenessProbe: - tcpSocket: - port: http - periodSeconds: 20 - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - name: config - mountPath: /etc/tesor/tesor.toml - subPath: tesor.toml - readOnly: true - - name: state - mountPath: /var/lib/tesor - volumes: - - name: config - configMap: - name: {{ default (include "tesor.fullname" .) .Values.config.existingConfigMap }} - - name: state - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ default (include "tesor.fullname" .) .Values.persistence.existingClaim }} - {{- else }} - emptyDir: {} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - -# vim: set filetype=helm: diff --git a/charts/tesor/templates/httproute.yaml b/charts/tesor/templates/httproute.yaml deleted file mode 100644 --- a/charts/tesor/templates/httproute.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -{{- if .Values.route.enabled }} -apiVersion: gateway.networking.k8s.io/v1 -kind: HTTPRoute -metadata: - name: {{ include "tesor.fullname" . }} - labels: - {{- include "tesor.labels" . | nindent 4 }} -spec: - {{- with .Values.route.parentRefs }} - parentRefs: - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with .Values.route.hostnames }} - hostnames: - {{- toYaml . | nindent 4 }} - {{- end }} - rules: - - backendRefs: - - name: {{ include "tesor.fullname" . }} - port: {{ .Values.service.port }} -{{- end }} - -# vim: set filetype=helm: diff --git a/charts/tesor/templates/pvc.yaml b/charts/tesor/templates/pvc.yaml deleted file mode 100644 --- a/charts/tesor/templates/pvc.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ include "tesor.fullname" . }} - labels: - {{- include "tesor.labels" . | nindent 4 }} -spec: - accessModes: - {{- toYaml .Values.persistence.accessModes | nindent 4 }} - resources: - requests: - storage: {{ .Values.persistence.size }} - {{- with .Values.persistence.storageClass }} - storageClassName: {{ . | quote }} - {{- end }} -{{- end }} - -# vim: set filetype=helm: diff --git a/charts/tesor/templates/service.yaml b/charts/tesor/templates/service.yaml deleted file mode 100644 --- a/charts/tesor/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "tesor.fullname" . }} - labels: - {{- include "tesor.labels" . | nindent 4 }} -spec: - selector: - {{- include "tesor.selectorLabels" . | nindent 4 }} - ports: - - name: http - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - -# vim: set filetype=helm: diff --git a/charts/tesor/values.yaml b/charts/tesor/values.yaml deleted file mode 100644 --- a/charts/tesor/values.yaml +++ /dev/null @@ -1,78 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -replicaCount: 1 - -image: - repository: ghcr.io/dimidiumlabs/tesor - tag: "" - digest: "" - pullPolicy: IfNotPresent - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -podAnnotations: {} -podLabels: {} - -podSecurityContext: - runAsNonRoot: true - - runAsUser: 10000 - runAsGroup: 10000 - - fsGroup: 10000 - fsGroupChangePolicy: OnRootMismatch - -securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: [ALL] - readOnlyRootFilesystem: true - -service: - port: 2000 - -config: - existingConfigMap: "" - appname: tesor - hostnames: [] - server: - shutdownTimeout: 60 - requestTimeout: 30 - maxBodySize: 64 MiB - maxConcurrentRequests: 512 - rateLimitPeriod: 10 - rateLimitBurstSize: 50 - backends: - go: - enabled: true - refreshInterval: 3600 - zig: - enabled: true - refreshInterval: 3600 - log: - enabled: true - level: info - format: json - extra: "" - -persistence: - enabled: true - existingClaim: "" - accessModes: [ReadWriteOnce] - size: 20Gi - storageClass: "" - -route: - enabled: false - hostnames: [] - parentRefs: [] - -resources: {} -nodeSelector: {} -tolerations: [] -affinity: {} - -terminationGracePeriodSeconds: 70 diff --git a/crates/base/Cargo.toml b/crates/base/Cargo.toml index 6eec5fe..ac83c12 100644 --- a/crates/base/Cargo.toml +++ b/crates/base/Cargo.toml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later [package] diff --git a/crates/base/src/lib.rs b/crates/base/src/lib.rs index d22128e..ca3598d 100644 --- a/crates/base/src/lib.rs +++ b/crates/base/src/lib.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later pub mod serde; diff --git a/crates/base/src/serde.rs b/crates/base/src/serde.rs index a5dc205..7897b02 100644 --- a/crates/base/src/serde.rs +++ b/crates/base/src/serde.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later use std::net::SocketAddr; diff --git a/crates/repos/Cargo.toml b/crates/repos/Cargo.toml index 01e3359..38bfc2e 100644 --- a/crates/repos/Cargo.toml +++ b/crates/repos/Cargo.toml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later [package] diff --git a/crates/repos/src/go.rs b/crates/repos/src/go.rs index 8b08f78..d591e7d 100644 --- a/crates/repos/src/go.rs +++ b/crates/repos/src/go.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later use std::time::Duration; @@ -487,10 +487,10 @@ mod tests_go_filename { upstream: Url::parse("https://dl.google.com/go/").unwrap(), ..Default::default() }; - let url = t.upstream_url(&config, "tesor:test").unwrap(); + let url = t.upstream_url(&config, "zorian:test").unwrap(); assert_eq!( url.as_str(), - "https://dl.google.com/go/go1.25.6.linux-amd64.tar.gz?source=tesor%3Atest" + "https://dl.google.com/go/go1.25.6.linux-amd64.tar.gz?source=zorian%3Atest" ); } diff --git a/crates/repos/src/lib.rs b/crates/repos/src/lib.rs index 4191ea0..1f70f0a 100644 --- a/crates/repos/src/lib.rs +++ b/crates/repos/src/lib.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later pub mod go; diff --git a/crates/repos/src/zig.rs b/crates/repos/src/zig.rs index 996f35e..c9a8b8f 100644 --- a/crates/repos/src/zig.rs +++ b/crates/repos/src/zig.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later use std::collections::HashMap; diff --git a/crates/tesor/build.rs b/crates/tesor/build.rs deleted file mode 100644 --- a/crates/tesor/build.rs +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov -// SPDX-License-Identifier: AGPL-3.0-or-later - -fn main() { - println!("cargo::rerun-if-changed=../../Cargo.lock"); - println!("cargo::rerun-if-changed=../../mise.toml"); - println!("cargo::rerun-if-changed=../../mise.lock"); - - let out_dir = std::env::var("OUT_DIR").unwrap(); - let target = std::env::var("TARGET").unwrap(); - let output = format!("{out_dir}/licenses.json"); - - let status = std::process::Command::new("mise") - .current_dir(env!("CARGO_MANIFEST_DIR")) - .args([ - "run", - "licenses-json", - "--", - "--manifest-path", - "Cargo.toml", - "--output", - &output, - "--target", - &target, - ]) - .status() - .expect("failed to run licenses-json task"); - - assert!(status.success(), "failed to generate licenses.json"); -} diff --git a/crates/tesor/Cargo.toml b/crates/zorian/Cargo.toml index 908295d..4317d22 100644 --- a/crates/tesor/Cargo.toml +++ b/crates/zorian/Cargo.toml @@ -1,9 +1,9 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later [package] -name = "tesor" -description = "tesor web-server and daemon" +name = "zorian" +description = "Zorian web-server and daemon" version.workspace = true authors.workspace = true @@ -58,5 +58,9 @@ opentelemetry_sdk.workspace = true [target.'cfg(target_os = "linux")'.dependencies] sd-notify.workspace = true +[build-dependencies] +xtask = { path = "../../xtask" } +serde_json.workspace = true + [dev-dependencies] tempfile.workspace = true diff --git a/crates/zorian/build.rs b/crates/zorian/build.rs new file mode 100644 --- /dev/null +++ b/crates/zorian/build.rs @@ -0,0 +1,13 @@ +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> +// SPDX-License-Identifier: AGPL-3.0-or-later + +fn main() { + println!("cargo::rerun-if-changed=../../Cargo.lock"); + + let json = + xtask::licenses::generate_json("Cargo.toml").expect("failed to generate licenses JSON"); + + let out_dir = std::env::var("OUT_DIR").unwrap(); + std::fs::write(format!("{out_dir}/licenses.json"), json) + .expect("failed to write licenses.json"); +} diff --git a/crates/tesor/src/assets/apple-touch-icon.png b/crates/zorian/src/assets/apple-touch-icon.png index 0f6bb61..0f6bb61 100644 --- a/crates/tesor/src/assets/apple-touch-icon.png +++ b/crates/zorian/src/assets/apple-touch-icon.png Binary files differ diff --git a/crates/tesor/src/assets/base.css b/crates/zorian/src/assets/base.css index 66503e7..3345768 100644 --- a/crates/tesor/src/assets/base.css +++ b/crates/zorian/src/assets/base.css @@ -1,4 +1,4 @@ -/* SPDX-FileCopyrightText: 2026 Nikolay Govorov */ +/* SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> */ /* SPDX-License-Identifier: AGPL-3.0-or-later */ @font-face { diff --git a/crates/tesor/src/assets/favicon-192.png b/crates/zorian/src/assets/favicon-192.png index 0f6bb61..0f6bb61 100644 --- a/crates/tesor/src/assets/favicon-192.png +++ b/crates/zorian/src/assets/favicon-192.png Binary files differ diff --git a/crates/tesor/src/assets/favicon-512.png b/crates/zorian/src/assets/favicon-512.png index 49cd3cd..49cd3cd 100644 --- a/crates/tesor/src/assets/favicon-512.png +++ b/crates/zorian/src/assets/favicon-512.png Binary files differ diff --git a/crates/tesor/src/assets/favicon.ico b/crates/zorian/src/assets/favicon.ico index 093e50b..093e50b 100644 --- a/crates/tesor/src/assets/favicon.ico +++ b/crates/zorian/src/assets/favicon.ico Binary files differ diff --git a/crates/tesor/src/assets/favicon.svg b/crates/zorian/src/assets/favicon.svg index ed7cc17..ed7cc17 100644 --- a/crates/tesor/src/assets/favicon.svg +++ b/crates/zorian/src/assets/favicon.svg diff --git a/crates/tesor/src/assets/jetbrainsmono/JetBrainsMono-Italic[wght].woff2 b/crates/zorian/src/assets/jetbrainsmono/JetBrainsMono-Italic[wght].woff2 index 98adc80..98adc80 100644 --- a/crates/tesor/src/assets/jetbrainsmono/JetBrainsMono-Italic[wght].woff2 +++ b/crates/zorian/src/assets/jetbrainsmono/JetBrainsMono-Italic[wght].woff2 Binary files differ diff --git a/crates/tesor/src/assets/jetbrainsmono/JetBrainsMono[wght].woff2 b/crates/zorian/src/assets/jetbrainsmono/JetBrainsMono[wght].woff2 index 4cd1413..4cd1413 100644 --- a/crates/tesor/src/assets/jetbrainsmono/JetBrainsMono[wght].woff2 +++ b/crates/zorian/src/assets/jetbrainsmono/JetBrainsMono[wght].woff2 Binary files differ diff --git a/crates/tesor/src/assets/manifest.webmanifest b/crates/zorian/src/assets/manifest.webmanifest index 6d7fa0a..53f9612 100644 --- a/crates/tesor/src/assets/manifest.webmanifest +++ b/crates/zorian/src/assets/manifest.webmanifest @@ -1,5 +1,5 @@ { - "name": "tesor", + "name": "Zorian", "icons": [ { "src": "/icon-192.png", "type": "image/png", "sizes": "192x192" }, { "src": "/icon-512.png", "type": "image/png", "sizes": "512x512" }, diff --git a/crates/tesor/src/assets/robots.txt b/crates/zorian/src/assets/robots.txt index 2fe8da2..2fe8da2 100644 --- a/crates/tesor/src/assets/robots.txt +++ b/crates/zorian/src/assets/robots.txt diff --git a/crates/tesor/src/config.rs b/crates/zorian/src/config.rs index e9e148a..79da442 100644 --- a/crates/tesor/src/config.rs +++ b/crates/zorian/src/config.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later use std::collections::HashMap; @@ -240,8 +240,8 @@ pub struct ConfigService { impl Default for ConfigService { fn default() -> Self { Self { - appname: "tesor".to_string(), - dirname: PathBuf::from("./.tesor-state"), + appname: "zorian".to_string(), + dirname: PathBuf::from("./.zorian-state"), listen: vec![ListenerConfig::default()], server: ServerConfig::default(), telemetry: TelemetryConfig::default(), @@ -410,13 +410,13 @@ mod tests { #[test] fn test_load_none_defaults() { let temp = TempDir::new().unwrap(); - let state = temp.path().join(".tesor-state"); + let state = temp.path().join(".zorian-state"); std::fs::create_dir_all(&state).unwrap(); let cwd = std::env::current_dir().unwrap(); std::env::set_current_dir(temp.path()).unwrap(); let cfg = ConfigService::load(None).unwrap(); - assert_eq!(cfg.appname(), "tesor"); + assert_eq!(cfg.appname(), "zorian"); std::env::set_current_dir(cwd).unwrap(); } diff --git a/crates/tesor/src/controller_backend.rs b/crates/zorian/src/controller_backend.rs index f97caa1..d14d93b 100644 --- a/crates/tesor/src/controller_backend.rs +++ b/crates/zorian/src/controller_backend.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later use std::sync::Arc; diff --git a/crates/tesor/src/controller_web.rs b/crates/zorian/src/controller_web.rs index 125295e..ebd9ce1 100644 --- a/crates/tesor/src/controller_web.rs +++ b/crates/zorian/src/controller_web.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later use std::future::Future; @@ -167,9 +167,9 @@ impl WebController { }; WebController::layout( - "Tesor — tiny & opinionated packages mirror", + "Zorian — tiny & opinionated packages mirror", html! { - h1 { "Tesor — tiny & opinionated packages mirror." } + h1 { "Zorian — tiny & opinionated packages mirror." } p { r#"This site provides a caching proxy for downloading Zig and Go installation files. @@ -177,8 +177,8 @@ impl WebController { } p { - "Tesor is open source software licensed under " a href="https://www.gnu.org/licenses/agpl-3.0.html" { "AGPL-3.0" } ". " - "Source code is available on " a href="https://git.dimidiumlabs.io/tesor" { "Dimidium Labs Git" } ". " + "Zorian is open source software licensed under " a href="https://www.gnu.org/licenses/agpl-3.0.html" { "AGPL-3.0" } ". " + "Source code is available on " a href="https://github.com/mrdimidium/zorian" { "GitHub" } ". " "A list of dependency licenses " a href="/about/licenses" { "is available" } "." } @@ -323,19 +323,19 @@ impl WebController { html! { h1 { "Licenses" } - h2 { "Tesor" } + h2 { "Zorian" } p { - "Tesor is licensed under the " b { "GNU Affero General Public License v3.0 (AGPL-3.0)" } ". " + "Zorian is licensed under the " b { "GNU Affero General Public License v3.0 (AGPL-3.0)" } ". " "This means you are free to use, modify, and distribute the software. " - "If you run a modified version of Tesor as a network service, " + "If you run a modified version of Zorian as a network service, " "you must make the source code of your modifications available to its users. " "The software is provided as-is, without warranty of any kind." } p { "Source code is available on " - a href="https://git.dimidiumlabs.io/tesor" { "Dimidium Labs Git" } + a href="https://github.com/mrdimidium/zorian" { "GitHub" } ". The full license text is included below." } diff --git a/crates/tesor/src/main.rs b/crates/zorian/src/main.rs index 1029eca..c43c9d6 100644 --- a/crates/tesor/src/main.rs +++ b/crates/zorian/src/main.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later mod config; @@ -82,7 +82,7 @@ async fn run_index_refresh<S: BackendSpec>( const VERSION: &str = env!("CARGO_PKG_VERSION"); const HELP: &str = "\ -Usage: tesor [--config=<path>] +Usage: zorian [--config=<path>] Options: --config=<path> Path to config file (optional) @@ -134,7 +134,7 @@ async fn main() { return; } if arg == "--version" || arg == "-V" { - println!("tesor {VERSION}"); + println!("zorian {VERSION}"); return; } if let Some(path) = arg.strip_prefix("--config=") { @@ -155,7 +155,7 @@ async fn main() { let storage = Arc::new(storage::StorageService::new(config.clone()).await.unwrap()); let network = Arc::new(proxy::ProxyService::new()); - let source = format!("tesor:{}", config.appname()); + let source = format!("zorian:{}", config.appname()); let backends = config.backends(); const REQUEST_ID_HEADER: http::HeaderName = http::HeaderName::from_static("x-request-id"); @@ -331,7 +331,7 @@ async fn main() { )) .layer(tower_http::set_header::SetResponseHeaderLayer::overriding( http::header::SERVER, - http::HeaderValue::from_static(concat!("tesor/", env!("CARGO_PKG_VERSION"))), + http::HeaderValue::from_static(concat!("zorian/", env!("CARGO_PKG_VERSION"))), )); let mut tasks = tokio::task::JoinSet::new(); diff --git a/crates/tesor/src/proxy.rs b/crates/zorian/src/proxy.rs index 5e98d23..bd6a0f4 100644 --- a/crates/tesor/src/proxy.rs +++ b/crates/zorian/src/proxy.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later use bytes::Bytes; @@ -40,7 +40,7 @@ impl ProxyService { let request = Request::builder() .method(http::Method::GET) .uri(request.url.as_str()) - .header(http::header::USER_AGENT, "tesor/0.1") + .header(http::header::USER_AGENT, "zorian/0.1") .body(Empty::<Bytes>::new()) .unwrap(); diff --git a/crates/tesor/src/storage.rs b/crates/zorian/src/storage.rs index bc751a7..0e7f3ac 100644 --- a/crates/tesor/src/storage.rs +++ b/crates/zorian/src/storage.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later // This class stores uploaded files and associated metadata. diff --git a/crates/tesor/src/telemetry.rs b/crates/zorian/src/telemetry.rs index 9036924..116a7d0 100644 --- a/crates/tesor/src/telemetry.rs +++ b/crates/zorian/src/telemetry.rs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later use std::fmt::Debug; @@ -102,9 +102,9 @@ impl Drop for TelemetryService { } impl TelemetryService { pub fn init(config: &TelemetryConfig, service_name: &str, service_version: &str) -> Self { - let env_filter = match std::env::var_os("TESOR_LOG") { + let env_filter = match std::env::var_os("ZORIAN_LOG") { Some(val) => tracing_subscriber::EnvFilter::try_new(val.to_string_lossy()) - .expect("Invalid TESOR_LOG"), + .expect("Invalid ZORIAN_LOG"), None => tracing_subscriber::EnvFilter::new(Self::log_level_to_filter( config.stdout.log_level, )), diff --git a/deny.toml b/deny.toml index 3cd37da..f9d0ba0 100644 --- a/deny.toml +++ b/deny.toml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later [licenses] @@ -22,10 +22,11 @@ allow = [ ] exceptions = [ # The project itself is distributed under the AGPL, but avoid it in dependencies + { crate = "xtask", allow = ["AGPL-3.0-or-later"] }, { crate = "base", allow = ["AGPL-3.0-or-later"] }, { crate = "repos", allow = ["AGPL-3.0-or-later"] }, + { crate = "zorian", allow = ["AGPL-3.0-or-later"] }, { crate = "smoke", allow = ["AGPL-3.0-or-later"] }, - { crate = "tesor", allow = ["AGPL-3.0-or-later"] }, ] unused-allowed-license = "allow" diff --git a/mise.lock b/mise.lock deleted file mode 100644 --- a/mise.lock +++ /dev/null @@ -1,73 +0,0 @@ -# @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html - -[[tools."aqua:taiki-e/cargo-llvm-cov"]] -version = "0.8.7" -backend = "aqua:taiki-e/cargo-llvm-cov" - -[tools."aqua:taiki-e/cargo-llvm-cov"."platforms.linux-arm64"] -checksum = "sha256:b7bb2ad514166f3b19fc06874c577eefde0010e5ac571f9ae33ff45cd19a4785" -url = "https://github.com/taiki-e/cargo-llvm-cov/releases/download/v0.8.7/cargo-llvm-cov-aarch64-unknown-linux-musl.tar.gz" -url_api = "https://api.github.com/repos/taiki-e/cargo-llvm-cov/releases/assets/418861713" - -[tools."aqua:taiki-e/cargo-llvm-cov"."platforms.linux-x64"] -checksum = "sha256:967b5cc996c29d8baa52bbb4595ef1f53af35255af8e2036ddbc6468d7b523c7" -url = "https://github.com/taiki-e/cargo-llvm-cov/releases/download/v0.8.7/cargo-llvm-cov-x86_64-unknown-linux-musl.tar.gz" -url_api = "https://api.github.com/repos/taiki-e/cargo-llvm-cov/releases/assets/418861752" - -[[tools."cargo:cargo-about"]] -version = "0.8.4" -backend = "cargo:cargo-about" - -[[tools.gh]] -version = "2.96.0" -backend = "aqua:cli/cli" - -[tools.gh."platforms.linux-arm64"] -checksum = "sha256:06f86ec7103d41993b76cd78072f43595c34aaa56506d971d9860e67140bf909" -url = "https://github.com/cli/cli/releases/download/v2.96.0/gh_2.96.0_linux_arm64.tar.gz" -url_api = "https://api.github.com/repos/cli/cli/releases/assets/464728549" -provenance = "github-attestations" - -[tools.gh."platforms.linux-x64"] -checksum = "sha256:83d5c2ccad5498f58bf6368acb1ab32588cf43ab3a4b1c301bf36328b1c8bd60" -url = "https://github.com/cli/cli/releases/download/v2.96.0/gh_2.96.0_linux_amd64.tar.gz" -url_api = "https://api.github.com/repos/cli/cli/releases/assets/464728543" -provenance = "github-attestations" - -[[tools.jq]] -version = "1.8.2" -backend = "aqua:jqlang/jq" - -[tools.jq."platforms.linux-arm64"] -checksum = "sha256:8b85c817833814ddca00a144c33705546355afccf0cf39b188f3cdb48b852309" -url = "https://github.com/jqlang/jq/releases/download/jq-1.8.2/jq-linux-arm64" -url_api = "https://api.github.com/repos/jqlang/jq/releases/assets/453012756" -provenance = "github-attestations" - -[tools.jq."platforms.linux-x64"] -checksum = "sha256:b1c22172dd303f3be49e935aa56aa48a8b7a46e0bc838b4997d3bb451495870f" -url = "https://github.com/jqlang/jq/releases/download/jq-1.8.2/jq-linux-amd64" -url_api = "https://api.github.com/repos/jqlang/jq/releases/assets/453012752" -provenance = "github-attestations" - -[[tools.rust]] -version = "1.97.1" -backend = "core:rust" - -[tools.rust.options] -components = "clippy,llvm-tools-preview,rustfmt" -profile = "minimal" - -[[tools.shellcheck]] -version = "0.11.0" -backend = "aqua:koalaman/shellcheck" - -[tools.shellcheck."platforms.linux-arm64"] -checksum = "sha256:12b331c1d2db6b9eb13cfca64306b1b157a86eb69db83023e261eaa7e7c14588" -url = "https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.linux.aarch64.tar.xz" -url_api = "https://api.github.com/repos/koalaman/shellcheck/releases/assets/279056934" - -[tools.shellcheck."platforms.linux-x64"] -checksum = "sha256:8c3be12b05d5c177a04c29e3c78ce89ac86f1595681cab149b65b97c4e227198" -url = "https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.linux.x86_64.tar.xz" -url_api = "https://api.github.com/repos/koalaman/shellcheck/releases/assets/279056942" diff --git a/mise.toml b/mise.toml deleted file mode 100644 --- a/mise.toml +++ /dev/null @@ -1,65 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov -# SPDX-License-Identifier: AGPL-3.0-or-later - -min_version = "2026.7.5" - -[settings] -experimental = true - -[tools] -"aqua:taiki-e/cargo-llvm-cov" = "0.8.7" -"cargo:cargo-about" = "0.8.4" -gh = "2.96.0" -jq = "1.8.2" -rust = { version = "1.97.1", profile = "minimal", components = [ "clippy", "llvm-tools-preview", "rustfmt" ] } -shellcheck = "0.11.0" - -[bootstrap.packages] -# APT -"apt:apt-utils" = "latest" -"apt:build-essential" = "latest" -"apt:debsigs" = "latest" -"apt:createrepo-c" = "latest" -"apt:gnupg" = "latest" -"apt:libssl-dev" = "latest" -"apt:pkg-config" = "latest" -"apt:rpm" = "latest" - -# DNF -"dnf:createrepo_c" = "latest" -"dnf:gcc" = "latest" -"dnf:gnupg2" = "latest" -"dnf:openssl-devel" = "latest" -"dnf:pkgconf-pkg-config" = "latest" -"dnf:rpm" = "latest" - -[task_config] -dir = "{{cwd}}" -includes = [ - "git::https://git.dimidiumlabs.io/platform.git//tasks?ref=159ce265b95d655342c378d9aaa7dc14dbf1dfa4", -] - -[tasks.fmt] -run = "cargo fmt --all --check" - -[tasks.clippy] -run = "cargo clippy --all-targets --all-features -- -D warnings" - -[tasks.test] -run = """ -cargo build --release -cargo test --all-features --release --locked -""" - -[tasks.smoke] -run = "cargo run -p smoke" - -[tasks.smoke-local] -run = "./tests/smoke/run-local.sh" - -[tasks.coverage] -run = """ -mkdir -p target/coverage/ -cargo llvm-cov --all-features --workspace --lcov --output-path target/coverage/lcov.info -cargo llvm-cov --all-features --workspace --html --output-dir target/coverage/html -""" diff --git a/nfpm.yaml b/nfpm.yaml index 5704fcb..262bde9 100644 --- a/nfpm.yaml +++ b/nfpm.yaml @@ -1,10 +1,10 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later # yaml-language-server: $schema=https://nfpm.goreleaser.com/schema.json # vim: set ts=2 sw=2 tw=0 fo=cnqoj -name: tesor +name: zorian arch: ${ARCH} version: ${VERSION} license: AGPL-3.0-or-later @@ -14,34 +14,34 @@ description: Tiny packages caching proxy contents: - src: ./LICENSE - dst: /usr/share/doc/tesor/LICENSE + dst: /usr/share/doc/zorian/LICENSE - src: ./README.md - dst: /usr/share/doc/tesor/README.md + dst: /usr/share/doc/zorian/README.md - - src: target/release/tesor - dst: /usr/local/bin/tesor + - src: target/release/zorian + dst: /usr/local/bin/zorian file_info: mode: 0755 - - src: pkg/tesor.toml - dst: /etc/tesor.toml + - src: pkg/zorian.toml + dst: /etc/zorian.toml type: config|noreplace file_info: mode: 0640 owner: root - group: tesor + group: zorian - - src: pkg/tesor.service - dst: /usr/lib/systemd/system/tesor.service + - src: pkg/zorian.service + dst: /usr/lib/systemd/system/zorian.service file_info: mode: 0644 - - dst: /var/lib/tesor + - dst: /var/lib/zorian type: dir file_info: mode: 0755 owner: root - group: tesor + group: zorian scripts: diff --git a/pkg/logo.svg b/pkg/logo.svg index f825370..25cd3ec 100644 --- a/pkg/logo.svg +++ b/pkg/logo.svg @@ -1,3 +1,8 @@ +<!-- +SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> +SPDX-License-Identifier: AGPL-3.0-or-later +--> + <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg viewBox="-150 -150 800 800" xmlns="http://www.w3.org/2000/svg" fill="rgb(247, 164, 29)"> diff --git a/pkg/scripts/postinstall.sh b/pkg/scripts/postinstall.sh index 6e391fc..8a1e7cf 100644 --- a/pkg/scripts/postinstall.sh +++ b/pkg/scripts/postinstall.sh @@ -1,10 +1,10 @@ #!/bin/sh -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later set -e -if [ -x "/bin/systemctl" ] && [ -d /run/systemd/system ] && [ -f /usr/lib/systemd/system/tesor.service ]; then +if [ -x "/bin/systemctl" ] && [ -d /run/systemd/system ] && [ -f /usr/lib/systemd/system/zorian.service ]; then /bin/systemctl daemon-reload - /bin/systemctl enable tesor + /bin/systemctl enable zorian fi diff --git a/pkg/scripts/preinstall.sh b/pkg/scripts/preinstall.sh index 175eaf1..2828c95 100644 --- a/pkg/scripts/preinstall.sh +++ b/pkg/scripts/preinstall.sh @@ -1,16 +1,17 @@ #!/bin/sh -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later set -e -TESOR_USER=${TESOR_USER:-tesor} -TESOR_GROUP=${TESOR_GROUP:-${TESOR_USER}} +PROGRAM=zorian +ZORIAN_USER=${ZORIAN_USER:-zorian} +ZORIAN_GROUP=${ZORIAN_GROUP:-${ZORIAN_USER}} -if ! getent group "$TESOR_GROUP" >/dev/null; then - groupadd --system "$TESOR_GROUP" +if ! getent group $ZORIAN_GROUP >/dev/null; then + groupadd --system $ZORIAN_GROUP fi -if ! getent passwd "$TESOR_USER" >/dev/null; then - useradd --system --gid "$TESOR_GROUP" --no-create-home --shell /usr/sbin/nologin "$TESOR_USER" +if ! getent passwd $ZORIAN_USER >/dev/null; then + useradd --system --gid $ZORIAN_GROUP --no-create-home --shell /usr/sbin/nologin $ZORIAN_USER fi diff --git a/pkg/scripts/preremove.sh b/pkg/scripts/preremove.sh index 9cd6599..87c062a 100644 --- a/pkg/scripts/preremove.sh +++ b/pkg/scripts/preremove.sh @@ -1,10 +1,10 @@ #!/bin/sh -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later set -e -if [ -x "/bin/systemctl" ] && [ -d /run/systemd/system ] && [ -f /usr/lib/systemd/system/tesor.service ]; then - /bin/systemctl stop tesor.service || true - /bin/systemctl disable tesor.service || true +if [ -x "/bin/systemctl" ] && [ -d /run/systemd/system ] && [ -f /usr/lib/systemd/system/zorian.service ]; then + /bin/systemctl stop zorian.service || true + /bin/systemctl disable zorian.service || true fi diff --git a/pkg/tesor.service b/pkg/zorian.service index c2d463d..64f34b5 100644 --- a/pkg/tesor.service +++ b/pkg/zorian.service @@ -1,22 +1,22 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later [Unit] -Description=tesor server (tiny packages caching proxy) +Description=Zorian server (tiny packages caching proxy) Requires=network-online.target After=time-sync.target network-online.target remote-fs.target nss-lookup.target Wants=time-sync.target [Service] Type=notify -User=tesor -Group=tesor +User=zorian +Group=zorian Restart=always RestartSec=30 WatchdogSec=30 NotifyAccess=main -ExecPaths=/usr/local/bin/tesor /usr/lib -ExecStart=/usr/local/bin/tesor --config=/etc/tesor.toml +ExecPaths=/usr/local/bin/zorian /usr/lib +ExecStart=/usr/local/bin/zorian --config=/etc/zorian.toml LimitCORE=infinity LimitNOFILE=500000 AmbientCapabilities=CAP_NET_BIND_SERVICE diff --git a/pkg/tesor.toml b/pkg/zorian.toml index 7296086..0fde186 100644 --- a/pkg/tesor.toml +++ b/pkg/zorian.toml @@ -1,13 +1,13 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later -# tesor will dutifully indicate its user agent and protocols (for example, source for zig). +# Zorian will dutifully indicate its user agent and protocols (for example, source for zig). # Specify your name if you want your instance to be identified. -appname="tesor" +appname="zorian" # Path to the directory for storing state (indexes, caches, statistics). # Must be a writable directory. -dirname="/var/lib/tesor" +dirname="/var/lib/zorian" # Common server settings [server] @@ -25,8 +25,8 @@ addr = "0.0.0.0:2025" hostnames = ["localhost", "127.0.0.1", "::1"] # For HTTPS, set tls_cert and tls_key to PEM file paths. -# tls_crt = "/etc/tesor/cert.pem" -# tls_key = "/etc/tesor/key.pem" +# tls_crt = "/etc/zorian/cert.pem" +# tls_key = "/etc/zorian/key.pem" # Telemetry configuration # Logs to stdout (pretty or json format) @@ -47,13 +47,13 @@ log_format = "pretty" # pretty, json # log_level = "info" # # # For gRPC with TLS, specify certificates: -# # tls_ca = "/etc/tesor/otel-ca.crt" -# # tls_crt = "/etc/tesor/otel-client.crt" # for mTLS -# # tls_key = "/etc/tesor/otel-client.key" # for mTLS +# # tls_ca = "/etc/zorian/otel-ca.crt" +# # tls_crt = "/etc/zorian/otel-client.crt" # for mTLS +# # tls_key = "/etc/zorian/otel-client.key" # for mTLS # # # HTTP headers for authentication: # # [telemetry.otelcol.headers] # # Authorization = "Bearer <token>" -# Environment variable TESOR_LOG overrides log_level settings. -# Example: TESOR_LOG=debug,sqlx=warn +# Environment variable ZORIAN_LOG overrides log_level settings. +# Example: ZORIAN_LOG=debug,sqlx=warn diff --git a/tests/smoke/Cargo.toml b/tests/smoke/Cargo.toml index 66be086..c3d953c 100644 --- a/tests/smoke/Cargo.toml +++ b/tests/smoke/Cargo.toml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later [package] diff --git a/tests/smoke/run-local.sh b/tests/smoke/run-local.sh index 4b72441..4117271 100755 --- a/tests/smoke/run-local.sh +++ b/tests/smoke/run-local.sh @@ -1,26 +1,28 @@ #!/usr/bin/env bash -# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> # SPDX-License-Identifier: AGPL-3.0-or-later -# Starts tesor in a temporary directory, runs smoke tests, cleans up. -# Expects a prebuilt binary at target/release/tesor (run `cargo build --release` first). +# Builds zorian, starts it in a temporary directory, runs smoke tests, cleans up. # # Usage: # ./tests/smoke/run-local.sh # default port 2025 -# TESOR_PORT=9999 ./tests/smoke/run-local.sh +# ZORIAN_PORT=9999 ./tests/smoke/run-local.sh set -euo pipefail -BIN="target/release/tesor" -PORT="${TESOR_PORT:-2025}" +PORT="${ZORIAN_PORT:-2025}" BASE_URL="http://127.0.0.1:${PORT}" TMPDIR="$(mktemp -d)" -LOGFILE="$TMPDIR/tesor.log" +LOGFILE="$TMPDIR/zorian.log" trap 'kill "$PID" 2>/dev/null; wait "$PID" 2>/dev/null; rm -rf "$TMPDIR"' EXIT +# Build +echo "Building zorian..." +cargo build --release -p zorian + # Write minimal config -cat > "$TMPDIR/tesor.toml" <<EOF +cat > "$TMPDIR/zorian.toml" <<EOF appname = "smoke" dirname = "$TMPDIR/state" @@ -44,10 +46,10 @@ EOF mkdir -p "$TMPDIR/state" -# Start tesor -echo "Starting tesor on ${BASE_URL}..." +# Start zorian +echo "Starting zorian on ${BASE_URL}..." echo "Server log: ${LOGFILE}" -"$BIN" --config="$TMPDIR/tesor.toml" >"$LOGFILE" 2>&1 & +cargo run --release -p zorian -- --config="$TMPDIR/zorian.toml" >"$LOGFILE" 2>&1 & PID=$! # Wait for index to load (log shows "index refreshed" for each backend) @@ -58,7 +60,7 @@ for i in $(seq 1 120); do break fi if ! kill -0 "$PID" 2>/dev/null; then - echo "tesor exited unexpectedly. Server log:" + echo "zorian exited unexpectedly. Server log:" cat "$LOGFILE" exit 1 fi @@ -72,4 +74,4 @@ if ! grep -q "index refreshed" "$LOGFILE" 2>/dev/null; then fi # Run smoke tests -TESOR_URL="${BASE_URL}" cargo run -p smoke +ZORIAN_URL="${BASE_URL}" cargo run -p smoke diff --git a/tests/smoke/src/main.rs b/tests/smoke/src/main.rs index ca109f9..93a914b 100644 --- a/tests/smoke/src/main.rs +++ b/tests/smoke/src/main.rs @@ -1,13 +1,13 @@ -// SPDX-FileCopyrightText: 2026 Nikolay Govorov +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> // SPDX-License-Identifier: AGPL-3.0-or-later -// Black-box smoke tests for Tesor. +// Black-box smoke tests for Zorian. // -// Downloads archives from Tesor and upstream, compares sha256 hashes, +// Downloads archives from Zorian and upstream, compares sha256 hashes, // verifies that minisig signatures (Zig) and sha256 checksums (Go) match upstream. // // Usage: -// TESOR_URL=https://pkg.earth cargo run -p smoke +// ZORIAN_URL=https://pkg.earth cargo run -p smoke use sha2::{Digest, Sha256}; @@ -198,8 +198,8 @@ fn test_web(r: &mut Runner, base_url: &str) { r.fail(name, &format!("status {status}, expected 200")); } else if !ct.contains("text/html") { r.fail(name, &format!("content-type: {ct}")); - } else if !body.contains("Tesor") { - r.fail(name, "body missing \"Tesor\""); + } else if !body.contains("Zorian") { + r.fail(name, "body missing \"Zorian\""); } else { r.ok(name); } @@ -274,11 +274,11 @@ fn test_go(r: &mut Runner, base_url: &str) { r.fetch_bytes(&format!("{base_url}/go/{file}")), r.fetch_bytes(&format!("https://go.dev/dl/{file}")), ) { - (Ok(tesor), Ok(upstream)) => { - let zh = sha256hex(&tesor); + (Ok(zorian), Ok(upstream)) => { + let zh = sha256hex(&zorian); let uh = sha256hex(&upstream); if zh != uh { - r.fail(&name, &format!("tesor={zh} upstream={uh}")); + r.fail(&name, &format!("zorian={zh} upstream={uh}")); } else { r.ok(&name); } @@ -332,11 +332,11 @@ fn test_zig(r: &mut Runner, base_url: &str) { r.fetch_bytes(&format!("{base_url}/zig/{}", entry.file)), r.fetch_bytes(&zig_upstream_url(entry.file, entry.version)), ) { - (Ok(tesor), Ok(upstream)) => { - let zh = sha256hex(&tesor); + (Ok(zorian), Ok(upstream)) => { + let zh = sha256hex(&zorian); let uh = sha256hex(&upstream); if zh != uh { - r.fail(&name, &format!("tesor={zh} upstream={uh}")); + r.fail(&name, &format!("zorian={zh} upstream={uh}")); } else { r.ok(&name); } @@ -348,11 +348,11 @@ fn test_zig(r: &mut Runner, base_url: &str) { // Signature: compare .minisig with upstream { let name = format!("zig: {}.minisig matches upstream", entry.file); - let tesor_url = format!("{base_url}/zig/{}.minisig", entry.file); + let zorian_url = format!("{base_url}/zig/{}.minisig", entry.file); let upstream_url = format!("{}.minisig", zig_upstream_url(entry.file, entry.version)); - match (r.fetch_bytes(&tesor_url), r.fetch_bytes(&upstream_url)) { - (Ok(tesor), Ok(upstream)) => { - if tesor != upstream { + match (r.fetch_bytes(&zorian_url), r.fetch_bytes(&upstream_url)) { + (Ok(zorian), Ok(upstream)) => { + if zorian != upstream { r.fail(&name, "minisig content differs from upstream"); } else { r.ok(&name); @@ -374,11 +374,11 @@ fn test_zig(r: &mut Runner, base_url: &str) { } fn main() { - let base_url = match std::env::var("TESOR_URL") { + let base_url = match std::env::var("ZORIAN_URL") { Ok(url) => url, Err(_) => { - eprintln!("Error: TESOR_URL environment variable is not set."); - eprintln!("Usage: TESOR_URL=https://pkg.earth cargo run -p smoke"); + eprintln!("Error: ZORIAN_URL environment variable is not set."); + eprintln!("Usage: ZORIAN_URL=https://pkg.earth cargo run -p smoke"); std::process::exit(1); } }; diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml new file mode 100644 --- /dev/null +++ b/xtask/Cargo.toml @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> +# SPDX-License-Identifier: AGPL-3.0-or-later + +[package] +name = "xtask" +edition.workspace = true +publish.workspace = true +license.workspace = true + +[dependencies] +krates = "0.20" +rayon = "1.10" +tracing.workspace = true +serde.workspace = true +serde_json.workspace = true +spdx = { version = "0.13", features = ["detection-inline-cache", "text"] } diff --git a/xtask/build.rs b/xtask/build.rs new file mode 100644 --- /dev/null +++ b/xtask/build.rs @@ -0,0 +1,9 @@ +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> +// SPDX-License-Identifier: AGPL-3.0-or-later + +fn main() { + println!( + "cargo:rustc-env=TARGET={}", + std::env::var("TARGET").unwrap() + ); +} diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs new file mode 100644 --- /dev/null +++ b/xtask/src/lib.rs @@ -0,0 +1,4 @@ +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> +// SPDX-License-Identifier: AGPL-3.0-or-later + +pub mod licenses; diff --git a/xtask/src/licenses.rs b/xtask/src/licenses.rs new file mode 100644 --- /dev/null +++ b/xtask/src/licenses.rs @@ -0,0 +1,615 @@ +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> +// SPDX-License-Identifier: AGPL-3.0-or-later +// +// The approach to gathering licenses — resolving the dependency graph via +// krates, scanning crate sources for license texts with spdx detection, +// and deduplicating results — is based on cargo-about +// (https://github.com/EmbarkStudios/cargo-about) by Embark Studios, +// licensed under MIT OR Apache-2.0. + +use std::collections::BTreeMap; +use std::{cmp, fmt}; + +use krates::cm; +use krates::{Utf8Path, Utf8PathBuf}; +use serde::Serialize; +use spdx::detection as sd; +use spdx::{Expression, LicenseReq, Licensee}; + +const CONFIDENCE_THRESHOLD: f32 = 0.8; + +const IGNORE_PRIVATE: bool = true; +const IGNORE_DEV_DEPENDENCIES: bool = true; +const IGNORE_BUILD_DEPENDENCIES: bool = true; +const IGNORE_TRANSITIVE_DEPENDENCIES: bool = false; + +struct Crate(cm::Package); + +impl Crate { + fn get_license_expression(&self) -> LicenseInfo { + if let Some(license_field) = &self.0.license { + match Crate::parse_license_expression(license_field) { + Ok(validated) => LicenseInfo::Expr(validated), + Err(err) => { + tracing::error!("unable to parse license expression for '{self}': {err}"); + LicenseInfo::Unknown + } + } + } else { + tracing::warn!("crate '{self}' doesn't have a license field"); + LicenseInfo::Unknown + } + } + + fn parse_license_expression(license: &str) -> Result<Expression, spdx::ParseError> { + Expression::parse_mode( + license, + spdx::ParseMode { + allow_deprecated: true, + allow_imprecise_license_names: true, + allow_slash_as_or_operator: false, + allow_postfix_plus_on_gpl: true, + allow_unknown: false, + }, + ) + } +} + +impl Ord for Crate { + fn cmp(&self, o: &Self) -> cmp::Ordering { + match self.0.name.cmp(&o.0.name) { + cmp::Ordering::Equal => self.0.version.cmp(&o.0.version), + o => o, + } + } +} + +impl PartialOrd for Crate { + fn partial_cmp(&self, o: &Self) -> Option<cmp::Ordering> { + Some(self.cmp(o)) + } +} + +impl Eq for Crate {} + +impl PartialEq for Crate { + fn eq(&self, o: &Self) -> bool { + self.cmp(o) == cmp::Ordering::Equal + } +} + +impl From<cm::Package> for Crate { + fn from(mut pkg: cm::Package) -> Self { + // Fix the license field as cargo used to allow the invalid / separator + if let Some(lf) = &mut pkg.license { + *lf = lf.replace('/', " OR "); + } + + Self(pkg) + } +} + +impl krates::KrateDetails for Crate { + fn name(&self) -> &str { + &self.0.name + } + + fn version(&self) -> &krates::semver::Version { + &self.0.version + } +} + +impl fmt::Display for Crate { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{} {}", self.0.name, self.0.version) + } +} + +impl std::ops::Deref for Crate { + type Target = cm::Package; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +type Krates = krates::Krates<Crate>; + +fn get_all_crates(cargo_toml: &Utf8Path) -> Result<Krates, krates::Error> { + let mut mdc = krates::Cmd::new(); + mdc.manifest_path(cargo_toml); + + let mut builder = krates::Builder::new(); + + if IGNORE_BUILD_DEPENDENCIES { + builder.ignore_kind(krates::DepKind::Build, krates::Scope::All); + } + + if IGNORE_DEV_DEPENDENCIES { + builder.ignore_kind(krates::DepKind::Dev, krates::Scope::All); + } + + if IGNORE_TRANSITIVE_DEPENDENCIES { + builder.ignore_kind(krates::DepKind::Normal, krates::Scope::NonWorkspace); + builder.ignore_kind(krates::DepKind::Dev, krates::Scope::NonWorkspace); + builder.ignore_kind(krates::DepKind::Build, krates::Scope::NonWorkspace); + } + + builder.include_targets(std::iter::once((env!("TARGET"), vec![]))); + + let graph = builder.build(mdc, |filtered: cm::Package| { + tracing::debug!("filtered {} {}", filtered.name, filtered.version); + })?; + + Ok(graph) +} + +type LicenseStore = sd::Store; + +fn load_license_store() -> Result<LicenseStore, Box<dyn std::error::Error>> { + Ok(sd::Store::load_inline()?) +} + +#[derive(Debug)] +#[allow(clippy::large_enum_variant)] +enum LicenseInfo { + Expr(Expression), + Unknown, +} + +enum LicenseFileKind { + /// The license file is the canonical text of the license + Text(String), + /// The file just has a license header + Header, +} + +struct LicenseFile { + license_expr: Expression, + confidence: f32, + kind: LicenseFileKind, +} + +impl Ord for LicenseFile { + fn cmp(&self, o: &Self) -> cmp::Ordering { + match self.license_expr.as_ref().cmp(o.license_expr.as_ref()) { + cmp::Ordering::Equal => o + .confidence + .partial_cmp(&self.confidence) + .expect("NaN encountered comparing license confidences"), + ord => ord, + } + } +} + +impl PartialOrd for LicenseFile { + fn partial_cmp(&self, o: &Self) -> Option<cmp::Ordering> { + Some(self.cmp(o)) + } +} + +impl PartialEq for LicenseFile { + fn eq(&self, o: &Self) -> bool { + self.cmp(o) == cmp::Ordering::Equal + } +} + +impl Eq for LicenseFile {} + +struct KrateLicense<'krate> { + krate: &'krate Crate, + lic_info: LicenseInfo, + license_files: Vec<LicenseFile>, +} + +fn walk_files(dir: &Utf8Path) -> Vec<Utf8PathBuf> { + let mut files = Vec::new(); + let mut stack = vec![dir.to_path_buf()]; + + while let Some(current) = stack.pop() { + let entries = match std::fs::read_dir(¤t) { + Ok(entries) => entries, + Err(e) => { + tracing::warn!("failed to read directory '{current}': {e}"); + continue; + } + }; + + for entry in entries.filter_map(|e| e.ok()) { + let ft = match entry.file_type() { + Ok(ft) => ft, + Err(_) => continue, + }; + + let path = match Utf8PathBuf::from_path_buf(entry.path()) { + Ok(pb) => pb, + Err(e) => { + tracing::warn!("skipping path {}, not a valid utf-8 path", e.display()); + continue; + } + }; + + if ft.is_dir() { + stack.push(path); + } else if ft.is_file() { + files.push(path); + } + } + } + + files +} + +fn scan_files( + root_dir: &Utf8Path, + scanner: &sd::scan::Scanner<'_>, + threshold: f32, +) -> Vec<LicenseFile> { + walk_files(root_dir) + .into_iter() + .filter_map(|path| { + let contents = read_file(&path)?; + check_is_license_file(path, contents, scanner, threshold) + }) + .collect() +} + +fn read_file(path: &Utf8Path) -> Option<String> { + match std::fs::read_to_string(path) { + Err(ref e) if e.kind() == std::io::ErrorKind::InvalidData => { + tracing::debug!("binary file '{path}' detected"); + None + } + Err(e) => { + tracing::error!("failed to read '{path}': {e}"); + None + } + Ok(c) => Some(c), + } +} + +fn check_is_license_file( + path: Utf8PathBuf, + contents: String, + scanner: &sd::scan::Scanner<'_>, + threshold: f32, +) -> Option<LicenseFile> { + match scan_text(&contents, scanner, threshold) { + ScanResult::Header(ided) => { + let license_expr = match Expression::parse(ided.id.name) { + Ok(expr) => expr, + Err(err) => { + tracing::error!( + "failed to parse license '{}' at {path:?} into a valid expression: {err}", + ided.id.name + ); + return None; + } + }; + + Some(LicenseFile { + license_expr, + confidence: ided.confidence, + kind: LicenseFileKind::Header, + }) + } + ScanResult::Text(ided) => { + let license_expr = match Expression::parse(ided.id.name) { + Ok(expr) => expr, + Err(err) => { + tracing::error!( + "failed to parse license '{}' at {path:?} into a valid expression: {err}", + ided.id.name + ); + return None; + } + }; + + Some(LicenseFile { + license_expr, + confidence: ided.confidence, + kind: LicenseFileKind::Text(contents), + }) + } + ScanResult::UnknownId(id_str) => { + tracing::error!("found unknown SPDX identifier '{id_str}' scanning '{path}'"); + None + } + ScanResult::LowLicenseChance(ided) => { + tracing::debug!( + "found '{}' scanning '{path}' but it only has a confidence score of {}", + ided.id.name, + ided.confidence, + ); + None + } + ScanResult::NoLicense => None, + } +} + +struct Identified { + confidence: f32, + id: spdx::LicenseId, +} + +enum ScanResult { + Header(Identified), + Text(Identified), + UnknownId(String), + LowLicenseChance(Identified), + NoLicense, +} + +fn scan_text(contents: &str, strat: &sd::scan::Scanner<'_>, threshold: f32) -> ScanResult { + let text = spdx::detection::TextData::new(contents); + let lic_match = strat.scan(&text); + + let Some(identified) = lic_match.license else { + return ScanResult::NoLicense; + }; + + let lic_id = match spdx::license_id(identified.name) { + Some(id) => Identified { + confidence: lic_match.score, + id, + }, + None => return ScanResult::UnknownId(identified.name.to_owned()), + }; + + use spdx::detection::LicenseType; + + if lic_match.score >= threshold { + match identified.kind { + LicenseType::Header => ScanResult::Header(lic_id), + LicenseType::Original => ScanResult::Text(lic_id), + LicenseType::Alternate => { + panic!("Alternate license detected") + } + } + } else { + ScanResult::LowLicenseChance(lic_id) + } +} + +fn gather_licenses<'k>(krates: &'k Krates, store: &LicenseStore) -> Vec<KrateLicense<'k>> { + use rayon::prelude::*; + + let min_threshold = (CONFIDENCE_THRESHOLD - 0.5).max(0.1); + + let scanner = sd::scan::Scanner::new(store) + .confidence_threshold(min_threshold) + .optimize(false) + .max_passes(1); + + let mut licensed_krates: Vec<_> = krates + .krates() + .par_bridge() + .filter_map(|krate| { + // Skip private/workspace crates + if IGNORE_PRIVATE + && let Some(publish) = &krate.publish + && publish.is_empty() + { + tracing::debug!("ignoring private crate '{krate}'"); + return None; + } + + let lic_info = krate.get_license_expression(); + let root_path = krate.manifest_path.parent().unwrap(); + + let mut license_files = scan_files(root_path, &scanner, CONFIDENCE_THRESHOLD); + + // Condense each license down to the best candidate if + // multiple are found + license_files.sort(); + let mut last_expr = None; + license_files.retain(|lf| { + let dominated = last_expr.as_ref() == Some(&lf.license_expr); + last_expr = Some(lf.license_expr.clone()); + !dominated + }); + + Some(KrateLicense { + krate, + lic_info, + license_files, + }) + }) + .collect(); + + licensed_krates.sort_by(|a, b| a.krate.cmp(b.krate)); + licensed_krates +} + +/// For an OR expression like "MIT OR Apache-2.0", pick the minimal set of +/// licenses to satisfy the expression. Actual license policy validation +/// is handled by `cargo deny`. +fn pick_licenses(expr: &Expression) -> Vec<LicenseReq> { + let accepted: Vec<Licensee> = expr + .requirements() + .filter_map(|r| { + r.req + .license + .id() + .map(|id| Licensee::parse(id.name).unwrap()) + }) + .collect(); + + expr.minimized_requirements(&accepted).unwrap_or_default() +} + +/// For crates without a `license` field, synthesize requirements from +/// scanned license files. +fn synthesize_from_files(files: &[LicenseFile]) -> Vec<LicenseReq> { + let mut reqs = Vec::new(); + for lf in files { + for req in lf.license_expr.requirements() { + if !reqs.contains(&req.req) { + reqs.push(req.req.clone()); + } + } + } + reqs +} + +fn effective_licenses(kl: &KrateLicense<'_>) -> Vec<LicenseReq> { + match &kl.lic_info { + LicenseInfo::Expr(expr) => pick_licenses(expr), + LicenseInfo::Unknown => { + if kl.license_files.is_empty() { + tracing::warn!( + "unable to determine license for '{}': no `license` specified, and no license files were found", + kl.krate + ); + Vec::new() + } else { + synthesize_from_files(&kl.license_files) + } + } + } +} + +#[derive(Clone, Serialize)] +struct UsedBy { + #[serde(rename = "crate")] + krate: UsedByCrate, +} + +#[derive(Clone, Serialize)] +struct UsedByCrate { + name: String, + version: String, + repository: Option<String>, +} + +#[derive(Clone, Serialize)] +struct License { + name: String, + id: String, + first_of_kind: bool, + text: String, + used_by: Vec<UsedBy>, +} + +#[derive(Serialize)] +struct LicenseSet { + count: usize, + name: String, + id: String, +} + +#[derive(Serialize)] +struct LicenseList { + overview: Vec<LicenseSet>, + licenses: Vec<License>, +} + +fn generate(nfos: &[KrateLicense<'_>]) -> LicenseList { + let mut licenses_map: BTreeMap<String, BTreeMap<String, License>> = BTreeMap::new(); + + for krate_license in nfos { + let reqs = effective_licenses(krate_license); + + for license_req in &reqs { + let spdx::LicenseItem::Spdx { id, .. } = license_req.license else { + tracing::warn!( + "{license_req} has no license file for crate '{}'", + krate_license.krate + ); + continue; + }; + + // Try to find actual license text from scanned files + let license_text = krate_license + .license_files + .iter() + .find_map(|lf| { + if !lf + .license_expr + .evaluate(|ereq| ereq.license.id() == Some(id)) + { + return None; + } + + match &lf.kind { + LicenseFileKind::Text(text) => Some(text.clone()), + LicenseFileKind::Header => None, + } + }) + .unwrap_or_else(|| { + tracing::debug!( + "unable to find text for license '{license_req}' for crate '{}', falling back to canonical text", + krate_license.krate + ); + id.text().to_owned() + }); + + let used_by = UsedBy { + krate: UsedByCrate { + name: krate_license.krate.name.clone(), + version: krate_license.krate.version.to_string(), + repository: krate_license.krate.repository.clone(), + }, + }; + + let entry = licenses_map.entry(id.full_name.to_owned()).or_default(); + + let lic = entry + .entry(license_text.clone()) + .or_insert_with(|| License { + name: id.full_name.to_owned(), + id: id.name.to_owned(), + text: license_text, + used_by: Vec::new(), + first_of_kind: false, + }); + lic.used_by.push(used_by); + } + } + + let mut licenses: Vec<_> = licenses_map + .into_iter() + .flat_map(|(_, v)| v.into_values()) + .collect(); + + for lic in &mut licenses { + lic.used_by + .sort_by(|a, b| a.krate.name.len().cmp(&b.krate.name.len())); + } + + licenses.sort_by(|a, b| a.id.cmp(&b.id)); + + let mut overview_map: BTreeMap<&str, LicenseSet> = BTreeMap::new(); + + for lic in &mut licenses { + let ls = overview_map.entry(&lic.id).or_insert_with(|| { + lic.first_of_kind = true; + LicenseSet { + count: 0, + name: lic.name.clone(), + id: lic.id.clone(), + } + }); + ls.count += lic.used_by.len(); + } + + let mut overview: Vec<_> = overview_map.into_values().collect(); + overview.sort_by(|a, b| a.name.cmp(&b.name)); + + LicenseList { overview, licenses } +} + +/// Gathers all dependency licenses and returns a JSON string. +pub fn generate_json(manifest_path: &str) -> Result<String, Box<dyn std::error::Error>> { + let manifest_path = Utf8PathBuf::from(manifest_path); + if !manifest_path.exists() { + return Err(format!("manifest path '{manifest_path}' does not exist").into()); + } + + let krates = get_all_crates(&manifest_path)?; + let store = load_license_store()?; + let summary = gather_licenses(&krates, &store); + let list = generate(&summary); + + Ok(serde_json::to_string_pretty(&list)?) +} diff --git a/xtask/src/main.rs b/xtask/src/main.rs new file mode 100644 --- /dev/null +++ b/xtask/src/main.rs @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: 2026 Nikolay Govorov <me@govorov.online> +// SPDX-License-Identifier: AGPL-3.0-or-later + +fn main() -> Result<(), Box<dyn std::error::Error>> { + let args: Vec<String> = std::env::args().skip(1).collect(); + + match args.first().map(|s| s.as_str()) { + Some("licenses") => { + let json = xtask::licenses::generate_json("crates/zorian/Cargo.toml")?; + println!("{json}"); + Ok(()) + } + Some(cmd) => Err(format!("unknown command: {cmd}").into()), + None => Err( + "usage: cargo xtask <command>\n\ncommands:\n licenses Generate dependency license JSON" + .into(), + ), + } +} |
