Homeland 关于 Homeland Docker 部署有个建议

vstorm · July 28, 2020 · Last by huacnlee replied at July 28, 2020 · 2053 hits

默认的部署,会将 Redis 和 PostgreSQL 暴露到外网,而且是没有密码的。我查看了 homeland 的配置文档,没看到有可以设置密码的配置项。

部署后,redis 隔一段时间就会报错,最后在进入容器后,发现/data 目录里多了 red2.so 和 kinsing*两个文件,google 搜索了下,才知道是 redis 被入侵了。

建议将 docker-compose 的 port 映射改成"127.0.0.1:6379:6379",只允许本地访问,防止被入侵。

外部机器限制端口

是不是 docker 开了 80 端口?我曾经在阿里云服务器上出现了这个问题,后来关掉 80,使用 443 端口,就可以了

Reply to huacnlee

老大,还有问题,最新的 homeland 镜像是不是有问题?sudo make install_ssl 会报错

最后只能换成 3.5.0 的镜像,才能成功

Reply to huacnlee

docker compose 不需要把 redis 和 postgres 的端口开放,其它 service 可以通过内部网络访问这些服务,主机名就是 service 名。

https://docs.docker.com/compose/networking/

By default Compose sets up a single network for your app. Each container for a service joins the default network and is both reachable by other containers on that network, and discoverable by them at a hostname identical to the container name.

默认安全对用户很重要,不是所有用户都有足够的安全知识。以前我就被 mongodb 的默认配置坑过……

You need to Sign in before reply, if you don't have an account, please Sign up first.