ttrss: Use LDAP authentication

This commit is contained in:
James Valleroy 2016-03-11 17:02:55 -05:00 committed by Sunil Mohan Adapa
parent 47a54fadd1
commit 368e64c5ca
No known key found for this signature in database
GPG Key ID: 36C361440C9BC971
3 changed files with 24 additions and 6 deletions

View File

@ -51,22 +51,24 @@ def subcommand_setup(_):
for match in aug.match('/files' + CONFIG_FILE + '/define'):
if aug.get(match) == 'SELF_URL_PATH':
aug.set(match + '/value', "'http://localhost/tt-rss/'")
elif aug.get(match) == 'PLUGINS':
aug.set(match + '/value', "'auth_remote, note'")
aug.save()
action_utils.service_restart('tt-rss')
action_utils.webserver_enable('50-tt-rss')
action_utils.webserver_enable('tt-rss-plinth')
def subcommand_enable(_):
"""Enable web configuration and reload."""
action_utils.service_enable('tt-rss')
action_utils.webserver_enable('50-tt-rss')
action_utils.webserver_enable('tt-rss-plinth')
def subcommand_disable(_):
"""Disable web configuration and reload."""
action_utils.webserver_disable('50-tt-rss')
action_utils.webserver_disable('tt-rss-plinth')
action_utils.service_disable('tt-rss')

View File

@ -0,0 +1,15 @@
##
## On all sites, provide Tiny Tiny RSS on a default path: /tt-rss
## Allow all valid LDAP users.
##
Alias /tt-rss /usr/share/tt-rss/www
<Location /tt-rss>
AuthType basic
AuthName "FreedomBox Login"
AuthBasicProvider ldap
AuthLDAPUrl "ldap:///ou=users,dc=thisbox?uid"
AuthLDAPGroupAttribute memberUid
AuthLDAPGroupAttributeIsDN off
Require valid-user
</Location>

View File

@ -58,7 +58,7 @@ def init():
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(['tt-rss', 'postgresql', 'dbconfig-pgsql', 'php5-pgsql'])
helper.install(['tt-rss', 'postgresql', 'dbconfig-pgsql', 'php-pgsql'])
helper.call('post', actions.superuser_run, 'ttrss', ['setup'])
helper.call('post', service.notify_enabled, None, True)
@ -71,7 +71,8 @@ def get_status():
def is_enabled():
"""Return whether the module is enabled."""
return action_utils.webserver_is_enabled('50-tt-rss')
return (action_utils.service_is_enabled('tt-rss') and
action_utils.webserver_is_enabled('tt-rss-plinth'))
def is_running():
@ -91,6 +92,6 @@ def diagnose():
results = []
results.extend(action_utils.diagnose_url_on_all(
'https://{host}/ttrss', extra_options=['--no-check-certificate']))
'https://{host}/tt-rss', extra_options=['--no-check-certificate']))
return results