Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
a7e762b
move yoast/wordpress-seo-premium from require to suggest
chuckadams Nov 18, 2025
415c18f
fair/fair-plugin -> fairpm/fair-plugin
chuckadams Nov 18, 2025
0d51ceb
initial docker config (not yet working)
chuckadams Nov 18, 2025
a95bd28
initial bedrock-based version
chuckadams Nov 20, 2025
5afe81c
add bedrock-autoloader.php to version control
chuckadams Nov 20, 2025
780f7b2
uploads/.gitkeep -> uploads/.gitignore
chuckadams Nov 20, 2025
0fe6b3a
simplify roots/bedrock-disallow-indexing plugin, rm admin notice
chuckadams Nov 22, 2025
0d841ae
set wp_ db prefix and MULTISITE by default
chuckadams Nov 22, 2025
cbbcd9a
add apcu and sqlite3 to platform deps
chuckadams Nov 22, 2025
2d96816
Merge remote-tracking branch 'origin/main' into dockerize
chuckadams Nov 22, 2025
857cc27
add plugin: fairpm/mini-fair-repo
chuckadams Nov 22, 2025
d2e54d7
zap unused or non-vendored plugins and themes
chuckadams Nov 22, 2025
fede941
add vendored and local plugins
chuckadams Nov 22, 2025
5117eb2
fix config for WP_CONTENT_URL
chuckadams Dec 8, 2025
dafd87a
composer require oscarotero/env
chuckadams Dec 8, 2025
313b0cb
install wp-cli and ext-gmp in base image
chuckadams Dec 8, 2025
3efe07d
copy .env.example to .env if necessary
chuckadams Dec 8, 2025
24dfb6b
set MYSQL_DATABASE to wordpress
chuckadams Dec 9, 2025
7d52494
add db port mapping example to override file
chuckadams Dec 9, 2025
10b6d05
aspiredev.org -> local.dev.fair.pm
chuckadams Dec 9, 2025
9c703af
site url is now https://site.local.dev.fair.pm
chuckadams Dec 9, 2025
de3fea0
point caddy at root /app/web
chuckadams Dec 9, 2025
d8125a2
fix path in root index.php
chuckadams Dec 9, 2025
f501b74
fix WP_HOME in .env.example
chuckadams Dec 9, 2025
4aef106
enable healthchecks for db, mount config files in container
chuckadams Dec 9, 2025
c98c1df
add fixup-db-snapshot script
chuckadams Dec 9, 2025
b889e82
fix site_admins list in fixup-db-snapshot
chuckadams Dec 9, 2025
0c246c1
add rewrites to add /wp prefix for badly-behaved core
chuckadams Dec 9, 2025
d885616
run `frankenphp fmt` to shut caddy up about the all-important whitespace
chuckadams Dec 10, 2025
63c510e
add redis extension to docker image
chuckadams Dec 10, 2025
9a3eccc
minifair -> fair-beacon
chuckadams Dec 10, 2025
9494a7a
local.dev.fair.pm -> local.fair.pm
chuckadams Dec 10, 2025
17375ac
drop the 'site.' prefix from local.fair.pm
chuckadams Dec 10, 2025
63042b0
make fixup on wp_site/wp_blogs less silly
chuckadams Dec 10, 2025
c93ab24
add meta/bin/scrape
chuckadams Dec 10, 2025
8302d79
add wpackagist-plugin/fastly 1.2
chuckadams Dec 11, 2025
45d07ef
add some security headers to Caddyfile
chuckadams Dec 28, 2025
3f67e8e
fixup domains in wp_blogs
chuckadams Jan 3, 2026
6940a4a
set plugin activations in fixup-db-snapshot
chuckadams Jan 3, 2026
238caec
use HostRegexp in traefik routers to match subdomains
chuckadams Jan 3, 2026
8291179
add ignored plugin files
chuckadams Jan 3, 2026
991ec4c
adjust themes gitignore
chuckadams Jan 3, 2026
1651e32
add f-gu-filter plugin
chuckadams Jan 3, 2026
149e637
only add cachebuster if $mirror_url is initially 404
chuckadams Jan 4, 2026
3d6ca27
rm moved and unused files
chuckadams Jan 7, 2026
25ced95
add a couple extra settings to php.local.ini
chuckadams Jan 7, 2026
a758d05
add object-cache.php (not sure if location is right)
chuckadams Jan 7, 2026
0d5a3a8
bump
chuckadams Jan 7, 2026
48b17ef
use new build-and-push script for container builds
chuckadams Jan 7, 2026
08b90e0
bump beacon
chuckadams Jan 7, 2026
06db7f8
drop unused aspire-net network
chuckadams Jan 10, 2026
5476aa3
Merge branch 'main' into dockerize
chuckadams Jan 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ignore everything by default
*

# copy these directories
!bin/
!docker/fairpm-wordpress

# copy these files
!.env
!README.md
!composer.json
!composer.lock

15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,json,yml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
18 changes: 18 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
DATABASE_URL='mysql://wp:password@fairpm-db:3306/wordpress'
DB_PREFIX='wp_'

WP_ENV='development'
WP_HOME='https://local.fair.pm'
WP_SITEURL="${WP_HOME}/wp"

# WP_DEBUG_LOG='/path/to/debug.log'

