Skip to content

Commit

Permalink
Merge pull request #7026 from TheThingsNetwork/backport/docker-and-to…
Browse files Browse the repository at this point in the history
…ols-changes

Backport of docker and tools changes
  • Loading branch information
nicholaspcr authored Apr 11, 2024
2 parents 47ecec5 + 40f9247 commit 99c8054
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ services:
TTN_LW_BLOB_LOCAL_DIRECTORY: /srv/ttn-lorawan/public/blob
TTN_LW_REDIS_ADDRESS: redis:6379
TTN_LW_IS_DATABASE_URI: postgres://root:root@postgres:5432/ttn_lorawan_dev?sslmode=disable

ports:
# If deploying on a public server:
# - "80:1885"
Expand All @@ -57,12 +56,13 @@ services:
- "1887:1887"
- "8887:8887"
- "1700:1700/udp"

# If using custom certificates:
secrets:
- ca.pem
- cert.pem
- key.pem
extra_hosts:
- "host.docker.internal:host-gateway"

# If using custom certificates:
secrets:
Expand Down
12 changes: 11 additions & 1 deletion tools/mage/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ package ttnmage
import (
"context"
"fmt"
"io/fs"
"log"
"os"
"strings"

"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
"go.thethings.network/lorawan-stack/v3/pkg/errors"
)

const (
Expand Down Expand Up @@ -57,10 +60,17 @@ func (SQL) Fmt(context.Context) error {

func walkDir(root string, apply func(path string, filename string) error) error {
files, err := os.ReadDir(root)
if err != nil {
if err != nil && !errors.Is(err, fs.ErrPermission) {
return err
}

if errors.Is(err, fs.ErrPermission) {
if mg.Verbose() {
log.Printf("skipping '%s' file due to permission denied\n", root)
}
return nil
}

for _, file := range files {
if file.IsDir() {
err = walkDir(root+"/"+file.Name(), apply)
Expand Down

0 comments on commit 99c8054

Please sign in to comment.