|
1 |
| -SCIONLab Go Static Tester |
| 1 | +Webapp AS Visualization |
2 | 2 | =========================
|
3 | 3 |
|
4 |
| -## Webapp Setup |
5 |
| - |
6 |
| -Webapp is a Go application that will serve up a static web portal to make it easy to |
7 |
| -experiment with SCIONLab test apps on a virtual machine. |
8 |
| - |
9 |
| -To install the SCIONLab `webapp`: |
10 |
| - |
11 |
| -```shell |
12 |
| -go get github.com/netsec-ethz/scion-apps/webapp |
13 |
| -``` |
14 |
| - |
15 |
| -### Local Infrastructure |
| 4 | +More installation and usage information is available on the [SCION Tutorials web page for webapp](https://netsec-ethz.github.io/scion-tutorials/as_visualization/webapp/). |
16 | 5 |
|
17 |
| -To run the Go Web UI at default localhost 127.0.0.1:8000 run: |
| 6 | +## Webapp Setup |
| 7 | +Webapp is a Go application that will serve up a static web portal to make it easy to visualize and experiment with SCIONLab test apps on a virtual machine. |
18 | 8 |
|
| 9 | +### Install |
19 | 10 | ```shell
|
20 |
| -webapp |
| 11 | +mkdir ~/go/src/github.com/netsec-ethz |
| 12 | +cd ~/go/src/github.com/netsec-ethz |
| 13 | +git clone https://github.com/netsec-ethz/scion-apps.git |
21 | 14 | ```
|
22 | 15 |
|
23 |
| -### SCIONLab Virtual Machine |
24 |
| - |
25 |
| -Using vagrant, make sure to edit your `vagrantfile` to provision the additional port |
26 |
| -for the Go web server by adding this line for port 8080 (for example, just choose any forwarding |
27 |
| -port not already in use by vagrant): |
28 |
| - |
29 |
| -``` |
30 |
| -config.vm.network "forwarded_port", guest: 8080, host: 8080, protocol: "tcp" |
31 |
| -``` |
32 |
| - |
33 |
| -To run the Go Web UI at a specific address (-a) and port (-p) like 0.0.0.0:8080 for a SCIONLabVM use: |
34 |
| - |
| 16 | +### Build |
| 17 | +Install all [SCIONLab apps](https://github.com/netsec-ethz/scion-apps) and dependancies, including `webapp`: |
35 | 18 | ```shell
|
36 |
| -webapp -a 0.0.0.0 -p 8080 -r . |
| 19 | +cd scion-apps |
| 20 | +./deps.sh |
| 21 | +make install |
37 | 22 | ```
|
38 | 23 |
|
39 |
| -Now, open a web browser at http://127.0.0.1:8080, to begin. |
| 24 | +### Run |
| 25 | +!!! warning |
| 26 | + If the old [scion-viz](https://github.com/netsec-ethz/scion-viz) web server is running on your SCIONLab VM, port 8000 may still be in use. To remedy this, before `vagrant up`, make sure to edit your `vagrantfile` to provision an alternate port for the `webapp` web server. Add this line for a different port, say 8080 (for example, just choose any forwarding port not already in use by vagrant, and use that port everywhere below): |
40 | 27 |
|
41 |
| -## Development |
| 28 | + ``` |
| 29 | + config.vm.network "forwarded_port", guest: 8080, host: 8080, protocol: "tcp" |
| 30 | + ``` |
42 | 31 |
|
43 |
| -For developing the web server go code, since it is annoying to make several changes, |
44 |
| -only to have to start and stop the web server each time, a watcher library |
45 |
| -like `go-watcher` is recommended. |
46 |
| - |
47 |
| -```shell |
48 |
| -go get github.com/canthefason/go-watcher |
49 |
| -go install github.com/canthefason/go-watcher/cmd/watcher |
50 |
| -``` |
51 |
| - |
52 |
| -After installation you can `cd` to the `webapp.go` directory and webapp will be rebuilt |
53 |
| -and rerun every time you save your source file changes, with or without command arguments. |
54 |
| - |
55 |
| -```shell |
56 |
| -cd ~/go/src/github.com/netsec-ethz/scion-apps/webapp |
57 |
| -watcher -a 0.0.0.0 -p 8080 -r .. |
58 |
| -``` |
59 |
| -or |
| 32 | +To run the Go Web UI at a specific address (-a) and port (-p) like 0.0.0.0:8000 for a SCIONLab VM use: |
60 | 33 | ```shell
|
61 |
| -cd ~/go/src/github.com/netsec-ethz/scion-apps/webapp |
62 |
| -watcher |
| 34 | +cd webapp |
| 35 | +webapp -a 0.0.0.0 -p 8000 |
63 | 36 | ```
|
| 37 | +Now, open a web browser at [http://127.0.0.1:8000](http://127.0.0.1:8000), to begin. |
64 | 38 |
|
65 |
| -## Webapp Features |
66 |
| - |
67 |
| -This Go web server wraps several SCION test client apps and provides an interface |
68 |
| -for any text and/or image output received. |
69 |
| -[SCIONLab Apps](http://github.com/netsec-ethz/scion-apps) are on Github. |
70 |
| - |
71 |
| -Two functional server tests are included to test the networks without needing |
72 |
| -specific sensor or camera hardware, `imagetest` and `statstest`. |
73 |
| - |
74 |
| -Supported client applications include `camerapp`, `sensorapp`, and `bwtester`. |
75 |
| -For best results, ensure the desired server-side apps are running and connected to |
76 |
| -the SCION network first. Instructions to setup the servers are |
77 |
| -[here](https://github.com/netsec-ethz/scion-apps/blob/master/README.md). |
78 |
| -The web interface launched above can be used to run the client-side apps. |
79 |
| - |
80 |
| -### File System Browser |
81 |
| - |
82 |
| -The File System Browser button on the front page will allow you to navigate and serve any |
83 |
| -files on the SCIONLab node from the root (-r) directory you specified (if any) when |
84 |
| -starting webapp.go. |
85 |
| - |
86 |
| -### bwtester client |
87 |
| - |
88 |
| -Simply adjust the dials to the desired level, while the icon lock will allow you |
89 |
| -to keep one value constant. |
90 |
| - |
91 |
| - |
92 |
| - |
93 |
| - |
94 |
| -### camerapp client |
95 |
| - |
96 |
| -The retrieved image will appear scaled down and can be clicked on to open a larger size. |
97 |
| - |
98 |
| - |
99 |
| - |
100 |
| - |
101 |
| -### sensorapp client |
102 |
| - |
103 |
| - |
104 |
| - |
105 |
| - |
106 |
| -### statstest server |
107 |
| - |
108 |
| -This hardware-independent test will echo some remote machine stats from the Python script |
109 |
| -`local-stats.py`, which is piped to the server for transmission to clients. |
110 |
| -On your remote SCION server node run (substituting your own address parameters): |
111 |
| - |
112 |
| -```shell |
113 |
| -cd $GOPATH/src/github.com/netsec-ethz/scion-apps/webapp/tests/statstest/statsserver |
114 |
| -python3 local-stats.py | sensorserver -s 1-15,[127.0.0.5]:35555 |
115 |
| -``` |
116 |
| - |
117 |
| -Now, from your webapp browser interface running on your virtual client SCION node, |
118 |
| -you can enter both client and server addresses and ask the client for remote stats |
119 |
| -by clicking on the `sensorapp` tab. |
120 |
| - |
121 |
| -### imagetest server |
122 |
| - |
123 |
| -This hardware-independent test will generate an image with some remote machine stats from |
124 |
| -the Go app `local-image.go`, which will be saved locally for transmission to clients. |
125 |
| - |
126 |
| -You may need golang.org's image package first: |
127 |
| - |
128 |
| -```shell |
129 |
| -go get golang.org/x/image |
130 |
| -``` |
131 |
| - |
132 |
| -On your remote SCION server node run (substituting your own address parameters): |
133 |
| - |
134 |
| -```shell |
135 |
| -cd $GOPATH/src/github.com/netsec-ethz/scion-apps/webapp/tests/imgtest/imgserver |
136 |
| -go build |
137 |
| -./imgserver | imageserver -s 1-18,[127.0.0.8]:38887 |
138 |
| -``` |
139 |
| - |
140 |
| -Now, from your webapp browser interface running on your virtual client SCION node, |
141 |
| -you can enter both client and server addresses and ask the client for the most |
142 |
| -recently generated remote image by clicking on the `camerapp` tab. |
143 |
| - |
| 39 | +## Related Links |
| 40 | +* [Webapp SCIONLab AS Visualization Tutorials](https://netsec-ethz.github.io/scion-tutorials/as_visualization/webapp/) |
| 41 | +* [Webapp SCIONLab Apps Visualization](https://netsec-ethz.github.io/scion-tutorials/as_visualization/webapp_apps/) |
| 42 | +* [Webapp Development Tips](https://netsec-ethz.github.io/scion-tutorials/as_visualization/webapp_development/) |
0 commit comments