Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/silverbucket/node-webfinger-service
a webfinger service implementation in node.js
https://github.com/silverbucket/node-webfinger-service
Last synced: about 1 month ago
JSON representation
a webfinger service implementation in node.js
- Host: GitHub
- URL: https://github.com/silverbucket/node-webfinger-service
- Owner: silverbucket
- Created: 2012-11-18T00:11:52.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:53:59.000Z (11 months ago)
- Last Synced: 2024-04-15T13:17:14.756Z (7 months ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 6
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-webfinger-service
a webfinger service implementation in node.js
## Introduction
This is a very simple WebFinger service written for node.js. It only supports JSON at the moment, and could very well have bugs. Feedback, contributions and bug reports welcome.
## Install
```
$ git clone git://github.com/silverbucket/node-webfinger-service.git
$ cd node-webfinger-service
$ npm install
```## Setup
#### 1. Basic config
```
$ cp config.js.example config.js
```Edit the `config.js` and set your domain name, and the protocol (http or https) that you will receive requests on.
#### 2. User data
All of the user data lives in the `resource/acct/` directory. Each file is treated as a username when webfinger-service does it's lookup (it doesn't actually check for any system accounts). An example user data file is there named `user`, and looks like this:
```javascript
module.exports = {
"subject" : "acct:[email protected]",
"links" : [
{
"rel" : "http://webfinger.net/rel/avatar",
"href" : "http://exmaple.com/images/avatar.jpg"
},
{
"rel" : "http://webfinger.net/rel/profile-page",
"href" : "http://www.example.com/user/profile"
},
{
"rel" : "http://packetizer.com/rel/blog",
"href" : "http://exmaple.com/blog"
}
]
};
```So, if your filename is `bob` then lookups for `bob@[yourdomain]` will return
that json object.#### 3. Setup a proxy ( HAProxy )
You can also setup nginx to forward, but I've only tested with HAProxy.
```
frontend public
bind *:80
...
acl is_webfinger path_beg -i /.well-known
use_backend webfinger if is_webfinger
...
backend webfinger
timeout server 30s
option httpclose
option forwardfor
server srv1 127.0.0.1:9110 # or whatever port you chose in config.js
```**Don't forget to restart HAProxy**
#### 4. Start the webfinger-service
```
$ bin/webfinger-service
```## Example request/response
A request like this:
`GET http://localhost:9110/.well-known/webfinger?resource=acct:[email protected]`Should provide a response like this:
```javascript
{
"subject": "acct:[email protected]",
"links": [
{
"rel": "http://webfinger.net/rel/avatar",
"href": "http://exmaple.com/images/avatar.jpg"
},
{
"rel": "http://webfinger.net/rel/profile-page",
"href": "http://www.example.com/user/profile"
},
{
"rel": "http://packetizer.com/rel/blog",
"href": "http://exmaple.com/blog"
}
]
}
```