readme and makefile updates

This commit is contained in:
Gustavo Maronato 2023-09-20 11:52:46 -03:00
parent 7623b16f5a
commit e2ea9cd975
No known key found for this signature in database
2 changed files with 42 additions and 21 deletions

View file

@ -9,7 +9,7 @@ build:
test: test:
go test -v ./... go test -v ./...
serve: run:
go run main.go serve go run main.go serve
clean: clean:

View file

@ -85,15 +85,14 @@ https://example.com/user/charlie:
"rel": "openid", "rel": "openid",
"href": "https://sso.example.com/" "href": "https://sso.example.com/"
}, },
{
"rel": "name",
"href": "Alice Doe"
},
{ {
"rel": "http://webfinger.net/rel/profile-page", "rel": "http://webfinger.net/rel/profile-page",
"href": "https://example.com/user/alice" "href": "https://example.com/user/alice"
} }
] ],
"properties": {
"name": "Alice Doe"
}
} }
``` ```
</details> </details>
@ -107,14 +106,13 @@ https://example.com/user/charlie:
"subject": "acct:bob@example.com", "subject": "acct:bob@example.com",
"links": [ "links": [
{ {
"rel": "name", "rel": "http://openid.net/specs/connect/1.0/issuer",
"href": "Bob Foo"
},
{
"rel": "openid",
"href": "https://sso.example.com/" "href": "https://sso.example.com/"
} }
] ],
"properties": {
"http://schema.org/name": "Bob Foo"
}
} }
``` ```
</details> </details>
@ -128,21 +126,44 @@ https://example.com/user/charlie:
"subject": "https://example.com/user/charlie", "subject": "https://example.com/user/charlie",
"links": [ "links": [
{ {
"rel": "name", "rel": "http://webfinger.net/rel/profile-page",
"href": "Charlie Baz"
},
{
"rel": "profile",
"href": "https://example.com/user/charlie" "href": "https://example.com/user/charlie"
} }
] ],
"properties": {
"http://schema.org/name": "Charlie Baz"
}
} }
``` ```
</details> </details>
## Commands
Finger exposes two commands: `serve` and `healthcheck`. `serve` is the default command and starts the server. `healthcheck` is used by the Docker healthcheck to check if the server is up.
## Configs ## Configs
Here are the config options available. You can change them via command line flags or environment variables: Here are the config options available. You can change them via command line flags or environment variables:
| CLI flag | Env variable | Default | Description | | CLI flag | Env variable | Default | Description |
| -------- | ------------ | ------- | ----------- | | ------------------- | ---------------- | -------------------------------------- | -------------------------------------- |
| fdsfds | gsfgfs | fgfsdgf | gdfsgdf | | `-p, --port` | `WF_PORT` | `8080` | Port where the server listens to |
| `-h, --host` | `WF_HOST` | `localhost` (`0.0.0.0` when in Docker) | Host where the server listens to |
| `-f, --finger-file` | `WF_FINGER_FILE` | `fingers.yml` | Path to the webfingers definition file |
| `-u, --urn-file` | `WF_URN_FILE` | `urns.yml` | Path to the URNs alias file |
| `-d, --debug` | `WF_DEBUG` | `false` | Enable debug logging |
## Development
You need to have [Go](https://golang.org/) installed to build the project.
Clone the repo and run `make build` to build the binary. You can then run `./finger serve` to start the server.
A few other commands are:
- `make run` to run the server
- `make test` to run the tests
- `make lint` to run the linter
- `make clean` to clean the build files
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.