diff --git a/README.md b/README.md index 7f4bba3..5230a60 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,16 @@ # anyk-docker -Docker files for ÁNYK + +Docker files for [ÁNYK](https://www.nav.gov.hu/nav/letoltesek/nyomtatvanykitolto_programok/nyomtatvany_apeh/keretprogramok/abevjava_install.html). + +Built on . + +## How to use + +1. Start one of the docker images with `docker-compose up`. +2. Connect with a remote desktop app to `localhost:3990` (the port may be changed in the docker-compose.yml) +3. User/password: `root`/`root` + +## Docker images + +- ÁNYK only: +- ÁNYK and 19KATA (KATA for 2019): diff --git a/anyk-19kata/Dockerfile b/anyk-19kata/Dockerfile new file mode 100644 index 0000000..6a59bbc --- /dev/null +++ b/anyk-19kata/Dockerfile @@ -0,0 +1,8 @@ +FROM reisingeradam/anyk:2.94.0 +LABEL maintainer="Adam Reisinger" + +# Download and install 19KATA plugin for ANYK +RUN wget https://www.nav.gov.hu/data/cms489660/NAV_19KATA.jar -P ~ \ + # -s: silent (non-gui) install + && java -jar ~/NAV_19KATA.jar -s \ + && rm ~/NAV_19KATA.jar diff --git a/anyk-19kata/docker-compose.yml b/anyk-19kata/docker-compose.yml new file mode 100644 index 0000000..47d1347 --- /dev/null +++ b/anyk-19kata/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3" + +services: + anyk: + build: . + image: ${DOCKER_REGISTRY:-reisingeradam}/anyk:2.94.0-19kata + ports: + - "3390:3389" + # - "2222:22" + shm_size: 1g diff --git a/anyk/Dockerfile b/anyk/Dockerfile new file mode 100644 index 0000000..697075d --- /dev/null +++ b/anyk/Dockerfile @@ -0,0 +1,21 @@ +FROM danielguerra/ubuntu-xrdp:18.04 +LABEL maintainer="Adam Reisinger" + +# Install Java 8 +RUN apt-get update && apt-get install -y \ + crudini \ + openjdk-8-jre \ + && rm -rf /var/lib/apt/lists/* + +# Overwrite entrypoint bash file: removed the user creation script there +COPY ./shared/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh + +RUN echo "root:root" | chpasswd \ + # Create 'Desktop' folder so the ANYK installer can create a shortcut there + && mkdir ~/Desktop \ + # Download and install ANYK + && wget https://www.nav.gov.hu/data/cms36637/abevjava_install.jar -P ~ \ + # -s: silent (non-gui) install + # -u: create user settings + && java -jar ~/abevjava_install.jar -s -u \ + && rm ~/abevjava_install.jar diff --git a/anyk/docker-compose.yml b/anyk/docker-compose.yml new file mode 100644 index 0000000..91ef286 --- /dev/null +++ b/anyk/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3" + +services: + anyk: + build: + context: .. + dockerfile: anyk/Dockerfile + image: ${DOCKER_REGISTRY:-reisingeradam}/anyk:2.94.0 + ports: + - "3390:3389" + # - "2222:22" + shm_size: 1g diff --git a/shared/docker-entrypoint.sh b/shared/docker-entrypoint.sh new file mode 100644 index 0000000..baea86f --- /dev/null +++ b/shared/docker-entrypoint.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# Add the ssh config if needed + +if [ ! -f "/etc/ssh/sshd_config" ]; + then + cp /ssh_orig/sshd_config /etc/ssh +fi + +if [ ! -f "/etc/ssh/ssh_config" ]; + then + cp /ssh_orig/ssh_config /etc/ssh +fi + +if [ ! -f "/etc/ssh/moduli" ]; + then + cp /ssh_orig/moduli /etc/ssh +fi + +# generate fresh rsa key if needed +if [ ! -f "/etc/ssh/ssh_host_rsa_key" ]; + then + ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa +fi + +# generate fresh dsa key if needed +if [ ! -f "/etc/ssh/ssh_host_dsa_key" ]; + then + ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa +fi + +#prepare run dir +mkdir -p /var/run/sshd + +# generate xrdp key +if [ ! -f "/etc/xrdp/rsakeys.ini" ]; + then + xrdp-keygen xrdp auto +fi + +# generate certificate for tls connection +if [ ! -f "/etc/xrdp/cert.pem" ]; + then + # delete eventual leftover private key + rm -f /etc/xrdp/key.pem || true + cd /etc/xrdp + # TODO make data in certificate configurable? + openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365 \ + -subj "/C=US/ST=Some State/L=Some City/O=Some Org/OU=Some Unit/CN=Terminalserver" + crudini --set /etc/xrdp/xrdp.ini Globals security_layer tls + crudini --set /etc/xrdp/xrdp.ini Globals certificate /etc/xrdp/cert.pem + crudini --set /etc/xrdp/xrdp.ini Globals key_file /etc/xrdp/key.pem + +fi + +# generate machine-id +uuidgen > /etc/machine-id + +# set keyboard for all sh users +echo "export QT_XKB_CONFIG_ROOT=/usr/share/X11/locale" >> /etc/profile + + +exec "$@" \ No newline at end of file