Link shortener

Currently reading
Link shortener

Sorry - can you please show me the way? I now how to move on the terminal to the config file, but dont know how to edit it.
 

Telos

Subscriber
1,858
621
NAS
DS418play, DS213j, DS3622+, DSM 7.1.4-11091
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]
 
50
11
NAS
DS1019+
Router
  1. RT2600ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
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)
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
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.
 
14
0
NAS
Synology DS918+
Operating system
  1. macOS
  2. Windows
Mobile operating system
  1. Android
  2. iOS
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.
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
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
 
14
0
NAS
Synology DS918+
Operating system
  1. macOS
  2. Windows
Mobile operating system
  1. Android
  2. iOS
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?
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
Is Maria also in docker or via Package Center? Accessing phpmyadmin, are you able to access the database?
 
14
0
NAS
Synology DS918+
Operating system
  1. macOS
  2. Windows
Mobile operating system
  1. Android
  2. iOS
Running via Package Center and yes, I'm able to access it.
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
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.
 
14
0
NAS
Synology DS918+
Operating system
  1. macOS
  2. Windows
Mobile operating system
  1. Android
  2. iOS
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?
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
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?
 
14
0
NAS
Synology DS918+
Operating system
  1. macOS
  2. Windows
Mobile operating system
  1. Android
  2. iOS
Last edited:
via the docker UI in DSM
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
Then when you will start to make the container on the Network tab there will be a check box for using host and not bridge network configuration.
 
14
0
NAS
Synology DS918+
Operating system
  1. macOS
  2. Windows
Mobile operating system
  1. Android
  2. iOS
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?
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
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), [email protected]:/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.
 
14
0
NAS
Synology DS918+
Operating system
  1. macOS
  2. Windows
Mobile operating system
  1. Android
  2. iOS
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: 14
  • chrome_3SaRyuJEWM.png
    chrome_3SaRyuJEWM.png
    3.4 KB · Views: 14

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

Please bare in mind that this approach will not allow to issue letsencrypt wilcard certificates for your...
Replies
6
Views
1,571
Never mind, mistake on my part. I guess the link lights don't come on.
Replies
1
Views
382
If this is a one-time deal, it might be a good idea to do this through Resilio Sync instead.
Replies
11
Views
748

Welcome to SynoForum.com!

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

Registration is free, easy and fast!

Top