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
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:
+2
-2
@@ -5,8 +5,8 @@ RUST_LOG=debug
|
||||
ALLOWED_ORIGINS=https://soaricarus.com,https://www.soaricarus.com
|
||||
SECRET_MAIN_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h
|
||||
ROOT_DIRECTORY=/home/icarus/mydata
|
||||
POSTGRES_MAIN_USER=icarus
|
||||
POSTGRES_MAIN_USER=soaricarus
|
||||
POSTGRES_MAIN_PASSWORD=password
|
||||
POSTGRES_MAIN_DB=icarus_db
|
||||
POSTGRES_MAIN_DB=soaricarus_db
|
||||
POSTGRES_MAIN_HOST=main_db
|
||||
DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB}
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ RUST_LOG=debug
|
||||
ALLOWED_ORIGINS=https://soaricarus.com,https://www.soaricarus.com
|
||||
SECRET_MAIN_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h
|
||||
ROOT_DIRECTORY=/home/icarus/mydata
|
||||
POSTGRES_MAIN_USER=icarus
|
||||
POSTGRES_MAIN_USER=soaricarus
|
||||
POSTGRES_MAIN_PASSWORD=password
|
||||
POSTGRES_MAIN_DB=icarus_db
|
||||
POSTGRES_MAIN_DB=soaricarus_db
|
||||
POSTGRES_MAIN_HOST=main_db
|
||||
DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB}
|
||||
|
||||
@@ -23,12 +23,12 @@ jobs:
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key
|
||||
chmod 600 ~/.ssh/icarus_models_deploy_key
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key
|
||||
chmod 600 ~/.ssh/soaricarus_models_deploy_key
|
||||
ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts
|
||||
|
||||
eval $(ssh-agent -s)
|
||||
ssh-add -v ~/.ssh/icarus_models_deploy_key
|
||||
ssh-add -v ~/.ssh/soaricarus_models_deploy_key
|
||||
|
||||
cargo check
|
||||
|
||||
@@ -75,12 +75,12 @@ jobs:
|
||||
ROOT_DIRECTORY: "/tmp"
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key
|
||||
chmod 600 ~/.ssh/icarus_models_deploy_key
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key
|
||||
chmod 600 ~/.ssh/soaricarus_models_deploy_key
|
||||
ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts
|
||||
|
||||
eval $(ssh-agent -s)
|
||||
ssh-add -v ~/.ssh/icarus_models_deploy_key
|
||||
ssh-add -v ~/.ssh/soaricarus_models_deploy_key
|
||||
|
||||
cargo test
|
||||
|
||||
@@ -96,12 +96,12 @@ jobs:
|
||||
- run: rustup component add rustfmt
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key
|
||||
chmod 600 ~/.ssh/icarus_models_deploy_key
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key
|
||||
chmod 600 ~/.ssh/soaricarus_models_deploy_key
|
||||
ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts
|
||||
|
||||
eval $(ssh-agent -s)
|
||||
ssh-add -v ~/.ssh/icarus_models_deploy_key
|
||||
ssh-add -v ~/.ssh/soaricarus_models_deploy_key
|
||||
cargo fmt --all -- --check
|
||||
|
||||
clippy:
|
||||
@@ -116,12 +116,12 @@ jobs:
|
||||
- run: rustup component add clippy
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key
|
||||
chmod 600 ~/.ssh/icarus_models_deploy_key
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key
|
||||
chmod 600 ~/.ssh/soaricarus_models_deploy_key
|
||||
ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts
|
||||
|
||||
eval $(ssh-agent -s)
|
||||
ssh-add -v ~/.ssh/icarus_models_deploy_key
|
||||
ssh-add -v ~/.ssh/soaricarus_models_deploy_key
|
||||
cargo clippy -- -D warnings
|
||||
|
||||
build:
|
||||
@@ -135,10 +135,10 @@ jobs:
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key
|
||||
chmod 600 ~/.ssh/icarus_models_deploy_key
|
||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key
|
||||
chmod 600 ~/.ssh/soaricarus_models_deploy_key
|
||||
ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts
|
||||
|
||||
eval $(ssh-agent -s)
|
||||
ssh-add -v ~/.ssh/icarus_models_deploy_key
|
||||
ssh-add -v ~/.ssh/soaricarus_models_deploy_key
|
||||
cargo build --release
|
||||
|
||||
Generated
+31
-31
@@ -1038,37 +1038,6 @@ dependencies = [
|
||||
"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]]
|
||||
name = "icarus_envy"
|
||||
version = "0.8.0"
|
||||
@@ -2213,6 +2182,37 @@ dependencies = [
|
||||
"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]]
|
||||
name = "socket2"
|
||||
version = "0.6.4"
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "icarus"
|
||||
name = "soaricarus"
|
||||
version = "0.5.2"
|
||||
edition = "2024"
|
||||
rust-version = "1.95"
|
||||
|
||||
+3
-21
@@ -1,4 +1,3 @@
|
||||
# Stage 1: Build the application
|
||||
FROM rust:1.95 as builder
|
||||
|
||||
# Set the working directory inside the container
|
||||
@@ -17,34 +16,24 @@ RUN mkdir -p -m 0700 ~/.ssh && \
|
||||
echo " User git" >> ~/.ssh/config && \
|
||||
chmod 600 ~/.ssh/config
|
||||
|
||||
# << --- ADD HOST KEY HERE --- >>
|
||||
RUN ssh-keyscan git.kundeng.us >> ~/.ssh/known_hosts
|
||||
|
||||
# Copy Cargo manifests
|
||||
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 && \
|
||||
echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \
|
||||
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 src ./src
|
||||
# If you have other directories like `templates` or `static`, copy them too
|
||||
COPY .env ./.env
|
||||
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 \
|
||||
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
|
||||
|
||||
# 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
|
||||
WORKDIR /usr/local/bin
|
||||
|
||||
# Copy the compiled binary from the builder stage
|
||||
# Replace 'icarus' with the actual name of your binary (usually the crate name)
|
||||
COPY --from=builder /usr/src/app/target/release/icarus .
|
||||
COPY --from=builder /usr/src/app/target/release/soaricarus_api .
|
||||
|
||||
# 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/migrations ./migrations
|
||||
|
||||
# Expose the port your Axum app listens on (e.g., 3000 or 8000)
|
||||
EXPOSE 8000
|
||||
|
||||
# Set the command to run your application
|
||||
# Ensure this matches the binary name copied above
|
||||
CMD ["./icarus"]
|
||||
CMD ["./soaricarus_api"]
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
# Icarus
|
||||
Web API for the Icarus project.
|
||||
# soaricarus_api
|
||||
Core web API for the soaricarus project.
|
||||
|
||||
|
||||
### Requires
|
||||
`icarus_auth` v0.8.x
|
||||
`soaricarus_auth` v0.8.x
|
||||
`songparser` v0.6.x
|
||||
|
||||
### Compatible with
|
||||
`icarus-dm` v0.9.x
|
||||
`soaricarus-dm` v0.9.x
|
||||
|
||||
|
||||
## 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 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
|
||||
and exists on the docker image's filesystem. The credentials for the database doesn't need to be
|
||||
|
||||
+11
-11
@@ -21,7 +21,7 @@ services:
|
||||
# --- Web API auth ---
|
||||
auth_api:
|
||||
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"]
|
||||
dockerfile: Dockerfile # Optional: Specify if your Dockerfile has a non-standard name
|
||||
container_name: auth_api
|
||||
@@ -29,12 +29,12 @@ services:
|
||||
ports:
|
||||
- "8001:8001"
|
||||
env_file:
|
||||
- ../icarus_auth/.env
|
||||
- ../soaricarus_auth/.env
|
||||
depends_on:
|
||||
auth_db:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- icarus-network
|
||||
- soaricarus-network
|
||||
# Optional: Mount local code for development (live reload)
|
||||
# volumes:
|
||||
# - ./path/to/your/web-api-repo:/app
|
||||
@@ -55,13 +55,13 @@ services:
|
||||
- auth_api
|
||||
- auth_db
|
||||
networks:
|
||||
- icarus-network
|
||||
- soaricarus-network
|
||||
|
||||
|
||||
# PostgreSQL Database Service
|
||||
main_db:
|
||||
image: postgres:18.4-alpine
|
||||
container_name: icarus_db
|
||||
container_name: soaricarus_db
|
||||
environment:
|
||||
# These MUST match the user, password, and database name in the DATABASE_URL above
|
||||
POSTGRES_USER: ${POSTGRES_MAIN_USER:-icarus}
|
||||
@@ -81,17 +81,17 @@ services:
|
||||
start_period: 10s
|
||||
restart: always
|
||||
networks:
|
||||
- icarus-network
|
||||
- soaricarus-network
|
||||
|
||||
# --- icarus web auth api db ---
|
||||
auth_db:
|
||||
image: postgres:18.4-alpine
|
||||
container_name: icarus_auth_db
|
||||
container_name: soaricarus_auth_db
|
||||
environment:
|
||||
# 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_DB: ${POSTGRES_AUTH_DB:-icarus_auth_db}
|
||||
POSTGRES_DB: ${POSTGRES_AUTH_DB:-soaricarus_auth_db}
|
||||
volumes:
|
||||
# Persist database data using a named volume
|
||||
- postgres_data_auth:/var/lib/postgresql
|
||||
@@ -106,7 +106,7 @@ services:
|
||||
start_period: 10s
|
||||
restart: always
|
||||
networks:
|
||||
- icarus-network
|
||||
- soaricarus-network
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
@@ -115,5 +115,5 @@ volumes:
|
||||
driver: local # Use the default local driver
|
||||
|
||||
networks:
|
||||
icarus-network:
|
||||
soaricarus-network:
|
||||
driver: bridge
|
||||
|
||||
Reference in New Issue
Block a user