mrblacyk / boxer Goto Github PK
View Code? Open in Web Editor NEWBoxer is a self-hosted platform for managing boxes (VMs). Some say it's open-source HackTheBox platform.
License: Apache License 2.0
Boxer is a self-hosted platform for managing boxes (VMs). Some say it's open-source HackTheBox platform.
License: Apache License 2.0
There is a news section but the only place for adding a news is django admin. Would be cool to have a button for admins Add news
with a django form to add it.
Make a setup page when there are no users nor settings in the database. So when a user (or in the future - a Dockerfile) does:
# migrate DB
./manage.py migrate
# start the app
./manage.py runserver 0:80
# or other more production deployment like apache2 with mod wsgi
..they are greeted with setup page. Probably this needs to be done as the last issue to contain the most settings.
Rewrite deployment code to utilise libvirt-python
instead of callCmd
and virsh
.
Snapshot creation and revert are already defined in aplibvirt.py
so definitely make use of those.
def createSnapshot(
virt_conn: libvirt.virConnect,
domain_name: str, snapshot_name: str) -> bool:
""" Make a snapshot of shutoff VM """
# (..)
def revertSnapshot(
virt_conn: libvirt.virConnect,
domain_name: str, snapshot_name: str) -> bool:
""" Revert a snapshot of shutoff VM """
The initial snapshot name should be fixed. I make INIT
snapshots with virsh
but I'm open to other names if it will be fixed.
Right now code in aplibvirt.py
is:
def connect(URI: str = "qemu:///system") -> libvirt.virConnect:
""" Simple libvirt connect function """
return libvirt.open(URI)
So it's ready to consume different URI.
What needs to be done:
Create a Celery + RabbitMQ + PostgreSQL setup and integration with the project.
This must provide a robust scheduling system which can be cancelled. All the edgy cases should be handled (trying to cancel a task in a queue which was already cancelled, etc).
The idea is to provide a functionality to:
The code should call resetMachine
and stopMachine
from aplibvirt.py
accordingly. The former is not yet defined and needs to be created (but in the worst case it can be similar to stopMachine
), the latter is with the code of:
def stopMachine(
virt_conn: libvirt.virConnect, domain_name: str) -> [int, bool]:
""" Stop a domain by name
Returns a list with:
* an integer return code,
* a boolean saying if the machine was already stopped.
"""
virt_conn = reassureConnection(virt_conn)
return _machineOperation(virt_conn, domain_name, "stop")
Right now, network deployment uses callCmd
method. It needs to be rewritten to utilise libvirt-python instead. All the libvirt logic should be put into aplibvirt.py
.
As of now, the platform is capable of starting and stopping the machines but there is no easy access to boxes. OpenVPN integration is the first thing which comes to my mind but I had no prior experience with it so if anybody has a better solution to this problem - you are more than welcome.
This is a big issue as it requires not only a research on the subject, PoC but also an actual implementation and integration.
As of now, only the stop functionality is implemented and it is implemented in a way that the hypervisor sends a graceful shutdown signal. This should be a force ACPI shutoff with the revert to the initial snapshot afterwards.
The reset function should do the stop (defined above) and then a start.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.