Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/fishroom/config.py
/fishroom/config/config.json
/test/config.py
config.py.production
15 changes: 15 additions & 0 deletions fishroom/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python

import os
import json

config_path = os.path.join(
os.path.dirname(__file__),
"config",
"config.json"
)

with open(config_path, "r") as f:
config = json.load(f)

# vim: ts=4 sw=4 sts=4 expandtab
11 changes: 9 additions & 2 deletions fishroom/config.py.example → fishroom/config/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Fishroom Configuration

This directory contains the Fishroom configuration file `config.json`.

You may reference `config.json.example` for details. The JSON file will be
parsed into the following Python dictionary:

```Python
config = {
"debug": True,
"timezone": "Asia/Shanghai",
Expand Down Expand Up @@ -119,5 +127,4 @@ config = {
}
}
}

# vim: ft=python
```
88 changes: 88 additions & 0 deletions fishroom/config/config.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"debug": true,
"timezone": "Asia/Shanghai",
"baseurl": "http://fishroom.example.com",
"name": "teleboto",
"cmd_me": "tg_bot",
"redis": {
"unix_socket_path": "/var/run/redis/redis.sock",
"host": "redis-host",
"port": 6379,
"prefix": "fishroom"
},
"irc": {
"server": "irc.freenode.net",
"port": 6697,
"nick": "XiaoT",
"password": null,
"ssl": true,
"blacklist": [
"[Olaf]"
]
},
"telegram": {
"token": "",
"me": null,
"admin": []
},
"xmpp": {
"server": "xmpp.jp",
"port": 5222,
"jid": "user@xmpp.jp/resource",
"password": "",
"nick": "XiaoT"
},
"gitter": {
"token": "",
"me": ""
},
"matrix": {
"server": "https://matrixim.cc:8448",
"user": "fishroom",
"password": "",
"nick": "bot_fishroom",
"bot_msg_pattern": "^mubot|^!wikipedia"
},
"wechat": {},
"qiniu": {
"access_key": "",
"secret_key": "",
"bucket": "",
"base_url": ""
},
"photo_store": {
"provider": "vim-cn",
"options": {
"client_id": ""
}
},
"chatlog": {
"host": "tornado-host",
"port": 8000,
"default_channel": "teleboto-dev"
},
"file_store": {
"provider": "qiniu"
},
"text_store": {
"provider": "vinergy",
"options": {}
},
"plugins": [
"pia",
"imglink",
"vote",
"hualao"
],
"bindings": {
"archlinux-cn": {
"irc": "#archlinux-cn",
"telegram": "-1001031857103",
"xmpp": "chat@conference.xmpp.jp",
"matrix": "#archlinux:matrixim.cc"
},
"test": {
"wechat": "xxx chat room"
}
}
}
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pytz
redis
marshmallow==2.1.0
tornado==4.5.2
marshmallow==2.15.1
tornado==6.0.3
tornado-redis
irc
requests
Expand All @@ -10,6 +10,6 @@ pillow
qiniu
python-magic
dateutils
aiohttp==2.3.3
aiohttp==3.5.4
matrix-client
itchat