Skip to content

Commit ceb3c22

Browse files
12rambaumartinRenou
authored andcommitted
indentation issue in docs
1 parent 26b1cb4 commit ceb3c22

File tree

1 file changed

+82
-82
lines changed

1 file changed

+82
-82
lines changed

docs/source/deploy.rst

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ Customizing Voilà on Binder
8181
To specify different options (such as the theme and template), create a
8282
``jupyter_config.json`` file at the root of the repository with the following content:
8383

84-
.. code:: json
84+
.. code:: json
8585
86-
{
87-
"VoilaConfiguration": {
88-
"theme": "dark",
89-
"template": "gridstack"
90-
}
91-
}
86+
{
87+
"VoilaConfiguration": {
88+
"theme": "dark",
89+
"template": "gridstack"
90+
}
91+
}
9292
9393
9494
An example can be found in the
@@ -224,96 +224,96 @@ Steps
224224

225225
1. SSH into the server:
226226

227-
.. code:: text
227+
.. code:: text
228228
229-
ssh ubuntu@<ip-address>
229+
ssh ubuntu@<ip-address>
230230
231231
2. Install nginx:
232232

233-
.. code:: text
233+
.. code:: text
234234
235-
sudo apt install nginx
235+
sudo apt install nginx
236236
237237
3. To check that ``nginx`` is correctly installed:
238238

239-
.. code:: text
239+
.. code:: text
240240
241-
sudo systemctl status nginx
241+
sudo systemctl status nginx
242242
243243
4. Create the file ``/etc/nginx/sites-enabled/yourdomain.com`` with the following content:
244244

245-
.. code:: text
245+
.. code:: text
246246
247-
server {
248-
listen 80;
249-
server_name yourdomain.com;
250-
proxy_buffering off;
251-
location / {
252-
proxy_pass http://localhost:8866;
253-
proxy_set_header Host $host;
254-
proxy_set_header X-Real-IP $remote_addr;
255-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
256-
257-
proxy_http_version 1.1;
258-
proxy_set_header Upgrade $http_upgrade;
259-
proxy_set_header Connection "upgrade";
260-
proxy_read_timeout 86400;
261-
}
262-
263-
client_max_body_size 100M;
264-
error_log /var/log/nginx/error.log;
265-
}
247+
server {
248+
listen 80;
249+
server_name yourdomain.com;
250+
proxy_buffering off;
251+
location / {
252+
proxy_pass http://localhost:8866;
253+
proxy_set_header Host $host;
254+
proxy_set_header X-Real-IP $remote_addr;
255+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
256+
257+
proxy_http_version 1.1;
258+
proxy_set_header Upgrade $http_upgrade;
259+
proxy_set_header Connection "upgrade";
260+
proxy_read_timeout 86400;
261+
}
262+
263+
client_max_body_size 100M;
264+
error_log /var/log/nginx/error.log;
265+
}
266266
267267
5. Enable and start the ``nginx`` service:
268268

269-
.. code:: text
269+
.. code:: text
270270
271-
sudo systemctl enable nginx.service
272-
sudo systemctl start nginx.service
271+
sudo systemctl enable nginx.service
272+
sudo systemctl start nginx.service
273273
274274
6. Install pip:
275275

276-
.. code:: text
276+
.. code:: text
277277
278-
sudo apt update && sudo apt install python3-pip
278+
sudo apt update && sudo apt install python3-pip
279279
280280
7. Follow the instructions in `Setup an example project`_, and install the dependencies:
281281

282-
.. code:: text
283-
284-
sudo python3 -m pip install -r requirements.txt
285-
286-
8. Create a new systemd service for running Voilà in ``/usr/lib/systemd/system/voila.service``.
287-
The service will ensure Voilà is automatically restarted on startup:
282+
.. code:: text
288283
289-
.. code:: text
284+
sudo python3 -m pip install -r requirements.txt
290285
291-
[Unit]
292-
Description=Voila
286+
8. Create a new systemd service for running Voilà in ``/usr/lib/systemd/system/voila.service``. The service will ensure Voilà is automatically restarted on startup:
293287

