hold off secure mode

This commit is contained in:
Django Doucet 2023-04-26 15:54:09 -06:00
parent 8aa3f53dbd
commit 6b68f0763d
3 changed files with 19 additions and 19 deletions

View file

@ -144,15 +144,15 @@ class Admin {
'default' => array( 'post', 'pages' ), 'default' => array( 'post', 'pages' ),
) )
); );
\register_setting( // \register_setting(
'activitypub', // 'activitypub',
'activitypub_use_secure_mode', // 'activitypub_use_secure_mode',
array( // array(
'type' => 'boolean', // 'type' => 'boolean',
'description' => \__( 'Secure mode allows blocking servers from fetching public activities', 'activitypub' ), // 'description' => \__( 'Secure mode allows blocking servers from fetching public activities', 'activitypub' ),
'default' => 0, // 'default' => 0,
) // )
); // );
} }
public static function schedule_migration() { public static function schedule_migration() {

View file

@ -42,13 +42,13 @@ class Server {
} }
} else { } else {
// SecureMode/Authorized fetch. // SecureMode/Authorized fetch.
$secure_mode = \get_option( 'activitypub_use_secure_mode', '0' ); // $secure_mode = \get_option( 'activitypub_use_secure_mode', '0' );
// if ( $secure_mode ) {
if ( $secure_mode ) { // $verified_request = Signature::verify_http_signature( $request );
if ( \is_wp_error( $verified_request ) ) { // if ( \is_wp_error( $verified_request ) ) {
return $verified_request; // return $verified_request;
} // }
} // }
} }
} }
} }

View file

@ -171,7 +171,7 @@
</tbody> </tbody>
</table> </table>
<table class="form-table"> <!-- <table class="form-table">
<tbody> <tbody>
<tr> <tr>
<th scope="row"> <th scope="row">
@ -179,12 +179,12 @@
</th> </th>
<td> <td>
<p> <p>
<label><input type="checkbox" name="activitypub_use_secure_mode" id="activitypub_use_secure_mode" value="1" <?php echo \checked( '1', \get_option( 'activitypub_use_secure_mode', '0' ) ); ?> /> <?php echo wp_kses( \__( 'In secure mode every ActivityPub request must be signed. This disallows anonymous requests and prevents serving content to servers listed in the Blocklist.', 'activitypub' ), 'default' ); ?></label> <label><input type="checkbox" name="activitypub_use_secure_mode" id="activitypub_use_secure_mode" value="1" <?php // echo \checked( '1', \get_option( 'activitypub_use_secure_mode', '0' ) ); ?> /> <?php echo wp_kses( \__( 'In secure mode every ActivityPub request must be signed. This disallows anonymous requests and prevents serving content to servers listed in the Blocklist.', 'activitypub' ), 'default' ); ?></label>
</p> </p>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table> -->
<?php \do_settings_fields( 'activitypub', 'server' ); ?> <?php \do_settings_fields( 'activitypub', 'server' ); ?>