Compare commits
3 Commits
8b5949d1d0
...
daae79a166
Author | SHA1 | Date | |
---|---|---|---|
daae79a166 | |||
a10f3a00eb | |||
0abfc1624f |
19
README.md
19
README.md
|
@ -1,12 +1,12 @@
|
|||
# Comics Viewer
|
||||
|
||||
This small project provides a web based viewer for comics in the CBZ and CBR formats. Bear in mind that much of the code in this project is **very** old and has had lots of "just get it working" updates over the decades (not kidding) to keep up with changing PHP API requirements. It is *sooooo* not pretty (but should be *safe*).
|
||||
This small project provides a web based viewer for comics in the CBZ and CBR formats. Comic archive files are parsed and extracted dynamically while browsing and viewing. Thumbnails are created for both series and issues the first time a folder is accessed.
|
||||
|
||||
## This project requires
|
||||
|
||||
* PHP ImageMagick
|
||||
* PHP RAR (PECL)
|
||||
- Unfortunately RAR 4.2.0 has not been updated for PHP 8/8.2 (as of 2023-08-18). There is a [fix](https://github.com/cataphract/php-rar/pull/18/commits/02331ca1cc1e8638c34e024566f4b391a6c863c5) available. Just replace the files in the version from PECL/Github with the ones in [this](https://github.com/cataphract/php-rar/pull/18).
|
||||
- Unfortunately RAR 4.2.0 has not been updated for PHP 8/8.2 (as of 2025-03-13). There is a [fix](https://github.com/cataphract/php-rar/pull/18/commits/02331ca1cc1e8638c34e024566f4b391a6c863c5) available. Just replace the files in the version from PECL/Github with the ones in [this](https://github.com/cataphract/php-rar/pull/18).
|
||||
|
||||
## Don't forget to:
|
||||
|
||||
|
@ -15,4 +15,17 @@ This small project provides a web based viewer for comics in the CBZ and CBR for
|
|||
* Import the `install/initial_db_mysql.sql` database structure
|
||||
* Change the ownership of the `comics/` and `thumbs/` folders to the web server user
|
||||
* Copy the `variables-dist.php` file to `variables.php` and edit that file appropriately
|
||||
* Set up the cron job for things in [cron/](cron/)
|
||||
* Set up the cron job for things in [cron/](cron/). If installing on a systemd OS see services below.
|
||||
|
||||
## Services
|
||||
|
||||
If installing on an OS that uses systemd there are service and timer files available to run the periodic jobs. They can be installed like so:
|
||||
|
||||
* Edit the script path to the appropriate installation location in the service file(s)
|
||||
* Copy the service/timer files to the system:
|
||||
- `sudo cp install/clearextracts.* /etc/systemd/system/`
|
||||
- `sudo systemctl daemon-reload`
|
||||
* Start the timer:
|
||||
- `sudo systemctl start clearextracts.timer`
|
||||
* Enable the timer:
|
||||
- `sudo systemctl enable clearextracts.timer`
|
||||
|
|
|
@ -5,10 +5,10 @@ $projectRoot = dirname(dirname(__FILE__));
|
|||
require "{$projectRoot}/header.php";
|
||||
|
||||
if ( $argc != 2 ) {
|
||||
echo "Invalid number of days to keep\n";
|
||||
exit();
|
||||
}
|
||||
$daysToKeep = 10;
|
||||
} else {
|
||||
$daysToKeep = intval($argv[1]);
|
||||
}
|
||||
|
||||
$ed = $projectRoot . "/" . EXTRACTSDIR;
|
||||
$now = time();
|
||||
|
|
|
@ -59,6 +59,7 @@ function makeThumb($item = "") {
|
|||
$imgext = strtolower($parts['extension']);
|
||||
if ( (strcmp($lowest, $imgname) > 0)
|
||||
&& ((strcasecmp($imgext, "jpg") == 0)
|
||||
|| (strcasecmp($imgext, "jpeg") == 0)
|
||||
|| (strcasecmp($imgext, "png") == 0)
|
||||
|| (strcasecmp($imgext, "webp") == 0)) ) {
|
||||
$lowest = $imgname;
|
||||
|
@ -82,6 +83,7 @@ function makeThumb($item = "") {
|
|||
$imgext = strtolower($parts['extension']);
|
||||
if ( (strcmp($lowest, $imgname) > 0)
|
||||
&& ((strcasecmp($imgext, "jpg") == 0)
|
||||
|| (strcasecmp($imgext, "jpeg") == 0)
|
||||
|| (strcasecmp($imgext, "png") == 0)
|
||||
|| (strcasecmp($imgext, "webp") == 0)) ) {
|
||||
$lowest = $imgname;
|
||||
|
|
5
install/clearextracts.service
Normal file
5
install/clearextracts.service
Normal file
|
@ -0,0 +1,5 @@
|
|||
[Unit]
|
||||
Description="A script to remove extracted comics in webapp older than a set age (defaults to 10 days)"
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/php /var/www/htdocs/comics/cron/clearExtracts.php
|
9
install/clearextracts.timer
Normal file
9
install/clearextracts.timer
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description="Run ClearExtracts.service at 5am every day"
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 05:00:00
|
||||
Unit=clearextracts.service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user