Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09c56a69f6
|
||
|
|
bd03252b28
|
||
|
|
c3a3ce58ba
|
+2
-2
@@ -5,9 +5,9 @@ RUST_LOG=debug
|
||||
ALLOWED_ORIGINS=https://soaricarus.com,https://www.soaricarus.com
|
||||
SECRET_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h
|
||||
SERVICE_PASSPHRASE=iUOo1fxshf3y1tUGn1yU8l9raPApHCdinW0VdCHdRFEjqhR3Bf02aZzsKbLtaDFH
|
||||
POSTGRES_AUTH_USER=icarus_op
|
||||
POSTGRES_AUTH_USER=soaricarus_op
|
||||
POSTGRES_AUTH_PASSWORD=password
|
||||
POSTGRES_AUTH_DB=icarus_auth_db
|
||||
POSTGRES_AUTH_DB=soaricarus_auth_db
|
||||
POSTGRES_AUTH_HOST=auth_db
|
||||
DATABASE_URL=postgresql://${POSTGRES_AUTH_USER}:${POSTGRES_AUTH_PASSWORD}@${POSTGRES_AUTH_HOST}:5432/${POSTGRES_AUTH_DB}
|
||||
ENABLE_REGISTRATION=TRUE
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ RUST_LOG=debug
|
||||
ALLOWED_ORIGINS=https://soaricarus.com,https://www.soaricarus.com
|
||||
SECRET_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h
|
||||
SERVICE_PASSPHRASE=iUOo1fxshf3y1tUGn1yU8l9raPApHCdinW0VdCHdRFEjqhR3Bf02aZzsKbLtaDFH
|
||||
POSTGRES_AUTH_USER=icarus_op_test
|
||||
POSTGRES_AUTH_USER=soaricarus_op_test
|
||||
POSTGRES_AUTH_PASSWORD=password
|
||||
POSTGRES_AUTH_DB=icarus_auth_test_db
|
||||
POSTGRES_AUTH_DB=soaricarus_auth_test_db
|
||||
POSTGRES_AUTH_HOST=localhost
|
||||
DATABASE_URL=postgresql://${POSTGRES_AUTH_USER}:${POSTGRES_AUTH_PASSWORD}@${POSTGRES_AUTH_HOST}:5432/${POSTGRES_AUTH_DB}
|
||||
ENABLE_REGISTRATION=TRUE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: icarus_auth Build
|
||||
name: soaricarus_auth Build
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -20,12 +20,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 ${{ vars.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
|
||||
|
||||
@@ -72,12 +72,12 @@ jobs:
|
||||
ENABLE_REGISTRATION: 'TRUE'
|
||||
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 ${{ vars.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
|
||||
|
||||
@@ -93,12 +93,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 ${{ vars.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:
|
||||
@@ -113,12 +113,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 ${{ vars.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:
|
||||
@@ -132,10 +132,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 ${{ vars.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
+27
-27
@@ -781,31 +781,6 @@ dependencies = [
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "icarus_auth"
|
||||
version = "0.8.1"
|
||||
dependencies = [
|
||||
"argon2",
|
||||
"axum",
|
||||
"http-body-util",
|
||||
"icarus_envy",
|
||||
"icarus_models",
|
||||
"josekit",
|
||||
"openssl",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sqlx",
|
||||
"time",
|
||||
"tokio",
|
||||
"tower",
|
||||
"tower-http",
|
||||
"tracing-subscriber",
|
||||
"url",
|
||||
"utoipa",
|
||||
"utoipa-swagger-ui",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "icarus_envy"
|
||||
version = "0.8.0"
|
||||
@@ -1604,6 +1579,31 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "soaricarus_auth"
|
||||
version = "0.8.1"
|
||||
dependencies = [
|
||||
"argon2",
|
||||
"axum",
|
||||
"http-body-util",
|
||||
"icarus_envy",
|
||||
"icarus_models",
|
||||
"josekit",
|
||||
"openssl",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sqlx",
|
||||
"time",
|
||||
"tokio",
|
||||
"tower",
|
||||
"tower-http",
|
||||
"tracing-subscriber",
|
||||
"url",
|
||||
"utoipa",
|
||||
"utoipa-swagger-ui",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.6.4"
|
||||
@@ -2214,9 +2214,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.23.4"
|
||||
version = "1.24.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53"
|
||||
checksum = "bf3923a6f5c4c6382e0b653c4117f48d631ea17f38ed86e2a828e6f7412f5239"
|
||||
dependencies = [
|
||||
"getrandom 0.4.3",
|
||||
"js-sys",
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "icarus_auth"
|
||||
name = "soaricarus_auth"
|
||||
version = "0.8.1"
|
||||
edition = "2024"
|
||||
rust-version = "1.95"
|
||||
@@ -14,7 +14,7 @@ tracing-subscriber = { version = "0.3.23" }
|
||||
tower = { version = "0.5.3", features = ["full"] }
|
||||
tower-http = { version = "0.7.0", features = ["cors"] }
|
||||
sqlx = { version = "0.9.0", features = ["postgres", "runtime-tokio", "tls-native-tls", "time", "uuid"] }
|
||||
uuid = { version = "1.23.4", features = ["v4", "serde"] }
|
||||
uuid = { version = "1.23.5", features = ["v4", "serde"] }
|
||||
argon2 = { version = "0.5.3", features = ["std"] }
|
||||
time = { version = "0.3.53", features = ["macros", "serde"] }
|
||||
josekit = { version = "0.10.3" }
|
||||
|
||||
+3
-22
@@ -1,14 +1,8 @@
|
||||
# Stage 1: Build the application
|
||||
# Use a specific Rust version for reproducibility. Choose one that matches your development environment.
|
||||
# Using slim variant for smaller base image
|
||||
FROM rust:1.96.1 as builder
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Install build dependencies if needed (e.g., for certain crates like sqlx with native TLS)
|
||||
# RUN apt-get update && apt-get install -y pkg-config libssl-dev
|
||||
|
||||
# Install build dependencies if needed (e.g., git for cloning)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
pkg-config libssl3 \
|
||||
@@ -16,36 +10,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
openssh-client git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# << --- ADD HOST KEY HERE --- >>
|
||||
# Replace 'yourgithost.com' with the actual hostname (e.g., github.com)
|
||||
RUN mkdir -p -m 0700 ~/.ssh && \
|
||||
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_auth* # Clean up dummy build artifacts (replace icarus_auth)
|
||||
rm -rf src target/release/deps/soaricarus_auth*
|
||||
|
||||
# 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)
|
||||
@@ -55,17 +38,15 @@ RUN apt-get update && apt-get install -y ca-certificates libssl-dev libssl3 && r
|
||||
WORKDIR /usr/local/bin
|
||||
|
||||
# Copy the compiled binary from the builder stage
|
||||
# Replace 'icarus_auth' with the actual name of your binary (usually the crate name)
|
||||
COPY --from=builder /usr/src/app/target/release/icarus_auth .
|
||||
COPY --from=builder /usr/src/app/target/release/soaricarus_auth .
|
||||
|
||||
# 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 8001
|
||||
|
||||
# Set the command to run your application
|
||||
# Ensure this matches the binary name copied above
|
||||
CMD ["./icarus_auth"]
|
||||
CMD ["./soaricarus_auth"]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
A auth web API services for the Icarus project.
|
||||
# soaricarus_auth
|
||||
A auth web API services for the soaricarus project.
|
||||
|
||||
|
||||
# Getting Started
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
ssh: ["default"]
|
||||
container_name: icarus_auth
|
||||
container_name: soaricarus_auth
|
||||
ports:
|
||||
- "8001:8001"
|
||||
env_file:
|
||||
@@ -17,11 +17,11 @@ services:
|
||||
|
||||
auth_db:
|
||||
image: postgres:18.4-alpine
|
||||
container_name: icarus_auth_db
|
||||
container_name: soaricarus_auth_db
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_AUTH_USER:-icarus_op}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_AUTH_PASSWORD:-password}
|
||||
POSTGRES_DB: ${POSTGRES_AUTH_DB:-icarus_auth_db}
|
||||
POSTGRES_DB: ${POSTGRES_AUTH_DB:-soaricarus_auth_db}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql
|
||||
ports: []
|
||||
|
||||
Reference in New Issue
Block a user