Bugfixes in wifi-qr + update DockerImages to v1.2.1

This commit is contained in:
2024-01-07 21:53:56 +01:00
parent 16a0069926
commit 8f91c192f6
10 changed files with 62 additions and 41 deletions

3
.idea/misc.xml generated
View File

@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="Black"> <component name="Black">
<option name="sdkName" value="Python 3.12 (Docker-Flask-QR)" /> <option name="sdkName" value="Python 3.12 (Docker-Flask-QR)" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" project-jdk-name="Python 3.11 FlaskQR(venv)" project-jdk-type="Python SDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_21" project-jdk-name="Python 3.12 (Docker-Flask-QR)" project-jdk-type="Python SDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

View File

@@ -2,8 +2,8 @@
<configuration default="false" name="Dockerfile-Raspi" type="docker-deploy" factoryName="dockerfile" server-name="Docker-RasPi"> <configuration default="false" name="Dockerfile-Raspi" type="docker-deploy" factoryName="dockerfile" server-name="Docker-RasPi">
<deployment type="dockerfile"> <deployment type="dockerfile">
<settings> <settings>
<option name="imageTag" value="flask-qrcode-gen:latest" /> <option name="imageTag" value="tebarius/flask-qrcode-generator:armv7-latest, ghcr.io/tebarius/flask-qrcode-generator:armv7-latest" />
<option name="containerName" value="flask-qrcode-gen" /> <option name="containerName" value="Flask-QRcode-Gen" />
<option name="portBindings"> <option name="portBindings">
<list> <list>
<DockerPortBindingImpl> <DockerPortBindingImpl>

View File

@@ -2,7 +2,7 @@
<configuration default="false" name="Dockerfile-local" type="docker-deploy" factoryName="dockerfile" server-name="Docker-local"> <configuration default="false" name="Dockerfile-local" type="docker-deploy" factoryName="dockerfile" server-name="Docker-local">
<deployment type="dockerfile"> <deployment type="dockerfile">
<settings> <settings>
<option name="imageTag" value="flask-qrcode-gen:latest" /> <option name="imageTag" value="tebarius/flask-qrcode-generator:latest, ghcr.io/tebarius/flask-qrcode-generator:latest" />
<option name="containerName" value="Flask-QRcode-Gen" /> <option name="containerName" value="Flask-QRcode-Gen" />
<option name="portBindings"> <option name="portBindings">
<list> <list>

62
.idea/workspace.xml generated
View File

