Skip to content

Commit

Permalink
Release 1.15.62 - See CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tiredofit committed Sep 27, 2022
1 parent 512b007 commit 7442749
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.15.62 2022-09-27 <dave at tiredofit dot ca>

### Added
- Add `APP_PROXY` support as introduced in Freescout 1.8.25
- Freescout 1.8.28


## 1.15.61 2022-09-22 <dave at tiredofit dot ca>

### Added
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Be sure to view the following repositories to understand all the customizable op
| `ADMIN_LAST_NAME` | Admin user First Name | `User` |
| `ADMIN_PASS` | Administrator Password - Needed for Logging in | |
| `APPLICATION_NAME` | Change default application name - Default `Freescout` | `freescout` |
| `APP_PROXY` | Allow Application to use a proxy for fetching modules | |
| `DB_HOST` | Host or container name of MariaDB Server e.g. `freescout-db` | |
| `DB_PORT` | MariaDB Port | `3306` |
| `DB_NAME` | MariaDB Database name e.g. `freescout` | |
Expand Down
30 changes: 20 additions & 10 deletions install/etc/cont-init.d/30-freescout
Original file line number Diff line number Diff line change
Expand Up @@ -83,31 +83,30 @@ sed -i "s#'name' => '.*',#'name' => '${APPLICATION_NAME}',#g" "${NGINX_WEBROOT}"

### Dynamically Create Configuration
if grep -q "APP_URL" "${NGINX_WEBROOT}"/.env > /dev/null 2>&1; then
if [ "$SETUP_TYPE" = "AUTO" ]; then
### Sanity Test
if [ "${SETUP_TYPE,,}" = "auto" ]; then
sanity_db
sanity_var SITE_URL "Site URL"
db_ready mariadb

print_info "Auto Configuring based on Environment Variables"
# Proxy and Host Settings
if [ -z "$SITE_URL" ]; then
if [ -n "$APP_URL" ]; then
if [ -z "${SITE_URL}" ]; then
if [ -n "${APP_URL}" ]; then
sed -i --follow-symlinks "s#APP_URL=.*#APP_URL=${APP_URL}#g" "${NGINX_WEBROOT}"/.env
fi
else
sed -i --follow-symlinks "s#APP_URL=.*#APP_URL=${SITE_URL}#g" "${NGINX_WEBROOT}"/.env
fi

if [ "$ENABLE_SSL_PROXY" = "TRUE" ] || [ "$ENABLE_SSL_PROXY" = "true" ] || [ "$APP_FORCE_HTTPS" = "true" ] || [ "$APP_FORCE_HTTPS" = "TRUE" ]; then
if var_true "${ENABLE_SSL_PROXY}" || var_true "${APP_FORCE_HTTPS}" ; then
sed -i --follow-symlinks "s#APP_FORCE_HTTPS=.*#APP_FORCE_HTTPS=true#g" "${NGINX_WEBROOT}"/.env
sed -i --follow-symlinks "s#SESSION_SECURE_COOKIE=.*#SESSION_SECURE_COOKIE=true#g" "${NGINX_WEBROOT}"/.env
else
sed -i --follow-symlinks "s#APP_FORCE_HTTPS=.*#APP_FORCE_HTTPS=false#g" "${NGINX_WEBROOT}"/.env
sed -i --follow-symlinks "s#SESSION_SECURE_COOKIE=.*#SESSION_SECURE_COOKIE=false#g" "${NGINX_WEBROOT}"/.env
fi

