grim/hgkeeper

Parents e86ba80834b8
Children 410414a1fbe7
Make the default hgkeeper theme the default theme and move everything to python3
--- a/Dockerfile Mon Apr 13 22:45:44 2020 -0500
+++ b/Dockerfile Mon Apr 13 23:14:50 2020 -0500
@@ -10,15 +10,18 @@
FROM debian:buster-slim
+ENV HGKEEPER_THEME_URL=https://keep.imfreedom.org/grim/hgkeeper-theme/archive/default.tar.gz
+
RUN set -ex && \
apt-get update && \
apt-get install -y --no-install-recommends \
- python libpython-dev python-pip python-setuptools build-essential \
- openssh-client nvi procps \
+ python3 libpython3-dev python3-pip python3-setuptools build-essential \
+ openssh-client libffi6 libffi-dev nvi procps wget \
&& \
- pip install --no-binary :all: mercurial hg-evolve && \
+ pip3 install --no-binary :all: mercurial hg-evolve hgwebplus && \
apt-get remove -y --purge \
- libpython2.7-dev python-pip python-setuptools build-essential \
+ libpython3-dev python3-pip python3-setuptools build-essential \
+ libffi-dev \
&& \
apt-get autoremove --purge -y && \
apt-get clean && \
@@ -28,12 +31,21 @@
groupadd -g 22271 hg && \
useradd -m -d /var/lib/hg -u 22271 -g hg hg
+# install the hgkeeper theme
RUN set -ex && \
- mkdir -p /etc/mercurial && \
- printf "[extensions]\nhgext3rd.evolve=\n" > /etc/mercurial/hgrc
+ cd /tmp && \
+ wget -O - "${HGKEEPER_THEME_URL}" | tar zx && \
+ HGINST=$(python3 -c 'import mercurial; print(mercurial.__path__[0])') && \
+ cp -a /tmp/hgkeeper-theme-default/templates/hgkeeper/ $HGINST/templates/ && \
+ cp -a /tmp/hgkeeper-theme-default/templates/static/hgk/ $HGINST/templates/static/ && \
+ rm -rf /tmp/hgkeeper-theme-default
+
+# setup the global mercurial configuration
+COPY hgrc /etc/mercurial/hgrc
COPY --from=build /root/hgkeeper /usr/local/bin/hgkeeper
USER hg
CMD ["hgkeeper", "serve"]
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hgrc Mon Apr 13 23:14:50 2020 -0500
@@ -0,0 +1,7 @@
+[extensions]
+hgext3rd.evolve =
+hgext3rd.hgwebplus =
+
+[web]
+style = hgkeeper
+
--- a/hgweb/files/hgweb.cgi Mon Apr 13 22:45:44 2020 -0500
+++ b/hgweb/files/hgweb.cgi Mon Apr 13 23:14:50 2020 -0500
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
-config = '{{.HGWEB_CONFIG}}'
+#!/usr/bin/env python3
+config = b'{{.HGWEB_CONFIG}}'
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi