Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

earnapp binary name in download endpoint changed #48

Open
MRColorR opened this issue Jan 2, 2025 · 4 comments
Open

earnapp binary name in download endpoint changed #48

MRColorR opened this issue Jan 2, 2025 · 4 comments

Comments

@MRColorR
Copy link

MRColorR commented Jan 2, 2025

the current logic is outdated ad earnapp updated their website and their executables filenames.

old:

#!/bin/bash

archs=`uname -m`
if [ $archs = "x86_64" ]; then
    file=bin_64
elif [ $archs = "amd64" ]; then
    file=bin_64
elif [ $archs = "armv7l" ]; then
    file=armv7
elif [ $archs = "armv6l" ]; then
    file=armv7
elif [ $archs = "aarch64" ]; then
    file=aarch64
elif [ $archs = "arm64" ]; then
    file=aarch64
else
    file=armv7
fi
mkdir /download
wget -cq --no-check-certificate https://brightdata.com/static/earnapp/$file -O /download/earnapp

current:

STATUS_FILE="/etc/earnapp/status"
if [ ! -f $STATUS_FILE ]; then
    perr "04_dir_create"
    print "✔ Creating directory /etc/earnapp"
    mkdir -p /etc/earnapp
    chmod a+wr /etc/earnapp/
    touch "$STATUS_FILE"
    chmod a+wr "$STATUS_FILE"
else
    LOG_FILENAME="$LOG_DIR/dir.log"
    ls -al /etc/earnapp -I "*.sent" > "$LOG_FILENAME"
    read_log
    perr "04_dir_existed" "$STATUS_FILE" "$LOG"
    print "✔ System directory already exists"
fi
if [ "$OS_ARCH" = "x86_64" ]; then
    file=$PRODUCT-x64-$VERSION
elif [ "$OS_ARCH" = "amd64" ]; then
    file=$PRODUCT-x64-$VERSION
elif [ "$OS_ARCH" = "armv7l" ]; then
    file=$PRODUCT-arm7l-$VERSION
elif [ "$OS_ARCH" = "armv6l" ]; then
    file=$PRODUCT-arm7l-$VERSION
elif [ "$OS_ARCH" = "aarch64" ]; then
    file=$PRODUCT-aarch64-$VERSION
elif [ "$OS_ARCH" = "arm64" ]; then
    file=$PRODUCT-aarch64-$VERSION
else
    perr "10_arch_other" "$OS_ARCH"
    file=$PRODUCT-arm7l-$VERSION
fi
print "✔ Fetching $file"
perr "15_fetch_start" "$file"
FILENAME="/tmp/earnapp_$VERSION"
LOG_FILENAME="$LOG_DIR/earnapp_fetch.log"
BASE_URL="${BASE_URL:-https://cdn-earnapp.b-cdn.net/static}"
if wget -c "$BASE_URL/$file" \
    -O "$FILENAME" 2>$LOG_FILENAME; then
    read_log
    perr "17_fetch_finished" "$file" "$LOG"
else
    read_log
    perr "16_fetch_failed" "$file" "$LOG"
    print "⚠ Failed"
    exit 1
fi
echo | md5sum $FILENAME
chmod +x $FILENAME

The current image is still functional, but new builds will require an update to this logic.

I've forked the repository to explore the possibility of using the EarnApp install script for better maintainability of the image. I successfully installed and ran EarnApp by passing my UUID (I prefer using the lite image version), but the device doesn't appear online on the dashboard. Feel free to take a look if you're interested. If it works as intended, I'll open a PR.

@eherranzr
Copy link

+1 on this request. Earnapp is no longer working (at least for me) and there's no log output just the container exiting. Would love to test @MRColorR solution

@eherranzr
Copy link

@MRColorR, seems like this repository is no longer being updated. It would be great if you could upload your fork to docker-hub so that we can use it. Thanks!

@MRColorR
Copy link
Author

@MRColorR, seems like this repository is no longer being updated. It would be great if you could upload your fork to docker-hub so that we can use it. Thanks!

I can push it next week if you would like. It is still a work in progress, and I hope it can be merged back into the main project someday.

Please feel free to test it and contribute if you wish.

@eherranzr
Copy link

@MRColorR, seems like this repository is no longer being updated. It would be great if you could upload your fork to docker-hub so that we can use it. Thanks!

I can push it next week if you would like. It is still a work in progress, and I hope it can be merged back into the main project someday.

Please feel free to test it and contribute if you wish.

It would be great. Please update this issue so that I can test it and hopefully so that it can be merged back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants