Updating name
Rust CI / Rustfmt (pull_request) Successful in 2m25s
Rust CI / Test Suite (pull_request) Successful in 3m44s
Rust CI / Check (pull_request) Successful in 5m42s
Rust CI / build (pull_request) Successful in 6m40s
Rust CI / Clippy (pull_request) Successful in 7m58s

This commit is contained in:
2026-07-17 16:52:07 -04:00
parent 8a64a71339
commit 2afce82682
8 changed files with 71 additions and 89 deletions
+2 -2
View File
@@ -5,8 +5,8 @@ RUST_LOG=debug
ALLOWED_ORIGINS=https://soaricarus.com,https://www.soaricarus.com ALLOWED_ORIGINS=https://soaricarus.com,https://www.soaricarus.com
SECRET_MAIN_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h SECRET_MAIN_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h
ROOT_DIRECTORY=/home/icarus/mydata ROOT_DIRECTORY=/home/icarus/mydata
POSTGRES_MAIN_USER=icarus POSTGRES_MAIN_USER=soaricarus
POSTGRES_MAIN_PASSWORD=password POSTGRES_MAIN_PASSWORD=password
POSTGRES_MAIN_DB=icarus_db POSTGRES_MAIN_DB=soaricarus_db
POSTGRES_MAIN_HOST=main_db POSTGRES_MAIN_HOST=main_db
DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB} DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB}
+2 -2
View File
@@ -5,8 +5,8 @@ RUST_LOG=debug
ALLOWED_ORIGINS=https://soaricarus.com,https://www.soaricarus.com ALLOWED_ORIGINS=https://soaricarus.com,https://www.soaricarus.com
SECRET_MAIN_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h SECRET_MAIN_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h
ROOT_DIRECTORY=/home/icarus/mydata ROOT_DIRECTORY=/home/icarus/mydata
POSTGRES_MAIN_USER=icarus POSTGRES_MAIN_USER=soaricarus
POSTGRES_MAIN_PASSWORD=password POSTGRES_MAIN_PASSWORD=password
POSTGRES_MAIN_DB=icarus_db POSTGRES_MAIN_DB=soaricarus_db
POSTGRES_MAIN_HOST=main_db POSTGRES_MAIN_HOST=main_db
DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB} DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB}
+15 -15
View File
@@ -23,12 +23,12 @@ jobs:
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- run: | - run: |
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key
chmod 600 ~/.ssh/icarus_models_deploy_key chmod 600 ~/.ssh/soaricarus_models_deploy_key
ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts
eval $(ssh-agent -s) eval $(ssh-agent -s)
ssh-add -v ~/.ssh/icarus_models_deploy_key ssh-add -v ~/.ssh/soaricarus_models_deploy_key
cargo check cargo check
@@ -75,12 +75,12 @@ jobs:
ROOT_DIRECTORY: "/tmp" ROOT_DIRECTORY: "/tmp"
run: | run: |
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key
chmod 600 ~/.ssh/icarus_models_deploy_key chmod 600 ~/.ssh/soaricarus_models_deploy_key
ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts
eval $(ssh-agent -s) eval $(ssh-agent -s)
ssh-add -v ~/.ssh/icarus_models_deploy_key ssh-add -v ~/.ssh/soaricarus_models_deploy_key
cargo test cargo test
@@ -96,12 +96,12 @@ jobs:
- run: rustup component add rustfmt - run: rustup component add rustfmt
- run: | - run: |
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key
chmod 600 ~/.ssh/icarus_models_deploy_key chmod 600 ~/.ssh/soaricarus_models_deploy_key
ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts
eval $(ssh-agent -s) eval $(ssh-agent -s)
ssh-add -v ~/.ssh/icarus_models_deploy_key ssh-add -v ~/.ssh/soaricarus_models_deploy_key
cargo fmt --all -- --check cargo fmt --all -- --check
clippy: clippy:
@@ -116,12 +116,12 @@ jobs:
- run: rustup component add clippy - run: rustup component add clippy
- run: | - run: |
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key
chmod 600 ~/.ssh/icarus_models_deploy_key chmod 600 ~/.ssh/soaricarus_models_deploy_key
ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts
eval $(ssh-agent -s) eval $(ssh-agent -s)
ssh-add -v ~/.ssh/icarus_models_deploy_key ssh-add -v ~/.ssh/soaricarus_models_deploy_key
cargo clippy -- -D warnings cargo clippy -- -D warnings
build: build:
@@ -135,10 +135,10 @@ jobs:
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- run: | - run: |
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key
chmod 600 ~/.ssh/icarus_models_deploy_key chmod 600 ~/.ssh/soaricarus_models_deploy_key
ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts
eval $(ssh-agent -s) eval $(ssh-agent -s)
ssh-add -v ~/.ssh/icarus_models_deploy_key ssh-add -v ~/.ssh/soaricarus_models_deploy_key
cargo build --release cargo build --release
Generated
+31 -31
View File
@@ -1038,37 +1038,6 @@ dependencies = [
"tower-service", "tower-service",
] ]
[[package]]
name = "icarus"
version = "0.5.2"
dependencies = [
"axum",
"axum-extra",
"common-multipart-rfc7578",
"futures",
"icarus_envy",
"icarus_meta",
"icarus_models",
"josekit",
"jsonwebtoken",
"mime_guess",
"openssl",
"serde",
"serde_json",
"sqlx",
"tempfile",
"time",
"tokio",
"tokio-util",
"tower",
"tower-http",
"tracing-subscriber",
"url",
"utoipa",
"utoipa-swagger-ui",
"uuid",
]
[[package]] [[package]]
name = "icarus_envy" name = "icarus_envy"
version = "0.8.0" version = "0.8.0"
@@ -2213,6 +2182,37 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "soaricarus"
version = "0.5.2"
dependencies = [
"axum",
"axum-extra",
"common-multipart-rfc7578",
"futures",
"icarus_envy",
"icarus_meta",
"icarus_models",
"josekit",
"jsonwebtoken",
"mime_guess",
"openssl",
"serde",
"serde_json",
"sqlx",
"tempfile",
"time",
"tokio",
"tokio-util",
"tower",
"tower-http",
"tracing-subscriber",
"url",
"utoipa",
"utoipa-swagger-ui",
"uuid",
]
[[package]] [[package]]
name = "socket2" name = "socket2"
version = "0.6.4" version = "0.6.4"
+1 -1
View File
@@ -1,5 +1,5 @@
[package] [package]
name = "icarus" name = "soaricarus"
version = "0.5.2" version = "0.5.2"
edition = "2024" edition = "2024"
rust-version = "1.95" rust-version = "1.95"
+3 -21
View File
@@ -1,4 +1,3 @@
# Stage 1: Build the application
FROM rust:1.95 as builder FROM rust:1.95 as builder
# Set the working directory inside the container # Set the working directory inside the container
@@ -17,34 +16,24 @@ RUN mkdir -p -m 0700 ~/.ssh && \
echo " User git" >> ~/.ssh/config && \ echo " User git" >> ~/.ssh/config && \
chmod 600 ~/.ssh/config chmod 600 ~/.ssh/config
# << --- ADD HOST KEY HERE --- >>
RUN ssh-keyscan git.kundeng.us >> ~/.ssh/known_hosts RUN ssh-keyscan git.kundeng.us >> ~/.ssh/known_hosts
# Copy Cargo manifests # Copy Cargo manifests
COPY Cargo.toml Cargo.lock ./ COPY Cargo.toml Cargo.lock ./
# Build *only* dependencies to leverage Docker cache
# This dummy build caches dependencies as a separate layer
RUN --mount=type=ssh mkdir src && \ RUN --mount=type=ssh mkdir src && \
echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \ echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \
cargo build --release --quiet && \ cargo build --release --quiet && \
rm -rf src target/release/deps/icarus* # Clean up dummy build artifacts (replace icarus) rm -rf src target/release/deps/soaricarus_api*
# Copy the actual source code # Copy the actual source code
COPY src ./src COPY src ./src
# If you have other directories like `templates` or `static`, copy them too
COPY .env ./.env COPY .env ./.env
COPY migrations ./migrations COPY migrations ./migrations
# << --- SSH MOUNT ADDED HERE --- >>
# Build *only* dependencies to leverage Docker cache
# This dummy build caches dependencies as a separate layer
# Mount the SSH agent socket for this command
RUN --mount=type=ssh \ RUN --mount=type=ssh \
cargo build --release --quiet cargo build --release --quiet
# Stage 2: Create the final, smaller runtime image
# Use a minimal base image like debian-slim or even distroless for security/size
FROM debian:trixie-slim FROM debian:trixie-slim
# Install runtime dependencies if needed (e.g., SSL certificates) # Install runtime dependencies if needed (e.g., SSL certificates)
@@ -53,18 +42,11 @@ RUN apt-get update && apt-get install -y ca-certificates libssl-dev libssl3 && r
# Set the working directory # Set the working directory
WORKDIR /usr/local/bin WORKDIR /usr/local/bin
# Copy the compiled binary from the builder stage COPY --from=builder /usr/src/app/target/release/soaricarus_api .
# Replace 'icarus' with the actual name of your binary (usually the crate name)
COPY --from=builder /usr/src/app/target/release/icarus .
# Copy other necessary files like .env (if used for runtime config) or static assets
# It's generally better to configure via environment variables in Docker though
COPY --from=builder /usr/src/app/.env . COPY --from=builder /usr/src/app/.env .
COPY --from=builder /usr/src/app/migrations ./migrations COPY --from=builder /usr/src/app/migrations ./migrations
# Expose the port your Axum app listens on (e.g., 3000 or 8000)
EXPOSE 8000 EXPOSE 8000
# Set the command to run your application CMD ["./soaricarus_api"]
# Ensure this matches the binary name copied above
CMD ["./icarus"]
+6 -6
View File
@@ -1,19 +1,19 @@
# Icarus # soaricarus_api
Web API for the Icarus project. Core web API for the soaricarus project.
### Requires ### Requires
`icarus_auth` v0.8.x `soaricarus_auth` v0.8.x
`songparser` v0.6.x `songparser` v0.6.x
### Compatible with ### Compatible with
`icarus-dm` v0.9.x `soaricarus-dm` v0.9.x
## Getting Started ## Getting Started
Quickest way to get started is with docker. Make sure `icarus_auth` and `songparser` repositories Quickest way to get started is with docker. Make sure `soaricarus_auth` and `songparser` repositories
are located in the root of the parent directory. Check the respective repositories to ensure they are located in the root of the parent directory. Check the respective repositories to ensure they
are setup correctly before configuring `Icarus`. are setup correctly before configuring `soaricarus_api`.
Copy the `.env.docker.sample` file to `.env`. Ensure that the `ROOT_DIRECTORY` variable is populated Copy the `.env.docker.sample` file to `.env`. Ensure that the `ROOT_DIRECTORY` variable is populated
and exists on the docker image's filesystem. The credentials for the database doesn't need to be and exists on the docker image's filesystem. The credentials for the database doesn't need to be
+11 -11
View File
@@ -21,7 +21,7 @@ services:
# --- Web API auth --- # --- Web API auth ---
auth_api: auth_api:
build: build:
context: ../icarus_auth # IMPORTANT: Relative path to the local checkout of your web API repo (containing the Dockerfile) context: ../soaricarus_auth # IMPORTANT: Relative path to the local checkout of your web API repo (containing the Dockerfile)
ssh: ["default"] ssh: ["default"]
dockerfile: Dockerfile # Optional: Specify if your Dockerfile has a non-standard name dockerfile: Dockerfile # Optional: Specify if your Dockerfile has a non-standard name
container_name: auth_api container_name: auth_api
@@ -29,12 +29,12 @@ services:
ports: ports:
- "8001:8001" - "8001:8001"
env_file: env_file:
- ../icarus_auth/.env - ../soaricarus_auth/.env
depends_on: depends_on:
auth_db: auth_db:
condition: service_healthy condition: service_healthy
networks: networks:
- icarus-network - soaricarus-network
# Optional: Mount local code for development (live reload) # Optional: Mount local code for development (live reload)
# volumes: # volumes:
# - ./path/to/your/web-api-repo:/app # - ./path/to/your/web-api-repo:/app
@@ -55,13 +55,13 @@ services:
- auth_api - auth_api
- auth_db - auth_db
networks: networks:
- icarus-network - soaricarus-network
# PostgreSQL Database Service # PostgreSQL Database Service
main_db: main_db:
image: postgres:18.4-alpine image: postgres:18.4-alpine
container_name: icarus_db container_name: soaricarus_db
environment: environment:
# These MUST match the user, password, and database name in the DATABASE_URL above # These MUST match the user, password, and database name in the DATABASE_URL above
POSTGRES_USER: ${POSTGRES_MAIN_USER:-icarus} POSTGRES_USER: ${POSTGRES_MAIN_USER:-icarus}
@@ -81,17 +81,17 @@ services:
start_period: 10s start_period: 10s
restart: always restart: always
networks: networks:
- icarus-network - soaricarus-network
# --- icarus web auth api db --- # --- icarus web auth api db ---
auth_db: auth_db:
image: postgres:18.4-alpine image: postgres:18.4-alpine
container_name: icarus_auth_db container_name: soaricarus_auth_db
environment: environment:
# These MUST match the user, password, and database name in the DATABASE_URL above # These MUST match the user, password, and database name in the DATABASE_URL above
POSTGRES_USER: ${POSTGRES_AUTH_USER:-icarus_op} POSTGRES_USER: ${POSTGRES_AUTH_USER:-soaricarus_op}
POSTGRES_PASSWORD: ${POSTGRES_AUTH_PASSWORD:-password} POSTGRES_PASSWORD: ${POSTGRES_AUTH_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_AUTH_DB:-icarus_auth_db} POSTGRES_DB: ${POSTGRES_AUTH_DB:-soaricarus_auth_db}
volumes: volumes:
# Persist database data using a named volume # Persist database data using a named volume
- postgres_data_auth:/var/lib/postgresql - postgres_data_auth:/var/lib/postgresql
@@ -106,7 +106,7 @@ services:
start_period: 10s start_period: 10s
restart: always restart: always
networks: networks:
- icarus-network - soaricarus-network
volumes: volumes:
postgres_data: postgres_data:
@@ -115,5 +115,5 @@ volumes:
driver: local # Use the default local driver driver: local # Use the default local driver
networks: networks:
icarus-network: soaricarus-network:
driver: bridge driver: bridge