diff --git a/versions/3_3_0-7/alpine/apache/php b/versions/3_3_0-7/alpine/apache/php new file mode 120000 index 00000000..d1bdc9df --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php @@ -0,0 +1 @@ +php73 \ No newline at end of file diff --git a/versions/3_3_0-7/alpine/apache/php73/.env b/versions/3_3_0-7/alpine/apache/php73/.env new file mode 100644 index 00000000..86e19f0d --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/.env @@ -0,0 +1,27 @@ +# Set your journal Tag: +COMPOSE_PROJECT_NAME=journal +PROJECT_DOMAIN=journal.localhost +SERVERNAME=$PROJECT_DOMAIN + +# Warning: Dockerfile is not taking this variable yet. +# OJS_BRANCH=ojs-stable-3_1_2-0 + +# IMPORTANT: Set a non used port. +HTTP_PORT=8081 +HTTPS_PORT=8481 +ADMINER_HTTP=9081 + +# Remember this to fill your installation form in a clean installatio +# MYSQL_VERSION=10.3 +MYSQL_ROOT_PASSWORD=root +MYSQL_USER=ojs +MYSQL_PASSWORD=ojs +MYSQL_DATABASE=ojs + +# OJS variables +OJS_CLI_INSTALL=0 +OJS_DB_HOST=db +OJS_DB_DRIVER=mysqli +OJS_DB_USER=ojs +OJS_DB_PASSWORD=ojs +OJS_DB_NAME=ojs diff --git a/versions/3_3_0-7/alpine/apache/php73/Dockerfile b/versions/3_3_0-7/alpine/apache/php73/Dockerfile new file mode 100644 index 00000000..d67501aa --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/Dockerfile @@ -0,0 +1,137 @@ +FROM alpine:3.11 + +LABEL maintainer="Public Knowledge Project " + +WORKDIR /var/www/html + +ENV COMPOSER_ALLOW_SUPERUSER=1 \ + SERVERNAME="localhost" \ + HTTPS="on" \ + OJS_VERSION=3_3_0-7 \ + OJS_CLI_INSTALL="0" \ + OJS_DB_HOST="localhost" \ + OJS_DB_USER="ojs" \ + OJS_DB_PASSWORD="ojs" \ + OJS_DB_NAME="ojs" \ + OJS_WEB_CONF="/etc/apache2/conf.d/ojs.conf" \ + OJS_CONF="/var/www/html/config.inc.php" + + +# PHP_INI_DIR to be symmetrical with official php docker image +ENV PHP_INI_DIR /etc/php/7.3 + +# When using Composer, disable the warning about running commands as root/super user +ENV COMPOSER_ALLOW_SUPERUSER=1 + +# Basic packages +ENV PACKAGES \ + apache2 \ + apache2-ssl \ + apache2-utils \ + ca-certificates \ + curl \ + ttf-freefont \ + dcron \ + patch \ + php7 \ + php7-apache2 \ + runit \ + supervisor + +# PHP extensions +ENV PHP_EXTENSIONS \ + php7-bcmath \ + php7-bz2 \ + php7-calendar \ + php7-ctype \ + php7-curl \ + php7-dom \ + php7-exif \ + php7-fileinfo \ + php7-ftp \ + php7-gettext \ + php7-intl \ + php7-iconv \ + php7-json \ + php7-mbstring \ + php7-mysqli \ + php7-opcache \ + php7-openssl \ + php7-pdo_mysql \ + php7-phar \ + php7-posix \ + php7-session \ + php7-shmop \ + php7-simplexml \ + php7-sockets \ + php7-sysvmsg \ + php7-sysvsem \ + php7-sysvshm \ + php7-tokenizer \ + php7-xml \ + php7-xmlreader \ + php7-xmlwriter \ + php7-zip \ + php7-zlib + +# Required to build OJS: +ENV BUILDERS \ + git \ + nodejs \ + npm + +# To make a smaller image, we start with the copy. +# This let us joining runs in a single layer. +COPY exclude.list /tmp/exclude.list + +RUN set -xe \ + && apk add --no-cache --virtual .build-deps $BUILDERS \ + && apk add --no-cache $PACKAGES \ + && apk add --no-cache $PHP_EXTENSIONS \ +# Building OJS: + # Configure and download code from git + && git config --global url.https://.insteadOf git:// \ + && git config --global advice.detachedHead false \ + && git clone --depth 1 --single-branch --branch $OJS_VERSION --progress https://github.com/pkp/ojs.git . \ + && git submodule update --init --recursive >/dev/null \ + # Composer vudu: + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer.phar \ + # To avoid timeouts with gitHub we use tokens: + # TODO: Replace personal token by an official one. + # && composer.phar config -g github-oauth.github.com 58778f1c172c09f3add6cb559cbadd55de967d47 \ + # Install Composer Deps: + && composer.phar --working-dir=lib/pkp install --no-dev \ + && composer.phar --working-dir=plugins/paymethod/paypal install --no-dev \ + && composer.phar --working-dir=plugins/generic/citationStyleLanguage install --no-dev \ + # Node joins to the party: + && npm install -y && npm run build \ +# Create directories + && mkdir -p /var/www/files /run/apache2 /run/supervisord/ \ + && cp config.TEMPLATE.inc.php config.inc.php \ + && chown -R apache:apache /var/www/* \ +# Prepare freefont for captcha + && ln -s /usr/share/fonts/TTF/FreeSerif.ttf /usr/share/fonts/FreeSerif.ttf \ +# Prepare crontab + && echo "0 * * * * ojs-run-scheduled" | crontab - \ +# Prepare httpd.conf + && sed -i -e '\##,\##d' /etc/apache2/httpd.conf \ + && sed -i -e "s/^ServerSignature.*/ServerSignature Off/" /etc/apache2/httpd.conf \ +# Clear the image (list of files to be deleted in exclude.list). + && cd /var/www/html \ + && rm -rf $(cat /tmp/exclude.list) \ + && apk del --no-cache .build-deps \ + && rm -rf /tmp/* \ + && rm -rf /root/.cache/* \ +# Some folders are not required (as .git .travis.yml test .gitignore .gitmodules ...) + && find . -name ".git" -exec rm -Rf '{}' \; \ + && find . -name ".travis.yml" -exec rm -Rf '{}' \; \ + && find . -name "test" -exec rm -Rf '{}' \; \ + && find . \( -name .gitignore -o -name .gitmodules -o -name .keepme \) -exec rm -Rf '{}' \; + +COPY root/ / + +EXPOSE 80 443 + +VOLUME [ "/var/www/files", "/var/www/html/public" ] + +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"] diff --git a/versions/3_3_0-7/alpine/apache/php73/docker-compose-local.yml b/versions/3_3_0-7/alpine/apache/php73/docker-compose-local.yml new file mode 100644 index 00000000..3aad4f41 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/docker-compose-local.yml @@ -0,0 +1,57 @@ +# File: docker-compose.yml +# Access via "http://localhost:8081" +# +# Call example: +# $ docker-compose up + +version: "3.6" + +networks: + inside: + external: false + +services: + db: + image: mariadb:10.2 +# env_file: +# - .env + container_name: "ojs_db_${COMPOSE_PROJECT_NAME:-demo}" + environment: + MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD:-ojsPwd}" + MYSQL_DATABASE: "${MYSQL_DATABASE:-ojs}" + MYSQL_USER: "${MYSQL_USER:-ojs}" + MYSQL_PASSWORD: "${MYSQL_PASSWORD:-ojsPwd}" +# volumes: +# - ./volumes/db:/var/lib/mysql +# - ./volumes/logs/db:/var/log/mysql +# - ./volumes/config/db.charset.conf:/etc/mysql/conf.d/charset.cnf +# - ./volumes/migration:/docker-entrypoint-initdb.d + networks: + - inside + restart: always + + ojs: + image: local/ojs:3_3_0-7 +# env_file: +# - .env + container_name: "ojs_app_${COMPOSE_PROJECT_NAME:-demo}" + hostname: "${COMPOSE_PROJECT_NAME:-demo}" + restart: always + ports: + - "${HTTP_PORT:-8080}:80" + - "${HTTPS_PORT:-443}:443" +# volumes: +# - /etc/localtime:/etc/localtime +# - ./volumes/private:/var/www/files +# - ./volumes/public:/var/www/html/public +# - ./volumes/logs/app:/var/log/apache2 +# # WARNING: You can only enable file-volumes if file exists in the container. +# - ./volumes/config/ojs.config.inc.php:/var/www/html/config.inc.php +# - ./volumes/config/apache.htaccess:/var/www/html/.htaccess +# - ./volumes/php.custom.ini:/usr/local/etc/php/conf.d/custom.ini + + networks: + - inside + depends_on: + - db + restart: always diff --git a/versions/3_3_0-7/alpine/apache/php73/docker-compose.yml b/versions/3_3_0-7/alpine/apache/php73/docker-compose.yml new file mode 100644 index 00000000..394899be --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/docker-compose.yml @@ -0,0 +1,57 @@ +# File: docker-compose.yml +# Access via "http://localhost:8081" +# +# Call example: +# $ docker-compose up + +version: "3.6" + +networks: + inside: + external: false + +services: + db: + image: mariadb:10.2 +# env_file: +# - .env + container_name: "ojs_db_${COMPOSE_PROJECT_NAME:-demo}" + environment: + MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD:-ojsPwd}" + MYSQL_DATABASE: "${MYSQL_DATABASE:-ojs}" + MYSQL_USER: "${MYSQL_USER:-ojs}" + MYSQL_PASSWORD: "${MYSQL_PASSWORD:-ojsPwd}" +# volumes: +# - ./volumes/db:/var/lib/mysql +# - ./volumes/logs/db:/var/log/mysql +# - ./volumes/config/db.charset.conf:/etc/mysql/conf.d/charset.cnf +# - ./volumes/migration:/docker-entrypoint-initdb.d + networks: + - inside + restart: always + + ojs: + image: pkpofficial/ojs:3_3_0-7 +# env_file: +# - .env + container_name: "ojs_app_${COMPOSE_PROJECT_NAME:-demo}" + hostname: "${COMPOSE_PROJECT_NAME:-demo}" + restart: always + ports: + - "${HTTP_PORT:-8080}:80" + - "${HTTPS_PORT:-443}:443" +# volumes: +# - /etc/localtime:/etc/localtime +# - ./volumes/private:/var/www/files +# - ./volumes/public:/var/www/html/public +# - ./volumes/logs/app:/var/log/apache2 +# # WARNING: You can only enable file-volumes if file exists in the container. +# - ./volumes/config/ojs.config.inc.php:/var/www/html/config.inc.php +# - ./volumes/config/apache.htaccess:/var/www/html/.htaccess +# - ./volumes/php.custom.ini:/usr/local/etc/php/conf.d/custom.ini + + networks: + - inside + depends_on: + - db + restart: always diff --git a/versions/3_3_0-7/alpine/apache/php73/exclude.list b/versions/3_3_0-7/alpine/apache/php73/exclude.list new file mode 100644 index 00000000..56c72402 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/exclude.list @@ -0,0 +1,96 @@ +.babelrc +.editorconfig +.eslintignore +.eslintrc.js +.git +.openshift +.postcssrc.js +.scrutinizer.yml +.travis.yml +/root/.composer +/root/.npm +/usr/local/bin/composer +/var/cache/apk/* +babel.config.js +cypress +dbscripts/xml/data/locale/en_US/sample.xml +dbscripts/xml/data/sample.xml +docs/dev +lib/pkp/.git +lib/pkp/cypress +lib/pkp/js/lib/pnotify/build-tools +lib/pkp/lib/components/*.css +lib/pkp/lib/components/*.js +lib/pkp/lib/swordappv2/.git +lib/pkp/lib/swordappv2/.git +lib/pkp/lib/swordappv2/test +lib/pkp/lib/vendor/alex198710/pnotify/.git +lib/pkp/lib/vendor/ezyang/htmlpurifier/smoketests/ +lib/pkp/lib/vendor/ezyang/htmlpurifier/tests/ +lib/pkp/lib/vendor/michelf/php-markdown/test +lib/pkp/lib/vendor/adodb/adodb-php/.git +lib/pkp/lib/vendor/nikic/fast-route/test/ +lib/pkp/lib/vendor/oyejorge/less.php/test +lib/pkp/lib/vendor/phpmailer/phpmailer/test/ +lib/pkp/lib/vendor/pimple/pimple/ext/pimple/tests/ +lib/pkp/lib/vendor/pimple/pimple/src/Pimple/Tests/ +lib/pkp/lib/vendor/robloach/component-installer/tests/ +lib/pkp/lib/vendor/robloach/component-installer/tests/ComponentInstaller/Test/ +lib/pkp/lib/vendor/sebastian +lib/pkp/lib/vendor/symfony/process/Tests/ +lib/pkp/lib/vendor/symfony/translation/Tests/ +lib/pkp/plugins/*/*/tests +lib/pkp/tests +lib/pkp/tools/travis +lib/pkp/tools/travis +lib/ui-library +node_modules +package-lock.json +package.json +plugins/*/*/tests +plugins/auth/ldap +plugins/blocks/relatedItems +plugins/generic/announcementFeed +plugins/generic/backup +plugins/generic/browse +plugins/generic/citationStyleLanguage/lib/vendor/citation-style-language/locales/.git +plugins/generic/citationStyleLanguage/lib/vendor/guzzle/guzzle/tests/ +plugins/generic/citationStyleLanguage/lib/vendor/guzzle/guzzle/tests/Guzzle/Tests/ +plugins/generic/citationStyleLanguage/lib/vendor/satooshi/php-coveralls/tests/ +plugins/generic/citationStyleLanguage/lib/vendor/seboettg/citeproc-php/tests/ +plugins/generic/citationStyleLanguage/lib/vendor/seboettg/collection/tests/ +plugins/generic/citationStyleLanguage/lib/vendor/symfony/config/Tests/ +plugins/generic/citationStyleLanguage/lib/vendor/symfony/config/Tests/ +plugins/generic/citationStyleLanguage/lib/vendor/symfony/console/Tests/ +plugins/generic/citationStyleLanguage/lib/vendor/symfony/debug/ +plugins/generic/citationStyleLanguage/lib/vendor/symfony/event-dispatcher/Tests/ +plugins/generic/citationStyleLanguage/lib/vendor/symfony/filesystem/Tests/ +plugins/generic/citationStyleLanguage/lib/vendor/symfony/stopwatch/Tests/ +plugins/generic/citationStyleLanguage/lib/vendor/symfony/yaml/Tests/ +plugins/generic/coins +plugins/generic/cookiesAlert +plugins/generic/counter +plugins/generic/customLocale +plugins/generic/externalFeed +plugins/generic/lucene +plugins/generic/phpMyVisites +plugins/generic/recommendBySimilarity +plugins/generic/translator +plugins/importexport/duracloud +plugins/importexport/sample +plugins/oaiMetadataFormats/jats +plugins/paymethod/paypal/vendor/guzzle/guzzle/docs/ +plugins/paymethod/paypal/vendor/guzzle/guzzle/tests/ +plugins/paymethod/paypal/vendor/guzzle/guzzle/tests/Guzzle/Tests/ +plugins/paymethod/paypal/vendor/omnipay/common/tests/ +plugins/paymethod/paypal/vendor/omnipay/paypal/tests/ +plugins/paymethod/paypal/vendor/symfony/event-dispatcher/ +plugins/paymethod/paypal/vendor/symfony/http-foundation/Tests/ +plugins/reports/subscriptions +tests +tools/buildpkg.sh +tools/genLocaleReport.sh +tools/genTestLocale.php +tools/test +vue.config.js +webpack.config.js diff --git a/versions/3_3_0-7/alpine/apache/php73/root/etc/apache2/conf.d/ojs.conf b/versions/3_3_0-7/alpine/apache/php73/root/etc/apache2/conf.d/ojs.conf new file mode 100644 index 00000000..14d664bb --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/root/etc/apache2/conf.d/ojs.conf @@ -0,0 +1,51 @@ + +# Load modules +LoadModule slotmem_shm_module modules/mod_slotmem_shm.so +LoadModule rewrite_module modules/mod_rewrite.so +LoadModule expires_module modules/mod_expires.so + + + ServerName www.example.com + DocumentRoot /var/www/html + + RewriteEngine on + AcceptPathInfo On + + Options FollowSymLinks + AllowOverride all + Allow from all + + # This removes index.php from the url + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php/$1 [QSA,L] + + + ErrorLog /var/log/apache2/error.log + CustomLog /var/log/apache2/access.log combined + + + ServerName www.example.com + DocumentRoot /var/www/html + + SSLEngine on + SSLCertificateFile /etc/ssl/apache2/server.pem + SSLCertificateKeyFile /etc/ssl/apache2/server.key + + PassEnv HTTPS + RewriteEngine on + AcceptPathInfo On + + Options FollowSymLinks + AllowOverride all + Allow from all + + # This removes index.php from the url + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php/$1 [QSA,L] + + + ErrorLog /var/log/apache2/error.log + CustomLog /var/log/apache2/access.log combined + diff --git a/versions/3_3_0-7/alpine/apache/php73/root/etc/php7/conf.d/0-ojs.ini b/versions/3_3_0-7/alpine/apache/php73/root/etc/php7/conf.d/0-ojs.ini new file mode 100644 index 00000000..348f970b --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/root/etc/php7/conf.d/0-ojs.ini @@ -0,0 +1,23 @@ +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; +post_max_size = 30M + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +file_uploads = On +upload_max_filesize = 50M + +;;;;;;;;;;;;;;;;;;; +; opcache ; +;;;;;;;;;;;;;;;;;;; +opcache_memory_consumption = 512 +opcache_interned_strings_buffer = 8 +opcache_max_accelerated_files = 4000 +opcache_revalidate_freq = 60 +opcache_fast_shutdown = 1 +opcache_max_file_size = 0 +opcache_enable_cli = 1 \ No newline at end of file diff --git a/versions/3_3_0-7/alpine/apache/php73/root/etc/supervisord.conf b/versions/3_3_0-7/alpine/apache/php73/root/etc/supervisord.conf new file mode 100644 index 00000000..708151a9 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/root/etc/supervisord.conf @@ -0,0 +1,19 @@ +[supervisord] +nodaemon=true +loglevel=info +pidfile=/run/supervisord/supervisord.pid +logfile=/var/log/supervisord.log + +[supervisorctl] +serverurl=unix:///tmp/supervisor.sock + +[program:checkstart] +command=/usr/local/bin/ojs-pre-start + +[program:crond] +command=/usr/sbin/crond -f -L /var/log/cron/cron.log +autorestart=true + +[program:apache] +command=/usr/sbin/httpd -f /etc/apache2/httpd.conf -DFOREGROUND +autorestart=true diff --git a/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-cli-install b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-cli-install new file mode 100755 index 00000000..d4f42516 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-cli-install @@ -0,0 +1,11 @@ +#!/bin/sh + +echo "[OJS CLI Install] First time running this container, preparing..." +echo "127.0.0.1 $SERVERNAME" >> /etc/hosts + +echo "[OJS CLI Install] Calling the install using pre-defined variables..." + +# For php 5: +curl "http://${SERVERNAME}/index/install/install" --data "installing=0&adminUsername=admin&adminPassword=admin&adminPassword2=admin&adminEmail=admin%40${SERVERNAME}.org&locale=en_US&additionalLocales%5B%5D=en_US&clientCharset=utf-8&connectionCharset=utf8&databaseCharset=utf8&filesDir=%2Fvar%2Fwww%2Ffiles&databaseDriver=mysql&databaseHost=${OJS_DB_HOST}&databaseUsername=${OJS_DB_USER}&databasePassword=${OJS_DB_PASSWORD}&databaseName=${OJS_DB_NAME}&oaiRepositoryId=${SERVERNAME}&enableBeacon=0" --compressed + +echo "[OJS CLI Install] DONE!" diff --git a/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-migrate b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-migrate new file mode 100644 index 00000000..d7a83168 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-migrate @@ -0,0 +1,39 @@ +#!/bin/sh + +echo "[OJS Migrate] Changing to installed off" +sed -i '/^installed/c\installed = Off' $OJS_CONF + +echo "Checking migration folders and files..." +if [ -d "/var/www/files/migration/private" && \ + -d "/var/www/files/migration/public" && \ + -f "/var/www/files/migration/db/dump.sql ]; then + + echo "Checking versions..." + php /var/www/html/tools/upgrade.php check + + echo "Check former information..." + read -r -p "Are you sure you want to UPGRADE? [y/N] " response + if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]] + then + echo "[OJS Upgrade] Upgrading..." + php /var/www/html/tools/upgrade.php check + + echo "[OJS Upgrade] Changing to installed on" + sed -i '/^installed/c\installed = On' $OJS_CONF + + echo "[OJS Upgrade] Upgrade is done, please check the log and restart the container." + else + echo "UPGRADE canceled -> Recovering former state." + echo "Changing to installed on" + sed -i '/^installed/c\installed = On' $OJS_CONF + + echo "[OJS Upgrade] Upgrade was cancelled." + fi +else + echo "Migration folders are missing..." + echo "The following folders and files are required to perform the migration:" + echo "- ./volumes/private/migration/dump.sql: A mysqldump of your database (with utf8 encoding)." + echo "- ./volumes/private/migration/public: A copy of your public folder (with all the files)." + echo "- ./volumes/private/migration/private: A copy of your private folder (with the public files)." + echo "If the folders and files exist, check if the private volume is uncommented in your docker-compose.yml" +fi diff --git a/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-patch b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-patch new file mode 100755 index 00000000..da27771c --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-patch @@ -0,0 +1,43 @@ +#!/bin/sh + +WEB_ROOT_PATH="/var/www" +PATCH_LIST_FILE="${WEB_ROOT_PATH}/files/patch.list" + +# Gets the commit from the url, takes it as a patch and applies is the ojs root folder. +# $1: The full url of a gitHub/gitLab commit. +applyPatch() { + cd "${WEB_ROOT_PATH}/html" + echo " Patching from: ${1}" + wget ${1}.patch -O tmp.patch + patch -p1 < tmp.patch + rm tmp.patch + return +} + +main() { + echo "[OJS Patch] Apply a patch to your OJS..." + + if [ ${1} ]; then + echo "Patching a single commit." + applyPatch ${1} + echo "[OJS Patch] DONE!" + else + if [ -f "${PATCH_LIST_FILE}" ]; then + + echo "Patching with a list of commits from a file list." + echo "(List found at: $PATCH_LIST_FILE)" + + # As far as we won't have bash: old fashion while. + while read patchItem + do + applyPatch $patchItem + done < $PATCH_LIST_FILE + + echo "[OJS Patch] DONE!" + else + echo "No parameters and no patch.list file found." + fi + fi +} + +main $@ diff --git a/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-pre-start b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-pre-start new file mode 100755 index 00000000..652ea3a2 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-pre-start @@ -0,0 +1,23 @@ +#!/bin/sh + +KEY_PATH="/etc/ssl/apache2/server.key" +PEM_PATH="/etc/ssl/apache2/server.pem" + +echo "[OJS Pre-Start] Enforcing configs..." + +sed -i -e "s/www.example.com/${SERVERNAME}/g" $OJS_WEB_CONF +sed -i -e "s/^#ServerName.*/ServerName ${SERVERNAME}/" /etc/apache2/httpd.conf +sed -i -e "s/restful_urls = Off/restful_urls = On/g" $OJS_CONF +sed -i -e "s/enable_cdn = On/enable_cdn = Off/g" $OJS_CONF + +# Generate a cert based on ServerName +if [ ! -f $KEY_PATH ] || + [[ `openssl x509 -in $PEM_PATH -noout -subject | cut -d '/' -f2-` == *$SERVERNAME* ]]; then + echo "[OJS Pre-Start] Generating certs ..." + openssl req -x509 -nodes -days 1460 -newkey rsa:2048 -keyout $KEY_PATH -out $PEM_PATH -subj "/CN=$SERVERNAME/" +fi + +if [[ ${OJS_CLI_INSTALL} == "1" ]] && + grep -q 'installed = Off' $OJS_CONF ; then + ojs-cli-install +fi diff --git a/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-run-scheduled b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-run-scheduled new file mode 100755 index 00000000..37590777 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-run-scheduled @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "[OJS runScheduledTasks] running..." +php /var/www/html/tools/runScheduledTasks.php diff --git a/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-upgrade b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-upgrade new file mode 100755 index 00000000..48a24396 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-upgrade @@ -0,0 +1,17 @@ +#!/bin/sh + +echo "[OJS Upgrade] Changing to installed off" +#Workarround, to avoid issues if config is a volume: +cp $OJS_CONF /tmp/config.inc.php +sed -i '/^installed/c\installed = Off' /tmp/config.inc.php +cp -f /tmp/config.inc.php $OJS_CONF + +echo "[OJS Upgrade] Upgrading..." +php /var/www/html/tools/upgrade.php upgrade + +echo "[OJS Upgrade] Changing to installed on" +cp $OJS_CONF /tmp/config.inc.php +sed -i '/^installed/c\installed = On' $OJS_CONF +cp -f /tmp/config.inc.php $OJS_CONF + +echo "[OJS Upgrade] Upgrade is done, please restart the container." diff --git a/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-variable b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-variable new file mode 100755 index 00000000..bb675888 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/root/usr/local/bin/ojs-variable @@ -0,0 +1,14 @@ +#!/bin/sh + +echo "[OJS Variables] Set variable value in config.inc.php" +echo " Variable: [${1}]" +echo " New value: [${2}]" +echo " config file: $OJS_CONF" + +#Workarround, to avoid issues when config is a volume: +cp $OJS_CONF /tmp/config.inc.php +sed -i -e "s/^${1} =.*/${1} = ${2}/" /tmp/ojs.config.inc.php +sed -i '/^installed/c\installed = Off' /tmp/config.inc.php +cp -f /tmp/config.inc.php $OJS_CONF + +echo "[OJS Variable] Variable set." diff --git a/versions/3_3_0-7/alpine/apache/php73/volumes/config/README b/versions/3_3_0-7/alpine/apache/php73/volumes/config/README new file mode 100644 index 00000000..7922c850 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/volumes/config/README @@ -0,0 +1 @@ +Folder to keep persistent your CONFIG files (uncomment the volume files in docker-compose.yml) diff --git a/versions/3_3_0-7/alpine/apache/php73/volumes/db/README b/versions/3_3_0-7/alpine/apache/php73/volumes/db/README new file mode 100644 index 00000000..1f9d766c --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/volumes/db/README @@ -0,0 +1 @@ +Folder to keep persistent your DB files (uncomment the volume docker-compose.yml) diff --git a/versions/3_3_0-7/alpine/apache/php73/volumes/logs/app/README b/versions/3_3_0-7/alpine/apache/php73/volumes/logs/app/README new file mode 100644 index 00000000..53431440 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/volumes/logs/app/README @@ -0,0 +1 @@ +Folder to map and keep persistent your web logs (uncomment the volume docker-compose.yml) diff --git a/versions/3_3_0-7/alpine/apache/php73/volumes/logs/db/README b/versions/3_3_0-7/alpine/apache/php73/volumes/logs/db/README new file mode 100644 index 00000000..36537831 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/volumes/logs/db/README @@ -0,0 +1 @@ +Folder to keep persistent your DB logs (uncomment the volume docker-compose.yml) diff --git a/versions/3_3_0-7/alpine/apache/php73/volumes/private/README b/versions/3_3_0-7/alpine/apache/php73/volumes/private/README new file mode 100644 index 00000000..99935247 --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/volumes/private/README @@ -0,0 +1 @@ +Folder to keep persistent your PRIVATE files (uncomment the volume in docker-compose.yml) diff --git a/versions/3_3_0-7/alpine/apache/php73/volumes/public/README b/versions/3_3_0-7/alpine/apache/php73/volumes/public/README new file mode 100644 index 00000000..5273516f --- /dev/null +++ b/versions/3_3_0-7/alpine/apache/php73/volumes/public/README @@ -0,0 +1 @@ +Folder to keep persistent your PUBLIC files (uncomment the volume docker-compose.yml)