Commit Graph

477 Commits

Author SHA1 Message Date
Adrian Schmutzler b93ed81c34 Enforce https for login page link
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:45:24 +02:00
Adrian Schmutzler f50fb4ed6e router.html: Add maximum value for airtime plot
This will cut defective 5 GHz data bigger than 100 %.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:45:15 +02:00
Adrian Schmutzler d6b7ce8e1e config: Introduce specific stats deletion threshold for gw history
Value set to only 7 days to reduce database size, since these
data seem to be of little relevance.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:45:01 +02:00
Adrian Schmutzler e499315dec api: Introduce dnslist and dnsentries
This provides lists of V2 routers to be used in DNS servers:

/api/dnslist - Plain tab-separated list to be used in custom scripts

/api/dnsentries - List of zone file entries without a header

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:44:29 +02:00
Adrian Schmutzler c8178beedd gwinfo and scripts/deletestats: Delete old netif data
Netif information is deleted 48 hours after the MAC addresses
have changed.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:42:35 +02:00
Adrian Schmutzler 1fa8cf3206 Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:53:21 +01:00
Adrian Schmutzler 8b97e05af5 router_list.html: Make uptime sortable
Offline routers are assumed to have uptime=0.

Minor design changes included.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:53:15 +01:00
Adrian Schmutzler b9aab43459 router_list.html: Show last contact
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:53:03 +01:00
Adrian Schmutzler c581915076 api/alfred: Remove router hardname name correction for old FW
This only affects 0.5.1 and older.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:46:52 +01:00
Adrian Schmutzler 488a8a2c63 router.html: Show warning if no contact address is set
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:46:41 +01:00
Adrian Schmutzler 5d7e00422e api/alfred: Check for new router data initially by system time
If we receive data from more than one gateway, there happens to
be a mix of older and newer data (since synchronization between
gateways seems to be not working).

To deal with that, we now only accept data where the router's
system time is newer than the value stored in the DB. To account
for time synchronization issues, we also accept data which is more
than one hour older.

This patch removes other checks for old data which are now obsolete.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:46:31 +01:00
Adrian Schmutzler d3ea76b648 scripts/deletestats: Use block-wise delete for more stats tables
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:46:20 +01:00
Adrian Schmutzler c208663f70 router.html/map: Treat quality differently based on routing protocol
Adds display support for BATMAN_V data.

This is step 1 of 2. It does change the background colors for
neighbors, but does NOT change the link colors in the map.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:45:40 +01:00
Adrian Schmutzler f6f699c8c7 api/alfred and router.html: Include routing_protocol
This only works for routers with updated nodewatcher.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:45:32 +01:00
Adrian Schmutzler d82e7bf5a7 map: Only show coordinates on second click
First click closes open popup.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:45:22 +01:00
Adrian Schmutzler 1a32a823db router.html: Readjust map size to System panel
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:45:08 +01:00
Adrian Schmutzler 49a9c6618f router.html: Show current airtime values in addition to plot
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:44:58 +01:00
Adrian Schmutzler 146d64da19 api/alfred and router.html: Retrieve and show traffic control status
This only works for routers with updated nodewatcher.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:44:44 +01:00
Adrian Schmutzler 6188443dc9 router.html: Show gateway names in connection quality plot
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:44:32 +01:00
Adrian Schmutzler 84eb048904 router.html: Log blocked status changes to router events
Like normal router events, the block/unblock events are deleted
if they become old enough.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:44:17 +01:00
Adrian Schmutzler 3742f5415d router.html: Add explanation and color highlighting for netifs
Label netifs AFTER json if clause

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:42:31 +01:00
Adrian Schmutzler 9924e4fa36 map.js: Change blue color
Increases visibility of links.

