1
0
mirror of https://github.com/aquatix/digimarks.git synced 2025-12-06 23:05:10 +01:00

45 Commits

Author SHA1 Message Date
3fbab07944 requests security update and more 2025-06-11 09:20:54 +02:00
db091ae02e Flask security update and more 2025-05-21 12:24:53 +02:00
24935dad9f jinja2 security update and more 2025-01-10 14:59:56 +01:00
6864e7f5a4 werkzeug security update and more 2024-12-10 21:16:03 +01:00
ed8e02f0d5 New certifi, latest dependencies 2024-09-06 22:02:08 +02:00
76e4924e2c certifi security update and more 2024-07-07 11:27:39 +02:00
a35fbffaec requests security update and more 2024-05-26 14:08:19 +02:00
fad7dc59bc jinja2 security update and more 2024-05-08 23:00:56 +02:00
1a4ca1a4c7 Merge pull request #39 from aquatix/snyk-fix-98ecd74aa298dc47942423af99957199
[Snyk] Security upgrade idna from 3.6 to 3.7
2024-04-14 21:55:20 +02:00
snyk-bot
ad614b2872 fix: requirements.txt to reduce vulnerabilities
The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-IDNA-6597975
2024-04-14 19:32:08 +00:00
b658651c07 Security update for peewee and more 2024-03-02 11:08:11 +01:00
c1d795e704 Merge pull request #37 from aquatix/snyk-fix-67c48228bceafdd6ed7fac5925180c4f
[Snyk] Security upgrade jinja2 from 3.1.2 to 3.1.3
2024-02-11 16:13:10 +01:00
4b36b448cf jinja2 security update and more 2024-01-11 20:53:24 +01:00
snyk-bot
29b1d045cd fix: requirements.txt to reduce vulnerabilities
The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-JINJA2-6150717
2024-01-11 14:48:51 +00:00
d8bf52c9d2 urllib3 security update and more 2023-10-21 19:02:42 +02:00
010905086f urllib security update; latest Flask and everything 2023-10-04 11:10:43 +02:00
a4225829e3 certifi security update and more 2023-07-26 22:59:53 +02:00
f3dff354fc requests security update 2023-05-23 22:38:31 +02:00
ca71fa66df flask security update and more 2023-05-09 09:14:34 +02:00
09ab5acf76 Security updates 2023-02-16 10:22:42 +01:00
e90d35238a Security updates 2022-12-09 11:51:50 +01:00
3092f83c8b Serve the search JS with the correct mimetype 2022-07-23 11:10:55 +02:00
a27787e956 Dependency updates 2022-07-23 11:10:50 +02:00
21800911db Security: lxml; more updates 2022-07-13 18:45:34 +02:00
20a3d9f838 Latest everything 2022-04-23 09:09:50 +02:00
0ab3bd2263 Security: lxml; more updates 2021-12-13 21:28:43 +01:00
32b074b859 Security: urllib3; more updates 2021-07-06 15:10:18 +02:00
5789bbe006 Latest everything 2021-03-25 10:16:17 +01:00
2ef7358ac7 Jinja2 security fix; new-style pip-tools requirements 2021-02-02 08:51:18 +01:00
d1e590390c lxml security update and more 2020-12-02 09:19:05 +01:00
7a1bc11004 Replaced deprecated AtomFeed by feedgen; some dep updates 2020-07-28 14:52:44 +02:00
315c664fcc Document the RapidAPI (MashApe) key for favicons 2020-05-06 14:04:33 +02:00
db5944cec4 Werkzeug 1.0 has deprecated the AtomFeed 2020-05-06 14:02:09 +02:00
Michiel Scholten
becb734d17 Merge pull request #19 from mnishig/doc-MASHAPE_API_KEY
Add description for 'MASHAPE_API_KEY'
2020-05-06 13:56:57 +02:00
64ee0856c5 (Security) bumps 2020-05-05 19:59:27 +02:00
Masahide Nishihama
6c2be3070e add description 'MASHAPE_API_KEY' 2020-04-28 10:30:52 +09:00
426c2eda68 RapidAPI all the things 2020-04-16 13:34:10 +02:00
b0e53d4a85 Back to a version that actually works 2020-03-20 20:47:58 +01:00
1f69d9e53f Lots of updates 2020-03-20 20:44:28 +01:00
Michiel Scholten
fc27d9f186 Merge pull request #17 from aquatix/snyk-fix-e8cd4803e12d5fe482405c22b3c5b385
[Snyk] Security upgrade urllib3 from 1.25.3 to 1.25.8
2020-03-07 09:22:34 +01:00
snyk-bot
6341b384bf fix: requirements.txt to reduce vulnerabilities
The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-URLLIB3-559452
2020-03-07 07:48:53 +00:00
f698ebfe18 Security updates for Flask&Werkzeug, more version bumps 2019-08-12 19:27:49 +02:00
9f736ffe82 Move to RapidAPI url for favicons API 2019-07-27 10:45:04 +02:00
e1a45a21b5 urllib3 security update, more version bumps 2019-05-04 10:41:49 +02:00
9492d26511 Security update for urllib3, more bumps 2019-04-19 21:08:49 +02:00
6 changed files with 151 additions and 67 deletions

View File

@@ -39,6 +39,8 @@ Usage / example configuration
Copy ``settings.py`` from example_config to the parent directory and Copy ``settings.py`` from example_config to the parent directory and
configure to your needs (*at the least* change the value of `SYSTEMKEY`). configure to your needs (*at the least* change the value of `SYSTEMKEY`).
Do not forget to fill in the `MASHAPE_API_KEY` value, which you [can request on the RapidAPI website](https://rapidapi.com/realfavicongenerator/api/realfavicongenerator).
Run digimarks as a service under nginx or apache and call the appropriate Run digimarks as a service under nginx or apache and call the appropriate
url's when wanted. url's when wanted.

View File

@@ -10,10 +10,11 @@ import sys
import bs4 import bs4
import requests import requests
from flask import (Flask, abort, jsonify, redirect, render_template, request, from dateutil import tz
url_for) from feedgen.feed import FeedGenerator
from flask import (Flask, abort, jsonify, make_response, redirect,
render_template, request, url_for)
from peewee import * # noqa from peewee import * # noqa
from werkzeug.contrib.atom import AtomFeed
try: try:
# Python 3 # Python 3
@@ -357,14 +358,14 @@ class Bookmark(BaseModel):
def _set_favicon_with_realfavicongenerator(self, domain): def _set_favicon_with_realfavicongenerator(self, domain):
""" Fetch favicon for the domain """ """ Fetch favicon for the domain """
response = requests.get( response = requests.get(
'https://realfavicongenerator.p.mashape.com/favicon/icon?platform=android_chrome&site=' + domain, 'https://realfavicongenerator.p.rapidapi.com/favicon/icon?platform=android_chrome&site=' + domain,
stream=True, stream=True,
headers={'User-Agent': DIGIMARKS_USER_AGENT, 'X-Mashape-Key': settings.MASHAPE_API_KEY} headers={'User-Agent': DIGIMARKS_USER_AGENT, 'X-Mashape-Key': settings.MASHAPE_API_KEY}
) )
if response.status_code == 404: if response.status_code == 404:
# Fall back to desktop favicon # Fall back to desktop favicon
response = requests.get( response = requests.get(
'https://realfavicongenerator.p.mashape.com/favicon/icon?platform=desktop&site=' + domain, 'https://realfavicongenerator.p.rapidapi.com/favicon/icon?platform=desktop&site=' + domain,
stream=True, stream=True,
headers={'User-Agent': DIGIMARKS_USER_AGENT, 'X-Mashape-Key': settings.MASHAPE_API_KEY} headers={'User-Agent': DIGIMARKS_USER_AGENT, 'X-Mashape-Key': settings.MASHAPE_API_KEY}
) )
@@ -604,10 +605,12 @@ def bookmarks_js(userkey):
Bookmark.userkey == userkey, Bookmark.userkey == userkey,
Bookmark.status == Bookmark.VISIBLE Bookmark.status == Bookmark.VISIBLE
).order_by(Bookmark.created_date.desc()) ).order_by(Bookmark.created_date.desc())
return render_template( resp = make_response(render_template(
'bookmarks.js', 'bookmarks.js',
bookmarks=bookmarks bookmarks=bookmarks
) ))
resp.headers['Content-type'] = 'text/javascript; charset=utf-8'
return resp
@app.route('/r/<userkey>/<urlhash>') @app.route('/r/<userkey>/<urlhash>')
@@ -960,23 +963,34 @@ def publictag_feed(tagkey):
Bookmark.tags.contains(this_tag.tag), Bookmark.tags.contains(this_tag.tag),
Bookmark.status == Bookmark.VISIBLE Bookmark.status == Bookmark.VISIBLE
) )
feed = AtomFeed(this_tag.tag, feed_url=request.url, url=make_external(url_for('publictag_page', tagkey=tagkey)))
feed = FeedGenerator()
feed.title(this_tag.tag)
feed.id(request.url)
feed.link(href=request.url, rel='self')
feed.link(href=make_external(url_for('publictag_page', tagkey=tagkey)))
for bookmark in bookmarks: for bookmark in bookmarks:
entry = feed.add_entry()
updated_date = bookmark.modified_date updated_date = bookmark.modified_date
if not bookmark.modified_date: if not bookmark.modified_date:
updated_date = bookmark.created_date updated_date = bookmark.created_date
bookmarktitle = '{} (no title)'.format(bookmark.url) bookmarktitle = '{} (no title)'.format(bookmark.url)
if bookmark.title: if bookmark.title:
bookmarktitle = bookmark.title bookmarktitle = bookmark.title
feed.add(
bookmarktitle, entry.id(bookmark.url)
content_type='html', entry.title(bookmarktitle)
author='digimarks', entry.link(href=bookmark.url)
url=bookmark.url, entry.author(name='digimarks')
updated=updated_date, entry.pubdate(bookmark.created_date.replace(tzinfo=tz.tzlocal()))
published=bookmark.created_date entry.published(bookmark.created_date.replace(tzinfo=tz.tzlocal()))
) entry.updated(updated_date.replace(tzinfo=tz.tzlocal()))
return feed.get_response()
response = make_response(feed.atom_str(pretty=True))
response.headers.set('Content-Type', 'application/atom+xml')
return response
except PublicTag.DoesNotExist: except PublicTag.DoesNotExist:
abort(404) abort(404)

