diff --git a/.github/Dockerfile b/.github/Dockerfile index b27db718..3d78a0c9 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -20,7 +20,7 @@ RUN go get -d -v github.com/mailhog/mhsendmail \ ## #FROM jt-base AS base -FROM ghcr.io/joomlatools/jt-base:latest AS base +FROM ghcr.io/joomlatools/jt-base:latest AS build # Set arg defaults ARG DEBIAN_FRONTEND=noninteractive @@ -37,7 +37,10 @@ RUN apt-get install -y --no-install-recommends sudo # Install MySQL COPY ./config/s6/mysql-init.d /etc/mysql-init.d/ COPY ./config/mysql /etc/mysql/ -RUN apt-get install -y --no-install-recommends mysql-server php8.1-mysql php8.1-mysqli +RUN apt-get install -y --no-install-recommends mysql-server php8.1-mysql php8.1-mysqli php8.1-gd && \ + rm -rf /var/lib/mysql && \ + /bin/bash -e /var/scripts/apt_clean.sh && \ + /bin/bash -e /var/scripts/apt_purge.sh; # Install Console COPY ./config/console /root/.joomlatools/console/ @@ -48,26 +51,10 @@ COPY ./config/folioshell /root/.foliolabs/folioshell/ # Install jtctl COPY ./bin/jtctl /usr//bin/jtctl -## -# Stage: build -## -FROM scratch AS build - -ENV APP_DATA=/srv/www \ - APP_ROOT=/var/www \ - APP_VOLUME=/mnt/www \ - APP_USER=www-data - -# Copy all from build -COPY --from=base / . - # Copy mhsendmail from the builder COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/bin/mhsendmail RUN chmod +x /usr/bin/mhsendmail -# Remove copied files -RUN rm -rf $APP_ROOT/* - # Remove services RUN rm -rf /usr/bin/apache_exporter RUN rm -rf /usr/bin/php-fpm_exporter @@ -91,9 +78,6 @@ RUN rm /etc/services.d/fastcgi/down RUN rm /etc/services.d/file/down RUN rm /etc/services.d/phpfpm/down -# Remove MySQL default databas -RUN rm -rf /var/lib/mysql - # Clean up apt cache and temp files to save disk space RUN /bin/bash -e /var/scripts/apt_clean.sh; RUN /bin/bash -e /var/scripts/apt_purge.sh; @@ -112,7 +96,4 @@ ENV APP_DATA=/srv/www \ ENV COMPOSER_ALLOW_SUPERUSER=1 \ COMPOSER_HOME=/tmp \ - COMPOSER_NO_DEV=1 - -# App -COPY --chown=$APP_USER:$APP_USER ./ $APP_ROOT \ No newline at end of file + COMPOSER_NO_DEV=1 \ No newline at end of file diff --git a/config/composer.json b/config/composer.json deleted file mode 100755 index 9c36ba58..00000000 --- a/config/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "joomlatools/server", - "type": "project", - "homepage": "https://github.com/joomlatools/joomlatools-server", - "authors": [ - { - "name": "Johan Janssens", - "email": "johan@janssens.me", - "homepage": "http://about.me/johanjanssens" - }, - { - "name": "Timble", - "email": "info@timble.net", - "homepage": "http://www.timble.net" - } - ], - "require": { - "phpmailer/phpmailer": "^6.5", - "michelf/php-markdown": "^1.9", - "voku/html-min": "^4.0", - "matthiasmullie/minify": "^1.3", - "foliolabs/folioshell": "dev-feature/10-refactor as 1.1.x-dev", - "joomlatools/console": "dev-master as 1.6.x-dev", - "joomlatools/framework": "dev-master as 3.5.x-dev", - "joomlatools/pages": "dev-master as 0.22.x-dev" - } -} diff --git a/config/composer.stub b/config/composer.stub deleted file mode 100644 index 8b137891..00000000 --- a/config/composer.stub +++ /dev/null @@ -1 +0,0 @@ - diff --git a/config/composer/pages.json b/config/composer/pages.json new file mode 100755 index 00000000..78142c75 --- /dev/null +++ b/config/composer/pages.json @@ -0,0 +1,10 @@ +{ + "require": { + "phpmailer/phpmailer": "^6.5", + "michelf/php-markdown": "^1.9", + "voku/html-min": "^4.0", + "matthiasmullie/minify": "^1.3", + "joomlatools/framework": "dev-master as 3.5.x-dev", + "joomlatools/pages": "dev-master as 0.22.x-dev" + } +} diff --git a/config/composer/shell.json b/config/composer/shell.json new file mode 100755 index 00000000..1de60c6a --- /dev/null +++ b/config/composer/shell.json @@ -0,0 +1,6 @@ +{ + "require": { + "foliolabs/folioshell": "dev-feature/10-refactor as 1.1.x-dev", + "joomlatools/console": "dev-master as 1.6.x-dev" + } +} \ No newline at end of file diff --git a/config/koowa.php b/config/koowa.php deleted file mode 100755 index 2523a0c9..00000000 --- a/config/koowa.php +++ /dev/null @@ -1,21 +0,0 @@ - getenv('APP_ENV'), - 'script_name' => '', //remove index.php - - 'cache_path' => getenv('APP_VOLUME').'/sites/'.basename(PAGES_SITE_ROOT).'/cache', - 'log_path' => getenv('APP_VOLUME').'/sites/'.basename(PAGES_SITE_ROOT).'/log', - 'extension_path' => [ - KOOWA_VENDOR.'/joomlatools/pages/contrib/extensions/sentry', - KOOWA_ROOT.'/extensions' - ], - - 'http_cache' => getenv('APP_CACHE') !== false ? filter_var(getenv('APP_CACHE'), FILTER_VALIDATE_BOOLEAN) : true, - 'http_cache_time' => '1week', - 'http_cache_time_browser' => '1day', - - 'http_client_cache' => getenv('APP_CACHE') !== false ? filter_var(getenv('APP_CACHE'), FILTER_VALIDATE_BOOLEAN) : true, - - //'page_cache_validation' => filter_var(getenv('APP_CACHE'), FILTER_VALIDATE_BOOLEAN), - //'template_cache_validation' => filter_var(getenv('APP_CACHE'), FILTER_VALIDATE_BOOLEAN), - //'data_cache_validation' => filter_var(getenv('APP_CACHE'), FILTER_VALIDATE_BOOLEAN), - - //See: https://www.owasp.org/index.php/OWASP_Secure_Headers_Project#xpcdp - 'headers' => [ - 'Strict-Transport-Security' => getenv('APP_ENV') == 'production' ? 'max-age=63072000;' : null, - 'X-Xss-Protection' => '1; mode=block', - 'X-Frame-Options' => 'DENY', - 'Feature-Policy' => "camera 'none'; microphone 'none'", - 'Referrer-Policy' => 'strict-origin-when-cross-origin', - 'X-Permitted-Cross-Domain-Policies' => 'none', - 'Content-Security-Policy' => in_array(getenv('APP_ENV'), ['production', 'staging']) ? 'upgrade-insecure-requests' : null, - 'X-Content-Type-Options' => 'nosniff', - ], - - 'aliases' => [ - 'theme://' => 'base://theme/', - 'images://' => 'base://images/', - - 'assets://css/debugger' => 'https://files.joomlatools.com/joomlatools-framework/resources/assets/css/debugger', - 'assets://js/debugger' => 'https://files.joomlatools.com/joomlatools-framework/resources/assets/js/debugger', - ], - - 'extensions' => - [ - /** - * ext:sentry - */ - 'ext:sentry.config' => [ - 'options' => [ - 'environment' => getenv('SENTRY_ENVIRONMENT') ?: getenv('APP_ENV'), - 'traces_sample_rate' => getenv('SENTRY_TRACING') ?: 1.0, - ], - ], - - 'ext:sentry.template.helper.behavior' => [ - 'options' => [ - //'tunnel' => getenv('APP_ENV') != 'development' ? '/__sentry' : null, - ], - 'version' => '6.16.1', - ], - - 'ext:sentry.event.subscriber.exception' => [ - 'options' => [ - 'server_name' => gethostname(), - ] - ] - ]); \ No newline at end of file diff --git a/config/koowa/default.php b/config/vendor/koowa.php similarity index 69% rename from config/koowa/default.php rename to config/vendor/koowa.php index 891d4c78..e2bba067 100755 --- a/config/koowa/default.php +++ b/config/vendor/koowa.php @@ -1,6 +1,5 @@ '20', /* Locale */ - 'offset' => 'UTC', - 'language' => 'en-GB', + 'offset' => 'UTC', + 'language' => 'en-GB', - /* Mail */ + /* Mail */ 'mailer' => 'smtp', 'mailfrom' => 'norepl@localhost.home', 'fromname' => 'Joomlatools', @@ -23,10 +22,11 @@ 'smtpport' => '1025', 'smtpsecure' => 'none', - /* Cache */ - 'caching' => getenv('APP_CACHE') !== false ? filter_var( getenv('APP_CACHE') , FILTER_VALIDATE_BOOLEAN) : true, + /* Cache */ + 'caching' => getenv('APP_CACHE') !== false ? filter_var( getenv('APP_CACHE') , FILTER_VALIDATE_BOOLEAN) : true, 'lifetime' => '15', - /* Debug */ + /* Debug */ 'debug' => getenv('APP_DEBUG') !== false ? filter_var( getenv('APP_DEBUG') , FILTER_VALIDATE_BOOLEAN) : false, + 'secret' => getenv('APP_NONCE') ]; \ No newline at end of file diff --git a/config/vendor/pages.php b/config/vendor/pages.php new file mode 100644 index 00000000..8ca5011a --- /dev/null +++ b/config/vendor/pages.php @@ -0,0 +1,28 @@ + getenv('APP_ENV'), + 'script_name' => '', //remove index.php + + 'cache_path' => getenv('APP_VOLUME').'/sites/'.basename(PAGES_SITE_ROOT).'/cache', + 'log_path' => getenv('APP_VOLUME').'/sites/'.basename(PAGES_SITE_ROOT).'/log', + + 'http_cache' => getenv('APP_CACHE') !== false ? filter_var(getenv('APP_CACHE'), FILTER_VALIDATE_BOOLEAN) : true, + 'http_cache_time' => '1week', + 'http_cache_time_browser' => '1day', + + 'http_client_cache' => getenv('APP_CACHE') !== false ? filter_var(getenv('APP_CACHE'), FILTER_VALIDATE_BOOLEAN) : true, + + //'page_cache_validation' => filter_var(getenv('APP_CACHE'), FILTER_VALIDATE_BOOLEAN), + //'template_cache_validation' => filter_var(getenv('APP_CACHE'), FILTER_VALIDATE_BOOLEAN), + //'data_cache_validation' => filter_var(getenv('APP_CACHE'), FILTER_VALIDATE_BOOLEAN), + + 'aliases' => [ + 'theme://' => 'base://theme/', + 'images://' => 'base://images/', + + 'assets://css/debugger' => 'https://files.joomlatools.com/joomlatools-framework/resources/assets/css/debugger', + 'assets://js/debugger' => 'https://files.joomlatools.com/joomlatools-framework/resources/assets/js/debugger', + ], +); \ No newline at end of file