Commit Graph

439 Commits

Author SHA1 Message Date
Adrian Schmutzler 672b8d55fc Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 16:42:58 +01:00
Adrian Schmutzler 41ef7f281a api.py/application.py: Write extended information to full log
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 20:25:16 +01:00
Adrian Schmutzler 636a8d3baa routertools: Use custom file for full log, do not write to syslog
It is easier to evaluate a specific log which is not crowded with
messages from other programs

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 20:25:16 +01:00
Adrian Schmutzler 1c80bafc10 routertools/alfred: New routers are always 'online'
Since other states are only evaluated correctly on a CHANGE, we
set status to 'online' for new routers, so that the second call
can log unknown events.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 20:25:16 +01:00
Adrian Schmutzler 69fbcd3181 routertools/alfred: Catch malformatted coordinates
The puts a router with malformatted coordinates into the default
hood.

Note:
For a comma instead of dot (lat=48,3), the Monitoring will assign
default, while the keyserver will use floor(), resulting in
lat=48.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 20:25:16 +01:00
Adrian Schmutzler 53c9dc11fd routertools/alfred: Improve exception logging
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 20:25:16 +01:00
Adrian Schmutzler 7a678a73c6 routertools/alfred: Set status earlier
This prevent a variable-not-found error when status is not set
in except statement.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 20:25:16 +01:00
Adrian Schmutzler 48bf9c008b calcglobalstats/deletestats: Improve duration logging and output
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 20:25:00 +01:00
Adrian Schmutzler 80f20f4d0c routertools/deletestats: Split and improve netif stats deletion
This patch reorganizes the deletion of old stats:
- Commits are done after each step
- Netif stats deletion is split into UPDATE and DELETE
- Delays are added, to reduce locking

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 20:04:10 +01:00
Adrian Schmutzler 7e821b2ae7 config: Global/hood stats are stored for an entire year
Database demand for those stats is relatively low, so they can be
stored excessively.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:52:14 +01:00
Adrian Schmutzler 20eedde52e config.py: Add explanation for options
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:52:08 +01:00
Adrian Schmutzler f52af65c1c routertools/config: Add minimum time difference for router stats
This prevents errors due to the same router being sent twice in
the same second.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:52:02 +01:00
Adrian Schmutzler 9e6e3c8dbf routertools/alfred: Minimize time without router_netif data
Rearrange queries to have a minimum time where netifs for router
are not present.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:51:49 +01:00
Adrian Schmutzler a994ec114a MySQL stats: Convert from datetime to int
DB scripts still need to be updated.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:49:46 +01:00
Adrian Schmutzler ce4193556a router.html: Add permalink
This is fixed to the br-mesh address. If a router has no br-mesh,
no perma-link is displayed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:46:46 +01:00
Adrian Schmutzler f56d70ea55 application.py: Introduce /mac/<routermac> URL for shorter links
The behavior is equivalent to get_router_by_mac, just shorter.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:46:06 +01:00
Adrian Schmutzler e37214eb91 helpers: Enable search for routers by neighbors
If neighbor:<mac-address> or neighbour:<mac-address> is searched,
the routers having this neighbor are returned.

Regex is enabled.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:45:46 +01:00
Adrian Schmutzler 42a0a016a6 bootstrap.html: Add meta-tag google notranslate
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:45:32 +01:00
Adrian Schmutzler 8b81445991 bootstrap.html: Add content language
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:45:26 +01:00
Adrian Schmutzler 8d8436c7f7 mysqltools: Use UTF8 in mysqldb module
The MySQLdb python module needs this explicitly, otherwise it
defaults to latin-1.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:45:03 +01:00
Adrian Schmutzler a1024baea0 routertools/alfred: Recognize MySQL lock as specific exception
This will not change the router status to unknown

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:44:33 +01:00
Adrian Schmutzler b016489cfb scripts: Add crontiles.sh
Provide regular restart of uwsgi-tiles as a workaround for
missing dots.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:44:00 +01:00
Adrian Schmutzler 4fa16a738a api/alfred: Get IP address of alfred senders
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:41:59 +01:00
Adrian Schmutzler e4c1b17801 maptools.py: Only show best connection based on quality in map
Fixes #92

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:41:07 +01:00
Adrian Schmutzler d5043afb71 user.html: Replace spaces in user name to support query string
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:40:24 +01:00
Adrian Schmutzler 6b24fc89fd helpers: Enable regex for user nickname
Fixes link from user detail page already containing regex

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:40:16 +01:00
Adrian Schmutzler d2789a51df statistics.html: Increase y-limit for online/offline graph
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 22:12:03 +01:00
Adrian Schmutzler bd4495e660 statistics.html: Add total value to routers graph
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 22:12:03 +01:00
Adrian Schmutzler 7b4aaa2b50 statistics.html: Display less new routers and realign stats
This moves the online/offline and client stats to the right side.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 22:11:42 +01:00
Adrian Schmutzler d0d173d935 Introduce debugging function
This adds a timestamp to all debug outputs

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 22:02:27 +01:00
Adrian Schmutzler d71d35af10 query string: Use beginning and end markers
Since we use regex for the query string, we have to set markers
for beginning and end when we want to match only the whole field.

