From 5f45caebe4fc6a0c4654654b01cbf8f852c27d95 Mon Sep 17 00:00:00 2001 From: Cyrille LOUARN Date: Sat, 23 Sep 2023 02:39:19 +0200 Subject: [PATCH] Better domain control and validation --- CHANGELOG.md | 5 +- README.md | 2 + src/usr/bin/tyto | 7 +- .../program/__pycache__/args.cpython-311.pyc | Bin 0 -> 2421 bytes .../program/__pycache__/check.cpython-311.pyc | Bin 0 -> 672 bytes .../program/__pycache__/debug.cpython-311.pyc | Bin 0 -> 2831 bytes .../__pycache__/domain.cpython-311.pyc | Bin 0 -> 18494 bytes .../program/__pycache__/forms.cpython-311.pyc | Bin 0 -> 8631 bytes .../program/__pycache__/help.cpython-311.pyc | Bin 0 -> 435 bytes .../program/__pycache__/langs.cpython-311.pyc | Bin 0 -> 2836 bytes .../program/__pycache__/new.cpython-311.pyc | Bin 0 -> 731 bytes .../program/__pycache__/show.cpython-311.pyc | Bin 0 -> 1173 bytes .../program/__pycache__/tools.cpython-311.pyc | Bin 0 -> 3559 bytes .../program/__pycache__/tyto.cpython-311.pyc | Bin 0 -> 1833 bytes .../__pycache__/userset.cpython-311.pyc | Bin 0 -> 719 bytes src/var/lib/tyto/program/args.py | 9 +- src/var/lib/tyto/program/check.py | 4 +- src/var/lib/tyto/program/debug.py | 11 +- src/var/lib/tyto/program/domain.py | 112 +++++++++++------- src/var/lib/tyto/program/forms.py | 6 +- src/var/lib/tyto/program/langs.py | 2 +- src/var/lib/tyto/program/tools.py | 7 +- .../__pycache__/logs_fr.cpython-311.pyc | Bin 0 -> 2397 bytes .../__pycache__/website_fr.cpython-311.pyc | Bin 0 -> 225 bytes src/var/lib/tyto/translations/logs_en.py | 2 +- src/var/lib/tyto/translations/logs_fr.py | 4 +- 26 files changed, 100 insertions(+), 71 deletions(-) create mode 100644 src/var/lib/tyto/program/__pycache__/args.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/__pycache__/debug.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/__pycache__/domain.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/__pycache__/forms.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/__pycache__/help.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/__pycache__/langs.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/__pycache__/new.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/__pycache__/show.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/__pycache__/tools.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/__pycache__/tyto.cpython-311.pyc create mode 100644 src/var/lib/tyto/program/__pycache__/userset.cpython-311.pyc create mode 100644 src/var/lib/tyto/translations/__pycache__/logs_fr.cpython-311.pyc create mode 100644 src/var/lib/tyto/translations/__pycache__/website_fr.cpython-311.pyc diff --git a/CHANGELOG.md b/CHANGELOG.md index 78a3154..0be154d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,10 @@ Tyto - Littérateur - License: - Documentation: -## [1.9.0] +## [1.9.1] +- Auto update configuration domain +- Better managing configuration domain values +- Better checking if valid domain diff --git a/README.md b/README.md index 83892c0..3350f57 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,5 @@ tyto - - needs more checks to be validated - english logs translation file (French only, for now) +# Next +- Create all directories for valid domain diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index ad4f067..0a57530 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,5 +1,6 @@ #!/usr/bin/env python3 -# Version: 1.9.0 +# Version: 1.9.1 +# Updated: 2023-09-23 1695429475 # Tyto - Littérateur # Copyright (C) 2023 Cyrille Louarn @@ -40,9 +41,9 @@ # file program : #-------------------------- -#======# -# MAIN # #======#======================================================================= +# MAIN # +#======# import sys if not __name__ == "__main__": print("! Error: '%s' not '%s'"%(__name__, "__main__")) diff --git a/src/var/lib/tyto/program/__pycache__/args.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/args.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3e4f597a029a8c2a3ba547a92b5c749dd86562a GIT binary patch literal 2421 zcmcIl%}*Og6rY*>u#LSW!GyXL8blziBe460)Dnagsi5Xi4y8qkTSPbBt-&>3G`m2E z5^0fKi363WWRxC))Dum`|IxFNtO~8r@l99FQ!ga<&fE(-@JMAu`}=e z-rHX_t&2eU_HWJnBSy%d*l88k6i!PZJSGM)Xo=*4mgcDFvm6txl#@g&=VZ|;IYqQ; zP8Dq=7ZGhV7d2Rg84V`C8EBCU_mSbhtxK-f#Y8Iy2nYAsit6(}y!3v&$`8T1S4gRgMJFCy#?SBUnOr1)z~$66kum`Z?vKH z?7hFAKe+zn-Je#gtH;_%T^sR?q_@RyPqF?Ss%>S5?OcV|5TY;BIC}u zGk&DCjiA~E8lkHMjn+W87}HKj0z!(Ryg~VJJHd)*Tu}@PWNUSxH6%keq(h+DQAjn& z1d1;5fN+jFCw%iD`gIV+i?jSPtn}n%v$U30IG&Cp$-GD~0lX)y?n%~qNAx5%^wNsa zN(dvc><(0W5&#lH?9%>6)u~$S8oUiTR=KmI@AV%n{PNY)+fUbz<%zmHQIjW5w4^(W zkFSufA(+}}vM}<#5RvDEkppH5_paWlf%9N&#r(9!k8IWdlYLnx z00664q|W+|S*p%bHI{nDwC(ZAxI5lpiS4n zsmVsNzdGGWzEQp9$JJ=eCjjoSf0;;{JN&~!<>rqI`wPcxpw0$rtyi!z-5q2s{OyS- z;ln5mA>jSQjrllA!T?B#z%rPP0`uT~{`D7n5uIAKjP;T^&EJDjq_q7zfG<%>{aH$A u-0i~WgiO|6=j$gV+6U>c1wEl8bUhIY$uWd}nfCf5gx)K3&?lWBEcXvj^vgH^ literal 0 HcmV?d00001 diff --git a/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..def599927b7441c5ca3844e2b3d1abe2c2351a83 GIT binary patch literal 672 zcmZuu&ubGw6n^t|vyG9e#Rimslp>K>$lg4ZBG?v1!FceNOPKC#?{740>CdL za^O6e-lpIf1PB&F^W3v0n`vyKz}L{U1bYrO>yIgEczLB!m&h!#={KTdP>kFhokcvP z%xRtm28w3M(J|FC{I|>Wo4V1&ZO1(FYfIV@NyLL#mkxOth?bYc`??VFxSi^iFyW$g?dS3tbt+N?XF)*H+tCHPjCGRFK5lQCw0cHIuBZo!xQ|xpc!|&s9B@xLujFC6CE@gOgjFk*4Bdm~oQ+!)}SN&A| zc=x3Kq5k#8_j}{@?QDH}j5`_bjPf<5Zgg*LrM*;|r;|lP=CscsS4@1B=&ZOECE_6T o@5@z^=3l0dh$a?eZ1Ru+yF4hF?+2`oE?N`EX1iV!Z literal 0 HcmV?d00001 diff --git a/src/var/lib/tyto/program/__pycache__/debug.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/debug.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d77ef524c0ea4418f4d81c72f1a9108223372d69 GIT binary patch literal 2831 zcmah}OK%fb6uvX#@x1&<90PeePJp&%(U4GDsZbVBK^G-O@um$zmg74F2is%KOqvqS zNN&X<3o1owr6K{#(g&L^`xE+ZDzUIeiiFgacekQ!qDt*KGoHa9rn%SmyXSo8yXRbw z$LFhbS|u<}{*%_n(uDkpPB{3!@%RWBUl2+t*C5Nm&MkAk&oA?oze$z_%9Tk;=;4vY zTC#r?ia z(P#sChGI0S0nKoX2Hv1xK&@PiCNrQJiP2;SH2E0K(17MZj0WF5f53eX#%OW_nnN*~ zkpazUj3z&z8H>>z7|@KzXbwKr#3&AhikSH5KJl@A;^X_oC-#X)Pc-I!li_(faaa11 zbF=oTkRim$+~Me?lLVY{q&u9Gbx3q!0zO6xjtmyp_of{MEI#n=W$!~*c@T9L=p~|A za0nf}?*B(ko^md+-+EecZ923a^88u9hd>`G6&Fox2%E`?%g0Y0ZwC89b5okQJb&uM zYoYOaXv~L3q&X2XC!0OIT@Um1uz&TiY4z}SJ!~F5><&Hr`}Y({Eo1L@GpSJ9oyrIn?msn!s%kE=q0M=s^w{`x?M5acHL-M zo=6)8aH4LSM#~c$)fRXOpOb*AzzI)A%qn?I)%cxwfLsacMDDVR{ zGYI$zFm;fMR&CwWHmYU|k5Z%QWdN%6R;6a@5Tl-A>K0rQL#YjY#j4wS#XqkGLJJOh zO2eqqpg#e!8p1dJFE@&sxEIg_YLZcnj+F6INRKhL;M3{B|!yv zGPZ7dV%w~@Y)`-{3H_tGT^jO)){5x~A69*6cnRy8vEhj|qhXlf*hbsq&y``l3+pVb zbFh|RU4ZogtV$aB?1&^*Ow79kRfOv9@XhZmTio0qS_rv{ty1&oF?BnbW%ts;+h@d?=%Mn5DD%w^K z<`T}pd4Ich>&n)Z+h=hGRC%ksJ&W@hmnov6{Y8?3@;3tWAy1MjBZ83YO6pb(fBbGL z-Kp&+q?_+-l|R0C^J2%JOahHBd<-uqDJ9I)u$i+61q6I=zai!&v=;&PPlG}OFhmBw0I4JpI^b7q5Sl?D$ literal 0 HcmV?d00001 diff --git a/src/var/lib/tyto/program/__pycache__/domain.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/domain.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4c0a0516f2f6a7a3ae3edd3e3d0a93f1eb301dfd GIT binary patch literal 18494 zcmeHPS!^50neHw&FR>|7_eIG%Em7x4mMmX$$g-~SH8awT)^aukt)^wl)G^((Wh+#` zF&tQ9*f0^q7$q1X%!6l{&1T_!2;i4IOtAa1yARz)10ysbAlQW;yx0KFdIK1Peb~Rc zn|)A}Mrv%3mu<1DtE=k!>-g)hN^ZM@*L3}|l z1VhG%8RbdNkn%g4LGsf!W0RlM3?)D9Gj{pum~qHY=ZuppMKodb?>bCjvY$)Sp3K<{cho}E52c(Bvxk%y?v1q$xyF{#zk>YekHr)7R zip+U1M3ojjQ)w!r9-*Zma6R=}R2w2RZ=}+kgZXWyhAEy2n5fihP=hB@83}v^JpC2i z$~995?O>ljlzorXF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z@hc9pAsm`QFJpq;AB3$d6T|R)eQCPKMpSFr^}T0H&z)rCA6p3Xtadxsv_H#h?T@xs(%AUFkL(V literal 0 HcmV?d00001 diff --git a/src/var/lib/tyto/program/__pycache__/help.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/help.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10adcae716f2f1dcf0a6aac2dc6817a3d4eee52a GIT binary patch literal 435 zcmZWlu}T9$5S`iF#So1a+NqG(orPBmVqsyK#_k%q+|LakX(G+Qwqt2K6LG4v zo%m@awUuy+jb4~!_g$WXFZFq?Ib*FkYfVcl=$iHx^k<;$AnXjIrS=2F t9<_w|)kW=Uz=L5DUW)@N%|h~$LS8|{{1yR^rf|4z`99)V4%=b*^dHykTqOVi literal 0 HcmV?d00001 diff --git a/src/var/lib/tyto/program/__pycache__/langs.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/langs.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d8384982c378a3a3d0d23794b4550c17b180f5b4 GIT binary patch literal 2836 zcmds3-)q}O96w1X+ln2>uHAHPx-@O#wr-cWU4E>E64+=%10zrp=;FbQnsZVY#||f@ zZ9>M()`!p)n!!o~C6K|Ad1Qm^W%ObHz}~E(u^?2 z?#K7Oce>B#bJ91>%}oT-4?;M5BSOd@SaFkBE9`v$h3AA3Cge%lc?xO4u8V2WeoAS{ ze$q6xpK@AeV%o=~M7s3L0Auw@404uG? zs-RQ1kC1y_)YZDygMQuJ0BBkl2-$$_B&|aax@CytbIXh_2=$|w%zO*tI`nUNJ_2F> zQNm<=^^v4#(R^`Av-}UTceI?IwS>&P)H5@;D?`k&U0lIX(r;0nPlA)qGn2V|))I@F zMQ2p~uI0-<%xSu2$t-(kcFK~9vwD(RzUd;H1wWcs3sbxWf>?g1Nz?FEJ0QJkZ`|-1 zUYz3UbP9)PumbBy9RwL?8Xkwiy^yuLU`nLwBh4M9b6ZNw(mNI91l-F*%R@US+Lyal zeR!2AUX@UH>D;ywd~)n*`{VW%zoB%PN=KE5QgoXtkA@f3rTDW4t8`T@#|+wS((VfF z-U>z*`+rxO7vp;{7nwlgCfppG0)IjQDWDSF0}}x8fLn+D4R;h_;&HFMTIcUI5+*eQ zT|Yvl1*MY!d{m|5q#!+%#>oSro(N3Vk({-}eCsgBhBuEU;>db>>LJ&ckou96;ylm= z-l;Ac(8WJ8A4+IQmrMc?;`o{ziDik|0!LtxD?wn1?KI1CmM>qNP=N`NsjSYjlj>|< zueJENHj~fkJc>aOSFV8hmhhukj)Ad4FeszVX&IYFZ$i^e$XXtZjeYb~>EcfGm>E59 zL@$`p3+2mZwEMSc-!IX=%~2zI)r?+!dD@I#TkKlw+TRk7F2%6~<^BB~rEPg=?Rq(3 zD3?s-Qk4i&WGmQGy1o->TNzvHTYle&oQLR2bLpan+wj@j1LQ|~O`3qRmvF_nzkA<- zc}|oD@dHwD93W!#++c!^?5U+je&DV*;;%|N&QVMEypc?7z%J~15MU6az#@p$AbD9O zh^cesWSPHGQ&Eak+syw35er%z*C2Bq?_s^ zdWx-^1r!S?wQ;5>(=H5()2J7Q1o6@n+b1$*ED49BQUmx+^9~6XA>pT?o#Pf;)UF>$^&m>+w(4>PEI@l;! z-U+djAxnbOo#RK5i~mX* z9?Mlp5QOSYfe6Pcr1jtLEpnprx*PsE0*Ml>wg!c8m3ZbtGgduwHXy{S#4}wXAyy@x N>GC=bT(D$w_HT-MM?3%k literal 0 HcmV?d00001 diff --git a/src/var/lib/tyto/program/__pycache__/new.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/new.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f5fcc36b9a31857180035ad8dc27bf52a9c25e2 GIT binary patch literal 731 zcmZWm%WB&|6utA1u;e=FE0`89jJt9O)i#tS%g~iKg)Y1as%BzTY$=SUX#**!;9n^D zfi$J`XAQ3NYR=p!xq9#|GqkHE*j^@m_PR9qd-FaL7asmF>pfjHV3?YZ#t@~g03PxLAJ}6qiI{6@fGvEHa zGvCR}XNhGHS*XpP*>WxugmciOP5``X{PnY`dz$}OWxGpLTWj4-&3bpGOsNhT4IO36 zj4z_2L-{ezbY?h;ks0SGRgtU`m2TfbwXs%t7MvRF^<*y)a=7s}7v9rrueb1e1yI)h z$}jxVx#9kTZ(Z~5f_JZY_b2!BgTldzGFy%va7w*@casWWRfXzQDq-@Z5dKIVOViAKY~$$b;m zdIA7{gy0jdGABvSd;$s-=`eNvMN`O=@f4~U_tCLtb`d&Z+IK#i=L$yo`+BC4)W`yyeAnzl1Wjw!Zk z&S^Ho)UZU@cszb~JGG>mDLpfjvR7;)wP+f1rkYJz^Tu-5;tEr;YEGTgOi_z_{8()q z9QYlq-|BS<4u+goHwYx^v^o>($@iV>osPFoxEiDd_!Q!d2zru4B2Sy6PYX5v-`qmH z9&2#1A`7+JeHPySBZ~L9xBZ&OA$WcF6}MUAl`J4rE&wH~Q7(fmUQ{J270?c%aslt4 zUFot11Rq*2=_&=-;~w{GFFEf)8z8VFzDIxs#ph{&1~28n=johih!Ps!<4=$0g`zyH>X!C$ zI1yyZ`3$hSylziZeRf(mRLTNXiOCsT%UVocG&4Dy$yA%k&oN@;Z5Htj@@6JM7)mqp zR$F26lB(x5e|Ah!KvVYN0cWfO4h|gQUy!ahAcwd(kz zw+0&qlkg+i@$3dk$P62nSuZk+2@uooCHf6a(P1z1v*44gLG!xSXWrp=qAk`02bUm( h++hSL?1aQRgqx+SwtG!R*IlSVEQ|(_3s<8T_b*K%{3!qc literal 0 HcmV?d00001 diff --git a/src/var/lib/tyto/program/__pycache__/tools.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/tools.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54ddb3e45ffa6cd1adbf0d8fb1f89b3e43573e22 GIT binary patch literal 3559 zcmcInTWcFf6rSDLi+0y?<5Z0uIkDB)kuAH4Vms-bfRi?Dp*V%Om-xlV+KnwomekpG zlN1G9V~8*g)%LpsvAG+N-MIF9msnxEoXji)f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h>RbLN8c6=NZJB sjw=Y`!hz?rzRM4V{u6p3f_;R@B!omq1W4r#%CmR0P$Y{H%t9>v3sG{V!2kdN literal 0 HcmV?d00001 diff --git a/src/var/lib/tyto/program/args.py b/src/var/lib/tyto/program/args.py index e165e27..35801aa 100644 --- a/src/var/lib/tyto/program/args.py +++ b/src/var/lib/tyto/program/args.py @@ -45,7 +45,6 @@ def get_action(): except: action = "" - #==================# # Target arguments # #------------------# @@ -63,9 +62,9 @@ def get_options(): dlogs = force = erron = False for arg in range(1, len(sys.argv)): - if sys.argv[arg] in tyto.debug_options: dlogs = True - if sys.argv[arg] in tyto.force_options: force = True - if sys.argv[arg] in tyto.debug_errors: erron = True + dlogs = sys.argv[arg] in tyto.debug_options + force = sys.argv[arg] in tyto.force_options + erron = sys.argv[arg] in tyto.debug_errors #===========# @@ -74,7 +73,7 @@ def get_options(): def valid_action(): global action if not action in tyto.actions: - debug.out(1, "[action]", action, dlogs,2, False) + debug.out(1, "[action]", action, False, 2, False) action = "help" diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index e2c99ea..8ea0d42 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -33,11 +33,11 @@ #-------------------------- import sys -import domain +import domain, langs def manage(action, target): # Load domain configuration, update if needed, check if valid domain.valid_conf() - + langs.load_website_lang() print("check:", action, target, domain.dcf.get("DOMAIN", "name")) diff --git a/src/var/lib/tyto/program/debug.py b/src/var/lib/tyto/program/debug.py index 0236cd5..bef6a6a 100644 --- a/src/var/lib/tyto/program/debug.py +++ b/src/var/lib/tyto/program/debug.py @@ -37,8 +37,8 @@ import langs, args #===================================# -# Show logs if "show" is True # -# -D argument for specific ones # +# Show all logs if "show" is True # +# or with -D argument # # color is for "*" in message # # - 3 colors levels: # # - - 0 = Green # @@ -48,8 +48,11 @@ import langs, args #-----------------------------------# def out(nbr, var, val, show, color, stop): args.get_options() - if not show and not args.dlogs: return # Show Very less logs - if args.erron and color == 0: return # Show only warn and error logs + if not show: + show = args.dlogs or args.erron and color > 0 # Show only warn and error logs + + if not show: + return # COlors CS = '\033[0;0m' # Unset diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index 690a817..a762b6f 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -100,43 +100,12 @@ def dcf_exists(): return True else: try: shown_no - except: debug.out(100, "False", dcf_uri, True, 1, False) + except: debug.out(104, "False", dcf_uri, True, 1, False) shown_no = True + compatible_name() return False -#=============================================# -# Ensure domain is valid and ready to be used # -#---------------------------------------------# -def valid_conf(): - dcf_load() - try: - dcf_name = dcf.get("DOMAIN", "name") - except: - debug.out(100, conf_name, dcf_uri, True, 1, True) - - # Check some values in ult_dcf - ult_dcf_load() - try: - ult_dcf_name = ult_dcf.get("DOMAIN", "name") - ult_dcf_hash = ult_dcf.get("DOMAIN", "hash") - ult_dcf_conf = ult_dcf.get("DOMAIN", "conf") - ult_dcf_root = ult_dcf.get("DOMAIN", "root") - except: - debug.out(100, conf_name, ult_dcf_uri, True, 1, True) - - # Compare values (exit if mismatch) - if ult_dcf_name != conf_name or \ - ult_dcf_conf != dcf_uri or \ - dcf_name != ult_dcf_name: - debug.out(100, conf_name, "?", True, 1, True) - - # Check if dcf need to be updated - now_dcf_hash = tools.get_filesum(dcf_uri, True) - if now_dcf_hash != ult_dcf_hash: - dcf_update_values("") - - #=========================================# # Guess and return wip_url from conf_name # #-----------------------------------------# @@ -204,28 +173,26 @@ def dcf_update_values(srv): dcf_load() # Test server directory, and exit if not exists - if not srv: srv = dcf.get("SERVER", "root") # Set from db if unknown - if srv: tools.dir_exists(srv, True) + srv = srv or dcf.get("SERVER", "root") # Set from db if unknown # Test registred website lang # change to default lang sys, or "en" if no translation file + # Load website lang file langs.load_website_lang() srv_dom = os.path.join(srv, conf_name + "/") srv_wip = os.path.join(srv_dom, "wip/") srv_www = os.path.join(srv_dom, "www/") - favicon = dcf.get("TEMPLATE_FILENAMES", "favicon") - logo = dcf.get("TEMPLATE_FILENAMES", "logo") - styles = dcf.get("TEMPLATE_FILENAMES", "styles") - rss = dcf.get("TEMPLATE_FILENAMES", "rss") - stats = dcf.get("TEMPLATE_FILENAMES", "stats") + favicon = dcf.get("TEMPLATE_FILENAMES", "favicon") or "favicon.png" + logo = dcf.get("TEMPLATE_FILENAMES", "logo") or "logo.png" + styles = dcf.get("TEMPLATE_FILENAMES", "styles") or "styles.css" + rss = dcf.get("TEMPLATE_FILENAMES", "rss") or "rss.xml" + stats = dcf.get("TEMPLATE_FILENAMES", "stats") or "stats.ini" www_url = dcf.get("WEBSITE", "www_url") wip_url = dcf.get("WEBSITE", "wip_url") - sdb_title = dcf.get("WEBSITE_MODULES", "sidebar_title") - usr_mods = os.path.join(dcf_dir + "modules/") usr_tpl = os.path.join(dcf_dir, "template/") usr_favicon = os.path.join(usr_tpl, favicon) @@ -262,11 +229,13 @@ def dcf_update_values(srv): dcf.set("USER_DIRS", "modules", usr_mods) dcf.set("USER_DIRS", "database", dcf_dir + ".db/") dcf.set("USER_DIRS", "template", usr_tpl) + dcf.set("USER_MODULES_FILES", "metas", usr_mods + "tyto_metas.raw") dcf.set("USER_MODULES_FILES", "header", usr_mods + "tyto_header.raw") dcf.set("USER_MODULES_FILES", "navbar", usr_mods + "tyto_navbar.raw") dcf.set("USER_MODULES_FILES", "sidebar", usr_mods + "tyto_sidebar.raw") dcf.set("USER_MODULES_FILES", "footer", usr_mods + "tyto_footer.raw") + dcf.set("USER_TEMPLATE_FILES", "favicon", usr_favicon) dcf.set("USER_TEMPLATE_FILES", "logo", usr_logo) dcf.set("USER_TEMPLATE_FILES", "styles", usr_styles) @@ -275,8 +244,18 @@ def dcf_update_values(srv): dcf.set("WEBSITE", "lang", langs.site_lang) www_url or dcf.set("WEBSITE", "www_url", "https://%s/"%conf_name) wip_url or dcf.set("WEBSITE", "wip_url", create_wip_url()) + dcf.get("WEBSITE_MODULES", "sidebar_title") or \ + dcf.set("WEBSITE_MODULES", "sidebar_title", langs.site.sidebar_title) + dcf.get("WEBSITE_MODULES", "sidebar_items").isdigit() or \ + dcf.set("WEBSITE_MODULES", "sidebar_items", "0") + dcf.get("WEBSITE_MODULES", "rss_items").isdigit() or \ + dcf.set("WEBSITE_MODULES", "rss_items", "0") - sdb_title or dcf.set("WEBSITE_MODULES", "sidebar_title", langs.site.sidebar_title) + dcf.set("TEMPLATE_FILENAMES", "favicon", favicon) + dcf.set("TEMPLATE_FILENAMES", "logo", logo) + dcf.set("TEMPLATE_FILENAMES", "styles", styles) + dcf.set("TEMPLATE_FILENAMES", "rss", rss) + dcf.set("TEMPLATE_FILENAMES", "stats", stats) # SERVER dcf.set("SERVER", "root", srv) @@ -341,6 +320,53 @@ def dcf_update_values(srv): debug.out(204, "True", dcf_uri, True, 0, False) +#=============================================# +# Ensure domain is valid and ready to be used # +#---------------------------------------------# +def valid_conf(): + dcf_load() + + # Most importants + # - dcf name must be config_name + # - root server must exists + try: + dcf_name = dcf.get("DOMAIN", "name") + if dcf_name != conf_name: + debug.out(100, conf_name, dcf_uri, True, 2, True) + except: + debug.out(100, conf_name, dcf_uri, True, 2, True) + + + + # Server root + try: dcf_srv = dcf.get("SERVER", "root") + except: debug.out(100, "SERVER root", "?", True, 2, True) + + if not dcf_srv or not tools.dir_exists(dcf_srv, True): + debug.out(100, "SERVER root", "? %s"%dcf_srv, True, 2, True) + + # Check some values in ult_dcf + ult_dcf_load() + try: + ult_dcf_name = ult_dcf.get("DOMAIN", "name") + ult_dcf_hash = ult_dcf.get("DOMAIN", "hash") + ult_dcf_conf = ult_dcf.get("DOMAIN", "conf") + ult_dcf_root = ult_dcf.get("DOMAIN", "root") + except: + debug.out(100, conf_name, ult_dcf_uri, True, 1, True) + + # Compare values (exit if mismatch) + if ult_dcf_name != conf_name or \ + ult_dcf_conf != dcf_uri or \ + dcf_name != ult_dcf_name: + debug.out(100, conf_name, "?", True, 1, True) + + # Check if dcf need to be updated + now_dcf_hash = tools.get_filesum(dcf_uri, True) + if now_dcf_hash != ult_dcf_hash: + dcf_update_values("") + + #======#======================================================================= # MAIN # #------# diff --git a/src/var/lib/tyto/program/forms.py b/src/var/lib/tyto/program/forms.py index 4862460..bd9ebc8 100644 --- a/src/var/lib/tyto/program/forms.py +++ b/src/var/lib/tyto/program/forms.py @@ -225,10 +225,8 @@ def ask_domain_server(): domain.dcf_load() srv = domain.dcf.get("SERVER", "root") - if srv: - if not tools.dir_exists(srv, False): - tested = True - srv = "" + if srv and not not tools.dir_exists(srv, False): + srv = "" q = "> %s (%s)%s "%(langs.logs.domain_srv, srv, langs.logs.q) answer = ask(q, False, srv) diff --git a/src/var/lib/tyto/program/langs.py b/src/var/lib/tyto/program/langs.py index 932fa18..03465c4 100644 --- a/src/var/lib/tyto/program/langs.py +++ b/src/var/lib/tyto/program/langs.py @@ -114,7 +114,7 @@ def get_website_lang(): site_lang = domain.dcf.get("WEBSITE", "lang") if not translation_exists("website", site_lang, False): - site_lang = get_sys_lang() + site_lang = get_sys_lang() # or default "en" tr_website_uri = tr_website_uri%(trfs, site_lang) diff --git a/src/var/lib/tyto/program/tools.py b/src/var/lib/tyto/program/tools.py index f522d1b..6e8e8a6 100644 --- a/src/var/lib/tyto/program/tools.py +++ b/src/var/lib/tyto/program/tools.py @@ -56,11 +56,8 @@ def get_filesum(path, src): # Mainly used to check domain server dir # #----------------------------------------# def dir_exists(dir_path, out): - exists = bool(os.path.exists(dir_path)) - - if not exists: - if out: debug.out(6, "False", dir_path, True, 2, True) - else: debug.out(6, "False", dir_path, True, 2, False) + if not bool(os.path.exists(dir_path)): + debug.out(6, "False", dir_path, out, 2, out) return False return True diff --git a/src/var/lib/tyto/translations/__pycache__/logs_fr.cpython-311.pyc b/src/var/lib/tyto/translations/__pycache__/logs_fr.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b8e22f499439ff86f97425a5148c96beb5c1b706 GIT binary patch literal 2397 zcmZuzJ8v6D5I*WHN~B0pPd`^O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)(iZ5s?e;Y2 zdHnRs>+M3XOedAMpiq90QpH|*qm5;aWNXmD0>}m}kJ{r`#ntjyyFeeci75U9!F)9! literal 0 HcmV?d00001 diff --git a/src/var/lib/tyto/translations/__pycache__/website_fr.cpython-311.pyc b/src/var/lib/tyto/translations/__pycache__/website_fr.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..268a28c8af428bb910f0ad7a81d6cfe81c6e6e3c GIT binary patch literal 225 zcmZ3^%ge<81P9%DQUh5T7#@Q-Fu(|9eC7i(rZc24L@}f=Mlq%^1v6+emx=-f9g9jb zlXFsw6^c@m^K)|(^HL74EUw}S$VtpoNGVk)&MZmw(`35ETb!Aanv_@+Uy@mplX{CC zB%YgCu#(|3$cA4U`elhl`Z<|N`X!Ym`T8YAiFw62i6xo&dBytWsYxK!@o7bR1(m-z uY;yBcN^?@}ir9e~LGCLS0}>yY85tQrI59E^YBccP;F4%y2f-qse;5EYB|WqN literal 0 HcmV?d00001 diff --git a/src/var/lib/tyto/translations/logs_en.py b/src/var/lib/tyto/translations/logs_en.py index dea3c31..c8a0cdb 100644 --- a/src/var/lib/tyto/translations/logs_en.py +++ b/src/var/lib/tyto/translations/logs_en.py @@ -60,5 +60,5 @@ tyto [action] [target] [options] [options] ; multi-set --force, -F : force doing things... --debug, -D : show more logs - --errors, -E : Show only warn and error logs + --errors, -E : Show mainly warnings and errors logs """ diff --git a/src/var/lib/tyto/translations/logs_fr.py b/src/var/lib/tyto/translations/logs_fr.py index ff98310..7ecb177 100644 --- a/src/var/lib/tyto/translations/logs_fr.py +++ b/src/var/lib/tyto/translations/logs_fr.py @@ -73,7 +73,7 @@ domain_new = "Domaine créé" created_dir = "Dossier créé" created_file = "Fichier créé" updated_file = "Fichier mis à jour" -later = "Peut-être plus targ..." +later = "Peut-être plus tard..." @@ -104,5 +104,5 @@ tyto [action] [target] [options] [options] ; multiples --force, -F : forcer à faire quelque chose... --debug, -D : montrer plus de logs - --errors, -E : montrer uniquement les avertissement et erreurs + --errors, -E : montrer surtout les avertissements et erreurs """