Compare commits
4 Commits
373ce1247e
...
60cd5140d2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60cd5140d2 | ||
|
|
dcbc8dd062 | ||
|
|
08f232bf51 | ||
|
|
75d068fef6 |
@@ -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()
|
|
||||||
@@ -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
|
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/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, \
|
from flask import Flask, request, session, redirect, \
|
||||||
@@ -10,10 +10,10 @@ import logging
|
|||||||
import dmm.lsblk as lsblk
|
import dmm.lsblk as lsblk
|
||||||
import importlib
|
import importlib
|
||||||
import yaml
|
import yaml
|
||||||
|
import sys
|
||||||
|
|
||||||
# configuration
|
# configuration
|
||||||
#CONFIGFILE="templates/dmm-installer-template.yaml"
|
CONFIGFILE="/etc/yasi/yasi.yaml"
|
||||||
CONFIGFILE="templates/dmm-installer-vm-template.yaml"
|
|
||||||
|
|
||||||
# import config
|
# import config
|
||||||
global config
|
global config
|
||||||
@@ -28,6 +28,7 @@ app.config.from_object(__name__)
|
|||||||
app.config['CONFIG'] = config
|
app.config['CONFIG'] = config
|
||||||
app.app_context().push()
|
app.app_context().push()
|
||||||
config['settings']['menu'] = {}
|
config['settings']['menu'] = {}
|
||||||
|
sys.path.append('/usr/share/yasi-daemon')
|
||||||
|
|
||||||
if DEV_MODE:
|
if DEV_MODE:
|
||||||
print("Note: Starting in devmode!")
|
print("Note: Starting in devmode!")
|
||||||
@@ -53,8 +54,8 @@ if DEV_MODE == "1":
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
serve(app,
|
serve(app,
|
||||||
host='0.0.0.0',
|
host='127.0.0.1',
|
||||||
port=8080,
|
port=9274,
|
||||||
url_scheme='http',
|
url_scheme='http',
|
||||||
expose_tracebacks=DEV_MODE)
|
expose_tracebacks=DEV_MODE)
|
||||||
|
|
||||||
32
src/yasi-webclient
Executable file
32
src/yasi-webclient
Executable 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')
|
||||||
0
src/yasi_applets/__init__.py
Normal file
0
src/yasi_applets/__init__.py
Normal 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>
|
<h1> Raw data </h1>
|
||||||
{{ disk }}
|
{{ disk }}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<!-- drag region class: -->
|
<!-- drag region class: -->
|
||||||
<div id="titlebar" class="pywebview-drag-region" style="padding: 15px; margin: -15px; padding-bottom: 30px;">
|
<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 %}
|
{% 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>
|
<a href="{{ menu[item][1]}}"> <button class="button is-{% if request.path == menu[item][1] %}info{% else %}dark{% endif %}"> {{ menu[item][0]}} </button></a>
|
||||||
|
|||||||
BIN
src/yasi_applets/main/static/icons/yasi.png
Normal file
BIN
src/yasi_applets/main/static/icons/yasi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
@@ -109,7 +109,6 @@ def build_menu():
|
|||||||
Define menu items and paths.
|
Define menu items and paths.
|
||||||
"""
|
"""
|
||||||
current_app.config['CONFIG']['settings']['menu']['users'] = (build_stringlist()['menu_item'], "/users", 20)
|
current_app.config['CONFIG']['settings']['menu']['users'] = (build_stringlist()['menu_item'], "/users", 20)
|
||||||
print(current_app.config['CONFIG']['settings']['menu'])
|
|
||||||
|
|
||||||
|
|
||||||
def build_summary():
|
def build_summary():
|
||||||
@@ -118,7 +117,6 @@ def build_summary():
|
|||||||
"""
|
"""
|
||||||
current_app.config['CONFIG']['Summary']['users'] = {}
|
current_app.config['CONFIG']['Summary']['users'] = {}
|
||||||
current_app.config['CONFIG']['Summary']['users']['heading'] = "Users and Identity"
|
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']['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'])
|
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?")
|
return("ok?")
|
||||||
|
|||||||
@@ -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
|
|
||||||
14
systemd/yasi-daemon.service
Normal file
14
systemd/yasi-daemon.service
Normal 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
|
||||||
Reference in New Issue
Block a user