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

M4B 2.0 "overhaul" #42

Merged
merged 50 commits into from
May 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
4b5e665
refactor fn_setupApp to use flags and updated fn_envSetup accordingly
MRColorR Mar 24, 2023
79c0410
fixed missing proxyrack link in menu option1
MRColorR Mar 24, 2023
ff8e5ae
reworked --uuid flag to loop until valid reply is given
MRColorR Mar 24, 2023
0c24b12
fixed bad logic in while loop for flag with arguments
MRColorR Mar 30, 2023
2dbf509
refactor fn_setupApp to use flags and updated fn_envSetup accordingly
MRColorR Mar 24, 2023
9d91eec
fixed missing proxyrack link in menu option1
MRColorR Mar 24, 2023
6eed186
reworked --uuid flag to loop until valid reply is given
MRColorR Mar 24, 2023
6c08415
fixed bad logic in while loop for flag with arguments
MRColorR Mar 30, 2023
8d95f83
Merge branch 'dev' of https://github.com/MRColorR/money4band into dev
MRColorR May 6, 2023
6a6f2c5
colors and docker install - optimizing runme 1
MRColorR May 6, 2023
ce91d78
rework 2
MRColorR May 6, 2023
6ce3328
current code optimization 3
MRColorR May 7, 2023
514c4f7
code optimization 4
MRColorR May 7, 2023
7ce7be5
optimization complete
MRColorR May 8, 2023
6a7bc57
Testing Proxy settings
LorenzoBrilli May 9, 2023
9069dea
Proxy testing and visual bugfix
LorenzoBrilli May 9, 2023
d2a118e
fixed # positioning for tun2socks setup
MRColorR May 10, 2023
f988d1c
new enhanced proxy setup, #30 should be solved
MRColorR May 10, 2023
0dc2913
avoid unecessary DNS redirect requests
MRColorR May 10, 2023
1bb5eca
fixed missing proxy setup flag
MRColorR May 10, 2023
fc5c396
moved containers names to lowercase
MRColorR May 10, 2023
72a721e
Added Proxylite support as per #39
MRColorR May 12, 2023
446a912
Update README.md
MRColorR May 12, 2023
83da741
showlinks rework to suport dynamic number of apps in the future
MRColorR May 12, 2023
7344a12
Merge branch 'dev' of https://github.com/MRColorR/money4band into dev
MRColorR May 12, 2023
66d2231
new static confi file for adding app dinamically
MRColorR May 12, 2023
9759613
remove unused proxyrack env variable
MRColorR May 12, 2023
cdb4558
new dynamic app setup pt 1
MRColorR May 12, 2023
e789ac0
moved flags in arrays
MRColorR May 12, 2023
7172862
new dynamic app loader complete
MRColorR May 12, 2023
8d3b421
fixed bad stack proxy substitution , new dynamic app setup complete
MRColorR May 13, 2023
b0977c1
new dynamic web dasboard 1
MRColorR May 13, 2023
d6be4ae
visual improvements and improved notificationsetup logic
MRColorR May 13, 2023
c02d0bd
completed new dynamic webdashboard
MRColorR May 13, 2023
e6ad07d
fixed env setup yn prompt logic
MRColorR May 13, 2023
df02b0d
removed redundant informations from .env
MRColorR May 13, 2023
b1b1901
updated readme informations regarding new features
MRColorR May 13, 2023
a04d234
fixed a smal typo in a message
MRColorR May 13, 2023
8b15795
simpler messages in the bitping setup script as it should always be l…
MRColorR May 13, 2023
c8596b2
better docker binfmt service
MRColorR May 13, 2023
b8c5e11
better error handling and new DockerBinfms function
MRColorR May 13, 2023
d09326f
better arch emulation service installer and better error function
MRColorR May 13, 2023
2ceb35c
fixed missing DEFAULT color in color array
MRColorR May 13, 2023
da33e49
removed set -euo pipefail as it's causing early exit also in good sit…
MRColorR May 13, 2023
b3e5c88
enable the use of addDockerBinfmtSVC
MRColorR May 13, 2023
bad0598
fixed typo in a info string
MRColorR May 13, 2023
685d2e8
fixed old naming for logo leading to no picture
MRColorR May 13, 2023
6cb5a1a
enhanced colors for some info messages
MRColorR May 13, 2023
052b798
Update README.md
MRColorR May 13, 2023
3411de2
Update README.md
MRColorR May 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 8 additions & 30 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@
# Prevent access from unauthorized users on this machine.
######################################################################
#
#FIRST OF ALL PLEASE REGISTER ON THE PLATFORMS USING THIS LINKS, YOU'LL NEED TO ENTER SOME DATA BELOW:
# 1) Earnapp | https://earnapp.com/i/3zulx7k
# 2) HoneyGain | https://r.honeygain.me/MINDL15721
# 3) IPROYAL | https://pawns.app?r=MiNe
# 4) PACKETSTREAM | https://packetstream.io/?psr=3zSD
# 5) PEER2PROFIT | https://p2pr.me/165849012262da8d0aa13c8
# 6) TRAFFMONETIZER | https://traffmonetizer.com/?aff=366499
# 7) REPOCKET | https://link.repocket.co/hr8i
# 8) PROXYRACK | https://peer.proxyrack.com/ref/myoas6qttvhuvkzh8ffx90ns1ouhwgilfgamo5ex
# 9) BITPING | https://app.bitping.com?r=qm7mIuX3
#FIRST OF ALL PLEASE REGISTER ON THE PLATFORMS USING THE LINKS PROVIDED IN THE README OR BY THE SCRIPT AUTOCONFIG, YOU'LL NEED TO ENTER SOME DATA BELOW:
#
######################################################################
## PROJECT NAME
Expand All @@ -26,67 +17,54 @@ COMPOSE_PROJECT_NAME=money4band
## MACHINE NAME (for display in apps' dashboard if the app permits this)
DEVICE_NAME=yourDeviceName

