Skip to content

Commit

Permalink
项目改名为calibre-webserver;合并oldiy的docker配置
Browse files Browse the repository at this point in the history
  • Loading branch information
talebook committed May 17, 2019
1 parent 969fd74 commit fbe6387
Show file tree
Hide file tree
Showing 37 changed files with 55 additions and 11 deletions.
2 changes: 1 addition & 1 deletion conf/nginx/talebook.org
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ server {
}

location ^~ /static/ {
root /data/release/www/calibre.talebook.org/my-calibre-webserver/webserver/;
root /data/release/www/calibre.talebook.org/calibre-webserver/webserver/;
if ($query_string) { expires max; }
}

Expand Down
4 changes: 2 additions & 2 deletions conf/supervisor/calibre-webserver.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
programs=tornado-8000

[program:tornado-8000]
command=python my-calibre-webserver/server.py --with-library=/data/books/library --port=8000 --logging=debug
command=python calibre-webserver/server.py --with-library=/data/books/library --port=8000 --logging=debug
directory=/data/release/www/calibre.talebook.org
user=root
autorestart=true
redirect_stderr=true
stdout_logfile=/data/log/my-calibre-webserver.log
stdout_logfile=/data/log/calibre-webserver.log
loglevel=info

36 changes: 36 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ubuntu:16.04
MAINTAINER Rex <talebook@foxmail.com>

LABEL Maintainer="Rex <talebook@foxmail.com>"
LABEL Thanks="oldiy <oldiy2018@gmail.com>"

RUN apt-get update && \
apt-get install bash calibre python-pip unzip supervisor sqlite3 git -y

