tsgoff / docker-yourls

yourls
2 stars 18 forks source link

plugins symlink does not work as plugins folder already exists #4

Open PAFsec opened 7 years ago

PAFsec commented 7 years ago

Hello,

Thank you for your docker.

As describe in the title, the plugins symlink is not created under the user/ folder, as a folder already exists. It is rather created under user/plugins/plugins which makes YOURLS not taking it in account.

I am mounting a volume like so in my docker-compose.yml (in order to restore my previous plugins) :

volumes:
  - /my/YOURLS/data:/data

In order to always /bin/mv $YOURLS_PATH/plugins /data you should first check if it exists. If so, /bin/rm -R $YOURLS_PATH/plugins, otherwise /bin/mv $YOURLS_PATH/plugins /data. This way, you are ensuring the fact that it is never present in the folder before the symbolic link is created.

Thank you in advance.

tsgoff commented 7 years ago

Hi PAFsec, thank you for your feedback. I see the Problem. That should do the trick: 222 /bin/mv $YOURLS_PATH/plugins /data 223 ln -s /data/plugins/ $YOURLS_PATH/ I will test it later.