Commit Graph

35 Commits

Author SHA1 Message Date
Vincent Bernat
b1d6382585 common/embed: replace all go:embed use by an embedded archive
Some of the files were quite big:

- asns.csv ~ 3 MB
- index.js ~ 1.5 MB
- *.svg ~ 2 MB

Use a ZIP archive to put them all and embed it. This reduce the binary
size from 89 MB to 82 MB. 🤯

This also pulls some code modernization (use of http.ServeFileFS).
2025-09-03 00:00:05 +02:00
Vincent Bernat
2c787ff75c console: use mux to simplify static assets serving 2025-09-02 17:53:59 +02:00
Itah
e41e64a3ac console/clickhouse: Expose API route to get best table and interval from time range 2024-03-25 14:20:22 +01:00
Vincent Bernat
62521e629d common/http: rename to common/httpserver
This is a preparation to introduce an httpclient common package. And it
makes it easier to use http from the standard library.
2023-05-28 09:08:29 +02:00
Vincent Bernat
e4c3a6b723 console: move /sankey and /graph to /graph/sankey and /graph/line
Also rename stuff to GraphSankey and GraphLine for consistency.
2023-02-22 20:54:58 +01:00
Vincent Bernat
c6a9319b57 common/schema: turns into a component
This is a first step to make it accept configuration. Most of the
changes are quite trivial, but I also ran into some difficulties with
query columns and filters. They need the schema for parsing, but parsing
happens before dependencies are instantiated (and even if it was not the
case, parsing is stateless). Therefore, I have added a `Validate()`
method that must be called after instantiation. Various bits `panic()`
if not validated to ensure we catch all cases.

The alternative to make the component manages a global state would have
been simpler but it would break once we add the ability to add or
disable columns.
2023-01-18 12:22:10 +01:00
Vincent Bernat
788e12dc26 console: make cache duration configurable 2022-12-22 16:32:26 +01:00
Vincent Bernat
775dc08db2 console: implement an HTTP cache for Clickhouse-backed requests
Fix #328
2022-12-22 16:23:49 +01:00
Vincent Bernat
78fb01c223 chore: fix some small issues detected by golangci-lint
But not using it as some linters are either plain incorrect (the one
suggesting to not use nil for `c.t.Context()`) or just
debatable (checking for err value is a good practice, but there are
good reasons to opt out in some cases).
2022-08-10 17:44:32 +02:00
Vincent Bernat
67703cc61e console: use templates to build SQL query
This is needed if we want to be able to mix use of several tables
inside a single query (for example, flows_1m0s for a part of the query
and flows_5m0s for another part to overlay historical data).

Also, the way we handle time buckets is now cleaner. The previous way
had two stages of rounding and was incorrect. We were discarding the
first and last value for this reason. The new way only has one stage
of rounding and is correct. It tries hard to align the buckets at the
specified start time. We don't need to discard these values anymore.
We still discard the last one because it could be incomplete (when end
is "now").
2022-08-09 11:45:40 +02:00
Vincent Bernat
927a9f3cfd console: display running version 2022-07-21 12:57:32 +02:00
Vincent Bernat
dff8773c7f console: move ethertypes for IPv4/IPv6 to helpers package 2022-07-07 02:43:22 +02:00
Vincent Bernat
8be1bca4fd license: AGPL-3.0-only
```
git ls-files \*.js \*.go \
  | xargs sed -i '1i // SPDX-FileCopyrightText: 2022 Free Mobile\n// SPDX-License-Identifier: AGPL-3.0-only\n'
git ls-files \*.vue \
  | xargs sed -i '1i <!-- SPDX-FileCopyrightText: 2022 Free Mobile -->\n<!-- SPDX-License-Identifier: AGPL-3.0-only -->\n'
```
2022-06-29 11:42:28 +02:00
Vincent Bernat
bf0c474726 console: implement "filter/saved" endpoints 2022-06-13 09:50:43 +02:00
Vincent Bernat
b65d78ab1b console: turn authentication into a proper component 2022-06-09 19:55:57 +02:00
Vincent Bernat
f5252ce077 console: rework a bit user management
Notably, HTTP headers are configurable and a provider is used for the
frontend side.
2022-05-31 17:03:00 +02:00
Vincent Bernat
9567de4ca5 console: add minimal user management 2022-05-30 22:24:18 +02:00
Vincent Bernat
4114568600 console/filter: add completion endpoint 2022-05-26 15:58:52 +02:00
Vincent Bernat
2d4f5214bd tests: handle JSON in TestHTTPEndpoints 2022-05-26 10:40:55 +02:00
Vincent Bernat
bd3c79c057 console: endpoint for sankey graph 2022-05-22 16:48:36 +02:00
Vincent Bernat
c23e5c1687 console/frontend: use static generated content for fields
This is more reliable and efficient but it also remove a bug with
equality comparison failing and thus inability to remove entries.
Also, sorted exactly as we want.
2022-05-18 08:49:03 +02:00
Vincent Bernat
34f153d9cd console: dynamically fetch available dimensions 2022-05-16 10:19:53 +02:00
Vincent Bernat
eefd7088b9 console: remove /fields endpoint as we don't use it 2022-05-15 15:24:50 +02:00
Vincent Bernat
04d818e00f console/frontend: add a selector for dimensions 2022-05-15 15:19:55 +02:00
Vincent Bernat
2319262340 console: add visualize tab
Currently, there is no controls available.
2022-05-12 14:27:18 +02:00
Vincent Bernat
05276dbc63 console: make use of consolidated tables 2022-05-10 09:30:33 +02:00
Vincent Bernat
370cd6f961 console/frontend: add a graph on the homepage 2022-04-21 16:07:01 +02:00
Vincent Bernat
506bca0291 console: add "top" widgets API 2022-04-14 16:00:35 +02:00
Vincent Bernat
793e55db52 console: add an API to get flow rate 2022-04-14 13:50:00 +02:00
Vincent Bernat
12344a3684 console: add an API to get list of exporters 2022-04-14 10:22:57 +02:00
Vincent Bernat
4be33c70ba console: add an API to get the last received flow 2022-04-14 10:06:01 +02:00
Vincent Bernat
50ca1987b2 http: use Gin web framework to reduce API boilerplate 2022-04-10 22:13:38 +02:00
Vincent Bernat
bbe6fdb635 console: remove proxy to Grafana
This is not really our job to do that.
2022-04-07 11:07:38 +02:00
Vincent Bernat
ce7fce32ba console: switch to Vue.JS + Tailwind CSS + Headless UI for the frontend 2022-04-06 21:03:19 +02:00
Vincent Bernat
1dc253764d global: split Akvorado into 3 services 2022-04-01 20:21:53 +02:00