aboutsummaryrefslogtreecommitdiff
path: root/justfile
diff options
context:
space:
mode:
authorbenj <benj@rse8.com>2022-12-30 15:57:36 -0800
committerbenj <benj@rse8.com>2022-12-30 15:57:36 -0800
commit8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3 (patch)
tree1ff85fd9fbd94a5559f9dbac755973fd58b31f28 /justfile
parentf0ea9ecd17b03605d747044874a26e1bd52c0ee1 (diff)
downloadsecdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar
secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar.gz
secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar.bz2
secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar.lz
secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar.xz
secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.tar.zst
secdiam-8ca3433b2a4a82723e00e64b1e5aff0b1bed95b3.zip
impl authZ write and check (depends on spicedb for now)
Diffstat (limited to 'justfile')
-rw-r--r--justfile25
1 files changed, 21 insertions, 4 deletions
diff --git a/justfile b/justfile
index 6411cc9..1bb89c3 100644
--- a/justfile
+++ b/justfile
@@ -1,3 +1,9 @@
+PG_USER := "secduser"
+PG_PASS := "p4ssw0rd"
+PG_DB := "secd"
+PG_PORT := "5412"
+PG_URL := "postgres://" + PG_USER + ":" + PG_PASS + "@host.docker.internal:" + PG_PORT / PG_DB
+
run-debug:
@RUST_BACKTRACE=1 cargo run $@
@@ -7,8 +13,19 @@ build:
build-prod:
@cargo build --release
-start-postgres:
- @docker start secd-db || docker run -d --name secd-db -e POSTGRES_PASSWORD=p4ssw0rd -e POSTGRES_USER=secduser -e POSTGRES_DB=secd -p 5412:5432 postgres:12 -c log_statement=all
+@start-postgres: _start_postgres start-spice
+
+@migrate-spice:
+ docker run --rm --add-host host.docker.internal:host-gateway --name spice_migrator authzed/spicedb migrate head --datastore-engine postgres --datastore-conn-uri "{{PG_URL}}"
+
+@start-spice: migrate-spice
+ docker start spice || docker run -d --add-host host.docker.internal:host-gateway --name spice -p 50051:50051 -p 9090:9090 -p 8080:8080 -p 9443:8443 authzed/spicedb serve --grpc-preshared-key "sup3rs3cr3tk3y" --http-enabled --datastore-engine postgres --datastore-conn-uri "{{PG_URL}}"
+
+@_start_postgres:
+ docker start secddb || docker run -d --name secddb -e POSTGRES_PASSWORD={{PG_PASS}} -e POSTGRES_USER={{PG_USER}} -e POSTGRES_DB={{PG_DB}} -p {{PG_PORT}}:5432 postgres:13 -c log_statement=all
+
+@start-mailserver:
+ docker start mailhog || docker run -d --name mailhog -p 7180:8025 -p 25:1025 mailhog/mailhog:latest
-start-mailserver:
- @docker start mailhog || docker run -d --name mailhog -p 7180:8025 -p 25:1025 mailhog/mailhog:latest
+@clean:
+ docker rm -f spice secddb