Static Images Don't Display After Installation of Diaspora

Greetings!

I’ve been attempting to install and get a functional Diaspora pod for weeks now. After several tries using the official installation guide, while looking on the web for answers, I stumbled across koehn’s Docker Compose page. I downloaded the three example yml files (database, diaspora, docker-compose), edited them, added them all to one directory, and ran the docker-compose up -d command. After configuring the nginx as a reverse server and making several edits to the my .conf file, I managed to get the intro page; however, no images are displaying. I read the support documents which said that I need to make sure that the section in the diaspora.yml where it says url: has the correct URL. Currently, I am just using http as my pod address and haven’t enabled all the SSL stuff in the nginx conf file yet. I just want to see if I can get the pod working using just HTTP and if I can get it working, then I will add the SSL stuff.

I don’t know what else I can do. I’ve spend weeks trying to get it to work and days getting it to work using the Docker image.

I’m running the Docker on Debian 9. As you already know, the Docker yml make Postgres, Redis, and Diaspora containers.

Should I post my config files here? What’s the next step?

Thank you so much. I really really want to get Diaspora up and running.

UPDATE: 07/16/19

I’m including my nginx configuration file below.

nginx config file (located in /etc/nginx/conf.d)

Default server configuration

#gzip_static on;

server {
listen 80;
listen [::]:80;

server_name subdomain.domain.com;
root /home/diaspora/diaspora/public;

# Configure maximum picture size
# Note that Diaspora has a client side check set at 4M
client_max_body_size 5M;
client_body_buffer_size 256K;

Proxy if requested file not found

try_files $uri @diaspora;

location /assets/ {
  expires max;
  add_header Cache-Control public;
}

location @diaspora {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto https;

  proxy_set_header Host $http_host;
  proxy_redirect off;
  proxy_pass http://diaspora_server;

}
}

upstream diaspora_server {

server unix:/home/diaspora/diaspora/tmp/diaspora.sock;

  server 127.0.0.1:3000;

}

Docker-compose file (located in same directory as above)

version: ‘2’
services:
diaspora:
image: koehn/diaspora:latest
links:
- postgres
- redis
volumes:
- diaspora-images:/home/diaspora/diaspora/public/uploads/images
- ./diaspora.yml:/home/diaspora/diaspora/config/diaspora.yml:ro
- ./database.yml:/home/diaspora/diaspora/config/database.yml:ro
ports:
- ‘3000:3000’
restart: always

postgres:
read_only: true
mem_limit: 8G
image: postgres:10-alpine
tmpfs:
- /tmp
environment:
- POSTGRES_USER=diaspora
- POSTGRES_PASSWORD=somepassword*@123
- POSTGRES_DB=diaspora_production
volumes:
- postgres:/var/lib/postgresql/data
- postgres-run:/var/run/postgresql
restart: always

redis:
image: redis:latest
mem_limit: 384M
read_only: true
tmpfs:
- /tmp
command: redis-server --appendonly yes
volumes:
- redis:/data
restart: always

volumes:
diaspora-images:
postgres:
postgres-run:
redis:

I tried to add all the SSL stuff later and the site stop working altogether. It’s worse than before. :frowning:

I don’t have experience with Diaspora running on Docker but did you look at this issue? Seems to be the same problem you are experiencing.

Also you can’t change Diaspora URL after initial install (unless you start over with clean database and lose ability to use all existing accounts forever). I am not sure if it applies to http/https prefix but maybe it does so changing from HTTP to HTTPS after the install might be not the great idea. @supertux88 any comment on this?

Changing from http to https is the only change that works (however you probably want to change your passwords after you set up https, since you sent it unencrypted over the internet before). It’s everything documented in the diaspora.yml: https://github.com/diaspora/diaspora/blob/9bab794ea464ee602b2e315509adf17f0815b4f4/config/diaspora.yml.example#L32-L39

The solution you linked isn’t recommended for production. It maybe works for a small pod, but we recommend a reverse-proxy for the static files in production. It’s also documented in the diaspora.yml: https://github.com/diaspora/diaspora/blob/9bab794ea464ee602b2e315509adf17f0815b4f4/config/diaspora.yml.example#L135-L138
(I hope enabling that option is not the only possible solution with this docker-container to make static files work and it also supports the recommended solution with a reverse-proxy, but I don’t know how that docker-container works, so I can’t help with that)

It is certainly possible to serve static files directly but it would require modifying Koehn’s docker configuration (exposing static assets folder as a docker volume and pointing the proxy to it). But I am not confident enough to write the exact config in blind and I don’t use Docker :slight_smile:

But since the author decided to go with it and everything else it working I suppose they can try it this way and figure how to change it later when/if they experience performance hit.

Thank you for your reply. I tried the fix offered by the image author but it didn’t work either.

So, I’m back to installing Diaspora for the 10th time according to the official install directions. :frowning:

Feel free to ask these channels for help. If it’s our own guides, there is a high change we’ll be able to help you, as compared to third-party docker containers…

Thank you. :slight_smile:

I attempted to install Diaspora using the official instructions. I am installing on Debian 9, Postgres, Nginx.

Everything is going okay, but now I get the error message “FATAL: Can’t connect to redis. Please check if it’s running and if environment.redis is configured correctly in config/diaspora.yml” after running ./script/server

I edited the diaspora.yml file and commented out all the redis entries so that it will default to localhost. Is that correct?

Also, after updating diaspora.yml, how do I update Diaspora and restart the system with the new change?

Thank you! I really want to get this working so badly. :slight_smile:

UPDATE:
OMG! It finally worked.

1 Like

I am also using Docker containers for Diaspora. How did you end up making it work? Are you just serving the assets directly with environment.assets.serve?

Hi @mmance, there’s a Docker container for Diaspora that has been set up by long-term member @bradkoehn. https://github.com/koehn/diaspora-docker

This is not an officially supported installation method, but it has been in use successfully for a number of years, and I’m sure that @bradkoehn would be happy to help if you hit problems with it (he’s a good guy).