## PROXY CONFIGURATION
# protocol://username:password@ip:port or protocol://ip:port
# STACK_PROXY=

## EARNAPP
# Your Earnapp device id : ! must start with sdk-node-<md5sum>
# <md5sum> can be done this way : echo "your random string" | md5sum (get the 32 char result)
# or just paste your device_name or another string to https://www.md5hashgenerator.com/ and copy the result in the device UUID after the sdk-node- part
# or you can generate one directly using the full privileged image for earnapp
# A few time after starting it successfully : register your node on earnapp dashboard : https://earnapp.com/r/<your device id>
EARNAPP_DEVICE_UUID=sdk-node-yourEARNAPPMD5sum
# EARNAPP_HTTP_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port
# EARNAPP_HTTPS_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port


## HONEYGAIN
# Your Honeygain account email
# Your Honeygain account password
HONEYGAIN_EMAIL=yourHONEYGAINMail
HONEYGAIN_PASSWD=yourHONEYGAINPw
# HONEYGAIN_HTTP_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port
# HONEYGAIN_HTTPS_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port

## IPROYAL
# Your IproyalPawns account email
# Your IproyalPawns account password
IPROYALPAWNS_EMAIL=yourIPROYALPAWNSMail
IPROYALPAWNS_PASSWD=yourIPROYALPAWNSPw
# IPROYALPAWNS_HTTP_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port
# IPROYALPAWNS_HTTPS_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port

## PEER2PROFIT
# Your Peer2profit account email
PEER2PROFIT_EMAIL=yourPEER2PROFITMail
# PEER2PROFIT_HTTP_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port
# PEER2PROFIT_HTTPS_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port

## PACKETSTREAM
# Your packetstream CID (to retrieve in your packetstream dashboard : Section : download -> Looking for linux app -> docker command : -e CID=xxxx)
PACKETSTREAM_CID=yourPACKETSTREAMCID
# PACKETSTREAM_HTTP_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port
# PACKETSTREAM_HTTPS_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port

## TRAFFMONETIZER
# Your traffmonetizer token (to retrieve in your traffmonetizer dashboard : Section : dashboard -> Your application token
TRAFFMONETIZER_TOKEN=yourTRAFFMONETIZERToken
# TRAFFMONETIZER_HTTP_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port
# TRAFFMONETIZER_HTTPS_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port

## REPOCKET
REPOCKET_EMAIL=yourREPOCKETMail
REPOCKET_APIKEY=yourREPOCKETAPIKey
# REPOCKET_HTTP_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port
# REPOCKET_HTTPS_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port

## PROXYRACK
PROXYRACK_EMAIL=yourPROXYRACKMail
PROXYRACK_APIKEY=yourPROXYRACKAPIKey
# PROXYRACK_HTTP_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port
# PROXYRACK_HTTPS_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port

## PROXYLITE Your Proxylite USER ID (to retrieve in your proxylite dashboard : Section : download -> look for Your USER ID , it should be a number like 123456 near you account name)
PROXYLITE_USER_ID=yourPROXYLITEUserID

# BITPING
# Bitping have a special firt startup process , see manual setup documentation or use te setup script
# BITPING_HTTP_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port
# BITPING_HTTPS_PROXY=http://proxyUsername:proxyPassword@proxy_url:proxy_port

