1.0.1.sh 1.5 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. # Hestia Control Panel upgrade script for target version 1.0.1
  3. #######################################################################################
  4. ####### Place additional commands below. #######
  5. #######################################################################################
  6. # Ensure that users from previous releases are set to the correct stable release branch
  7. if [ ! -z "$RELEASE_BRANCH" ] && [ "$RELEASE_BRANCH" = "master" ] || [ "$RELEASE_BRANCH" = "develop" ]; then
  8. echo "(*) Updating default release branch configuration..."
  9. $HESTIA/bin/v-change-sys-config-value 'RELEASE_BRANCH' 'release'
  10. fi
  11. # Back up old template files and install the latest versions
  12. if [ -d $HESTIA/data/templates/ ]; then
  13. echo "(*) Updating web templates to enable per-domain HSTS/OCSP SSL support..."
  14. cp -rf $HESTIA/data/templates $HESTIA_BACKUP/templates/
  15. $HESTIA/bin/v-update-web-templates >/dev/null 2>&1
  16. fi
  17. # Remove global options from nginx.conf to prevent conflicts with other web packages
  18. # and remove OCSP SSL stapling from global configuration as it has moved to per-domain availability in this release.
  19. if [ -e /etc/nginx/nginx.conf ]; then
  20. sed -i "/add_header X-Frame-Options SAMEORIGIN;/d" /etc/nginx/nginx.conf
  21. sed -i "/add_header X-Content-Type-Options nosniff;/d" /etc/nginx/nginx.conf
  22. sed -i "/ssl_stapling on;/d" /etc/nginx/nginx.conf
  23. sed -i "/ssl_stapling_verify on;/d" /etc/nginx/nginx.conf
  24. fi