Skip to content

Commit

Permalink
Merge branch 'master' into implement-custom-acme
Browse files Browse the repository at this point in the history
  • Loading branch information
t0xicCode authored Jul 21, 2023
2 parents 20e8c8b + 27e8251 commit daad941
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 99 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ jobs:
name: Lint Sourcecode
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.18.4

- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: v1.35
version: v1.48
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ acme-dns.log
.vagrant
coverage.out
.idea/
dist/
22 changes: 11 additions & 11 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ builds:
goos:
- linux
goarch:
- 386
- amd64

archive:
format: tar.gz
files:
- LICENSE
- README.md
- Dockerfile
- config.cfg
- acme-dns.service
archives:
- id: tgz
format: tar.gz
files:
- LICENSE
- README.md
- Dockerfile
- config.cfg
- acme-dns.service

sign:
artifacts: checksum
signs:
- artifacts: checksum
2 changes: 1 addition & 1 deletion challengeprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ func (c *ChallengeProvider) CleanUp(ctx context.Context, _ acme.Challenge) error
// Wait is a dummy function as we are just going to be ready to answer the challenge from the get-go
func (c *ChallengeProvider) Wait(_ context.Context, _ acme.Challenge) error {
return nil
}
}
20 changes: 10 additions & 10 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func getSQLiteStmt(s string) string {
}

func (d *acmedb) Init(engine string, connection string) error {
d.Lock()
defer d.Unlock()
d.Mutex.Lock()
defer d.Mutex.Unlock()
db, err := sql.Open(engine, connection)
if err != nil {
return err
Expand Down Expand Up @@ -171,8 +171,8 @@ func (d *acmedb) NewTXTValuesInTransaction(tx *sql.Tx, subdomain string) error {
}

func (d *acmedb) Register(afrom cidrslice) (ACMETxt, error) {
d.Lock()
defer d.Unlock()
d.Mutex.Lock()
defer d.Mutex.Unlock()
var err error
tx, err := d.DB.Begin()
// Rollback if errored, commit if not
Expand Down Expand Up @@ -210,8 +210,8 @@ func (d *acmedb) Register(afrom cidrslice) (ACMETxt, error) {
}

func (d *acmedb) GetByUsername(u uuid.UUID) (ACMETxt, error) {
d.Lock()
defer d.Unlock()
d.Mutex.Lock()
defer d.Mutex.Unlock()
var results []ACMETxt
getSQL := `
SELECT Username, Password, Subdomain, AllowFrom
Expand Down Expand Up @@ -248,8 +248,8 @@ func (d *acmedb) GetByUsername(u uuid.UUID) (ACMETxt, error) {
}

func (d *acmedb) GetTXTForDomain(domain string) ([]string, error) {
d.Lock()
defer d.Unlock()
d.Mutex.Lock()
defer d.Mutex.Unlock()
domain = sanitizeString(domain)
var txts []string
getSQL := `
Expand Down Expand Up @@ -282,8 +282,8 @@ func (d *acmedb) GetTXTForDomain(domain string) ([]string, error) {
}

func (d *acmedb) Update(a ACMETxtPost) error {
d.Lock()
defer d.Unlock()
d.Mutex.Lock()
defer d.Mutex.Unlock()
var err error
// Data in a is already sanitized
timenow := time.Now().Unix()
Expand Down
29 changes: 14 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/joohoi/acme-dns
go 1.16

require (
github.com/BurntSushi/toml v0.4.1
github.com/BurntSushi/toml v1.2.1
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/ajg/form v1.5.1 // indirect
github.com/caddyserver/certmagic v0.15.2
github.com/caddyserver/certmagic v0.17.2
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 // indirect
github.com/gavv/httpexpect v2.0.0+incompatible
Expand All @@ -15,25 +15,24 @@ require (
github.com/gorilla/websocket v1.4.2 // indirect
github.com/imkira/go-interpol v1.1.0 // indirect
github.com/julienschmidt/httprouter v1.3.0
github.com/lib/pq v1.10.4
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/lib/pq v1.10.7
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-sqlite3 v1.14.10
github.com/mholt/acmez v1.0.1
github.com/miekg/dns v1.1.45
github.com/mattn/go-sqlite3 v1.14.16
github.com/mholt/acmez v1.1.0
github.com/miekg/dns v1.1.51
github.com/moul/http2curl v1.0.0 // indirect
github.com/rs/cors v1.8.2
github.com/rs/cors v1.8.3
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/sirupsen/logrus v1.9.0
github.com/valyala/fasthttp v1.31.0 // indirect
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/yudai/pp v2.0.1+incompatible // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.20.0 // indirect
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3
golang.org/x/net v0.0.0-20220107192237-5cfca573fb4d // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/tools v0.1.8 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.7.0
golang.org/x/mod v0.9.0 // indirect
)
Loading

0 comments on commit daad941

Please sign in to comment.