From 1866cb7fcf997de2c0ccfd77eb2c190d0d01298b Mon Sep 17 00:00:00 2001 From: brent s Date: Sat, 2 Nov 2019 01:45:28 -0400 Subject: [PATCH] blank/fresh start --- __init__.py | 0 app/__init__.py | 7 --- app/js/multiform.js | 32 ------------ app/templates/_formhelper.html | 12 ----- app/templates/base.html | 52 ------------------- app/templates/generator.html | 74 --------------------------- app/templates/index.html | 12 ----- app/templates/storage/disk.html | 17 ------ app/templates/storage/filesystem.html | 0 app/templates/storage/index.html | 30 ----------- app/templates/storage/luks.html | 0 app/templates/storage/lvm.py | 0 app/templates/storage/mdadm.html | 0 app/views.py | 33 ------------ config.py | 3 -- run.py | 8 --- uwsgi.ini | 18 ------- 17 files changed, 298 deletions(-) delete mode 100644 __init__.py delete mode 100644 app/__init__.py delete mode 100644 app/js/multiform.js delete mode 100644 app/templates/_formhelper.html delete mode 100644 app/templates/base.html delete mode 100644 app/templates/generator.html delete mode 100644 app/templates/index.html delete mode 100644 app/templates/storage/disk.html delete mode 100644 app/templates/storage/filesystem.html delete mode 100644 app/templates/storage/index.html delete mode 100644 app/templates/storage/luks.html delete mode 100644 app/templates/storage/lvm.py delete mode 100644 app/templates/storage/mdadm.html delete mode 100644 app/views.py delete mode 100644 config.py delete mode 100755 run.py delete mode 100644 uwsgi.ini diff --git a/__init__.py b/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/app/__init__.py b/app/__init__.py deleted file mode 100644 index 24fdf84..0000000 --- a/app/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -from flask import Flask - -app = Flask(__name__, instance_relative_config = True) - -from app import views - -app.config.from_object('config') diff --git a/app/js/multiform.js b/app/js/multiform.js deleted file mode 100644 index 548028e..0000000 --- a/app/js/multiform.js +++ /dev/null @@ -1,32 +0,0 @@ -// https://github.com/sebkouba/dynamic-flask-form -$(function() { - $("div[data-toggle=fieldset]").each(function() { - var $this = $(this); - - //Add new entry - $this.find("button[data-toggle=fieldset-add-row]").click(function() { - var target = $($(this).data("target")) - console.log(target); - var oldrow = target.find("[data-toggle=fieldset-entry]:last"); - var row = oldrow.clone(true, true); - console.log(row.find(":input")[0]); - var elem_id = row.find(":input")[0].id; - var elem_num = parseInt(elem_id.replace(/.*-(\d{1,4})-.*/m, '$1')) + 1; - row.attr('data-id', elem_num); - row.find(":input").each(function() { - console.log(this); - var id = $(this).attr('id').replace('-' + (elem_num - 1) + '-', '-' + (elem_num) + '-'); - $(this).attr('name', id).attr('id', id).val('').removeAttr("checked"); - }); - oldrow.after(row); - }); //End add new entry - - //Remove row - $this.find("button[data-toggle=fieldset-remove-row]").click(function() { - if($this.find("[data-toggle=fieldset-entry]").length > 1) { - var thisRow = $(this).closest("[data-toggle=fieldset-entry]"); - thisRow.remove(); - } - }); //End remove row - }); -}); \ No newline at end of file diff --git a/app/templates/_formhelper.html b/app/templates/_formhelper.html deleted file mode 100644 index 5790894..0000000 --- a/app/templates/_formhelper.html +++ /dev/null @@ -1,12 +0,0 @@ -{% macro render_field(field) %} -
{{ field.label }} -
{{ field(**kwargs)|safe }} - {% if field.errors %} - - {% endif %} -
-{% endmacro %} \ No newline at end of file diff --git a/app/templates/base.html b/app/templates/base.html deleted file mode 100644 index 95e0a64..0000000 --- a/app/templates/base.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - {% block title %}{% endblock %} - - - - - - - - - - - - - -
-
- -
- {% block body %}{% endblock %} - -
- - - \ No newline at end of file diff --git a/app/templates/generator.html b/app/templates/generator.html deleted file mode 100644 index 80090d9..0000000 --- a/app/templates/generator.html +++ /dev/null @@ -1,74 +0,0 @@ -{% extends "base.html" %}{% block title %}AIF-NG Configurator | Generator{% endblock %}{% block body %} -
-

Generator

-

WARNING: Please note that this site may have you submit sensitive - information such as passwords, usernames, and the like.
- In the interests of full disclosure and respect for privacy, it is important that you know that these are - entirely viewable to me, or whomever runs the instance of this website.
- It is highly recommended that you generate it with dummy values for those sensitive fields - (denoted with *sensitive), and replace those locally in a - plaintext editor or XML editor of your choice after downloading the generated configuration file.

-
-
- {% for message in get_flashed_messages() %} -

{{ message }}

- {% endfor %} -
- -{% from "_formhelper.html" import render_field %} -
- -

Version

-

This version should match the version of AIF-NG that you are running. It must match a valid git reference (tag, branch, commit, etc.) for - the - project.

