1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-12-21 07:07:05 +00:00

preliminary support for webfinger

It just echos back the subject given to it.
This commit is contained in:
Joshua Tauberer 2014-06-20 01:54:59 +00:00
parent 5faa1cae71
commit 85169dc960
3 changed files with 19 additions and 0 deletions

View File

@ -39,5 +39,11 @@ server {
client_max_body_size 20M;
}
# Webfinger configuration.
location = /.well-known/webfinger {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/bin/mailinabox-webfinger.php;
fastcgi_pass unix:/tmp/php-fastcgi.www-data.sock;
}
}

View File

@ -31,6 +31,10 @@ rm -f /etc/init.d/php-fastcgi
ln -s $(pwd)/conf/phpfcgi-initscript /etc/init.d/php-fastcgi
update-rc.d php-fastcgi defaults
# Put our webfinger server script into a well-known location.
cp tools/webfinger.php /usr/bin/mailinabox-webfinger.php
chown www-data.www-data /usr/bin/mailinabox-webfinger.php
# Start services.
service nginx restart
service php-fastcgi restart

9
tools/webfinger.php Executable file
View File

@ -0,0 +1,9 @@
<?php
$resource = $_GET['resource'];
header("Content-type: application/json");
echo json_encode(array(
subject => $resource,
), JSON_PRETTY_PRINT);
?>