env.sh 1.08 KB
Newer Older
Masaru Abe committed
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
#!/bin/sh
PROTOCOL=$1
DOMAIN=$2

modify_htaccess()
{
		URI=$1
		cat > abvw/.htaccess << EOF
SetEnvIf Referer "^$URI" RefererCheck
Order deny,allow
Deny from all
Allow from env=RefererCheck
<Files ~ "\.(js|json)$">
Header add Pragma "no-cache"
Header set Cache-Control no-cache
</Files>
EOF
}

modify_api()
{
	URI_PREFIX=$1
	cat > abvw/common/json/sys/conf.json << EOF
{
        "apiUrl"              : "$URI_PREFIX/{0}/abvapi",
        "apiLoginUrl"         : "$URI_PREFIX/nuabvapi",
        "apiResourceDlUrl"    : "$URI_PREFIX/{0}/dl",
        "bookShelfCount"      : 15,
        "bookListCount"       : 15,
        "screenlockTimeDefault" : 30,
        "pushPageCount"       : 5,
        "pushTimePeriod"      : 60,
        "debug"               : true,
        "loginPage"           : "index.html",
        "anonymousLoginFlg"   : true,
        "anonymousLoginPath"  : "user",
        "anonymousLoginId"    : "nologin",
        "appName"             : "ABookWebCL",
        "appVersion"          : "0.0.1"
}
EOF
}

Masaru Abe committed
44
modify_htaccess "$PROTOCOL://$DOMAIN/webvw/"
Masaru Abe committed
45 46
modify_api "$PROTOCOL://$DOMAIN/acms"