forked from media-centre/makenews
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oneClickInstaller.sh
executable file
·67 lines (56 loc) · 1.8 KB
/
oneClickInstaller.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
#check requisites
sh ./checkPreRequisites.sh
source ./install.config
sh ./couchdb_tasks_internal.sh $userName $password $db
HOST=http://$userName:[email protected]:5986
SERVER_URL=http://$serverIp:$port
curl -X PUT $HOST/_config/httpd/enable_cors -d '"true"'
curl -X PUT $HOST/_config/cors/origins -d '"'$SERVER_URL'"'
curl -X PUT $HOST/_config/cors/credentials -d '"true"'
curl -X PUT $HOST/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'
curl -X PUT $HOST/_config/cors/headers -d '"accept, authorization, content-type, origin, referer, x-csrf-token"'
npm install
cat <<EOF > ./server/config/application.json
{
"default": {
"serverIpAddress": "$serverIp",
"serverPort": $port,
"couchDbUrl": "http://127.0.0.1:5984",
"searchEngineUrl": "http://127.0.0.1:5986/_fti/local",
"userDbPrefix": "db_",
"adminDetails": {
"username": "$userName",
"password": "$password",
"db": "$db"
},
"facebook": {
"url": "https://graph.facebook.com/v2.8",
"appSecretKey": "$fb_appSecretKey",
"appId": "$fb_appId",
"timeOut": 4000,
"limit": 500
},
"twitter": {
"url": "https://api.twitter.com/1.1",
"authenticateUrl": "https://api.twitter.com/oauth/authenticate",
"consumerKey": "$tw_consumerKey",
"consumerSecret": "$tw_consumerSecret"
}
}
}
EOF
cat <<EOF > ./client/config/config.js
if(!window.mediaCenter) {
window.mediaCenter = {};
}
window.mediaCenter.serverUrl = "$SERVER_URL";
window.mediaCenter.facebookAppId = "$fb_appId";
window.mediaCenter.autoRefreshSurfFeedsInterval = 300000;
window.mediaCenter.dbSessionInterval = 600000;
window.mediaCenter.storyAutoSaveTimeInterval = 300000;
EOF
gulp build
node ./dist/server/src/migration.js
cd dist
./create_user.sh