Dead simple document host?
from deegeese@sopuli.xyz to selfhosted@lemmy.world on 20 Aug 18:57
https://sopuli.xyz/post/32377882

I have a bunch of plain text recipe files on a NAS. If a family member wants to cook something, they ask me to print them a copy.

I’m looking for a simple as possible way to put them on a local web server via a Docker image or similar.

Basically all I need is to have recipes.local show the list of files, then you can click one to view and or print it.

Don’t want logins. Don’t need ability to edit files. Want something read-only I can set and forget while I continue to manage the content directly on the NAS.

What would you suggest?

#selfhosted

threaded - newest

cmnybo@discuss.tchncs.de on 20 Aug 19:04 next collapse

A web server with directory listing enabled would work fine for that.

HelloRoot@lemy.lol on 20 Aug 19:11 next collapse

sftpgo

dan@upvote.au on 20 Aug 19:30 next collapse

Install Nginx, add autoindex on; to the default site config, throw the files into /var/www/html or whatever default folder it uses, and delete the default index.html file. If you need to do it via Docker then use the official Nginx image hub.docker.com/_/nginx

You could also just share the files via SMB. Easy to use on a PC - you could configure their computers to mount the share as a network drive on boot (e.g. R:, for recipes). Not sure about other phones but the built-in files app on my Galaxy S25 Ultra supports SMB too.

Luckyfriend222@lemmy.world on 20 Aug 19:42 next collapse

Based on OPs requirements, this is the answer

deegeese@sopuli.xyz on 20 Aug 21:35 collapse

I already have SMB but want something easier for non tech family members.

Nginx sounds like the way to go and just symlink www -> recipes

Thanks.

edit to add final update:

  • Installed nginx docker image on NAS
  • Mapped html and config paths to host
  • Enabled directory listing support
  • Added recipes.local to NAS reverse proxy
  • Added recipes.local to RPi CNAMEs
  • Bookmarked the site on kids’ computer
Tolookah@discuss.tchncs.de on 20 Aug 19:43 next collapse

Not quite what you want, but I am a huge fan of mealie.

AbidanYre@lemmy.world on 20 Aug 22:30 next collapse

Came here to say the same thing. More than OP is asking for, but it’s fantastic.

curbstickle@lemmy.dbzer0.com on 20 Aug 23:34 collapse

Just used it to import a recipe, tweak it, and then I made it. Big fan of mealie.

I bet it would do a decent job of parsing those text files.

undefined@lemmy.hogru.ch on 21 Aug 00:05 collapse

Are you referring to mealie-recipes/mealie?

Tolookah@discuss.tchncs.de on 21 Aug 00:27 collapse

Yes, that. It’s a bit much, but it’s really easy to use.

cute_noker@feddit.dk on 20 Aug 20:05 next collapse

Copy files and do a

python3 -m http.server

Very simple and does the job.

abimelechbeutelbilch@fulda.social on 20 Aug 20:41 collapse

@cute_noker @deegeese
Better use #copyparty - it's very powerfull and secure:
https://fulda.social/@abimelechbeutelbilch/115044659580192358

cute_noker@feddit.dk on 21 Aug 16:41 collapse

Looks interesting, but also more complicated.

abimelechbeutelbilch@fulda.social on 21 Aug 17:10 collapse

@cute_noker If you are familiar with #docker you can use #copyparty as simple as this:

docker pull copyparty/im && docker stop copyparty_photos && docker rm copyparty_photos

docker run -d -p 12345:12345 --name copyparty_photos \
--restart unless-stopped \
-v /path/to/photos/:/w \
-v /root/.config/copyparty:/cfg \
copyparty/im \
--https-only -nih -p 12345 \
--localtime \
--nos-hdd \
--grid \
--theme=6 \
-v /w::r,guest:rd,admin \
-a guest:pw1234 \
-a admin:anotherpw5678 \
--ipu=1.2.3.4/32=admin

TL;DR:
Path/to/photos = where your files are stored
-p 12345:12345 = Port to expose
Use https only!
User guest with PW can read
User admin with PW can read and delete
Autologin as admin if coming from IP 1.2.3.4

All parameters: https://ocv.me/copyparty/helptext.html

cute_noker@feddit.dk on 21 Aug 18:28 collapse

Looks very cool, seems like a good way to get started.

But it is hard to beat the simplicity of python.

The Dockerfile should work with this:

FROM python:3.13-slim WORKDIR /app COPY . /app EXPOSE 8000 CMD [“python”, “-m”, “http.server”]

abimelechbeutelbilch@fulda.social on 21 Aug 18:58 collapse

@cute_noker #python wins by simplicity and a very small footprint. But it loses by security (if this is a matter for the data made available for the whole internet).

cute_noker@feddit.dk on 21 Aug 21:23 collapse

Totally agree.

k4j8@lemmy.world on 20 Aug 21:10 next collapse

Caddy has this feature built-in. It looks nice too.

recipes.local {
	root * /srv
	file_server
}

caddyserver.com/docs/caddyfile/…/file_server

There’s also File Browser.

_cryptagion@anarchist.nexus on 20 Aug 22:08 next collapse

why not copyparty?

Tramort@programming.dev on 20 Aug 23:47 next collapse

sandstorm is dead simple to host and crazy secure.

it handles user accounts for you and there are lots of apps to serve files or track text files.

it rocks.

tatterdemalion@programming.dev on 21 Aug 00:05 next collapse

I use dufs. Copyparty seems good too.

lorentz@feddit.it on 21 Aug 08:11 collapse

Just use the directory listing of your favourite web server. You have a HTTP read only view of a directory and all of its content. If you self host likely you have already a reverse proxy, so it is just matter of updating its configuration. I’m sure it is supported by Apache, Nginx, LightHttpd, and Caddy. But I would expect every webserver supports it. Caddy is the easiest to use if you need to start from scratch.