Same color change has already been performed earlier for the
neighbors in router.html.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:36:34 +01:00
Adrian Schmutzler 825f79aa66 router.html: Support babel cost and BATMAN V in neighbor graph
This patch uses the absolute value for plotting and removes the
graph maximum. A dynamic upper margin is introduced to prevent
overlap of data and legend.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:33:39 +01:00
Adrian Schmutzler 00ba4ace1b routertools/filters/map.js: Implement babel cost by negative quality
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:31:58 +01:00
Adrian Schmutzler 89ad846375 routertools: Use float for neighbor and gateway quality
This enables support for BATMAN V.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:27:18 +01:00
Adrian Schmutzler eb8822d79f statistics.html: Don't include orphans in gateway overview
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:26:13 +01:00
Adrian Schmutzler f8ba13268a routertools: Parse gateway quality differently to catch wrong data
Since old routers send defective gateway data, some routers got
values like "false6" for quality. This is now caught and false
removed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:25:16 +01:00
Adrian Schmutzler 7091cc5054 Don't show "Blocked" status for V2 routers
This affects only whether the status indication is SHOWN. It does
not affect the storage of this tag.

One can still en- or disable the blocked status of a V2 router via
the options menu.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:24:10 +01:00
Adrian Schmutzler d298cc7762 Introduce v2 field in router table
If a router sends his hood, it is considered to be V2.

V2 hoods are highlighted on the statistics page.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:23:54 +01:00
Adrian Schmutzler 6d735a549a Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:32:26 +01:00
Adrian Schmutzler 17f5c18a92 api/routers: Use MAC address for link to router
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:32:05 +01:00
Adrian Schmutzler 6872b61cb0 api/routers: Tidy up unnecessary variables
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:32:05 +01:00
Adrian Schmutzler b1110e95bd api/routers: Add loadavg to data
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:32:05 +01:00
Adrian Schmutzler 0b8998eb0b stattools: Sort data from router_firmwares() and router_models()
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:32:05 +01:00
Adrian Schmutzler 59aa790116 maptools: Prevent drawing mesh connections twice
Quality is calculated as average of two connections where required.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:31:56 +01:00
Adrian Schmutzler 8fdcfc5a11 statistics.html: Adjust combine threshold for firmware pie chart
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:26:21 +01:00
Adrian Schmutzler 0451480d91 router.html: Show bit per second for data rates
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:25:34 +01:00
Adrian Schmutzler 8d41ed9838 api/alfred and router.html: Introduce airtime stats
This only works for routers with updated nodewatcher.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:25:06 +01:00
Adrian Schmutzler 1cffed9f79 api/alfred and router.html: Introduce detailed client stats
This only works for routers with updated nodewatcher.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:14:35 +01:00
Adrian Schmutzler b43be1bfcc user.html: Log off user after he deleted himself
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:02:27 +01:00
Adrian Schmutzler c3c0c54715 user.html: Fix delete account button
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:02:21 +01:00
Adrian Schmutzler d03edb4552 Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:01:50 +01:00
Adrian Schmutzler 0b04098629 api/gwinfo: Switch from ON DUPLICATE KEY UPDATE to if/else
This prevents excessive use of AUTO_INCREMENT

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:01:28 +01:00
Adrian Schmutzler 907b3154a9 api/alfred: Introduce NoCoordinates hood
Previously, mesh routers without coordinates are assigned to the
default hood, even if they are meshing with routers from other
hoods.

To keep the default hood clean, we introduce the "NoCoordinates"
hood for all those routers.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:01:02 +01:00
Adrian Schmutzler 4dab09748c Introduce option to set routers as blocked by KeyXchange
This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:59:05 +01:00
Adrian Schmutzler 94b9d92b8a statistics.html: Check for GW and hood when using selector
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:56:41 +01:00
Adrian Schmutzler a5b06d62c6 statistics.html: Make hood and GW tables sortable
This causes some adjustments in the underlying select queries.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:56:34 +01:00
Adrian Schmutzler d8e9add933 statistics.html: Show number of gateways in hood table
The number counts all GWs with 2 or more online routers.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:54:23 +01:00
Adrian Schmutzler 0ce3fa5c2f routertools: Set rx/tx to zero if router gets offline
This has to be done BEFORE the status is set, since otherwise
the selector won't work anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:52:27 +01:00
Adrian Schmutzler 9e990bc98a statistics.html: Sort GWs by netif name if same GW
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:50:19 +01:00
Adrian Schmutzler 662bec1a16 Change GWinfo to store vpnmac instead of vpnif
This is required to uniquely find the relation between VPN and
bat after change of MAC adresses.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:09:49 +01:00
Adrian Schmutzler 0dea6339e2 api/gwinfo: Stop filtering br-* interfaces
Keep br-* interfaces, throw away l2tp.
Seems like batctl gwl only shows br-* or fff*, but never l2tp*.

Seems to be required to support V1 gateways with L2TP.

The main impact on table size is done by l2tp*.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:04:49 +01:00
Adrian Schmutzler 9da232ac50 router.html: Fix code flow to provide JSON without reading stats
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:02:22 +01:00
Adrian Schmutzler 05c6af708f statistics.html: Replace clients per GW column by unknown routers
The clients per GW cannot by determined reliably in the
Monitoring. Thus, we remove the column and readd the previously
removed "unknown" column.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:02:00 +01:00
Adrian Schmutzler c71849efe4 router.html: /mac/<routermac> now supports GET parameters
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:01:03 +01:00
Adrian Schmutzler 58cc2e167f scripts/deletestats: Do not evaluate status in stats deletion
Previously, old stats had been only deleted if the router was
online. This required a join with the router table, which caused
locking issues when writing to this table by alfred request.

Now, we just delete old stats ignoring the router state, except
for the router_stats table, which is smaller and thus remains
as before.

In addition, this patch logs the number of rows affected.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:00:44 +01:00
Adrian Schmutzler 804ce80472 scripts/deletestats.py: Delete netif stats after 21 days
This adds an additional config value to set the deletion threshold
for netif data.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler 59fcf2fa8f Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler 823858d981 scripts: Add deleteunlinked.py
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler c605ffe2f0 statistics.html: Show MAC addresses for known gateways in list
This shows the VPN and batX addresses.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler 0a2b8b9a8b statistics.html: Remove "unknown" column from gateway list
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler a9912dccd2 statistics.html: Show details about selected gateway
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler 452aa5a009 statistics.html: Provide sorted list of gateways
Gateways are listed alphabetically based on their name, then all
without name based on their MAC address.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler ff0aeca1aa helpers: Enable search for gateways based on batX interface MACs
Introduces two new query parameters:
bat:<mac> looks for routers being aware of the specified gateway
batselected:<mac> looks for routers CONNECTED to the specified gw

