Skip to content

Commit ce00ffa

Browse files
Enhance macOS compatibility in installation script (#694)
* Enhance macOS compatibility in installation script - Added checks to ensure the script is executed, not sourced. - Improved OS detection and handling for macOS and Linux. - Updated directory paths for macOS. - Introduced cross-platform helper functions for downloading files and modifying files. - Added functionality to patch the .dappnode_profile for macOS compatibility. - Enhanced user shell configuration to source the profile correctly. - Cleaned up rc.local for Linux installations. - Improved logging and user feedback during installation. * Add macOS support for installation scripts and update DAppNode core start function * Normalize component names to lowercase in download URL and file paths * Update macOS test script to install Docker using Homebrew * Normalize component names to lowercase in Docker image loading logic * Remove macOS test scripts from workflow configuration * Update IPFS endpoint and enhance logging in installation script * Refactor logging in installation script to remove color output and improve readability * uninstall script in macos (#695) * uninstall script in macos * comment reexec under bash * comment * remove colors logic --------- Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> * Enhance installation script with improved error handling, logging, and CLI wrappers for VPN commands * Remove core CLI wrappers from installation script to streamline execution * Add macOS-specific environment variable injection for dappmanager compose * Fix DISABLE_HOST_SCRIPTS environment variable handling in macOS patch function * Initialize DNCORE_COMPOSE_ARGS array to prevent unbound variable errors * Refactor macOS patch function to handle environment variable insertion with temporary file for compatibility * Increase sleep duration to 30 seconds for VPN initialization in installation script * Implement wait_for_internal_ip function to ensure dappmanager publishes INTERNAL_IP before proceeding * Add macOS server detection and adjust package selection for always-on Macs * Add patch for macOS non-server to use remote IPFS services in maindb.json * Enhance wait_for_internal_ip function to check for HOSTNAME alongside INTERNAL_IP and improve error messaging; add wait for maindb.json file existence in macOS non-server patch function * Remove macOS non-server patch for remote IPFS services from installation script * Remove default PROFILE_BRANCH assignment from installation script * Add support for minimal installation mode and enhance argument parsing in installer script * Increase wait time for VPN initialization in installer script * Add function to print VPN access credentials after core startup * Refactor Linux setup steps to conditionally execute based on MINIMAL mode * Add support for Notifications and Premium packages in installation scripts (#696) * Add local profile path argument to DAppNode installation script * Add support for macOS in VPN access credential retrieval * Add support for custom package selection in installation script * Add interactive setup wizard to installation script * Add conditional output for VPN credentials based on selected packages * Remove interactive mode support from installation script * Add support for lite installation mode in the installation script * Refactor installation script by removing macOS-specific checks and unused functions * Improve Docker prerequisite checks in installation script * Remove outdated comment regarding patch_compose_paths function in installation script --------- Co-authored-by: Marc Font <36164126+Marketen@users.noreply.github.com>
1 parent dcd2e86 commit ce00ffa

5 files changed

Lines changed: 989 additions & 229 deletions

File tree

.dappnode_profile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export DAPPMANAGER_VERSION="${DAPPMANAGER_VERSION:-0.2.99}"
1414
export WIFI_VERSION="${WIFI_VERSION:-0.2.9}"
1515
export WIREGUARD_VERSION="${WIREGUARD_VERSION:-0.1.3}"
1616
export HTTPS_VERSION="${HTTPS:-0.2.2}"
17+
export NOTIFICATIONS_VERSION="/ipfs/QmQubxH4WgqEFxvFntef4H2DmuU6mxBRS6XeuShc3owNi9"
18+
export PREMIUM_VERSION="/ipfs/QmXDddoa56HkrvtkGsa3mozpsn9SzQZtoVBWgagcW6SsHy"
1719

1820
export DAPPNODE_DIR="/usr/src/dappnode"
1921
export DAPPNODE_CORE_DIR="${DAPPNODE_DIR}/DNCORE"

.github/workflows/release.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ on:
2626
vpn:
2727
description: "Version of the OpenVPN Package. Only numbers"
2828
required: true
29+
notifications:
30+
description: "IPFS hash of the Notifications Package. Must start with /ipfs/"
31+
required: true
32+
premium:
33+
description: "IPFS hash of the Premium Package. Must start with /ipfs/"
34+
required: true
2935

3036
jobs:
3137
set-versions:
@@ -39,13 +45,16 @@ jobs:
3945
wireguard: ${{ steps.set_outputs.outputs.wireguard }}
4046
https: ${{ steps.set_outputs.outputs.https }}
4147
vpn: ${{ steps.set_outputs.outputs.vpn }}
48+
notifications: ${{ steps.set_outputs.outputs.notifications }}
49+
premium: ${{ steps.set_outputs.outputs.premium }}
4250
core: ${{ steps.set_outputs.outputs.core }}
4351
steps:
4452
- name: Check versions regex
4553
run: |
4654
[[ "${{ github.event.inputs.bind }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.event.inputs.ipfs }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.event.inputs.dappmanager }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && \
4755
[[ "${{ github.event.inputs.wifi }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.event.inputs.wireguard }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.event.inputs.https }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && \
48-
[[ "${{ github.event.inputs.vpn }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.event.inputs.core }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "versions introduced in wrong format"; exit 1; }
56+
[[ "${{ github.event.inputs.vpn }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.event.inputs.core }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && \
57+
[[ "${{ github.event.inputs.notifications }}" =~ ^/ipfs/.+$ ]] && [[ "${{ github.event.inputs.premium }}" =~ ^/ipfs/.+$ ]] || { echo "versions introduced in wrong format"; exit 1; }
4958
- name: Checkout
5059
uses: actions/checkout@v4
5160
- name: Set new versions
@@ -56,7 +65,9 @@ jobs:
5665
sed -i -e "/DAPPMANAGER_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${{ github.event.inputs.dappmanager }}"/" .dappnode_profile
5766
sed -i -e "/WIFI_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${{ github.event.inputs.wifi }}"/" .dappnode_profile
5867
sed -i -e "/WIREGUARD_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${{ github.event.inputs.wireguard }}"/" .dappnode_profile
59-
sed -i -e "/HTTPS_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/"${{ github.event.inputs.https }}"/" .dappnode_profile
68+
sed -i -e "/HTTPS_VERSION/s/[0-9]*\.[0-9]*\.[0-9]*/${{ github.event.inputs.https }}/" .dappnode_profile
69+
sed -i -e "s|^export NOTIFICATIONS_VERSION=.*|export NOTIFICATIONS_VERSION=\"${{ github.event.inputs.notifications }}\"|" .dappnode_profile
70+
sed -i -e "s|^export PREMIUM_VERSION=.*|export PREMIUM_VERSION=\"${{ github.event.inputs.premium }}\"|" .dappnode_profile
6071
cat .dappnode_profile
6172
- name: Create dappnode_profile.sh
6273
run: cp .dappnode_profile dappnode_profile.sh
@@ -76,6 +87,8 @@ jobs:
7687
echo "wireguard=${{ github.event.inputs.wireguard }}" >> $GITHUB_OUTPUT
7788
echo "https=${{ github.event.inputs.https }}" >> $GITHUB_OUTPUT
7889
echo "vpn=${{ github.event.inputs.vpn }}" >> $GITHUB_OUTPUT
90+
echo "notifications=${{ github.event.inputs.notifications }}" >> $GITHUB_OUTPUT
91+
echo "premium=${{ github.event.inputs.premium }}" >> $GITHUB_OUTPUT
7992
8093
build-debian-attended:
8194
name: Build Debian attended ISO

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
sudo /bin/bash ./scripts/dappnode_install_pre.sh UPDATE
2323
- name: Install DAppNode
2424
run: |
25-
sudo /bin/bash ./scripts/dappnode_install.sh
25+
sudo /bin/bash ./scripts/dappnode_install.sh --local-profile-path "$PWD/.dappnode_profile"
2626
- name: Show installation logs
2727
run: |
2828
cat /usr/src/dappnode/logs/install.log
@@ -37,7 +37,7 @@ jobs:
3737

3838
steps:
3939
- name: Checkout
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@v6
4141

4242
# Create Debian ISO
4343
- name: create Debian ISO

0 commit comments

Comments
 (0)