@@ -9,9 +9,17 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3fdfc273-527d-4717-bd6d-4ba98fba7555" name="Changes" comment="readme.md geschrieben und Container auf Docker-Hub"> <list default="true" id="3fdfc273-527d-4717-bd6d-4ba98fba7555" name="Changes" comment="URLs in readme.md auf ghcr.io">
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/runConfigurations/Dockerfile_Raspi.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/runConfigurations/Dockerfile_Raspi.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/runConfigurations/Dockerfile_local.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/runConfigurations/Dockerfile_local.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/readme.md" beforeDir="false" afterPath="$PROJECT_DIR$/readme.md" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Dockerfile" beforeDir="false" afterPath="$PROJECT_DIR$/Dockerfile" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Dockerfile-RasPi" beforeDir="false" afterPath="$PROJECT_DIR$/Dockerfile-RasPi" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/GET-Flask-QR.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/GET-Flask-QR.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/POST-Flask-QR.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/POST-Flask-QR.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/post-templates/wifi.html" beforeDir="false" afterPath="$PROJECT_DIR$/app/post-templates/wifi.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/qr-static/style.css" beforeDir="false" afterPath="$PROJECT_DIR$/app/qr-static/style.css" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -69,20 +77,25 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;DefaultHtmlFileTemplate&quot;: &quot;HTML File&quot;, "DefaultHtmlFileTemplate": "HTML File",
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;, "Docker.Dockerfile-Raspi.executor": "Run",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "Docker.Dockerfile-local.executor": "Run",
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;, "Docker.Dockerfile.executor": "Run",
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;, "Python.GET-Flask-QR.executor": "Run",
&quot;last_opened_file_path&quot;: &quot;D:/mager/Documents/IntelliJ/Docker-Flask-QR/app/POST-Flask-QR.py&quot;, "Python.POST-Flask-QR.executor": "Run",
&quot;project.structure.last.edited&quot;: &quot;Artifacts&quot;, "RunOnceActivity.OpenProjectViewOnStart": "true",
&quot;project.structure.proportion&quot;: &quot;0.15&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot;, "SHARE_PROJECT_CONFIGURATION_FILES": "true",
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot; "ignore.virus.scanning.warn.message": "true",
"last_opened_file_path": "D:/mager/Documents/IntelliJ/Docker-Flask-QR/app/POST-Flask-QR.py",
"project.structure.last.edited": "Project",
"project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.2",
"settings.editor.selected.configurable": "preferences.pluginManager"
} }
}</component> }]]></component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/app/get-templates" /> <recent name="$PROJECT_DIR$/app/get-templates" />
@@ -98,9 +111,10 @@
<recent name="D:\mager\Documents\IntelliJ\Docker-Flask-QR" /> <recent name="D:\mager\Documents\IntelliJ\Docker-Flask-QR" />
</key> </key>
</component> </component>
<component name="RunManager" selected="Docker.Dockerfile-local"> <component name="RunManager" selected="Docker.Dockerfile-Raspi">
<configuration name="GET-Flask-QR" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true"> <configuration name="GET-Flask-QR" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<module name="Docker-Flask-QR" /> <module name="Docker-Flask-QR" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
<envs> <envs>
@@ -123,6 +137,7 @@
</configuration> </configuration>
<configuration name="POST-Flask-QR" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true"> <configuration name="POST-Flask-QR" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<module name="Docker-Flask-QR" /> <module name="Docker-Flask-QR" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
<envs> <envs>
@@ -158,8 +173,8 @@
<list> <list>
<item itemvalue="Docker.Dockerfile-local" /> <item itemvalue="Docker.Dockerfile-local" />
<item itemvalue="Docker.Dockerfile-Raspi" /> <item itemvalue="Docker.Dockerfile-Raspi" />
<item itemvalue="Python.POST-Flask-QR" />
<item itemvalue="Python.GET-Flask-QR" /> <item itemvalue="Python.GET-Flask-QR" />
<item itemvalue="Python.POST-Flask-QR" />
</list> </list>
</component> </component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
@@ -267,7 +282,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1699999431716</updated> <updated>1699999431716</updated>
</task> </task>
<option name="localTasksCounter" value="13" /> <task id="LOCAL-00013" summary="URLs in readme.md auf ghcr.io">
<option name="closed" value="true" />
<created>1700154394950</created>
<option name="number" value="00013" />
<option name="presentableId" value="LOCAL-00013" />
<option name="project" value="LOCAL" />
<updated>1700154394950</updated>
</task>
<option name="localTasksCounter" value="14" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@@ -305,7 +328,8 @@
<MESSAGE value="Variante mit POST-REQUESTS ergänzt und Dockerfiles auf POST umgestellt" /> <MESSAGE value="Variante mit POST-REQUESTS ergänzt und Dockerfiles auf POST umgestellt" />
<MESSAGE value="ENV-Variable HTTP_METHOD eingeführt" /> <MESSAGE value="ENV-Variable HTTP_METHOD eingeführt" />
<MESSAGE value="readme.md geschrieben und Container auf Docker-Hub" /> <MESSAGE value="readme.md geschrieben und Container auf Docker-Hub" />
<option name="LAST_COMMIT_MESSAGE" value="readme.md geschrieben und Container auf Docker-Hub" /> <MESSAGE value="URLs in readme.md auf ghcr.io" />
<option name="LAST_COMMIT_MESSAGE" value="URLs in readme.md auf ghcr.io" />
</component> </component>
<component name="XSLT-Support.FileAssociations.UIState"> <component name="XSLT-Support.FileAssociations.UIState">
<expand /> <expand />

View File

@@ -1,13 +1,13 @@
FROM python:slim FROM python:slim
LABEL authors="tebarius" LABEL authors="tebarius"
LABEL version="1.2" LABEL version="1.2.1"
LABEL description="QR-Code-Generator-Server with Flask-App" LABEL description="QR-Code-Generator-Server with Flask-App"
WORKDIR /app WORKDIR /app
COPY ./app /app/ COPY ./app /app/
#RUN pip install --upgrade pip RUN pip install --upgrade pip
RUN pip install --trusted-host pypi.python.org -r requirements.txt RUN pip install --trusted-host pypi.python.org -r requirements.txt
EXPOSE 8002 EXPOSE 8002

View File

@@ -1,7 +1,7 @@
FROM python:slim FROM python:slim
LABEL authors="tebarius" LABEL authors="tebarius"
LABEL version="1.2" LABEL version="1.2.1"
LABEL description="QR-Code-Generator-Server with Flask-App" LABEL description="QR-Code-Generator-Server with Flask-App"
LABEL platform="Raspberry Pi 3 with Raspian" LABEL platform="Raspberry Pi 3 with Raspian"
@@ -9,7 +9,7 @@ WORKDIR /app
COPY ./app /app/ COPY ./app /app/
RUN apt-get update && apt-get install -y gcc zlib1g-dev libjpeg-dev RUN apt-get update && apt-get install -y gcc zlib1g-dev libjpeg-dev
#RUN python -m pip install --upgrade pip RUN python -m pip install --upgrade pip
#RUN python -m pip install --upgrade pillow #RUN python -m pip install --upgrade pillow
RUN pip install --trusted-host pypi.python.org -r requirements.txt RUN pip install --trusted-host pypi.python.org -r requirements.txt

