-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
1,441 additions
and
1,196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,47 @@ | ||
# VERTRIBUTING | ||
# Contributing | ||
|
||
## Verbessere die Codebase | ||
## Code Contributions | ||
|
||
Als Entwickler, der Raspirus's Funktionalität verstärken möchte, sind Ihre Beiträge von unschätzbarem Wert. Bitte halten Sie sich an die folgenden Richtlinien: | ||
We welcome contributions! Before starting, please: | ||
|
||
- **Überprüfe existierende Probleme:** Bevor du eintauchst, überprüfe existierende Probleme, um Duplikate zu vermeiden. Wenn keine existiert, zögern Sie nicht, eine neue zu öffnen. | ||
- **Check existing issues** to avoid duplicates. | ||
- **Follow documentation & coding standards.** | ||
- **Write tests** when applicable. | ||
|
||
- **Dokumentation ist Schlüssel:** Stellen Sie immer sicher, dass Ihr Code gut dokumentiert ist. Denken Sie daran, Tests anzupassen, um die Code-Integrität zu erhalten. | ||
🔗 **[Read the Code of Conduct](https://github.com/Raspirus/docs/blob/main/CODE_OF_CONDUCT.md)** | ||
|
||
- [Lies den Verhaltenskodex](https://github.com/Raspirus/docs/blob/main/CODE_OF_CONDUCT.md) | ||
## Documentation Contributions | ||
|
||
## Die Dokumentation bereichern | ||
Our documentation is built with [MkDocs](https://www.mkdocs.org/user-guide/installation/) and enhanced with the [Material Theme](https://squidfunk.github.io/mkdocs-material/reference/). | ||
|
||
Die Dokumentation von Raspirus wird mithilfe von Markdown erstellt und von [MkDocs]betrieben (https\://www\.mkdocs.org/user-guide/installation/) und Python. Um zur Dokumentation beizutragen: | ||
To contribute: | ||
|
||
- **Folge dem Guide:** Um die Dokumentation auf deinem lokalen Rechner zu starten, folge der [guide](https://raspirus.github.io/docs/guides). | ||
- **Material-Theme:** Unsere Dokumentation verwendet das Material-Theme, das Markdown-Funktionalität erweitert. Entdecke mehr darüber [here](https://squidfunk.github.io/mkdocs-material/reference). | ||
1. Clone the [documentation repository](https://github.com/Raspirus/docs). | ||
2. Set up MkDocs locally. | ||
3. Submit a pull request with your improvements. | ||
|
||
## Antriebsübersetzungen | ||
## Translation Contributions | ||
|
||
Unsere Dokumentation ist mehrsprachig dank [Crowdin](https://crowdin.com/project/raspirus), einem intuitiven externen Dienst. GUI Übersetzungen werden über JSON-Dateien bearbeitet. Werfen Sie einen Blick auf die [guide](https://raspirus.github.io/docs/guides) für umfassende Einsichten. | ||
Raspirus is multilingual! We use [Crowdin](https://crowdin.com/project/raspirus) for translations. | ||
|
||
## Kunstwerk und Medien infizieren | ||
- GUI translations use JSON files. | ||
- Documentation translations follow the [contribution guide](https://raspirus.github.io/docs/guides). | ||
|
||
Das Repository für Kunstwerke (Logos, Banner, etc.) und Medien (Powerpoints, Artikel, Graphen, etc.) wird separat auf [diesem Projektarchiv](https://github.com/Raspirus/media) gehostet. Fühlen Sie sich frei, unsere visuelle Präsenz zu unterstützen und zu stärken. Beachten Sie, dass das aktuelle Logo und Banner aufgrund fehlender künstlerischer Expertise von AI generiert wurden. | ||
## Artwork & Media | ||
|
||
## Feedback geben | ||
We maintain a separate [media repository](https://github.com/Raspirus/media) for: | ||
|
||
Jenseits der oben genannten Beiträge gibt es andere wirkungsvolle Möglichkeiten, sich einzubringen: | ||
- Logos, banners, and promotional images. | ||
- PowerPoints, articles, and infographics. | ||
|
||
- **Trete Discord:** Komm mit unserer Community auf dem [Discord Server](https://discord.gg/Vx7fW9PA8B) um wertvolle Feedback und Ideen zu teilen. | ||
- **Überlege dir Spenden:** Wenn du Wert in Raspirus findest, überlege [donating](https://github.com/sponsors/Raspirus) um laufende Entwicklung zu unterstützen. | ||
- **Spread the Word:** Eine einfache, aber effektive Möglichkeit, dazu beizutragen, ist das Herunterladen von Raspirus und die Einführung an Freunde. | ||
Feel free to contribute and improve Raspirus’s visual presence! | ||
|
||
Vielen Dank für Ihr Engagement für Raspirus's Wachstum und Verbesserung. Ihr Engagement ist ein Eckpfeiler unseres Erfolgs. | ||
## Community & Feedback | ||
|
||
Join the discussion and help shape Raspirus: | ||
|
||
- 💬 **[Join our Discord](https://discord.gg/Vx7fW9PA8B)** | ||
- 💰 **[Consider sponsoring Raspirus](https://github.com/sponsors/Raspirus)** | ||
- 🌍 **Spread the word!** | ||
|
||
Thank you for your support and contributions! 🚀 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,135 @@ | ||
# DEVELOPER | ||
|
||
## Navigation durch die Architektur | ||
|
||
```mermaid | ||
graph LR | ||
A[Start] --> B{Scan-Position angegeben? ; | ||
B --> |Ja| C[Start scan]; | ||
C --> |Start Loop| D[Datei gefunden]; | ||
D --> E[Erstelle Hash]; | ||
E --> F[Vergleiche Hash]; | ||
F --> G{Hash in DB? ; | ||
G --> |Ja| H[Flagge als Malware]; | ||
G --> |Nein| I[Flagge als Safe]; | ||
H & I --> J[Iteration fortsetzen]; | ||
J --> K{Letzte Datei? ; | ||
K --> |Ja| L[Scanner stoppen]; | ||
L --> M[Ergebnisse anzeigen]; | ||
K --> | N[No| Erneut starten]; | ||
N --> D; | ||
B --> |Nein | O[Stop] | ||
``` | ||
# Developers | ||
|
||
Welcome to the Raspirus developer guide! This page outlines everything you need to contribute effectively, from setting up your environment to understanding the architecture and updating YARA rules. | ||
|
||
--- | ||
|
||
## Setup | ||
|
||
To begin development, follow these steps: | ||
|
||
1. Clone the repository: | ||
```sh | ||
git clone https://github.com/Raspirus/raspirus.git | ||
cd raspirus | ||
``` | ||
2. Install [Rust](https://www.rust-lang.org/tools/install). | ||
3. Install the Raspirus package: | ||
```sh | ||
cargo install . | ||
``` | ||
4. Start development: | ||
```sh | ||
cargo run | ||
``` | ||
5. Or build Raspirus: | ||
```sh | ||
cargo build | ||
``` | ||
|
||
### Troubleshooting Setup Issues | ||
If you encounter issues while building or running Raspirus: | ||
|
||
- Ensure Rust is installed correctly. | ||
- Verify that logs and config files are created properly. | ||
- Check for dependency conflicts and missing packages. | ||
|
||
--- | ||
|
||
## Documentation | ||
|
||
Since Raspirus is written in Rust, you can generate developer documentation with: | ||
```sh | ||
cargo doc --no-deps --open | ||
``` | ||
This will open the generated documentation in your browser. | ||
|
||
--- | ||
|
||
## Architecture | ||
|
||
Raspirus follows a **frontend-backend** architecture, with both components written in Rust. | ||
|
||
Raspirus gliedert sich in zwei integrale Komponenten: Frontend und Backend. Diese Komponenten, die in unterschiedlichen Sprachen und Frameworks erstellt wurden, sind über ein Drittanbieter-Framework mit dem Namen [Tauri](https://tauri.app/) miteinander verbunden. Dieser Rahmen erleichtert nicht nur die Kommunikation zwischen Frontend und Backend, sondern ermöglicht auch die Integration von Rust in das Frontend. Darüber hinaus ermöglicht Tauri die Verteilung von Raspirus auf verschiedene Betriebssysteme. | ||
|
||
## Starte deine Entwicklerreise | ||
|
||
\=== "Windows" Kopiere das Repository | ||
2\. Installiere [Tauri and Prerequisites](https://tauri.app/v1/guides/getting-started/prevquisites#setting-up-windows) | ||
3\. Installieren Sie [npm](https://nodejs.org/en/download) | ||
4\. 1. Clone the repository | ||
2\. Install [Tauri and Prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-macos) | ||
3\. Install [npm](https://nodejs.org/en/download) | ||
4\. Install [Next.js](https://nextjs.org/docs/getting-started/installation#manual-installation) with `npm install next@latest react@latest react-dom@latest` | ||
5\. Install npm dependencies with: `npm i` | ||
6\. Start development with `cargo tauri dev` | ||
7\. or build Raspirus with `cargo tauri build` Installiere npm Abhängigkeiten mit: `npm i` | ||
6\. Beginnen Sie die Entwicklung mit `cargo tauri dev` | ||
7\. oder bauen Sie Raspirus mit "cargo tauri build" | ||
|
||
\=== "Linux" Klone das Repository | ||
2\. Führe `make install` | ||
3 aus. 1. Clone the Repository | ||
2\. Execute `make install` | ||
3\. Run the application with `raspirus` | ||
|
||
\=== "macOS" Kopiere das Repository | ||
2\. Installiere [Tauri and Prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-macos) | ||
3\. Installieren Sie [npm](https://nodejs.org/en/download) | ||
4\. 1. Clone the repository | ||
2\. Install [Tauri and Prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites#setting-up-windows) | ||
3\. Install [npm](https://nodejs.org/en/download) | ||
4\. Install [Next.js](https://nextjs.org/docs/getting-started/installation#manual-installation) with `npm install next@latest react@latest react-dom@latest` | ||
5\. Install npm dependencies with: `npm i` | ||
6\. Start development with `cargo tauri dev` | ||
7\. or build Raspirus with `cargo tauri build` Installiere npm Abhängigkeiten mit: `npm i` | ||
6\. Beginnen Sie die Entwicklung mit `cargo tauri dev` | ||
7\. oder bauen Sie Raspirus mit "cargo tauri build" | ||
|
||
Sollten Sie während Ihres ersten Laufs oder Builds auf irgendwelche Fehler stoßen, stellen Sie sicher, dass Sie jeden Schritt gewissenhaft verfolgt haben. Bestätigen Sie die genaue Erstellung von Logs und Konfigurationsdateien. | ||
|
||
## Erforsche das Backend | ||
|
||
```mermaid | ||
classDiagram | ||
Main <|-- DBOps | ||
Main <|-- Configs | ||
Main <|-- FileLogs | ||
Main <|-- Scanner | ||
Main: +Config config_file | ||
class DBOps { | ||
+Connection db_conn | ||
+String db_file | ||
+TauriWindow t_win | ||
+new() | ||
+update_db() | ||
+hash_exists() | ||
} | ||
class Configs { | ||
+Data data | ||
+new() | ||
+save() | ||
+load() | ||
} | ||
class FileLogs { | ||
+File file | ||
+log() | ||
+create_file() | ||
} | ||
class Scanner { | ||
+String scan_loc | ||
+DbOps db_ops | ||
+Vec malware_list | ||
+search_files() | ||
+create_hash() | ||
+get_folder_size() | ||
} | ||
### Frontend | ||
|
||
- Uses **iced-rs** for GUI rendering. | ||
- Prioritizes user experience—ideally, users should never need to open the settings page. | ||
- Designed for **touch support**, minimizing keyboard input. | ||
- Plug-and-play: Can be replaced with another frontend if needed. | ||
- Simple structure, similar to a website with just a few pages. | ||
|
||
### Backend | ||
|
||
- **Multi-threaded** for efficient scanning. | ||
- Handles scanning, rule processing, and settings management. | ||
- Implements **YARA rules** for malware detection. | ||
- Well-documented functions—if in doubt, check the code directly. | ||
- Despite its complexity, it becomes easier to navigate once you start working with it. | ||
|
||
--- | ||
|
||
## Configuration | ||
|
||
The configuration file is stored in the default system configuration folder: | ||
|
||
```json | ||
{ | ||
"config_version": "6", | ||
"rules_version": "v1.1.2", | ||
"min_matches": 0, | ||
"max_matches": 20, | ||
"max_threads": 12, | ||
"logging_is_active": true, | ||
"mirror": "https://api.github.com/repos/Raspirus/yara-rules/releases/latest", | ||
"language": "en", | ||
"dark_mode": true | ||
} | ||
``` | ||
|
||
Das Backend, ein essentielles Rad in der Raspirus-Maschine, wird in Rust sorgfältig für eine herausragende Leistung hergestellt. Die primäre Datei enthält Funktionen, die über das Frontend zugänglich sind, was JSON-kompatible Ergebnisse liefern muss. Für eine detaillierte Aufschlüsselung siehe die obige Darstellung der modularen Anordnung des Backends. | ||
### Key Fields | ||
|
||
- `config_version`: Determines if an older config needs to be overwritten. | ||
- `rules_version`: Tracks the last downloaded YARA rules version. | ||
- `min_matches`: Minimum number of rule matches required to flag a file. | ||
- `max_matches`: Maximum rule matches before stopping further checks. | ||
- `max_threads`: Number of CPU threads used for scanning. | ||
- `logging_is_active`: Enables/disables logging (useful when storage is limited). | ||
- `mirror`: API endpoint for fetching rule updates. | ||
- `language`: Current language (supports `fr`, `en`, `it`, `de`). | ||
- `dark_mode`: Toggles the application’s dark mode. | ||
|
||
--- | ||
|
||
## Mirrors | ||
|
||
The `mirror` setting in the config file should point to a Git API. Custom mirrors must provide JSON with the following structure: | ||
|
||
```json | ||
{ | ||
"tag_name": "v1.1", | ||
"zipball_url": "http://example.com/download.zip" | ||
} | ||
``` | ||
|
||
- `tag_name`: Specifies the version for update checks. | ||
- `zipball_url`: Direct link to the `.zip` archive containing YARA rules. | ||
|
||
--- | ||
|
||
## Frontend entpacken | ||
## Updater | ||
|
||
<iframe title="The original Raspirus project on Figma" style="border: 1px solid rgba(0, 0, 0, 0.1);" width="800" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FpkgpwieNbhYiOi4Gz6Uyt6%2FRaspirus%3Fnode-id%3D0%253A1%26t%3DGr4YG3Ynv24YVlz2-1" allowfullscreen></iframe> | ||
Raspirus has a **built-from-scratch updater** that: | ||
|
||
Unsere Frontend, die mit JavaScript über das Next.js Framework entwickelt wurde, betont Benutzerfreundlichkeit und Funktionalität. Er enthält Komponenten und Seiten und spiegelt die Einfachheit und Robustheit von Next.js wider. Eine ungefähre visuelle Darstellung der Frontend-Architektur finden Sie im obigen Bild. | ||
1. Checks the latest available version using the configured mirror. | ||
2. Downloads the `.zip` archive to cache. | ||
3. Compiles all `.yar` files into a `.yarac` (compiled YARA rules). | ||
4. Saves the compiled rules in: | ||
- **Linux/macOS**: `~/.local/share/raspirus` | ||
- **Windows**: `%appdata%\Roaming\Raspirus\Data` | ||
- **macOS (App Bundle)**: `/Applications/Raspirus/data` | ||
|
||
## Testabdeckung auswerten | ||
### Release Archive Structure | ||
|
||
- Backend-Tests, die in Rust erstellt wurden, können über den Befehl "cargo test" ausgeführt werden. Greifen Sie auf diese Tests im [test-Verzeichnis](https://github.com/Raspirus/Raspirus/tree/main/src-tauri%2Fsrc%2Ftests). Prüfen Sie die Testabdeckung auf [Codecov](https://app.codecov.io/gh/Raspirus/Raspirus). | ||
- Die mit Selenium erstellten Frontend-Tests befinden sich derzeit in der Entwicklung. | ||
The update `.zip` should contain **uncompiled YARA `.yar` files**. The folder structure inside the archive does not matter, as files are added recursively. | ||
|
||
Vielen Dank für Ihr Interesse, zur Entwicklung von Raspirus beizutragen. Ihre Expertise stärkt unseren Fortschritt. | ||
📌 **Windows Users:** If Windows Defender interferes with compiled YARA rules, an optional script can disable Defender scanning. See [this script](https://github.com/Raspirus/yara-rules/blob/main/scripts/windows.ps1). |
Oops, something went wrong.