Merge pull request #2338 from pixelfed/staging

Staging
This commit is contained in:
daniel 2020-07-21 10:29:29 -06:00 committed by GitHub
commit 4886dd1fbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 58 deletions

View file

@ -21,7 +21,7 @@ class HashidService {
$shortcode = ''; $shortcode = '';
while($id) { while($id) {
$id = ($id - ($r = $id % $base)) / $base; $id = ($id - ($r = $id % $base)) / $base;
$shortcode = $cmap{$r} . $shortcode; $shortcode = $cmap[$r] . $shortcode;
}; };
return $shortcode; return $shortcode;
}); });

View file

@ -4,21 +4,23 @@ FROM php:7.4-apache-buster
COPY contrib/docker/php.production.ini "$PHP_INI_DIR/php.ini" COPY contrib/docker/php.production.ini "$PHP_INI_DIR/php.ini"
# Install Composer # Install Composer
ENV COMPOSER_VERSION 1.9.2 ENV COMPOSER_VERSION=1.10.9 \
ENV COMPOSER_HOME /var/www/.composer COMPOSER_HOME=/var/www/.composer \
COMPOSER_MEMORY_LIMIT=-1 \
PATH="~/.composer/vendor/bin:./vendor/bin:${PATH}"
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /var/www/
RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \ RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
&& curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \ && curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \
&& php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" \ && php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" \
&& php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --version=${COMPOSER_VERSION} && rm -rf /tmp/composer-setup.php && php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --version=${COMPOSER_VERSION} && rm -rf /tmp/composer-setup.php \
&& apt-get update \
# Update OS Packages && apt-get upgrade -y \
RUN apt-get update # && apt-get install -y --no-install-recommends apt-utils \
&& apt-get install -y --no-install-recommends \
# Install OS Packages
RUN apt-get install -y --no-install-recommends apt-utils
RUN apt-get install -y --no-install-recommends \
## Standard ## Standard
locales locales-all \ locales \
locales-all \
git \ git \
gosu \ gosu \
zip \ zip \
@ -33,47 +35,45 @@ RUN apt-get install -y --no-install-recommends \
## Image Processing ## Image Processing
libjpeg62-turbo-dev \ libjpeg62-turbo-dev \
libpng-dev \ libpng-dev \
libmagickwand-dev \
# Required for GD # Required for GD
libxpm4 \ libxpm4 \
libxpm-dev \ libxpm-dev \
libwebp6 \ libwebp6 \
libwebp-dev \ libwebp-dev \
## Video Processing ## Video Processing
ffmpeg ffmpeg \
## Database
# Update Local data # libpq-dev \
RUN sed -i '/en_US/s/^#//g' /etc/locale.gen && locale-gen && update-locale # libsqlite3-dev \
mariadb-client \
# Locales Update
&& sed -i '/en_US/s/^#//g' /etc/locale.gen \
&& locale-gen \
&& update-locale \
# Install PHP extensions # Install PHP extensions
RUN docker-php-source extract && docker-php-source extract \
#PHP Imagemagick extensions #PHP Imagemagick extensions
RUN apt-get install -y --no-install-recommends libmagickwand-dev && pecl install imagick \
RUN pecl install imagick && docker-php-ext-enable imagick \
RUN docker-php-ext-enable imagick
# PHP GD extensions # PHP GD extensions
RUN docker-php-ext-configure gd \ && docker-php-ext-configure gd \
--with-freetype \ --with-freetype \
--with-jpeg \ --with-jpeg \
--with-webp \ --with-webp \
--with-xpm --with-xpm \
RUN docker-php-ext-install -j$(nproc) gd && docker-php-ext-install -j$(nproc) gd \
#PHP Redis extensions #PHP Redis extensions
RUN pecl install redis && pecl install redis \
RUN docker-php-ext-enable redis && docker-php-ext-enable redis \
#PHP Database extensions #PHP Database extensions
RUN apt-get install -y --no-install-recommends libpq-dev libsqlite3-dev && docker-php-ext-install pdo_mysql \
RUN docker-php-ext-install pdo_mysql pdo_pgsql pdo_sqlite #pdo_pgsql pdo_sqlite \
#PHP extensions (dependencies) #PHP extensions (dependencies)
RUN docker-php-ext-configure intl && docker-php-ext-configure intl \
RUN docker-php-ext-install -j$(nproc) intl bcmath zip pcntl exif curl && docker-php-ext-install -j$(nproc) intl bcmath zip pcntl exif curl \
#APACHE Bootstrap #APACHE Bootstrap
RUN a2enmod rewrite remoteip \ && a2enmod rewrite remoteip \
&& {\ && {\
echo RemoteIPHeader X-Real-IP ;\ echo RemoteIPHeader X-Real-IP ;\
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
@ -81,26 +81,22 @@ RUN a2enmod rewrite remoteip \
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
echo SetEnvIf X-Forwarded-Proto "https" HTTPS=on ;\ echo SetEnvIf X-Forwarded-Proto "https" HTTPS=on ;\
} > /etc/apache2/conf-available/remoteip.conf \ } > /etc/apache2/conf-available/remoteip.conf \
&& a2enconf remoteip && a2enconf remoteip \
#Cleanup #Cleanup
RUN docker-php-source delete && docker-php-source delete \
RUN apt-get autoremove --purge -y && apt-get autoremove --purge -y \
RUN apt-get clean && apt-get clean \
RUN rm -rf /var/cache/apt && rm -rf /var/cache/apt \
RUN rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/
ENV PATH="~/.composer/vendor/bin:./vendor/bin:${PATH}"
COPY . /var/www/ COPY . /var/www/
WORKDIR /var/www/ # for detail why storage is copied this way, pls refer to https://github.com/pixelfed/pixelfed/pull/2137#discussion_r434468862
RUN cp -r storage storage.skel \
RUN cp -r storage storage.skel && composer global require hirak/prestissimo --prefer-dist --no-interaction --no-ansi --no-suggest \
RUN composer global require hirak/prestissimo --no-interaction --no-suggest --prefer-dist && composer install --prefer-dist --no-interaction --no-ansi --optimize-autoloader \
RUN composer install --prefer-dist --no-interaction --no-ansi --optimize-autoloader && composer update --prefer-dist --no-interaction --no-ansi \
RUN composer global remove hirak/prestissimo && composer global remove hirak/prestissimo --no-interaction --no-ansi \
RUN rm -rf html && ln -s public html && rm -rf html && ln -s public html
VOLUME /var/www/storage /var/www/bootstrap VOLUME /var/www/storage /var/www/bootstrap
CMD ["/var/www/contrib/docker/start.apache.sh"] CMD ["/var/www/contrib/docker/start.apache.sh"]