View File

@@ -171,9 +171,9 @@ def makeqr():
ssid = (request.args.get("ssid").replace("\\", "\\\\").replace(";", "\\;") ssid = (request.args.get("ssid").replace("\\", "\\\\").replace(";", "\\;")
.replace(",", "\\,").replace(":", "\\:").replace("\"", "\\\"")) .replace(",", "\\,").replace(":", "\\:").replace("\"", "\\\""))
if request.args.get("auth") == "WPA": if request.args.get("auth") == "WPA":
data = f'WIFI:T:WPA;S:"{ssid}";P:"{passw}"' data = f'WIFI:T:WPA;S:"{ssid}";P:"{passw}";'
else: else:
data = f'WIFI:T:nopass;S:"{ssid}"' data = f'WIFI:T:nopass;S:"{ssid}";'
if request.args.get("hidden"): if request.args.get("hidden"):
data += "H:true;;" data += "H:true;;"
else: else:

View File

@@ -171,13 +171,14 @@ def makeqr():
ssid = (request.form["ssid"].replace("\\", "\\\\").replace(";", "\\;") ssid = (request.form["ssid"].replace("\\", "\\\\").replace(";", "\\;")
.replace(",", "\\,").replace(":", "\\:").replace("\"", "\\\"")) .replace(",", "\\,").replace(":", "\\:").replace("\"", "\\\""))
if request.form["auth"] == "WPA": if request.form["auth"] == "WPA":
data = f'WIFI:T:WPA;S:"{ssid}";P:"{passw}"' data = f'WIFI:T:WPA;S:"{ssid}";P:"{passw}";'
else: else:
data = f'WIFI:T:nopass;S:"{ssid}"' data = f'WIFI:T:nopass;S:"{ssid}";'
if request.form["hidden"]: if 'ssid_hidden' in request.form:
data += "H:true;;" data += "H:true;;"
else: else:
data += ";" data += ";"
elif request.form['type'] == "cal": elif request.form['type'] == "cal":
# Format für Calendar (Zeilenumbrüche beachten!!): # Format für Calendar (Zeilenumbrüche beachten!!):
# BEGIN:VEVENT # BEGIN:VEVENT

View File

@@ -9,8 +9,8 @@
<input type="text" name="ssid" id="ssid" size="30" maxlength="60" required><br /> <input type="text" name="ssid" id="ssid" size="30" maxlength="60" required><br />
<label for="passw">Passcode &#47; Passwort:</label> <label for="passw">Passcode &#47; Passwort:</label>
<input type="text" name="passw" id="passw" size="30" maxlength="60"><br /> <input type="text" name="passw" id="passw" size="30" maxlength="60"><br />
<input type="checkbox" name="hidden" id="hidden" value=True> <input type="checkbox" name="ssid_hidden" id="ssid_hidden" value=True>
<label for="hidden"><i>versteckte &#47; unsichtbare SSID</i></label><br /> <label for="ssid_hidden"><i>versteckte &#47; unsichtbare SSID</i></label><br />
<label> <label>
<input name="auth" type="radio" value="WPA" required> <input name="auth" type="radio" value="WPA" required>
</label> WPA/WPA2/WPA3<br /> </label> WPA/WPA2/WPA3<br />
@@ -18,11 +18,6 @@
<input name="auth" type="radio" value="nopass" required> <input name="auth" type="radio" value="nopass" required>
</label> keine Verschl&uuml;sselung </label> keine Verschl&uuml;sselung
<br /> <br />
<button type="reset">Eingaben zur&uuml;cksetzen</button> <button type="reset">Eingaben zur&uuml;cksetzen</button>
<button type="submit">Eingaben absenden</button> <button type="submit">Eingaben absenden</button>

View File

@@ -28,13 +28,13 @@
} }
input[type='radio'] input[type='radio']
{ {
transform: scale(4); transform: scale(3);
margin: 10px; margin: 10px;
vertical-align:10px; vertical-align:10px;
} }
input[type='checkbox'] input[type='checkbox']
{ {
transform: scale(4); transform: scale(3);
margin: 10px; margin: 10px;
vertical-align:10px; vertical-align:10px;
} }