Giter VIP home page Giter VIP logo

owlette's Introduction

๐Ÿฆ‰ Owlette

It's a hoot!

Owlette is a Python-based Windows process manager service designed for maximum flexibility and editability. ๐Ÿ› ๏ธ It monitors various processes, automatically relaunching them if they crash or are accidentally closed. ๐Ÿ”„ It can also send email and/or Slack notifications with system metrics when the going gets weird. ๐Ÿ“ง

Screenshot

๐Ÿ“š Table of Contents

  1. ๐ŸŒŸ Features
  2. ๐Ÿ› ๏ธ Installation
  3. ๐Ÿš€ Usage
  4. ๐ŸŽ›๏ธ UI Features
  5. ๐Ÿ› ๏ธ Configuration
  6. ๐Ÿ—‘๏ธ Uninstallation
  7. ๐Ÿž Troubleshooting
  8. ๐Ÿค Contributing
  9. ๐Ÿ“œ License

๐ŸŒŸ Features

  • ๐Ÿš€ Starts specified processes upon system startup
  • ๐Ÿ”„ Automatically restarts applications if they freeze, crash or are accidentally closed
  • ๐Ÿ“Š Monitors system metrics like CPU usage, memory usage, and disk space
  • ๐Ÿ“ง Sends Gmail/Slack notifications using APIs
  • ๐Ÿฝ๏ธ Tray icon for easy access to features and settings
  • ๐ŸŽš๏ธ Autolaunch/Manage toggle: Conveniently disable a process from automatically launching during development
  • ๐Ÿ”„ Relaunch Attempts til Restart: Configurable number of relaunch attempts before issuing a full system restart
  • ๐Ÿ›‘ Forcibly terminate processes via the Kill button
  • ๐Ÿ“Š View the current status of each monitored process
  • ๐ŸŽš๏ธ Set the visibility and priority of processes

๐Ÿ› ๏ธ Installation

๐Ÿ“‹ Prerequisites

  • ๐Ÿ Python 3.9 or higher
  • ๐Ÿ“ฆ pip (Python package installer)
  • โ˜๏ธ (Optional) Google Cloud Platform (GCP) account for Gmail API
  • ๐Ÿค– (Optional) Slack workspace and admin account for Slack API

1๏ธโƒฃ Clone the repository:

git clone https://github.com/theexperiential/Owlette.git

2๏ธโƒฃ Navigate to the project directory:

cd Owlette

๐Ÿ“ฆ Installation Methods

๐Ÿค– Automatic Installation/Updater

Run the install.bat file as an administrator to automatically install the required packages and set up the service. It also works as an updater, anytime this repo is updated.

๐Ÿ–๏ธ Manual Installation

  1. Install the required Python packages:

    pip install -r requirements.txt

  2. Create folders named config, logs, and tmp in the Owlette folder.

โ˜๏ธ Gmail API Configuration (Google Cloud Platform)

  • 1๏ธโƒฃ Go to the Google Cloud Console.
  • 2๏ธโƒฃ Create a new project.
  • 3๏ธโƒฃ Navigate to "APIs & Services" > "Dashboard".
  • 4๏ธโƒฃ Enable the Gmail API.
  • 5๏ธโƒฃ Create OAuth client IDs and download the client secrets JSON file.
  • 6๏ธโƒฃ Place the downloaded JSON file in the project config directory and rename it to client_secrets.json.

๐Ÿค– Slack API Configuration

๐Ÿ› ๏ธ Part 1: Create Your Slack App

  1. Head over to the Slack API website.
  2. Click on "Create an App" and fill in your App Name and Development Slack Workspace.

๐Ÿ›ก๏ธ Part 2: OAuth & Permissions

  1. Once your app is up and running, navigate to the "OAuth & Permissions" page.
  2. Under "Bot Token Scopes," add the following scopes:
    • channels:write
    • channels:manage
    • chat:write

๐Ÿš€ Part 3: Install the App

  1. Scroll back to the top of the "OAuth & Permissions" page.
  2. Hit that "Install App to Workspace" button.
  3. Review the permissions and click "Allow."

Part 4: Enable Slack & Enter OAuth Token

  1. Enable the Slack toggle in Owlette Configuration.
  2. Enter your Bot User OAuth Token (from OAuth & Permissions page) and click on "Submit".
  3. Check your Slack workspace in the #owlette channel for a message from Owlette!

๐Ÿš€ Usage

1๏ธโƒฃ Run the owlette_gui.py script to configure the service:

python owlette_gui.py

