Browse Source

runtime/ dir permission improve

master
filesite 1 day ago
parent
commit
a000acbead
  1. 8
      docker-entrypoint.sh
  2. 5
      plugins/Common.php

8
docker-entrypoint.sh

@ -3,8 +3,16 @@ theme=$1 @@ -3,8 +3,16 @@ theme=$1
if [ -d "/var/www/machete/themes/${theme}/" ]; then
echo "Theme chosed [${theme}]."
## 权限重新设置
chown -R www-data:www-data /var/www/machete/runtime/
## 复制对应皮肤的配置文件
cd /var/www/machete/runtime/
if [ ! -d cache ]; then
mkdir cache/
chown -R www-data:www-data cache/
fi
## 避免容器重启后重新生成配置文件
if [ ! -f custom_config.json ]; then

5
plugins/Common.php

@ -541,9 +541,6 @@ Class Common { @@ -541,9 +541,6 @@ Class Common {
);
$jsonData = json_encode($cacheData, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
$cacheDir = __DIR__ . '/../runtime/cache/';
if (!is_dir($cacheDir)) {
mkdir($cacheDir, 0777, true);
}
//子目录支持
if (!empty($cacheSubDir)) {
@ -551,7 +548,7 @@ Class Common { @@ -551,7 +548,7 @@ Class Common {
}
if (!is_dir($cacheDir)) {
mkdir($cacheDir, 0755);
mkdir($cacheDir, 0755, true);
}
$cache_filename = "{$cacheDir}{$key}.json";

Loading…
Cancel
Save