Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

[ADD] clouder_template_red_october: File encyption/decryption #187

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

lasley
Copy link
Contributor

@lasley lasley commented Dec 15, 2016

This is a WIP, I have a question that I'll ask inline. ReadMe below for info on this template.

Clouder Template - Red October

This module provides a Clouder Template for Red Octover.

Red October is a cryptographically-secure implementation of the two-person rule
to protect sensitive data. From a technical perspective, Red October is a
software-based encryption and decryption server. The server can be used to
encrypt a payload in such a way that no one individual can decrypt it. The
encryption of the payload is cryptographically tied to the credentials of the
authorized users.

Authorized persons can delegate their credentials to the server for a period of
time. The server can decrypt any previously-encrypted payloads as long as the
appropriate number of people have delegated their credentials to the server.

This architecture allows Red October to act as a convenient decryption service.
Other systems, including CloudFlare’s build system, can use it for decryption
and users can delegate their credentials to the server via a simple web interface.
All communication with Red October is encrypted with TLS,
ensuring that passwords are not sent in the clear.

Read More on CloudFlare's Blog

Browse Red October on Github

RUN go install github.com/cloudflare/redoctober

EXPOSE 8080 8081
ENV RO_CERTS=/var/lib/redoctober/data/server.crt \
Copy link
Contributor Author

@lasley lasley Dec 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an example of a template file that is filled by Python variables when deploying the service? I need to be able to pass a cert into this file, from the CA.

A bit lower, I actually need to edit the Dockerfile too. There is an addr option there that will need to be dynamic based on the port we assign in the XML.

I have a similar requirement during the generation of the CA, in which I need to generate a configuration file based on some data that is set in the model (CN, OU, etc).

CFSSL then needs to be run against that config file in order to generate the root CA cert, which is then used as part of the Dockerfile CMD.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually replace them in deploy_post hook https://github.com/clouder-community/clouder/blob/0.9.0/clouder_template_odoo/template.py#L49

I suggest you use this method for now. It'd be great to avoid using deploy_post for this purpose so we can make generic docker images which can be used without Clouder, but that's not the point of this PR.
I'm working on it, I need to make such generic image for the Clouder docker compose so let's wait until I figure the best way to do it.

In the case you describe, I still believe most of the operation will stay in deploy_post.

Copy link
Contributor Author

@lasley lasley Dec 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A template language like Jinja2 would be seriously badass here if that's similar to what you're thinking. We could even use the pre-existing odoo.tools.safe_eval to allow us a safe code context that we control, allowing for some nice possibilities.

Or better yet, the Jinja2 sandbox like in mail - https://github.com/odoo/odoo/blob/226b28e090deb12ca9a204fdcedc20c0359aad85/addons/mail/models/mail_template.py#L59

@codecov-io
Copy link

codecov-io commented Dec 15, 2016

Current coverage is 31.54% (diff: 44.44%)

Merging #187 into master will increase coverage by 0.53%

@@             master       #187   diff @@
==========================================
  Files            73         74     +1   
  Lines          5653       5732    +79   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           1753       1808    +55   
- Misses         3900       3924    +24   
  Partials          0          0          

Powered by Codecov. Last update 8695902...d07eabd

Copy link
Owner

@YannickB YannickB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok finished review.

Don't you think this template shall be merged with the cfssl template ? With your proposition we'll have

openssl
cfssl-data
cfssl-exec
redoctober-data
redoctober-exec

Each deployed service increased the time needed for oneclick installation. I believe we shall only have

openssl
redoctober-data
redoctober-exec

with redoctober filling the purpose of cfssl.

EDIT : Forget what I said with merge redoctober and cfssl. I was sure that redoctober required cfssl in his container but it's not the case.

model="clouder.image.port"
>
<field name="template_id" ref="image_template_redoctober_exec" />
<field name="name">redoctober-http</field>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you need proxy, you shall use http tag

FROM clouder/base:3.4
MAINTAINER Dave Lasley <[email protected]>

CMD tail -f /dev/null
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No CMD needed, use base

FROM clouder/base:3.4
MAINTAINER Dave Lasley <[email protected]>

CMD tail -f /dev/null
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No CMD needed, use base

RUN go install github.com/cloudflare/redoctober

EXPOSE 8080 8081
ENV RO_CERTS=/var/lib/redoctober/data/server.crt \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually replace them in deploy_post hook https://github.com/clouder-community/clouder/blob/0.9.0/clouder_template_odoo/template.py#L49

