ether: specify v23 flags using env var
Change-Id: Ia035180e08e2705caf7e4d5e918507176e900978
diff --git a/.gitignore b/.gitignore
index aa673e6..f325f9d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
-bin
-node_modules
-public/bundle.*
-tmp
+/bin
+/creds
+/node_modules
+/public/bundle.*
+/tmp
diff --git a/Makefile b/Makefile
index 3156e47..a29722d 100644
--- a/Makefile
+++ b/Makefile
@@ -47,6 +47,11 @@
v23 go build -a -o $@/syncbased v.io/syncbase/x/ref/services/syncbase/syncbased
touch $@
+# Mints credentials.
+creds: bin
+ ./bin/principal seekblessings --v23.credentials creds
+ touch $@
+
node_modules: package.json $(shell $(FIND) $(V23_ROOT)/roadmap/javascript/syncbase/{package.json,src} $(V23_ROOT)/release/javascript/core/{package.json,src})
npm prune
npm install
@@ -64,8 +69,11 @@
# https://github.com/substack/node-browserify/issues/1063
touch $@
+# TODO(sadovsky): Newest cssnano appears to be broken with Vanadium's old
+# version of node, 0.10.24.
public/bundle.min.css: $(shell find stylesheets) node_modules
- lessc -sm=on stylesheets/index.less | postcss -u autoprefixer -u cssnano > $@
+# lessc -sm=on stylesheets/index.less | postcss -u autoprefixer -u cssnano > $@
+ lessc -sm=on stylesheets/index.less | postcss -u autoprefixer > $@
public/bundle.min.js: browser/index.js $(shell find browser) node_modules
ifdef DEBUG
diff --git a/README.md b/README.md
index e6fb7dd..0adce83 100644
--- a/README.md
+++ b/README.md
@@ -17,17 +17,17 @@
Next, if you haven't already, generate credentials to use for running the local
daemons (mounttabled and syncbased). Leave the blessing extension field empty.
- ./bin/principal seekblessings --v23.credentials tmp/creds
+ make creds
Next, start local daemons (in another terminal). This script runs mounttabled
and syncbased at ports `$PORT+1` and `$PORT+2` respectively, and configures
Syncbase to persist its data under `tmp/syncbase_$PORT`. It expects to find
-credentials in `tmp/creds`.
+credentials in `creds`.
PORT=4000 ./tools/start_services.sh
# Or, start from a clean slate.
- rm -rf tmp/syncbase* && PORT=4000 ./tools/start_services.sh
+ rm -rf tmp && PORT=4000 ./tools/start_services.sh
Finally, start the web app.
@@ -104,21 +104,21 @@
Signature
- $V23_ROOT/release/go/bin/vrpc -v23.credentials=tmp/creds signature /localhost:4002
+ $V23_ROOT/release/go/bin/vrpc -v23.credentials=creds signature /localhost:4002
Method call
- $V23_ROOT/release/go/bin/vrpc -v23.credentials=tmp/creds call /localhost:4002 GetPermissions
- $V23_ROOT/release/go/bin/vrpc -v23.credentials=tmp/creds call /localhost:4002/todos/db/tb Scan '""' '""'
+ $V23_ROOT/release/go/bin/vrpc -v23.credentials=creds call /localhost:4002 GetPermissions
+ $V23_ROOT/release/go/bin/vrpc -v23.credentials=creds call /localhost:4002/todos/db/tb Scan '""' '""'
Glob
- $V23_ROOT/release/go/bin/namespace -v23.credentials=tmp/creds glob "/localhost:4002/..."
+ $V23_ROOT/release/go/bin/namespace -v23.credentials=creds glob "/localhost:4002/..."
Debug
- $V23_ROOT/release/go/bin/debug -v23.credentials=tmp/creds glob "/localhost:4002/__debug/stats/rpc/server/routing-id/..."
- $V23_ROOT/release/go/bin/debug -v23.credentials=tmp/creds stats read "/localhost:4002/__debug/stats/rpc/server/routing-id/c61964ab4c72ee522067eb6d5ddd22fc/methods/BeginBatch/latency-ms"
+ $V23_ROOT/release/go/bin/debug -v23.credentials=creds glob "/localhost:4002/__debug/stats/rpc/server/routing-id/..."
+ $V23_ROOT/release/go/bin/debug -v23.credentials=creds stats read "/localhost:4002/__debug/stats/rpc/server/routing-id/c61964ab4c72ee522067eb6d5ddd22fc/methods/BeginBatch/latency-ms"
### Integration test setup
diff --git a/demo.md b/demo.md
index a37030e..2f842b1 100644
--- a/demo.md
+++ b/demo.md
@@ -8,11 +8,11 @@
Run these commands once:
DEBUG=1 make build
- ./bin/principal seekblessings --v23.credentials tmp/creds
+ make creds
Run these commands (each from its own terminal) on each reset:
- rm -rf tmp/syncbase* && PORT=5000 ./tools/start_services.sh
+ rm -rf tmp && PORT=5000 ./tools/start_services.sh
PORT=5100 ./tools/start_services.sh
DEBUG=1 PORT=5000 make serve
@@ -30,11 +30,11 @@
Run these commands once:
DEBUG=1 make build
- ./bin/principal seekblessings --v23.credentials tmp/creds
+ make creds
Run these commands (each from its own terminal) on each reset:
- rm -rf tmp/syncbase* && PORT=5000 ./tools/start_services.sh
+ rm -rf tmp && PORT=5000 ./tools/start_services.sh
DEBUG=1 PORT=5000 make serve
diff --git a/tools/start_services.sh b/tools/start_services.sh
index b302f62..ba2859b 100755
--- a/tools/start_services.sh
+++ b/tools/start_services.sh
@@ -1,9 +1,6 @@
#!/bin/bash
-# Expects credentials in tmp/creds, generated as follows:
-#
-# make build
-# ./bin/principal seekblessings --v23.credentials tmp/creds
+# Expects credentials in creds dir, generated using "make creds".
set -euo pipefail
@@ -38,7 +35,7 @@
# extension.
./bin/mounttabled \
--v23.tcp.address=${MOUNTTABLED_ADDR} \
- --v23.credentials=${TMP}/creds &
+ --v23.credentials=creds &
./bin/syncbased \
--v=5 \
@@ -47,7 +44,7 @@
--name=syncbase \
--v23.namespace.root=/${MOUNTTABLED_ADDR} \
--v23.tcp.address=${SYNCBASED_ADDR} \
- --v23.credentials=${TMP}/creds \
+ --v23.credentials=creds \
--v23.permissions.literal='{"Admin":{"In":["..."]},"Write":{"In":["..."]},"Read":{"In":["..."]},"Resolve":{"In":["..."]},"Debug":{"In":["..."]}}'
tail -f /dev/null # wait forever