Skip to content

Commit

Permalink
Merge pull request #29 from phpbb/update/area51-master
Browse files Browse the repository at this point in the history
Update area51 master branch to latest version
  • Loading branch information
marc1706 authored May 15, 2024
2 parents c093998 + 9a99f2c commit 6ad72f6
Show file tree
Hide file tree
Showing 1,000 changed files with 44,712 additions and 42,449 deletions.
20 changes: 20 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Debian version
ARG VARIANT="buster"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

# Install PHP
RUN apt-get -y update
RUN apt-get -y install php php-xml php-mbstring php-curl php-zip php-xdebug

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Install MySQL
RUN apt-get -y install mysql-server php-mysql

# Xdebug
ADD resources/xdebug.ini /etc/php/8.1/apache2/conf.d/xdebug.ini

# Configure Apache
RUN echo "Listen 8080" >> /etc/apache2/ports.conf && \
a2enmod rewrite
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/ubuntu
{
"name": "Ubuntu",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
"args": { "VARIANT": "ubuntu-22.04" }
},

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
"settings": {
// Allow Xdebug to listen to requests from remote (or container)
"remote.localPortHost": "allInterfaces"
},
//"devPort": {},
// Specify which VS Code extensions to install (List of IDs)
"extensions": ["xdebug.php-debug"]
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [80, 9003],

// Use 'postCreateCommand' to run commands after the container is created.
"postStartCommand": "bash .devcontainer/resources/setup.sh",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"github-cli": "latest"
}
}
38 changes: 38 additions & 0 deletions .devcontainer/resources/phpbb-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
installer:
admin:
name: admin
password: adminadmin
email: [email protected]

board:
lang: en
name: My Board
description: My amazing new phpBB board

database:
dbms: mysqli
dbhost: 127.0.0.1
dbport: 3306
dbuser: phpbb
dbpasswd: phpbb
dbname: phpbb
table_prefix: phpbb_

email:
enabled: false
smtp_delivery : ~
smtp_host: ~
smtp_port: ~
smtp_auth: ~
smtp_user: ~
smtp_pass: ~

server:
cookie_secure: false
server_protocol: http://
force_server_vars: false
server_name: localhost
server_port: 80
script_path: /

extensions: []
44 changes: 44 additions & 0 deletions .devcontainer/resources/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# setup.sh
# Commands to install and configure phpBB

# Start MySQL
echo "[Codespaces] Start MySQL"
sudo service mysql start

# Start Apache
echo "[Codespaces] Start Apache"
sudo service apache2 start

# Add SSH key
echo "[Codespaces] Add SSH key"
echo "$SSH_KEY" > /home/vscode/.ssh/id_rsa && chmod 600 /home/vscode/.ssh/id_rsa

# Create a MySQL user to use
echo "[Codespaces] Create MySQL user"
sudo mysql -u root<<EOFMYSQL
CREATE USER 'phpbb'@'localhost' IDENTIFIED BY 'phpbb';
GRANT ALL PRIVILEGES ON *.* TO 'phpbb'@'localhost' WITH GRANT OPTION;
CREATE DATABASE IF NOT EXISTS phpbb;
EOFMYSQL

# Download dependencies
echo "[Codespaces] Install Composer dependencies"
composer install --no-interaction

# Symlink the webroot so it can be viewed
echo "[Codespaces] Create Symlink of webroot"
sudo rm -rf /var/www/html
sudo ln -s /workspaces/phpbb/phpBB /var/www/html

# Copy phpBB config
echo "[Codespaces] Copy phpBB configuration"
cp /workspaces/phpbb/.devcontainer/resources/phpbb-config.yml /workspaces/phpbb/phpBB/install/install-config.yml

# Install phpBB
echo "[Codespaces] Run phpBB CLI installation"
cd /workspaces/phpbb/phpBB && composer install --no-interaction
sudo php /workspaces/phpbb/phpBB/install/phpbbcli.php install /workspaces/phpbb/phpBB/install/install-config.yml
rm -rf /workspaces/phpbb/phpBB/install

