1
0
Fork 0
mirror of https://github.com/anyproto/any-sync-dockercompose.git synced 2025-06-08 05:47:03 +09:00
This commit is contained in:
Grigory Efimov 2023-08-16 01:31:06 +03:00
parent 99f1d4bc20
commit 4284b105f5
2 changed files with 6 additions and 6 deletions

View file

@ -6,7 +6,7 @@ RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
RUN git config --global url.ssh://git@github.com/.insteadOf https://github.com/
# }}
RUN apt-get install -y yq
RUN wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq
WORKDIR /generateconfig
COPY .env /.env

10
gen.sh
View file

@ -5,8 +5,8 @@ source /.env
# generate networkId
if ! [[ -s .networkId ]]; then
anyconf create-network
yq -r .networkId nodes.yml > .networkId
yq -r .account.signingKey account.yml > .networkSigningKey
cat nodes.yml | grep '^networkId:' | awk '{print $NF}' > .networkId
cat account.yml | yq '.account.signingKey' > .networkSigningKey
fi
NETWORK_ID=$( cat .networkId)
NETWORK_SIGNING_KEY=$( cat .networkSigningKey )
@ -28,6 +28,6 @@ if ! [[ -s account0.yml ]]; then
fi
yq -yi ".networkId |= \"${NETWORK_ID}\"" nodes.yml
yq -yi ".account.signingKey |= \"${NETWORK_SIGNING_KEY}\"" account3.yml
yq -yi ".account.signingKey |= \"${NETWORK_SIGNING_KEY}\"" account5.yml
yq --indent 4 --inplace ".networkId |= \"${NETWORK_ID}\"" nodes.yml
yq --indent 4 --inplace ".account.signingKey |= \"${NETWORK_SIGNING_KEY}\"" account3.yml
yq --indent 4 --inplace ".account.signingKey |= \"${NETWORK_SIGNING_KEY}\"" account5.yml