Skip to content

Introduce public/ directory

Fridtjof requested to merge public-dir into master

Closes #3 (closed)

DO NOT MERGE. Needs coordination with admin before deployment

This MR will not work at all without the nginx image produced by images!22 (merged). That MR should be merged, then the tag here should be changed to latest.

What does this MR do?

Adds a new directory, public/. This directory should have any static and/or generated files to be served by the webserver in front of our application.

This includes:

  • Metadata, like manifests, robots.txt, etc
  • Static assets, like the img/ and css/ directories. To make this MR less complicated, they have been added as symlinks for now.
  • Generated assets, like anything in assets/
  • Anything else I saw in the webserver config

The goal is basically to limit the webserver to this directory, and therefore make it very obvious what is served directly vs what's "code"/"resources". As a byproduct, the webserver can assume anything in there is safe to serve statically (besides index.php, of course).

It also has the nice side effect of removing a bunch of clutter from the project root.

Finally, this unblocks a bunch of other stuff for the future that should make life easier for both devs and admins, requiring less coordination for currently very tedious tasks.

How confident are you it won't break things if deployed?

It works in dev, but I can't say if it will work in beta/prod until we've tested that.

Links to related issues

#3 (closed)

How to test

Test anything specifically that might access project files in a weird way. Examples I've fixed so far are the modules that generate PDFs (e.g. for Passports) and the Content module (specifically for release notes and the changelog).

Checklist

  • added a test, or explain why one is not needed/possible...
  • no unrelated changes
  • asked someone for a code review
  • set a "for:" label to indicate who will be affected by this change
  • added to the next milestone (see https://gitlab.com/foodsharing-dev/foodsharing/-/milestones, unless it has a "for:Dev" label)
  • added an entry to CHANGELOG.md
  • added a short text that can be used in the release notes
  • Once your MR has been merged, you are responsible to create a testing issue in the Beta Testing forum: https://foodsharing.de/?page=bezirk&bid=734&sub=forum. Please change the MRs label to "state:Beta testing".
    • Consider writing a detailed description in German.
    • Describe in a few sentences, what should be tested from a user perspective.
    • Also mention different settings (e.g. different browsers, roles, ...) how this change can be tested.
    • Be aware, that also non technical people should understand.
Edited by Fridtjof

Merge request reports