if [ "$APP_DEBUG" = "TRUE" ] || [ "$APP_DEBUG" = "true" ] || [ "$DISPLAY_ERRORS" = "true" ] || [ "$DISPLAY_ERRORS" = "TRUE" ]; then
if var_true "${APP_DEBUG}" || var_true "${DISPLAY_ERRORS}" ; then
sed -i --follow-symlinks "s#APP_DEBUG=.*#APP_DEBUG=true#g" "${NGINX_WEBROOT}"/.env
else
sed -i --follow-symlinks "s#APP_DEBUG=.*#APP_DEBUG=false#g" "${NGINX_WEBROOT}"/.env
Expand All @@ -129,6 +128,13 @@ if grep -q "APP_URL" "${NGINX_WEBROOT}"/.env > /dev/null 2>&1; then
echo "APP_DISABLE_UPDATING=true" | sudo -u "${NGINX_USER}" tee -a "${NGINX_WEBROOT}"/.env
fi

# App Proxy (1.8.25)
if ! grep -q "APP_PROXY" "${NGINX_WEBROOT}"/.env > /dev/null 2>&1; then
echo "APP_PROXY=${APP_PROXY}" | sudo -u "${NGINX_USER}" tee -a "${NGINX_WEBROOT}"/.env
else
sed -i --follow-symlinks "s#APP_PROXY=.*#APP_PROXY=${APP_PROXY}g" "${NGINX_WEBROOT}"/.env
fi

else
print_info "Skipping Auto configuration and using in place .env"
fi
Expand All @@ -147,23 +153,27 @@ else
chown "${NGINX_USER}":"${NGINX_GROUP}" "${NGINX_WEBROOT}"/.env
echo "#### Automatically Generated File - Upon container restart any settings will reset!" | silent sudo -u "${NGINX_USER}" tee "${NGINX_WEBROOT}"/.env
# Proxy and HostSettings
if [ -z "$SITE_URL" ]; then
if [ -n "$APP_URL" ]; then
if [ -z "${SITE_URL}" ]; then
if [ -n "${APP_URL}" ]; then
echo "APP_URL=$APP_URL" | silent sudo -u "${NGINX_USER}" tee -a "${NGINX_WEBROOT}"/.env
fi
else
echo "APP_URL=$SITE_URL" | silent sudo -u "${NGINX_USER}" tee -a "${NGINX_WEBROOT}"/.env
fi

if [ "$ENABLE_SSL_PROXY" = "TRUE" ] || [ "$ENABLE_SSL_PROXY" = "true" ] || [ "$APP_FORCE_HTTPS" = "true" ] || [ "$APP_FORCE_HTTPS" = "TRUE" ]; then
if var_true "${ENABLE_SSL_PROXY}" || var_true "${APP_FORCE_HTTPS}" ; then
echo "APP_FORCE_HTTPS=true" | silent sudo -u "${NGINX_USER}" tee -a "${NGINX_WEBROOT}"/.env
echo "SESSION_SECURE_COOKIE=true" | silent sudo -u "${NGINX_USER}" tee -a "${NGINX_WEBROOT}"/.env
else
echo "APP_FORCE_HTTPS=false" | silent sudo -u "${NGINX_USER}" tee -a "${NGINX_WEBROOT}"/.env
echo "SESSION_SECURE_COOKIE=false" | silent sudo -u "${NGINX_USER}" tee -a "${NGINX_WEBROOT}"/.env
fi

if [ "$APP_DEBUG" = "TRUE" ] || [ "$APP_DEBUG" = "true" ] || [ "$DISPLAY_ERRORS" = "true" ] || [ "$DISPLAY_ERRORS" = "TRUE" ]; then
if [ -n "${APP_PROXY}" ] ; then
echo "APP_PROXY=${APP_PROXY}" | silent sudo -u "${NGINX_USER}" tee -a "${NGINX_WEBROOT}"/.env
fi

if var_true "${APP_DEBUG}" || var_true "${DISPLAY_ERRORS}" ; then
echo "APP_DEBUG=true" | silent sudo -u "${NGINX_USER}" tee -a "${NGINX_WEBROOT}"/.env
else
echo "APP_DEBUG=false" | silent sudo -u "${NGINX_USER}" tee -a "${NGINX_WEBROOT}"/.env
Expand Down

0 comments on commit 7442749

Please sign in to comment.