WordPress makes two assumptions this project cannot accept: that identity comes from an email address, and that a site lives at one server. Both are things somebody else can take away — a mailbox is rented from a provider who can close it or be compelled to open it, and a server is one seizure from being gone. Sirius Press replaces the first and hedges the second. Signing in means signing a challenge with the key that controls a CashAddress. The address is recovered from the signature, so nothing is typed but the signature itself, and the result is an ordinary WordPress session cookie — roles, capabilities, nonces and the REST API never learn the login was different. Three ways to produce one: a wallet the browser already exposes, a phrase used once in the page and wiped, or a signature pasted in from any BIP-137 wallet, which needs no JavaScript and lets the key stay on a machine that never touches the web. There is no password reset, and the recovery page says so plainly rather than offering a form that cannot work. A reset mechanism is by construction a way to take an account from its owner, and it is always easier to attack than the cryptography it bypasses. Publishing a post also exports it as static HTML to the name's storage on Sia, signed by the key that owns the name, so the site keeps answering when the server does not. Email as a feature is untouched. wp_mail() still works, SMTP still sends, and contact forms still deliver to addresses real people typed. Only mail to the site's own unroutable placeholder addresses is diverted to an in-app inbox. The objection was to email as identity, not to email. Core is pinned and patched rather than vendored. WordPress 7.1.1 is 149 MB and 5,008 files; the fork's entire core diff is 75 lines in wp-admin/install.php. Carrying the former to express the latter would bury the patch where nobody reviews it and make every clone of the monorepo pay for it. Upstream releases still merge through tools/update-wordpress.sh, which reapplies the series and says exactly which hunk needs a human. The cryptography is implemented twice — PHP on the server, JavaScript in the page — because the server must verify and the browser must sign. Both are pinned against libauth, the library the Sirius portal wallet and the BNS gateway already use, so a disagreement of one byte fails the test suite rather than presenting as a rejected login at three in the morning. 132 checks, no framework, about a second.
100 lines
5.4 KiB
Diff
100 lines
5.4 KiB
Diff
Subject: [PATCH] setup wizard: ask for a wallet, not a mailbox
|
|
|
|
The installer is the one place in WordPress where the fork cannot do its
|
|
work from a plugin. It runs before plugins load, and it refuses to finish
|
|
without an email address, so a site with no mail identity cannot be
|
|
installed at all.
|
|
|
|
The change is the smallest one that removes the requirement:
|
|
|
|
- "Your Email" becomes "Your wallet address", and it is optional. The
|
|
installer has nothing to verify a signature against yet — the site
|
|
does not exist — so an address typed here is taken on trust and can be
|
|
replaced from the profile screen afterwards, where it CAN be proved.
|
|
- The two is_email() gates become one address check.
|
|
- wp_install() still receives an email string, because its signature and
|
|
everything downstream of it expects one. It gets a permanently
|
|
unroutable .invalid placeholder.
|
|
|
|
The two helper functions are defined by the Sirius Press bootstrap
|
|
must-use plugin, which loads before this file on every request including
|
|
the installer. If that plugin is missing, they fall back to accepting
|
|
nothing and the installer behaves as it does on stock WordPress minus the
|
|
email field.
|
|
|
|
Applies to: WordPress 7.1.1
|
|
--- a/wp-admin/install.php
|
|
+++ b/wp-admin/install.php
|
|
@@ -101,6 +101,8 @@
|
|
$weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
|
|
$user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
|
|
$admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
|
|
+ // Sirius Press: the identity field on this form is a wallet address.
|
|
+ $admin_wallet = isset( $_POST['admin_wallet'] ) ? trim( wp_unslash( $_POST['admin_wallet'] ) ) : '';
|
|
|
|
if ( ! is_null( $error ) ) {
|
|
?>
|
|
@@ -175,9 +177,9 @@
|
|
</tr>
|
|
<?php endif; ?>
|
|
<tr>
|
|
- <th scope="row"><label for="admin_email"><?php _e( 'Your Email' ); ?></label></th>
|
|
- <td><input name="admin_email" type="email" id="admin_email" size="25" aria-describedby="admin-email-desc" value="<?php echo esc_attr( $admin_email ); ?>" />
|
|
- <p id="admin-email-desc"><?php _e( 'Double-check your email address before continuing.' ); ?></p></td>
|
|
+ <th scope="row"><label for="admin_wallet"><?php _e( 'Your wallet address' ); ?></label></th>
|
|
+ <td><input name="admin_wallet" type="text" id="admin_wallet" size="25" class="code" aria-describedby="admin-wallet-desc" value="<?php echo esc_attr( $admin_wallet ); ?>" autocapitalize="off" autocomplete="off" spellcheck="false" />
|
|
+ <p id="admin-wallet-desc"><?php _e( 'Sirius Press: your Bitcoin Cash address is your account. Leave this blank to attach one later from your profile — until then the password above is the only way in.' ); ?></p></td>
|
|
</tr>
|
|
<?php $blog_privacy_selector_title = has_action( 'blog_privacy_selector' ) ? __( 'Site visibility' ) : __( 'Search engine visibility' ); ?>
|
|
<tr>
|
|
@@ -411,10 +413,20 @@
|
|
$user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
|
|
$admin_password = isset( $_POST['admin_password'] ) ? wp_unslash( $_POST['admin_password'] ) : '';
|
|
$admin_password_check = isset( $_POST['admin_password2'] ) ? wp_unslash( $_POST['admin_password2'] ) : '';
|
|
- $admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
|
|
+ $admin_wallet = isset( $_POST['admin_wallet'] ) ? trim( wp_unslash( $_POST['admin_wallet'] ) ) : '';
|
|
$public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 1;
|
|
|
|
- // Check email address.
|
|
+ /*
|
|
+ * Sirius Press: there is no email step. The account identity is a
|
|
+ * CashAddress, and it is optional here because the installer has nothing
|
|
+ * to verify a signature against yet — the site does not exist. An address
|
|
+ * typed now is attached below; an administrator who leaves it blank
|
|
+ * attaches one from their profile afterwards, where they can prove it.
|
|
+ */
|
|
+ $admin_wallet = sirius_press_install_address( $admin_wallet );
|
|
+ $admin_email = sirius_press_install_stub_email( $admin_wallet );
|
|
+
|
|
+ // Check the username and password.
|
|
$error = false;
|
|
if ( empty( $user_name ) ) {
|
|
// TODO: Poka-yoke.
|
|
@@ -427,19 +439,20 @@
|
|
// TODO: Poka-yoke.
|
|
display_setup_form( __( 'Your passwords do not match. Please try again.' ) );
|
|
$error = true;
|
|
- } elseif ( empty( $admin_email ) ) {
|
|
- // TODO: Poka-yoke.
|
|
- display_setup_form( __( 'You must provide an email address.' ) );
|
|
- $error = true;
|
|
- } elseif ( ! is_email( $admin_email ) ) {
|
|
- // TODO: Poka-yoke.
|
|
- display_setup_form( __( 'Sorry, that is not a valid email address. Email addresses look like <code>username@example.com</code>.' ) );
|
|
+ } elseif ( false === $admin_wallet ) {
|
|
+ display_setup_form( __( 'Sorry, that is not a valid Bitcoin Cash address. Leave the field blank if you would rather attach a wallet after installing.' ) );
|
|
$error = true;
|
|
}
|
|
|
|
if ( false === $error ) {
|
|
$wpdb->show_errors();
|
|
$result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language );
|
|
+
|
|
+ // Sirius Press: record the administrator's wallet so they can sign in
|
|
+ // with it immediately.
|
|
+ if ( '' !== $admin_wallet && ! empty( $result['user_id'] ) ) {
|
|
+ update_user_meta( (int) $result['user_id'], 'sirius_wallet_address', $admin_wallet );
|
|
+ }
|
|
?>
|
|
|
|
<h1><?php _e( 'Success!' ); ?></h1>
|