Skip to content

Commit

Permalink
Fixing relative paths and Py module imports
Browse files Browse the repository at this point in the history
  • Loading branch information
justnom committed Mar 23, 2021
1 parent 8ab81b5 commit 8742caa
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.vscode
.vscode
seed.bin
serialnumber
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ On initial deployment and subsequent key rotations a new key pair has to be gene
## Seed Serialization, Signing and Serving
The following steps are performed by CI to publish the updated seed file:

1. Run `$ python seed/serialize.py` to compile the protobuf.
1. Run `$ python seed/serialize.py seed/seed.json` to compile the protobuf.
2. Sign the seed file with `$ go run /crypto/crypto_util.go sign`.
3. Update the `X-Seed-Signature` response header.
4. Update the ETAG header with the contents of `/seed/serialnumber`.
4. Update the ETAG header with the contents of `serialnumber`.

## Some Notes on using variations in the Browser
- Studies only take effect after restarting the browser.
Expand All @@ -40,4 +40,4 @@ The following steps are performed by CI to publish the updated seed file:
## Dashboard
To build the dashboard:
1. Install dependencies `$ npm install`
2. Bundle resources `$ npm run build`
2. Bundle resources `$ npm run build`
2 changes: 1 addition & 1 deletion crypto/crypto_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func SignSeedData() error {
return err
}

seedData, err := ioutil.ReadFile("./seed")
seedData, err := ioutil.ReadFile("./seed.bin")
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion seed/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__pycache__
seed
venv
venv
serialnumber
Empty file added seed/proto/__init__.py
Empty file.
Binary file added seed/proto/__init__.pyc
Binary file not shown.
Binary file added seed/proto/study_pb2.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion seed/proto/variations_seed_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions seed/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import datetime
import hashlib
import json
import study_pb2
import proto.study_pb2 as study_pb2
import sys
import time
import variations_seed_pb2
import proto.variations_seed_pb2 as variations_seed_pb2

SEED_JSON_PATH = "./seed.json"
SEED_BIN_PATH = "./seed"
SEED_BIN_PATH = "./seed.bin"
SERIALNUMBER_PATH = "./serialnumber"
CONSISTENCY = "permanent"
TOTAL_PROBA = 100
Expand Down Expand Up @@ -134,7 +133,7 @@ def serialize_and_save_variations_seed_message(seed_data, path):

if __name__ == "__main__":
print("Load seed.json")
seed_data = load(SEED_JSON_PATH)
seed_data = load(sys.argv[1])

print("Validate seed data")
if validate(seed_data):
Expand Down

0 comments on commit 8742caa

Please sign in to comment.