Commit 544d82ec authored by zauberstuhl's avatar zauberstuhl

Merge branch 'develop' into 'master'

Optimize InitSocialRelay and print more debug msgs

See merge request !80
parents 29159a49 4c99ad46
......@@ -8,7 +8,6 @@ variables:
POSTGRES_DB: ganggo
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
UPDATE_CHANNEL: alpha
stages:
- install
- test
......@@ -35,6 +34,7 @@ install:
- make install
except:
- master
- develop
linux:test:psql:
stage: test
script:
......@@ -44,6 +44,7 @@ linux:test:psql:
- install
except:
- master
- develop
linux:test:mysql:
stage: test
script:
......@@ -53,6 +54,7 @@ linux:test:mysql:
- install
except:
- master
- develop
linux:amd64:
artifacts:
expire_in: "1 hour"
......@@ -67,6 +69,7 @@ linux:amd64:
- install
except:
- master
- develop
windows:amd64:
artifacts:
expire_in: "1 hour"
......
......@@ -73,14 +73,23 @@ func InitSocialRelay() {
// this is required for using the social-relay
revel.Config.SetSection("ganggo")
subscribe := revel.Config.BoolDefault("relay.subscribe", false)
if !revel.DevMode && subscribe {
address, found := revel.Config.String("address")
if found {
_, err := http.Get("https://the-federation.info/register/" + address)
if err != nil {
revel.WARN.Println("Wasn't able to register at the-federation.info", err)
}
address, found := revel.Config.String("address")
if !revel.DevMode && subscribe && found {
result := struct{Error string `json:"error"`}{}
endpoint := fmt.Sprintf(revel.Config.StringDefault(
"relay.endpoint", "https://the-federation.info/register/%s",
), address)
err := federation.FetchJson("GET", endpoint, nil, &result)
if err != nil {
revel.AppLog.Error("InitSocialRelay failed",
"result", result, "err", err)
} else {
revel.AppLog.Info("InitSocialRelay registration", "result", result)
}
} else {
revel.AppLog.Info("InitSocialRelay skipped",
"devMode", revel.DevMode, "subscribe", subscribe)
}
}
......
......@@ -6,7 +6,7 @@ API=https://api.bintray.com
# BINTRAY_USER=$1
# BINTRAY_API_KEY=$2
# BINTRAY_REPO=$3
PCK_NAME=${UPDATE_CHANNEL}
PCK_NAME=$(echo $VERSION |sed 's#^v[\.0-9\-]*\([a-z]*\)[\.0-9]*$#\1#')
CURL="curl -u${BINTRAY_USER}:${BINTRAY_API_KEY} -H Content-Type:application/json -H Accept:application/json"
data="{
......
......@@ -51,6 +51,8 @@ relay.subscribe = false
#relay.scope = "all"
# This option is obsolete if you specified "all" in "relay.scope"
#relay.tags = "social,network,politics"
# DO NOT touch unless you know exactly what you are doing
#relay.endpoint = "https://the-federation.info/register/%s"
[DEFAULT]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment