diff --git a/plugins/nginx-vhosts/command-functions b/plugins/nginx-vhosts/command-functions index 2d65389f8..59776be15 100755 --- a/plugins/nginx-vhosts/command-functions +++ b/plugins/nginx-vhosts/command-functions @@ -4,6 +4,7 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions" +source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/internal-functions" cmd-nginx-report() { declare desc="displays a nginx report for one or more apps" @@ -45,6 +46,7 @@ cmd-nginx-report-single() { "--nginx-hsts-include-subdomains: $(fn-plugin-property-get-default "nginx" "$APP" "hsts-include-subdomains" "true")" "--nginx-hsts-max-age: $(fn-plugin-property-get-default "nginx" "$APP" "hsts-max-age" "15724800")" "--nginx-hsts-preload: $(fn-plugin-property-get-default "nginx" "$APP" "hsts-preload" "false")" + "--nginx-last-visited-at: $(fn-nginx-vhosts-last-visited-at "$APP")" ) if [[ -z "$INFO_FLAG" ]]; then diff --git a/plugins/nginx-vhosts/internal-functions b/plugins/nginx-vhosts/internal-functions index c286b2074..0528144df 100755 --- a/plugins/nginx-vhosts/internal-functions +++ b/plugins/nginx-vhosts/internal-functions @@ -4,6 +4,15 @@ set -eo pipefail source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" +fn-nginx-vhosts-last-visited-at() { + declare APP="$1" + local LOG_PATH=$(fn-nginx-access-log-path "$APP") + + if [[ "$LOG_PATH" != "off" ]] && [[ "$LOG_PATH" != "/dev/null" ]] && [[ -f "$LOG_PATH" ]]; then + stat -c %Y "$LOG_PATH" + fi +} + fn-nginx-vhosts-manage-hsts() { declare APP="$1" SSL_ENABLED="$2" local HSTS="$(fn-plugin-property-get-default "nginx" "$APP" "hsts" "true")"