planety / prologue

Powerful and flexible web framework written in Nim
https://planety.github.io/prologue
Apache License 2.0
1.23k stars 47 forks source link

Error: You do not have permission to access this file. #204

Closed exitcas closed 1 year ago

exitcas commented 1 year ago

Hello,

I've been having this specific error every time I want to create a static file directory. My Prologue app doesn't let me to access to files on my static directory via the browser, stating that I don't have permission to access them. I started checking out the documentation and searching for solutions but nothing popped out.

This is the code that publishes my website:

var app = newApp(settings = newSettings(
  port = Port(8080)
))
app.use(staticFileMiddleware("/static"))
app.addRoute("/", index)
app.addRoute("/signup", signup, @[HttpGet, HttpPost])
app.run()

I would be very thankful if you could help me with this. Thank you, Lucas.

ITwrx commented 1 year ago

this is an old issue, so idk if you still have this problem, but...

sounds like permissions issues. what OS are you using?

where is that error coming from and being shown? from Prologue itself, in the terminal? or from/in the browser?

exitcas commented 1 year ago

this is an old issue, so idk if you still have this problem, but...

sounds like permissions issues. what OS are you using?

where is that error coming from and being shown? from Prologue itself, in the terminal? or from/in the browser?

Hello,

I was using Ubuntu GNU/Linux.

I already found the solution for myself some time ago, but I forgot to share it and close this thread!

The problem was that the executable couldn't access the files because they didn't have a compatible permission level. Mode 644 worked fine with me, but I'm not a security expert, so don't take it as the optimal choice.

Thank you,

exitcas.