strip cr in paste body

This commit is contained in:
dave 2022-02-01 23:13:47 -08:00
parent 62f04809ab
commit 93de90c9c9
3 changed files with 33 additions and 37 deletions

View File

@ -1,4 +1,4 @@
FROM ubuntu:bionic FROM ubuntu:focal
RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.list && \ RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.list && \
sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list && \ sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list && \
@ -6,11 +6,11 @@ RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.
DEBIAN_FRONTEND=noninteractive \ DEBIAN_FRONTEND=noninteractive \
apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \ apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
wget gpg git build-essential && \ wget gpg git build-essential && \
wget -qO- http://artifact.scc.net.davepedu.com/repo/apt/extpython/dists/bionic/install | bash /dev/stdin && \ wget -qO- http://artifact.scc.net.davepedu.com/repo/apt/extpython/dists/focal/install | bash /dev/stdin && \
apt-get update && \ apt-get update && \
DEBIAN_FRONTEND=noninteractive \ DEBIAN_FRONTEND=noninteractive \
apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \ apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
extpython-python3.7 && \ extpython-python3.9 && \
apt-get clean autoclean && \ apt-get clean autoclean && \
apt-get autoremove -y && \ apt-get autoremove -y && \
rm -rf /var/lib/{apt,dpkg,cache,log}/ rm -rf /var/lib/{apt,dpkg,cache,log}/
@ -18,9 +18,9 @@ RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.
ADD . /tmp/code ADD . /tmp/code
RUN cd /tmp/code && \ RUN cd /tmp/code && \
/opt/extpython/3.7/bin/pip3 install -r requirements.txt && \ /opt/extpython/3.9/bin/pip3 install -r requirements.txt && \
/opt/extpython/3.7/bin/python3 setup.py install && \ /opt/extpython/3.9/bin/python3 setup.py install && \
useradd --uid 1000 app useradd --uid 1000 app
USER app USER app
ENTRYPOINT ["/opt/extpython/3.7/bin/wastebind"] ENTRYPOINT ["/opt/extpython/3.9/bin/wastebind"]

View File

@ -1,32 +1,28 @@
appdirs==1.4.3 appdirs==1.4.4
asn1crypto==0.24.0 BTrees==4.9.2
backports.functools-lru-cache==1.5 cffi==1.15.0
BTrees==4.5.1 cheroot==8.6.0
certifi==2019.3.9 CherryPy==18.6.1
cffi==1.12.3 jaraco.classes==3.2.1
chardet==3.0.4 jaraco.collections==3.5.1
cheroot==6.5.5 jaraco.context==4.1.1
CherryPy==18.1.1 jaraco.functools==3.5.0
cryptography==2.7 jaraco.text==3.7.0
idna==2.8 more-itertools==8.12.0
jaraco.functools==2.0 perfmetrics==3.2.0.post0
more-itertools==7.0.0 persistent==4.7.0
perfmetrics==2.0 portend==3.1.0
persistent==4.5.0 pycparser==2.21
portend==2.4 PyMySQL==1.0.2
pycparser==2.19 pytz==2021.3
PyMySQL==0.9.3
pytz==2019.1
-e git+https://git.davepedu.com/dave/relstorage.git@5ae138b71a0eeb740208e61cfd1662c49738ee45#egg=RelStorage -e git+https://git.davepedu.com/dave/relstorage.git@5ae138b71a0eeb740208e61cfd1662c49738ee45#egg=RelStorage
requests==2.22.0 six==1.16.0
six==1.12.0 tempora==5.0.1
tempora==1.14.1 transaction==3.0.1
transaction==2.4.0 zc.lockfile==2.0
urllib3==1.25.3 ZConfig==3.6.0
zc.lockfile==1.4
ZConfig==3.4.0
zdaemon==4.3 zdaemon==4.3
ZEO==5.2.1 ZEO==5.2.3
ZODB==5.5.1 ZODB==5.6.0
zodbpickle==1.0.3 zodbpickle==2.2.0
zope.interface==4.6.0 zope.interface==5.4.0

View File

@ -119,7 +119,7 @@ class WasteWeb(object):
def make(self, name, contents): def make(self, name, contents):
if not RE_NAME.match(name): if not RE_NAME.match(name):
raise cherrypy.HTTPError(400, f"paste name must match {RE_NAME_RAW}") raise cherrypy.HTTPError(400, f"paste name must match {RE_NAME_RAW}")
self.db.writepaste(name, contents) self.db.writepaste(name, contents.replace("\r", ""))
raise cherrypy.HTTPRedirect("/" + name) raise cherrypy.HTTPRedirect("/" + name)
@cherrypy.expose @cherrypy.expose