# Finished
echo "[Codespaces] phpBB installation completed"
10 changes: 10 additions & 0 deletions .devcontainer/resources/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
zend_extension=xdebug.so

[xdebug]
xdebug.mode=develop,debug
xdebug.discover_client_host=1
xdebug.client_port=9003
xdebug.start_with_request=yes
xdebug.log='/var/log/xdebug/xdebug.log'
xdebug.connect_timeout_ms=2000
xdebug.idekey=VSCODE
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Checklist:

- [ ] Correct branch: master for new features; 3.3.x for fixes
- [ ] Tests pass
- [ ] Code follows coding guidelines: [master](https://area51.phpbb.com/docs/dev/master/development/coding_guidelines.html) and [3.3.x](https://area51.phpbb.com/docs/dev/3.3.x/development/coding_guidelines.html)
- [ ] Code follows coding guidelines: [master](https://area51.phpbb.com/docs/master/coding-guidelines.html) and [3.3.x](https://area51.phpbb.com/docs/dev/3.3.x/development/coding_guidelines.html)
- [ ] Commit follows commit message [format](https://area51.phpbb.com/docs/dev/3.3.x/development/git.html)

Tracker ticket (set the ticket ID to **your ticket ID**):
Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB3-12345
15 changes: 8 additions & 7 deletions .github/check-doctum-parse-errors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
set -e

if [ ! -f doctum.phar ]; then
# Download the latest (5.1.x) release if the file does not exist
# Download the latest (5.x.x) release if the file does not exist
# Remove it to update your phar
curl -O https://doctum.long-term.support/releases/5.1/doctum.phar
curl -O https://doctum.long-term.support/releases/5/doctum.phar
rm -f doctum.phar.sha256
curl -O https://doctum.long-term.support/releases/5.1/doctum.phar.sha256
curl -O https://doctum.long-term.support/releases/5/doctum.phar.sha256
sha256sum --strict --check doctum.phar.sha256
rm -f doctum.phar.sha256
# You can fetch the latest (5.1.x) version code here:
# https://doctum.long-term.support/releases/5.1/VERSION
chmod +x ./doctum.phar
# You can fetch the latest (5.x.x) version code here:
# https://doctum.long-term.support/releases/5/VERSION
fi
# Show the version to inform users of the script
php doctum.phar --version
php doctum.phar parse build/doctum-checkout.conf.php -v
./doctum.phar version --text
./doctum.phar parse build/doctum-checkout.conf.php -v
17 changes: 6 additions & 11 deletions travis/phing-sniff.sh → .github/check-js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@
# the docs/CREDITS.txt file.
#
set -e
set -x

DB=$1
TRAVIS_PHP_VERSION=$2
NOTESTS=$3
set +x

if [ "$NOTESTS" == '1' ]
then
cd build
../phpBB/vendor/bin/phing sniff
cd ..
fi
sudo npm install -g > /dev/null
npm ci > /dev/null
set -x
node_modules/eslint/bin/eslint.js "phpBB/**/*.js"
node_modules/eslint/bin/eslint.js "gulpfile.js"
2 changes: 1 addition & 1 deletion .github/setup-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ fi

if [ "$MYISAM" == '1' ]
then
mysql -h 127.0.0.1 -u root -e 'SET GLOBAL storage_engine=MyISAM;'
mysql -h 127.0.0.1 -u root -e 'SET GLOBAL default_storage_engine=MyISAM;'
fi
2 changes: 1 addition & 1 deletion .github/setup-ldap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ mkdir /var/tmp/slapd
cp .github/ldap/slapd.conf /var/tmp/slapd/slapd.conf
slapd -d 256 -d 128 -f /var/tmp/slapd/slapd.conf -h ldap://localhost:3389 &
sleep 3
ldapadd -h localhost:3389 -D "cn=admin,dc=example,dc=com" -w adminadmin -f .github/ldap/base.ldif
ldapadd -H ldap://localhost:3389 -D "cn=admin,dc=example,dc=com" -w adminadmin -f .github/ldap/base.ldif
5 changes: 0 additions & 5 deletions .github/setup-phpbb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,4 @@ fi

cd phpBB
php ../composer.phar install --dev --no-interaction
if [[ "$PHP_VERSION" =~ ^nightly$ || "$PHP_VERSION" =~ ^8 ]]
then
php ../composer.phar remove phpunit/dbunit --dev --update-with-dependencies \
&& php ../composer.phar require symfony/yaml:~4.4 misantron/dbunit:~5.0 phpunit/phpunit:^9.3 --dev --update-with-all-dependencies --ignore-platform-reqs
fi
cd ..
144 changes: 144 additions & 0 deletions .github/setup-sphinx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
#!/bin/bash
#
# 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.
#
set -e
set -x

sudo apt-get update
sudo apt-get install -q -y sphinxsearch

DIR=$(dirname "$0")

SPHINX_DAEMON_HOST="localhost"
SPHINX_DAEMON_PORT="9312"
SPHINX_CONF="$DIR/sphinx.conf"
SPHINX_DATA_DIR="/var/run/sphinxsearch"
SPHINX_LOG="$SPHINX_DATA_DIR/log/searchd.log"
SPHINX_QUERY_LOG="$SPHINX_DATA_DIR/log/sphinx-query.log"
ID="saw9zf2fdhp1goue" # Randomly generated via phpBB unique_id()

PHPBB_TEST_DBHOST="0.0.0.0"
PHPBB_TEST_DBNAME="phpbb_tests"
PHPBB_TEST_DBUSER="root"
PHPBB_TEST_DBPASSWD=""

sudo service sphinxsearch stop
sudo mkdir -p "$SPHINX_DATA_DIR/log"
sudo chown "sphinxsearch" "$SPHINX_DATA_DIR/log"

# Generate configuration file for Sphinx
echo "
source source_phpbb_${ID}_main
{
type = mysql # mysql or pgsql
sql_host = $PHPBB_TEST_DBHOST
sql_user = $PHPBB_TEST_DBUSER
sql_pass = $PHPBB_TEST_DBPASSWD
sql_db = $PHPBB_TEST_DBNAME
sql_port =
sql_query_pre = SET NAMES 'utf8'
sql_query_pre = UPDATE phpbb_sphinx SET max_doc_id = (SELECT MAX(post_id) FROM phpbb_posts) WHERE counter_id = 1
sql_query_range = SELECT MIN(post_id), MAX(post_id) FROM phpbb_posts
sql_range_step = 5000
sql_query = SELECT \
p.post_id AS id, \
p.forum_id, \
p.topic_id, \
p.poster_id, \
p.post_visibility, \
CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, \
p.post_time, \
p.post_subject, \
p.post_subject as title, \
p.post_text as data, \
t.topic_last_post_time, \
0 as deleted \
FROM phpbb_posts p, phpbb_topics t \
WHERE \
p.topic_id = t.topic_id \
AND p.post_id >= \$start AND p.post_id <= \$end
sql_query_post =
sql_query_post_index = UPDATE phpbb_sphinx SET max_doc_id = \$maxid WHERE counter_id = 1
sql_attr_uint = forum_id
sql_attr_uint = topic_id
sql_attr_uint = poster_id
sql_attr_uint = post_visibility
sql_attr_bool = topic_first_post
sql_attr_bool = deleted
sql_attr_timestamp = post_time
sql_attr_timestamp = topic_last_post_time
sql_attr_string = post_subject
}
source source_phpbb_${ID}_delta : source_phpbb_${ID}_main
{
sql_query_pre = SET NAMES 'utf8'
sql_query_range =
sql_range_step =
sql_query = SELECT \
p.post_id AS id, \
p.forum_id, \
p.topic_id, \
p.poster_id, \
p.post_visibility, \
CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, \
p.post_time, \
p.post_subject, \
p.post_subject as title, \
p.post_text as data, \
t.topic_last_post_time, \
0 as deleted \
FROM phpbb_posts p, phpbb_topics t \
WHERE \
p.topic_id = t.topic_id \
AND p.post_id >= ( SELECT max_doc_id FROM phpbb_sphinx WHERE counter_id=1 )
sql_query_post_index =
}
index index_phpbb_${ID}_main
{
path = $SPHINX_DATA_DIR/index_phpbb_${ID}_main
source = source_phpbb_${ID}_main
docinfo = extern
morphology = none
stopwords =
wordforms =
exceptions =
min_word_len = 2
charset_table = U+FF10..U+FF19->0..9, 0..9, U+FF41..U+FF5A->a..z, U+FF21..U+FF3A->a..z, A..Z->a..z, a..z, U+0149, U+017F, U+0138, U+00DF, U+00FF, U+00C0..U+00D6->U+00E0..U+00F6, U+00E0..U+00F6, U+00D8..U+00DE->U+00F8..U+00FE, U+00F8..U+00FE, U+0100->U+0101, U+0101, U+0102->U+0103, U+0103, U+0104->U+0105, U+0105, U+0106->U+0107, U+0107, U+0108->U+0109, U+0109, U+010A->U+010B, U+010B, U+010C->U+010D, U+010D, U+010E->U+010F, U+010F, U+0110->U+0111, U+0111, U+0112->U+0113, U+0113, U+0114->U+0115, U+0115, U+0116->U+0117, U+0117, U+0118->U+0119, U+0119, U+011A->U+011B, U+011B, U+011C->U+011D, U+011D, U+011E->U+011F, U+011F, U+0130->U+0131, U+0131, U+0132->U+0133, U+0133, U+0134->U+0135, U+0135, U+0136->U+0137, U+0137, U+0139->U+013A, U+013A, U+013B->U+013C, U+013C, U+013D->U+013E, U+013E, U+013F->U+0140, U+0140, U+0141->U+0142, U+0142, U+0143->U+0144, U+0144, U+0145->U+0146, U+0146, U+0147->U+0148, U+0148, U+014A->U+014B, U+014B, U+014C->U+014D, U+014D, U+014E->U+014F, U+014F, U+0150->U+0151, U+0151, U+0152->U+0153, U+0153, U+0154->U+0155, U+0155, U+0156->U+0157, U+0157, U+0158->U+0159, U+0159, U+015A->U+015B, U+015B, U+015C->U+015D, U+015D, U+015E->U+015F, U+015F, U+0160->U+0161, U+0161, U+0162->U+0163, U+0163, U+0164->U+0165, U+0165, U+0166->U+0167, U+0167, U+0168->U+0169, U+0169, U+016A->U+016B, U+016B, U+016C->U+016D, U+016D, U+016E->U+016F, U+016F, U+0170->U+0171, U+0171, U+0172->U+0173, U+0173, U+0174->U+0175, U+0175, U+0176->U+0177, U+0177, U+0178->U+00FF, U+00FF, U+0179->U+017A, U+017A, U+017B->U+017C, U+017C, U+017D->U+017E, U+017E, U+0410..U+042F->U+0430..U+044F, U+0430..U+044F, U+4E00..U+9FFF
ignore_chars = U+0027, U+002C
min_prefix_len = 3
min_infix_len = 0
html_strip = 1
index_exact_words = 0
blend_chars = U+23, U+24, U+25, U+26, U+40
}
index index_phpbb_${ID}_delta : index_phpbb_${ID}_main
{
path = $SPHINX_DATA_DIR/index_phpbb_${ID}_delta
source = source_phpbb_${ID}_delta
}
indexer
{
mem_limit = 512M
}
searchd
{
listen = $SPHINX_DAEMON_PORT
log = $SPHINX_LOG
query_log = $SPHINX_QUERY_LOG
read_timeout = 5
max_children = 30
pid_file = $SPHINX_DATA_DIR/searchd.pid
binlog_path = $SPHINX_DATA_DIR/
}
" > $SPHINX_CONF

sudo mv "$SPHINX_CONF" "/etc/sphinxsearch/sphinx.conf"
sudo sed -i "s/START=no/START=yes/g" "/etc/default/sphinxsearch"
sudo chmod 777 "/var/run/sphinxsearch"
Loading

0 comments on commit 6ad72f6

Please sign in to comment.