Add more examples

This commit is contained in:
a 2022-12-15 02:12:25 -06:00
parent db6210cb19
commit 6f1d90cc0c
2 changed files with 11 additions and 4 deletions

View file

@ -4,15 +4,15 @@ Simple WebFinger server that returns static resources. Written with Python and F
## Deployment
### Add static resources
### Add static resources as a quickstart
- Create a `resource/` folder. This will map to the `?resource=` query parameter.
- Put a .jrd file in there; anything before the .jrd will be served via that `resource` query parameter.
- Currently, the "subject" will be ignored (as the `resource` will be used directly).
- Otherwise, `links` and `aliases` and `properties` will be served normally.
- Symlinks will be resolved as well. Try using a URI as a symlink and put it in `aliases` too!
- Symlinks will be resolved as well. Try using a URI as a symlink and maybe put it in `aliases` too!
Example `acct:a@trwnh.com.jrd`
Example `resource/acct:a@trwnh.com.jrd`
```json
{
@ -33,6 +33,13 @@ Example `acct:a@trwnh.com.jrd`
}
```
If your resource URI has slashes in it and would therefore be an invalid UNIX path, it must be percent-encoded. For example, to have the WebFinger server respond to a lookup for `?resource=https://trwnh.com/~a`, you can create a symlink with the path `resource/https%3A%2F%2Ftrwnh.com%2F~a.jrd` like so:
```sh
cd resource
ln -s "acct:a@trwnh.com" "https%3A%2F%2Ftrwnh.com%2F~a.jrd"
```
### Running the server
Environment variables you may use:

View file

@ -48,7 +48,7 @@ class JRD(BaseModel):
schema_extra = {
"example": r'''{
"subject": "acct:a@trwnh.com",
"aliases": ["https://trwnh.com/actors/7057bc10-db1c-4ebe-9e00-22cf04be4e5e", "https://trwnh.com/~a", "acct:trwnh@trwnh.com"],
"aliases": ["https://ap.trwnh.com/actors/7057bc10-db1c-4ebe-9e00-22cf04be4e5e", "https://trwnh.com/~a", "acct:trwnh@ap.trwnh.com"],
"links": [
{
"rel": "self",