I suggest you use this method for now. It'd be great to avoid using deploy_post for this purpose so we can make generic docker images which can be used without Clouder, but that's not the point of this PR.
I'm working on it, I need to make such generic image for the Clouder docker compose so let's wait until I figure the best way to do it.

In the case you describe, I still believe most of the operation will stay in deploy_post.

@YannickB
Copy link
Owner

Just to be sure, redoctober is about file/data secure storage am I right ? If yes, we had a discussion about https://www.vaultproject.io/ which looked very good to me.

Can you describe what is the exact purpose for redoctober ? Shall it replace https://www.vaultproject.io/ and if yes can you explain why we shall use redoctober instead ?

@lasley
Copy link
Contributor Author

lasley commented Dec 26, 2016

Don't you think this template shall be merged with the cfssl template ? With your proposition we'll have

Red October and CFSSL serve different purposes. Red October is file encryption, and CFSSL is a certificate authority.

CFSSL is required to secure our internal communications, such as Logstash=>Elastic.

Red October is going to handle encryption/decryption of private keys generated by CFSSL, Openssl, OpenSSH, etc.

OpenSSL container is required in order to get some certificate information that I was otherwise unable to obtain from the other services.

As I understand it, Docker is built upon the premise of modular design & the combining of logical services is not the way to go. Technically we could just install OpenSSL on every container that requires it, but I feel like that will just increase the deploy time exponentially vs. the one container.

Can you describe what is the exact purpose for redoctober ? Shall it replace https://www.vaultproject.io/ and if yes can you explain why we shall use redoctober instead ?

I included some of this our email thread before I noticed the question here. Just so it's all public too, here's the breakdown from the email. Let me know if it doesn't clarify.

Vaultproject duplicates a lot of functionality that the CFSSL CA does, without actually providing a CA. It does technically offer more than Red October though, specifically the storage of the encrypted data vs simply key management.

On the flip side, Red October is more secure. It has another layer of decryption rights called delegation, which allows you to delegate decryption rights to different RO Vaults. This means that the RO Vault itself is actually portable, and able to be distributed amongst multiple Vaults. In our context, this means we can add superusers to decrypt the data & template those users across customer vaults.

TBH both are about as state of the art in terms of design, for the most part it’s just the question of feature duplication. I think a lot of Vault project’s appeal (at least for me) is their website. I still need to do a side-by-side comparison though, and I’m somewhat thinking of making a Vaultproject connector simply for the hell of it.

Edit: Just saw your edit. Too late, I explained anyways! 🚀

@YannickB
Copy link
Owner

Thanks @lasley for clarification, looks like the way to go for me !

* Remove data and source from base
* Proxy compat
* Roadmap notes
* Switch user to red october
* Fix dockerfile
* Bugfixes
@lasley lasley force-pushed the feature/master/clouder_crypto branch from e05639f to be1aaaa Compare December 28, 2016 21:25
@lasley
Copy link
Contributor Author

lasley commented Dec 29, 2016

I'm planning on doing a few tests with this later today & will report back on whether we can merge.

<field name="template_ids"
eval="[(4, [ref('image_template_redoctober_data')])]"
/>
<field name="parent_from">clouder/base:3.4</field>
Copy link
Contributor Author

@lasley lasley Dec 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After inheriting from base, I am getting a build failed due to no command. Looking at the base, this makes sense (because there isn't).

Do we have another Docker layer with just a cat or tail in it that we can use instead?

2016-12-29 23:22:31,950 9723 INFO clouder odoo.addons.clouder.models.model: command : docker build --pull -t dev-red_october-data-20161229.232231 /tmp/dev-red_october-data-20161229.232231
2016-12-29 23:22:32,002 9723 INFO clouder odoo.addons.clouder.models.model: stdout : Sending build context to Docker daemon 2.048 kB
2016-12-29 23:22:32,106 9723 INFO clouder odoo.addons.clouder.models.model: stdout : Step 1 : FROM clouder/base:3.4
2016-12-29 23:22:33,218 9723 INFO ? werkzeug: 10.0.2.2 - - [29/Dec/2016 23:22:33] "GET /web/static/src/img/spin.png HTTP/1.1" 200 -
2016-12-29 23:22:33,273 9723 INFO clouder odoo.addons.clouder.models.model: stdout : 3.4: Pulling from clouder/base
2016-12-29 23:22:33,282 9723 INFO clouder odoo.addons.clouder.models.model: stdout : Digest: sha256:393853d46770a169871d54e6462d3cce1ad2d553ab1522939206b5b389be99e2
2016-12-29 23:22:33,286 9723 INFO clouder odoo.addons.clouder.models.model: stdout : Status: Image is up to date for clouder/base:3.4
2016-12-29 23:22:33,290 9723 INFO clouder odoo.addons.clouder.models.model: stdout :  ---> 2921143ce024
2016-12-29 23:22:33,295 9723 INFO clouder odoo.addons.clouder.models.model: stdout : Step 2 : MAINTAINER [email protected]
2016-12-29 23:22:33,298 9723 INFO clouder odoo.addons.clouder.models.model: stdout :  ---> Using cache
2016-12-29 23:22:33,303 9723 INFO clouder odoo.addons.clouder.models.model: stdout :  ---> 411c56dc580b
2016-12-29 23:22:33,307 9723 INFO clouder odoo.addons.clouder.models.model: stdout : Step 3 : VOLUME data
2016-12-29 23:22:33,736 9723 INFO clouder odoo.addons.clouder.models.model: stdout :  ---> Running in 14a3ba11c900
2016-12-29 23:22:33,997 9723 INFO clouder odoo.addons.clouder.models.model: stdout :  ---> 12fcb9fb3e12
2016-12-29 23:22:34,066 9723 INFO clouder odoo.addons.clouder.models.model: stdout : Removing intermediate container 14a3ba11c900
2016-12-29 23:22:34,091 9723 INFO clouder odoo.addons.clouder.models.model: stdout : Successfully built 12fcb9fb3e12
2016-12-29 23:22:34,096 9723 INFO clouder odoo.addons.clouder.models.model: connect: ssh dev.localhost
2016-12-29 23:22:34,100 9723 INFO clouder odoo.addons.clouder.models.model: 
2016-12-29 23:22:34,104 9723 INFO clouder odoo.addons.clouder.models.model: host : 192.168.69.108
2016-12-29 23:22:34,109 9723 INFO clouder odoo.addons.clouder.models.model: command : rm -rf /tmp/dev-red_october-data-20161229.232231
2016-12-29 23:22:34,150 9723 INFO clouder odoo.addons.clouder.models.model: connect: ssh dev.localhost
2016-12-29 23:22:34,155 9723 INFO clouder odoo.addons.clouder.models.model: 
2016-12-29 23:22:34,159 9723 INFO clouder odoo.addons.clouder.models.model: host : 192.168.69.108
2016-12-29 23:22:34,163 9723 INFO clouder odoo.addons.clouder.models.model: command : docker run -d -t --restart=always --name dev-red_october-data dev-red_october-data-20161229.232231 
2016-12-29 23:22:34,215 9723 INFO clouder odoo.addons.clouder.models.model: stderr : docker: Error response from daemon: No command specified.
2016-12-29 23:22:34,221 9723 INFO clouder odoo.addons.clouder.models.model: stderr : See 'docker run --help'.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch, ok I was sure we had a CMD in the inherited base image.

I made a direct commit to resolve it, can you try again with the latest image from Docker hub ? clouder-community/clouder@8695902 https://hub.docker.com/r/clouder/base/builds/bzb6vgezh9o8qk55ycqhedc/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woot looks like we're in business thanks! Few more tweaks here and we should be good, I'll let you know

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a sidenote, I shall remove all tail -f I made in the data images, they are all replaced by the CMD cat I added in the base image

MAINTAINER Dave Lasley <[email protected]>

ARG RO_CERTPASSWD="password"
ARG RO_COMMONNAME="localhost"
Copy link
Contributor Author

@lasley lasley Jan 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a way to specify build args programmatically? I'd like to make this common-name & password something more meaningful

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use environment for this. In Clouder deployment, you can specify them by overriding an hook, like this example in mysql template :

https://github.com/clouder-community/clouder/blob/master/clouder_template_mysql/template.py#L53

Note that the use case seems to be the same, you probably want to store them in Clouder as options, like the root password of mysql.

@lasley lasley force-pushed the feature/master/clouder_crypto branch from 345744d to d14d4cd Compare January 2, 2017 19:54
<field name="local_port">8080</field>
</record>

<record id="image_port_redoctober_metrics"
Copy link
Contributor Author

@lasley lasley Jan 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When deploying this from clouder, I'm getting an error when binding to 8081. This isn't happening when I build and run the image on its own, so it has to be something I'm doing wrong in the config here or there's something I don't know about on that port. Any clues where to start?

Relevant Docker logs:

2017/01/02 19:52:25 core.init success: path=/var/lib/redoctober/data/diskrecord.json
2017/01/02 19:52:25 metrics.init start: addr=localhost:8081
2017/01/02 19:52:25 http.serve start: addr=:8080
2017/01/02 19:52:25 listen tcp 198.23.230.10:8081: bind: cannot assign requested address

Without Clouder:

root@odoo-dev-10:/media/sf_Repos/clouder/clouder_template_red_october/images/exec# docker run -t lasley/redoctober-exec
Generating RSA private key, 2048 bit long modulus
....+++
....................................................................................................................+++
e is 65537 (0x10001)
writing RSA key
Signature ok
subject=/C=US/ST=California/L=Everywhere/CN=localhost
Getting Private key

Generated default certificates for RedOctobeer at /var/lib/redoctober/data/server.crt and /var/lib/redoctober/data/server.pem

2017/01/02 19:56:24 core.init success: path=/var/lib/redoctober/data/diskrecord.json
2017/01/02 19:56:24 metrics.init start: addr=localhost:8081
2017/01/02 19:56:24 http.serve start: addr=:8080

I tried removing this port definition just for the hell of it, but that had no effect.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the problem is located inside your container.

listen tcp 198.23.230.10:8081 I suspect this is not the port which can't be allocated, it's the IP adress. Probably 198.23.230.10 can be used by the node but not by the container, which has probably another IP like 172.17.. more often used by Docker. You probably have a setting somewhere which should be set to 0.0.0.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woot good call! No idea what that IP is either, it doesn't match with any of my infrastructure (both internal and external facing).

2d241b1a6c52        dev-red_october-exec-20170102.203532              "/usr/lib/go/src/gith"   24 seconds ago      Up 18 seconds                   0.0.0.0:30012->8080/tcp, 0.0.0.0:30011->8081/tcp                                         dev-red_october-exec

@lasley
Copy link
Contributor Author

lasley commented Jan 2, 2017

Alright this works!

I'm not sure if the proxy part is though. Am I supposed to do something more than just setting the name as https?

@YannickB
Copy link
Owner

YannickB commented Jan 2, 2017

So redoctober has a web interface... That's really good to know.

You'll need to add link to proxy/dns with https://github.com/clouder-community/clouder/blob/0.9.0/clouder_template_odoo/template.xml#L315, and allow base creation in the application. Then try to create a base on this service, with the url you want to access it.

@lasley
Copy link
Contributor Author

lasley commented Jan 2, 2017

So redoctober has a web interface... That's really good to know.

Yeah totally - I'm using the JSON API via the same port, but it comes with a rudimentary interface based on the JSON API. Makes it really freaking easy to poke around

$ docker run -d lasley/redoctober-exec -p 8080:8080
$ curl -k https://localhost:8080
<!DOCTYPE html>
<html lang="en">
<head>
	<title>Red October - Two Man Rule File Encryption &amp; Decryption</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">

	<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" />
	<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap-theme.min.css" />
	<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
	<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>
	<style type="text/css">
		.footer{ border-top: 1px solid #ccc; margin-top: 50px; padding: 20px 0;}
	</style>
</head>

@lasley
Copy link
Contributor Author

lasley commented Jan 2, 2017

@YannickB Hmm ok so I don't think I've tried to create a Base manually before. I created #193 because the view was basically broken, but now that I have things entered I'm getting stuck on some dependencies.

I think I have everything figured out except for the application.default_image_id.version_ids: constraint. What image is supposed to be linked to the application? The exec?

@YannickB
Copy link
Owner

YannickB commented Jan 3, 2017

@lasley Application with children shall not have default_image_id, I'm wondering if I didn't let a wrong constraint behind. Can you provide a link to this constraint ?

@YannickB
Copy link
Owner

YannickB commented Jan 3, 2017

Oh ok. This function is used when you didn't first created a service. This way you can directly create a base, it will create the service behind for the customer. Useful when you want to create a service each time you create a base for a customer, so he have his own service (no multi-base mode)

TBH, recently I only followed the process first create manually the service, then create the base and fill the service_id field so this function is not called. You should do the same for now until we debug it.

@lasley
Copy link
Contributor Author

lasley commented Jan 3, 2017

Ok I see, so there's just a missing deploy step if you create it the one direction. I already had a service, so that was a pretty easy fix.

Hmmm I must still be missing something though, now I'm getting a missing port error. I can replicate it by Reloading the proxy, which jives in the traceback:

Traceback (most recent call last):
  File "/opt/odoo/odoo/http.py", line 638, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo/http.py", line 675, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo/http.py", line 331, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo/service/model.py", line 119, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo/http.py", line 324, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo/http.py", line 933, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo/http.py", line 504, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/addons/web/controllers/main.py", line 862, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/addons/web/controllers/main.py", line 854, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/odoo/api.py", line 679, in call_kw
    return call_kw_model(method, model, args, kwargs)
  File "/opt/odoo/odoo/api.py", line 664, in call_kw_model
    result = method(recs, *args, **kwargs)
  File "/media/sf_Repos/clouder/clouder/models/base.py", line 587, in create
    return super(ClouderBase, self).create(vals)
  File "/media/sf_Repos/clouder/clouder/models/model.py", line 432, in create
    res.do('create', 'deploy_frame')
  File "/media/sf_Repos/clouder/clouder/models/model.py", line 332, in do
    getattr(self, 'do_exec')(action, job_id)
  File "/media/sf_Repos/clouder/clouder/models/model.py", line 346, in do_exec
    getattr(self, action)()
  File "/media/sf_Repos/clouder/clouder/models/model.py", line 360, in deploy_frame
    self.deploy_links()
  File "/media/sf_Repos/clouder/clouder/models/model.py", line 394, in deploy_links
    link.deploy_()
  File "/media/sf_Repos/clouder/clouder/models/base_link.py", line 86, in deploy_
    'deploy_link ' + self.name.name, 'deploy_exec', where=self.base_id)
  File "/media/sf_Repos/clouder/clouder/models/model.py", line 332, in do
    getattr(self, 'do_exec')(action, job_id)
  File "/media/sf_Repos/clouder/clouder/models/model.py", line 346, in do_exec
    getattr(self, action)()
  File "/media/sf_Repos/clouder/clouder/models/base_link.py", line 93, in deploy_exec
    self.control() and self.deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_odoo/template.py", line 465, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_gitlab/template.py", line 456, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_piwik/template.py", line 130, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_shinken/template.py", line 250, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_proxy/template.py", line 192, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_mail/template.py", line 214, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_dns/common.py", line 64, in deploy_link
    self.base_id.generate_cert_exec()
  File "/media/sf_Repos/clouder/clouder_template_proxy/template.py", line 110, in generate_cert_exec
    proxy_link.deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_odoo/template.py", line 465, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_gitlab/template.py", line 456, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_piwik/template.py", line 130, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_shinken/template.py", line 250, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_proxy/template.py", line 263, in deploy_link
    port +
UnboundLocalError: local variable 'port' referenced before assignment

I think everything is having this trouble though, here's Gitlab Edit: maybe not Gitlab actually, but something during the Odoo one click that isn't generating an exception, but in the logs:

2017-01-03 23:10:40,677 31878 INFO clouder odoo.addons.clouder.models.model:   File "/media/sf_Repos/clouder/clouder/models/model.py", line 360, in deploy_frame
    self.deploy_links()
  File "/media/sf_Repos/clouder/clouder/models/model.py", line 394, in deploy_links
    link.deploy_()
  File "/media/sf_Repos/clouder/clouder/models/base_link.py", line 86, in deploy_
    'deploy_link ' + self.name.name, 'deploy_exec', where=self.base_id)
  File "/media/sf_Repos/clouder/clouder/models/model.py", line 332, in do
    getattr(self, 'do_exec')(action, job_id)
  File "/media/sf_Repos/clouder/clouder/models/model.py", line 346, in do_exec
    getattr(self, action)()
  File "/media/sf_Repos/clouder/clouder/models/base_link.py", line 93, in deploy_exec
    self.control() and self.deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_odoo/template.py", line 465, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_gitlab/template.py", line 456, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_piwik/template.py", line 130, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_shinken/template.py", line 250, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_proxy/template.py", line 192, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_mail/template.py", line 214, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_dns/common.py", line 64, in deploy_link
    self.base_id.generate_cert_exec()
  File "/media/sf_Repos/clouder/clouder_template_proxy/template.py", line 110, in generate_cert_exec
    proxy_link.deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_odoo/template.py", line 465, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_gitlab/template.py", line 456, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_piwik/template.py", line 130, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_shinken/template.py", line 250, in deploy_link
    super(ClouderBaseLink, self).deploy_link()
  File "/media/sf_Repos/clouder/clouder_template_proxy/template.py", line 263, in deploy_link
    port +

