Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 5 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ APP_SECRET=ed57093ff0c0f5c74d15b176f96d1e66
###< symfony/framework-bundle ###

###> symfony/mailer ###
# MAILER_DSN=null://null
MAILER_DSN=null://null
###< symfony/mailer ###

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
#DATABASE_URL="sqlite:///%kernel.project_dir%/var/dbsaver.db"
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8"
DATABASE_URL="mysql://root:root@127.0.0.1:3306/dbsaver?serverVersion=5.7"
#DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###

DEFAULT_LOCALE=en
Expand Down
Empty file added .env.dev
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ on:
jobs:
php-cs-fixer:
name: PHP CS Fixer (PHP ${{ matrix.php-version }})
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

strategy:
matrix:
php-version:
- '8.1'
- '8.4'

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -30,7 +30,7 @@ jobs:
tools: cs2pr

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3

- name: Run PHP CS Fixer
run: 'vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr'
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,29 @@ on:
jobs:
phpunit:
name: PHPUnit (PHP ${{ matrix.php-version }})
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
SYMFONY_DEPRECATIONS_HELPER: disabled

services:
mysql:
image: mariadb:10.11
env:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: test_db
ports:
- 3307:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
matrix:
php-version:
- '8.1'
- '8.2'
- '8.3'
- '8.4'

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -36,15 +46,28 @@ jobs:
run: composer validate

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
composer-options: "--ignore-platform-reqs"

- name: Start mariadb
run: docker-compose -f docker-compose.test.yaml up -d mariadb
- name: Start MinIO
run: docker compose -f compose.test.yaml up -d minio

- name: Wait for MinIO to be healthy
run: |
for i in {1..120}; do
if [ "$(docker inspect -f '{{json .State.Health.Status}}' $(docker compose -f compose.test.yaml ps -q minio))" = "\"healthy\"" ]; then
echo "MinIO is healthy"; exit 0
fi
sleep 1
done
echo "MinIO did not become healthy in time"; docker compose -f compose.test.yaml logs minio; exit 1

- name: Create buckets
run: docker compose -f compose.test.yaml up --exit-code-from createbuckets createbuckets

- name: Start other Docker services
run: docker-compose -f docker-compose.test.yaml up -d minio createbuckets ftpserver
- name: Start FTP server
run: docker compose -f compose.test.yaml up -d ftpserver

- name: Load Doctrine fixtures
run: |
Expand All @@ -60,10 +83,7 @@ jobs:
SYMFONY_DEPRECATIONS_HELPER: disabled

- name: Stop other Docker services
run: docker-compose -f docker-compose.test.yaml stop createbuckets minio ftpserver

- name: Stop mariadb
run: docker-compose -f docker-compose.test.yaml stop mariadb
run: docker compose -f compose.test.yaml stop createbuckets minio ftpserver

- name: Upload to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ on:
jobs:
phpstan:
name: PHPStan (PHP ${{ matrix.php-version }})
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

strategy:
matrix:
php-version:
- '8.1'
- '8.4'

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -30,7 +30,7 @@ jobs:
tools: cs2pr

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3

- name: Run PHPStan
run: 'vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr'
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
Expand Down
2 changes: 1 addition & 1 deletion .php-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.1
8.3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Backups can be saved **locally** or in **S3 cloud** (AWS, Scaleway, ...).

## Prerequisites <a name="prerequisites"></a>

* PHP 8.1+
* PHP 8.3+
* Composer
* Symfony CLI (if you want to run the project locally)

Expand Down
4 changes: 2 additions & 2 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ tasks:

setup_tests:
cmds:
- docker compose -f docker-compose.test.yaml up -d
- docker compose -f compose.test.yaml up -d
- rm -rf var/cache/test/*
- symfony console d:d:d --force --if-exists --quiet --env=test
- symfony console d:d:c --quiet --env=test
Expand All @@ -65,7 +65,7 @@ tasks:

cleanup_tests:
cmds:
- docker compose -f docker-compose.test.yaml stop
- docker compose -f compose.test.yaml stop

ci:
desc: Check code style, static analysis...
Expand Down
4 changes: 4 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;

if (!is_dir(dirname(__DIR__).'/vendor')) {
throw new LogicException('Dependencies are missing. Try running "composer install".');
}

if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}
Expand Down
25 changes: 16 additions & 9 deletions docker-compose.test.yaml → compose.test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: '3'

services:
mariadb:
image: mariadb:10.6
image: mariadb:10.11
ports:
- '3307:3306'
environment:
Expand All @@ -22,18 +20,27 @@ services:
ports:
- 9004:9004
- 9001:9001
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:9004/minio/health/ready"]
interval: 2s
timeout: 2s
retries: 60
start_period: 5s

createbuckets:
image: minio/mc
depends_on:
- minio
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
/bin/sh -eux -c '
/usr/bin/mc alias set myminio http://minio:9004 minio minio123;
/usr/bin/mc mb myminio/somebucketname;
/usr/bin/mc policy set public myminio/somebucketname;
exit 0;
"
until /usr/bin/mc ls myminio >/dev/null 2>&1; do
echo "Waiting for MinIO..."; sleep 1;
done;
/usr/bin/mc mb -p myminio/somebucketname || true;
/usr/bin/mc anonymous set public myminio/somebucketname || true;
'
ftpserver:
environment:
- FTP_PASS=dbsaver
Expand Down
13 changes: 8 additions & 5 deletions docker-compose.yaml → compose.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
version: '3'

services:
mailer:
image: schickling/mailcatcher
ports: [1025, 1080]
image: axllent/mailpit
ports:
- "1025"
- "8025"
environment:
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1

mariadb:
image: mariadb:10.6
image: mariadb:10.11
ports:
- '3307:3306'
environment:
Expand Down
Loading