This is our custom fork of phpBB, for running the language forum site.
Your code contributions are welcome!
Bug reports are always welcome!
If you want to propose a code change, here are a few principles:
First, create a fork of this repository using the "Fork" button on the upper right. Then, check out your fork, substituting the appropriate username below:
# Insert your own username here.
git git@github.com:$MY_GITHUB_NAME/phpbb.git
# Switch to the newly-created directory, and check out the correct
# branch, along with any submodules:
cd phpbb
git checkout custom
git submodule update --init
# Create an upstream branch so that you can access the main repo later:
git remote add upstream git@github.com:language-learners/phpbb.git
Now, create a branch for the feature you want to add:
# Make sure we base our branch off the latest `custom`.
git checkout custom
git pull upstream custom
# Create a new branch and check it out.
git checkout -b cool_extension
# Push a copy of our new branch to our personal repo.
git push -u origin cool_extension
Now you can go ahead and make any changes you want. See below for
instructions on using docker-compose
to run a local copy of the site.
Some notes about preparing pull requests:
custom
.README.md
file (unless you're actually submitting
improvements).When your branch looks good, you can run:
git push origin cool_extension
...and then go to GitHub and create a pull request based off the upstream
custom
branch.
The recommended way to run the site locally is to install docker
and
docker-compose
, which will allow you to run code inside "containers",
which are sort of like lightweight virtual machines. This will allow you
to hack on the code without manually installing PHP, MySQL, and a bunch of
different extensions and libraries.
You can get Docker from the official site. Mac and Windows users should probably try using Docker Toolbox, which provides all the necessary command-line tools plus a GUI.
Assuming you have working copies of docker
and docker-compose
, and that
your system supports a Unix-like Terminal with git
, you can run the
following commands:
# Check out the source code from GitHub and switch into the source
# directory before running the setup commands, if you haven't already done
# so following the steps above.
git clone https://github.com/language-learners/phpbb.git
cd phpbb
# Check out our custom branch (or substitute the name our feature branch),
# if you haven't already done so.
git checkout custom
git submodule update --init
# Install the PHP packages required to run the site, and make sure the
# database exists. You generally only need to do this once, unless we
# upgrade phpBB.
docker-compose run --rm setup
# Start up the database and the site.
docker-compose up site
If the docker-compose
command is missing, or unable to find a working
copy of docker
, then please consult your Docker Toolbox or other Docker
setup instructions, particularly the part about getting the command-line
tools correctly configured. You may be told to run something like:
eval "$(docker-machine env default)"
From here, you can visit http://localhost:8000/ and finish the phpBB install process. Fill in the following:
You will be asked to install a config.php
file. This goes in the phpBB
subdirectory of the repository, and you'll need to run:
chmod a+r phpBB/config.php
Once this is done, unfortunately, you'll be asked to remove phpBB/install
directory from phpBB. To temporarily get rid of phpBB/install
, run:
rm -r phpBB/install/
Before checking your changes in, you can run the following command to
restore the deleted phpBB/install
:
git checkout phpBB/install
This requires being a site admin with server access. But you can do it as follows, if you run a secure machine where your environment variables are not vulnerable.
Before starting, make sure that all your local changes are properly commited.
# One-time setup. (We'll make this better.)
(cd deploy && bundle install)
# Specify where to deploy to.
export DEPLOY_HOST=foo.com DEPLOY_USER=bar
# Leading space required to omit password from shell history.
export DEPLOY_PASSWORD=CorrectHorseBatteryStaple
# Run the deploy.
deploy/deploy-site
The deploy is deliberately slowed down. Once it's done, it will update the
deployed
branch to point to the version of the code that it just deployed.