generated from canonical/is-charms-template-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add NGINX rock #9
Closed
Closed
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
036dce2
feat: add NGINX rock
amandahla aa5ee14
fix: ignore license for conf files
amandahla 11aa940
fix: add maubot-nginx-image param
amandahla b684071
Merge remote-tracking branch 'origin' into ISD-2273-nginx-rock
amandahla cbf42d8
fix: fix integration test and change Ingress port to point to NGINX
amandahla 7c71c7b
fix: remove file from nginx conf
amandahla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,15 @@ resources: | |
maubot-image: | ||
type: oci-image | ||
description: OCI image for maubot | ||
maubot-nginx-image: | ||
type: oci-image | ||
description: OCI image for nginx Maubot | ||
|
||
containers: | ||
maubot: | ||
resource: maubot-image | ||
maubot-nginx: | ||
resource: maubot-nginx-image | ||
|
||
type: charm | ||
base: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
user nginx nginx; | ||
daemon off; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
include mime.types; | ||
server_tokens off; | ||
|
||
gzip on; | ||
gzip_disable "msie6"; | ||
gzip_min_length 256; | ||
|
||
gzip_proxied any; | ||
gzip_http_version 1.1; | ||
gzip_types | ||
application/font-woff | ||
application/font-woff2 | ||
application/x-javascript | ||
application/xml | ||
application/xml+rss | ||
image/png | ||
image/x-icon | ||
font/woff2 | ||
text/css | ||
text/javascript | ||
text/plain | ||
text/xml; | ||
|
||
add_header X-Content-Type-Options 'nosniff'; | ||
add_header X-Frame-Options 'SAMEORIGIN'; | ||
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"; | ||
add_header X-XSS-Protection "1; mode=block"; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for" "$http_x_forwarded_proto"'; | ||
access_log /var/log/nginx/access.log main; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the access log should be logged to stdout, as the error log is logged to stderr? |
||
|
||
map $http_x_forwarded_proto $proxy_x_forwarded_proto { | ||
default $http_x_forwarded_proto; | ||
'' $scheme; | ||
} | ||
|
||
server { | ||
listen 8080; | ||
listen [::]:8080; | ||
error_log stderr error; | ||
|
||
location / { | ||
root /var/empty/nginx; | ||
proxy_hide_header Cache-Control; | ||
add_header Cache-Control 'no-cache,private'; | ||
include common_headers.conf; | ||
client_max_body_size 0; | ||
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; | ||
proxy_set_header X-Forwarded-Host $http_host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_pass http://localhost:29316; | ||
} | ||
|
||
location /health { | ||
access_log off; | ||
add_header 'Content-Type' 'application/json'; | ||
return 204; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2024 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
|
||
name: maubot-nginx | ||
summary: maubot nginx rock | ||
description: Nginx OCI image for the maubot charm | ||
version: "1.0" | ||
base: [email protected] | ||
build-base: [email protected] | ||
license: Apache-2.0 | ||
platforms: | ||
amd64: | ||
parts: | ||
add-user: | ||
plugin: nil | ||
overlay-script: | | ||
chmod 755 $CRAFT_OVERLAY/etc | ||
groupadd -R $CRAFT_OVERLAY --gid 2000 nginx | ||
useradd -R $CRAFT_OVERLAY --system --gid 2000 --uid 2000 --no-create-home nginx | ||
nginx-conf: | ||
plugin: dump | ||
source: etc | ||
organize: | ||
nginx.conf: etc/nginx/nginx.conf | ||
nginx: | ||
stage-packages: | ||
- logrotate | ||
- nginx | ||
plugin: nil | ||
override-build: | | ||
craftctl default | ||
rm $CRAFT_PART_INSTALL/etc/nginx/nginx.conf | ||
override-prime: | | ||
craftctl default | ||
mkdir run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: probably don't need to compress PNG files.