Skip to content
Snippets Groups Projects
Commit 43b20013 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

stuff

parent 62d8aa77
No related branches found
No related tags found
No related merge requests found
...@@ -24,21 +24,18 @@ RUN apt update && apt install -y --no-install-recommends \ ...@@ -24,21 +24,18 @@ RUN apt update && apt install -y --no-install-recommends \
&& sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \ && dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale \ && update-locale \
# Install php extensions # Install php extensions
&& docker-php-ext-configure gd --with-jpeg-dir --with-freetype-dir --with-webp-dir \ && docker-php-ext-configure gd --with-jpeg-dir --with-freetype-dir --with-webp-dir \
&& docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \ && docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \
&& pecl install memcached redis \ && pecl install memcached redis \
&& docker-php-ext-enable memcached redis \ && docker-php-ext-enable memcached redis \
# Cleanup # Cleanup
RUN docker-php-source delete \ RUN docker-php-source delete \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
&& apt-get autoclean -y \ && apt-get autoclean -y \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/* \
&& pecl clear-cache \ && pecl clear-cache \
# Enable PS in gs # Enable PS in gs
&& sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \ && sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \
/etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml
...@@ -19,19 +19,16 @@ RUN apt update && apt install -y --no-install-recommends \ ...@@ -19,19 +19,16 @@ RUN apt update && apt install -y --no-install-recommends \
libxml2-dev \ libxml2-dev \
libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \ libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \
locales \ locales \
# Install locales # Install locales
RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \ RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \
&& sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \ && dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale \ && update-locale \
# Install php extensions # Install php extensions
RUN docker-php-ext-configure gd --with-jpeg-dir --with-freetype-dir --with-webp-dir \ RUN docker-php-ext-configure gd --with-jpeg-dir --with-freetype-dir --with-webp-dir \
&& docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \ && docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \
&& pecl install memcached redis \ && pecl install memcached redis \
&& docker-php-ext-enable memcached redis \ && docker-php-ext-enable memcached redis \
# Cleanup # Cleanup
RUN docker-php-source delete \ RUN docker-php-source delete \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
...@@ -39,7 +36,6 @@ RUN docker-php-source delete \ ...@@ -39,7 +36,6 @@ RUN docker-php-source delete \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& pecl clear-cache \ && pecl clear-cache \
# Enable PS in gs # Enable PS in gs
RUN sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \ RUN sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \
/etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml
...@@ -19,19 +19,16 @@ RUN apt update && apt install -y --no-install-recommends \ ...@@ -19,19 +19,16 @@ RUN apt update && apt install -y --no-install-recommends \
libxml2-dev \ libxml2-dev \
libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \ libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \
locales \ locales \
# Install locales # Install locales
&& sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \
&& sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \ && dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale \ && update-locale \
# Install php extensions # Install php extensions
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \ && docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
&& docker-php-ext-install -j$(nproc) gd gettext intl opcache pdo_mysql pdo_pgsql soap xsl zip \ && docker-php-ext-install -j$(nproc) gd gettext intl opcache pdo_mysql pdo_pgsql soap xsl zip \
&& pecl install memcached redis \ && pecl install memcached redis \
&& docker-php-ext-enable memcached redis \ && docker-php-ext-enable memcached redis \
# Cleanup # Cleanup
&& docker-php-source delete \ && docker-php-source delete \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
...@@ -39,7 +36,6 @@ RUN apt update && apt install -y --no-install-recommends \ ...@@ -39,7 +36,6 @@ RUN apt update && apt install -y --no-install-recommends \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& pecl clear-cache \ && pecl clear-cache \
# Enable PS in gs # Enable PS in gs
RUN sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \ RUN sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \
/etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml
...@@ -19,27 +19,23 @@ RUN apt update && apt install -y --no-install-recommends \ ...@@ -19,27 +19,23 @@ RUN apt update && apt install -y --no-install-recommends \
libxml2-dev \ libxml2-dev \
libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \ libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \
locales \ locales \
# Install locales # Install locales
&& sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \
&& sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \ && dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale \ && update-locale \
# Install php extensions # Install php extensions
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \ && docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
&& docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip && docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip
&& pecl install memcached redis \ && pecl install memcached redis \
&& docker-php-ext-enable memcached redis \ && docker-php-ext-enable memcached redis \
# Cleanup # Cleanup
&& docker-php-source delete && docker-php-source delete \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
&& apt-get autoclean -y \ && apt-get autoclean -y \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& pecl clear-cache \ && pecl clear-cache \
# Enable PS in gs # Enable PS in gs
&& sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \ && sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \
/etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml
...@@ -20,19 +20,16 @@ RUN apt update && apt install -y --no-install-recommends \ ...@@ -20,19 +20,16 @@ RUN apt update && apt install -y --no-install-recommends \
libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \ libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \
locales \ locales \
vim \ vim \
# Install locales # Install locales
&& sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \
&& sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \ && dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale \ && update-locale \
# Install php extensions # Install php extensions
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \ && docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
&& docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \ && docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \
&& pecl install memcached redis \ && pecl install memcached redis \
&& docker-php-ext-enable memcached redis \ && docker-php-ext-enable memcached redis \
# Cleanup # Cleanup
&& docker-php-source delete \ && docker-php-source delete \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
...@@ -40,7 +37,6 @@ RUN apt update && apt install -y --no-install-recommends \ ...@@ -40,7 +37,6 @@ RUN apt update && apt install -y --no-install-recommends \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& pecl clear-cache \ && pecl clear-cache \
# Enable PS in gs # Enable PS in gs
&& sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \ && sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \
/etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml
...@@ -19,19 +19,16 @@ RUN apt update && apt install -y --no-install-recommends \ ...@@ -19,19 +19,16 @@ RUN apt update && apt install -y --no-install-recommends \
libxml2-dev \ libxml2-dev \
libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \ libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \
locales \ locales \
# Install locales # Install locales
&& sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \
&& sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \ && dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale \ && update-locale \
# Install php extensions # Install php extensions
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \ && docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
&& docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \ && docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \
&& pecl install memcached redis \ && pecl install memcached redis \
&& docker-php-ext-enable memcached redis \ && docker-php-ext-enable memcached redis \
# Cleanup # Cleanup
&& docker-php-source delete \ && docker-php-source delete \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
...@@ -39,7 +36,6 @@ RUN apt update && apt install -y --no-install-recommends \ ...@@ -39,7 +36,6 @@ RUN apt update && apt install -y --no-install-recommends \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& pecl clear-cache \ && pecl clear-cache \
# Enable PS in gs # Enable PS in gs
&& sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \ && sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \
/etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml
...@@ -21,19 +21,16 @@ RUN apt update \ ...@@ -21,19 +21,16 @@ RUN apt update \
libxml2-dev \ libxml2-dev \
locales \ locales \
libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \ libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \
# Install locales # Install locales
&& sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \
&& sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \ && dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale \ && update-locale \
# Install php extensions # Install php extensions
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \ && docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
&& docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \ && docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \
&& pecl install memcached redis \ && pecl install memcached redis \
&& docker-php-ext-enable memcached redis \ && docker-php-ext-enable memcached redis \
# Cleanup # Cleanup
&& docker-php-source delete \ && docker-php-source delete \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
...@@ -41,7 +38,6 @@ RUN apt update \ ...@@ -41,7 +38,6 @@ RUN apt update \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& pecl clear-cache \ && pecl clear-cache \
# Enable PS in gs \ # Enable PS in gs \
&& sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \ && sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \
/etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml
...@@ -22,13 +22,11 @@ RUN apt update \ ...@@ -22,13 +22,11 @@ RUN apt update \
libxml2-dev \ libxml2-dev \
locales \ locales \
libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \ libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \
# Install locales # Install locales
&& sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen \
&& sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \ && sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \ && dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale \ && update-locale \
# Install php extensions # Install php extensions
&& docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \ && docker-php-ext-configure gd --with-jpeg --with-freetype --with-webp \
&& docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \ && docker-php-ext-install -j$(nproc) gd gettext intl mysqli opcache pdo_mysql pdo_pgsql soap xsl zip \
...@@ -36,7 +34,6 @@ RUN apt update \ ...@@ -36,7 +34,6 @@ RUN apt update \
# && docker-php-ext-enable memcached redis xdebug \ # && docker-php-ext-enable memcached redis xdebug \
&& pecl install memcached redis \ && pecl install memcached redis \
&& docker-php-ext-enable memcached redis \ && docker-php-ext-enable memcached redis \
# Cleanup # Cleanup
&& docker-php-source delete \ && docker-php-source delete \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
...@@ -44,7 +41,6 @@ RUN apt update \ ...@@ -44,7 +41,6 @@ RUN apt update \
&& apt-get clean -y \ && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& pecl clear-cache \ && pecl clear-cache \
# Enable PS in gs # Enable PS in gs
&& sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \ && sed -r -i_bak 's/rights="none" pattern="([EX]?PS[23]*|PDF)"/rights="read | write" pattern="\1"/' \
/etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml
...@@ -57,6 +57,10 @@ final class Add extends Command ...@@ -57,6 +57,10 @@ final class Add extends Command
throw new Exception('Web path cannot be empty'); throw new Exception('Web path cannot be empty');
} }
if ($webPath === 'sites') {
throw new Exception("Web path 'sites' is prohibited");
}
if (array_key_exists($webPath, Config::getInstance()->get('sites') ?? [])) { if (array_key_exists($webPath, Config::getInstance()->get('sites') ?? [])) {
throw new Exception('Site "' . $webPath . '" already exists.'); throw new Exception('Site "' . $webPath . '" already exists.');
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace Studip\Dockerized\Commands\Sites; namespace Studip\Dockerized\Commands\Sites;
use Exception;
use Studip\Dockerized\Config; use Studip\Dockerized\Config;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
...@@ -27,6 +28,10 @@ final class Remove extends Command ...@@ -27,6 +28,10 @@ final class Remove extends Command
$config = Config::getInstance(); $config = Config::getInstance();
$sites = $config->get('sites') ?? []; $sites = $config->get('sites') ?? [];
if ($webPath === 'sites') {
throw new Exception("Web path 'sites' is prohibited");
}
if (!array_key_exists($webPath, $sites)) { if (!array_key_exists($webPath, $sites)) {
$io->error("The site '{$webPath}' does not exist."); $io->error("The site '{$webPath}' does not exist.");
return Command::FAILURE; return Command::FAILURE;
...@@ -42,7 +47,7 @@ final class Remove extends Command ...@@ -42,7 +47,7 @@ final class Remove extends Command
$config->store(); $config->store();
$io->success('Site ' . $webPath . ' has been removed.'); $io->success("Site '{$webPath}' has been removed.");
return Command::SUCCESS; return Command::SUCCESS;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment