Compare commits

...

4 Commits

Author SHA1 Message Date
Jonathan Carter
60cd5140d2 Add systemd unit 2025-08-26 15:58:42 +02:00
Jonathan Carter
dcbc8dd062 Try to make header moving work 2025-08-26 15:58:32 +02:00
Jonathan Carter
08f232bf51 Rename to yasi, add icon 2025-08-26 15:22:26 +02:00
Jonathan Carter
75d068fef6 Exclude cd and loop devs 2025-08-25 20:58:26 +02:00
11 changed files with 54 additions and 86 deletions

View File

@@ -1,20 +0,0 @@
#!/usr/bin/env python3
import webview
LOCATION = "http://localhost:8080/welcome"
def on_closed():
"""
Actions to take when System Installer is closed.
"""
print('pywebview window is closed')
window = webview.create_window('System Installer', LOCATION,
transparent=True, easy_drag=False, frameless=True,
width=1050, focus=True, zoomable=True,
confirm_close=True, resizable=True)
window.events.closed += on_closed
webview.start()

View File

@@ -1,32 +0,0 @@
#!/usr/bin/env dmm-perform-recipe
module_path:
- local
settings:
language: en
devmode: True
apt_depends: util-linux adduser parted e2fsprogs debootstrap
apps: main welcome users disks software summary install
menu_order: welcome users disks software summary
recipe:
installer_dependencies:
description: Installing Dependencies
module: aptpkg
function: install
packagooes: apt
chrooti: /tmp
users:
module: users
function: add
users:
- username:
password:
fullname:
sudo: True
popcon:
module: software
function: popcon
enable_popcon: False

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
Welcome to SID - The System Installer Daemon!
Welcome to YaSID - The The Yasi System Installer Daemon!
"""
from flask import Flask, request, session, redirect, \
@@ -10,10 +10,10 @@ import logging
import dmm.lsblk as lsblk
import importlib
import yaml
import sys
# configuration
#CONFIGFILE="templates/dmm-installer-template.yaml"
CONFIGFILE="templates/dmm-installer-vm-template.yaml"
CONFIGFILE="/etc/yasi/yasi.yaml"
# import config
global config
@@ -28,6 +28,7 @@ app.config.from_object(__name__)
app.config['CONFIG'] = config
app.app_context().push()
config['settings']['menu'] = {}
sys.path.append('/usr/share/yasi-daemon')
if DEV_MODE:
print("Note: Starting in devmode!")
@@ -53,8 +54,8 @@ if DEV_MODE == "1":
if __name__ == '__main__':
serve(app,
host='0.0.0.0',
port=8080,
host='127.0.0.1',
port=9274,
url_scheme='http',
expose_tracebacks=DEV_MODE)

32
src/yasi-webclient Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env python3
import webview
LOCATION = "http://localhost:9274/welcome"
def on_closed():
"""
Actions to take when System Installer is closed.
"""
print('pywebview window is closed')
window = webview.create_window('System Installer', LOCATION,
transparent=True, easy_drag=True, frameless=True,
width=1050, focus=True, zoomable=True,
confirm_close=True, resizable=True,
)
webview.settings = {
'ALLOW_DOWNLOADS': False,
'ALLOW_FILE_URLS': False,
'DRAG_REGION_SELECTOR': 'pywebview-drag-region',
'OPEN_EXTERNAL_LINKS_IN_BROWSER': True,
'OPEN_DEVTOOLS_IN_DEBUG': True,
'IGNORE_SSL_ERRORS': False,
'REMOTE_DEBUGGING_PORT': None,
'SHOW_DEFAULT_MENUS': True
}
window.events.closed += on_closed
webview.start(icon='/usr/share/icons/yasi.png')

View File

View File

@@ -64,10 +64,9 @@
-->
<!-- {% for disk in blockdevs["blockdevices"] if disk["name"] != "zram0"%} -->
{% for disk in blockdevs["blockdevices"] if disk["name"] != "zram0" and disk["name"] != "loop0" and disk["name"] != "sr0" %}
<!--
<h1> Raw data </h1>
{{ disk }}

View File

@@ -4,7 +4,7 @@
<!-- drag region class: -->
<div id="titlebar" class="pywebview-drag-region" style="padding: 15px; margin: -15px; padding-bottom: 30px;">
<a hx-get="/main/menu" hx-swap="outerHTML"/> <button class="button is-link"> </button </a>
<a hx-get="/main/menu" hx-swap="outerHTML"/> <button class="button is-link"> <i class="fa fa-bars" aria-hidden="true"></i> </button> </a>
{% for item in menu_order %}
<a href="{{ menu[item][1]}}"> <button class="button is-{% if request.path == menu[item][1] %}info{% else %}dark{% endif %}"> {{ menu[item][0]}} </button></a>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -109,7 +109,6 @@ def build_menu():
Define menu items and paths.
"""
current_app.config['CONFIG']['settings']['menu']['users'] = (build_stringlist()['menu_item'], "/users", 20)
print(current_app.config['CONFIG']['settings']['menu'])
def build_summary():
@@ -118,7 +117,6 @@ def build_summary():
"""
current_app.config['CONFIG']['Summary']['users'] = {}
current_app.config['CONFIG']['Summary']['users']['heading'] = "Users and Identity"
current_app.config['CONFIG']['Summary']['users']['bleh'] = current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']
current_app.config['CONFIG']['Summary']['users']['settings'] = current_app.config['CONFIG']['recipe']['users']['users']
current_app.config['CONFIG']['Summary']['users']['text'] = "Add primary user with the username: " + str(current_app.config['CONFIG']['recipe']['users']['users'][0]['username'])
return("ok?")

View File

@@ -1,24 +0,0 @@
from applets.software import bp
from flask import Flask, request, session, redirect, \
url_for, render_template, flash, Blueprint
# we use this neat little trick to get config data from the main app
from flask import current_app
def build_stringlist():
"""
Return all the strings that is used in this applet.
"""
string_dict = {}
string_dict['initial_user_text'] = _("Let's set up an initial user.")
string_dict['full_name'] = _("Full Name")
string_dict['user_name'] = _("Username")
string_dict['user_name_available'] = _("This username is available")
string_dict['user_name_not_available'] = _("This username is not available")
string_dict['user_name_reserved'] = _("This username is reserved by the system")
string_dict['user_name_characters'] = _("The username must be one word, lowercase, with no special characters")
string_dict['password'] = _("Password")
string_dict['password_confirm'] = _("Password (confirm)")
string_dict['password_nomatch'] = _("These passwords do now match")
string_dict['password_tooshort'] = _("This password is too short")
return string_dict

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Yasi Daemon
After=network.target
[Service]
ExecStart=yasi-daemon
Environment="FLASK_ENV=production"
User=yasi
Group=yasi
Restart=always
[Install]
WantedBy=multi-user.target