百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
U

upduck

> 编程语言
开源

一个简单的 Web 服务器,集成了 DuckDNS 和 Let's Encrypt

100 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个简单的 Web 服务器,集成了 DuckDNS 和 Let's Encrypt

upduck

Upduck is a simple HTTP and HTTPS static file server that integrates with DuckDNS. It is meant for quickly sharing static files beyond your local network over an HTTPS connection but can also be used within your local network (without HTTPS).

Disclaimer: This project has no affiliation with DuckDNS or Let's Encrypt and is not endorsed or supported by them.

Disclaimer: Using this program with the -email flag signifies your acceptance to the Let's Encrypt's Subscriber Agreement and/or Terms of Service.

How to use

The help section of the program tries to be as helpful as possible, make sure you read the section with examples:

…

Install

You can either compile this program or download a release.

Downloading

You can download a version for your system and move it anywhere you want. It is recommended to put the executable in a directory from your $PATH.

On a Raspberry Pi the following command should download the right executable:

arch=$(uname -m) && wget -O upduck "https://github.com/xarantolus/upduck/releases/latest/download/upduck-raspberrypi-${arch%l}"

Mark it as executable:

chmod +x upduck

Then move it to your $PATH to make it accessible everywhere:

mv upduck /usr/bin/upduck

Now you should be able to run upduck from anywhere. This is especially useful if you set -dir . while saving settings, as now it always serves directory you're currently in.

If you want to use ports below 1024 and run upduck without root (sudo), you can set the CAP_NET_BIND_SERVICE permission:

setcap 'cap_net_bind_service=+ep' /usr/bin/upduck

Compiling

Since this is a normal Go program, compiling works like this:

go build

If you're compiling for another operating system, you can set environment variables. You can see the release.sh script to see how it's done for building releases.

You can also run upduck on Android (using Termux).

You'll likely need root though. I tested this on my phone (which has root), so I'm not 100% sure but it probably doesn't work without. It also doesn't seem to work when cross-compiling from Windows to Android, but when compiling directly on the device it's used on it works.

Start by installing Termux from an app store.

  1. After that, you can open Termux and install Go and Git:
pkg install golang git

Now the command go version should output something like go version go1.15.3 android/arm64.

  1. Clone this repo and cd into it:
bash
git clone https://github.com/xarantolus/upduck.git && cd upduck
  1. Compile the program:
go build
  1. Move it to your $PATH:
mv upduck ~/../usr/bin/

Now you can run it just like shown in the help section above. Please also make sure that the Termux app has the storage permission.

I recommend using the Termux Widget for upduck. For that, you can put scripts to start & stop this server in ~/.shortcuts/tasks, they could look like this (after configuring this server once with the -save flag):

A script to start the server:

upduck:

bash
#!/usr/bin/bash
sudo upduck -dir /storage/emulated/0 # Fill in any path you like

A script to stop the server running in the background:

stopduck:

bash
#!/usr/bin/bash
sudo killall upduck

Now you can tap the widget any time to start/stop the server, which means that you'll never have to get up to find a cable ever again. At least when you're in a network where you configured upduck correctly.

Obtaining a DuckDNS domain and setting up HTTPS

To get a DuckDNS subdomain, you'll need to register on their site and then create a domain. The prefix you type in is the -site parameter of your program, your token is for the -token option.

Now that we have the domain, we'll need to make sure the router is set up correctly. For this, you'll need to forward a port in your router to port 443 (or the one set with -sp) of the device upduck is running on. This port will be part of your external address, e.g. mysite.duckdns.org:port, where port is a number.

When you did that, you can run upduck like this:

upduck -email [email protected] -token DuckDNSToken -site mysite

The email address will be sent to Let's Encrypt as part of obtaining an HTTPS certificate.

This should start a local HTTP web server on port 8080 and an HTTPS server on port 443. The second one should receive the requests that are forwarded from your router.

Saving settings

Since typing out all arguments can become tiresome, you can save them quite easily. They will then be reloaded on the next start.

Disclaimer: Writing your credentials to disk is a security risk since other programs might read that file. They could gain control over your DuckDNS account or find out your email address.

To save settings, just add the -save flag to your normal command line. The next time, your credentials will be restored and you don't have to remember them or type them every time.

Loading settings

Saved settings are loaded automatically if no new options for DuckDNS are given.

When the config file is loaded, the following settings can be overwritten by command line flags: port with -p and directory listings with -disallow-listings. This means that you can run upduck -p 2020 to get the local server while still getting the DuckDNS server if it was ever set up with -save.

User accounts

You can create user accounts to control access as outlined in the "User configuration" section of the help output. These accounts are loaded with every start of the server, so you only need to set it up once.

Logging in is done using HTTP Basic Auth. This means that the login duration depends on how long a browser saves the given username/password combination.

Contributions

Contributions, suggestions, questions and any issue reports are very welcome. Please don't hesistate to ask :)

License

This is free as in freedom software. Do whatever you like with it.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goduckdnshttphttp-serverhttps

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言