Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
modified: bin/.mc/eula.txt#
Browse files Browse the repository at this point in the history
	modified:   bin/.mc/server.properties
	modified:   bin_arc/script/ngroksenpai.py
	modified:   bin_arc/script/starter.sh
	modified:   bin_arc/script/stop.py
modified:   bin_arc/templates/index.html
	modified:   bin_arc/templates/nuke.png
	modified:   bin_arc/ussr-ssl.py
	modified:   bin_win/script/ngroksenpai.py#	modified:   bin_win/script/starter.bat
	modified:   bin_win/script/stop.py
	modified:   bin_win/templates/index.html
	modified:   bin_win/templates/nuke.png
modified:   bin_win/ussr-ssl.py
	modified:   config/conf.txt
new file:   config/lock.pa.txt
	modified:   config/token.txt
	modified:   config/webhook.txt
	modified:   dependencies/config.py#
	modified:   dependencies/prerequisites.bat
	modified:   instructions.txt
	modified:   launcher.bat
	modified:   scripts/launcher.py
	modified:   scripts/start.bat
	modified:   scripts/start.sh
  • Loading branch information
mickoissicko committed Jan 26, 2024
1 parent 3f0655f commit c27f897
Show file tree
Hide file tree
Showing 26 changed files with 108 additions and 29 deletions.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified bin/.mc/eula.txt
100644 → 100755
Empty file.
Empty file modified bin/.mc/server.properties
100644 → 100755
Empty file.
Empty file modified bin_arc/script/ngroksenpai.py
100644 → 100755
Empty file.
Empty file modified bin_arc/script/starter.sh
100644 → 100755
Empty file.
Empty file modified bin_arc/script/stop.py
100644 → 100755
Empty file.
Empty file modified bin_arc/templates/index.html
100644 → 100755
Empty file.
Empty file modified bin_arc/templates/nuke.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified bin_arc/ussr-ssl.py
100644 → 100755
Empty file.
Empty file modified bin_win/script/ngroksenpai.py
100644 → 100755
Empty file.
Empty file modified bin_win/script/starter.bat
100644 → 100755
Empty file.
Empty file modified bin_win/script/stop.py
100644 → 100755
Empty file.
Empty file modified bin_win/templates/index.html
100644 → 100755
Empty file.
Empty file modified bin_win/templates/nuke.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified bin_win/ussr-ssl.py
100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions config/conf.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
# 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
Empty file added config/lock.pa.txt
Empty file.
Empty file modified config/token.txt
100644 → 100755
Empty file.
Empty file modified config/webhook.txt
100644 → 100755
Empty file.
Empty file modified dependencies/config.py
100644 → 100755
Empty file.
64 changes: 46 additions & 18 deletions dependencies/prerequisites.bat
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.

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
Empty file modified instructions.txt
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions launcher.bat
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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

Expand Down
55 changes: 52 additions & 3 deletions scripts/launcher.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion scripts/start.bat
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file modified scripts/start.sh
100644 → 100755
Empty file.

0 comments on commit c27f897

Please sign in to comment.