Setup Wireguard Between Two Servers

WireGuard is a modern VPN that utilizes state-of-art cryptography. It’s very easy to set up compared to other VPNs. In this post we are exploring how to set up secure networks between two servers over the internet. Preparation First, we will need the necessary components: wireguard-go and wg from wireguard-tools. wireguard-go is used to create the network interface that the system uses to create the tunnel between the servers. wg manages the configuration of the interfaces....

published on December 28, 2023 · last edited on July 17, 2024 · 4 min · 654 words

Tracking Http Upload Progress Using Golang

I wrote a simple cli tool to upload files to my Cloudreve instance. It’s easy to figure out which api to call when uploading files. However, it will be helpful to know how the upload is going. Visualizing Speed When creating an upload request, golang allows us to use a io.Reader as the request body. The body will be responsible for displaying upload progress. info Although Cloudreve and its storage providers require Content-Length header to be set, thus requiring the total length to be known beforehand, this method is applicable even if the total is unknown....

published on December 10, 2023 · 3 min · 574 words

Compiling Static Binaries With Alpine

A static build is compiled version of a program which has been statically linked against libraries, according to Wikipedia. In practice, it means we can run a binary anywhere in compatible environments without installing dependencies. Although the binary is considerably larger, it greatly simplifies deployments. Learning by Example - cURL First, we take a look at how a static binary of cURL can be produced: 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 # dependencies to build curl apk add build-base clang openssl-dev nghttp2-dev nghttp2-static libssh2-dev libssh2-static # these are missing on at least armhf apk add openssl-libs-static zlib-static || true # gcc is apparantly incapable of building a static binary, even gcc -static helloworld....

published on November 20, 2023 · 3 min · 592 words

Advanced Postman Features

Postman is an API platform for developers. For average users, it can be used to send HTTP requests very easily. It has an intuitive interface - you can specify different aspects of an HTTP request: the method, the url, the query parameters, the headers and the body if any. Sometimes it’s also easier to call an API using Postman than to use the UI to do something. Postman has some features to make this accessible....

published on November 8, 2023 · 2 min · 375 words

Fixing Caddy's Http3

Caddy has supported http3 for a long time. First it’s an experimental feature, then in v2.6.0 it is on by default. There were some bugs, but I believe with the latest commits, most of them are gone. Problems Socket Reuse To improve efficiency, caddy tries to reuse sockets between configuration reloads. For Windows systems caddy has to wrap the underlying socket and set deadlines to terminate old use of the socket....

published on October 25, 2023 · 3 min · 629 words