From 85169dc9608824af387363e6e6906b0facd91475 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Fri, 20 Jun 2014 01:54:59 +0000 Subject: [PATCH] preliminary support for webfinger It just echos back the subject given to it. --- conf/nginx.conf | 6 ++++++ setup/web.sh | 4 ++++ tools/webfinger.php | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100755 tools/webfinger.php diff --git a/conf/nginx.conf b/conf/nginx.conf index 61fa009..b033ab0 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -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; + } } diff --git a/setup/web.sh b/setup/web.sh index 8a2df8d..53f70d0 100755 --- a/setup/web.sh +++ b/setup/web.sh @@ -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 diff --git a/tools/webfinger.php b/tools/webfinger.php new file mode 100755 index 0000000..2192e08 --- /dev/null +++ b/tools/webfinger.php @@ -0,0 +1,9 @@ + $resource, + ), JSON_PRETTY_PRINT); +?> +