Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit 077c5b7

Browse files
authored
Skip IPFS config if DISABLE_IPFS env var is set (#67)
* Skip ipfs config if ipfs is disabled Using the environment variable to check if it's set, skip if it is. * Update readme-vars.yml Changelog update for "Skip IPFS config" if env variable is set.
1 parent 7d5d7d9 commit 077c5b7

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ app_setup_block: |
9090
9191
# changelog
9292
changelogs:
93+
- {date: "28.01.24:", desc: "Skip IPFS config if DISABLE_IPFS is set as env variable."}
9394
- {date: "27.01.24:", desc: "Add atari5200 support."}
9495
- {date: "24.01.24:", desc: "Pin node back on aarch64 as well for compatibility."}
9596
- {date: "23.01.24:", desc: "Add logic to symlink out RO rom directories to support upgrades."}

root/etc/s6-overlay/s6-rc.d/init-emulatorjs-config/run

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@
55
lsiown abc:abc \
66
/data
77

8-
# ipfs migrate check on startup
9-
if [[ -d "/data/.ipfs" ]]; then
10-
echo "[ipfs-upgrade] Checking if fs-repo needs to be upgraded (this may take some time)"
11-
HOME=/data s6-setuidgid abc /usr/bin/fs-repo-migrations -y -to 15
12-
fi
8+
# check if ipfs is disabled
9+
if [ -z ${DISABLE_IPFS+x} ]; then
10+
11+
# ipfs migrate check on startup
12+
if [[ -d "/data/.ipfs" ]]; then
13+
echo "[ipfs-upgrade] Checking if fs-repo needs to be upgraded (this may take some time)"
14+
HOME=/data s6-setuidgid abc /usr/bin/fs-repo-migrations -y -to 15
15+
fi
1316

14-
# ipfs config
15-
if [[ ! -d "/data/.ipfs" ]]; then
16-
HOME=/data ipfs init --profile lowpower
17-
lsiown -R abc:abc /data/.ipfs
17+
# ipfs config
18+
if [[ ! -d "/data/.ipfs" ]]; then
19+
HOME=/data ipfs init --profile lowpower
20+
lsiown -R abc:abc /data/.ipfs
21+
fi
1822
fi
1923

2024
# link user data to frontend
@@ -26,11 +30,11 @@ fi
2630
if [[ ! -d '/config/profile/default' ]]; then
2731
mkdir -p /config/profile/default
2832
echo "input_menu_toggle_gamepad_combo = 3
29-
system_directory = /home/web_user/retroarch/system/" > /config/profile/default/retroarch.cfg
33+
system_directory = /home/web_user/retroarch/system/" >/config/profile/default/retroarch.cfg
3034
lsiown -R abc:abc /config/profile
3135
fi
3236
if [[ ! -f '/config/profile/profile.json' ]]; then
33-
echo '{}' > /config/profile/profile.json
37+
echo '{}' >/config/profile/profile.json
3438
lsiown -R abc:abc /config/profile
3539
fi
3640

@@ -44,8 +48,8 @@ lsiown -R abc:root /var/lib/nginx
4448
DIRS='3do atari2600 atari5200 atari7800 colecovision doom gba lynx n64 nes odyssey2 psx segaCD segaMD segaSaturn snes vb ws arcade atari5200 gb gbc jaguar msx nds ngp pce sega32x segaGG segaMS segaSG vectrex'
4549
for DIR in ${DIRS}; do
4650
if [[ -d "/roms/${DIR}" ]] && [[ ! -L "/data/${DIR}/roms" ]]; then
47-
mkdir -p /data/${DIR}
48-
ln -s /roms/${DIR} /data/${DIR}/roms
49-
lsiown abc:abc /data/${DIR}
51+
mkdir -p "/data/${DIR}"
52+
ln -s "/roms/${DIR}" "/data/${DIR}/roms"
53+
lsiown abc:abc "/data/${DIR}"
5054
fi
5155
done

0 commit comments

Comments
 (0)