And looking back on this, I think we maybe are missing some proxy stuff in Elasticsearch. Oh well, we'll find out soon enough 😆

Oh and for good measure, relevant docker ps:

runbot@runbot:~/instance/runbot-addons$ docker ps | grep dev-
8341f2445665        dev-redoctober-exec-20170103.230802               "/go/src/github.com/c"   4 minutes ago       Up 4 minutes                                                                                                              dev-redoctober-exec
807291f1270b        dev-redoctober-data-20170103.230800               "/bin/sh -c cat"         5 minutes ago       Up 5 minutes                                                                                                              dev-redoctober-data
a42d939df7d5        dev-clouder9-all-clouder9-files-20170103.230411   "/bin/sh -c 'tail -f "   8 minutes ago       Up 8 minutes                                                                                                              dev-clouder9-all-clouder9-files
545804c18df4        dev-clouder9-all-clouder9-data-20170103.230406    "/bin/sh -c 'tail -f "   8 minutes ago       Up 8 minutes                                                                                                              dev-clouder9-all-clouder9-data
62f799a8c927        dev-clouder9-all-postgres-exec-20170103.230358    "/docker-entrypoint.s"   8 minutes ago       Restarting (127) 2 minutes ago   5432/tcp                                                                                 dev-clouder9-all-postgres-exec
8c8b82b862e2        dev-clouder9-all-postgres-data-20170103.230355    "/bin/sh -c 'tail -f "   9 minutes ago       Up 9 minutes                                                                                                              dev-clouder9-all-postgres-data
b5dd4bc80f54        dev-proxy-exec-20170103.230332                    "/bin/sh -c nginx"       9 minutes ago       Up 9 minutes                     0.0.0.0:30007->80/tcp, 0.0.0.0:30008->443/tcp                                            dev-proxy-exec
3f586fa7f9ed        dev-proxy-data-20170103.230329                    "/bin/sh -c 'tail -f "   9 minutes ago       Up 9 minutes                                                                                                              dev-proxy-data
8f44b46ea3e2        dev-postfix-data-20170103.230314                  "/bin/sh -c 'tail -f "   9 minutes ago       Up 9 minutes                                                                                                              dev-postfix-data
41c6c090d1e6        dev-bind-exec-20170103.230206                     "/bin/sh -c 'named -g"   10 minutes ago      Up About a minute                53/tcp, 0.0.0.0:30003->53/udp                                                            dev-bind-exec
33a54fbe9319        dev-bind-data-20170103.230203                     "/bin/sh -c 'tail -f "   10 minutes ago      Up 10 minutes                                                                                                             dev-bind-data
cf8161510b2e        dev-backup-bup-20170103.230140                    "/bin/sh -c 'supervis"   11 minutes ago      Up 11 minutes                    0.0.0.0:30000->5666/tcp, 0.0.0.0:30001->8080/tcp                                         dev-backup-bup

