From 345197aa4aa148346f14eb3ef1cc76109c9198c4 Mon Sep 17 00:00:00 2001 From: KunoiSayami <46131041+KunoiSayami@users.noreply.github.com> Date: Sun, 16 May 2021 00:31:22 +0800 Subject: doc: Add configure sections to README --- README.md | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 77a9ce9..6433a8c 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,41 @@ # Cgit simple authentication -This project is currently developing, minor version may incompatible with previous minor version. +Simple authentication for [cgit](https://wiki.archlinux.org/title/Cgit) powered by [sqlite](https://wiki.archlinux.org/title/SQLite) and [redis](https://wiki.archlinux.org/title/Redis) -## Notice +## Configure -Upgrade from v0.1.x to v0.2.x should reset database due to password storage method changed. +Add this project as cgit [`auth-filter`](https://man.archlinux.org/man/cgitrc.5#FILTER_API) + +```conf +auth-filter=/opt/cgit-simple-authentication/target/release/cgit-simple-authentication +``` + +Available options for this filter: + +```conf +# Set cookie time to live +cgit-simple-auth-cookie-ttl=600 +# Specify database location (Default is /etc/cgit/auth.db) +cgit-simple-auth-database=/etc/cgit/auth.db +# Should authenticate in repositories root view +cgit-simple-auth-bypass-root=false +# Should enable authenticate in all repository +cgit-simple-auth-full-protect=true +``` + +Available options for repositories: + +_Should set `cgit-simple-auth-full-protect=false`_ + +```conf +repo.url=test +# Enable protect for this repository +repo.protect=true +``` ## Source -Most idea from: https://github.com/varphone/cgit-gogs-auth-filter +Most of the ideas come from: https://github.com/varphone/cgit-gogs-auth-filter ## License -- cgit v1.3.1