From bb189dd1e7cc14900e03a72403752e6aa5276d8c Mon Sep 17 00:00:00 2001 From: gabrix73 Date: Sun, 12 Apr 2026 14:49:49 +0200 Subject: rename: Veilith -> Khimera across all files and documentation --- .gitignore | 10 +- LICENSE | 2 +- MILITARY-FEATURES.md | 20 +-- Makefile | 22 +-- README.md | 38 ++--- SECURITY.md | 12 +- build-bundle.sh | 72 ++++----- go.mod | 2 +- khimera-main.go | 328 +++++++++++++++++++++++++++++++++++++++++ launcher.bat | 28 ++-- transport/mesh/mesh.go | 2 +- transport/mesh/storeforward.go | 2 +- transport/tor/embedded.go | 4 +- transport/tor/tor.go | 2 +- veilith-main.go | 328 ----------------------------------------- 15 files changed, 436 insertions(+), 436 deletions(-) create mode 100644 khimera-main.go delete mode 100644 veilith-main.go diff --git a/.gitignore b/.gitignore index 31b0125..af9d418 100644 --- a/.gitignore +++ b/.gitignore @@ -4,12 +4,12 @@ *.dll *.so *.dylib -veilith +khimera launcher launcher.exe # Allow source files (override binary exclusion) -!veilith-*.go +!khimera-*.go # Test binary, built with `go test -c` *.test @@ -45,9 +45,9 @@ Thumbs.db ehthumbs.db Desktop.ini -# Veilith specific -.veilith/ -veilith-data/ +# Khimera specific +.khimera/ +khimera-data/ portable-data/ *.db *.db-shm diff --git a/LICENSE b/LICENSE index 733133d..5f3e55e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2026 Veilith Contributors +Copyright (c) 2026 Khimera Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/MILITARY-FEATURES.md b/MILITARY-FEATURES.md index 4f82fb7..f778c63 100644 --- a/MILITARY-FEATURES.md +++ b/MILITARY-FEATURES.md @@ -1,4 +1,4 @@ -# ๐ŸŽ–๏ธ Veilith - Military Features Implementation +# ๐ŸŽ–๏ธ Khimera - Military Features Implementation ## โœ… **IMPLEMENTED - Critical War Zone Features** @@ -346,7 +346,7 @@ embeddedTor.SetBridges(tor.GetDefaultBridges()) **Situation:** - Soldier captured by enemy -- USB drive with Veilith seized +- USB drive with Khimera seized - Enemy attempting to extract contacts/intel **Solution:** @@ -399,11 +399,11 @@ queue.Enqueue(criticalMessage) package main import ( - "veilith/identity" - "veilith/security" - "veilith/transport" - "veilith/transport/tor" - "veilith/transport/mesh" + "khimera/identity" + "khimera/security" + "khimera/transport" + "khimera/transport/tor" + "khimera/transport/mesh" ) func main() { @@ -468,7 +468,7 @@ func main() { // TODO: Add keyboard listener for Ctrl+Alt+Del+F12 // On trigger: wipe.Wipe() - fmt.Println("โœ… Veilith Military Edition Ready") + fmt.Println("โœ… Khimera Military Edition Ready") fmt.Println("๐ŸŽ–๏ธ All war-zone features active") } ``` @@ -528,7 +528,7 @@ func main() { ## ๐ŸŽ–๏ธ **Conclusion** -**Veilith v1.0-military is NOW READY for war zones.** +**Khimera v1.0-military is NOW READY for war zones.** All critical military features implemented: โœ… Embedded Tor @@ -549,5 +549,5 @@ All critical military features implemented: --- -**Veilith - Military Edition** +**Khimera - Military Edition** *Privacy you can carry. Security you can trust. Even in war zones.* diff --git a/Makefile b/Makefile index 0fde165..d7efa6a 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ -# Veilith Portable - Makefile +# Khimera Portable - Makefile # Builds portable executables for Windows, Linux, and Android # Configuration VERSION := 0.9 BUILD_DATE := $(shell date +%Y%m%d) -OUTPUT_DIR := veilith-portable-v$(VERSION) +OUTPUT_DIR := khimera-portable-v$(VERSION) LDFLAGS := -s -w -X main.Version=$(VERSION) -X main.BuildDate=$(BUILD_DATE) # Colors for output @@ -21,7 +21,7 @@ all: portable # Help help: - @echo "Veilith Portable Build System v$(VERSION)" + @echo "Khimera Portable Build System v$(VERSION)" @echo "" @echo "Usage:" @echo " make portable - Build all portable executables" @@ -54,8 +54,8 @@ windows: install-deps go build \ -ldflags="$(LDFLAGS) -H windowsgui" \ -tags static \ - -o $(OUTPUT_DIR)/Windows/veilith.exe \ - ./veilith-main.go + -o $(OUTPUT_DIR)/Windows/khimera.exe \ + ./khimera-main.go @if [ $$? -eq 0 ]; then \ echo "$(GREEN)โœ“$(NC) Windows build complete"; \ else \ @@ -72,9 +72,9 @@ linux: install-deps go build \ -ldflags="$(LDFLAGS) -extldflags '-static'" \ -tags 'osusergo netgo static_build' \ - -o $(OUTPUT_DIR)/Linux/veilith-linux \ - ./veilith-main.go - @chmod +x $(OUTPUT_DIR)/Linux/veilith-linux + -o $(OUTPUT_DIR)/Linux/khimera-linux \ + ./khimera-main.go + @chmod +x $(OUTPUT_DIR)/Linux/khimera-linux @if [ $$? -eq 0 ]; then \ echo "$(GREEN)โœ“$(NC) Linux build complete"; \ else \ @@ -89,7 +89,7 @@ android: # Build all portable executables portable: @echo "$(BLUE)โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—$(NC)" - @echo "$(BLUE)โ•‘ VEILITH PORTABLE BUILD v$(VERSION) โ•‘$(NC)" + @echo "$(BLUE)โ•‘ KHIMERA PORTABLE BUILD v$(VERSION) โ•‘$(NC)" @echo "$(BLUE)โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•$(NC)" @echo "" @$(MAKE) -s linux @@ -110,8 +110,8 @@ test: clean: @echo "$(YELLOW)[Clean]$(NC) Removing build artifacts..." rm -rf $(OUTPUT_DIR) - rm -rf veilith-portable-v*.zip - rm -rf veilith-portable-v*.tar.gz + rm -rf khimera-portable-v*.zip + rm -rf khimera-portable-v*.tar.gz @echo "$(GREEN)โœ“$(NC) Clean complete" # Package distribution diff --git a/README.md b/README.md index b6c8a36..496eba4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# ๐Ÿ”’ Veilith - Military-Grade Portable Messenger +# ๐Ÿ”’ Khimera - Military-Grade Portable Messenger **Secure, anonymous, portable messaging designed for hostile environments.** -Veilith is a war-ready communication tool that works even when Internet is unavailable or censored. Built for soldiers, journalists, activists, and anyone who needs unbreakable privacy. +Khimera is a war-ready communication tool that works even when Internet is unavailable or censored. Built for soldiers, journalists, activists, and anyone who needs unbreakable privacy. ## ๐ŸŽฏ Core Philosophy @@ -28,14 +28,14 @@ Veilith is a war-ready communication tool that works even when Internet is unava - Linux/Mac: `./launcher` - Windows: `launcher.bat` -Veilith auto-detects your OS and runs the correct executable. All data stays on the USB drive. +Khimera auto-detects your OS and runs the correct executable. All data stays on the USB drive. ### Build from Source ```bash # Clone repository -git clone https://github.com/gabrix73/veilith.git -cd veilith +git clone https://github.com/gabrix73/khimera.git +cd khimera # Build for your platform make linux # Linux executable @@ -52,7 +52,7 @@ make all # All platforms ## ๐Ÿ›ก๏ธ Military Features ### 1๏ธโƒฃ **Embedded Tor Bundle** -No external Tor daemon required. Veilith bundles Tor directly in the executable. +No external Tor daemon required. Khimera bundles Tor directly in the executable. ```go // Auto-starts Tor on launch @@ -336,8 +336,8 @@ queue.Enqueue(criticalMessage) ## ๐Ÿ“ Project Structure ``` -veilith/ -โ”œโ”€โ”€ veilith-main.go # Main entry point +khimera/ +โ”œโ”€โ”€ khimera-main.go # Main entry point โ”œโ”€โ”€ identity/ โ”‚ โ””โ”€โ”€ identity.go # Ed25519 identity management โ”œโ”€โ”€ addressbook/ @@ -369,11 +369,11 @@ veilith/ ### Change Identity -Delete your identity key - Veilith auto-generates a new one on next launch: +Delete your identity key - Khimera auto-generates a new one on next launch: ```bash -rm ~/.veilith/identity.key -./veilith +rm ~/.khimera/identity.key +./khimera # New identity auto-generated ``` @@ -383,10 +383,10 @@ Use different data directories: ```bash # Identity 1 (journalist) -VEILITH_DATA_DIR=~/.veilith-journalist ./veilith +KHIMERA_DATA_DIR=~/.khimera-journalist ./khimera # Identity 2 (activist) -VEILITH_DATA_DIR=~/.veilith-activist ./veilith +KHIMERA_DATA_DIR=~/.khimera-activist ./khimera ``` ### Panic Button (Emergency Wipe) @@ -396,7 +396,7 @@ VEILITH_DATA_DIR=~/.veilith-activist ./veilith For now, programmatically: ```go -import "veilith/security" +import "khimera/security" wipe := security.NewEmergencyWipe(&security.WipeConfig{ DataDir: "./data", @@ -467,7 +467,7 @@ Contributions welcome! Please follow these guidelines: **MIT License** -Copyright (c) 2024 Veilith Project +Copyright (c) 2024 Khimera Project Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -479,7 +479,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ## โš ๏ธ Security Notice -**Veilith is designed for defensive security only.** +**Khimera is designed for defensive security only.** - โœ… Use for privacy, anonymity, secure communications - โœ… Use in hostile/censored environments @@ -493,8 +493,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ## ๐Ÿ“ž Support -- **Issues:** [GitHub Issues](https://github.com/yourusername/veilith/issues) -- **Discussions:** [GitHub Discussions](https://github.com/yourusername/veilith/discussions) +- **Issues:** [GitHub Issues](https://github.com/yourusername/khimera/issues) +- **Discussions:** [GitHub Discussions](https://github.com/yourusername/khimera/discussions) - **Security:** Report vulnerabilities privately via email --- @@ -511,6 +511,6 @@ Special thanks to cryptographers and security researchers who make privacy tools --- -**Veilith - Privacy you can carry. Security you can trust. Even in war zones.** +**Khimera - Privacy you can carry. Security you can trust. Even in war zones.** ๐Ÿ”’ **Stay safe. Stay anonymous. Stay connected.** diff --git a/SECURITY.md b/SECURITY.md index fedabad..dca2848 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ ## Supported Versions -Currently, Veilith is in active development (version 0.9). Security updates are applied to the latest version only. +Currently, Khimera is in active development (version 0.9). Security updates are applied to the latest version only. | Version | Supported | | ------- | ------------------ | @@ -13,7 +13,7 @@ Currently, Veilith is in active development (version 0.9). Security updates are **DO NOT** open public GitHub issues for security vulnerabilities. -If you discover a security vulnerability in Veilith, please report it responsibly: +If you discover a security vulnerability in Khimera, please report it responsibly: ### Preferred Method: Encrypted Email @@ -37,7 +37,7 @@ If you discover a security vulnerability in Veilith, please report it responsibl ## Security Features -Veilith implements multiple layers of defense: +Khimera implements multiple layers of defense: - **End-to-End Encryption**: Noise Protocol (XX pattern) - **Forward Secrecy**: Automatic session key rotation @@ -67,7 +67,7 @@ The following are considered **out of scope** for security reports: Users should: -1. Keep Veilith updated to the latest version +1. Keep Khimera updated to the latest version 2. Verify binary signatures before installation 3. Use portable mode on untrusted systems 4. Enable emergency wipe if at risk @@ -76,7 +76,7 @@ Users should: ## Cryptographic Implementation -Veilith uses well-audited cryptographic libraries: +Khimera uses well-audited cryptographic libraries: - **Noise Protocol**: `flynn/noise` (Go implementation) - **Tor**: Embedded Tor with authenticated bridges @@ -86,7 +86,7 @@ We **never** implement custom cryptography. ## Bug Bounty -Currently, Veilith does not offer a paid bug bounty program. However, we deeply appreciate responsible disclosure and will publicly credit researchers (with permission). +Currently, Khimera does not offer a paid bug bounty program. However, we deeply appreciate responsible disclosure and will publicly credit researchers (with permission). --- diff --git a/build-bundle.sh b/build-bundle.sh index d848fd4..3ffcb3b 100755 --- a/build-bundle.sh +++ b/build-bundle.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Veilith Portable - USB Bundle Builder +# Khimera Portable - USB Bundle Builder # Creates a complete multi-platform USB bundle set -e @@ -14,13 +14,13 @@ NC='\033[0m' # Configuration VERSION="0.9" -BUNDLE_NAME="veilith-usb-v${VERSION}" +BUNDLE_NAME="khimera-usb-v${VERSION}" BUILD_DATE=$(date +%Y%m%d) echo -e "${CYAN}" echo "โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—" echo "โ•‘ โ•‘" -echo "โ•‘ VEILITH USB BUNDLE BUILDER v${VERSION} โ•‘" +echo "โ•‘ KHIMERA USB BUNDLE BUILDER v${VERSION} โ•‘" echo "โ•‘ Multi-Platform Portable Distribution โ•‘" echo "โ•‘ โ•‘" echo "โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•" @@ -54,19 +54,19 @@ echo "" # Build Linux echo -e "${BLUE}[1/2]${NC} Building Linux executable..." echo " Target: Linux AMD64" -echo " Output: $BUNDLE_NAME/Linux/veilith-linux" +echo " Output: $BUNDLE_NAME/Linux/khimera-linux" CGO_ENABLED=1 \ GOOS=linux \ GOARCH=amd64 \ go build \ -ldflags="-s -w -X main.Version=${VERSION} -X main.BuildDate=${BUILD_DATE}" \ - -o "$BUNDLE_NAME/Linux/veilith-linux" \ - ./veilith-main.go + -o "$BUNDLE_NAME/Linux/khimera-linux" \ + ./khimera-main.go if [ $? -eq 0 ]; then - chmod +x "$BUNDLE_NAME/Linux/veilith-linux" - SIZE=$(du -h "$BUNDLE_NAME/Linux/veilith-linux" | cut -f1) + chmod +x "$BUNDLE_NAME/Linux/khimera-linux" + SIZE=$(du -h "$BUNDLE_NAME/Linux/khimera-linux" | cut -f1) echo -e "${GREEN}โœ“${NC} Linux build complete (${SIZE})" else echo -e "${RED}โœ—${NC} Linux build failed" @@ -79,7 +79,7 @@ echo -e "${BLUE}[2/2]${NC} Building Windows executable..." if command -v x86_64-w64-mingw32-gcc &> /dev/null; then echo " Target: Windows AMD64" - echo " Output: $BUNDLE_NAME/Windows/veilith.exe" + echo " Output: $BUNDLE_NAME/Windows/khimera.exe" CGO_ENABLED=1 \ GOOS=windows \ @@ -87,11 +87,11 @@ if command -v x86_64-w64-mingw32-gcc &> /dev/null; then CC=x86_64-w64-mingw32-gcc \ go build \ -ldflags="-s -w -H windowsgui -X main.Version=${VERSION} -X main.BuildDate=${BUILD_DATE}" \ - -o "$BUNDLE_NAME/Windows/veilith.exe" \ - ./veilith-main.go + -o "$BUNDLE_NAME/Windows/khimera.exe" \ + ./khimera-main.go if [ $? -eq 0 ]; then - SIZE=$(du -h "$BUNDLE_NAME/Windows/veilith.exe" | cut -f1) + SIZE=$(du -h "$BUNDLE_NAME/Windows/khimera.exe" | cut -f1) echo -e "${GREEN}โœ“${NC} Windows build complete (${SIZE})" else echo -e "${RED}โœ—${NC} Windows build failed" @@ -123,10 +123,10 @@ To build Android APK: 3. Build APK: cd .. - fyne package -os android -appID com.veilith.portable + fyne package -os android -appID com.khimera.portable 4. Sign APK (optional): - jarsigner -keystore veilith.keystore app.apk veilith + jarsigner -keystore khimera.keystore app.apk khimera For more info: https://developer.fyne.io/started/mobile EOF @@ -138,7 +138,7 @@ echo -e "${YELLOW}[Documentation]${NC} Creating README..." cat > "$BUNDLE_NAME/README.txt" << EOF โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— โ•‘ โ•‘ -โ•‘ VEILITH PORTABLE USB v${VERSION} โ•‘ +โ•‘ KHIMERA PORTABLE USB v${VERSION} โ•‘ โ•‘ Privacy-First P2P Messenger โ•‘ โ•‘ Multi-Platform Edition โ•‘ โ•‘ โ•‘ @@ -147,10 +147,10 @@ cat > "$BUNDLE_NAME/README.txt" << EOF BUILD DATE: ${BUILD_DATE} โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• - WHAT IS VEILITH PORTABLE? + WHAT IS KHIMERA PORTABLE? โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• -Veilith Portable is a zero-installation, privacy-first messenger +Khimera Portable is a zero-installation, privacy-first messenger that runs directly from USB drives on multiple platforms: โœ“ Windows (x86_64) @@ -168,14 +168,14 @@ No traces left on the host system. LINUX / macOS: 1. Open terminal in this directory 2. Run: ./launcher - 3. Or: cd Linux && ./veilith-linux + 3. Or: cd Linux && ./khimera-linux WINDOWS: 1. Double-click: launcher.bat - 2. Or: Double-click: Windows/veilith.exe + 2. Or: Double-click: Windows/khimera.exe ANDROID: - 1. Copy Android/veilith.apk to your phone + 1. Copy Android/khimera.apk to your phone 2. Enable "Unknown Sources" in settings 3. Install the APK 4. Launch from app drawer @@ -185,15 +185,15 @@ ANDROID: BUNDLE STRUCTURE โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• -veilith-usb-v${VERSION}/ +khimera-usb-v${VERSION}/ โ”œโ”€โ”€ launcher # Smart launcher (Linux/Mac) โ”œโ”€โ”€ launcher.bat # Windows launcher โ”œโ”€โ”€ Windows/ # Windows executable -โ”‚ โ””โ”€โ”€ veilith.exe +โ”‚ โ””โ”€โ”€ khimera.exe โ”œโ”€โ”€ Linux/ # Linux executable -โ”‚ โ””โ”€โ”€ veilith-linux +โ”‚ โ””โ”€โ”€ khimera-linux โ”œโ”€โ”€ Android/ # Android APK -โ”‚ โ””โ”€โ”€ veilith.apk +โ”‚ โ””โ”€โ”€ khimera.apk โ”œโ”€โ”€ data/ # YOUR DATA (encrypted) โ”‚ โ”œโ”€โ”€ identity.enc # Your cryptographic identity โ”‚ โ””โ”€โ”€ contacts.enc # Your contact list @@ -248,11 +248,11 @@ PRIVACY: LINUX: Permission denied? chmod +x launcher - chmod +x Linux/veilith-linux + chmod +x Linux/khimera-linux WINDOWS: Antivirus blocking? - Add veilith.exe to exceptions + Add khimera.exe to exceptions Won't start? Right-click โ†’ Run as Administrator (one time) @@ -266,7 +266,7 @@ ANDROID: FIRST RUN โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• -On first run, Veilith will: +On first run, Khimera will: 1. Create a new cryptographic identity 2. Ask for a passphrase to protect it 3. Save encrypted identity to data/identity.enc @@ -282,9 +282,9 @@ On subsequent runs: SUPPORT โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• - Website: https://veilith-messenger.org - Email: support@veilith-messenger.org - Security: security@veilith-messenger.org + Website: https://khimera-messenger.org + Email: support@khimera-messenger.org + Security: security@khimera-messenger.org โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• @@ -297,7 +297,7 @@ See docs/LICENSE.txt for licensing information. Built: ${BUILD_DATE} Version: ${VERSION} -Veilith Portable - Privacy you can carry +Khimera Portable - Privacy you can carry EOF echo -e "${GREEN}โœ“${NC} README created" @@ -329,13 +329,13 @@ echo "" echo -e "${YELLOW}[Summary]${NC} Bundle summary..." echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" -if [ -f "$BUNDLE_NAME/Linux/veilith-linux" ]; then - LINUX_SIZE=$(du -h "$BUNDLE_NAME/Linux/veilith-linux" | cut -f1) +if [ -f "$BUNDLE_NAME/Linux/khimera-linux" ]; then + LINUX_SIZE=$(du -h "$BUNDLE_NAME/Linux/khimera-linux" | cut -f1) echo " Linux: ${LINUX_SIZE}" fi -if [ -f "$BUNDLE_NAME/Windows/veilith.exe" ]; then - WINDOWS_SIZE=$(du -h "$BUNDLE_NAME/Windows/veilith.exe" | cut -f1) +if [ -f "$BUNDLE_NAME/Windows/khimera.exe" ]; then + WINDOWS_SIZE=$(du -h "$BUNDLE_NAME/Windows/khimera.exe" | cut -f1) echo " Windows: ${WINDOWS_SIZE}" fi @@ -380,5 +380,5 @@ echo "To distribute:" echo " โ€ข Share ${BUNDLE_NAME}.zip (Windows users)" echo " โ€ข Share ${BUNDLE_NAME}.tar.gz (Linux users)" echo "" -echo -e "${CYAN}Veilith Portable - Privacy you can carry${NC}" +echo -e "${CYAN}Khimera Portable - Privacy you can carry${NC}" echo "" diff --git a/go.mod b/go.mod index 5701cdd..bb92398 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module veilith +module khimera go 1.21 diff --git a/khimera-main.go b/khimera-main.go new file mode 100644 index 0000000..2099ae5 --- /dev/null +++ b/khimera-main.go @@ -0,0 +1,328 @@ +// cmd/khimera-portable/main.go +package main + +import ( + "fmt" + "log" + "os" + "path/filepath" + "runtime" + + "fyne.io/fyne/v2/app" + "fyne.io/fyne/v2/container" + "fyne.io/fyne/v2/widget" + + "khimera/addressbook" + "khimera/identity" + "khimera/session" + "khimera/transport" + "khimera/transport/mesh" + "khimera/transport/tor" +) + +// PortableApp represents the portable Khimera application +type PortableApp struct { + config *PortableConfig + identity *identity.Identity + addressBook *addressbook.AddressBook + sessionMgr *session.SessionManager + transportMgr *transport.TransportManager +} + +// PortableConfig holds portable mode configuration +type PortableConfig struct { + IsPortable bool + BaseDir string + DataDir string + TorDir string + TempDir string + IdentityPath string + ContactsPath string + ConfigPath string + IsUSB bool + IsNetworkShare bool + Platform string +} + +func main() { + fmt.Println("โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—") + fmt.Println("โ•‘ KHIMERA PORTABLE v0.9 โ•‘") + fmt.Println("โ•‘ Privacy-First P2P Messenger โ•‘") + fmt.Println("โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•") + fmt.Println() + + // Detect and setup portable mode + config, err := detectPortableMode() + if err != nil { + log.Fatalf("Failed to initialize portable mode: %v", err) + } + + // Display portable status + displayPortableStatus(config) + + // Initialize portable app + portableApp := &PortableApp{ + config: config, + } + + // Setup data directories + if err := portableApp.setupDirectories(); err != nil { + log.Fatalf("Failed to setup directories: %v", err) + } + + // Start GUI + portableApp.startGUI() +} + +// detectPortableMode detects portable environment +func detectPortableMode() (*PortableConfig, error) { + // Get executable location + exe, err := os.Executable() + if err != nil { + return nil, fmt.Errorf("failed to get executable path: %w", err) + } + + baseDir := filepath.Dir(exe) + + config := &PortableConfig{ + IsPortable: true, + BaseDir: baseDir, + DataDir: filepath.Join(baseDir, "data"), + TorDir: filepath.Join(baseDir, "tor"), + TempDir: filepath.Join(baseDir, "temp"), + Platform: runtime.GOOS, + } + + // Set file paths + config.IdentityPath = filepath.Join(config.DataDir, "identity.enc") + config.ContactsPath = filepath.Join(config.DataDir, "contacts.enc") + config.ConfigPath = filepath.Join(config.DataDir, "config.json") + + // Detect if running from USB + config.IsUSB = isRemovableDrive(baseDir) + config.IsNetworkShare = isNetworkPath(baseDir) + + return config, nil +} + +// isRemovableDrive checks if path is on removable media +func isRemovableDrive(path string) bool { + switch runtime.GOOS { + case "windows": + return isWindowsRemovable(path) + case "linux": + return isLinuxRemovable(path) + default: + return false + } +} + +// isWindowsRemovable checks for Windows removable drives +func isWindowsRemovable(path string) bool { + // Simplified check - in production use Windows API + drive := filepath.VolumeName(path) + // Check if drive letter is in typical USB range (E: to Z:) + if len(drive) > 0 { + letter := drive[0] + return letter >= 'E' && letter <= 'Z' + } + return false +} + +// isLinuxRemovable checks for Linux removable media +func isLinuxRemovable(path string) bool { + // Check if path contains /media or /mnt (typical USB mount points) + return filepath.HasPrefix(path, "/media") || + filepath.HasPrefix(path, "/mnt") +} + +// isNetworkPath checks if running from network share +func isNetworkPath(path string) bool { + switch runtime.GOOS { + case "windows": + return filepath.HasPrefix(path, "\\\\") + case "linux": + // Check for NFS/SMB mounts (simplified) + return false + } + return false +} + +// displayPortableStatus shows portable mode information +func displayPortableStatus(config *PortableConfig) { + fmt.Println("๐Ÿ“ Portable Mode Configuration") + fmt.Println("โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”") + fmt.Printf(" Platform: %s\n", config.Platform) + fmt.Printf(" Base Dir: %s\n", config.BaseDir) + fmt.Printf(" Data Dir: %s\n", config.DataDir) + fmt.Printf(" Running from: ") + + if config.IsUSB { + fmt.Println("USB Drive โœ“") + } else if config.IsNetworkShare { + fmt.Println("Network Share โœ“") + } else { + fmt.Println("Local Drive") + } + fmt.Println() +} + +// setupDirectories creates required directories +func (pa *PortableApp) setupDirectories() error { + dirs := []string{ + pa.config.DataDir, + pa.config.TorDir, + pa.config.TempDir, + } + + for _, dir := range dirs { + if err := os.MkdirAll(dir, 0700); err != nil { + return fmt.Errorf("failed to create directory %s: %w", dir, err) + } + } + + fmt.Println("โœ“ Directories initialized") + return nil +} + +// startGUI launches the portable GUI application +func (pa *PortableApp) startGUI() { + myApp := app.New() + myWindow := myApp.NewWindow("Khimera Portable v0.9") + + // Welcome screen + welcomeLabel := widget.NewLabel("Welcome to Khimera Portable") + welcomeLabel.Alignment = fyne.TextAlignCenter + + infoLabel := widget.NewLabel(fmt.Sprintf( + "Running from: %s\nData directory: %s", + pa.config.BaseDir, + pa.config.DataDir, + )) + infoLabel.Wrapping = fyne.TextWrapWord + + // Identity section + var passphraseEntry *widget.Entry + var statusLabel *widget.Label + + statusLabel = widget.NewLabel("No identity loaded") + + passphraseEntry = widget.NewPasswordEntry() + passphraseEntry.SetPlaceHolder("Enter passphrase...") + + // Load/Create identity button + loadBtn := widget.NewButton("Load Identity", func() { + passphrase := passphraseEntry.Text + if passphrase == "" { + statusLabel.SetText("โš  Please enter a passphrase") + return + } + + // Try to load existing identity + if _, err := os.Stat(pa.config.IdentityPath); err == nil { + id, err := identity.LoadIdentity(pa.config.IdentityPath, []byte(passphrase)) + if err != nil { + statusLabel.SetText("โš  Failed to load identity (wrong passphrase?)") + return + } + pa.identity = id + statusLabel.SetText("โœ“ Identity loaded: " + id.GetPublicKeyHex()[:16] + "...") + } else { + // Create new identity + id, err := identity.NewIdentity() + if err != nil { + statusLabel.SetText("โš  Failed to create identity") + return + } + + if err := id.Save(pa.config.IdentityPath, []byte(passphrase)); err != nil { + statusLabel.SetText("โš  Failed to save identity") + return + } + + pa.identity = id + statusLabel.SetText("โœ“ New identity created: " + id.GetPublicKeyHex()[:16] + "...") + } + + // Initialize other components + pa.initializeComponents() + }) + + // Quit button + quitBtn := widget.NewButton("Quit", func() { + pa.cleanup() + myApp.Quit() + }) + + // Layout + content := container.NewVBox( + welcomeLabel, + widget.NewSeparator(), + infoLabel, + widget.NewSeparator(), + widget.NewLabel("Identity Management:"), + passphraseEntry, + loadBtn, + statusLabel, + widget.NewSeparator(), + quitBtn, + ) + + myWindow.SetContent(content) + myWindow.Resize(fyne.NewSize(600, 400)) + myWindow.CenterOnScreen() + myWindow.ShowAndRun() +} + +// initializeComponents initializes core components after identity is loaded +func (pa *PortableApp) initializeComponents() error { + // Initialize session manager + pa.sessionMgr = session.NewSessionManager() + + // Initialize transport manager + pa.transportMgr = transport.NewTransportManager() + + // Try to load address book + if _, err := os.Stat(pa.config.ContactsPath); err == nil { + // Load existing contacts + fmt.Println("โœ“ Address book loaded") + } else { + // Create new address book + pa.addressBook = addressbook.NewAddressBook() + fmt.Println("โœ“ New address book created") + } + + fmt.Println("โœ“ Components initialized") + return nil +} + +// cleanup performs cleanup on application exit +func (pa *PortableApp) cleanup() { + fmt.Println("\n๐Ÿงน Cleaning up...") + + // Secure wipe sessions + if pa.sessionMgr != nil { + pa.sessionMgr.SecureWipeAll() + fmt.Println(" โœ“ Sessions wiped") + } + + // Close transports + if pa.transportMgr != nil { + pa.transportMgr.Close() + fmt.Println(" โœ“ Transports closed") + } + + // Wipe identity from memory + if pa.identity != nil { + pa.identity.SecureWipe() + fmt.Println(" โœ“ Identity wiped from memory") + } + + // Clean temp directory + if pa.config.TempDir != "" { + os.RemoveAll(pa.config.TempDir) + fmt.Println(" โœ“ Temp files removed") + } + + fmt.Println("โœ“ Cleanup complete") +} diff --git a/launcher.bat b/launcher.bat index 95d8e5e..1dea813 100644 --- a/launcher.bat +++ b/launcher.bat @@ -1,15 +1,15 @@ @echo off -REM Veilith Portable - Windows Launcher +REM Khimera Portable - Windows Launcher REM Automatically launches the Windows executable with portable settings -title Veilith Portable v0.9 - Launcher +title Khimera Portable v0.9 - Launcher cls echo. echo ======================================================== echo. -echo VEILITH PORTABLE v0.9 +echo KHIMERA PORTABLE v0.9 echo Privacy-First P2P Messenger echo Windows Launcher echo. @@ -40,13 +40,13 @@ if "%DRIVE_LETTER%" GEQ "E" ( echo. REM Check if executable exists -if not exist "Windows\veilith.exe" ( +if not exist "Windows\khimera.exe" ( echo. echo ======================================================== echo ERROR: Windows executable not found! echo ======================================================== echo. - echo Expected location: Windows\veilith.exe + echo Expected location: Windows\khimera.exe echo. echo Please build the Windows executable: echo make windows @@ -66,24 +66,24 @@ if not exist "temp" mkdir temp echo [Launch] echo -------------------------------------------------------- echo. -echo Starting Veilith Portable... +echo Starting Khimera Portable... echo. REM Set environment variables for portable mode -set "VEILITH_PORTABLE=1" -set "VEILITH_DATA_DIR=%SCRIPT_DIR%data" -set "VEILITH_TOR_DIR=%SCRIPT_DIR%tor" -set "VEILITH_TEMP_DIR=%SCRIPT_DIR%temp" +set "KHIMERA_PORTABLE=1" +set "KHIMERA_DATA_DIR=%SCRIPT_DIR%data" +set "KHIMERA_TOR_DIR=%SCRIPT_DIR%tor" +set "KHIMERA_TEMP_DIR=%SCRIPT_DIR%temp" REM Change to Windows directory and launch cd /d "%SCRIPT_DIR%Windows" -start "" "veilith.exe" +start "" "khimera.exe" REM Check if launch was successful if errorlevel 1 ( echo. echo ======================================================== - echo ERROR: Failed to launch Veilith + echo ERROR: Failed to launch Khimera echo ======================================================== echo. echo Possible issues: @@ -93,7 +93,7 @@ if errorlevel 1 ( echo - Missing dependencies echo. echo Troubleshooting: - echo 1. Add veilith.exe to antivirus exceptions + echo 1. Add khimera.exe to antivirus exceptions echo 2. Run as Administrator (one time) echo 3. Check USB drive is not read-only echo 4. Verify Windows version compatibility @@ -104,7 +104,7 @@ if errorlevel 1 ( REM Success echo. -echo Veilith launched successfully! +echo Khimera launched successfully! echo. echo The application window should open shortly... echo You can close this window. diff --git a/transport/mesh/mesh.go b/transport/mesh/mesh.go index dbe50e1..cf757ee 100644 --- a/transport/mesh/mesh.go +++ b/transport/mesh/mesh.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "veilith/transport" + "khimera/transport" ) // MeshTransport implements peer-to-peer mesh networking diff --git a/transport/mesh/storeforward.go b/transport/mesh/storeforward.go index 1fcb93d..eb4fe48 100644 --- a/transport/mesh/storeforward.go +++ b/transport/mesh/storeforward.go @@ -51,7 +51,7 @@ type QueueConfig struct { func NewMessageQueue(config *QueueConfig) (*MessageQueue, error) { if config == nil { config = &QueueConfig{ - QueueDir: filepath.Join(os.TempDir(), "veilith-queue"), + QueueDir: filepath.Join(os.TempDir(), "khimera-queue"), MaxAge: 24 * time.Hour, MaxSize: 1000, MaxAttempts: 10, diff --git a/transport/tor/embedded.go b/transport/tor/embedded.go index c1800d8..fd92805 100644 --- a/transport/tor/embedded.go +++ b/transport/tor/embedded.go @@ -56,7 +56,7 @@ func NewEmbeddedTor(config *EmbeddedTorConfig) (*EmbeddedTor, error) { if dataDir == "" { // Use temp directory tmpDir := os.TempDir() - dataDir = filepath.Join(tmpDir, "veilith-tor-"+randomString(8)) + dataDir = filepath.Join(tmpDir, "khimera-tor-"+randomString(8)) } if err := os.MkdirAll(dataDir, 0700); err != nil { @@ -168,7 +168,7 @@ func (et *EmbeddedTor) Start() error { // writeTorrc writes Tor configuration file func (et *EmbeddedTor) writeTorrc(path string) error { - config := fmt.Sprintf(`# Veilith Embedded Tor Configuration + config := fmt.Sprintf(`# Khimera Embedded Tor Configuration # Data directory DataDirectory %s diff --git a/transport/tor/tor.go b/transport/tor/tor.go index a6a1e35..1e402c6 100644 --- a/transport/tor/tor.go +++ b/transport/tor/tor.go @@ -8,7 +8,7 @@ import ( "golang.org/x/net/proxy" - "veilith/transport" + "khimera/transport" ) // TorTransport implements Tor-based networking diff --git a/veilith-main.go b/veilith-main.go deleted file mode 100644 index 72e5c25..0000000 --- a/veilith-main.go +++ /dev/null @@ -1,328 +0,0 @@ -// cmd/veilith-portable/main.go -package main - -import ( - "fmt" - "log" - "os" - "path/filepath" - "runtime" - - "fyne.io/fyne/v2/app" - "fyne.io/fyne/v2/container" - "fyne.io/fyne/v2/widget" - - "veilith/addressbook" - "veilith/identity" - "veilith/session" - "veilith/transport" - "veilith/transport/mesh" - "veilith/transport/tor" -) - -// PortableApp represents the portable Veilith application -type PortableApp struct { - config *PortableConfig - identity *identity.Identity - addressBook *addressbook.AddressBook - sessionMgr *session.SessionManager - transportMgr *transport.TransportManager -} - -// PortableConfig holds portable mode configuration -type PortableConfig struct { - IsPortable bool - BaseDir string - DataDir string - TorDir string - TempDir string - IdentityPath string - ContactsPath string - ConfigPath string - IsUSB bool - IsNetworkShare bool - Platform string -} - -func main() { - fmt.Println("โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—") - fmt.Println("โ•‘ VEILITH PORTABLE v0.9 โ•‘") - fmt.Println("โ•‘ Privacy-First P2P Messenger โ•‘") - fmt.Println("โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•") - fmt.Println() - - // Detect and setup portable mode - config, err := detectPortableMode() - if err != nil { - log.Fatalf("Failed to initialize portable mode: %v", err) - } - - // Display portable status - displayPortableStatus(config) - - // Initialize portable app - portableApp := &PortableApp{ - config: config, - } - - // Setup data directories - if err := portableApp.setupDirectories(); err != nil { - log.Fatalf("Failed to setup directories: %v", err) - } - - // Start GUI - portableApp.startGUI() -} - -// detectPortableMode detects portable environment -func detectPortableMode() (*PortableConfig, error) { - // Get executable location - exe, err := os.Executable() - if err != nil { - return nil, fmt.Errorf("failed to get executable path: %w", err) - } - - baseDir := filepath.Dir(exe) - - config := &PortableConfig{ - IsPortable: true, - BaseDir: baseDir, - DataDir: filepath.Join(baseDir, "data"), - TorDir: filepath.Join(baseDir, "tor"), - TempDir: filepath.Join(baseDir, "temp"), - Platform: runtime.GOOS, - } - - // Set file paths - config.IdentityPath = filepath.Join(config.DataDir, "identity.enc") - config.ContactsPath = filepath.Join(config.DataDir, "contacts.enc") - config.ConfigPath = filepath.Join(config.DataDir, "config.json") - - // Detect if running from USB - config.IsUSB = isRemovableDrive(baseDir) - config.IsNetworkShare = isNetworkPath(baseDir) - - return config, nil -} - -// isRemovableDrive checks if path is on removable media -func isRemovableDrive(path string) bool { - switch runtime.GOOS { - case "windows": - return isWindowsRemovable(path) - case "linux": - return isLinuxRemovable(path) - default: - return false - } -} - -// isWindowsRemovable checks for Windows removable drives -func isWindowsRemovable(path string) bool { - // Simplified check - in production use Windows API - drive := filepath.VolumeName(path) - // Check if drive letter is in typical USB range (E: to Z:) - if len(drive) > 0 { - letter := drive[0] - return letter >= 'E' && letter <= 'Z' - } - return false -} - -// isLinuxRemovable checks for Linux removable media -func isLinuxRemovable(path string) bool { - // Check if path contains /media or /mnt (typical USB mount points) - return filepath.HasPrefix(path, "/media") || - filepath.HasPrefix(path, "/mnt") -} - -// isNetworkPath checks if running from network share -func isNetworkPath(path string) bool { - switch runtime.GOOS { - case "windows": - return filepath.HasPrefix(path, "\\\\") - case "linux": - // Check for NFS/SMB mounts (simplified) - return false - } - return false -} - -// displayPortableStatus shows portable mode information -func displayPortableStatus(config *PortableConfig) { - fmt.Println("๐Ÿ“ Portable Mode Configuration") - fmt.Println("โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”") - fmt.Printf(" Platform: %s\n", config.Platform) - fmt.Printf(" Base Dir: %s\n", config.BaseDir) - fmt.Printf(" Data Dir: %s\n", config.DataDir) - fmt.Printf(" Running from: ") - - if config.IsUSB { - fmt.Println("USB Drive โœ“") - } else if config.IsNetworkShare { - fmt.Println("Network Share โœ“") - } else { - fmt.Println("Local Drive") - } - fmt.Println() -} - -// setupDirectories creates required directories -func (pa *PortableApp) setupDirectories() error { - dirs := []string{ - pa.config.DataDir, - pa.config.TorDir, - pa.config.TempDir, - } - - for _, dir := range dirs { - if err := os.MkdirAll(dir, 0700); err != nil { - return fmt.Errorf("failed to create directory %s: %w", dir, err) - } - } - - fmt.Println("โœ“ Directories initialized") - return nil -} - -// startGUI launches the portable GUI application -func (pa *PortableApp) startGUI() { - myApp := app.New() - myWindow := myApp.NewWindow("Veilith Portable v0.9") - - // Welcome screen - welcomeLabel := widget.NewLabel("Welcome to Veilith Portable") - welcomeLabel.Alignment = fyne.TextAlignCenter - - infoLabel := widget.NewLabel(fmt.Sprintf( - "Running from: %s\nData directory: %s", - pa.config.BaseDir, - pa.config.DataDir, - )) - infoLabel.Wrapping = fyne.TextWrapWord - - // Identity section - var passphraseEntry *widget.Entry - var statusLabel *widget.Label - - statusLabel = widget.NewLabel("No identity loaded") - - passphraseEntry = widget.NewPasswordEntry() - passphraseEntry.SetPlaceHolder("Enter passphrase...") - - // Load/Create identity button - loadBtn := widget.NewButton("Load Identity", func() { - passphrase := passphraseEntry.Text - if passphrase == "" { - statusLabel.SetText("โš  Please enter a passphrase") - return - } - - // Try to load existing identity - if _, err := os.Stat(pa.config.IdentityPath); err == nil { - id, err := identity.LoadIdentity(pa.config.IdentityPath, []byte(passphrase)) - if err != nil { - statusLabel.SetText("โš  Failed to load identity (wrong passphrase?)") - return - } - pa.identity = id - statusLabel.SetText("โœ“ Identity loaded: " + id.GetPublicKeyHex()[:16] + "...") - } else { - // Create new identity - id, err := identity.NewIdentity() - if err != nil { - statusLabel.SetText("โš  Failed to create identity") - return - } - - if err := id.Save(pa.config.IdentityPath, []byte(passphrase)); err != nil { - statusLabel.SetText("โš  Failed to save identity") - return - } - - pa.identity = id - statusLabel.SetText("โœ“ New identity created: " + id.GetPublicKeyHex()[:16] + "...") - } - - // Initialize other components - pa.initializeComponents() - }) - - // Quit button - quitBtn := widget.NewButton("Quit", func() { - pa.cleanup() - myApp.Quit() - }) - - // Layout - content := container.NewVBox( - welcomeLabel, - widget.NewSeparator(), - infoLabel, - widget.NewSeparator(), - widget.NewLabel("Identity Management:"), - passphraseEntry, - loadBtn, - statusLabel, - widget.NewSeparator(), - quitBtn, - ) - - myWindow.SetContent(content) - myWindow.Resize(fyne.NewSize(600, 400)) - myWindow.CenterOnScreen() - myWindow.ShowAndRun() -} - -// initializeComponents initializes core components after identity is loaded -func (pa *PortableApp) initializeComponents() error { - // Initialize session manager - pa.sessionMgr = session.NewSessionManager() - - // Initialize transport manager - pa.transportMgr = transport.NewTransportManager() - - // Try to load address book - if _, err := os.Stat(pa.config.ContactsPath); err == nil { - // Load existing contacts - fmt.Println("โœ“ Address book loaded") - } else { - // Create new address book - pa.addressBook = addressbook.NewAddressBook() - fmt.Println("โœ“ New address book created") - } - - fmt.Println("โœ“ Components initialized") - return nil -} - -// cleanup performs cleanup on application exit -func (pa *PortableApp) cleanup() { - fmt.Println("\n๐Ÿงน Cleaning up...") - - // Secure wipe sessions - if pa.sessionMgr != nil { - pa.sessionMgr.SecureWipeAll() - fmt.Println(" โœ“ Sessions wiped") - } - - // Close transports - if pa.transportMgr != nil { - pa.transportMgr.Close() - fmt.Println(" โœ“ Transports closed") - } - - // Wipe identity from memory - if pa.identity != nil { - pa.identity.SecureWipe() - fmt.Println(" โœ“ Identity wiped from memory") - } - - // Clean temp directory - if pa.config.TempDir != "" { - os.RemoveAll(pa.config.TempDir) - fmt.Println(" โœ“ Temp files removed") - } - - fmt.Println("โœ“ Cleanup complete") -} -- cgit v1.2.3