mirror of
https://codeberg.org/pluja/kycnot.me
synced 2025-08-07 22:13:12 -04:00
Improve donations page
This commit is contained in:
parent
5390772be8
commit
2a6a42f2d6
3 changed files with 10 additions and 18 deletions
17
Dockerfile
17
Dockerfile
|
@ -1,18 +1,13 @@
|
||||||
FROM python:3-alpine AS base
|
FROM python:3-alpine AS base
|
||||||
# Image to Build Dependencies
|
# Image to Build Dependencies
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY ./requirements.txt /app
|
COPY ./requirements.txt /app
|
||||||
|
|
||||||
# Build Dependencies
|
# Build Dependencies
|
||||||
RUN apk update \
|
RUN apk update
|
||||||
&& apk add --virtual build-deps gcc python3-dev musl-dev \
|
RUN apk add musl-dev musl-dev g++ gcc make python3-dev build-base
|
||||||
&& apk --no-cache add musl-dev libffi-dev openssl-dev libxml2-dev libxslt-dev file llvm-dev make g++ \
|
RUN apk add libffi-dev openssl-dev libxml2-dev libxslt-dev file llvm-dev
|
||||||
&& apk add jpeg-dev zlib-dev libjpeg \
|
RUN apk add jpeg-dev zlib-dev libjpeg
|
||||||
&& pip install Pillow \
|
|
||||||
&& apk del build-deps
|
|
||||||
|
|
||||||
# Python Dependencies
|
# Python Dependencies
|
||||||
RUN pip install --no-cache-dir --prefix=/install gunicorn
|
RUN pip install --no-cache-dir --prefix=/install gunicorn
|
||||||
|
@ -20,13 +15,11 @@ RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
|
||||||
|
|
||||||
# Runtime Environment Image
|
# Runtime Environment Image
|
||||||
FROM base
|
FROM base
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Runtime Dependencies
|
# Runtime Dependencies
|
||||||
RUN apk --no-cache add libxml2 libxslt
|
RUN apk --no-cache add libxml2 libxslt
|
||||||
COPY --from=builder /install /usr/local
|
COPY --from=builder /install /usr/local
|
||||||
COPY . /app/
|
COPY . /app/
|
||||||
|
|
||||||
EXPOSE 1337
|
EXPOSE 1337
|
||||||
CMD gunicorn kycnot:app --bind 0.0.0.0:1337 --worker-class sanic.worker.GunicornWorker
|
CMD gunicorn kycnot:app --bind 0.0.0.0:1337 --worker-class sanic.worker.GunicornWorker
|
|
@ -13,7 +13,7 @@ from random import randrange
|
||||||
import ruamel.yaml
|
import ruamel.yaml
|
||||||
import datetime
|
import datetime
|
||||||
import os.path
|
import os.path
|
||||||
import qrcode
|
#import qrcode
|
||||||
import httpx
|
import httpx
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -62,7 +62,7 @@ async def about(request):
|
||||||
r = httpx.get(
|
r = httpx.get(
|
||||||
"https://codeberg.org/schylza/schylza/raw/branch/main/SUPPORT.md")
|
"https://codeberg.org/schylza/schylza/raw/branch/main/SUPPORT.md")
|
||||||
donations = yaml.load(r.content)
|
donations = yaml.load(r.content)
|
||||||
await generate_donations_qrcodes(donations)
|
#await generate_donations_qrcodes(donations)
|
||||||
return html(template.render(date=date, title="KYC? Not me!",
|
return html(template.render(date=date, title="KYC? Not me!",
|
||||||
subtitle="About KYCNOT.ME",
|
subtitle="About KYCNOT.ME",
|
||||||
support=donations))
|
support=donations))
|
||||||
|
@ -165,6 +165,7 @@ async def gns(request):
|
||||||
return text('POST request - {}'.format(request.json))
|
return text('POST request - {}'.format(request.json))
|
||||||
return(html(template.render()))
|
return(html(template.render()))
|
||||||
|
|
||||||
|
'''
|
||||||
async def generate_donations_qrcodes(donations):
|
async def generate_donations_qrcodes(donations):
|
||||||
qr = qrcode.QRCode()
|
qr = qrcode.QRCode()
|
||||||
qr.add_data(donations['xmr'])
|
qr.add_data(donations['xmr'])
|
||||||
|
@ -184,6 +185,7 @@ async def generate_donations_qrcodes(donations):
|
||||||
xmr.save("static/img/qrcodes/xmr.png")
|
xmr.save("static/img/qrcodes/xmr.png")
|
||||||
btc.save("static/img/qrcodes/btc.png")
|
btc.save("static/img/qrcodes/btc.png")
|
||||||
nano.save("static/img/qrcodes/nano.png")
|
nano.save("static/img/qrcodes/nano.png")
|
||||||
|
'''
|
||||||
|
|
||||||
async def get_trustpilot_info(service):
|
async def get_trustpilot_info(service):
|
||||||
r = httpx.get(
|
r = httpx.get(
|
||||||
|
|
|
@ -17,11 +17,8 @@ lazy-object-proxy==1.6.0
|
||||||
MarkupSafe==2.0.1
|
MarkupSafe==2.0.1
|
||||||
mccabe==0.6.1
|
mccabe==0.6.1
|
||||||
multidict==5.1.0
|
multidict==5.1.0
|
||||||
petname==2.6
|
|
||||||
Pillow==8.3.2
|
|
||||||
pylint==2.8.3
|
pylint==2.8.3
|
||||||
PyYAML==5.4.1
|
PyYAML==5.4.1
|
||||||
qrcode==7.3
|
|
||||||
rfc3986==1.5.0
|
rfc3986==1.5.0
|
||||||
ruamel.appconfig==0.5.5
|
ruamel.appconfig==0.5.5
|
||||||
ruamel.std.argparse==0.8.3
|
ruamel.std.argparse==0.8.3
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue