#737·dufs

dufs 0.46.0 apparently doesn't perform the placeholder substitution on the 404 response.

Author: hysonleeCreated Aug 28, 2026Updated Aug 28, 2026

Problem 1

I'm running dufs 0.46.0 as a downloaded binary in Linux, after setting up and it works fine. Then I set a simple 404.html stay with index.html under my assets folder, 404.html code be like :

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/svg+xml" href="__ASSETS_PREFIX__logo.svg">
    <title>404 Page Not Found</title>

From my observation, the icon href "__ASSETS_PREFIX__logo.svg" works in index.html but not my 404.html, dufs v0.46.0 does not process __ASSETS_PREFIX__ in 404.html.

F12 debug: icon URL in index.html:

http://127.0.0.1:5000/__dufs_v0.46.0__/logo.svg

icon URL in 404.html:

http://127.0.0.1:5000/__ASSETS_PREFIX__logo.svg

So the browser not found the icon file.

Problem 2

I set path-prefix in config file, yaml be like:

## config.yaml
bind: 0.0.0.0
port: 5000
path-prefix: /drive

<a> link in 404.html page be like:

## 404.html
<div class="container">
    <h1>404</h1>
    <h2><br>Oops! Page Not Found</h2>
    <a href="/" class="btn"><br>Go to Homepage</a>
</div>

So click "Go to Homepage" it back to the root / without a path-prefix /drive and page show "Invalid Path".

My short-term solution

Hard-coding the relative URL in 404.html:

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/svg+xml" href="/drive/__dufs_v0.46.0__/logo.svg">
    <title>404 Page Not Found</title>
.
.
.
<div class="container">
    <h1>404</h1>
    <h2><br>Oops! Page Not Found</h2>
    <a href="/drive" class="btn"><br>Go to Homepage</a>
</div>