mirror of
https://github.com/Blockstream/satellite-api.git
synced 2025-02-22 13:42:33 +01:00
remove http_x_forwarded_for from nginx and set it to 0.0.0.0 + update some image hashes + add log rotation
This commit is contained in:
parent
1a16caa12a
commit
8cc51f04a4
2 changed files with 13 additions and 21 deletions
|
@ -32,7 +32,7 @@ write_files:
|
|||
permissions: 0644
|
||||
owner: root
|
||||
content: |
|
||||
log_format withtimebs '$http_x_forwarded_for - $remote_addr - $remote_user [$time_local] '
|
||||
log_format withtimebs '$remote_addr - $remote_user [$time_local] '
|
||||
'"$request" $status $body_bytes_sent '
|
||||
'"$http_referer" "$http_user_agent" '
|
||||
'rt="$request_time" uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
|
||||
|
@ -45,13 +45,7 @@ write_files:
|
|||
server_name ${host};
|
||||
listen 80;
|
||||
server_tokens off;
|
||||
|
||||
set_real_ip_from 130.211.0.0/22;
|
||||
set_real_ip_from 35.191.0.0/16;
|
||||
set_real_ip_from 10.0.0.0/8;
|
||||
real_ip_recursive on;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-For 0.0.0.0;
|
||||
|
||||
# Proxy to Satellite API
|
||||
location = / {
|
||||
|
@ -93,7 +87,7 @@ write_files:
|
|||
permissions: 0644
|
||||
owner: root
|
||||
content: |
|
||||
log_format withtime '$http_x_forwarded_for - $remote_addr - $remote_user [$time_local] '
|
||||
log_format withtime '$remote_addr - $remote_user [$time_local] '
|
||||
'"$request" $status $body_bytes_sent '
|
||||
'"$http_referer" "$http_user_agent" '
|
||||
'rt="$request_time" uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
|
||||
|
@ -106,14 +100,8 @@ write_files:
|
|||
server_name ${space_host};
|
||||
listen 80 default_server;
|
||||
server_tokens off;
|
||||
|
||||
set_real_ip_from 130.211.0.0/22;
|
||||
set_real_ip_from 35.191.0.0/16;
|
||||
set_real_ip_from 10.0.0.0/8;
|
||||
real_ip_recursive on;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
proxy_set_header X-Forwarded-For 0.0.0.0;
|
||||
|
||||
# Proxy to Satellite API
|
||||
location = / {
|
||||
rewrite ^ /index.html break;
|
||||
|
@ -244,6 +232,8 @@ write_files:
|
|||
--network=host \
|
||||
--pid=host \
|
||||
--name=nginx \
|
||||
--log-opt max-size=200m \
|
||||
--log-opt max-file=3 \
|
||||
-v /home/bs/bscom.conf:/etc/nginx/conf.d/bscom.conf:ro \
|
||||
-v /home/bs/space.conf:/etc/nginx/conf.d/space.conf:ro \
|
||||
-v /home/bs/index.html:/usr/share/nginx/html/index.html:ro \
|
||||
|
@ -303,7 +293,7 @@ write_files:
|
|||
-v /mnt/disks/data/${net}:/root/.bitcoin:rw \
|
||||
"${bitcoin_docker}" ${bitcoin_cmd}
|
||||
ExecStop=/usr/bin/docker exec bitcoin bitcoin-cli stop
|
||||
ExecStopPost=/usr/bin/sleep 5
|
||||
ExecStopPost=/usr/bin/sleep 3
|
||||
ExecStopPost=/usr/bin/docker rm -f bitcoin
|
||||
|
||||
- path: /etc/systemd/system/lightning.service
|
||||
|
@ -329,8 +319,8 @@ write_files:
|
|||
-v /mnt/disks/data/lightning:/root/.lightning:rw \
|
||||
"${lightning_docker}" ${lightning_cmd}
|
||||
ExecStop=/usr/bin/docker exec lightning lightning-cli stop
|
||||
ExecStopPost=/usr/bin/sleep 5
|
||||
ExecStopPost=/usr/bin/docker rm -f bitcoin
|
||||
ExecStopPost=/usr/bin/sleep 3
|
||||
ExecStopPost=/usr/bin/docker rm -f lightning
|
||||
ExecStopPost=/sbin/iptables -D INPUT -p tcp --dport ${lightning_port} -j ACCEPT
|
||||
|
||||
- path: /etc/systemd/system/redis.service
|
||||
|
@ -383,6 +373,8 @@ write_files:
|
|||
--network=host \
|
||||
--pid=host \
|
||||
--name=ionosphere \
|
||||
--log-opt max-size=200m \
|
||||
--log-opt max-file=3 \
|
||||
-v /mnt/disks/data/ionosphere:/data \
|
||||
-e "RACK_ENV=production" \
|
||||
-e "CHARGE_ROOT=http://api-token:${rpcpass}@localhost:9112" \
|
||||
|
|
|
@ -181,5 +181,5 @@ variable "prom_docker" {
|
|||
|
||||
variable "gcloud_docker" {
|
||||
type = "string"
|
||||
default = "google/cloud-sdk@sha256:b0d0555efef6a566f42fc4f0d89be9e1d74aff4565e27bbd206405f759d3f2b0"
|
||||
default = "google/cloud-sdk@sha256:78e68a98c5d6aa36eca45099bae38a1544a1688fd16b506fb914a29fdf6e4afa"
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue