mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
rssbridge: New app to generate RSS feeds for websites
[sunil: Update description for simplicity, group info] [sunil: Indentation fixes] [sunil: End all URLs with a slash] [sunil: Update frontpage shortcut to be a simple one] [sunil: Enable single-sign-on for main interface only] [sunil: In copyright file, merge with public-domain section] [sunil: Simplify and vectorify the icon] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
9de181b730
commit
9efc56368c
3
debian/copyright
vendored
3
debian/copyright
vendored
@ -67,6 +67,8 @@ Files: static/themes/default/icons/ejabberd.png
|
||||
static/themes/default/icons/privoxy.png
|
||||
static/themes/default/icons/privoxy.svg
|
||||
static/themes/default/icons/radicale.svg
|
||||
static/themes/default/icons/rssbridge.png
|
||||
static/themes/default/icons/rssbridge.svg
|
||||
static/themes/default/icons/zoph.png
|
||||
static/themes/default/icons/zoph.svg
|
||||
static/themes/default/img/network-connection.svg
|
||||
@ -82,6 +84,7 @@ Comment: Placed into public domain by authors (or)
|
||||
https://commons.wikimedia.org/wiki/File:Ejabberd_icon.png
|
||||
https://radicale.org/css/logo.svg
|
||||
https://github.com/resiprocate/resiprocate/blob/master/resip/stack/doc/reSIProcate-logo.svg
|
||||
https://github.com/RSS-Bridge/rss-bridge/blob/master/static/logo_600px.png
|
||||
License: public-domain
|
||||
|
||||
Files: doc/manual/en/images/icons/*
|
||||
|
||||
92
plinth/modules/rssbridge/__init__.py
Normal file
92
plinth/modules/rssbridge/__init__.py
Normal file
@ -0,0 +1,92 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""
|
||||
FreedomBox app to configure RSS-Bridge.
|
||||
"""
|
||||
from django.urls import reverse_lazy
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from plinth import app as app_module
|
||||
from plinth import cfg, frontpage, menu
|
||||
from plinth.modules.apache.components import Webserver
|
||||
from plinth.modules.backups.components import BackupRestore
|
||||
from plinth.modules.firewall.components import Firewall
|
||||
from plinth.modules.users.components import UsersAndGroups
|
||||
from plinth.package import Packages
|
||||
from plinth.utils import format_lazy
|
||||
|
||||
from . import manifest
|
||||
|
||||
_description = [
|
||||
_('RSS-Bridge generates RSS and Atom feeds for websites that do not have '
|
||||
'one. Generated feeds can be consumed by any feed reader.'),
|
||||
format_lazy(
|
||||
_('When enabled, RSS-Bridge can be accessed by <a href="{users_url}">'
|
||||
'any user</a> belonging to the feed-reader group.'),
|
||||
users_url=reverse_lazy('users:index')),
|
||||
format_lazy(
|
||||
_('You can use RSS-Bridge with <a href="{ttrss_url}">Tiny Tiny '
|
||||
'RSS</a> to follow various websites. When adding a feed, enable '
|
||||
'authentication and use your {box_name} credentials.'),
|
||||
ttrss_url=reverse_lazy('ttrss:index'), box_name=cfg.box_name),
|
||||
]
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
class RSSBridgeApp(app_module.App):
|
||||
"""FreedomBox app for RSS-Bridge."""
|
||||
|
||||
app_id = 'rssbridge'
|
||||
|
||||
_version = 1
|
||||
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
|
||||
groups = {'feed-reader': _('Read and subscribe to news feeds')}
|
||||
|
||||
info = app_module.Info(app_id=self.app_id, version=self._version,
|
||||
name=_('RSS-Bridge'), icon_filename='rssbridge',
|
||||
short_description=_('RSS Feed Generator'),
|
||||
description=_description,
|
||||
manual_page='RSSBridge', donation_url=None,
|
||||
clients=manifest.clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-rssbridge', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'rssbridge:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-rssbridge', name=info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename,
|
||||
url='/rss-bridge/', login_required=True,
|
||||
allowed_groups=list(groups))
|
||||
self.add(shortcut)
|
||||
|
||||
packages = Packages('packages-rssbridge', ['rss-bridge'])
|
||||
self.add(packages)
|
||||
|
||||
firewall = Firewall('firewall-rssbridge', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-rssbridge', 'rss-bridge',
|
||||
urls=['https://{host}/rss-bridge/'])
|
||||
self.add(webserver)
|
||||
|
||||
users_and_groups = UsersAndGroups('users-and-groups-rssbridge',
|
||||
groups=groups)
|
||||
self.add(users_and_groups)
|
||||
|
||||
backup_restore = BackupRestore('backup-restore-rssbridge',
|
||||
**manifest.backup)
|
||||
self.add(backup_restore)
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
app.setup(old_version)
|
||||
helper.call('post', app.enable)
|
||||
@ -0,0 +1,21 @@
|
||||
##
|
||||
## On all sites, provide RSS-Bridge on a default path: /rss-bridge
|
||||
## Allow valid LDAP users from groups 'feed-reader' and 'admin'.
|
||||
##
|
||||
Alias /rss-bridge /usr/share/rss-bridge
|
||||
|
||||
<Location /rss-bridge>
|
||||
<If "%{QUERY_STRING} =~ /format=[^H]/">
|
||||
# Formats: Atom, Json, Mrss and Plaintext
|
||||
Include includes/freedombox-auth-ldap.conf
|
||||
Require ldap-group cn=admin,ou=groups,dc=thisbox
|
||||
Require ldap-group cn=feed-reader,ou=groups,dc=thisbox
|
||||
</If>
|
||||
<Else>
|
||||
# Formats: Html and all other pages
|
||||
Include includes/freedombox-single-sign-on.conf
|
||||
<IfModule mod_auth_pubtkt.c>
|
||||
TKTAuthToken "feed-reader" "admin"
|
||||
</IfModule>
|
||||
</Else>
|
||||
</Location>
|
||||
@ -0,0 +1 @@
|
||||
plinth.modules.rssbridge
|
||||
17
plinth/modules/rssbridge/manifest.py
Normal file
17
plinth/modules/rssbridge/manifest.py
Normal file
@ -0,0 +1,17 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
"""
|
||||
Application manifest for RSS-Bridge.
|
||||
"""
|
||||
|
||||
clients = [{
|
||||
'name': _('RSS-Bridge'),
|
||||
'platforms': [{
|
||||
'type': 'web',
|
||||
'url': '/rss-bridge/'
|
||||
}]
|
||||
}]
|
||||
|
||||
backup = {}
|
||||
13
plinth/modules/rssbridge/urls.py
Normal file
13
plinth/modules/rssbridge/urls.py
Normal file
@ -0,0 +1,13 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""
|
||||
URLs for the RSS-Bridge module.
|
||||
"""
|
||||
|
||||
from django.urls import re_path
|
||||
|
||||
from plinth.views import AppView
|
||||
|
||||
urlpatterns = [
|
||||
re_path(r'^apps/rssbridge/$', AppView.as_view(app_id='rssbridge'),
|
||||
name='index'),
|
||||
]
|
||||
@ -50,6 +50,7 @@ markers = [
|
||||
"quassel",
|
||||
"radicale",
|
||||
"roundcube",
|
||||
"rssbridge",
|
||||
"samba",
|
||||
"searx",
|
||||
"security",
|
||||
|
||||
BIN
static/themes/default/icons/rssbridge.png
Normal file
BIN
static/themes/default/icons/rssbridge.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
103
static/themes/default/icons/rssbridge.svg
Normal file
103
static/themes/default/icons/rssbridge.svg
Normal file
@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="512"
|
||||
height="512"
|
||||
viewBox="0 0 135.46666 135.46666"
|
||||
version="1.1"
|
||||
id="svg1551"
|
||||
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||
sodipodi:docname="logo.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<defs
|
||||
id="defs1545" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98994949"
|
||||
inkscape:cx="156.57364"
|
||||
inkscape:cy="340.92649"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="g1492"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1846"
|
||||
inkscape:window-height="1016"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:pagecheckerboard="0"
|
||||
units="px"
|
||||
width="512px" />
|
||||
<metadata
|
||||
id="metadata1548">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-197)">
|
||||
<g
|
||||
style="fill:#1182db;fill-opacity:1"
|
||||
id="g1492"
|
||||
transform="matrix(1.063066,0,0,1.063066,31.239097,-1662.8034)"
|
||||
inkscape:export-xdpi="84.084839"
|
||||
inkscape:export-ydpi="84.084839">
|
||||
<rect
|
||||
ry="21.264336"
|
||||
rx="21.38586"
|
||||
y="1753.8333"
|
||||
x="-25.02375"
|
||||
height="118.70615"
|
||||
width="118.70615"
|
||||
id="rect1480"
|
||||
style="vector-effect:none;fill:none;fill-opacity:1;stroke:#1182db;stroke-width:8.72401;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<g
|
||||
id="g1490"
|
||||
transform="matrix(1.2265219,0,0,1.2265219,1367.2192,-933.0482)"
|
||||
style="fill:#1182db;fill-opacity:1;stroke-width:2.37724">
|
||||
<g
|
||||
style="fill:#1182db;fill-opacity:1;stroke-width:3.88193"
|
||||
transform="matrix(0.61238525,0,0,0.61238525,-1199.6119,2184.4357)"
|
||||
id="g1488">
|
||||
<path
|
||||
style="opacity:1;vector-effect:none;fill:#1182db;fill-opacity:1;stroke:none;stroke-width:29.3437;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:58.6875, 117.375;stroke-dashoffset:0;stroke-opacity:1"
|
||||
d="m 541.51249,525.34565 c -10.41315,-4.00956 -14.78996,-6.8636 -21.21485,-13.83378 -9.51065,-10.31784 -12.16446,-17.61997 -12.22497,-33.63782 -0.0451,-11.93786 0.4192,-14.53892 3.85734,-21.60913 4.60063,-9.46079 15.51168,-20.18661 24.98644,-24.56227 5.4253,-2.50553 9.38434,-3.11239 20.31033,-3.11325 11.66691,-9.2e-4 14.67404,0.52181 21.42857,3.7249 9.99443,4.73949 19.32279,14.0885 24.07789,24.13117 5.25545,11.09941 5.95363,27.48145 1.65888,38.9238 -4.02442,10.72212 -14.87839,22.6043 -25.31059,27.7083 -10.28725,5.03309 -27.6637,6.08212 -37.56904,2.26808 z"
|
||||
id="path1482"
|
||||
inkscape:connector-curvature="0"
|
||||
transform="scale(0.26458333)" />
|
||||
<path
|
||||
style="opacity:1;vector-effect:none;fill:#1182db;fill-opacity:1;stroke:none;stroke-width:29.3437;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:58.6875, 117.375;stroke-dashoffset:0;stroke-opacity:1"
|
||||
d="m 683.89345,526.92166 c -0.52382,-0.5238 -0.96246,-2.93451 -0.97477,-5.35714 -0.0352,-6.92667 -5.18979,-29.62173 -10.01089,-44.07679 C 648.75042,405.05698 592.21848,359.91722 516.2625,352.40923 l -9.75001,-0.96376 0.31432,-35.60003 c 0.17288,-19.58002 0.82532,-36.11103 1.44987,-36.73558 1.81708,-1.81708 35.29533,1.40642 53.50247,5.15156 47.00787,9.66933 86.72265,29.83563 117.9638,59.89942 22.60831,21.7563 38.25173,44.31995 51.33931,74.05042 11.72719,26.64016 21.65262,66.64856 24.10447,97.16279 l 1.00439,12.5 h -35.67264 c -19.61996,0 -36.10123,-0.42858 -36.62503,-0.95239 z"
|
||||
id="path1484"
|
||||
inkscape:connector-curvature="0"
|
||||
transform="scale(0.26458333)" />
|
||||
<path
|
||||
style="opacity:1;vector-effect:none;fill:#1182db;fill-opacity:1;stroke:none;stroke-width:29.3437;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:58.6875, 117.375;stroke-dashoffset:0;stroke-opacity:1"
|
||||
d="m 823.42333,526.81959 -8.80344,-0.50396 -0.79067,-6.72078 c -0.43486,-3.69645 -1.19383,-10.89938 -1.68659,-16.00652 -4.34718,-45.05596 -23.32007,-100.71198 -47.77185,-140.13638 -22.38739,-36.09589 -54.4142,-68.56278 -89.46856,-90.69793 -41.25297,-26.04928 -95.0629,-43.89344 -148.38973,-49.20819 -9.42857,-0.93969 -17.94643,-1.93722 -18.92857,-2.21675 -1.37004,-0.38992 -1.78572,-9.19669 -1.78572,-37.83338 v -37.32517 l 15.35715,0.93347 c 45.68823,2.77713 80.32407,8.98439 117.5,21.05774 91.16555,29.60718 160.46184,87.77122 202.6182,170.06818 24.63558,48.09321 41.9844,114.7859 45.52317,175.00127 l 0.86054,14.64286 -27.71524,-0.27526 c -15.24339,-0.15139 -31.6768,-0.50203 -36.51869,-0.7792 z"
|
||||
id="path1486"
|
||||
inkscape:connector-curvature="0"
|
||||
transform="scale(0.26458333)" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.6 KiB |
Loading…
x
Reference in New Issue
Block a user