X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=etc%2Fsv%2Fnginx%2Fconfigure.sh;fp=etc%2Fsv%2Fnginx%2Fconfigure.sh;h=0000000000000000000000000000000000000000;hp=a44c647168ffe34a8945209348520e9725e4dc53;hb=3ad6118386977e346d81042e924e5db9c5f15b7d;hpb=22f04b9fac14adc3d3fc98273ba126c3a51792c3 diff --git a/etc/sv/nginx/configure.sh b/etc/sv/nginx/configure.sh deleted file mode 100644 index a44c647..0000000 --- a/etc/sv/nginx/configure.sh +++ /dev/null @@ -1,92 +0,0 @@ -rule _runit_sv_configure php5-fpm '*' -rule _runit_sv_restart php5-fpm -rule apt_get_install nginx spawn-fcgi fcgiwrap -rule insserv_remove nginx -rule insserv_remove fcgiwrap - -rule _www_configure - -sudo install -d -m 770 -o www -g www \ - /etc/nginx \ - /etc/nginx/conf.d \ - /etc/nginx/site.d \ - /etc/nginx/x509.d -sudo ln -fns \ - /etc/nginx \ - /home/www/etc/nginx -sudo install -m 660 -o www -g www \ - "$tool"/etc/nginx/nginx.conf \ - /etc/nginx/nginx.conf - -for conf in $(find "$tool"/etc/nginx/conf.d \ - -mindepth 1 -maxdepth 1 -type f \ - -name '*.conf' \ - -printf '%f\n') - do - sudo install -m 660 -o www -g www \ - "$tool"/etc/nginx/conf.d/"$conf" \ - /etc/nginx/conf.d/"$conf" - done - -for site in $(find "$tool"/etc/nginx/site.d \ - -mindepth 1 -maxdepth 1 -type d \ - -false ${@:+$(printf -- '-or -name %s\n' "$@")} \ - -printf '%f\n') - do - rule adduser www-"$site" \ - --disabled-login \ - --disabled-password \ - --group \ - --home /home/www/pub/"$site" \ - --shell /bin/false \ - --system - rule adduser log-www-"$site" \ - --disabled-login \ - --disabled-password \ - --group \ - --home /home/www/log/"$site"/nginx \ - --shell /bin/false \ - --system - sudo install -d -m 771 -o log-www -g log-www \ - /home/www/log/"$site" - sudo install -d -m 770 -o www -g www \ - /etc/nginx/site.d/"$site" - sudo install -d -m 770 -o www -g www \ - /etc/nginx/x509.d/"$site" - sudo test -L /home/www/pub/"$site" || - sudo install -d -m 2770 -o www-"$site" -g www-"$site" \ - /home/www/pub/"$site" - sudo adduser www-data www-"$site" - sudo adduser www-data log-www-"$site" - sudo install -m 660 -o www -g www \ - "$tool"/etc/nginx/site.d/"$site"/local.conf \ - /etc/nginx/site.d/"$site"/local.conf - test ! -e "$tool"/etc/nginx/site.d/"$site"/http.conf || - sudo install -m 660 -o www -g www \ - "$tool"/etc/nginx/site.d/"$site"/http.conf \ - /etc/nginx/site.d/"$site"/http.conf - if test -L "$tool"/etc/nginx/site.d/"$site"/site.conf - then - sudo cp --force --preserve=links --no-dereference \ - "$tool"/etc/nginx/site.d/"$site"/site.conf \ - /etc/nginx/site.d/"$site"/site.conf - else - sudo install -m 660 -o www -g www \ - "$tool"/etc/nginx/site.d/"$site"/site.conf \ - /etc/nginx/site.d/"$site"/site.conf - fi - sudo install -m 660 -o www -g www /dev/stdin \ - /etc/nginx/site.d/"$site"/server.conf <<-EOF - server { - access_log /home/www/log/$site/nginx/access.log main; - error_log /home/www/log/$site/nginx/error.log warn; - root /home/www/pub/$site; - include /etc/nginx/site.d/$site/local.conf; - include /etc/nginx/site.d/$site/site.conf; - } - EOF - ( - test ! -r "$tool"/etc/nginx/site.d/"$site"/configure.sh || - . "$tool"/etc/nginx/site.d/"$site"/configure.sh || return 1 - ) - done