Сообщения за 2023

Python docker как настроить SSL

Обычно для крупных проектов я использую nginx, либо полноценные CDN сервисы вроде CloudFlare которые дают https из коробки. Но в моём случае мне требовалось развернуть на дешевом впс сервере всю инфраструктуру, и чтобы был https. Мне нехотелось разбиратся в тонкостях настройки nginx и копатся в каких-то конфигах. В итоге я нашел решение - Caddy . Все что нужно для настройки - DNS A запись, и внешний айпи. Чтобы добавить Caddy к себе в docker-compose, я создал отдельный файл docker-compose.prod.yml: version : '3' services :   caddy :     image : caddy     ports :       - 80:80       - 443:443     volumes :       - ./Caddyfile:/etc/caddy/Caddyfile       - caddy_data:/data       - caddy_config:/config volumes :   caddy_data :   caddy_config : Также создал Caddyfile в корне проекта: bbak.mkhitaryan.pw {   reverse_proxy web:8000 } Все что нужно для настройки - поменяйте домен в директиве с bbak.mkhitaryan.pw на собственный. И всё! Когда сделаете  docker-compose up -f docker-compose.

Namecheap redirect does not work with https

I have tried using Namecheap's redirect functionality from my main domain mkhitaryan.pw to my cv. But I quickly run into an issue that Namecheap only allows HTTP requests! When it receives an HTTPS request, it just hangs the connection until timeout: Namecheap redirect only works on port 80! As you can see, the 443 port just hangs the connection, but the 80 port redirect works well! The solution that I found is to use Netlify  instead of Namecheap's redirect. Netlify works very well with HTTPS and allows you to make redirection happen on an HTML page. Netlify also gives you 100GB of free traffic! Good luck spending it with a blank HTML redirect page, that is a few kilobytes large. There are many guides over the WEB on how to connect your Namecheap domain to Netlify. I only provide the HTML page that I used for redirection: <!DOCTYPE html> < html > < head > < meta http-equiv = "refresh" content = "0; url='https://cv.mkhitaryan.p

Installing lightweight proxy server on raspberry pi

Introduction As I live in Armenia, I have a lot of friends across the CIS region who live under internet oppression regimes. For an example the Russians cannot access Instagram, Twitter without a vpn, and many other resources. That makes it very important to them to use proxy/vpn to bypass the DPI, which government regimes use for censorship. Here in Armenia we have clean internet with no censorship, so if I setup a proxy for my friends they can use it to access the free on censorship internet. In most of the guides I found on the internet they are using privoxy, which is insecure  because it has no authentication system built-in, and if left as it is, your proxy IP address will be used by port scanners for various bad stuff like spamming. Such behavior risks your ip address getting marked as spam, or getting used by hackers to make you a suspect of cybercrime. That is why I found a better solution for creating a proxy server called 3proxy . It is pretty lightweight, and has almost no