- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我希望使用 Flower ( https://github.com/mher/flower ) 来监视我的 Celery 任务,而不是在他们的文档 ( http://docs.celeryproject.org/en/latest/userguide/monitoring.html#flower-real-time-celery-web-monitor ) 中推荐的 django-admin。但是,因为我是新手,所以我对 Flower 页面仅基于 HTTP 而不是 HTTPS 的方式感到有点困惑。我如何为我的 Celery 任务启用安全性,这样任何老用户都不能只访问不需要登录的网站 http://flowerserver.com:5555并改变一些东西?
我考虑过 Celery 的 own documentation在此,但不幸的是,他们没有提及如何保护 Flower 的 api 或 web ui。全部内容:[此处需要更多文本]
谢谢!
更新:我的问题部分与此处重复:How do I add authentication and endpoint to Django Celery Flower Monitoring?
但是,我在这里通过询问如何使用包含 nginx、gunicorn 和 celery 的环境在同一台远程计算机上运行它来澄清他的问题。我也想知道如何设置 Flower 的外部可访问 url,但如果可能的话,我也更喜欢 https 而不是 http(或者某种保护 webui 和远程访问它的方法)。我还需要知道让 Flower 运行是否对任何可能访问 Flower 的内部 API 的人来说都是一个相当大的安全风险,以及保护它的最佳方法是什么,或者是否应该完全禁用它并仅在 as-需要的依据。
最佳答案
您可以使用 --auth 标志运行 flower,它将使用特定的谷歌电子邮件进行身份验证:
celery flower --auth=your.email@gmail.com
编辑 1:
新版本的 Flower 需要更多的标志和一个注册的 OAuth2 客户端 Google Developer Console :
celery flower \
--auth=your.email@gmail.com \
--oauth2_key="client_id" \
--oauth2_secret="client_secret" \
--oauth2_redirect_uri="http://example.com:5555/login"
oauth2_redirect_uri
必须是实际的 flower 登录 url,并且还必须添加到 Google Development Console 中的授权重定向 url。
不幸的是,此功能在当前稳定版本 0.7.2
中无法正常工作,但现在已在开发版本 0.8.0-dev
中使用此 commit 修复。
编辑 2:
您可以使用 basic authentication 配置 Flower:
celery flower --basic_auth=user1:password1,user2:password2
然后为除 localhost 之外的所有端口阻塞 5555 端口,并为 nginx 或 apache 配置反向代理:
ProxyRequests off
ProxyPreserveHost On
ProxyPass / http://localhost:5555
然后确保代理模块已打开:
sudo a2enmod proxy
sudo a2enmod proxy_http
如果您无法在单独的子域上设置它,例如:flower.example.com
(上面的配置),您可以为 example.com/flower 设置它
:
使用 url_prefix
运行花:
celery flower --url_prefix=flower --basic_auth=user1:password1,user2:password2
在 apache 配置中:
ProxyPass /flower http://localhost:5555
当然要确保配置了SSL,否则没有意义:)
关于django - 生产中的 celery 花安全,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19689510/
我用 redis 后端运行 celery。 我想在 centos 6.2 上运行 celery 花作为守护进程。 我知道花是 Tornado 应用程序,所以我应该使用一个进程来运行 Tornado 应
我在一台服务器上有几个项目,它们使用具有不同 BROKER_URL 的 celery 包。Flower 允许一个 BORKER_URL 作为命令选项: celery flower --broker=a
我正在使用芹菜和花卉。当我访问Flower中的“任务”标签时,我可以看到我的任务正在注册,甚至可以在“状态”列中看到“成功”标签以及所有内容。 但是,在“监视器”选项卡上,所有图形(“成功任务”,“失
我正在尝试创建一个有 5 个叶子的 css 花 - 没有任何有希望的尝试。我正在尝试创建什么:有 5 片叶子的 CSS 花,每片叶子可以有三种不同的状态(小、中、大)。我找到了 http://ross
如果我有一个变体,像这样: using my_variant = boost::variant; 有没有一种简单的方法可以将变体可以包含的类型提取到 Boost.Hana 元组中,以便满足以下条件:
调用 Flower API's /api/task/apply/* 只是挂起而没有返回结果,即使任务已根据 Web UI 处理并成功。 重现错误: # hangs even though task s
我有一个模板函数,默认情况下没有定义,但它由某些类型特化: template auto foo(bar &, const T &) -> void; template <> auto foo(bar
就目前情况而言,这个问题不太适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、民意调查或扩展讨论。如果您觉得这个问题可以改进并可能重新开放,visit
我是一名优秀的程序员,十分优秀!