View file

@ -1,7 +1,7 @@
<nav class="navbar navbar-expand navbar-light navbar-laravel shadow-none border-bottom sticky-top py-1"> <nav class="navbar navbar-expand navbar-light navbar-laravel shadow-none border-bottom sticky-top py-1">
<div class="container"> <div class="container">
<a class="navbar-brand d-flex align-items-center" href="{{ route('timeline.personal') }}" title="Logo"> <a class="navbar-brand d-flex align-items-center" href="{{ route('timeline.personal') }}" title="Logo">
<img src="/img/pixelfed-icon-color.svg" height="30px" class="px-2" loading="eager"> <img src="/img/pixelfed-icon-color.svg" height="30px" class="px-2" loading="eager" alt="Pixelfed logo">
<span class="font-weight-bold mb-0 d-none d-sm-block" style="font-size:20px;">{{ config('app.name', 'pixelfed') }}</span> <span class="font-weight-bold mb-0 d-none d-sm-block" style="font-size:20px;">{{ config('app.name', 'pixelfed') }}</span>
</a> </a>
@ -65,6 +65,10 @@
<span class="fas fa-stream pr-2 text-lighter"></span> <span class="fas fa-stream pr-2 text-lighter"></span>
Local Local
</a> </a>
<a class="dropdown-item font-weight-bold" href="/i/stories/new">
<span class="fas fa-history text-lighter pr-2"></span>
Stories
</a>
{{-- <a class="dropdown-item font-weight-bold" href="#"> {{-- <a class="dropdown-item font-weight-bold" href="#">
<span class="fas fa-circle-notch pr-2 text-lighter"></span> <span class="fas fa-circle-notch pr-2 text-lighter"></span>
Circles Circles

View file

@ -1,7 +1,7 @@
<nav class="navbar navbar-expand navbar-light navbar-laravel shadow-none border-bottom sticky-top"> <nav class="navbar navbar-expand navbar-light navbar-laravel shadow-none border-bottom sticky-top">
<div class="container"> <div class="container">
<a class="navbar-brand d-flex align-items-center" href="{{ url('/') }}" title="{{ config('app.name', 'Laravel') }} Logo"> <a class="navbar-brand d-flex align-items-center" href="{{ url('/') }}">
<img src="/img/pixelfed-icon-color.svg" height="30px" class="px-2"> <img src="/img/pixelfed-icon-color.svg" height="30px" class="px-2" alt="Pixelfed logo">
<span class="font-weight-bold mb-0" style="font-size:20px;">{{ config('app.name', 'Laravel') }}</span> <span class="font-weight-bold mb-0" style="font-size:20px;">{{ config('app.name', 'Laravel') }}</span>
</a> </a>
</div> </div>