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">
<component name="Black">
<option name="sdkName" value="Python 3.12 (Docker-Flask-QR)" />
</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" />
</component>
</project>

View File

@@ -2,8 +2,8 @@
<configuration default="false" name="Dockerfile-Raspi" type="docker-deploy" factoryName="dockerfile" server-name="Docker-RasPi">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="flask-qrcode-gen:latest" />
<option name="containerName" value="flask-qrcode-gen" />
<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="portBindings">
<list>
<DockerPortBindingImpl>

View File

@@ -2,7 +2,7 @@
<configuration default="false" name="Dockerfile-local" type="docker-deploy" factoryName="dockerfile" server-name="Docker-local">
<deployment type="dockerfile">
<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="portBindings">
<list>

62
.idea/workspace.xml generated
View File

@@ -9,9 +9,17 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<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$/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>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -69,20 +77,25 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;DefaultHtmlFileTemplate&quot;: &quot;HTML File&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;D:/mager/Documents/IntelliJ/Docker-Flask-QR/app/POST-Flask-QR.py&quot;,
&quot;project.structure.last.edited&quot;: &quot;Artifacts&quot;,
&quot;project.structure.proportion&quot;: &quot;0.15&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"DefaultHtmlFileTemplate": "HTML File",
"Docker.Dockerfile-Raspi.executor": "Run",
"Docker.Dockerfile-local.executor": "Run",
"Docker.Dockerfile.executor": "Run",
"Python.GET-Flask-QR.executor": "Run",
"Python.POST-Flask-QR.executor": "Run",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
"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">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/app/get-templates" />
@@ -98,9 +111,10 @@
<recent name="D:\mager\Documents\IntelliJ\Docker-Flask-QR" />
</key>
</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">
<module name="Docker-Flask-QR" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
@@ -123,6 +137,7 @@
</configuration>
<configuration name="POST-Flask-QR" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<module name="Docker-Flask-QR" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
@@ -158,8 +173,8 @@
<list>
<item itemvalue="Docker.Dockerfile-local" />
<item itemvalue="Docker.Dockerfile-Raspi" />
<item itemvalue="Python.POST-Flask-QR" />
<item itemvalue="Python.GET-Flask-QR" />
<item itemvalue="Python.POST-Flask-QR" />
</list>
</component>
<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" />
<updated>1699999431716</updated>
</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 />
</component>
<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="ENV-Variable HTTP_METHOD eingeführt" />
<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 name="XSLT-Support.FileAssociations.UIState">
<expand />

View File

@@ -1,13 +1,13 @@
FROM python:slim
LABEL authors="tebarius"
LABEL version="1.2"
LABEL version="1.2.1"
LABEL description="QR-Code-Generator-Server with Flask-App"
WORKDIR /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
EXPOSE 8002

View File

@@ -1,7 +1,7 @@
FROM python:slim
LABEL authors="tebarius"
LABEL version="1.2"
LABEL version="1.2.1"
LABEL description="QR-Code-Generator-Server with Flask-App"
LABEL platform="Raspberry Pi 3 with Raspian"
@@ -9,7 +9,7 @@ WORKDIR /app
COPY ./app /app/
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 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(";", "\\;")
.replace(",", "\\,").replace(":", "\\:").replace("\"", "\\\""))
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:
data = f'WIFI:T:nopass;S:"{ssid}"'
data = f'WIFI:T:nopass;S:"{ssid}";'
if request.args.get("hidden"):
data += "H:true;;"
else:

View File

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

View File

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

View File

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