建议部署在Linux或者Macos上,Windows不适合本项目的调试、部署
docker部署
user_trpc = Trpc('auth') # using with service name
user_trpc.requests(method='get', path='/user')
$ git clone https://github.com/bigbaser/TcloudServer.git
server {
listen 80;
server_name 127.0.0.1 localhost;
location /v1/datashow/ {
proxy_pass http://127.0.0.1:9022;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, projectid';
add_header 'Access-Control-Allow-Methods' 'POST, GET, DELETE, OPTIONS';
}
location /v1/jobs/ {
proxy_pass http://127.0.0.1:9038;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, projectid';
add_header 'Access-Control-Allow-Methods' 'POST, GET, DELETE, OPTIONS';
}
location /v1/message/ {
proxy_pass http://127.0.0.1:9030;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, projectid';
add_header 'Access-Control-Allow-Methods' 'POST, GET, DELETE, OPTIONS';
}
location /v1/tcdevices/ {
proxy_pass http://127.0.0.1:9036;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, projectid';
add_header 'Access-Control-Allow-Methods' 'POST, GET, DELETE, OPTIONS';
}
location /v1/public/ {
proxy_pass http://127.0.0.1:9034;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, projectid';
add_header 'Access-Control-Allow-Methods' 'POST, GET, DELETE, OPTIONS';
}
location /v1/monkey/ {
proxy_pass http://127.0.0.1:9022;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, projectid';
add_header 'Access-Control-Allow-Methods' 'POST, GET, DELETE, OPTIONS';
}
location ~* /v1/(flow|deploy)/ {
proxy_pass http://127.0.0.1:9026;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, projectid';
add_header 'Access-Control-Allow-Methods' 'POST, GET, DELETE, OPTIONS';
}
location ~* /v1/(cidata|tool)/ {
proxy_pass http://127.0.0.1:9024;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, projectid';
add_header 'Access-Control-Allow-Methods' 'POST, GET, DELETE, OPTIONS';
}
location ~* /v1/interface.* {
proxy_pass http://127.0.0.1:9028;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, projectid';
add_header 'Access-Control-Allow-Methods' 'POST, GET, DELETE, OPTIONS';
}
location ~* /v1/(user|track|role|ability|feedback|wxlogin)/ {
proxy_pass http://127.0.0.1:9020;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, projectid';
add_header 'Access-Control-Allow-Methods' 'POST, GET, DELETE, OPTIONS';
}
location / {
proxy_pass http://127.0.0.1:9032;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, projectid';
add_header 'Access-Control-Allow-Methods' 'POST, GET, DELETE, OPTIONS';
}
}
$ python -m apps.auth.run