Skip to content

Commit

Permalink
temp: team debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHougaard committed Nov 7, 2024
1 parent 6c04c3f commit 6533d73
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 38 deletions.
44 changes: 9 additions & 35 deletions backend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,48 +1,22 @@
FROM node:20-alpine
FROM --platform=linux/amd64 node:20-alpine

# ? Setup a test SoftHSM module. In production a real HSM is used.

ARG SOFTHSM2_VERSION=2.5.0

ENV SOFTHSM2_VERSION=${SOFTHSM2_VERSION} \
SOFTHSM2_SOURCES=/tmp/softhsm2
# ? App setup

# install build dependencies including python3
RUN apk --update add \
alpine-sdk \
autoconf \
automake \
git \
libtool \
openssl-dev \
python3 \
make \
g++

# build and install SoftHSM2
RUN git clone https://github.com/opendnssec/SoftHSMv2.git ${SOFTHSM2_SOURCES}
WORKDIR ${SOFTHSM2_SOURCES}

RUN git checkout ${SOFTHSM2_VERSION} -b ${SOFTHSM2_VERSION} \
&& sh autogen.sh \
&& ./configure --prefix=/usr/local --disable-gost \
&& make \
&& make install

WORKDIR /root
RUN rm -fr ${SOFTHSM2_SOURCES}

# install pkcs11-tool
RUN apk --update add opensc

RUN softhsm2-util --init-token --slot 0 --label "auth-app" --pin 1234 --so-pin 0000

# ? App setup
g++ \
gcompat \
libstdc++

RUN apk add --no-cache bash curl && curl -1sLf \
'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.alpine.sh' | bash \
&& apk add infisical=0.8.1 && apk add --no-cache git


ENV ChrystokiConfigurationPath=/usr/safenet/lunaclient/


WORKDIR /app

COPY package.json package.json
Expand Down
6 changes: 3 additions & 3 deletions backend/src/lib/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const envSchema = z
.string()
.optional()
.transform((val) => {
if (process.env.NODE_ENV === "development") return "/usr/local/lib/softhsm/libsofthsm2.so";
// if (process.env.NODE_ENV === "development") return "/usr/local/lib/softhsm/libsofthsm2.so";
return val;
})
),
Expand All @@ -180,7 +180,7 @@ const envSchema = z
.string()
.optional()
.transform((val) => {
if (process.env.NODE_ENV === "development") return "1234";
// if (process.env.NODE_ENV === "development") return "1234";
return val;
})
),
Expand All @@ -189,7 +189,7 @@ const envSchema = z
.string()
.optional()
.transform((val) => {
if (process.env.NODE_ENV === "development") return "auth-app";
// if (process.env.NODE_ENV === "development") return "auth-app";
return val;
})
),
Expand Down
1 change: 1 addition & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ services:
- TELEMETRY_ENABLED=false
volumes:
- ./backend/src:/app/src
- "/etc/luna-docker:/usr/safenet/lunaclient"
extra_hosts:
- "host.docker.internal:host-gateway"

Expand Down

0 comments on commit 6533d73

Please sign in to comment.