Files
YYeTsBot/yyetsweb/README.md

56 lines
1.4 KiB
Markdown
Raw Normal View History

2021-02-06 11:35:28 +08:00
# web端
**注意源代码中包含Google Analytics分析代码`index.html`, `search.html``resource.html`。如果自己使用,要记得去除哦**
2021-02-06 11:35:28 +08:00
# requirements
2021-02-07 09:32:23 +08:00
* tornado
* mongodb
* pymongo
2021-02-06 11:35:28 +08:00
# 导入数据
2021-07-24 13:45:57 +08:00
从 [这里](https://yyets.dmesg.app/database) 下载mongodb数据然后导入
2021-07-24 13:45:57 +08:00
```shell
2022-02-22 18:54:02 +08:00
mongorestore --gzip --archive=yyets_mongo.gz --nsFrom "share.*" --nsTo "zimuzu.*"
2021-07-24 13:45:57 +08:00
```
# 运行
`python server.py`
# Docker
参考[这里](https://github.com/BennyThink/WebsiteRunner)
# MongoDB index
```shell
use zimuzu;
db.getCollection('yyets').createIndex({"data.info.id": 1});
db.getCollection('yyets').createIndex({"data.info.views" : -1});
db.getCollection('yyets').createIndex({"data.info.area" : 1});
db.getCollection('yyets').getIndexes();
2021-08-15 12:28:19 +08:00
db.getCollection('douban').createIndex({"resourceId" : 1});
db.getCollection('douban').getIndexes();
db.getCollection('users').createIndex({"username" : 1}, { unique: true });
db.getCollection('users').getIndexes();
db.getCollection('comment').createIndex({"resource_id" : 1});
db.getCollection('comment').getIndexes();
db.getCollection('reactions').createIndex({"comment_id" : 1});
db.getCollection('reactions').getIndexes();
db.getCollection('metrics').createIndex({"date" : 1});
db.getCollection('metrics').getIndexes();
db.getCollection('notification').createIndex({"username" : 1});
db.getCollection('notification').getIndexes();
```