parent
9484880bca
commit
9aeeb52bdb
|
@ -45,12 +45,14 @@ const (
|
||||||
|
|
||||||
var instanceColl *Collection
|
var instanceColl *Collection
|
||||||
|
|
||||||
func initActivityPub(cfg *config.Config) {
|
func initActivityPub(app *App) {
|
||||||
ur, _ := url.Parse(cfg.App.Host)
|
ur, _ := url.Parse(app.cfg.App.Host)
|
||||||
instanceColl = &Collection{
|
instanceColl = &Collection{
|
||||||
ID: 0,
|
ID: 0,
|
||||||
Alias: ur.Host,
|
Alias: ur.Host,
|
||||||
Title: ur.Host,
|
Title: ur.Host,
|
||||||
|
db: app.db,
|
||||||
|
hostName: app.cfg.App.Host,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
8
app.go
8
app.go
|
@ -384,13 +384,13 @@ func Initialize(apper Apper, debug bool) (*App, error) {
|
||||||
|
|
||||||
apper.App().InitDecoder()
|
apper.App().InitDecoder()
|
||||||
|
|
||||||
apper.App().InitActivityPub()
|
|
||||||
|
|
||||||
err = ConnectToDatabase(apper.App())
|
err = ConnectToDatabase(apper.App())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("connect to DB: %s", err)
|
return nil, fmt.Errorf("connect to DB: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initActivityPub(apper.App())
|
||||||
|
|
||||||
// Handle local timeline, if enabled
|
// Handle local timeline, if enabled
|
||||||
if apper.App().cfg.App.LocalTimeline {
|
if apper.App().cfg.App.LocalTimeline {
|
||||||
log.Info("Initializing local timeline...")
|
log.Info("Initializing local timeline...")
|
||||||
|
@ -501,10 +501,6 @@ func (app *App) InitDecoder() {
|
||||||
app.formDecoder.RegisterConverter(sql.NullFloat64{}, converter.ConvertSQLNullFloat64)
|
app.formDecoder.RegisterConverter(sql.NullFloat64{}, converter.ConvertSQLNullFloat64)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (app *App) InitActivityPub() {
|
|
||||||
initActivityPub(app.cfg)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ConnectToDatabase validates and connects to the configured database, then
|
// ConnectToDatabase validates and connects to the configured database, then
|
||||||
// tests the connection.
|
// tests the connection.
|
||||||
func ConnectToDatabase(app *App) error {
|
func ConnectToDatabase(app *App) error {
|
||||||
|
|
Loading…
Reference in New Issue