Skip to content

Commit b131bb2

Browse files
committed
chore: Fix various file formatting problems
1 parent 81a5975 commit b131bb2

File tree

7 files changed

+54
-53
lines changed

7 files changed

+54
-53
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bin/build_docs
2929
bin/serve_docs
3030
```
3131
## Setup Frontend step by step
32-
```
32+
```
3333
clone the repository
3434
pip install -r requirements/development.txt
3535
bin/build_docs

bin/watch

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python3
22
import datetime
3-
import os
43
import subprocess
54

65
from inotify.adapters import InotifyTree
@@ -38,7 +37,11 @@ def watch_for_changes(debug=False):
3837
ignore = True
3938
break
4039

41-
if filename.endswith(".swx") or filename.endswith(".swp") or filename.endswith("~"):
40+
if (
41+
filename.endswith(".swx")
42+
or filename.endswith(".swp")
43+
or filename.endswith("~")
44+
):
4245
ignore = True
4346

4447
if ignore:

docs/about-hypernode/support/what-to-expect-from-hipex-support.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Please use [support@hipex.io](mailto:support@hipex.io) for all your questions/pr
1313

1414

1515
## Can I reach Hipex by phone?
16-
Yes, you can during office hours you can call us at +31(0)85-888 77 54.
16+
Yes, you can during office hours you can call us at +31(0)85-888 77 54.
1717

1818
# Outside office hours
1919
It's after business hours and I have an emergency, what should I do?
@@ -23,13 +23,13 @@ An urgent matter is for example:
2323
- customers can't place any orders
2424

2525

26-
## Step 1 Use your mail that is known in Pack and send us a ticket to spoed@hipex.io
26+
## Step 1 Use your mail that is known in Pack and send us a ticket to spoed@hipex.io
2727
Don't forget to mention:
2828

2929
- name of the server or your domain
3030
- an extensive description of your problem
3131

32-
Please know if you don't use the correct mail adress, your ticket won't be follow up as the system doesn't recogonize.
32+
Please know if you don't use the correct mail adress, your ticket won't be follow up as the system doesn't recogonize.
3333

3434
## Step 2 The Request is Sent to the On Duty Hero
3535
As soon as you report the disruption via one of the designated channels, an alert is sent via PagerDuty to the HERO (Hypernode/Hipex Emergency Request Operative) team. One of our heroes will confirm receipt of the urgent ticket.
@@ -46,4 +46,3 @@ Upon resolving the issue, the Hero will issue a debrief to the Support Departmen
4646

4747
# Hipex knowledge base
4848
Till further notice [Hipex knowledge base](https://www.hipex.io/docs/nl/) will exist. Eventually we will integrate both Hypernode and [Hipex knowledge base](https://www.hipex.io/docs/nl/) together.
49-

docs/ecommerce-applications/magento-2/how-to-configure-varnish-for-magento-2-x.md

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<!-- source: https://support.hypernode.com/en/ecommerce/magento-2/how-to-configure-varnish-for-magento-2-x -->
2+
23
# How to Configure Varnish for Magento 2.x
34

45
Customers with Hypernode Pelican, Falcon (formerly known as Professional) and Eagle (formerly known as Excellence plans can use Varnish to boost their Magento shop. This article explains how you can configure Varnish 4 or 6 for your Hypernode. If you want to know which Varnish version you need to configure, please check the [Magento documentation](https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html) first. Do you have a Magento 1 shop, please check [this article](https://support.hypernode.com/knowledgebase/varnish-on-magento1/).
56

67
Although Varnish is extremely awesome when it get's to speeding up websites, Varnish is a complex technique that needs some experience to set it up. Don't implement varnish on production nodes without testing Varnish first on a [development node](https://support.hypernode.com/knowledgebase/development-plans-for-your-magento-shop/) or the [Hypernode Docker](https://support.hypernode.com/en/best-practices/testing/hypernode-docker).
78

8-
9-
Enable Varnish 4.0 or 6.0 for Magento 2.x
10-
-----------------------------------------
9+
## Enable Varnish 4.0 or 6.0 for Magento 2.x
1110

1211
As Magento 2 supports Varnish out of the box, there is no need for the turpentine extension anymore in Magento 2. Simply follow the steps below to configure Varnish 4.0 or 6.0 for Magento 2.
1312

@@ -18,6 +17,7 @@ $ hypernode-systemctl settings varnish_version 4.0
1817
```
1918

2019
**Or if you want to switch to Varnish 6.0**
20+
2121
```console
2222
$ hypernode-systemctl settings varnish_version 6.0
2323
```
@@ -30,39 +30,37 @@ $ hypernode-systemctl settings varnish_enabled true
3030

3131
**Enable Varnish via the [Service Panel](https://service.byte.nl/)**
3232

33-
* Log in on the Service Panel
34-
* Go to the tab "Instellingen"
35-
* Click on "Varnish"
36-
* Use the switch to enable Varnish
33+
- Log in on the Service Panel
34+
- Go to the tab "Instellingen"
35+
- Click on "Varnish"
36+
- Use the switch to enable Varnish
3737

3838
**Enable Varnish via the [Control Panel](https://auth.hypernode.com/)**
3939

40-
* Click on "Hypernodes"
41-
* Click on "Caching"
42-
* Select the Hypernode
43-
* Click on "Enable Varnish"
40+
- Click on "Hypernodes"
41+
- Click on "Caching"
42+
- Select the Hypernode
43+
- Click on "Enable Varnish"
4444

45-
Configure Varnish on the Vhost
46-
------------------------------
45+
## Configure Varnish on the Vhost
4746

48-
Since the introduction of **[hypernode-manage-vhosts](https://changelog.hypernode.com/changelog/release-7166-hypernode-manage-vhosts-enabled-by-default/)**Hypernode may work somewhat different than you might be used to. With HMV enabled, it requires one more step to configure Varnish for your shop/vhost. Remember, for each domain, there should be a vhost created. You can list an overview of all configured vhosts with `hypernode-manage-vhosts --list`. While you do that, note that there is a column, "varnish". By default this is set to "False". Which means that Varnish isn't configured for this vhost. You can configure Varnish for the vhost by running the following command:
47+
Since the introduction of \*\*[hypernode-manage-vhosts](https://changelog.hypernode.com/changelog/release-7166-hypernode-manage-vhosts-enabled-by-default/)\*\*Hypernode may work somewhat different than you might be used to. With HMV enabled, it requires one more step to configure Varnish for your shop/vhost. Remember, for each domain, there should be a vhost created. You can list an overview of all configured vhosts with `hypernode-manage-vhosts --list`. While you do that, note that there is a column, "varnish". By default this is set to "False". Which means that Varnish isn't configured for this vhost. You can configure Varnish for the vhost by running the following command:
4948

5049
```console
5150
$ hypernode-manage-vhosts EXAMPLE.COM --varnish
5251
```
5352

54-
Configure Magento 2.x for Varnish
55-
---------------------------------
53+
## Configure Magento 2.x for Varnish
5654

57-
* Log in to the Magento Admin/Backend as an administrator.
58-
* Navigate to **Stores > Configuration > Advanced > System > Full Page Cache**
59-
* From the **Caching Application** list, click `Varnish Caching`
60-
* Enter a TTL value
61-
* Expand Varnish Configuration and insert the correct information:
62-
+ `Backend Host`: 127.0.0.1
63-
+ `Backend Port`: 8080
64-
* Save your VCL by clicking the button **`Save config`** in the top right
65-
* Click *Export VCL for Varnish 4 or *Export VCL for Varnish 6**
55+
- Log in to the Magento Admin/Backend as an administrator.
56+
- Navigate to **Stores > Configuration > Advanced > System > Full Page Cache**
57+
- From the **Caching Application** list, click `Varnish Caching`
58+
- Enter a TTL value
59+
- Expand Varnish Configuration and insert the correct information:
60+
- `Backend Host`: 127.0.0.1
61+
- `Backend Port`: 8080
62+
- Save your VCL by clicking the button **`Save config`** in the top right
63+
- Click *Export VCL for Varnish 4 or *Export VCL for Varnish 6**
6664

6765
### Configure Your Backend Servers Through the Commandline
6866

@@ -112,15 +110,15 @@ backend default {
112110

113111
Make sure you change this to the aforementioned configuration (without the health_check probe), since this will break on our Nginx configuration and will therefore result in a `503 Guru Meditation` error.
114112

115-
Import Your VCL into the Varnish Daemon
116-
---------------------------------------
113+
## Import Your VCL into the Varnish Daemon
117114

118115
Import your VCL into Varnish and save as `mag2`:
119116

120117
```console
121118
$ varnishadm vcl.load mag2 /data/web/default.vcl
122119

123120
```
121+
124122
The output should say: *your VCL is compiled*. If you receive a `Permission denied` error, and have recently activated Varnish, please close all ssh sessions, and log back in to reload your new permissions.
125123

126124
Now tell Varnish to activate the loaded VCL:
@@ -129,6 +127,7 @@ Now tell Varnish to activate the loaded VCL:
129127
$ varnishadm vcl.use mag2
130128

131129
```
130+
132131
In the examples we used the name ‘mag2’ for our VCL, but you can use any name you prefer.
133132

134133
### Test if the Correct VCL is Uploaded
@@ -138,16 +137,16 @@ List all VCL’s with the following command:
138137
```console
139138
$ varnishadm vcl.list
140139
```
140+
141141
The VCL you just imported and activated should have the status `active`. If all went well, varnish is now functioning with a working VCL.
142142

143143
### The "Boot" profile
144144

145-
To make sure your .vcl stays active even after a restart of Varnish we run a script every 5 minutes which saves the running config to /data/var/varnish/default.vcl which will be used once Varnish restarts. the "boot" profile will check what the last running .vcl was, and use that config in the "boot" profile. 
145+
To make sure your .vcl stays active even after a restart of Varnish we run a script every 5 minutes which saves the running config to /data/var/varnish/default.vcl which will be used once Varnish restarts. the "boot" profile will check what the last running .vcl was, and use that config in the "boot" profile.
146146

147147
This will mean that your loaded .vcl profile won't be existing the next time you'll look,  and that your own .vcl profile is renamed to "boot". This is expected behaviour.
148148

149-
Flush Your Varnish Cache When Using Magento 2
150-
---------------------------------------------
149+
## Flush Your Varnish Cache When Using Magento 2
151150

152151
To flush the Varnish cache of your Magento store on the command line you can use `/data/web/magento2/bin/magento cache:flush full_page` This will purge the Varnish cache of the local Varnish instance.
153152

@@ -156,18 +155,18 @@ Additionally you can flush your cache through the Magento admin backend or use `
156155
```console
157156
$ varnishadm "ban req.url ~ ."
158157
```
158+
159159
Or if you want to flush the cache for a single domain in a multisite setup:
160160

161161
```console
162162
$ varnishadm "ban req.http.host == example.com"
163163
```
164-
Warming Your Cache
165-
------------------
164+
165+
## Warming Your Cache
166166

167167
Magento 2 doesn't need to use turpentine anymore, so we can't use the cache crawler provided with turpentine. As an alternative you can use an extension to warm your cache or the cache warmers we provided on our Github account, [here](https://gist.github.com/hn-support/60016f4b7986ad2cce693bdf2f3501b4) and [here](https://gist.github.com/hn-support/bc7cc401e3603a848a4dec4b18f3a78d).
168168

169-
Enable Debug Headers
170-
--------------------
169+
## Enable Debug Headers
171170

172171
If you are implementing Varnish on Magento 2, you might want to view some caching headers that indicate whether the page is cacheable or not. To do this, put your Magento install in `Developer mode`. Now if you request a page through curl, you can see the `X-Magento-Cache-Debug` header:
173172

@@ -183,15 +182,13 @@ X-Magento-Cache-Control: max-age=86400, public, s-maxage=86400
183182
X-Magento-Cache-Debug: MISS
184183
```
185184

186-
VCL Tip
187-
-------
185+
## VCL Tip
188186

189-
In our experience the by default generated .vcl from your Magento backend often doesn't work very well. You can check this for example by running `varnishhist`, this will show you a graph with the HITS, (`|`) and MISSES (`#`). So if you're seeing a lot of MISSES (`#`) you could use **[this .vcl](https://gist.github.com/hn-support/f4d29af73d76d0f7879a2fa9d10d8411)**. We found out that this .vcl is often performing quite well. 
187+
In our experience the by default generated .vcl from your Magento backend often doesn't work very well. You can check this for example by running `varnishhist`, this will show you a graph with the HITS, (`|`) and MISSES (`#`). So if you're seeing a lot of MISSES (`#`) you could use **[this .vcl](https://gist.github.com/hn-support/f4d29af73d76d0f7879a2fa9d10d8411)**. We found out that this .vcl is often performing quite well.
190188

191-
****please note that this is just another standard .vcl, if this doesn't work either or you have specific requirements you should contact a Varnish implementation specialist.** 
189+
\*\***please note that this is just another standard .vcl, if this doesn't work either or you have specific requirements you should contact a Varnish implementation specialist.**
192190

193-
Troubleshooting
194-
---------------
191+
## Troubleshooting
195192

196193
- If you are receiving `Permission denied` errors while running `varnishadm` or other Varnish CLI commands, and you have just activated Varnish, close any existing ssh sessions, and log back in to reload your updated permissions.
197194
- If your Varnish setup is not working over SSL, check [this article](https://support.hypernode.com/en/hypernode/ssl/how-to-use-ssl-certificates-on-your-hypernode-when-ordered-via-byte-nl#Redirecting-to-HTTPS-When-Using-Varnish)
@@ -214,8 +211,8 @@ proxy_busy_buffers_size 256k;
214211

215212
### 503 Errors
216213

217-
* There is a bug when Varnish is activated on Magento 2.2.0, resulting in a "503 backend fetch" error. Please see Magento Github issue [10165](https://github.com/magento/magento2/issues/10165). For now, we advise you to either wait with upgrading to Magento 2.2.0 when using Varnish until this bug is fixed or use an adjusted .vcl as a temporary workaround:
218-
* In Magento 2.4.x (and possibly earlier versions as well) a solution could be to disable the **product_identities_extender** plugin. This is a default Magento plugin which doesn't seem to work properly with Varnish enabled. All credit for this solution goes to [Tree of Information](https://www.treeofinformation.nl/) whom have spend a long time investigting this issue.
214+
- There is a bug when Varnish is activated on Magento 2.2.0, resulting in a "503 backend fetch" error. Please see Magento Github issue [10165](https://github.com/magento/magento2/issues/10165). For now, we advise you to either wait with upgrading to Magento 2.2.0 when using Varnish until this bug is fixed or use an adjusted .vcl as a temporary workaround:
215+
- In Magento 2.4.x (and possibly earlier versions as well) a solution could be to disable the **product_identities_extender** plugin. This is a default Magento plugin which doesn't seem to work properly with Varnish enabled. All credit for this solution goes to [Tree of Information](https://www.treeofinformation.nl/) whom have spend a long time investigting this issue.
219216

220217
### Restart Varnish
221218

docs/ecommerce-applications/shopware-6/admin-loop-in-shopware-6-when-basic-auth-is-used.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ Shopware uses OAuth with a bearer token for logging into the admin and using the
88
The solution is to whitelist your IP to skip the basic auth on the Hypernode when you come from your specified IP.
99

1010
```nginx
11-
$ cat /data/web/nginx/whitelist-development-exception.conf
11+
$ cat /data/web/nginx/whitelist-development-exception.conf
1212
# You can make certain IP addresses exempt here from the development
1313
# basic auth. Beware though, that google and bing bots will always
1414
# remain blocked on development nodes!
1515
1616
geo $development_exceptions {
1717
default "Development restricted area";
1818
# The IP that you want to access the Shopware 6 admin from
19-
127.0.0.1 "off";
19+
127.0.0.1 "off";
2020
}
2121
```

docs/hypernode-platform/tools/what-kind-of-request-is-my-hypernode-serving.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ There are a few handy helpers you can use on Hypernode to get a quick overview o
77

88
Shows you the top requests from the latest `/var/log/nginx/access.log`
99
```bash
10-
app@levkc9-yourappname-magweb-cmbs:~$ mostreqs
10+
app@levkc9-yourappname-magweb-cmbs:~$ mostreqs
1111
20 "GET / HTTP/1.1"
1212
6 "GET /wp-login.php HTTP/1.1"
1313
3 "GET /favicon.ico HTTP/1.1"
@@ -18,7 +18,7 @@ alias mostreqs='grep phpfpm /var/log/nginx/access.log | jq .request | sus | tail
1818

1919
Shows you a live view of the requests that are currently landing in NGINX
2020
```bash
21-
app@levkc9-yourappname-magweb-cmbs:~$ livereqs
21+
app@levkc9-yourappname-magweb-cmbs:~$ livereqs
2222
1.2.3.4 NL 2021-12-06T14:27:08+00:00 GET / HTTP/1.1 301 Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
2323
alias livereqs='tal|pnl --fields ip,country,handler,remote_user,date,req,status,user_agent'
2424
```

hypernode/downloader/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import List, Optional, Tuple
88
from urllib.parse import urlparse
99

10+
import mdformat
1011
import requests
1112
from bs4 import BeautifulSoup
1213
from markdownify import markdownify as md
@@ -180,6 +181,7 @@ def convert_document(
180181
f"# {article_heading}\n"
181182
f"{article_body_markdown}"
182183
)
184+
document_contents = mdformat.text(document_contents)
183185

184186
filepath = output_dir.joinpath(filename)
185187

0 commit comments

Comments
 (0)