Skip to content

BFH-Project1-HS24-KMS4-2/ai-aided-caches-n-logs-monitoring-n-wiping-demon

Repository files navigation

Tracesentry

AI-Aided Caches-n-Logs Monitoring-n-Wiping Demon

Overview

TraceSentry is a cross-platform daemon and CLI that continuously monitors cache and log artifacts and helps you manage them safely. Powered by AI, it classifies files, explains their purpose, and recommends secure wiping or deletion where appropriate. The objective is to minimize unnecessary disk usage, improve system performance, and protect privacy without compromising stability.

Features

  • Search: Allows users to search for log/cache-files or specific files with a given pattern within the file system.
  • Monitoring: Tracks cache and log files within the file system.
  • AI Integration: Analyzes files to understand their utility and whether deletion is recommended.
  • File Wiping/Deletion: Securely wipes or deletes files based on AI recommendations and user approval.

Installation

This chapter provides installation instructions for all supported platforms. TraceSentry is a platform-independent system compatible with major operating systems (Windows, Linux, macOS). However, development and testing were only conducted on the following versions, so compatibility with other versions cannot be guaranteed:

  • Windows 11--10.0
  • Linux 6.1.0-28
  • macOS Sequoia 15.2

Prerequisites

For all subsequent steps, the following prerequisites are required:

  • Java 21+ (JRE) installation.
  • A recent Maven installation (if compiling manually).
  • The ZIP archive has been extracted to the desired installation directory.

The ZIP archive is generated by the root maven project. All build and setup scripts exclusively work within the ZIP archive's structure.

OpenAI API Key

To use the inspection functionality, create an OpenAI API key by following the instructions at OpenAI API Keys. Add credits to your account to enable the OpenAI API: OpenAI Billing Overview. This API key will be needed in subsequent steps. If this step is skipped, you will not have access to the inspection functionality.

Scripts

To simplify installation, scripts are provided for all supported platforms in the installation directory:

  • build: Compiles the project, creates the executable JAR files, and replaces them in the bin folder.
  • setup: Sets up necessary environment variables and configures the daemon for autostart.
  • build-setup: Sequentially executes build and setup.

Since the JAR files are already included in the installation directory, manual compilation is not necessary. It is recommended to execute setup directly. For the scripts to recognize the OpenAI API key, it must be stored in a file named apikey.txt in the installation directory.

Linux

The following scripts are available for Linux:

  • build
  • setup
  • build-setup

Windows

The following scripts are available for Windows:

  • build.ps1
  • setup-win.ps1
  • build-setup-win.ps1

Before executing the scripts, ensure they can run. Warning: This action allows all scripts to execute and must be performed by an administrator. Use the following command in PowerShell:

set-executionpolicy unrestricted

Recommended execution of setup-win.ps1:

.\setup-win.ps1

macOS

The following scripts are available for macOS:

  • build
  • setup-mac
  • build-setup-mac

Warning: For simplicity, configurations are made exclusively in the ~/.zprofile file. These can be manually removed if necessary. The setup script should only be executed once to avoid duplicate entries in ~/.zprofile.

Ensure that the CLI and scripts can be executed using the following command:

chmod +x ts
chmod +x <script-name>

If a quarantine tag is set, it can be removed with the following command:

xattr -d com.apple.quarantine <script-name>

Recommended execution of setup-mac:

./setup-mac

Usage

CLI Usage

Technologies Used

  • OpenAI GPT-4o mini
  • Java/Spring/Maven
  • SQLite/H2

Contribution

  1. Create a new branch, prefixed with feat/ (git checkout -b feat/feature-name)
  2. Commit your changes (git commit -m 'Add feature')
  3. Push to the branch (git push origin feat/feature-name)
  4. Create a merge request

License

This project is licensed under the MIT License: LICENSE

Contact

About

AI-Aided Caches-n-Logs Monitoring-n-Wiping Demon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages