Skip to content
Snippets Groups Projects
Commit 2cb7fa71 authored by richardpapp's avatar richardpapp
Browse files

Add SSL support.

parent d3901749
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -45,19 +45,25 @@ class Traefik {
}
else {
$fs->mkdir($traefikPath);
$fs->mkdir($traefikPath . '/certs');
  • jurgenhaas @jurgenhaas ·
    Owner

    This is added inside the if/else clause which checked if the traefikPath exists. So the way this is implemented now, the certs will not being created for already existing projects. I think there should be a separate if/else clase to check, if certs do exist and create them if not.

  • Please register or sign in to reply
$cmd = 'openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ';
  • jurgenhaas @jurgenhaas ·
    Owner

    I'm wondering about the 365 day limitation. It may happen that users will just forget about it and suddenly the environment won't work anymore. Instead of thinking about a renewal process I wonder if we should probably use a really long duration like e.g. 10 years? It's local anyway, so I don't see any security implications with that.

  • jurgenhaas @jurgenhaas ·
    Owner

    Also, we should check for existing projects if we need to add the extra parts into the docker-compose.yml file.

  • Please register or sign in to reply
$cmd .= $traefikPath . '/certs/key.pem -out ' . $traefikPath . '/certs/cert.pem';
exec($cmd);
$traefik = [
'version' => '2',
'services' => [
'traefik' => [
'image' => 'traefik',
'restart' => 'unless-stopped',
'command' => '-c /dev/null --web --docker --logLevel=DEBUG',
'command' => '-c /dev/null --web --docker --logLevel=DEBUG --defaultEntryPoints="https" --defaultEntryPoints="http" --entryPoints="Name:https Address::443 TLS:/certs/cert.pem,/certs/key.pem" --entryPoints="Name:http Address::80"',
'networks' => [],
'ports' => [
'8000:80',
'443:443',
  • jurgenhaas @jurgenhaas ·
    Owner

    Port 443 on the host may already be taken, so I would expose 8443 and map that internally to 443.

  • Please register or sign in to reply
'8080:8080',
],
'volumes' => [
'./certs:/certs/',
'/var/run/docker.sock:/var/run/docker.sock',
],
],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment