Skip to content

Commit

Permalink
Merge branch 'release/v1.17.10-8'
Browse files Browse the repository at this point in the history
  • Loading branch information
nhinze23 authored and cesmarvin committed Nov 2, 2021
2 parents 094a798 + 1840a63 commit 8a12176
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 9 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Changelog
# Nginx Changelog

All notable changes to this project will be documented in this file.

Expand All @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v1.17.10-8] - 2021-11-02

### Changed
- The script to append the warp menu to each page is now hosted instead of inline (#49)
- Use logging/root key

## [v1.17.10-7] - 2021-06-17
### Changed
- Update warp-menu version to v1.2.0 and add link to Cloudogu docs (#47)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN set -x \
FROM registry.cloudogu.com/official/base:3.12.4-1
LABEL maintainer="[email protected]" \
NAME="official/nginx" \
VERSION="1.17.10-7"
VERSION="1.17.10-8"

ENV CES_CONFD_VERSION=0.5.1 \
CES_CONFD_TAR_SHA256="f8776bc473beeacda8ff502861906bb9ab6eeda365513290116697cc6f68eee8" \
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!groovy
@Library(['github.com/cloudogu/dogu-build-lib@v1.1.0', 'github.com/cloudogu/ces-build-lib@1.44.2']) _
@Library(['github.com/cloudogu/dogu-build-lib@v1.4.1', 'github.com/cloudogu/ces-build-lib@1.48.0']) _
import com.cloudogu.ces.dogubuildlib.*
import com.cloudogu.ces.cesbuildlib.*

Expand Down
7 changes: 7 additions & 0 deletions custom_scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Custom Scripts

This directory contains optional custom scripts that can be activated. To do so move a certain script into the `conf.d` Volume of the Nginx (`/var/lib/ces/nginx/volumes/app.conf.d`). Then you need to restart the dogu for the script/s to apply.

### Script: block_jenkins_user_view

THis scripts blocks all member views of the Jenkins dogu. This is especially helpful for giving public access to one Jenkins instance while securing the member information.
4 changes: 4 additions & 0 deletions custom_scripts/block_jenkins_user_view.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
location ~* (/jenkins).*(/asynchPeople) {
error_page 401 /errors/401.html;
return 401;
}
18 changes: 14 additions & 4 deletions dogu.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Name": "official/nginx",
"Version": "1.17.10-7",
"Version": "1.17.10-8",
"DisplayName": "Nginx",
"Description": "Nginx WebServer.",
"Logo": "https://cloudogu.com/images/dogus/nginx.png",
Expand All @@ -17,9 +17,19 @@
],
"Configuration": [
{
"Name": "log_level",
"Description": "Detail level of logging (debug, info, notice, warn, error, crit, alert, or emerg)",
"Optional": true
"Name": "logging/root",
"Description": "Set the root log level to one of ERROR, WARN, INFO, DEBUG.",
"Optional": true,
"Default": "WARN",
"Validation": {
"Type": "ONE_OF",
"Values": [
"WARN",
"DEBUG",
"INFO",
"ERROR"
]
}
},
{
"Name": "disable_access_log",
Expand Down
1 change: 1 addition & 0 deletions resources/etc/ces-confd/templates/app.conf.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
server {
include /etc/nginx/include.d/ssl.conf;
include /etc/nginx/include.d/errors.conf;
include /etc/nginx/include.d/warp.conf;
include /etc/nginx/include.d/robots.conf;
include /etc/nginx/app.conf.d/*.conf;
Expand Down
2 changes: 1 addition & 1 deletion resources/etc/nginx/include.d/subfilters.conf.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# warp menu
set $scripts '<script type="text/javascript">(function(){var s = document.createElement("script");s.type = "text/javascript";s.src = "/warp/warp.js";var x = document.getElementsByTagName("script")[0];x.parentNode.insertBefore(s, x);})();</script></body>';
set $scripts '<script type="text/javascript" src="/warpmenu/add-warp-menu.js"></script></body>';

# Include google analytics scripts if a tracking id is set
{{ if .Config.Exists "google_tracking_id" }}
Expand Down
4 changes: 4 additions & 0 deletions resources/etc/nginx/include.d/warp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# error page location
location /warpmenu {
root /var/www/html;
}
2 changes: 1 addition & 1 deletion resources/etc/nginx/nginx.conf.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
user nginx;
worker_processes 2;

error_log /var/log/nginx/error.log {{ .Config.GetOrDefault "log_level" "warn" }};
error_log /var/log/nginx/error.log {{ .Env.Get "LOG_LEVEL" }};
pid /var/run/nginx.pid;

events {
Expand Down
25 changes: 25 additions & 0 deletions resources/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@ set -o errexit
set -o nounset
set -o pipefail

echo " ./////, "
echo " ./////==//////* "
echo " ////. ___ ////. "
echo " ,**,. //// ,////A, */// ,**,. "
echo " ,/////////////* */////* *////////////A "
echo " ////' \VA. '|' .///' '///* "
echo " */// .*///*, | .*//*, ///* "
echo " (/// (//////)**--_./////_----*//////) ///) "
echo " V/// '°°°° (/////) °°°°' //// "
echo " V/////(////////\. '°°°' ./////////(///(/' "
echo " 'V/(/////////////////////////////V' "

function export_log_level() {
ETCD_LOG_LEVEL="$(doguctl config logging/root --default "WARN")"
echo "Found etcd log level: ${ETCD_LOG_LEVEL}"

# The log level is exported for `doguctl template`
# The format is almost the same, except the case. The etcd-format is all uppercase, the configuration format
# is all lower case.
export LOG_LEVEL="${ETCD_LOG_LEVEL,,}"

echo "Set dogu log level to : ${LOG_LEVEL}"
}

echo "[nginx] configure ssl and https ..."
doguctl config --global certificate/server.crt > "/etc/ssl/server.crt"
doguctl config --global certificate/server.key > "/etc/ssl/server.key"
Expand All @@ -20,6 +44,7 @@ doguctl template /etc/nginx/include.d/customhtml.conf.tpl /etc/nginx/include.d/c

# render main configuration to include log_level
echo "[nginx] configure logging ..."
export_log_level
doguctl template /etc/nginx/nginx.conf.tpl /etc/nginx/nginx.conf

# render analytics template
Expand Down
9 changes: 9 additions & 0 deletions resources/var/www/html/warpmenu/add-warp-menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const addWarpMenu = function(){
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "/warp/warp.js";
var x = document.getElementsByTagName("script")[0];
x.parentNode.insertBefore(s, x);
}

addWarpMenu();

0 comments on commit 8a12176

Please sign in to comment.