Skip to content

PotatoMaster101/sectxt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: GPL v3

Sectxt

Sending secret messages using a password.

Crates

Setup Development

docker compose up -d
$env:DATABASE_URL = "postgres://postgres:postgres@127.0.0.1:5432/postgres?sslmode=disable"
sqlx migrate run --source 'crates/sectxt-db/migrations'
trunk serve

Run Tests

$env:DATABASE_URL = "postgres://postgres:postgres@127.0.0.1:5432/postgres?sslmode=disable"
cargo test

Setup Production

# backend
cargo lambda build --arm64 --release --output-format zip -p sectxt-lambda-message
aws login
terraform init
terraform apply -auto-approve
sqlx migrate run --source 'crates/sectxt-db/migrations' --database-url "$(terraform output -raw database_url)"

# frontend
trunk build --release
aws s3 sync 'dist/' "s3://$(terraform output -raw asset_bucket)" --delete

Test Endpoint

Test create message:

curl -X POST -H "Content-Type: application/json" "$(terraform output -raw create_endpoint_url)" -d '{
  "auth_token": [1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2],
  "ciphertext": [1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9],
  "nonce": [1,2,3,4,5,6,7,8,9,0,1,2],
  "salt": [1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6]
}'

Test consume message:

curl -X POST -H "Content-Type: application/json" "$(terraform output -raw consume_endpoint_url)" -d '{
  "auth_token": [1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2],
  "id": "<ID>"
}'

Destroy Production

terraform destroy -auto-approve

TODO

  • Add attachment upload support
  • Implement frontend

About

Sending secret messages using a password

Topics

Resources

License

Stars

Watchers

Forks

Contributors