Compare commits
7 Commits
dev-event-
...
v0.34.19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1759b6dfdc | ||
|
|
2d3bc35e45 | ||
|
|
69f07b57ce | ||
|
|
b86028acee | ||
|
|
b67781fe23 | ||
|
|
6920b82684 | ||
|
|
0f291aa147 |
15
compose.yml
15
compose.yml
@@ -33,11 +33,12 @@ services:
|
|||||||
|
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
build:
|
# build:
|
||||||
dockerfile: docker/Dockerfile.base.worker
|
# dockerfile: docker/Dockerfile.base.worker
|
||||||
context: .
|
# context: .
|
||||||
args:
|
# args:
|
||||||
FRANKENPHP_TAG: php8.4-alpine
|
# FRANKENPHP_TAG: php8.4-alpine
|
||||||
|
image: torsearch-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- $PWD:/app
|
- $PWD:/app
|
||||||
@@ -45,7 +46,7 @@ services:
|
|||||||
tty: true
|
tty: true
|
||||||
environment:
|
environment:
|
||||||
TZ: America/Chicago
|
TZ: America/Chicago
|
||||||
command: php /app/bin/console messenger:consume async --time-limit=3600 -vv
|
# command: php /app/bin/console messenger:consume async --time-limit=3600 -vv
|
||||||
|
|
||||||
|
|
||||||
scheduler:
|
scheduler:
|
||||||
@@ -96,6 +97,8 @@ services:
|
|||||||
image: adminer
|
image: adminer
|
||||||
ports:
|
ports:
|
||||||
- "8081:8080"
|
- "8081:8080"
|
||||||
|
environment:
|
||||||
|
ADMINER_DEFAULT_SERVER: database
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -15,6 +15,26 @@ framework:
|
|||||||
max_retries: 1
|
max_retries: 1
|
||||||
multiplier: 1
|
multiplier: 1
|
||||||
|
|
||||||
|
download:
|
||||||
|
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
|
||||||
|
options:
|
||||||
|
use_notify: true
|
||||||
|
check_delayed_interval: 60000
|
||||||
|
queue_name: download
|
||||||
|
retry_strategy:
|
||||||
|
max_retries: 3
|
||||||
|
multiplier: 1
|
||||||
|
|
||||||
|
monitor:
|
||||||
|
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
|
||||||
|
options:
|
||||||
|
use_notify: true
|
||||||
|
check_delayed_interval: 60000
|
||||||
|
queue_name: monitor
|
||||||
|
retry_strategy:
|
||||||
|
max_retries: 1
|
||||||
|
multiplier: 1
|
||||||
|
|
||||||
media_cache:
|
media_cache:
|
||||||
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
|
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
|
||||||
options:
|
options:
|
||||||
@@ -36,12 +56,12 @@ framework:
|
|||||||
routing:
|
routing:
|
||||||
# Route your messages to the transports
|
# Route your messages to the transports
|
||||||
# 'App\Message\YourMessage': async
|
# 'App\Message\YourMessage': async
|
||||||
'App\Download\Action\Command\DownloadMediaCommand': async
|
'App\Download\Action\Command\DownloadMediaCommand': download
|
||||||
'App\Download\Action\Command\DownloadSeasonCommand': async
|
'App\Download\Action\Command\DownloadSeasonCommand': async
|
||||||
'App\Monitor\Action\Command\MonitorTvEpisodeCommand': async
|
'App\Monitor\Action\Command\MonitorTvEpisodeCommand': monitor
|
||||||
'App\Monitor\Action\Command\MonitorTvSeasonCommand': async
|
'App\Monitor\Action\Command\MonitorTvSeasonCommand': monitor
|
||||||
'App\Monitor\Action\Command\MonitorTvShowCommand': async
|
'App\Monitor\Action\Command\MonitorTvShowCommand': monitor
|
||||||
'App\Monitor\Action\Command\MonitorMovieCommand': async
|
'App\Monitor\Action\Command\MonitorMovieCommand': monitor
|
||||||
'App\Torrentio\Action\Command\GetTvShowOptionsCommand': media_cache
|
'App\Torrentio\Action\Command\GetTvShowOptionsCommand': media_cache
|
||||||
|
|
||||||
# when@test:
|
# when@test:
|
||||||
|
|||||||
@@ -23,22 +23,22 @@ services:
|
|||||||
- /mnt/media/downloads/movies:/var/download/movies
|
- /mnt/media/downloads/movies:/var/download/movies
|
||||||
- /mnt/media/downloads/tvshows:/var/download/tvshows
|
- /mnt/media/downloads/tvshows:/var/download/tvshows
|
||||||
restart: always
|
restart: always
|
||||||
command: -vv --time-limit=3600 --limit=10
|
# command: -vv --time-limit=3600 --limit=10
|
||||||
deploy:
|
deploy:
|
||||||
replicas: 2
|
replicas: 2
|
||||||
depends_on:
|
depends_on:
|
||||||
- app
|
- app
|
||||||
|
|
||||||
|
#
|
||||||
scheduler:
|
# scheduler:
|
||||||
image: registry.caldwell.digital/home/torsearch-scheduler:${TAG}
|
# image: registry.caldwell.digital/home/torsearch-scheduler:${TAG}
|
||||||
volumes:
|
# volumes:
|
||||||
- /mnt/media/downloads/movies:/var/download/movies
|
# - /mnt/media/downloads/movies:/var/download/movies
|
||||||
- /mnt/media/downloads/tvshows:/var/download/tvshows
|
# - /mnt/media/downloads/tvshows:/var/download/tvshows
|
||||||
restart: always
|
# restart: always
|
||||||
command: -vv
|
# command: -vv
|
||||||
depends_on:
|
# depends_on:
|
||||||
- app
|
# - app
|
||||||
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
|
|||||||
@@ -1,10 +1,40 @@
|
|||||||
FROM code.caldwell.digital/home/torsearch-base-worker:php8.4-alpine
|
###
|
||||||
|
# This version of Torsearch runs the scheduler, downloader, and worker
|
||||||
|
# in this one container. Each process is managerd by supervisord
|
||||||
|
# and can be configured via environment variables and more
|
||||||
|
# than one of these containers cans till be run.
|
||||||
|
###
|
||||||
|
ARG APP_VERSION="latest"
|
||||||
|
|
||||||
ARG APP_VERSION="0.0.0-dev"
|
FROM code.caldwell.digital/home/torsearch-app:${APP_VERSION} AS base_image
|
||||||
ENV APP_VERSION="${APP_VERSION}"
|
|
||||||
|
|
||||||
COPY . /app
|
|
||||||
|
|
||||||
ENTRYPOINT [ "php", "/app/bin/console", "messenger:consume", "async" ]
|
FROM alpine:3.22 AS build_stage
|
||||||
|
|
||||||
HEALTHCHECK --interval=3s --timeout=3s --retries=10 CMD return 0
|
COPY --from=base_image --chown=1000:1000 /app /app
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
curl \
|
||||||
|
nginx \
|
||||||
|
php84 \
|
||||||
|
php84-ctype \
|
||||||
|
php84-curl \
|
||||||
|
php84-dom \
|
||||||
|
php84-fileinfo \
|
||||||
|
php84-fpm \
|
||||||
|
php84-gd \
|
||||||
|
php84-mbstring \
|
||||||
|
php84-mysqli \
|
||||||
|
php84-opcache \
|
||||||
|
php84-openssl \
|
||||||
|
php84-pdo_mysql \
|
||||||
|
php84-tokenizer \
|
||||||
|
supervisor
|
||||||
|
|
||||||
|
RUN ln -s /usr/bin/php84 /usr/bin/php
|
||||||
|
|
||||||
|
COPY docker/worker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
|
||||||
|
# We start supervisord and supervisord starts
|
||||||
|
# respective service in the configuration file.
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||||
|
|||||||
27
docker/worker/supervisord.conf
Normal file
27
docker/worker/supervisord.conf
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
logfile=/dev/null
|
||||||
|
logfile_maxbytes=0
|
||||||
|
pidfile=/run/supervisord.pid
|
||||||
|
|
||||||
|
[program:torsearch-worker]
|
||||||
|
command=/app/bin/console messenger:consume download -vv --time-limit 3600
|
||||||
|
numprocs=1
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
autorestart=true
|
||||||
|
startretries=3
|
||||||
|
process_name=%(program_name)s_%(process_num)02d
|
||||||
|
|
||||||
|
[program:torsearch-scheduler]
|
||||||
|
command=/app/bin/console messenger:consume scheduler_monitor monitor -vv --time-limit 21600
|
||||||
|
numprocs=1
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
autorestart=true
|
||||||
|
startretries=3
|
||||||
|
process_name=%(program_name)s_%(process_num)02d
|
||||||
@@ -21,10 +21,7 @@ final class Version20250831013403 extends AbstractMigration
|
|||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
$this->addSql(<<<'SQL'
|
$this->addSql(<<<'SQL'
|
||||||
DROP TABLE sessions
|
DROP TABLE IF EXISTS sessions
|
||||||
SQL);
|
|
||||||
$this->addSql(<<<'SQL'
|
|
||||||
ALTER TABLE download CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL
|
|
||||||
SQL);
|
SQL);
|
||||||
$this->addSql(<<<'SQL'
|
$this->addSql(<<<'SQL'
|
||||||
ALTER TABLE user_preference CHANGE preference_value preference_value VARCHAR(1024) DEFAULT NULL
|
ALTER TABLE user_preference CHANGE preference_value preference_value VARCHAR(1024) DEFAULT NULL
|
||||||
@@ -37,9 +34,6 @@ final class Version20250831013403 extends AbstractMigration
|
|||||||
$this->addSql(<<<'SQL'
|
$this->addSql(<<<'SQL'
|
||||||
CREATE TABLE sessions (sess_id VARBINARY(128) NOT NULL, sess_data LONGBLOB NOT NULL, sess_lifetime INT UNSIGNED NOT NULL, sess_time INT UNSIGNED NOT NULL, INDEX sess_lifetime_idx (sess_lifetime), PRIMARY KEY(sess_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB COMMENT = ''
|
CREATE TABLE sessions (sess_id VARBINARY(128) NOT NULL, sess_data LONGBLOB NOT NULL, sess_lifetime INT UNSIGNED NOT NULL, sess_time INT UNSIGNED NOT NULL, INDEX sess_lifetime_idx (sess_lifetime), PRIMARY KEY(sess_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB COMMENT = ''
|
||||||
SQL);
|
SQL);
|
||||||
$this->addSql(<<<'SQL'
|
|
||||||
ALTER TABLE download CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL
|
|
||||||
SQL);
|
|
||||||
$this->addSql(<<<'SQL'
|
$this->addSql(<<<'SQL'
|
||||||
ALTER TABLE user_preference CHANGE preference_value preference_value VARCHAR(255) DEFAULT NULL
|
ALTER TABLE user_preference CHANGE preference_value preference_value VARCHAR(255) DEFAULT NULL
|
||||||
SQL);
|
SQL);
|
||||||
|
|||||||
35
migrations/Version20251102221034.php
Normal file
35
migrations/Version20251102221034.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20251102221034 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql(<<<'SQL'
|
||||||
|
ALTER TABLE event_log ADD created_at DATETIME NULL, ADD updated_at DATETIME NULL
|
||||||
|
SQL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql(<<<'SQL'
|
||||||
|
ALTER TABLE event_log DROP created_at, DROP updated_at
|
||||||
|
SQL);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,10 +6,13 @@ use App\EventLog\Framework\Repository\EventLogRepository;
|
|||||||
use App\User\Framework\Entity\User;
|
use App\User\Framework\Entity\User;
|
||||||
use Doctrine\DBAL\Types\Types;
|
use Doctrine\DBAL\Types\Types;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Gedmo\Timestampable\Traits\TimestampableEntity;
|
||||||
|
|
||||||
#[ORM\Entity(repositoryClass: EventLogRepository::class)]
|
#[ORM\Entity(repositoryClass: EventLogRepository::class)]
|
||||||
class EventLog
|
class EventLog
|
||||||
{
|
{
|
||||||
|
use TimestampableEntity;
|
||||||
|
|
||||||
#[ORM\Id]
|
#[ORM\Id]
|
||||||
#[ORM\GeneratedValue]
|
#[ORM\GeneratedValue]
|
||||||
#[ORM\Column(nullable: true)]
|
#[ORM\Column(nullable: true)]
|
||||||
|
|||||||
Reference in New Issue
Block a user