294-
[Service]
295-
Type=simple
296-
PIDFile=/run/voila.pid
297-
ExecStart=voila --no-browser voila/notebooks/basics.ipynb
298-
User=ubuntu
299-
WorkingDirectory=/home/ubuntu/
300-
Restart=always
301-
RestartSec=10
288+
.. code:: text
302289
303-
[Install]
304-
WantedBy=multi-user.target
290+
[Unit]
291+
Description=Voila
292+
293+
[Service]
294+
Type=simple
295+
PIDFile=/run/voila.pid
296+
ExecStart=voila --no-browser voila/notebooks/basics.ipynb
297+
User=ubuntu
298+
WorkingDirectory=/home/ubuntu/
299+
Restart=always
300+
RestartSec=10
301+
302+
[Install]
303+
WantedBy=multi-user.target
305304
306305
In this example Voilà is started with ``voila --no-browser voila/notebooks/basics.ipynb`` to serve a single notebook.
307306
You can edit the command to change this behavior and the notebooks Voilà is serving.
308307

309308
9. Enable and start the ``voila`` service:
310309

311-
.. code:: text
310+
.. code:: text
312311
313-
sudo systemctl enable voila.service
314-
sudo systemctl start voila.service
312+
sudo systemctl enable voila.service
313+
sudo systemctl start voila.service
315314
316315
.. note::
316+
317317
To check the logs for Voilà:
318318

319319
.. code:: text
@@ -328,45 +328,45 @@ Enable HTTPS with Let's Encrypt
328328

329329
1. Install ``certbot``:
330330

331-
.. code:: text
331+
.. code:: text
332332
333-
sudo add-apt-repository ppa:certbot/certbot
334-
sudo apt update
335-
sudo apt install python-certbot-nginx
333+
sudo add-apt-repository ppa:certbot/certbot
334+
sudo apt update
335+
sudo apt install python-certbot-nginx
336336
337337
2. Obtain the certificates from Let's Encrypt. The ``--nginx`` flag will edit the nginx configuration automatically:
338338

339-
.. code:: text
340-
341-
sudo certbot --nginx -d yourdomain.com
339+
.. code:: text
340+
341+
sudo certbot --nginx -d yourdomain.com
342342
343343
3. ``/etc/nginx/sites-enabled/yourdomain.com`` should now contain a few more entries:
344344

345-
.. code :: text
346-
347-
$ cat /etc/nginx/sites-enabled/yourdomain.com
345+
.. code :: text
348346
349-
...
350-
listen 443 ssl; # managed by Certbot
351-
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem; # managed by Certbot
352-
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem; # managed by Certbot
353-
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
354-
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
355-
...
347+
$ cat /etc/nginx/sites-enabled/yourdomain.com
348+
349+
...
350+
listen 443 ssl; # managed by Certbot
351+
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem; # managed by Certbot
352+
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem; # managed by Certbot
353+
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
354+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
355+
...
356356
357357
4. Visit ``yourdomain.com`` to access the Voilà applications over HTTPS.
358358

359359
5. To automatically renew the certificates (they expire after 90 days), open the ``crontab`` file:
360360

361-
.. code :: text
361+
.. code :: text
362362
363-
crontab -e
363+
crontab -e
364364
365-
And add the following line:
365+
And add the following line:
366366

367-
.. code :: text
367+
.. code :: text
368368
369-
0 12 * * * /usr/bin/certbot renew --quiet
369+
0 12 * * * /usr/bin/certbot renew --quiet
370370
371371
For more information, you can also follow `the guide on the nginx blog <https://www.nginx.com/blog/using-free-ssltls-certificates-from-lets-encrypt-with-nginx/>`__.
372372

0 commit comments

Comments
 (0)