Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4409b9b
feat: add arma-reforger-workshop plugin
szpolny Dec 20, 2025
4111baf
browse workshop directly in browser
szpolny Dec 20, 2025
9914044
readme for arma-reforger-workshop plugin
szpolny Dec 20, 2025
0b04697
Merge branch 'main' into arma-reforger-main
Boy132 Dec 23, 2025
c697d86
Merge branch 'pelican-dev:main' into main
szpolny Dec 27, 2025
f042ae1
fix: correct string interpolation in mod notifications
szpolny Dec 27, 2025
408ae7a
eliminate n+1 calls
szpolny Dec 27, 2025
8befb7b
fix pint
szpolny Dec 27, 2025
4e6ca23
use localization strings instead of hardcoded texts
szpolny Dec 27, 2025
b47ada7
enhance mod enrichment with concurrent requests and caching
szpolny Dec 27, 2025
87b02a4
normalize modId to uppercase for consistent comparison
szpolny Dec 27, 2025
1eade90
improve caching for errors
szpolny Dec 27, 2025
44722db
laravel pint
szpolny Dec 27, 2025
303de44
fix: correct URL generation for config path by trimming trailing dots
szpolny Dec 27, 2025
e31629f
fix for caching issues
szpolny Dec 27, 2025
0f2798e
replace __('...') with trans('...')
szpolny Dec 30, 2025
f287ef4
allow nullable version parameter in addMod method
szpolny Dec 30, 2025
a9373b9
replace __('...') with trans('...') for localization consistency
szpolny Dec 30, 2025
c24e825
update translations
szpolny Dec 30, 2025
cd16777
refactor mod details handling: replace parseModDetailsFromResponse wi…
szpolny Dec 30, 2025
e7864ea
Merge branch 'main' into arma-reforger-main
Boy132 Jan 1, 2026
bc42c5c
fix phpstan issues
szpolny Jan 2, 2026
307078b
pint fix
szpolny Jan 2, 2026
cc9b266
type hint fix
szpolny Jan 2, 2026
216abdf
another fix for phpstan
szpolny Jan 2, 2026
2b564ee
remove getModDetails method
szpolny Jan 2, 2026
36feff0
reset the installed mods cache after successful installation
szpolny Jan 2, 2026
0a1690b
update readme
Boy132 Jan 3, 2026
346b2b7
simplify phpdoc
Boy132 Jan 3, 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
57 changes: 57 additions & 0 deletions arma-reforger-workshop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Arma Reforger Workshop Plugin (by spolny)

A Pelican Panel plugin for managing Arma Reforger workshop mods directly from the server panel.

## Features

- **View Installed Mods** - See all mods currently configured in your server's `config.json`
- **Add Mods** - Add mods by entering their Workshop ID (GUID)
- **Remove Mods** - Remove mods from your server configuration
- **Browse Workshop** - Search and browse mods from the Bohemia Arma Reforger Workshop directly in the panel
- **One-Click Install** - Add mods to your server directly from the workshop browser
- **Mod Details** - View version, subscriber count, downloads, and ratings for each mod

## Requirements

Your server egg must have one of the following:
- Feature: `arma_reforger_workshop`
- Tag: `arma_reforger` or `arma-reforger`

## Configuration

The plugin automatically detects the server's config file location. By default, it looks for `config.json` in the server root.

You can customize the config path by adding a `CONFIG_FILE` server variable in your egg.

## How It Works

Arma Reforger servers use a `config.json` file where mods are listed in the `game.mods` array:

```json
{
"game": {
"mods": [
{
"modId": "5965550F24A0C152",
"name": "Where Am I",
"version": "1.2.0"
}
]
}
}
```

This plugin provides a user-friendly interface to manage this configuration without manually editing the JSON file.

## Workshop Integration

