Commit ff442dec authored by Fabio Montefuscolo's avatar Fabio Montefuscolo

update wordpress and add fallbacks for security tokens on wp-config

parent 98fd4833
......@@ -5,7 +5,7 @@ RUN curl -s -o wp-cli.phar 'https://raw.githubusercontent.com/wp-cli/builds/gh-p
&& chmod +x wp-cli.phar \
&& mv wp-cli.phar /usr/local/bin/wp
RUN wp core download --path=/var/www/html/ --version=4.6 --locale=pt_BR --allow-root
RUN wp core download --path=/var/www/html/ --version=4.6.1 --locale=pt_BR --allow-root
COPY htaccess /var/www/html/.htaccess
COPY wp-config.php /var/www/html/wp-config.php
......@@ -19,6 +19,10 @@ RUN chown -R wordpress:root /var/www/html/ \
RUN mkdir -p /docker-entrypoint-extra/
COPY docker-entrypoint.sh /entrypoint.sh
# `wp-cli --help` will use cat
ENV PAGER /bin/cat
RUN echo "alias wp='/usr/local/bin/wp --allow-root'" >> /root/.bashrc
EXPOSE 80 443
ENTRYPOINT ["/entrypoint.sh"]
CMD ["apache2-foreground"]
<?php
define('DB_USER', getenv('DB_USER') ?: 'wordpress');
define('DB_NAME', getenv('DB_NAME') ?: 'wordpress');
define('DB_PASSWORD', getenv('DB_PASSWORD') ?: 'wordpress');
define('DB_HOST', getenv('DB_HOST') ?: 'mysql');
define('DB_CHARSET', getenv('WORDPRESS_DB_CHARSET') ?: 'utf8');
define('DB_COLLATE', getenv('WORDPRESS_DB_COLLATE') ?: '');
define('DB_USER', getenv('DB_USER') ?: 'wordpress');
define('DB_NAME', getenv('DB_NAME') ?: 'wordpress');
define('DB_PASSWORD', getenv('DB_PASSWORD') ?: 'wordpress');
define('DB_HOST', getenv('DB_HOST') ?: 'mysql');
define('DB_CHARSET', getenv('DB_CHARSET') ?: 'utf8');
define('DB_COLLATE', getenv('DB_COLLATE') ?: '');
define('AUTH_KEY', getenv('WORDPRESS_AUTH_KEY') ?: 'secret');
define('SECURE_AUTH_KEY', getenv('WORDPRESS_SECURE_AUTH_KEY') ?: 'secret');
define('LOGGED_IN_KEY', getenv('WORDPRESS_LOGGED_IN_KEY') ?: 'secret');
define('NONCE_KEY', getenv('WORDPRESS_NONCE_KEY') ?: 'secret');
define('AUTH_SALT', getenv('WORDPRESS_AUTH_SALT') ?: 'secret');
define('SECURE_AUTH_SALT', getenv('WORDPRESS_SECURE_AUTH_SALT') ?: 'secret');
define('LOGGED_IN_SALT', getenv('WORDPRESS_LOGGED_IN_SALT') ?: 'secret');
define('NONCE_SALT', getenv('WORDPRESS_NONCE_SALT') ?: 'secret');
define('AUTH_KEY', getenv('AUTH_KEY') ?: hash('sha256', DB_USER.DB_NAME.DB_PASSWORD.DB_HOST));
define('SECURE_AUTH_KEY', getenv('SECURE_AUTH_KEY') ?: hash('sha256', AUTH_KEY));
define('LOGGED_IN_KEY', getenv('LOGGED_IN_KEY') ?: hash('sha256', SECURE_AUTH_KEY));
define('NONCE_KEY', getenv('NONCE_KEY') ?: hash('sha256', LOGGED_IN_KEY));
define('AUTH_SALT', getenv('AUTH_SALT') ?: hash('sha256', NONCE_KEY));
define('SECURE_AUTH_SALT', getenv('SECURE_AUTH_SALT') ?: hash('sha256', AUTH_SALT));
define('LOGGED_IN_SALT', getenv('LOGGED_IN_SALT') ?: hash('sha256', SECURE_AUTH_SALT));
define('NONCE_SALT', getenv('NONCE_SALT') ?: hash('sha256', LOGGED_IN_SALT));
$table_prefix = getenv('WORDPRESS_TABLE_PREFIX') ?: 'wp_';
define('WP_DEBUG', getenv('WORDPRESS_WP_DEBUG') === 'true');
define('WP_DEBUG_LOG', getenv('WORDPRESS_WP_DEBUG_LOG') === 'true');
define('WP_DEBUG_DISPLAY', getenv('WORDPRESS_WP_DEBUG_DISPLAY') === 'true');
define('FS_METHOD', getenv('FS_METHOD') ?: 'direct');
$table_prefix = getenv('TABLE_PREFIX') ?: 'wp_';
define('WP_DEBUG', getenv('WP_DEBUG') === 'true');
define('WP_DEBUG_LOG', getenv('WP_DEBUG_LOG') === 'true');
define('WP_DEBUG_DISPLAY', getenv('WP_DEBUG_DISPLAY') === 'true');
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
$_SERVER['HTTPS']='on';
if(getenv('HTTPS') === 'on') {
$_SERVER['HTTPS'] = 'on';
}
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) {
$_SERVER['HTTPS'] = 'on';
}
require_once(ABSPATH . 'wp-settings.php');
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment