From 0de80eac66fe1dff60c576d7d1fbb951df107033 Mon Sep 17 00:00:00 2001 From: Sebastien Awwad Date: Mon, 8 May 2017 17:22:10 -0400 Subject: [PATCH 1/6] (WIP) Initial draft of README for web frontend --- demo/README_webfrontend.md | 83 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 demo/README_webfrontend.md diff --git a/demo/README_webfrontend.md b/demo/README_webfrontend.md new file mode 100644 index 0000000..b815bec --- /dev/null +++ b/demo/README_webfrontend.md @@ -0,0 +1,83 @@ +# Demo Web Frontend Instructions + +Note that code for the demo web frontend is in another repository, +uptane_web_app, on git.uptane.org, which is not yet shared. + + +## Starting the Web Frontend +The other services and the web frontend need to be in sync. I will provide +instructions here as if none of them are running, but the important point is +that if the Director Repo or Image Repo are restarted, you'll need to perform +step 4 if the Director Repo is restarted, and steps 4 and 5 if the Image Repo +is restarted. (More detailed conditionals can be written out, but in short: +if services restart, start this list over.) +1. Start director repo, image repo, and timeserver via console (Windows 1-3), as normal per the demo instructions in the Uptane readme. +2. Start the web frontend: python3 web2py.py -a 'admin-password' -c server.crt -k server.key -i 127.0.0.1 -p 8000 + - Note that this needs to be somewhere where Uptane is installed. For example, if Uptane is installed in a virtual environment, then source that virtual environment before running this command. +3. Open the web frontend in a browser, in two instances, one in private browsing (Or you can use two different browsers.), so that you can log in as two separate users simultaneously: + - https://localhost:8000/UPTANE/default/index + - Window 6: Login 1, accessing the Image Repository: + - user: supplier1 / password: supplier1pass + - Window 7: Login 2, accessing the Director Repository: + - user: oem1 / password: oem1pass +4. In the web frontend for the Director Repository (Window 7): + - Delete any existing rows (vehicles) +5. In the web frontend for the Image Repository (Window 6): + - (Make sure to have done the previous step first.) + - Delete any existing rows (images) + - Upload new images by filling in ECU Type, Update Version, and Update Image. The order of these doesn't matter. The filenames should match. Where the files are found doesn't matter, and neither do the contents really, but these files are included in uptane_web_app/applications/UPTANE/test_uploads/ + - INFO / 1.0 / INFO-1.0.png + - BCU / 1.1 / BCU1.1.jpg + - TCU / 1.0 / TCU-1.0.jpg + - TCU / 1.1 / TCU-1.1.jpg + - TCU / 1.2 / TCU-1.2.jpg +6. In the web frontend for the Director Repository: + - Click Add Record and fill this in: + - VIN: democar + - Note: + - ECU List: TCU-1.0, INFO-1.0, BCU-1.1 + - Click the Checkin Date field and choose a date and time (any time in the past or now) + - Click Submit + +The servers are now ready. + + +## Starting the Clients +1. Start a demo Primary client in a console: + - python + - import demo.demo_primary as dp + - dp.clean_slate(vin='democar', ecu_serial='INFOdemocar') +2. Start a demo Secondary client in a console, when the Primary is done starting: + - python + - import demo.demo_secondary as ds + - ds.clean_slate(vin='democar', ecu_serial='TCUdemocar') + - Note that if the Primary port isn't 30701 (generally, if you were running multiple Primaries when the Primary started), you need the additional parameter primary_port=. You can get that port from the messages produced by the Primary when it starts. + + +## Performing a normal update: +1. Assign an update to democar + - In the Director Repository web frontend window: + - Select the democar row and click View Vehicle Data + - Uncheck TCU 1.0 and check TCU 1.1 + - Click Create Bundle +2. Instruct the demo Primary to fetch new images and metadata for the vehicle + - In the Primary's console window: + - dp.update_cycle() +3. When that is finished, instruct the Secondary to update from the Primary + - In the Secondary's console window: + - ds.update_cycle() +4. You should see an Updated banner + + + + + +----------------------------- +# DEVELOPMENT NOTES + +Modifying the behavior of the hack buttons + +XMLRPC calls made in: +uptane_web_app/applications/UPTANE/controllers/default.py, around line 640 + + From 511dcddeeb98c40aef9246750c7170bda6c0dd89 Mon Sep 17 00:00:00 2001 From: Sebastien Awwad Date: Mon, 8 May 2017 17:31:18 -0400 Subject: [PATCH 2/6] Move NYU Pi instructions to demo folder --- nyu_new_pi_instructions.md => demo/nyu_new_pi_instructions.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename nyu_new_pi_instructions.md => demo/nyu_new_pi_instructions.md (100%) diff --git a/nyu_new_pi_instructions.md b/demo/nyu_new_pi_instructions.md similarity index 100% rename from nyu_new_pi_instructions.md rename to demo/nyu_new_pi_instructions.md From 1175a48aae610873e3088527f4cf77f27a10766b Mon Sep 17 00:00:00 2001 From: Sebastien Awwad Date: Mon, 8 May 2017 17:42:21 -0400 Subject: [PATCH 3/6] DOC: Correct link to uptane_web_app repo --- demo/README_webfrontend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/README_webfrontend.md b/demo/README_webfrontend.md index b815bec..8d2b167 100644 --- a/demo/README_webfrontend.md +++ b/demo/README_webfrontend.md @@ -1,7 +1,7 @@ # Demo Web Frontend Instructions Note that code for the demo web frontend is in another repository, -uptane_web_app, on git.uptane.org, which is not yet shared. +[uptane_web_app](https://github.com/uptane/uptane_web_app]). ## Starting the Web Frontend From 3bf90517d3a5863104108ff3df2f0371223e2913 Mon Sep 17 00:00:00 2001 From: Sebastien Awwad Date: Mon, 8 May 2017 17:45:18 -0400 Subject: [PATCH 4/6] DOC: Correct names of files starting in Image Repo in demo --- demo/README_webfrontend.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/demo/README_webfrontend.md b/demo/README_webfrontend.md index 8d2b167..f80b3d7 100644 --- a/demo/README_webfrontend.md +++ b/demo/README_webfrontend.md @@ -26,11 +26,12 @@ if services restart, start this list over.) - (Make sure to have done the previous step first.) - Delete any existing rows (images) - Upload new images by filling in ECU Type, Update Version, and Update Image. The order of these doesn't matter. The filenames should match. Where the files are found doesn't matter, and neither do the contents really, but these files are included in uptane_web_app/applications/UPTANE/test_uploads/ - - INFO / 1.0 / INFO-1.0.png - - BCU / 1.1 / BCU1.1.jpg - - TCU / 1.0 / TCU-1.0.jpg - - TCU / 1.1 / TCU-1.1.jpg - - TCU / 1.2 / TCU-1.2.jpg + - INFO / 1.0 / INFO1.0.txt + - BCU / 1.1 / BCU1.1.txt + - BCU / 1.2 / BCU1.2.txt + - TCU / 1.0 / TCU1.0.txt + - TCU / 1.1 / TCU1.1.txt + - TCU / 1.2 / TCU1.2.txt 6. In the web frontend for the Director Repository: - Click Add Record and fill this in: - VIN: democar From ff63488dc6412e1d4b20d6fe7aa28dd28e6b94e4 Mon Sep 17 00:00:00 2001 From: Sebastien Awwad Date: Mon, 8 May 2017 17:45:52 -0400 Subject: [PATCH 5/6] DOC: Add instructions for OS X and Chrome application-mode --- demo/README_webfrontend.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/demo/README_webfrontend.md b/demo/README_webfrontend.md index f80b3d7..db62965 100644 --- a/demo/README_webfrontend.md +++ b/demo/README_webfrontend.md @@ -20,6 +20,9 @@ if services restart, start this list over.) - user: supplier1 / password: supplier1pass - Window 7: Login 2, accessing the Director Repository: - user: oem1 / password: oem1pass + - In my case, I can run these two commands: + `/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --ignore-certificate-errors --app=https://localhost:8000/UPTANE/default/index/ --incognito` + `/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --ignore-certificate-errors --app=https://localhost:8000/UPTANE/default/index/` 4. In the web frontend for the Director Repository (Window 7): - Delete any existing rows (vehicles) 5. In the web frontend for the Image Repository (Window 6): From 107d6be4b1b8de25d5c28738320dcfa2e346fe81 Mon Sep 17 00:00:00 2001 From: Sebastien Awwad Date: Mon, 8 May 2017 17:46:33 -0400 Subject: [PATCH 6/6] DOC: Note that some initial configuration has been streamlined in the webfrontend readme. --- demo/README_webfrontend.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/demo/README_webfrontend.md b/demo/README_webfrontend.md index db62965..90fcb28 100644 --- a/demo/README_webfrontend.md +++ b/demo/README_webfrontend.md @@ -6,13 +6,10 @@ Note that code for the demo web frontend is in another repository, ## Starting the Web Frontend The other services and the web frontend need to be in sync. I will provide -instructions here as if none of them are running, but the important point is -that if the Director Repo or Image Repo are restarted, you'll need to perform -step 4 if the Director Repo is restarted, and steps 4 and 5 if the Image Repo -is restarted. (More detailed conditionals can be written out, but in short: -if services restart, start this list over.) -1. Start director repo, image repo, and timeserver via console (Windows 1-3), as normal per the demo instructions in the Uptane readme. -2. Start the web frontend: python3 web2py.py -a 'admin-password' -c server.crt -k server.key -i 127.0.0.1 -p 8000 +instructions here as if none of them are running. +1. Start Director Repo, Image Repo, and Timeserver via console (Windows 1-3), as normal per the demo instructions in the [Uptane readme](../blob/develop/README.md). +2. Start the web frontend: + `python3 web2py.py -a 'admin-password' -c server.crt -k server.key -i 127.0.0.1 -p 8000` - Note that this needs to be somewhere where Uptane is installed. For example, if Uptane is installed in a virtual environment, then source that virtual environment before running this command. 3. Open the web frontend in a browser, in two instances, one in private browsing (Or you can use two different browsers.), so that you can log in as two separate users simultaneously: - https://localhost:8000/UPTANE/default/index @@ -23,6 +20,10 @@ if services restart, start this list over.) - In my case, I can run these two commands: `/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --ignore-certificate-errors --app=https://localhost:8000/UPTANE/default/index/ --incognito` `/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --ignore-certificate-errors --app=https://localhost:8000/UPTANE/default/index/` + +**The following steps 4-6 are no longer necessary**, because the Director and Image +Repo now start with these settings. If the values in the web frontend's database +do not match these, however, follow these steps to correct them: 4. In the web frontend for the Director Repository (Window 7): - Delete any existing rows (vehicles) 5. In the web frontend for the Image Repository (Window 6):