From e89820b8a431f00c712b8f43f66f324614c401d4 Mon Sep 17 00:00:00 2001 From: Yury Pikhtarev Date: Fri, 11 Jul 2025 23:05:45 +0200 Subject: [PATCH] Update Qodana configuration and GitHub workflows - Enhanced qodana.yaml to include additional PHP inspections and set PHP version to 8.4. - Updated lint.yml and tests.yml workflow names for consistency. - Modified qodana_code_quality.yml to improve job steps and update checkout action to v4. - Removed work-in-progress warnings from several documentation files to reflect completed sections. --- .github/workflows/lint.yml | 2 +- .github/workflows/qodana_code_quality.yml | 21 +++++--- .github/workflows/tests.yml | 2 +- docs/docs/architecture/overview.md | 5 +- docs/docs/development/sail.md | 5 +- docs/docs/development/setup.md | 61 +++++------------------ docs/docs/getting-started/installation.md | 10 ---- docs/docs/intro.md | 4 -- docs/docs/migration/from-v2.md | 55 ++------------------ qodana.yaml | 33 +++++++++++- 10 files changed, 67 insertions(+), 131 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9f2ccc078..4b73796a1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: linter +name: Linter on: push: diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml index d7c931f39..2375feeca 100644 --- a/.github/workflows/qodana_code_quality.yml +++ b/.github/workflows/qodana_code_quality.yml @@ -1,28 +1,33 @@ name: Qodana + on: workflow_dispatch: pull_request: push: - branches: # Specify your branches here - - main # The 'main' branch - - 'releases/*' # The release branches + branches: + - main + - dexter jobs: qodana: runs-on: ubuntu-latest + permissions: contents: write pull-requests: write checks: write + steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit + ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit fetch-depth: 0 # a full history is required for pull request analysis - - name: 'Qodana Scan' + + - name: Qodana Scan uses: JetBrains/qodana-action@v2025.1 with: pr-mode: false env: - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_326072973 }} - QODANA_ENDPOINT: 'https://qodana.cloud' \ No newline at end of file + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} + QODANA_ENDPOINT: 'https://qodana.cloud' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7857d07a3..a2bc4d7c9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: tests +name: Tests on: push: diff --git a/docs/docs/architecture/overview.md b/docs/docs/architecture/overview.md index d883a88d2..e02c5e16e 100644 --- a/docs/docs/architecture/overview.md +++ b/docs/docs/architecture/overview.md @@ -1,13 +1,10 @@ --- sidebar_position: 1 +title: Overview --- # Architecture Overview -:::warning Work in Progress -This documentation is currently under development and not yet complete. Some sections may be incomplete or subject to change as the project evolves. -::: - TorrentPier follows a modern, scalable architecture built on Laravel's proven patterns and best practices. ## Tech Stack diff --git a/docs/docs/development/sail.md b/docs/docs/development/sail.md index a890060b1..d7c51f6cd 100644 --- a/docs/docs/development/sail.md +++ b/docs/docs/development/sail.md @@ -1,8 +1,9 @@ --- -sidebar_position: 3 +sidebar_position: 2 +title: Docker Development --- -# Laravel Sail Development +# Docker Development Laravel Sail provides a Docker-powered local development environment for TorrentPier. This guide covers everything you need to know about using Sail for development. diff --git a/docs/docs/development/setup.md b/docs/docs/development/setup.md index 18e925a81..934019959 100644 --- a/docs/docs/development/setup.md +++ b/docs/docs/development/setup.md @@ -1,13 +1,10 @@ --- sidebar_position: 1 +title: Development Setup --- # Development Setup -:::warning Work in Progress -This documentation is currently under development and not yet complete. Some sections may be incomplete or subject to change as the project evolves. -::: - This guide will help you set up a local development environment for TorrentPier. ## Prerequisites @@ -26,7 +23,7 @@ This guide will help you set up a local development environment for TorrentPier. ```bash # Clone the repository git clone https://github.com/torrentpier/torrentpier.git -cd dexter +cd torrentpier # Install dependencies composer install @@ -122,13 +119,11 @@ Recommended extensions: ### Always Use Artisan Commands ```bash -# Generate model with all resources -php artisan make:model Post --all +# Generate model with all resources and API controller +php artisan make:model Post --all --api # Create controller php artisan make:controller PostController --resource - -# Create React page component manually in resources/js/pages/ ``` ### Useful Commands @@ -233,59 +228,27 @@ php artisan make:model Post -mfsc // - Controller: app/Http/Controllers/PostController.php ``` -## Git Workflow - -### Branching Strategy - -```bash -# Create feature branch -git checkout -b feature/user-profile - -# Create bugfix branch -git checkout -b bugfix/login-issue - -# Push branch -git push -u origin feature/user-profile -``` - -### Commit Messages - -Follow conventional commits: -- `feat:` New feature -- `fix:` Bug fix -- `docs:` Documentation -- `style:` Code style -- `refactor:` Code refactoring -- `test:` Tests -- `chore:` Maintenance - ## Troubleshooting ### Common Issues 1. **npm install fails** - ```bash +```bash rm -rf node_modules package-lock.json npm install - ``` +``` 2. **Composer memory limit** - ```bash +```bash COMPOSER_MEMORY_LIMIT=-1 composer install - ``` +``` 3. **Permission errors** - ```bash +```bash chmod -R 775 storage bootstrap/cache - ``` +``` 4. **Cache issues** - ```bash +```bash php artisan optimize:clear - ``` - -## Next Steps - -- Review Coding Standards -- Learn about Testing -- Understand API Development +``` diff --git a/docs/docs/getting-started/installation.md b/docs/docs/getting-started/installation.md index 3fa65ad33..46b1f8abc 100644 --- a/docs/docs/getting-started/installation.md +++ b/docs/docs/getting-started/installation.md @@ -4,10 +4,6 @@ sidebar_position: 1 # Installation -:::warning Work in Progress -This documentation is currently under development and not yet complete. Some sections may be incomplete or subject to change as the project evolves. -::: - This guide will help you install and set up TorrentPier on your server. ## Requirements @@ -190,9 +186,3 @@ If you encounter issues, try clearing all caches: ```bash php artisan optimize:clear ``` - -## Next Steps - -- Configure Application Settings -- Set up Email Configuration -- Review Security Best Practices diff --git a/docs/docs/intro.md b/docs/docs/intro.md index a1de83c5d..bbaf47382 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -4,10 +4,6 @@ sidebar_position: 1 # Welcome to TorrentPier -:::warning Work in Progress -This documentation is currently under development and not yet complete. Some sections may be incomplete or subject to change as the project evolves. -::: - TorrentPier is a modern, Laravel-based BitTorrent tracker and open-source software that allows you to run your own private or public torrent community. This is a complete rewrite of the original TorrentPier v2.x, built from the ground up using modern web technologies and best practices. This documentation will guide you through the architecture, features, and development process of the new TorrentPier. ## Key Features diff --git a/docs/docs/migration/from-v2.md b/docs/docs/migration/from-v2.md index 87fcbe3f5..c2ea20637 100644 --- a/docs/docs/migration/from-v2.md +++ b/docs/docs/migration/from-v2.md @@ -1,5 +1,6 @@ --- sidebar_position: 1 +title: TorrentPier v2.x --- # Migrating from TorrentPier v2.x @@ -94,11 +95,10 @@ cp -r /path/to/old/data/attachments /path/to/new/storage/app/attachments Map old settings to new: -| Old Setting | New Setting | Notes | -|------------|-------------|-------| -| `$bb_cfg['bt_announce_url']` | `TRACKER_ANNOUNCE_URL` | In .env file | -| `$bb_cfg['torrent_pass']` | Auto-generated | More secure | -| `$bb_cfg['ratio_enabled']` | `TRACKER_RATIO_ENABLED` | Boolean | +| Old Setting | New Setting | Notes | +|------------------------------|-------------------------|--------------| +| `$bb_cfg['bt_announce_url']` | `TRACKER_ANNOUNCE_URL` | In .env file | +| `$bb_cfg['ratio_enabled']` | `TRACKER_RATIO_ENABLED` | Boolean | ### Step 6: Test Migration @@ -108,25 +108,6 @@ php artisan migrate:status php artisan torrentpier:verify ``` -## Data Mapping - -### Users Table - -| v2.x Column | New Column | Changes | -|-------------|------------|---------| -| `user_id` | `id` | Same data | -| `username` | `username` | Validated | -| `user_password` | `password` | Re-hashed | -| `user_email` | `email` | Verified | - -### Torrents Table - -| v2.x Column | New Column | Changes | -|-------------|------------|---------| -| `topic_id` | `id` | New IDs | -| `info_hash` | `info_hash` | Same | -| `size` | `size` | Bigint | - ## Post-Migration ### 1. Verify Data Integrity @@ -163,17 +144,6 @@ php artisan cache:clear php artisan optimize ``` -## Rollback Plan - -If issues occur: - -1. Stop new installation -2. Restore DNS to old server -3. Investigate issues -4. Fix and retry - -Keep old installation running until confident. - ## Common Issues ### Password Reset Required @@ -202,18 +172,3 @@ If you had custom mods in v2.x: 2. Evaluate if still needed 3. Reimplement using Laravel patterns 4. Submit as pull requests - -## Getting Help - -- GitHub Issues -- Community Forum -- Documentation -- Discord Channel - -## Next Steps - -After successful migration: -- Configure new features -- Train moderators -- Update user guides -- Monitor feedback diff --git a/qodana.yaml b/qodana.yaml index 290bf6a19..563d70c24 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,6 +1,35 @@ +#-------------------------------------------------------------------------------# +# Qodana analysis is configured by qodana.yaml file # +# https://www.jetbrains.com/help/qodana/qodana-yaml.html # +#-------------------------------------------------------------------------------# version: "1.0" -linter: jetbrains/qodana-php:2025.1 profile: name: qodana.recommended +php: + version: "8.4" +linter: jetbrains/qodana-php:2025.1 include: - - name: CheckDependencyLicenses \ No newline at end of file + - name: CheckDependencyLicenses + - name: PhpComposerExtensionStubsInspection + - name: PhpIncludeInspection + - name: PhpUnhandledExceptionInspection + - name: PhpCastIsUnnecessaryInspection + - name: PhpRedundantOptionalArgumentInspection + - name: PhpRangesInClassCanBeMergedInspection + - name: PhpMissingReturnTypeInspection + - name: PhpMissingFieldTypeInspection + - name: PhpDocMissingThrowsInspection + - name: PhpLoopCanBeConvertedToArrayMapInspection + - name: PhpInconsistentReturnPointsInspection + - name: PhpFullyQualifiedNameUsageInspection + - name: PhpDefineCanBeReplacedWithConstInspection + - name: PhpConditionAlreadyCheckedInspection + - name: PhpConcatenationWithEmptyStringCanBeInlinedInspection + - name: PhpSwitchCanBeReplacedWithMatchExpressionInspection + - name: PhpPluralMixedCanBeReplacedWithArrayInspection + - name: PhpMixedReturnTypeCanBeReducedInspection + - name: PhpIfWithCommonPartsInspection +exclude: + - name: All + paths: + - legacy