Update for publishing (#3)

Signed-off-by: Ryan McCue <me@ryanmccue.info>
This commit is contained in:
Ryan McCue 2025-06-06 17:24:42 +02:00 committed by GitHub
parent 3e7bc6e67b
commit 2e5edf7103
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 103 additions and 11 deletions

View file

@ -1,19 +1,13 @@
# Server
This is the overarching repo for the code deployed to our development server, running at https://beta.web-pub.org/
## Accessing
During development, the beta environment is protected with Basic authentication. The credentials are:
* **Username**: `openwebff`
* **Password**: `wither-nodding-dues-morals-splat`
This is the overarching repo for the code deployed to our hosted server, running at https://fair.pm/
## Local Development
This repository is pre-configured with wp-env configuration. You can set up a local environment using:
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.
@ -26,7 +20,7 @@ npx @wordpress/env start
## Deployment
Deployment will eventually be automatic, but in the meantime, you can run `bin/deploy.sh`. This will synchronize the `content/` directory to the server using rsync.
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.
To ignore files from deployment, specify them in `.distignore`.

21
index.php Normal file
View file

@ -0,0 +1,21 @@
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which tells WordPress to load the theme.
*
* @package WordPress
*
* DO NOT EDIT THIS FILE.
*
* phpcs:disable PSR1.Files.SideEffects
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );

77
wp-config.php Normal file
View file

@ -0,0 +1,77 @@
<?php
/**
* Main config file.
*
* Configuration should go into .config instead of here.
*
* phpcs:disable PSR1.Files.SideEffects
*/
// Load an escape hatch early load file, if it exists.
if ( is_readable( __DIR__ . '/.config/load-early.php' ) ) {
include_once __DIR__ . '/.config/load-early.php';
}
// Load the plugin API (like add_action etc) early, so everything loaded
// via the Composer autoloaders can using actions.
require_once __DIR__ . '/wordpress/wp-includes/plugin.php';
// Load the whole autoloader very early, this will also include
// all `autoload.files` from all modules.
require_once __DIR__ . '/vendor/autoload.php';
// Ready to go.
do_action( 'fairserver.loaded_autoloader' );
// Load the regular configuration.
if ( file_exists( __DIR__ . '/.config/load.php' ) ) {
require_once __DIR__ . '/.config/load.php';
}
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/wordpress/' );
}
if ( ! defined( 'WP_CONTENT_DIR' ) ) {
define( 'WP_CONTENT_DIR', __DIR__ . '/content' );
}
if ( ! defined( 'WP_CONTENT_URL' ) ) {
$protocol = ! empty( $_SERVER['HTTPS'] ) ? 'https' : 'http';
define( 'WP_CONTENT_URL', $protocol . '://' . $_SERVER['HTTP_HOST'] . '/content' );
}
if ( ! defined( 'WP_INITIAL_INSTALL' ) || ! WP_INITIAL_INSTALL ) {
// Multisite is always enabled, unless some spooky
// early loading code tried to change that of course.
if ( ! defined( 'MULTISITE' ) ) {
define( 'MULTISITE', true );
}
}
if ( ! isset( $table_prefix ) ) {
$table_prefix = getenv( 'TABLE_PREFIX' ) ?: 'wp_';
}
/*
* DB constants are expected to be provided by other modules, as they are
* environment specific.
*/
$required_constants = [
'DB_HOST',
'DB_NAME',
'DB_USER',
'DB_PASSWORD',
];
foreach ( $required_constants as $constant ) {
if ( ! defined( $constant ) ) {
http_response_code( 500 );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
die( "$constant constant is not defined." );
}
}
if ( ! getenv( 'WP_PHPUNIT__TESTS_CONFIG' ) ) {
require_once ABSPATH . 'wp-settings.php';
}