[planet-web/oscp] Force en_US.utf-8 on the container + land the missing encoding now that parseFragment supports it
- From: Andrea Veri <averi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [planet-web/oscp] Force en_US.utf-8 on the container + land the missing encoding now that parseFragment supports it
- Date: Wed, 20 Jan 2021 18:22:49 +0000 (UTC)
commit adbe3ec33681b5053a61004d907b59362bbb9435
Author: Andrea Veri <averi redhat com>
Date: Wed Jan 20 19:22:13 2021 +0100
Force en_US.utf-8 on the container + land the missing encoding now that parseFragment supports it
Dockerfile | 12 ++++++++++--
patches/01_land_required_encoding.patch | 12 ++++++++++++
2 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/Dockerfile b/Dockerfile
index b90d02ae..8012a7ed 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,9 +2,15 @@ FROM debian:10-slim
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
- apt-get install -y --no-install-recommends planet-venus git nginx-light xsltproc patch && \
+ apt-get install -y --no-install-recommends planet-venus git nginx-light xsltproc patch locales && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
+ dpkg-reconfigure --frontend=noninteractive locales && \
+ update-locale LANG=en_US.UTF-8
+
+ENV LANG en_US.UTF-8
+
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
@@ -15,8 +21,10 @@ RUN groupadd planet -g 1000510000 && useradd planet -g 1000510000 -u 1000510000
chown -R 1000510000:100051000 /planet
COPY patches/00_override_encoding_to_encoding.patch /planet/00_override_encoding_to_encoding.patch
+COPY patches/01_land_required_encoding.patch /planet/01_land_required_encoding.patch
RUN cd /usr/lib/python2.7/dist-packages/planet && patch -p0 < /planet/00_override_encoding_to_encoding.patch
&& \
- rm /planet/00_override_encoding_to_encoding.patch
+ patch -p0 < /planet/01_land_required_encoding.patch && \
+ rm /planet/00_override_encoding_to_encoding.patch /planet/01_land_required_encoding.patch
RUN mkdir -p /var/cache/planet-venus/theme/common && \
cp -r /usr/share/planet-venus/theme/common/* /var/cache/planet-venus/theme/common/ && \
diff --git a/patches/01_land_required_encoding.patch b/patches/01_land_required_encoding.patch
new file mode 100644
index 00000000..3d4d7626
--- /dev/null
+++ b/patches/01_land_required_encoding.patch
@@ -0,0 +1,12 @@
+--- ./scrub.py.orig 2021-01-20 18:20:05.896444525 +0000
++++ ./scrub.py 2021-01-20 18:17:51.848544932 +0000
+@@ -141,7 +141,7 @@
+ if not doc:
+ from html5lib import html5parser, treebuilders
+ p=html5parser.HTMLParser(tree=treebuilders.getTreeBuilder('dom'))
+- doc = p.parseFragment(node['value'])
++ doc = p.parseFragment(node['value'], encoding='utf-8')
+
+ from html5lib import treewalkers, serializer
+ walker = treewalkers.getTreeWalker('dom')(doc)
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]