mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-12-22 07:17:05 +00:00
drop webfinger, see #95
This commit is contained in:
parent
06a8ce1c9d
commit
8566b78202
@ -55,13 +55,6 @@ server {
|
||||
client_max_body_size 20M;
|
||||
}
|
||||
|
||||
# Webfinger configuration.
|
||||
location = /.well-known/webfinger {
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME /usr/local/bin/mailinabox-webfinger.php;
|
||||
fastcgi_pass php-fpm;
|
||||
}
|
||||
|
||||
# Z-Push (Microsoft Exchange ActiveSync)
|
||||
location /Microsoft-Server-ActiveSync {
|
||||
include /etc/nginx/fastcgi_params;
|
||||
|
12
setup/web.sh
12
setup/web.sh
@ -57,22 +57,12 @@ if [ -L /etc/init.d/php-fastcgi ]; then
|
||||
apt-get -y purge php5-cgi #NODOC
|
||||
fi
|
||||
|
||||
# Put our webfinger script into a well-known location.
|
||||
for f in webfinger; do
|
||||
cp tools/$f.php /usr/local/bin/mailinabox-$f.php
|
||||
chown www-data.www-data /usr/local/bin/mailinabox-$f.php
|
||||
done
|
||||
|
||||
# Remove obsoleted scripts. #NODOC
|
||||
# exchange-autodiscover is now handled by Z-Push. #NODOC
|
||||
for f in exchange-autodiscover; do #NODOC
|
||||
for f in webfinger exchange-autodiscover; do #NODOC
|
||||
rm -f /usr/local/bin/mailinabox-$f.php #NODOC
|
||||
done #NODOC
|
||||
|
||||
# Make some space for users to customize their webfinger responses.
|
||||
mkdir -p $STORAGE_ROOT/webfinger/acct;
|
||||
chown -R $STORAGE_USER $STORAGE_ROOT/webfinger
|
||||
|
||||
# Start services.
|
||||
restart_service nginx
|
||||
restart_service php5-fpm
|
||||
|
@ -1,46 +0,0 @@
|
||||
<?php
|
||||
$resource = '';
|
||||
|
||||
if(isset($_GET['resource'])){
|
||||
$resource = $_GET['resource'];
|
||||
}
|
||||
|
||||
// Parse our configuration file to get the STORAGE_ROOT.
|
||||
$STORAGE_ROOT = NULL;
|
||||
foreach (file("/etc/mailinabox.conf") as $line) {
|
||||
$line = explode("=", rtrim($line), 2);
|
||||
if ($line[0] == "STORAGE_ROOT") {
|
||||
$STORAGE_ROOT = $line[1];
|
||||
}
|
||||
}
|
||||
if ($STORAGE_ROOT == NULL) exit("no STORAGE_ROOT");
|
||||
|
||||
// Turn the resource into a file path. First URL-encode the resource
|
||||
// so that it is filepath-safe.
|
||||
$fn = urlencode($resource);
|
||||
|
||||
// Replace the first colon (it's URL-encoded) with a slash since we'll
|
||||
// break off the files into scheme subdirectories.
|
||||
$fn = preg_replace("/%3A/", "/", $fn, 1);
|
||||
|
||||
// Since this is often for email addresses, un-escape @-signs so they
|
||||
// are not odd-looking. It's filename-safe anyway.
|
||||
$fn = preg_replace("/%40/", "@", $fn);
|
||||
|
||||
// Combine with root path.
|
||||
$fn = $STORAGE_ROOT . "/webfinger/" . $fn . ".json";
|
||||
|
||||
// See if the file exists.
|
||||
if (!file_exists($fn)) {
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Content-type: application/json");
|
||||
echo file_get_contents($fn);
|
||||
|
||||
//json_encode(array(
|
||||
// subject => $resource,
|
||||
//), JSON_PRETTY_PRINT);
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user