Uncategorized

YaTHS: Ultra-minimal HTTP file server for the homelab (37KB binary, 37KB Docker image)

Ultra-Minimal HTTP File Server for the Homelab: A Tiny but Mighty Solution

Introduction to YaTHS

I recently stumbled upon a Reddit post that caught my attention – a user had created an ultra-minimal HTTP file server called YaTHS, which stands for Yet another Tiny HTTP-Server. As someone who values simplicity and efficiency, I was intrigued by the idea of a tiny file server that could serve files without the need for a full-fledged web server.

The creator of YaTHS was motivated by the same desire for simplicity – they were tired of using bloated containers to serve files and wanted to see how small they could make a file server while still maintaining its functionality. The result is a 37KB binary and a 37KB Docker image that can serve files with impressive performance – 37k requests per second and 28 GB/s throughput.

Use Cases for YaTHS

So, what are the use cases for YaTHS? According to the creator, it’s perfect for quick file sharing on a local network, temporary public folders for transferring files between devices, and even running on slow devices like the Pi Zero or old Androids via Termux. It’s also a great tool for development and testing before switching to a more robust server like nginx.

Some of the features that make YaTHS stand out include its mobile-friendly UI, support for common MIME types, and the ability to toggle hidden files. The best part? No config files are needed, and it’s a single binary without any libraries or dependencies.

How to Use YaTHS

Using YaTHS is incredibly straightforward. You can run the Docker image using the command docker run -p 8000:8000 -v /path/to/files/:/data alsca183/yaths, replacing /path/to/files/ with the path to the files you want to serve. If you’re feeling adventurous, you can even build the image yourself from the source code on GitHub.

It’s worth noting that YaTHS is not meant to replace your main web server – it’s designed for local use and development purposes only. As the creator warns, don’t expose your files to untrusted actors, and be aware of the limitations, including no HTTPS/TLS support, no HTTP/2 or HTTP/3, no authentication, and no rate limiting.

Conclusion

In conclusion, YaTHS is an impressive example of how minimalism can be a strength in software development. By stripping away unnecessary features and focusing on simplicity, the creator has managed to create a tiny but mighty file server that can serve files with impressive performance. Whether you’re a developer looking for a quick and easy way to test files or a homelab enthusiast seeking a lightweight solution, YaTHS is definitely worth checking out.

Polska wersja

Ultra-minimalny serwer plików HTTP dla homelabu: mały, ale potężny rozwiązanie

Niedawno natknąłem się na post na Reddit, który zwrócił moją uwagę – użytkownik stworzył ultra-minimalny serwer plików HTTP o nazwie YaTHS, co oznacza Yet another Tiny HTTP-Server. Jako osoba, która ceni sobie prostotę i wydajność, byłem zaintrygowany pomysłem stworzenia małego serwera plików, który mógłby służyć plikami bez potrzeby pełnego serwera internetowego.

Twórca YaTHS został zainspirowany tą samą chęcią prostoty – był sfrustrowany używaniem rozdętych kontenerów do służenia plików i chciał zobaczyć, jak mały może być serwer plików, jednocześnie zachowując jego funkcjonalność. Rezultatem jest 37KB plik binarny i 37KB obraz Docker, który może służyć plikami z imponującą wydajnością – 37k żądań na sekundę i 28 GB/s przepustowość.

Przypadki użycia YaTHS

Co to są przypadki użycia YaTHS? Zgodnie z twórcą, jest to idealne rozwiązanie dla szybkiego udostępniania plików w sieci lokalnej, tymczasowych folderów publicznych do przenoszenia plików między urządzeniami oraz nawet uruchamiania na wolnych urządzeniach, takich jak Pi Zero lub stare Androidy za pośrednictwem Termux. Jest to również doskonałe narzędzie do rozwoju i testowania przed przełączeniem się na bardziej zaawansowany serwer, taki jak nginx.

Niektóre z funkcji, które sprawiają, że YaTHS wyróżnia się, to jego przyjazny interfejs mobilny, obsługa typowych typów MIME oraz możliwość przełączania plików ukrytych. Najlepsza część? Nie są wymagane żadne pliki konfiguracyjne, a jest to pojedynczy plik binarny bez bibliotek lub zależności.

Jak używać YaTHS

Używanie YaTHS jest niezwykle proste. Możesz uruchomić obraz Docker za pomocą polecenia docker run -p 8000:8000 -v /path/to/files/:/data alsca183/yaths, zastępując /path/to/files/ ścieżką do plików, które chcesz udostępnić. Jeśli czujesz się awanturniczo, możesz nawet samodzielnie zbudować obraz z kodu źródłowego na GitHub.

Warto zauważyć, że YaTHS nie jest przeznaczony do zastąpienia Twojego głównego serwera internetowego – został zaprojektowany do użytku lokalnego i rozwoju. Jak twórca ostrzega, nie udostępniaj swoich plików niezaufanym aktorom i bądź świadomy ograniczeń, w tym braku obsługi HTTPS/TLS, HTTP/2 lub HTTP/3, braku uwierzytelniania oraz braku limitowania przepustowości.

Podsumowanie

Podsumowując, YaTHS jest imponującym przykładem tego, jak minimalizm może być siłą w rozwoju oprogramowania. Przez usunięcie niepotrzebnych funkcji i skupienie się na prostocie, twórca zdołał stworzyć mały, ale potężny serwer plików, który może służyć plikami z imponującą wydajnością. Niezależnie od tego, czy jesteś deweloperem szukającym szybkiego i łatwego sposobu na testowanie plików, czy entuzjastą homelabu poszukującym lekkiego rozwiązania, YaTHS jest na pewno wart sprawdzenia.

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Appliance - Powered by TurnKey Linux