From 973c0c307838ec028f9a0112fa2062863ea21709 Mon Sep 17 00:00:00 2001 From: Cameron Wichman Date: Wed, 14 Jun 2023 10:09:39 -0700 Subject: [PATCH] small tweaks --- README.md | 10 +++++----- util/util.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1e637ad..796112c 100644 --- a/README.md +++ b/README.md @@ -40,10 +40,10 @@ docker-compose up |-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------| | `BASE_PATH` | Set this variable if you run wireguard-ui under a subpath of your reverse proxy virtual host (e.g. /wireguard)) | N/A | | `BIND_ADDRESS` | The addresses that can access to the web interface and the port | 0.0.0.0:80 | -| `SESSION_SECRET` | The secret key used to encrypt the session cookies. Set this to a random value. Accepts files | N/A | +| `SESSION_SECRET` | The secret key used to encrypt the session cookies. Set this to a random value. Accepts files as input | N/A | | `WGUI_USERNAME` | The username for the login page. Used for db initialization only | `admin` | -| `WGUI_PASSWORD` | The password for the user on the login page. Will be hashed automatically. Used for db initialization only. Accepts files | `admin` | -| `WGUI_PASSWORD_HASH` | The password hash for the user on the login page. (alternative to `WGUI_PASSWORD`). Used for db initialization only. Accepts files | N/A | +| `WGUI_PASSWORD` | The password for the user on the login page. Will be hashed automatically. Used for db initialization only. Accepts files as input | `admin` | +| `WGUI_PASSWORD_HASH` | The password hash for the user on the login page. (alternative to `WGUI_PASSWORD`). Used for db initialization only. Accepts files as input | N/A | | `WGUI_ENDPOINT_ADDRESS` | The default endpoint address used in global settings where clients should connect to | Resolved to your public ip address | | `WGUI_FAVICON_FILE_PATH` | The file path used as website favicon | Embedded WireGuard logo | | `WGUI_ENDPOINT_ADDRESS` | The default endpoint address used in global settings | Resolved to your public ip address | @@ -57,11 +57,11 @@ docker-compose up | `WG_CONF_TEMPLATE` | The custom `wg.conf` config file template. Please refer to our [default template](https://github.com/ngoduykhanh/wireguard-ui/blob/master/templates/wg.conf) | N/A | | `EMAIL_FROM_ADDRESS` | The sender email address | N/A | | `EMAIL_FROM_NAME` | The sender name | `WireGuard UI` | -| `SENDGRID_API_KEY` | The SendGrid api key. Accepts files | N/A | +| `SENDGRID_API_KEY` | The SendGrid api key. Accepts files as input | N/A | | `SMTP_HOSTNAME` | The SMTP IP address or hostname | `127.0.0.1` | | `SMTP_PORT` | The SMTP port | `25` | | `SMTP_USERNAME` | The SMTP username | N/A | -| `SMTP_PASSWORD` | The SMTP user password. Accepts files | N/A | +| `SMTP_PASSWORD` | The SMTP user password. Accepts files as input | N/A | | `SMTP_AUTH_TYPE` | The SMTP authentication type. Possible values: `PLAIN`, `LOGIN`, `NONE` | `NONE` | | `SMTP_ENCRYPTION` | the encryption method. Possible values: `NONE`, `SSL`, `SSLTLS`, `TLS`, `STARTTLS` | `STARTTLS` | diff --git a/util/util.go b/util/util.go index c11ed0d..946748b 100644 --- a/util/util.go +++ b/util/util.go @@ -480,8 +480,8 @@ func LookupEnvOrSecretString(key string, defaultVal string) string { } } // returns file contents if file exists - var content string if file, err := os.Open(val); err == nil { + var content string scanner := bufio.NewScanner(file) for scanner.Scan() { content += scanner.Text()