Initial import of Shirobana bot backend
Include utility modules, shared channels, prompts, read-only skills, wardrobe memory and regression tests. Externalize legacy credentials and exclude private runtime state.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"""Single Windows service for the existing mail website, MCP and remote COM API."""
|
||||
import os
|
||||
import uvicorn
|
||||
from starlette.middleware.wsgi import WSGIMiddleware
|
||||
import mailWeb
|
||||
import mail_mcp
|
||||
import admin_com
|
||||
|
||||
admin_com.install(mailWeb.app)
|
||||
web = WSGIMiddleware(mailWeb.app)
|
||||
mcp = mail_mcp.BearerKeyMiddleware(mail_mcp.mcp.http_app(
|
||||
path='/mcp/', stateless_http=True,
|
||||
allowed_hosts=['api.rrrosmontis.icu', '127.0.0.1', 'localhost']))
|
||||
|
||||
|
||||
async def application(scope, receive, send):
|
||||
# Lifespan goes to FastMCP, so its session manager starts and stops normally.
|
||||
if scope['type'] == 'http' and scope.get('path', '').startswith('/v1/mail/api/'):
|
||||
await web(scope, receive, send)
|
||||
else:
|
||||
await mcp(scope, receive, send)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
uvicorn.run(application, host='127.0.0.1', port=int(os.environ.get('MAIL_PORT', '12005')),
|
||||
log_level='warning', access_log=False, timeout_graceful_shutdown=20)
|
||||
Reference in New Issue
Block a user