Skip to content
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
wants to merge 6 commits into from
Closed

feat: add NGINX rock #9

wants to merge 6 commits into from

Conversation

amandahla
Copy link
Contributor

@amandahla amandahla commented Sep 13, 2024

Applicable spec:

Overview

This PR adds a NGINX rock and pebble layer to the Maubot charm.

Rationale

NGINX will act as a proxy.

Note:

Juju Events Changes

Add NGINX pebble ready event.

Module Changes

Library Changes

Checklist

No CH available.

@amandahla amandahla requested a review from a team as a code owner September 13, 2024 14:47
cbartz
cbartz previously approved these changes Sep 16, 2024
Copy link

Test coverage for 7c71c7b

Name           Stmts   Miss Branch BrPart  Cover   Missing
----------------------------------------------------------
src/charm.py      59     21     10      2    58%   50, 57-63, 67-72, 76-81, 87
----------------------------------------------------------
TOTAL             59     21     10      2    58%

Static code analysis report

Run started:2024-09-17 14:55:59.752612

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 210
  Total lines skipped (#nosec): 0
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

Copy link

@weiiwang01 weiiwang01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the overall is great, but I have one question related to this: why not include nginx in the maubot image and use pebble to run both the maubot service and nginx in the same container? Is there any reason for using two containers?

application/x-javascript
application/xml
application/xml+rss
image/png

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.

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;

Choose a reason for hiding this comment

The 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?

@amandahla
Copy link
Contributor Author

I think the overall is great, but I have one question related to this: why not include nginx in the maubot image and use pebble to run both the maubot service and nginx in the same container? Is there any reason for using two containers?

Thats an excellent question. I cant think of any reason for having two containers!

@amandahla
Copy link
Contributor Author

I'll close this PR and add NGINX to Maubot. Thanks @weiiwang01 !

@amandahla amandahla closed this Sep 18, 2024
@amandahla amandahla mentioned this pull request Sep 19, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants