-
-
Notifications
You must be signed in to change notification settings - Fork 0
Version 1.1.0 #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Version 1.1.0 #17
Changes from 14 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4e0ed93
Merge pull request #7 from JosunLP/dev
JosunLP 7ce7ce8
Initial plan
Copilot a5c909b
Add native macOS support for builds and releases
Copilot cca113d
Refactor: consolidate Unix installation logic for Linux and macOS
Copilot f5e4143
🐛 Korrigiere SHA256-Checksumme für Linux und macOS; füge Fehlerausgab…
JosunLP f28bd5c
🐛 Verbessere Fehlerausgabe für nicht unterstützte macOS-Architekturen
JosunLP c3aba12
Merge branch 'copilot/add-macos-support-release' into dev
JosunLP 45bc16f
Feature: Rotation (#11)
JosunLP 83e4149
Add Docker deployment target with automated Docker Hub publishing (#13)
Copilot 3d4eaf8
Potential fix for code scanning alert no. 1: Workflow does not contai…
JosunLP 4d3f253
Update src/api.rs
JosunLP f2a0196
Add conditional checks to Docker workflow for missing secrets (#18)
Copilot c2bbf65
Revert invalid secret conditionals in Docker workflow (#19)
Copilot 77f1116
Add unit tests for parse_bool and clarify allow_rotations API fallbac…
Copilot fc9635f
fmt
JosunLP 3a956b4
Update dependencies and improve API route handling
JosunLP 95ba14b
Update version to 1.1.0 and enhance Docker setup documentation
JosunLP 37feb52
Refine Docker configuration and clarify axum 0.8 route syntax (#23)
Copilot 5d63499
Add test coverage for allow_rotations field parsing and override beha…
Copilot fee94cd
Update CHANGELOG
JosunLP 7bb3420
Update CHANGELOG
JosunLP File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Git files | ||
| .git | ||
| .gitignore | ||
| .github | ||
|
|
||
| # Rust build artifacts | ||
| target/ | ||
|
|
||
| # Documentation | ||
| *.md | ||
| CHANGELOG | ||
| LICENSE | ||
|
|
||
| # Environment files | ||
| .env | ||
| .env.example | ||
|
|
||
| # Scripts | ||
| scripts/ | ||
|
|
||
| # Node files | ||
| package.json | ||
| node_modules/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Docker Build and Push | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
| # Manual dispatch builds and pushes images based on metadata-action tags | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| docker: | ||
| name: Build and Push Docker Image | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} | ||
| # Note: Ensure DOCKER_USERNAME and DOCKER_PASSWORD secrets are configured | ||
|
JosunLP marked this conversation as resolved.
|
||
|
|
||
| - name: Extract metadata for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ secrets.DOCKER_USERNAME }}/sort-it-now | ||
| tags: | | ||
| type=semver,pattern={{version}} | ||
| type=semver,pattern={{major}}.{{minor}} | ||
| type=semver,pattern={{major}} | ||
| type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }} | ||
|
JosunLP marked this conversation as resolved.
|
||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| platforms: linux/amd64,linux/arm64 | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| name: Rust | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| # Docker Hub Deployment Setup | ||
|
|
||
| Diese Anleitung beschreibt, wie man die automatische Docker-Veröffentlichung auf Docker Hub einrichtet. | ||
|
|
||
| ## Voraussetzungen | ||
|
|
||
| 1. Ein Docker Hub Account (https://hub.docker.com/) | ||
| 2. Repository-Admin-Zugriff auf GitHub | ||
|
|
||
| ## Schritt 1: Docker Hub Access Token erstellen | ||
|
|
||
| 1. Gehe zu https://hub.docker.com/settings/security | ||
| 2. Klicke auf "New Access Token" | ||
| 3. Gib einen Namen ein (z.B. "github-actions-sort-it-now") | ||
| 4. Wähle die Berechtigung "Read, Write" aus | ||
| 5. Klicke auf "Generate" | ||
| 6. **Wichtig:** Kopiere das Token sofort - es wird nur einmal angezeigt! | ||
|
|
||
| ## Schritt 2: GitHub Secrets konfigurieren | ||
|
|
||
| 1. Gehe zu deinem GitHub Repository | ||
| 2. Navigiere zu **Settings** → **Secrets and variables** → **Actions** | ||
| 3. Klicke auf "New repository secret" | ||
| 4. Erstelle zwei Secrets: | ||
|
|
||
| **Secret 1:** | ||
| - Name: `DOCKER_USERNAME` | ||
| - Value: Dein Docker Hub Benutzername | ||
|
|
||
| **Secret 2:** | ||
| - Name: `DOCKER_PASSWORD` | ||
| - Value: Das Access Token aus Schritt 1 | ||
|
|
||
| ## Schritt 3: Workflow testen | ||
|
|
||
| Der Docker-Workflow wird automatisch ausgelöst, wenn: | ||
| - Ein neuer Tag im Format `v*` erstellt wird (z.B. `v1.0.0`) | ||
| - Der Workflow manuell über "Actions" → "Docker Build and Push" → "Run workflow" gestartet wird | ||
|
|
||
| ### Manueller Test: | ||
|
|
||
| 1. Gehe zu **Actions** im GitHub Repository | ||
| 2. Wähle den Workflow "Docker Build and Push" | ||
| 3. Klicke auf "Run workflow" | ||
| 4. Wähle den Branch aus | ||
| 5. Klicke auf "Run workflow" | ||
|
|
||
| ## Schritt 4: Docker Image auf Docker Hub verifizieren | ||
|
|
||
| Nach erfolgreichem Workflow-Durchlauf: | ||
|
|
||
| 1. Gehe zu https://hub.docker.com/ | ||
| 2. Navigiere zu deinem Repository | ||
| 3. Das Image sollte mit den entsprechenden Tags verfügbar sein: | ||
| - `latest` (wird bei jedem Release mit einem `v*` Tag vergeben) | ||
| - Versions-Tags (z.B. `1.0.0`, `1.0`, `1`) | ||
|
|
||
| ## Docker Image verwenden | ||
|
|
||
| Nach der Veröffentlichung kann das Image folgendermaßen verwendet werden: | ||
|
|
||
| > **Hinweis:** Ersetze `<your-dockerhub-username>` durch deinen tatsächlichen Docker Hub Benutzernamen. | ||
|
|
||
| ```bash | ||
| # Neueste Version | ||
| docker pull <your-dockerhub-username>/sort-it-now:latest | ||
|
|
||
| # Spezifische Version | ||
| docker pull <your-dockerhub-username>/sort-it-now:1.0.0 | ||
|
|
||
| # Ausführen | ||
| docker run -p 8080:8080 -e SORT_IT_NOW_SKIP_UPDATE_CHECK=1 <your-dockerhub-username>/sort-it-now:latest | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Workflow schlägt mit "Authentication failed" fehl | ||
| - Überprüfe, ob die Secrets korrekt gesetzt sind | ||
| - Stelle sicher, dass das Docker Hub Access Token nicht abgelaufen ist | ||
| - Verifiziere den Docker Hub Benutzernamen (Groß-/Kleinschreibung beachten) | ||
|
|
||
| ### Workflow schlägt mit "denied: requested access to the resource is denied" fehl | ||
| - Das Access Token benötigt "Write"-Berechtigung | ||
| - Stelle sicher, dass das Repository auf Docker Hub existiert (wird automatisch beim ersten Push erstellt) | ||
|
|
||
| ### Image wird nicht mit allen Plattformen gebaut | ||
| - Docker Buildx wird automatisch eingerichtet | ||
| - Bei Problemen kann man in `.github/workflows/docker.yml` die Zeile `platforms: linux/amd64,linux/arm64` auf nur `linux/amd64` reduzieren | ||
|
|
||
| ## Anpassungen | ||
|
|
||
| ### Docker Hub Repository-Name ändern | ||
|
|
||
| In `.github/workflows/docker.yml` die Zeile: | ||
| ```yaml | ||
| images: ${{ secrets.DOCKER_USERNAME }}/sort-it-now | ||
| ``` | ||
|
|
||
| ändern zu: | ||
| ```yaml | ||
| images: ${{ secrets.DOCKER_USERNAME }}/dein-repository-name | ||
| ``` | ||
|
|
||
| ### Andere Registry verwenden (z.B. GitHub Container Registry) | ||
|
|
||
| Für GitHub Container Registry (ghcr.io): | ||
| 1. Ersetze `docker/login-action` mit GitHub Token: | ||
| ```yaml | ||
| - name: Log in to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| ``` | ||
|
|
||
| 2. Ändere das Image in `metadata-action`: | ||
| ```yaml | ||
| images: ghcr.io/${{ github.repository_owner }}/sort-it-now | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Build stage | ||
| FROM rust:1 AS builder | ||
|
|
||
| # Install build dependencies | ||
| RUN apt-get update && apt-get install -y \ | ||
| pkg-config \ | ||
| libssl-dev \ | ||
| ca-certificates \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy manifests and build dependencies first for better layer caching | ||
| COPY Cargo.toml ./ | ||
| # Note: Cargo.lock is gitignored in this project, so dependencies will resolve at build time | ||
| # Create a dummy main.rs to build dependencies | ||
| RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo build --release && rm -rf src | ||
|
|
||
| # Copy actual source code | ||
|
JosunLP marked this conversation as resolved.
|
||
| COPY src ./src | ||
| COPY web ./web | ||
|
|
||
| # Build the application with actual source | ||
| RUN cargo build --release | ||
|
|
||
| # Runtime stage | ||
| FROM debian:bookworm-slim | ||
|
|
||
| # Install runtime dependencies | ||
| RUN apt-get update && apt-get install -y \ | ||
| ca-certificates \ | ||
| libssl3 \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Create non-root user for security | ||
| RUN useradd -r -u 10001 -s /usr/sbin/nologin appuser | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy the binary from builder with proper ownership | ||
| COPY --from=builder --chown=appuser:appuser /app/target/release/sort_it_now /app/sort_it_now | ||
|
|
||
| # Expose the default port | ||
| EXPOSE 8080 | ||
|
|
||
| # Set environment variables with defaults | ||
| ENV SORT_IT_NOW_API_HOST=0.0.0.0 | ||
| ENV SORT_IT_NOW_API_PORT=8080 | ||
|
|
||
| # Switch to non-root user | ||
| USER appuser | ||
|
|
||
| # Run the binary | ||
| CMD ["/app/sort_it_now"] | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.