2๏ธโƒฃ Follow the on-screen instructions to authenticate with Gmail and configure the processes you want to manage.

3๏ธโƒฃ To install the Windows service, run the following command as an administrator:

python owlette_service.py install

4๏ธโƒฃ To start the Windows service, run:

python owlette_service.py start

5๏ธโƒฃ To stop the Windows service, run:

python owlette_service.py stop

6๏ธโƒฃ The tray icon will automatically run with the service. But if you wish to run the GUI configuration, just double-click on owlette_gui.py or run:

python owlette_gui.py

7๏ธโƒฃ To restart the system tray icon, restart the process or run:

python owlette_tray.py

๐ŸŽ›๏ธ UI Features

System Tray Icon

Right-Click Menu

  • Open Config: Brings up the Owlette Configuration window where you can manage and monitor processes.
  • Start on Login: Allows you to toggle whether the service starts upon system login.
  • Exit: Closes the Owlette service and any open Configuration windows.

๐Ÿ› ๏ธ Configuration

๐Ÿ“‘ Overview

The Configuration UI is built using the customtkinter library and is designed to manage processes and notifications. It features a dark theme and provides various functionalities like adding, removing, and reordering processes, as well as configuring email settings.

๐Ÿงฉ UI Components

๐Ÿ”„ Process Details

  • Autolaunch/Manage: Enables or disables monitoring for the selected process. If enabled, Owlette will check the process every 10 seconds. If it is unresponsive, it will attempt to close and relaunch it. If the process ID (PID) is no longer found, Owlette will attempt to relaunch it automatically.
  • Name: Text field to enter the name of the process.
  • Exe Path: Text field to specify the executable path. Includes a "Browse" button.
  • File Path / Cmd Line Args: Text field for additional file paths or command-line arguments. Includes a "Browse" button.
  • Launch Time Delay (s): Text field to specify a time delay, in seconds, before the process starts.
  • Time to Initialize (s): Text field to specify the total time, in seconds, to give a process to fully initialize before checking it's responsitivity.
  • Relaunch Attempts til Restart: Set the number of relaunch attempts before a system restart is triggered. Owlette will prompt you with a 30 second countdown window before starting, which you may either initiate, pause or cancel. If the countdown completes, the restart will continue.
  • Priority: Dropdown menu to set the priority level of the process (how much CPU time the process gets compared to other running processes).
  • Window Visibility: Dropdown menu to set the process window to be shown or hidden.
  • Add: Adds a new process to the Process Startup List based on the details provided.

๐Ÿ“‹ Process Startup List

  • Listbox: Displays the list of configured processes. The list is ordered, so your processes will be started in the order you define.
  • Kill: Terminates the selected and running process.
  • Del: Removes the selected process from the list.
  • Up: Moves the selected process up in the list (start it before other processes).
  • Down: Moves the selected process down in the list (start it after other processes).
  • Save Changes: Saves any modifications to the selected process and Notifications section. Note that changes are also saved when you press your return key on your keyboard in a text field, or click anywhere outside of one in the UI.

๐Ÿ“ง Notifications

  • Emails To (Comma Separated): Text field to specify the recipient email addresses, separated by commas.
  • Gmail: Toggle to initiate (or disable) Gmail email notifications.
  • Slack: Toggle to initiate (or disable) Slack notifications.

๐ŸŒŸ Features

  • Dark Theme: The UI uses a dark color scheme for better visibility.
  • Validation: Includes validation for invalid file paths and invalid email addresses.

๐Ÿ—‘๏ธ Uninstallation

To uninstall the Owlette service and python dependencies, you may run the uninstall.bat file as an administrator. Alternatively, to just remove the service, you may run the following command as an administrator:

python owlette_service.py remove

This will remove the Owlette service from your system.

๐Ÿž Troubleshooting

๐Ÿ“ Logs

Logs are stored in the logs folder, per script. service.log for the service, email.log for the email sender, tray.log for the tray icon, etc. Check these logs for debugging information.

๐Ÿ”„ Restarting the service

If you exit Owlette from the tray icon or stop the service and wish to restart it, you can:

  1. Go to Services (services.msc from the run menu), and find the "Owlette Service" and click on "Start the service"

  2. Run the start_service.py file in the src folder

  3. Run the following command as an administrator (from the src folder):

    python owlette_service.py start

๐Ÿค Contributing

Feel free to contribute by submitting pull requests.

๐Ÿ“œ License

This project is licensed under the GNU General Public License v3.0.

owlette's People

Contributors

dylanroscover avatar

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.