This commit is contained in:
yumoqing 2024-01-28 11:14:28 +08:00
parent 69da784271
commit c0426d5710
2 changed files with 4 additions and 4 deletions

View File

@ -80,9 +80,9 @@ class AuthAPI(AppLogger):
async def setupAuth(self,app): async def setupAuth(self,app):
# setup session middleware in aiohttp fashion # setup session middleware in aiohttp fashion
secret = b'iqwertyuiopasdfghjklzxcvbnm12345' b = str(self.conf.website.port).encode('utf-8')
if self.conf.website.cookie_secret: cnt = 32 - len(b)
secret = self.conf.website.cookie_secret.encode('utf-8') secret = b + b'iqwertyuiopasdfghjklzxcvbnm12345'[:cnt]
storage = EncryptedCookieStorage(secret) storage = EncryptedCookieStorage(secret)
if self.conf.website.session_redis: if self.conf.website.session_redis:
url = self.conf.website.session_redis.url url = self.conf.website.session_redis.url

View File

@ -60,7 +60,7 @@ class ConfiguredServer(AppLogger):
config.website.ssl.keyfile) config.website.ssl.keyfile)
reuse_port = None reuse_port = None
if platform != 'win32': if platform != 'win32':
resue_port = True reuse_port = True
web.run_app(self.init_auth(),host=config.website.host or '0.0.0.0', web.run_app(self.init_auth(),host=config.website.host or '0.0.0.0',
port=port, port=port,
reuse_port=reuse_port, reuse_port=reuse_port,