From c5b7fe019808ce1a437895a65816f8d2b13ec79d Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 28 Oct 2013 11:03:06 +0000 Subject: main/nginx: create and use an nginx user and www-data group ref #2245 --- main/nginx/APKBUILD | 7 ++++--- main/nginx/nginx.pre-install | 8 ++++++-- main/nginx/nginx.pre-upgrade | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) create mode 120000 main/nginx/nginx.pre-upgrade diff --git a/main/nginx/APKBUILD b/main/nginx/APKBUILD index 3668897e55..578b1f12f2 100644 --- a/main/nginx/APKBUILD +++ b/main/nginx/APKBUILD @@ -4,11 +4,12 @@ pkgname=nginx pkgver=1.4.3 -pkgrel=0 +pkgrel=1 pkgdesc="lightweight HTTP and reverse proxy server" url="http://www.nginx.org" arch="all" license="Custom" +install="$pkgname.pre-install $pkgname.pre-upgrade" makedepends="pcre-dev openssl-dev zlib-dev" source="http://nginx.org/download/$pkgname-$pkgver.tar.gz nginx.initd @@ -36,8 +37,8 @@ build() { --http-client-body-temp-path=/tmp/$pkgname/client-body \ --http-proxy-temp-path=/tmp/$pkgname/proxy \ --http-fastcgi-temp-path=/tmp/$pkgname/fastcgi \ - --user=http \ - --group=http \ + --user=nginx \ + --group=nginx \ --with-ipv6 \ --with-pcre-jit \ --with-http_ssl_module \ diff --git a/main/nginx/nginx.pre-install b/main/nginx/nginx.pre-install index 8d0a58c6f8..55b5bfcda5 100644 --- a/main/nginx/nginx.pre-install +++ b/main/nginx/nginx.pre-install @@ -1,5 +1,9 @@ #!/bin/sh -addgroup nginx 2>/dev/null -adduser -S -H -h /dev/null -s /sbin/nologin -D -G nginx nginx 2>/dev/null +addgroup -g 82 -S www-data 2>/dev/null +addgroup -S nginx 2>/dev/null +adduser -S -G nginx -H -h /var/www/localhost/htdocs -s /sbin/nologin \ + -D nginx 2>/dev/null +addgroup nginx www-data 2>/dev/null + exit 0 diff --git a/main/nginx/nginx.pre-upgrade b/main/nginx/nginx.pre-upgrade new file mode 120000 index 0000000000..7af104a12c --- /dev/null +++ b/main/nginx/nginx.pre-upgrade @@ -0,0 +1 @@ +nginx.pre-install \ No newline at end of file -- cgit v1.2.3