Fixes #85

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 22:02:16 +01:00
Adrian Schmutzler 17ea9274bb config: Router stats are stored for 14 days instead of 7
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 22:01:51 +01:00
Adrian Schmutzler 846f66281e routertools: Don't delete old stats of offline routers
With this patch, router stats are only deleted if the router
is online or missing in the router table.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 22:01:44 +01:00
Adrian Schmutzler 42c78f1079 routertools: Remove commented old code
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 22:01:29 +01:00
Adrian Schmutzler cf8b841c6a router_list.html/user.html: Show router reset in list
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 22:00:36 +01:00
Adrian Schmutzler 8f04e13c24 routertools/router.html: Display warning for lost coordinates
Warning: This requires a change of the MySQL table 'router'

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 21:59:30 +01:00
Adrian Schmutzler ebb4589301 routertools: Remember settings after router reset
This restores the behavior before the MySQL conversion: If a
router is reset, the new (empty) values are not written to
the variables, instead the old ones are kept.

In contrast to the old setting, however, we still do reset the
hood.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 21:56:35 +01:00
Adrian Schmutzler 7f81bff24b routertools: Don't use old coordinates for hood assignment
If no lat/lng or hood is sent, the device should go to Default.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 21:56:18 +01:00
Adrian Schmutzler 07208b6f5c routertools: Reorganize parsed data from router XML
Since we do not use MongoDB anymore, the structure of the parsed
data in router_update can be simplified to a less nested scheme.

In addition to that, directory keys have been adjusted to those
in MySQL. This prevents typos and errors.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 21:48:48 +01:00
Adrian Schmutzler 6984848203 helpers: Reenable search for community
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-20 11:49:01 +01:00
Adrian Schmutzler e20d37edf9 routertools: Write exceptions for parsing routers to file
Since exceptions during parsing a router's alfred data are
caught, you do not learn about the reasons.

Thus, this writes some information to a file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-20 11:48:55 +01:00
Adrian Schmutzler 8ff508f211 routertools: Remove leftover from debugging
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-20 11:48:49 +01:00
Adrian Schmutzler 7eed4a257c apidoc.html: Add documentation of remaining APIs
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-20 11:45:44 +01:00
Adrian Schmutzler 20b6677f8b scripts: Transfer users between mongodb and MySQL
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-19 16:00:16 +01:00
Adrian Schmutzler 9e3236f593 gitignore: Add mysqlconfig
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-19 15:59:12 +01:00
Adrian Schmutzler 58b6bc34f9 helpers/api: Fix MAC search
This fixes searching for MAC addresses in the router list and
via api/get_router_by_mac/

Additionally, regex is enabled for MAC addresses.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-19 15:41:19 +01:00
Adrian Schmutzler b2541fe40e api/alfred: Write time and duration of alfred calls to file
Attention: This contains a hardcoded path!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-19 15:40:08 +01:00
Adrian Schmutzler af545d8194 config: Introduce path for debug output
Includes update of file names for debug files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-19 15:36:43 +01:00
Adrian Schmutzler 5e75f9cad0 config: Move config to a single, separate file
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-19 15:30:39 +01:00
Adrian Schmutzler 5d8e1f9fce Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-19 15:26:46 +01:00