first commit

This commit is contained in:
Shadchamp
2025-08-29 13:52:41 -04:00
parent 86c4bedf72
commit f0106fd482
12 changed files with 6105 additions and 3939 deletions
+3 -1
View File
@@ -1,9 +1,11 @@
FROM debian:buster-slim
FROM debian:bullseye-slim
RUN apt update
RUN apt install -y wget cron curl mariadb-client gnupg
RUN wget https://repo.manticoresearch.com/manticore-repo.noarch.deb
RUN dpkg -i manticore-repo.noarch.deb
# Fix Manticore repo sources to use bullseye instead of buster
RUN sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/manticoresearch.list
RUN apt update
RUN apt install -y manticore=5.0.2-220530-348514c86 manticore-server=5.0.2-220530-348514c86 manticore-tools=5.0.2-220530-348514c86 manticore-dev=5.0.2-220530-348514c86 manticore-server-core=5.0.2-220530-348514c86 manticore-common=5.0.2-220530-348514c86
+1 -1
View File
@@ -1 +1 @@
*/15 * * * * /usr/bin/php /var/www/scripts/schedule.php OL9n0m2JxhBxYyMvXWJg >> /tmp/schedule.log
*/15 * * * * /usr/bin/php /var/www/scripts/schedule.php OL9n0m2JxhBxYyMvXWJg >> /tmp/schedule.log
+7 -4
View File
@@ -5,6 +5,9 @@ run_service()
/etc/init.d/$1 start || exit 1
}
# Ensure /var/www has correct ownership for git operations
chown -R gazelle:gazelle /var/www
# We'll need these anyway so why not kill some time while waiting on MySQL to be ready
su -c 'echo "====== Composer Install ======"; \
composer --version; \
@@ -32,11 +35,11 @@ if ! FKEY_MY_DATABASE=1 LOCK_MY_DATABASE=1 /var/www/vendor/bin/phinx migrate; th
exit 1
fi
if [ ! -f /etc/php/7.4/cli/conf.d/99-boris.ini ]; then
if [ ! -f /etc/php/8.4/cli/conf.d/99-boris.ini ]; then
echo "Initialize Boris..."
grep '^disable_functions' /etc/php/7.4/cli/php.ini \
grep '^disable_functions' /etc/php/8.4/cli/php.ini \
| sed -r 's/pcntl_(fork|signal|signal_dispatch|waitpid),//g' \
> /etc/php/7.4/cli/conf.d/99-boris.ini
> /etc/php/8.4/cli/conf.d/99-boris.ini
fi
echo "Start services..."
@@ -49,7 +52,7 @@ truncate -s0 /var/www/logs/*.log
run_service cron
run_service nginx
run_service php7.4-fpm
run_service php8.4-fpm
crontab /var/www/.docker/web/crontab
+30
View File
@@ -0,0 +1,30 @@
# Example .env file for Gazelle-Porn project
# MySQL Database configuration
MYSQL_DATABASE=gazelle
MYSQL_USER=gazelle
MYSQL_PASSWORD=password
MYSQL_ROOT_PASSWORD=em%G9Lrey4^N
# Web service configuration
WEB_PORT=9000
VITE_PORT=9002
LIVERELOAD_PORT=35729
# Memcached configuration
MEMCACHED_HOST=memcached
# phpMyAdmin configuration
PMA_HOST=mysql
PMA_USER=gazelle
PMA_PASSWORD=password
PMA_PORT=9001
# ManticoreSearch configuration
MANTICORE_DATA_PATH=/var/lib/manticore
MANTICORE_CONF_PATH=/var/lib/manticore/conf/manticore.conf
# MySQL exposed port
MYSQL_PORT=36000
# Add any other environment variables below as needed
+30 -25
View File
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:24.04
WORKDIR /var/www
@@ -7,7 +7,12 @@ WORKDIR /var/www
RUN apt-get update
RUN apt install -y software-properties-common
RUN add-apt-repository ppa:ondrej/php
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y
RUN apt-get update
RUN apt install -y php8.4
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y --no-install-recommends \
build-essential \
@@ -26,19 +31,19 @@ RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y --no-install-r
mariadb-client \
netcat-openbsd \
nginx \
php7.4-cli \
php7.4-curl \
php7.4-fpm \
php7.4-gd \
php7.4-mbstring \
php7.4-mysql \
php7.4-xml \
php7.4-zip \
php7.4-yaml \
php7.4-apcu \
php7.4-bcmath \
php7.4-memcached \
php7.4-xdebug \
php8.4-cli \
php8.4-curl \
php8.4-fpm \
php8.4-gd \
php8.4-mbstring \
php8.4-mysql \
php8.4-xml \
php8.4-zip \
php8.4-yaml \
php8.4-apcu \
php8.4-bcmath \
php8.4-memcached \
php8.4-xdebug \
python3 \
python3-pip \
python3-setuptools \
@@ -49,13 +54,13 @@ RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y --no-install-r
zlib1g-dev \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& curl -sL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y --no-install-recommends \
nodejs \
yarn
# Python tools layer
RUN pip3 install chardet
RUN apt-get update && apt-get install -y python3-chardet
RUN curl -s https://getcomposer.org/installer | php
RUN mv composer.phar /usr/bin/composer
@@ -63,8 +68,6 @@ RUN mv composer.phar /usr/bin/composer
# Puppeteer layer
# This installs the necessary packages to run the bundled version of chromium for puppeteer
RUN apt-get install -y --no-install-recommends \
gconf-service \
libasound2 \
libatk1.0-0 \
libc6 \
libcairo2 \
@@ -73,7 +76,6 @@ RUN apt-get install -y --no-install-recommends \
libexpat1 \
libfontconfig1 \
libgcc1 \
libgconf-2-4 \
libgdk-pixbuf2.0-0 \
libglib2.0-0 \
libgtk-3-0 \
@@ -95,7 +97,6 @@ RUN apt-get install -y --no-install-recommends \
libxss1 \
libxtst6 \
fonts-liberation \
libappindicator1 \
libnss3 \
lsb-release \
xdg-utils \
@@ -116,13 +117,17 @@ COPY . /var/www
# Permissions and configuration layer
RUN useradd -ms /bin/bash gazelle \
&& chown -R gazelle:gazelle /var/www \
&& cp /var/www/.docker/web/php.ini /etc/php/7.4/cli/php.ini \
&& cp /var/www/.docker/web/php.ini /etc/php/7.4/fpm/php.ini \
&& cp /var/www/.docker/web/xdebug.ini /etc/php/7.4/mods-available/xdebug.ini \
&& rm -f /etc/nginx/sites-enabled/default
&& cp /var/www/.docker/web/php.ini /etc/php/8.4/cli/php.ini \
&& cp /var/www/.docker/web/php.ini /etc/php/8.4/fpm/php.ini \
&& cp /var/www/.docker/web/xdebug.ini /etc/php/8.4/mods-available/xdebug.ini \
&& rm -f /etc/nginx/sites-enabled/default \
&& sed -i 's|unix:/var/run/php/php-fpm.sock|unix:/var/run/php/php8.4-fpm.sock|g' /etc/nginx/sites-available/default || true \
&& sed -i 's|unix:/var/run/php/php-fpm.sock|unix:/var/run/php/php8.4-fpm.sock|g' /etc/nginx/nginx.conf || true
EXPOSE 80/tcp
EXPOSE 9002/tcp
EXPOSE 35729/tcp
ENTRYPOINT [ "/bin/bash", "/var/www/.docker/web/entrypoint.sh" ]
+7 -7
View File
@@ -2,7 +2,7 @@
use Aws\CommandPool;
use Aws\S3\S3Client;
use Guzzle\Service\Exception\CommandTransferException;
use Aws\Exception\AwsException;
class Minio implements ImageStorage {
private $s3;
@@ -56,15 +56,15 @@ class Minio implements ImageStorage {
if ($Result instanceof \Aws\Result) {
$ret[] = $this->image_path($Datas[$Idx]['Name']);
} else {
if ($Result->getStatusCode() != 200) {
throw new Exception("Upload failed, status code: " . $Result->getStatusCode() . " message: " . $Result->getAwsErrorMessage());
if (method_exists($Result, 'getStatusCode') && $Result->getStatusCode() != 200) {
throw new Exception("Upload failed, status code: " . $Result->getStatusCode() . " message: " . (method_exists($Result, 'getAwsErrorMessage') ? $Result->getAwsErrorMessage() : 'Unknown error'));
}
}
}
} catch (CommandTransferException $e) {
foreach ($e->getFailedCommands() as $failedCommand) {
throw new Exception($e->getExceptionForFailedCommand($failedCommand)->getMessage());
}
} catch (\Aws\Exception\AwsException $e) {
throw new Exception($e->getMessage());
} catch (\Exception $e) {
throw new Exception($e->getMessage());
}
return $ret;
}
+7 -5
View File
@@ -22,17 +22,18 @@
"require": {
"php": ">=7",
"robmorgan/phinx": "^0.10.0",
"yupmin/php-chardet": "^1.0",
"whichbrowser/parser": "^2.0",
"orpheusnet/bencode-torrent": "*",
"irazasyed/telegram-bot-sdk": "^3.4",
"imdbphp/imdbphp": "^8.1",
"php-curl-class/php-curl-class": "^9.1",
"mailgun/mailgun-php": "~1.7.2",
"mailgun/mailgun-php": "~4.3.5",
"kriswallsmith/buzz": "^1.2",
"nyholm/psr7": "^1.4",
"aws/aws-sdk-php": "^3.185",
"twig/twig": "^2.15.3",
"twig/twig": "^3.14.1",
"nesbot/carbon": ">=2.72.6",
"symfony/process": ">=5.4.46",
"d11wtq/boris": "^1.0",
"phpmailer/phpmailer": "^6.6",
"tronovav/geoip2-update": "^2.1",
@@ -40,7 +41,7 @@
},
"require-dev": {
"phpstan/phpstan": "^0.12.49",
"phpunit/phpunit": "^6|^7",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.5"
},
"scripts": {
@@ -49,7 +50,8 @@
},
"config": {
"allow-plugins": {
"kylekatarnls/update-helper": true
"kylekatarnls/update-helper": true,
"php-http/discovery": true
}
}
}
Generated
+3961 -2728
View File
File diff suppressed because it is too large Load Diff
+15 -17
View File
@@ -1,5 +1,3 @@
version: '3'
services:
web:
build: .
@@ -15,40 +13,40 @@ services:
volumes:
- .:/var/www:delegated
- .docker/web/nginx.conf:/etc/nginx/sites-enabled/gazelle.conf
- .docker/web/www.conf:/etc/php/7.4/fpm/pool.d/www.conf
- .docker/web/www.conf:/etc/php/8.4/fpm/pool.d/www.conf
environment:
# These should match what you set for your mysql container below
- MYSQL_USER=gazelle
- MYSQL_PASSWORD=password
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
memcached:
image: memcached:1.5-alpine
image: memcached:latest
container_name: gpw-memcached
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: gpw-phpmyadmin
environment:
- PMA_HOST=mysql
- PMA_USER=gazelle
- PMA_PASSWORD=password
- PMA_HOST=${PMA_HOST}
- PMA_USER=${PMA_USER}
- PMA_PASSWORD=${PMA_PASSWORD}
depends_on:
- mysql
ports:
- 9001:80
mysql:
image: mariadb:10.3
image: mariadb:latest
container_name: gpw-mysql
ports:
- 36000:3306
volumes:
- ./.docker/mysql/mysqld_sql_mode.cnf:/etc/mysql/conf.d/mysqld_sql_mode.cnf:delegated
- ./.docker/mysql/mysqld_sql_mode.cnf:/etc/mysql/conf.d/mysqld_sql_mode.cnf:ro
- mysql-data:/var/lib/mysql
- ./gazelle.sql:/docker-entrypoint-initdb.d/gazelle.sql:ro
environment:
- MYSQL_DATABASE=gazelle
- MYSQL_USER=gazelle
- MYSQL_PASSWORD=password
- MYSQL_ROOT_PASSWORD=em%G9Lrey4^N
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
manticoresearch:
build: ./.docker/manticore
@@ -62,8 +60,8 @@ services:
- ./.docker/manticore/manticore.conf:/var/lib/manticore/conf/manticore.conf
environment:
# These should match what you set for your mysql container above
- MYSQL_USER=gazelle
- MYSQL_PASSWORD=password
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
volumes:
mysql-data:
+4
View File
@@ -1397,6 +1397,10 @@ CREATE TABLE `movie_info_cache` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Table structure for table `new_info_hashes`
--
+13 -1
View File
@@ -32,7 +32,19 @@
"preact": "^10.6.4",
"prop-types": "^15.8.1",
"react-resize-detector": "^7.1.2",
"remark-gfm": "^3.0.1"
"remark-gfm": "^3.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^4.0.0",
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"typescript": "^5.4.0",
"postcss": "^8.4.32",
"remark-parse": "^10.0.0",
"unified": "^10.1.2",
"mdast-util-gfm-table": "^1.0.1",
"micromark": "^3.0.5",
"micromark-extension-gfm-table": "^1.0.3"
},
"devDependencies": {
"@mdx-js/react": "^2.1.2",
+2027 -1150
View File
File diff suppressed because it is too large Load Diff