jamesrwhite / minicron

🕰️ Monitor your cron jobs
GNU General Public License v3.0
2.34k stars 154 forks source link

Is https scheme really working??? #280

Open palkoc opened 7 years ago

palkoc commented 7 years ago

Hi guys, I'm not able to configure minicron with https scheme... Invalid protocol... Is minicron really able to run with https enabled? It seems not to me...

PC

PerRommetveit commented 6 years ago

It is quite possible to run minicron with https, you can also set up httpasswd auth.

Install nginx as a webserver on same instance as minicron, create a self signed SSL cert. Or you could use let's encrypt SSL.

Example /etc/nginx/sites-enabled/minicron :

server {
    listen 80;
    return 301 https://$host$request_uri;
}

    server {
        # The port you want minicron to be available, with nginx port 80
        # is implicit but it's left here for demonstration purposes
        listen 443;

        # The host you want minicron to available at
        server_name minicron.mydomain.com;

    ssl_certificate           /etc/nginx/cert.crt;
    ssl_certificate_key       /etc/nginx/cert.key;

    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;

        location / {
            # Pass the real ip address of the user to minicron
            proxy_set_header X-Real-IP $remote_addr;

            # minicron defaults to running on port 9292, if you change
            # this you also need to change your minicron.toml config
            proxy_pass http://127.0.0.1:9292;
            proxy_connect_timeout       600;
            proxy_send_timeout          600;
            proxy_read_timeout          600;
            auth_basic                  "Username and Password Required";
            auth_basic_user_file        /etc/nginx/.htpasswd;
            send_timeout                600;
        }
    }

Minicron would now be available on minicron.mydomain.com.

jamesrwhite commented 6 years ago

In all released versions I don't believe the client itself supports https, that was an oversight on my part.

This will be resolved in v1.0.