diff --git a/.gitignore b/.gitignore
index 2105ddb..a8e1812 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,3 +54,9 @@ logs/
# OS
.DS_Store
Thumbs.db
+
+# cosi
+data/
+hohiha/
+HH-dashboard/
+odooconf/
\ No newline at end of file
diff --git a/build.sh b/build.sh
index efac500..d3c78a9 100755
--- a/build.sh
+++ b/build.sh
@@ -1 +1,6 @@
-docker build --no-cache -t gitea.lan.hobbyhimmel.de/hobbyhimmel/custom-tomee .
\ No newline at end of file
+
+#!/bin/bash
+set -e
+
+docker buildx build --no-cache -t hosi:test-0.0.1 --load .
+
diff --git a/conf/manager.xml b/conf/manager.xml
new file mode 100644
index 0000000..6b06295
--- /dev/null
+++ b/conf/manager.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/setenv.sh b/conf/setenv.sh
new file mode 100644
index 0000000..4e5bcec
--- /dev/null
+++ b/conf/setenv.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# CUPS Printing Configuration for Java
+export JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=false"
+export JAVA_OPTS="$JAVA_OPTS -Dcups.servers=/run/cups/cups.sock"
+export JAVA_OPTS="$JAVA_OPTS -Dcups.server=/run/cups/cups.sock"
+export JAVA_OPTS="$JAVA_OPTS -Djavax.print.debug=true"
+export JAVA_OPTS="$JAVA_OPTS -Djdk.print.polling=true"
+export JAVA_OPTS="$JAVA_OPTS -Djdk.print.polling.interval=1000"
+export JAVA_OPTS="$JAVA_OPTS -Dsun.print.printservice.protocol=ipp"
+export JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
+
+export JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/usr/lib/x86_64-linux-gnu"
+export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"
+
+# Optional debug
+# export JAVA_OPTS="$JAVA_OPTS -Dsun.print.debug=true"
diff --git a/conf/tomcat-users.xml b/conf/tomcat-users.xml
new file mode 100644
index 0000000..7d66836
--- /dev/null
+++ b/conf/tomcat-users.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dbash.sh b/dbash.sh
new file mode 100644
index 0000000..d8bcb2d
--- /dev/null
+++ b/dbash.sh
@@ -0,0 +1,6 @@
+
+#!/bin/bash
+set -e
+
+docker exec -u 0 -it hosi /bin/bash
+
diff --git a/docker-compose.yml b/docker-compose.yml
index bd2b309..709a614 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,23 +1,16 @@
services:
- hobbysign:
- container_name: hobbysign
- image: gitea.lan.hobbyhimmel.de/hobbyhimmel/custom-tomee:latest
+ hosi:
+ container_name: hosi
+ image: hosi:test-0.0.1
stdin_open: true
tty: true
environment:
- HOHIHA_OUTPUT_DIR=/usr/local/tomee/output
- HOHIHA_ODOO_CONFIG=/usr/local/tomee/config/secrets.yml
volumes:
- - hobbysign_output:/usr/local/tomee/output
- - hobbysign_config:/usr/local/tomee/config
- - hobbysign_webapps:/usr/local/tomee/webapps
- - /var/run/cups/cups.sock:/var/run/cups/cups.sock
- healthcheck:
- test: ["CMD", "lpstat", "-v"]
- interval: 30s
- timeout: 10s
- retries: 3
- start_period: 10s
+ - /home/snick/hs/data/output:/usr/local/tomee/output
+ - /home/snick/hs/data/config:/usr/local/tomee/config
+ - /run/cups/cups.sock:/run/cups/cups.sock
user: "1000:1000"
restart: unless-stopped
@@ -25,14 +18,6 @@ services:
- hobbyhimmel_odoo_13_default
- npm-nw
-volumes:
- hobbysign_output:
- name: hobbysign_output
- hobbysign_config:
- name: hobbysign_config
- hobbysign_webapps:
- name: hobbysign_webapps
-
networks:
hobbyhimmel_odoo_13_default:
external: true
diff --git a/dockerfile b/dockerfile
index ece017d..3c3b73a 100644
--- a/dockerfile
+++ b/dockerfile
@@ -1,32 +1,49 @@
-FROM tomee:9.1.3-jre17-Semeru-ubuntu-plume
+FROM tomee:9.1.3-jre17-ubuntu-plume
# Install nano
USER root
-RUN apt update && apt install -y nano cups-client cups-bsd && apt clean
+# Install printing and X11 dependencies
+RUN apt update && apt install -y \
+ nano \
+ cups-client \
+ libcups2 \
+ libcups2-dev \
+ libx11-6 \
+ libxext6 \
+ libxi6 \
+ libxtst6 \
+ libxrender1 \
+ libfontconfig1 \
+ && apt clean
+
+
# Create a user with a home directory
RUN useradd -u 1000 -m -d /home/hobbyadmin -s /bin/bash hobbyadmin
# Set the working directory
WORKDIR /usr/local/tomee
-# Create the output directory and set permissions
-RUN mkdir -p /usr/local/tomee/output && chown -R 1000:1000 /usr/local/tomee/output
-RUN mkdir -p /usr/local/tomee/config && chown -R 1000:1000 /usr/local/tomee/config
-
# Copy application files
-# COPY . /usr/local/tomee
-RUN if [ -d /usr/local/tomee/webapps/ROOT ]; then mv /usr/local/tomee/webapps/ROOT /usr/local/tomee/webapps/welcome; fi
-RUN if [ -f /usr/local/tomee/webapps/ROOT.war ]; then mv /usr/local/tomee/webapps/ROOT.war /usr/local/tomee/webapps/admin.war; fi
-COPY tomcat-users.xml /usr/local/tomee/conf/tomcat-users.xml
-COPY manager.xml /usr/local/tomee/conf/Catalina/localhost/manager.xml
+# Rename default welcome app if it exists
+RUN if [ -d /usr/local/tomee/webapps/ROOT ]; then \
+ mv /usr/local/tomee/webapps/ROOT /usr/local/tomee/webapps/welcome; \
+ fi
+
+COPY ./HH-dashboard/install/ROOT.war /usr/local/tomee/webapps/ROOT.war
+COPY ./hohiha/install/HoHiHa.war /usr/local/tomee/webapps/
+COPY ./conf/tomcat-users.xml /usr/local/tomee/conf/tomcat-users.xml
+COPY ./conf/manager.xml /usr/local/tomee/conf/Catalina/localhost/manager.xml
+COPY ./conf/setenv.sh /usr/local/tomee/bin/setenv.sh
+
# Create a startup script to set umask and run the application
RUN echo '#!/bin/sh' > /usr/local/tomee/start.sh \
&& echo 'umask 002' >> /usr/local/tomee/start.sh \
&& echo 'catalina.sh run' >> /usr/local/tomee/start.sh
-
-# Make the startup script executable
+
+# Make the scripts executable
RUN chmod +x /usr/local/tomee/start.sh
+RUN chmod +x /usr/local/tomee/bin/setenv.sh
# Change ownership of all files to user 1000
diff --git a/README.md b/hobbysign-old/README.md
similarity index 100%
rename from README.md
rename to hobbysign-old/README.md
diff --git a/build.local.sh b/hobbysign-old/build.local.sh
old mode 100755
new mode 100644
similarity index 100%
rename from build.local.sh
rename to hobbysign-old/build.local.sh
diff --git a/hobbysign-old/build.sh b/hobbysign-old/build.sh
new file mode 100644
index 0000000..efac500
--- /dev/null
+++ b/hobbysign-old/build.sh
@@ -0,0 +1 @@
+docker build --no-cache -t gitea.lan.hobbyhimmel.de/hobbyhimmel/custom-tomee .
\ No newline at end of file
diff --git a/cups/README.md b/hobbysign-old/cups/README.md
similarity index 100%
rename from cups/README.md
rename to hobbysign-old/cups/README.md
diff --git a/cups/cups/cupsd.conf b/hobbysign-old/cups/cups/cupsd.conf
similarity index 100%
rename from cups/cups/cupsd.conf
rename to hobbysign-old/cups/cups/cupsd.conf
diff --git a/cups/cups/printers.conf b/hobbysign-old/cups/cups/printers.conf
similarity index 100%
rename from cups/cups/printers.conf
rename to hobbysign-old/cups/cups/printers.conf
diff --git a/cups/ppd/HL-L2370DN.ppd b/hobbysign-old/cups/ppd/HL-L2370DN.ppd
similarity index 100%
rename from cups/ppd/HL-L2370DN.ppd
rename to hobbysign-old/cups/ppd/HL-L2370DN.ppd
diff --git a/cups/ppd/HL-L2370DN.ppd.O b/hobbysign-old/cups/ppd/HL-L2370DN.ppd.O
similarity index 100%
rename from cups/ppd/HL-L2370DN.ppd.O
rename to hobbysign-old/cups/ppd/HL-L2370DN.ppd.O
diff --git a/docker-compose.local.yml b/hobbysign-old/docker-compose.local.yml
similarity index 100%
rename from docker-compose.local.yml
rename to hobbysign-old/docker-compose.local.yml
diff --git a/hobbysign-old/docker-compose.yml b/hobbysign-old/docker-compose.yml
new file mode 100644
index 0000000..bd2b309
--- /dev/null
+++ b/hobbysign-old/docker-compose.yml
@@ -0,0 +1,42 @@
+services:
+ hobbysign:
+ container_name: hobbysign
+ image: gitea.lan.hobbyhimmel.de/hobbyhimmel/custom-tomee:latest
+ stdin_open: true
+ tty: true
+ environment:
+ - HOHIHA_OUTPUT_DIR=/usr/local/tomee/output
+ - HOHIHA_ODOO_CONFIG=/usr/local/tomee/config/secrets.yml
+ volumes:
+ - hobbysign_output:/usr/local/tomee/output
+ - hobbysign_config:/usr/local/tomee/config
+ - hobbysign_webapps:/usr/local/tomee/webapps
+ - /var/run/cups/cups.sock:/var/run/cups/cups.sock
+ healthcheck:
+ test: ["CMD", "lpstat", "-v"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 10s
+
+ user: "1000:1000"
+ restart: unless-stopped
+ networks:
+ - hobbyhimmel_odoo_13_default
+ - npm-nw
+
+volumes:
+ hobbysign_output:
+ name: hobbysign_output
+ hobbysign_config:
+ name: hobbysign_config
+ hobbysign_webapps:
+ name: hobbysign_webapps
+
+networks:
+ hobbyhimmel_odoo_13_default:
+ external: true
+ name: hobbyhimmel_odoo_13_default
+ npm-nw:
+ external: true
+ name: npm-nw
diff --git a/hobbysign-old/dockerfile b/hobbysign-old/dockerfile
new file mode 100644
index 0000000..ece017d
--- /dev/null
+++ b/hobbysign-old/dockerfile
@@ -0,0 +1,39 @@
+FROM tomee:9.1.3-jre17-Semeru-ubuntu-plume
+
+# Install nano
+USER root
+RUN apt update && apt install -y nano cups-client cups-bsd && apt clean
+
+# Create a user with a home directory
+RUN useradd -u 1000 -m -d /home/hobbyadmin -s /bin/bash hobbyadmin
+
+# Set the working directory
+WORKDIR /usr/local/tomee
+
+# Create the output directory and set permissions
+RUN mkdir -p /usr/local/tomee/output && chown -R 1000:1000 /usr/local/tomee/output
+RUN mkdir -p /usr/local/tomee/config && chown -R 1000:1000 /usr/local/tomee/config
+
+# Copy application files
+# COPY . /usr/local/tomee
+RUN if [ -d /usr/local/tomee/webapps/ROOT ]; then mv /usr/local/tomee/webapps/ROOT /usr/local/tomee/webapps/welcome; fi
+RUN if [ -f /usr/local/tomee/webapps/ROOT.war ]; then mv /usr/local/tomee/webapps/ROOT.war /usr/local/tomee/webapps/admin.war; fi
+COPY tomcat-users.xml /usr/local/tomee/conf/tomcat-users.xml
+COPY manager.xml /usr/local/tomee/conf/Catalina/localhost/manager.xml
+# Create a startup script to set umask and run the application
+RUN echo '#!/bin/sh' > /usr/local/tomee/start.sh \
+ && echo 'umask 002' >> /usr/local/tomee/start.sh \
+ && echo 'catalina.sh run' >> /usr/local/tomee/start.sh
+
+# Make the startup script executable
+RUN chmod +x /usr/local/tomee/start.sh
+
+
+# Change ownership of all files to user 1000
+RUN chown -R 1000:1000 /usr/local/tomee
+
+# Set the user to "hobbyadmin" (replace 1000 with the actual UID of hobbyadmin)
+USER hobbyadmin
+
+# Run the startup script
+CMD ["/usr/local/tomee/start.sh"]
diff --git a/dockerfile.local b/hobbysign-old/dockerfile.local
similarity index 100%
rename from dockerfile.local
rename to hobbysign-old/dockerfile.local
diff --git a/logs.xml b/hobbysign-old/logs.xml
similarity index 100%
rename from logs.xml
rename to hobbysign-old/logs.xml
diff --git a/manager.xml b/hobbysign-old/manager.xml
similarity index 100%
rename from manager.xml
rename to hobbysign-old/manager.xml
diff --git a/start.local.sh b/hobbysign-old/start.local.sh
old mode 100755
new mode 100644
similarity index 100%
rename from start.local.sh
rename to hobbysign-old/start.local.sh
diff --git a/start.sh b/hobbysign-old/start.sh
old mode 100755
new mode 100644
similarity index 100%
rename from start.sh
rename to hobbysign-old/start.sh
diff --git a/stop.sh b/hobbysign-old/stop.sh
old mode 100755
new mode 100644
similarity index 100%
rename from stop.sh
rename to hobbysign-old/stop.sh
diff --git a/tomcat-users.xml b/hobbysign-old/tomcat-users.xml
similarity index 100%
rename from tomcat-users.xml
rename to hobbysign-old/tomcat-users.xml
diff --git a/web.xml b/hobbysign-old/web.xml
similarity index 100%
rename from web.xml
rename to hobbysign-old/web.xml