@YannickB
Copy link
Owner

YannickB commented Jan 3, 2017

Hum I guess we're not entering this condition :

https://github.com/clouder-community/clouder/blob/master/clouder_template_proxy/template.py#L253

Can you output self.base_id.service_id.ports to see where is the problem ? [IMP] : I guess we shall raise an issue here when neither http nor https are found in self.base_id.service_id.ports

@lasley
Copy link
Contributor Author

lasley commented Jan 4, 2017

Service with NAME: dev-redoctober, PORTS: {}

@lasley
Copy link
Contributor Author

lasley commented Jan 4, 2017

And this makes sense because the service doesn't seem to have any exposed ports:

image

@YannickB
Copy link
Owner

YannickB commented Jan 4, 2017

That's strange since you specified the port in

https://github.com/clouder-community/clouder/pull/187/files#diff-067c1eb14f6f8af45482f279b63141a4R7

But I see what the problem is. You have to expose it, either local or internet in order for the port to be inherited in service.

Eg. https://github.com/clouder-community/clouder/blob/master/clouder_template_odoo/template.xml#L122

@lasley
Copy link
Contributor Author

lasley commented Jan 17, 2017

Damn still no go. It looks like Let's Encrypt is failing on the proxy before this (my dev doesn't have a public port 80). Think it's something to do with that? Should I maybe try a Base for something else that's known good (and what would that be)?

@YannickB
Copy link
Owner

Hum, to be honest the local expose status wasn't much tested until now, can you try with internet exposed ?

The local shall be used only for container to container interactions, so it'll not publish port in the container itself.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants