Commit Graph
196 Commits
Author SHA1 Message Date
Andreas Perhab 7c700c7b76 [FIX] session_redis: add required option 'post_load' for server wide addon 2020-04-07 11:26:33 +02:00
Akim JuilleratandPatrick Tombez 85d274a10e attachment_s3: Migrate to boto3 2020-03-10 10:21:30 +01:00
Akim JuilleratandGitHub 2b6045e33b Merge pull request #164 from grindtildeath/11.0-fix_auth_to_keystone_v3
[11.0] attachment_swift: Fix auth to keystone v3
2020-03-09 13:32:41 +01:00
Akim Juillerat df6c2aec0b Fix authentication to Keystone v3
- Use newer version from python lib.
 - Define project_domain_id + user_domain_id in auth
2020-03-09 09:40:31 +01:00
Akim JuilleratandGitHub 52416faee5 Merge pull request #148 from grindtildeath/11.0_dev_attachments
[11.0] Require AWS_BUCKETNAME for prod, integration and labs environments only
2020-03-05 09:59:43 +01:00
Patrick TombezandGitHub 7aac003f04 Merge pull request #153 from p-tombez/11.0-keystoneauth_v3
[11.0] Use keystoneauth v3 for Swift attachments
2020-03-04 11:04:35 +01:00
Mussie SirakandPatrick Tombez 87b33817ee Use keystoneauth v3 for Swift attachments 2020-03-04 10:25:35 +01:00
Akim Juillerat d931ecbcea Require AWS_BUCKETNAME for prod, integration and labs environments only
AWS_BUCKETNAME is only needed in order to write on the bucket, but
read-only access should be allowed for other environments.

Fixes bug introduced by 6c3b610610
2020-02-25 15:57:05 +01:00
Simone Orsi 02a460fef2 cloud_platform: fix default config
`_config_by_server_env` should always retutn a `PlatformConfig` instance
2020-02-04 13:40:16 +01:00
Patrick TombezandGitHub 00f95aa59c Merge pull request #134 from p-tombez/11.0-anon_redis_session
[11.0] Add anonymous redis session expiration configuration
2020-01-31 11:15:07 +01:00
Patrick Tombez 0470e54d1d Add anonymous redis session expiration configuration 2020-01-29 16:32:51 +01:00
Nicolas Bessi (nbessi)andGitHub 9c4d3ca5ba Merge pull request #127 from guewen/11.0-store-less-files-in-db
Store .less files in database
2020-01-15 08:00:04 +01:00
Guewen Baconnier 9c4e9392ef Store .less files in database
When users customize .less files using the 'web_editor', the controller
creates a new ir.attachment for the customized file [0].

The attachment will be stored in S3 by default, which is unfortunate
since it will slow down the generation of the assets. Force storage
in the database for .less files.

Note: beware when porting this to upper versions, check the code of
web_editor, because it changed (notably less files are now scss).

[0] https://github.com/odoo/odoo/blob/11.0/addons/web_editor/controllers/main.py#L370
2020-01-14 16:59:23 +01:00
Guewen BaconnierandGitHub 0e235d2365 Merge pull request #54 from guewen/add-force-storage-special-fields
[11.0] Add method to force storage of special attachments to DB
2019-12-12 15:54:01 +01:00
Yannick VaucherandGitHub 7e126f76a9 Merge pull request #119 from leemannd/11_remove_useless_logs
[11.0] Add description to model
2019-12-10 10:59:28 +01:00
Denis Leemann 5cb6be3257 [11.0] Add description to model
This removes the useless warning at startup
2019-12-09 16:28:43 +01:00
Guewen BaconnierandGitHub 536678cf40 Merge pull request #112 from guewen/11.0-add-support-running-env-labs
[11.0] Add support of 'labs' RUNNING_ENV in cloud_platform
2019-11-29 15:52:15 +01:00
Guewen BaconnierandGitHub f99883eb0c Merge pull request #104 from camptocamp/revert-99-11.0-monitoring_check_db_connection
Revert "[11.0] [IMP] monitoring_status: check the db is reachable"
2019-11-18 13:50:36 +01:00
Guewen Baconnier b1f40cfe26 Add an advice in error message 2019-11-18 13:48:07 +01:00
Guewen Baconnier e172ce490a Add support of 'labs' RUNNING_ENV in cloud_platform
The labs env can be anything starting by 'labs', such as
'labs-logistics', 'labs-finance', ...

