Skip to content

Get rid of the 'static' folder / make it dynamic #118

Closed

Description

@joepio

You can't run the atomic-server binary without the ./static folder. This mean that if you run the server without cloning this repo, you get:

[2021-03-27T21:14:14Z ERROR actix_files::files] Specified path is not a directory: "static/"
[2021-03-27T21:14:14Z ERROR actix_files::files] Specified path is not a directory: "static/well-known/"

So why do we actually use this folder?

  1. A font, some styles and some icons
  2. Storing and hosting the ./well-known directory for HTTPS / letsencrypt SSL / TLS certificate / acme-challenge

Reason number 1 isn't that relevant any more, since we switched to a different front-end. I even think we should get rid of Tera and all its templates (nothing wrong with them or the library, but it is no longer needed and just increases the complexity of this project).

Reason number two... Well, there should be other ways of doing the acme-challenge. Doing that requires taking another look at the logic inside https.rs.

Storing the acme-challenge in a cleaner way

When initializing the letsencrypt process, we start off with creating a static file server that hosts some empty folder.
Then, a challenge is fetched from letsencrypt. This contains a token and a proof. The token is basically the filename, well-known/acme-challenge/{token}, and the proof is the body of that URL.

So we need to store this token and the proof someway. Using a filesystems and serving that folder is a very easy way of doing this, but it might also be a bit dirty. It might be a privacy risk, since any file in that .well-known folder will be publicly available.

Maybe the simplest solution is to move the ./static folder to some user-scoped config folder inside the atomic config folder, which also means that we need to make all mentions of static refer to user config, instead of making it relative to where the application is run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions