Giter Club home page Giter Club logo

keepitup's People

Contributors

aiyionprime avatar lemoer avatar moridius avatar

Stargazers

 avatar

Watchers

 avatar  avatar

keepitup's Issues

Bug: Alarm mails are not sent (regression)

This is a regression based on the changes done in #6, #9 or #13.

Mär 24 13:26:27 harvester python[16130]: Traceback (most recent call last):
Mär 24 13:26:27 harvester python[16130]:   File "/opt/keepitup/ping_worker.py", line 28, in <module>
Mär 24 13:26:27 harvester python[16130]:     alarm = n.check(session)
Mär 24 13:26:27 harvester python[16130]:   File "/opt/keepitup/main.py", line 342, in check
Mär 24 13:26:27 harvester python[16130]:     alarm.send_notification_mails(session)
Mär 24 13:26:27 harvester python[16130]:   File "/opt/keepitup/main.py", line 255, in send_notification_mails
Mär 24 13:26:27 harvester python[16130]:     mail_template = self.get_mail_template("resolved")
Mär 24 13:26:27 harvester python[16130]: AttributeError: 'Alarm' object has no attribute 'get_mail_template'

I am not sure if only "resolved"-Mails are affected. Maybe "problem"-Mails are also affected.

Verbesserungsvorschläge

  • Es gibt keinen "SignIn"
  • Was bedeutet der Status Waiting?
  • Ist das Tool auf Deutsch oder auf Englisch? Vll sollten wir es auf Deutsch umbauen?
  • Kann man sich auch unsubscriben?
  • "Der Titel heißt HelloFromFlask"
  • Reihenfolge der Nodes ist noch zufällig?
  • "Alle Nodes die von irgendwem subscribed werden" rauswerfen
  • Evtl. den Subscribe-Button schon anzeigen, wenn man noch nicht eingeloggt ist. Dann auf das Subscribe-EMail-Ding verweisen.
  • Was passiert, wenn ein Supernode weg ist?
    • Ganz viele Mails. Siehe 28.01.2021 22:11 Uhr
  • Zeitstempel in den Mailbetreff. Ggf. auch die Dauer des Alarms beim resolved mit in die Mail?
  • Alarme anders herum sortieren
  • Ist da evtl. eine Stunde Versatz beim anzeigen der Alarms?
  • Alarme erst nach 1 Stunde offline senden (?)
  • Abhängigkeiten von Adressen einführen?
    • "Beschwer dich nicht über NodeX, wenn NodeY nicht erreichbar ist."
  • Die Mail-Header sind malformed.
    • Unter anderem der Timestamp in der Mail ist kaputt.

feature idea 'keepituptodate'

As a user might have various reasons to disable his autoupdater,
keepitup might just be the place to notify users, they might upgrade their router.

Babel.localeselector missing in flask-babel 3.0.0

  • Babel.locale_selector and Babel.timezone_selector no longer exist. They must be provided
    either when the Babel() object is created or when init_app() is called. This is to support
    having a single Babel object for multiple Flask apps (#107) as well as to simplify settings
    and multi-threaded state.

https://github.com/python-babel/flask-babel/blob/master/CHANGELOG Section 3.0.0

One option would be to temporarily pin flask-babel to 2.0.0 as well.

@moridius started working on a proper fix, which gets rid of the decorator.

Worker crashes sometimes during mail send

Feb 21 01:15:24 harvester python[2332]: Traceback (most recent call last):
Feb 21 01:15:24 harvester python[2332]:   File "/opt/keepitup/ping_worker.py", line 35, in <module>
Feb 21 01:15:24 harvester python[2332]:     alarm = n.check(session)
Feb 21 01:15:24 harvester python[2332]:   File "/opt/keepitup/main.py", line 446, in check
Feb 21 01:15:24 harvester python[2332]:     alarm.send_notification_mails(session)
Feb 21 01:15:24 harvester python[2332]:   File "/opt/keepitup/main.py", line 284, in send_notification_mails
Feb 21 01:15:24 harvester python[2332]:     self.alarm_mail_msgid = user.send_mail(mail_template, node=node, url=url)
Feb 21 01:15:24 harvester python[2332]:   File "/opt/keepitup/main.py", line 89, in send_mail
Feb 21 01:15:24 harvester python[2332]:     server.sendmail(SMTP_FROM, self.email, mail)
Feb 21 01:15:24 harvester python[2332]:   File "/usr/lib/python3.7/smtplib.py", line 855, in sendmail
Feb 21 01:15:24 harvester python[2332]:     msg = _fix_eols(msg).encode('ascii')
Feb 20 19:02:45 harvester python[2332]: UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 265: ordinal not in range(128)

Translate to german

As Hannover is in Germany we should translate the tool to german in order to keep it simple for the majority of users. This was already suggested in #1.

I would suggest two steps:

  1. Translate everything to german (hardcoded) as a quick solution.
  2. Check out Flask-Babel or similar and see whether we can provide a german and an english version.

I will send a PR for step 1 if desired.

Startup fails if nodes.json cannot be fetched

barfs traceback and dies.

Dez 30 23:06:14 harvester systemd[1]: Started The KeepItUp Worker pings and sends notification mails.
Dez 30 23:06:16 harvester python[585]: ping_worker.py, 451 nodes loaded.
Dez 30 23:06:16 harvester python[585]: Traceback (most recent call last):
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/urllib3/connection.py", line 170, in _new_conn
Dez 30 23:06:16 harvester python[585]:     (self._dns_host, self.port), self.timeout, **extra_kw
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 96, in create_connection
Dez 30 23:06:16 harvester python[585]:     raise err
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 86, in create_connection
Dez 30 23:06:16 harvester python[585]:     sock.connect(sa)
Dez 30 23:06:16 harvester python[585]: ConnectionRefusedError: [Errno 111] Connection refused
Dez 30 23:06:16 harvester python[585]: During handling of the above exception, another exception occurred:
Dez 30 23:06:16 harvester python[585]: Traceback (most recent call last):
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 706, in urlopen
Dez 30 23:06:16 harvester python[585]:     chunked=chunked,
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 382, in _make_request
Dez 30 23:06:16 harvester python[585]:     self._validate_conn(conn)
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
Dez 30 23:06:16 harvester python[585]:     conn.connect()
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/urllib3/connection.py", line 353, in connect
Dez 30 23:06:16 harvester python[585]:     conn = self._new_conn()
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/urllib3/connection.py", line 182, in _new_conn
Dez 30 23:06:16 harvester python[585]:     self, "Failed to establish a new connection: %s" % e
Dez 30 23:06:16 harvester python[585]: urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f73b3c938d0>: Failed to establish a new connection:
Dez 30 23:06:16 harvester python[585]: During handling of the above exception, another exception occurred:
Dez 30 23:06:16 harvester python[585]: Traceback (most recent call last):
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
Dez 30 23:06:16 harvester python[585]:     timeout=timeout
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 756, in urlopen
Dez 30 23:06:16 harvester python[585]:     method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 573, in increment
Dez 30 23:06:16 harvester python[585]:     raise MaxRetryError(_pool, url, error or ResponseError(cause))
Dez 30 23:06:16 harvester python[585]: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='harvester.ffh.zone', port=443): Max retries exceeded with url: /api/nodes.json
Dez 30 23:06:16 harvester python[585]: During handling of the above exception, another exception occurred:
Dez 30 23:06:16 harvester python[585]: Traceback (most recent call last):
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/ping_worker.py", line 19, in <module>
Dez 30 23:06:16 harvester python[585]:     nodes_json_cache.update()
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/main.py", line 144, in update
Dez 30 23:06:16 harvester python[585]:     res = requests.get(NODES_JSON_URL)
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/requests/api.py", line 76, in get
Dez 30 23:06:16 harvester python[585]:     return request('get', url, params=params, **kwargs)
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/requests/api.py", line 61, in request
Dez 30 23:06:16 harvester python[585]:     return session.request(method=method, url=url, **kwargs)
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/requests/sessions.py", line 542, in request
Dez 30 23:06:16 harvester python[585]:     resp = self.send(prep, **send_kwargs)
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/requests/sessions.py", line 655, in send
Dez 30 23:06:16 harvester python[585]:     r = adapter.send(request, **kwargs)
Dez 30 23:06:16 harvester python[585]:   File "/opt/keepitup/venv/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
Dez 30 23:06:16 harvester python[585]:     raise ConnectionError(e, request=request)
Dez 30 23:06:16 harvester python[585]: requests.exceptions.ConnectionError: HTTPSConnectionPool(host='harvester.ffh.zone', port=443): Max retries exceeded with url: /api/nodes.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.