Skip to content

Commit

Permalink
linux - add default API_LISTEN_IP
Browse files Browse the repository at this point in the history
  • Loading branch information
fl0ppy-d1sk committed Oct 30, 2023
1 parent 18d682b commit fa628cb
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-core-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
echo "HTTP_PORT=80" | sudo tee -a /etc/bunkerweb/variables.env
echo "HTTPS_PORT=443" | sudo tee -a /etc/bunkerweb/variables.env
echo 'DNS_RESOLVERS=9.9.9.9 8.8.8.8 8.8.4.4' | sudo tee -a /etc/bunkerweb/variables.env
echo 'API_LISTEN_IP=127.0.0.1' | sudo tee -a /etc/bunkerweb/variables.env
echo "USE_BUNKERNET=no" | sudo tee -a /etc/bunkerweb/variables.env
echo "USE_BLACKLIST=no" | sudo tee -a /etc/bunkerweb/variables.env
echo "LOG_LEVEL=info" | sudo tee -a /etc/bunkerweb/variables.env
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests-ui-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
echo "HTTP_PORT=80" | sudo tee -a /etc/bunkerweb/variables.env
echo "HTTPS_PORT=443" | sudo tee -a /etc/bunkerweb/variables.env
echo 'DNS_RESOLVERS=9.9.9.9 8.8.8.8 8.8.4.4' | sudo tee -a /etc/bunkerweb/variables.env
echo 'API_LISTEN_IP=127.0.0.1' | sudo tee -a /etc/bunkerweb/variables.env
echo "MULTISITE=yes" | sudo tee -a /etc/bunkerweb/variables.env
echo "LOG_LEVEL=info" | sudo tee -a /etc/bunkerweb/variables.env
echo "USE_BUNKERNET=no" | sudo tee -a /etc/bunkerweb/variables.env
Expand Down
9 changes: 9 additions & 0 deletions docs/quickstart-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ You will find more settings about reverse proxy in the [settings section](settin
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
SERVER_NAME=www.example.com
USE_REVERSE_PROXY=yes
REVERSE_PROXY_URL=/
Expand Down Expand Up @@ -268,6 +269,7 @@ You will find more settings about reverse proxy in the [settings section](settin
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
SERVER_NAME=www.example.com
USE_REVERSE_PROXY=yes
REVERSE_PROXY_URL=/
Expand Down Expand Up @@ -323,6 +325,7 @@ You will find more settings about reverse proxy in the [settings section](settin
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
USE_REVERSE_PROXY=yes
REVERSE_PROXY_URL=/
REVERSE_PROXY_HOST=http://127.0.0.1:8000
Expand Down Expand Up @@ -658,6 +661,7 @@ You will find more settings about reverse proxy in the [settings section](settin
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
MULTISITE=yes
SERVER_NAME=app1.example.com app2.example.com app3.example.com
USE_REVERSE_PROXY=yes
Expand Down Expand Up @@ -701,6 +705,7 @@ You will find more settings about reverse proxy in the [settings section](settin
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
MULTISITE=yes
SERVER_NAME=app1.example.com app2.example.com app3.example.com
USE_REVERSE_PROXY=yes
Expand Down Expand Up @@ -756,6 +761,7 @@ You will find more settings about reverse proxy in the [settings section](settin
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
MULTISITE=yes
SERVER_NAME=app1.example.com app2.example.com app3.example.com
USE_REVERSE_PROXY=yes
Expand Down Expand Up @@ -2199,6 +2205,7 @@ BunkerWeb supports PHP using external or remote [PHP-FPM](https://www.php.net/ma
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
MULTISITE=yes
SERVER_NAME=app1.example.com app2.example.com app3.example.com
app1.example.com_LOCAL_PHP=/run/php/php-fpm.sock
Expand Down Expand Up @@ -2240,6 +2247,7 @@ BunkerWeb supports PHP using external or remote [PHP-FPM](https://www.php.net/ma
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
MULTISITE=yes
SERVER_NAME=app1.example.com app2.example.com app3.example.com
app1.example.com_LOCAL_PHP=/run/php/php-fpm.sock
Expand Down Expand Up @@ -2289,6 +2297,7 @@ BunkerWeb supports PHP using external or remote [PHP-FPM](https://www.php.net/ma
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
MULTISITE=yes
SERVER_NAME=app1.example.com app2.example.com app3.example.com
app1.example.com_LOCAL_PHP=/run/php/php-fpm.sock
Expand Down
4 changes: 3 additions & 1 deletion docs/web-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -823,10 +823,10 @@ Because the web UI is a web application, the recommended installation procedure
Here is the `/etc/bunkerweb/variables.env` boilerplate you can use :

```conf
API_LISTEN_IP=127.0.0.1
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
SERVER_NAME=www.example.com
MULTISITE=yes
www.example.com_USE_UI=yes
Expand Down Expand Up @@ -859,6 +859,7 @@ Because the web UI is a web application, the recommended installation procedure
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
SERVER_NAME=www.example.com
MULTISITE=yes
www.example.com_USE_UI=yes
Expand Down Expand Up @@ -932,6 +933,7 @@ Because the web UI is a web application, the recommended installation procedure
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
SERVER_NAME=www.example.com
MULTISITE=yes
www.example.com_USE_UI=yes
Expand Down
1 change: 1 addition & 0 deletions examples/authelia/variables.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
MULTISITE=yes
# Replace with your domains
SERVER_NAME=auth.example.com app1.example.com app2.example.com
Expand Down
1 change: 1 addition & 0 deletions examples/behind-reverse-proxy/variables.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
# replace with your domains
SERVER_NAME=www.example.com
# real IP settings
Expand Down
1 change: 1 addition & 0 deletions examples/cors/variables.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
MULTISITE=yes
# Replace with your domains
SERVER_NAME=app1.example.com app2.example.com app3.example.com
Expand Down
1 change: 1 addition & 0 deletions examples/drupal/variables.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
# Replace with your domain
SERVER_NAME=www.example.com
DISABLE_DEFAULT_SERVER=yes
Expand Down
1 change: 1 addition & 0 deletions examples/joomla/variables.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
# Replace with your domain
SERVER_NAME=www.example.com
DISABLE_DEFAULT_SERVER=yes
Expand Down
1 change: 1 addition & 0 deletions examples/moodle/variables.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
# Replace with your domain
SERVER_NAME=www.example.com
DISABLE_DEFAULT_SERVER=yes
Expand Down
1 change: 1 addition & 0 deletions examples/nextcloud/variables.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
# Replace with your domain
SERVER_NAME=www.example.com
DISABLE_DEFAULT_SERVER=yes
Expand Down
1 change: 1 addition & 0 deletions examples/php-cookie-flags/variables.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
# Replace with your domain
SERVER_NAME=www.example.com
DISABLE_DEFAULT_SERVER=yes
Expand Down
1 change: 1 addition & 0 deletions examples/php-multisite/variables.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
# Replace with your domain
SERVER_NAME=app1.example.com app2.example.com
MULTISITE=yes
Expand Down
1 change: 1 addition & 0 deletions examples/php-singlesite/variables.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
# Replace with your domain
SERVER_NAME=www.example.com
DISABLE_DEFAULT_SERVER=yes
Expand Down
1 change: 1 addition & 0 deletions examples/proxy-protocol/variables.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
# replace with your domains
SERVER_NAME=www.example.com
# real IP settings
Expand Down
1 change: 1 addition & 0 deletions examples/wordpress/variables.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HTTP_PORT=80
HTTPS_PORT=443
DNS_RESOLVERS=8.8.8.8 8.8.4.4
API_LISTEN_IP=127.0.0.1
# Replace with your domain
SERVER_NAME=www.example.com
DISABLE_DEFAULT_SERVER=yes
Expand Down
4 changes: 2 additions & 2 deletions src/common/confs/api.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ server {
server_name {{ API_SERVER_NAME }};

# HTTP listen
listen {{ API_LISTEN_IP }}:{{ API_HTTP_PORT }};
listen {{ API_LISTEN_IP }}:{{ API_HTTP_PORT }} reuseport;
{% if API_LISTEN_IP != "127.0.0.1" +%}
listen 127.0.0.1:{{ API_HTTP_PORT }};
listen 127.0.0.1:{{ API_HTTP_PORT }} reuseport;
{% endif %}

# maximum body size for API
Expand Down

0 comments on commit fa628cb

Please sign in to comment.