View File

@@ -10,6 +10,10 @@ DEBUG = False
# echo -n "yourstring" | sha1sum # echo -n "yourstring" | sha1sum
SYSTEMKEY = 'S3kr1t' SYSTEMKEY = 'S3kr1t'
# RapidAPI key for favicons
# https://rapidapi.com/realfavicongenerator/api/realfavicongenerator
MASHAPE_API_KEY = 'your_MASHAPE_key'
LOG_LOCATION = 'digimarks.log' LOG_LOCATION = 'digimarks.log'
#LOG_LOCATION = '/var/log/digimarks/digimarks.log' #LOG_LOCATION = '/var/log/digimarks/digimarks.log'
# How many logs to keep in log rotation: # How many logs to keep in log rotation:

View File

@@ -1,29 +1,61 @@
# # This file was autogenerated by uv via the following command:
# This file is autogenerated by pip-compile # uv pip compile requirements-dev.in
# To update, run: astroid==3.3.10
# # via pylint
# pip-compile requirements-dev.in --upgrade beautifulsoup4==4.13.4
# # via bs4
astroid==2.2.5 # via pylint blinker==1.9.0
beautifulsoup4==4.7.1 # via bs4 # via flask
bs4==0.0.1 bs4==0.0.2
certifi==2019.3.9 # via requests # via -r requirements.in
chardet==3.0.4 # via requests certifi==2025.4.26
click==7.0 # via flask # via requests
flask==1.0.2 charset-normalizer==3.4.2
idna==2.8 # via requests # via requests
isort==4.3.17 # via pylint click==8.2.1
itsdangerous==1.1.0 # via flask # via flask
jinja2==2.10.1 # via flask dill==0.4.0
lazy-object-proxy==1.3.1 # via astroid # via pylint
markupsafe==1.1.1 # via jinja2 feedgen==1.0.0
mccabe==0.6.1 # via pylint # via -r requirements.in
peewee==3.9.3 flask==3.1.1
pylint==2.3.1 # via -r requirements.in
requests==2.21.0 idna==3.10
six==1.12.0 # via astroid # via requests
soupsieve==1.9 # via beautifulsoup4 isort==6.0.1
typed-ast==1.3.1 # via astroid # via pylint
urllib3==1.24.1 # via requests itsdangerous==2.2.0
werkzeug==0.15.2 # via flask # via flask
wrapt==1.11.1 # via astroid jinja2==3.1.6
# via flask
lxml==5.4.0
# via feedgen
markupsafe==3.0.2
# via
# flask
# jinja2
# werkzeug
mccabe==0.7.0
# via pylint
peewee==3.18.1
# via -r requirements.in
platformdirs==4.3.8
# via pylint
pylint==3.3.7
# via -r requirements-dev.in
python-dateutil==2.9.0.post0
# via feedgen
requests==2.32.4
# via -r requirements.in
six==1.17.0
# via python-dateutil
soupsieve==2.7
# via beautifulsoup4
tomlkit==0.13.3
# via pylint
typing-extensions==4.14.0
# via beautifulsoup4
urllib3==2.4.0
# via requests
werkzeug==3.1.3
# via flask

