first commit
This commit is contained in:
commit
c3e813df0e
2 changed files with 64 additions and 0 deletions
47
localhost-https-development.php
Normal file
47
localhost-https-development.php
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Plugin Name: Localhost https Development
|
||||||
|
* Description: Allows for developing https locally together with other apps.
|
||||||
|
* Version: 0.1.0
|
||||||
|
* Author: André Menrath
|
||||||
|
* Text Domain: localhost-https-dev
|
||||||
|
* License: AGPL-3.0-or-later
|
||||||
|
* License URI: https://www.gnu.org/licenses/agpl-3.0.de.html
|
||||||
|
* Requires PHP: 8.1
|
||||||
|
*
|
||||||
|
* Requires at least ActivityPub plugin with version >= 3.2.2. ActivityPub plugin tested up to: 3.2.2.
|
||||||
|
*
|
||||||
|
* @license AGPL-3.0-or-later
|
||||||
|
* @package LocalHost_Https_Dev
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Exit if accessed directly.
|
||||||
|
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a filter for http_request_host_is_external
|
||||||
|
*/
|
||||||
|
add_filter( 'http_request_host_is_external', 'activitypub_event_bridge_custom_http_request_host_is_external', 10, 3 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a filter for http_request_host_is_external
|
||||||
|
*
|
||||||
|
* @param bool $is_external Whether the request is external.
|
||||||
|
*/
|
||||||
|
function activitypub_event_bridge_custom_http_request_host_is_external( $is_external ) {
|
||||||
|
$is_external = true;
|
||||||
|
|
||||||
|
return $is_external;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Don't verify ssl certs for testing.
|
||||||
|
*/
|
||||||
|
add_filter( 'https_ssl_verify', 'activitypub_event_bridge_dont_verify_local_dev_https', 10, 3 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do not verify.
|
||||||
|
*/
|
||||||
|
function activitypub_event_bridge_dont_verify_local_dev_https() {
|
||||||
|
return false;
|
||||||
|
}
|
17
readme.txt
Normal file
17
readme.txt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
=== Localhost https Development ===
|
||||||
|
Contributors: andremenrath
|
||||||
|
Tags: development
|
||||||
|
Requires at least: 6.5
|
||||||
|
Tested up to: 6.6
|
||||||
|
Stable tag: 0.1.0
|
||||||
|
Requires PHP: 8.1
|
||||||
|
License: AGPL-3.0-or-later
|
||||||
|
License URI: https://www.gnu.org/licenses/agpl-3.0.html
|
||||||
|
|
||||||
|
Only allows for developing locally https ActivityPub stuff.
|
||||||
|
|
||||||
|
== Description ==
|
||||||
|
|
||||||
|
Only allows for developing locally https ActivityPub stuff.
|
||||||
|
|
||||||
|
Used together with https://code.event-federation.eu/Event-Federation/docker
|
Loading…
Reference in a new issue