Skip to content

Commit 4a1036c

Browse files
committed
switch to environment variable for secret key
1 parent 787a7c9 commit 4a1036c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

worker/src/Main.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ serveDepsInfo json =
8181

8282
getSecret :: IO String
8383
getSecret =
84-
do args <- Env.getArgs
85-
case args of
86-
[secret] ->
84+
do maybeValue <- Env.lookupEnv "STRIPE_SECRET"
85+
case maybeValue of
86+
Just secret ->
8787
return secret
8888

89-
_ ->
89+
Nothing ->
9090
do IO.hPutStrLn IO.stderr
91-
"Expecting a secret for /donate page:\n\
91+
"Expecting environment variable STRIPE_SECRET to be defined:\n\
9292
\\n\
93-
\ ./run-worker sk_test_abcdefghijklmnopqrstuvwxyz\n\
93+
\ STRIPE_SECRET=sk_test_abcdefghijklmnopqrstuvwxyz\n\
9494
\\n\
95-
\Needed for handling donations with Stripe."
95+
\It is needed for handling donations with Stripe."
9696
Exit.exitFailure

0 commit comments

Comments
 (0)