diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..90ab869 --- /dev/null +++ b/Containerfile @@ -0,0 +1,29 @@ +FROM python:3.14-slim + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + PIP_NO_CACHE_DIR=1 + +WORKDIR /app + +# Optional but useful for Pillow runtime compatibility in slim images +RUN apt-get update && apt-get install -y --no-install-recommends \ + libjpeg62-turbo \ + zlib1g \ +&& rm -rf /var/lib/apt/lists/* + +COPY requirements.txt ./ +RUN pip install -r requirements.txt + +COPY . . + +# Non-root runtime user +RUN useradd -m -u 10001 catnote && chown -R catnote:catnote /app +USER catnote + +EXPOSE 5000 + +# BLEHD_SOCKET can be overridden at runtime +ENV BLEHD_SOCKET=/run/bleh/blehd.sock + +CMD ["python", "app.py", "--port", "5000"] diff --git a/app.py b/app.py index 171331f..780b91f 100644 --- a/app.py +++ b/app.py @@ -649,8 +649,12 @@ def icon_maskable(): def icon_rounded(): return send_from_directory('static', 'icon512_rounded.png') +@app.route('/icon512_monochrome.png') +def icon_monochrome(): + return send_from_directory('static', 'icon512_monochrome.png') + if __name__ == "__main__": parser = argparse.ArgumentParser(description='CatNote: Server for Markdown to MXW01 Cat Printer') parser.add_argument('-p', '--port', type=int, default=5000, help='Port to run the server on (default: 5000)') args = parser.parse_args() - app.run(host='0.0.0.0', port=args.port) \ No newline at end of file + app.run(host='0.0.0.0', port=args.port) diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..89997d0 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,10 @@ +services: + server: + build: . + ports: + - "8000:5000" + restart: unless-stopped + volumes: + - /run/bleh/blehd.sock:/run/bleh/blehd.sock:rw + group_add: + - "1001" diff --git a/static/icon512_monochrome.png b/static/icon512_monochrome.png new file mode 100644 index 0000000..6b80b1a Binary files /dev/null and b/static/icon512_monochrome.png differ diff --git a/static/manifest.json b/static/manifest.json index 93c50c0..ffa9abe 100644 --- a/static/manifest.json +++ b/static/manifest.json @@ -1 +1,18 @@ -{"theme_color":"#22282c","background_color":"#22282c","icons":[{"purpose":"maskable","sizes":"512x512","src":"icon512_maskable.png","type":"image/png"},{"purpose":"any","sizes":"512x512","src":"icon512_rounded.png","type":"image/png"}],"orientation":"any","display":"standalone","dir":"auto","lang":"es-UY","start_url":"https://catnote.netpaws.cc","scope":"https://catnote.netpaws.cc","name":"CatNote","short_name":"CatNote","id":"cc.netpaws.catnote"} \ No newline at end of file +{ + "theme_color": "#22282c", + "background_color": "#22282c", + "icons": [ + { "purpose": "maskable", "sizes": "512x512", "src": "icon512_maskable.png", "type": "image/png" }, + { "purpose": "any", "sizes": "512x512", "src": "icon512_rounded.png", "type": "image/png" }, + { "purpose": "monochrome", "sizes": "512x512", "src": "icon512_monochrome.png", "type": "image/png" } + ], + "orientation": "any", + "display": "standalone", + "dir": "auto", + "lang": "es-UY", + "start_url": "https://catnote.netpaws.cc/", + "scope": "https://catnote.netpaws.cc/", + "name": "CatNote", + "short_name": "CatNote", + "id": "/" +}