* At install, s3/swift is set as default storage
* However, unlike prod/integration, the storage is not forced to be an
object storage
* Redis is required
* When the storage is set on s3/swift, then the bucket name is mandatory
(otherwise, there is no place where to create the files...)

The redis prefix regex match is relaxed: anything starting by a project
name, then '-odoo-', then any combination of letters, digits, and dashes
is accepted (so a prefix my-project9-odoo-labs-web3 is valid).
2019-11-18 13:48:01 +01:00
Guewen BaconnierandGitHub c2d85f3014 Revert "[11.0] [IMP] monitoring_status: check the db is reachable" 2019-10-29 17:31:40 +01:00
Simone OrsiandGitHub 484a8654f7 Merge pull request #99 from gurneyalex/11.0-monitoring_check_db_connection
[11.0] [IMP] monitoring_status: check the db is reachable
2019-10-28 08:11:52 +01:00
Alexandre Fayolle 06224c0ee3 [IMP] monitoring_status: check the db is reachable
make a real SQL query on GET /monitoring/status and return a 503
if the query failed.
2019-10-25 16:24:59 +02:00
Simone OrsiandGitHub 8d349d2973 Merge pull request #74 from guewen/11.0-monitoring_status-ignore-http
[11.0] Ignore HTTP version in monitoring_status filter
2019-08-09 11:55:26 +02:00
Simone OrsiandGuewen Baconnier 8107af7461 Ignore HTTP version in monitoring_status filter 2019-08-09 09:59:07 +02:00
Yannick VaucherandGitHub 03c5ac9159 Merge pull request #66 from guewen/11.0-filter-monitoring-status-log
[11.0] Filter /monitoring/status werkzeug logs
2019-07-19 13:26:21 +02:00
Guewen Baconnier eb0ced89fc Filter /monitoring/status werkzeug logs
With healtchecks, they constitute 95% of our logs. Let's stop wasting
resources and shut them up.
2019-07-12 16:25:51 +02:00
Guewen BaconnierandGitHub d48a418490 Update base_attachment_object_storage/models/ir_attachment.py 2019-06-04 13:19:17 +02:00
Guewen BaconnierandGitHub c8936964a8 Merge pull request #60 from guewen/11.0-swift-auth-session
[11.0] attachment_swift: share a session for all connections
2019-05-21 14:52:24 +02:00
Guewen Baconnier b45b4d23a9 Override dependencies with different name and pin versions
The name of the libs and python packages are different, Odoo expects
the inner python package in the manifest, but setuptools cannot find the
libs in pypi, overrides them with the libs names.
2019-05-09 10:10:36 +02:00
Guewen Baconnier fe827e6b3f Pin PyYAML version because 5.x does not work with Odoo
It would raise ConstructorError: could not determine a constructor for the tag '!record'
2019-05-09 10:10:36 +02:00
Guewen Baconnier 8a4e9d1f84 attachment_swift: share a session for all connections
OVH's Swift applies a rate limit on the authentication.

attachment_swift authenticates again each time it has to read/write an
attachment. When running upgrades on upgrades of files or installing a
new DB, at some point, we get rejected with HTTP 429.

This commit introduces a shared storage for Swift Session. All
connections will reuses the same authentication token created the first
time a connection needs a Session.

Note: needs python-swiftclient>=3.7.0 to have
https://github.com/openstack/python-swiftclient/commit/1971ef880ff225379d4a91f00f89f323a1605eeb
2019-05-09 10:10:36 +02:00
Guewen Baconnier 440600e89f Add missing variable in documentation example 2019-05-09 10:04:45 +02:00
Guewen Baconnier 3a269ce879 Add method to force storage of special attachments to DB
Some attachments (e.g. image_small, image_medium) are stored in DB
instead of the object storage for faster access.

In some situations, we may have pushed all these files on the Object
Storage (migration from a filesystem to object storage) and want to
bring back these attachments from the object storage to the database.

