CraftBian

It has now been around two years since CraftBian seized development, and i have therefore been thinking about what the best approuch would be to for the system to become End-of-Life.

CraftBian has from the beginning relied on some webservices located at my place, and since i do no longer maintain CraftBian, it would be best to shut down these webservices. However, since CraftBian needs those, it would make the system highly unresponsive since it would constantly be trying to connect and talk to these webservices.

I will therefore shortly release an update, which aims to completely remove all references to my webservices, and make CraftBian more selfsustained. Heres what is going to happen:

  • After this update, which will be version 1.6, the Update system will essentially be disabled, since it will no longer have anywhere to look for updates.
  • The automatic server creation feature has until now been using a webservice from cba.today to get the newest Minecraft server.jar automatically by automated code. This code will now be moved into CraftBian itself, away from the Webservice, adding a new settings menu to change the variables if/when Mojang changes their website.
  • The online documentation located on this page has been integrated into CraftBian it self for convenience

The update is available right now, and will be available for the rest of 2020, where after the webservices will be shutdown permanently

If you by 2021 happen to have not managed to update CraftBian through the web interface, and therefore experience a slow and unresponsive interface, due to the webservices being shut down at that point, you can manually update it by downloading the update here. To do a manual update in CraftBian go to the About tab -> Click the Update button -> Switch to Manual -> Select the downloaded file -> Click update

Thanks for anyone who have supported this project! It was a fun time and I learned alot.

~ Daniel

So the time has come for me to get some things out, I should’ve announced a while ago.

CraftBian 2, will most likely never see the day of light. Neither will further development of CraftBian 1

I’m sorry that i have to announce this. But you might also have known it somewhat already, since no news about development for CraftBian has been released for over a year. The reason I’ve decided to do this now and not earlier, is simply because that I’ve actually wanted to get back into the development of CraftBian 2, but the only thing that has changed since i began, is that I’ve lost even more time to work on it.

My wife and I bought an old house back in july last year, which we took over in November last year, and that has simply taken away all the time I’ve had. Since its an old house, there’s just so much stuff to work on and we’re not even close to being done yet. I’ve refused to give up on CraftBian, but I must admit, that i can no longer defend not letting go any longer. So the conclusion had to come to this.

CraftBian has never been anything I’ve made lots of money from. Not many people has ever bought it, BUT that has also never been the thing that has been driving me to continue the developing it. It has always been because of the interest in both programming and Minecraft.

I wont completely rule any future development out just yet. Once we get settled in our house and things begin to fall in place, I will for sure return to programming. And a good way of doing that might very well by picking up CraftBian 2 were i left off. I just cannot say when that will be.

But until then, its been a good and fun ride. The project started as an idea i had with a fellow student to be able to run a Minecraft server on a Raspberry Pi.. I had never imagined it would evolve into a full fledged web administration interface!

Many of you know that CraftBian relies on my web services provided on cba.today. Those are not going to be shutdown anytime soon. They will continue to operate as long as i have cba.today which I have no plans in shutting down. Basically this means, that everything should continue to work as it has been doing until now. I just cannot guarantee that i will fix the web services, if they break down, as fast as I’ve been able to earlier. The CraftBian listing on Sellfy has also been taken down, and i plan to make an announcement inside CraftBian that will link to this post later. I might also take down the Facebook page later, I’m not sure about that just yet.

I want to make a special and HUGE THANK YOU to my friend Shadowstreik. If it wasn’t for this guy, CraftBian wouldn’t have made it even close to as far as it did. I truly believe that he has been responsible for finding, reporting, testing and helping crush at least 70% of all bugs in CraftBian. So to whoever still uses this, you owe a thanks to this guy!

Thanks for all your support and help along the way.

I’ve released CraftBian version 1.5 which fixes some issues with the new Minecraft Server version from 1.13 and up .. Mojang/Microsoft has changed the games command system quite a bit, so i had to make some changes in CraftBian to make it able to talk to Minecraft servers in the new way.

This new version also features some changes for how ram is calculated, mounting is done, and more. The reason for these changes is for compatibility with the new image, which is no longer based on Minibian, but the official Raspbian distro instead. I’ve decided to this basically because the old image was running a few versions behind of CraftBian, and because it seems that the image it was based on, Minibian, is no longer updated, and finally to make it Raspberry Pi 3B+ compatible.

