Browse Source

add admin code install, ignore hidden files start with .

master
filesite 2 years ago
parent
commit
eb13b57182
  1. 7
      Dockerfile
  2. 7
      Dockerfile_samba
  3. 10
      bin/upgrade.sh
  4. 3
      lib/DirScanner.php

7
Dockerfile

@ -7,6 +7,7 @@ RUN apk add \
&& mkdir -p /var/www/downloads && cd /var/www/downloads/ \ && mkdir -p /var/www/downloads && cd /var/www/downloads/ \
&& wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" \ && wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" \
&& tar -zxvf master.tar.gz \ && tar -zxvf master.tar.gz \
&& rm -f master.tar.gz \
&& mv machete/ /var/www/ \ && mv machete/ /var/www/ \
&& cd /var/www/ && rm -rf downloads/ \ && cd /var/www/ && rm -rf downloads/ \
&& mkdir machete/www/navs/ && mkdir machete/www/girls/ && mkdir machete/www/videos/ \ && 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/navs/ \
&& chown apache:apache www/girls/ \ && chown apache:apache www/girls/ \
&& chown apache:apache www/videos/ \ && 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 \ && rm -f /etc/nginx/http.d/default.conf \
&& cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/http.d/machete.conf && cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/http.d/machete.conf

7
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/ \ && mkdir -p /var/www/downloads && cd /var/www/downloads/ \
&& wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" \ && wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" \
&& tar -zxvf master.tar.gz \ && tar -zxvf master.tar.gz \
&& rm -f master.tar.gz \
&& mv machete/ /var/www/ \ && mv machete/ /var/www/ \
&& cd /var/www/ && rm -rf downloads/ \ && cd /var/www/ && rm -rf downloads/ \
&& mkdir machete/www/navs/ && mkdir machete/www/girls/ && mkdir machete/www/videos/ \ && 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/navs/ \
&& chown apache:apache www/girls/ \ && chown apache:apache www/girls/ \
&& chown apache:apache www/videos/ \ && 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 \ && rm -f /etc/nginx/nginx.conf \
&& cp /var/www/machete/conf/nginx.conf /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 \ && cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/conf.d/machete.conf \

10
bin/upgrade.sh

@ -8,6 +8,7 @@ rm -f master.tar.gz
rm -rf machete/ rm -rf machete/
wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz"
tar -zxvf master.tar.gz tar -zxvf master.tar.gz
rm -f master.tar.gz
rsync -vruL machete/* /var/www/machete/ \ rsync -vruL machete/* /var/www/machete/ \
--exclude=www/content/ \ --exclude=www/content/ \
--exclude=www/navs/ \ --exclude=www/navs/ \
@ -21,5 +22,14 @@ cd /var/www/machete/ \
&& chown apache:apache www/girls/ \ && chown apache:apache www/girls/ \
&& chown apache:apache www/videos/ && 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 "Machete upgrade done."
echo "" echo ""

3
lib/DirScanner.php

@ -85,8 +85,9 @@ Class DirScanner {
//判断目录名或文件名是否合法 //判断目录名或文件名是否合法
//不允许包含斜杠/,反斜杠\,单引号',双引号",空格字符 //不允许包含斜杠/,反斜杠\,单引号',双引号",空格字符
//忽略.开头的隐藏文件
private function isValid($name) { private function isValid($name) {
return str_replace(['/', '\\', "'", '"', ' '], '', $name) == $name; return str_replace(['/', '\\', "'", '"', ' '], '', $name) == $name && !preg_match('/^\..+/', $name);
} }
//解析描述文件内容 //解析描述文件内容

Loading…
Cancel
Save