This document describes the high-level architecture of this project
If you want to familiarize yourself with the code base and generally how it works, this is a good place to be.
This is a simple state machine. It has 5 major states, init, encrypt, wait, decrypt, and exit. These states corespond to a specific action or series of actions to be performed.
Command & Control Server is a very basic web server with websocket event loop.
<file name>
for a file name
<folder name>/
for a folder
<folder name>/<file name>
for a file within a folder
Readme of the project, it goes over a bunch of things
Documentation about contributing to this project
Earthly is a build system that uses containers to create reporducible environments. This is our configuration file for Earthly. It can do tons of things like building the binary, building the docker container, download dependencies, etc
Were using MIT license
Base of our code. It launches the CMD system
Command line interface module. It pretains to handling the command line interface and all the logic and stuff that goes with it.
Root command. This launches the state machine. It also handles the flags as well as the -h
message
Encrypt subcommand. This just encrypts the file system starting at config.Config.Base. It requires config.Config.Password
to be setup.
Decrypt subcommand. This just decrypts the file system starting at config.Config.Base. It requires config.Config.Password
to be setup.
Configuration system. It holds the constants and types as well as a central configuration struct.
This is the file for above.
File system walking module. It has an interface FileAction
which is the file action to happen on every file that isnt a directory walk.Walk
encounters.
This is the file for above.
File encryption system. It has a struct which implements walk.FileAction
.
This is the file for above.
File decryption system. It has a struct which implements walk.FileAction
.
This is the file for above.
States for state machine.
Initialize connection with cc-server, get password if it isnt supplied, launch heartbeat system, and move to next state.
Encrypt state. Encrypt file system starting at config.Config.Base
Decrypt state. Decrypt file system starting at config.Config.Base
Wait state. Continuesly waits until either config.Config.Signal
or config.Config.HBError
can be read in. If its config.Config.HBError
then return the error.
Exit state. Close config.Config.Conn
.
Command and control server folder.
Readme for command and control server
Earthfile for command and control server.
Base of command and control server. It launches the cmd system.
Command line interface module. It pretains to handling the command line interface and all the logic and stuff that goes with it.
File for above.
Web server for websockets. Has the event loop for connection handling.
Configuration system.
File for above.
Event handlers for specific events.
Init event handler. Responds with the config.Config.Password
Heartbeat event handler. Responds whether in trigger period.
Systemd services for docker container or binary.