Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
321a71c
initial with Auth
BibaltiK Aug 13, 2025
05ef51d
bump github actions
BibaltiK Aug 13, 2025
57a4df9
-
BibaltiK Aug 13, 2025
776ccbd
-
BibaltiK Aug 13, 2025
9bdc2b0
-
BibaltiK Aug 13, 2025
4c559b3
-
BibaltiK Aug 13, 2025
89e6017
-
BibaltiK Aug 13, 2025
dd0a9b6
downgrad notify
BibaltiK Aug 13, 2025
e70624b
validate security Schemes
BibaltiK Aug 13, 2025
5cc3cc8
fix deploy uri
BibaltiK Aug 14, 2025
9f4af97
change SwaggerUI Title
BibaltiK Aug 14, 2025
41752e9
add Account Role Enum
BibaltiK Aug 14, 2025
ad25524
implements last aktivity updater
BibaltiK Aug 14, 2025
e954d11
change Auth Responsetyp to unauthorized
BibaltiK Aug 14, 2025
326a6fe
add version to composer
BibaltiK Aug 14, 2025
fb283c9
Bump
BibaltiK Aug 14, 2025
6abb8e6
remove version from composer
BibaltiK Aug 14, 2025
0858b25
add version to constants
BibaltiK Aug 14, 2025
1324542
implements Logout Endpoint
BibaltiK Aug 15, 2025
e29812c
implements authorized validation
BibaltiK Aug 15, 2025
0c2dc7c
Implements ErrorHandler with Logger
BibaltiK Aug 18, 2025
6d2bbcf
change route implementation and fix any routes
BibaltiK Aug 18, 2025
d9fc684
bump php 8.3 to 8.4.16
BibaltiK Jan 8, 2026
bd729df
refactor clone readonly class with new parameter
BibaltiK Jan 8, 2026
12d1872
add dev url for webhook
BibaltiK Jan 8, 2026
169c271
add dev url for webhook
BibaltiK Jan 8, 2026
464d030
add dev url for webhook
BibaltiK Jan 8, 2026
41344a3
add dev url for webhook
BibaltiK Jan 8, 2026
02b2da7
fix wotkflow
BibaltiK Jan 8, 2026
7bf2611
fix phpunit config
BibaltiK Jan 8, 2026
8c15e9b
rewrite script with AI
BibaltiK Jan 11, 2026
3971e42
rewrite for php 8.4
BibaltiK Jan 11, 2026
a86bd57
reorganisation
BibaltiK Jan 11, 2026
eeb1792
Changes for property hook
BibaltiK Jan 11, 2026
8bcab2b
refactor: improve bin/hackathon CLI and update documentation
BibaltiK Jan 12, 2026
61e6a0c
bump checkout and rsync actions
BibaltiK Jan 12, 2026
d7beaab
fix package for deployment
BibaltiK Jan 12, 2026
cc85e44
-
BibaltiK Jan 12, 2026
3b3a1eb
bump action script
BibaltiK Jan 13, 2026
245841c
implements Property Hook AccountAccessAuth
BibaltiK Jan 13, 2026
02d9390
implements Property Hook AccountActivation
BibaltiK Jan 13, 2026
8187c05
implements Property Hook Token
BibaltiK Jan 13, 2026
6acb503
rename Method
BibaltiK Jan 13, 2026
d06cad3
moved enum
BibaltiK Jan 13, 2026
d39ab7b
-
BibaltiK Jan 13, 2026
a259140
refactor
BibaltiK Jan 14, 2026
1e16126
refactor magic string
BibaltiK Jan 15, 2026
1e49315
refactor magic string
BibaltiK Jan 15, 2026
c2566c1
bumps
BibaltiK Jan 15, 2026
d773e86
add required gitkeep
BibaltiK Jan 15, 2026
8385f97
refactor: finalize management CLI, fix volume detection and preserve …
BibaltiK Jan 15, 2026
021071c
refactor: change for php 8.4
BibaltiK Jan 16, 2026
faecf4c
fix: code quali
BibaltiK Jan 16, 2026
4f7296a
refactor: change namespace
BibaltiK Jan 16, 2026
d3d484a
add build deployment
BibaltiK Jan 16, 2026
707843a
fix: Deploy Name
BibaltiK Jan 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
APP_ENV=develope
USERMAP_UID=1000
USERMAP_GID=984
MYSQL_USER=dev
MYSQL_PASSWORD=dev
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=db
MYSQL_PUBLIC_PORT=3306
MYSQL_TESTING_PORT=3307
PHP_VERSION=8.3
MARIADB_VERSION=latest
APACHE_VERSION=2.4-alpine
HTTP_PORT=80
SHTTP_PORT=443
30 changes: 30 additions & 0 deletions .github/actions/setup-php-composer/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# .github/actions/setup-php-composer/action.yml
name: 'Setup PHP and Composer'
description: 'Common setup for PHP jobs'
inputs:
php-version:
description: 'PHP Version'
default: '8.4'
install-flags:
description: 'Composer install flags'
default: '--prefer-dist --no-progress'

runs:
using: "composite"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
extensions: pdo, mbstring # hier Standard-Extensions ergänzen

- name: Cache Composer packages
uses: actions/cache@v5
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-php-

- name: Install dependencies
shell: bash
run: composer install ${{ inputs.install-flags }}
190 changes: 75 additions & 115 deletions .github/workflows/codestyle-and-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,147 +4,107 @@ on:
branches:
- '*'
- '!master'
- '!develop'
paths:
- "**.php"
pull_request:
workflow_dispatch:

jobs:
phplint:
name: PHP Lint
# 1. Job: Statische Analyse (Lint, Stan, CodeSniffer)
# Diese laufen zusammen, da sie keine Datenbank benötigen.
static-analysis:
name: PHP Quality Checks
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.1.1

- name: Validate composer.json and composer.lock
run: composer validate --strict
- uses: actions/checkout@v6.0.2

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Setup PHP and Composer
uses: ./.github/actions/setup-php-composer

- name: Run PHP Linter
run: composer run-script phplint

phpstan:
name: PHP Stan
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.1.1

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHP Stan
run: composer run-script phpstan

phpcs:
name: PHP CodeSniffer
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.1.1

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHP Codesniffer
run: composer run-script phpcs

phpunit:
name: PHP Unit Test
needs:
- phplint
- phpstan
- phpcs
- name: Notify Failure
if: failure()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: error
details: Static Analysis (Lint/Stan/CS) failed.
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}

# 2. Job: Tests (Unit & Functional)
# Dieser Job benötigt die MariaDB Service-Container
tests:
name: PHP Tests
needs: static-analysis
runs-on: ubuntu-latest

services:
database-testing:
image: mariadb:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: db
MYSQL_USER: dev
MYSQL_PASSWORD: dev
ports:
- 3306:3306
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
env:
DB_DATABASE: db
DB_USERNAME: dev
DB_PASSWORD: dev
DB_HOST: 127.0.0.1
DB_PORT: 3306
APP_ENV: action
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v6.0.2

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Setup PHP and Composer
uses: ./.github/actions/setup-php-composer

- name: Run PHP Unit Test
run: composer run-script unittest

phpfunctional:
name: PHP Functional Test
needs:
- phplint
- phpstan
- phpcs
runs-on: ubuntu-latest
- name: Run PHP Functional Test
run: composer run-script functionaltest

- name: Notify Failure
if: failure()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: error
details: Unit or Functional Tests failed.
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}

# 3. Job: Abschluss-Benachrichtigung
final-status:
name: Final Status Message
needs: [static-analysis, tests]
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1

- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
- name: Check Info Success
if: ${{ needs.static-analysis.result == 'success' && needs.tests.result == 'success' }}
uses: rjstone/discord-webhook-notify@v1.0.4
with:
php-version: 8.3
extensions: pdo, pdo_sqlite
ini-values: date.timezone='UTC'

- name: Validate composer.json and composer.lock
run: composer validate --strict
severity: info
details: Checks successfully executed on API.
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
- name: Check Info Failure
if: ${{ needs.static-analysis.result != 'success' || needs.tests.result != 'success' }}
uses: rjstone/discord-webhook-notify@v1.0.4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHP Unit Test
run: composer run-script functionaltest
severity: error
details: >-
${{ format('❌ Incorrect checks during the API check. [View Logs](https://github.com/{0}/actions/runs/{1})',
github.repository,
github.run_id) }}
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}
121 changes: 121 additions & 0 deletions .github/workflows/deploy_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Deployment on Build
on:
push:
branches: [ "master" ]
workflow_dispatch:

jobs:
# 1. Statische Analyse (Zusammengefasst, da sie keine DB brauchen)
static-analysis:
name: PHP Quality Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2

- name: Setup Environment
uses: ./.github/actions/setup-php-composer

- name: Validate Composer
run: composer validate --strict

- name: Run Checks
run: |
composer run-script phplint
composer run-script phpstan
composer run-script phpcs

- name: Notify Failure
if: failure()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: error
details: Static Analysis (Lint/Stan/CS) failed.
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}

# 2. Tests (Unit & Functional getrennt, da Functional DB braucht)
tests:
name: PHP Tests
needs: static-analysis
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:latest
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: db
MYSQL_USER: dev
MYSQL_PASSWORD: dev
ports: ["3306:3306"]
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
env:
DB_DATABASE: db
DB_USERNAME: dev
DB_PASSWORD: dev
DB_HOST: 127.0.0.1
APP_ENV: action
steps:
- uses: actions/checkout@v6.0.2
- name: Setup Environment
uses: ./.github/actions/setup-php-composer

- name: Run Unit Tests
run: composer run-script unittest

- name: Run Functional Tests
run: composer run-script functionaltest

- name: Notify Failure
if: failure()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: error
details: PHP Tests failed.
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}

# 3. Deployment
deploy:
name: Deploy to Dev
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2

- name: Setup Environment (No Dev)
uses: ./.github/actions/setup-php-composer
with:
install-flags: '--prefer-dist --no-progress --no-dev'

- name: Build OpenAPI
run: composer run-script openapi

- name: Deploy via rsync
uses: burnett01/rsync-deployments@8.0.3
with:
switches: -avz --no-o --no-g --no-perms --no-t --omit-dir-times --delete --exclude-from='.rsync-exclude'
remote_path: ${{ secrets.DEPLOY_PATH_API_BUILD }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_port: ${{ secrets.DEPLOY_PORT }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
remote_key_pass: ${{ secrets.DEPLOY_KEY_PASS }}

- name: Clear Cache
uses: appleboy/ssh-action@v1.2.2
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
passphrase: ${{ secrets.DEPLOY_KEY_PASS }}
script: rm -rf ${{ secrets.DEPLOY_PATH_API_BUILD }}/data/cache/*

- name: Deployment Notification
if: always()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: ${{ job.status == 'success' && 'info' || 'error' }}
details: >-
${{ job.status == 'success'
&& '[🚀 Successful deployment to build!](https://build.ownhackathon.de/api/docs)'
|| format('[❌ Deployment failed! View Logs](https://github.com/{0}/actions/runs/{1})', github.repository, github.run_id)
}}
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}
Loading