Commit graph

642 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
5b5e2714ae
db: use shared cache for in-memory db
Due to how QsqlDatabase works from different threads, a connection to
the DB can only be used from the thread that created it.

In order to access a database from different threads you create a new
QsqlDatabase connection to the DB specifying the DB name/file.

With DBs written to the disk, the database file/name is always the
same (say /tmp/file.db).

But with in-memory databases, whenever you create a new connection with
:memory:, it always create a new in-memory DB, so the DB is empty for
the Cleaner() task, and that's why it was not deleting old events.

Closes #844
2023-02-13 01:00:34 +01:00
Gustavo Iñiguez Goia
4540650b07
ui: use XDG_CONFIG_HOME to store GUI configuration
Closes: #847
2023-02-13 00:59:10 +01:00
Gustavo Iñiguez Goia
b7f065e018
i18n: updated Turkish translation 2023-02-12 12:04:57 +01:00
Gustavo Iñiguez Goia
e9184372e1
ui: fixed typo in ruleseditor 2023-02-12 00:50:22 +01:00
Gustavo Iñiguez Goia
ac21d3c98d
ui: minor rules refactoring
Reference db records fields by constants instead of numbers.
2023-02-12 00:02:33 +01:00
Gustavo Iñiguez Goia
f5d357207e
ui: added 64x64 icon 2023-02-11 21:50:49 +01:00
Gustavo Iñiguez Goia
8241811478
ui: updated resources
36c26e60f6

4baf218570

Author: Petter Reinholdtsen <pere@hungry.com>
2023-02-11 14:10:59 +01:00
Gustavo Iñiguez Goia
3cec971a1f ui: allow to create rules from events
Added option to create rules from events, filling up the fields of the
new rule with the properties of a connection.

By default the rules' fields are not enabled.

Closes: #843
2023-02-11 13:40:41 +01:00
Gustavo Iñiguez Goia
156e936ae7
ui: added appstream metainformation file
Added file to display GUI information on software centers.

