Skip to content

Commit 6694202

Browse files
mwfarbjuagargi
authored andcommitted
Updated README.md for packaged run
1 parent 4c34411 commit 6694202

File tree

1 file changed

+71
-14
lines changed

1 file changed

+71
-14
lines changed

webapp/README.md

Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,95 @@ Webapp AS Visualization
33

44
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/).
55

6-
## Webapp Setup
6+
## Webapp
77
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.
88

9-
### Install
9+
10+
## Packaged Setup/Run
11+
For running `webapp` in a package environment, like the default [SCIONLab](https://www.scionlab.org) environment, it will require command-line options for `webapp` to find the tools its requires. In most cases, the default `scionlab` and `scion-apps` packages will need to be specified on the command-line.
12+
13+
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:
14+
```shell
15+
webapp \
16+
-a 0.0.0.0 \
17+
-p 8000 \
18+
-r /var/www/webapp/web/data \
19+
-srvroot /var/www/webapp/web \
20+
-sabin /usr/bin \
21+
-sroot /etc/scion \
22+
-sbin /usr/bin \
23+
-sgen /etc/scion/gen \
24+
-sgenc /var/lib/scion \
25+
-slogs /var/log/scion
26+
```
27+
Now, open a web browser at [http://127.0.0.1:8000](http://127.0.0.1:8000), to begin.
28+
29+
30+
## Development Setup/Run
31+
For running `webapp` in a development environment for the SCION Infrastucture, follow the SCIONLab development install and run process at [https://github.com/netsec-ethz/netsec-scion](https://github.com/netsec-ethz/netsec-scion).
32+
33+
Then, follow these steps to install SCIONLab Apps to run `webapp` in development.
34+
35+
### Development Install
1036
```shell
1137
mkdir ~/go/src/github.com/netsec-ethz
1238
cd ~/go/src/github.com/netsec-ethz
1339
git clone https://github.com/netsec-ethz/scion-apps.git
1440
```
1541

16-
### Build
17-
Install all [SCIONLab apps](https://github.com/netsec-ethz/scion-apps) and dependancies, including `webapp`:
42+
### Development Build
43+
Install all [SCIONLab apps](https://github.com/netsec-ethz/scion-apps) and dependencies, including `webapp`:
1844
```shell
1945
cd scion-apps
2046
./deps.sh
2147
make install
2248
```
2349

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):
50+
### Development Run
51+
You can alter the defaults on the command line, all of which are listed below:
52+
```shell
53+
webapp \
54+
-a 127.0.0.1 \
55+
-p 8000 \
56+
-r . \
57+
-srvroot $GOPATH/src/github.com/netsec-ethz/scion-apps/webapp/web \
58+
-sabin $GOPATH/bin \
59+
-sroot $GOPATH/src/github.com/scionproto/scion \
60+
-sbin $GOPATH/src/github.com/scionproto/scion/bin \
61+
-sgen $GOPATH/src/github.com/scionproto/scion/gen \
62+
-sgenc $GOPATH/src/github.com/scionproto/scion/gen-cache \
63+
-slogs $GOPATH/src/github.com/scionproto/scion/logs
64+
```
65+
or can run `webapp` with like this, which will use the defaults above:
66+
```shell
67+
webapp
68+
```
2769

28-
```
29-
config.vm.network "forwarded_port", guest: 8080, host: 8080, protocol: "tcp"
30-
```
3170

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:
71+
## Command-Line Help
3372
```shell
34-
cd webapp
35-
webapp -a 0.0.0.0 -p 8000
73+
Usage of webapp:
74+
-a string
75+
Address of server host. (default "127.0.0.1")
76+
-p int
77+
Port of server host. (default 8000)
78+
-r string
79+
Root path to read/browse from, CAUTION: read-access granted from -a and -p. (default ".")
80+
-sabin string
81+
Path to execute the installed scionlab apps binaries (default "/home/ubuntu/go/bin")
82+
-sbin string
83+
Path to execute SCION bin directory of infrastructure tools (default "/home/ubuntu/go/src/github.com/scionproto/scion/bin")
84+
-sgen string
85+
Path to read SCION gen directory of infrastructure config (default "/home/ubuntu/go/src/github.com/scionproto/scion/gen")
86+
-sgenc string
87+
Path to read SCION gen-cache directory of infrastructure run-time config (default "/home/ubuntu/go/src/github.com/scionproto/scion/gen-cache")
88+
-slogs string
89+
Path to read SCION logs directory of infrastructure logging (default "/home/ubuntu/go/src/github.com/scionproto/scion/logs")
90+
-sroot string
91+
Path to read SCION root directory of infrastructure (default "/home/ubuntu/go/src/github.com/scionproto/scion")
92+
-srvroot string
93+
Path to read/write web server files. (default "/home/ubuntu/go/src/github.com/netsec-ethz/scion-apps/webapp/web")
3694
```
37-
Now, open a web browser at [http://127.0.0.1:8000](http://127.0.0.1:8000), to begin.
3895

3996
## Related Links
4097
* [Webapp SCIONLab AS Visualization Tutorials](https://netsec-ethz.github.io/scion-tutorials/as_visualization/webapp/)

0 commit comments

Comments
 (0)