diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-09-01 10:37:59 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-09-01 10:37:59 +0200 |
commit | 7a42aed1f6800f31eda01f89a7f2971efea531a5 (patch) | |
tree | f9c1bb5fd28ca237f1f8e6ceb2885805c3e0ad06 /Zotlabs/Web | |
parent | 28d6b9ce168aab2f646c3e5b9925b1f40ee9cdfb (diff) | |
parent | 5bffae621979f37740cbfc7d97adf15f95e6c6e8 (diff) | |
download | volse-hubzilla-7a42aed1f6800f31eda01f89a7f2971efea531a5.tar.gz volse-hubzilla-7a42aed1f6800f31eda01f89a7f2971efea531a5.tar.bz2 volse-hubzilla-7a42aed1f6800f31eda01f89a7f2971efea531a5.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'Zotlabs/Web')
-rw-r--r-- | Zotlabs/Web/HTTPSig.php | 10 | ||||
-rw-r--r-- | Zotlabs/Web/Router.php | 12 |
2 files changed, 20 insertions, 2 deletions
diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php index 537cd52a1..1f485a881 100644 --- a/Zotlabs/Web/HTTPSig.php +++ b/Zotlabs/Web/HTTPSig.php @@ -145,7 +145,7 @@ class HTTPSig { - static function create_sig($request,$head,$prvkey,$keyid = 'Key',$send_headers = false,$alg = 'sha256') { + static function create_sig($request,$head,$prvkey,$keyid = 'Key',$send_headers = false,$auth = false,$alg = 'sha256') { $return_headers = []; @@ -155,8 +155,14 @@ class HTTPSig { $x = self::sign($request,$head,$prvkey,$alg); - $sighead = 'Signature: keyId="' . $keyid . '",algorithm="' . $algorithm + if($auth) { + $sighead = 'Authorization: Signature keyId="' . $keyid . '",algorithm="' . $algorithm . '",headers="' . $x['headers'] . '",signature="' . $x['signature'] . '"'; + } + else { + $sighead = 'Signature: keyId="' . $keyid . '",algorithm="' . $algorithm + . '",headers="' . $x['headers'] . '",signature="' . $x['signature'] . '"'; + } if($head) { foreach($head as $k => $v) { diff --git a/Zotlabs/Web/Router.php b/Zotlabs/Web/Router.php index 3190369c8..710aa2844 100644 --- a/Zotlabs/Web/Router.php +++ b/Zotlabs/Web/Router.php @@ -119,6 +119,18 @@ class Router { if(! (\App::$module_loaded)) { + // undo the setting of a letsencrypt acme-challenge rewrite rule + // which blocks access to our .well-known routes. + // Also provide a config setting for sites that have a legitimate need + // for a custom .htaccess in the .well-known directory; but they should + // make the file read-only so letsencrypt doesn't modify it + + if(strpos($_SERVER['REQUEST_URI'],'/.well-known/') === 0) { + if(file_exists('.well-known/.htaccess') && get_config('system','fix_apache_acme',true)) { + rename('.well-known/.htaccess','.well-known/.htaccess.old'); + } + } + $x = [ 'module' => $module, 'installed' => \App::$module_loaded, |