Practice Test - Docker Deployment of URL Shortening Service YOURLS
A service for shortening URLs, allowing you to operate a URL shortening service on your own server. It provides complete control over your data, including simple statistics, analysis, and numerous plugins.
December 30, 2023: Escaping the clutches of the MySQL database, embracing its branch, MariaDB.
Reason: In the event of an unexpected power failure, MySQL reported errors when Docker was started, which could not be resolved. In comparison, MariaDB provides a better solution.
Purpose
This is a URL shortening service that enables you to run a URL shortening service on your own server. Its features include complete control over your data, including statistics, analysis, and the ability to install various plugins. It also allows for the management of links related to Clash.
Existing online URL shortening solutions often come with obvious drawbacks, some of which involve hidden and specific redirections.
Existing URL Shortening Resources
Short Links
- https://t.hk.uy/b5kg
- https://netlify.carlzeng.com currently does not support the domain name you entered. Use this URL to shorten: https://sage-halva-bac054.netlify.app
- https://t.hk.uy/b6qy
Easily Shorten Links
- https://goo.su/BwRaE1T
- https://goo.su/prTA5T5
URL Shortener
- https://tinyurl.com/yurgh2fm
Traditional Free URL Shortening Tool
- http://s8u.cn/HIG7o
- Elegant, but unable to accept: first redirects to a link, then restores the original URL.
Change of Perspective:
Use your own domain name for shorter ‘Nname’;
Setting up your own URL shortening service
Implementation Details and Process Notes
Visual Guide
[Fun Docker Project] Setting up your own URL Shortening Service—YOURLS in 10 minutes](https://iwanlab.com/docker-compose-install-yourls/)
[Server] How to Set Up Your Own Private Short URL Service Using Docker](https://www.hellosanta.com.tw/knowledge/category-38/post-219)
Process, Issues Encountered, and Solutions
In the ‘bt’ directory, a docker-compose template was created,docker-compose -f yours.yml up
Then, a firewall rule was added to allow traffic through port 8200
After adding a firewall rule, it was impossible to connect to the ‘bt’ panel
Setting up your own URL shortening service
1 | version: "3.5" |
Reported Error:
1 | yours_mysql | 2023-11-07 13:33:44+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' |
Resolved on 20231229[Resolved]: Updated the mapping directory for MySQL docker; reinstalled everything. Data Loss (including the shortened link data and access statistics data).
The completed solution is to use the GautamGupta/YOURLS-Import-Export plugin for effortless export and import functionality.
Detailed installation steps:
- Download the zip.
- Extract the zip.
- Place the YOURLS-Import-Export folder in the user/plugins directory.
- Activate the plugin.
- Restart Docker
docker-compose -f 'yourls_service.yaml' restart
Experience: Very user-friendly; for example, the current all-link list can be exported (or backed up). In special situations, starting over from scratch (saving time).
Derived Readings: Plugins List: This list of plugins is categorized alphabetically and can be searched for specific functionalities directly on the page.
Next Steps
Feature: Analyze specific user attribute information, such as IP addresses, GEO addresses, similar to the detailed list provided by statcounter.com
yourls-geoip-update
Unable to update the database.
Error downloading “GeoLite2-Country”. Invalid license key.
Do your best; can someone correct this for me?
On 20231216, attempts to update the mmdb database file in the directory ./yourls_data20231120/includes/geo proved ineffective.
- Uploaded GeoLite2-City.mmdb
- Copied and replaced the original GeoLite2-Country.mmdb
- This resulted in two new 64.34MB files, up from the original 5.41MB files
- Todo: Observe the changes
On 20231216, practical tests proved that there was no change. Next step:
- Download alecthw/mmdb_china_ip_list to obtain the Country.mmdb file
- Upload it to ./yourls_data20231120/includes/geo and replace the original GeoLite2-Country.mmdb.
- Restart Docker, Todo: Observe the changes.
Advantages and Disadvantages
Advantages of Yourls
Numerous plugins for flexible assembly. Plugin list: YOURLS Awesome List.
Disadvantages of Yourls
The statistical functionality is basic and weak, almost at a comical level.
The documentation is not clear and straightforward. In the case of a failed GeoIP update, how can IP data be manually uploaded to that directory? It is surprising that this information is not easily found through a search engine.
Docker Installation of X-UI
Setting up Xray panel that supports multiple users and protocols on a single port - the ultimate chimera
FranzKafkaYu/x-ui version was used, only needing to modify the above image to enwaiax/x-ui:alpha-zh. As the telegram bot was temporarily not in use, the default was switched back to vaxilu/x-ui
1 | version: "3.9" |
A new directory was created, and the above configuration was added to x-ui.yamldocker-compose -f x-ui.yaml up
https://www.amadues.link/archives/dockerda-jian-jie-dian-vless-ws-tls-web
Following the solution of docker-compose.yaml: https://hostloc.com/thread-1108468-1-1.html
Following the configuration: https://iwanlab.com/npm-xui/
Related video: https://www.youtube.com/watch?v=V3nsDicSMBc
To be tested:vless://39fde2d2-c88c-4bea-d491-fb6990d49741@vmess.carlzeng.com:17866?type=ws&security=none&path=%2Fgugu#gugugee
On-premises configurations helped in viewing and editing the settings: http://192.168.6.116:54321/fk/xui/
Not successful…awaiting more client connection tests, waiting for rescue.
Potential Resources:
To be continued…