├── LICENSE.md ├── README.md ├── build ├── .root_fs │ ├── etc │ │ ├── escape-pod.conf │ │ ├── hostname │ │ ├── hosts │ │ ├── mongod.conf │ │ └── mongod.key │ ├── home │ │ └── ubuntu │ │ │ ├── .bashrc │ │ │ ├── .profile │ │ │ └── start_escape-pod.sh │ ├── usr │ │ ├── lib │ │ │ └── systemd │ │ │ │ └── system │ │ │ │ ├── escape_pod.service │ │ │ │ └── mongod.service │ │ └── local │ │ │ ├── aarch64-linux-gnu │ │ │ └── lib │ │ │ │ └── .files.txt │ │ │ ├── bin │ │ │ ├── .files.txt │ │ │ ├── escape-pod.sh │ │ │ └── mongod.sh │ │ │ └── escapepod │ │ │ └── .files.txt │ └── var │ │ ├── lib │ │ └── mongodb │ │ │ └── .files.txt │ │ └── log │ │ └── mongodb │ │ └── .placeholder ├── Dockerfile ├── README.md ├── escapepod-bash.bat ├── escapepod-build.bat ├── escapepod-build.sh ├── escapepod-cmd.bat ├── escapepod-img-mount.sh └── escapepod-remove.bat ├── linux ├── docker-escapepod-bash.sh └── docker-escapepod-run.sh └── windows ├── DOCKER-ESCAPEPOD-BASH.bat ├── DOCKER-ESCAPEPOD-CMD.bat ├── DOCKER-ESCAPEPOD-REMOVE.bat ├── DOCKER-ESCAPEPOD-RUN.bat ├── DOCKER-ESCAPEPOD-START.bat └── README.md /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 cyb3rdog 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VECTOR's ESCAPE-POD [DOCKER IMAGE](https://hub.docker.com/r/cyb3rdog/escapepod) 2 | 3 | Unofficial Docker image wrapping the Escape Pod for Anki/DDL Vector Robot. 4 | Escape Pod allows your favorite robot companion to function independent of DDL cloud servers while also enabling the customization of voice commands and improving response times. 5 | 6 | ## Docker Hub repository: 7 | #### **[https://hub.docker.com/r/cyb3rdog/escapepod](https://hub.docker.com/r/cyb3rdog/escapepod)** 8 | 9 | ## Getting Started 10 | 11 | These instructions will cover usage information of this docker image 12 | 13 | ### Prerequisites 14 | 15 | In order to run this container you'll need to have **docker** installed. 16 | 17 | * [Windows](https://docs.docker.com/windows/started) 18 | * [OS X](https://docs.docker.com/mac/started/) 19 | * [Linux](https://docs.docker.com/linux/started/) 20 | 21 | ## Usage 22 | 23 | The easiest way to run the docker container, is to execute following docker command: 24 | 25 | ```shell 26 | docker run -it --rm --name escapepod -h escapepod -p 80:80 -p 8084:8084 -p 8085:8085 -p 8086:8086 -p 65533:65533 -d cyb3rdog/escapepod:latest 27 | ``` 28 | 29 | This command will download the image and start the container with the Vector's EscapePod forwarded to port 80 of your virtual machine. 30 | Once this command is finished, the EscapePod should be fully online within next 5 seconds. 31 | 32 | 33 | ### EscapePod IP address 34 | 35 | **Depending on the type of your setup, you will most likelly need to configure your docker's virtual machine network adapter mode to 'bridged' so that the virtual machine will in fact get its ip address directly from your router, and all devices on your local network including Vector will be able to connect to it.** 36 | The default setting for docker vm adapters is a subnet with the host the virtual machine runs from, so in that scenario, your other devices in your local area network and your vector will be unable to reach it. 37 | 38 | 1) To check the IP address of your docker virtual machine, you'll need to know the machine name (ie. 'default') 39 | 40 | ```shell 41 | docker-machine active 42 | ``` 43 | 44 | 2) Use the retieved machine_name to query the IP address, by replacing the \ with the actual name in following command: 45 | 46 | ```shell 47 | docker-machine ip 48 | ``` 49 | 50 | 3) After that, most prefferably, let your local pc know about the EscapePod's IP address, by changing the ***hosts*** file: 51 | Open the hosts file in your favorite text editor: 52 | * Windows: *c:\Windows\System32\drivers\etc\hosts* (make sure your file does not have read-only, and system attributes) 53 | * Linux: */etc/hosts* 54 | 55 | Add the following record into the hosts file, where instead of 0.0.0.0 below, enter your EscapePod IP address from step 2. 56 | 57 | ```shell 58 | 0.0.0.0 escapepod.local 59 | ``` 60 | 61 | Save the file. 62 | 63 | 4) Finally, use either this IP address, or directly the 'escapepod.local' address in the url address bar of your web browser: 64 | 65 | ```shell 66 | http://:80/ 67 | or 68 | http://escapepod.local/ 69 | ``` 70 | 71 | ### Container Parameters 72 | 73 | List of the parameters available to the container 74 | 75 | ... nothing here so far ... 76 | 77 | 78 | ### Environment Variables 79 | 80 | * `PORT` - escapepod web ui port exposed from within the container (default 80) 81 | 82 | ## Authors 83 | 84 | * **cyb3rdog** - (https://github.com/cyb3rdog) 85 | 86 | ## License 87 | 88 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details. 89 | 90 | 91 | -------------------------------------------------------------------------------- /build/.root_fs/etc/escape-pod.conf: -------------------------------------------------------------------------------- 1 | DDL_RPC_PORT=8084 2 | DDL_HTTP_PORT=8085 3 | DDL_OTA_PORT=8086 4 | DDL_UI_PORT=80 5 | 6 | DDL_SAYWHATNOW_STT_MODEL=/usr/local/escapepod/model.tflite 7 | DDL_SAYWHATNOW_STT_SCORER=/usr/local/escapepod/model.scorer 8 | 9 | DDL_DB_NAME=database 10 | DDL_DB_HOST=127.0.0.1 11 | DDL_DB_PASSWORD=MzBmMWFmY2NhYzE0 12 | DDL_DB_PORT=27017 13 | DDL_DB_USERNAME=myUserAdmin 14 | -------------------------------------------------------------------------------- /build/.root_fs/etc/hostname: -------------------------------------------------------------------------------- 1 | escapepod 2 | -------------------------------------------------------------------------------- /build/.root_fs/etc/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost 2 | 3 | # The following lines are desirable for IPv6 capable hosts 4 | ::1 ip6-localhost ip6-loopback 5 | fe00::0 ip6-localnet 6 | ff00::0 ip6-mcastprefix 7 | ff02::1 ip6-allnodes 8 | ff02::2 ip6-allrouters 9 | ff02::3 ip6-allhosts 10 | 127.0.0.1 escapepod.local escapepod 11 | ::1 escapepod.local escapepod 12 | -------------------------------------------------------------------------------- /build/.root_fs/etc/mongod.conf: -------------------------------------------------------------------------------- 1 | # mongod.conf 2 | 3 | # for documentation of all options, see: 4 | # http://docs.mongodb.org/manual/reference/configuration-options/ 5 | 6 | # Where and how to store data. 7 | storage: 8 | dbPath: /var/lib/mongodb 9 | journal: 10 | enabled: true 11 | # engine: 12 | # mmapv1: 13 | # wiredTiger: 14 | 15 | # where to write logging data. 16 | systemLog: 17 | destination: file 18 | logAppend: true 19 | path: /var/log/mongodb/mongod.log 20 | 21 | # network interfaces 22 | net: 23 | port: 27017 24 | bindIp: 127.0.0.1 25 | 26 | 27 | # how the process runs 28 | processManagement: 29 | timeZoneInfo: /usr/share/zoneinfo 30 | 31 | #security: 32 | 33 | #operationProfiling: 34 | 35 | #replication: 36 | 37 | #sharding: 38 | 39 | ## Enterprise-Only Options: 40 | 41 | #auditLog: 42 | 43 | #snmp: 44 | replication: 45 | replSetName: rs0 46 | 47 | 48 | security: 49 | authorization: enabled 50 | keyFile: /etc/mongod.key 51 | 52 | -------------------------------------------------------------------------------- /build/.root_fs/etc/mongod.key: -------------------------------------------------------------------------------- 1 | bbDJdhaoSCNcXxxPPAvoYL6xwU8Y92kjH0OvmKNdfTh5vpgz7//HWHNj8tBHzEBy 2 | 5jVCpWRiJf3ZpNWnCJR6Q0EwBFQOnx6fg/rEMNSv7k4a46gFtmK1KlGgkMcq2D6l 3 | Ddo0RqUWOIa5R49wbaqPMAnuLVidv4Ki0Xy0GOy/JNNzWWm5GgEFk8p/JudHhKZg 4 | 3wqeNg8WOO+Do9GT/YY+HJO3SeugcgfMR3gkNh3Aw096CoXLkGOlgsI+KC/SOWLp 5 | BNDmf3v3KGcr6Xm88BOVMTdwgFifP2cxv9+Cb6PIIzyLRYzx8TLNYhXtfE4TcLGK 6 | p5ZpT3kDc3Ed4KJhuEmiKiQqYsOVv7dkOoji/4ExVH4jz6wXOMNT5a5LiTVE03G+ 7 | an8stE23c/b3fMnG1BCtAudQkR03XyS3vVUURU6vBBSsH/vnwo0cMjkhukeAVBos 8 | bzRFRyK0m5rsqpVPBgoyZho5EDYiWGGoJS2gv41ajps8WZyupLnMiUmmH7/etY0l 9 | PRrTSb+j8C64M5Sj93XnY2pFfzjvQ1G/66hNvXs+u8XV8mwRcM5sLGOzuUgYs8cM 10 | XVwzerZqiypmCtF3Ljy4rykrVi9YKwV9rXPVIQSpN0z6mHnKt9IjFg725UMdKidg 11 | qON6IHUzq6s2Q3xjyT60Q599yiQRE2PB/njzmFLVrxU3OB3ggBGslQ2YbDu8q4Em 12 | tMVUXUQ1+uDAIcALxPqgqbdpwNSzy89hVcwZA1pmAWjngYrho/WrKGMo8VpUHYgQ 13 | RwkvZeH5JP23whAN5JrJ/XgKnXRUFrRrGpkhHxVLJAbnuVZY8gd3TZVG2LHiIvbY 14 | XGDfQmDGtJxWQTg1r7E7fuF4ybx3av7+4bil8EWFT1Z05tjpWHO8hq6y 15 | -------------------------------------------------------------------------------- /build/.root_fs/home/ubuntu/.bashrc: -------------------------------------------------------------------------------- 1 | # ~/.bashrc: executed by bash(1) for non-login shells. 2 | # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) 3 | # for examples 4 | 5 | # If not running interactively, don't do anything 6 | case $- in 7 | *i*) ;; 8 | *) return;; 9 | esac 10 | 11 | # don't put duplicate lines or lines starting with space in the history. 12 | # See bash(1) for more options 13 | HISTCONTROL=ignoreboth 14 | 15 | # append to the history file, don't overwrite it 16 | shopt -s histappend 17 | 18 | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) 19 | HISTSIZE=1000 20 | HISTFILESIZE=2000 21 | 22 | # check the window size after each command and, if necessary, 23 | # update the values of LINES and COLUMNS. 24 | shopt -s checkwinsize 25 | 26 | # If set, the pattern "**" used in a pathname expansion context will 27 | # match all files and zero or more directories and subdirectories. 28 | #shopt -s globstar 29 | 30 | # make less more friendly for non-text input files, see lesspipe(1) 31 | [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" 32 | 33 | # set variable identifying the chroot you work in (used in the prompt below) 34 | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then 35 | debian_chroot=$(cat /etc/debian_chroot) 36 | fi 37 | 38 | # set a fancy prompt (non-color, unless we know we "want" color) 39 | case "$TERM" in 40 | xterm-color|*-256color) color_prompt=yes;; 41 | esac 42 | 43 | # uncomment for a colored prompt, if the terminal has the capability; turned 44 | # off by default to not distract the user: the focus in a terminal window 45 | # should be on the output of commands, not on the prompt 46 | #force_color_prompt=yes 47 | 48 | if [ -n "$force_color_prompt" ]; then 49 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then 50 | # We have color support; assume it's compliant with Ecma-48 51 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such 52 | # a case would tend to support setf rather than setaf.) 53 | color_prompt=yes 54 | else 55 | color_prompt= 56 | fi 57 | fi 58 | 59 | if [ "$color_prompt" = yes ]; then 60 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 61 | else 62 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 63 | fi 64 | unset color_prompt force_color_prompt 65 | 66 | # If this is an xterm set the title to user@host:dir 67 | case "$TERM" in 68 | xterm*|rxvt*) 69 | PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" 70 | ;; 71 | *) 72 | ;; 73 | esac 74 | 75 | # enable color support of ls and also add handy aliases 76 | if [ -x /usr/bin/dircolors ]; then 77 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" 78 | alias ls='ls --color=auto' 79 | #alias dir='dir --color=auto' 80 | #alias vdir='vdir --color=auto' 81 | 82 | alias grep='grep --color=auto' 83 | alias fgrep='fgrep --color=auto' 84 | alias egrep='egrep --color=auto' 85 | fi 86 | 87 | # colored GCC warnings and errors 88 | #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' 89 | 90 | # some more ls aliases 91 | alias ll='ls -alF' 92 | alias la='ls -A' 93 | alias l='ls -CF' 94 | 95 | # Add an "alert" alias for long running commands. Use like so: 96 | # sleep 10; alert 97 | alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' 98 | 99 | # Alias definitions. 100 | # You may want to put all your additions into a separate file like 101 | # ~/.bash_aliases, instead of adding them here directly. 102 | # See /usr/share/doc/bash-doc/examples in the bash-doc package. 103 | 104 | if [ -f ~/.bash_aliases ]; then 105 | . ~/.bash_aliases 106 | fi 107 | 108 | # enable programmable completion features (you don't need to enable 109 | # this, if it's already enabled in /etc/bash.bashrc and /etc/profile 110 | # sources /etc/bash.bashrc). 111 | if ! shopt -oq posix; then 112 | if [ -f /usr/share/bash-completion/bash_completion ]; then 113 | . /usr/share/bash-completion/bash_completion 114 | elif [ -f /etc/bash_completion ]; then 115 | . /etc/bash_completion 116 | fi 117 | fi 118 | -------------------------------------------------------------------------------- /build/.root_fs/home/ubuntu/.profile: -------------------------------------------------------------------------------- 1 | # ~/.profile: executed by the command interpreter for login shells. 2 | # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login 3 | # exists. 4 | # see /usr/share/doc/bash/examples/startup-files for examples. 5 | # the files are located in the bash-doc package. 6 | 7 | # the default umask is set in /etc/profile; for setting the umask 8 | # for ssh logins, install and configure the libpam-umask package. 9 | #umask 022 10 | 11 | # if running bash 12 | if [ -n "$BASH_VERSION" ]; then 13 | # include .bashrc if it exists 14 | if [ -f "$HOME/.bashrc" ]; then 15 | . "$HOME/.bashrc" 16 | fi 17 | fi 18 | 19 | # set PATH so it includes user's private bin if it exists 20 | if [ -d "$HOME/bin" ] ; then 21 | PATH="$HOME/bin:$PATH" 22 | fi 23 | 24 | # set PATH so it includes user's private bin if it exists 25 | if [ -d "$HOME/.local/bin" ] ; then 26 | PATH="$HOME/.local/bin:$PATH" 27 | fi 28 | -------------------------------------------------------------------------------- /build/.root_fs/home/ubuntu/start_escape-pod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /usr/local/bin/mongod.sh & 4 | /usr/local/bin/escape-pod.sh & 5 | 6 | /bin/bash -------------------------------------------------------------------------------- /build/.root_fs/usr/lib/systemd/system/escape_pod.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=DDL Escape Pod 3 | After=network.target 4 | 5 | [Service] 6 | Type=simple 7 | User=ubuntu 8 | Group=ubuntu 9 | LimitNOFILE=1024 10 | Restart=on-failure 11 | RestartSec=10 12 | EnvironmentFile=/etc/escape-pod.conf 13 | WorkingDirectory=/home/ubuntu 14 | ExecStart=/usr/local/bin/escape-pod.sh 15 | PermissionsStartOnly=true 16 | StandardOutput=syslog 17 | StandardError=syslog 18 | SyslogIdentifier=escape_pod 19 | CapabilityBoundingSet=CAP_NET_BIND_SERVICE 20 | CapabilityBoundingSet=CAP_NET_RAW 21 | CapabilityBoundingSet=CAP_NET_ADMIN 22 | AmbientCapabilities=CAP_NET_BIND_SERVICE 23 | AmbientCapabilities=CAP_NET_RAW 24 | AmbientCapabilities=CAP_NET_ADMIN 25 | 26 | [Install] 27 | WantedBy=multi-user.target 28 | -------------------------------------------------------------------------------- /build/.root_fs/usr/lib/systemd/system/mongod.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=MongoDB Database Server 3 | Documentation=https://docs.mongodb.org/manual 4 | After=network-online.target 5 | Wants=network-online.target 6 | 7 | [Service] 8 | User=mongodb 9 | Group=mongodb 10 | EnvironmentFile=-/etc/default/mongod 11 | ExecStart=/usr/local/bin/mongod.sh 12 | PIDFile=/var/run/mongodb/mongod.pid 13 | # file size 14 | LimitFSIZE=infinity 15 | # cpu time 16 | LimitCPU=infinity 17 | # virtual memory size 18 | LimitAS=infinity 19 | # open files 20 | LimitNOFILE=64000 21 | # processes/threads 22 | LimitNPROC=64000 23 | # locked memory 24 | LimitMEMLOCK=infinity 25 | # total threads (user+kernel) 26 | TasksMax=infinity 27 | TasksAccounting=false 28 | 29 | # Recommended limits for mongod as specified in 30 | # https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings 31 | 32 | [Install] 33 | WantedBy=multi-user.target 34 | -------------------------------------------------------------------------------- /build/.root_fs/usr/local/aarch64-linux-gnu/lib/.files.txt: -------------------------------------------------------------------------------- 1 | This folder contains library files extracted from the following EscapePod directories: 2 | - /usr/lib/ 3 | - /usr/lib/aarch64-linux-gnu/ -------------------------------------------------------------------------------- /build/.root_fs/usr/local/bin/.files.txt: -------------------------------------------------------------------------------- 1 | This folder contains binary files extracted from the following EscapePod directories: 2 | - /usr/bin 3 | 4 | ... 5 | 6 | mongo 7 | mongod 8 | mongodump 9 | mongoexport 10 | mongofiles 11 | mongoimport 12 | mongorestore 13 | mongos 14 | mongostat 15 | mongotop 16 | -------------------------------------------------------------------------------- /build/.root_fs/usr/local/bin/escape-pod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export $(cat /etc/escape-pod.conf | xargs) 4 | qemu-aarch64 -L /usr/local/aarch64-linux-gnu /usr/local/escapepod/bin/escape-pod -------------------------------------------------------------------------------- /build/.root_fs/usr/local/bin/mongod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | qemu-aarch64 -L /usr/local/aarch64-linux-gnu /usr/local/bin/mongod --config /etc/mongod.conf -------------------------------------------------------------------------------- /build/.root_fs/usr/local/escapepod/.files.txt: -------------------------------------------------------------------------------- 1 | This folder contains escapepod files extracted from the following EscapePod directories: 2 | - /usr/local/escapepod 3 | 4 | ... 5 | 6 | bin/escape-pod 7 | ui/assets/jquery.min.3.3.1.js 8 | ui/assets/pterm.js 9 | ui/assets/sodium.js 10 | ui/logs 11 | ui/ota/OSKR_EP_1.7.3_6016.ota 12 | ui/ota/Prod_EP_1.7.3_6016.ota 13 | ui/747baba41526760b7ce256549c89a25e.png 14 | ui/index.html 15 | ui/styles.css 16 | ui/webpack.js 17 | model.scorer 18 | model.tflite -------------------------------------------------------------------------------- /build/.root_fs/var/lib/mongodb/.files.txt: -------------------------------------------------------------------------------- 1 | This folder contains database files extracted from the following EscapePod directories: 2 | - /var/lib/mongodb/ 3 | 4 | ... 5 | 6 | diagnostic.data/metrics.2021-03-08T17-44-37Z-00000 7 | journal/WiredTigerLog.0000000001 8 | journal/WiredTigerPreplog.0000000001 9 | journal/WiredTigerPreplog.0000000002 10 | _mdb_catalog.wt 11 | collection-0-5619395563596453988.wt 12 | collection-10-5619395563596453988.wt 13 | collection-11-5619395563596453988.wt 14 | collection-13-5619395563596453988.wt 15 | collection-15-5619395563596453988.wt 16 | collection-17-5619395563596453988.wt 17 | collection-19-5619395563596453988.wt 18 | collection-21-5619395563596453988.wt 19 | collection-23-5619395563596453988.wt 20 | collection-2-5619395563596453988.wt 21 | collection-26-5619395563596453988.wt 22 | collection-28-5619395563596453988.wt 23 | collection-4-5619395563596453988.wt 24 | collection-6-5619395563596453988.wt 25 | collection-8-5619395563596453988.wt 26 | index-12-5619395563596453988.wt 27 | index-14-5619395563596453988.wt 28 | index-1-5619395563596453988.wt 29 | index-16-5619395563596453988.wt 30 | index-18-5619395563596453988.wt 31 | index-20-5619395563596453988.wt 32 | index-22-5619395563596453988.wt 33 | index-24-5619395563596453988.wt 34 | index-25-5619395563596453988.wt 35 | index-27-5619395563596453988.wt 36 | index-29-5619395563596453988.wt 37 | index-30-5619395563596453988.wt 38 | index-3-5619395563596453988.wt 39 | index-5-5619395563596453988.wt 40 | index-7-5619395563596453988.wt 41 | index-9-5619395563596453988.wt 42 | sizeStorer.wt 43 | storage.bson 44 | WiredTiger 45 | WiredTiger.turtle 46 | WiredTiger.wt 47 | WiredTigerHS.wt 48 | -------------------------------------------------------------------------------- /build/.root_fs/var/log/mongodb/.placeholder: -------------------------------------------------------------------------------- 1 | this dummy file is here, so that it is not forgotten that this directory has to be created during the image build -------------------------------------------------------------------------------- /build/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | ENV DEBIAN_FRONTEND=noninteractive 4 | 5 | RUN apt-get clean -y 6 | RUN apt-get update -y 7 | RUN apt-get install -y qemu-user qemu-user-static gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu binutils-aarch64-linux-gnu-dbg build-essential 8 | 9 | COPY .root_fs/ . 10 | RUN chmod 600 /etc/mongod.key 11 | 12 | EXPOSE 27017 13 | EXPOSE 80 14 | EXPOSE 8084 15 | EXPOSE 8085 16 | EXPOSE 8086 17 | EXPOSE 65533 18 | 19 | WORKDIR /home/ubuntu 20 | CMD /home/ubuntu/start_escape-pod.sh 21 | -------------------------------------------------------------------------------- /build/README.md: -------------------------------------------------------------------------------- 1 | # ESCAPE POD DOCKER IMAGE BUILD SCRIPT 2 | 3 | ## Prerequisites 4 | 5 | ### **Before building the EscapePod Docker image, all Escape-Pod related files necessary for this build must be copied into the ```.root_fs/``` sub-directory.** 6 | 7 | These files can be obtained and extracted manually either from the official escape pod rpi image, or from your raspberry pi, in case you have it deployed already. 8 | The script ```escapepod-img-mount.sh``` can automatically download and mount the original image to your linux file system, so you should be able to extract all the necessary distribution files. 9 | 10 | ## FileSystem 11 | 12 | There are following 4 directories of the concern, that has to contain the files from the original escapepod image, or your RPI: 13 | Each of those directories contain the ```.files``` file with a short description of what files should be copied into that specific directory 14 | 15 | ### *.root_fs/usr/local/escapepod* 16 | 17 | Whole directory with the all the escapepod binaries, Web UI, and distributed OTA image files 18 | ``` 19 | /usr/local/escapepod -> .root_fs/usr/local/escapepod 20 | ``` 21 | 22 | ### *.root_fs/usr/local/bin* 23 | 24 | Selected MongoDB binaries 25 | ``` 26 | /usr/bin -> .root_fs/usr/local/bin 27 | ``` 28 | 29 | ### *.root_fs/usr/local/aarch64-linux-gnu/lib* 30 | 31 | Aarch64 libraries used to run the escapepod and mongo db binaries 32 | (Hey DDL, we're still waiting for the arm64 escapepod binary build, so we can get rid of all this) 33 | ``` 34 | - /usr/lib -> .root_fs/usr/local/aarch64-linux-gnu/lib 35 | - /usr/lib/aarch64-linux-gnu/ -> .root_fs/usr/local/aarch64-linux-gnu/lib 36 | ``` 37 | 38 | ### *.root_fs/var/lib/mongodb* 39 | 40 | Mongo DB database containing the intents, configuration, licence keys, etc.. 41 | ``` 42 | /var/lib/mongodb -> .root_fs/var/lib/mongodb 43 | ``` 44 | 45 | - In case your will be copying these files from the distribution image, you will create a docker image with 'blank' distribution database, 46 | - For the scenario, where you will extract your files from your already deployed and configured raspberry pi, the result Docker image will be actually clon of your rpi, and will be already set up, with all your custom intents, your licence keys etc. 47 | 48 | ## Building the Docker Image 49 | 50 | Once all the required escape pod files have been copied into the ```.root_fs``` directory, the image can be built with following scripts: 51 | 52 | - For Windows - use the ```escapepod-build.bat``` file 53 | - For Linux - use the ```escapepod-build.sh``` file 54 | 55 | Both scripts will eventually call the *docker build* command which composes the image from the ```Dockerfile``` 56 | ``` 57 | docker build -t escapepod . 58 | ``` 59 | 60 | Once the image is built, the script will create a new contrainer and start it up: 61 | ``` 62 | docker run -it --rm --name escapepod -h escapepod -p 80:80 -p 8084:8084 -p 8085:8085 -p 8086:8086 -p 65533:65533 -d escapepod 63 | ``` 64 | 65 | Your dockerized EscapePod will run from the container, so you can access it using the docker virtual machine's ip address, and you can 'ssh' in using following command: 66 | ``` 67 | docker exec -it -u root escapepod /bin/bash 68 | ``` 69 | 70 | ### Enjoy! 71 | -------------------------------------------------------------------------------- /build/escapepod-bash.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | SET MACHINE=escapepod-build 4 | SET SW_NAME=escapepod 5 | 6 | REM ------ VARIABLES ------ 7 | :Variables 8 | ECHO Setting Enviroment Variables for User '%USERNAME%'... 9 | 10 | SETLOCAL ENABLEDELAYEDEXPANSION 11 | FOR /f "tokens=*" %%i IN ('docker-machine env %MACHINE%') DO %%i 12 | 13 | REM ------ SHELL ------ 14 | ECHO. 15 | ECHO Logging into the machine '%MACHINE%'... 16 | ECHO Type 'docker exec -it -u root %SW_NAME% /bin/bash' to shell container 17 | ECHO Type 'exit' to quit the shell. 18 | ECHO. 19 | 20 | ansicon -p 21 | docker-machine ssh %MACHINE% 22 | REM docker exec -it -u root %SW_NAME% /bin/bash -------------------------------------------------------------------------------- /build/escapepod-build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM ------------------------------------------------------------------------------- 3 | REM --- The minimal pre-requisities to use this Script "as is" are: --- 4 | REM --- * DockerToolbox --- 5 | REM --- * Oracle VirtualBox --- 6 | REM ------------------------------------------------------------------------------- 7 | REM --- This Script does everything automaticaly, including creation of the --- 8 | REM --- Virtual Machine, if that does not exist, creating and setting up the --- 9 | REM --- Docker Container, enabling it for remote connections on specified port --- 10 | ECHO ------------------------------------------------------------------------------- 11 | ECHO --- Script Optional Parameters: --- 12 | ECHO --- %%1 - Docker Virtual Machine Name --- 13 | ECHO --- %%2 - Docker Container Name --- 14 | ECHO --- %%3 - Host Name --- 15 | ECHO --- %%4 - Port --- 16 | ECHO ------------------------------------------------------------------------------- 17 | 18 | 19 | SET VM_MEMORY=4086 20 | SET VM_DISK_SIZE=15000 21 | SET VM_DRIVER=virtualbox 22 | SET VM_NIC_MODE=deny 23 | 24 | SET MACHINE=escapepod-build 25 | SET HOST_NAME=escapepod 26 | 27 | SET SW_PORT=80 28 | SET SW_NAME=escapepod 29 | SET SW_IMAGE=escapepod:latest 30 | 31 | SET HOSTS_FILE=%WINDIR%\system32\drivers\etc\hosts 32 | 33 | IF NOT "%1"=="" SET MACHINE=%1 34 | IF NOT "%2"=="" SET SW_NAME=%2 35 | IF NOT "%3"=="" SET HOST_NAME=%3 36 | IF NOT "%4"=="" SET SW_PORT=%4 37 | 38 | 39 | REM ------ Machine ------ 40 | :Machine 41 | ECHO. 42 | ECHO Searching for Docker Virtual Machine '%MACHINE%'... 43 | FOR /F "USEBACKQ tokens=1" %%i IN (`docker-machine ls`) DO ( 44 | IF %%i==%MACHINE% SET DOCKER_MACHINE_NAME=%%i 45 | ) 46 | IF "%DOCKER_MACHINE_NAME%"=="%MACHINE%" GOTO Boot 47 | 48 | ECHO Docker Virtual Machine '%MACHINE%' not Found! 49 | ECHO Creating New Virtual Machine '%MACHINE%'... 50 | ECHO. 51 | 52 | docker-machine create --driver %VM_DRIVER% --virtualbox-memory %VM_MEMORY% --virtualbox-disk-size %VM_DISK_SIZE% --virtualbox-host-dns-resolver --virtualbox-hostonly-nicpromisc %VM_NIC_MODE% %MACHINE% 53 | REM docker network create --driver=bridge --subnet=192.168.0.0/24 --gateway=192.168.0.1 network 54 | GOTO Variables 55 | 56 | 57 | REM ------ BOOT ------ 58 | :Boot 59 | ECHO Done. 60 | ECHO. 61 | ECHO Checking State of Docker Virtual Machine '%MACHINE%'... 62 | SETLOCAL ENABLEDELAYEDEXPANSION 63 | FOR /F "tokens=* USEBACKQ" %%F IN (`docker-machine status %MACHINE%`) DO ( 64 | SET DOCKER_MACHINE_STATUS=%%F 65 | ) 66 | IF "%DOCKER_MACHINE_STATUS%"=="Running" GOTO Variables 67 | 68 | ECHO Done. 69 | ECHO. 70 | ECHO Booting Up Docker Virtual Machine '%MACHINE%'... 71 | REM "c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" sharedfolder add %MACHINE% --name "%SHARE_NAME%" --hostpath %cd%\%SHARE_SUB_DIR% 72 | docker-machine start %MACHINE% 73 | 74 | 75 | REM ------ VARIABLES ------ 76 | :Variables 77 | ECHO Done. 78 | ECHO. 79 | ECHO Setting Enviroment Variables for User '%USERNAME%'... 80 | 81 | SETLOCAL ENABLEDELAYEDEXPANSION 82 | FOR /f "tokens=*" %%i IN ('docker-machine env %MACHINE%') DO %%i 83 | FOR /f "tokens=*" %%i IN ('docker-machine env %MACHINE%') DO ECHO %%i 84 | FOR /F "USEBACKQ tokens=1" %%i IN (`docker-machine ip %MACHINE%`) DO SET HOST_IP=%%i 85 | FOR /F "USEBACKQ tokens=1" %%i IN (`docker-machine active`) DO SET MACHINE_ACTIVE=%%i 86 | 87 | ECHO. 88 | ECHO - Active Machine: '%MACHINE_ACTIVE%' 89 | ECHO - Active IP: '%HOST_IP%' 90 | 91 | 92 | REM ------ REGENERATE ------ 93 | GOTO Remove 94 | ECHO Done. 95 | ECHO. 96 | ECHO Regenerating '%MACHINE%'... 97 | CHOICE /M "- Regenerate certificates? :" 98 | IF ERRORLEVEL 2 GOTO Remove 99 | docker-machine regenerate-certs %MACHINE% --force 100 | 101 | 102 | REM ------ REMOVE ------ 103 | :Remove 104 | ECHO Done. 105 | ECHO. 106 | ECHO Checking Existing Docker Containers... 107 | SETLOCAL ENABLEDELAYEDEXPANSION 108 | FOR /F "tokens=* USEBACKQ" %%F IN (`docker ps -a -q -f name^="%SW_NAME%"`) DO SET DOCKER_SW_CID=%%F 109 | 110 | IF "%DOCKER_SW_CID%"=="" GOTO Build 111 | docker stop %DOCKER_SW_CID% 112 | docker rm -f %DOCKER_SW_CID% 113 | 114 | 115 | REM ------ BUILD ------ 116 | :Build 117 | ECHO Done. 118 | ECHO. 119 | ECHO Building new image '%SW_IMAGE%'... 120 | 121 | docker build -t %SW_IMAGE% . 122 | 123 | REM ------ LAUNCH ------ 124 | :Run 125 | ECHO Done. 126 | ECHO. 127 | ECHO Creating the container '%SW_NAME%'... 128 | 129 | docker run -it --rm --name %SW_NAME% -h %HOST_NAME% -p 80:%SW_PORT% -p 8084:8084 -p 8085:8085 -p 8086:8086 -p 65533:65533 -d %SW_IMAGE% 130 | 131 | REM ------ START ------ 132 | :Start 133 | ECHO Done. 134 | ECHO. 135 | ECHO Starting Containers... 136 | docker start %SW_NAME% 137 | 138 | 139 | REM ------ FINISH ------ 140 | :Finish 141 | ECHO Done. 142 | ECHO. 143 | ECHO Server Info : 144 | ECHO Server = %HOST_IP% 145 | ECHO Web = http://%HOST_IP%:80/ 146 | ECHO. 147 | 148 | start "" http://%HOST_IP%:80/ 149 | 150 | CHOICE /M "Do you want to ssh to '%MACHINE%': " 151 | IF ERRORLEVEL 2 GOTO Exit 152 | 153 | 154 | REM ------ SHELL ------ 155 | ECHO. 156 | ECHO Logging into the machine '%MACHINE%'... 157 | ECHO Type 'docker exec -it -u root %SW_NAME% /bin/bash' to shell into container 158 | ECHO Type 'exit' to quit. 159 | ECHO. 160 | 161 | ansicon -p 162 | REM docker exec -it -u root %SW_NAME% /bin/bash 163 | docker-machine ssh %MACHINE% 164 | 165 | 166 | REM ------ EXIT ------ 167 | :Exit 168 | ECHO. 169 | ECHO Finished. Press any key to quit. 170 | pause > nul 171 | -------------------------------------------------------------------------------- /build/escapepod-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VAR_HOSTNAME="escapepod" 4 | VAR_SW_NAME="escapepod" 5 | VAR_IMAGE="escapepod:latest" 6 | 7 | # ------ BUILD ------ 8 | echo "Building new image '$VAR_IMAGE'..." 9 | 10 | docker build -t $VAR_IMAGE . 11 | 12 | # ------ LAUNCH ------ 13 | echo "Done." 14 | echo "" 15 | echo "Creating the container '$VAR_SW_NAME'..." 16 | 17 | docker run -it --rm --name $VAR_SW_NAME -h $VAR_HOSTNAME -p 80:80 -p 8084:8084 -p 8085:8085 -p 8086:8086 -p 65533:65533 -d $VAR_IMAGE 18 | -------------------------------------------------------------------------------- /build/escapepod-cmd.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | SET MACHINE=escapepod-build 4 | 5 | REM ------ VARIABLES ------ 6 | :Variables 7 | ECHO Setting Enviroment Variables for User '%USERNAME%'... 8 | 9 | SETLOCAL ENABLEDELAYEDEXPANSION 10 | FOR /f "tokens=*" %%i IN ('docker-machine env %MACHINE%') DO %%i 11 | 12 | REM ------ SHELL ------ 13 | cmd -------------------------------------------------------------------------------- /build/escapepod-img-mount.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Place this script to same location as your 'escape-pod-6ab70e5-R1.img.xz' file 4 | # In case the image file will not be found in the same directory as this script, 5 | # this script will download and extract the image by itself before mounting it. 6 | # Once done, you can access your EscapePod filesystem in VAR_MOUNT (/mnt/escape-pod), 7 | # you can symlink the targets, or copy the required files wherever you want to. 8 | # You'll be most probably interrested in /mnt/escape-pod/usr/local/escapepod/ 9 | # Enjoy. 10 | 11 | VAR_IMAGE_URL="https://assets.digitaldreamlabs.com/PEavApG5dgnZA5ei/Escape-Pod-Release-1.0.0/escape-pod-6ab70e5-R1.img.xz" 12 | VAR_IMAGE_XZ="escape-pod-6ab70e5-R1.img.xz" 13 | VAR_MOUNT="/mnt/escape-pod" 14 | VAR_LOOP="" 15 | 16 | echo "--- Escape Pod Image Mount Script --- " 17 | 18 | if [ ! -f $VAR_IMAGE_XZ ] 19 | then 20 | echo "Downloading '$VAR_IMAGE_URL'..." 21 | wget $VAR_IMAGE_URL 22 | fi 23 | 24 | VAR_IMAGE=${VAR_IMAGE_XZ/.xz/} 25 | if [ ! -f $VAR_IMAGE ] 26 | then 27 | echo "Extracting '$VAR_IMAGE_XZ' to '$VAR_IMAGE'..." 28 | unxz -v $VAR_IMAGE_XZ 29 | fi 30 | 31 | echo "Image path: '$VAR_IMAGE'" 32 | echo "Mount point: '$VAR_MOUNT'" 33 | 34 | test -f $VAR_IMAGE && echo "OK. Image file ready." || echo "FAILED. Image file not found!" 35 | test -f $VAR_IMAGE || exit 36 | 37 | echo "" 38 | echo "Mounting '$VAR_IMAGE' to '$VAR_MOUNT'..." 39 | 40 | sudo mkdir -p $VAR_MOUNT 41 | 42 | sudo modprobe loop 43 | VAR_LOOP=$(sudo losetup -f) 44 | 45 | echo "Setting up Loop Device '$VAR_LOOP'..." 46 | sudo losetup -P $VAR_LOOP ./$VAR_IMAGE 47 | 48 | echo "Probing '$VAR_LOOP' for partitions..." 49 | sudo partprobe $VAR_LOOP 50 | 51 | echo "Mounting '${VAR_LOOP}p2' to '$VAR_MOUNT'..." 52 | sudo mount "${VAR_LOOP}p2" "$VAR_MOUNT" 53 | 54 | echo "Done." 55 | echo "" 56 | 57 | echo "- To unmount, call this command:" 58 | echo "sudo umount $VAR_MOUNT" 59 | echo "- To delete the loop device, call this one:" 60 | echo "sudo losetup -d ${VAR_LOOP}" 61 | -------------------------------------------------------------------------------- /build/escapepod-remove.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | SET MACHINE=escapepod-build 4 | IF NOT "%1"=="" SET MACHINE=%1 5 | 6 | docker-machine rm %MACHINE% 7 | 8 | :Exit 9 | ECHO Done. Press any key. 10 | pause > nul 11 | -------------------------------------------------------------------------------- /linux/docker-escapepod-bash.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VAR_MACHINE="escapepod" 4 | VAR_SW_NAME="escapepod" 5 | 6 | # ------ SHELL ------ 7 | echo "Logging into the machine '$VAR_MACHINE'..." 8 | echo "Type 'docker exec -it -u root $VAR_SW_NAME /bin/bash' to shell container" 9 | echo "Type 'exit' to quit the shell." 10 | echo "" 11 | 12 | docker-machine ssh $VAR_MACHINE 13 | # docker exec -it -u root $VAR_SW_NAME /bin/bash -------------------------------------------------------------------------------- /linux/docker-escapepod-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VAR_HOSTNAME="escapepod" 4 | VAR_SW_NAME="escapepod" 5 | VAR_IMAGE="cyb3rdog/escapepod:latest" 6 | 7 | docker run -it --rm --name $VAR_SW_NAME -h $VAR_HOSTNAME -p 80:80 -p 8084:8084 -p 8085:8085 -p 8086:8086 -p 65533:65533 -d $VAR_IMAGE -------------------------------------------------------------------------------- /windows/DOCKER-ESCAPEPOD-BASH.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | SET MACHINE=ESCAPEPOD 4 | SET SW_NAME=escapepod 5 | 6 | REM ------ VARIABLES ------ 7 | :Variables 8 | ECHO Setting Enviroment Variables for User '%USERNAME%'... 9 | 10 | SETLOCAL ENABLEDELAYEDEXPANSION 11 | FOR /f "tokens=*" %%i IN ('docker-machine env %MACHINE%') DO %%i 12 | 13 | REM ------ SHELL ------ 14 | ECHO. 15 | ECHO Logging into the machine '%MACHINE%'... 16 | ECHO Type 'docker exec -it -u root %SW_NAME% /bin/bash' to shell container 17 | ECHO Type 'exit' to quit the shell. 18 | ECHO. 19 | 20 | docker-machine ssh %MACHINE% 21 | REM docker exec -it -u root %SW_NAME% /bin/bash -------------------------------------------------------------------------------- /windows/DOCKER-ESCAPEPOD-CMD.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | SET MACHINE=ESCAPEPOD 4 | 5 | REM ------ VARIABLES ------ 6 | :Variables 7 | ECHO Setting Enviroment Variables for User '%USERNAME%'... 8 | 9 | SETLOCAL ENABLEDELAYEDEXPANSION 10 | FOR /f "tokens=*" %%i IN ('docker-machine env %MACHINE%') DO %%i 11 | 12 | REM ------ SHELL ------ 13 | cmd -------------------------------------------------------------------------------- /windows/DOCKER-ESCAPEPOD-REMOVE.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | SET MACHINE=ESCAPEPOD 4 | IF NOT "%1"=="" SET MACHINE=%1 5 | 6 | docker-machine rm %MACHINE% 7 | 8 | :Exit 9 | ECHO Done. Press any key. 10 | pause > nul 11 | -------------------------------------------------------------------------------- /windows/DOCKER-ESCAPEPOD-RUN.bat: -------------------------------------------------------------------------------- 1 | 2 | SET MACHINE=ESCAPEPOD 3 | SET HOST_NAME=escapepod 4 | 5 | SET SW_PORT=80 6 | SET SW_NAME=escapepod 7 | SET SW_IMAGE=cyb3rdog/escapepod:latest 8 | 9 | 10 | REM ------ VARIABLES ------ 11 | :Variables 12 | ECHO Setting Enviroment Variables for User '%USERNAME%'... 13 | 14 | SETLOCAL ENABLEDELAYEDEXPANSION 15 | FOR /f "tokens=*" %%i IN ('docker-machine env %MACHINE%') DO %%i 16 | 17 | 18 | REM ------ LAUNCH ------ 19 | docker run -it --rm --name %SW_NAME% -h "%HOST_NAME%" -p 80:%SW_PORT% -p 8084:8084 -p 8085:8085 -p 8086:8086 -p 65533:65533 -d %SW_IMAGE% 20 | -------------------------------------------------------------------------------- /windows/DOCKER-ESCAPEPOD-START.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM ------------------------------------------------------------------------------- 3 | REM --- The minimal pre-requisities to use this Script "as is" are: --- 4 | REM --- * DockerToolbox --- 5 | REM --- * Oracle VirtualBox --- 6 | REM ------------------------------------------------------------------------------- 7 | REM --- This Script does everything automaticaly, including creation of the --- 8 | REM --- Virtual Machine, if that does not exist, creating and setting up the --- 9 | REM --- Docker Container, enabling it for remote connections on specified port --- 10 | ECHO ------------------------------------------------------------------------------- 11 | ECHO --- Script Optional Parameters: --- 12 | ECHO --- %%1 - Docker Virtual Machine Name --- 13 | ECHO --- %%2 - Docker Container Name --- 14 | ECHO --- %%3 - Host Name --- 15 | ECHO --- %%4 - Port --- 16 | ECHO ------------------------------------------------------------------------------- 17 | 18 | 19 | SET VM_MEMORY=4086 20 | SET VM_DISK_SIZE=15000 21 | SET VM_DRIVER=virtualbox 22 | SET VM_NIC_MODE=deny 23 | 24 | SET MACHINE=ESCAPEPOD 25 | SET HOST_NAME=escapepod 26 | 27 | SET SW_PORT=80 28 | SET SW_NAME=escapepod 29 | SET SW_IMAGE=cyb3rdog/escapepod:latest 30 | 31 | SET HOSTS_FILE=%WINDIR%\system32\drivers\etc\hosts 32 | 33 | IF NOT "%1"=="" SET MACHINE=%1 34 | IF NOT "%2"=="" SET SW_NAME=%2 35 | IF NOT "%3"=="" SET HOST_NAME=%3 36 | IF NOT "%4"=="" SET SW_PORT=%4 37 | 38 | 39 | REM ------ Machine ------ 40 | :Machine 41 | ECHO. 42 | ECHO Searching for Docker Virtual Machine '%MACHINE%'... 43 | FOR /F "USEBACKQ tokens=1" %%i IN (`docker-machine ls`) DO ( 44 | IF %%i==%MACHINE% SET DOCKER_MACHINE_NAME=%%i 45 | ) 46 | IF "%DOCKER_MACHINE_NAME%"=="%MACHINE%" GOTO Boot 47 | 48 | ECHO Docker Virtual Machine '%MACHINE%' not Found! 49 | ECHO Creating New Virtual Machine '%MACHINE%'... 50 | ECHO. 51 | 52 | docker-machine create --driver %VM_DRIVER% --virtualbox-memory %VM_MEMORY% --virtualbox-disk-size %VM_DISK_SIZE% --virtualbox-host-dns-resolver --virtualbox-hostonly-nicpromisc %VM_NIC_MODE% %MACHINE% 53 | REM docker network create --driver=bridge --subnet=192.168.0.0/24 --gateway=192.168.0.1 network 54 | GOTO Variables 55 | 56 | 57 | REM ------ BOOT ------ 58 | :Boot 59 | ECHO Done. 60 | ECHO. 61 | ECHO Checking State of Docker Virtual Machine '%MACHINE%'... 62 | SETLOCAL ENABLEDELAYEDEXPANSION 63 | FOR /F "tokens=* USEBACKQ" %%F IN (`docker-machine status %MACHINE%`) DO ( 64 | SET DOCKER_MACHINE_STATUS=%%F 65 | ) 66 | IF "%DOCKER_MACHINE_STATUS%"=="Running" GOTO Variables 67 | 68 | ECHO Done. 69 | ECHO. 70 | ECHO Booting Up Docker Virtual Machine '%MACHINE%'... 71 | REM "c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" sharedfolder add %MACHINE% --name "%SHARE_NAME%" --hostpath %cd%\%SHARE_SUB_DIR% 72 | docker-machine start %MACHINE% 73 | 74 | 75 | REM ------ VARIABLES ------ 76 | :Variables 77 | ECHO Done. 78 | ECHO. 79 | ECHO Setting Enviroment Variables for User '%USERNAME%'... 80 | 81 | SETLOCAL ENABLEDELAYEDEXPANSION 82 | FOR /f "tokens=*" %%i IN ('docker-machine env %MACHINE%') DO %%i 83 | FOR /f "tokens=*" %%i IN ('docker-machine env %MACHINE%') DO ECHO %%i 84 | FOR /F "USEBACKQ tokens=1" %%i IN (`docker-machine ip %MACHINE%`) DO SET HOST_IP=%%i 85 | FOR /F "USEBACKQ tokens=1" %%i IN (`docker-machine active`) DO SET MACHINE_ACTIVE=%%i 86 | 87 | ECHO. 88 | ECHO - Active Machine: '%MACHINE_ACTIVE%' 89 | ECHO - Active IP: '%HOST_IP%' 90 | 91 | 92 | REM ------ REGENERATE ------ 93 | GOTO Remove 94 | ECHO Done. 95 | ECHO. 96 | ECHO Regenerating '%MACHINE%'... 97 | CHOICE /M "- Regenerate certificates? :" 98 | IF ERRORLEVEL 2 GOTO Remove 99 | docker-machine regenerate-certs %MACHINE% --force 100 | 101 | 102 | REM ------ REMOVE ------ 103 | :Remove 104 | ECHO Done. 105 | ECHO. 106 | ECHO Checking Existing Docker Containers... 107 | SETLOCAL ENABLEDELAYEDEXPANSION 108 | FOR /F "tokens=* USEBACKQ" %%F IN (`docker ps -a -q -f name^="%SW_NAME%"`) DO SET DOCKER_SW_CID=%%F 109 | 110 | IF "%DOCKER_SW_CID%"=="" GOTO Build 111 | docker stop %DOCKER_SW_CID% 112 | docker rm -f %DOCKER_SW_CID% 113 | 114 | 115 | REM ------ BUILD ------ 116 | :Build 117 | ECHO Done. 118 | ECHO. 119 | ECHO Creating container '%SW_NAME%' from '%SW_IMAGE%'... 120 | 121 | docker run -it --rm --name %SW_NAME% -h "%HOST_NAME%" -p 80:%SW_PORT% -p 8084:8084 -p 8085:8085 -p 8086:8086 -p 65533:65533 -d %SW_IMAGE% 122 | 123 | REM ------ START ------ 124 | :Start 125 | ECHO Done. 126 | ECHO. 127 | ECHO Starting Containers... 128 | docker start %SW_NAME% 129 | 130 | 131 | REM ------ FINISH ------ 132 | :Finish 133 | ECHO Done. 134 | ECHO. 135 | ECHO Server Info : 136 | ECHO Server = %HOST_IP% 137 | ECHO Web = http://%HOST_IP%:80/ 138 | ECHO. 139 | 140 | start "" http://%HOST_IP%:80/ 141 | 142 | CHOICE /M "Do you want to ssh into '%MACHINE%': " 143 | IF ERRORLEVEL 2 GOTO Exit 144 | 145 | 146 | REM ------ SHELL ------ 147 | ECHO. 148 | ECHO Logging into the machine '%MACHINE%'... 149 | ECHO Type 'docker exec -it -u root %SW_NAME% /bin/bash' to shell into container 150 | ECHO Type 'exit' to quit. 151 | ECHO. 152 | REM docker exec -it -u root %SW_NAME% /bin/bash 153 | docker-machine ssh %MACHINE% 154 | 155 | 156 | REM ------ EXIT ------ 157 | :Exit 158 | ECHO. 159 | ECHO Finished. Press any key to quit. 160 | pause > nul 161 | -------------------------------------------------------------------------------- /windows/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Windows Scripts for EscapePod Docker Image 3 | 4 | This folder contain various Windows batch scripts to help you use the EscapePod Docker Image in your Windows environment. 5 | 6 | ## DOCKER-ESCAPEPOD-START.bat 7 | 8 | This is a fully automated script which creates a dedicated Docker Virtual machine named 'ESCAPEPOD', pull the image, and run the container. 9 | The advantage od this approach is that the EscapePod container is not contained in your 'default' Docker's machine, where you already 10 | may have another containers using the required ports, but is contained in its own virtual machine. 11 | 12 | This script will: 13 | - create a new 'ESCAPEPOD' virtual machine if it does not exist 14 | - start the 'ESCAPEPOD' virtual machine if it is not running already 15 | - set the machine related enviroment variables 16 | - create a 'escapepod' container with all necessary ports exposed 17 | - opens a browser with the virtual machine ip address in url 18 | - prompt you if you want to ssh into the docker virtual machine 19 | 20 | ## DOCKER-ESCAPEPOD-REMOVE.bat 21 | 22 | This script deletes the 'ESCAPEPOD' virtual machine, and its virtual disks, so you can start over. 23 | 24 | ## DOCKER-ESCAPEPOD-BASH.bat 25 | 26 | This script SSH you into the 'ESCAPEPOD' virtual machine. 27 | To SSH further into the container itself, call this command: 28 | 29 | ``` 30 | docker exec -it -u root escapepod /bin/bash 31 | ``` 32 | 33 | In case you will need to copy some data to the container use the ```docker cp``` command: 34 | ``` 35 | docker cp your_dir_or_file escapepod:/home/ubuntu/. 36 | ``` 37 | This example copies a file named *your_dir_or_file* into the */home/ubuntu/* folder in the container. 38 | 39 | ## DOCKER-ESCAPEPOD-CMD.bat 40 | 41 | This scripts set's up your enviroment to use the docker related commands for the 'ESCAPEPOD' machine. 42 | 43 | 44 | ### Enjoy! 45 | 46 | --------------------------------------------------------------------------------