ipedrazas / taiga-docker

Docker scripts to run your own Taiga
Apache License 2.0
324 stars 115 forks source link

Getting cross origin problems. #41

Open metin opened 8 years ago

metin commented 8 years ago

Hi, I had to modify port numbers for my purposes. This is my setup.sh file. I had to run taiga-front on 8081.

#! /usr/bin/env bash

API_NAME="softtech.gitlab";

echo API_NAME: $API_NAME

mkdir -p /data/postgres

#docker pull ipedrazas/taiga-back
#docker pull ipedrazas/taiga-front

docker run -d --name postgres2  -v /data/postgres:/var/lib/postgresql/data postgres
# postgres needs some time to startup
sleep 5
docker run -d --name taiga-back  -p 8000:8000 -e API_NAME=$API_NAME  --link postgres2:postgres ipedrazas/taiga-back
docker run -d --name taiga-front -p 8081:80 -e API_NAME=$API_NAME --link taiga-back:taiga-back --volumes-from taiga-back ipedrazas/taiga-front

docker run -it --link postgres2:postgres --rm postgres sh -c "su postgres --command 'createuser -h "'$POSTGRES_PORT_5432_TCP_ADDR'" -p "'$POSTGRES_PORT_5432_TCP_PORT'" -d -r -s taiga'"
docker run -it --link postgres2:postgres --rm postgres sh -c "su postgres --command 'createdb -h "'$POSTGRES_PORT_5432_TCP_ADDR'" -p "'$POSTGRES_PORT_5432_TCP_PORT'" -O taiga taiga'";
docker run -it --rm --link postgres2:postgres ipedrazas/taiga-back bash regenerate.sh

Setup runs successfully but when I load the page I get errors. This is not too important I guess. Here is the chrome log.

Initialize navigation urls
Initialize api urls
Using the default logging exception handler.
Initialize resources
Initialize application
Analytics: no acount id provided. Disabling.
TypeError: Cannot read property 'get' of null
    at link (http://gitlab.softtech:8081/js/app.js?v=1437417084614:23656:44)
    at http://gitlab.softtech:8081/js/libs.js?v=1437417084604:13:9603
    at invokeLinkFn (http://gitlab.softtech:8081/js/libs.js?v=1437417084604:13:9721)
    at nodeLinkFn (http://gitlab.softtech:8081/js/libs.js?v=1437417084604:12:27886)
    at http://gitlab.softtech:8081/js/libs.js?v=1437417084604:13:5035
    at processQueue (http://gitlab.softtech:8081/js/libs.js?v=1437417084604:14:24061)
    at http://gitlab.softtech:8081/js/libs.js?v=1437417084604:14:24328
    at Scope.$eval (http://gitlab.softtech:8081/js/libs.js?v=1437417084604:15:5292)
    at Scope.$digest (http://gitlab.softtech:8081/js/libs.js?v=1437417084604:15:3032)
    at Scope.$apply (http://gitlab.softtech:8081/js/libs.js?v=1437417084604:15:5697)
    at http://gitlab.softtech:8081/js/libs.js?v=1437417084604:14:30625
    at completeOutstandingRequest (http://gitlab.softtech:8081/js/libs.js?v=1437417084604:12:5843)
    at http://gitlab.softtech:8081/js/libs.js?v=1437417084604:12:8857 <div tg-working-on="">

Then when I go to signup page to create an account, I get this when signing up.

OPTIONS http://softtech.gitlab:8000/api/v1/auth/register 
XMLHttpRequest cannot load http://softtech.gitlab:8000/api/v1/auth/register. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://gitlab.softtech:8081' is therefore not allowed access. The response had HTTP status code 504.
XHR failed loading: POST "http://softtech.gitlab:8000/api/v1/auth/register".
TypeError: Cannot read property '_error_message' of null
    at onErrorSubmit (auth.coffee:274)
    at processQueue (angular.js:14454)
    at angular.js:14470
    at Scope.$eval (angular.js:15719)
    at Scope.$digest (angular.js:15530)
    at Scope.$apply (angular.js:15824)
    at angular.js:16119
    at completeOutstandingRequest (angular.js:5370)
    at angular.js:5642

Any idea?