###> Do not remove this comment, and do not add anything under it, as it will be replaced on install <###
AUTH_KEY='generateme'
SECURE_AUTH_KEY='generateme'
LOGGED_IN_KEY='generateme'
NONCE_KEY='generateme'
AUTH_SALT='generateme'
SECURE_AUTH_SALT='generateme'
LOGGED_IN_SALT='generateme'
NONCE_SALT='generateme'
65 changes: 32 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ name: Build and push container

on:
push:
branches: [ main ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
tags: [ 'v*' ]

jobs:
build:
Expand All @@ -16,31 +12,34 @@ jobs:
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
run: bin/build.sh

- name: Build Summary
if: always()
run: |
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "- Commit: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
echo "- Branch: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
echo "- Status: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY

- name: Upload build artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs
path: /tmp/fairserver-build/
retention-days: 7
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Build and push
run: bin/build-and-push
env:
DOCKERFILE: docker/fairpm-wordpress/Dockerfile
IMAGE_NAME: ${{ github.repository }}
TAG: ${{ github.event.release.tag_name }}
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

- name: Build Summary
if: always()
run: |
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "- Commit: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
echo "- Branch: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
echo "- Status: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY

- name: Upload build artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs
path: /tmp/fairserver-build/
retention-days: 7
45 changes: 25 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
.env.production
gp-data/
#### ignore all dotfiles and dot-dirs, with exceptions
.*
!.config/
!.distignore
!.dockerignore
!.editorconfig
!.env.example
!.gitattributes
!.gitignore

# Installed via Composer
content/mu-plugins/php-basic-auth/
content/plugins/aws-ses-wp-mail/
content/plugins/fair-plugin/
content/plugins/git-updater/
content/plugins/query-monitor/
content/plugins/wp-redis/
content/plugins/mini-fair-repo/
content/plugins/aspireexplorer/
content/plugins/public-post-preview/
content/plugins/wordpress-seo/
content/plugins/wordpress-seo-premium/
content/themes/fair-parent-theme/
content/plugins/fair-beacon/
content/plugins/glotpress-wp/
content/plugins/s3-uploads/
vendor/
wordpress/
#### ignore these patterns
*.bak
*.log
*.tmp
*.local
*.local.*
*.secret
*.secret.*

#### ignore these specific directories
/gp-data/
/vendor/

#### ignore these specific files
auth.json
docker-compose.override.yml
30 changes: 12 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
# Server
# fair.pm web site

This is the overarching repo for the code deployed to our hosted server, running at https://fair.pm/
This is the overarching repo for the code deployed to our hosted server, running at https://fair.pm/. It will eventually form a template repository for wordpress installations in general, but for now it's specifically configured for the fair.pm site.

## Quick Start for Local Development

## Local Development

This repository is pre-configured with wp-env configuration. (Better Docker Compose setup coming soon!)

You can set up a local environment using:

```sh
# First, install Composer dependencies.
composer install

# Then, start an environment.
npx @wordpress/env start
```
bin/init
bin/up
```

## Local Development

## Deployment
The fair.pm server is built on the [Roots Bedrock](https://roots.io/bedrock/) distribution of WordPress, so all plugins and themes are managed via Composer.

Deployment will eventually be automatic, but in the meantime, the infrastructure team needs to deploy the repository via Helm. Ping them when deployment is needed.
Local development is primarily based on Docker containers, using a FrankenPHP web server container for WordPress, with other support containers defined in `docker-compose.yml`. The default configuration is to expose the server through Traefik at https://local.fair.pm (which always resolves to localhost), but local ports can be used instead by renaming the `docker-compose.override.example.yml` file to `docker-compose.override.yml` and editing it to your needs.

To ignore files from deployment, specify them in `.distignore`.
## Deployment

TODO

## License

Licensed under the GNU General Public License, v2 or later. Copyright 2025 contributors.

Incorporates code from [WordPress/wordpress.org](https://github.com/WordPress/wordpress.org). Licensed under the GNU General Public License, v2 or later. Copyright 2025 contributors.
Incorporates code from [WordPress](https://github.com/WordPress/wordpress.org) and [Roots Bedrock](https://github.com/roots/bedrock). Licensed under the GNU General Public License, v2 or later. Copyright 2025 contributors.
37 changes: 37 additions & 0 deletions bin/build-and-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# shellcheck disable=SC2086

set -euxo pipefail

here=$(dirname "$0")
cd "$here/.."

image=${IMAGE_NAME?required argument missing}
dockerfile=${DOCKERFILE:-Dockerfile}
tag=${TAG:-$(git describe --tags --abbrev=0)}
platform=${PLATFORM:-linux/amd64,linux/arm64}
target=${TARGET:-prod}

registry=${REGISTRY:-ghcr.io}
username=${REGISTRY_USERNAME:-required-but-ignored-on-ghcr}
password=${REGISTRY_PASSWORD:-${GITHUB_TOKEN:-}}

main () {
push_arg=''

if [[ -n ${password:-} ]]; then
echo "$password" | docker login "$registry" -u "$username" --password-stdin
push_arg='--push'
fi

docker buildx build \
--file "$dockerfile" \
--target "$target" \
--platform "$platform" \
--tag "ghcr.io/$image:$tag" \
--tag "ghcr.io/$image:latest" \
$push_arg \
.
}

main "$@"
50 changes: 0 additions & 50 deletions bin/build.sh

This file was deleted.

58 changes: 0 additions & 58 deletions bin/container/Dockerfile

This file was deleted.

Loading