Compare commits

...

9 Commits

Author SHA1 Message Date
github-actions[bot]
ccb44d6fbd Merge pull request #11595 from firefly-iii/release-1769407906
🤖 Automatically merge the PR into the develop branch.
2026-01-26 07:11:54 +01:00
JC5
b9fe074080 🤖 Auto commit for release 'develop' on 2026-01-26 2026-01-26 07:11:46 +01:00
James Cole
033281ff51 Fix routes and add batch finish command. 2026-01-26 06:56:10 +01:00
github-actions[bot]
5e8d23ba91 Merge pull request #11592 from firefly-iii/release-1769398904
🤖 Automatically merge the PR into the develop branch.
2026-01-26 04:41:52 +01:00
JC5
35509f19ad 🤖 Auto commit for release 'develop' on 2026-01-26 2026-01-26 04:41:44 +01:00
github-actions[bot]
5e56eeb22e Merge pull request #11591 from firefly-iii/release-1769370043
🤖 Automatically merge the PR into the develop branch.
2026-01-25 20:40:53 +01:00
JC5
e921bb3ebe 🤖 Auto commit for release 'develop' on 2026-01-25 2026-01-25 20:40:43 +01:00
James Cole
353cd0f4f1 Try to fix call to trusted proxies 2026-01-25 20:36:25 +01:00
James Cole
1376ed16cf Rename file. 2026-01-25 20:32:10 +01:00
8 changed files with 140 additions and 52 deletions

View File

@@ -0,0 +1,71 @@
<?php
declare(strict_types=1);
/*
* BatchController.php
* Copyright (c) 2026 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Api\V1\Controllers\System;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Events\Model\TransactionGroup\CreatedSingleTransactionGroup;
use FireflyIII\Events\Model\TransactionGroup\TransactionGroupEventFlags;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class BatchController extends Controller
{
private JournalRepositoryInterface $repository;
/**
* UserController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(function ($request, $next) {
$this->repository = app(JournalRepositoryInterface::class);
return $next($request);
});
}
public function finishBatch(Request $request): JsonResponse
{
$journals = $this->repository->getUncompletedJournals();
if (0 === count($journals)) {
return response()->json([], 204);
}
/** @var TransactionJournal $first */
$first = $journals->first();
$group = $first?->transactionGroup;
if (null === $group) {
return response()->json([], 204);
}
$flags = new TransactionGroupEventFlags();
$flags->applyRules = 'true' === $request->get('apply_rules');
event(new CreatedSingleTransactionGroup($group, $flags));
return response()->json([], 204);
}
}

View File

@@ -58,6 +58,8 @@ class UserController extends Controller
});
}
public function finishBatch(): JsonResponse {}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/users/deleteUser

View File

@@ -45,6 +45,6 @@ class TrustProxies extends Middleware
*/
public function __construct()
{
$this->proxies = (string) config('firefly.trusted_proxies');
$this->proxies = (string) config('trustedproxy.proxies');
}
}

View File

