Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Application Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
20
Issues
20
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ganggo
Application Server
Commits
544d82ec
Commit
544d82ec
authored
Jan 08, 2019
by
zauberstuhl
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'master'
Optimize InitSocialRelay and print more debug msgs See merge request
!80
parents
29159a49
4c99ad46
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
9 deletions
+23
-9
.gitlab-ci.yml
.gitlab-ci.yml
+4
-1
app/init.go
app/init.go
+16
-7
ci/scripts/bintray.sh
ci/scripts/bintray.sh
+1
-1
conf/app.conf.example
conf/app.conf.example
+2
-0
No files found.
.gitlab-ci.yml
View file @
544d82ec
...
...
@@ -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"
...
...
app/init.go
View file @
544d82ec
...
...
@@ -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
)
}
}
...
...
ci/scripts/bintray.sh
View file @
544d82ec
...
...
@@ -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
=
"{
...
...
conf/app.conf.example
View file @
544d82ec
...
...
@@ -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]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment