Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

网页api无法登陆 #159

Closed
bluestar800 opened this issue Nov 4, 2024 · 7 comments
Closed

网页api无法登陆 #159

bluestar800 opened this issue Nov 4, 2024 · 7 comments

Comments

@bluestar800
Copy link

已经使用docker搭建完成,使用host网络和_k 加密,windows desktop可以正常使用,并且api后台也正确。

但是有几个问题需要您的回复:
1、CSRF_TRUSTED_ORIGINS,可否定义多个,比如内网地址和外网地址?
2、ID_SERVER,可否定义多个?
3、ID_SERVER是对api服务的ip,还是对外网的IP or url ?

搭建后
容器使用host网络,host ip比如s 10.10.10.100,那么API就是http://10.10.10.100:21114

使用网页控制,写入——ID/中继服务器——服务器(10.10.10.100),API(http://10.10.10.100:21114),登陆账号密码,提示无法访问http://10.10.10.100:21114

@kingmo888
Copy link
Owner

1、可以,CSRF_TRUSTED_ORIGINS = ['https://domain1.com', 'http://192.168.1.200:21114']
2、目前不可以,它实际上是为【网页控制】的html输出一个模板变量。你可以在views中根据受访url的主域来区分内外网,然后分别返回不同的ID_SERVER。
3、网页控制相当于web api项目下集成进来的一个app,ID_SERVER是Web控制端使用的ID服务器,实际就是你的服务端的IP。

@bluestar800
Copy link
Author

1、可以,CSRF_TRUSTED_ORIGINS = ['https://domain1.com', 'http://192.168.1.200:21114'] 2、目前不可以,它实际上是为【网页控制】的html输出一个模板变量。你可以在views中根据受访url的主域来区分内外网,然后分别返回不同的ID_SERVER。 3、网页控制相当于web api项目下集成进来的一个app,ID_SERVER是Web控制端使用的ID服务器,实际就是你的服务端的IP。

感谢您的回复,也感谢你提供如此好的软件。

关于ID_SERVER,基于你的解释,我可否认为是api服务器访问hbbs服务器所用的,如果两者都在一个局域网内,那么我就可以直接使用hbbs的ip来作为ID_SERVER,而不管我访问api是使用的内网ip还是外网的url?

@kingmo888
Copy link
Owner

是的。

@bluestar800
Copy link
Author

是的。

但是使用网页控制的时候,提示我——连接错误,无法连接到中继服务器,这个该如何处理?

@kingmo888
Copy link
Owner

看看readme、看看其他issues吧。可能的原因挺多的,但实际就是服务端或者哪里的配置问题。
时间较久了,几个原因记不太清,恕我一时无法解答。

@bluestar800
Copy link
Author

bluestar800 commented Nov 18, 2024

这个问题已经解决了。

CSRF_TRUSTED_ORIGINS可以写多个
ID_SERVER的设定是告诉api,server是哪台,如果是内网可以直接用内网IP
api的网址,我现在是用的nginx代理来实现的。

@bluestar800
Copy link
Author

close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants