Your Name 3 anni fa
parent
commit
6ffb700957
1 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. 11 2
      step_question/apis/newbot.py

+ 11 - 2
step_question/apis/newbot.py

@@ -4,7 +4,16 @@ import fastapi.staticfiles as fastapiStaticfiles
 import linebot
 import linebot.models as linebotModels
 
-#uvicorn main:app --port 443 --ssl-keyfile=/etc/letsencrypt/live/ptt.cx/key.pem --ssl-certfile=/etc/letsencrypt/live/ptt.cx/cert.pem
+#uvicorn main:app --host 0.0.0.0 --port 443 --ssl-keyfile=/etc/letsencrypt/live/cal.ptt.cx/privkey.pem --ssl-certfile=/etc/letsencrypt/live/cal.ptt.cx/fullchain.pem
+#uvicorn main:app --host 0.0.0.0 --port 443 --ssl-keyfile=/etc/letsencrypt/live/ptt.cx/privkey.pem --ssl-certfile=/etc/letsencrypt/live/ptt.cx/chain.pem
+
+#uvicorn main:app --host 0.0.0.0 --port 443 --key-file=/etc/letsencrypt/live/ptt.cx/privkey.pem --certfile=/etc/letsencrypt/live/ptt.cx/cert.pem
+
+# --keyfile=./key.pem --certfile=./cert.pem 
+
+#   --ssl-cert-reqs 1 
+# 
+# --ssl-ca-certs=/etc/letsencrypt/live/ptt.cx/fullchain.crt
 
 app = fastapi.FastAPI()
 app.mount(
@@ -33,7 +42,7 @@ handler = WebhookHandler('58a73d69c3ad6416e0b465e64c30526a')
 async def callback(request: fastapi.Request):
     signature = request.headers['X-Line-Signature']
     body = await request.body()
-    bot.handle(body.decode('utf-8'), signature)
+    handler.handle(body.decode('utf-8'), signature)
     return 'OK'