mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-25 17:42:25 +01:00
@@ -6,6 +6,7 @@ mongo:
|
||||
db: crawlab_test
|
||||
username: ""
|
||||
password: ""
|
||||
authSource: "admin"
|
||||
redis:
|
||||
address: localhost
|
||||
password: ""
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user