diff --git a/config.py b/config.py index 106f833..8cc80f9 100644 --- a/config.py +++ b/config.py @@ -40,6 +40,7 @@ def set_debug_flag(debug): TRACKER_PASSWORD_LENGTH_MAX = config_tracker.getint('password_length_max') TRACKER_SUMMARY_LENGTH_MAX = config_tracker.getint('summary_length_max') TRACKER_LOG_ENTRIES_PER_PAGE = config_tracker.getint('log_entries_per_page') +TRACKER_FEED_ADVISORY_ENTRIES = config_tracker.getint('feed_advisory_entries') config_sqlite = config['sqlite'] SQLITE_JOURNAL_MODE = config_sqlite['journal_mode'] diff --git a/config/00-default.conf b/config/00-default.conf index 9eb7c46..ae01afc 100644 --- a/config/00-default.conf +++ b/config/00-default.conf @@ -8,6 +8,7 @@ password_length_min = 16 password_length_max = 64 summary_length_max = 200 log_entries_per_page = 10 +feed_advisory_entries = 15 [pacman] handle_cache_time = 120 diff --git a/tracker/view/advisory.py b/tracker/view/advisory.py index 1450b53..d659f2b 100644 --- a/tracker/view/advisory.py +++ b/tracker/view/advisory.py @@ -10,6 +10,7 @@ from pytz import UTC from sqlalchemy import and_ +from config import TRACKER_FEED_ADVISORY_ENTRIES from config import TRACKER_ISSUE_URL from tracker import db from tracker import tracker @@ -60,8 +61,8 @@ def get_advisory_data(): @tracker.route('/advisories/feed.atom', methods=['GET']) @tracker.route('/advisory/feed.atom', methods=['GET']) def advisory_atom(): - last_recent_entries = 15 - data = get_advisory_data()['published'][:last_recent_entries] + data = get_advisory_data()['published'][:TRACKER_FEED_ADVISORY_ENTRIES] + feed = FeedGenerator() feed.title('Arch Linux Security - Recent advisories') feed.description('Arch Linux recent advsisories RSS feed')