Merge pull request #106 from tikazyq/develop

Develop
This commit is contained in:
Marvin Zhang
2019-08-03 11:17:03 +08:00
committed by GitHub
5 changed files with 13 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ mongo:
db: crawlab_test
username: ""
password: ""
authSource: "admin"
redis:
address: localhost
password: ""

View File

@@ -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 {

View File

@@ -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

View File

@@ -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;

View File

@@ -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"