Merge branch 'main' of https://git.mamahaha.work/sangge/mimajingsai
Some checks failed
Deploy App / Deploy to Web Server (push) Failing after 21s

This commit is contained in:
Smart-SangGe 2023-10-25 10:25:09 +08:00
commit 42895e63d0
3 changed files with 33 additions and 5 deletions

28
.gitea/workflows/ci.yaml Normal file
View File

@ -0,0 +1,28 @@
name: Deploy App
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy to Web Server
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: copy file via ssh password
uses: appleboy/scp-action@v0.1.4
with:
host: "110.41.155.96,110.41.130.197,110.41.21.35"
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: "src/server.py,src/client.py,src/node.py"
target: "/root/mimajingsai/src/"

View File

@ -1,15 +1,14 @@
import argparse
import requests
def send_post_request(ip_addr, message_name):
url = f"http://localhost:8002/request_message"
data = {
"dest_ip": ip_addr,
"message_name": message_name
}
data = {"dest_ip": ip_addr, "message_name": message_name}
response = requests.post(url, json=data)
return response.text
def main():
parser = argparse.ArgumentParser(description="Send POST request to a specified IP.")
parser.add_argument("ip_addr", help="IP address to send request to.")
@ -19,5 +18,6 @@ def main():
response = send_post_request(args.ip_addr, args.message_name)
print(response)
if __name__ == "__main__":
main()

View File

@ -109,7 +109,7 @@ async def send_user_des_message(source_ip: str, dest_ip: str, re_message): #
# 发送 HTTP POST 请求
response = requests.post(
"http://" + dest_ip+ ":8002" + "/receive_messages", json=data
"http://" + dest_ip + ":8002" + "/receive_messages", json=data
)
print(response.text)