diff --git a/Makefile b/Makefile index 2f473c4..a80feef 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ build: test: go test -v ./... -serve: +run: go run main.go serve clean: diff --git a/README.md b/README.md index 244e220..89041cf 100644 --- a/README.md +++ b/README.md @@ -85,15 +85,14 @@ https://example.com/user/charlie: "rel": "openid", "href": "https://sso.example.com/" }, - { - "rel": "name", - "href": "Alice Doe" - }, { "rel": "http://webfinger.net/rel/profile-page", "href": "https://example.com/user/alice" } - ] + ], + "properties": { + "name": "Alice Doe" + } } ``` @@ -107,14 +106,13 @@ https://example.com/user/charlie: "subject": "acct:bob@example.com", "links": [ { - "rel": "name", - "href": "Bob Foo" - }, - { - "rel": "openid", + "rel": "http://openid.net/specs/connect/1.0/issuer", "href": "https://sso.example.com/" } - ] + ], + "properties": { + "http://schema.org/name": "Bob Foo" + } } ``` @@ -128,21 +126,44 @@ https://example.com/user/charlie: "subject": "https://example.com/user/charlie", "links": [ { - "rel": "name", - "href": "Charlie Baz" - }, - { - "rel": "profile", + "rel": "http://webfinger.net/rel/profile-page", "href": "https://example.com/user/charlie" } - ] + ], + "properties": { + "http://schema.org/name": "Charlie Baz" + } } ``` +## 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 Here are the config options available. You can change them via command line flags or environment variables: -| CLI flag | Env variable | Default | Description | -| -------- | ------------ | ------- | ----------- | -| fdsfds | gsfgfs | fgfsdgf | gdfsgdf | +| CLI flag | Env variable | Default | Description | +| ------------------- | ---------------- | -------------------------------------- | -------------------------------------- | +| `-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.