2019-11-18 01:06:28 -05:00
|
|
|
import os
|
|
|
|
import pprint
|
|
|
|
import re
|
|
|
|
##
|
|
|
|
from flask import render_template, make_response, request, Response
|
|
|
|
from flask_autoindex import AutoIndex
|
|
|
|
##
|
|
|
|
from app import db
|
|
|
|
from app import app
|
|
|
|
|
|
|
|
ua_re = re.compile(r'^iPXE/v[0-9.]+')
|
|
|
|
|
2019-11-19 07:14:45 -05:00
|
|
|
# TODO: NBI support? https://github.com/bruienne/bsdpy
|
|
|
|
# http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2010q1/003638.html
|
2019-11-18 01:06:28 -05:00
|
|
|
|
|
|
|
def getReqInfo():
|
|
|
|
d = {}
|
|
|
|
for a in dir(request):
|
|
|
|
if a.startswith('_'):
|
|
|
|
continue
|
|
|
|
d[a] = getattr(request, a)
|
|
|
|
return(d)
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/', methods = ['GET'])
|
|
|
|
def index():
|
|
|
|
DB = db.LocalDB()
|
|
|
|
result = render_template('main.ipxe.j2',
|
|
|
|
db = DB)
|
|
|
|
DB.close()
|
|
|
|
return(result)
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/foo', methods = ['GET'])
|
|
|
|
def foo():
|
|
|
|
pprint.pprint(getReqInfo())
|
|
|
|
return(Response())
|