From c30906ba8c416485f92efec10f4a59917fd41e2a Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Sun, 8 Sep 2019 00:21:15 +0500 Subject: [PATCH] Configuration example and README update. --- README.md | 30 ++++++++++++++++++++++++++++-- inn2-fudforum-auth.dist.yaml | 6 ++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 983240b..0409132 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,34 @@ Right now authentication provider is able to connect only to PostgreSQL database ## Installation -*TBW* +Right now you can build it yourself by using ``go get``: + +```bash +go get -u -v develop.pztrn.name/pztrn/inn2-fudforum-auth +``` + +Binary will be placed in ``$GOPATH/bin``. Use [this configuration example](/inn2-fudforum-auth.dist.yaml) as example and tune it. ## Configuration -*TBW* \ No newline at end of file +### Provider + +See [this configuration example](/inn2-fudforum-auth.dist.yaml), it has comments for each section. + +Don't forget to define default group and other groups your INN2 is using in ``readers.conf``! + +### INN2 + +INN2 authentication uses ``auth`` and ``access`` blocks, first for authentication and second for authorization. We should define them both for each users group. Example for ``admin`` group from configuration example: + +```text +auth admin { + hosts: * + auth: /usr/local/bin/inn2-fudforum-auth -config /etc/news/inn2-fudforum-auth.yaml +} + +access admin { + users: "*@admin" + newsgroups: * +} +``` diff --git a/inn2-fudforum-auth.dist.yaml b/inn2-fudforum-auth.dist.yaml index 9d4fcde..868c2cf 100644 --- a/inn2-fudforum-auth.dist.yaml +++ b/inn2-fudforum-auth.dist.yaml @@ -20,6 +20,12 @@ groups: default: "regular" # Groups to users mapping. # This is a list of structures. Example "admin" group included. + # Group name from "group" parameter will be added to user as INN2 wants + # only on successful authentications. In this example this string will + # be returned to INN2: + # + # User:localadmin@admin + # groups: - group: "admin" # This is a list of users.