From 02cad1789e0b46f78156688578cb662f8d30ad8f Mon Sep 17 00:00:00 2001 From: Cyrille LOUARN Date: Wed, 27 Sep 2023 16:52:41 +0200 Subject: [PATCH] Check, create, update a domain should be ready --- CHANGELOG.md | 5 + README.md | 1 - src/usr/bin/tyto | 4 +- .../__pycache__/domain.cpython-311.pyc | Bin 27268 -> 34888 bytes .../program/__pycache__/langs.cpython-311.pyc | Bin 2882 -> 2857 bytes src/var/lib/tyto/program/domain.py | 287 ++++++++++++++---- src/var/lib/tyto/program/langs.py | 4 +- 7 files changed, 231 insertions(+), 70 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c618bdf..a51a171 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ Tyto - Littérateur - License: - Documentation: +# CURRENTLY IN DEV ! + +## [1.9.8] +- Check/create/update a domain is ready + ## [1.9.7] - new process to check and update configuration file (bug at write some values) diff --git a/README.md b/README.md index 0a56932..3ce4399 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ tyto ``` ## ToDo next (working on) -- Manage domain configuration file values - check action - create template post database diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index 4a53280..2b0113c 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Version: 1.9.7 -# Updated: 2023-09-27 1695799605 +# Version: 1.9.8 +# Updated: 2023-09-27 1695826135 # Tyto - Littérateur # Copyright (C) 2023 Cyrille Louarn diff --git a/src/var/lib/tyto/program/__pycache__/domain.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/domain.cpython-311.pyc index 5c8f9bdcf6505069160d1e7356454a7b44a47365..cf79271eb992e9e037ca08241b2d1d8a3e178cb7 100644 GIT binary patch literal 34888 zcmeHwS!^6fmS9#@M%`o;Z&DNw@l^4qL{g^@(h_x9lx>KG zf@URaf@Y8dSa=gAV!LIp~zXU4t(9n;xX)Z#0PHZ}*^E{`L%d80Q^o(95_W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9loFZ)TVVJI`He?>uwze8e<3IEbDfokh)KwOMm%(&$-! z0**)MSu`_d%ZP9n`0L}9oxB|bcn7*SHmKLl@DqNB-XEJi^8{&aCE_9xZA6fVY5o`y zmxwq{#APDL+ZgX7;z=R^5yUT^yqxmm=$DsHRz8i35jHSB!y8HCG^ug{><~{jgNR`w z04AQEfP4VCFOQ)Ez7q>p{%1t8Gb7Mxq!iVJ%YP$v3))nWzNd&8y>qh?ywG%UDe;^G)9(ng-I#2LiZ&yKsRQNV7>C zyZdq-zN48iKlp$7z7Wq^l3>>Vvv^WSCsfquH`;PQTK=)V|uZ zHhzB~#JR(qJIJ}w?Ov@0q;BTD}vLT*b|`r?Z(k~NdKGj4kpmOYD}ZN{`x zy;QwAv2IZbPQ!vkF%SG z)7cN39TRryBfE2=k^Sh9V={;OILA5J#D09(F_laGGuJuQ%zj$r@HbPRHan*a*sXq( zqpjbIf4yAWq5l1bt^R{_8~Gi!JKBbiuv^1NxV916ur zwnmTAz diff --git a/src/var/lib/tyto/program/__pycache__/langs.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/langs.cpython-311.pyc index fa4836420e9625954cbaecb7b20575ed550fd8c5..cb08c4b4d22f137a83292136beee7296de288557 100644 GIT binary patch delta 313 zcmX>kwo;6DIWI340}!~Vh@{4Ep3K35?LY{@|Y`_BN@sWOL$?r7#LDmN;oESu$%LFzZgP zX4f#{xW!je6knd2RGe9o8edwJd5bM2KQ}Qm?-o;X+AZev)RJ4AV5ywMy!0Yjpdpj* zvFkW!0U5bKT$~Cd8W=vXF^H%(=-m~QnUXm@cT(;G&lP1C#mugVnRRG(X#Tjtq%t*U zV&0TI5D&=z@nf)S!5^A=Qzu#H9414j!|=R52rSx{^T8; VE7?GH73oh-=aOYKn%v5@7XW;gQS$%* delta 307 zcmZ1}c1VnOIWI340}wo%DU=$%kvE==iHmXaAtoIbMurlmiJ!G5FJcp7D&U>W$1W|% zR>BWb3IQoBB|MWqv6<_$mB566bcq0hQ^JE_r!iHrF)$=D0QE$$n=*1v?qio!WKT|u z&&f|rxy6*6c8fVZwWLTEsN)uAab`(sd`@Cs`sDrWI!@X^v0NZ7P6rYV3?JASL{uB} z?lN(-=v`zIy22!Mfl25tpGZ$;e{NUq49^8+7y0zA@abLPbJ(i0QE!W0gXUyy4kOkg zQK0t8SsX7FKnC7o0agl*0}2*_yjP?(xtLR%(O~j?&XsH+r9}pl{kUWq KjVI@D?F9g-GD^Sz diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index 033d44e..847f099 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -180,9 +180,7 @@ def cf_create(): # Ensure to set correct values # #-------------------------------------------# def cf_update_values(write): - global cf # Load Domain Configuration file - cf = "" cf_load() if cf.get("DOMAIN", "name") != name: @@ -201,7 +199,6 @@ def cf_update_values(write): global srv_name srv_name = os.path.join(srv, name + "/") - print("domain: srv_name", srv_name) if cf.get("SERVER", "domain") != srv_name: cf.set("SERVER", "domain", srv_name) debug.out(204, "[SERVER] domain", srv_name, False, 0, False) @@ -313,19 +310,30 @@ def cf_update_values(write): cf.set("DOMAIN", "license_url", "https://www.gnu.org/licenses/fdl-1.3.txt") write = True + # Optional + global legals_url, terms_url, statuses_url + legals_url = cf.get("DOMAIN", "legals_url") + terms_url = cf.get("DOMAIN", "terms_url") + statuses_url = cf.get("DOMAIN", "statuses_url") + # [WEBSITE] # ========= - global www_url, wip_url + global www_url www_url = cf.get("WEBSITE", "www_url") if not www_url: - cf.set("WEBSITE", "www_url", "https://%s/"%name) + www_url = "https://%s/"%name + cf.set("WEBSITE", "www_url", www_url) + debug.out(204, "[WEBSITE] www_url", www_url, False, 0, False) write = True + global wip_url wip_url = cf.get("WEBSITE", "wip_url") if not wip_url: - cf.set("WEBSITE", "wip_url", create_wip_url()) + wip_url = create_wip_url() + cf.set("WEBSITE", "wip_url", wip_url) + debug.out(204, "[WEBSITE] wip_url", wip_url, False, 0, False) write = True - + global lang lang = cf.get("WEBSITE", "lang") if not lang: @@ -336,11 +344,12 @@ def cf_update_values(write): write = True langs.load_website_lang() - + global css css = cf.get("WEBSITE", "css") if not css: - cf.set("WEBSITE", "css", "tyto") + cf.set("WEBSITE", "css", "tyto") + write = True global sep sep = cf.get("WEBSITE", "separator") @@ -355,6 +364,7 @@ def cf_update_values(write): except: cf.set("WEBSITE", "static", "no") ; write = True # [WEBSITE_MODULES] + # ================= global navbar try: cf.getboolean("WEBSITE_MODULES", "navbar") except: cf.set("WEBSITE_MODULES", "navbar", "yes") ; write = True @@ -391,14 +401,7 @@ def cf_update_values(write): if cf.get("USER_TEMPLATE_FILES", "favicon") != usr_favicon: cf.set("USER_TEMPLATE_FILES", "favicon", usr_favicon) write = True - wip_favicon = os.path.join(srv_wip_tpl, favicon) - if cf.get("WIP_FILES", "favicon") != wip_favicon: - cf.set("WIP_FILES", "favicon", wip_favicon) - write = True - www_favicon = os.path.join(srv_www_tpl, favicon) - if cf.get("WWW_FILES", "favicon") != www_favicon: - cf.set("WWW_FILES", "favicon", www_favicon) - write = True + logo = cf.get("TEMPLATE_FILENAMES", "logo") if not logo: @@ -409,14 +412,6 @@ def cf_update_values(write): if cf.get("USER_TEMPLATE_FILES", "logo") != usr_logo: cf.set("USER_TEMPLATE_FILES", "logo", usr_logo) write = True - wip_logo = os.path.join(srv_wip_tpl, logo) - if cf.get("WIP_FILES", "logo") != wip_logo: - cf.set("WIP_FILES", "logo", wip_logo) - write = True - www_logo = os.path.join(srv_www_tpl, logo) - if cf.get("WWW_FILES", "logo") != www_logo: - cf.set("WWW_FILES", "logo", www_logo) - write = True styles = cf.get("TEMPLATE_FILENAMES", "styles") if not styles: @@ -427,42 +422,18 @@ def cf_update_values(write): if cf.get("USER_TEMPLATE_FILES", "styles") != usr_styles: cf.set("USER_TEMPLATE_FILES", "styles", usr_styles) write = True - wip_styles = os.path.join(srv_wip_tpl, styles) - if cf.get("WIP_FILES", "styles") != wip_styles: - cf.set("WIP_FILES", "styles", wip_styles) - write = True - www_styles = os.path.join(srv_www_tpl, styles) - if cf.get("WWW_FILES", "styles") != www_styles: - cf.set("WWW_FILES", "styles", www_styles) - write = True rss = cf.get("TEMPLATE_FILENAMES", "rss") if not rss: rss = "rss.xml" cf.set("TEMPLATE_FILENAMES", "rss", rss) write = True - wip_rss = os.path.join(srv_wip_tpl, rss) - if cf.get("WIP_FILES", "rss") != wip_rss: - cf.set("WIP_FILES", "rss", wip_rss) - write = True - www_rss = os.path.join(srv_www_tpl, rss) - if cf.get("WWW_FILES", "rss") != www_rss: - cf.set("WWW_FILES", "rss", www_rss) - write = True stats = cf.get("TEMPLATE_FILENAMES", "stats") if not stats: stats = "tyto_stats.ini" cf.set("TEMPLATE_FILENAMES", "stats", stats) write = True - wip_stats = os.path.join(srv_wip_tpl, stats) - if cf.get("WIP_FILES", "stats") != wip_stats: - cf.set("WIP_FILES", "stats", wip_stats) - write = True - www_stats = os.path.join(srv_www_tpl, stats) - if cf.get("WWW_FILES", "stats") != www_stats: - cf.set("WWW_FILES", "stats", www_stats) - write = True # [USER_DIRS] # =========== @@ -488,6 +459,167 @@ def cf_update_values(write): cf.set("USER_DIRS", "database", cf_usr_db) write = True + # USER_MODULES_FILES + # ================== + global usr_metas + usr_metas = os.path.join(cf_usr_mods, "tyto_metas.raw") + if cf.get("USER_MODULES_FILES", "metas") != usr_metas: + cf.set("USER_MODULES_FILES", "metas", usr_metas) + debug.out(204, "[USER_MODULES_FILES] metas", usr_metas, False, 0, False) + write = True + + global usr_header + usr_header = os.path.join(cf_usr_mods, "tyto_header.raw") + if cf.get("USER_MODULES_FILES", "header") != usr_header: + cf.set("USER_MODULES_FILES", "header", usr_header) + debug.out(204, "[USER_MODULES_FILES] header", usr_header, False, 0, False) + write = True + + global usr_navbar + usr_navbar = os.path.join(cf_usr_mods, "tyto_navbar.raw") + if cf.get("USER_MODULES_FILES", "navbar") != usr_navbar: + cf.set("USER_MODULES_FILES", "navbar", usr_navbar) + debug.out(204, "[USER_MODULES_FILES] navbar", usr_navbar, False, 0, False) + write = True + + global usr_sidebar + usr_sidebar = os.path.join(cf_usr_mods, "tyto_sidebar.raw") + if cf.get("USER_MODULES_FILES", "sidebar") != usr_sidebar: + cf.set("USER_MODULES_FILES", "sidebar", usr_sidebar) + debug.out(204, "[USER_MODULES_FILES] sidebar", usr_sidebar, False, 0, False) + write = True + + global usr_footer + usr_footer = os.path.join(cf_usr_mods, "tyto_footer.raw") + if cf.get("USER_MODULES_FILES", "footer") != usr_footer: + cf.set("USER_MODULES_FILES", "footer", usr_footer) + debug.out(204, "[USER_MODULES_FILES] footer", usr_footer, False, 0, False) + write = True + + # [WIP_FILES] + # =========== + wip_favicon = os.path.join(srv_wip_tpl, favicon) + if cf.get("WIP_FILES", "favicon") != wip_favicon: + cf.set("WIP_FILES", "favicon", wip_favicon) + write = True + + wip_logo = os.path.join(srv_wip_tpl, logo) + if cf.get("WIP_FILES", "logo") != wip_logo: + cf.set("WIP_FILES", "logo", wip_logo) + write = True + + wip_styles = os.path.join(srv_wip_tpl, styles) + if cf.get("WIP_FILES", "styles") != wip_styles: + cf.set("WIP_FILES", "styles", wip_styles) + write = True + + wip_rss = os.path.join(srv_wip_tpl, rss) + if cf.get("WIP_FILES", "rss") != wip_rss: + cf.set("WIP_FILES", "rss", wip_rss) + write = True + + wip_stats = os.path.join(srv_wip_tpl, stats) + if cf.get("WIP_FILES", "stats") != wip_stats: + cf.set("WIP_FILES", "stats", wip_stats) + write = True + + global wip_metas + wip_metas = os.path.join(srv_wip_tpl, "metas.html") + if cf.get("WIP_FILES", "metas") != wip_metas: + cf.set("WIP_FILES", "metas", wip_metas) + debug.out(204, "[WIP_FILES] metas", wip_metas, False, 0, False) + write = True + + global wip_header + wip_header = os.path.join(srv_wip_tpl, "header.html") + if cf.get("WIP_FILES", "header") != wip_header: + cf.set("WIP_FILES", "header", wip_header) + debug.out(204, "[WIP_FILES] header", wip_header, False, 0, False) + write = True + + global wip_navbar + wip_navbar = os.path.join(srv_wip_tpl, "navbar.html") + if cf.get("WIP_FILES", "navbar") != wip_navbar: + cf.set("WIP_FILES", "navbar", wip_navbar) + debug.out(204, "[WIP_FILES] navbar", wip_navbar, False, 0, False) + write = True + + global wip_sidebar + wip_sidebar = os.path.join(srv_wip_tpl, "sidebar.html") + if cf.get("WIP_FILES", "sidebar") != wip_sidebar: + cf.set("WIP_FILES", "sidebar", wip_sidebar) + debug.out(204, "[WIP_FILES] sidebar", wip_sidebar, False, 0, False) + write = True + + global wip_footer + wip_footer = os.path.join(srv_wip_tpl, "footer.html") + if cf.get("WIP_FILES", "footer") != wip_footer: + cf.set("WIP_FILES", "footer", wip_footer) + debug.out(204, "[WIP_FILES] footer", wip_footer, False, 0, False) + write = True + + # [WWW_FILES] + # =========== + www_favicon = os.path.join(srv_www_tpl, favicon) + if cf.get("WWW_FILES", "favicon") != www_favicon: + cf.set("WWW_FILES", "favicon", www_favicon) + write = True + + www_logo = os.path.join(srv_www_tpl, logo) + if cf.get("WWW_FILES", "logo") != www_logo: + cf.set("WWW_FILES", "logo", www_logo) + write = True + + www_styles = os.path.join(srv_www_tpl, styles) + if cf.get("WWW_FILES", "styles") != www_styles: + cf.set("WWW_FILES", "styles", www_styles) + write = True + + www_rss = os.path.join(srv_www_tpl, rss) + if cf.get("WWW_FILES", "rss") != www_rss: + cf.set("WWW_FILES", "rss", www_rss) + write = True + + www_stats = os.path.join(srv_www_tpl, stats) + if cf.get("WWW_FILES", "stats") != www_stats: + cf.set("WWW_FILES", "stats", www_stats) + write = True + + global www_metas + www_metas = os.path.join(srv_www_tpl, "metas.html") + if cf.get("WWW_FILES", "metas") != www_metas: + cf.set("WWW_FILES", "metas", www_metas) + debug.out(204, "[WWW_FILES] metas", www_metas, False, 0, False) + write = True + + global www_header + www_header = os.path.join(srv_www_tpl, "header.html") + if cf.get("WWW_FILES", "header") != www_header: + cf.set("WWW_FILES", "header", www_header) + debug.out(204, "[WWW_FILES] header", www_header, False, 0, False) + write = True + + global www_navbar + www_navbar = os.path.join(srv_www_tpl, "navbar.html") + if cf.get("WWW_FILES", "navbar") != www_navbar: + cf.set("WWW_FILES", "navbar", www_navbar) + debug.out(204, "[WWW_FILES] navbar", www_navbar, False, 0, False) + write = True + + global www_sidebar + www_sidebar = os.path.join(srv_www_tpl, "sidebar.html") + if cf.get("WWW_FILES", "sidebar") != www_sidebar: + cf.set("WWW_FILES", "sidebar", www_sidebar) + debug.out(204, "[WWW_FILES] sidebar", www_sidebar, False, 0, False) + write = True + + global www_footer + www_footer = os.path.join(srv_www_tpl, "footer.html") + if cf.get("WWW_FILES", "footer") != www_footer: + cf.set("WWW_FILES", "footer", www_footer) + debug.out(204, "[WWW_FILES] footer", www_footer, False, 0, False) + write = True + # [TYTO] # ====== if cf.get("TYTO", "domain_hash") != cf_id: @@ -500,35 +632,60 @@ def cf_update_values(write): cf.set("TYTO", "domain_user", ult_cf_uri) write = True - # Write Configuration file # Only if needed or when new domain - print("domain: write", write) if write: with open(cf_uri, "w") as f: cf.write(f) + debug.out(204, "True", cf_uri, True, 0, False) - # Update User local domain configuration file - #-------------------------------------------- + + #=============================================# + # Update User local domain configuration file # + #---------------------------------------------# + ult_write = False ult_cf_load() - ult_cf.set("DOMAIN", "name", name) - ult_cf.set("DOMAIN", "hash", tools.get_filesum(cf_uri, True)) - ult_cf.set("DOMAIN", "root", cf_dir) - ult_cf.set("DOMAIN", "conf", cf_uri) - ult_cf.set("SERVER", "root", srv) + if ult_cf.get("DOMAIN", "name") != name: + ult_cf.set("DOMAIN", "name", name) + ult_write = True + + cf_hash_c = tools.get_filesum(cf_uri, True) + if ult_cf.get("DOMAIN", "hash") != cf_hash_c: + ult_cf.set("DOMAIN", "hash", cf_hash_c) + ult_write = True + + if ult_cf.get("DOMAIN", "root") != cf_dir: + ult_cf.set("DOMAIN", "root", cf_dir) + ult_write = True + + if ult_cf.get("DOMAIN", "conf") != cf_uri: + ult_cf.set("DOMAIN", "conf", cf_uri) + ult_write = True + + if ult_cf.get("SERVER", "root") != srv: + ult_cf.set("SERVER", "root", srv) + ult_write = True - with open(ult_cf_uri, "w") as f: - ult_cf.write(f) + if ult_write: + with open(ult_cf_uri, "w") as f: + ult_cf.write(f) # Update User local Domains List File #------------------------------------ ult_dlf_load() - ult_dlf.set("DOMAINS", name, cf_dir) + dlf_write = False + try: + dlf_line = ult_dlf.get("DOMAINS", name) + if dlf_line != cf_dir: + dlf_write = True + except: + dlf_write = True - with open(ult_dlf_uri, "w") as f: - ult_dlf.write(f) - - debug.out(204, "True", cf_uri, True, 0, False) + if dlf_write: + ult_dlf.set("DOMAINS", name, cf_dir) + with open(ult_dlf_uri, "w") as f: + ult_dlf.write(f) + #=============================================# diff --git a/src/var/lib/tyto/program/langs.py b/src/var/lib/tyto/program/langs.py index 77054bc..0dc4aba 100644 --- a/src/var/lib/tyto/program/langs.py +++ b/src/var/lib/tyto/program/langs.py @@ -110,8 +110,8 @@ def get_website_lang(): global site_lang, tr_website_uri tr_website_uri = "%swebsite_%s.py" - domain.cf_load() - site_lang = domain.cf.get("WEBSITE", "lang") or get_sys_lang() + try: site_lang = domain.cf.get("WEBSITE", "lang") + except: site_lang = get_sys_lang() if not translation_exists("website", site_lang, False): site_lang = get_sys_lang() # or default "en"