Preface
Sometimes, in my blog articles, I want to share some files for everyone to download. In fact, there are quite a few options to choose from: Nextcloud, links generated by COS built with MinIO, Baidu Netdisk, Alibaba Cloud Drive, etc. However, each of these methods has its own advantages and disadvantages (I will write a dedicated article about this later). Recently, I saw other articles mentioning a lightweight file-sharing software: pingvin-share. First, it is simple to deploy; second, it is very distinctive; third, it supports registration (I dare not make purely anonymous ones public, such as burn-after-reading software that can be used without registration, as I might get a visit from the authorities if they are abused...). These features really suit my taste, so I decided to use it as my regular sharing solution.
Deployment
Create the folder on the host machine that needs to be mapped into the container
As usual, first create the folders required for the -v parameter mount:
mkdir -p /docker/pingvin-share/data
Note: This host folder is also the root folder where uploaded files will be stored in the future, so you need to choose an appropriate storage. The size limit of the storage where this folder is located is the limit of the file size that pingvin-share can store, just like the famous old slogan: "How bold the people are, how productive the land is." Therefore, it can completely be a shared folder on a high-capacity NAS. However, this requires mounting the NAS shared folder on the host Linux system in advance. For specific host environments, you can refer to my previous articles:Tips and Tricks Series: macOS Automatically Mounts SMB Shared Network Disks on Boot、Debian Series: Mounting SMB Shared Directories in Unprivileged Linux Containers in PVE、Debian Series: Automatically Mount SMB on Boot)。
The command in docker run format is as follows:
docker run --name pingvin-share -d --restart=always \
-p 9700:3000 \
-v /docker/pingvin-share/data:/opt/app/backend/data \
stonith404/pingvin-share:latest
-p 7333:3000 \
-p 9700:3000 \
-v /docker/pingvin-share/data:/opt/app/backend/data \
stonith404/pingvin-share:latest
-p 9700:3000Map port 9700 of the host to port 3000 of the container. You can modify this according to your actual environment.-v /docker/pingvin-share/data:/opt/app/backend/dataMap the host's
/docker/pingvin-share/data

to the container's
/opt/app/backend/dataWhy is pingvin-share called a "lightweight" file sharing platform? As you can see from the command above, unlike some other cloud drive applications like Nextcloud that require specifying databases like MariaDB or MySQL. To be honest, if I just want to upload files and simply generate a sharing link, but you still make me mess around with a database, I'd feel a bit annoyed. However, not specifying one doesn't mean pingvin-share doesn't need a database; it uses an embedded SQLite database, as shown in the figure below:和You can see a pingvin-share.db file, and that's it. This database file is stored by default in the "/docker/pingvin-share/data" path of the host.Note: pingvin-share can also be used in conjunction with the Docker version of ClamAV, which will scan uploaded files for viruses. If you want to use them together, you need to create a Docker version of ClamAV, and when creating the pingvin-share container, use-e CLAMAV_HOST-e CLAMAV_Port
Preparation
Initial Setup
Usehttp://宿主机ip:9700parameters to specify the address and port of ClamAV respectively. Of course, this kind of scenario requiring mutual access also requires

--network=

parameter to divide the network of the two containers into a non-default bridge. This is a bit of a hassle. Crucially, if I am the only one using it, there won't be a risk of virus infection. More importantly, ClamAV actually requires a minimum of 3G RAM, with 4G recommended, which is a bit scary... Just like when I deployed the full-text search software Elasticsearch for Nextcloud in the past, the memory usage felt like at least 3G... Forget it, I won't bother. Interested friends can give it a try.

Log in, as shown below:

Click "Sign Up" in the red box in the upper right corner to create the first account (which is also the administrator account):

After filling in the account information, click the red box at the bottom of the image above to create the account, and then the following interface will appear:
First, change the language to Chinese. Click "My account" in the red box in the image above:

Select Simplified Chinese in the Language option at the very bottom:

General Settings
In this way, the language of the entire page is set.

"At the same time, this interface also allows you to modify the account name, email, password, and enable two-factor authentication, etc.:

Note: If modifying the password here reports an error, you can also modify it in the "Administration" - "User Management" interface:
http://宿主机IP:9700Go to "Administration" - "Configuration":
"General" configuration options:https://share.example.comThe App URL in the red box here is very important, as it determines the link address generated when you share files. If it is only used in the local network, it can be directly changed tohttps://share.example.com:44444。
and that's it.
"Assuming the public domain name is share.example.com and the ICP filing is completed, and the reverse proxy has also completed the SSL configuration, the App URL is:

. If the domain name does not have an ICP filing, you need to append the port actually used by the reverse proxy after the domain name, for example:
"At the same time, the "General" interface can also set the displayed App name, logo, and whether to display the homepage, etc.

"Sharing" configuration options:
"The "Allow registration" option here is enabled by default. If you only want to use it by yourself, you need to turn off this option. At the same time, this interface can also set the maximum expiration time of sharing, file size (the total size of all files contained in a link), and zip compression level.

"SMTP" configuration options:
Upload and Share
To use the email notification function set in the "Email" configuration options, you need to configure the SMTP-related options first.

After selecting the local file and double-clicking to open it (taking the "Tanchuang.flac" file as an example), the following interface is displayed:

The share link specifies the last part of the share link. This can be manually specified or automatically generated. Manual specification allows you to set more understandable letters. For example, here I uploaded the flac file of Tanchuang, so I set it to "music". At the same time, this interface can also set the expiration time, access password, and number of visits (setting the number of visits to 1 is equivalent to burn after reading). After setting, click "Share" in the red box at the bottom to generate the link:

Then you only need to copy this link and send it to the person you want to share with, which completes the most basic sharing function.
Advanced Applications
In the previous section, the file sharing of pingvin-share should actually be called folder sharing. If you directly copy the share link from the previous section and open it in a browserhttps://share.example.com/s/music, you can see the following display:

The image above actually displays the contents of the "music" folder. Since there is currently only one file, only one is displayed. In the red box to the right of the file in the image above, there are 3 buttons, from left to right: preview, copy file download link, and click to download. So if you want to share this file directly, you need to use the button in the middle of the red box in the image above to copy and send it to the other party.
Sharing folders has an advantage: the content inside can be modified at will, but the external link remains fixed. It is very convenient when publishing content that needs to be modified frequently (such as frequently updated source code). Click the button in the red box in the image below to add files:

In addition, pingvin-share also has a very interesting feature: reverse share (meaning reverse sharing)
, even if other people do not have a registered account, they can upload files directly by opening this link:

And you can also define the expiration time of this link, the file size that can be uploaded, and the number of times the link can be used:

Configure public network access
If you want to publish 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).
Simple Summary
If you just simply want a file sharing function and don't want to mess around too much (mainly don't want to install a database); or if the performance of the purchased cloud host is limited, making it difficult to deploy something like Nextcloud, but you still want to use it to deploy a file sharing application, pingvin-share is really a good choice. In short, it is still recommended for friends in need to try it out.
You can experience the actual effect using the following link, where I have put some songs I downloaded before:
pingvin-share demonstration link