-

{{ render_field(form.version) }}

- (back to top) - - -

Disk

-

- - -

Network

-

- - -

System

-

- - -

Pacman

-

- - -

Bootloader

-

- - -

Scripts

-

- - -
-{% if form.errors %} - -{% endif %} - - -{% endblock %} \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html deleted file mode 100644 index 779767f..0000000 --- a/app/templates/index.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "base.html" %}{% block title %}AIF-NG Configurator | Home{% endblock %}{% block body %}
-

AIF-NG Configurator

-

A tool to generate XML configuration files for AIF-NG.

-
-

What is it?

-

This tool will let you generate configuration files for AIF-NG. I, the author of this generator and of AIF-NG, - recognize that not everyone is comfortable with writing XML from scratch — even if they use something like an IDE - with XML support (I recommend PyCharm Community Edition; it will validate your config as you go as long as you include the XSD in the header!).

- -

So without further ado, head on over to the generator or for more information on using this tool, - try the usage page.

-{% endblock %} \ No newline at end of file diff --git a/app/templates/storage/disk.html b/app/templates/storage/disk.html deleted file mode 100644 index d838110..0000000 --- a/app/templates/storage/disk.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "base.html" %}{% block title %}AIF-NG Configurator | Disks{% endblock %}{% block body %} -
-

Disks

-

Generator > Storage > Disk

-
-

Disks

-

In this section, you must specify device path names of the target disk(s) to install to. It is highly - recommended to use actual device paths, but you can specify ONE entry as "auto" which will use the first - available unformatted disk. It is not recommended to combine "auto" and actual device path(s).

-

DISK FORM

-
- - - -
-{% endblock %} \ No newline at end of file diff --git a/app/templates/storage/filesystem.html b/app/templates/storage/filesystem.html deleted file mode 100644 index e69de29..0000000 diff --git a/app/templates/storage/index.html b/app/templates/storage/index.html deleted file mode 100644 index ab89888..0000000 --- a/app/templates/storage/index.html +++ /dev/null @@ -1,30 +0,0 @@ -{% extends "base.html" %}{% block title %}AIF-NG Configurator | Storage{% endblock %}{% block body %} -
-

Storage

-

Generator > Storage

-
-

Storage

-

In this section, you will configure disks/partitions and filesystems to use for your installation. Optionally, you - can also add support for LVM, LUKS, and/or mdadm.

- - -{% endblock %} \ No newline at end of file diff --git a/app/templates/storage/luks.html b/app/templates/storage/luks.html deleted file mode 100644 index e69de29..0000000 diff --git a/app/templates/storage/lvm.py b/app/templates/storage/lvm.py deleted file mode 100644 index e69de29..0000000 diff --git a/app/templates/storage/mdadm.html b/app/templates/storage/mdadm.html deleted file mode 100644 index e69de29..0000000 diff --git a/app/views.py b/app/views.py deleted file mode 100644 index 400c803..0000000 --- a/app/views.py +++ /dev/null @@ -1,33 +0,0 @@ -from flask import render_template, make_response, request, flash -from app import app -# from flask_wtf import Form -from wtforms import Form, BooleanField, PasswordField, StringField, TextAreaField, validators - - -class DiskForm(): - disk = TextAreaField(label = 'Disk(s):', - validators = [validators.required(), - validators.Regexp((r'^(/dev/([A-Za-z0-9_]+/)?' - r'[A-Za-z0-9_]+[0-9]?|' - r'auto)$'))], - default = '/dev/sda') - - -class GeneratorForm(Form): - version = StringField(label = 'Version:', - validators = [validators.required()], - default = '0.2.0') - - -@app.route('/', methods = ['GET']) -def index(): - return(render_template('index.html')) - - -@app.route('/generator', methods = ['GET', 'POST']) -def generator(): - form = GeneratorForm(request.form) - if request.method == 'POST' and form.validate(): - print(form) - flash('Generated!') - return(render_template('generator.html', form = form)) diff --git a/config.py b/config.py deleted file mode 100644 index bcf673f..0000000 --- a/config.py +++ /dev/null @@ -1,3 +0,0 @@ -# Flask debugging - DISABLE FOR PRODUCTION ENVIRONMENTS -DEBUG = True -#DEBUG = False diff --git a/run.py b/run.py deleted file mode 100755 index 2fbd814..0000000 --- a/run.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python3 - -from app import app - -if __name__ == '__main__': - # app.run() - app.run(host = 'localhost', port = 5001, debug = True) - diff --git a/uwsgi.ini b/uwsgi.ini deleted file mode 100644 index 6f60f1f..0000000 --- a/uwsgi.ini +++ /dev/null @@ -1,18 +0,0 @@ -[uwsgi] -plugin = python -py-autoreload = 1 -#uid = http -#gid = http -socket = /run/uwsgi/aifng_config.sock -chown-socket = http:http -processes = 4 -master = 1 -base = /usr/local/lib/aif-ng_configgen -chdir = %(base) -#mount = /=%(base)/run.py -wsgi-file = %(base)/run.py -chmod-socket = 660 -callable = app -cgi-helper =.py=python -logto = /var/log/uwsgi/%n.log -vacuum \ No newline at end of file