The plugin integrates with the [Bohemia Arma Reforger Workshop](https://reforger.armaplatform.com/workshop) to:

- Fetch mod details (name, version, subscribers, downloads, rating)
- Search for mods by name
- Browse popular mods
- Display mod thumbnails and descriptions

Mod data is cached to improve performance:
- Individual mod details: 6 hours
- Workshop search results: 15 minutes
60 changes: 60 additions & 0 deletions arma-reforger-workshop/lang/en/arma-reforger-workshop.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

return [
'navigation' => [
'workshop_mods' => 'Workshop Mods',
'browse_workshop' => 'Browse Workshop',
],
'titles' => [
'browse_workshop' => 'Browse Arma Reforger Workshop',
],
'labels' => [
'mod' => 'Mod',
'mod_id' => 'Mod ID',
'mod_name' => 'Mod Name',
'author' => 'Author',
'version' => 'Version',
'subscribers' => 'Subscribers',
'downloads' => 'Downloads',
'rating' => 'Rating',
'type' => 'Type',
'config_path' => 'Config Path',
'installed_mods' => 'Installed Mods',
],
'actions' => [
'add_mod' => 'Add Mod',
'add_to_server' => 'Add to Server',
'browse_workshop' => 'Browse Workshop',
'edit_config' => 'Edit Config',
'remove' => 'Remove',
'installed' => 'Installed',
'view_installed_mods' => 'View Installed Mods',
'open_in_browser' => 'Open in Browser',
],
'form' => [
'mod_id_helper' => 'Enter the mod ID (GUID) from the Bohemia Workshop. Example: 5965550F24A0C152',
'mod_id_placeholder' => '5965550F24A0C152',
'mod_name_helper' => 'A friendly name for the mod',
'version_placeholder' => 'Optional - leave empty for latest',
'mod_id_validation_regex' => 'The mod ID must be a 16-character hexadecimal string.',
],
'modals' => [
'remove_mod_heading' => 'Remove Mod',
'remove_mod_description' => 'Are you sure you want to remove ":name" from your server\'s mod list?',
'add_mod_heading' => 'Add ":name"',
'add_mod_description' => 'This will add ":name" by :author to your server\'s mod list.',
],
'sections' => [
'browse_mods' => 'Browse Mods',
'browse_mods_description' => 'Search and browse mods from the Bohemia Arma Reforger Workshop. Click "Add to Server" to install a mod.',
],
'notifications' => [
'mod_added' => 'Mod added',
'mod_added_body' => "':name' has been added to your server configuration.",
'mod_removed' => 'Mod removed',
'mod_removed_body' => "':name' has been removed from your server configuration.",
'failed_to_add' => 'Failed to add mod',
'failed_to_remove' => 'Failed to remove mod',
'config_update_failed' => 'Could not update the server configuration.',
],
];
17 changes: 17 additions & 0 deletions arma-reforger-workshop/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"id": "arma-reforger-workshop",
"name": "Arma Reforger Workshop",
"author": "spolny",
"version": "1.0.0",
"description": "Manage Arma Reforger workshop mods in server config",
"category": "plugin",
"url": "https://github.com/pelican-dev/plugins/tree/main/arma-reforger-workshop",
"update_url": null,
"namespace": "spolny\\ArmaReforgerWorkshop",
"class": "ArmaReforgerWorkshopPlugin",
"panels": [
"server"
],
"panel_version": null,
"composer_packages": null
}
23 changes: 23 additions & 0 deletions arma-reforger-workshop/src/ArmaReforgerWorkshopPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace spolny\ArmaReforgerWorkshop;

use Filament\Contracts\Plugin;
use Filament\Panel;

class ArmaReforgerWorkshopPlugin implements Plugin
{
public function getId(): string
{
return 'arma-reforger-workshop';
}

public function register(Panel $panel): void
{
$id = str($panel->getId())->title();

$panel->discoverPages(plugin_path($this->getId(), "src/Filament/$id/Pages"), "spolny\\ArmaReforgerWorkshop\\Filament\\$id\\Pages");
}

public function boot(Panel $panel): void {}
}
29 changes: 29 additions & 0 deletions arma-reforger-workshop/src/Facades/ArmaReforgerWorkshop.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace spolny\ArmaReforgerWorkshop\Facades;

use App\Models\Server;
use App\Repositories\Daemon\DaemonFileRepository;
use Illuminate\Support\Facades\Facade;
use spolny\ArmaReforgerWorkshop\Services\ArmaReforgerWorkshopService;

/**
* @method static bool isArmaReforgerServer(Server $server)
* @method static array<int, array{modId: string, name: string, version: string}> getInstalledMods(Server $server, DaemonFileRepository $fileRepository)
* @method static string getConfigPath(Server $server)
* @method static bool addMod(Server $server, DaemonFileRepository $fileRepository, string $modId, string $name, string $version = '')
* @method static bool removeMod(Server $server, DaemonFileRepository $fileRepository, string $modId)
* @method static string getModWorkshopUrl(string $modId)
* @method static array<string, mixed> parseNextDataFromHtml(string $html, string $modId)
* @method static array{mods: array<int, mixed>, total: int, page: int, perPage: int} browseWorkshop(string $search = '', int $page = 1)
* @method static bool isModInstalled(Server $server, DaemonFileRepository $fileRepository, string $modId)
*
* @see ArmaReforgerWorkshopService
*/
class ArmaReforgerWorkshop extends Facade
{
protected static function getFacadeAccessor(): string
{
return ArmaReforgerWorkshopService::class;
}
}
Loading