Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86ea9d5b38 | ||
|
|
a61da34f2a | ||
|
|
225754dfe5 | ||
|
|
6e358fe1eb | ||
|
|
a2da2698e3 | ||
|
|
ee017d7ae6 | ||
|
|
b0b5211e88 | ||
|
|
c6f0220889 | ||
|
|
b1cd1cf0bf | ||
|
|
dab6504e71 | ||
|
|
e361e998b3 | ||
|
|
bc73625121 | ||
|
|
a2439f3619 | ||
|
|
edfb1b92cb | ||
|
|
1097e4c313 | ||
|
|
fe10a8d4b0 | ||
|
|
96da4ce1b0 | ||
|
|
6aad92a0c6 | ||
|
|
7fc7db0577 | ||
|
|
e5ed2d9556 | ||
|
|
fbe4e736c8 | ||
|
|
bc635d5b76 | ||
|
|
c3a9c69c91 | ||
|
|
b043bb9cc9 | ||
|
|
d9afa9b558 | ||
|
|
4f0b873bed | ||
|
|
fb067d5396 | ||
|
|
dbaf7c4880 | ||
|
|
4750c53b58 | ||
|
|
aa0ce72d35 | ||
| 6360e6495f | |||
|
|
ed2f797ac2 | ||
|
|
91f91c20fa | ||
| 2f7d276781 | |||
| e22306225b | |||
| 6a860a4d75 | |||
| 5ff89b905f | |||
| 49b017de3d | |||
| 937b673be6 | |||
| 3e04d0a82d | |||
| 706e8e9892 | |||
| 154292530a | |||
| 82c3f7bb78 | |||
| e7f8f278ee | |||
|
|
c4b3fb215c |
3
.env
3
.env
@@ -13,7 +13,7 @@
|
||||
#
|
||||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
|
||||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
|
||||
|
||||
APP_URL=
|
||||
###> symfony/framework-bundle ###
|
||||
APP_ENV=prod
|
||||
APP_SECRET=
|
||||
@@ -27,6 +27,7 @@ APP_SECRET=
|
||||
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
|
||||
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
|
||||
# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8"
|
||||
DATABASE_URL=
|
||||
|
||||
###< doctrine/doctrine-bundle ###
|
||||
MERCURE_JWT_SECRET="!ChangeThisMercureHubJWTSecretKey!"
|
||||
|
||||
102
.gitea/workflows/ci.yml
Normal file
102
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,102 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
build-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
|
||||
- name: Install phing
|
||||
run: composer global require phing/phing
|
||||
|
||||
- name: Run composer
|
||||
run: composer install --no-dev --no-scripts -o
|
||||
|
||||
- name: Build tailwind
|
||||
run: APP_ENV=build php bin/console tailwind:build
|
||||
|
||||
- name: Install frontend assets
|
||||
run: APP_ENV=build php bin/console importmap:install
|
||||
|
||||
- name: Compile assets
|
||||
run: APP_ENV=build php bin/console asset-map:compile
|
||||
|
||||
- name: Login to registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: "${{ vars.REGISTRY_URL }}"
|
||||
username: "${{ vars.REGISTRY_USER }}"
|
||||
password: "${{ vars.REGISTRY_PASS }}"
|
||||
|
||||
- name: Create torsearch-app docker image
|
||||
run: |
|
||||
tag="${{ gitea.REF_NAME }}"
|
||||
tmdb_api="${{ vars.TMDB_API }}"
|
||||
version=${tag:1}
|
||||
docker build -f docker/Dockerfile.app \
|
||||
-t code.caldwell.digital/home/torsearch-app:${version} \
|
||||
-t code.caldwell.digital/home/torsearch-app:latest \
|
||||
--build-arg "APP_VERSION=${version}" \
|
||||
--build-arg "TMDB_API=${tmdb_api}" \
|
||||
.
|
||||
docker push code.caldwell.digital/home/torsearch-app:${version}
|
||||
docker push code.caldwell.digital/home/torsearch-app:latest
|
||||
|
||||
- name: Create torsearch-worker docker image
|
||||
run: |
|
||||
tag="${{ gitea.REF_NAME }}"
|
||||
tmdb_api="${{ vars.TMDB_API }}"
|
||||
version=${tag:1}
|
||||
docker build -f docker/Dockerfile.worker \
|
||||
-t code.caldwell.digital/home/torsearch-worker:${version} \
|
||||
-t code.caldwell.digital/home/torsearch-worker:latest \
|
||||
--build-arg "APP_VERSION=${version}" \
|
||||
--build-arg "TMDB_API=${tmdb_api}" \
|
||||
.
|
||||
docker push code.caldwell.digital/home/torsearch-worker:${version}
|
||||
docker push code.caldwell.digital/home/torsearch-worker:latest
|
||||
|
||||
- name: Create torsearch-scheduler docker image
|
||||
run: |
|
||||
tag="${{ gitea.REF_NAME }}"
|
||||
tmdb_api="${{ vars.TMDB_API }}"
|
||||
version=${tag:1}
|
||||
docker build -f docker/Dockerfile.scheduler \
|
||||
-t code.caldwell.digital/home/torsearch-scheduler:${version} \
|
||||
-t code.caldwell.digital/home/torsearch-scheduler:latest \
|
||||
--build-arg "APP_VERSION=${version}" \
|
||||
--build-arg "TMDB_API=${tmdb_api}" \
|
||||
.
|
||||
docker push code.caldwell.digital/home/torsearch-scheduler:${version}
|
||||
docker push code.caldwell.digital/home/torsearch-scheduler:latest
|
||||
|
||||
- name: Create artifact
|
||||
run: |
|
||||
file="torsearch-${{ gitea.REF_NAME }}.tar.gz"
|
||||
touch $file
|
||||
tar -cvzf $file --exclude=$file .
|
||||
|
||||
- name: Create release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
files: |-
|
||||
"torsearch-${{ gitea.REF_NAME }}.tar.gz"
|
||||
|
||||
# - name: Upload artifact
|
||||
# uses: actions/upload-artifact@v3
|
||||
# with:
|
||||
# name: "torsearch-${{ gitea.REF_NAME }}.tar.gz"
|
||||
# path: "torsearch-${{ gitea.REF_NAME }}.tar.gz"
|
||||
# compression_level: 9
|
||||
@@ -1,24 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
name: SonarQube Scan
|
||||
jobs:
|
||||
sonarqube:
|
||||
name: SonarQube Trigger
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checking out
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: SonarQube Scan
|
||||
uses: https://code.caldwell.digital/tools/sonarqube-action@v0.0.3
|
||||
with:
|
||||
host: "https://qube.caldwell.digital"
|
||||
login: ${{ secrets.SONARQUBE_TOKEN }}
|
||||
projectName: "torsearch"
|
||||
projectBaseDir: "./src"
|
||||
2
assets/bootstrap.js
vendored
2
assets/bootstrap.js
vendored
@@ -5,6 +5,7 @@ import DownloadOptionTr from './components/download-option-tr.js';
|
||||
import DownloadListRow from './components/download-list-row.js';
|
||||
import MonitorListRow from './components/monitor-list-row.js';
|
||||
import MovieContainer from "./components/movie-container.js";
|
||||
import StatusCheckerSpan from "./components/status-checker-span.js";
|
||||
|
||||
import { startStimulusApp } from '@symfony/stimulus-bundle';
|
||||
import Popover from '@stimulus-components/popover';
|
||||
@@ -24,3 +25,4 @@ customElements.define('movie-container', MovieContainer);
|
||||
customElements.define('dl-tr', DownloadOptionTr, {extends: 'tr'});
|
||||
customElements.define('download-list-row', DownloadListRow, {extends: 'tr'});
|
||||
customElements.define('monitor-list-row', MonitorListRow, {extends: 'tr'});
|
||||
customElements.define('status-checker-span', StatusCheckerSpan, {extends: 'span'});
|
||||
|
||||
40
assets/components/status-checker-span.js
Normal file
40
assets/components/status-checker-span.js
Normal file
@@ -0,0 +1,40 @@
|
||||
export default class PreviewContentDialog extends HTMLSpanElement {
|
||||
#url;
|
||||
#service;
|
||||
#status;
|
||||
|
||||
#statusTexts = {
|
||||
200: 'up',
|
||||
204: 'up'
|
||||
}
|
||||
|
||||
#statusColors = {
|
||||
200: 'bg-green-500',
|
||||
204: 'bg-green-500'
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.#url = this.getAttribute('url');
|
||||
this.#service = this.getAttribute('service');
|
||||
|
||||
(async () => await this.checkStatus())();
|
||||
setInterval(async () => await this.checkStatus(), 1000 * 60 * 10);
|
||||
}
|
||||
|
||||
async checkStatus() {
|
||||
const response = await fetch(this.#url);
|
||||
this.#status = response.status;
|
||||
this.setAttribute('title', this.getTitle());
|
||||
this.classList.remove('bg-red-500', 'bg-green-500');
|
||||
this.classList.add(this.getColor());
|
||||
}
|
||||
|
||||
getTitle() {
|
||||
return `${this.#service} is ${this.#statusTexts[this.#status] ?? 'down'}`
|
||||
}
|
||||
|
||||
getColor() {
|
||||
return this.#statusColors[this.#status] ?? 'bg-red-500';
|
||||
}
|
||||
}
|
||||
@@ -1,40 +1,43 @@
|
||||
sentry:
|
||||
register_error_listener: true # Disables the ErrorListener to avoid duplicated log in sentry
|
||||
register_error_handler: true # Disables the ErrorListener, ExceptionListener and FatalErrorListener integrations of the base PHP SDK
|
||||
when@prod: &prod
|
||||
sentry:
|
||||
register_error_listener: true # Disables the ErrorListener to avoid duplicated log in sentry
|
||||
register_error_handler: true # Disables the ErrorListener, ExceptionListener and FatalErrorListener integrations of the base PHP SDK
|
||||
|
||||
options:
|
||||
release: 'torsearch@%app.version%'
|
||||
enable_logs: true
|
||||
traces_sample_rate: 1
|
||||
profiles_sample_rate: 1
|
||||
attach_stacktrace: true
|
||||
options:
|
||||
release: 'torsearch@%app.version%'
|
||||
enable_logs: true
|
||||
traces_sample_rate: 1
|
||||
profiles_sample_rate: 1
|
||||
attach_stacktrace: true
|
||||
|
||||
tracing:
|
||||
enabled: true
|
||||
dbal: # DB queries
|
||||
enabled: true
|
||||
cache: # cache pools
|
||||
enabled: true
|
||||
twig: # templating engine
|
||||
tracing:
|
||||
enabled: true
|
||||
dbal: # DB queries
|
||||
enabled: true
|
||||
cache: # cache pools
|
||||
enabled: true
|
||||
twig: # templating engine
|
||||
enabled: true
|
||||
|
||||
services:
|
||||
# (Optionally) Configure the breadcrumb handler as a service (needed for the breadcrumb Monolog handler)
|
||||
Sentry\Monolog\BreadcrumbHandler:
|
||||
arguments:
|
||||
- '@Sentry\State\HubInterface'
|
||||
- !php/const Monolog\Logger::INFO # Configures the level of messages to capture as breadcrumbs
|
||||
monolog:
|
||||
handlers:
|
||||
# (Optionally) Register the breadcrumb handler as a Monolog handler
|
||||
sentry_breadcrumbs:
|
||||
type: service
|
||||
name: sentry_breadcrumbs
|
||||
id: Sentry\Monolog\BreadcrumbHandler
|
||||
# Register the handler as a Monolog handler to capture messages as events
|
||||
sentry:
|
||||
type: sentry
|
||||
level: !php/const Monolog\Logger::ERROR # Configures the level of messages to capture as events
|
||||
hub_id: Sentry\State\HubInterface
|
||||
fill_extra_context: true # Enables sending monolog context to Sentry
|
||||
process_psr_3_messages: false # Disables the resolution of PSR-3 placeholders in reported messages
|
||||
services:
|
||||
# (Optionally) Configure the breadcrumb handler as a service (needed for the breadcrumb Monolog handler)
|
||||
Sentry\Monolog\BreadcrumbHandler:
|
||||
arguments:
|
||||
- '@Sentry\State\HubInterface'
|
||||
- !php/const Monolog\Logger::INFO # Configures the level of messages to capture as breadcrumbs
|
||||
monolog:
|
||||
handlers:
|
||||
# (Optionally) Register the breadcrumb handler as a Monolog handler
|
||||
sentry_breadcrumbs:
|
||||
type: service
|
||||
name: sentry_breadcrumbs
|
||||
id: Sentry\Monolog\BreadcrumbHandler
|
||||
# Register the handler as a Monolog handler to capture messages as events
|
||||
sentry:
|
||||
type: sentry
|
||||
level: !php/const Monolog\Logger::ERROR # Configures the level of messages to capture as events
|
||||
hub_id: Sentry\State\HubInterface
|
||||
fill_extra_context: true # Enables sending monolog context to Sentry
|
||||
process_psr_3_messages: false # Disables the resolution of PSR-3 placeholders in reported messages
|
||||
|
||||
when@dev: *prod
|
||||
|
||||
@@ -18,9 +18,13 @@ module.exports = {
|
||||
"bg-green-400",
|
||||
"bg-purple-400",
|
||||
"bg-orange-400",
|
||||
"bg-red-500",
|
||||
"bg-green-500",
|
||||
"bg-blue-600",
|
||||
"bg-rose-600",
|
||||
"bg-black/20",
|
||||
"text-red-500",
|
||||
"text-green-500",
|
||||
"alert-success",
|
||||
"alert-warning",
|
||||
"font-bold",
|
||||
|
||||
@@ -6,6 +6,20 @@
|
||||
<div class="md:flex md:items-center md:gap-12">
|
||||
<nav aria-label="Global" class="md:block">
|
||||
<ul class="ml-4 flex items-end md:items-center md:gap-6 text-sm">
|
||||
<li>
|
||||
<div class="flex flex-row justify-center items-start gap-2 p-2 w-10 mt-1 h-6 rounded-lg border border-orange-500 text-orange-500">
|
||||
<status-checker-span
|
||||
class="h-2 w-2 rounded-full text-green-600 bg-green-600"
|
||||
url="https://torrentio.strem.fun"
|
||||
service="Torrentio">
|
||||
</status-checker-span>
|
||||
<status-checker-span
|
||||
class="h-2 w-2 rounded-full text-green-600 bg-green-600"
|
||||
url="https://api.themoviedb.org/3"
|
||||
service="TMDB">
|
||||
</status-checker-span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('app.monitor.upcoming-episodes') }}" data-turbo="false" title="View upcoming episodes of the shows you're subscribed to.">
|
||||
<twig:ux:icon name="solar:calendar-linear" width="25px" class="text-orange-500" />
|
||||
|
||||
Reference in New Issue
Block a user