Files
nuntius/__pycache__/install.cpython-314.pyc
T

77 lines
13 KiB
Plaintext
Raw Normal View History

+
`Ufj!"ãó`^RIHt^RIt^RIt^RIt^RIt^RIt^RIt^RIH t Rt
Rt Rt Rt
RtR tR
t!R R ]P"4tR
RltRRltRRltRRltRRltRRltRRltRRltRRltRR ltR!R"ltR#R$ltR%R&ltR*R'R(llt ]!R)8Xd
] !4R#R#)+é)Ú annotationsN)ÚNoReturnÚnuntiusz/usr/local/bin/nuntiusz /etc/nuntiusz/etc/nuntius/config.tomlz/etc/nuntius/.envz/var/lib/nuntiusz#/etc/systemd/system/nuntius.servicecóØ]tRt^(t$Rt]P R]PR]PR/t R]
R&]P R]PR]PR /t R]
R
&R t R R
lt
RtR#)Ú_ColourFormatterzMPrefix each log line with a coloured level marker, mimicking the bash script.zzzzdict[int, str]Ú_COLOURSz==>zWARN:zERROR:Ú_LABELSzcó V^8„dQhRRRR/#)éÚrecordzlogging.LogRecordÚreturnÚstr©)Úformats
install.pyÚ __annotate__Ú_ColourFormatter.__annotate__7s÷#°3ñc ó VPPVPR4pVPPVPR4pV'd,V'd$V V VP RVP 4 2#VP 4#)ÚÚ )rÚgetÚlevelnor Ú_RESETÚ
getMessage)Úselfr ÚcolourÚlabels&& rrÚ_ColourFormatter.format7sqØ×" 6§>¡>°2Ó6ˆØ × Ñ  §¡°Óß —eØX˜e˜W T§[¡[ °6×3DÑ3DÓ3FÐ2GÐ × Ñ Ó"rrN)Ú__name__Ú
__module__Ú __qualname__Ú__firstlineno__Ú__doc__ÚloggingÚINFOÚWARNINGÚERRORrÚ__annotations__r rrÚ__static_attributes__rrrrr(slÙ  ˜Ø
 €Hˆnóð  ˜Ø
€Gˆð
€F÷#rrcóV^8„dQhRR/#©r r
ÚNoner)rs"rrr?s÷ñ˜ñrcó \P!4pVP\P4\P!4pVP \
44VPP4VPV4R#)z7Configure the root logger with coloured console output.N)
r%Ú getLoggerÚsetLevelr&Ú
StreamHandlerÚ setFormatterrÚhandlersÚclearÚ
addHandler)ÚloggerÚhandlers rÚ_setup_loggingr8?s^ä
×
Ò
Ó
€FØ
‡OO”G—L‘LÔ×%€GØ ×ÑÔ
‡OO×ÑÔØ
×Ñrcó$V^8„dQhRRRRRR/#)r Úcmdz list[str]ÚkwargsÚobjectr
z subprocess.CompletedProcess[str]r)rs"rrrOs'÷@ñ@ˆ@ @Ð.Nñ@rc ó8\P!V3RRRR/VB#)zKRun a command via subprocess and check for failure (unless told otherwise).ÚcheckTÚtext)Ú
subprocessÚrun)r:r;s&,rÚ_runrBOs ä >Š>˜ ?  Ð ?¸Ñ ?rcóV^8„dQhRR/#r,r)rs"rrrYs÷ñrcó–\P!4^8wd/\P!R4\P
!^4R#R#)zExit if not running as root.z$Run as root: sudo python3 install.pyN)ÚosÚgeteuidr%ÚerrorÚsysÚexitrrrÚ require_rootrJYs-ä ‡zzƒ|Ü
Š
Ð ŠŽ ñrcóV^8„dQhRR/#r,r)rs"rrr`s÷ ñ  rcóN\PPR4'g-\P!R4\
P !^4\PPR4'g/\P!R4\
P !^4R#R#)z?Verify that the binary and the systemd unit are present in CWD.ú ./nuntiusuK./nuntius binary not found — copy it here first (e.g. rsync bin/nuntius).ú./nuntius.serviceuR./nuntius.service not found — paste the unit from docs/deployment.md (Option A).N)rEÚpathÚisfiler%rGrHrIrrrÚ
require_filesrQ`sfä
7‰7>‰>˜+× 
Š
Ø 
ô ŠŒ Ü
7‰7>‰>Ð-× 
Š
Ø 
ô ŠŽ ñ /rcóV^8„dQhRR/#r,r)rs"rrrns÷
ñ

rc óB\R\.\P\PR7\P
!R\4R # \P d;\P
!R\4\RRRRR \R
\.4R #i;i) z4Create the system user if it does not already exist.Úid©ÚstdoutÚstderrzUser %s already exists.uCreating system user %s…Úuseraddz--systemz--shellz/usr/sbin/nologinz
--home-dirz --user-groupN)rBÚ NUNTIUS_USERr@ÚDEVNULLr%ÚinfoÚCalledProcessErrorÚDATA_DIRrrrÚ create_userr^ns|ð
Ü ˆd”LÐ
!¬*×*<Ñ*<ÄZ×EWÑEWÕ Š Ð Ö=øÜ ×

Ü Š Ð1´<Ô àØØØÜØÜð
÷
ð

úsA AÁA BÂBcóV^8„dQhRR/#r,r)rs"rrrƒs÷ñ˜ñrcóô\P!R\4\P!\RR7\
P !\\\R7\P!\R4R#)zHEnsure the data directory exists with correct ownership and permissions.uSetting up %s…T©Úexist_ok)ÚuserÚgroupièN) r%r[r]rEÚmakedirsÚshutilÚchownrYÚchmodrrrÚcreate_data_dirriƒs=ä ‡L‚LÐ#¤XÔ‡K‚K” 4Õ
‡L‚L”¤ ´LÕ‡H‚HŒXrcóV^8„dQhRR/#r,r)rs"rrrs÷ñ˜ñrcó¨\P!R\4\P!R\4\
P !\R4R#)z9Copy the nuntius binary to /usr/local/bin with mode 0755.uInstalling binary to %s…rMN)r%r[ÚBIN_DESTrfÚcopy2rErhrrrÚinstall_binaryrns-ä ‡L‚LÐ-¬xÔ
‡LLœhÔ‡HHŒXrcóV^8„dQhRR/#r,r)rs"rrrs÷"˜ñ"rcó¨\P!R\4\P!R\4\
P !\R4R#)z*Copy the systemd unit file with mode 0644.uInstalling systemd unit %s…rNN)r%r[Ú SERVICE_DESTrfrmrErhrrrÚinstall_servicerrs.ä ‡L‚LÐ0´,Ô
‡L‚LÐ$¤lÔ‡HHŒ\˜!rcóV^8„dQhRR/#r,r)rs"rrrs÷FñF˜ñFrcóf\PP\4'd\P
!R\4R#\P
!R\4\P !\RR7\RRRR \.\P\PR
7\PP\4'g\P!R \4\R R
\ R\ 2\.4R# \PdL}i;i)zMAuto-generate the TOML config by running nuntius briefly if config is absent.z/Config %s already exists; leaving it untouched.NuGenerating %s…TraÚtimeoutz-kÚ5sÚ4srUz5nuntius did not create %s; check the uploaded binary.rgz-RÚ:)rErOrPÚ CONFIG_FILEr%r[reÚ
CONFIG_DIRrBrlr@rZr\ÚwarningrYr]rrrÚgenerate_configr|ä ‡ww‡~~”k× Š Ð Ôä ‡L‚LÐ#¤[Ô‡K‚K”
 

Ü ˆi˜˜t T¬8Ð