-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from BenediktMKuehne/update-func
Updater app
- Loading branch information
Showing
26 changed files
with
738 additions
and
316 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.1-02a5f8d9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# EMBArk - The firmware security scanning environment | ||
# | ||
# Copyright 2024 Siemens Energy AG | ||
# | ||
# EMBArk comes with ABSOLUTELY NO WARRANTY. | ||
# | ||
# EMBArk is licensed under MIT | ||
# | ||
# Author(s): Benedikt Kuehne | ||
|
||
# Description: Automates writing the VERSION.txt | ||
|
||
# create version | ||
sed -i "s|-.*|-$(git describe --always)|1" "$(dirname "${0}")/../VERSION.txt" | ||
# and tag for version | ||
# TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.conf import settings | ||
|
||
|
||
def embark_version(request): | ||
return {'EMBARK_VERSION': settings.VERSION[0], 'EMBA_VERSION': settings.VERSION[1]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#embarkLogo { | ||
width: 100%; | ||
padding: 50px; | ||
} | ||
|
||
#embarkLogo img { | ||
width: 60%; | ||
max-width: 600px; | ||
display: block; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
::selection{ | ||
background-color: #160022; | ||
color: #ffcc00; | ||
} | ||
|
||
.alert { | ||
margin: 30px; | ||
} | ||
|
||
#login_footer { | ||
text-align: center; | ||
margin: 50px 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{% load django_bootstrap5 %} | ||
|
||
<div class="box"> | ||
<form action="{% url 'embark-updater-check' %}" method="post" id="form"> | ||
{% csrf_token %} | ||
<div class="innerBlock"> | ||
{% load filters %} | ||
{% bootstrap_form emba_check_form %} | ||
<button type="submit" class="btn btn-primary">Check</button> | ||
</div> | ||
</form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
{% load django_bootstrap5 %} | ||
{% load tz %} | ||
|
||
{% block style %} | ||
<link rel="stylesheet" type="text/css" href="{% static 'content/css/logviewer.css' %}"/> | ||
<link rel="stylesheet" type="text/css" href="{% static 'content/css/updater.css' %}"/> | ||
{% endblock style %} | ||
|
||
{% block title %}EMBArk updater dashboard{% endblock title %} | ||
{% block navigation %}{% include "navigation.html" %}{% endblock navigation %} | ||
|
||
{% bootstrap_messages %} | ||
|
||
{% block maincontent %} | ||
{% timezone request.session.django_timezone %} | ||
<div class="update-form-container"> | ||
<div id="embarkLogo"> | ||
<img src="{% static 'content/images/embark_logo.svg' %}" alt="EMBArk logo graphic" height="auto" width="auto"/> | ||
</div> | ||
<div class="d-flex justify-content-center"> | ||
<h2><span class="badge bg-primary">Current Version:</span> {{ EMBARK_VERSION }}</h2> | ||
</div> | ||
<div class="d-flex justify-content-center"> | ||
<a href="https://github.com/e-m-b-a/embark/releases/latest">Release-Notes</a> | ||
</div> | ||
<hr> | ||
<div class="update-check d-flex justify-content-center"> | ||
<h3><span class="badge bg-secondary">EMBA version</span> {{ EMBA_VERSION }}</h3> | ||
</div> | ||
<div id="progress"> | ||
{% block progress %}{% include "updater/progress.html" %}{% endblock progress %} | ||
</div> | ||
<div id="check"> | ||
{% block check %}{% include "updater/check.html" %}{% endblock check %} | ||
</div> | ||
<div id="update"> | ||
<p> | ||
<button class="btn btn-primary" type="button" data-bs-toggle="collapse" data-bs-target="#collapseEMBA" aria-expanded="false" aria-controls="collapseEMBA" title="Update EMBA"> | ||
Update EMBA | ||
</button> | ||
</p> | ||
{% block update %}{% include "updater/update.html" %}{% endblock update %} | ||
</div> | ||
|
||
</div> | ||
|
||
{% endtimezone %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% load django_bootstrap5 %} | ||
{% load static %} | ||
<div class="box"> | ||
{{ log_content|safe }} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% load django_bootstrap5 %} | ||
|
||
<div class="collapse" id="collapseEMBA"> | ||
<div class="box"> | ||
<p class="mainText">EMBA Configuration</p> | ||
<p class="subText">Update EMBA</p> | ||
|
||
<form action="{% url 'embark-updater-update' %}" method="post" id="form"> | ||
{% csrf_token %} | ||
<div class="innerBlock"> | ||
{% load filters %} | ||
{% bootstrap_form emba_update_form %} | ||
<button type="submit" class="btn btn-primary" data-bs-toggle="collapse.show" data-bs-target="collapseStart">Update</button> | ||
</div> | ||
</form> | ||
|
||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class UpdaterConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'updater' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import logging | ||
from django import forms | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class EmbaUpdateForm(forms.Form): | ||
option = forms.MultipleChoiceField(choices=[ | ||
('GIT', 'Git Update'), ('DOCKER', 'Docker Update'), ('NVD', 'CVE Update') | ||
], help_text='Update EMBA', widget=forms.CheckboxSelectMultiple, required=False) | ||
|
||
|
||
class CheckForm(forms.Form): | ||
option = forms.ChoiceField(choices=[ | ||
('BOTH', 'Host and container'), ('CONTAINER', 'Only Container') | ||
], help_text='Check EMBA', widget=forms.Select, required=True) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.urls import path | ||
|
||
from updater import views | ||
|
||
# view routing | ||
urlpatterns = [ | ||
path('updater/', views.updater_home, name='embark-updater-home'), | ||
path('updater/update-emba', views.update_emba, name='embark-updater-update'), | ||
path('updater/check-emba', views.check_update, name='embark-updater-check'), | ||
path('updater/progress', views.progress, name='embark-updater-progress'), | ||
path('updater/raw-progress', views.raw_progress, name='embark-updater-raw') | ||
] |
Oops, something went wrong.