Skip to content

Commit

Permalink
Fix nginx SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
guimard committed Aug 16, 2024
1 parent 513adad commit bc58c54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion portal/install/etc/cont-init.d/update-nginx-portal-conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ s#__PORTALSTATICDIR__#/usr/share/lemonldap-ng/portal/htdocs/static/#g;
' /etc/lemonldap-ng/portal-nginx.conf

if test "$TLS_CERT_FILE"; then
perl -i -pe 's/^(\s*listen.*)80/${1}443/' /etc/lemonldap-ng/portal-nginx.conf
perl -i -pe 's/^(\s*listen.*)80/${1}443 ssl/' /etc/lemonldap-ng/portal-nginx.conf
if grep ssl_certificate /etc/lemonldap-ng/portal-nginx.conf; then
echo "SSL already configured ?"
else
Expand Down
13 changes: 13 additions & 0 deletions uwsgi-portal/install/etc/cont-init.d/update-nginx-portal-conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ s#__PORTALSITEDIR__#/usr/share/lemonldap-ng/portal/htdocs/#g;
s#__PORTALSTATICDIR__#/usr/share/lemonldap-ng/portal/htdocs/static/#g;
' /etc/lemonldap-ng/portal-nginx.conf

if test "$TLS_CERT_FILE"; then
perl -i -pe 's/^(\s*listen.*)80/${1}443 ssl/' /etc/lemonldap-ng/portal-nginx.conf
if grep ssl_certificate /etc/lemonldap-ng/portal-nginx.conf; then
echo "SSL already configured ?"
else
perl -i -pe 'BEGIN{our $setCert="
ssl_certificate $ENV{TLS_CERT_FILE};
ssl_certificate_key $ENV{TLS_KEY_FILE};
"};s/^(\s*server_name)/$setCert$1/' /etc/lemonldap-ng/portal-nginx.conf
fi
cat /etc/lemonldap-ng/portal-nginx.conf
fi

if test "$RELAY" != ''; then
set -e
perl -e '
Expand Down

0 comments on commit bc58c54

Please sign in to comment.