# WATCHTOWER
# use this container to auto-update containers and send notifications using shoutrrr
Expand Down
10 changes: 6 additions & 4 deletions .resources/.files/docker.binfmt.service
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
[Unit]
Description=Autostart binfmt container as a Service
Description=Autostart binfmt container as a Service by MRColorR
After=docker.service
Requires=docker.service

[Service]
TimeoutStartSec=0
Restart=no
Restart=on-failure
StartLimitIntervalSec=10
StartLimitBurst=2
ExecStartPre=-/usr/bin/docker exec %n stop
ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull tonistiigi/binfmt
ExecStartPre=-/usr/bin/docker pull tonistiigi/binfmt
ExecStart=/usr/bin/docker run --privileged --rm --name %n tonistiigi/binfmt --install all

[Install]
WantedBy=default.target
WantedBy=default.target
2 changes: 0 additions & 2 deletions .resources/.scripts/bitpingSetup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/bash
echo "First of all make sure that you have already run the runme.sh script and that you have registered to the various apps with the links provided."
read -n 1 -s -r -p "if you have already performed these actions, press any key to continue"$'\n'
echo "To configure this app we will need to start an interactive container in a new terminal (so Docker needs to be already installed)."
echo "Then when prompted enter your bitping email and password in it. Hit enter and then close it (or CTRL+C it) as we will not need it anymore"$'\n'
read -n 1 -s -r -p "When ready to start, press any key to continue"$'\n'
Expand Down
41 changes: 14 additions & 27 deletions .resources/.scripts/get-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -e
#
# Git commit from https://github.com/docker/docker-install when
# the script was uploaded (Should only be modified by upload job):
SCRIPT_COMMIT_SHA="4f282167c425347a931ccfd95cc91fab041d414f"
SCRIPT_COMMIT_SHA="a8a6b338bdfedd7ddefb96fe3e7fe7d4036d945a"

