Difegue / LANraragi

Web application for archival and reading of manga/doujinshi. Lightweight and Docker-ready for NAS/servers.
https://lrr.tvc-16.science
MIT License
2.07k stars 135 forks source link

uploaded plugins gone if docker container recreated #980

Open theggs opened 3 weeks ago

theggs commented 3 weeks ago

LRR Version and OS Docker LANraragi v0.9.0

Bug Details Uploaded plugins are store in home/koyomi/lanraragi/lib/LANraragi/Plugin along with the default plugins. This directory is come from the image. As a result, when docker container recreate(e.g. for version upgrading, env vars updating), the directory will be restored, the uploaded plugins would gone. I have to upload the plugins, and configurate them again.

Expected: user uploaded plugins are put in an independent directory, so we can mount a local path to it.

Matching Logs Post any logs you have encountered when reproducing the bug.
If possible, switch the app to Debug Mode in order to have more logs. No Logs.

Screenshots If applicable, add screenshots to help explain your problem.

Nixis198 commented 3 weeks ago

I feel like this is a non-issue.

You should be able to make a volume map between the plugin folder in LANraragi to a system folder. It will keep any new/updated plugins and the database file will keep the settings.

Here is the command I ran to map the two folders. image

theggs commented 3 weeks ago

@Nixis198 I thought the local emty directory will overwrite the one in container when first running. Let me try it and feedback. Thanks.

theggs commented 3 weeks ago

@Nixis198 It does as I expected: mounting an empty directory would overwrite the oraginal path. All plugins are gone after startup. So it is not a solution.

Nixis198 commented 3 weeks ago

I made a pull request that adds the plugins folder to the dockerfile. So it should be easier to add when making your container. You will still have to reupload your plugins when/if this is accepted, but once you do it once you should be good. All your plugins will be stored not in the container, but in a local folder, and the database file should store your plugin settings.

theggs commented 3 weeks ago

I made a pull request that adds the plugins folder to the dockerfile. So it should be easier to add when making your container. You will still have to reupload your plugins when/if this is accepted, but once you do it once you should be good. All your plugins will be stored not in the container, but in a local folder, and the database file should store your plugin settings.

it is a good idea to use VOLUME! Thank you!

chierinyan commented 2 weeks ago

Another workaround is to directly mount the .pm file to the plugin dir

-v /path/to/your/fantasticPlugin.pm:/home/koyomi/lanraragi/lib/LANraragi/Plugin/<type>/fantasticPlugin.pm

Edit: I just relized that LRR just checks all subdirs under Plugin, so if you have a lot of plugins to manage, you can also mount a custom subdir

-v /path/to/your/plugins/:/home/koyomi/lanraragi/lib/LANraragi/Plugin/User
theggs commented 2 weeks ago

@chierinyan the uploaded plugins are put direct in Plugin. So even it checks all subdirs, the plugins wouldn't be in any subdirs.

shinji257 commented 2 hours ago

You can mount a subdir and just put the plugin in that subdir yourself rather than uploading via LANraragi.

theggs commented 2 hours ago

@shinji257 I understand what you mean. It can be treated as a workaround, rather than be a end user-oriented resolution.