blob: 4c4f77f8382d536beeac912d4a6a29faf2deae7d [file] [log] [blame]
Luigi Santivettied568d42020-05-18 00:53:17 +01001#!/bin/bash
2#
3# apache placeholders
4#
5# Copyright 2019 Luigi Santivetti <luigi.santivetti@gmail.com>
6
7# Permission is hereby granted, free of charge, to any person obtaining a
8# copy of this software and associated documentation files (the "Software"),
9# to deal in the Software without restriction, including without limitation
10# the rights to use, copy, modify, merge, publish, distribute, sublicense,
11# and/or sell copies of the Software, and to permit persons to whom the
12# Software is furnished to do so, subject to the following conditions:
13
14# The above copyright notice and this permission notice (including the next
15# paragraph) shall be included in all copies or substantial portions of the
16# Software.
17
18# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21# ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25_APACHE_DKRC_SERVICE_="${module}"
26_APACHE_DKRC_IMAGE_="${host_name}-img-${_APACHE_DKRC_SERVICE_}"
27_APACHE_DKRC_CONTEXT_="${mod_docker_d}"
28_APACHE_DKRC_CONTAINER_="${host_name}-con-${_APACHE_DKRC_SERVICE_}"
29_APACHE_DKRC_FRONTEND_IP_="172.28.0.2"
30_APACHE_DKRC_BACKEND_IP_="172.27.0.3"
31_APACHE_DKRC_PORTS_F_="${ports_f}"
32_APACHE_DKRC_CONF_F_="${apache2_f}"
33_APACHE_DKRC_AVAILABLE_D_="${available_d}"
34_APACHE_DKRC_ENABLED_D_="${enabled_d}"
35_APACHE_DKRC_CERT_L_="${certificates_l}"
36_APACHE_DKRC_LOG_D_="${log_d}"
37_APACHE_DKRC_WWW_D_="${www_d}"
38if [ "$apache_has_media" -eq 1 ]; then
39 _APACHE_HAS_MEDIA_="1"
40 _APACHE_HTML_PHOTOS_D_="${photos_d}"
41 _APACHE_HTML_VIDEOS_D_="${videos_d}"
42else
43 _APACHE_HAS_MEDIA_="0"
44 _APACHE_HTML_PHOTOS_D_=""
45 _APACHE_HTML_VIDEOS_D_=""
46fi
47_APACHE_DKRC_ROOTFS_="${mod_rootfs_d}"
48_APACHE_DKRC_DOCKERFILE_="Dockerfile"
49_APACHE_VHOST_HTTP_LOG_F_="/var/log/apache2/vhost-http-log.txt"
50_APACHE_SSL_LOG_F_="/var/log/apache2/vhost-https-log.txt"
51_APACHE_SSL_LOG_LEVEL_REL_="info ssl:info"
52_APACHE_SSL_LOG_LEVEL_DBG_="trace8 ssl:trace8"
53_APACHE_CON_SSL_D_="/etc/letsencrypt"
54if [ "$apache_has_dummy_certs" -eq 1 ]; then
55 _APACHE_CON_SSL_CONF_F_="${_APACHE_CON_SSL_D_}/${host_name}.conf"
56 _APACHE_CON_SSL_CERT_F_="${_APACHE_CON_SSL_D_}/${host_name}.crt"
57 _APACHE_CON_SSL_KEY_F_="${_APACHE_CON_SSL_D_}/${host_name}.key"
58else
59 _APACHE_CON_SSL_CONF_F_="${_APACHE_CON_SSL_D_}/options-ssl-apache.conf"
60 _APACHE_CON_SSL_CERT_F_="${_APACHE_CON_SSL_D_}/live/${host_name}/fullchain.pem"
61 _APACHE_CON_SSL_KEY_F_="${_APACHE_CON_SSL_D_}/live/${host_name}/privkey.pem"
62fi
63_APACHE_VHOST_GERRIT_LOG_F_="/var/log/apache2/vhost-gerrit-log.txt"
64_APACHE_VHOST_GERRIT_LOG_LEVEL_REL_="info"
65_APACHE_VHOST_GERRIT_LOG_LEVEL_DBG_="trace8"
66_APACHE_DOCUMENT_ROOT_D_="/var/www/html"
67_APACHE_PRIVATE_PATH_="/private"
68_APACHE_HTTP_PORT_="80"
69_APACHE_HTTPS_PORT_="443"
70_APACHE_GERRIT_PROXY_PORT_="8081"
71_APACHE_SERVER_NAME_="${host_name}"
72_APACHE_SERVER_ALIAS_="www.${_APACHE_SERVER_NAME_}"
73_APACHE_CON_SSL_MYSQL_D_="/etc/mysql_ssl"
74_APACHE_CON_SSL_MYSQL_CERT_F_="${_APACHE_CON_SSL_MYSQL_D_}/"
75_APACHE_CON_SSL_MYSQL_CERT_F_+="$(basename "${_MYSQL_SSL_CLIENT_CERT_F_}")"
76_APACHE_CON_SSL_MYSQL_KEY_F_="${_APACHE_CON_SSL_MYSQL_D_}/"
77_APACHE_CON_SSL_MYSQL_KEY_F_+="$(basename "${_MYSQL_SSL_CLIENT_KEY_F_}")"
78_APACHE_CON_SSL_MYSQL_CA_F_="${_APACHE_CON_SSL_MYSQL_D_}/"
79_APACHE_CON_SSL_MYSQL_CA_F_+="$(basename "${_MYSQL_SSL_CLIENT_CA_F_}")"
80_APACHE_EXT_AUTH_F_="${http_authentication_bang_f}"
81_APACHE_EXT_AUTH_KEYWORD_="bash_auth"
82_APACHE_CON_EXT_AUTH_F_="/var/www/http_authentication"
83if [ "${mod_mode}" = "${release}" ]; then
84 _APACHE_SSL_LOG_LEVEL_="${_APACHE_SSL_LOG_LEVEL_REL_}"
85 _APACHE_VHOST_GERRIT_LOG_LEVEL_="${_APACHE_VHOST_GERRIT_LOG_LEVEL_REL_}"
86 _APACHE_MOD_AUTHNZ_DEBUG_FLAG_="/dev/null"
87 _APACHE_CODE_IGNITER_ENV_="production"
88else
89 _APACHE_SSL_LOG_LEVEL_="${_APACHE_SSL_LOG_LEVEL_DBG_}"
90 _APACHE_VHOST_GERRIT_LOG_LEVEL_="${_APACHE_VHOST_GERRIT_LOG_LEVEL_DBG_}"
91 _APACHE_MOD_AUTHNZ_DEBUG_FLAG_="/dev/stderr --verbose"
92 _APACHE_CODE_IGNITER_ENV_="development"
93fi
94_APACHE_MOD_AUTHNZ_EXTERNAL_D_="$(basename "${mod_authnz_external_d}")"
95_APACHE_MOD_AUTHNZ_SUCCESS_CODE_="204"
96_APACHE_MOD_AUTHNZ_H_ACCEPT_="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
97_APACHE_MOD_AUTHNZ_H_CONTENT_="Content-Type: application/x-www-form-urlencoded"
98_APACHE_MOD_AUTHNZ_LOCALHOST_="127.0.0.1"