RUN pip install jinja2==2.10 social-auth-app-tornado==1.0.0 social-auth-storage-sqlalchemy==1.1.0 tornado==5.1.1 Baidubaike==2.0.1 && \
mkdir -p /data/log/ && \
mkdir -p /data/books/ && \
mkdir -p /data/release/www/calibre.talebook.org/ && \
mkdir -p /data/books/library && \
mkdir -p /data/books/extract && \
mkdir -p /data/books/upload && \
mkdir -p /data/books/convert && \
mkdir -p /data/books/progress && \
chmod a+w -R /data/log /data/books /data/release && \
cd /data/release/www/calibre.talebook.org/ && \
git clone https://github.com/talebook/calibre-webserver.git calibre-webserver && \
calibredb add --library-path=/data/books/library/ -r /data/release/www/calibre.talebook.org/calibre-webserver/docker/book/ && \
python /data/release/www/calibre.talebook.org/calibre-webserver/server.py --syncdb && \
cp /data/release/www/calibre.talebook.org/calibre-webserver/conf/supervisor/calibre-webserver.conf /etc/supervisor/conf.d/ && \
cp /data/release/www/calibre.talebook.org/calibre-webserver/docker/local_settings.py /data/release/www/calibre.talebook.org/calibre-webserver/webserver/ && \
rm -f /data/release/www/calibre.talebook.org/calibre-webserver/webserver/*.pyc && \
mkdir -p /prebuilt/ && \
mv /data/* /prebuilt/ && \
chmod +x /prebuilt/release/www/calibre.talebook.org/calibre-webserver/docker/start.sh

EXPOSE 8000

VOLUME ["/data/books"]

CMD ["/prebuilt/release/www/calibre.talebook.org/calibre-webserver/docker/start.sh"]

2 changes: 2 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# docker-calibre-webserver
Run Docker of calibre web
Binary file added docker/book/340-红楼梦.epub
Binary file not shown.
Binary file added docker/book/464-围城.epub
Binary file not shown.
Binary file added docker/book/484-孽海花.epub
Binary file not shown.
Binary file added docker/book/535-传奇.epub
Binary file not shown.
Binary file added docker/book/668-神曲(全三册).epub
Binary file not shown.
Binary file added docker/book/694-京华烟云.epub
Binary file not shown.
Binary file added docker/book/855-妻妾成群.epub
Binary file not shown.
Binary file added docker/book/九州·缥缈录Ⅰ_ 蛮荒.epub
Binary file not shown.
Binary file added docker/book/他的国.epub
Binary file not shown.
Binary file added docker/book/变形记.azw3
Binary file not shown.
Binary file added docker/book/名利场.epub
Binary file not shown.
Binary file added docker/book/呼啸山庄.epub
Binary file not shown.
Binary file added docker/book/唐诗三百首.epub
Binary file not shown.
Binary file not shown.
Binary file added docker/book/天行者.epub
Binary file not shown.
Binary file added docker/book/小王子.epub
Binary file not shown.
Binary file added docker/book/彼得·潘.epub
Binary file not shown.
Binary file added docker/book/教父.epub
Binary file not shown.
Binary file added docker/book/格林童话.mobi
Binary file not shown.
Binary file added docker/book/白发魔女传.epub
Binary file not shown.
Binary file added docker/book/百年孤独.epub
Binary file not shown.
Binary file added docker/book/神曲.azw3
Binary file not shown.
Binary file added docker/book/简.爱.epub
Binary file not shown.
Binary file added docker/book/罪与罚.epub
Binary file not shown.
Binary file added docker/book/老人與海.epub
Binary file not shown.
Binary file added docker/book/芳华.epub
Binary file not shown.
Binary file added docker/book/荆棘鸟.epub
Binary file not shown.
Binary file added docker/book/逆水寒.epub
Binary file not shown.
Binary file added docker/book/鲁滨孙历险记.epub
Binary file not shown.
6 changes: 6 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
if [ ! -d "/data/release" ]; then
cp -rf /prebuilt/* /data/
fi

/usr/bin/supervisord --nodaemon
8 changes: 4 additions & 4 deletions docs/INSTALL.zh_CN.md → document/INSTALL.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mkdir -p /data/log/
mkdir -p /data/release/www/calibre.talebook.org/
mkdir -p /data/books/{library,extract,upload,convert,progress}
cd /data/release/www/calibre.talebook.org/
git clone https://github.com/talebook/my-calibre-webserver.git
git clone https://github.com/talebook/calibre-webserver.git
```

Expand All @@ -44,7 +44,7 @@ git clone https://github.com/talebook/talebook-library.git /data/books/library
## 创建DB
执行以下命令,创建程序DB。
```
python /data/release/www/calibre.talebook.org/my-calibre-webserver/server.py --syncdb
python /data/release/www/calibre.talebook.org/calibre-webserver/server.py --syncdb
```


Expand Down Expand Up @@ -121,12 +121,12 @@ sudo nginx -s start
如果有调整过supervisord里面的配置(例如端口、目录),一定要执行```sudo supervisorctl reload all```重新读取配置,不然是不会生效的,可能会导致启动失败。

如果提示```calibre:tornado-8000: ERROR(spawn error)```,那么说明环境没配置正确。
请打开日志文件```/data/log/my-calibre-webserver.log```查看原因,重点查看最后一次出现Traceback报错,关注其中```Traceback (most recent call last)```提示的错误原因。
请打开日志文件```/data/log/calibre-webserver.log```查看原因,重点查看最后一次出现Traceback报错,关注其中```Traceback (most recent call last)```提示的错误原因。

* 网站能打开,但是提示```500: internal server error```

这种情况,一般是服务运行时出现异常,常见原因有目录权限没有配置正常、数据库没创建好、或者触发了某个代码BUG。

请打开日志文件```/data/log/my-calibre-webserver.log```查看原因,重点查看最后一次出现Traceback报错,关注其中```Traceback (most recent call last)```提示的错误原因,并提issue联系开发者排查。
请打开日志文件```/data/log/calibre-webserver.log```查看原因,重点查看最后一次出现Traceback报错,关注其中```Traceback (most recent call last)```提示的错误原因,并提issue联系开发者排查。


6 changes: 3 additions & 3 deletions webserver/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import os

settings = {
# "static_host" : "js.talebook.org",
#"static_host" : "cdn.talebook.org",
"static_path" : os.path.join(os.path.dirname(__file__), "static"),
"template_path" : os.path.join(os.path.dirname(__file__), "templates"),
"progress_path" : "/data/books/progress/",
"progress_path" : "/data/books/progress/",
"convert_path" : "/data/books/convert/",
"upload_path" : "/data/books/upload/",
"extract_path" : "/data/books/extract/",
Expand All @@ -33,7 +33,7 @@
'smtp_server' : "smtp.talebook.org",
'smtp_username' : "sender@talebook.org",
'smtp_password' : "password",
'douban_apikey' : "default-apikey",
'douban_apikey' : "0df993c66c0c636e29ecbb5344252a4a",

# See: http://open.weibo.com/developers
'SOCIAL_AUTH_WEIBO_KEY' : '',
Expand Down
2 changes: 1 addition & 1 deletion webserver/templates/sidebar/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<span class="legend">下载</span>
<div class="list-group">
<a href="https://github.com/talebook/my-calibre-webserver" class="list-group-item">站点源码</a>
<a href="https://github.com/talebook/calibre-webserver" class="list-group-item">站点源码</a>
<a href="https://github.com/talebook/talebook-library" class="list-group-item">书库打包</a>
<a href="http://diumx.com" target="_blank" class="list-group-item">友链:芒果读书</a>
<a href="https://bookset.me" target="_blank" class="list-group-item">友链:bookset</a>
Expand Down

0 comments on commit fbe6387

Please sign in to comment.