Browse Source

Use APP_PASSWORD in ride-the-lightning

deterministic-app-passwords
Luke Childs 3 years ago
parent
commit
b0d6823a39
  1. 2
      apps/ride-the-lightning/docker-compose.yml
  2. 3
      apps/ride-the-lightning/rtl/RTL-Config.json
  3. 10
      apps/ride-the-lightning/rtl/entrypoint.sh
  4. 9
      scripts/update/01-run.sh

2
apps/ride-the-lightning/docker-compose.yml

@ -13,8 +13,10 @@ services:
- ${APP_DATA_DIR}/loop:/loop
- ${LND_DATA_DIR}:/lnd:ro
- ${BITCOIN_DATA_DIR}:/bitcoin:ro
entrypoint: /data/entrypoint.sh
environment:
# App config
APP_PASSWORD: $APP_PASSWORD
PORT: $APP_RIDE_THE_LIGHTNING_PORT
RTL_CONFIG_PATH: "/data"
CHANNEL_BACKUP_PATH: "/data/backup"

3
apps/ride-the-lightning/rtl/RTL-Config.json

@ -1,6 +1,5 @@
{
"# TODO:": "APP_PASSWORD",
"multiPass": "moneyprintergobrrr",
"multiPass": "$APP_PASSWORD",
"defaultNodeIndex": 1,
"SSO": {
"rtlSSO": 0,

10
apps/ride-the-lightning/rtl/entrypoint.sh

@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Migrate legacy default password
sed -i 's/"multiPassHashed": "70c882380045d35807b45245bd49185991904ff47a5036dfe82103c49f9f0f31"/"multiPass": "'${APP_PASSWORD}'"/' $RTL_CONFIG_PATH/RTL-Config.json
sed -i 's/"multiPass": "moneyprintergobrrr"/"multiPass": "'${APP_PASSWORD}'"/' $RTL_CONFIG_PATH/RTL-Config.json
# Migrate new password placeholder
sed -i 's/$APP_PASSWORD/'${APP_PASSWORD}'/' $RTL_CONFIG_PATH/RTL-Config.json
exec /sbin/tini -g -- node rtl

9
scripts/update/01-run.sh

@ -218,6 +218,15 @@ if [[ -d "${samourai_app_dojo_tor_dir}" ]] && [[ ! -d "${samourai_app_new_dojo_t
mv "${samourai_app_dojo_tor_dir}/" "${samourai_app_new_dojo_tor_dir}"
fi
# Handle updating entrypoint for ride-the-lightning app
rtl_data_dir="${UMBREL_ROOT}/app-data/ride-the-lightning"
rtl_data_entrypoint="${rtl_data_dir}/rtl/entrypoint.sh"
rtl_app_entrypoint="${UMBREL_ROOT}/apps/ride-the-lightning/rtl/entrypoint.sh"
if [[ -d "${rtl_data_dir}" ]]; then
echo "Found ride-the-lightning install, attempting to update entrypoint..."
cp "${rtl_app_entrypoint}" "${rtl_data_entrypoint}"
fi
# Fix permissions
echo "Fixing permissions"
find "$UMBREL_ROOT" -path "$UMBREL_ROOT/app-data" -prune -o -exec chown 1000:1000 {} +

Loading…
Cancel
Save