From a6707abd98f2cdb002094abc0d0a67de1d35efe3 Mon Sep 17 00:00:00 2001 From: lwabish Date: Sat, 31 Dec 2022 08:04:36 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E2=9A=A1=EF=B8=8F=20support=20TYPECHO?= =?UTF-8?q?=5FSECURE=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/init.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/init.sh b/scripts/init.sh index d555c4d..f64cbab 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -55,6 +55,10 @@ if [[ ! -z "${TYPECHO_INSTALL}" && "${TYPECHO_INSTALL}" = "1" ]]; then su -p www-data -s /usr/bin/env php /app/install.php fi +if [[ ! -z "${TYPECHO_SECURE}" && "${TYPECHO_SECURE}" = "1" ]]; then + echo 'define('__TYPECHO_SECURE__',true);' >>/app/config.inc.php +fi + if [ "$1" = "apache" ]; then apachectl -D FOREGROUND elif [ "$1" = "fpm" ]; then @@ -63,4 +67,4 @@ elif [ "$1" = "cli" ]; then su -p www-data -s /bin/ -c '/usr/bin/env php' else su -p www-data -s /bin/ -c '/usr/bin/env php -S 0.0.0.0:80 -t /app' -fi \ No newline at end of file +fi