https://www.freedesktop.org/software/appstream/docs/
2023-02-06 21:59:19 +01:00
Gustavo Iñiguez Goia
b6d62eeb02
ui: fixed listing connections when using translations 2023-02-06 17:25:18 +01:00
Gustavo Iñiguez Goia
758b7ce1a8
i18n: fixed creating locales on fedora
kudos to pizzadude for adding a note to the wiki.
2023-02-06 13:59:49 +01:00
Gustavo Iñiguez Goia
9ad67555e6
updated translations definitions 2023-02-06 13:28:50 +01:00
Gustavo Iñiguez Goia
b08cd6b07c
updated translations 2023-02-06 13:02:58 +01:00
Gustavo Iñiguez Goia
846b1c5efa
i18n: added new language nb_NO
by Petter Reinholdtsen
2023-02-06 11:02:44 +01:00
Spencer Comfort
5cdbd6182a
Remove unused parameters (#829)
* Update highlight.py
2023-02-05 22:14:45 +01:00
Gustavo Iñiguez Goia
e2dfb3a021
ui: fixed exception on PyQt 5.15.8 (2/2)
reported by @darkfishy and @uffejakobsen (#821), thank you!
2023-01-29 19:49:40 +01:00
Gustavo Iñiguez Goia
1c66d83835
ui: fixed exception on PyQt 5.15.8
reported by @darkfishy and @uffejakobsen (#821), thank you!
2023-01-29 19:07:25 +01:00
Gustavo Iñiguez Goia
1790c80e03
ui: delete temp rules only if enabled 2023-01-26 12:06:26 +01:00
Gustavo Iñiguez Goia
649e1cceac
ui: more options to exclude/autoflush temp rules
Added more options for auto excluding/deleting temporary rules.
If the GUI was configured to store events to disk, you could end up
having thousands of temporary rules over time.

Closes: #622
2023-01-26 11:16:09 +01:00
Petter Reinholdtsen
3d38ffbd07 Added copyright and license header to daemon/main.go and ui/bin/opensnitch-ui.
Based on git history with no lower threshold on contributions, so any
contributors get a copyright claim in the code.
2023-01-23 06:13:40 +00:00
Gustavo Iñiguez Goia
c96f647b96
ui: added tr, ru, and lt languages
d838a2122e
2023-01-23 01:31:10 +01:00
Gustavo Iñiguez Goia
8674aed617
ui: fixed app icon
was 48x35 instead of 48x48
2023-01-22 16:58:12 +01:00
Gustavo Iñiguez Goia
18dc32c51f
removed ftrace monitor method
deprecated, was not in use.
2023-01-21 21:03:53 +01:00
Gustavo Iñiguez Goia
cba52cf3d8
ui: added Actions
Added ability to perform actions on different parts of the GUI, based on
conditions defined in json files.

There's only one Action of type Highlight for now, to colorize cells and
rows.

There're 3 Highlight actions defined by default:
 - rules: applied to the rules view to colorize the columns Enabled and
   Action.
 - firewall: applied to the fw rules to colorize the columns Action and
   Enabled.
 - common: applied to the rest of the views to colorize the column
   Action.

Users can add new actions to the directory
~/.config/opensnitch/actions/, as .json files. The format is defined
below.

Example of a Highlight action to colorize cells and rows, based on
different texts (simple texts/strings for now):
{
  "name": "commonDelegateConfig",
  "actions": {
    "highlight": {
      "cells": [
        {
          "text": ["allow", "✓ online"],
          "cols": [1, 2, 3],
          "color": "green",
          "bgcolor": "",
          "alignment": ["center"]
        }
      ],
      "rows": [
        {
          "text": ["block-domains"],
          "cols": [8],
          "color": "white",
          "bgcolor": "darkMagenta",
          "alignment": []
        }
      ]
    }
}

Closes: #555
2023-01-21 00:27:31 +01:00
Gustavo Iñiguez Goia
9762ec377e
ui, cli: added options to enable debug messages 2023-01-16 13:41:53 +01:00
Gustavo Iñiguez Goia
ea8b209dd5
ui, prefs: reenable notifications button after callback
rel: #785
2023-01-12 17:26:03 +01:00
Gustavo Iñiguez Goia
e952f73e18
ui: fixed crash on Wayland resizing the pop-ups
- Fixed crash on Wayland (Fedora 37) when setting the minimum and
   maximum size of a pop-up. setMinimumSize() makes crash the GUI.
 - With the above fix, we don't need to set QT_QPA_PLATFORM
   (Closes: #794)
2023-01-10 00:32:01 +01:00
Gustavo Iñiguez Goia
a619814ea7
ui: fixed typo adding Quit menu .. 2023-01-09 00:39:45 +01:00
Gustavo Iñiguez Goia
4cf41cc546
ui: added Quit menu 2023-01-09 00:30:55 +01:00
Gustavo Iñiguez Goia
afc3fb8900
ui, themes: allow to apply themes in runtime
When selecting a theme the Preferences dialog is stylized. If the user
saves the changes the theme will be applied to all the dialogs.
2023-01-09 00:19:16 +01:00
Gustavo Iñiguez Goia
5264988a36
ui: fixed pop-up crash on wayland
Clicking on the [+] pop-up button crashes the GUI on wayland (f37).
Switching to xcb plugin fixes this problem (QT_QPA_PLATFORM=xcb)
2023-01-07 22:26:31 +01:00
Gustavo Iñiguez Goia
ba5208ef02
ui, cli: added proto/grpc versions to cli tool
Display what versions is using the GUI. It'll help to debug issues.

For next releases we may need to check incompatibilities between grpc
and protobuf (#790).
2023-01-06 23:57:15 +01:00
Gustavo Iñiguez Goia
690cea7774
ui, fw: fixed exception checking fw status
Under certain situation, checking fw status caused an exception
loading the GUI when new nodes connected.

What caused this error is unknown, so for now we'll protect the GUI from
crashing.

Closes #790
2023-01-06 15:53:03 +01:00
Gustavo Iñiguez Goia
5e61bd0989
ui, stats: fixed proc details monitor, better scrolling
- Scroll horizontally perpixel. Otherwise with long texts is hard to
   view the item.
 - Fixed process details monitoring.
2023-01-05 03:06:31 +01:00
Gustavo Iñiguez Goia
ef7f809cf7
ui, stats: removed old button 2023-01-04 01:02:15 +01:00
Gustavo Iñiguez Goia
30a8c90829
ui: enable HighDpiPixmaps, fixed nodes list
- Enable high-dpi pixmaps for icons.
 - Fixed nodes connections listing when accesing from the Events view.
2023-01-03 12:31:12 +01:00
Gustavo Iñiguez Goia
c7ee55ab1a
ui, cli: added debug option, better help.
- Added --debug option, to get stacktraces when the GUI segfaults.
 - Added examples to show how to listen on IP addresses.
2023-01-03 00:59:12 +01:00
Gustavo Iñiguez Goia
75831aa082
ui: improved nodes management
- Fixed crashes when a node connects/disconnects.
 - Fixed listing nodes fw tables and chains.
 - Fixed deleting nodes from the list.
 - Prefs: Do not ask the user to restart the GUI when there're more than
   1 node connected.
2023-01-03 00:56:10 +01:00
Gustavo Iñiguez Goia
9d5823c48b
ui: improved nodes management
- Fixed reconfiguring nodes address from/to unix sockets <-> net
   sockets.
 - Fixed updating nodes status when connecting/disconnecting.
2023-01-02 19:54:15 +01:00
Gustavo Iñiguez Goia
c364ee1d7a
ui, stats: fixed displaying nodes statistics 2023-01-02 10:23:33 +01:00
Gustavo Iñiguez Goia
93add53103
ui, stats: added more columns to the process view
- Added columns Protocol, DstIP, DstHost and DstPort to the Process
   view.
 - Allow to filter by protocol.

This should ease to analyze cases like #787
2023-01-01 22:59:24 +01:00
Gustavo Iñiguez Goia
f1a3a3aa73
ui, fw: improved rules dialog
There were some issues on systems where protobuf is outdated, which led to
crashes and some dialog misconfigurations.
2023-01-01 19:36:52 +01:00
Gustavo Iñiguez Goia
fd3bf5716d
ui, fw: fixed crash loading not supported rules
Rules with targets other than stop, return, accept or drop are not
supported (from the GUI) yet.
2023-01-01 11:38:45 +01:00
Gustavo Iñiguez Goia
d072fe4786
ui, prefs: disable pop-ups if timeout is 0
When the timeout value is set to 0, enable the check [x] Disable
pop-ups.

It was not clear what 0 meant (#783)
2022-12-31 17:46:14 +01:00
Gustavo Iñiguez Goia
e7d976862b
ui: allow to import/export rules per node
From the nodes view.
2022-12-30 19:02:51 +01:00
Gustavo Iñiguez Goia
276966ad30
ui: some rules fixing 2022-12-29 16:58:32 +01:00
Gustavo Iñiguez Goia
e4cfad2aef
ui: added menu to export rules to clipboard/file 2022-12-29 16:46:15 +01:00
Gustavo Iñiguez Goia
b9cf0e86fd
ui: added options to export/import rules
- Added options to export/import rules to/from a directory.
   All nodes' rules will be exported, each ruleset to its own
   directory.
   Importing rules will be added to all nodes.
   WIP, we'll make it more granular.

Closes #324 #746
2022-12-29 14:33:14 +01:00
Gustavo Iñiguez Goia
b7198a6fef
ui: group rules functionality 2022-12-28 20:44:11 +01:00
Gustavo Iñiguez Goia
2cdbd97035
ui, views: fixed address view, general clean up 2022-12-28 02:00:49 +01:00