mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-03-31 17:15:38 +00:00
require app key on crontab/tool http requests
This commit is contained in:
parent
f5d8759dfe
commit
07262f4486
4 changed files with 12 additions and 4 deletions
1
.env
1
.env
|
|
@ -17,6 +17,7 @@
|
||||||
###> symfony/framework-bundle ###
|
###> symfony/framework-bundle ###
|
||||||
APP_ENV=dev
|
APP_ENV=dev
|
||||||
APP_SECRET=EDITME
|
APP_SECRET=EDITME
|
||||||
|
APP_KEY=EDITME
|
||||||
###< symfony/framework-bundle ###
|
###< symfony/framework-bundle ###
|
||||||
|
|
||||||
###> doctrine/doctrine-bundle ###
|
###> doctrine/doctrine-bundle ###
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ php bin/console doctrine:migrations:migrate
|
||||||
|
|
||||||
##### Crontab
|
##### Crontab
|
||||||
|
|
||||||
* `* * * * * /crontab/torrent/scrape` - update seeding stats
|
* `* * * * * /crontab/torrent/scrape/{%app.key%}` - update seeding stats
|
||||||
|
|
||||||
##### App settings
|
##### App settings
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
parameters:
|
parameters:
|
||||||
app.version: '%env(APP_VERSION)%'
|
app.version: '%env(APP_VERSION)%'
|
||||||
app.name: '%env(APP_NAME)%'
|
app.name: '%env(APP_NAME)%'
|
||||||
|
app.key: '%env(APP_KEY)%'
|
||||||
app.pagination: '%env(APP_PAGINATION)%'
|
app.pagination: '%env(APP_PAGINATION)%'
|
||||||
app.trackers: '%env(APP_TRACKERS)%'
|
app.trackers: '%env(APP_TRACKERS)%'
|
||||||
app.locales: '%env(APP_LOCALES)%'
|
app.locales: '%env(APP_LOCALES)%'
|
||||||
|
|
|
||||||
|
|
@ -322,7 +322,7 @@ class TorrentController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('default/torrent/list.html.twig', [
|
return $this->render('default/torrent/list.html.twig', [
|
||||||
'query' => urldecode($request->get('query')),
|
'query' => $request->get('query') ? urldecode($request->get('query')) : '',
|
||||||
'torrents' => $torrents,
|
'torrents' => $torrents,
|
||||||
'pagination' =>
|
'pagination' =>
|
||||||
[
|
[
|
||||||
|
|
@ -1752,7 +1752,10 @@ class TorrentController extends AbstractController
|
||||||
|
|
||||||
// Tools
|
// Tools
|
||||||
#[Route(
|
#[Route(
|
||||||
'/crontab/torrent/scrape',
|
'/crontab/torrent/scrape/{key}',
|
||||||
|
requirements: [
|
||||||
|
'key' => '%app.key%'
|
||||||
|
],
|
||||||
methods:
|
methods:
|
||||||
[
|
[
|
||||||
'GET'
|
'GET'
|
||||||
|
|
@ -1773,7 +1776,10 @@ class TorrentController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route(
|
#[Route(
|
||||||
'/tool/torrent/reindex',
|
'/tool/torrent/reindex/{key}',
|
||||||
|
requirements: [
|
||||||
|
'key' => '%app.key%'
|
||||||
|
],
|
||||||
methods:
|
methods:
|
||||||
[
|
[
|
||||||
'GET'
|
'GET'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue