mirror of https://gitlab.com/bashrc2/epicyon
Show list of known epicyon instances
parent
d416ba02f7
commit
6f704b5331
|
@ -48,6 +48,7 @@ from webapp_welcome_final import html_welcome_final
|
|||
from webapp_welcome import html_welcome_screen
|
||||
from webapp_welcome import is_welcome_screen_complete
|
||||
from webapp_podcast import html_podcast_episode
|
||||
from webapp_utils import html_known_epicyon_instances
|
||||
from webapp_utils import get_default_path
|
||||
from webapp_utils import csv_following_list
|
||||
from webapp_utils import get_shares_collection
|
||||
|
@ -2262,6 +2263,42 @@ def daemon_http_get(self) -> None:
|
|||
self.server.debug)
|
||||
return
|
||||
|
||||
if self.path == '/knowninstances':
|
||||
if not authorized:
|
||||
http_403(self)
|
||||
return
|
||||
|
||||
if calling_domain.endswith('.onion'):
|
||||
msg = \
|
||||
html_known_epicyon_instances(
|
||||
self.server.base_dir, 'http',
|
||||
self.server.onion_domain,
|
||||
self.server.system_language,
|
||||
self.server.known_epicyon_instances)
|
||||
elif calling_domain.endswith('.i2p'):
|
||||
msg = \
|
||||
html_known_epicyon_instances(
|
||||
self.server.base_dir, 'http',
|
||||
self.server.i2p_domain,
|
||||
self.server.system_language,
|
||||
self.server.known_epicyon_instances)
|
||||
else:
|
||||
msg = \
|
||||
html_known_epicyon_instances(
|
||||
self.server.base_dir,
|
||||
self.server.http_prefix,
|
||||
self.server.domain_full,
|
||||
self.server.system_language,
|
||||
self.server.known_epicyon_instances)
|
||||
msg = msg.encode('utf-8')
|
||||
msglen = len(msg)
|
||||
login_headers(self, 'text/html', msglen, calling_domain)
|
||||
write2(self, msg)
|
||||
fitness_performance(getreq_start_time, self.server.fitness,
|
||||
'_GET', 'known epicyon instances',
|
||||
self.server.debug)
|
||||
return
|
||||
|
||||
if self.path in ('/manual', '/usermanual', '/userguide'):
|
||||
if calling_domain.endswith('.onion'):
|
||||
msg = \
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "فن",
|
||||
"Reply Controls": "عناصر التحكم في الرد",
|
||||
"Searchable by": "قابلة للبحث بواسطة",
|
||||
"Yourself": "نفسك"
|
||||
"Yourself": "نفسك",
|
||||
"Epicyon Instances": "حالات Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "শিল্প",
|
||||
"Reply Controls": "উত্তর নিয়ন্ত্রণ",
|
||||
"Searchable by": "দ্বারা অনুসন্ধানযোগ্য",
|
||||
"Yourself": "নিজেকে"
|
||||
"Yourself": "নিজেকে",
|
||||
"Epicyon Instances": "এপিসিয়ন দৃষ্টান্ত"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Art",
|
||||
"Reply Controls": "Controls de resposta",
|
||||
"Searchable by": "Cercable per",
|
||||
"Yourself": "Tu mateix"
|
||||
"Yourself": "Tu mateix",
|
||||
"Epicyon Instances": "Instàncies d'Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Celf",
|
||||
"Reply Controls": "Rheolaethau Ymateb",
|
||||
"Searchable by": "Chwiliadwy gan",
|
||||
"Yourself": "Eich Hun"
|
||||
"Yourself": "Eich Hun",
|
||||
"Epicyon Instances": "Enghreifftiau Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Kunst",
|
||||
"Reply Controls": "Antwortsteuerung",
|
||||
"Searchable by": "Durchsuchbar nach",
|
||||
"Yourself": "Selbst"
|
||||
"Yourself": "Selbst",
|
||||
"Epicyon Instances": "Epicyon-Instanzen"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Τέχνη",
|
||||
"Reply Controls": "Στοιχεία ελέγχου απάντησης",
|
||||
"Searchable by": "Δυνατότητα αναζήτησης από",
|
||||
"Yourself": "Σύ ο ίδιος"
|
||||
"Yourself": "Σύ ο ίδιος",
|
||||
"Epicyon Instances": "Περιπτώσεις Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Art",
|
||||
"Reply Controls": "Reply Controls",
|
||||
"Searchable by": "Searchable by",
|
||||
"Yourself": "Yourself"
|
||||
"Yourself": "Yourself",
|
||||
"Epicyon Instances": "Epicyon Instances"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Arte",
|
||||
"Reply Controls": "Controles de respuesta",
|
||||
"Searchable by": "Buscable por",
|
||||
"Yourself": "Tú mismo"
|
||||
"Yourself": "Tú mismo",
|
||||
"Epicyon Instances": "Instancias de Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "هنر",
|
||||
"Reply Controls": "کنترل های پاسخ",
|
||||
"Searchable by": "قابل جستجو توسط",
|
||||
"Yourself": "خودت"
|
||||
"Yourself": "خودت",
|
||||
"Epicyon Instances": "موارد Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Taide",
|
||||
"Reply Controls": "Vastausohjaimet",
|
||||
"Searchable by": "Haettavissa",
|
||||
"Yourself": "itseäsi"
|
||||
"Yourself": "itseäsi",
|
||||
"Epicyon Instances": "Epicyonin esiintymät"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Art",
|
||||
"Reply Controls": "Contrôles de réponse",
|
||||
"Searchable by": "Recherchable par",
|
||||
"Yourself": "Toi-même"
|
||||
"Yourself": "Toi-même",
|
||||
"Epicyon Instances": "Instances d'Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Ealaín",
|
||||
"Reply Controls": "Rialuithe Freagra",
|
||||
"Searchable by": "Inchuardaithe ag",
|
||||
"Yourself": "Tú féin"
|
||||
"Yourself": "Tú féin",
|
||||
"Epicyon Instances": "Cásanna Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "אָמָנוּת",
|
||||
"Reply Controls": "פקדי תגובה",
|
||||
"Searchable by": "ניתן לחיפוש לפי",
|
||||
"Yourself": "עַצמְךָ"
|
||||
"Yourself": "עַצמְךָ",
|
||||
"Epicyon Instances": "מופעי Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "कला",
|
||||
"Reply Controls": "उत्तर नियंत्रण",
|
||||
"Searchable by": "द्वारा खोजा जा सकता है",
|
||||
"Yourself": "अपने आप को"
|
||||
"Yourself": "अपने आप को",
|
||||
"Epicyon Instances": "एपिक्योन इंस्टेंसेस"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Arte",
|
||||
"Reply Controls": "Controlli di risposta",
|
||||
"Searchable by": "Ricercabile per",
|
||||
"Yourself": "Te stesso"
|
||||
"Yourself": "Te stesso",
|
||||
"Epicyon Instances": "Istanze di Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "美術",
|
||||
"Reply Controls": "返信コントロール",
|
||||
"Searchable by": "検索可能",
|
||||
"Yourself": "あなた自身"
|
||||
"Yourself": "あなた自身",
|
||||
"Epicyon Instances": "エピキオンインスタンス"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "미술",
|
||||
"Reply Controls": "답변 제어",
|
||||
"Searchable by": "검색 가능",
|
||||
"Yourself": "당신 자신"
|
||||
"Yourself": "당신 자신",
|
||||
"Epicyon Instances": "에피시온 인스턴스"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Fen",
|
||||
"Reply Controls": "Reply Controls",
|
||||
"Searchable by": "Lêgerîn ji hêla",
|
||||
"Yourself": "Xwe"
|
||||
"Yourself": "Xwe",
|
||||
"Epicyon Instances": "Mînakên Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Kunst",
|
||||
"Reply Controls": "Antwoordbedieningen",
|
||||
"Searchable by": "Doorzoekbaar op",
|
||||
"Yourself": "Jezelf"
|
||||
"Yourself": "Jezelf",
|
||||
"Epicyon Instances": "Epicyon-instanties"
|
||||
}
|
||||
|
|
|
@ -698,5 +698,6 @@
|
|||
"Art": "Art",
|
||||
"Reply Controls": "Reply Controls",
|
||||
"Searchable by": "Searchable by",
|
||||
"Yourself": "Yourself"
|
||||
"Yourself": "Yourself",
|
||||
"Epicyon Instances": "Epicyon Instances"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Sztuka",
|
||||
"Reply Controls": "Kontrola odpowiedzi",
|
||||
"Searchable by": "Można wyszukiwać według",
|
||||
"Yourself": "Się"
|
||||
"Yourself": "Się",
|
||||
"Epicyon Instances": "Instancje Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Arte",
|
||||
"Reply Controls": "Controles de resposta",
|
||||
"Searchable by": "Pesquisável por",
|
||||
"Yourself": "Tu próprio"
|
||||
"Yourself": "Tu próprio",
|
||||
"Epicyon Instances": "Instâncias Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Искусство",
|
||||
"Reply Controls": "Ответить Элементы управления",
|
||||
"Searchable by": "Поиск по",
|
||||
"Yourself": "Сам"
|
||||
"Yourself": "Сам",
|
||||
"Epicyon Instances": "Эпиционные экземпляры"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Sanaa",
|
||||
"Reply Controls": "Vidhibiti vya Kujibu",
|
||||
"Searchable by": "Inaweza kutafutwa na",
|
||||
"Yourself": "Mwenyewe"
|
||||
"Yourself": "Mwenyewe",
|
||||
"Epicyon Instances": "Matukio ya Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "Sanat",
|
||||
"Reply Controls": "Cevap Kontrolleri",
|
||||
"Searchable by": "Aranabilir",
|
||||
"Yourself": "Kendin"
|
||||
"Yourself": "Kendin",
|
||||
"Epicyon Instances": "Epikyon Örnekleri"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "ст",
|
||||
"Reply Controls": "Елементи керування відповідями",
|
||||
"Searchable by": "Можливість пошуку за",
|
||||
"Yourself": "себе"
|
||||
"Yourself": "себе",
|
||||
"Epicyon Instances": "Примірники Epicyon"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "קונסט",
|
||||
"Reply Controls": "ענטפער קאָנטראָלס",
|
||||
"Searchable by": "זוך דורך",
|
||||
"Yourself": "זיך"
|
||||
"Yourself": "זיך",
|
||||
"Epicyon Instances": "Epicyon ינסטאַנסיז"
|
||||
}
|
||||
|
|
|
@ -702,5 +702,6 @@
|
|||
"Art": "艺术",
|
||||
"Reply Controls": "回复控制",
|
||||
"Searchable by": "可搜索",
|
||||
"Yourself": "你自己"
|
||||
"Yourself": "你自己",
|
||||
"Epicyon Instances": "史诗副本"
|
||||
}
|
||||
|
|
|
@ -351,6 +351,9 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
|
|||
html_str += \
|
||||
'<p class="login-text"><a href="/about">' + \
|
||||
translate['About this Instance'] + '</a></p>'
|
||||
html_str += \
|
||||
'<p class="login-text"><a href="/knowninstances">' + \
|
||||
translate['Epicyon Instances'] + '</a></p>'
|
||||
html_str += \
|
||||
'<p class="login-text"><a href="/manual">' + \
|
||||
translate['User Manual'] + '</a></p>'
|
||||
|
|
|
@ -2430,3 +2430,29 @@ def load_buy_sites(base_dir: str) -> {}:
|
|||
if buy_sites_json:
|
||||
return buy_sites_json
|
||||
return {}
|
||||
|
||||
|
||||
def html_known_epicyon_instances(base_dir: str, http_prefix: str,
|
||||
domain_full: str,
|
||||
system_language: str,
|
||||
known_epicyon_instances: []) -> str:
|
||||
"""Show a list of known epicyon instances
|
||||
"""
|
||||
html_str = ''
|
||||
css_filename = base_dir + '/epicyon-profile.css'
|
||||
if os.path.isfile(base_dir + '/epicyon.css'):
|
||||
css_filename = base_dir + '/epicyon.css'
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
html_str = \
|
||||
html_header_with_website_markup(css_filename, instance_title,
|
||||
http_prefix, domain_full,
|
||||
system_language)
|
||||
if known_epicyon_instances:
|
||||
instances_text = ''
|
||||
for instance in known_epicyon_instances:
|
||||
instances_text += instance + '<br>\n'
|
||||
html_str += \
|
||||
'<div class="container">' + instances_text + '</div>\n'
|
||||
html_str += html_footer()
|
||||
return html_str
|
||||
|
|
Loading…
Reference in New Issue