cherubgyre is an anonymous community defense social network
https://cherubgyre.com is under construction, but it's got some links. https://api.cherubgyre.com has api docs.
- Open AWS CloudShell. Sometimes it's worth issuing a command to clear the docker build cache in CloudShell before you begin, since the storage they give you is minimal:
docker system prune -a -f
-
In CloudShell upload
deploy-script.sh
from this repo using theActions > Upload File
in the upper-right corner of the screen. -
deploy-script.sh
will be uploaded to/home/cloudshell-user
. Make it executable.
chmod 755 deploy-script.sh
- To deploy environment
cherubgyre-prod
and create all AWS components necessary to support that environment, execute the script with the following options:
sh deploy-script.sh -d cherubgyre-prod
- When the script is done, it will print details of the deployment to your shell, including the public URL at which the endpoint for the API is available.
-
Open AWS CloudShell.
-
In CloudShell upload
deploy-script.sh
from this repo using theActions > Upload File
in the upper-right corner of the screen. -
deploy-script.sh
will be uploaded to/home/cloudshell-user
. Make it executable.
chmod 755 deploy-script.sh
- To undeploy environment
cherubgyre-prod
and remove all AWS components related to that environment, execute the script with the following options:
sh deploy-script.sh -u cherubgyre-prod
- When the script is done, it will confirm that all components of the ennvironment have been deprovisioned.
-
Install rust, following instructions at https://rustup.rs
-
Clone this repo
-
Install RustRover from JetBrains (register for an account, free for non-commercial use)
-
Install lld linker for faster compile times
brew install llvm
or
apt install llvm lld clang
-
Install cargo-watch to trigger commands when source code changes. Chain some commands so cargo watch runs check, (if successful) then test, (if successful) then run:
cargo install cargo-watch cargo watch -x check -x test -x run
-
Install cargo-llvm-cov to measure code coverage, and run cargo llvm-cov to compute code coverage for the application.
rustup component add llvm-tools-preview cargo install cargo-llvm-cov cargo llvm-cov
-
Make sure the linter "clippy" is installed. Run it to fail the pipeline if there are warnings.
rustup component add clippy cargo clippy -- -D warnings
-
Add rustfmt for automatic code formatting. Run it using cargo fmt (or
cargo fmt -- ---check
if you'd prefer a formatting step for caution. I don't.)rustup component add rustfmt cargo fmt
-
Add cargo-audit for security audits. Run it to scan your dependency tree.
cargo install cargo-audit cargo audit
- Check out
.github/workflows/general.yaml
in this repository: it will run some of the above fmt and clippy checks on every push to main. - Check out
.github/workflows/audit.yaml
in this repository: it will run audits on every push to main. - Tests will be in
tests/
here because it is preferable to externalize tests from the source for the purposes of visibility and security. We don't want to give tests any privileged access to the code.