aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content/weblog/2018-08-03_how-to-break-and-repair-pip/index.es.md2
-rw-r--r--content/weblog/2018-08-03_how-to-break-and-repair-pip/index.ru.md2
-rw-r--r--content/weblog/2018-08-12_ssl-with-lets-encrypt/index.es.md141
-rw-r--r--content/weblog/2018-08-12_ssl-with-lets-encrypt/index.md141
-rw-r--r--content/weblog/2018-08-12_ssl-with-lets-encrypt/index.ru.md139
5 files changed, 423 insertions, 2 deletions
diff --git a/content/weblog/2018-08-03_how-to-break-and-repair-pip/index.es.md b/content/weblog/2018-08-03_how-to-break-and-repair-pip/index.es.md
index 6458da7..b7d9642 100644
--- a/content/weblog/2018-08-03_how-to-break-and-repair-pip/index.es.md
+++ b/content/weblog/2018-08-03_how-to-break-and-repair-pip/index.es.md
@@ -1,5 +1,5 @@
+++
-title = "How to break pip, and how to repair it..."
+title = "Como romper pip, y como repararlo"
date = 2018-08-03T22:00:00Z
+++
diff --git a/content/weblog/2018-08-03_how-to-break-and-repair-pip/index.ru.md b/content/weblog/2018-08-03_how-to-break-and-repair-pip/index.ru.md
index 0a62d75..b4e0dac 100644
--- a/content/weblog/2018-08-03_how-to-break-and-repair-pip/index.ru.md
+++ b/content/weblog/2018-08-03_how-to-break-and-repair-pip/index.ru.md
@@ -1,5 +1,5 @@
+++
-title = "How to break pip, and how to repair it..."
+title = "Как сломать pip, и как его починить"
date = 2018-08-03T22:00:00Z
+++
diff --git a/content/weblog/2018-08-12_ssl-with-lets-encrypt/index.es.md b/content/weblog/2018-08-12_ssl-with-lets-encrypt/index.es.md
new file mode 100644
index 0000000..500cf35
--- /dev/null
+++ b/content/weblog/2018-08-12_ssl-with-lets-encrypt/index.es.md
@@ -0,0 +1,141 @@
++++
+title = "SSL en tu sitio fácil y gratis con Let's Encrypt"
+date = 2018-08-12T22:28:00Z
++++
+
+Es bien sabido en esta época que la seguridad es una parte importante de
+desarrollo web, y no solamente. Y como olvidar ese suculento SEO de Google, que
+da prioridad a sitios que usan https en lugar del antiguo http (Aunque para ser
+sincero me da igual Google, sin embargo mis clientes y la mayoría de los que
+lleguen a leer esto si le dan importancia)
+
+<!-- more -->
+
+Quieres agregarle SSL a tu sitio, pero vaya, que esos certificados cuestan
+dinero. Ah, pero he ahí donde estás equivocado (A menos que ya sepas a cerca de
+Let's Encrypt y simplemente hayas entrado a leer este tutorial para saber como
+generar un certificado. En dado caso sinceramente pido perdón por esta patética
+introducción).
+
+En esta guía detallaré los pasos para adquirir un certificado SSL de Let's
+Encrypt con Certbot en un servidor con nginx. Instalaré Certbot en un servidor
+Debian Stretch, si usas otra distro de Linux (o BSD, etc.) es probable que
+necesites usar otro comando para instalarlo.
+
+Primero instalamos Certbot
+
+```
+# apt-get install certbot
+```
+
+Antes de podar instalar certificados, necesitamos configurar nginx para ello.
+Podemos modificar la configuración por defecto para ello. Necesitamos hacer
+esto para que el servidor de Let's Encrypt puede leer el archivo de "desafío"
+para verificar que en efecto el(los) dominio(s) nos pertenece(n).
+
+```nginx
+server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+
+ server_name _;
+
+ # This is so that Let's Encrypt can look for the challenge
+ location /.well-known/acme-challenge/ {
+ root /var/www/html/;
+ default_type text/plain;
+ }
+
+ # The rest of your configuration...
+}
+```
+
+Una vez editado el archivo de configuración necesitamos reiniciar nginx.
+
+```
+# sudo systemctl restart nginx
+```
+
+Después de reiniciar nginx podemos proceder con la instalación del certificado.
+En mi caso necesito el certificado para múltiples subdominios, por lo tanto los
+agregaré usando la opción -d para cada uno de ellos en mi lista de argumentos
+como en el ejemplo siguiente
+
+```
+# certbot certonly --webroot -w /var/www/html -d www.example.com -d example.com
+```
+
+Durante el proceso de generación de certificados Certbot te pedirá tu correo
+electrónico. Let's Encrypt enviará notificaciones a el cuando el certificado
+esté a punto de expirar, sin embargo Certbot se encargará de renovarlos antes
+de que expiren automáticamente.
+
+Con esto nuestros certificados están instalados en el servidor y listos para
+ser usados. Lo último que queda por hacer es configurar nginx para que use los
+certificados y redirija de http a https. En las variables `ssl_certificate`
+`ssl_certificate_key` ponemos la dirección en el sistema de archivos de nuestro
+certificado y nuestra llave publica.
+
+```nginx
+server {
+ listen 80;
+ listen [::]:80;
+ server_name www.example.com;
+ return 301 https://$host$request_uri;
+}
+
+server {
+ listen 443 ssl;
+
+ server_name www.example.com;
+ ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
+ ssl_certificate_key /path/to/key/www.example.com/privkey.pem;
+ location /static/ {
+ alias /home/webuser/mysite/static/;
+ }
+ location /media/ {
+ alias /home/webuser/mysite/media/;
+ }
+ location / {
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $http_host;
+ proxy_redirect off;
+ proxy_pass http://127.0.0.1:8001;
+ }
+}
+```
+
+Un contra de redirigir a https automáticamente es que los exploradores antiguos
+que no son compatibles con https no podrán abrir el sitio web. Pero vaya, que
+estamos en 2018, no deberíamos de preocuparnos por exploradores de hace 10 y
+más años.
+
+Para más información acerca de Certbot:
+[https://certbot.eff.org/docs/using.html](https://certbot.eff.org/docs/using.html)
+
+Actualización (2018/11/02): Hace un tiempo en 2018, Let's Encrypt agregó la posibilidad de generar un certificado "universal" para todos los subdominios (por ejemplo, *.example.com).
+
+Para generar dicho certificado, primero necesitamos descargar la última versión de certbot del repositorio oficial de git
+
+```sh
+$ git clone https://github.com/certbot/certbot.git
+```
+
+Después entramos al directorio "certbot" y ejecutamos
+
+```sh
+$ ./certbot-auto certonly --manual \
+> --preferred-challenges=dns \
+> --email email@example.com \
+> --server https://acme-v02.api.letsencrypt.org/directory \
+> --agree-tos \
+> -d *.example.com
+```
+
+Certbot te presentará con un "desafío" de DNS en el que tendrás que agregar una
+entrada de tipo TXT a la configuración de tu dominio, ya que este tipo de
+certificados sólo funciona con el "reto" de dns. Asegúrate de que tu
+configuración de DNS ya esté actualizada antes presionar "Enter".
+
+También ten en cuenta que actualmente no es posible renovar automáticamente
+certificados de este tipo.
diff --git a/content/weblog/2018-08-12_ssl-with-lets-encrypt/index.md b/content/weblog/2018-08-12_ssl-with-lets-encrypt/index.md
new file mode 100644
index 0000000..e3075e7
--- /dev/null
+++ b/content/weblog/2018-08-12_ssl-with-lets-encrypt/index.md
@@ -0,0 +1,141 @@
++++
+title = "Free and easy SSL with Let's Encrypt"
+date = 2018-08-12T22:28:00Z
++++
+
+We all know that in this day and age security is an important factor when
+developing sites, and not only. Also let's not forget about that sweet Google
+SEO which rewards sites which use https instead of the old http (Although I
+couldn't care less about Google, however some people I might work with do, and
+I bet most of you reading also care).
+
+<!-- more -->
+
+You might want to add SSL to your site, but, you might think, those SSL certs cost
+money, and they ain't exactly cheap. And that's where you are wrong my friend
+(unless you already knew about Let's Encrypt and are only reading this to learn
+how to generate a certificate, in that case I apologize for the cringe
+introduction).
+
+Here I will be detailing the steps to acquire an SSL certificate with Let's
+Encrypt using Certbot, with nginx. I will be installing Certbot on a Debian
+Stretch server, so you might need to input a different command depending on the
+distro or OS you are using.
+
+First we need to install Certbot
+
+```
+# apt-get install certbot
+```
+
+Before we can install the certificates, we need to configure nginx for
+certficate installation and renewal. We can set the default server
+configuration on nginx for that. We need to do this so that Let's Encrypt's
+server can read the challenge generated by Certbot and verify that we indeed
+own the domain(s) for which we want to make the certificate.
+
+```nginx
+server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+
+ server_name _;
+
+ # This is so that Let's Encrypt can look for the challenge
+ location /.well-known/acme-challenge/ {
+ root /var/www/html/;
+ default_type text/plain;
+ }
+
+ # The rest of your configuration...
+}
+```
+
+Once we have edited the default configuration file, we need to restart nginx.
+
+```
+# sudo systemctl restart nginx
+```
+
+After that we can get started installing the certificate. I wanted to get a
+certificate for more than subdomain, so I added them using the -d flag to my
+list of arguments like in the following example
+
+```
+# certbot certonly --webroot -w /var/www/html -d www.example.com -d example.com
+```
+
+It will ask your email for renew notifications, although certbot should renew
+your certificates automatically before expiration.
+
+That's it, you should already have the new certificate and keys on your server.
+Now you can go ahead and configure nginx to accept https connections and
+redirect plain old insecure http requests to https. You should also put the
+correct path for your certificate and public key under `ssl_certificate` and
+`ssl_certificate_key` respectively.
+
+```nginx
+server {
+ listen 80;
+ listen [::]:80;
+ server_name www.example.com;
+ return 301 https://$host$request_uri;
+}
+
+server {
+ listen 443 ssl;
+
+ server_name www.example.com;
+ ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
+ ssl_certificate_key /path/to/key/www.example.com/privkey.pem;
+ location /static/ {
+ alias /home/webuser/mysite/static/;
+ }
+ location /media/ {
+ alias /home/webuser/mysite/media/;
+ }
+ location / {
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $http_host;
+ proxy_redirect off;
+ proxy_pass http://127.0.0.1:8001;
+ }
+}
+```
+
+The downside of automatically redirecting http requests to https is that old
+browsers that don't support https won't be able to open your site. But come on,
+it's 2018, who cares about 10+ year old software. Even if you are running
+really old hardware there definitely is some modern free software that runs on
+that hardware.
+
+For more information on Certbot:
+[https://certbot.eff.org/docs/using.html](https://certbot.eff.org/docs/using.html)
+
+Update (2018/11/02): Sometime in 2018 Let's Encrypt added the possibility to
+generate a wildcard SSL certificate (e.g. *.example.com).
+
+To generate such a certificate we will need to download certbot from the git
+repository
+
+```sh
+$ git clone https://github.com/certbot/certbot.git
+```
+
+Then we cd into certbot and run
+
+```sh
+$ ./certbot-auto certonly --manual \
+> --preferred-challenges=dns \
+> --email email@example.com \
+> --server https://acme-v02.api.letsencrypt.org/directory \
+> --agree-tos \
+> -d *.example.com
+```
+
+For this you will need to add a TXT record to the DNS settings of your domain,
+since this only works using the dns challenge. Before pressing enter make sure
+that your record has been deployed.
+
+Do keep in mind that it's not currently possible to renew this kind of
+certificate automatically.
diff --git a/content/weblog/2018-08-12_ssl-with-lets-encrypt/index.ru.md b/content/weblog/2018-08-12_ssl-with-lets-encrypt/index.ru.md
new file mode 100644
index 0000000..c041641
--- /dev/null
+++ b/content/weblog/2018-08-12_ssl-with-lets-encrypt/index.ru.md
@@ -0,0 +1,139 @@
++++
+title = "Легкий и халявный SSL с Let's Encrypt"
+date = 2018-08-12T22:28:00Z
++++
+
+Всем нам известно насколько важна безопасность в веб-разработке, и не только в
+вебе. И не надо забыть про тот самый SEO Google который повышает рейтинг сайтов
+которые работают с https вместо старого доброго http. (Хоть мне плевать на
+Google, но мои клиенты так не думают, также как основная часть аудитории этой
+статьи)
+
+<!-- more -->
+
+Возможно вы давно хотели добавить SSL сертификат для своего сайта или сервиса,
+но чувак, они же деньги стоят! А вот вы ошибаетесь (Если вы уже знали про Let's
+Encrypt, то прощу прошение за такое бесполезное введение).
+
+В этом туториале я коротко объясню как сгенерировать сертификат SSL с Let's
+Encrypt с помощью Certbot используя nginx. В моем случае я его устанавливал на
+Debian Stretch, комманда для установки Certbot может отличатся для вас в
+зависимости от вашей ОСи.
+
+Перед тем как начать, устанавливаем
+
+```
+# apt-get install certbot
+```
+
+До того как мы сможем установить сертификат, нам нужно настроить nginx для
+установки и последовательной продления сертификата. Для этого нам понадобится
+поменять дефолтный файл настройки сервера nginx. Нам это необходимо сделать для
+того чтобы, сервер Let's Encrypt смог прочитать файл "челленджа" сгенерирован
+Certbot'ом и убедится в том что домен(ы) действительно наш(и).
+
+```nginx
+server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+
+ server_name _;
+
+ # This is so that Let's Encrypt can look for the challenge
+ location /.well-known/acme-challenge/ {
+ root /var/www/html/;
+ default_type text/plain;
+ }
+
+ # The rest of your configuration...
+}
+```
+
+После того как мы редактировали настройки, нам потребуется перезапустить с
+
+```
+# sudo systemctl restart nginx
+```
+
+Теперь у нас все готово чтобы сгенерировать сертификат. Мне нужен был
+сертификат для несколько поддоменов, так что я их всех добавил в список
+аргументов используя флаг -d, например
+
+```
+# certbot certonly --webroot -w /var/www/html -d www.example.com -d example.com
+```
+
+Certbot попросит ваш адрес электронной почти, в который будут отправляться
+уведомления об истекании срока действия вашего сертификата. Однако Certbot
+красавчик умеет их продлевать автоматический.
+
+Вот и наш сертификат готов. А теперь вы можете настроить nginx чтобы он принимал
+https запросы и делал редирект http запросов на https. Не забудьте добавить
+правильный путь к вашему сертификату и ключу в `ssl_certificate` и
+`ssl_certificate_key` соответственно.
+
+```nginx
+server {
+ listen 80;
+ listen [::]:80;
+ server_name www.example.com;
+ return 301 https://$host$request_uri;
+}
+
+server {
+ listen 443 ssl;
+
+ server_name www.example.com;
+ ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
+ ssl_certificate_key /path/to/key/www.example.com/privkey.pem;
+ location /static/ {
+ alias /home/webuser/mysite/static/;
+ }
+ location /media/ {
+ alias /home/webuser/mysite/media/;
+ }
+ location / {
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $http_host;
+ proxy_redirect off;
+ proxy_pass http://127.0.0.1:8001;
+ }
+}
+```
+
+Один минус автоматического редиректа, заключается в том что старые браузеры,
+(ох уж эти старые неубиваемые версси Internet Explorer) которые не поддерживают
+https, не смогут открыть ваш сайт. Но лично мне по барабану на браузера
+десятилетней давности.
+
+Вы можете найти больше информации по Certbot на этой странице (сайт на
+английском):
+[https://certbot.eff.org/docs/using.html](https://certbot.eff.org/docs/using.html)
+
+Редактировано (2018/11/02): Недавно в 2018 Let's Encrypt добавили возможность
+сгенерировать универсальный сертификат для всех поддоменов (например,
+*.example.com).
+
+Чтобы сгенерировать такой вид сертификата, нам понадобится скачать последнюю
+версию certbot из официального репозитория гита
+
+```sh
+$ git clone https://github.com/certbot/certbot.git
+```
+
+После этого можем перейти в каталог certbot, и выполнить следующую комманду
+
+```sh
+$ ./certbot-auto certonly --manual \
+> --preferred-challenges=dns \
+> --email email@example.com \
+> --server https://acme-v02.api.letsencrypt.org/directory \
+> --agree-tos \
+> -d *.example.com
+```
+
+Для этого нам понадобится добавить запись TXT в настройках DNS нашего домена,
+посколько для таких сертификатов только доступен "dns challenge". Перед тем как
+нажать на клавишу ввода, убедитесь что настройки вашего домена обновлены.
+
+Имейте ввиду что такие виды сертификатов нельзя обновлять в автоматическом режиме.