MineServerColab by EXPOSUREEE - Ipynb
MineServerColab by EXPOSUREEE - Ipynb
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "NPYLySfQ_TJ6"
},
"source": [
"\n",
"```\n",
"███╗ ███╗██╗███╗ ██╗███████╗ ██████╗ ██████╗ ██╗ █████╗ ██████╗\
n",
"████╗ ████║██║████╗ ██║██╔════╝██╔════╝██╔═══██╗██║ ██╔══██╗██╔══██╗\
n",
"██╔████╔██║██║██╔██╗ ██║█████╗ ██║ ██║ ██║██║ ███████║██████╔╝\
n",
"██║╚██╔╝██║██║██║╚██╗██║██╔══╝ ██║ ██║ ██║██║ ██╔══██║██╔══██╗\
n",
"██║ ╚═╝ ██║██║██║ ╚████║███████╗╚██████╗╚██████╔╝███████╗██║ ██║██████╔╝\
n",
"╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═════╝\
n",
"```\n",
"**Create a Minecraft Server in Google Colab! (Modified & Translated by
EXPOSUREEE in English)**\n",
"\n",
"---\n",
"\n",
"The Script below will cause your server to start. You'll need to create
the server first in order to use it - don't worry, the scripts below will do the
vast majority of the work for you. Maybe you want to change the server region,
check below.\n",
"\n",
"Modified version of SoyMichas\n",
"\n",
"Original: https://github.com/thecoder-001/MineColab"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "pZ0Yw2BWBYQA",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "17e7c418-3a26-4fff-cc26-2e95db19fbfa"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\n",
"WARNING: apt does not have a stable CLI interface. Use with caution in
scripts.\n",
"\n",
"\n",
"WARNING: apt does not have a stable CLI interface. Use with caution in
scripts.\n",
"\n"
]
}
],
"source": [
"# @title # **Run this code** {display-mode: \"form\"}\n",
"# markdown Recuerda ejecutar primero este codigo para que todas las demas
celdas funcionen.\n",
"import requests\n",
"from google.colab import drive\n",
"import requests\n",
"import json\n",
"import os\n",
"import glob\n",
"from types import FunctionType\n",
"import base64\n",
"import subprocess\n",
"import sys\n",
"try:\n",
" from pyngrok import conf, ngrok\n",
" from pyngrok.conf import PyngrokConfig\n",
"except:\n",
" !pip install -q pyngrok --quiet --upgrade\n",
" from pyngrok import conf, ngrok\n",
" from pyngrok.conf import PyngrokConfig\n",
"from google.colab import runtime\n",
"try:from rich import print\n",
"except:\n",
" !pip install rich --quiet --upgrade\n",
" from rich import print\n",
"try:import semver\n",
"except:\n",
" !pip install semver --quiet --upgrade\n",
" import semver\n",
"\n",
"!command -v filebrowser &>/dev/null || curl -fsSL
https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash &>/dev/null\
n",
"!command -v dig &>/dev/null || sudo apt install dnsutils\n",
"!sudo apt update >/dev/null\n",
"!sudo apt upgrade >/dev/null\n",
"\n",
"def log(text:str):\n",
" print(\"[bold green][LOG][/bold green] \"+text)\n",
"\n",
"def exit():\n",
" runtime.unassign()\n",
"\n",
"AIKAR_FLAGS=\"--add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:
+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -
XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -
XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -
XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -
XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -
Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -
XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -
XX:G1ReservePercent=20\"\n",
"SERVERJARS_URLS=[\n",
"
[\"https://launchermeta.mojang.com/mc/game/version_manifest.json\", \"vanilla\"],\
n",
"
[\"https://launchermeta.mojang.com/mc/game/version_manifest.json\", \"snapshot\"],\
n",
" [\"https://papermc.io/api/v2/projects/paper/\", \"paper\"],\n",
" [\"https://papermc.io/api/v2/projects/waterfall/\", \"waterfall\"],\
n",
" [\"https://api.purpurmc.org/v2/purpur/\", \"purpur\"],\n",
" [\"modded/forge\", \"forge\"],\n",
" [\"proxies/bungeecord\",\"bungeecord\"],\n",
" [\"proxies/velocity\",\"velocity\"],\n",
" [\"modded/fabric\", \"fabric\"],\n",
" [\"modded/catserver\", \"catserver\"],\n",
" [\"servers/sponge\", \"sponge\"],\n",
" [\"https://mohistmc.com/api/versions\", \"mohist\"],\n",
" [\"https://api.magmafoundation.org/api/v2/allVersions\", \"magma\"]\
n",
"]\n",
"\n",
"def view_available_versions():\n",
" txt=\"\"\n",
" for url in SERVERJARS_URLS:\n",
" versions=[]\n",
" if url[0].startswith(\"http\"):\n",
" req=requests.get(url[0])\n",
" res=json.loads(req.content.decode())\n",
" if url[1] in
[\"paper\",\"purpur\",\"waterfall\"]:versions=res[\"versions\"][::-1]\n",
" if url[1] in [\"magma\",\"mohist\"]:versions=res\n",
" if url[1] == \"vanilla\":\n",
" for o in res[\"versions\"]:\n",
" if o[\"type\"][0]==\"r\":\n",
" if o[\"id\"] == \"1.2.4\":\n",
" break\n",
" versions.append(o[\"id\"])\n",
" if url[1]==\"snapshot\":\n",
" for o in res[\"versions\"]:\n",
" if o[\"type\"][0]==\"s\":\n",
" if o[\"id\"] == \"1.3\":\n",
" versions.append(o[\"id\"])\n",
" break\n",
" versions.append(o[\"id\"])\n",
" else:\n",
"
req=requests.get(f\"https://serverjars.com/api/fetchAll/{url[0]}/200\")\n",
" res=json.loads(req.content.decode())\n",
" versions=[version[\"version\"] for version in res[\"response\"]]\n",
" txt+=url[1].upper()+\":\\n\"+\"\\n\".join([' '.join(versions[i:i+10])
for i in range(0, len(versions), 10)])+\"\\n\"\n",
" print(txt)\n",
"\n",
"def connect_ngrok(port, type_, config):\n",
" log(\"Starting ngrok...\")\n",
" tok=config[\"token\"]\n",
" log(\"Configuring ngrok...\")\n",
" ! ngrok authtoken $tok\n",
" ngrokc:PyngrokConfig=conf.get_default()\n",
" ngrokc.region = config[\"region\"]\n",
" log(\"Configured.\")\n",
" url=\"\"\n",
" try:\n",
" if type_==\"tcp\":\n",
" url = ngrok.connect(port, 'tcp')\n",
" else:\n",
" url = ngrok.connect(port)\n",
" log(\"Ngrok connected.\")\n",
" except Exception as e:\n",
" log(\"Hubo un problema al iniciar ngrok porfavor revise su token.\")\
n",
" exit()\n",
" url=[e.replace('\"',\"\") for e in str(url)[13:].split(\" -> \")]\n",
" if config.get(\"ip\") and type_==\"tcp\":\n",
" u=url[0].replace(\"tcp://\",\"\").split(\":\")[0]\n",
"
result=subprocess.check_output([\"dig\",\"+short\",u]).decode().replace(\"\\
n\",\"\")\n",
" url[0]=url[0].replace(u,result)\n",
" return url\n",
"\n",
"def disconnect_ngrok(tunnel):\n",
" ngrok.disconnect(tunnel.public_url)\n",
"\n",
"def exit_ngrok():\n",
" log(\"Closing ngrok...\")\n",
" tunnels = ngrok.get_tunnels()\n",
" for tunnel in tunnels:\n",
" disconnect_ngrok(tunnel)\n",
" ngrok.kill()\n",
" log(\"Ngrok closed.\")\n",
"\n",
"def load_server_props(path:str):\n",
" folder=server_folder(path)\n",
" with open(\"server.properties\",\"r\") as f:\n",
" lines=f.read().split(\"\\n\")\n",
" if lines[-1]=='':\n",
" del lines[-1]\n",
" props={}\n",
" for line in lines:\n",
" if line[0]==\"#\":continue\n",
" l=line.split(\"=\")\n",
" props[l[0]]=l[1]\n",
" return props\n",
"\n",
"def save_server_props(path:str,props:dict):\n",
"\n",
" folder=server_folder(path)\n",
"\n",
" txt=\"\"\n",
" for prop in props:\n",
" txt+=prop+\"=\"+props[prop]+\"\\n\"\n",
"\n",
" with open(\"server.properties\",\"w\") as f:\n",
" f.write(txt)\n",
"\n",
"def apply_custom_props(path:str,props:dict):\n",
" fileprops=load_server_props(path)\n",
" for prop in props:\n",
" fileprops[prop]=props[prop]\n",
" save_server_props(path,fileprops)\n",
"\n",
"def get_url_version(version, type_) -> str:\n",
" url = \"\"\n",
" if type_ in [u[1] for u in SERVERJARS_URLS]:\n",
" if type_==\"magma\":\n",
" return
f\"https://api.magmafoundation.org/api/v2/{version}/latest/download\"\n",
" if type_==\"mohist\":\n",
" return f\"https://mohistmc.com/api/{version}/latest/download\"\n",
" if type_==\"purpur\":\n",
" return
f\"https://api.purpurmc.org/v2/purpur/{version}/latest/download\"\n",
" if type_==\"paper\":\n",
" latest_build =
requests.get(\"https://papermc.io/api/v2/projects/paper/versions/\" + version)\n",
" filename =
requests.get(\"https://papermc.io/api/v2/projects/paper/versions/\" + version
+ \"/builds/\" + str(latest_build.json()[\"builds\"][-1]))\n",
" return \"https://papermc.io/api/v2/projects/paper/versions/\" +
version + \"/builds/\" + str(latest_build.json()[\"builds\"][-1]) + \"/downloads/\"
+ filename.json()[\"downloads\"][\"application\"][\"name\"]\n",
" if type_ in [\"vanilla\",\"snapshot\"]:\n",
" versionsw =
requests.get(\"https://launchermeta.mojang.com/mc/game/version_manifest.json\")\n",
" versions=json.loads(versionsw.content.decode())[\"versions\"]\n",
" versionw=requests.get([o for o in versions if o[\"id\"]==version][0]
[\"url\"])\n",
" version=json.loads(versionw.content.decode())\n",
" return version[\"downloads\"][\"server\"][\"url\"]\n",
" versions=[u[1] for u in SERVERJARS_URLS]\n",
"
url=\"https://serverjars.com/api/fetchJar/\"+SERVERJARS_URLS[versions.index(type_)]
[0]+\"/\"+version\n",
" else:\n",
" exit()\n",
" return url\n",
"\n",
"def install_jar(path, url, filename, type_, version):\n",
" log(\"Downloading jar file...\")\n",
" r = requests.get(url)\n",
" if r.status_code == 200:\n",
" with open(os.path.join(path,filename), 'wb') as f:\n",
" f.write(r.content)\n",
" else:\n",
" print('Error '+ str(r.status_code))\n",
" log(\"Downloaded jar file.\")\n",
" if type_ == 'fabric':\n",
" log(\"Installing fabric...\")\n",
" !java -jar $filename server -mcversion $version -downloadMinecraft
&>/dev/null\n",
" if type_ == 'forge':\n",
" log(\"Installing forge...\")\n",
" !java -jar $filename --installServer &>/dev/null\n",
" if \"1.17\">version:\n",
" !mv $filename installer-$filename\n",
" forgefile=glob.glob(os.path.join(path,f\"forge-{version}-*.jar\"))
[0]\n",
" !mv $forgefile $filename\n",
" log(\"Jar file installed successfully.\")\n",
"\n",
"def remove_server(path):\n",
" server_folder(path)\n",
" os.chdir(\"..\")\n",
" !rm -rf $path\n",
"\n",
"def server_folder(path, check=False, cd=True):\n",
" back_path=os.getcwd()\n",
" os.chdir(\"/content/\")\n",
" if not os.path.exists(\"drive\"):\n",
" log(\"Mounting google drive...\")\n",
" drive.mount('/content/drive')\n",
" log(\"Mounted\")\n",
" if check:\n",
" if not
os.path.exists(os.path.join(\"/content/drive/MyDrive/\",path)):\n",
" print(\"ERROR Invalid Server path - Not found \"+path)\n",
" exit()\n",
" path=os.path.join(\"/content/drive/MyDrive/\",path)\n",
" if not os.path.exists(path):\n",
" ! mkdir \"$path\"\n",
" if cd:\n",
" os.chdir(path)\n",
" else:\n",
" os.chdir(back_path)\n",
" return path\n",
"\n",
"def start_filebrowser(path:str):\n",
" server_path=server_folder(path)\n",
" config=import_config()\n",
" urls=connect_ngrok(8005, \"http\", config[\"proxy\"])\n",
" log(f\"Filebrowser: [link={urls[0]}]{urls[0]}[/link]\")\n",
" !filebrowser -r \"$server_path\" -p 8005\n",
"\n",
"def server_directory_shell(path):\n",
" path=server_folder(path=\"Minecraft-server\")\n",
" while True:\n",
" path=os.getcwd().split(\"/\")\n",
" path.pop(0)\n",
" prompt=\"/server/\"\n",
" code=None\n",
" if len(path)==4:\n",
" try:code=input(prompt+\" >>\")\n",
" except:print(\"exit\")\n",
" else:\n",
" for i in range(len(path)-4):\n",
" prompt+=path[4+i]+\"/\"\n",
" try:code=input(prompt+\" >>\")\n",
" except:print(\"exit\")\n",
"\n",
" if code:\n",
" if code.startswith(\"cd\"):\n",
" os.chdir(code[3:])\n",
" continue\n",
"\n",
" if code==\"exit\":\n",
" break\n",
"\n",
" !$code\n",
" else:\n",
" break\n",
"\n",
"def start_http_files(path):\n",
" print(\"Starting http server...\")\n",
" server_folder(path=path)\n",
" config=import_config()\n",
" urls=connect_ngrok(8000, \"http\", config[\"proxy\"])\n",
" print(\"Files web in \"+urls[0])\n",
" !python -m http.server >/dev/null\n",
"\n",
"def install_server(proxy:dict={},version:str=\"1.20.1\",
type_:str=\"vanilla\", path:str=\"Minecraft-Server\", custom_url:str=\"\"):\n",
" log(\"Installing server...\")\n",
" path=server_folder(path)\n",
" if type_==\"custom\":\n",
" url=custom_url\n",
" else:\n",
" url=get_url_version(version,type_)\n",
"\n",
" filename=type_+\"-\"+version+\".jar\"\n",
" install_jar(path, url, filename,type_,version)\n",
"\n",
"
json.dump({\"version\":version,\"type\":type_,\"filename\":filename,\"proxy\":
proxy}, open(\"colabconfig.json\",'w'))\n",
" !echo \"eula=true\" > eula.txt\n",
" log(\"Successfully installed server.\")\n",
"\n",
"def import_config() -> dict:\n",
" if os.path.isfile(\"colabconfig.json\"):\n",
" return json.load(open(\"colabconfig.json\"))\n",
" else:\n",
" print(\"Error: colabconfig.json not found.\")\n",
" exit()\n",
"\n",
"def install_java(version:str, type_:str):\n",
" if semver.compare(version if len(version.split(\".\"))==3 else
version+\".0\", \"1.17.0\")==-1:\n",
" log(\"Installing JRE 8...\")\n",
" java_path=\"/usr/lib/jvm/java-8-openjdk-amd64/bin/java\"\n",
" !sudo apt-get install openjdk-8-jre-headless &>/dev/null ||
echo \"Failed to install OpenJdk8.\"\n",
" else:\n",
" log(\"Installing JRE 17...\")\n",
" java_path=\"/usr/lib/jvm/java-17-openjdk-amd64/bin/java\"\n",
" !sudo apt-get install openjdk-17-jre-headless &>/dev/null ||
echo \"Failed to install OpenJdk17.\"\n",
"\n",
" log(\"JRE installed.\")\n",
"\n",
" return java_path\n",
"\n",
"def get_methods(clss):\n",
" return [x for x, y in clss.__dict__.items() if type(y) == FunctionType
and str(x)!=\"__init__\"]\n",
"\n",
"class RunCommand:\n",
"\n",
" def __init__(self, config):\n",
" self.version=config[\"version\"]\n",
" self._type=config[\"type\"]\n",
"\n",
" def get(self,args,jarname) -> str:\n",
" list_of_types=get_methods(RunCommand)\n",
" list_of_types.remove(\"get\")\n",
" self.args=args\n",
" self.jarname=jarname\n",
" if self._type in list_of_types:\n",
" # The custom starts for servers\n",
" return getattr(self, self._type)().format(\n",
" args=args,\n",
" jarname=jarname\n",
" )\n",
" else:\n",
" # The default start\n",
" return '{args} -jar {jarname} nogui'.format(\n",
" args=args,\n",
" jarname=jarname\n",
" )\n",
"\n",
" def forge(self):\n",
" if self.version < \"1.17\":\n",
" return '{args} -jar \"{jarname}\" nogui'\n",
" else:\n",
" pathtoforge =
glob.glob(f\"libraries/net/minecraftforge/forge/{self.version}-*/unix_*.txt\")\n",
" args=self.args\n",
" !echo $args > user_jvm_args.txt\n",
" if pathtoforge:\n",
" return '@user_jvm_args.txt \"@'+pathtoforge[0]+'\" nogui \"$@\"'\
n",
" else:\n",
" log(\"No unix_args.txt found.\")\n",
"\n",
" def purpur(self):\n",
" return AIKAR_FLAGS+\" {args} -jar {jarname} nogui\"\n",
"\n",
" def paper(self):\n",
" return AIKAR_FLAGS+\" {args} -jar {jarname} nogui\"\n",
"\n",
"def install_playit():\n",
" ! curl -SsL https://playit-cloud.github.io/ppa/key.gpg | sudo apt-key
add -\n",
" ! sudo curl -SsL -o /etc/apt/sources.list.d/playit-cloud.list
https://playit-cloud.github.io/ppa/playit-cloud.list\n",
" ! sudo apt update &>/dev/null && sudo apt install playit &>/dev/null &&
echo \"Playit.gg installed\" || echo \"Failed to install playit\"\n",
"\n",
"def run_server(path:str,ngrok_tunnels:list=[]):\n",
" log(\"Starting server...\")\n",
" !sudo apt update &>/dev/null || echo \"apt cache update failed\"\n",
" server_path=server_folder(path, True)\n",
" log(\"Loading config...\")\n",
" configfile=import_config()\n",
" log(\"Config loaded\")\n",
" jpath=install_java(configfile[\"version\"],configfile[\"type\"])\n",
" args=\"-Xms8704M -Xmx8704M\"\n",
"\n",
" if configfile[\"proxy\"][\"service\"]==\"ngrok\":\n",
" configfile[\"proxy\"][\"ip\"]=True\n",
" urls=connect_ngrok(25565,\"tcp\",configfile[\"proxy\"])\n",
" log(\"Minecraft IP Server: \"+urls[0].replace(\"tcp://\",\"\"))\n",
"\n",
"\n",
"\n",
" if configfile[\"proxy\"][\"service\"] in [\"ngrok\",\"ngrok-playit\"]:\
n",
" for tunnel in ngrok_tunnels:\n",
"
tunnel_urls=connect_ngrok(tunnel[\"port\"],tunnel[\"type\"],configfile[\"proxy\"])\
n",
" if tunnel.get(\"callback\"):\n",
" tunnel[\"callback\"](tunnel_urls)\n",
"\n",
" if configfile[\"proxy\"][\"service\"] in [\"playit\",\"ngrok-playit\"]:\
n",
" install_playit()\n",
"\n",
" command=RunCommand(configfile)\n",
" cmd=command.get(jarname=configfile[\"filename\"],args=args)\n",
"\n",
" log(\"Starting jar file...\")\n",
" if configfile[\"proxy\"][\"service\"] in [\"playit\",\"ngrok-playit\"]:\
n",
" !playit & $jpath $cmd\n",
" else:\n",
" !$jpath $cmd\n",
" log(\"Finalized server.\")\n",
" exit_ngrok()"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "P4Jl1SDT7uiG"
},
"source": [
"# **1 - Create your server**\n",
"\n",
"---\n",
"\n",
"**Things to keep in mind:**\n",
"- The code below will create your server and accept the EULA. Your server
will be ready to start.\n",
"- The code below will download Paper, a type of high-performance Vanilla
server that allows you to use plugins.\n",
"- If you want to use another type of server.jar put it in the Drive folder
manually.\n",
"- You have to put the Ngrok TOKEN below, enter this link
https://dashboard.ngrok.com/auth to get your token (you have to have an account
created in ngrok)\n",
"- You can change the REGION in this code below, this is important for the
LAG and PING. Use the regions closest to you. The default region is the United
States, which is not recommended for countries in South America or Spain. Regions
such as 'sa' (Brazil) and 'eu' (Europe) can be used for these. You can change it in
this code below where it is indicated.\n",
"- The files on the server will be saved in your Google Drive (the ones
from the Google account you choose or are using)\n",
"\n",
"\n",
"---\n",
"\n",
"\n",
"\n",
"Run the following code. Modify it to customize the server. (There are
important options, please check.)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "C1zf1-U972Vd",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 102
},
"outputId": "ee787116-6540-4d6b-dd24-a53620f84cde"
},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Installing server\u001b[33m...\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Installing server<span style=\"color: #808000;
text-decoration-color: #808000\">...</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Downloading jar file\u001b[33m...\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Downloading jar file<span style=\"color: #808000;
text-decoration-color: #808000\">...</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Downloaded jar file.\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Downloaded jar file.\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Jar file installed successfully.\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Jar file installed successfully.\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Successfully installed server.\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Successfully installed server.\n",
"</pre>\n"
]
},
"metadata": {}
}
],
"source": [
"install_server(\n",
" proxy={\n",
" \"service\": \"ngrok\", # Elige ngrok o playit o \"ngrok-playit\"\
n",
"\n",
" \"token\": \"\", # <- Insert your ngrok token here, you can get it
at https://dashboard.ngrok.com/auth.\n",
" # AVAILABLE REGIONS\n",
" # ap - Asia/Pacific (Singapore)\n",
" # au - Australia (Sydney)\n",
" # eu - Europa (Frankfurt - Alemania)\n",
" # in - India (Mumbai)\n",
" # jp - Japan (Tokyo)\n",
" # sa - America del sur (São Paulo - Brasil)\n",
" # us - United States (Ohio)\n",
" \"region\": \"in\" # <- Change this to the region you prefer.\n",
" },\n",
" path=\"Minecraft-server\", # <- Directory / Name of the server
container folder in drive\n",
" version=\"1.20.2\", # <- Minecraft server version\n",
"\n",
" # TYPES OF SERVERS AVAILABLE\n",
" # VANILLA:\n",
" # vanilla 1.20.1 - 1.2.5\n",
" # snapshot 23w35a - 1.3\n",
" # SERVERS:\n",
" # paper 1.20.1 - 1.8.8\n",
" # purpur 1.20.1 - 1.14.1\n",
" # sponge 1.12.2 - 1.8.9\n",
" # MODDED:\n",
" # forge 1.20.1 - 1.5.2\n",
" # fabric 1.20.1 - 1.14\n",
" # mohist 1.20.1 - 1.7.10\n",
" # magma 1.20.1 - 1.12.2\n",
" # catserver 1.18.2 - 1.12.2\n",
" # PROXIES:\n",
" # waterfall 1.19 - 1.11\n",
" # bungeecord 1.20 - 1.19\n",
" # velocity (No minecraft version) 3.2.0 - 1.0.10\n",
" type_=\"paper\", # <- Type of Server\n",
"\n",
" custom_url=\"\"\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "xKrecTWv8FKX"
},
"source": [
"#**2 – Run Your Server**\n",
"Use this whenever you want to open it\n",
"\n",
"---\n",
"\n",
"**IMPORTANT:**\n",
"- The IP will change whenever you restart the server.\n",
"- To set a command per console, you can do it here. Basically this below
will be your console (where you'll put commands and see the logs)\n",
"- It is advisable to have the Google Colab tab open so that the server
does not close, it is possible that from time to time it will ask you to solve a
captcha.\n",
"\n",
"---\n",
"\n",
"Run the following code, remember to change the path if you have changed it
before:\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "UAwlDVr-8Nx1",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"outputId": "25e371be-dd94-467b-b005-7b30e3e23e2f"
},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Starting server\u001b[33m...\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Starting server<span style=\"color: #808000; text-
decoration-color: #808000\">...</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Loading config\u001b[33m...\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Loading config<span style=\"color: #808000; text-
decoration-color: #808000\">...</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Config loaded\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Config loaded\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Installing JRE \u001b[1;36m17\u001b[0m\u001b[33m...\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Installing JRE <span style=\"color: #008080; text-
decoration-color: #008080; font-weight: bold\">17</span><span style=\"color:
#808000; text-decoration-color: #808000\">...</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
JRE installed.\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> JRE installed.\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Starting ngrok\u001b[33m...\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Starting ngrok<span style=\"color: #808000; text-
decoration-color: #808000\">...</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Configuring ngrok\u001b[33m...\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Configuring ngrok<span style=\"color: #808000;
text-decoration-color: #808000\">...</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"Authtoken saved to configuration file: /root/.ngrok2/ngrok.yml\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Configured.\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Configured.\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stderr",
"text": [
"WARNING:pyngrok.process.ngrok:t=2023-10-27T10:42:22+0000 lvl=warn
msg=\"ngrok config file found at legacy location, move to XDG location\"
xdg_path=/root/.config/ngrok/ngrok.yml legacy_path=/root/.ngrok2/ngrok.yml\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Ngrok connected.\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Ngrok connected.\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Minecraft IP Server: \u001b[1;92m3.6.115.64\u001b[0m:\u001b[1;36m14048\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Minecraft IP Server: <span style=\"color: #00ff00;
text-decoration-color: #00ff00; font-weight: bold\">3.6.115.64</span>:<span
style=\"color: #008080; text-decoration-color: #008080; font-weight:
bold\">14048</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Starting jar file\u001b[33m...\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Starting jar file<span style=\"color: #808000;
text-decoration-color: #808000\">...</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"WARNING: Using incubator modules: jdk.incubator.vector\n",
"Starting org.bukkit.craftbukkit.Main\n",
"System Info: Java 17 (OpenJDK 64-Bit Server VM 17.0.8.1+1-Ubuntu-
0ubuntu122.04) Host: Linux 5.15.120+ (amd64)\n",
"Loading libraries, please wait...\n",
"[10:42:48 INFO]: Environment:
Environment[accountsHost=https://api.mojang.com,
sessionHost=https://sessionserver.mojang.com,
servicesHost=https://api.minecraftservices.com, name=PROD]\n",
"[10:42:52 INFO]: Loaded 7 recipes\n",
"[10:42:53 INFO]: Starting minecraft server version 1.20.2\n",
"\u001b[33;1m[10:42:53 WARN]: ****************************\n",
"\u001b[m\u001b[33;1m[10:42:53 WARN]: YOU ARE RUNNING THIS SERVER AS AN
ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.\n",
"\u001b[m\u001b[33;1m[10:42:53 WARN]: YOU ARE OPENING YOURSELF UP TO
POTENTIAL RISKS WHEN DOING THIS.\n",
"\u001b[m\u001b[33;1m[10:42:53 WARN]: FOR MORE INFORMATION, SEE
https://madelinemiller.dev/blog/root-minecraft-server/\n",
"\u001b[m\u001b[33;1m[10:42:53 WARN]: ****************************\n",
"\u001b[m[10:42:53 INFO]: Loading properties\n",
"[10:42:53 INFO]: This server is running Paper version git-Paper-248
(MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: b974a6b)\n",
"[10:42:55 INFO]: Server Ping Player Sample Count: 12\n",
"[10:42:55 INFO]: Using 4 threads for Netty based IO\n",
"\u001b[33;1m[10:42:56 WARN]: [!] The timings profiler has been enabled
but has been scheduled for removal from Paper in the future.\n",
" We recommend installing the spark profiler as a replacement:
https://spark.lucko.me/\n",
" For more information please visit:
https://github.com/PaperMC/Paper/issues/8948\n",
"\u001b[m[10:42:56 INFO]: [ChunkTaskScheduler] Chunk system is using 1
I/O threads, 1 worker threads, and gen parallelism of 1 threads\n",
"[10:42:57 INFO]: Default game type: SURVIVAL\n",
"[10:42:57 INFO]: Generating keypair\n",
"\u001b[K[10:42:57 INFO]: Starting Minecraft server on *:25565\n",
"\u001b[K[10:42:57 INFO]: Using epoll channel type\n",
"\u001b[K[10:42:57 INFO]: Paper: Using libdeflate (Linux x86_64)
compression from Velocity.\n",
"\u001b[K[10:42:57 INFO]: Paper: Using OpenSSL 3.0.x (Linux x86_64)
cipher from Velocity.\n",
"\u001b[K[10:42:58 INFO]: [floodgate] Loading server plugin floodgate
v2.2.2-SNAPSHOT (b85-71acc6c)\n",
"\u001b[K[10:43:01 INFO]: [floodgate] Took 3,289ms to boot Floodgate\
n",
"\u001b[K[10:43:01 INFO]: [Geyser-Spigot] Loading server plugin Geyser-
Spigot v2.2.0-SNAPSHOT\n",
"\u001b[K[10:43:05 INFO]: [Geyser-Spigot] Loading extensions...\n",
"\u001b[K[10:43:05 INFO]: [Geyser-Spigot] Loaded 0 extension(s)\n",
"\u001b[K[10:43:05 INFO]: Server permissions file permissions.yml is
empty, ignoring it\n",
"\u001b[K\u001b[33;1m[10:43:05 WARN]: **** SERVER IS RUNNING IN
OFFLINE/INSECURE MODE!\n",
"\u001b[K\u001b[33;1m[10:43:05 WARN]: The server will make no attempt
to authenticate usernames. Beware.\n",
"\u001b[K\u001b[33;1m[10:43:05 WARN]: While this makes the game
possible to play without internet access, it also opens up the ability for hackers
to connect with any username they choose.\n",
"\u001b[K\u001b[33;1m[10:43:05 WARN]: To change this, set \"online-
mode\" to \"true\" in the server.properties file.\n",
"\u001b[K[10:43:05 INFO]: Preparing level \"world\"\n",
"\u001b[K[10:43:07 INFO]: Preparing start region for dimension
minecraft:overworld\n",
"\u001b[K[10:43:08 INFO]: Time elapsed: 564 ms\n",
"\u001b[K[10:43:08 INFO]: Preparing start region for dimension
minecraft:the_nether\n",
"\u001b[K[10:43:08 INFO]: Time elapsed: 102 ms\n",
"\u001b[K[10:43:08 INFO]: Preparing start region for dimension
minecraft:the_end\n",
"\u001b[K[10:43:08 INFO]: Time elapsed: 88 ms\n",
"\u001b[K[10:43:08 INFO]: [floodgate] Enabling floodgate v2.2.2-
SNAPSHOT (b85-71acc6c)\n",
"\u001b[K[10:43:10 INFO]: [Geyser-Spigot] Enabling Geyser-Spigot
v2.2.0-SNAPSHOT\n",
"\u001b[K[10:43:10 INFO]: [Geyser-Spigot]
******************************************\n",
"\u001b[K[10:43:10 INFO]: [Geyser-Spigot] \n",
"\u001b[K[10:43:10 INFO]: [Geyser-Spigot] Loading Geyser version 2.2.0-
SNAPSHOT (git-master-8d2ebcf)\n",
"\u001b[K[10:43:10 INFO]: [Geyser-Spigot] \n",
"\u001b[K[10:43:10 INFO]: [Geyser-Spigot]
******************************************\n",
"\u001b[K[10:43:36 INFO]: [Geyser-Spigot] Started Geyser on
0.0.0.0:19132\n",
"\u001b[K[10:43:36 INFO]: [Geyser-Spigot] Done (25.952s)! Run /geyser
help for help!\n",
"\u001b[K[10:43:36 INFO]: Running delayed init tasks\n",
"\u001b[K[10:43:36 INFO]: Done (42.909s)! For help, type \"help\"\n",
"\u001b[K[10:43:36 INFO]: Timings Reset\n",
"\u001b[K\u001b[33;1m[10:43:37 WARN]: [Geyser-Spigot] Missing MC locale
file: en_us\n",
"\u001b[K[10:43:37 INFO]: [Geyser-Spigot] Downloading Minecraft JAR to
extract required files, please wait... (this may take some time depending on the
speed of your internet connection)\n",
"\u001b[K[10:43:43 INFO]: [Geyser-Spigot] Minecraft JAR has been
successfully downloaded and loaded!\n",
"\u001b[K\u001b[33;1m[10:43:44 WARN]: Can't keep up! Is the server
overloaded? Running 5010ms or 100 ticks behind\n",
"\u001b[K[10:45:14 INFO]: UUID of player EXPOSUREEE is 743434da-021b-
364e-9d50-7ed554ef11ee\n",
"\u001b[K[10:45:15 INFO]: \u001b[93mEXPOSUREEE joined the game\
u001b[0m\n",
"\u001b[K[10:45:15 INFO]: EXPOSUREEE[/127.0.0.1:36290] logged in with
entity id 252 at ([world]12.194901801995421, 70.0, -36.49458538822576)\n",
"\u001b[K[10:45:19 INFO]: EXPOSUREEE lost connection: Disconnected\n",
"\u001b[K[10:45:19 INFO]: \u001b[93mEXPOSUREEE left the game\u001b[0m\
n",
">....[10:45:28 INFO]: Stopping server\n",
"[10:45:28 INFO]: [Geyser-Spigot] Disabling Geyser-Spigot v2.2.0-
SNAPSHOT\n",
"[10:45:28 INFO]: [Geyser-Spigot] Shutting down Geyser.\n",
"[10:45:28 INFO]: [Geyser-Spigot] Geyser shutdown successfully.\n",
"[10:45:28 INFO]: [floodgate] Disabling floodgate v2.2.2-SNAPSHOT (b85-
71acc6c)\n",
"[10:45:28 INFO]: Saving players\n",
"[10:45:28 INFO]: [Geyser-Spigot] The skin uploader has been closed\n",
"[10:45:28 INFO]: Saving worlds\n",
"[10:45:28 INFO]: Saving chunks for level
'ServerLevel[world]'/minecraft:overworld\n",
"[10:45:28 INFO]: [ChunkHolderManager] Waiting 60s for chunk system to
halt for world 'world'\n",
"[10:45:28 INFO]: [ChunkHolderManager] Halted chunk system for world
'world'\n",
"[10:45:28 INFO]: [ChunkHolderManager] Saving all chunkholders for
world 'world'\n",
"[10:45:32 INFO]: [ChunkHolderManager] Saved 1042 block chunks, 533
entity chunks, 0 poi chunks in world 'world' in 3.88s\n",
"[10:45:32 INFO]: ThreadedAnvilChunkStorage (world): All chunks are
saved\n",
"[10:45:32 INFO]: Saving chunks for level
'ServerLevel[world_nether]'/minecraft:the_nether\n",
"[10:45:32 INFO]: [ChunkHolderManager] Waiting 60s for chunk system to
halt for world 'world_nether'\n",
"[10:45:32 INFO]: [ChunkHolderManager] Halted chunk system for world
'world_nether'\n",
"[10:45:32 INFO]: [ChunkHolderManager] Saving all chunkholders for
world 'world_nether'\n",
"[10:45:33 INFO]: [ChunkHolderManager] Saved 529 block chunks, 529
entity chunks, 0 poi chunks in world 'world_nether' in 1.59s\n",
"[10:45:34 INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are
saved\n",
"[10:45:34 INFO]: Saving chunks for level
'ServerLevel[world_the_end]'/minecraft:the_end\n",
"[10:45:34 INFO]: [ChunkHolderManager] Waiting 60s for chunk system to
halt for world 'world_the_end'\n",
"[10:45:34 INFO]: [ChunkHolderManager] Halted chunk system for world
'world_the_end'\n",
"[10:45:34 INFO]: [ChunkHolderManager] Saving all chunkholders for
world 'world_the_end'\n",
"[10:45:34 INFO]: [ChunkHolderManager] Saved 529 block chunks, 529
entity chunks, 0 poi chunks in world 'world_the_end' in 0.56s\n",
"[10:45:34 INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are
saved\n",
"[10:45:34 INFO]: ThreadedAnvilChunkStorage: All dimensions are saved\
n",
"2023-10-27 10:45:34,735 Log4j2-AsyncAppenderEventDispatcher-1-Async
WARN Advanced terminal features are not available in this environment\n",
"[10:45:34 INFO]: Flushing Chunk IO\n",
"[10:45:34 INFO]: Closing Thread Pool\n",
"[10:45:34 INFO]: Closing Server\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Finalized server.\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Finalized server.\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Closing ngrok\u001b[33m...\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Closing ngrok<span style=\"color: #808000; text-
decoration-color: #808000\">...</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stderr",
"text": [
"WARNING:pyngrok.process.ngrok:t=2023-10-27T10:45:36+0000 lvl=warn
msg=\"ngrok config file found at legacy location, move to XDG location\"
xdg_path=/root/.config/ngrok/ngrok.yml legacy_path=/root/.ngrok2/ngrok.yml\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Ngrok closed.\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Ngrok closed.\n",
"</pre>\n"
]
},
"metadata": {}
}
],
"source": [
"run_server(\n",
" path=\"Minecraft-server\", # <- Directory / Name of the server
containing folder in drive\n",
" ngrok_tunnels=[\n",
" # Add your custom ngrok tunnels here\n",
" # {\n",
" # \"port\": 4711,\n",
" # \"type\": \"tcp\",\n",
" # \"callback\":lambda urls: log(\"Extra TCP
Tunnel: \"+urls[0].replace(\"tcp://\",\"\"))\n",
" # }\n",
" ],\n",
" )"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "ziwoTNmqNNnL"
},
"source": [
"**FAQ - THINGS YOU NEED TO KNOW**\n",
"\n",
"Google Colab isn't meant to create Minecraft servers, but they can be
done. Google Colab promises to work 12 hours straight, however it is possible that
it will close if there is no person who is reviewing the page or using the console,
basically if the page detects inactivity the process will end. The performance is
approximately 12 GB of RAM, along with a processor with a power of 2.2 GHz and 2
theards, this is better than many paid hostings, but it has no support and does not
promise to be open always, you can put mods, but it is not advisable to saturate it
with many as well as plugins, what limits this server the most is its processor
which, It's not very good, any hosting for 12 USD can offer you a higher quality
server, if you plan to create something for many users, that's much better. The
servers used are Google's along with Ngrok's proxy."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "8STYh1bt81aL"
},
"source": [
"# **3 - Utilities**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "V4o_QAHy9BWP"
},
"outputs": [],
"source": [
"remove_server(\n",
" path=\"Minecraft-server\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "T8ED0dAe6_fm"
},
"outputs": [],
"source": [
"start_http_files(\n",
" path=\"Minecraft-server\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "bXSzBHRJ6_mS"
},
"outputs": [],
"source": [
"server_directory_shell(\n",
" path=\"Minecraft-server\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "6ovapdp6Xufn",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 206
},
"outputId": "5fc1a964-45c4-4c71-f2e7-6e83777a6f87"
},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Starting ngrok\u001b[33m...\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Starting ngrok<span style=\"color: #808000; text-
decoration-color: #808000\">...</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Configuring ngrok\u001b[33m...\u001b[0m\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Configuring ngrok<span style=\"color: #808000;
text-decoration-color: #808000\">...</span>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"Authtoken saved to configuration file: /root/.ngrok2/ngrok.yml\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Configured.\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Configured.\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stderr",
"text": [
"WARNING:pyngrok.process.ngrok:t=2023-10-27T10:47:38+0000 lvl=warn
msg=\"ngrok config file found at legacy location, move to XDG location\"
xdg_path=/root/.config/ngrok/ngrok.yml legacy_path=/root/.ngrok2/ngrok.yml\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Ngrok connected.\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Ngrok connected.\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"\u001b[1;32m[\u001b[0m\u001b[1;32mLOG\u001b[0m\u001b[1;32m]\u001b[0m
Filebrowser: \u001b]8;id=413728;https://f44b-35-196-187-103.ngrok-free.app\u001b\\\
u001b[4;94mhttps://f44b-35-196-187-103.ngrok-free.app\u001b[0m\u001b]8;;\u001b\\\n"
],
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-
height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier
New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000;
font-weight: bold\">[LOG]</span> Filebrowser: <a href=\"https://f44b-35-196-187-
103.ngrok-free.app\" target=\"_blank\"><span style=\"color: #0000ff; text-
decoration-color: #0000ff; text-decoration: underline\">https://f44b-35-196-187-
103.ngrok-free.app</span></a>\n",
"</pre>\n"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"2023/10/27 10:47:39 No config file used\n",
"2023/10/27 10:47:39 Listening on 127.0.0.1:8005\n",
"2023/10/27 10:48:04 Caught signal interrupt: shutting down.\n",
"2023/10/27 10:48:04 accept tcp 127.0.0.1:8005: use of closed network
connection\n"
]
}
],
"source": [
"start_filebrowser(\n",
" path=\"Minecraft-server\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "G3UWIxMrLhWp"
},
"outputs": [],
"source": [
"view_available_versions()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "ZBf5mllB03bo"
},
"outputs": [],
"source": [
"apply_custom_props(\n",
" path=\"Minecraft-server\",\n",
" props={\n",
" \"online-mode\": \"false\",\n",
" \"motd\": \"\\u00A72The best minecraft server!\\u00A7r\\n\\
u00A7424/7 Server!\"\n",
" }\n",
")"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}