Start config work

This commit is contained in:
Nyx 2025-03-10 01:25:36 -05:00
parent 4a6ef8a047
commit a071556e1f
3 changed files with 13 additions and 3 deletions

1
.gitignore vendored
View file

@ -162,3 +162,4 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder. # option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/ #.idea/
config.ini

View file

@ -1,21 +1,28 @@
from flask import * from flask import *
from os import path, walk from os import path, walk
import configparser
config = configparser.ConfigParser()
config.read('config.ini')
instanceBranding = str(config['BRANDING']['instanceName'])
app = Flask(__name__) app = Flask(__name__)
@app.route('/') @app.route('/')
def home(): def home():
return render_template('index.j2', instanceName="nyxask.nixos.internal", instanceBranding="NyxAsk Testing Instance") return render_template('index.j2', instanceName="nyxask.nixos.internal", instanceBranding=instanceBranding)
@app.route('/auth/login/') @app.route('/auth/login/')
def login(): def login():
return render_template('login.j2', instanceName="nyxask.nixos.internal", instanceBranding="NyxAsk Testing Instance") return render_template('login.j2', instanceName="nyxask.nixos.internal", instanceBranding=instanceBranding)
@app.route('/auth/register/') @app.route('/auth/register/')
def register(): def register():
return render_template('register.j2', instanceName="nyxask.nixos.internal", instanceBranding="NyxAsk Testing Instance") return render_template('register.j2', instanceName="nyxask.nixos.internal", instanceBranding=instanceBranding)
@app.route('/assets/css/index.css') @app.route('/assets/css/index.css')
def index_css(): def index_css():

2
config.sample.ini Normal file
View file

@ -0,0 +1,2 @@
[BRANDING]
instanceName = NyxAsk Sample Config