Single-user mode
ThirtyFile as a file manager for one person in a sandbox: no sign-in, no accounts, one folder.
On this page
What changes
Single-user mode is for a place only you can reach: a sandbox, a virtual machine, a container on your own computer. You open the page and the files are there. It is off unless you turn it on, and a normal server is not affected.
- No sign-in. Everyone who reaches the page is the same person. There are no accounts, passwords or two-factor codes.
- One folder. The files are the ordinary files of the folder you choose (
THIRTYFILE_FILES), or of several named folders (below). Browse, upload, download, create, edit, rename, move and delete them, with the same previews, search, tags, trash and editors as always. Anything you change in the folder from outside shows up too. - Nothing for several people. Users and groups, permissions, share links, guests, the Control panel, notifications, WebDAV, S3 buckets and FTP receive folders are not just hidden but switched off: the server doesn't answer them. SFTP stays off too.
- Only that folder. The server reads and writes only inside it. Links in it that point elsewhere are skipped, as in every folder space.
Run it in Docker
docker run -d --name thirtyfile --restart unless-stopped \
-p 127.0.0.1:8080:8080 \
-v /srv/thirtyfile/data:/data \
-v /srv/work:/files \
-e THIRTYFILE_SINGLE_USER=true \
-e THIRTYFILE_FILES=/files \
-e THIRTYFILE_RUN_AS=1000:1000 \
ghcr.io/thirtyfile/thirtyfile:latest
| Part | What it does |
|---|---|
-p 127.0.0.1:8080:8080 | Publishes the page on this computer only. Without 127.0.0.1:, Docker opens the port to every network the computer is on, past its firewall |
-v /srv/work:/files | The folder to manage. Mount a folder of the sandbox, not a larger one: it is all the server can touch |
THIRTYFILE_SINGLE_USER=true | Turns the mode on |
THIRTYFILE_FILES=/files | The folder, as the container sees it. Required |
THIRTYFILE_RUN_AS=1000:1000 | The user the server runs as. It has to be allowed to change the files in /files: use the owner of that folder (id -u and id -g) |
The /data folder keeps the index, thumbnails and settings. It must not be inside the files folder, and it belongs to this mode: a data folder made in single-user mode can't start a normal server, and the other way round. Choosing another folder later shows that folder instead; the old one is left as it is.
Several folders
To work with more than one folder in the same window, give each a name. Each one becomes a space of its own with that name, listed under "All spaces", and has the usual navigation and file operations. The names are yours: they don't have to match the folders on disk.
-e THIRTYFILE_FILES=Workspace=/workspace,Home=/home/sandbox
Mount each folder into the container the same way as /files above. Separate the entries with commas, and give every folder a name. No folder may be inside another, and the data folder must be outside all of them. A folder you take out of the list later is left as it is on disk and shown again if you name it again. A single path without a name works as before and is shown as "My files".
Read-only folders
A folder in which ThirtyFile can't make new files, such as one mounted with :ro, is shown as a read-only space: you can open and download its files, and nothing in it changes, so it has no trash or earlier versions. A folder that can't use THIRTYFILE_FOLDER_STATE, because it is on another disk or mount (see Storage locations), is shown the same way, unless no trash or earlier versions are kept (below). ThirtyFile looks at each folder when it starts and says in its log why one is read-only. Restart it after changing permissions or mounts.
-v /mnt/assets:/assets:ro \
-e THIRTYFILE_FILES=Workspace=/workspace,Assets=/assets
No trash or earlier versions
Set THIRTYFILE_KEEP_HISTORY=false to keep no trash and no earlier versions. Deleting is then permanent (ThirtyFile asks first), saving replaces a file without keeping what it held, and the trash isn't shown. Trash and versions are what need THIRTYFILE_FOLDER_STATE on the same mount as the folders, so a folder on another mount stays writable.
This suits a folder that several sandboxes share, each running its own ThirtyFile with its own data folder and its own THIRTYFILE_FOLDER_STATE: nothing of ThirtyFile's stays in the shared folder, and what one changes shows in the others. When two change the same file at the same time, the last save wins.
-e THIRTYFILE_FOLDER_STATE=/state \
-e THIRTYFILE_KEEP_HISTORY=false
Mounts and links inside a folder
A disk or folder mounted inside one of the folders, such as ~/.agents/skills mounted into Home, opens where it is: Home › .agents › skills shows its files as the shell does, without naming it in THIRTYFILE_FILES. It works as a folder of its own, read-only when ThirtyFile can't write there, and it isn't listed separately under "All spaces". ThirtyFile looks for such mounts when it starts and every minute after, so one mounted later shows up within a minute; one that is gone is no longer shown, and comes back when it is mounted again. A folder of the same disk mounted inside (a bind mount) is simply part of the folder. A single file mounted inside, such as ~/.agents/AGENTS.md, shows like any other file and opens in the preview; changing it works only as far as its mount allows.
A symbolic link to a folder or file inside one of the folders shown, or inside such a mount, is a shortcut: opening it opens what it points to. Shortcuts only open; they can't be renamed, moved or deleted from ThirtyFile. Links to anywhere else aren't followed, unless their folder is one of those THIRTYFILE_LINK_TARGETS names (full paths separated by commas): a link to a folder inside one then opens that folder, read-only when ThirtyFile can't write there, and it isn't listed under "All spaces" either. Use it for folders several sandboxes share, such as skills under /opt, while Home and Workspace stay the folders you start from. A note above the list says how many items of a folder aren't shown and why: such links, names that can't be shown, and things that are neither files nor folders. Pointing at the note lists their names. To reach what one points to, list that folder as one of its own, as Assets above.
Reaching it from your computer
Inside the container the server listens on all addresses, and Docker passes only what you publish. With -p 127.0.0.1:8080:8080, open http://localhost:8080 on the computer that runs Docker. Without Docker, the server listens on 127.0.0.1:8080 by itself (change it with THIRTYFILE_ADDR).
When the sandbox is another machine or a virtual machine, forward the port from your computer, so that the page still arrives as localhost:
ssh -L 8080:127.0.0.1:8080 user@sandbox
Then open http://localhost:8080 on your computer. Many sandboxes and dev containers have a port forwarding setting that does the same.
The server answers only to localhost, 127.0.0.1 and [::1]. A page that arrives under another name gets "unknown host name". When a forwarding tool or proxy gives the page a name of its own, list it:
-e THIRTYFILE_ALLOWED_HOSTS=sandbox.example.com
Who can reach it
There is no sign-in, so whoever reaches the port has every file in the folder. The sandbox and the network around it keep everyone else out, not ThirtyFile. Keep the port on the loopback address or behind your own forwarding, and don't publish it to a network or the internet. ThirtyFile writes a warning to its log at start when the address it listens on is not a loopback address; inside Docker that is expected, and the published port is what counts.
What ThirtyFile still does, because websites you visit can send requests to localhost:
- Requests that a browser says come from another website are refused, and so are changes whose
Originisn't the page's own. - Requests for a name that isn't this computer's are refused, which stops a website that makes its own name point to your computer (DNS rebinding).
- Files are reached only below the chosen folder.
Programs on the same computer can still use the port. If other things on it are not trusted, put the sandbox's network apart from them.
Settings
| Variable | Default | What it does |
|---|---|---|
THIRTYFILE_SINGLE_USER | false | Turns single-user mode on |
THIRTYFILE_FILES | The full path of the folder to manage, or several as Name=/path,Name=/path (see below). Required in this mode, and none may hold or be inside the data folder or another of them | |
THIRTYFILE_ADDR | 127.0.0.1:8080 | Where the server listens (a normal server: 0.0.0.0:8080; the Docker image sets that itself) |
THIRTYFILE_ALLOWED_HOSTS | Names the page may be reached under besides localhost, separated by commas | |
THIRTYFILE_KEEP_HISTORY | true | false keeps no trash and no earlier versions: deleting is permanent (see above) |
THIRTYFILE_LINK_TARGETS | Folders outside THIRTYFILE_FILES that symbolic links may lead to, as full paths separated by commas (see above) |
The other settings, such as THIRTYFILE_TRASH_DAYS and THIRTYFILE_MAX_UPLOAD_MB, work as in Settings. Backups, storage locations and the like are Control panel features and are not available here: copy the folder, or use the sandbox's own snapshots.
Going back to a normal server
Start a normal server with a new data folder and add the folder as a space. Your files were never inside the data folder, so nothing needs to be exported.