# strip "v" prefix if present
VERSION="${VERSION#v}"
Expand Down Expand Up @@ -244,6 +244,9 @@ check_forked() {
fi
dist_version="$(sed 's/\/.*//' /etc/debian_version | sed 's/\..*//')"
case "$dist_version" in
12)
dist_version="bookworm"
;;
11)
dist_version="bullseye"
;;
Expand Down Expand Up @@ -332,6 +335,9 @@ do_install() {
debian|raspbian)
dist_version="$(sed 's/\/.*//' /etc/debian_version | sed 's/\..*//')"
case "$dist_version" in
12)
dist_version="bookworm"
;;
11)
dist_version="bullseye"
;;
Expand Down Expand Up @@ -380,7 +386,7 @@ do_install() {
deprecation_notice "$lsb_dist" "$dist_version"
;;
fedora.*)
if [ "$dist_version" -lt 33 ]; then
if [ "$dist_version" -lt 36 ]; then
deprecation_notice "$lsb_dist" "$dist_version"
fi
;;
Expand Down Expand Up @@ -412,7 +418,7 @@ do_install() {
echo "# WARNING: VERSION pinning is not supported in DRY_RUN"
else
# Will work for incomplete versions IE (17.12), but may not actually grab the "latest" if in the test channel
pkg_pattern="$(echo "$VERSION" | sed "s/-ce-/~ce~.*/g" | sed "s/-/.*/g").*-0~$lsb_dist"
pkg_pattern="$(echo "$VERSION" | sed "s/-ce-/~ce~.*/g" | sed "s/-/.*/g")"
search_command="apt-cache madison 'docker-ce' | grep '$pkg_pattern' | head -1 | awk '{\$1=\$1};1' | cut -d' ' -f 3"
pkg_version="$($sh_c "$search_command")"
echo "INFO: Searching repository for VERSION '$VERSION'"
Expand All @@ -438,24 +444,15 @@ do_install() {
pkgs="$pkgs docker-ce-cli${cli_pkg_version%=} containerd.io"
fi
if version_gte "20.10"; then
pkgs="$pkgs docker-compose-plugin"
pkgs="$pkgs docker-compose-plugin docker-ce-rootless-extras$pkg_version"
fi
if version_gte "20.10" && [ "$(uname -m)" = "x86_64" ]; then
# also install the latest version of the "docker scan" cli-plugin (only supported on x86 currently)
pkgs="$pkgs docker-scan-plugin"
fi
# TODO(thaJeztah) remove the $CHANNEL check once 22.06 and docker-buildx-plugin is published to the "stable" channel
if [ "$CHANNEL" = "test" ] && version_gte "22.06"; then
if version_gte "23.0"; then
pkgs="$pkgs docker-buildx-plugin"
fi
if ! is_dry_run; then
set -x
fi
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends $pkgs >/dev/null"
if version_gte "20.10"; then
# Install docker-ce-rootless-extras without "--no-install-recommends", so as to install slirp4netns when available
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce-rootless-extras${pkg_version%=} >/dev/null"
fi
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $pkgs >/dev/null"
)
echo_docker_as_nonroot
exit 0
Expand Down Expand Up @@ -529,15 +526,10 @@ do_install() {
pkgs="$pkgs docker-ce-cli containerd.io"
fi
fi
if version_gte "20.10" && [ "$(uname -m)" = "x86_64" ]; then
# also install the latest version of the "docker scan" cli-plugin (only supported on x86 currently)
pkgs="$pkgs docker-scan-plugin"
fi
if version_gte "20.10"; then
pkgs="$pkgs docker-compose-plugin docker-ce-rootless-extras$pkg_version"
fi
# TODO(thaJeztah) remove the $CHANNEL check once 22.06 and docker-buildx-plugin is published to the "stable" channel
if [ "$CHANNEL" = "test" ] && version_gte "22.06"; then
if version_gte "23.0"; then
pkgs="$pkgs docker-buildx-plugin"
fi
if ! is_dry_run; then
Expand Down Expand Up @@ -601,10 +593,6 @@ do_install() {
# It's okay for cli_pkg_version to be blank, since older versions don't support a cli package
cli_pkg_version="$($sh_c "$search_command")"
pkg_version="-$pkg_version"

search_command="zypper search -s --match-exact 'docker-ce-rootless-extras' | grep '$pkg_pattern' | tail -1 | awk '{print \$6}'"
rootless_pkg_version="$($sh_c "$search_command")"
rootless_pkg_version="-$rootless_pkg_version"
fi
fi
(
Expand All @@ -620,8 +608,7 @@ do_install() {
if version_gte "20.10"; then
pkgs="$pkgs docker-compose-plugin docker-ce-rootless-extras$pkg_version"
fi
# TODO(thaJeztah) remove the $CHANNEL check once 22.06 and docker-buildx-plugin is published to the "stable" channel
if [ "$CHANNEL" = "test" ] && version_gte "22.06"; then
if version_gte "23.0"; then
pkgs="$pkgs docker-buildx-plugin"
fi
if ! is_dry_run; then
Expand Down
74 changes: 74 additions & 0 deletions .resources/.www/.configs/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"apps": [
{
"name": "EARNAPP",
"dashboard": "https://earnapp.com/dashboard",
"link": "https://earnapp.com/i/3zulx7k",
"image": "fazalfarhan01/earnapp",
"flags": ["--uuid"]
},
{
"name": "HONEYGAIN",
"dashboard": "https://dashboard.honeygain.com/",
"link": "https://r.honeygain.me/MINDL15721",
"image": "honeygain/honeygain",
"flags": ["--email", "--password"]
},
{
"name": "IPROYALPAWNS",
"dashboard": "https://dashboard.pawns.app/",
"link": "https://pawns.app?r=MiNe",
"image": "iproyal/pawns-cli",
"flags": ["--email", "--password"]
},
{
"name": "PEER2PROFIT",
"dashboard": "https://dashboard.peer2profit.app/dashboard",
"link": "https://p2pr.me/165849012262da8d0aa13c8",
"image": "peer2profit/peer2profit_linux",
"flags": ["--email"]
},
{
"name": "PACKETSTREAM",
"dashboard": "https://packetstream.io/dashboard",
"link": "https://packetstream.io/?psr=3zSD",
"image": "packetstream/psclient",
"flags": ["--cid"]
},
{
"name": "TRAFFMONETIZER",
"dashboard": "https://app.traffmonetizer.com/dashboard",
"link": "https://traffmonetizer.com/?aff=366499",
"image": "traffmonetizer/cli",
"flags": ["--token"]
},
{
"name": "REPOCKET",
"dashboard": "https://app.repocket.co/#home",
"link": "https://link.repocket.co/hr8i",
"image": "repocket/repocket",
"flags": ["--email", "--apikey"]
},
{
"name": "PROXYRACK",
"dashboard": "https://peer.proxyrack.com/dashboard",
"link": "https://peer.proxyrack.com/ref/myoas6qttvhuvkzh8ffx90ns1ouhwgilfgamo5ex",
"image": "proxyrack/pop",
"flags": ["--apikey"]
},
{
"name": "PROXYLITE",
"dashboard": "https://proxylite.ru/",
"link": "https://proxylite.ru/?r=PJTKXWN3",
"image": "proxylite/proxyservice",
"flags": ["--userid"]
},
{
"name": "BITPING",
"dashboard": "https://app.bitping.com/earnings",
"link": "https://app.bitping.com?r=qm7mIuX3",
"image": "bitping/bitping-node",
"flags": ["--customScript", "bitpingSetup.sh"]
}
]
}
File renamed without changes.
Loading