Skip to content

Commit

Permalink
chore: modify docker deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-manole committed Aug 29, 2023
1 parent 414288d commit 3bc656d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion nix/ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
includedPaths = [
"apps.dockerApps.evaluation-test"
];
}
}
5 changes: 4 additions & 1 deletion nix/docker-files/docker.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ inputs', pkgs, l, ... }: let
imgAttributes = {
name = "plutus-certification";
tag = "12";
tag = "13";
};
nixConfig = ''
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
Expand Down Expand Up @@ -31,6 +31,8 @@
${addParameter "use-whitelist" "USE_WHITELIST"}
${addParameter "port" "PORT"}
${addParameter "db-path" "DB_PATH"}
${addParameter "min-amount-for-address-reservation" "MIN_AMOUNT_FOR_ADDRESS_RESERVATION"}
if [ -n "$JWT_SECRET" ];
then
args="$args --jwt-secret $JWT_SECRET"
Expand Down Expand Up @@ -132,6 +134,7 @@ rec {
${addEnvVar "UNSAFE_PLAIN_ADDRESS_AUTH"}
${addEnvVar "PORT"}
${addEnvVar "DB_PATH"}
${addEnvVar "MIN_AMOUNT_FOR_ADDRESS_RESERVATION"}
if [[ -z "$PORT" ]]; then
export PORT=9671
Expand Down
1 change: 1 addition & 0 deletions nix/docker-files/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
JWT_SECRET2=secret \
DB_PATH=./db/certification2.sqlite \
PORT=80 \
MIN_AMOUNT_FOR_ADDRESS_RESERVATION=1000000 \
nix run .#dockerApps.runDockerImage
10 changes: 6 additions & 4 deletions server/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ data Args = Args
, github :: !GitHubArgs
, bypassSubscriptionValidation :: !Bool
, dbPath :: !FilePath
, minAmountForAddressAssessment :: !Word64
, minAmountForAddressAssignment :: !Word64
}

data GitHubArgs = GitHubArgs
Expand Down Expand Up @@ -166,9 +166,11 @@ argsParser = Args
<> Opts.value "./certification.sqlite"
)
<*> option auto
( long "min-amount-for-address-assessment"
( long "min-amount-for-address-reservation"
<> metavar "MIN_AMOUNT"
<> help "the minimum amount of Lovelace required to perform an address assessment"
<> help ( "the minimum amount of Lovelace required to perform an address reservation. "
<> "CAUTION: don't use different values once one was chosen, as this will affect the previously reserved addresses too"
)
<> showDefault
<> Opts.value oneAda
)
Expand Down Expand Up @@ -493,7 +495,7 @@ main = do
ref <- newIORef Nothing
_ <- forkIO $ startTransactionsMonitor
(narrowEventBackend InjectSynchronizer eb) scheduleCrash
(args.wallet) ref 10 (args.minAmountForAddressAssessment)
(args.wallet) ref 10 (args.minAmountForAddressAssignment)
(WithDBWrapper (withDb' (args.dbPath)) )
pure ref
serverArgs args serverCaps r eb whitelist ref serverJWTConfig serverAddressRotation = ServerArgs
Expand Down

0 comments on commit 3bc656d

Please sign in to comment.