Skip to content

Commit

Permalink
listen configs
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevaev committed Nov 11, 2021
1 parent aa2de59 commit 8e60b84
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
5 changes: 2 additions & 3 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ md5sums=(SKIP)
backup=(
etc/kvmd/{override,logging,auth,meta}.yaml
etc/kvmd/{ht,ipmi,vnc}passwd
etc/kvmd/nginx/{kvmd.ctx-{http,server},loc-{login,nocache,proxy,websocket},mime-types,ssl,nginx}.conf
etc/kvmd/nginx/{kvmd.ctx-{http,server},listen-http{,s},loc-{login,nocache,proxy,websocket},mime-types,ssl,redirect-to-https,nginx}.conf
etc/kvmd/janus/janus{,.plugin.ustreamer,.transport.websockets}.jcfg
etc/kvmd/web.css
)
Expand Down Expand Up @@ -136,7 +136,6 @@ package_kvmd() {
cp -r configs/* "$_cfg_default"

find "$pkgdir" -name ".gitignore" -delete
sed -i -e "s/^#PROD//g" "$_cfg_default/nginx/nginx.conf"
find "$_cfg_default" -type f -exec chmod 444 '{}' \;
chmod 400 "$_cfg_default/kvmd"/*passwd
chmod 750 "$_cfg_default/os/sudoers"
Expand All @@ -145,7 +144,7 @@ package_kvmd() {
mkdir -p "$pkgdir/etc/kvmd/"{nginx,vnc}"/ssl"
chmod 755 "$pkgdir/etc/kvmd/"{nginx,vnc}"/ssl"
install -Dm444 -t "$pkgdir/etc/kvmd/nginx" "$_cfg_default/nginx"/*.conf
chmod 644 "$pkgdir/etc/kvmd/nginx/nginx.conf"
chmod 644 "$pkgdir/etc/kvmd/nginx/"{nginx,redirect-to-https,ssl,listen-http{,s}}.conf

mkdir -p "$pkgdir/etc/kvmd/janus"
chmod 755 "$pkgdir/etc/kvmd/janus"
Expand Down
2 changes: 2 additions & 0 deletions configs/nginx/listen-http.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
listen 80;
listen [::]:80;
2 changes: 2 additions & 0 deletions configs/nginx/listen-https.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
listen 443 ssl http2;
listen [::]:443 ssl http2;
17 changes: 7 additions & 10 deletions configs/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,16 @@ http {
include /etc/kvmd/nginx/kvmd.ctx-http.conf;
include /usr/share/kvmd/extras/*/nginx.ctx-http.conf;

#PROD server {
#PROD listen 80;
#PROD listen [::]:80;
#PROD server_name localhost;
#PROD return 301 https://$host$request_uri;
#PROD }

server {
#PROD listen 443 ssl http2;
#PROD listen [::]:443 ssl http2;
server_name localhost;
#PROD include /etc/kvmd/nginx/ssl.conf;
include /etc/kvmd/nginx/listen-http.conf;
include /etc/kvmd/nginx/redirect-to-https.conf;
}

server {
server_name localhost;
include /etc/kvmd/nginx/listen-https.conf;
include /etc/kvmd/nginx/ssl.conf;
include /etc/kvmd/nginx/kvmd.ctx-server.conf;
include /usr/share/kvmd/extras/*/nginx.ctx-server.conf;
}
Expand Down
1 change: 1 addition & 0 deletions configs/nginx/redirect-to-https.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
return 301 https://$host$request_uri;
3 changes: 3 additions & 0 deletions kvmd.install
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ post_upgrade() {
chown kvmd-ipmi:kvmd-ipmi /etc/kvmd/ipmipasswd
chown kvmd-vnc:kvmd-vnc /etc/kvmd/vncpasswd
chmod 600 /etc/kvmd/*passwd
for target in nginx redirect-to-https ssl listen-http listen-https; do
chmod 644 /etc/kvmd/nginx/$target.conf || true
done

chown kvmd /var/lib/kvmd/msd || true

Expand Down

0 comments on commit 8e60b84

Please sign in to comment.