Browse Source

Add yaml config

mistress
Daniel Muckerman 4 years ago
parent
commit
dcc20d75ef
2 changed files with 39 additions and 15 deletions
  1. +11
    -15
      app.py
  2. +28
    -0
      config.yaml

+ 11
- 15
app.py View File

@ -1,29 +1,25 @@
from flask import Flask, g, request, session, redirect, url_for, render_template
from flask_bootstrap import Bootstrap
import os
import yaml
app = Flask(__name__)
Bootstrap(app)
app.secret_key = 'asdf'
app.debug = True
with open('config.yaml') as f:
yaml_data = yaml.load(f)
search = yaml_data['search']
account_url = yaml_data['accounts']['account_url']
apps = []
for itm in yaml_data['apps'].items():
apps.append(itm[1])
@app.route('/')
def index():
search = {'active': True, 'search_url': 'https://searx.info/?q='}
account_url = 'https://account.technicalincompetence.club'
apps = [
{'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'},
{'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'},
{'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'},
{'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'},
{'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'},
{'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'},
{'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'},
{'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'},
{'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'},
]
return render_template('index.j2', apps = apps, search = search, account_url = account_url)

+ 28
- 0
config.yaml View File

@ -0,0 +1,28 @@
search:
active: True
search_url: 'https://searx.info/?q='
accounts:
account_url: 'https://account.technicalincompetence.club'
apps:
chat:
name: "Rocket Chat"
description: "It's rocket chat"
link: "https://rocketchat.tia.moe"
cloud:
name: "Nextcloud"
description: "It's a cloud"
link: "https://cloud.tia.moe"
gitea:
name: "Gitea"
description: "It's git"
link: "https://git.tia.moe"
jellyfin:
name: "Jellyfin"
description: "It's a jellyfin"
link: "https://jellyfin.tia.moe"
rss:
name: "FreshRSS"
description: "It's rss"
link: "https://rss.tia.moe"

Loading…
Cancel
Save