View File

@@ -1,4 +1,10 @@
# Core application
flask flask
peewee peewee
# Fetch title etc from links
bs4 bs4
requests requests
# Generate (atom) feeds for tags and such
feedgen

View File

@@ -1,21 +1,47 @@
# # This file was autogenerated by uv via the following command:
# This file is autogenerated by pip-compile # uv pip compile requirements.in
# To update, run: beautifulsoup4==4.13.4
# # via bs4
# pip-compile requirements.in --upgrade blinker==1.9.0
# # via flask
beautifulsoup4==4.7.1 # via bs4 bs4==0.0.2
bs4==0.0.1 # via -r requirements.in
certifi==2019.3.9 # via requests certifi==2025.4.26
chardet==3.0.4 # via requests # via requests
click==7.0 # via flask charset-normalizer==3.4.2
flask==1.0.2 # via requests
idna==2.8 # via requests click==8.2.1
itsdangerous==1.1.0 # via flask # via flask
jinja2==2.10.1 # via flask feedgen==1.0.0
markupsafe==1.1.1 # via jinja2 # via -r requirements.in
peewee==3.9.3 flask==3.1.1
requests==2.21.0 # via -r requirements.in
soupsieve==1.9 # via beautifulsoup4 idna==3.10
urllib3==1.24.1 # via requests # via requests
werkzeug==0.15.2 # via flask itsdangerous==2.2.0
# via flask
jinja2==3.1.6
# via flask
lxml==5.4.0
# via feedgen
markupsafe==3.0.2
# via
# flask
# jinja2
# werkzeug
peewee==3.18.1
# via -r requirements.in
python-dateutil==2.9.0.post0
# via feedgen
requests==2.32.4
# via -r requirements.in
six==1.17.0
# via python-dateutil
soupsieve==2.7
# via beautifulsoup4
typing-extensions==4.14.0
# via beautifulsoup4
urllib3==2.4.0
# via requests
werkzeug==3.1.3
# via flask