diff --git a/README.md b/README.md index 7d6e84fa..bc9df5d7 100644 --- a/README.md +++ b/README.md @@ -7,27 +7,32 @@ for running a Minecraft server in a [dyno](https://devcenter.heroku.com/articles ## Usage -Create a [free ngrok account](https://ngrok.com/) and copy your Auth token. Then create a new Git project with a `eula.txt` file: +Create a [free ngrok account](https://ngrok.com/) and copy your Auth token. Then follow these instructions: ```sh-session $ echo 'eula=true' > eula.txt +$ echo 's3cmd' > requirements.txt +$ echo '' > wakemydyno.txt $ git init $ git add eula.txt +$ git add requirements.txt $ git commit -m "first commit" ``` Then, install the [Heroku toolbelt](https://toolbelt.heroku.com/). -Create a Heroku app, set your ngrok token, and push: +Make sure to run ```heroku login``` if you just installed it and it's your first time using it on your machine. +Follow this set of commands: ```sh-session -$ heroku create +$ heroku create yourapp +$ heroku git:remote -a yourapp $ heroku buildpacks:add heroku/python $ heroku buildpacks:add heroku/jvm $ heroku buildpacks:add jkutner/minecraft $ heroku config:set NGROK_API_TOKEN="xxxxx" $ git push heroku master ``` - +After that, go on http://wakemydyno.com/ and paste the url of your app to it Finally, open the app: ```sh-session @@ -44,6 +49,8 @@ Server available at: 0.tcp.ngrok.io:17003 Copy the `0.tcp.ngrok.io:17003` part, and paste it into your local Minecraft app as the server name. + + ## Syncing to S3 The Heroku filesystem is [ephemeral](https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem), @@ -72,7 +79,7 @@ Once you have Heroku Exec installed, you can connect to the console using ``` $ heroku ps:exec Establishing credentials... done -Connecting to web.1 on ⬢ lovely-minecraft-2351... +Connecting to web.1 on ⬢ yourapp... $ screen -r minecraft ``` diff --git a/app.json b/app.json index ad7d17bf..aa26c1ec 100644 --- a/app.json +++ b/app.json @@ -11,6 +11,10 @@ "description": "Do you accept the Minecraft EULA?", "value": "true" }, + "CRACKED_CLIENT": { + "description": "You don't allow cracked clients to join", + "required": true + }, "NGROK_API_TOKEN": { "description": "Your personal ngrok API token", "required": true diff --git a/bin/compile b/bin/compile index daa4da1c..2b6c19f4 100755 --- a/bin/compile +++ b/bin/compile @@ -25,7 +25,7 @@ CACHE_DIR=$2 OPT_DIR=$BP_DIR/../opt/ export_env_dir $3 - +#echo 's3cmd' >> $BUILD_DIR/requirements.txt APT_CACHE_DIR="$CACHE_DIR/apt/cache" APT_STATE_DIR="$CACHE_DIR/apt/state" APT_OPTIONS="-o debug::nolocking=true -o dir::cache=$APT_CACHE_DIR -o dir::state=$APT_STATE_DIR" @@ -85,7 +85,11 @@ if [ -n "${MINECRAFT_EULA:-""}" ]; then echo "eula=true" >> $BUILD_DIR/eula.txt echo "done" fi - +if [ -n "${CRACKED_CLIENT:-""}" ]; then + echo -n "-----> Allowing Cracked Clients to join... " + echo "online-mode=false" >> $BUILD_DIR/server.properties + echo "done" +fi mkdir -p $BUILD_DIR/bin [ ! -f $BUILD_DIR/minecraft ] && cp $OPT_DIR/minecraft $BUILD_DIR/bin [ ! -f $BUILD_DIR/sync ] && cp $OPT_DIR/sync $BUILD_DIR/bin diff --git a/opt/index.rhtml b/opt/index.rhtml index 3ab7631c..9c011e75 100644 --- a/opt/index.rhtml +++ b/opt/index.rhtml @@ -1,6 +1,6 @@ <% open('ngrok.log') do |f| %> <% f.lines.select { |line| line.include?("URL:") }.each do |line| %> - Server available at: <%= line.match(/tcp:\/\/(.+:[0-9]+) /)[1] %> +
Server available at: <%= line.match(/tcp:\/\/(.+:[0-9]+) /)[1] %>

<% end %> <% end %> diff --git a/wakemydyno.txt b/wakemydyno.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/wakemydyno.txt @@ -0,0 +1 @@ +