在启用 ufw 的 ubuntu 18.04 上,我运行 docker 容器,该容器应该将 django 应用程序连接到本地安装的 Postgresql 服务器。
禁用ufw后一切运行完美
docker-compose -f docker-compose.prod.yml run --rm app sh -c 'python manage.py createsuperuser'
Run Code Online (Sandbox Code Playgroud)
但是启用 ufw 后出现以下错误:
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not connect to server: Operation timed out
Is the server running on host "host.docker.internal" (172.17.0.1) and accepting
TCP/IP connections on port 5432?
Run Code Online (Sandbox Code Playgroud)
我有以下 ufw 规则
$ sudo ufw status
Status: active
To Action From
-- ------ ----
Nginx Full ALLOW Anywhere
OpenSSH ALLOW Anywhere …Run Code Online (Sandbox Code Playgroud) 从昨天起我开始从 google rest api 收到错误
{
"error": {
"code": 400,
"message": "API key not valid. Please pass a valid API key.",
"errors": [
{
"message": "API key not valid. Please pass a valid API key.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
Run Code Online (Sandbox Code Playgroud)
标题是:
"Content-length" "0"
"Content-Type" "application/x-www-form-urlencoded"
"Host" "www.googleapis.com"
"Authorization" "Bearer [APPILCATION_ID]"
"Accept" "application/json"
Run Code Online (Sandbox Code Playgroud)
我在开发者控制台中有 oAuth 2.0 客户端 ID。并发送与 3 个月前相同的请求 可能有什么问题?