Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"permissions": {
"allow": [
"Bash(docker exec:*)",
"Bash(docker logs:*)",
"Bash(docker-compose:*)",
"Bash(docker volume rm:*)",
"Bash(composer install:*)"
],
"deny": [],
"ask": []
}
}
50 changes: 43 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,68 @@
version: '3.8'
services:
wordpress:
image: wordpress:latest
container_name: postsecret_wordpress
restart: always
restart: unless-stopped
ports:
- "8080:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
WP_HOME: http://localhost:8080
WP_SITEURL: http://localhost:8080
WORDPRESS_DEBUG: 1
WORDPRESS_CONFIG_EXTRA: |
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', true);
volumes:
- ./wp-content:/var/www/html/wp-content
- wordpress_data:/var/www/html
depends_on:
- db
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s

db:
image: mysql:5.7
image: mysql:8.0
container_name: postsecret_db
restart: always
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
MYSQL_RANDOM_ROOT_PASSWORD: '1'
MYSQL_ROOT_PASSWORD: rootpassword
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "wordpress", "-pwordpress"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s

phpmyadmin:
image: phpmyadmin:5.2
container_name: postsecret_phpmyadmin
restart: unless-stopped
ports:
- "8081:80"
environment:
PMA_HOST: db
PMA_USER: wordpress
PMA_PASSWORD: wordpress
UPLOAD_LIMIT: 100M
depends_on:
- db

volumes:
db_data:
wordpress_data:
2 changes: 2 additions & 0 deletions wp-content/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
// Silence is golden.
2 changes: 2 additions & 0 deletions wp-content/plugins/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
// Silence is golden.
13 changes: 13 additions & 0 deletions wp-content/plugins/postsecret-admin/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "postsecret/postsecret-admin",
"description": "Admin tools for managing the PostSecret archive",
"type": "wordpress-plugin",
"autoload": {
"psr-4": {
"PostSecret\\Admin\\": "src/"
}
},
"require": {
"php": ">=8.0"
}
}
33 changes: 33 additions & 0 deletions wp-content/plugins/postsecret-admin/vendor/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
* Simple PSR-4 autoloader for PostSecret Admin plugin
*/

spl_autoload_register(function ($class) {
// Project-specific namespace prefix
$prefix = 'PostSecret\\Admin\\';

// Base directory for the namespace prefix
$base_dir = __DIR__ . '/../src/';

// Does the class use the namespace prefix?
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) !== 0) {
// No, move to the next registered autoloader
return;
}

// Get the relative class name
$relative_class = substr($class, $len);

// Replace the namespace prefix with the base directory, replace namespace
// separators with directory separators in the relative class name, append
// with .php
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';

// If the file exists, require it
if (file_exists($file)) {
require $file;
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

class ComposerAutoloaderInit
{
private static $loader;

public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit', 'loadClassLoader'));

$loader->setPsr4('PostSecret\\Admin\\', array(__DIR__ . '/../../src'));
$loader->register(true);

return $loader;
}

public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
}
2 changes: 2 additions & 0 deletions wp-content/themes/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
// Silence is golden.
Loading