Question

How to setup password Authentication on discourse app from marketplace ?

I want to add http basic authentication on my discourse app.

When someone visits the page to throw a browser confirm dialog that will ask for username and pass.

I set up discourse through the marketplace app.

Found some docs on how to set up what I want on an Apache server: https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-apache-on-ubuntu-18-04-quickstart.

Tried following the instructions but apparently port:80 is being used from the app.

tcp6 0 0 :::80 :::* LISTEN 5820/docker-proxy

Where would I configure this for my app?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Hi there @akapetzoglou,

This can not be done without some configuration changes.

For example, what you could do is to change the port of the Docker container so that it binds to 8080 for example.

Then set up Apache to listen on port 80 and add a reverse proxy rule to proxy the traffic from Apache on port 80 to the Docker container on port 8080.

You can follow the steps here on how to do that:

https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension

Then you can add the basic auth rules to your Apache Vhost as normal.

Another option would be to use a firewall instead of the basic authentication. That way you can close port 80 and only allow certain IPs to access it. To do that you could either use the DigitalOcean Cloud Firewalls or use CSF for example:

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-config-server-firewall-csf-on-ubuntu

Regards, Bobby

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.