Skip to content

Commit

Permalink
fix(ip logging): add env var for proxy to fix ip logging on failed lo…
Browse files Browse the repository at this point in the history
…gins (#756)
  • Loading branch information
ankarhem committed Jan 26, 2021
1 parent 20ca3f2 commit 9342a40
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

## Getting Started

Check out our documenation for steps on how to install and run Overseerr:
Check out our documentation for steps on how to install and run Overseerr:

https://docs.overseerr.dev/getting-started/installation

Expand All @@ -58,6 +58,7 @@ Currently, Overseerr is only distributed through Docker images. If you have Dock
docker run -d \
-e LOG_LEVEL=info \
-e TZ=Asia/Tokyo \
-e PROXY=<yes|no>
-p 5055:5055 \
-v /path/to/appdata/config:/app/config \
--restart unless-stopped \
Expand Down
5 changes: 3 additions & 2 deletions docs/extending-overseerr/reverse-proxy-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Base URLs cannot be configured in Overseerr. With this limitation, only subdomai

A sample is bundled in SWAG. This page is still the only source of truth, so the sample is not guaranteed to be up to date. If you catch an inconsistency, report it to the linuxserver team, or do a pull-request against the proxy-confs repository to update the sample.

Rename the sample file `overseerr.subdomain.conf.sample` to `overseerr.subdomain.conf` in the `proxy-confs`folder, or create `overseerr.subdomain.conf` in the same folder with the example below.
Rename the sample file `overseerr.subdomain.conf.sample` to `overseerr.subdomain.conf` in the `proxy-confs`folder, or create `overseerr.subdomain.conf` in the same folder with the example below.

Example Configuration:

Expand Down Expand Up @@ -122,6 +122,8 @@ server {
add_header X-Frame-Options "SAMEORIGIN" always;
# Prevent Sniff Mimetype (X-Content-Type-Options)
add_header X-Content-Type-Options "nosniff" always;
# Tell crawling bots to not index the site
add_header X-Robots-Tag "noindex, nofollow" always;
access_log /var/log/nginx/overseerr.example.com-access.log;
error_log /var/log/nginx/overseerr.example.com-error.log;
Expand All @@ -131,4 +133,3 @@ server {
}
}
```

2 changes: 2 additions & 0 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ After running Overseerr for the first time, configure it by visiting the web UI
docker run -d \
-e LOG_LEVEL=info \
-e TZ=Asia/Tokyo \
-e PROXY=<yes|no> \
-p 5055:5055 \
-v /path/to/appdata/config:/app/config \
--restart unless-stopped \
Expand All @@ -32,6 +33,7 @@ docker run -d \
--user=[ user | user:group | uid | uid:gid | user:gid | uid:group ] \
-e LOG_LEVEL=info \
-e TZ=Asia/Tokyo \
-e PROXY=<yes|no> \
-p 5055:5055 \
-v /path/to/appdata/config:/app/config \
--restart unless-stopped \
Expand Down
3 changes: 3 additions & 0 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ app
startJobs();

const server = express();
if (process.env.PROXY === 'yes') {
server.enable('trust proxy');
}
server.use(cookieParser());
server.use(bodyParser.json());
server.use(bodyParser.urlencoded({ extended: true }));
Expand Down

0 comments on commit 9342a40

Please sign in to comment.