--- /dev/null
+#!/bin/bash
+set -e
+
+function usage {
+       cat <<USAGE
+configure PROJECT
+PROJECT = webssh
+USAGE
+}
+
+if [ -z "$1" ]
+then
+       usage
+       exit 7
+fi
+
+case $1 in
+webssh)
+       cat <<WEBSSH >debian/webssh.conf
+# generated by configure
+compile_type=ANY
+target_type=DEB
+WEBSSH
+       mconfigure -V webssh
+       ;;
+*)
+       echo "Invalid project."
+       usage
+       exit 25
+       ;;
+esac
 
--- /dev/null
+!1 Initialisierung
+
+!|test.util.CallScript|
+|call script|mtestinfo webssh|
+|call script|!- rm -r ~/tmp/webssh | true -!|
+|call script|!- rm -r ~/tmp/tests | true -!|
+|call script|if [ ! -d ~/webssh ]; then cd ~; git clone https://github.com/huashengdun/webssh; fi|
+|call script|cd ~/webssh; git_up|
+|call script|rsync -a /usr/lib/python3.9/webssh/ ~/tmp/webssh/|
+|call script|rsync -a ~/webssh/tests/ ~/tmp/tests/|
 
--- /dev/null
+<?xml version="1.0"?>
+<properties>
+       <Edit/>
+       <Files/>
+       <Help/>
+       <Properties/>
+       <RecentChanges/>
+       <Refactor/>
+       <Search/>
+       <Suites/>
+       <Test/>
+       <Versions/>
+       <WhereUsed/>
+</properties>
 
--- /dev/null
+!1 pytest
+
+!|test.util.CallScript|
+|call script|cd ~/tmp/tests && pytest-3|
 
--- /dev/null
+<?xml version="1.0"?>
+<properties>
+       <Edit>true</Edit>
+       <Files>true</Files>
+       <Properties>true</Properties>
+       <RecentChanges>true</RecentChanges>
+       <Refactor>true</Refactor>
+       <Search>true</Search>
+       <Test>true</Test>
+       <Versions>true</Versions>
+       <WhereUsed>true</WhereUsed>
+</properties>
 
--- /dev/null
+!1 Server-Test
+
+!|test.util.CallScript|
+|call script|!- rm index.html | true -!|
+|call script|wget http://localhost:8888|
+|call script|grep WebSSH index.html|
 
--- /dev/null
+<?xml version="1.0"?>
+<properties>
+       <Edit>true</Edit>
+       <Files>true</Files>
+       <Properties>true</Properties>
+       <RecentChanges>true</RecentChanges>
+       <Refactor>true</Refactor>
+       <Search>true</Search>
+       <Test>true</Test>
+       <Versions>true</Versions>
+       <WhereUsed>true</WhereUsed>
+</properties>
 
--- /dev/null
+!contents -R2 -g -p -f -h
 
--- /dev/null
+<?xml version="1.0"?>
+<properties>
+       <Edit/>
+       <Files/>
+       <Help></Help>
+       <Properties/>
+       <RecentChanges/>
+       <Refactor/>
+       <Search/>
+       <Suite/>
+       <Suites></Suites>
+       <Versions/>
+       <WhereUsed/>
+</properties>
 
--- /dev/null
+projects (0.1-%BUILD%) unstable; urgency=medium
+  * Djanjo base project
+ -- Michael Wagner <michael@wagnertech.de>  Fri, 08 Aug 2025 10:00:00 +0100
 
--- /dev/null
+compile_type=NONE
+target_type=DEB
 
--- /dev/null
+Source: projects
+Section: main
+Priority: optional
+Maintainer: Michael Wagner <michael@wagnertech.de>
+Build-Depends: 
+ 
+Package: mdjango
+Architecture: all
+Depends: python3-django, apache2, libapache2-mod-wsgi-py3, postgresql, python3-psycopg2
+Description: Djanjo base project
+
 
--- /dev/null
+#!/bin/bash
+set -e
+
+mkdir -p $1/etc/apache2/sites-available/
+cp mdjango/etc/mysite.conf $1/etc/apache2/sites-available/
 
--- /dev/null
+#!/bin/bash
+set -e
+
+a2ensite mysite
+systemctl reload apache2
+
+# check addition to settings
+if ! grep "### MDJANGO ###" /opt/mysite/mysite/settings.py >/dev/null
+then
+       echo "add mdjango settings to settings.py"
+       cat << EOF >> /opt/mysite/mysite/settings.py
+### MDJANGO ###
+DATABASES = {
+    'default': {},
+    'tbd': {
+        'ENGINE': 'django.db.backends.postgresql',
+        'NAME': 'mydatabase',
+        'USER': 'myuser',
+        'PASSWORD': 'mypassword',
+        'HOST': 'localhost',
+        'PORT': '5432',
+    }
+}
+DEBUG = False
+### MDJANGO-END ###
+EOF
+fi
 
--- /dev/null
+#!/bin/bash
+set -e
+
+if [ ! -d /opt/mysite ]
+then
+       cd /opt
+       django-admin startproject mysite
+fi
 
--- /dev/null
+#!/bin/bash
+set -e
+
+. debian/setenv.sh
+
+source .venv/bin/activate
+pip install webssh
+
+# detemine verion
+websshdir=$(ls -d .venv/lib/python3.9/site-packages/webssh-*)
+version=${websshdir##*/webssh-}
+version=${version%%.egg*}
+echo "export version=$version" >> $PROJECT_DIR/debian/setenv.sh
+echo "version=$version" >> $PROJECT_DIR/debian/rules.pre
 
--- /dev/null
+Source: webssh
+Section: main
+Priority: optional
+Maintainer: Michael Wagner <michael@wagnertech.de>
+Build-Depends: git, mbuild
+ 
+Package: webssh
+Architecture: all
+Depends: python3-paramiko(>=2.3.1), python3-tornado(>=4.5.0), python3-cryptography(>=3.3), python3-pycparser
+Description: WebSSH
 
--- /dev/null
+#!/bin/bash
+set -e
+
+. debian/setenv.sh
+
+mkdir -p $1/usr/lib/python3.9/
+cp -a $BUILD_DIR/.venv/lib/python3.9/site-packages/webssh $1/usr/lib/python3.9/
+
+mkdir -p $1/usr/bin
+cp $BUILD_DIR/.venv/bin/wssh $1/usr/bin/webssh
+
+mkdir -p $1/lib/systemd/system
+cp etc/webssh.service $1/lib/systemd/system/
 
--- /dev/null
+#!/bin/bash
+set -e
+
+systemctl enable webssh || true
+systemctl start webssh || true
 
--- /dev/null
+#!/bin/bash
+set -e
+
+python3 -m venv .venv
 
--- /dev/null
+[Unit]
+Description=WebSSH
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/webssh
+KillMode=process
+Restart=on-failure
+RestartSec=3
+Type=simple
+
+[Install]
+WantedBy=multi-user.target
+Alias=frps.service
 
--- /dev/null
+WSGIScriptAlias / /opt/mysite/mysite/wsgi.py
+#WSGIPythonHome /path/to/venv
+WSGIPythonPath /opt/mysite
+<Directory /opt/mysite>
+<Files wsgi.py>
+Require all granted
+</Files>
+</Directory>