Compare commits
10
Commits
v0.4.0
..
cc6ff8155d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc6ff8155d
|
||
|
|
cc1c455eca
|
||
|
|
7cbe5e3b5a
|
||
|
|
00dce090df
|
||
|
|
cf64cd5bf1
|
||
|
|
16c053a055
|
||
|
|
367fe20c6e
|
||
|
|
8aff6885e2
|
||
|
|
1429c4386d
|
||
|
|
50d0ea630f |
@@ -0,0 +1,12 @@
|
|||||||
|
APP_ENV=development
|
||||||
|
BACKEND_PORT=8000
|
||||||
|
FRONTEND_URL=http://localhost:4200
|
||||||
|
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_PASSWORD=password
|
||||||
|
POSTGRES_MAIN_DB=icarus_db
|
||||||
|
POSTGRES_MAIN_HOST=main_db
|
||||||
|
DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB}
|
||||||
@@ -9,14 +9,14 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Important for git describe --tags
|
fetch-depth: 0 # Important for git describe --tags
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: 1.94
|
toolchain: 1.96.1
|
||||||
components: cargo
|
components: cargo
|
||||||
|
|
||||||
- name: Extract Version from Cargo.toml
|
- name: Extract Version from Cargo.toml
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@@ -25,12 +29,12 @@ jobs:
|
|||||||
--health-retries 5
|
--health-retries 5
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install Rust 1.94
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: 1.94
|
toolchain: 1.96.1
|
||||||
components: clippy, rustfmt
|
components: clippy, rustfmt
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
@@ -49,21 +53,20 @@ jobs:
|
|||||||
pg_isready -U ${{ secrets.POSTGRES_USER }} -d ${{ secrets.POSTGRES_DB }} && break
|
pg_isready -U ${{ secrets.POSTGRES_USER }} -d ${{ secrets.POSTGRES_DB }} && break
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
# Run database migrations (if you use sqlx migrations)
|
|
||||||
cargo install sqlx-cli --no-default-features --features native-tls,postgres
|
cargo install sqlx-cli --no-default-features --features native-tls,postgres
|
||||||
sqlx migrate run --database-url $DATABASE_URL
|
sqlx migrate run --database-url $DATABASE_URL
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitea_deploy_key
|
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitea_deploy_key
|
||||||
chmod 600 ~/.ssh/gitea_deploy_key
|
chmod 600 ~/.ssh/gitea_deploy_key
|
||||||
ssh-keyscan ${{ vars.MYHOST }} >> ~/.ssh/known_hosts
|
ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts
|
||||||
eval $(ssh-agent -s)
|
eval $(ssh-agent -s)
|
||||||
ssh-add -v ~/.ssh/gitea_deploy_key
|
ssh-add -v ~/.ssh/gitea_deploy_key
|
||||||
cargo build --verbose --release
|
cargo build --verbose --release
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
env:
|
env:
|
||||||
ROOT_DIRECTORY: "/tmp"
|
ROOT_DIRECTORY: "/tmp"
|
||||||
@@ -71,9 +74,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cat .env.sample | head -6 > .env
|
cat .env.sample | head -6 > .env
|
||||||
cargo test --verbose --
|
cargo test --verbose --
|
||||||
|
|
||||||
- name: Run clippy
|
- name: Run clippy
|
||||||
run: cargo clippy -- -D warnings
|
run: cargo clippy -- -D warnings
|
||||||
|
|
||||||
- name: Run rustfmt
|
- name: Run rustfmt
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
|
|||||||
Generated
+369
-563
File diff suppressed because it is too large
Load Diff
+15
-17
@@ -1,33 +1,31 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "icarus"
|
name = "icarus"
|
||||||
version = "0.4.0"
|
version = "0.5.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.94"
|
rust-version = "1.95"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
axum = { version = "0.8.8", features = ["multipart"] }
|
axum = { version = "0.8.9", features = ["multipart"] }
|
||||||
axum-extra = { version = "0.12.5", features = ["cookie"] }
|
axum-extra = { version = "0.12.6", features = ["cookie"] }
|
||||||
serde = { version = "1.0.228", features = ["derive"] }
|
serde = { version = "1.0.228", features = ["derive"] }
|
||||||
serde_json = { version = "1.0.149" }
|
serde_json = { version = "1.0.150" }
|
||||||
tower = { version = "0.5.3", features = ["full"] }
|
tokio = { version = "1.52.3", features = ["full"] }
|
||||||
tokio = { version = "1.51", features = ["full"] }
|
|
||||||
tokio-util = { version = "0.7.18", features = ["io"] }
|
tokio-util = { version = "0.7.18", features = ["io"] }
|
||||||
tower-http = { version = "0.6.8", features = ["cors", "timeout"] }
|
tower = { version = "0.5.3", features = ["full"] }
|
||||||
|
tower-http = { version = "0.7.0", features = ["cors", "timeout"] }
|
||||||
tracing-subscriber = "0.3.23"
|
tracing-subscriber = "0.3.23"
|
||||||
futures = { version = "0.3.32" }
|
futures = { version = "0.3.32" }
|
||||||
mime_guess = { version = "2.0.5" }
|
mime_guess = { version = "2.0.5" }
|
||||||
uuid = { version = "1.23", features = ["v4", "serde"] }
|
uuid = { version = "1.23.4", features = ["v4", "serde"] }
|
||||||
sqlx = { version = "0.8.6", features = ["postgres", "runtime-tokio-native-tls", "time", "uuid"] }
|
sqlx = { version = "0.9.0", features = ["postgres", "runtime-tokio", "tls-native-tls", "time", "uuid"] }
|
||||||
time = { version = "0.3.47", features = ["formatting", "macros", "parsing", "serde"] }
|
time = { version = "0.3.53", features = ["formatting", "macros", "parsing", "serde"] }
|
||||||
thiserror = "2.0.18"
|
|
||||||
base64 = "0.22.1"
|
|
||||||
jsonwebtoken = { version = "10.3.0", features = ["rust_crypto"] }
|
jsonwebtoken = { version = "10.3.0", features = ["rust_crypto"] }
|
||||||
josekit = { version = "0.10.3" }
|
josekit = { version = "0.10.3" }
|
||||||
utoipa = { version = "5.4.0", features = ["axum_extras"] }
|
utoipa = { version = "5.5.0", features = ["axum_extras"] }
|
||||||
utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] }
|
utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] }
|
||||||
icarus_meta = { git = "ssh://git@git.kundeng.us/phoenix/icarus_meta.git", tag = "v0.5.0" }
|
icarus_meta = { git = "ssh://git@git.kundeng.us/phoenix/icarus_meta.git", tag = "v0.6.0" }
|
||||||
icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.10.0" }
|
icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.11.1" }
|
||||||
icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.6.0" }
|
icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.7.0" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
common-multipart-rfc7578 = { version = "0.7.0" }
|
common-multipart-rfc7578 = { version = "0.7.0" }
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
# Stage 1: Build the application
|
# Stage 1: Build the application
|
||||||
FROM rust:1.94 as builder
|
FROM rust:1.95 as builder
|
||||||
|
|
||||||
# Set the working directory inside the container
|
# Set the working directory inside the container
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
@@ -45,7 +45,7 @@ RUN --mount=type=ssh \
|
|||||||
|
|
||||||
# Stage 2: Create the final, smaller runtime image
|
# Stage 2: Create the final, smaller runtime image
|
||||||
# Use a minimal base image like debian-slim or even distroless for security/size
|
# Use a minimal base image like debian-slim or even distroless for security/size
|
||||||
FROM ubuntu:24.04
|
FROM debian:trixie-slim
|
||||||
|
|
||||||
# Install runtime dependencies if needed (e.g., SSL certificates)
|
# Install runtime dependencies if needed (e.g., SSL certificates)
|
||||||
RUN apt-get update && apt-get install -y ca-certificates libssl-dev libssl3 && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y ca-certificates libssl-dev libssl3 && rm -rf /var/lib/apt/lists/*
|
||||||
|
|||||||
+2
-2
@@ -74,7 +74,7 @@ services:
|
|||||||
POSTGRES_DB: ${POSTGRES_MAIN_DB:-icarus_db}
|
POSTGRES_DB: ${POSTGRES_MAIN_DB:-icarus_db}
|
||||||
volumes:
|
volumes:
|
||||||
# Persist database data using a named volume
|
# Persist database data using a named volume
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql
|
||||||
ports:
|
ports:
|
||||||
# Optional: Expose port 5432 ONLY if you need to connect directly from your host machine (e.g., for debugging)
|
# Optional: Expose port 5432 ONLY if you need to connect directly from your host machine (e.g., for debugging)
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
@@ -100,7 +100,7 @@ services:
|
|||||||
POSTGRES_DB: ${POSTGRES_AUTH_DB:-icarus_auth_db}
|
POSTGRES_DB: ${POSTGRES_AUTH_DB:-icarus_auth_db}
|
||||||
volumes:
|
volumes:
|
||||||
# Persist database data using a named volume
|
# Persist database data using a named volume
|
||||||
- postgres_data_auth:/var/lib/postgresql/data
|
- postgres_data_auth:/var/lib/postgresql
|
||||||
ports:
|
ports:
|
||||||
# Optional: Expose port 5432 ONLY if you need to connect directly from your host machine (e.g., for debugging)
|
# Optional: Expose port 5432 ONLY if you need to connect directly from your host machine (e.g., for debugging)
|
||||||
- "5433:5432"
|
- "5433:5432"
|
||||||
|
|||||||
Reference in New Issue
Block a user