Seafile WYSIWYG-editor: File not found

I use seafile v13 (CE, docker-compose). When I try to open a .md file in the editor I get displayed inside the editor:

    <div id="header" class="d-flex">
        <a href="/" id="logo" aria-label="Private Seafile" title="Private Seafile">
            <img src="/media/img/seafile-logo.png" title="Private Seafile" alt="logo" width="" height="32" />
        </a>        
    </div>
    <div id="main" class="container-fluid w100 flex-auto ov-auto">
       
Die Datei ist nicht vorhanden
    </div>

But other file types can be opened without problems. Does anybody know why I can’t open md files? My guess is that this is related to the handling of http/https.

My configuration:

On the host system, I have nginx configured as follows:

server {
    listen 443 ssl;
    server_name myserver.selfhost.eu;

    ssl_certificate      /mnt/share/seafile-data/seafile/ssl/myserver.selfhost.eu.crt;
    ssl_certificate_key  /mnt/share/seafile-data/seafile/ssl/myserver.selfhost.eu.key;

    location / {
        proxy_pass http://127.0.0.1:18080;
        proxy_set_header Host $host;
        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 $scheme;
    }

    location /seafdav {
        proxy_pass http://127.0.0.1:8002;     # WebDAV HTTP
        proxy_set_header Host $host;
        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 $scheme;
    }
}

This means that requests are forwarded as http to the seafile container on port 18080.

The docker compose looks like this:

  seafile:
    image: ${SEAFILE_IMAGE}
    container_name: seafile
    ports:
      - "18080:80"
      - "8002:8080" # this is for webdav 
...

Some variables in my .env:

SEAFILE_SERVER_LETSENCRYPT=false
SEAFILE_SERVER_HOSTNAME=myserver.selfhost.eu
SEAFILE_SERVER_PROTOCOL=https

When I change SEAFILE_SERVER_PROTOCOL to http, the browser does not load the file due to “mixed content”.

How does Markdown online view work in Seafile

In Seafile, when a user opens a Markdown file in the browser, the Markdown view page is displayed. This page subsequently loads the content of the Markdown file through a link provided by the server.

The link resembles the following format: https://seafile.example.com/seafhttp/repos/41637945-4991-4f0e-a1ec-f9cf7191defb/files/foo.md/?op=download .

The link is generated based on your configuration of SEAFILE_SERVER_PROTOCOL and SEAFILE_SERVER_HOSTNAME in the .env file. If your SEAFILE_SERVER_PROTOCOL is https and SEAFILE_SERVER_HOSTNAME is seafile.example.com. The generated link will be like https://seafile.example.com/seafhttp/xxxx

How to troubleshooting

In any case, you should utilize the browser console to verify the URL being used to load the Markdown file content.

If the URL is incorrect, you should review your settings for SEAFILE_SERVER_PROTOCOL and SEAFILE_SERVER_HOSTNAME.

If you have upgraded your server from an older version, such as version 11 or below, be sure to remove the SERVICE_URL and FILE_SERVER_ROOT settings in seahub_settings.py. These two settings are no longer in use, and if they are set to an incorrect value, you may encounter errors when loading Markdown files and other files.

1 Like

Found the solution - quite funny actually :smiley:

My .env looked like this:

SEAFILE_SERVER_LETSENCRYPT=false		# https is managed by the host nginx
SEAFILE_SERVER_HOSTNAME=myserver.selfhost.eu	# Specifies your host name if https is enabled
SEAFILE_SERVER_PROTOCOL=https			# https is managed by the host nginx

The comments were included into the urls which were tried to load! As soon as I removed the comments, it worked. Is this maybe a bug?