docker-perkeep/docker-entrypoint.sh

23 lines
695 B
Bash
Raw Normal View History

2023-08-02 19:35:49 +00:00
#!/bin/sh
2023-08-02 20:06:27 +00:00
if [ "T$PASSWORD" == "T" ];
then
return 1;
fi
if [ "T$SECRING" != "T" ] && [ "T$IDENTITY" != "T" ];
then
echo "$SECRING" > /perkeep/config/identity-secring.gpg
envsubst < /perkeep/config/server-config-custom.tpl.json > /perkeep/config/server-config-custom.json
fi
2023-08-02 19:35:49 +00:00
if [ ! -f /perkeep/config/identity-secring.gpg ];
then
pk put init -newkey
mv perkeep/.config/perkeep/identity-secring.gpg /perkeep/config/
2023-08-02 20:06:27 +00:00
export IDENTITY=$(sed -n -e '/identity/ s/.*:.*"\(.*\)".*/\1/p' /perkeep/.config/perkeep/client-config.json | tee /dev/tty)
envsubst < /perkeep/config/server-config-custom.tpl.json > /perkeep/config/server-config-custom.json
2023-08-02 19:35:49 +00:00
rm -r /perkeep/.config
fi
exec "$@"