Skip to content

Commit 5c57512

Browse files
authored
Merge pull request #153 from linuxserver/readme
Format app_setup_block
2 parents 093fadb + 1afac8b commit 5c57512

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ The architectures supported by this image are:
6868
> * If you don't want to or can't use the option `--remove-orphans`, then you can first do `docker-compose down`, then edit the compose yaml as above, and then issue `docker-compose up -d`
6969
7070
> Make sure to also update any references to this container by name. For instance, Nextcloud's `config.php` references this container in its `trusted_proxies` directive, which would have to be updated to `swag`.
71+
7172
### Validation and initial setup
73+
7274
* Before running this container, make sure that the url and subdomains are properly forwarded to this container's host, and that port 443 (and/or 80) is not being used by another service on the host (NAS gui, another webserver, etc.).
7375
* For `http` validation, port 80 on the internet side of the router should be forwarded to this container's port 80
7476
* For `dns` validation, make sure to enter your credentials into the corresponding ini (or json for some plugins) file under `/config/dns-conf`
@@ -79,20 +81,26 @@ The architectures supported by this image are:
7981
* If you need a dynamic dns provider, you can use the free provider duckdns.org where the `URL` will be `yoursubdomain.duckdns.org` and the `SUBDOMAINS` can be `www,ftp,cloud` with http validation, or `wildcard` with dns validation.
8082
* After setup, navigate to `https://yourdomain.url` to access the default homepage (http access through port 80 is disabled by default, you can enable it by editing the default site config at `/config/nginx/site-confs/default`).
8183
* Certs are checked nightly and if expiration is within 30 days, renewal is attempted. If your cert is about to expire in less than 30 days, check the logs under `/config/log/letsencrypt` to see why the renewals have been failing. It is recommended to input your e-mail in docker parameters so you receive expiration notices from Let's Encrypt in those circumstances.
84+
8285
### Security and password protection
86+
8387
* The container detects changes to url and subdomains, revokes existing certs and generates new ones during start.
8488
* Per [RFC7919](https://datatracker.ietf.org/doc/html/rfc7919), the container is shipping [ffdhe4096](https://ssl-config.mozilla.org/ffdhe4096.txt) as the `dhparams.pem`.
8589
* If you'd like to password protect your sites, you can use htpasswd. Run the following command on your host to generate the htpasswd file `docker exec -it swag htpasswd -c /config/nginx/.htpasswd <username>`
8690
* You can add multiple user:pass to `.htpasswd`. For the first user, use the above command, for others, use the above command without the `-c` flag, as it will force deletion of the existing `.htpasswd` and creation of a new one
8791
* You can also use ldap auth for security and access control. A sample, user configurable ldap.conf is provided, and it requires the separate image [linuxserver/ldap-auth](https://hub.docker.com/r/linuxserver/ldap-auth/) to communicate with an ldap server.
92+
8893
### Site config and reverse proxy
94+
8995
* The default site config resides at `/config/nginx/site-confs/default`. Feel free to modify this file, and you can add other conf files to this directory. However, if you delete the `default` file, a new default will be created on container start.
9096
* Preset reverse proxy config files are added for popular apps. See the `README.md` file under `/config/nginx/proxy_confs` for instructions on how to enable them. The preset confs reside in and get imported from [this repo](https://github.com/linuxserver/reverse-proxy-confs).
9197
* If you wish to hide your site from search engine crawlers, you may find it useful to add this configuration line to your site config, within the server block, above the line where ssl.conf is included
9298
`add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";`
9399
This will *ask* Google et al not to index and list your site. Be careful with this, as you will eventually be de-listed if you leave this line in on a site you wish to be present on search engines
94100
* If you wish to redirect http to https, you must expose port 80
101+
95102
### Using certs in other containers
103+
96104
* This container includes auto-generated pfx and private-fullchain-bundle pem certs that are needed by other apps like Emby and Znc.
97105
* To use these certs in other containers, do either of the following:
98106
1. *(Easier)* Mount the container's config folder in other containers (ie. `-v /path-to-le-config:/le-ssl`) and in the other containers, use the cert location `/le-ssl/keys/letsencrypt/`
@@ -101,7 +109,9 @@ This will *ask* Google et al not to index and list your site. Be careful with th
101109
1. `cert.pem`, `chain.pem`, `fullchain.pem` and `privkey.pem`, which are generated by Certbot and used by nginx and various other apps
102110
2. `privkey.pfx`, a format supported by Microsoft and commonly used by dotnet apps such as Emby Server (no password)
103111
3. `priv-fullchain-bundle.pem`, a pem cert that bundles the private key and the fullchain, used by apps like ZNC
112+
104113
### Using fail2ban
114+
105115
* This container includes fail2ban set up with 4 jails by default:
106116
1. nginx-http-auth
107117
2. nginx-badbots
@@ -113,7 +123,9 @@ This will *ask* Google et al not to index and list your site. Be careful with th
113123
* You can check the status of a specific jail via `docker exec -it swag fail2ban-client status <jail name>`
114124
* You can unban an IP via `docker exec -it swag fail2ban-client set <jail name> unbanip <IP>`
115125
* A list of commands can be found here: https://www.fail2ban.org/wiki/index.php/Commands
126+
116127
### Updating configs
128+
117129
* This container creates a number of configs for nginx, proxy samples, etc.
118130
* Config updates are noted in the changelog but not automatically applied to your files.
119131
* If you have modified a file with noted changes in the changelog:

readme-vars.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ app_setup_block: |
8888
> * If you don't want to or can't use the option `--remove-orphans`, then you can first do `docker-compose down`, then edit the compose yaml as above, and then issue `docker-compose up -d`
8989
9090
> Make sure to also update any references to this container by name. For instance, Nextcloud's `config.php` references this container in its `trusted_proxies` directive, which would have to be updated to `swag`.
91+
9192
### Validation and initial setup
93+
9294
* Before running this container, make sure that the url and subdomains are properly forwarded to this container's host, and that port 443 (and/or 80) is not being used by another service on the host (NAS gui, another webserver, etc.).
9395
* For `http` validation, port 80 on the internet side of the router should be forwarded to this container's port 80
9496
* For `dns` validation, make sure to enter your credentials into the corresponding ini (or json for some plugins) file under `/config/dns-conf`
@@ -99,20 +101,26 @@ app_setup_block: |
99101
* If you need a dynamic dns provider, you can use the free provider duckdns.org where the `URL` will be `yoursubdomain.duckdns.org` and the `SUBDOMAINS` can be `www,ftp,cloud` with http validation, or `wildcard` with dns validation.
100102
* After setup, navigate to `https://yourdomain.url` to access the default homepage (http access through port 80 is disabled by default, you can enable it by editing the default site config at `/config/nginx/site-confs/default`).
101103
* Certs are checked nightly and if expiration is within 30 days, renewal is attempted. If your cert is about to expire in less than 30 days, check the logs under `/config/log/letsencrypt` to see why the renewals have been failing. It is recommended to input your e-mail in docker parameters so you receive expiration notices from Let's Encrypt in those circumstances.
104+
102105
### Security and password protection
106+
103107
* The container detects changes to url and subdomains, revokes existing certs and generates new ones during start.
104108
* Per [RFC7919](https://datatracker.ietf.org/doc/html/rfc7919), the container is shipping [ffdhe4096](https://ssl-config.mozilla.org/ffdhe4096.txt) as the `dhparams.pem`.
105109
* If you'd like to password protect your sites, you can use htpasswd. Run the following command on your host to generate the htpasswd file `docker exec -it swag htpasswd -c /config/nginx/.htpasswd <username>`
106110
* You can add multiple user:pass to `.htpasswd`. For the first user, use the above command, for others, use the above command without the `-c` flag, as it will force deletion of the existing `.htpasswd` and creation of a new one
107111
* You can also use ldap auth for security and access control. A sample, user configurable ldap.conf is provided, and it requires the separate image [linuxserver/ldap-auth](https://hub.docker.com/r/linuxserver/ldap-auth/) to communicate with an ldap server.
112+
108113
### Site config and reverse proxy
114+
109115
* The default site config resides at `/config/nginx/site-confs/default`. Feel free to modify this file, and you can add other conf files to this directory. However, if you delete the `default` file, a new default will be created on container start.
110116
* Preset reverse proxy config files are added for popular apps. See the `README.md` file under `/config/nginx/proxy_confs` for instructions on how to enable them. The preset confs reside in and get imported from [this repo](https://github.com/linuxserver/reverse-proxy-confs).
111117
* If you wish to hide your site from search engine crawlers, you may find it useful to add this configuration line to your site config, within the server block, above the line where ssl.conf is included
112118
`add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";`
113119
This will *ask* Google et al not to index and list your site. Be careful with this, as you will eventually be de-listed if you leave this line in on a site you wish to be present on search engines
114120
* If you wish to redirect http to https, you must expose port 80
121+
115122
### Using certs in other containers
123+
116124
* This container includes auto-generated pfx and private-fullchain-bundle pem certs that are needed by other apps like Emby and Znc.
117125
* To use these certs in other containers, do either of the following:
118126
1. *(Easier)* Mount the container's config folder in other containers (ie. `-v /path-to-le-config:/le-ssl`) and in the other containers, use the cert location `/le-ssl/keys/letsencrypt/`
@@ -121,7 +129,9 @@ app_setup_block: |
121129
1. `cert.pem`, `chain.pem`, `fullchain.pem` and `privkey.pem`, which are generated by Certbot and used by nginx and various other apps
122130
2. `privkey.pfx`, a format supported by Microsoft and commonly used by dotnet apps such as Emby Server (no password)
123131
3. `priv-fullchain-bundle.pem`, a pem cert that bundles the private key and the fullchain, used by apps like ZNC
132+
124133
### Using fail2ban
134+
125135
* This container includes fail2ban set up with 4 jails by default:
126136
1. nginx-http-auth
127137
2. nginx-badbots
@@ -133,7 +143,9 @@ app_setup_block: |
133143
* You can check the status of a specific jail via `docker exec -it swag fail2ban-client status <jail name>`
134144
* You can unban an IP via `docker exec -it swag fail2ban-client set <jail name> unbanip <IP>`
135145
* A list of commands can be found here: https://www.fail2ban.org/wiki/index.php/Commands
146+
136147
### Updating configs
148+
137149
* This container creates a number of configs for nginx, proxy samples, etc.
138150
* Config updates are noted in the changelog but not automatically applied to your files.
139151
* If you have modified a file with noted changes in the changelog:

0 commit comments

Comments
 (0)