Discover Packages
github.com/84adam/arkfile
command
module
Version:
v0.0.0-...-e12197d
Opens a new window with list of versions in this module.
Published: Dec 13, 2024
License: MIT
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Arkfile
s3-style encrypted file backup
High-Level Architecture
Components
Client-Side
Web interface for user interaction
WebAssembly (WASM) module for client-side encryption/decryption
JavaScript for WASM interaction and API calls
Server-Side
Go HTTP server (Echo framework)
JWT authentication
SQLite database for user data and file metadata
Integration with Backblaze B2 (via MinIO client) for file storage
External Services
Backblaze B2 for encrypted file storage
Caddy web server for TLS and reverse proxy
Security Features
Client-side encryption using user passwords
Password hints stored separately from encrypted files
JWT-based authentication
TLS encryption for all traffic
Secure key derivation (PBKDF2)
Key Files and Their Purposes
main.go
Application entry point
Server setup and routing
Middleware configuration
client/main.go
Client-side encryption/decryption logic
WASM-based file processing
handlers/handlers.go
HTTP request handlers
File upload/download logic
User authentication handlers
storage/minio.go
Backblaze B2 integration
File storage operations
auth/jwt.go
JWT token generation and validation
Authentication middleware
database/database.go
Database connection setup
Schema creation
File metadata storage
Data Flow
File Upload
Client → Client-side Encryption (WASM)
→ Server (Echo) → Backblaze B2
→ SQLite (metadata)
File Download
Client → Server Request
→ Server (Echo) → Backblaze B2 (encrypted file)
→ SQLite (password hint)
→ Client → Client-side Decryption (WASM)
Environment Variables
BACKBLAZE_ENDPOINT=...
BACKBLAZE_KEY_ID=...
BACKBLAZE_APPLICATION_KEY=...
BACKBLAZE_BUCKET_NAME=...
JWT_SECRET=...
VULTR_API_KEY=...
Build and Deployment
Build Process
Compile server-side Go code
Compile client-side Go code to WASM
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" client/
cd client/
GOOS=js GOARCH=wasm go build -o main.wasm
Bundle static assets
Deployment
Set up Vultr server with Rocky Linux
Configure Caddy for TLS
Set up systemd services
Configure firewall
Security Layers
Transport Security
TLS via Caddy
HTTPS enforcement
Data Security
Client-side encryption
Secure key derivation
Password hints
Authentication
JWT-based auth
Secure password storage
Authorization
File access control
User permissions
The application follows a clean architecture pattern with clear separation of concerns, making it maintainable and scalable. Each component has a single responsibility, and dependencies flow inward from external services to the core business logic.
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.