Hey all, I’ve been trying to get up and running with Friendica in a docker container behind Nginx Proxy Manager and connected to a separate MariaDB container.

The scenario that I have is that the only combination I’ve gotten to work to connect to Friendica is to use the alpine docker image with the complete web server, as putting configs into separate nginx instances wasn’t getting me anywhere. However, using the full image, I can get to the UI and do the install to set things that I already set in env variables(?) whatever.

But what happens is that when it goes to save, it fails to save to the DB and maria db says that it rejected the connection for unauthenticated user and unknown host (implying to me that it rejected the connection before it even pulled this info). But the thing is that I’ve been able to shell into the friendica container and connect to the MariaDB. I can use adminer and log in as the friendica user to the friendica db that I created. Has anyone run in to this?

I’m starting to wonder if I need to use actual MySQL, maybe? This is a very strange issue as I’ve been able to create the database, user with privileges, and log in as that user. The host name for the user is ‘%’, so ‘friendica’@‘%’.

I’d appreciate any help that I could get there.

    • RagingHungryPanda@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      2 days ago

      Thank you for the help. Here is the last set of configurations that I was running.
      Edit: this is running on my TrueNas server.

      networks:
        maria-db-network:
          external: True
      services:
        friendica:
          build: /mnt/MainStorage/apps/friendica/config/app
          environment:
            - FRIENDICA_ADMIN_MAIL=<admin email>
            - FRIENDICA_TZ=America/Chicago
            - FRIENDICA_LANG=en-US
            - FRIENDICA_URL=https://friendica.michaeldileo.org/
            - FRIENDICA_SITENAME=Michael DiLeo's Friendica
            - SMTP=<the smtp>
            - SMTP_DOMAIN=<smtp domain
            - SMTP_FROM=admin
            - SMTP_AUTH_USER=<le user>
            - SMTP_AUTH_PASS=<auth pass>
            - SMTP_TLS=true
            - SMTP_STARTTLS=true
            - MYSQL_PASSWORD=<db pass>
            - MYSQL_DATABASE=friendica
            - MYSQL_USER=friendica
            - MYSQL_HOST=mariadb
            - MYSQL_PORT=3306
          image: friendica
          networks:
            - maria-db-network
          ports:
            - '30110:80'
          volumes:
            - /mnt/MainStorage/apps/friendica/data:/var/www/html
            - /mnt/MainStorage/apps/friendica/config/app:/app
      

      addon.config.php file:

      <?php
      
      return [
      	'system' => [
      		'cache_driver' => 'redis',
      		'lock_driver' => 'redis',
      
      		'redis_host' => 'redis',
      
      		'pidfile' => '/var/run/friendica.pid',
      	]
      ];
      

      docker file in the config folder

      FROM friendica:friendica
      
      RUN mkdir -p /usr/src/config
      COPY addon.config.php /usr/src/config/
      
      • slazer2au@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 days ago

        My limited knowledge of compose makes me think that the MYSQL_HOST is not resolving mariadb because the entire service is missing from the compose file.

        If you add the mariadb container as another service in this compose do things start working?

        • RagingHungryPanda@lemm.eeOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 days ago

          It didn’t really change when I put the db in the same compose file. I have them on the same docker network, so any container can reference any other container by its name, in this case mariadb and access any ports, not just the ones that are exposed.

          Evidence for this working is that MariaDB is logging the rejected connection attempts.

            • RagingHungryPanda@lemm.eeOP
              link
              fedilink
              English
              arrow-up
              1
              ·
              20 hours ago

              Unfortunately no, it’s just one log line over and over. At some point it did have the username and IP, but it usually contains neither.