Preface
Regarding apps that can share files, I have introduced several before. The complex one is minio on a private COS platform (I mainly use it to provide downloads for large files, after all, minio's permanent file links need to be generated manually, which is a bit low-tech and inefficient; for specific configuration steps, see:Docker Series: Building a Private COS Platform Based on MinIO), and the lightweight one is pingvin-share (I mainly use it to store small files that need to be shared on my blog; for specific configuration steps, see:Docker Series: Using Docker to Deploy a Lightweight File Sharing Platform Based on pingvin-share), while for sending text and small files to friends daily, I use the burn-after-reading service provided by cryptgeon (for specific configuration steps, see:Docker Series: Using Docker to Build Your Own Burn-After-Reading Application Based on cryptgeon), and to be honest, it is basically enough to handle various daily scenarios.
However, the fly in the ointment is that when sending text or files to friends, using burn-after-reading always feels a bit sneaky, and I'm a bit afraid of being misunderstood by internet monitors that I'm doing something bad... Moreover, burn-after-reading apps basically don't require registration, which makes me afraid to use them openly (after all, the hostname in the link will expose my website), fearing that improper use might lead to me being investigated by the authorities~~~ (one needs to be cautious living in China). While pingvin-share supports registration, it essentially shares a folder with a fixed link. Although you can create a new link to share an individual file each time, the operation is slightly complicated and feels like using a sledgehammer to crack a nut, so I personally think it's best used on a blog.
So, is there an app that can be used openly to share files with friends, users, or others in daily life? I accidentally discovered one today, and that is go-file.
This article introduces go-file, a lightweight file sharing app that supports user authentication.
Deploying go-file
Creating the directory on the host machine that needs to be mounted inside the container
mkdir -p /docker/go-file/data
This directory is also used to store videos, files, images, etc., that need to be shared, so try to choose a good storage location according to your needs.
Setting up go-file
The command to set up go-file in docker run format is as follows:
docker run --name go-file -d --restart=always \
-p 3000:3000 \ #映射宿主机上的3000端口到容器内部的3000端口,请根据实际环境修改
-e TZ=Asia/Shanghai \ #设定容器时区
-v /docker/go-file/data:/data \ #设定宿主机上需要挂载到容器内部的目录
justsong/go-file
Publishing go-file to the public network using an appropriate method (optional)
Unless it is only used in a local area network, go-file definitely needs to be published to the public network. You need to choose the most suitable publishing method based on your actual environment and the reverse proxy you use. You can refer to several of my previous articles:
1、Docker Series: Building Your Own Reverse Proxy Based on NPM Using Docker
2、Linux Panel Series: Configuring Reverse Proxy and Publishing Using Non-443 Ports
3、Home Data Center Series: Getting Cloudflare for Free via Domestic ICP-Filed Cloud Hosts to Achieve Fast Access to Domestic Sites from Abroad
4、Home Data Center Series: Getting Cloudflare for Free via Home Broadband Without Public IP to Achieve Fast Website Building (Universal)
Among them, the 1st and 2nd methods are suitable for environments with a public IP but without a legal 443 port (home broadband, non-filed cloud hosts), where non-standard ports need to be added after the URL (if using Cloudflare to build a website, no port needs to be added, but you need to customize the origin server port, which you can refer to:Home Data Center Series: Solving the Problem of Having a Public IP but No Legal 80 or 443 Ports for Website Building via Cloudflare's Origin Rules). The 3rd method is suitable for cloud hosts with ICP filing, and the 4th method is suitable for all environments (including environments without a public IP), which is also my recommended method (regardless of whether your environment has a public IP, because this method does not require running HTTPS traffic directly on the public network).
Assuming the access method for go-file after publishing ishttps://example.com
Accessing and configuring go-file
Usehttps://example.comAccess go-file (use http://host_ip:3000 for LAN access), the interface is as shown below:

For the first access, directly click "Login" in the red box in the upper right corner of the image above. On the user login interface, use the default username "admin" and default password "123456", then click "Submit":

After logging in, click "System Management" under the "admin" menu in the red box in the upper right corner:

Then modify the default administrator password (Note: changing the display name is not changing the account username), and then click "Submit":

The "Account Management" interface in the image above can also add "Regular Users" and "Administrator Users":

As well as "Manage Users":

In "System Settings", you can set the minimum permissions required for uploading and downloading respectively:

If you only use it for yourself, you can select Administrator for both "File Upload" and "Image Upload". Since I considered that friends might also use it, I selected "Regular User" as the minimum permission for uploading, as shown below:

Using go-file to share files
Sharing text files
Why do we need to talk about text files separately? Because this involves another application method: direct calling in the terminal.
For example, if you want to paste a piece of code into the server but are worried about various character formatting issues, you can directly upload the txt text file to go-file, and then use wget https://example.com/xxxxxxxx.txt -O file_name to directly download the text file locally and rename it; or if you have newly installed a server without a graphical interface, with no sshd service enabled, and no available editor to edit the sources.list file, and installing an editor using the default source is too slow, you can use curl https://example.com/xxxxxxxx.txt > /etc/apt/sources.list 或 wget https://example.com/xxxxxxxx.txt -O /etc/apt/sources.list to update the apt source, and then use apt update to update, or other similar scenarios. To be honest, minio can also do this, but the steps are relatively tedious and not as convenient as go-file.
Actually, speaking of this function, pasteme used to be the most convenient, but it stopped working after being shut down by authorities.
Sharing text is very simple, directly click "Upload" in the red box in the upper right corner:

There are two ways here: one is to directly copy the text to "Description", and then directly click upload, which will be automatically generated; you can also use the selection in the red box below to choose a local text file and then click upload:

After uploading, directly click the copy button in the red box on the right to get the file address:

After obtaining the file address, you can then operate through the several methods described above.
Sharing video files
Actually, the upload steps are the same. It's just that after uploading a video file, in addition to being able to share it using the sharing link, you can also play it online directly through the video menu:

Of course, this is actually played directly by the browser, so it requires formats supported by the browser (or installing a player).
Simple image hosting function
Under the image hosting menu, you can directly copy and paste or drag and drop to upload images:

Why call it a simple image hosting service? Look at the red box on the right, there are only 2 formats, one is http(s) or markdown:

Just in terms of the provided image links, compared to chevereto, it looks exceptionally simple:


Not to mention that chevereto has other features~. However, although simple, it also provides a plugin to work with picgo:

Overall, it can only be said to be usable, so everyone can choose according to their situation.
Online preview
If you upload files directly on the homepage, you can preview them online:

Why do I say on the homepage? Because by default go-file only has one image folder, which is used to store images uploaded under the image hosting menu, while other directly uploaded files are in folders automatically generated by the system named "Year-Month". The files under this automatically generated folder can be seen directly on the homepage, and can be: deleted, shared via QR code, link address copied, previewed online, and downloaded directly, as shown in the 5 icons at the bottom right of the image above.
Uploading files in folders you created
If you are in the host system/docker/go-file/data/uploadcreate other folders under the directory, for example, I created 3 folders: file, text, and video according to my habits, then selecting the "file" menu of go-file will show the new directory:

The files in the blue box at the bottom of the image above are automatically generated by the system, and the files in the red box are created by me directly on the host machine. Files uploaded in folders created by yourself will not appear on the homepage, so they cannot be deleted directly on the page, QR codes generated, or previewed online. You can only enter the folder to download and copy the share link:

If you want the uploaded files not to be displayed on the homepage, you can use this method.
Summary
Overall, go-file makes up for my small shortcoming when sharing files with others. At the same time, I am very satisfied with the support for user authentication. Finally, there is a tool that can be openly used to share with others. If you upload files in a self-created directory, they cannot be seen on the homepage, and privacy is also guaranteed. At the same time, I also connected the application to Cloudflare through a custom hostname for traffic scrubbing, so I am not afraid of attacks, perfect.
However, there are also some small regrets, such as no file management function at all. Except for files uploaded on the homepage which can be deleted directly on the page, files uploaded in folders created by yourself can only be deleted in the host machine. At the same time, it does not support sharing with passwords, nor does it support reading times and time control... At least, there should be an option to control whether the homepage displays visitor files, which is indeed a bit annoying. Even if I upload files on the homepage, I don't want everyone to access them. Maybe I just want to share them via links? In this regard, Peertube's video sharing is quite good:

I hope go-file can add these features in the future.