[damned-lies/oscp-testing] chore: update image based on fedora 34
- From: Guillaume Bernard <gbernard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies/oscp-testing] chore: update image based on fedora 34
- Date: Mon, 25 Apr 2022 16:20:45 +0000 (UTC)
commit af9077fdf2ef8a6f4174bf15c6f293ea3b4d1011
Author: Guillaume Bernard <contact guillaume-bernard fr>
Date: Mon Apr 25 18:20:02 2022 +0200
chore: update image based on fedora 34
Dockerfile | 39 ++++++++++++++++---------------
local_settings.py | 68 +++++++++++++++++++++++++++++--------------------------
2 files changed, 55 insertions(+), 52 deletions(-)
---
diff --git a/Dockerfile b/Dockerfile
index 3f43e876..9924fae6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,38 +1,37 @@
-FROM centos/s2i-base-centos8
+FROM fedora:34
+ENV USER=l10n
USER root
-RUN INSTALL_PKGS="python39 python39-devel python39-setuptools python39-pip python39-mod_wsgi python39-lxml \
+
+RUN INSTALL_PKGS="python python-devel python-setuptools python-pip python-lxml mod_wsgi \
httpd httpd-devel mod_ldap mod_session \
atlas-devel gcc-c++ gcc-gfortran libffi-devel libtool-ltdl enchant wget git \
gettext gnome-doc-utils intltool itstool libicu-devel mariadb-devel subversion yelp-tools \
automake autoconf make diffutils glibc-langpack-en" && \
- yum update -y && \
- yum install -y epel-release && \
- yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
- yum -y clean all --enablerepo='*'
+ dnf update -y && \
+ dnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
+ dnf -y clean all --enablerepo="*"
RUN sed -ri ' s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g;'
/etc/httpd/conf/httpd.conf && \
+ sed -i 's/Listen\ 80/Listen\ 8080/' /etc/httpd/conf/httpd.conf && \
rm -f /etc/httpd/conf.d/mod_security.conf
-RUN sed -i 's/Listen\ 80/Listen\ 8080/' /etc/httpd/conf/httpd.conf
+RUN groupadd "${USER}" -g 1000660000 && \
+ useradd "${USER}" -g 1000660000 -u 1000660000 -G apache -r -l -m && \
+ chown "${USER}":"${USER}" /var/run/httpd
+
+RUN mkdir -p /l10n && \
+ git clone --depth 1 --branch master --single-branch
https://gitlab.gnome.org/Infrastructure/damned-lies.git /l10n/damnedlies
-RUN groupadd l10n -g 1000660000 && \
- useradd l10n -g 1000660000 -u 1000660000 -G apache -r -l -m && \
- chown l10n:l10n /var/run/httpd && \
- mkdir -p /l10n && \
- git clone --depth 1 --branch develop --single-branch
https://gitlab.gnome.org/Infrastructure/damned-lies.git /l10n/damnedlies
ADD local_settings.py /l10n/damnedlies/damnedlies/local_settings.py
-ADD l10n-testing.openshift.gnome.org.conf /etc/httpd/conf.d/l10n-testing.openshift.gnome.org.conf
-RUN chown -R l10n:l10n /l10n
+ADD l10n*.gnome.org.conf /etc/httpd/conf.d/l10n.gnome.org.conf
+ADD entrypoint.sh /entrypoint.sh
-RUN ln -s /usr/lib64/python3.6/site-packages/libxml2.py /usr/lib64/python3.9/site-packages/libxml2.py && \
- ln -s /usr/lib64/python3.6/site-packages/drv_libxml2.py
/usr/lib64/python3.9/site-packages/drv_libxml2.py && \
- ln -s /usr/lib64/python3.6/site-packages/libxml2mod.so /usr/lib64/python3.9/site-packages/libxml2mod.so
+RUN chown -R "${USER}":"${USER}" /l10n && chown -R "${USER}":"${USER}" /etc/httpd && chmod o+rx
/entrypoint.sh
USER l10n
+
WORKDIR /l10n/damnedlies
-RUN python3.9 -m venv /l10n/venv && \
- /l10n/venv/bin/pip install -r requirements.txt
+RUN python3 -m venv /l10n/venv && /l10n/venv/bin/pip install -r requirements.txt
-ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/local_settings.py b/local_settings.py
index 7d4d6558..bbe51979 100644
--- a/local_settings.py
+++ b/local_settings.py
@@ -1,59 +1,63 @@
import os
+from pathlib import Path
DEBUG = True
STATIC_SERVE = False
USE_DJANGO_OPENID = False
-ADMINS = (
- ('Andrea Veri', 'av gnome org'),
- #('Claude Paroz', 'claude 2xlibre net'),
-)
+ADMINS = (("Andrea Veri", "av gnome org"),)
MANAGERS = ADMINS
DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.mysql',
- 'NAME' : '$DB_NAME',
- 'USER' : '$DB_USER',
- 'PASSWORD': '$DB_PASSWORD',
- 'HOST' : '$DB_HOST',
- 'PORT' : '$DB_PORT',
- 'CONN_MAX_AGE': 300,
- 'OPTIONS': {
- 'charset': 'utf8mb4',
- }
+ "default": {
+ "ENGINE": "django.db.backends.mysql",
+ "NAME": "$DB_NAME",
+ "USER": "$DB_USER",
+ "PASSWORD": "$DB_PASSWORD",
+ "HOST": "$DB_HOST",
+ "PORT": "$DB_PORT",
+ "CONN_MAX_AGE": 300,
+ "OPTIONS": {
+ "charset": "utf8mb4",
+ },
}
}
-SECRET_KEY = '$SECRET_KEY'
-ALLOWED_HOSTS=['l10n-testing.openshift.gnome.org', '8.43.85.13', '8.43.85.14', '8.43.85.29']
+SECRET_KEY = "$SECRET_KEY"
+ALLOWED_HOSTS = [
+ "l10n.gnome.org",
+ "l10n-testing.openshift.gnome.org",
+ "8.43.85.13",
+ "8.43.85.14",
+ "8.43.85.29",
+ "127.0.0.1",
+ "localhost",
+]
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
-EMAIL_HOST = 'smtp-int.gnome.org'
-EMAIL_SUBJECT_PREFIX = '[DL]'
-DEFAULT_FROM_EMAIL = 'noreply gnome org'
-SERVER_EMAIL = 'gnomeweb gnome org'
+EMAIL_HOST = "smtp-int.gnome.org"
+EMAIL_SUBJECT_PREFIX = "[DL]"
+DEFAULT_FROM_EMAIL = "noreply gnome org"
+SERVER_EMAIL = "gnomeweb gnome org"
-TIME_ZONE = 'UTC'
+TIME_ZONE = "UTC"
+
+DATADIR = Path("/var/www/djamnedlies/data/")
+MEDIA_ROOT = DATADIR / "media"
-MEDIA_ROOT = '/var/www/djamnedlies/data/media'
# Local directory path for VCS checkout
-SCRATCHDIR = "/var/www/djamnedlies/data/scratchdir"
-POTDIR = os.path.join(SCRATCHDIR, "POT")
-LOCK_DIR = '/var/www/djamnedlies/data/locks'
+SCRATCHDIR = DATADIR / "scratchdir"
+POTDIR = SCRATCHDIR / "POT"
+LOCK_DIR = DATADIR / "locks"
ADMIN_GROUP = "coordination_team"
-UPLOAD_ARCHIVED_DIR = 'upload-backup'
+UPLOAD_ARCHIVED_DIR = "upload-backup"
FILE_UPLOAD_PERMISSIONS = 0o644
-#ITSTOOL_PATH = '/usr/local/www/gnomeweb/local/bin/'
-
# Sentry configuration (needs pip install raven)
-RAVEN_CONFIG = {
- "dsn": "$SENTRY_DSN"
-}
+RAVEN_CONFIG = {"dsn": "$SENTRY_DSN"}
GITLAB_TOKEN = "$GITLAB_TOKEN"
VCS_HOME_REGEX = "gitlab\.gnome\.org"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]