• General
  • Connecting Nextcloud, Calibre-Web and External Storage

sean Hi again,

I've been toying with nextcloud, apps, calibreweb, syncing, ... on opalstack and on hetzner and I came to a few conclusions and a new question.

It turns out hetzner doesn't support external storage because of security reasons, so connecting another server to their nextcloud isn't possible.

Connecting a hetzner-nextcloud to an opalstack-instance is possible. But from what I understand it doesn't sync an an external storage locally. It just provides a webinterface to the external storage and temporarily caches it.
If I want to use Calibreweb on opalstack the files have to be somewhere within my user on opalstack.

I saw there is a nextcloudmd-client (https://docs.nextcloud.com/desktop/3.4/advancedusage.html#install-nextcloudcmd) that can be triggered to sync a nextcloud-account. But I assume using rclone with a cronjob might to the same thing?

My setup would be installing calibreweb on opalstack and using rclone to daily sync my ebooklibrary with my nextcloud at hetzner which syncs with calibre on my laptop amongst other things.

Do you consider that the best solution given the current situation? (until opalstack comes with similar storage solutions 🙂).

  • sean replied to this.

    HelenaGwyn I don't think nextcloudcmd would help with this. That tool syncs from a Nextcloud instance to a client directory, but it doesn't sync files between 2 Nextcloud instances, which I think is what you want to do?

    If you use rclone (or any other external sync tool) to sync files directly into the Nextcloud filesystem, ie into ~/apps/nextcloud/data/username/files then you'll need to tell Nextcloud to sync up its database after the file sync is complete. The commands to do that are:

    cd ~/apps/nextcloud
    php74 occ files:scan --all

    So you'd need to incorporate that into whatever cron job you run for your sync.

      sean I want one location to sync all my files with (on hetzner in this case) and serve my ebooklibrary with calibreweb on opalstack. Connecting two nextcloud-instances doesn't work for this use case from what I understand. Calibreweb needs to be pointed to the folder with the database and files. Adding an external storage in nextcloud, doesn't sync the external files, it just shows them in the webinterface. Or I don't know where to look for them.
      At the moment there's no need to sync directly with a nextcloud on opalstack, I just want my ebooklibrary served on opalstack.

      • sean replied to this.

        HelenaGwyn in that case I think you should be able to use any sync tool (rclone, rsync, whatever) to sync the Calibre library directories on each end.

          9 months later

          sean Is it ok or allowed to use rclone mount to have the external library connected to CalibreWeb. The documentation says it needs rclone mount --vfs-cache-mode=full --file-perms=0777 cloud:Calibre_folder local:mountpoint to be able to work.

          • sean replied to this.
            2 months later

            sean

            Hi, I would like to serve multiple libraries as subfolders under the same domain: domain.ext/ebooks, domain.ext/courses, ...

            How do I implement this? I found this in calibre-web's documentation: https://github.com/janeczku/calibre-web/wiki/FAQ#how-to-handle-multiple-calibre-libraries

            Or can I just create two python-apps under the same shelluser and a private nginx with a configuration found at: https://github.com/janeczku/calibre-web/issues/19#issuecomment-220866727.

            • sean replied to this.

              HelenaGwyn I think you'll need to combine both, ie you'll need to run a separate instance of calibreweb for each library and then wire them all up to a private Nginx instance.

              For each additional instance of calibreweb you'll need to create a new "Nginx Proxy Port" app and then start a new instance of the existing cps script listening on the new port assignment and pointing at a new database, eg:

              # replace NNNNN with your port assignment
              export CALIBRE_PORT=NNNNN 
              # replace XXXXX with the library name
              ( nohup ~/apps/name_of_app/env/bin/cps -i 127.0.0.1 -p $HOME/.calibre-web/XXXXX-app.db -g $HOME/.calibre-web/XXXXX-gdrive.db >> ~/logs/apps/name_of_app/name_of_app.log 2>&1 & )

              Then in your Nginx instance config, each Calibreweb instance will get a location block like so:

                  # replace XXXXX and NNNNN with your library name and port assignment as above.
                  location /XXXXX {
                      proxy_pass http://127.0.0.1:NNNNN;
                      proxy_set_header Host $http_host;
                      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                      proxy_set_header X-Forwarded-Host $server_name;
                      proxy_set_header X-Scheme $scheme;
                      proxy_set_header X-Script-Name /XXXXX;
                  }

                sean Thanks, all give it a try.

                I won't be using Google Drive for my storage though but a nextcloud-instance mounted with rclone. So I assume that just means leaving out the -g variable and configuring the database)location during the setup of the instance itself. Is $HOME/.calibreweb/<library_name> the best location to mount my database-folders?

                And I had already been trying with two python-apps. I tried deleting the second one (comics_library on Opal9), which still had a mounted folder in it when initiating the deletion. I unmoutend and removed the folder afterwards, but the 'deleting' seems to be stuck. I assume that's something you have resolve?

                • sean replied to this.

                  HelenaGwyn So I assume that just means leaving out the -g variable and configuring the database)location during the setup of the instance itself.

                  In my testing Calibreweb created a gdrive database whether I told it to or not. If you run into problems without specifying the path then go ahead and include it as I've shown.

                  HelenaGwyn Is $HOME/.calibreweb/<library_name> the best location to mount my database-folders?

                  $HOME/.calibre-web is the default location that Calibreweb sets up, you're free to change it if you like.

                  HelenaGwyn the 'deleting' seems to be stuck. I assume that's something you have resolve?

                  Yep, something was stuck on our end. All clear now!

                    sean I'm new to configuring nginx. I managed to install the private instance with a default app for the root, but adding the locations for the subfolders keeps on giving me 'Not found'.

                    I'm also not able to stop or kill the uwsgi somehow.

                    • sean replied to this.
                      a year later

                      Personally, I've explored similar setups and found that connecting multiple Nextcloud instances across different servers and domains is possible, though it requires setting up federation between them. As for cost-effective cloud space, options like Hetzner's Storage Boxes look promising for mounting storage directly in the interface.Also, sharing ebook files between users while keeping annotations private might need some customization but is achievable with careful setup. If you're still exploring options, I recently came across a method on how to migrate from Sage 100, which might offer insights applicable to managing diverse data setups.

                      Mastodon