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: ...@@ -8,7 +8,6 @@ variables:
POSTGRES_DB: ganggo POSTGRES_DB: ganggo
POSTGRES_USER: postgres POSTGRES_USER: postgres
POSTGRES_PASSWORD: "" POSTGRES_PASSWORD: ""
UPDATE_CHANNEL: alpha
stages: stages:
- install - install
- test - test
...@@ -35,6 +34,7 @@ install: ...@@ -35,6 +34,7 @@ install:
- make install - make install
except: except:
- master - master
- develop
linux:test:psql: linux:test:psql:
stage: test stage: test
script: script:
...@@ -44,6 +44,7 @@ linux:test:psql: ...@@ -44,6 +44,7 @@ linux:test:psql:
- install - install
except: except:
- master - master
- develop
linux:test:mysql: linux:test:mysql:
stage: test stage: test
script: script:
...@@ -53,6 +54,7 @@ linux:test:mysql: ...@@ -53,6 +54,7 @@ linux:test:mysql:
- install - install
except: except:
- master - master
- develop
linux:amd64: linux:amd64:
artifacts: artifacts:
expire_in: "1 hour" expire_in: "1 hour"
...@@ -67,6 +69,7 @@ linux:amd64: ...@@ -67,6 +69,7 @@ linux:amd64:
- install - install
except: except:
- master - master
- develop
windows:amd64: windows:amd64:
artifacts: artifacts:
expire_in: "1 hour" expire_in: "1 hour"
......
...@@ -73,14 +73,23 @@ func InitSocialRelay() { ...@@ -73,14 +73,23 @@ func InitSocialRelay() {
// this is required for using the social-relay // this is required for using the social-relay
revel.Config.SetSection("ganggo") revel.Config.SetSection("ganggo")
subscribe := revel.Config.BoolDefault("relay.subscribe", false) subscribe := revel.Config.BoolDefault("relay.subscribe", false)
if !revel.DevMode && subscribe { address, found := revel.Config.String("address")
address, found := revel.Config.String("address") if !revel.DevMode && subscribe && found {
if found { result := struct{Error string `json:"error"`}{}
_, err := http.Get("https://the-federation.info/register/" + address) endpoint := fmt.Sprintf(revel.Config.StringDefault(
if err != nil { "relay.endpoint", "https://the-federation.info/register/%s",
revel.WARN.Println("Wasn't able to register at the-federation.info", err) ), 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 ...@@ -6,7 +6,7 @@ API=https://api.bintray.com
# BINTRAY_USER=$1 # BINTRAY_USER=$1
# BINTRAY_API_KEY=$2 # BINTRAY_API_KEY=$2
# BINTRAY_REPO=$3 # 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" CURL="curl -u${BINTRAY_USER}:${BINTRAY_API_KEY} -H Content-Type:application/json -H Accept:application/json"
data="{ data="{
......
...@@ -51,6 +51,8 @@ relay.subscribe = false ...@@ -51,6 +51,8 @@ relay.subscribe = false
#relay.scope = "all" #relay.scope = "all"
# This option is obsolete if you specified "all" in "relay.scope" # This option is obsolete if you specified "all" in "relay.scope"
#relay.tags = "social,network,politics" #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] [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