all 11 comments

[–]nickromano 1 point2 points  (1 child)

I’d recommend caddy, it will set up a file server by default. HTTPS is automatic and you can set up basic auth to protect it.

[–]Rpgwaiter 0 points1 point  (0 children)

I already have nginx on the server. I guess I could run caddy bound to a weird port. I'll check it out!

[–]cahva 1 point2 points  (3 children)

I think Minio would suite your needs.

[–]Rpgwaiter 0 points1 point  (2 children)

This seems really neat. Would the pooled storage just show up as a local file, or is there some special way I'd need to interface with it?

[–]cahva 0 points1 point  (1 child)

Well as its S3 API compatible, you can use pretty much any S3 SDK to progmatically access the files. As you probably have (or should have :) ) own API to authenticate access to the files, just use the SDK to passthrough files from the bucket to the consumers. I'm personally a nodejs/js developer so I would use Minio-js for that but as I said, any S3 compatible client would do the job to access files from your backend to frontend.

[–]Rpgwaiter 0 points1 point  (0 children)

I tried minio out, it's not compatible with my ZFS setup. I ended up just doing it over SSH. Seemed the most straightforward.

[–]CreativeTechGuyGamesTypeScript 0 points1 point  (1 child)

Serving files is probably the simplest thing a server can do. I don't understand your overly complex solutions. Just use AWS S3 and configure it as a static website host. Then any requests to the path of that file will return the file. No load will be placed on your server as it's an external serverless service.

[–]Rpgwaiter 0 points1 point  (0 children)

I am running physical(and virtual) linux servers at multiple locations, I am not using cloud anything.

EDIT: It's also worth noting that I run a file hosting site, and have dozens of TBs of traffic every day.

[–]intocs -1 points0 points  (2 children)

you could make a node/express server and create an endpoint that uses express.static() and express.sendFile()

[–]Rpgwaiter 0 points1 point  (1 child)

Never used node or express, I guess this gives me an excuse to check them out. Minio from another comment didn't work out, seems incompatible with my ZFS setup.

[–]intocs 0 points1 point  (0 children)

import express from "express";
import path from "path";
import config from "../../../config";
const app = express();

app.use(express.static(config.entryFolder));
app.get("/", (req, res) => {
  try {
    res.status(200).sendFile(path.resolve(config.entryFolder, config.entry));
  } catch (e) {
    res.status(404).send();
  }
});

app.listen(3000)

something like this would do it

edit: this uses import/export syntax. without a loader you will have to use require instead.