Skip to content

Commit

Permalink
chore: adapt nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyynthia committed Jan 27, 2023
1 parent 522d1f7 commit 5fc4683
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ node_modules
*.nogit.*

.env
config.json
conf/nginx.custom.conf
.env.*
!.env.example
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ community.
Extremism is dangerous and only lead to conflicts, and nobody likes conflicts. Exaggerating someone's view on a
subject to misleadingly claim they are being offensive, oppressive, or otherwise harmful falls under this rule.

You may report unappropriated behavior by shooting me an email at cynthia@cynthia.dev.
You may report unappropriated behavior by shooting me an email at cynthia@maid.gg.
4 changes: 2 additions & 2 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ This repo uses [pnpm](https://pnpm.io/) for dependency management and general ma
troubles if you try to use another package manager.

### Development environment
You can quickly spin up a development environment with [docker compose](https://docs.docker.com/compose/), which will
have everything needed for PronounDB's website & API to work. It'll have hot-reloading on both the website and the API.
You can start services needed for PronounDB with with [docker compose](https://docs.docker.com/compose/). Once services
are up, you can run the dev server with `pnpm run dev` in the websites package.

To test the extension, you can run `pnpm run dev` in the extension package to build the extension & enable automatic
re-building when files are changed. You'll need to load the extension in your browser manually, and to refresh it
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G71TSDF)

[![License](https://img.shields.io/github/license/cyyynthia/pronoundb.org.svg?style=flat-square)](https://github.com/cyyynthia/pronoundb.org/blob/mistress/LICENSE)
[![Chat on Discord](https://img.shields.io/badge/chat-on%20discord-5865F2?style=flat-square)](https://discord.gg/VnxPeNHHpG)<br/>
[![Chrome Web Store](https://img.shields.io/chrome-web-store/v/nblkbiljcjfemkfjnhoobnojjgjdmknf?logo=google-chrome&logoColor=white&style=flat-square)](https://chrome.google.com/webstore/detail/pronoundb/nblkbiljcjfemkfjnhoobnojjgjdmknf)
[![Mozilla Add-on](https://img.shields.io/amo/v/pronoundb?logo=firefox&logoColor=white&style=flat-square)](https://addons.mozilla.org/firefox/addon/pronoundb)
[![Edge Add-on](https://img.shields.io/badge/dynamic/json?label=edge%20add-on&prefix=v&color=fe7d37&logo=microsoftedge&logoColor=white&style=flat-square&query=%24.version&url=https%3A%2F%2Fmicrosoftedge.microsoft.com%2Faddons%2Fgetproductdetailsbycrxid%2Fjbgjogfdlgjohdacngknlohahhaiaodn)](https://microsoftedge.microsoft.com/addons/detail/jbgjogfdlgjohdacngknlohahhaiaodn)
Expand Down Expand Up @@ -36,7 +37,7 @@ For the time being, neo-pronouns are not supported by PronounDB. However, they m
In my [original statement](https://github.com/cyyynthia/pronoundb.org/blob/f8eaea19/README.md#faq), I stated that
they would not be something I'll be adding - this is (probably) no longer the case.

I'll be changing the way pronouns are internally handled and formatted soon, which should allow for this to happen.
I'll be changing the way pronouns are internally handled and formatted soon:tm:, which should allow for this to happen.
I also revised some of my plans regarding internationalization and found some compromises there too.

### Custom pronouns
Expand Down
33 changes: 14 additions & 19 deletions conf/nginx.prod.conf → conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# A good chunk of performance & security settings are not here.

limit_conn_zone $binary_remote_addr zone=pdb_conn_limit_per_ip:10m;
limit_req_zone $binary_remote_addr zone=pdb_req_limit_per_ip:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=pdb_req_limit_per_ip:10m rate=50r/s;

server {
listen 443 ssl http2;
Expand All @@ -12,39 +12,34 @@ server {
client_max_body_size 512K;

limit_conn pdb_conn_limit_per_ip 10;
limit_req zone=pdb_req_limit_per_ip burst=10 nodelay;
limit_req zone=pdb_req_limit_per_ip burst=50 nodelay;
limit_req_status 429;

root /home/cynthia/pronoundb.org/packages/website/dist;
try_files $uri @web;
access_log /var/log/nginx/pronoundb.access.log;
error_log /var/log/nginx/pronoundb.error.log error;

location /.well-known {
try_files $uri =403;
}
root /home/cynthia/pronoundb.org/packages/website/dist/client;
try_files $uri @ssr;

location /assets {
location /_astro {
add_header cache-control "no-transform, public, max-age=31536000, immutable";
try_files $uri @web;
try_files $uri =404;
}

location @web {
proxy_pass http://localhost:7001;
location /.well-known {
try_files $uri =404;
}

location /api {
proxy_pass http://localhost:7002;
location /@internal {
deny all;
}

# todo: deprecate?
location /shields {
proxy_pass http://localhost:7002;
location @ssr {
proxy_pass http://localhost:7003;
}

# SSL
ssl_certificate /etc/letsencrypt/live/pronoundb.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/pronoundb.org/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/pronoundb.org/chain.pem;

# Additonal prefs
include /home/cynthia/pronoundb.org/conf/nginx.custom.conf;
}
32 changes: 0 additions & 32 deletions conf/nginx.dev.conf

This file was deleted.

0 comments on commit 5fc4683

Please sign in to comment.