diff --git a/README.md b/README.md index 7717b54..85c5476 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,11 @@ Filesite.io也一样,它短小精悍,使用它把常见的本地文件制作 docker pull filesite/machete ``` +支持samba文件共享管理内容的版本: +``` +docker pull filesite/machete +``` + 启动machete容器: @@ -80,3 +85,52 @@ docker ps ``` http://127.0.0.1:1080 ``` + + +## 后台管理内容 + +最新版本已经支持网页版后台和samba文件共享方式管理内容。 + +### 网页版后台 + +网址为域名后面加**/admin/**来访问, +默认账号密码: +> 账号:filesite +> 密码:88888888 + +账号密码可在```conf/app.php```里修改。 + + +### samba文件共享 + +文件共享网址格式为: +> //filesite:88888888@服务器ip或域名/machete + +默认账号密码: +> 账号:filesite +> 密码:88888888 + +账号密码可在容器中执行命令修改: +``` +smbpwd filesite 新密码 +``` + + +### 文件共享使用方法 + + +windows下在**运行**里输入: +``` +\\服务器ip或域名\machete +``` + +然后在弹出的登陆框里输入账号密码就可以完成远程磁盘挂载。 + + +macos下挂载共享目录的命令: +``` +mount_smbfs //filesite:88888888@服务器ip或域名/machete 本地目录 +``` + +挂载好之后就可以打开Finder看到共享目录了, +点击进去就可以跟管理本地文件和目录一样操作了。 diff --git a/bin/upgrade.sh b/bin/upgrade.sh index 3c9fbb1..60b3afb 100755 --- a/bin/upgrade.sh +++ b/bin/upgrade.sh @@ -17,21 +17,6 @@ rsync -vruL machete/* /var/www/machete/ \ --exclude=www/videos/ \ --exclude=runtime/ -# check the user of php-fpm -phpUser='apache' -isAlpine=`grep 'www-data' /etc/passwd | wc -l` -if [ $isAlpine -ge 1 ]; then - phpUser='www-data' -fi - -cd /var/www/machete/ \ - && chown "${phpUser}:${phpUser}" runtime/ \ - && chown -R "${phpUser}:${phpUser}" www/content/ \ - && chown "${phpUser}:${phpUser}" www/navs/ \ - && chown "${phpUser}:${phpUser}" www/girls/ \ - && chown "${phpUser}:${phpUser}" www/videos/ - - # upgrade admin cd /var/www/downloads/ wget "https://git.filesite.io/wen/jialuomaadmin/archive/master.tar.gz" diff --git a/conf/smb.conf b/conf/smb.conf index 5c007d7..537a55e 100644 --- a/conf/smb.conf +++ b/conf/smb.conf @@ -6,7 +6,7 @@ path = /var/www/sambashare/filesite browseable = yes read only = no - force create mode = 0665 + force create mode = 0664 force directory mode = 0775 force group = apache valid users = filesite @sambashare diff --git a/controller/ApiController.php b/controller/ApiController.php index ae80761..91b7c00 100644 --- a/controller/ApiController.php +++ b/controller/ApiController.php @@ -187,8 +187,9 @@ Class ApiController extends Controller { } try { - $res = mkdir("{$target}/{$newDir}"); + $res = mkdir("{$target}/{$newDir}", 0775); if ($res) { + chmod("{$target}/{$newDir}", 0775); $code = 1; $msg = '目录创建完成'; }else { @@ -581,6 +582,7 @@ Class ApiController extends Controller { $base64 = str_replace(' ', '+', $base64); $fileContent = base64_decode($base64); file_put_contents($filePath, $fileContent); + chmod($filePath, 0664); //判断文件大小 $maxLength = FSC::$app['config']['admin']['maxUploadFileSize'] * 1024*1024;