mailhog
This commit is contained in:
18
devenv.lock
18
devenv.lock
@@ -3,11 +3,11 @@
|
||||
"devenv": {
|
||||
"locked": {
|
||||
"dir": "src/modules",
|
||||
"lastModified": 1784325378,
|
||||
"narHash": "sha256-Gof6j4d43yX2qSLLp78JILke346IggDFIxTgl3ecVQE=",
|
||||
"lastModified": 1787015266,
|
||||
"narHash": "sha256-B4eXU1+QiZc3fFgH0pTl185xNUYNzW+1KIe9Jmtavkk=",
|
||||
"owner": "cachix",
|
||||
"repo": "devenv",
|
||||
"rev": "5f1cf17be0fc48689bd0ecb810de6d2e06d259a1",
|
||||
"rev": "c18de5253016e6eb97689724327f08e9dd2d4768",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -22,11 +22,11 @@
|
||||
"nixpkgs-src": "nixpkgs-src"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1783345554,
|
||||
"narHash": "sha256-LZhOm4kqjHUnwP4CNHpaqqEVcumGNd1PvOEOad8LkS0=",
|
||||
"lastModified": 1787002832,
|
||||
"narHash": "sha256-DGkHh88/7YLVGZ7HzSVN4YmUmR+wGKudIp6H9UsUNT0=",
|
||||
"owner": "cachix",
|
||||
"repo": "devenv-nixpkgs",
|
||||
"rev": "6004ea8c229fe9d41b21c6f4c76bf6c2e10771dd",
|
||||
"rev": "ee3d58d53cfcddfc0ae6fc7f04f4fe2a0c7cf0ed",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -39,11 +39,11 @@
|
||||
"nixpkgs-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1783279667,
|
||||
"narHash": "sha256-/NAkDSsve+GNM0Bt6tleJdCGfsTlK89nPjkVOzZMo0s=",
|
||||
"lastModified": 1786858016,
|
||||
"narHash": "sha256-Vczr2zxD0orq6N2QQe5uqOGF7TRDcQJRRuAcsdHr4kg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f205b5574fd0cb7da5b702a2da51507b7f4fdd1b",
|
||||
"rev": "54ba4bcec4043e72a4006d825e0d7aff5562008f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -38,6 +38,10 @@
|
||||
alias ${config.env.DEVENV_ROOT}/themes/;
|
||||
}
|
||||
|
||||
location /mu-plugins/ {
|
||||
alias ${config.env.DEVENV_ROOT}/mu-plugins/;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
include ${pkgs.nginx}/conf/fastcgi.conf;
|
||||
@@ -71,6 +75,8 @@
|
||||
];
|
||||
};
|
||||
|
||||
services.mailhog.enable = true;
|
||||
|
||||
services.mysql.enable = true;
|
||||
services.mysql.ensureUsers = [
|
||||
{
|
||||
|
||||
21
mu-plugins/mailhog.php
Normal file
21
mu-plugins/mailhog.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Route all outgoing mail through the local mailhog service (see devenv.nix)
|
||||
* instead of actually sending it. View caught mail at http://localhost:8025.
|
||||
*/
|
||||
|
||||
add_action(
|
||||
'phpmailer_init',
|
||||
function ( $phpmailer ) {
|
||||
$phpmailer->isSMTP();
|
||||
$phpmailer->Host = '127.0.0.1';
|
||||
$phpmailer->Port = 1025;
|
||||
$phpmailer->SMTPAuth = false;
|
||||
$phpmailer->SMTPAutoTLS = false;
|
||||
}
|
||||
);
|
||||
|
||||
// WordPress defaults the From address to "wordpress@localhost" in this
|
||||
// environment, which PHPMailer rejects as invalid (no dot in the domain),
|
||||
// causing wp_mail() to fail before it ever reaches mailhog.
|
||||
add_filter( 'wp_mail_from', fn() => 'wordpress@wp-devenv.test' );
|
||||
@@ -10,6 +10,10 @@
|
||||
define( 'WP_PLUGIN_DIR', __DIR__ . '/plugins' );
|
||||
define( 'WP_PLUGIN_URL', 'http://localhost:8080/plugins' );
|
||||
|
||||
// ** Must-use plugins also live in the repo root ** //
|
||||
define( 'WPMU_PLUGIN_DIR', __DIR__ . '/mu-plugins' );
|
||||
define( 'WPMU_PLUGIN_URL', 'http://localhost:8080/mu-plugins' );
|
||||
|
||||
// ** Database settings (matches services.mysql in devenv.nix) ** //
|
||||
define( 'DB_NAME', 'wp' );
|
||||
define( 'DB_USER', 'wp' );
|
||||
|
||||
Reference in New Issue
Block a user