Link shortener

Currently reading
Link shortener

I'd like to point out an alternative that is quite simple...
simply-shorten

draganczukp/simply-shorten

Code:
docker run -p 4567:4567 \
    -e username="username" \
    -e password="password" \
    -v ./urls.sqlite:/urls.sqlite \
    -e db_url=/urls.sqlite \
    -d simply-shorten:latest

What I liked (apart from functionality), is this...

Bloat that will not be implemented
  • Logging, tracking or spying of any kind. The only logs that still exist are errors printed to stderr and the default SLF4J warning.
  • User management. If you need a shortener for your whole organisation, either run separate containers for everyone or use something else.
  • Cookies, newsletters, "we value your privacy" popups or any of the multiple other ways modern web shows how anti-user it is. We all hate those, and they're not needed here.
  • Paywalls or messages begging for donations. If you want to support me (for whatever reason), you can message me through Github issues or via email. [email protected]
 
Last edited:
I think @Rusty forgot to mention that must be a link to mariadb database.
I have done and works...
One more thing: YOURLS_SITE parameter must be:
http://local_IPNAS:3333

(if no reverse proxy configured of course)
 
I think @Rusty forgot to mention that must be a link to mariadb database.
I have done and works...
One more thing: YOURLS_SITE parameter must be:
http://local_IPNAS:3333

(if no reverse proxy configured of course)
Rusty didn't forget. If you read it closely you will see the 2 quote sections regarding the same.
 
Hey guys,

I’m pretty new to all of this so please be gentle :)
I wanted to run yourls via docker on a Synolgoy NAS and pretty much followed the instructions here.

But I can’t get it to work, the log says:
Warning: mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 17
MySQL Connection Error: (2002) Connection refused

Seems like I messed something up with the MariaDB configuration?
Any tips or hits are greatly appreciated!
Thanks.
 
Hey guys,

I’m pretty new to all of this so please be gentle :)
I wanted to run yourls via docker on a Synolgoy NAS and pretty much followed the instructions here.

But I can’t get it to work, the log says:
Warning: mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 17
MySQL Connection Error: (2002) Connection refused

Seems like I messed something up with the MariaDB configuration?
Any tips or hits are greatly appreciated!
Thanks.
Seems that yourls can’t talk to your mariadb instance. Share your maria and yourls configurations and we can take a better look
 
Thanks!
Sure thing, here we go:
yourls environment config:
YOURLS_DB_NAME = yourls
YOURLS_DB_HOST = 192.168.0.222:3653 (local NAS ip with MariaDB port)
YOURLS_SITE = https://domain.synology.me:3654
YOURLS_DB_USER = root
YOURLS_DB_PASS = myrootpw

MariaDB 10:
should be running on Port 3653 (do I have to enable TCP/IP connection in the Syn-GUI?)
USER = root
PASS = myrootpw
new database named yourls
root has got all privileges

can't reach anything via the browser at: 192.168.0.222:3653
192.168.0.222/myphpadmin works

what else do you need?
 
Running via Package Center and yes, I'm able to access it.
Well there are members here that also have had problems with crossing docker container communication with the local installed service via package center.

You could try and set up yourls to use the host network and not the bridge one and see if that will fix the problem. Another way you could simply move Maria to docker container and have them connected that way.
 
Could you please elaborate what you mean by host and bridge network?
I'm sorry, but I'm not that well versed in this field.
Would I need anything else but MariaDB in docker for the database to work?
 
Could you please elaborate what you mean by host and bridge network?
I'm sorry, but I'm not that well versed in this field.
Would I need anything else but MariaDB in docker for the database to work?
Are you running yourls via docker compose or via docker ui in DSM?
 
Last edited:
okay, the container is running on host now (at least I think^^).
Is there a way I can verify that?
What do I need to change in the yourls environment config then?
yourls still throws mysqlconnection refused.
I imagine I'll have to change the address and port now?
 
okay, the container is running on host now (at least I think^^).
Is there a ways I can verify that?
From the UI menu you will be able to verify it by going to the port menu. If the ports settings page is "off limits" then you are running in host mode.

yourls still throws mysqlconnection refused.
I imagine I'll have to change the address and port now?
Atm, maria is running on it default port (3306) or sometimes on 3307. If the yourls container can stay up and running even if you get that connection error, you could try and use the Terminal window for that container in order to test your connection towards Maria instance. If that will work then network visibility is not the issue.

So go to Terminal tab for yourls container and click create and then enter bash and hit return. You should land in a terminal root of yourls container (similar to this), root@883927b86efd:/var/www/html#

Now run apt-get update, to get the latest updates of repositories and after that install telnet command by using: apt-get install telnet.

When telnet has installed run this: telnet yourNASip mariaDBPortnumber and hit return. Something like this, telnet 192.168.10.20 3306.

If you will connect you will get something like:

Code:
Trying 192.168.10.20...
Connected to 192.168.10.20.
Escape character is '^]'.

This will mean that the container can in fact see and connect to MariaDB port. This will also mean that the problem that you are having is maybe due to user permissions/account or password, or the problem is permission on the DB itself.
 
Unfortunately Maria is not showing anything under Port Settings. (see imgs attached)
Also the yourls container stops every time the "refused connection"error occurs. :(
 

Attachments

  • chrome_q8nHMfFRDN.png
    chrome_q8nHMfFRDN.png
    3.7 KB · Views: 30
  • chrome_3SaRyuJEWM.png
    chrome_3SaRyuJEWM.png
    3.4 KB · Views: 32

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

That is about the GB Ethernet maximum speed. 984/ 8 = about 120MB/s relatively high, not an average.
Replies
1
Views
750
Please bare in mind that this approach will not allow to issue letsencrypt wilcard certificates for your...
Replies
6
Views
4,872
Never mind, mistake on my part. I guess the link lights don't come on.
Replies
1
Views
1,118
If this is a one-time deal, it might be a good idea to do this through Resilio Sync instead.
Replies
11
Views
1,435

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Back
Top