Giter VIP home page Giter VIP logo

lightkeeper's Introduction

LightkeeperRM

LightkeeperRM (Remote Management) is a modular drop-in replacement for maintaining servers over SSH with shell commands. No additional daemons or other software is needed on target hosts. LightkeeperRM will only run standard Linux commands already available on the host. You can see executed commands through debug log and on target hosts's logs (depending on setup), so it's easy to audit and debug. Lightkeeper simplifies general maintenance tasks such as upgrades, ad-hoc monitoring, debugging and configuration.

LightkeeperRM aims to be customizable, modular and easily extendable, so that it can be modified for different needs.

User-interface is compact and aims to keep only the most essential information visible. Clicking and navigating between different views is kept to a minimum.
In case you find the GUI insufficient and need to dig deeper, you can always use a button, or hotkey, for launching a terminal that logs you in through SSH.

Extensive keyboard shortcuts.

NOTE: this is currently a pre-release and still has bugs and is missing some features. Documentation is also not yet complete.




Overview of LightkeeperRM's GUI.


Some features

  • Status summary in host table for quick status view
  • Log viewer with regex search and hotkeys similar to less/vim.
  • Text file editor for editing remote files (with built-in editor or using CLI over SSH).
  • Follow console output for longer running commands such as container builds and package updates.

Installing

Flatpak

It is recommended to download the app from Flathub: https://flathub.org/apps/io.github.kalaksi.Lightkeeper
It's sandboxed and uses the minimum amount of permissions required.

The alternative is building from source.

Building from source

Flatpak

flatpak-builder build --user --force-clean flatpak/io.github.kalaksi.Lightkeeper-local.yml
# If you want to install also:
flatpak-builder --user --install --force-clean build flatpak/io.github.kalaksi.Lightkeeper-local.yml

Regular

Dependencies are:

  • Qt 5.15
  • liboping
  • libdbus
  • qmltermwidget

Corresponding Ubuntu 22.04 packages are:

  • qtdeclarative5-dev
  • liboping0
  • libdbus-1-3, libdbus-1-dev
  • qml-module-qmltermwidget

Building:

cargo build

Running:

./target/debug/lightkeeper

Post-install

If you're using the ping monitor, you need to give Lightkeeper binary more networking privileges:

$ setcap cap_net_raw+ep $MY_BINARY

Server OS support

The (current) goal is to support:

  • Debian
  • Ubuntu
  • RHEL
  • CentOS
  • NixOS
  • Linux in general (basic functionality for most distributions)

Configuration

NOTE: There is currently an assumption that your user can run sudo without password (or has root privileges) on the target host since some commands need higher privileges.

Configuration can now be done using the graphical UI, but configuring can always be done directly through configuration files, too.

Configuration files

Example configuration files config.example.yml, hosts.example.yml and groups.example.yml can be found in the root of this repository.

When running without flatpak, the default configuration directory is usually ~/.config/lightkeeper and cache directory ~/.cache/lightkeeper. With flatpak, it's the usual app specific directory: ~/.var/app/io.github.kalaksi.Lightkeeper/config and ~/.var/app/io.github.kalaksi.Lightkeeper/cache. You can use a custom configuration directory with the -c/--config-dir option.

Debug logging

Log levels are controlled with environment variable RUST_LOG, so use RUST_LOG=debug.

Testing

test-directory contains Vagrantfiles for virtual machines and also matching LightkeeperRM configurations.
Use --config-dir to load the test configuration. For example, ./target/debug/lightkeeper --config-dir test if building from source.

License

Lightkeeper

Copyright © 2023 [email protected].

This software is licensed under GNU General Public License 3.

NOTE: If you need a non-GPL license, get in contact.

Crate dependencies

All crate dependencies contain permissive licenses (mostly MIT license).
You can check the licenses with:

cargo tree --format "{p} {l}" --prefix none

Or, to quickly see what different licenses are being used by printing only unique license strings:

cargo tree --format "{l}" --prefix none | sort | uniq

Liboping

Liboping 1.10 (https://noping.cc/) is redistributed inside the flatpak package. It's a separate C library dependency needed by oping-crate and is distributed under LGPL-2.1 license.

lightkeeper's People

Contributors

kalaksi avatar b1ek avatar

Stargazers

 avatar  avatar ReK_ avatar EndreEndi avatar jon ⚝ avatar Miloš Kroulík avatar Florian Nagel avatar Andrejs Agejevs avatar Matthieu Vion avatar Michał Frąckiewicz avatar  avatar Tim Kersey avatar Adrian Sieber avatar  avatar Daniel Phan avatar adam kaminski avatar Owen Kuemerle avatar pyunramura avatar Vincent Quéméner avatar  avatar Emmanuel Florac avatar Remy van Elst avatar Andriy Gapon avatar Luke Kalbfleisch avatar Tomás Pollak avatar Andreas Ley avatar Tyler O'Brien avatar  avatar  avatar Volodymyr Lisivka avatar  avatar Ben Lee-Cohen avatar Marco avatar iskrisis avatar dzmitry-lahoda avatar Chad Moon avatar gnito-org avatar  avatar Jonas mg avatar Tom Schuster avatar Dennis Fundi avatar Akhil Acharya avatar  avatar Elias Eskelinen avatar Mauricio Uribe avatar Julian avatar Arthur Tazhitdinov avatar  avatar Aurelien Clu. avatar Tim Hagemann avatar  avatar Peter B avatar micielski avatar Jeff Emanuel avatar An | Anton Röhm avatar Nico avatar Marvin Schubert avatar Alex Goodman avatar Murdho Savila avatar Dmitry Nikolayev avatar Andrew Straw avatar Emil avatar Yasha avatar Albin Ekblom avatar Mads Kristiansen avatar Ramon van Sprundel avatar Aron Merkestijn avatar  avatar Sebastian Schlatow avatar Graffarts avatar Shabbir Hasan avatar  avatar Israel Zúñiga de la Mora avatar Gonzalo Arreche avatar  avatar ᴍᴀᴍᴀᴅᴏᴜ ʙᴀʙᴀᴇɪ avatar Robert Kashyap avatar Ievgen Pyrogov avatar Erik Junsved avatar Zackary Lowery avatar Rui Osório avatar Archer Allstars avatar Daniel Wetzel avatar George Pchelkin avatar Patryk Tabiś avatar  avatar ashed avatar mtron avatar  avatar хлифи avatar Dale Glass avatar Denys Holius avatar  avatar solf1re2 avatar Tawmu avatar Alex Kwiatkowski avatar e-cxr avatar RafayAK avatar Alexander Johnstone avatar MrJohnsson avatar

Watchers

 avatar EndreEndi avatar  avatar  avatar

lightkeeper's Issues

Ping issue on 0.4.4 version

$> flatpak run io.github.kalaksi.Lightkeeper 
[2023-09-10T09:57:46Z INFO  lightkeeper] Lightkeeper starting...
[2023-09-10T09:57:46Z INFO  lightkeeper::module::module_factory] Validating modules
[2023-09-10T09:57:46Z INFO  lightkeeper::module::module_factory] Loaded 28 command modules, 19 monitoring modules and 2 connector modules
[2023-09-10T09:57:46Z INFO  lightkeeper::configuration] Reading main configuration from /home/oktay454/.var/app/io.github.kalaksi.Lightkeeper/config/config.yml
[2023-09-10T09:57:46Z INFO  lightkeeper::configuration] Reading host configuration from /home/oktay454/.var/app/io.github.kalaksi.Lightkeeper/config/hosts.yml
[2023-09-10T09:57:46Z INFO  lightkeeper::configuration] Reading group configuration from /home/oktay454/.var/app/io.github.kalaksi.Lightkeeper/config/groups.yml
Gtk-Message: 12:57:46.408: Failed to load module "xapp-gtk3-module"
Gtk-Message: 12:57:46.427: Failed to load module "canberra-gtk-module"
Gtk-Message: 12:57:46.428: Failed to load module "canberra-gtk-module"
[2023-09-10T09:57:46Z WARN  default] Qt: Session management error: Could not open network socket
[2023-09-10T09:57:46Z INFO  lightkeeper::module::connection::ssh] Connected to 127.0.0.1:22
[2023-09-10T09:57:46Z WARN  lightkeeper::module::connection::ssh] Password is not set, trying authentication with first key found in SSH agent
[2023-09-10T09:57:47Z ERROR lightkeeper::monitor_manager] [example-host] Error from monitor ping: oping::PingError::LibOpingError: İşleme izin verilmedi

image

SSH Connection on v0.5.0

[2023-09-17T20:05:13Z WARN  default] Qt: Session management error: Could not open network socket
[2023-09-17T20:05:13Z INFO  lightkeeper::module::connection::ssh] Connected to 127.0.0.1:22
[2023-09-17T20:05:13Z WARN  lightkeeper::module::connection::ssh] Password is not set, trying authentication with first key found in SSH agent
[2023-09-17T20:05:13Z ERROR lightkeeper::connection_manager] [example-host] Error while connecting 127.0.0.1: Error when communicating with SSH agent: [Session(-18)] Username/PublicKey combination invalid
[2023-09-17T20:05:13Z WARN  lightkeeper::monitor_manager] No response messages received for monitor _internal-platform-info-ssh
[2023-09-17T20:05:13Z ERROR lightkeeper::monitor_manager] [example-host] Error from monitor _internal-platform-info-ssh: Error while connecting: Error when communicating with SSH agent: [Session(-18)] Username/PublicKey combination invalid

image

TODOs

A list of tasks you can do if you want to help the project.
Also you can check out the issues section for bug reports!

Dont forget to reference this issue when submitting a task fixing PR!

  • Don't store sensitive info (let modules choose if they contain any of that): src/cache.rs:62
  • Open external terminal without freezing the UI thread: src/command_handler.rs:345,356
  • Support for multiple commands per module (take a look at monitor_manager.rs): src/command_handler.rs:401,450,483
  • Check that destination file hasn't changed when uploading remote edits: src/command_handler.rs:451
  • Check if remote_text_editor and text_editor are valid executables: src/configuration.rs:44,46
  • Don't block the thread unnecessairly: src/connection_manager.rs
  • Validate path string: src/file_handler.rs:92,99
  • Refactor src/frontend/frontend.rs: src/frontend/frontend.rs:11
  • Use HostState instead?: src/frontend/frontend.rs:35
  • Use camelCase with QML models: src/frontend/qt/models/config_manager_model.rs:15, src/frontend/qt/models/host_data_manager_model.rs:15
  • Consider version too: src/frontend/qt/models/config_manager_model.rs:632
  • Add parent window id in src/frontend/qt/models/desktop_portal_model.rs:146,169
  • Don't use deprecated property: src/frontend/qt/models/theme_model.rs:48
  • Use Kirigami instead of hex colors?: src/frontend/qt/models/theme_model.rs:77

I collected those from code comments that are like this:

// TODO: blah blah blah

To view all comments like this, do this:

$ grep -n TODO $(find src -type f)

Not run v0.7.0

Even though I deleted the ~/.var/app/io.github.kalaksi.Lightkeeper/ directory, it does not work after the update.
Debian 12 Gnome (X11)

flatpak run io.github.kalaksi.Lightkeeper 
[2023-11-04T19:18:08Z INFO  lightkeeper] Lightkeeper starting...
[2023-11-04T19:18:08Z INFO  lightkeeper::module::module_factory] Validating modules
[2023-11-04T19:18:08Z INFO  lightkeeper::module::module_factory] Loaded 30 command modules, 23 monitoring modules and 3 connector modules
[2023-11-04T19:18:08Z INFO  lightkeeper::configuration] Created new main configuration file /home/USER_NAME/.var/app/io.github.kalaksi.Lightkeeper/config/config.yml
[2023-11-04T19:18:08Z INFO  lightkeeper::configuration] Created new host configuration file /home/USER_NAME/.var/app/io.github.kalaksi.Lightkeeper/config/hosts.yml
[2023-11-04T19:18:08Z INFO  lightkeeper::configuration] Created new group configuration file /home/USER_NAME/.var/app/io.github.kalaksi.Lightkeeper/config/groups.yml
[2023-11-04T19:18:08Z INFO  lightkeeper::configuration] Reading main configuration from /home/USER_NAME/.var/app/io.github.kalaksi.Lightkeeper/config/config.yml
[2023-11-04T19:18:08Z INFO  lightkeeper::configuration] Reading host configuration from /home/USER_NAME/.var/app/io.github.kalaksi.Lightkeeper/config/hosts.yml
[2023-11-04T19:18:08Z INFO  lightkeeper::configuration] Reading group configuration from /home/USER_NAME/.var/app/io.github.kalaksi.Lightkeeper/config/groups.yml
[2023-11-04T19:18:08Z INFO  lightkeeper::configuration] Updated main configuration file /home/USER_NAME/.var/app/io.github.kalaksi.Lightkeeper/config/config.yml
[2023-11-04T19:18:08Z INFO  lightkeeper] Lightkeeper starting...
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: SendError { .. }', ../src/host_manager.rs:232:24
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2023-11-04T19:18:08Z INFO  lightkeeper::module::module_factory] Validating modules
[2023-11-04T19:18:08Z ERROR lightkeeper::connection_manager] Stopped receiver thread: receiving on a closed channel
[2023-11-04T19:18:08Z INFO  lightkeeper::module::module_factory] Loaded 30 command modules, 23 monitoring modules and 3 connector modules
[2023-11-04T19:18:08Z INFO  lightkeeper::configuration] Reading main configuration from /home/USER_NAME/.var/app/io.github.kalaksi.Lightkeeper/config/config.yml
[2023-11-04T19:18:08Z INFO  lightkeeper::configuration] Reading host configuration from /home/USER_NAME/.var/app/io.github.kalaksi.Lightkeeper/config/hosts.yml
[2023-11-04T19:18:08Z INFO  lightkeeper::configuration] Reading group configuration from /home/USER_NAME/.var/app/io.github.kalaksi.Lightkeeper/config/groups.yml
[2023-11-04T19:18:08Z WARN  qt.qpa.xcb] could not connect to display 
[2023-11-04T19:18:08Z INFO  qt.qpa.plugin] Could not load the Qt platform plugin "xcb" in "" even though it was found.
[2023-11-04T19:18:08Z ERROR default] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
    Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Has the code been independently reviewed?

I would love to try out an application like this, but the idea of running it on my machine freaks me out since it would immediately have ssh access to a lot of servers which is insecure for obvious reasons

My point being is that there should be some independent reviews attached to every release/version. Of course everyone could just study the code for themselves but that's just basically too much work.

Also the readme has no explanation whatsoever what access level is required, and how the data is fetched.

Improve flatpak/desktop icon

Hi,
square icons are not really nice to see nowadays. I attach a rounded version.
You can easily get it by using ImageMagick:

io github kalaksi Lightkeeper-rounded

$ convert io.github.kalaksi.Lightkeeper-128px.png \
     \( +clone  -alpha extract \
        -draw 'fill black polygon 0,0 0,30 30,0 fill white circle 30,30 30,0' \
        \( +clone -flip \) -compose Multiply -composite \
        \( +clone -flop \) -compose Multiply -composite \
     \) -alpha off -compose CopyOpacity -composite io.github.kalaksi.Lightkeeper-rounded.png

Also remember that only 128x128 icons are required for Flathub apps right now.

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.