diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/bin/.mc/eula.txt b/bin/.mc/eula.txt old mode 100644 new mode 100755 diff --git a/bin/.mc/server.properties b/bin/.mc/server.properties old mode 100644 new mode 100755 diff --git a/bin_arc/script/ngroksenpai.py b/bin_arc/script/ngroksenpai.py old mode 100644 new mode 100755 diff --git a/bin_arc/script/starter.sh b/bin_arc/script/starter.sh old mode 100644 new mode 100755 diff --git a/bin_arc/script/stop.py b/bin_arc/script/stop.py old mode 100644 new mode 100755 diff --git a/bin_arc/templates/index.html b/bin_arc/templates/index.html old mode 100644 new mode 100755 diff --git a/bin_arc/templates/nuke.png b/bin_arc/templates/nuke.png old mode 100644 new mode 100755 diff --git a/bin_arc/ussr-ssl.py b/bin_arc/ussr-ssl.py old mode 100644 new mode 100755 diff --git a/bin_win/script/ngroksenpai.py b/bin_win/script/ngroksenpai.py old mode 100644 new mode 100755 diff --git a/bin_win/script/starter.bat b/bin_win/script/starter.bat old mode 100644 new mode 100755 diff --git a/bin_win/script/stop.py b/bin_win/script/stop.py old mode 100644 new mode 100755 diff --git a/bin_win/templates/index.html b/bin_win/templates/index.html old mode 100644 new mode 100755 diff --git a/bin_win/templates/nuke.png b/bin_win/templates/nuke.png old mode 100644 new mode 100755 diff --git a/bin_win/ussr-ssl.py b/bin_win/ussr-ssl.py old mode 100644 new mode 100755 diff --git a/config/conf.txt b/config/conf.txt old mode 100644 new mode 100755 index ae0bdfd..a84e709 --- a/config/conf.txt +++ b/config/conf.txt @@ -1,7 +1,7 @@ -# conf.txt -# -# uncomment the line below to allow the app to initialise ngrok -# uncommenting the below line also allows the app to automatically send the ngrok urls if config'd correctly -# -# use-ngrok=True -# autongrok=True \ No newline at end of file +# conf.txt +# +# uncomment the line below to allow the app to initialise ngrok +# uncommenting the below line also allows the app to automatically send the ngrok urls if config'd correctly +# +# use-ngrok=True +# autongrok=True diff --git a/config/lock.pa.txt b/config/lock.pa.txt new file mode 100755 index 0000000..e69de29 diff --git a/config/token.txt b/config/token.txt old mode 100644 new mode 100755 diff --git a/config/webhook.txt b/config/webhook.txt old mode 100644 new mode 100755 diff --git a/dependencies/config.py b/dependencies/config.py old mode 100644 new mode 100755 diff --git a/dependencies/prerequisites.bat b/dependencies/prerequisites.bat old mode 100644 new mode 100755 index 77c89ef..f16f7da --- a/dependencies/prerequisites.bat +++ b/dependencies/prerequisites.bat @@ -1,20 +1,23 @@ @echo off +set "currentDir=%cd%" + cd ../config -if exist lock.pa ( - exit /b +if exist lock.pa.txt ( + cd .. + cd scripts + py launcher.py ) else ( echo. ) -where choco >nul 2>nul -if %errorlevel% neq 0 ( - echo Installing Chocolatey... - @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" -) else ( - echo Chocolatey is already installed. -) +cd C:/ProgramData/ +rd /s /q chocolatey * +del /q chocolatey + +echo Installing Chocolatey... +@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" echo Installing curl... choco install curl -y @@ -24,22 +27,47 @@ choco install tar -y echo Installation complete. -mkdir ../ngrok +cd "%currentDir%" + +cd .. +mkdir ngrok cd ngrok -set downloadURL=https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-windows-amd64.zip -set fileName=ngrok-v3-stable-windows-amd64.zip -set extractDir=ngrok +echo Downloading ngrok... +curl -O https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-windows-amd64.zip -curl -o %fileName% %downloadURL% +echo Extracting ngrok... +tar -xf ngrok-v3-stable-windows-amd64.zip -tar -xf %fileName% -C %extractDir% +echo Download and extraction complete. -del %fileName% +cd .. -echo Download and extraction complete. +choco install python39 -y +py -m pip install mcrcon +py -m pip install flask +py -m pip install requests +cd "%currentDir%" cd .. cd config echo. > lock.pa -echo Lock file created. \ No newline at end of file + +cd .. +cd scripts +python launcher.py + +cd "%currentDir%" +cd .. +cd config +echo. > lock.pa + +cd "%currentDir%" +cd .. +cd scripts + +py launcher.py + +cd .. +cd config +echo. > lock.pa \ No newline at end of file diff --git a/instructions.txt b/instructions.txt old mode 100644 new mode 100755 diff --git a/launcher.bat b/launcher.bat old mode 100644 new mode 100755 index 5da0c9d..b759ea0 --- a/launcher.bat +++ b/launcher.bat @@ -1,4 +1,6 @@ :: launcher.bat +set "params=%*" +cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B ) @echo off diff --git a/scripts/launcher.py b/scripts/launcher.py old mode 100644 new mode 100755 index 6f9deac..d6f729f --- a/scripts/launcher.py +++ b/scripts/launcher.py @@ -16,12 +16,14 @@ def clear_screen(): def setup_dependencies_win(): clear_screen() + print("THIS MODE IS DEPRECATED, PLEASE USE THE LAUNCHER.BAT SCRIPT!!") batch_script_path = '../dependencies/prerequisites.bat' subprocess.run([batch_script_path], shell=True) os.chdir('../scripts') def setup_dependencies_arch(): clear_screen() + print("THIS MODE IS DEPRECATED, PLEASE USE THE LAUNCHER.SH SCRIPT!!") os.chdir('../dependencies') os.system('chmod +x install.sh') os.system('./install.sh') @@ -83,9 +85,56 @@ def ussr_for_arch(): def ussr_for_win(): clear_screen() - batch_script_path = 'start.bat' - subprocess.run([batch_script_path], shell=True) - os.chdir('../scripts') + + print("OPTIONAL: If you are not using Ngrok, feel free to use Nn to skip.") + yesnop = input("Did you configure Ngrok token? [Y/N/Nn]") + + if yesnop.lower() == 'y': + pass + + elif yesnop.lower() == 'n': + print("INFO: Your NGROK Authtoken is available at:") + print("https://dashboard.ngrok.com/get-started/your-authtoken") + ngrok_token = input("Enter NGROK authentication token: ") + + webbrowser.open("https://dashboard.ngrok.com/get-started/your-authtoken") + + with open('../config/token.txt', 'w') as file: + file.write(f"{ngrok_token}") + + elif yesnop.lower() == 'Nn': + pass + + else: + print("Only 'y' or 'n'. Indecisive enough?") + + clear_screen() + print("OPTIONAL: If you are not using a webhook, feel free to use Nn to skip.") + print("TIP: It is recommended to use a webhook if you will be using tools such as Tmux!") + + yesnop = input("Did you configure webhook URL? [Y/N/Nn]") + + if yesnop.lower() == 'y': + pass + + elif yesnop.lower() == 'n': + webhook_url = input("Enter webhook URL: ") + + with open('../config/webhook.txt', 'w') as file: + file.write(f"{webhook_url}") + + elif yesnop.lower() == 'Nn': + pass + + else: + print("Only 'y' or 'n'. Indecisive enough?") + + with open('../config/token.txt', 'r') as file: + ngrok_token = file.read().strip() + os.system(f'ngrok config add-authtoken {ngrok_token}') + + os.system('./start.bat') + os.chdir('../scripts') def mc_server(): clear_screen() diff --git a/scripts/start.bat b/scripts/start.bat old mode 100644 new mode 100755 index 063dd65..0d53118 --- a/scripts/start.bat +++ b/scripts/start.bat @@ -6,7 +6,7 @@ cd ../config if exist lock.pa ( cd ../bin_win - python ussr-ssl.py + py ussr-ssl.py ) else ( echo Please install dependencies first. echo Exiting in 3 seconds diff --git a/scripts/start.sh b/scripts/start.sh old mode 100644 new mode 100755