From dac96ba101206bbd2f873fd2f577c9cb5de332ee Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Tue, 12 Jul 2022 00:31:12 -0700 Subject: [PATCH] Add missing /root --- .gitignore | 1 - root/defaults/app.db | Bin 0 -> 81920 bytes root/defaults/policy.xml | 80 ++++++++++++++++++++++++++++ root/etc/cont-init.d/30-config | 49 +++++++++++++++++ root/etc/services.d/calibre-web/run | 6 +++ 5 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 root/defaults/app.db create mode 100644 root/defaults/policy.xml create mode 100644 root/etc/cont-init.d/30-config create mode 100644 root/etc/services.d/calibre-web/run diff --git a/.gitignore b/.gitignore index 14da8a03..a4b97f90 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,6 @@ vendor/ .pylint.d # calibre-web -*.db *.log cps/cache diff --git a/root/defaults/app.db b/root/defaults/app.db new file mode 100644 index 0000000000000000000000000000000000000000..752e6916ddd7769ac4e43dd8447d2394fb340fd4 GIT binary patch literal 81920 zcmeI)?Qh%09S3kyPAtieqNGV63|ku3ZD0#g5?g+VlNM_fTS<*NcIt-(0g5pv@?>$Q zNQI>Q02mmYY$&jo+aIu3d$$++XZB|lMc*vIHlY0-MM|VhEA3JYt@;%#TjD+N?sIqK z-9^ggXRC(CmAdUTnWxN37bIDh?kkEUN%!b^nVx6qIYQ4eJuX%18aNetqpP zOUyKC4!`-7*FHM)+o{UYR)Zf^tfOV_94#CCXqmb6+B&Kl{*#Lr^mdsy>FN6Kn*MLM z__=%Ia^V}()|lC_T~Gd_sk7G4s9{l62tWV=5P$##AOHafKmY;|fB*y_009U<00Izz z00bZa0SG_<0uX?}unW)!9sKY1i|_g40Rad=00Izz00bZa0SG_<0uX?}kO_3Y|NmOb zzaFxRp*j$N00bZa0SG_<0uX=z1Rwwb2&CmR(xvS6Ti3<eAb|Bhx&j0s009U<00Izz z00bZa0SG`~_yw^3AO1E*4Iuyl2tWV=5P$##AOHafKmY<`f&kzDM@N7F1Rwwb2tWV= z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o5tmvV~bc+ zNUw2P0d?!N5K({CuKkW{be?1ayTvVGF|Zu%md-pbuALUAwhbo=38UGeJCZ{VexK=F zL)8XdDXAQ%G=x8j=z1JY7o_kzX=1^~vQIWv9#=M=DW6uKDN}}C6j!ySPpV6wDpSD) zNHjmQ%r~)yXX&!7~~pU{(CXUipR}Sf9mz>ra$!(*WM;`cEi8v*wiaL zI$-MMH(qaACMqaWsqsT~+o9V;*tp8l`s%8f;7zQpFI6_H6JaV*lKz`f65+%3jq1vy zHNiR+6riYVR3BD1s%uNtO+_5@y{W$E&!!94ugk}DsidhUO&AQi%K3ML=Q0j;7M(3l`n_Z_?0KSA{iPo(<}xj5eDq@}|KR+ea&zat9{=~aGFBS>IP>?+tIWGU zwV6E13jqi~00RFffmffOPZzFSk-zw*e?Jpqaj>EkNxfmnvNE2cl;ZF*{9u2|}PWiFVNP0f_2i>3IgI-Hn>sY<(srPG?r|EgUq zoj9F;F!$@LMsI#rd~$KLaN~yj ztg|on!Zc`&@6tq^TeP~2zr7r5^1i?+(U2udSKmj$h=`g~>_z)q8$_u*Gi0lVAZGdviY4 z7baq1bR9T#N7F3b9YPVNdZ&Fk9@i(Ya17C}Me-TtED{Sw|bRGB#S+zJ1!&CRoyno=w}WyWCP|P8=G4xtUEDZr_&w zuGJlN%tscl3(n7vz6wmu^X;4Rbu7Nf)kNlV9HTRdsvc68rIP_eD0Q z*gZTzFJW9IxV>o@4eV_+jy_DM3x$IGveO&rLl uzVzbX|KKSv0uX=z1Rwwb2tWV=5P$##AOL}(63ECSS7fo7kop!hptcVH literal 0 HcmV?d00001 diff --git a/root/defaults/policy.xml b/root/defaults/policy.xml new file mode 100644 index 00000000..5ec3385c --- /dev/null +++ b/root/defaults/policy.xml @@ -0,0 +1,80 @@ + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config new file mode 100644 index 00000000..4ca17b9e --- /dev/null +++ b/root/etc/cont-init.d/30-config @@ -0,0 +1,49 @@ +#!/usr/bin/with-contenv bash + +# create symlinks for imagemagick policy.xml +[[ -f /etc/ImageMagick-6/policy.xml ]] && \ + rm /etc/ImageMagick-6/policy.xml +[[ ! -L /etc/ImageMagick-6/policy.xml ]] && \ + ln -s /defaults/policy.xml /etc/ImageMagick-6/policy.xml + +# create symlinks for database and log +[[ ! -f /config/app.db ]] && \ + cp /defaults/app.db /config/app.db +[[ -f /app/calibre-web/app.db ]] && \ + rm /app/calibre-web/app.db +[[ ! -L /app/calibre-web/app.db ]] && \ + ln -s /config/app.db /app/calibre-web/app.db + +# create symlinks for log +[[ ! -f /config/calibre-web.log ]] && \ + touch /config/calibre-web.log +[[ -f /app/calibre-web/calibre-web.log ]] && \ + rm /app/calibre-web/calibre-web.log +[[ ! -L /app/calibre-web/calibre-web.log ]] && \ + ln -s /config/calibre-web.log /app/calibre-web/calibre-web.log + +# create Google drive client_secrets.json file +[[ ! -f /config/client_secrets.json ]] && \ + echo "{}" > /config/client_secrets.json +[[ -f /app/calibre-web/client_secrets.json ]] && + rm /app/calibre-web/client_secrets.json +[[ ! -L /app/calibre-web/client_secrets.json ]] && + ln -s /config/client_secrets.json /app/calibre-web/client_secrets.json + +# create Google drive symlinks for database +[[ ! -f /config/gdrive.db ]] && \ + cp /app/calibre-web/gdrive.db /config/gdrive.db +[[ -f /app/calibre-web/gdrive.db ]] && \ + rm /app/calibre-web/gdrive.db +[[ ! -L /app/calibre-web/gdrive.db ]] && \ + ln -s /config/gdrive.db /app/calibre-web/gdrive.db + +# check if kepubify is present and if so make executable +[[ -f /usr/bin/kepubify ]] && \ +[[ ! -x /usr/bin/kepubify ]] && \ + chmod +x /usr/bin/kepubify + +# permissions +chown -R abc:abc \ + /config \ + /app/calibre-web diff --git a/root/etc/services.d/calibre-web/run b/root/etc/services.d/calibre-web/run new file mode 100644 index 00000000..98523a39 --- /dev/null +++ b/root/etc/services.d/calibre-web/run @@ -0,0 +1,6 @@ +#!/usr/bin/with-contenv bash + +cd /app/calibre-web || exit + +exec \ + s6-setuidgid abc python3 /app/calibre-web/cps.py