diff --git a/README.md b/README.md index 7776968..6091d45 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,19 @@ # 💻 Income Generator 💵 -**[ Multi-Platform | Docker Stack | Containerized | Passive Income | Auto Update ]** +**[ Multi-Platform | OS Native | Containerized Stack | Passive Income | Auto Update ]** If you like this project, don't forget to leave a star. ⭐ ->**NOTE:** *"This tool has always been developed for my personal use in mind, therefore the focus has always been Linux first as I run them on my home and cloud servers before making it available to the general public."* -
-## Overview 📚 -**Income Generator** is an all-in-one tool that allows generating passive income by leveraging popular passive income generative applications, everyday devices, and unused internet bandwidth. +**Income Generator** is an all-in-one tool that allows generating passive income by leveraging income generating applications and unused internet bandwidth with minimal system resource. + +Designed for minimal setup and native cross-platform support, utilizing containerized runtime isolation from the host, with full orchestration allowing fast deployment across multiple hosts. -The result is a tool that fully orchestrates, manages, and deploys these applications into an isolated space from the host, simplifying the process, and allowing for fast deployment across stacks with application auto-update management. +📖 It's' strongly recommended to refer to the [**Wiki**](../../wiki) for in-depth details and instructions. -**Some of the key features you can expect:** +## Key Features ✨ - **Easy To Use** - All-in-one solution for managing the stack. Docker installation, start/stop/remove. - **Multi-platform** - Deploy across different OS. - **Global Access** - Access the tool anywhere, just type `igm`. @@ -22,18 +21,17 @@ The result is a tool that fully orchestrates, manages, and deploys these applica - **On-the-fly-update** - Tool can be updated on the fly whilst preserving config settings. - **Local Config** - Config file is auto-generated and stored locally, including credentials. - **Resource Limit** - Easily apply resource limit based on system hardware. -- **Selective Apps** - Enable or disable the application of your choice to deploy. - -📖 Refer to the [**Wiki**](../../wiki) is strongly recommended for more details and in-depth instructions. +- **Selective Apps** - Enable or disable the application of your choice to deploy and earn. +- **Quick Actions** - CLI commands for common operations without launching the tool. ## Getting Started 🚥 ### Prerequisite 📦 **The tool configures and runs everything in a containerized virtualized environment isolated from the host.** -- A 64-bit machine, though it's possible to run on a 32-bit machine, but with certain performance limitations, specifically with lower memory availability. +- A 64-bit machine. It is possible to run on a 32-bit machine, but expect performance or compatibility limitations. - A minimum of 4GB is recommended to ensure the most resource available and for future expansions. -- ARM architecture devices, such as Raspberry Pi, Apple Silicon, etc, require an emulation layer such as [**qemu-user-static (qus)**](https://github.com/dbhi/qus) to run x86 architecture applications on ARM. Installing docker via the tool will enable this automatically. -- For Windows, [**WSL2**](https://learn.microsoft.com/en-us/windows/wsl/install) and [**Winget**](https://learn.microsoft.com/en-us/windows/package-manager) will be required. +- ARM architecture devices, such as Raspberry Pi, Apple Silicon, etc, require an emulation layer such as [**qemu-user-static (qus)**](https://github.com/dbhi/qus) to run x86 architecture applications on ARM. Automatically configured seamlessly through the tool. +- On Windows, [**WSL2**](https://learn.microsoft.com/en-us/windows/wsl/install) and [**Winget**](https://learn.microsoft.com/en-us/windows/package-manager) is required. ### Quick Start Guide ⚙️ If the prerequisites are met based on the platform, you can simply follow the quick start guide, otherwise, refer to the [**Wiki**](../../wiki) for the full setup procedure. @@ -48,7 +46,7 @@ Open the command line and get the bootstrap script. curl -o %APPDATA%\IGM\igm.bat --create-dirs --ssl-no-revoke -L https://raw.githubusercontent.com/XternA/income-generator/main/start.bat ``` Register the bootstrap script by adding an entry to the environment variable path. -``` +```sh for /f "delims=" %i in ('powershell -Command "[Environment]::GetEnvironmentVariable('Path', 'User')"') do set USERPATH=%i && setx PATH %USERPATH%;%APPDATA%\IGM ``` For the registering to take effect, close and re-open a new command line process. @@ -69,7 +67,7 @@ git clone --depth=1 https://github.com/XternA/income-generator.git ~/.income-gen ``` Register alias for global access. (Auto detects and adds to current shell choice e.g. `.bashrc`, `.zshrc` etc.) ```sh -echo "alias igm='(cd ~/.income-generator; sh start.sh)'" >> ~/."${SHELL##*/}"rc; source ~/."${SHELL##*/}"rc +echo "alias igm=\"sh -c 'cd ~/.income-generator; sh start.sh \\\"\\\$@\\\"' --\"" >> ~/."${SHELL##*/}rc"; source ~/."${SHELL##*/}rc" ``` Run the tool. ```sh @@ -90,7 +88,7 @@ Each app has been grouped in the install option. Therefore, whether it be reside | Application | Residential / Mobile IP | VPS / Hosting IP | Devices Per Account | Devices Per IP | Major Payout Type | | --- | :---: | :---: | :---: | :---: | :---: | -| **[EARNAPP](https://bit.ly/4a4XJLF)** | :white_check_mark: | :x: |15|1 | PayPal, Wise | +| **[EARNAPP](https://bit.ly/4a4XJLF)** | :white_check_mark: | :x: |15|1 | PayPal | | **[HONEYGAIN](https://bit.ly/3x6nX1S)** | :white_check_mark: | :x: |10|1 | PayPal, Crypto | | **[PEER2PROFIT](https://bit.ly/3x7CquB)** | :white_check_mark: | :white_check_mark: |Unlimited|Unlimited| Crypto | | **[TRAFFMONETIZER](https://bit.ly/3TKmJlU)** | :white_check_mark: | :white_check_mark: |Unlimited|Unlimited| Crypto | diff --git a/compose/compose.local.yml b/compose/compose.local.yml index 3bb193c..a9042d5 100644 --- a/compose/compose.local.yml +++ b/compose/compose.local.yml @@ -86,7 +86,7 @@ services: nodepay: container_name: nodepay - image: kellphy/nodepay:legacy + image: kellphy/nodepay restart: always environment: - NP_COOKIE=${NODEPAY_COOKIE:-} diff --git a/scripts/app-selection.sh b/scripts/app-selection.sh index 4bc0560..1b9eca5 100644 --- a/scripts/app-selection.sh +++ b/scripts/app-selection.sh @@ -123,7 +123,7 @@ while true; do echo " ${RED}d${NC} = ${RED}disable all${NC}" echo " ${BLUE}0${NC} = ${BLUE}exit${NC}" - printf "\nSelect to ${GREEN}enable${NC} | ${RED}disable${NC} application (1-%s): " "$(echo "$app_data" | wc -l)" + printf "\nSelect to ${GREEN}enable${NC} | ${RED}disable${NC} application (1-%s): " "$(echo "$app_data" | wc -l | xargs)" read -r choice case $choice in diff --git a/scripts/config.sh b/scripts/config.sh index 82b7026..c0ba7f9 100644 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -14,12 +14,12 @@ NC='\033[0m' display_banner() { clear printf $GREEN - echo "==========================================================" - echo "# ${NC}Dotenv Configuration Script${GREEN} #" - echo "==========================================================" - echo "# ${NC}Configure and update the configuration file setup${GREEN} #" - echo "# ${NC}stored within a config file called ${RED}.env${NC}.${GREEN} #" - echo "==========================================================" + echo "===========================================================" + echo "# ${NC}Application Credential Setup Manager${GREEN} #" + echo "===========================================================" + echo "# ${NC}Manage, update and configure application credentials.${GREEN} #" + echo "# ${NC}Credentials are stored locally in a ${RED}.env${NC} config file.${GREEN} #" + echo "===========================================================" printf $NC } @@ -89,7 +89,7 @@ process_entries() { jq -c '.[]' "$JSON_FILE" | while read -r config_entry; do display_banner - entry_count=$(expr $entry_count + 1) + entry_count=$((entry_count + 1)) echo "\nConfiguring application ${RED}$entry_count${NC} of ${RED}$num_entries${NC}" if [ $(echo "$config_entry" | jq -r '.is_enabled') = false ]; then @@ -102,7 +102,7 @@ process_entries() { description_ext=$(echo "$config_entry" | jq -r '.description_ext' | tr -d '\n') registration=$(echo "$config_entry" | jq -r '.registration' | tr -d '\n') - echo "\n[ $app_name ]" + echo "\n[ ${GREEN}$app_name${NC} ]" [ "$url" != null ] && echo "Go to $BLUE$url$NC to register an account. (CTRL + Click)" [ "$description" != null ] && echo "Description: ${YELLOW}$description${NC}" [ "$description_ext" != null ] && echo "${YELLOW}$description_ext${NC}" @@ -143,9 +143,9 @@ process_entries() { display_banner if [ "$change_made" -eq 1 ]; then - echo "\nDone updating dotenv file '${RED}$ENV_FILE${NC}'." + echo "\nDone updating config file '${RED}$ENV_FILE${NC}'." elif [ "$change_made" -eq 0 ] && [ ! -f "$ENV_FILE" ]; then - echo "\nDotenv file '${RED}$ENV_FILE${NC}' was created." + echo "\nDotenv file '${RED}$ENV_FILE${NC}' created." else echo "\nNo changes made to '${RED}$ENV_FILE${NC}'." fi @@ -153,15 +153,17 @@ process_entries() { # Main script if [ -f "$ENV_FILE" ]; then - printf "\nDotenv file '${RED}$ENV_FILE${NC}' found. Configure it? (y/n): "; read -r input + echo "Credentials will be stored in '${RED}$ENV_FILE${NC}'" + printf "\nStart the application setup process? (y/n): "; read -r input if [ "$input" = "y" ]; then process_entries else - echo "No changes made to '${RED}$ENV_FILE${NC}'." + echo "\nNo changes made to '${RED}$ENV_FILE${NC}'." fi else - echo "Dotenv file '${RED}$ENV_FILE${NC}' not found. Creating a new one...\n" + echo "Dotenv file '${RED}$ENV_FILE${NC}' not found. Creating new one...\n" sleep 1.2 touch "$ENV_FILE" process_entries fi +printf "\nPress Enter to continue..."; read -r input < /dev/tty diff --git a/start.bat b/start.bat index ef4676c..15d4050 100644 --- a/start.bat +++ b/start.bat @@ -1,6 +1,10 @@ @echo off setlocal +set ARGS="%*" +set REPO="https://github.com/XternA/income-generator.git" +set TOOL_DIR="~/.income-generator" + winget --version >nul 2>&1 if %errorlevel% neq 0 ( echo No winget found on the system. Please install winget before proceeding. @@ -8,42 +12,30 @@ if %errorlevel% neq 0 ( ) wsl --version >nul 2>&1 -if %errorlevel% equ 0 ( - wsl ! [ -d $HOME/.income-generator ] && call :GetTool - call :CheckAndRegisterAlias - wsl ${SHELL##*/} -ilc "igm" -) else ( +if %errorlevel% neq 0 ( echo No Windows Subsystem for Linux found on the system. Ensure WSL is enabled before proceeding. + exit /b 1 ) + +call :CheckAndRegisterAlias +wsl ${SHELL##*/} -ilc "echo; [ ! -d %TOOL_DIR% ] && git clone --depth=1 %REPO% %TOOL_DIR%; sleep 3; igm %ARGS%" exit /b 0 REM -- Sub-calls ------------- :CheckAndRegisterAlias -wsl -e sh -c "if [ -f $HOME/.aliases ]; then exit 0; else exit 1; fi" +wsl -e sh -c "[ -f $HOME/.aliases ]" if %errorlevel% equ 0 ( - wsl grep -q "igm='(cd ~/.income-generator; sh start.sh)'" "$HOME/.aliases" || call :RegisterToAliases + wsl grep -q "alias igm=" "$HOME/.aliases" || call :RegisterToAliases ) else ( - wsl grep -q "igm='(cd ~/.income-generator; sh start.sh)'" "$HOME/.${SHELL##*/}rc" || call :RegisterToRC + wsl grep -q "alias igm=" "$HOME/.${SHELL##*/}rc" || call :RegisterToRC ) exit /b 0 :RegisterToAliases -wsl -e sh -c "echo \"alias igm='(cd ~/.income-generator; sh start.sh)'\" >> $HOME/.aliases" +wsl -e sh -c "echo 'alias igm=\"sh -c '\''cd %TOOL_DIR%; sh start.sh \\\"\\$@\\\"'\'' --\"' >> $HOME/.aliases" exit /b 0 :RegisterToRC -wsl -e sh -c "echo \"alias igm='(cd ~/.income-generator; sh start.sh)'\" >> $HOME/.${SHELL##*/}rc" -exit /b 0 - -:GetTool -echo: -echo No Income Generator found. Fetching... -echo: - -wsl git clone --depth=1 https://github.com/XternA/income-generator.git $HOME/.income-generator - -echo: -echo Launching... -timeout /t 2 /nobreak >nul 2>&1 +wsl -e sh -c "echo 'alias igm=\"sh -c '\''cd %TOOL_DIR%; sh start.sh \\\"\\$@\\\"'\'' --\"' >> $HOME/.${SHELL##*/}rc" exit /b 0 diff --git a/start.sh b/start.sh index 1317ef0..35af426 100644 --- a/start.sh +++ b/start.sh @@ -2,7 +2,6 @@ sh scripts/init.sh -NEW_UPDATE="$(sh scripts/check-tool-update.sh)" ARCH="$(sh scripts/arch.sh)" STATS="$(sh scripts/limits.sh "$(sh scripts/set-limit.sh | awk '{print $NF}')")" ENV_FILE="$(pwd)/.env" @@ -29,7 +28,18 @@ stats() { printf "%s\n" "$STATS" echo "${GREEN}----------------------------------------${NC}" echo - [ -n "$NEW_UPDATE" ] && echo "$NEW_UPDATE\n" +} + +view_config() { + KEY='\x1b[94m' # Blue + EQUALS='\x1b[91m' # Red + VALUE='\x1b[92m' # Green + RESET='\x1b[0m' # Reset + + echo "${RED}---------[ START OF CONFIG ]---------\n" + tail -n +14 "$ENV_FILE" | sed -e "s/^\([^=]*\)=\(.*\)$/${KEY}\1${EQUALS}=${VALUE}\2${RESET}/" + echo "${RED}\n----------[ END OF CONFIG ]----------${NC}" + printf "\nPress Enter to continue..."; read input } option_1() { @@ -37,11 +47,12 @@ option_1() { display_banner options="(1-4)" - echo "1. Only applications with VPS/Hosting support" - echo "2. All applications including residential IPs only support" - echo "3. All applications including residential IPs only support, excluding single instances only" - echo "4. Applications with unlimited counts" - echo "0. Return to Main Menu" + [ "$1" = "quick_menu" ] && echo "How would you like to install?\n" + echo "1. All applications including residential support" + echo "2. Only applications with only VPS/Hosting support" + echo "3. All applications with residential but exclude single install count" + echo "4. Only applications allowing unlimited install count" + [ "$1" = "quick_menu" ] && echo "0. Exit" || echo "0. Return to Main Menu" echo read -p "Select an option $options: " option @@ -51,13 +62,13 @@ option_1() { install_type="\n" case $option in 1) - install_type="Installing only applications supporting VPS/Hosting..." - compose_files="-f $COMPOSE/compose.yml -f $COMPOSE/compose.unlimited.yml -f $COMPOSE/compose.hosting.yml" - ;; - 2) install_type="Installing all application..." compose_files=$ALL_COMPOSE_FILES ;; + 2) + install_type="Installing only applications supporting VPS/Hosting..." + compose_files="-f $COMPOSE/compose.yml -f $COMPOSE/compose.unlimited.yml -f $COMPOSE/compose.hosting.yml" + ;; 3) install_type="Installing all applications, excluding single instances only..." compose_files="-f $COMPOSE/compose.yml -f $COMPOSE/compose.unlimited.yml -f $COMPOSE/compose.hosting.yml -f $COMPOSE/compose.local.yml" @@ -76,7 +87,7 @@ option_1() { # Check if there are lines after the separator if ! tail -n "+$((line_number + 1))" $ENV_FILE | grep -v '^[[:space:]]*$' | grep -q "^"; then - echo "No configrations for applications found. Make sure to complete the configuration setup." + echo "No configration for applications found. Make sure to complete the configuration setup." echo "Running setup configuration now..." sleep 0.6 sh scripts/config.sh @@ -118,16 +129,12 @@ option_2() { case $option in 1) display_banner - echo "Setting up configurations..." + echo "Setting up application configuration...\n" sh scripts/config.sh - printf "\nPress Enter to continue..."; read input ;; 2) display_banner - echo "---------[ START OF CONFIG ]---------\n${BLUE}" - tail -n +14 $ENV_FILE - echo "${NC}\n----------[ END OF CONFIG ]----------" - printf "\nPress Enter to continue..."; read input + view_config ;; 3) display_banner @@ -261,7 +268,7 @@ option_8() { echo "3. LOW --> 18.75% Total RAM" echo "4. MID --> 25% Total RAM" echo "5. MAX --> 50% Total RAM" - echo "0. Return to Main Menu" + [ "$1" = "quick_menu" ] && echo "0. Exit" || echo "0. Return to Main Menu" echo read -p "Select an option $options: " option @@ -278,6 +285,7 @@ option_8() { echo sh scripts/set-limit.sh "$limit_type" STATS="$(sh scripts/limits.sh "$(sh scripts/set-limit.sh | awk '{print $NF}')")" + echo "\nRedeploy applications for new limits to take effect." ;; 0) break # Return to the main menu @@ -401,40 +409,117 @@ option_9() { } # Main script -while true; do - display_banner - stats - sh scripts/cleanup.sh - - options="(1-9)" - - echo "1. Install & Run Applications" - echo "2. Setup Configuration" - echo "3. Start Applications" - echo "4. Stop Applications" - echo "5. Remove Applications" - echo "6. Show Installed Applications" - echo "7. Manage Docker" - echo "8. Change Resource Limits" - echo "9. Manage Tool" - echo "0. Quit" - echo - read -p "Select an option $options: " choice - - case $choice in - 0) display_banner; echo "Quitting..."; sleep 0.62; clear; exit 0 ;; - 1) option_1 ;; - 2) option_2 ;; - 3) option_3 ;; - 4) option_4 ;; - 5) option_5 ;; - 6) option_6 ;; - 7) option_7 ;; - 8) option_8 ;; - 9) option_9 ;; - *) - echo "\nInvalid option. Please select a valid option $options." - printf "\nPress Enter to continue..."; read input - ;; - esac -done +main_menu() { + while true; do + display_banner + stats + sh scripts/cleanup.sh + [ -n "$NEW_UPDATE" ] && echo "$NEW_UPDATE\n" + + options="(1-9)" + + echo "1. Install & Run Applications" + echo "2. Setup Configuration" + echo "3. Start Applications" + echo "4. Stop Applications" + echo "5. Remove Applications" + echo "6. Show Installed Applications" + echo "7. Manage Docker" + echo "8. Change Resource Limits" + echo "9. Manage Tool" + echo "0. Quit" + echo + read -p "Select an option $options: " choice + + case $choice in + 0) display_banner; echo "Quitting..."; sleep 0.62; clear; exit 0 ;; + 1) option_1 ;; + 2) option_2 ;; + 3) option_3 ;; + 4) option_4 ;; + 5) option_5 ;; + 6) option_6 ;; + 7) option_7 ;; + 8) option_8 ;; + 9) option_9 ;; + *) + echo "\nInvalid option. Please select a valid option $options." + printf "\nPress Enter to continue..."; read input + ;; + esac + done +} + +case "$1" in + --help|help) + display_banner + echo "Quick action menu of common operations.\n" + echo "Usage: igm" + echo "Usage: igm [command]" + + echo "\n[${BLUE}General${NC}]" + echo " igm Launch the Income Generator tool." + echo " igm help Display this help usage guide." + + echo "\n[${BLUE}Manage${NC}]" + echo " igm start Start all currently deployed applications." + echo " igm stop Stop all currently deployed running applications." + echo " igm remove Stop and remove all currently deployed applications." + echo " igm show Show list of installed and running applications." + echo " igm deploy Launch the install manager for deploying applications." + + echo "\n[${BLUE}Configuration${NC}]" + echo " igm app Enable or disable applications for deployment." + echo " igm setup Setup credentials for applications to be deployed." + echo " igm view View all configured application credentials." + echo " igm edit Edit configured credentials and config file directly." + echo " igm limit Set the application resource limits." + echo + ;; + start) + option_3 + clear + ;; + stop) + option_4 + clear + ;; + remove) + option_5 + clear + ;; + show) + option_6 + clear + ;; + deploy) + option_1 quick_menu + clear + ;; + app) + sh scripts/app-selection.sh + clear + ;; + setup) + display_banner + sh scripts/config.sh + clear + ;; + view) + display_banner + view_config + clear + ;; + edit) + nano $ENV_FILE + clear + ;; + limit) + option_8 quick_menu + clear + ;; + *) + NEW_UPDATE="$(sh scripts/check-tool-update.sh)" + main_menu + ;; +esac