Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. LAMP
  3. Deeplinking media files from external volumes

Deeplinking media files from external volumes

Scheduled Pinned Locked Moved Solved LAMP
volumes
25 Posts 4 Posters 2.4k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • benborgesB Offline
      benborgesB Offline
      benborges
      wrote on last edited by girish
      #1

      I'm using a LAMP container to display the content of another container running tg-archive, by default tg-archive store media at the root of the site folder, inside a "media" folder.

      https://ukraine.osintukraine.com/

      But this is taking a lot of space (videos, images) so I started using a SSHFS mount volume to host the media folder, this means that in Cloudron context if I go to
      /media/dataua/media/ I can see all my media files from the command line from inside the container.

      But ultimately I want to be able to link to these files from the LAMP container html index, I already tried to change media path to /media/dataua/media/ but it seems the Apache server cannot see those files ?

      default cloudron data volume

      • /app/data/public
        --- media
        --- index.html

      sshfs data volume assigned to this LAMP container

      • /media/dataua/media/

      I also tried to "move" the default storage to the newly mounted volume, it seems cloudron is doing the operation but the container restart none of the files from the previous appdata/target have been moved to the new location, it's just empty.

      Maybe I have to be on the latest cloudron to be able to use volumes the way I want ?

      anyway, any help very much appreciated & thanks in advance !

      BenB

      girishG 2 Replies Last reply
      0
      • benborgesB benborges

        I'm using a LAMP container to display the content of another container running tg-archive, by default tg-archive store media at the root of the site folder, inside a "media" folder.

        https://ukraine.osintukraine.com/

        But this is taking a lot of space (videos, images) so I started using a SSHFS mount volume to host the media folder, this means that in Cloudron context if I go to
        /media/dataua/media/ I can see all my media files from the command line from inside the container.

        But ultimately I want to be able to link to these files from the LAMP container html index, I already tried to change media path to /media/dataua/media/ but it seems the Apache server cannot see those files ?

        default cloudron data volume

        • /app/data/public
          --- media
          --- index.html

        sshfs data volume assigned to this LAMP container

        • /media/dataua/media/

        I also tried to "move" the default storage to the newly mounted volume, it seems cloudron is doing the operation but the container restart none of the files from the previous appdata/target have been moved to the new location, it's just empty.

        Maybe I have to be on the latest cloudron to be able to use volumes the way I want ?

        anyway, any help very much appreciated & thanks in advance !

        girishG Do not disturb
        girishG Do not disturb
        girish
        Staff
        wrote on last edited by
        #2

        @benborges said in Deeplinking media files from external volumes:

        But ultimately I want to be able to link to these files from the LAMP container html index, I already tried to change media path to /media/dataua/media/ but it seems the Apache server cannot see those files ?

        Can you clarify what you mean by media path ? You have to fixup apache config - https://docs.cloudron.io/apps/lamp/#apache-settings

        1 Reply Last reply
        0
        • girishG girish moved this topic from Support on
        • benborgesB benborges

          I'm using a LAMP container to display the content of another container running tg-archive, by default tg-archive store media at the root of the site folder, inside a "media" folder.

          https://ukraine.osintukraine.com/

          But this is taking a lot of space (videos, images) so I started using a SSHFS mount volume to host the media folder, this means that in Cloudron context if I go to
          /media/dataua/media/ I can see all my media files from the command line from inside the container.

          But ultimately I want to be able to link to these files from the LAMP container html index, I already tried to change media path to /media/dataua/media/ but it seems the Apache server cannot see those files ?

          default cloudron data volume

          • /app/data/public
            --- media
            --- index.html

          sshfs data volume assigned to this LAMP container

          • /media/dataua/media/

          I also tried to "move" the default storage to the newly mounted volume, it seems cloudron is doing the operation but the container restart none of the files from the previous appdata/target have been moved to the new location, it's just empty.

          Maybe I have to be on the latest cloudron to be able to use volumes the way I want ?

          anyway, any help very much appreciated & thanks in advance !

          girishG Do not disturb
          girishG Do not disturb
          girish
          Staff
          wrote on last edited by
          #3

          @benborges I did a quick test. I attached a volume which has some images:

          root@4213cfdd-b0fd-4325-9763-ec8ac002116d:/app/code# ls -l /media/blockstorage/images/
          total 260
          -rw-r--r-- 1 www-data www-data 265746 Jan  1  2021 artemis-fowl.jpeg
          

          I added this block to the apache config inside the VirtualHost in /app/data/apache/app.conf:

              Alias /images /media/blockstorage/images
              <Location /images>
                  Require all granted
              </Location>
          

          Restart the apps and I can access https://lamp.domain.com/images/artemis-fowl.jpeg.

          Not sure if this is what you are looking for though?

          benborgesB 2 Replies Last reply
          3
          • girishG girish

            @benborges I did a quick test. I attached a volume which has some images:

            root@4213cfdd-b0fd-4325-9763-ec8ac002116d:/app/code# ls -l /media/blockstorage/images/
            total 260
            -rw-r--r-- 1 www-data www-data 265746 Jan  1  2021 artemis-fowl.jpeg
            

            I added this block to the apache config inside the VirtualHost in /app/data/apache/app.conf:

                Alias /images /media/blockstorage/images
                <Location /images>
                    Require all granted
                </Location>
            

            Restart the apps and I can access https://lamp.domain.com/images/artemis-fowl.jpeg.

            Not sure if this is what you are looking for though?

            benborgesB Offline
            benborgesB Offline
            benborges
            wrote on last edited by
            #4

            @girish This is exactly what I was looking, even better because I don't have to replace any of my path now, this is actually perfect, thank you very much for taking the time to test it !

            demo here https://russia.osintukraine.com/#2022-06-11

            BenB

            1 Reply Last reply
            1
            • nebulonN nebulon marked this topic as a question on
            • nebulonN nebulon has marked this topic as solved on
            • girishG girish

              @benborges I did a quick test. I attached a volume which has some images:

              root@4213cfdd-b0fd-4325-9763-ec8ac002116d:/app/code# ls -l /media/blockstorage/images/
              total 260
              -rw-r--r-- 1 www-data www-data 265746 Jan  1  2021 artemis-fowl.jpeg
              

              I added this block to the apache config inside the VirtualHost in /app/data/apache/app.conf:

                  Alias /images /media/blockstorage/images
                  <Location /images>
                      Require all granted
                  </Location>
              

              Restart the apps and I can access https://lamp.domain.com/images/artemis-fowl.jpeg.

              Not sure if this is what you are looking for though?

              benborgesB Offline
              benborgesB Offline
              benborges
              wrote on last edited by benborges
              #5

              @girish Last question, how did you gave www-data permissions to files inside the remote volume attached to the container ?

              In my use case they belong to a completely different user in another linux system so i'm a bit confused on how I should give proper permissions so that the apache web server can access these files.

              BenB

              jdaviescoatesJ 1 Reply Last reply
              0
              • benborgesB benborges

                @girish Last question, how did you gave www-data permissions to files inside the remote volume attached to the container ?

                In my use case they belong to a completely different user in another linux system so i'm a bit confused on how I should give proper permissions so that the apache web server can access these files.

                jdaviescoatesJ Offline
                jdaviescoatesJ Offline
                jdaviescoates
                wrote on last edited by jdaviescoates
                #6

                @benborges you can do that using the File Manager for the Volume

                I use Cloudron with Gandi & Hetzner

                benborgesB 1 Reply Last reply
                0
                • jdaviescoatesJ jdaviescoates

                  @benborges you can do that using the File Manager for the Volume

                  benborgesB Offline
                  benborgesB Offline
                  benborges
                  wrote on last edited by
                  #7

                  @jdaviescoates Yes that's how I usually do it but here, I have so many files in my media folder that the Filemanager crash during the operation .

                  BenB

                  girishG benborgesB 2 Replies Last reply
                  0
                  • benborgesB benborges

                    @jdaviescoates Yes that's how I usually do it but here, I have so many files in my media folder that the Filemanager crash during the operation .

                    girishG Do not disturb
                    girishG Do not disturb
                    girish
                    Staff
                    wrote on last edited by
                    #8

                    @benborges Maybe there's too many files causing some crash. Are you able to go one level up and change permissions at directory level ? There is an option to change permissions recursively. Does that work?

                    benborgesB 1 Reply Last reply
                    1
                    • girishG girish

                      @benborges Maybe there's too many files causing some crash. Are you able to go one level up and change permissions at directory level ? There is an option to change permissions recursively. Does that work?

                      benborgesB Offline
                      benborgesB Offline
                      benborges
                      wrote on last edited by
                      #9

                      @girish it does work for cloudron containers/volumes but since this is a filesystem on another system under another user, I'm not sure it can even change those permissions ?

                      And actually, it seems the fact those files are being handled by Apache, maybe I don't need to change permission at all?

                      BenB

                      girishG 1 Reply Last reply
                      0
                      • benborgesB benborges

                        @girish it does work for cloudron containers/volumes but since this is a filesystem on another system under another user, I'm not sure it can even change those permissions ?

                        And actually, it seems the fact those files are being handled by Apache, maybe I don't need to change permission at all?

                        girishG Do not disturb
                        girishG Do not disturb
                        girish
                        Staff
                        wrote on last edited by
                        #10

                        @benborges As long as it's readable by apache (which runs as www-data user), we should be good. Change in ownership is not needed.

                        1 Reply Last reply
                        1
                        • benborgesB benborges

                          @jdaviescoates Yes that's how I usually do it but here, I have so many files in my media folder that the Filemanager crash during the operation .

                          benborgesB Offline
                          benborgesB Offline
                          benborges
                          wrote on last edited by
                          #11

                          @benborges said in Deeplinking media files from external volumes:

                          @jdaviescoates Yes that's how I usually do it but here, I have so many files in my media folder that the Filemanager crash during the operation .

                          will have tg-archive to store media files in sub directories by month/day and problem solved 🙂

                          Thanks again for the support !

                          BenB

                          benborgesB 1 Reply Last reply
                          0
                          • benborgesB benborges

                            @benborges said in Deeplinking media files from external volumes:

                            @jdaviescoates Yes that's how I usually do it but here, I have so many files in my media folder that the Filemanager crash during the operation .

                            will have tg-archive to store media files in sub directories by month/day and problem solved 🙂

                            Thanks again for the support !

                            benborgesB Offline
                            benborgesB Offline
                            benborges
                            wrote on last edited by
                            #12

                            @girish I'm interested to do the exact same thing but with other cloudron apps, like in my usecase NocoDB or Baserow, but those two apps don't have an Apache config block like the LAMP does, so i'm wondering before opening a new topic on the NocoDB app here on the forum if this is even possible ?

                            BenB

                            girishG 1 Reply Last reply
                            0
                            • benborgesB benborges

                              @girish I'm interested to do the exact same thing but with other cloudron apps, like in my usecase NocoDB or Baserow, but those two apps don't have an Apache config block like the LAMP does, so i'm wondering before opening a new topic on the NocoDB app here on the forum if this is even possible ?

                              girishG Do not disturb
                              girishG Do not disturb
                              girish
                              Staff
                              wrote on last edited by
                              #13

                              @benborges are you not able to move the NocoDB / Baserow files to a volume and just access via LAMP app?

                              1 Reply Last reply
                              0
                              • girishG Do not disturb
                                girishG Do not disturb
                                girish
                                Staff
                                wrote on last edited by
                                #14

                                Ah, I see now. You can't mount the app data directory of an app into another app. This would just result in corruption since an app's data directory is like a database and having other apps access it will cause integrity issues.

                                Do you only want readonly access from LAMP app into the other apps' data? If so, maybe that is something worth exploring.

                                benborgesB 1 Reply Last reply
                                0
                                • girishG girish

                                  Ah, I see now. You can't mount the app data directory of an app into another app. This would just result in corruption since an app's data directory is like a database and having other apps access it will cause integrity issues.

                                  Do you only want readonly access from LAMP app into the other apps' data? If so, maybe that is something worth exploring.

                                  benborgesB Offline
                                  benborgesB Offline
                                  benborges
                                  wrote on last edited by
                                  #15

                                  Hmmm interesting but I think what I want to do is the reverse, right now I have a LAMP mounted with a SSHfs volumes that contains my media files (terabytes of data) it's working perfectly, these LAMP static site are generated using tg-archive from a SQLite static database.

                                  I copied this database inside my nocodb container and opened it with nocodb
                                  I can see the content just fine but my media files are not accessible from nocodb

                                  I wish I could just mount the same volume on the nocodb container and than modify paths/domain and have nocodb able to access these same media files
                                  07bc6d91-8e07-484b-89b9-305c06e754a8-image.png

                                  BenB

                                  girishG 1 Reply Last reply
                                  0
                                  • benborgesB benborges

                                    Hmmm interesting but I think what I want to do is the reverse, right now I have a LAMP mounted with a SSHfs volumes that contains my media files (terabytes of data) it's working perfectly, these LAMP static site are generated using tg-archive from a SQLite static database.

                                    I copied this database inside my nocodb container and opened it with nocodb
                                    I can see the content just fine but my media files are not accessible from nocodb

                                    I wish I could just mount the same volume on the nocodb container and than modify paths/domain and have nocodb able to access these same media files
                                    07bc6d91-8e07-484b-89b9-305c06e754a8-image.png

                                    girishG Do not disturb
                                    girishG Do not disturb
                                    girish
                                    Staff
                                    wrote on last edited by
                                    #16

                                    @benborges Not sure who/what creates this SQLite database, but if that is in a volume of it's own, then you can mount that volume into nocodb. And then , nocodb can open the file from that volume, for example. Hope I understand your flow correctly.

                                    a0caf871-023b-4ed1-a459-3963579255d5-image.png

                                    benborgesB 1 Reply Last reply
                                    1
                                    • girishG girish

                                      @benborges Not sure who/what creates this SQLite database, but if that is in a volume of it's own, then you can mount that volume into nocodb. And then , nocodb can open the file from that volume, for example. Hope I understand your flow correctly.

                                      a0caf871-023b-4ed1-a459-3963579255d5-image.png

                                      benborgesB Offline
                                      benborgesB Offline
                                      benborges
                                      wrote on last edited by
                                      #17

                                      @girish The source of this sqlite database is tg-archive, a piece of code to archive telegram channels with media files;

                                      right now I have what you suggest covered, I have my 4 sqlite database inside nocodb run by cloudron
                                      I have also 4 sshfs volumes that contains the media files

                                      My initial question is how to access these media files, exactly like the LAMP container "deep linking" with Apache
                                      but with the nocodb cloudron container;

                                      https://nocodb.osintukraine.com/dashboard/#/nc/view/12cbd8a1-9862-4a9f-96f8-c151076324da

                                      this is not the issue, the issue is how do I make my media files, accessible from nocodb attached/mounted sshfs volume that contains these media files ?

                                      78ca4bfc-1671-4e20-a3ae-1718eb97d711-image.png

                                      right now the URL field in my sqlite table does not point to anything because in the original context of this database, the path to the domain is defined in the config.yaml file but exactly like for the LAMP container, I'm wondering how I can just say to nocodb the media files are at /media/

                                      BenB

                                      robiR girishG 2 Replies Last reply
                                      0
                                      • benborgesB benborges

                                        @girish The source of this sqlite database is tg-archive, a piece of code to archive telegram channels with media files;

                                        right now I have what you suggest covered, I have my 4 sqlite database inside nocodb run by cloudron
                                        I have also 4 sshfs volumes that contains the media files

                                        My initial question is how to access these media files, exactly like the LAMP container "deep linking" with Apache
                                        but with the nocodb cloudron container;

                                        https://nocodb.osintukraine.com/dashboard/#/nc/view/12cbd8a1-9862-4a9f-96f8-c151076324da

                                        this is not the issue, the issue is how do I make my media files, accessible from nocodb attached/mounted sshfs volume that contains these media files ?

                                        78ca4bfc-1671-4e20-a3ae-1718eb97d711-image.png

                                        right now the URL field in my sqlite table does not point to anything because in the original context of this database, the path to the domain is defined in the config.yaml file but exactly like for the LAMP container, I'm wondering how I can just say to nocodb the media files are at /media/

                                        robiR Offline
                                        robiR Offline
                                        robi
                                        wrote on last edited by
                                        #18

                                        @benborges Since you have the mount as in your screen shot, you should be able to open the Terminal to the NocoDB container and see that /media/dataua exists with your files in it.

                                        That would be the path to use from within NocoDB to reference any files.

                                        Conscious tech

                                        benborgesB 1 Reply Last reply
                                        1
                                        • robiR robi

                                          @benborges Since you have the mount as in your screen shot, you should be able to open the Terminal to the NocoDB container and see that /media/dataua exists with your files in it.

                                          That would be the path to use from within NocoDB to reference any files.

                                          benborgesB Offline
                                          benborgesB Offline
                                          benborges
                                          wrote on last edited by
                                          #19

                                          @robi I agree, that's exactly how I use it in the LAMP container, but it only works thanks to this config

                                          @girish said in Deeplinking media files from external volumes:

                                          @benborges I did a quick test. I attached a volume which has some images:

                                          root@4213cfdd-b0fd-4325-9763-ec8ac002116d:/app/code# ls -l /media/blockstorage/images/
                                          total 260
                                          -rw-r--r-- 1 www-data www-data 265746 Jan  1  2021 artemis-fowl.jpeg
                                          

                                          I added this block to the apache config inside the VirtualHost in /app/data/apache/app.conf:

                                              Alias /images /media/blockstorage/images
                                              <Location /images>
                                                  Require all granted
                                              </Location>
                                          

                                          Restart the apps and I can access https://lamp.domain.com/images/artemis-fowl.jpeg.

                                          Not sure if this is what you are looking for though?

                                          BenB

                                          1 Reply Last reply
                                          0
                                          • benborgesB benborges

                                            @girish The source of this sqlite database is tg-archive, a piece of code to archive telegram channels with media files;

                                            right now I have what you suggest covered, I have my 4 sqlite database inside nocodb run by cloudron
                                            I have also 4 sshfs volumes that contains the media files

                                            My initial question is how to access these media files, exactly like the LAMP container "deep linking" with Apache
                                            but with the nocodb cloudron container;

                                            https://nocodb.osintukraine.com/dashboard/#/nc/view/12cbd8a1-9862-4a9f-96f8-c151076324da

                                            this is not the issue, the issue is how do I make my media files, accessible from nocodb attached/mounted sshfs volume that contains these media files ?

                                            78ca4bfc-1671-4e20-a3ae-1718eb97d711-image.png

                                            right now the URL field in my sqlite table does not point to anything because in the original context of this database, the path to the domain is defined in the config.yaml file but exactly like for the LAMP container, I'm wondering how I can just say to nocodb the media files are at /media/

                                            girishG Do not disturb
                                            girishG Do not disturb
                                            girish
                                            Staff
                                            wrote on last edited by
                                            #20

                                            @benborges said in Deeplinking media files from external volumes:

                                            right now the URL field in my sqlite table does not point to anything because in the original context of this database, the path to the domain is defined in the config.yaml file but exactly like for the LAMP container, I'm wondering how I can just say to nocodb the media files are at /media/

                                            I think I understand what you are saying. You want https://nocodb.osintukraine.com/media/date/3.MP4 to somehow work. So, this won't work currently because it's not possible to override paths of nocodb like we do in the LAMP app. In the LAMP app, since the app is something we control, it's fine to configure paths the way we want. Doing the same for nocodb is going to cause problems at some point. For example, what it nocodb starts serving things in /media from next release. Or maybe it uses that path already for some internal use, who knows.

                                            So, instead, what do you think of either a) linking these to the LAMP app itself or b) setup a separate LAMP app instance under static.osintukraine.com and make it serve images from there. Nocodb can simple reference this for "static" contents. Would some idea like that work?

                                            benborgesB 1 Reply Last reply
                                            2
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes


                                              • Login

                                              • Don't have an account? Register

                                              • Login or register to search.
                                              • First post
                                                Last post
                                              0
                                              • Categories
                                              • Recent
                                              • Tags
                                              • Popular
                                              • Bookmarks
                                              • Search