]> wagnertech.de Git - projects.git/commitdiff
Merge branch 'master' of http://wagnertech.de/git/projects
authorMichael Wagner <mail@wagnertech.de>
Mon, 22 Sep 2025 20:21:14 +0000 (22:21 +0200)
committerMichael Wagner <mail@wagnertech.de>
Mon, 22 Sep 2025 20:21:14 +0000 (22:21 +0200)
29 files changed:
Configure [new file with mode: 0755]
Test/webssh/.dummy [new file with mode: 0644]
Test/webssh/FitnessePages/.dummy [new file with mode: 0644]
Test/webssh/FitnessePages/AaaStart/.dummy [new file with mode: 0644]
Test/webssh/FitnessePages/AaaStart/content.txt [new file with mode: 0644]
Test/webssh/FitnessePages/AaaStart/properties.xml [new file with mode: 0644]
Test/webssh/FitnessePages/PyTest/.dummy [new file with mode: 0644]
Test/webssh/FitnessePages/PyTest/content.txt [new file with mode: 0644]
Test/webssh/FitnessePages/PyTest/properties.xml [new file with mode: 0644]
Test/webssh/FitnessePages/ServerTest/.dummy [new file with mode: 0644]
Test/webssh/FitnessePages/ServerTest/content.txt [new file with mode: 0644]
Test/webssh/FitnessePages/ServerTest/properties.xml [new file with mode: 0644]
Test/webssh/FitnessePages/content.txt [new file with mode: 0644]
Test/webssh/FitnessePages/properties.xml [new file with mode: 0644]
debian/mdjango.changelog [new file with mode: 0644]
debian/mdjango.conf [new file with mode: 0644]
debian/mdjango.control [new file with mode: 0644]
debian/mdjango.cp [new file with mode: 0755]
debian/mdjango.postinst [new file with mode: 0755]
debian/mdjango.preinst [new file with mode: 0755]
debian/webssh.build [new file with mode: 0755]
debian/webssh.control [new file with mode: 0644]
debian/webssh.cp [new file with mode: 0755]
debian/webssh.postinst [new file with mode: 0755]
debian/webssh.prebuild [new file with mode: 0755]
etc/webssh.service [new file with mode: 0644]
mdjango/.dummy [new file with mode: 0644]
mdjango/etc/.dummy [new file with mode: 0644]
mdjango/etc/mysite.conf [new file with mode: 0644]

diff --git a/Configure b/Configure
new file mode 100755 (executable)
index 0000000..9e8badc
--- /dev/null
+++ b/Configure
@@ -0,0 +1,31 @@
+#!/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
diff --git a/Test/webssh/.dummy b/Test/webssh/.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/Test/webssh/FitnessePages/.dummy b/Test/webssh/FitnessePages/.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/Test/webssh/FitnessePages/AaaStart/.dummy b/Test/webssh/FitnessePages/AaaStart/.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/Test/webssh/FitnessePages/AaaStart/content.txt b/Test/webssh/FitnessePages/AaaStart/content.txt
new file mode 100644 (file)
index 0000000..8c98eac
--- /dev/null
@@ -0,0 +1,10 @@
+!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/|
diff --git a/Test/webssh/FitnessePages/AaaStart/properties.xml b/Test/webssh/FitnessePages/AaaStart/properties.xml
new file mode 100644 (file)
index 0000000..afb3ad1
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<properties>
+       <Edit/>
+       <Files/>
+       <Help/>
+       <Properties/>
+       <RecentChanges/>
+       <Refactor/>
+       <Search/>
+       <Suites/>
+       <Test/>
+       <Versions/>
+       <WhereUsed/>
+</properties>
diff --git a/Test/webssh/FitnessePages/PyTest/.dummy b/Test/webssh/FitnessePages/PyTest/.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/Test/webssh/FitnessePages/PyTest/content.txt b/Test/webssh/FitnessePages/PyTest/content.txt
new file mode 100644 (file)
index 0000000..701ed99
--- /dev/null
@@ -0,0 +1,4 @@
+!1 pytest
+
+!|test.util.CallScript|
+|call script|cd ~/tmp/tests && pytest-3|
diff --git a/Test/webssh/FitnessePages/PyTest/properties.xml b/Test/webssh/FitnessePages/PyTest/properties.xml
new file mode 100644 (file)
index 0000000..e13fdf4
--- /dev/null
@@ -0,0 +1,12 @@
+<?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>
diff --git a/Test/webssh/FitnessePages/ServerTest/.dummy b/Test/webssh/FitnessePages/ServerTest/.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/Test/webssh/FitnessePages/ServerTest/content.txt b/Test/webssh/FitnessePages/ServerTest/content.txt
new file mode 100644 (file)
index 0000000..979bfa1
--- /dev/null
@@ -0,0 +1,6 @@
+!1 Server-Test
+
+!|test.util.CallScript|
+|call script|!- rm index.html | true -!|
+|call script|wget http://localhost:8888|
+|call script|grep WebSSH index.html|
diff --git a/Test/webssh/FitnessePages/ServerTest/properties.xml b/Test/webssh/FitnessePages/ServerTest/properties.xml
new file mode 100644 (file)
index 0000000..e13fdf4
--- /dev/null
@@ -0,0 +1,12 @@
+<?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>
diff --git a/Test/webssh/FitnessePages/content.txt b/Test/webssh/FitnessePages/content.txt
new file mode 100644 (file)
index 0000000..99c097c
--- /dev/null
@@ -0,0 +1 @@
+!contents -R2 -g -p -f -h
diff --git a/Test/webssh/FitnessePages/properties.xml b/Test/webssh/FitnessePages/properties.xml
new file mode 100644 (file)
index 0000000..3096ff6
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<properties>
+       <Edit/>
+       <Files/>
+       <Help></Help>
+       <Properties/>
+       <RecentChanges/>
+       <Refactor/>
+       <Search/>
+       <Suite/>
+       <Suites></Suites>
+       <Versions/>
+       <WhereUsed/>
+</properties>
diff --git a/debian/mdjango.changelog b/debian/mdjango.changelog
new file mode 100644 (file)
index 0000000..5b143ea
--- /dev/null
@@ -0,0 +1,3 @@
+projects (0.1-%BUILD%) unstable; urgency=medium
+  * Djanjo base project
+ -- Michael Wagner <michael@wagnertech.de>  Fri, 08 Aug 2025 10:00:00 +0100
diff --git a/debian/mdjango.conf b/debian/mdjango.conf
new file mode 100644 (file)
index 0000000..4f91cd7
--- /dev/null
@@ -0,0 +1,2 @@
+compile_type=NONE
+target_type=DEB
diff --git a/debian/mdjango.control b/debian/mdjango.control
new file mode 100644 (file)
index 0000000..4a6d8aa
--- /dev/null
@@ -0,0 +1,11 @@
+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
+
diff --git a/debian/mdjango.cp b/debian/mdjango.cp
new file mode 100755 (executable)
index 0000000..f0ad2c8
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+set -e
+
+mkdir -p $1/etc/apache2/sites-available/
+cp mdjango/etc/mysite.conf $1/etc/apache2/sites-available/
diff --git a/debian/mdjango.postinst b/debian/mdjango.postinst
new file mode 100755 (executable)
index 0000000..ff4893d
--- /dev/null
@@ -0,0 +1,27 @@
+#!/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
diff --git a/debian/mdjango.preinst b/debian/mdjango.preinst
new file mode 100755 (executable)
index 0000000..f955f50
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+set -e
+
+if [ ! -d /opt/mysite ]
+then
+       cd /opt
+       django-admin startproject mysite
+fi
diff --git a/debian/webssh.build b/debian/webssh.build
new file mode 100755 (executable)
index 0000000..c104cd7
--- /dev/null
@@ -0,0 +1,14 @@
+#!/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
diff --git a/debian/webssh.control b/debian/webssh.control
new file mode 100644 (file)
index 0000000..c51f8e2
--- /dev/null
@@ -0,0 +1,10 @@
+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
diff --git a/debian/webssh.cp b/debian/webssh.cp
new file mode 100755 (executable)
index 0000000..aa6c95b
--- /dev/null
@@ -0,0 +1,13 @@
+#!/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/
diff --git a/debian/webssh.postinst b/debian/webssh.postinst
new file mode 100755 (executable)
index 0000000..5c23761
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+set -e
+
+systemctl enable webssh || true
+systemctl start webssh || true
diff --git a/debian/webssh.prebuild b/debian/webssh.prebuild
new file mode 100755 (executable)
index 0000000..c1d79fa
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -e
+
+python3 -m venv .venv
diff --git a/etc/webssh.service b/etc/webssh.service
new file mode 100644 (file)
index 0000000..d3563ff
--- /dev/null
@@ -0,0 +1,14 @@
+[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
diff --git a/mdjango/.dummy b/mdjango/.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/mdjango/etc/.dummy b/mdjango/etc/.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/mdjango/etc/mysite.conf b/mdjango/etc/mysite.conf
new file mode 100644 (file)
index 0000000..81eb48f
--- /dev/null
@@ -0,0 +1,8 @@
+WSGIScriptAlias / /opt/mysite/mysite/wsgi.py
+#WSGIPythonHome /path/to/venv
+WSGIPythonPath /opt/mysite
+<Directory /opt/mysite>
+<Files wsgi.py>
+Require all granted
+</Files>
+</Directory>