This might very well be the last version of CraftBian 1 you will see, but i said that for version 1.4 too, so lets see what the future brings!

You can find out more about the changes in CraftBian on bitbucket here 

To get the new image,  you simply have to open the mail you got from Sellfy when buying CraftBian. That mail will contain a link, which now holds the new version of CraftBian, called CraftBian_v1.5

If that is not possible for you, write me on my email: djda9l@gmail.com !

I got notified about CraftBian 1 not being compatible with the new Raspberry Pi 3 B+, and since i did not have a unit for testing with, I’ve just ordered one.

If my immediate assumptions are correct, this has to do with the image being rather old now. I then have two options

  1. Create a new image specific for the Raspberry Pi 3 B+
  2. Create a new image that is compatible with all the current compatible Raspberry Pi’s and the new model

I’m not sure what I’m going to do yet. But since CraftBian 2 is eventually going to come out, i might focus my work on that instead, and go with the easy solution for this issue, which is the first option.

Once i get my unit and start testing i will return with more info!

The first CraftBian 2 version is now ready for some testing! I have made an image ready for Raspberry Pi 2 and 3, which is two separate images for now. I’m making an installation script, so CraftBian 2 should be installable on any device (at least in theory), which will be made available later

Be advised though, that this image IS an ALPHA. Stuff is most certainly broken (hence the testing part), and there will be a lot of features missing from CraftBian 1 .

What this image includes

  • Ubuntu 16.04 linux release for Raspberry Pi
  • Laravel 5.5.28
  • CraftBian v2 ALPHA 1 which includes
    • Functionality to create, edit and delete servers
    • Send server commands through the web interface
    • Start/Stop the server
    • Power management of the Raspberry Pi
    • Limited settings for CraftBian

CraftBian 2 is not a continuation of CraftBian 1.. Its a complete do-over. A rewrite, utilizing the Laravel framework. This also means that many features from CraftBian 1 will not be present in this version of CraftBian 2. Those include:

  • Backup feature
  • Port forwarding feature
  • Auto server restart, and power scheduling
  • User management along with user role control
  • Automated server broadcast over LAN
  • etc.

All those above features are planned to be included later, along with new features.

My goal of this first ALPHA is mainly to see how well this idea works with the Laravel framework.

If you want in on the testing, don’t hesitate to contact me on my email djda9l@gmail.com .. Remember, the more testing and feedback i get on this version, the faster i can get new versions out to you, which includes the public release!

In this post I will be explaining some of the changes in CraftBian 2, codewise. These changes has mainly happened because i now utilize Laravel, so this is both notes to my self but might also be useful to others

Laravel

Laravel uses the MVC design pattern, which CraftBian v1.x did not. In CraftBian v1.x i used my “own” design pattern, with a ViewHandler that generated HTML so somewhat still separated from the View, but not completely. Laravel changes all that so that its now more distinctly separated hence the MVC: Model, View, Controller. Now in the view a templating engine called Blade is used, which gets its variables passed from the Controller. This structures the code much better, and most importantly – makes the code much easy to maintain. Furthermore Laravel provides loads of helper features which makes it easier to do Logging, Localization and even showing messages to the user. All features which CraftBian v1.x was missing very much

Localization

In CraftBian v1.x i simply didn’t do localization, which meant that all strings was typed in directly where needed. Laravel uses localization files like the below one

// This file is located in resources\lang\en\minecraft.php and is therefore the 
// ..English translation file

return [

    'motd' => 'MOTD',
    'gametype' => 'Gametype',
    'version' => 'Version',
    'players' => 'Players',
    'world' => 'World',
    'type' => 'Type',

    'server_not_started' => 'Server not started',
    'server_in_starting_stage_msg' => 'The server is currently in starting stage.
Error Messages is normal! If it hasnt started after 15 mins, try rebooting the Raspberry Pi',

    'current_output' => 'Current output',

    'waiting_for_server_output' => 'Waiting for server output...',

]

And when needing a specific translation, you call it out via the __() helper function, which takes the filename as input followed by the key needed like so

// In a Controller (PHP)

$translatedString = __('minecraft.gametype'); // <- Would be: Gametype

// In the blade templating engine (View)

{{ __('minecraft.current_output') }} // <- Would be: Current Output

Logging

Logging is also a feature which i would have appreciated back in CraftBian v1.x, mainly because it would be much easier to debug when CraftBians users were having trouble with something, which i needed to assist on. Laravel makes this very easy. An example below of logging a simple information is shown:

public function reboot()
{                     
    Log::info('Reboot has been called', ["user" => Auth::user()]);
    // ...
    // Doing the actual reboot stuff
    // ...
    Log::error('Rebooting unit failed!', ["returned" => $errorMessage]); 
}

As you can see its as simple as calling the static method info inside the Log class. This methods first argument would be a simple titile describing what has happened, and the next parameter is an array containing contextual and relevant info, but it is optional. There are other methods besides info or error, which you can find more info about here .

The log file containing all this is stored in storage/logs/laravel.log

Messages to the user (Flash messages)

CraftBian v1.x missed a lot of feedback to the user, when they did something inside the interface, being everything from saving a server.properties file for a Minecraft server, or setting up a backup schedule. In Laravel this is so easy to do with Flash messages:

// Below method is called when the user clicks a save button
public function saveSettings(Request $request)
{
    // .. the changed settings are inside the $request parameter
    // .. and is then updated, and finally:

    $request->session()->flash('success', 'Settings saved!'); 
    // The above line stores a message, which is the shown when the view 
    // .. is returned below:
    return view('settings');
}

This is mostly notes to my self, but others might find it useful / interesting  . It also gives you a slight insight in the development of CraftBian 2

I have more things i would like to cover, like the Model structure and how Object relational mapping works in Laravel, which i also get to utilize in CraftBian 2, because it now uses SQLite to store its settings instead of JSON as in CraftBian v1.x.

When CraftBian 2 is going into its closed beta testing, i have thought about how i want versions to be “named” or categorized until the final public release.

There will be three “milestones” before the actual public release and they will be named as follows: (arrow representing what I’m currently working on)

CraftBian 2 ALPHA
The goal of this version is to get basic functionality working. As of this writing, this is the version that CraftBian 2 is currently in. It includes the following:

Core functionality
Logging, Localization and Code structure
Unit power management
Unit status and usage display
CPU, RAM etc. as known from CraftBian v1.x
Minecraft Controls
Starting and stopping
Minecraft Server Console I/O
Basic Minecraft Server Creation
Including the creation of multiple servers
Minecraft Server settings
server.properties editing
CraftBian basic settings
Basic settings, Timezone setup and Hostname setup
About page including an Updating system
Might be simple at first

CraftBian 2 BETA
After the ALPHA version is in place, bug fixes is needed AND the rest of the relevant functionality from CraftBian v1.x will be moved over

Minecraft Server settings
White/Black list, operators and world handling
More CraftBian settings
Power scheduling, Storage management and user control
Backup feature
Automated Port mappings
Auto server download via API like in CraftBian v1.x
Server LAN broadcast via Python script like in CraftBian v1.x

CraftBian 2 DELTA
This will add (some of?) the new planned features for CraftBian 2 and fix the bugs in them

Force server shutdown if it hangs
Optimize dependancy of remote server
Log submission from Client to me, for easier bugfixing
Web based File browser
First time wizard
Guiding the user to set up different settings

CraftBian v2.0 (Public Release version)
First public release version, hopefully with bugs fixed and new features added. This version will be freely available to everyone who has already purchased CraftBian!

ONLY fix bugs since DELTA version

As you can see, I’ve added some checkboxes and checkmarks, so that you can follow the progress of the upcoming version, which will be updated along the development. Bugs are supposed to be added in BitBucket, but for now I’m going to use this, until i get further into the development!

And as a last thing, heres a screenshot of the current build. Its begging to take shape!

That’s it for now. This list might be updated with new/missing stuff along the way. If you want to help out with the development of CraftBian by testing it out, just write me and I’ll let you know more as soon as its available.

Progress has been slow on development of CraftBian 2. Sorry to say this, but i haven’t really gotten far yet. Now that “Winter is coming”, and i have finally found some time again, I’m hoping that i can actually progress now.

