Skip to content

Commit 3e220a4

Browse files
committed
Pass credentials file explicitly
1 parent c425250 commit 3e220a4

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
github.com/rs/zerolog v1.33.0
1010
go.mau.fi/util v0.8.3
1111
go.mau.fi/zeroconfig v0.1.3
12+
google.golang.org/api v0.170.0
1213
)
1314

1415
require (
@@ -47,7 +48,6 @@ require (
4748
golang.org/x/sys v0.28.0 // indirect
4849
golang.org/x/text v0.21.0 // indirect
4950
golang.org/x/time v0.5.0 // indirect
50-
google.golang.org/api v0.170.0 // indirect
5151
google.golang.org/appengine v1.6.8 // indirect
5252
google.golang.org/appengine/v2 v2.0.2 // indirect
5353
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect

push.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import (
3939
"go.mau.fi/util/ptr"
4040
"go.mau.fi/util/requestlog"
4141
"go.mau.fi/zeroconfig"
42+
"google.golang.org/api/option"
4243
)
4344

4445
var fcmPackageName = os.Getenv("FCM_PACKAGE_NAME")
@@ -81,7 +82,7 @@ func main() {
8182
),
8283
}
8384
ctx := log.WithContext(context.Background())
84-
app := exerrors.Must(firebase.NewApp(ctx, nil))
85+
app := exerrors.Must(firebase.NewApp(ctx, nil, option.WithCredentialsFile(os.Getenv("FCM_CREDENTIALS_FILE"))))
8586
fcmClient = exerrors.Must(app.Messaging(ctx))
8687
go func() {
8788
c := make(chan os.Signal, 1)

0 commit comments

Comments
 (0)