Both variants support regex.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler 669895cd7b router.html/statistics.html: Display gateway/batX where available
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
Adrian Schmutzler 1d64dc3e25 statistics.html: Add logging of 500 errors
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
Adrian Schmutzler 4f4452e06f db/*: Add missing commit to database
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
Adrian Schmutzler 898c06d8c6 Introduce infrastructure to receive and process gateway information
This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
Adrian Schmutzler 516eb07924 stattools: Improve code for calculation of global/hood/gw stats
This replaces UPDATE IF SELECT ELSE INSERT by ON DUPLICATE KEY
UPDATE. In addition, queries have been consolidated by ordering
data in advance and then using executemany.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
Adrian Schmutzler 2a515b94c7 config/routertools: Set minimum distance for data in router stats
This implement to different minimum distances in seconds for the
router stats in general and the netif stats in particular.

The values are chosen so that they are 30 secs. shorter than the
desired timespans of 5 and 10 minutes, to allow for fluctuation
in when data arrives.

This fixes the data density increase caused by V2 Hoods with two
gateways.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
Adrian Schmutzler 70f2f0a8a3 statistics.html: Change link label for hood statistics
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
Adrian Schmutzler ceddd7f636 Add gateway-specific statistics
This adds gateway stats which work similar to the detailed hood
statistics.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:29:55 +01:00
Adrian Schmutzler 34a7c4c58e statistics.html: Add gateway overview
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:27:15 +01:00
Adrian Schmutzler d567dfd56d router.html: Add gateway links
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:27:07 +01:00
Adrian Schmutzler d7bdca4797 helpers: Enable search for gateways
Introduces two new query parameters:
gw:<mac> looks for routers being aware of the specified gateway
selected:<mac> looks for routers CONNECTED to the specified gw

Both variants support regex.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 00:21:17 +01:00
Adrian Schmutzler 386384212e statistics.html: Fix layout of upper right divs
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 00:21:17 +01:00
Adrian Schmutzler 0af1c76254 statistics.html: Consolidate code
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 00:21:11 +01:00
Adrian Schmutzler f12a3f5a3e api/alfred and router.html: Collect and show gateway information
This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 00:10:29 +01:00
Adrian Schmutzler c3adf5fd68 api/alfred: Only log reboot if uptime difference greater than 5 min
If we have two gateways per hood, uptime may vary and cause
frequent logged reboots.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-13 16:46:45 +01:00
Adrian Schmutzler de7c5b2874 router.html: Highlight WiFi interfaces details
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-13 16:45:16 +01:00
Adrian Schmutzler 232e8fe6f0 scripts/calcglobalstats: Add marker at the end of logged durations
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-13 16:45:03 +01:00
Adrian Schmutzler 01e38d84ab Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
Adrian Schmutzler 03ef1a8f70 router.html: Make events scrollable to show more than five
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
Adrian Schmutzler 9375c2f891 statistics.html: Adjust design of pie charts
Minimum percentage for firmware increased to 2 per cent, for
routers increased to 3 per cent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
Adrian Schmutzler d8db4b2f9d router.html: Clarify Report Router button text
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
Adrian Schmutzler 55dc7b4ad5 Rename net_if from router_neighbor table to netif
This includes various changes throughout the code. Additionally,
some fields are reordered.

This requires a change of the MySQL table router_neighbor!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
Adrian Schmutzler 39d9ddc9d0 api/alfred: Update router data instead of DELETE/INSERT
Previously, I just deleted all entries and recreated them again
with INSERT. Although this is simple to write and actually includes
less queries, it causes a lot more write IO. Since most of the
neighbors and interfaces do NOT change frequently, it is worth the
extra effort to delete only those really gone since the last
update.

Only br-mesh will normally have assigned IPv6 addresses, thus
we just delete all IPv6 adresses of the other ones.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
Adrian Schmutzler 55f81c4295 api/alfred: Change calculation of rx/tx after reboot
Previously, on restart the traffic of the last period before
the restart was reused.

Now, we use the logged traffic divided by the uptime.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:19:24 +01:00
Adrian Schmutzler effcdf0a39 MySQL: Reduce field size for rx/tx in router_netif to uint32
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:18:26 +01:00
Adrian Schmutzler 858f419e54 api/alfred and router.html: Show WiFi data for netifs
This shows information about WiFi parameters (e.g. channel).

Except the Tx-Power, data is only available if a firmware with
a corresponding nodewatcher update is present (version 44).

This requires a change of the MySQL table router_netif!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:08:41 +01:00
Adrian Schmutzler ebe9c3afa1 MySQL: Remove net_if from router_neighbor primary key
Since all meshing interface have different MAC adresses, the
mac itself should be unique.

This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:08:41 +01:00
Adrian Schmutzler 22be8633c5 MySQL: Make rx_bytes/tx_bytes in router_netif UNSIGNED
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:08:28 +01:00
Adrian Schmutzler 7ef6f47c4e routertools: Reorder fields in INSERT queries for router stats
This is a cosmetic change to realign the INSERTs to the database.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 82118eed92 MySQL: Reorder fields in stats_hood table
This is meant to reflect the order of the primary key.

This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 069da3aac4 MySQL: Reorder fields in router stats tables
This is meant to reflect the order of the primary key.

This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 47f43eab0d global/hood stats: Include orphaned routers in statistics
This requires a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 92bd81f56d MySQL: Change size of MAC address fields to CHAR(17)
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 58a3747be8 MySQL: Reduce field size for hood to VARCHAR(30)
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler a44970425e MySQL: Reduce size of counters for global/hood stats
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 8b4ef93a17 MySQL: Change loadavg field size to float
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 3eb172bb70 MySQL: Reduce field size for router ID in all tables
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 87d7e345c8 MySQL: Reduce field size for rx/tx in router_stats_netif to uint32
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:00 +01:00
Adrian Schmutzler 58ce32e322 Change router_stats_netif to use ids for netifs
This introduces a serious of changes to code and database.

This patch requires changes to the MySQL database.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:18:22 +01:00
Adrian Schmutzler ec66c05361 api/nodelist: Fix condition for coordinates
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:15:54 +01:00
Adrian Schmutzler 60b6ada1f2 index.html: Fix HTML validity
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:15:38 +01:00
Adrian Schmutzler 23dd78d1da router.html: Fix HTML validity issue
Fixes #67.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:15:32 +01:00
Adrian Schmutzler 43280caee1 user.html: Fix HTML validity
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:15:18 +01:00
Adrian Schmutzler a6ecfae9b6 map: Show Coordinates if not clicking on router icon
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:14:19 +01:00
Adrian Schmutzler 71bb5a3a68 map: Show router popup only for selected layer
If KeyXchange v1 routers are not shown, their popup windows are
now also disabled (as the user would expect); same for v2.

Fixes #95.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:12:12 +01:00
Adrian Schmutzler 0f163c87ee MySQL: Add index for deletebit in router_stats_netif
This index drastically reduces the time required for the DELETE
commands, while the other commands are not affected to strongly.

This is mainly a change to the database.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:54 +01:00
Adrian Schmutzler 0052b87a0c config: 30 Events per router are stored instead of 20
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:36 +01:00
Adrian Schmutzler 9c900e2552 config: Router stats are stored for 30 days instead of 14
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:29 +01:00
Adrian Schmutzler 8c46e93ddd Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:23 +01:00
Adrian Schmutzler bf4ea20c2e index.html: Update github link
Fixes #106

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:17 +01:00
Adrian Schmutzler 5e8e399a70 statistics.html: Filter hood when clicking sectors in pie charts
Fixes #107

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:07 +01:00
Adrian Schmutzler a3ee0edead routertools/alfred: Replace empty hostname
Fixes #109

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:06:59 +01:00
Adrian Schmutzler b5a33f6e70 resetpw: Fix variable name and tidy up
Fixes HTTP 500 error.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:06:53 +01:00
Adrian Schmutzler d26dda7044 MySQL: Re-add keys for router/hood in stats
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:06:42 +01:00
Adrian Schmutzler 8d9f14b954 MySQL: Reorder primary key fields for stats
Use time for first indexed field so it is indexed individually

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:06:37 +01:00
Adrian Schmutzler 032b7ce15e MySQL: Reduce size of netif fields to 15 (Linux limit)
This is mainly a change to the database

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:06:31 +01:00
Adrian Schmutzler c55b1d259d MySQL: Reduce size of MAC address fields to 20
This is mainly a change to the database

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:06:25 +01:00
Adrian Schmutzler 9ab707a214 MySQL: Apply changes leftover from modifications to db init files
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:06:16 +01:00
Adrian Schmutzler 6a6a2806f6 logout: Remove admin from session
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 4f1bda0e83 user_info: Rearrange POST block
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 63316c7046 user.html: Users should have the right to delete their own account
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler cf3d3eb790 user.html: Only show authorized options in pulldown
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 4d3736b7aa user_info: Fix data reload from DB after changes
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler cea5c191a6 user.html: Display abuse properties and add ability to change it
Every user having abuse enabled will receive e-mails if routers
are reported.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 85a6c49574 register: Block registration with empty fields
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 083f3c3534 login: Allow e-mail address instead of user name
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 782d4b4065 db/users: Make nickname and email UNIQUE
This is mainly a change to the database

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 559ced0520 router.html: Only show authorized options in pulldown
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 899061b6ce router.html: Use url_for also for domain name
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 4389f4f11a router_info: Remove redundant user evaluation
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler ab400e1f01 Provide possibility to report routers
ATTENTION: Requires change in users database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 20e71afeb0 Provide possibility to ban routers
If routers are supposed to be removed from the Monitoring
permanently, they can now be banned based on their MAC address.

All admins can do that via the web interface.

ATTENTION: This requires a database update!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 818dc79b7d api/alfred: Remove old comments
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 16:44:07 +01:00
Adrian Schmutzler ae3b065f63 api/alfred: Fix alignment of mysql.close()
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 16:43:52 +01:00
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