Migrate anitya to apache

This commit is contained in:
Michal Konečný 2018-11-29 12:26:55 +01:00
parent 3f31d643ff
commit ee5d0e1bcb
3 changed files with 78 additions and 2 deletions

View file

@ -17,6 +17,7 @@ items:
license="MIT" license="MIT"
RUN dnf install -y --enablerepo=updates-testing \ RUN dnf install -y --enablerepo=updates-testing \
git \ git \
httpd \
graphviz \ graphviz \
python3-alembic \ python3-alembic \
python3-blinker \ python3-blinker \
@ -27,7 +28,6 @@ items:
python3-flask-login \ python3-flask-login \
python3-flask-restful \ python3-flask-restful \
python3-flask-openid \ python3-flask-openid \
python3-gunicorn \
python3-openid \ python3-openid \
python3-pip \ python3-pip \
python3-psycopg2 \ python3-psycopg2 \
@ -62,7 +62,6 @@ items:
RUN ln -sf /etc/pki/fedmsg/crt/fedmsg-release-monitoring.crt /etc/pki/fedmsg/release-monitoring.crt RUN ln -sf /etc/pki/fedmsg/crt/fedmsg-release-monitoring.crt /etc/pki/fedmsg/release-monitoring.crt
EXPOSE 8080 EXPOSE 8080
EXPOSE 9940 EXPOSE 9940
ENTRYPOINT gunicorn --bind 0.0.0.0:8080 --access-logfile=- anitya.wsgi:application
type: Dockerfile type: Dockerfile
strategy: strategy:
type: Docker type: Docker

View file

@ -40,6 +40,10 @@ items:
containers: containers:
- name: release-monitoring-web - name: release-monitoring-web
image: release-monitoring/release-monitoring-web:latest image: release-monitoring/release-monitoring-web:latest
command:
- bash
args:
- /etc/anitya/start.sh
env: env:
- name: USER - name: USER
value: anitya value: anitya

View file

@ -138,6 +138,79 @@ items:
[formatter_generic] [formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S datefmt = %H:%M:%S
start.sh: |-
mkdir /httpdir/run
ln -s /etc/httpd/modules /httpdir/modules
truncate --size=0 /httpdir/accesslog /httpdir/errorlog
tail -qf /httpdir/accesslog /httpdir/errorlog &
exec httpd -f /etc/anitya/httpd.conf -DFOREGROUND -DNO_DETACH
httpd.conf: |-
Listen 0.0.0.0:8080
ServerRoot "/httpdir"
PidFile "/httpdir/httpd.pid"
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule mime_module modules/mod_mime.so
LoadModule status_module modules/mod_status.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule version_module modules/mod_version.so
LoadModule wsgi_module modules/mod_wsgi_python3.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule mpm_event_module modules/mod_mpm_event.so
StartServers 20
ServerLimit 100
MaxRequestsPerChild 2000
MaxRequestWorkers 100
<Directory "/usr/local/lib/python3.7/anitya/static/docs/html/">
AllowOverride None
Require all granted
</Directory>
<Directory "/usr/local/lib/python3.7/site-packages/anitya/static/">
AllowOverride None
Require all granted
</Directory>
<Location />
Require all granted
</Location>
<Location /docs/>
Header set Cache-Control public
ExpiresDefault "access plus 1 month"
Header unset ETag
</Location>
<Location /static/>
Header set Cache-Control public
ExpiresDefault "access plus 1 month"
Header unset ETag
</Location>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /httpdir/accesslog combined
ErrorLog /httpdir/errorlog
LogLevel info
TypesConfig /etc/mime.types
AddDefaultCharset UTF-8
CoreDumpDirectory /tmp
Alias /docs /usr/local/lib/python3.7/anitya/static/docs/html/
Alias /static /usr/local/lib/python3.7/site-packages/anitya/static/
WSGIDaemonProcess anitya display-name=anitya processes=2 threads=2 maximum-requests=1000 home=/httpdir
WSGIApplicationGroup %{GLOBAL}
WSGISocketPrefix run/wsgi
WSGIRestrictStdout Off
WSGIRestrictSignal Off
WSGIPythonOptimize 1
WSGIScriptAlias / /usr/share/anitya/anitya.wsgi
- apiVersion: v1 - apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata: