From c0f378cc783e266534ea0ce8448aefa40b11316b Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sat, 16 Nov 2019 17:17:43 +0800
Subject: [PATCH 01/12] Update Dockerfile
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

安装中文字体，修复中文导出乱码问题
---
 Dockerfile | 80 ++++++++++++++++++++++++++++++------------------------
 1 file changed, 45 insertions(+), 35 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 78d2251..1dda5b0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,62 +10,72 @@ LABEL maintainer="homerr"
 # package versions
 ARG BOOKSTACK_RELEASE
 
+COPY boot_wkhtmltopdf.sh /usr/bin/boot_wkhtmltopdf.sh
 RUN \
  echo "**** install packages ****" && \
+ sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
  apk add --no-cache  \
-	curl \
-	fontconfig \
-	memcached \
-	netcat-openbsd \
-	php7-ctype \
-	php7-curl \
-	php7-dom \
-	php7-gd \
-	php7-ldap \
-	php7-mbstring \
-	php7-memcached \
-	php7-mysqlnd \
-	php7-openssl \
-	php7-pdo_mysql \
-	php7-phar \
-	php7-simplexml \
-	php7-tidy \
-	php7-tokenizer \
-	qt5-qtbase \
-	tar \
-	ttf-freefont \
-	wkhtmltopdf && \
+ curl \
+ msttcorefonts-installer \
+ fontconfig \
+ memcached \
+ netcat-openbsd \
+ php7-ctype \
+ php7-curl \
+ php7-dom \
+ php7-gd \
+ php7-ldap \
+ php7-mbstring \
+ php7-memcached \
+ php7-mysqlnd \
+ php7-openssl \
+ php7-pdo_mysql \
+ php7-phar \
+ php7-simplexml \
+ php7-tidy \
+ php7-tokenizer \
+ qt5-qtbase \
+ xvfb \
+ dbus \
+ tar \
+ ttf-freefont \
+ wkhtmltopdf && \
+ update-ms-fonts && \
+ fc-cache -f && \
  echo "**** tidy bug fix ****" && \
  curl -s \
-	http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/tidyhtml-libs-5.4.0-r0.apk | \
-	tar xfz - -C / && \
+ http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/tidyhtml-libs-5.4.0-r0.apk | \
+ tar xfz - -C / && \
  rm -f /usr/lib/libtidy.so.5.6.0 && \
  echo "**** configure php-fpm ****" && \
  sed -i 's/;clear_env = no/clear_env = no/g' /etc/php7/php-fpm.d/www.conf && \
  echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php7/php-fpm.conf && \
  echo "**** fetch bookstack ****" && \
  mkdir -p\
-	/var/www/html && \
+ /var/www/html && \
  if [ -z ${BOOKSTACK_RELEASE+x} ]; then \
-	BOOKSTACK_RELEASE=$(curl -sX GET "https://api.github.com/repos/bookstackapp/bookstack/releases/latest" \
-	| awk '/tag_name/{print $4;exit}' FS='[""]'); \
+ BOOKSTACK_RELEASE=$(curl -sX GET "https://api.github.com/repos/bookstackapp/bookstack/releases/latest" \
+ | awk '/tag_name/{print $4;exit}' FS='[""]'); \
  fi && \
  curl -o \
  /tmp/bookstack.tar.gz -L \
-	"https://github.com/BookStackApp/BookStack/archive/${BOOKSTACK_RELEASE}.tar.gz" && \
- tar xf \
- /tmp/bookstack.tar.gz -C \
-	/var/www/html/ --strip-components=1 && \
+ "https://github.com/BookStackApp/BookStack/archive/${BOOKSTACK_RELEASE}.tar.gz" && \
+ tar xf /tmp/bookstack.tar.gz -C /var/www/html/ --strip-components=1 && \
+ chmod a+x /usr/bin/boot_wkhtmltopdf.sh && \
  echo "**** install  composer ****" && \
  cd /tmp && \
- curl -sS https://getcomposer.org/installer | php && \
+ wget https://install.phpcomposer.com/composer.phar && \
  mv /tmp/composer.phar /usr/local/bin/composer && \
+ chmod a+x /usr/local/bin/composer && \
+ composer config -g repo.packagist composer https://packagist.phpcomposer.com && \
  echo "**** install composer dependencies ****" && \
  composer install -d /var/www/html/ && \
+ echo @edge http://mirrors.ustc.edu.cn/alpine/edge/testing >> /etc/apk/repositories && \
+ apk add wqy-zenhei@edge && \
+ apk add wqy-zenhei --update-cache --repository http://mirrors.ustc.edu.cn/alpine/edge/testing --allow-untrusted && \
+ apk add --update font-adobe-100dpi ttf-dejavu fontconfig && \
  echo "**** cleanup ****" && \
- rm -rf \
-	/root/.composer \
-	/tmp/*
+ rm -rf /root/.composer  /tmp/*
 
 # copy local files
 COPY root/ /

From 1bb414fddbb1fd0f3ca3153091e3e7cde370523b Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sat, 16 Nov 2019 17:41:12 +0800
Subject: [PATCH 02/12] Create docker-compose.yaml
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

修改导出文章中文乱码的问题
---
 docker-compose.yaml | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 docker-compose.yaml

diff --git a/docker-compose.yaml b/docker-compose.yaml
new file mode 100644
index 0000000..6d2652a
--- /dev/null
+++ b/docker-compose.yaml
@@ -0,0 +1,41 @@
+---
+version: "2"
+services:
+  bookstack:
+    build: .
+    image: bookstack:latest
+    #image: linuxserver/bookstack
+    container_name: bookstack
+    environment:
+    - PUID=1000
+    - PGID=1000
+    - DB_HOST=bookstack_db
+    - DB_USER=bookstack
+    - DB_PASS=yourdbpass
+    - DB_DATABASE=bookstackapp
+    - APP_LANG=zh_CN
+    - APP_AUTO_LANG_PUBLIC=true
+    - WKHTMLTOPDF=/usr/bin/boot_wkhtmltopdf.sh
+    volumes:
+    - ./data:/config
+    - /etc/localtime:/etc/localtime:ro
+    ports:
+    - 6875:80
+    restart: unless-stopped
+    depends_on:
+    - bookstack_db
+  bookstack_db:
+    image: linuxserver/mariadb
+    container_name: bookstack_db
+    environment:
+    - PUID=1000
+    - PGID=1000
+    - MYSQL_ROOT_PASSWORD=yourdbpass
+    - TZ=Asia/Shanghai
+    - MYSQL_DATABASE=bookstackapp
+    - MYSQL_USER=bookstack
+    - MYSQL_PASSWORD=yourdbpass
+    volumes:
+    - ./data:/config
+    - /etc/localtime:/etc/localtime:ro
+    restart: unless-stopped

From 26598dd9ad6edb22bb497180261f945883cccf25 Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sat, 16 Nov 2019 17:42:54 +0800
Subject: [PATCH 03/12] Create boot_wkhtmltopdf.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

解决导出中文乱码的问题
---
 boot_wkhtmltopdf.sh | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 boot_wkhtmltopdf.sh

diff --git a/boot_wkhtmltopdf.sh b/boot_wkhtmltopdf.sh
new file mode 100644
index 0000000..61f1fbb
--- /dev/null
+++ b/boot_wkhtmltopdf.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+Xvfb :0 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &
+DISPLAY=:0.0 /usr/bin/wkhtmltopdf $@
+killall Xvfb

From 299cff9366eae7120e6478bb1aa47eacb60f9787 Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sat, 16 Nov 2019 17:48:14 +0800
Subject: [PATCH 04/12] =?UTF-8?q?Create=20readme-=E4=B8=AD=E6=96=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

增加中文说明
---
 "readme-\344\270\255\346\226\207" | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 "readme-\344\270\255\346\226\207"

diff --git "a/readme-\344\270\255\346\226\207" "b/readme-\344\270\255\346\226\207"
new file mode 100644
index 0000000..90e0436
--- /dev/null
+++ "b/readme-\344\270\255\346\226\207"
@@ -0,0 +1,16 @@
+
+
+### 变化：
+
+    1，解决中文乱码问题  
+    2，调整仓库路径，使用中国国内源，加快制作镜像速度  
+    
+    
+### 运行：  
+    docker-compose build  
+    docker-compose up -d  
+    
+    
+### 参考文档：https://gitee.com/dreamidea/bookstack-docker-compose
+
+

From 912ace3fe2ec5fa1d4421fb563180ba68e32e9c0 Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sat, 16 Nov 2019 17:49:14 +0800
Subject: [PATCH 05/12] =?UTF-8?q?Rename=20readme-=E4=B8=AD=E6=96=87=20to?=
 =?UTF-8?q?=20readme-=E4=B8=AD=E6=96=87.md?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ...4\270\255\346\226\207" => "readme-\344\270\255\346\226\207.md" | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename "readme-\344\270\255\346\226\207" => "readme-\344\270\255\346\226\207.md" (100%)

diff --git "a/readme-\344\270\255\346\226\207" "b/readme-\344\270\255\346\226\207.md"
similarity index 100%
rename from "readme-\344\270\255\346\226\207"
rename to "readme-\344\270\255\346\226\207.md"

From c19c535b7fb7f8d57e3a4ffc05e21935dbb80e86 Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sat, 16 Nov 2019 17:52:00 +0800
Subject: [PATCH 06/12] =?UTF-8?q?Update=20readme-=E4=B8=AD=E6=96=87.md?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 "readme-\344\270\255\346\226\207.md" | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git "a/readme-\344\270\255\346\226\207.md" "b/readme-\344\270\255\346\226\207.md"
index 90e0436..c872b4e 100644
--- "a/readme-\344\270\255\346\226\207.md"
+++ "b/readme-\344\270\255\346\226\207.md"
@@ -14,3 +14,11 @@
 ### 参考文档：https://gitee.com/dreamidea/bookstack-docker-compose
 
 
+### 致谢
+   感谢以下网址涉及的所有相关团队和个人，感谢开源！
+   
+   https://www.bookstackapp.com/ 
+   https://www.linuxserver.io/
+   https://gitee.com/dreamidea/bookstack-docker-compose
+
+

From 43f0cb0ccb4e1d546e8c2a8b355db9104b628edc Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sat, 16 Nov 2019 17:53:40 +0800
Subject: [PATCH 07/12] =?UTF-8?q?Update=20readme-=E4=B8=AD=E6=96=87.md?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 "readme-\344\270\255\346\226\207.md" | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git "a/readme-\344\270\255\346\226\207.md" "b/readme-\344\270\255\346\226\207.md"
index c872b4e..84e3a16 100644
--- "a/readme-\344\270\255\346\226\207.md"
+++ "b/readme-\344\270\255\346\226\207.md"
@@ -2,7 +2,7 @@
 
 ### 变化：
 
-    1，解决中文乱码问题  
+    1，解决导出pdf中文乱码问题  
     2，调整仓库路径，使用中国国内源，加快制作镜像速度  
     
     
@@ -10,6 +10,8 @@
     docker-compose build  
     docker-compose up -d  
     
+已知问题：
+    貌似导出pdf，没有标签！！！
     
 ### 参考文档：https://gitee.com/dreamidea/bookstack-docker-compose
 

From afcd902f253d1fdf12244d52ae84063c54eb20bb Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sat, 16 Nov 2019 17:55:07 +0800
Subject: [PATCH 08/12] =?UTF-8?q?Update=20readme-=E4=B8=AD=E6=96=87.md?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 "readme-\344\270\255\346\226\207.md" | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git "a/readme-\344\270\255\346\226\207.md" "b/readme-\344\270\255\346\226\207.md"
index 84e3a16..385f4c6 100644
--- "a/readme-\344\270\255\346\226\207.md"
+++ "b/readme-\344\270\255\346\226\207.md"
@@ -13,14 +13,18 @@
 已知问题：
     貌似导出pdf，没有标签！！！
     
-### 参考文档：https://gitee.com/dreamidea/bookstack-docker-compose
+### 参考文档  
 
+https://gitee.com/dreamidea/bookstack-docker-compose  
 
-### 致谢
-   感谢以下网址涉及的所有相关团队和个人，感谢开源！
+
+### 致谢  
+   感谢以下网址涉及的所有相关团队和个人，感谢开源！  
+   
+   https://www.bookstackapp.com/   
+   https://www.linuxserver.io/  
+   https://gitee.com/dreamidea/bookstack-docker-compose  
+   
    
-   https://www.bookstackapp.com/ 
-   https://www.linuxserver.io/
-   https://gitee.com/dreamidea/bookstack-docker-compose
 
 

From d9375c26a2964ea286cbdff7026df70a57326f55 Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sun, 17 Nov 2019 19:02:47 +0800
Subject: [PATCH 09/12] Add files via upload

---
 "QQ\345\233\276\347\211\20720191117185747.png" | Bin 0 -> 46665 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 "QQ\345\233\276\347\211\20720191117185747.png"

diff --git "a/QQ\345\233\276\347\211\20720191117185747.png" "b/QQ\345\233\276\347\211\20720191117185747.png"
new file mode 100644
index 0000000000000000000000000000000000000000..62cd6c068e5e260436dbca66e1c476ba2d00c2fb
GIT binary patch

From 64c2963544bcc2040d80ec1057306c79ce61e303 Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sun, 17 Nov 2019 19:03:23 +0800
Subject: [PATCH 10/12] =?UTF-8?q?Delete=20QQ=E5=9B=BE=E7=89=87201911171857?=
 =?UTF-8?q?47.png?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 "QQ\345\233\276\347\211\20720191117185747.png" | Bin 46665 -> 0 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 "QQ\345\233\276\347\211\20720191117185747.png"

diff --git "a/QQ\345\233\276\347\211\20720191117185747.png" "b/QQ\345\233\276\347\211\20720191117185747.png"
deleted file mode 100644
index 62cd6c068e5e260436dbca66e1c476ba2d00c2fb..0000000000000000000000000000000000000000
GIT binary patch

From edb34ff8a6ab73e8050f52347c48e4e2096eedea Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sun, 17 Nov 2019 19:04:14 +0800
Subject: [PATCH 11/12] Add files via upload

---
 20191117185747.png | Bin 0 -> 46665 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 20191117185747.png

diff --git a/20191117185747.png b/20191117185747.png
new file mode 100644
index 0000000000000000000000000000000000000000..62cd6c068e5e260436dbca66e1c476ba2d00c2fb
GIT binary patch

From 82c30cd55fd43969e238ae05e182888c9eaef2bf Mon Sep 17 00:00:00 2001
From: or0or1 <or0or1@yeah.net>
Date: Sun, 17 Nov 2019 19:19:10 +0800
Subject: [PATCH 12/12] Add files via upload

---
 20191117191706.png | Bin 0 -> 17876 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 20191117191706.png

diff --git a/20191117191706.png b/20191117191706.png
new file mode 100644
index 0000000000000000000000000000000000000000..05a1ed4dbe1621b287c4d6d535acbfa9aefc3cd3
GIT binary patch
