Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/download
/extract
/package
/data
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ In `conf/nginx.conf.server`, expiration rules can be set for URI (`$uri_expiry`)
Start chrome with the following flag:

```
--proxy-server="https=127.0.0.1:3128;http=127.0.0.1:3128"
--proxy-server="https=127.0.0.1:3128;http=127.0.0.1:3128" --ignore-certificate-errors
```

### Electron
Expand Down
16 changes: 8 additions & 8 deletions conf/nginx.conf.server.template
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ map $http_range $proxy_cache_backend {
server {
include ./transparent_proxy/*.conf;
include ./restrict_local/*.conf;
listen 127.0.0.1:444 ssl;
listen 127.0.0.1:3128;
listen ${HOST}:444 ssl;
listen ${HOST}:3128;

add_header Funes-Proxied-By $proxied_by_value;

Expand Down Expand Up @@ -119,8 +119,8 @@ map $server_port $proxy_method {

server {
include ./restrict_local/*.conf;
listen 127.0.0.1:3129;
listen 127.0.0.1:3130;
listen ${HOST}:3129;
listen ${HOST}:3130;

add_header Funes-Cache-Status $upstream_cache_status;
add_header Funes-Upstream-Status $upstream_status;
Expand Down Expand Up @@ -179,8 +179,8 @@ map $server_port $forward_proxy_scheme {

server {
include ./restrict_local/*.conf;
listen 127.0.0.1:4480;
listen 127.0.0.1:4443;
listen ${HOST}:4480;
listen ${HOST}:4443;

add_header Funes-Proxied-By $forward_proxied_by_value;

Expand Down Expand Up @@ -214,8 +214,8 @@ map $server_port $forward_range_proxy_scheme {

server {
include ./restrict_local/*.conf;
listen 127.0.0.1:4481;
listen 127.0.0.1:4444;
listen ${HOST}:4481;
listen ${HOST}:4444;

add_header Funes-Proxied-By $forward_range_proxied_by_value;

Expand Down
26 changes: 26 additions & 0 deletions docker-compose.dev-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "2"
services:
nginx:
build:
context: ./
dockerfile: Dockerfile.dev
ports:
- "80:80"
- "443:443"
- "3128:3128"
volumes:
- ./data/logs:/usr/src/app/build/logs
- ./data/content_cache:/data/funes/content_cache
# command: ["bash", "-c", "sleep infinity"]
environment:
- VERBOSE=true
- DISABLE_TRANSPARENT_PROXY=1
- DISABLE_DYNAMIC_CERTS=1
- ENABLE_ACCESS_LOGS=true
- HOST=0.0.0.0
# - PROXY_BUFFER_SIZE=128k
# - PROXY_BUFFERS=4 128k
# - PROXY_BUSY_BUFFERS_SIZE=128k
# - DISABLE_RANGE_CACHE_EXPIRY_OVERRIDE=1
# - PROXY_READ_DATA_TIMEOUT=600s
# - PROXY_CONNECT_DATA_TIMEOUT=600s
18 changes: 9 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
version: '2'
version: "2"
services:
nginx:
build:
context: ./
dockerfile: Dockerfile.dev
ports:
- "80:80"
- "443:443"
- "3128:3128"
- "80:80"
- "443:443"
- "3128:3128"
# volumes:
# - ./:/usr/src/app/:rw
# command: ["bash", "-c", "sleep infinity"]
environment:
- HELLO=WORLD
- VERBOSE=true
# - RESTRICT_LOCAL=1
- DISABLE_TRANSPARENT_PROXY=1
- DISABLE_DYNAMIC_CERTS=1
- HELLO=WORLD
- VERBOSE=true
# - RESTRICT_LOCAL=1
- DISABLE_TRANSPARENT_PROXY=1
- DISABLE_DYNAMIC_CERTS=1
# - PROXY_BUFFER_SIZE=128k
# - PROXY_BUFFERS=4 128k
# - PROXY_BUSY_BUFFERS_SIZE=128k
Expand Down
10 changes: 9 additions & 1 deletion scripts/generate_conf_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ chown www-data $ROOT_CA_KEY

## Run this if you want to add the root CA cert to local certificate store.
# cp $ROOT_CA_CERT /usr/local/share/ca-certificates/


Comment thread
jschr marked this conversation as resolved.
# update-ca-certificates

if [ -z "$LOG_DIR" ]
Expand Down Expand Up @@ -147,6 +149,12 @@ if [ -z "$PROXY_READ_DATA_TIMEOUT" ]
then
export PROXY_READ_DATA_TIMEOUT="60s"
fi
if [ -z "$HOST" ]
then
export HOST="127.0.0.1"
fi

printf 'HOST=%s\n' "$HOST"
printf 'ERROR_LOG_LEVEL=%s\n' "$ERROR_LOG_LEVEL"
printf 'ACCESS_LOG_DIRECTIVE=%s\n' "$ACCESS_LOG_DIRECTIVE"
printf 'CACHE_ACCESS_LOG_DIRECTIVE=%s\n' "$CACHE_ACCESS_LOG_DIRECTIVE"
Expand Down Expand Up @@ -175,5 +183,5 @@ echo "Nameserver is: $NAMESERVER"

echo "Copying nginx config"
envsubst '${ROOT_CA_CERT} ${ROOT_CA_KEY} ${ERROR_LOG_LEVEL} ${ACCESS_LOG_DIRECTIVE} ${PROXY_BUFFER_SIZE} ${PROXY_BUFFERS} ${PROXY_BUSY_BUFFERS_SIZE}' < ./conf/nginx.conf.template > ./conf/nginx.conf
envsubst '${PROXY_CONNECT_DATA_TIMEOUT} ${PROXY_READ_DATA_TIMEOUT} ${NAMESERVER} ${CACHE_ACCESS_LOG_DIRECTIVE} ${RANGE_ACCESS_LOG_DIRECTIVE} ${CONTENT_CACHE_DIR} ${CONTENT_CACHE_KEYS_ZONE} ${CONTENT_CACHE_SIZE} ${SSL_VERIFY_DEPTH}' < ./conf/nginx.conf.server.template > ./conf/nginx.conf.server
envsubst '${HOST} ${PROXY_CONNECT_DATA_TIMEOUT} ${PROXY_READ_DATA_TIMEOUT} ${NAMESERVER} ${CACHE_ACCESS_LOG_DIRECTIVE} ${RANGE_ACCESS_LOG_DIRECTIVE} ${CONTENT_CACHE_DIR} ${CONTENT_CACHE_KEYS_ZONE} ${CONTENT_CACHE_SIZE} ${SSL_VERIFY_DEPTH}' < ./conf/nginx.conf.server.template > ./conf/nginx.conf.server
envsubst '${ROOT_CA_CERT} ${ROOT_CA_KEY} ${CERT_MEM_CACHE_TTL_SEC}' < ./conf/generate_ssl_certs.template.lua > ./conf/generate_ssl_certs.lua