floross/docker-readthedocs

Public access.

Opened this issue · 4 comments

Hello,

I faced some issue trying to make my installation accessible through the "short" URL access, but I finally figured it out.

To do so, I had to add an entry to the nginx file, to allow it to serve /public_web_root, and also add "public" to the SERVE_DOCS setting, although I am not really sure what it means...

Does this deserves a PR, and is a "desired" behaviour for this stack ?

Thanks,

Hi @Kimamisa, can you please clarify what the "short" URL is?

SERVE_DOCS is not something that you usually want, it makes python serve documentation requests (not the nginx).
There is also a per-project visibility setting (project management UI), did you try it?

Hi @Jmennius ,
yes, what they call short URL is the domain redirection per project.

Oh, I just saw that there is the nginx-vhost-template, but it is not filled when using the USE_SUBDOMAIN. Should we add a mechanism for that ?

Yes, the nginx-vhost-template is what you need.
It is not seamless, right now you should enable it manually and patch the hostname inside.
This config might also be incomplete, so you would probably like to copy something like proxying options and timeouts from the main one.

If you would like to make it more straightforward - we'll need some script that is able to patch the config on startup with a correct hostname (and restart nginx then). rtd-provision.sh is probably the right place for such a script. If we could only make nginx config use environment variable...

BTW, the subdomain (hostname) is built into the docs in some places so you won't be able to switch subdomain options seamlessly since existing docs will need a rebuild (for all references to function correctly).

thanks for your answer.

I think as a first step, we can add it to the documentation, to let other users know about it.

I'll try to dig further if I have more time.

Switching subdomains is not a problem, but having the first templating automated would ease the update of containers, as we won't have to automatically recreate the symlink !