https://github.com/spoje-net/apache2-auth-redmine
Use Redmine credentials with Apache
https://github.com/spoje-net/apache2-auth-redmine
apache2 authentication debian-packages perl redmine vagrantfile
Last synced: 8 months ago
JSON representation
Use Redmine credentials with Apache
- Host: GitHub
- URL: https://github.com/spoje-net/apache2-auth-redmine
- Owner: Spoje-NET
- Created: 2021-04-07T15:59:56.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-08-30T19:52:34.000Z (9 months ago)
- Last Synced: 2025-10-06T12:53:09.663Z (8 months ago)
- Topics: apache2, authentication, debian-packages, perl, redmine, vagrantfile
- Language: Perl
- Homepage:
- Size: 176 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

Authenticate Apache Users using Redmine's database
==================================================
authentificators read its configuration from default redmine's db config **/etc/redmine/default/database.yml**
Based on original script by Anders Nordby
Installation:
-------------
```shell
sudo apt install lsb-release wget
echo "deb http://repo.vitexsoftware.cz $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vitexsoftware.list
sudo wget -O /etc/apt/trusted.gpg.d/vitexsoftware.gpg http://repo.vitexsoftware.cz/keyring.gpg
sudo apt update
sudo apt install apache2-auth-redmine
```
Tested on Debian 9 & 10
Configuration
-------------
The package provide enabled /etc/apache2/confs-availble/auth_redmine.conf with default external Auth definitions
```apache
DefineExternalAuth redmineuser pipe /usr/lib/apache2/redmine-mysql-auth.pl
DefineExternalGroup redminegroup pipe /usr/lib/apache2/redmine-group-mysql-auth.pl
```
The following examples use it:
Simple known user auth
----------------------
```apache
AuthType Basic
AuthName "Only for Redmine Users"
AuthBasicProvider external
AuthExternal redmineuser
Require valid-user
```
Group membership based auth
---------------------------
```apache
AuthType Basic
AuthName "Only for Redmine Admins"
AuthBasicProvider external
AuthExternal redmineuser
GroupExternal redminegroup
Require external-group admins
```
**Please look into [Vagrantfile](Vagrantfile) for details how to install on real system.**
Testing
-------
We provide example [Vagrant](https://www.vagrantup.com/).with whole setup in the box.
In this cloned repository simply run
```shell
vagrant up
```
And wait to things be done.
After image download, package installation and additional provisioning web iside virtual machine become reachable at
[http://localhost:8090](http://localhost:8090)
Then you can try to open Apache's locations only for redmine users and group members
[For Users](http://localhost:8090/user/)
[Only for Admins](http://localhost:8090/admin/)
Testing users:
| login | password | member of group |
|-------------|---------------|-----------------
| admin | Cli@queel3 |
| john | dydCag9knag | admin
| doe | steevCor2ov | users
Auth tool read login and password from stdin in simple format
```
login
password
```
So You can test basic functionality from commandline:
```shell
echo -e "admin\nCli@queel3\n" | /usr/lib/apache2/redmine-mysql-auth.pl
```
The credentials was accepted. The script ends with **0** code as you can check using "$?" macro:
```shell
echo $?
0
```
Unsuccessfull attempt ends with **one** return code.
See Also:
---------
* https://github.com/haegar/mod-auth-external/blob/master/mod_authnz_external/INSTALL
* http://anders.fix.no/software/#unix
* https://spojenet.cz/


