Skip to content

Commit

Permalink
web fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stamepicmorg committed Dec 12, 2024
1 parent ec2a1ea commit 69fe756
Show file tree
Hide file tree
Showing 276 changed files with 9,594 additions and 7,122 deletions.
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,6 @@ ecosystem-testrail-images:
cd `pwd`/linux/ecosystem/testrail/7.5.3.1000/main && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.0.1089/main && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.1.1029/main && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.1.1030/main && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.1.1033/main && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.4.7036/main && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.6.1019/main && pwd && make build && make deploy

Expand Down Expand Up @@ -947,8 +945,6 @@ ecosystem-testrail-images:
cd `pwd`/linux/ecosystem/testrail/7.5.3.1000/ad && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.0.1089/ad && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.1.1029/ad && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.1.1030/ad && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.1.1033/ad && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.4.7036/ad && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.6.1019/ad && pwd && make build && make deploy

Expand Down Expand Up @@ -1012,12 +1008,9 @@ ecosystem-testrail-images:
cd `pwd`/linux/ecosystem/testrail/7.5.3.1000/ldap && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.0.1089/ldap && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.1.1029/ldap && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.1.1030/ldap && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.1.1033/ldap && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.4.7036/ldap && pwd && make build && make deploy
cd `pwd`/linux/ecosystem/testrail/8.0.6.1019/ldap && pwd && make build && make deploy


ecosystem-torrserver-images:
cd `pwd`/linux/ecosystem/torrserver && pwd && make build && make deploy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,79 @@

echo "[testrail] Welcome to Testrail {{item}} with Active Directory plugin"

echo "[testrail] Starting Testrail service"

##################################################################################
echo "[testrail] Starting testrail service"

#################################################################################
# Function for creating directories with rights for www-data
function createOptDirectory {
if [ ! -d $1 ]
then
echo "[testrail] Creating " $1
mkdir -p $1
if [ ! -d "$1" ]; then
echo "[testrail] Creating $1"
mkdir -p "$1"
fi

chown -R www-data:www-data $1
chown -R www-data:www-data "$1"
}

/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf

echo "[testrail] Unzipping testrail service"
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
#################################################################################
# Copy Apache Configuration
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"

echo "[testrail] Unzipping testrail Active Directory auth plugin"
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
#################################################################################
# Unpacking TestRail
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
echo "[testrail] Unzipping testrail service"
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
echo "[testrail] Testrail extracted"
else
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
exit 1
fi

createOptDirectory ${TR_DEFAULT_LOG_DIR}
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
#################################################################################
# Creating the necessary directories
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"

chown -R www-data:www-data ${TR_CONFIG_DIR}
chown -R www-data:www-data "${TR_CONFIG_DIR}"
chown -R www-data:www-data "${TR_CONFIGPATH}"

#################################################################################

# Waiting for task.php file to appear
TASK_FILE="/var/www/testrail/task.php"
echo "[testrail] Waiting for background task file"
while [ ! -f /var/www/testrail/task.php ]
do
sleep 2
while [ ! -f "$TASK_FILE" ]; do
sleep 2
done

echo "[testrail] Starting background task"
# Removing the memory limit for executing a PHP task
while /bin/true; do
php /var/www/testrail/task.php || true
sleep ${TR_DEFAULT_TASK_EXECUTION}
php -d memory_limit=-1 "$TASK_FILE" || true
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
done &
echo "[testrail] Background task stoped"

#################################################################################
echo "[testrail] Background task started"

#################################################################################
# Processing the FIX_WWW_DATA environment variable
if [[ -z "${FIX_WWW_DATA}" ]]; then
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
chown www-data:www-data /var/www -R
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
chown www-data:www-data /var/www -R
elif [ "${FIX_WWW_DATA}" == "false" ]; then
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
elif [ "${FIX_WWW_DATA}" == "true" ]; then
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
chown www-data:www-data /var/www -R
echo "[apache2] Done"
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
elif [ "${FIX_WWW_DATA}" == "true" ]; then
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
chown www-data:www-data /var/www -R
echo "[apache2] Done"
else
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
fi

#################################################################################
# Starting Apache
echo "[apache2] Starting up"

source /etc/apache2/envvars
tail -F /var/log/apache2/* &
exec apache2 -D FOREGROUND
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}} with LDAP plugin"
echo "[testrail] Starting testrail service"

#################################################################################

# Function for creating directories with rights for www-data
function createOptDirectory {
if [ ! -d $1 ]
then
echo "[testrail] Creating " $1
mkdir -p $1
if [ ! -d "$1" ]; then
echo "[testrail] Creating $1"
mkdir -p "$1"
fi

chown -R www-data:www-data $1
chown -R www-data:www-data "$1"
}

/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf

echo "[testrail] Unzipping testrail service"
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
#################################################################################
# Copy Apache Configuration
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"

echo "[testrail] Unzipping testrail LDAP auth plugin"
unzip -q -o -j ${TESTRAIL_RELEASE_DIR}/${TESTRAIL_PLUGIN_FILE} ${TESTRAIL_PLUGIN_FULLNAME}/auth.php -d ${TR_CUSTOM_AUTH_DIR}
#################################################################################
# Unpacking TestRail
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
echo "[testrail] Unzipping testrail service"
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
echo "[testrail] Testrail extracted"
else
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
exit 1
fi

createOptDirectory ${TR_DEFAULT_LOG_DIR}
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
#################################################################################
# Creating the necessary directories
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"

chown -R www-data:www-data ${TR_CONFIG_DIR}
chown -R www-data:www-data "${TR_CONFIG_DIR}"
chown -R www-data:www-data "${TR_CONFIGPATH}"

#################################################################################

# Waiting for task.php file to appear
TASK_FILE="/var/www/testrail/task.php"
echo "[testrail] Waiting for background task file"
while [ ! -f /var/www/testrail/task.php ]
do
sleep 2
while [ ! -f "$TASK_FILE" ]; do
sleep 2
done

echo "[testrail] Starting background task"
# Removing the memory limit for executing a PHP task
while /bin/true; do
php /var/www/testrail/task.php || true
sleep ${TR_DEFAULT_TASK_EXECUTION}
php -d memory_limit=-1 "$TASK_FILE" || true
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
done &
echo "[testrail] Background task stoped"

#################################################################################
echo "[testrail] Background task started"

#################################################################################
# Processing the FIX_WWW_DATA environment variable
if [[ -z "${FIX_WWW_DATA}" ]]; then
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
chown www-data:www-data /var/www -R
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
chown www-data:www-data /var/www -R
elif [ "${FIX_WWW_DATA}" == "false" ]; then
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
elif [ "${FIX_WWW_DATA}" == "true" ]; then
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
chown www-data:www-data /var/www -R
echo "[apache2] Done"
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
elif [ "${FIX_WWW_DATA}" == "true" ]; then
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
chown www-data:www-data /var/www -R
echo "[apache2] Done"
else
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
fi

#################################################################################
# Starting Apache
echo "[apache2] Starting up"

source /etc/apache2/envvars
tail -F /var/log/apache2/* &
exec apache2 -D FOREGROUND
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM epicmorg/apache2:php7.0
##############################################################################


ARG TESTRAIL_VERSION={{ item }}
ENV TESTRAIL_VERSION={{ item }}
ARG DOWNLOAD_URL=https://secure.testrail.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion70.zip

ENV TR_DEFAULT_TASK_EXECUTION=60
Expand All @@ -31,14 +31,14 @@ ENV OPENSSL_CONF=/etc/ssl/

RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf

ADD ${DOWNLOAD_URL} ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip
RUN echo "[testrail] Preparing folders" && \
mkdir -p ${TESTRAIL_RELEASE_DIR} && \
mkdir -p ${TR_WWW_PATH} && \
mkdir -p ${TR_DEFAULT_ATTACHMENT_DIR} ${TR_DEFAULT_REPORT_DIR} ${TR_DEFAULT_AUDIT_DIR} ${TR_DEFAULT_LOG_DIR} && \
echo "[testrail] Downloading and installing" && \
wget --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" --no-check-certificate -O ${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
chown -R www-data:www-data ${TESTRAIL_RELEASE_DIR} && \
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/ && \
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip -d /var/www/ && \
chown -R www-data:www-data ${TR_WWW_PATH} && \
ls -las ${TR_WWW_PATH} && \
chown -R www-data:www-data ${TR_OPT_PATH} && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,63 +5,76 @@ echo "[testrail] Welcome to Testrail {{item}}"
echo "[testrail] Starting testrail service"

#################################################################################

# Function for creating directories with rights for www-data
function createOptDirectory {
if [ ! -d $1 ]
then
echo "[testrail] Creating " $1
mkdir -p $1
if [ ! -d "$1" ]; then
echo "[testrail] Creating $1"
mkdir -p "$1"
fi

chown -R www-data:www-data $1
chown -R www-data:www-data "$1"
}

/bin/cp -rf ${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
#################################################################################
# Copy Apache Configuration
/bin/cp -rf "${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf" "/etc/apache2/sites-enabled/000-default.conf"

echo "[testrail] Unzipping testrail service"
unzip -q -o ${TESTRAIL_RELEASE_DIR}/testrail.zip -d /var/www/
echo "[testrail] Testrail extracted"
#################################################################################
# Unpacking TestRail
if [ -f "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" ]; then
echo "[testrail] Unzipping testrail service"
unzip -q -o "${TESTRAIL_RELEASE_DIR}/testrail-${TESTRAIL_VERSION}-ion70.zip" -d /var/www/
echo "[testrail] Testrail extracted"
else
echo "[testrail] Error: testrail-${TESTRAIL_VERSION}-ion70.zip not found in ${TESTRAIL_RELEASE_DIR}"
exit 1
fi

createOptDirectory ${TR_DEFAULT_LOG_DIR}
createOptDirectory ${TR_DEFAULT_AUDIT_DIR}
createOptDirectory ${TR_DEFAULT_REPORT_DIR}
createOptDirectory ${TR_DEFAULT_ATTACHMENT_DIR}
#################################################################################
# Creating the necessary directories
createOptDirectory "${TR_DEFAULT_LOG_DIR}"
createOptDirectory "${TR_DEFAULT_AUDIT_DIR}"
createOptDirectory "${TR_DEFAULT_REPORT_DIR}"
createOptDirectory "${TR_DEFAULT_ATTACHMENT_DIR}"

chown -R www-data:www-data ${TR_CONFIG_DIR}
chown -R www-data:www-data ${TR_CONFIGPATH}
chown -R www-data:www-data "${TR_CONFIG_DIR}"
chown -R www-data:www-data "${TR_CONFIGPATH}"

#################################################################################

# Waiting for task.php file to appear
TASK_FILE="/var/www/testrail/task.php"
echo "[testrail] Waiting for background task file"
while [ ! -f /var/www/testrail/task.php ]
do
sleep 2
while [ ! -f "$TASK_FILE" ]; do
sleep 2
done

echo "[testrail] Starting background task"
# Removing the memory limit for executing a PHP task
while /bin/true; do
php /var/www/testrail/task.php || true
sleep ${TR_DEFAULT_TASK_EXECUTION}
php -d memory_limit=-1 "$TASK_FILE" || true
sleep "${TR_DEFAULT_TASK_EXECUTION:-60}"
done &
echo "[testrail] Background task stoped"

#################################################################################
echo "[testrail] Background task started"

#################################################################################
# Processing the FIX_WWW_DATA environment variable
if [[ -z "${FIX_WWW_DATA}" ]]; then
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
chown www-data:www-data /var/www -R
echo "[apache2] env FIX_WWW_DATA is not set. Fixing permissions anyway"
chown www-data:www-data /var/www -R
elif [ "${FIX_WWW_DATA}" == "false" ]; then
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
elif [ "${FIX_WWW_DATA}" == "true" ]; then
echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait."
chown www-data:www-data /var/www -R
echo "[apache2] Done"
echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..."
elif [ "${FIX_WWW_DATA}" == "true" ]; then
echo "[apache2] Changing permissions for /var/www path. Don't worry, please wait."
chown www-data:www-data /var/www -R
echo "[apache2] Done"
else
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..."
fi

#################################################################################
# Starting Apache
echo "[apache2] Starting up"

source /etc/apache2/envvars
tail -F /var/log/apache2/* &
exec apache2 -D FOREGROUND
Loading

0 comments on commit 69fe756

Please sign in to comment.