Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

容器执行脚本init.sh里面设置usr/uploads疑问 #25

Open
flyisnow opened this issue Dec 9, 2022 · 1 comment
Open

容器执行脚本init.sh里面设置usr/uploads疑问 #25

flyisnow opened this issue Dec 9, 2022 · 1 comment

Comments

@flyisnow
Copy link

flyisnow commented Dec 9, 2022

代码里写的是

check_and_make 'usr/uploads' '755'

第一次执行install.php时,会提示uploads无权限,改为766后,安装成功

@flyisnow
Copy link
Author

flyisnow commented Dec 9, 2022

我目前使用的容器镜像是oyqi/typecho:nightly-php7.4-fpm-alpine
另外,这个方法

check_and_make() {
    if [ ! -e /app/$1 ]; then
        mkdir -p /app/$1
        chown -Rf www-data:www-data /app/$1
    fi

    if [ -n "$2" ]; then
        chmod $2 /app/$1
    fi
}

改为这样是不是更好,毕竟容器里执行,我修改了一次,下次就不用再修改了

check_and_make() {
    if [ ! -e /app/$1 ]; then
        mkdir -p /app/$1
        chown -Rf www-data:www-data /app/$1
       if [ -n "$2" ]; then
          chmod $2 /app/$1
       fi
    fi


}

@flyisnow flyisnow changed the title 容器执行脚本init.sh里面设置usr/uploads权限错误 容器执行脚本init.sh里面设置usr/uploads疑问 Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant