You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-9
Original file line number
Diff line number
Diff line change
@@ -30,9 +30,9 @@ You can now view the OpenSSL Webterm at https://localhost:4200.
30
30
31
31
## Internal workings
32
32
33
-
The React GUI just builds commands (as strings). These are then called upon the terminal, which is an instance of [wasm-webterm](https://github.com/cryptool-org/wasm-webterm). If your browser supports WebWorkers (including SharedArrayBuffers and Atomics), a new Worker thread is spawned and the WebAssembly binary ([`openssl.wasm`](https://github.com/cryptool-org/openssl-webterm/blob/master/emscr/binary/openssl.wasm)) is ran there. Otherwise, it is executed on the main browser thread using a fallback (which can freeze the tab).
33
+
The React GUI just builds commands (as strings). These are then called upon the terminal, which is an instance of [wasm-webterm](https://github.com/cryptool-org/wasm-webterm). If your browser supports WebWorkers (including SharedArrayBuffers and Atomics), a new Worker thread is spawned and the WebAssembly binary ([`openssl.wasm`](/emscr/binary/openssl.wasm)) is ran there. Otherwise, it is executed on the main browser thread using a fallback (which can freeze the tab).
34
34
35
-
The WebAssembly binary is executed using the (auto generated) Emscripten JS runtime contained in [`openssl.js`](https://github.com/cryptool-org/openssl-webterm/blob/master/emscr/binary/openssl.js). It initializes a virtual memory filesystem and handles input/output calls.
35
+
The WebAssembly binary is executed using the (auto generated) Emscripten JS runtime contained in [`openssl.js`](/emscr/binary/openssl.js). It initializes a virtual memory filesystem and handles input/output calls.
36
36
37
37
If the binary asks for input (reads from `/dev/stdin`), the thread will be paused until the user entered something. If the binary prints to `/dev/stdout` or `/dev/stderr`, it will be shown on the [xterm.js](https://github.com/xtermjs/xterm.js) web terminal.
38
38
@@ -41,31 +41,39 @@ After each command, the files in the memory filesystem are gathered and passed t
41
41
42
42
## Compiling OpenSSL
43
43
44
-
First, [install the Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html). You can then easily recompile the OpenSSL WebAssembly binary by calling the following command. Note that this is not neccessary, as [it's already compiled](https://github.com/cryptool-org/openssl-webterm/blob/master/emscr/binary).
44
+
First, [install the Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html). You can then easily recompile the OpenSSL WebAssembly binary by calling the following command. Note that this is not neccessary, as [it's already compiled](/emscr/binary).
45
45
46
46
```shell
47
47
$ npm run build:openssl
48
48
```
49
49
50
-
This will call the script in [`emscr/builds/openssl/build.sh`](https://github.com/cryptool-org/openssl-webterm/blob/master/emscr/builds/openssl/build.sh). It fetches the OpenSSL sources as a `.tar.gz` archive from https://www.openssl.org/source and extracts it. It then compiles them with Emscripten by calling `emconfigure` and `emmake` (both with specific flags).
50
+
This will call the script in [`emscr/builds/openssl/build.sh`](/emscr/builds/openssl/build.sh). It fetches the OpenSSL sources as a `.tar.gz` archive from https://www.openssl.org/source and extracts it. It then compiles them with Emscripten by calling `emconfigure` and `emmake` (both with specific flags).
51
51
52
52
The created files `openssl.wasm` and `openssl.js` are then copied into `emscr/binary`, where the webpack server will deliver them from.
53
53
54
+
54
55
## Docker Integration
55
56
56
-
The source code contains `Dockerfile` which allows you to create a [`docker`](https://www.docker.com/) image. To create a new one use the following command. Note that built app inside the image will be hosted on the [`nginx`](https://github.com/nginx/nginx) http server.
57
+
The source code contains a [`Dockerfile`](/Dockerfile) which allows you to create ready-to-run [Docker](https://www.docker.com) images. These are comparable to snapshots in virtual machines.
58
+
59
+
First, [install and start Docker](https://docs.docker.com/get-docker). Then create a Docker image:
57
60
58
61
```shell
59
-
$ docker build -t openssl-wt.
62
+
$ docker build -t openssl-webterm.
60
63
```
61
64
62
-
For create a docker container use the:
65
+
> This installs [Alpine Linux](https://www.alpinelinux.org) with Node.js (v16.3) and [nginx](https://github.com/nginx/nginx) into a virtual image, builds the OpenSSL Webterm sources, and copies the built files into nginx's web server directory.
66
+
67
+
You can then instanciate this image into a Docker container:
63
68
64
69
```shell
65
-
$ docker run --rm -it -p 10080:80 -d openssl-wt
70
+
$ docker run --rm -it -p 4300:80 -d openssl-webterm
66
71
```
67
72
68
-
After that you can view the OpenSSL Webterm at http://localhost:10080
73
+
> This runs the nginx web server.
74
+
75
+
You should now be able to view the OpenSSL Webterm at http://localhost:4300
0 commit comments