Compare commits
2 Commits
remote_ins
...
db43e381dc
Author | SHA1 | Date | |
---|---|---|---|
db43e381dc | |||
f16ba8821d |
19
.drone.yml
Normal file
19
.drone.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: automated container publishing
|
||||||
|
steps:
|
||||||
|
- name: publish image
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: docker_reg_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_reg_passwd
|
||||||
|
repo: decentral1se/gotosocial
|
||||||
|
tags: latest
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
 
|
 
|
||||||
|
|
||||||
|
[](https://drone.autonomic.zone/autonomic-cooperative/gotosocial)
|
||||||
|
|
||||||
Federated social media software.
|
Federated social media software.
|
||||||
|
|
||||||

|

|
||||||
|
@ -26,7 +26,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/mail"
|
"net/mail"
|
||||||
"regexp"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -48,7 +47,6 @@ type postgresService struct {
|
|||||||
conn *pg.DB
|
conn *pg.DB
|
||||||
log *logrus.Logger
|
log *logrus.Logger
|
||||||
cancel context.CancelFunc
|
cancel context.CancelFunc
|
||||||
// federationDB pub.Database
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPostgresService returns a postgresService derived from the provided config, which implements the go-fed DB interface.
|
// NewPostgresService returns a postgresService derived from the provided config, which implements the go-fed DB interface.
|
||||||
@ -120,12 +118,6 @@ func derivePGOptions(c *config.Config) (*pg.Options, error) {
|
|||||||
return nil, errors.New("no address set")
|
return nil, errors.New("no address set")
|
||||||
}
|
}
|
||||||
|
|
||||||
ipv4Regex := regexp.MustCompile(`^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$`)
|
|
||||||
hostnameRegex := regexp.MustCompile(`^(?:[a-z0-9]+(?:-[a-z0-9]+)*\.)+[a-z]{2,}$`)
|
|
||||||
if !hostnameRegex.MatchString(c.DBConfig.Address) && !ipv4Regex.MatchString(c.DBConfig.Address) && c.DBConfig.Address != "localhost" {
|
|
||||||
return nil, fmt.Errorf("address %s was neither an ipv4 address nor a valid hostname", c.DBConfig.Address)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate username
|
// validate username
|
||||||
if c.DBConfig.User == "" {
|
if c.DBConfig.User == "" {
|
||||||
return nil, errors.New("no user set")
|
return nil, errors.New("no user set")
|
||||||
|
Reference in New Issue
Block a user