syncthing: Update Apache configuration

- Redirect /syncthing to /syncthing/ as the daemon does not work
  without a slash at the end.

- Create a separate include file for LDAP authentication
  configuration that can be included on other app configurations.
This commit is contained in:
Sunil Mohan Adapa 2017-03-23 14:43:21 +05:30
parent 277cd45342
commit 3f57863a69
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
3 changed files with 25 additions and 10 deletions

View File

@ -1,13 +1,20 @@
ProxyPass /syncthing/ http://localhost:8384/
##
## On all sites, provide syncthing web interface on a path: /syncthing
##
<Location /syncthing/>
ProxyPassReverse http://localhost:8384/
AuthType basic
AuthName "FreedomBox Login"
AuthBasicProvider ldap
AuthLDAPUrl "ldap:///ou=users,dc=thisbox?uid"
AuthLDAPGroupAttribute memberUid
AuthLDAPGroupAttributeIsDN off
Require valid-user
# Redirect /syncthing to /syncthing/ as the Syncthing server does not
# work without a slash at the end.
<Location /syncthing>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/syncthing$
RewriteRule .* /syncthing/ [R=301,L]
</IfModule>
</Location>
<Location /syncthing/>
ProxyPass http://localhost:8384/
Include includes/freedombox-auth-ldap.conf
Require ldap-group cn=admin,ou=groups,dc=thisbox
</Location>

View File

@ -0,0 +1,6 @@
AuthType basic
AuthName "FreedomBox Login"
AuthBasicProvider ldap
AuthLDAPUrl "ldap:///ou=users,dc=thisbox?uid"
AuthLDAPGroupAttribute memberUid
AuthLDAPGroupAttributeIsDN off

View File

@ -209,6 +209,8 @@ setuptools.setup(
glob.glob('data/etc/apache2/conf-available/*.conf')),
('/etc/apache2/sites-available',
glob.glob('data/etc/apache2/sites-available/*.conf')),
('/etc/apache2/includes',
glob.glob('data/etc/apache2/includes/*.conf')),
('/etc/ikiwiki',
glob.glob('data/etc/ikiwiki/*.setup')),
('/etc/NetworkManager/dispatcher.d/',