However, there is only a few things  to tell for now.

It seems like the repositories on the original CraftBian image was broken
This isn’t really related to CraftBian 2, but i think it should be mentioned somewhere as it was a little concerning. CraftBians trusty betatester and user Shadowstreik, pointed this out to me the other day, and it seemed to have been broken for at least a week. To the normal user, this shouldn’t be a an issue, but if you tend to keep the packages behind CraftBian up to date, this was halting that process completely. It seems like that Minibian have JUST been fixed, as in as i was writing this post, so that is good news at least. Otherwise i would’ve had to create a completely new image for CraftBian.

I’ve got a Minecraft Server running on the upcoming CraftBian 2 image
Not exactly huge news, but I’ve just gotten a Minecraft Server running on the upcoming CraftBian 2 image. Using the default JAVA runtime environment on a Ubuntu installation makes this task impossible due to very very poor performance. So i had to switch it out with Oracle’s JAVA instead, which boosts performance 100x compared to the original on the Ubuntu image. This is the same package which i use on the current CraftBian image, albeit newer, so performance should, and seems, to be around the same 🙂

CraftBians backend has FINALLY been upgraded!
I’ve wanted to this for over 6 months, but have been waiting for a specific model to be released. CraftBians backend, has until last weekend been running on a Synology NAS. More specific the model called DS214SE. This was a model from 2014, and back then it was the cheapest model they made = the slowest and worst unit spec wise. I didn’t originally intent to run a webserver or any of the other tasks it ended up doing for that matter. It had a single core 700 mhz CPU with 256 mb ram, so not exactly a beast. The new unit is a 2018 model: DS918+, which is Synology’s top model for Home / Small office use. This has a Celeron 4 core cpu @ 1.5 GHz boosting up to 2,4 Ghz, and 4 GB ram, so it should be, and seems to be, a very nice performance boost and hopefully helps the speed of CraftBians webservices and backend.

That is all for now! I hope i get started with the development of the actual interface a little more this weekend. There is ALOT to do yet before anything is even remotely ready for beta testing, but i will keep this space updated, hopefully more often from now on 🙂

I’m glad to announce that the next big CraftBian version has begun its development! I do not have much information yet, as very much can change. Nothing is certain yet. However i do have a few plans for it listed below:

  • Will be based on a light Ubuntu distribution
    Instead of Minibian as is used now, i want to use Ubuntu at it is updated more frequently and still based on Debian. Also wider support across multiple platforms.
  • Multiple platform/board support.
    I hope to make a CraftBian installer, so that you can install the interface on whatever platform you might want to use. Everything from a Raspberry Pi, to a full fledged Server PC. However i still want to provide a full image like you are used to on the current CraftBian release.
  • Build on the Laravel PHP Framework.
    I’ve already begun the early testing phase on this, to test the compatibility of the current functionality in CraftBian
  • Nginx to replace Lighttpd
    Simply because it is better supported

Smaller, yet important changes:

  • Make less dependent on remote server
    One of the things that i don’t quite like about CraftBian v1.x is that if my remote server is down, CraftBian will be very slow or/and maybe even not work properly. This is something i do not want.
  • Better updating system, that can also account for the software behind CraftBian
    When updating CraftBian currently, the software behind it, in Linux, is not updated. This means that if some major change happened on this side, the user would be forced to completely reflash the image with a newer version. Something i do not want.
  • Multi language
    Something i had always intended but never got around to.
  • Logging system, maybe even remote submission of logs
    Another thing i had always wanted, but never got around to, as it would be easier for me to help and debug users having trouble.

This blog is intended for a detailed explanation on the progress of the development of CraftBian 2 and it will include some rather techy terms along with some programming. I also intend to use it for my self, as notes i need to remember along the way.

.. To be continued !

logo_small

Heard of my latest project CraftBian ? Its a web interface I’ve been working on and off on, for the last 3 months for administrating Minecraft Servers running on Raspberry Pi. And now its done! Well the interface it self and image is done and ready, but i just need to get some legal stuff in place before i can release it. Which is (hopefully) the least difficult part of it all. So stay tuned! For more details on what it can do go here.