This method is not called anywhere but can be called by RPC or scripts.
2019-05-01 16:06:35 +02:00
Guewen BaconnierandGitHub 2dff3e9676 Merge pull request #44 from Numigi/11.0-monitoring_log_requests_dispatch_classmethod
monitoring_log_request: _dispatch is a classmethod
2019-02-12 08:25:57 +01:00
Jordi Riera 535c658b70 monitorin_log_request: _dispatch is a classmethod 2019-02-11 17:46:04 -05:00
Guewen BaconnierandGitHub 1e310e34a8 Merge pull request #42 from tschanzt/allow_more_bucket_names
allow more bucket names
2019-01-14 16:27:31 +01:00
Timon Tschanz 4110f98480 set boto cfg 2019-01-07 17:17:34 +01:00
Timon Tschanz 26911b3bf3 allow more bucket names 2018-12-11 14:03:29 +01:00
Guewen Baconnier bdde32b3b8 Add setuptools files 2018-12-03 10:07:58 +01:00
Guewen Baconnier 636af1884f Edit readme 2018-12-03 10:07:07 +01:00
Guewen Baconnier 96f4e75311 base_attachment_object_storage: bump 1.1.0 2018-06-13 17:25:21 +02:00
Guewen BaconnierandGitHub 19dcbff646 Merge pull request #35 from guewen/11.0-force-storage-at-upgrade
11.0 Fix attachments stored in FS instead of object storage
2018-06-13 17:24:50 +02:00
Guewen Baconnier 371e5439e6 Document a weird domain which is there for a reason
The reason being:
https://github.com/odoo/odoo/blob/9032617120138848c63b3cfa5d1913c5e5ad76db/odoo/addons/base/ir/ir_attachment.py#L344-L347

I nearly deleted this domain but it was too weird to be there for no
reason. A comment explaining the issue was really missing.
2018-06-13 16:05:34 +02:00
Guewen Baconnier 6ab3038a90 Fix attachments stored in FS instead of object storage
Assume the following situation:

* We have installed addons base, sale and attachment_s3 (hence
base_attachment_object_storage as dependency)
* All attachments are in S3 already
* We run an upgrade of the 'base' addon, 'sale' is upgraded before
attachment_s3 in the order of loading.
* Sale updates the icon of the Sale menu
* As attachment_s3 is not loaded yet, the attachment is created in the
filestore

Now if we don't persist the filestore or use different servers, we'll
lose the images of the menus (or any attachment loaded by the
install/upgrade of an addon).

The implemented solution is to move the attachments from the filestore
to the object storage at the loading of the module. However, this
operation can take time and it shouldn't be run by 2 processes at the
same time, so we want to detect if the module is loaded during a normal odoo
startup or when some addons have been upgraded. There is nothing anymore
at this point which allow us to know that modules just have been
upgraded except... in the caller frame (load_modules). We have to rely
on the inpect module and get the caller frame, which is not recommended,
but seems the only way, besides, it's not called often and if
_register_hook was called from another place, it would have no effect
(unless the other place has a variable 'update_module' too).
2018-06-13 16:05:26 +02:00
Guewen Baconnier fb3d3134d6 Ensure that migration of files is commited before deleting files
When moving attachments from the filestore to an object storage,  the
filesystem files will be deleted only after the commit, so if the
transaction is rollbacked, we still have the local files for another
try.
2018-06-13 16:04:55 +02:00
Guewen BaconnierandGitHub 2ec125cccd Merge pull request #31 from guewen/11.0-swift-pass-region-name
Propagage region_name to swift connection
2018-03-29 16:44:39 +02:00
Guewen Baconnier 529c4066fa Propagage region_name to swift connection
Otherwise, the bucket will be in the incorrect region
2018-03-16 09:10:58 +01:00
Guewen BaconnierandGitHub c35483d948 Merge pull request #29 from guewen/11.0-fix-redis-stored-log
Fix order of args in logs
2018-03-15 12:27:47 +01:00
Guewen Baconnier 543a9eb22d Fix order of args in logs 2018-03-13 15:00:26 +01:00