@@ -33,6 +33,7 @@ use FireflyIII\Http\Middleware\Range;
use FireflyIII\Http\Middleware\RedirectIfAuthenticated;
use FireflyIII\Http\Middleware\SecureHeaders;
use FireflyIII\Http\Middleware\StartFireflySession;
use FireflyIII\Http\Middleware\TrustProxies;
use FireflyIII\Http\Middleware\VerifyCsrfToken;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Contracts\Http\Kernel;
@@ -95,7 +96,6 @@ $app = Application::configure(basePath: dirname(__DIR__))
health : '/up',
)
->withMiddleware(function (Middleware $middleware): void {
$middleware->trustProxies(at: envNonEmpty('TRUSTED_PROXIES', ''));
// overrule the standard middleware
$middleware->use(
[
@@ -106,6 +106,7 @@ $app = Application::configure(basePath: dirname(__DIR__))
TrimStrings::class,
ConvertEmptyStringsToNull::class,
SecureHeaders::class,
TrustProxies::class,
]
);

View File

@@ -67,61 +67,62 @@ use FireflyIII\User;
return [
'bindables' => [
// models
'account' => Account::class,
'attachment' => Attachment::class,
'availableBudget' => AvailableBudget::class,
'bill' => Bill::class,
'budget' => Budget::class,
'budgetLimit' => BudgetLimit::class,
'category' => Category::class,
'linkType' => LinkType::class,
'transactionType' => TransactionType::class,
'journalLink' => TransactionJournalLink::class,
'currency' => TransactionCurrency::class,
'objectGroup' => ObjectGroup::class,
'piggyBank' => PiggyBank::class,
'preference' => Preference::class,
'tj' => TransactionJournal::class,
'tag' => Tag::class,
'recurrence' => Recurrence::class,
'rule' => Rule::class,
'ruleGroup' => RuleGroup::class,
'transactionGroup' => TransactionGroup::class,
'user' => User::class,
'webhook' => Webhook::class,
'webhookMessage' => WebhookMessage::class,
'webhookAttempt' => WebhookAttempt::class,
'invitedUser' => InvitedUser::class,
'account' => Account::class,
'attachment' => Attachment::class,
'availableBudget' => AvailableBudget::class,
'bill' => Bill::class,
'budget' => Budget::class,
'budgetLimit' => BudgetLimit::class,
'category' => Category::class,
'linkType' => LinkType::class,
'transactionType' => TransactionType::class,
'journalLink' => TransactionJournalLink::class,
'currency' => TransactionCurrency::class,
'objectGroup' => ObjectGroup::class,
'piggyBank' => PiggyBank::class,
'preference' => Preference::class,
'preferenceName' => Preference::class,
'tj' => TransactionJournal::class,
'tag' => Tag::class,
'recurrence' => Recurrence::class,
'rule' => Rule::class,
'ruleGroup' => RuleGroup::class,
'transactionGroup' => TransactionGroup::class,
'user' => User::class,
'webhook' => Webhook::class,
'webhookMessage' => WebhookMessage::class,
'webhookAttempt' => WebhookAttempt::class,
'invitedUser' => InvitedUser::class,
// strings
'currency_code' => CurrencyCode::class,
'currency_code' => CurrencyCode::class,
// dates
'start_date' => Date::class,
'end_date' => Date::class,
'date' => Date::class,
'start_date' => Date::class,
'end_date' => Date::class,
'date' => Date::class,
// lists
'accountList' => AccountList::class,
'doubleList' => AccountList::class,
'budgetList' => BudgetList::class,
'journalList' => JournalList::class,
'categoryList' => CategoryList::class,
'tagList' => TagList::class,
'accountList' => AccountList::class,
'doubleList' => AccountList::class,
'budgetList' => BudgetList::class,
'journalList' => JournalList::class,
'categoryList' => CategoryList::class,
'tagList' => TagList::class,
// others
'fromCurrencyCode' => CurrencyCode::class,
'toCurrencyCode' => CurrencyCode::class,
'cliToken' => CLIToken::class,
'tagOrId' => TagOrId::class,
'dynamicConfigKey' => DynamicConfigKey::class,
'eitherConfigKey' => EitherConfigKey::class,
'fromCurrencyCode' => CurrencyCode::class,
'toCurrencyCode' => CurrencyCode::class,
'cliToken' => CLIToken::class,
'tagOrId' => TagOrId::class,
'dynamicConfigKey' => DynamicConfigKey::class,
'eitherConfigKey' => EitherConfigKey::class,
// V2 API endpoints:
'userGroupAccount' => UserGroupAccount::class,
'userGroupTransaction' => UserGroupTransaction::class,
'userGroupBill' => UserGroupBill::class,
'userGroupExchangeRate' => UserGroupExchangeRate::class,
'userGroup' => UserGroup::class,
'userGroupAccount' => UserGroupAccount::class,
'userGroupTransaction' => UserGroupTransaction::class,
'userGroupBill' => UserGroupBill::class,
'userGroupExchangeRate' => UserGroupExchangeRate::class,
'userGroup' => UserGroup::class,
],
];

View File

@@ -78,8 +78,8 @@ return [
'running_balance_column' => (bool)envNonEmpty('USE_RUNNING_BALANCE', true), // this is only the default value, is not used.
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2026-01-25',
'build_time' => 1769368548,
'version' => 'develop/2026-01-26',
'build_time' => 1769407779,
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used.

View File

@@ -730,6 +730,19 @@ Route::group(
}
);
// Batch API routes:
Route::group(
[
'middleware' => ['auth:api,sanctum', 'bindings'],
'namespace' => 'FireflyIII\Api\V1\Controllers\System',
'prefix' => 'v1/batch',
'as' => 'api.v1.batch.',
],
static function (): void {
Route::post('finish', ['uses' => 'BatchController@finishBatch', 'as' => 'finish']);
}
);
// USER
// Preference API routes:
@@ -743,8 +756,8 @@ Route::group(
Route::get('', ['uses' => 'PreferencesController@index', 'as' => 'index']);
Route::post('', ['uses' => 'PreferencesController@store', 'as' => 'store']);
// Route::get('{preferenceList}', ['uses' => 'PreferencesController@showList', 'as' => 'show-list'])->where('preferenceList', ',+');
Route::get('{preference}', ['uses' => 'PreferencesController@show', 'as' => 'show']);
Route::put('{preference}', ['uses' => 'PreferencesController@update', 'as' => 'update']);
Route::get('{preferenceName}', ['uses' => 'PreferencesController@show', 'as' => 'show']);
Route::put('{preferenceName}', ['uses' => 'PreferencesController@update', 'as' => 'update']);
}
);