diff --git a/backend/conf/config.yml b/backend/conf/config.yml index 30b7e786..9387a94a 100644 --- a/backend/conf/config.yml +++ b/backend/conf/config.yml @@ -6,6 +6,7 @@ mongo: db: crawlab_test username: "" password: "" + authSource: "admin" redis: address: localhost password: "" diff --git a/backend/database/mongo.go b/backend/database/mongo.go index d1771c1d..6b155791 100644 --- a/backend/database/mongo.go +++ b/backend/database/mongo.go @@ -35,13 +35,14 @@ func InitMongo() error { var mongoDb = viper.GetString("mongo.db") var mongoUsername = viper.GetString("mongo.username") var mongoPassword = viper.GetString("mongo.password") + var mongoAuth = viper.GetString("mongo.authSource") if Session == nil { var uri string if mongoUsername == "" { uri = "mongodb://" + mongoHost + ":" + mongoPort + "/" + mongoDb } else { - uri = "mongodb://" + mongoUsername + ":" + mongoPassword + "@" + mongoHost + ":" + mongoPort + "/" + mongoDb + uri = "mongodb://" + mongoUsername + ":" + mongoPassword + "@" + mongoHost + ":" + mongoPort + "/" + mongoDb + "?authSource=" + mongoAuth } sess, err := mgo.Dial(uri) if err != nil { diff --git a/docker_init.sh b/docker_init.sh index 4a5491d9..d4f2ee9a 100755 --- a/docker_init.sh +++ b/docker_init.sh @@ -7,7 +7,7 @@ then else jspath=`ls /app/dist/js/app.*.js` cp ${jspath} ${jspath}.bak - sed -i "s/localhost:8000/${CRAWLAB_API_ADDRESS}/g" ${jspath} + sed -i "s?localhost:8000?${CRAWLAB_API_ADDRESS}?g" ${jspath} fi # start nginx diff --git a/frontend/conf/crawlab.conf b/frontend/conf/crawlab.conf index c3da703f..bf8270e5 100644 --- a/frontend/conf/crawlab.conf +++ b/frontend/conf/crawlab.conf @@ -1,4 +1,12 @@ server { + gzip on; + gzip_min_length 1k; + gzip_buffers 4 16k; + #gzip_http_version 1.0; + gzip_comp_level 2; + gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; + gzip_vary off; + gzip_disable "MSIE [1-6]\."; listen 8080; root /app/dist; index index.html; diff --git a/jenkins/docker-compose.yml b/jenkins/docker-compose.yml index 5dbabdf8..fd7d2904 100644 --- a/jenkins/docker-compose.yml +++ b/jenkins/docker-compose.yml @@ -4,7 +4,7 @@ services: image: tikazyq/crawlab:latest container_name: master environment: - CRAWLAB_API_ADDRESS: "114.67.75.98:8000" + CRAWLAB_API_ADDRESS: "crawlab.cn/api" CRAWLAB_SERVER_MASTER: "Y" CRAWLAB_MONGO_HOST: "mongo" CRAWLAB_REDIS_ADDRESS: "redis"