From 3438503097d5f4b547eb4d2e8cc5906055e49ba6 Mon Sep 17 00:00:00 2001 From: gashapwn Date: Fri, 27 Nov 2020 01:01:11 +0000 Subject: [PATCH] site_name is now part of conf --- app.py | 6 ++++-- lyadmin.conf.json | 2 +- templates/index.html | 2 +- templates/main_layout.html | 2 +- templates/rules.html | 6 +++--- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app.py b/app.py index fa4e216..b076cb5 100644 --- a/app.py +++ b/app.py @@ -14,8 +14,6 @@ from flask import Flask, redirect, url_for, render_template, request # gasahwpn on irc.lainchan.org - - app=Flask(__name__) # Paths for conf file, @@ -140,6 +138,10 @@ def signup(): return render_template("signup.html", is_email_user = is_email_user) +@app.context_processor +def get_site_name(): + return {"site_name": conf_obj["site_name"]} + if __name__=="__main__": app.add_url_rule('/rules', 'rules', rules) app.add_url_rule('/req', 'req', req, methods = ['POST', 'GET']) diff --git a/lyadmin.conf.json b/lyadmin.conf.json index 16565fd..168bf53 100644 --- a/lyadmin.conf.json +++ b/lyadmin.conf.json @@ -1,5 +1,5 @@ { - "instance_name": "lingy.in", + "site_name": "lingy.in", "listen_ip": "104.248.118.130", "shell": { "SHELL_BASH": "/usr/local/bin/bash", diff --git a/templates/index.html b/templates/index.html index 54b93e1..9cd4f97 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,7 +2,7 @@ {%block content %}
-

lingy.in is a public unix / tilde instance for lainons

+

{{site_name}} is a public unix / tilde instance for lainons

current thread: https://lainchan.org/tech/res/34563.html

sign up

rules

diff --git a/templates/main_layout.html b/templates/main_layout.html index 5c071e6..f836431 100644 --- a/templates/main_layout.html +++ b/templates/main_layout.html @@ -7,7 +7,7 @@ {% endif %} -

lingy.in

+

{{ site_name }}

{%block content%} diff --git a/templates/rules.html b/templates/rules.html index a9f305d..fc57879 100644 --- a/templates/rules.html +++ b/templates/rules.html @@ -4,11 +4,11 @@

Rules

    -
  1. you must 18 or older to use lingy.in
  2. +
  3. you must 18 or older to use {{ site_name }}
  4. since this is multiuser system, show good judgement with the server resources (ie dont start mining crypto)
  5. don't damage/delete others work
  6. -
  7. don't upload child pornography to lingy.in
  8. -
  9. don't use lingy.in to distribute malware
  10. +
  11. don't upload child pornography to {{ site_name }}
  12. +
  13. don't use {{ site_name }} to distribute malware
  14. be smart with your data (fwiw, when i use a shared system like this i assume all data i have on the box is effecitvely comprimised)