Tag: 量angular器

Docker中的端口转发的Rails应用似乎会导致CSRFexception

我有一个在Docker容器中运行的Rails应用程序,它被分配了一个IP 172.17.0.3 。 对主机51.xxx传入请求被转发到172.17.0.3的rails应用程序。 更具体地说,这是这样做的: docker run -p 8080:8080 rails_app 但是,Rails应用程序抛出当用户尝试访问某些页面时Can't verify CSRF token authenticity错误。 我怀疑Rails认为传入的请求是攻击,因为目标的ip不匹配Rails应用程序的ip – 即用户请求被引导到主机51.xxx ,而Rails的实际位置是172.17.0.3 有什么办法让我告诉Rails这些请求是合法的吗? 作为附加信息,我使用devise进行身份validation,并使用unicorn作为服务器。 你们中的一些人可能会试图build议将protect_from_forgery with: :exception更改protect_from_forgery with: :exception :null_session ,但是如果没有放在代理之后,应用程序就可以正常工作。 另外,当我改变那个部分的时候,一些逻辑将不起作用,因为我认为这个设置是以处理用户会话的方式出现的。 这是我的networking的布局: (user from public network) —-> (proxy) —-> (rails app on a private network) (202.xxx) (51.xxx) (172.xxx) 编辑:该应用程序在development设置。 这是我在log/development.log文件中得到的错误。 Started POST "/register" for 202.xxx at 2014-11-18 […]

Docker selenium / node-chrome – 量angular器找不到Chrome二进制文件

我是Docker的新手,但不是E2E量angular器。 我正在尝试从Docker容器中构buildE2E集成。 遵循使用Docker的Angular的量angular器菜谱 他们有第2步 – 启动selenium节点 docker run -d –link selenium-hub:hub selenium/node-chrome:latest 我了解Selnium Grid的function – 它允许通过与网格进行通信来testing不同types的浏览器。 当我有这个docker容器运行Protactor不使用它作为铬二进制文件,我得到WebDriverError: unknown error: cannot find Chrome binary 。 我如何使量angular器使用此node-chrome容器,而不是本地铬二进制文件? 我的量angular器configuration: exports.config = { framework: 'mocha', directConnect: true, seleniumAddress: 'http://localhost:4444/wd/hub', // I have this set to the grid docker container from Angular cookbook specs: ['./stories/*.js'], onPrepare: function() { expect = […]

如何在Docker容器中启动一个宽浏览器,进行量angular器testing

在Docker容器中运行端到端testing时,我们需要浏览器很宽,以确保位于最右边的元素(aButton)实际上是可见的,并且像testing一样 expect(mainPage.aButton.isDisplayed()).toBeTruthy(); 成功。 当显示浏览器宽度时,我们总是得到一个最接近1050的值: browser.driver.manage().window().getSize().then(function(size) { console.log('browser size', size); }); 显示: browser size { height: 748, width: 1050, class: 'org.openqa.selenium.Dimension', hCode: 436207616 } 当使用这两个docker镜像运行testing时,由于button不可见,所以它们失败。 在不在Docker / Xvfb中的浏览器上运行testing时,没有任何问题。 https://registry.hub.docker.com/u/caltha/protractor/ 通过链接一个像这样的本地版本(和一些用于debugging的日志文件夹)来修改Xvfbconfiguration的设置。 mkdir -p /tmp/docker/protractor/supervisor docker run –rm \ –name run_protractor \ -v /tmp/docker/protractor:/var/log \ -v /tmp/testproject:/project \ -v /tmp/xvfb.conf:/etc/supervisor/conf.d/xvfb.conf:ro \ caltha/protractor Xvfb设置文件xvfb.conf: [program:xvfb] command = Xvfb :1 […]

在Docker中运行Angular2应用程序

我试图在docker中运行我的ng2应用程序。 我有Docker文件: FROM ubuntu:latest RUN apt-get update #Install curl & git RUN apt-get -qq -y install curl RUN apt-get install -yqq git #Download and install nodejs-6 RUN curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh RUN bash nodesource_setup.sh RUN apt-get install -yqq nodejs RUN apt-get install -yqq build-essential RUN npm install -g angular-cli #Clone the project RUN git […]

在Angular2应用程序中使用Docker环境variables

我想在Angular-Cli(1.0.0-beta.16)的'environment.prod.ts'中使用预定义的Docker Environmentvariables。 用例: environment.prod.ts: export const environment = { production: true, host1: $ENV1, //specific service endpoint goes here host2: $ENV2 //specific service endpoint goes here }; 我的Angular基于CLI的应用程序依赖于environment.prod.ts来获取有关后端服务(host1,host2)和应用程序的主机信息经历了DEV,TEST,QA,PROD等各种环境… 在Docker运行期间提供$ ENV1,$ ENV2作为环境variables 这可能吗 ? 如果没有,请纠正我的理解和build议任何其他的替代解决scheme