[FIX] runbot: download over https

Firefox blocks downloads from http link if you are on an https page
Allow to deactivate via an ICP in case the runbot is configured over
HTTP (you shouldn't really)
This commit is contained in:
Martin Trigaux 2023-05-19 11:38:31 +02:00 committed by xdo
parent 236554b588
commit 8153fdc4b2

View File

@ -827,7 +827,8 @@ class BuildResult(models.Model):
return os.path.join(root, 'build', build.dest, *l)
def http_log_url(self):
return 'http://%s/runbot/static/build/%s/logs/' % (self.host, self.dest)
use_ssl = self.env['ir.config_parameter'].get_param('runbot.use_ssl', default=True)
return '%s://%s/runbot/static/build/%s/logs/' % ('https' if use_ssl else 'http', self.host, self.dest)
def _server(self, *path):
"""Return the absolute path to the direcory containing the server file, adding optional *path"""