Skip to content

Commit

Permalink
Merge pull request #4399 from HDInnovations/8.x.x
Browse files Browse the repository at this point in the history
(Release) v8.3.5
  • Loading branch information
HDVinnie authored Dec 29, 2024
2 parents f8fc3eb + 62521e8 commit f554ae3
Show file tree
Hide file tree
Showing 51 changed files with 1,956 additions and 3,053 deletions.
2,060 changes: 0 additions & 2,060 deletions CHANGELOG.md

This file was deleted.

5 changes: 0 additions & 5 deletions FUNDING.yml

This file was deleted.

61 changes: 25 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,78 +8,67 @@
<a href="https://github.com/HDInnovations/UNIT3D-Community-Edition/actions/workflows/compile-assets-test.yml/badge.svg?branch=master"><img src="https://github.com/HDInnovations/UNIT3D-Community-Edition/actions/workflows/compile-assets-test.yml/badge.svg?branch=master" /></a>
<a href="https://github.com/HDInnovations/UNIT3D-Community-Edition/actions/workflows/larastan.yml/badge.svg?branch=master"><img src="https://github.com/HDInnovations/UNIT3D-Community-Edition/actions/workflows/larastan.yml/badge.svg?branch=master" /></a>
<a href="https://github.com/HDInnovations/UNIT3D-Community-Edition/actions/workflows/prettier-blade.yml/badge.svg?branch=master"><img src="https://github.com/HDInnovations/UNIT3D-Community-Edition/actions/workflows/prettier-blade.yml/badge.svg?branch=master" /></a>
<a href="https://polar.sh/HDInnovations"><img src="https://polar.sh/embed/seeks-funding-shield.svg?org=HDInnovations" /></a>
</p>

<p align="center">
🎉 <b>A Big Thanks To All Our <a href="https://github.com/HDInnovations/UNIT3D-Community-Edition/graphs/contributors">Contributors</a> and <a href="https://polar.sh/HDInnovations">Subscribers</a></b> 🎉
🎉 <b>A Big Thanks To All Our <a href="https://github.com/HDInnovations/UNIT3D-Community-Edition/graphs/contributors">Contributors</a> and <a href="https://square.link/u/VjB1CNfm">Donors</a></b> 🎉
</p>

## 📝 Table of Contents

1. [Introduction](#introduction)
2. [Installation](#installation)
3. [Updating](#updating)
4. [Support UNIT3D](#support)
5. [Funding Issues/Requests](#funding)
6. [Special Thanks](#thanks)
4. [Contributing](#contributing)
5. [License](#license)
6. [Services](#services)
7. [Donations](#donations)
8. [Discord Support](#discord)
9. [Special Thanks](#thanks)


## <a name="introduction"></a> 🧐 Introduction

We have been developing a Private Torrent Tracker Software called `UNIT3D`. This is a PHP software based on Laravel 11, Livewire and AlpineJS. It is MySQL Strict Mode Compliant, and PHP 8.3 Ready. The code is well-designed and follows the PSR-2 coding style. It uses an MVC Architecture to ensure clarity between logic and presentation. As a hashing algorithm of Bcrypt or Argon2 is used, to ensure a safe and proper way to store the passwords for the users. A lightweight Blade Templating Engine. Caching System Supporting: "apc,” "array,” "database,” "file," "memcached," and "redis" methods. Eloquent and much more!
We have been developing a Private Torrent Tracker Software called `UNIT3D`. This is a PHP software based on Laravel 11, Livewire and AlpineJS. It is MySQL Strict Mode Compliant, and PHP 8.3 Ready. It uses an MVC Architecture to ensure clarity between logic and presentation.

## <a name="installation"></a> 🖥️ Installation

Check it out here for more information: https://github.com/HDInnovations/UNIT3D-Installer

### Demo Data

Use this command to generate demo users and torrents for testing purposes in a dev environment:
## <a name="updating"></a> 🖥️ Updating

`php artisan demo:seed`
To update your installation to the latest version, run the following command. This will pull the latest changes from the repository and update your instance:

## <a name="updating"></a> 🖥️ Updating
`php artisan git:update`

## <a name="contributing"></a> 🤝 Contributing

## <a name="support"></a> ✨ Support UNIT3D
Please read [CONTRIBUTING.md](https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

You can support our work if you are enjoying UNIT3D. Sponsors will recieve an email with a Discord invite link to UNIT3Ds Discord server which is used for support and more.
## <a name="license"></a> 📜 License

<a href="https://polar.sh/HDInnovations"><picture><source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/embed/subscribe.svg?org=HDInnovations&label=Subscribe&darkmode"><img alt="Subscribe on Polar" src="https://polar.sh/embed/subscribe.svg?org=HDInnovations&label=Subscribe"></picture></a>
This project is licensed under the AGPL v3.0 License - see the [LICENSE](https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/master/LICENSE.md) file for details.

Some folks have asked me if it's possible to do a donation via Crypto. Yes!
```
Monero (XMR) - 85WrXRzmbF9fTp9UHLHhhEVeF5VBCHSen9suSvK4FkKqcyhXeikS1zM4u5gfa5gyQV9dS8yuoDwMGBJ1rQ8w1CWkJXN9kSo
## <a name="services"></a> 🛠️ Services

Bitcoin (BTC) - 3HUVkv3Q8b5nbxa9DtXG1dm4RdTJaTFRfc
HDInnovations offers a variety of services to help you with your UNIT3D instance. We offer services such as installation, updating, server tuning, dependency tuning, themes and custom plugin development. For more information, please visit our email us at [[email protected]](mailto:[email protected]?subject=[Services]%20UNIT3D%20)

Bitcoin Cash (BCH) - qp3wgpnwzpj4v9sq90wflsca8p5s75glrvga9tweu2
## <a name="donations"></a> 💰 Donations

Ether (ETH) - 0x5eFF42F65234aD9c6A0CA5B9495f3c6D205bBC27
If you would like to support the development of UNIT3D, please consider donating to keep the project alive. For more information, please email us at [[email protected]](mailto:[email protected]?subject=[Funding]%20UNIT3D%20)

ETC - 0xd644C7C7009eC3824f3305ff6C7E2Ee90497d56e
<a href="https://square.link/u/VjB1CNfm" target="_blank"><img alt="unit3d-donate.png" src="public/img/unit3d-donate.png" width="200px"/></a>&nbsp;&nbsp;&nbsp;
<img alt="unit3d-qr-code.png" src="public/img/unit3d-qr-code.png" width="169px"/>

Litecoin (LTC) - MDLKyHzupt1mchuo8mrjW9mihkKp1LD4nG
## <a name="discord"></a> 📞 Discord Community

USDC - 0xB32102d9104d2bfd0D4E3E4069618ADD985a4e2E
We have a Discord server for support and general discussion. This is a private server, and you will need to be invited to join. There is a small fee to join the server to help support the development of UNIT3D. For more information, please email us at [[email protected]](mailto:[email protected]?subject=[Discord]%20UNIT3D%20)

USDT (ERC-20) - 0x24c79c41EEAd9d81203ee567fE4bA3a6c81374DB
## <a name="thanks"></a> 🎉 Shoutouts

DOGE - DJ78fQspiu879y3adLbTZVSFABKhKqHE7B
```
<a href="https://scoutapm.com/?utm_source=github&utm_medium=referral&utm_campaign=opensource_referral"><img src="https://i.postimg.cc/g29XCJDh/Logo-rounded-square-495x495-1.png" height="50px;"></a>
<a href="https://www.jetbrains.com/?from=UNIT3D"><img src="https://i.imgur.com/KgDXZV8.png" height="50px;"></a>

## <a name="funding"></a> ✨ Funding issues and feature requests

<a href="https://polar.sh/HDInnovations"><img src="https://polar.sh/embed/fund-our-backlog.svg?org=HDInnovations" /></a>

## <a name="thanks"></a> 🎉 Special Thanks

<a href="https://scoutapm.com/?utm_source=github&utm_medium=referral&utm_campaign=opensource_referral"><img src="https://i.postimg.cc/g29XCJDh/Logo-rounded-square-495x495-1.png" height="50px;"></a>
<a href="https://www.jetbrains.com/?from=UNIT3D"><img src="https://i.imgur.com/KgDXZV8.png" height="50px;"></a>
<a href="https://www.themoviedb.org/"><img src="https://www.themoviedb.org/assets/2/v4/logos/v2/blue_square_2-d537fb228cf3ded904ef09b136fe3fec72548ebc1fea3fbbd1ad9e36364db38b.svg" height="50px;"></a>
<a href="https://github.com"><img src="https://i.imgur.com/NVWhzrU.png" height="50px;"></a>
<a href="https://laravel.com"><img src="https://i.postimg.cc/cCDBswfK/1200px-Laravel-svg.png" height="50px;"></a>
<a href="https://laravel-livewire.com"><img src="https://i.postimg.cc/jjsNyBbh/Livewire.png" height="50px;"></a>
<a href="https://alpinejs.dev"><img src="https://i.postimg.cc/28pWk0M1/alpinejs-logo.png" height="50px;"></a>
1 change: 1 addition & 0 deletions app/Enums/Occupation.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* NOTICE OF LICENSE.
*
Expand Down
1 change: 1 addition & 0 deletions app/Enums/UserGroup.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* NOTICE OF LICENSE.
*
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/AnnounceController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* NOTICE OF LICENSE.
*
Expand Down
12 changes: 12 additions & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
namespace App\Http\Controllers;

use App\Models\Article;
use App\Models\Comment;
use App\Models\FeaturedTorrent;
use App\Models\Group;
use App\Models\Poll;
Expand Down Expand Up @@ -104,6 +105,17 @@ public function index(Request $request): \Illuminate\Contracts\View\Factory|\Ill
->take(5)
->get(),
),
'comments' => cache()->remember(
'latest_comments',
$expiresAt,
fn () => Comment::query()
->with('user', 'user.group', 'commentable')
->whereHasMorph('commentable', [\App\Models\Torrent::class])
->orWhereHasMorph('commentable', [\App\Models\TorrentRequest::class])
->latest()
->take(5)
->get(),
),
'featured' => cache()->remember(
'latest_featured',
$expiresAt,
Expand Down
38 changes: 22 additions & 16 deletions app/Http/Controllers/Staff/GroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
use App\Http\Controllers\Controller;
use App\Http\Requests\Staff\StoreGroupRequest;
use App\Http\Requests\Staff\UpdateGroupRequest;
use App\Models\Forum;
use App\Models\ForumCategory;
use App\Models\Group;
use App\Models\ForumPermission;
use App\Services\Unit3dAnnounce;
use Illuminate\Support\Str;

Expand All @@ -45,25 +44,24 @@ public function index(): \Illuminate\Contracts\View\Factory|\Illuminate\View\Vie
*/
public function create(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
return view('Staff.group.create');
return view('Staff.group.create', [
'forumCategories' => ForumCategory::query()
->with([
'forums' => fn ($query) => $query->orderBy('position')
])
->orderBy('position')
->get(),
]);
}

/**
* Store A New Group.
*/
public function store(StoreGroupRequest $request): \Illuminate\Http\RedirectResponse
{
$group = Group::create(['slug' => Str::slug($request->name)] + $request->validated());

foreach (Forum::pluck('id') as $collection) {
ForumPermission::create([
'forum_id' => $collection,
'group_id' => $group->id,
'read_topic' => false,
'reply_topic' => false,
'start_topic' => false,
]);
}
$group = Group::create(['slug' => Str::slug($request->validated('group.name'))] + $request->validated('group'));

$group->permissions()->upsert($request->validated('permissions'), ['forum_id', 'group_id']);

Unit3dAnnounce::addGroup($group);

Expand All @@ -77,7 +75,13 @@ public function store(StoreGroupRequest $request): \Illuminate\Http\RedirectResp
public function edit(Group $group): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
return view('Staff.group.edit', [
'group' => $group,
'group' => $group,
'forumCategories' => ForumCategory::query()
->with([
'forums' => fn ($query) => $query->orderBy('position')
])
->orderBy('position')
->get(),
]);
}

Expand All @@ -86,7 +90,9 @@ public function edit(Group $group): \Illuminate\Contracts\View\Factory|\Illumina
*/
public function update(UpdateGroupRequest $request, Group $group): \Illuminate\Http\RedirectResponse
{
$group->update(['slug' => Str::slug($request->name)] + $request->validated());
$group->update(['slug' => Str::slug($request->validated('group.name'))] + $request->validated('group'));

$group->permissions()->upsert($request->validated('permissions'), ['forum_id', 'group_id']);

cache()->forget('group:'.$group->id);

Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Staff/ModerationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ public function index(): \Illuminate\Contracts\View\Factory|\Illuminate\View\Vie
return view('Staff.moderation.index', [
'current' => now(),
'pending' => Torrent::withoutGlobalScope(ApprovedScope::class)
->with(['user.group', 'category', 'type', 'resolution', 'category'])
->with(['user.group', 'category', 'type', 'resolution'])
->where('status', '=', Torrent::PENDING)
->get(),
'postponed' => Torrent::withoutGlobalScope(ApprovedScope::class)
->with(['user.group', 'moderated.group', 'category', 'type', 'resolution', 'category'])
->with(['user.group', 'moderated.group', 'category', 'type', 'resolution'])
->where('status', '=', Torrent::POSTPONED)
->get(),
'rejected' => Torrent::withoutGlobalScope(ApprovedScope::class)
->with(['user.group', 'moderated.group', 'category', 'type', 'resolution', 'category'])
->with(['user.group', 'moderated.group', 'category', 'type', 'resolution'])
->where('status', '=', Torrent::REJECTED)
->get(),
]);
Expand Down
34 changes: 34 additions & 0 deletions app/Http/Controllers/TorrentPendingController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

/**
* NOTICE OF LICENSE.
*
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D Community Edition
*
* @author HDVinnie <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
*/

namespace App\Http\Controllers;

use App\Models\Scopes\ApprovedScope;
use App\Models\Torrent;

class TorrentPendingController extends Controller
{
public function index(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
return view('torrent.pending', [
'torrents' => Torrent::withoutGlobalScope(ApprovedScope::class)
->with(['category', 'type', 'resolution'])
->where('status', '=', Torrent::PENDING)
->orWhere('status', '=', Torrent::POSTPONED)
->get(),
]);
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/User/TorrentZipController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function show(Request $request, User $user): \Illuminate\Http\RedirectRes
set_time_limit(1200);

// Extend The Maximum Memory Limit
ini_set('memory_limit', '1024M');
ini_set('memory_limit', '2048M');

// Authorized User
abort_unless($request->user()->is($user), 403);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Livewire/LaravelLogViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ final public function logFiles()
}

/**
* @return \Illuminate\Pagination\LengthAwarePaginator<\Illuminate\Support\Collection<string|int, mixed>>
* @return LengthAwarePaginator<\Illuminate\Support\Collection<string|int, mixed>>
*/
#[Computed]
final public function entries(): LengthAwarePaginator
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Livewire/PersonCredit.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ function ($tv) {
}

/**
* @param \Illuminate\Support\Collection<int, \App\Models\Torrent> $torrents
* @return \Illuminate\Support\Collection<string, \Illuminate\Support\Collection<int, \App\Models\Torrent>>
* @param \Illuminate\Support\Collection<int, Torrent> $torrents
* @return \Illuminate\Support\Collection<string, \Illuminate\Support\Collection<int, Torrent>>
*/
private function groupByTypeAndSort($torrents): \Illuminate\Support\Collection
{
Expand Down
10 changes: 5 additions & 5 deletions app/Http/Livewire/SimilarTorrent.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ final public function torrents(): \Illuminate\Support\Collection
}

/**
* @param \Illuminate\Support\Collection<int, \App\Models\Torrent> $torrents
* @return \Illuminate\Support\Collection<string, \Illuminate\Support\Collection<int, \App\Models\Torrent>>
* @param \Illuminate\Support\Collection<int, Torrent> $torrents
* @return \Illuminate\Support\Collection<string, \Illuminate\Support\Collection<int, Torrent>>
*/
private function groupByTypeAndSort(\Illuminate\Support\Collection $torrents): \Illuminate\Support\Collection
{
Expand Down Expand Up @@ -423,9 +423,9 @@ final public function deleteRecords(): void
$names = [];
$users = [];
$title = match (true) {
$this->category->movie_meta => ($movie = Movie::find($this->tmdbId))->title.' ('.$movie->release_date.')',
$this->category->tv_meta => ($tv = Tv::find($this->tmdbId))->name.' ('.$tv->first_air_date.')',
$this->category->game_meta => ($game = Game::find($this->igdbId))->name.' ('.$game->first_release_date.')',
$this->category->movie_meta => ($movie = Movie::find($this->tmdbId))->title.' ('.$movie->release_date->format('Y').')',
$this->category->tv_meta => ($tv = Tv::find($this->tmdbId))->name.' ('.$tv->first_air_date->format('Y').')',
$this->category->game_meta => ($game = Game::find($this->igdbId))->name.' ('.$game->first_release_date->format('Y').')',
default => $torrents->pluck('name')->join(', '),
};

Expand Down
Loading

0 comments on commit f554ae3

Please sign in to comment.