duh@133.cn 80abc50759 add word_generater_py3.py | 5 éve | |
---|---|---|
.. | ||
local_generater | 5 éve | |
passwd_changer | 6 éve | |
README.md | 6 éve | |
__init__.py | 6 éve |
依赖模块
pip install redis MySQLdb
日志
[handler_rotateFileHandler]
class=handlers.RotatingFileHandler
level=DEBUG
formatter=simpleFormatter
args=('securitypw.log', 'a', 50*1024*1024, 6)
密码修改间隔时间
token_unix_time = hashlib.md5(str(int(self.t) / 300)).hexdigest()[10:]
配置redis、mysql和用户名
class Config():
#database setting
dbhost = '678h0MTkyLjE2OC41LjnTjBX8ugEwNQ'
dbport = 'WRed4MzMwNg'
dbuser = 'qCgtpZGVhbg'
dbpasswd = 'jcwGKMTIzNDU2'
dbname = 'yU4LbYXV0aGNlbneWYjqFvQRlcg'
#redis setting
redishost = 'eZroIMTkyLjE2OC4xvEWFh7azLjgy'
redisport = 'MRci8NjM3OQ'
redisdb=0
#users
users = [ 'mYPeZZG91eXVedTrv2ONvcHM',
]
初始化数据库
CREATE TABLE `token_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`host` varchar(15) NOT NULL,
`time` varchar(45) NOT NULL,
`rd_list` varchar(100) NOT NULL,
PRIMARY KEY (`id`,`host`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;