NOTE: This repo works as development workbench for non-existing releases.
naksu
is collection of helper scripts for MEB stickless Abitti/matriculation exam servers.
In real life Naksu is Onerva's (the Abitti model teacher) cat.
The need for some kind of helper scripts appeared to be evident as we followed support requests and feedback from school IT staff and teachers.
These scripts are currently under planning/proof-of-concept stage. The executables can be downloaded from GitHub. Download either Windows or Linux version and execute the file in the OS-related zip. After this naksu updates itself when executed.
- Make sure you have
vagrant
executable - Make sure Oracle VirtualBox is installed
- Create
~/ktp
if it does not exist - Create
~/ktp-jako
if it does not exist - If
~/ktp/Vagrantfile
exists executevagrant destroy -f
(we expect that there is existing installation) - Delete
~/ktp/Vagrantfile.bak
- Rename
~/ktp/Vagrantfile
to~/ktp/Vagrantfile.bak
- Retrieve
http://static.abitti.fi/usbimg/qa/vagrant/Vagrantfile
to~/ktp/Vagrantfile
- Execute
vagrant box update
- Execute
vagrant box prune
Same as install/update procedure but the user is able to select Vagrantfile
. The
file must be downloaded beforehand by the school principal.
- Make sure you have
vagrant
executable - Make sure Oracle VirtualBox is installed
- Execute
vagrant up
- Make sure you have
vagrant
executable - Make sure you have
VBoxManage
executable - Get VirtualBox VM id of the vagrant default machine from
~/ktp/.vagrant/machines/default/virtualbox/id
VBoxManage showvminfo -machinereadable {Machine UUID}
-> GetDisk UUID
fromSATA Controller-ImageUUID-0-0
VBoxManage clonemedium {Disk UUID} {destination path} --format VMDK
VBoxManage closemedium {destination path}
Since the cloned disks can be quite large the user might want to select the media for the save. Unfortunately, libui SaveFile dialog does not support folders.
naksu
can be used in Linux and Windows environments. The compiling is supported
only on Linux. You need at least Go 1.7 to build naksu. In
Debian/Ubuntu environment install golang-1.9
or golang-1.10
.
Make sure go
points to your compiler or set GO
to point your go binary (in Makefile
).
- Install
dep
using these instructions - Install Docker daemon
make docker
Resulting binaries are saved to bin/
directory as naksu
and naksu.exe
Preferred way to compile naksu
is using Docker.
This currently works most reliably in Ubuntu Xenial. Later Ubuntu versions have compiled system libraries in different way, and this causes linux build to fail.
- Install
libgtk-3-dev
which is required bylibui
. - Run
make update_libs
to get all required golang dependencies. make linux
Windows version can be cross-compiled using mingw-w64. You need at least 5.0 of mingw-w64 libs. Build it from source if your pre-packaged version is older:
- Make sure your pre-packaged mingw-w64 is installed (Debian/Ubuntu:
mingw-w64
). - Get mingw-w64 from https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/
- Build:
mkdir ~/mingw-w64/current
./configure --prefix=$HOME/mingw-w64/current --host=x86_64-w64-mingw32
make -j4
make install
- By default the
Makefile
expects mingw-w64 at$HOME/mingw-w64/current
. This can be changed by editingCGO_LDFLAGS="-L$(HOME)/mingw-w64/current/lib"
in thenaksu.exe
rule. The path should point tolib
under your mingw-w64 install path.
After installing mingw-w64:
make windows
Windows version is built with icon file. Building src\naksu.syso
is done with
rsrc.
In case of trouble execute naksu with -debug
switch. If naksu can't find your vagrant
/VBoxManage
executable(s) you can use VAGRANTPATH
and VBOXMANAGEPATH
environment variables to set these by hand:
VAGRANTPATH=/opt/vagrant/latest/bin/vagrant naksu
VBOXMANAGEPATH=D:\Oracle\VirtualBox\VBoxManage.exe naksu
However, please report these problems since we would like to make naksu as easy to use as possible.
- Invent new version number. Naksu uses semantic versioning
- Update Changelog (below) and set version number in
src/naksu.go
(const version = "X.Y.Z"
) - Build version with
make docker
(or better, wait CI to do this) - Double-check the build really has the correct version number:
- Start
naksu
- Naksu should update itself
- Go to releases
- Click "Draft a new release"
- Enter the new version number to "Tag version" field (e.g. "v1.6.0" - note the "v")
- Fill "Release title"
- Copy release note markup from
README.md
to "Describe this release" textarea - Attach release files
naksu_linux_amd64.zip
andnaksu_windows_amd64.zip
you got from the build - Click "Publish release"
Things to consider later:
- Avoid asking administrator rights (Windows): Github
User interface
- Added button for removing exams (
vagrant destroy -f
) - Added button for removing servers (delete
~/.vagrant.d
,~/.VirtualBox
,~/ktp
and~/VirtualBox VMs
) - Detect installed VM version from
~/ktp/Vagrantfile
instead of Vagrant data files - Changed the low disk warning level from 5 Gb to 50 Gb
- Added . (period) to the list of accepted characters in the home directory path
- User can cancel confirmation dialogs by closing the window
Other changes
- Major rewrite of code
- Build and test on a Docker environment instead of local workstation
- Added support for compiling and executing Naksu on Darwin (needed by some of the developers)
User interface
- Hide management buttons behind a checkbox
- Removed Exit button in favour of Open ktp-jako button
- Refuse to install/update without network connection by disabling the buttons
Other changes
- Warn user if home path contains 8-bit characters
- Refuse to import Vagrantfile from ~/ktp/Vagrantfile
- Added desktop as a valid backup target location
- Make sure the selected backup target location is writeable
- Hide 'Invalid state while booting' errors from UI
- Use term "virtual server" instead of "stickless server"
- Improvements which make it easier to build Naksi using a continuous integration server
- Always create debug file to
~ktp/naksu_lastlog.txt
orTEMP/naksu_lastlog.txt
- Give more informative error message when vagrant exits with
--macaddress
error message - Bugfix: get Linux temporary path from
TempDir()
instead ofTEMP
env var
- Show current server version
- Show status messages when working with vagrant/VBoxManage
- UI Language support (Finnish, Swedish)
- Restart with
x-terminal-emulator
if started via file manager (Linux) - Warn user if there is less than 5 Gb free disk before install, update or backup
- Bugfix: Don't panic if media does not have vendor/model (Linux)
- Get vendor/model strings for removable media directly from WMI without
wmic
(Windows) - Application icon (Windows)
- Added logging (use
-debug
switch to show debug messages)
- User can create a backup (clone) from VM hard drive
- Continues execution although binary update fails
- User can switch between Abitti and Matriculation Exam servers