diff --git a/Dockerfile b/Dockerfile index 8a66295..59a9568 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ RUN apk add \ && mkdir -p /var/www/downloads && cd /var/www/downloads/ \ && wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" \ && tar -zxvf master.tar.gz \ + && rm -f master.tar.gz \ && mv machete/ /var/www/ \ && cd /var/www/ && rm -rf downloads/ \ && mkdir machete/www/navs/ && mkdir machete/www/girls/ && mkdir machete/www/videos/ \ @@ -16,6 +17,12 @@ RUN apk add \ && chown apache:apache www/navs/ \ && chown apache:apache www/girls/ \ && chown apache:apache www/videos/ \ + && cd /var/www/downloads/ \ + && wget "https://git.filesite.io/wen/jialuomaadmin/archive/master.tar.gz" \ + && tar -zxvf master.tar.gz \ + && rm -f master.tar.gz \ + && rm -rf /var/www/machete/www/admin/ \ + && mv jialuomaadmin/dist/ /var/www/machete/www/admin \ && rm -f /etc/nginx/http.d/default.conf \ && cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/http.d/machete.conf diff --git a/Dockerfile_samba b/Dockerfile_samba index 7c047f7..3478ac9 100644 --- a/Dockerfile_samba +++ b/Dockerfile_samba @@ -12,6 +12,7 @@ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n && mkdir -p /var/www/downloads && cd /var/www/downloads/ \ && wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" \ && tar -zxvf master.tar.gz \ + && rm -f master.tar.gz \ && mv machete/ /var/www/ \ && cd /var/www/ && rm -rf downloads/ \ && mkdir machete/www/navs/ && mkdir machete/www/girls/ && mkdir machete/www/videos/ \ @@ -21,6 +22,12 @@ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n && chown apache:apache www/navs/ \ && chown apache:apache www/girls/ \ && chown apache:apache www/videos/ \ + && cd /var/www/downloads/ \ + && wget "https://git.filesite.io/wen/jialuomaadmin/archive/master.tar.gz" \ + && tar -zxvf master.tar.gz \ + && rm -f master.tar.gz \ + && rm -rf /var/www/machete/www/admin/ \ + && mv jialuomaadmin/dist/ /var/www/machete/www/admin \ && rm -f /etc/nginx/nginx.conf \ && cp /var/www/machete/conf/nginx.conf /etc/nginx/nginx.conf \ && cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/conf.d/machete.conf \ diff --git a/bin/upgrade.sh b/bin/upgrade.sh index 70faa9f..c50ada6 100755 --- a/bin/upgrade.sh +++ b/bin/upgrade.sh @@ -8,6 +8,7 @@ rm -f master.tar.gz rm -rf machete/ wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" tar -zxvf master.tar.gz +rm -f master.tar.gz rsync -vruL machete/* /var/www/machete/ \ --exclude=www/content/ \ --exclude=www/navs/ \ @@ -21,5 +22,14 @@ cd /var/www/machete/ \ && chown apache:apache www/girls/ \ && chown apache:apache www/videos/ + +# upgrade admin +cd /var/www/downloads/ +wget "https://git.filesite.io/wen/jialuomaadmin/archive/master.tar.gz" +tar -zxvf master.tar.gz +rm -f master.tar.gz +rm -rf /var/www/machete/www/admin/ +mv jialuomaadmin/dist/ /var/www/machete/www/admin + echo "Machete upgrade done." echo "" \ No newline at end of file diff --git a/lib/DirScanner.php b/lib/DirScanner.php index 99b696b..7ccddd7 100644 --- a/lib/DirScanner.php +++ b/lib/DirScanner.php @@ -85,8 +85,9 @@ Class DirScanner { //判断目录名或文件名是否合法 //不允许包含斜杠/,反斜杠\,单引号',双引号",空格字符 + //忽略.开头的隐藏文件 private function isValid($name) { - return str_replace(['/', '\\', "'", '"', ' '], '', $name) == $name; + return str_replace(['/', '\\', "'", '"', ' '], '', $name) == $name && !preg_match('/^\..+/', $name); } //解析描述文件内容