mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge branch '3.2.x'
* 3.2.x: [ticket/14497] Do not check for doctype on index and use correct return [ticket/14497] Add test for visiting installer [ticket/14497] Use nginx sample config in travis tests [ticket/14497] Support second app.php script in install folder
This commit is contained in:
commit
a54b528bc6
3 changed files with 61 additions and 16 deletions
|
@ -62,7 +62,7 @@ http {
|
||||||
root /path/to/phpbb;
|
root /path/to/phpbb;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# phpbb uses index.htm
|
# phpBB uses index.htm
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
try_files $uri $uri/ @rewriteapp;
|
try_files $uri $uri/ @rewriteapp;
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,29 @@ http {
|
||||||
fastcgi_pass php;
|
fastcgi_pass php;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Correctly pass scripts for installer
|
||||||
|
location /install/ {
|
||||||
|
# phpBB uses index.htm
|
||||||
|
try_files $uri $uri/ @rewrite_installapp;
|
||||||
|
|
||||||
|
# Pass the php scripts to fastcgi server specified in upstream declaration.
|
||||||
|
location ~ \.php(/|$) {
|
||||||
|
# Unmodified fastcgi_params from nginx distribution.
|
||||||
|
include fastcgi_params;
|
||||||
|
# Necessary for php.
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||||
|
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
||||||
|
try_files $uri $uri/ /install/app.php$is_args$args;
|
||||||
|
fastcgi_pass php;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
location @rewrite_installapp {
|
||||||
|
rewrite ^(.*)$ /install/app.php/$1 last;
|
||||||
|
}
|
||||||
|
|
||||||
# Deny access to version control system directories.
|
# Deny access to version control system directories.
|
||||||
location ~ /\.svn|/\.git {
|
location ~ /\.svn|/\.git {
|
||||||
deny all;
|
deny all;
|
||||||
|
|
30
tests/functional/visit_installer_test.php
Normal file
30
tests/functional/visit_installer_test.php
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This file is part of the phpBB Forum Software package.
|
||||||
|
*
|
||||||
|
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||||
|
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||||
|
*
|
||||||
|
* For full copyright and license information, please see
|
||||||
|
* the docs/CREDITS.txt file.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group functional
|
||||||
|
*/
|
||||||
|
class phpbb_functional_visit_installer_test extends phpbb_functional_test_case
|
||||||
|
{
|
||||||
|
public function test_visit_installer()
|
||||||
|
{
|
||||||
|
self::request('GET', 'install/', [], false);
|
||||||
|
$this->assertContains('<meta http-equiv="refresh" content="0; url=./app.php" />', $this->get_content());
|
||||||
|
|
||||||
|
self::request('GET', 'install/index.html', [], false);
|
||||||
|
$this->assertContains('<meta http-equiv="refresh" content="0; url=./app.php" />', $this->get_content());
|
||||||
|
|
||||||
|
self::request('GET', 'install/app.php');
|
||||||
|
$this->assertContains('installation system', $this->get_content());
|
||||||
|
}
|
||||||
|
}
|
|
@ -57,20 +57,12 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# nginx
|
# nginx
|
||||||
echo "
|
cat $DIR/../phpBB/docs/nginx.sample.conf \
|
||||||
server {
|
| sed "s/root \/path\/to\/phpbb/root $(echo $PHPBB_ROOT_PATH | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/g" \
|
||||||
listen 80;
|
| sed -e '1,/The actual board domain/d' \
|
||||||
root $PHPBB_ROOT_PATH/;
|
| sed -e '/If running php as fastcgi/,$d' \
|
||||||
index index.php index.html;
|
| sed -e "s/fastcgi_pass php;/fastcgi_pass unix:$(echo $APP_SOCK | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g');/g" \
|
||||||
|
| sed -e 's/#listen 80/listen 80/' \
|
||||||
location ~ \.php {
|
| sudo tee $NGINX_CONF
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
|
||||||
fastcgi_param PATH_INFO \$fastcgi_path_info;
|
|
||||||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
|
|
||||||
fastcgi_pass unix:$APP_SOCK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
" | sudo tee $NGINX_CONF > /dev/null
|
|
||||||
|
|
||||||
sudo service nginx start
|
sudo service nginx start
|
||||||
|
|
Loading…
Add table
Reference in a new issue