diff options
| -rw-r--r-- | .docker/app/Dockerfile | 2 | ||||
| -rw-r--r-- | .docker/app/backup.sh | 4 | ||||
| -rw-r--r-- | .docker/app/startup.sh | 16 | ||||
| -rw-r--r-- | .docker/app/updater.sh | 2 | ||||
| -rw-r--r-- | classes/Config.php | 2 | ||||
| -rwxr-xr-x | locale/ar_SA/LC_MESSAGES/messages.mo | bin | 37354 -> 33646 bytes | |||
| -rw-r--r-- | locale/ar_SA/LC_MESSAGES/messages.po | 21 | ||||
| -rwxr-xr-x | plugins/af_comics/filters/af_comics_comicpress.php | 2 | ||||
| -rw-r--r-- | tests/ConfigTest.php | 12 |
9 files changed, 34 insertions, 27 deletions
diff --git a/.docker/app/Dockerfile b/.docker/app/Dockerfile index eb1af1ba9..8662e322f 100644 --- a/.docker/app/Dockerfile +++ b/.docker/app/Dockerfile @@ -25,7 +25,7 @@ RUN [ ! -z ${ALPINE_MIRROR} ] && \ -e 's/;\(php_admin_value\[error_log\]\) = .*/\1 = \/tmp\/error.log/' \ -e 's/;\(php_admin_flag\[log_errors\]\) = .*/\1 = on/' \ /etc/php83/php-fpm.d/www.conf && \ - mkdir -p /var/www ${SCRIPT_ROOT}/config.d + mkdir -p /var/www ${SCRIPT_ROOT}/config.d ${SCRIPT_ROOT}/sql/post-init.d ARG CI_COMMIT_BRANCH ENV CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH} diff --git a/.docker/app/backup.sh b/.docker/app/backup.sh index a28c39544..784982c70 100644 --- a/.docker/app/backup.sh +++ b/.docker/app/backup.sh @@ -4,12 +4,12 @@ DST_DIR=/backups KEEP_DAYS=28 APP_ROOT=/var/www/html/tt-rss -if pg_isready -h $TTRSS_DB_HOST -U $TTRSS_DB_USER; then +if pg_isready -h $TTRSS_DB_HOST -U $TTRSS_DB_USER -p $TTRSS_DB_PORT; then DST_FILE=ttrss-backup-$(date +%Y%m%d).sql.gz echo backing up tt-rss database to $DST_DIR/$DST_FILE... - export PGPASSWORD=$TTRSS_DB_PASS + export PGPASSWORD=$TTRSS_DB_PASS pg_dump --clean -h $TTRSS_DB_HOST -U $TTRSS_DB_USER $TTRSS_DB_NAME | gzip > $DST_DIR/$DST_FILE diff --git a/.docker/app/startup.sh b/.docker/app/startup.sh index b035371fe..86b10b746 100644 --- a/.docker/app/startup.sh +++ b/.docker/app/startup.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -while ! pg_isready -h $TTRSS_DB_HOST -U $TTRSS_DB_USER; do +while ! pg_isready -h $TTRSS_DB_HOST -U $TTRSS_DB_USER -p $TTRSS_DB_PORT; do echo waiting until $TTRSS_DB_HOST is ready... sleep 3 done @@ -84,17 +84,10 @@ else echo skipping local plugin updates, disabled. fi -PSQL="psql -q -h $TTRSS_DB_HOST -U $TTRSS_DB_USER $TTRSS_DB_NAME" +PSQL="psql -q -h $TTRSS_DB_HOST -p $TTRSS_DB_PORT -U $TTRSS_DB_USER $TTRSS_DB_NAME" $PSQL -c "create extension if not exists pg_trgm" -RESTORE_SCHEMA=${SCRIPT_ROOT}/restore-schema.sql.gz - -if [ -r $RESTORE_SCHEMA ]; then - $PSQL -c "drop schema public cascade; create schema public;" - zcat $RESTORE_SCHEMA | $PSQL -fi - # this was previously generated rm -f $DST_DIR/config.php.bak @@ -158,6 +151,11 @@ rm -f /tmp/error.log && mkfifo /tmp/error.log && chown app:app /tmp/error.log unset ADMIN_USER_PASS unset AUTO_CREATE_USER_PASS +find ${SCRIPT_ROOT}/sql/post-init.d/ -type f -name '*.sql' | while read F; do + echo applying SQL patch file: $F + $PSQL -f $F +done + touch $DST_DIR/.app_is_ready exec /usr/sbin/php-fpm83 --nodaemonize --force-stderr diff --git a/.docker/app/updater.sh b/.docker/app/updater.sh index 5fdddd1d1..66e0b7e5c 100644 --- a/.docker/app/updater.sh +++ b/.docker/app/updater.sh @@ -15,7 +15,7 @@ if ! id app; then adduser -D -h /var/www/html -G app -u $OWNER_UID app fi -while ! pg_isready -h $TTRSS_DB_HOST -U $TTRSS_DB_USER; do +while ! pg_isready -h $TTRSS_DB_HOST -U $TTRSS_DB_USER -p $TTRSS_DB_PORT; do echo waiting until $TTRSS_DB_HOST is ready... sleep 3 done diff --git a/classes/Config.php b/classes/Config.php index ab7f4baef..9235e2c45 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -483,7 +483,7 @@ class Config { $self_url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); $self_url_path = preg_replace("/(\/api\/{1,})?(\w+\.php)?(\?.*$)?$/", "", $self_url_path); - $self_url_path = preg_replace("/(\/plugins(.local))\/.{1,}$/", "", $self_url_path); + $self_url_path = preg_replace("/(\/plugins(.local)?)\/.{1,}$/", "", $self_url_path); return rtrim($self_url_path, "/"); } diff --git a/locale/ar_SA/LC_MESSAGES/messages.mo b/locale/ar_SA/LC_MESSAGES/messages.mo Binary files differindex 4c43b5d1d..769cdc2c2 100755 --- a/locale/ar_SA/LC_MESSAGES/messages.mo +++ b/locale/ar_SA/LC_MESSAGES/messages.mo diff --git a/locale/ar_SA/LC_MESSAGES/messages.po b/locale/ar_SA/LC_MESSAGES/messages.po index a1b35488f..9b806f59e 100644 --- a/locale/ar_SA/LC_MESSAGES/messages.po +++ b/locale/ar_SA/LC_MESSAGES/messages.po @@ -8,15 +8,16 @@ msgstr "" "Project-Id-Version: TinyTinyRSS\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-06-15 14:03+0300\n" -"PO-Revision-Date: 2014-08-13 19:15+0300\n" -"Last-Translator: عبد الناصر سعيد الثبيتي <abdunnasir@althobaity.com>\n" -"Language-Team: Arabic <abdunnasir@althobaity.com>\n" +"PO-Revision-Date: 2024-10-24 14:15+0000\n" +"Last-Translator: Younes <git@younes.io>\n" +"Language-Team: Arabic (Saudi Arabia) <https://hosted.weblate.org/projects/" +"tt-rss/webui/ar_SA/>\n" "Language: ar_SA\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 1.6.7\n" +"X-Generator: Weblate 5.8.2-dev\n" "X-Poedit-SourceCharset: UTF-8\n" #: backend.php:65 @@ -56,28 +57,24 @@ msgid "Disable updates" msgstr "عطّل التحديثات" #: backend.php:76 backend.php:86 -#, fuzzy msgid "15 minutes" -msgstr "كل ١٥ دقيقة" +msgstr "١٥ دقيقة" #: backend.php:77 backend.php:87 -#, fuzzy msgid "30 minutes" -msgstr "كل ٣٠ دقيقة" +msgstr "٣٠ دقيقة" #: backend.php:78 backend.php:88 msgid "Hourly" msgstr "كل ساعة" #: backend.php:79 backend.php:89 -#, fuzzy msgid "4 hours" -msgstr "كل ٤ ساعات" +msgstr "٤ ساعات" #: backend.php:80 backend.php:90 -#, fuzzy msgid "12 hours" -msgstr "كل ١٢ ساعة" +msgstr "١٢ ساعة" #: backend.php:81 backend.php:91 msgid "Daily" diff --git a/plugins/af_comics/filters/af_comics_comicpress.php b/plugins/af_comics/filters/af_comics_comicpress.php index b963b2ae7..c1b854209 100755 --- a/plugins/af_comics/filters/af_comics_comicpress.php +++ b/plugins/af_comics/filters/af_comics_comicpress.php @@ -28,7 +28,7 @@ class Af_Comics_ComicPress extends Af_ComicFilter { if ($res && $doc->loadHTML($res)) { $xpath = new DOMXPath($doc); - $basenode = $xpath->query('//div[@id="comic"]')->item(0); + $basenode = $xpath->query('//div[@id="comic"]|//img[contains(@class, "wp-post-image")]/..')->item(0); if ($basenode) { $article["content"] = $doc->saveHTML($basenode); diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 8d706c5af..ee15df8d3 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -128,6 +128,18 @@ final class SelfUrlPathTest extends TestCase { ); } + public function test_self_url_k(): void { + $_SERVER = []; + + $_SERVER["HTTP_HOST"] = "example.com"; + $_SERVER["REQUEST_URI"] = "/tt-rss/plugins/example/api/longpath/test.php/reader/api/0/stream/items/ids?n=1000&output=json&s=user/-/state/com.google/starred"; + + $this->assertEquals( + 'http://example.com/tt-rss', + Config::get_self_url(true) + ); + } + public function test_get_self_dir(): void { $this->assertEquals( dirname(__DIR__), # we're in (app)/tests/ |