@@ -373,61 +373,6 @@ patch_profile_for_macos() {
373373 sed_inplace ' s|/usr/src/dappnode|\$HOME/dappnode|g' " $profile "
374374}
375375
376- # macOS (non-server): ensure dappmanager uses remote IPFS services.
377- # This updates ${DAPPNODE_CORE_DIR}/maindb.json with:
378- # "ipfs-gateway": "https://ipfs-gateway.dappnode.net"
379- # "ipfs-client-target": "remote"
380- patch_maindb_for_macos_nonserver () {
381- if ! $IS_MACOS ; then
382- return 0
383- fi
384-
385- local maindb_file=" ${DAPPNODE_CORE_DIR} /maindb.json"
386- # Wait (up to 2 minutes) for maindb.json to exist.
387- local start_seconds
388- start_seconds=$SECONDS
389- while [[ ! -f " $maindb_file " ]]; do
390- if (( SECONDS - start_seconds >= 120 )) ; then
391- warn " macOS non-server: maindb.json not found at ${maindb_file} after 120s; skipping"
392- return 0
393- fi
394- sleep 2
395- done
396-
397- log " macOS non-server: patching maindb.json to use remote IPFS"
398-
399- if ! command -v osascript > /dev/null 2>&1 ; then
400- die " macOS non-server: cannot patch maindb.json (missing 'osascript')"
401- fi
402-
403- osascript -l JavaScript - " $maindb_file " << 'JXA '
404- ObjC.import('Foundation');
405-
406- function run(argv) {
407- var path = argv[0];
408- if (!path) throw new Error('Missing maindb.json path');
409-
410- var data = $.NSData.dataWithContentsOfFile(path);
411- if (!data) throw new Error('Unable to read file: ' + path);
412-
413- var content = ObjC.unwrap($.NSString.alloc.initWithDataEncoding(data, $.NSUTF8StringEncoding));
414- var obj = JSON.parse(content);
415- if (Object.prototype.toString.call(obj) !== '[object Object]') {
416- throw new Error('maindb.json is not a JSON object: ' + path);
417- }
418-
419- obj['ipfs-gateway'] = 'https://ipfs-gateway.dappnode.net';
420- obj['ipfs-client-target'] = 'remote';
421-
422- var out = JSON.stringify(obj, null, 2) + '\n';
423- var outStr = $.NSString.stringWithString(out);
424- var ok = outStr.writeToFileAtomicallyEncodingError(path, true, $.NSUTF8StringEncoding, null);
425- if (!ok) throw new Error('Unable to write file: ' + path);
426- }
427- JXA
428- return 0
429- }
430-
431376bootstrap_filesystem () {
432377 # Clean if update
433378 if [[ " ${UPDATE} " == " true" ]]; then
@@ -976,11 +921,6 @@ main() {
976921 echo " DAppNode installed" 2>&1 | tee -a " $LOGFILE "
977922 dappnode_core_start
978923
979- # macOS non-server machines should not try to use local IPFS.
980- if ! is_always_on_mac; then
981- patch_maindb_for_macos_nonserver
982- fi
983-
984924 echo " "
985925 echo " Waiting for VPN initialization..."
986926 wait_for_internal_ip " DAppNodeCore-dappmanager.dnp.dappnode.eth" 120 10
0 commit comments