Commit Graph
258 Commits
Author SHA1 Message Date
Yannick VaucherandGitHub 612d845b94 Merge pull request #287 from p-tombez/13.0-fix_redis_checks
[13.0][FIX] cloud_platform: Fix Redis checks
2021-11-10 16:03:29 +01:00
Patrick Tombez 9b15487896 [13.0][FIX] cloud_platform: Fix Redis checks 2021-11-10 15:40:04 +01:00
Yannick Vaucher 393de74a2e Bump version 2021-11-09 09:31:49 +01:00
Yannick VaucherandGitHub 19856b5ea0 Merge pull request #282 from yvaucher/13.0-bp-ovh-store-type
[13.0][FIX] cloud_platform_ovh uses swift
2021-11-09 09:11:11 +01:00
Alexandre FayolleandYannick Vaucher ec2bf10063 [FIX] cloud_platform_ovh uses swift 2021-11-08 11:58:47 +01:00
Yannick Vaucher e8d4373cdb Bump version after refactor 2021-11-08 11:57:12 +01:00
Yannick VaucherandGitHub bc62fb99ad Merge pull request #249 from p-tombez/13.0-add_cloud_platform_azure
[13.0][ADD] cloud_platform_azure
2021-11-01 17:13:19 +01:00
Yannick VaucherandGitHub 8e5d2f4ba3 Merge pull request #259 from nilshamerlinck/13.0-fix-attachment_azure
[13.0][FIX] attachment_azure
2021-10-20 18:08:43 +02:00
Patrick Tombez 9aea5d40a5 fix: Update bucket name format for new convention defined in platform specifications 2021-10-13 10:13:05 +02:00
Yannick VaucherandGitHub dbba78cee5 Merge pull request #256 from dannyadair/dannyadair/swift-per-db
[13.0] attachment_swift: multi-tenancy use db name in container
2021-10-12 18:51:12 +02:00
Yannick VaucherandGitHub b849b89cbd Merge pull request #261 from gurneyalex/13.0-fix-monitoring_log_requests
[FIX] monitoring_log_requests
2021-10-12 18:49:10 +02:00
Alexandre Fayolle ca6074a6a2 [FIX] monitoring_log_requests
in case the response is an HTTPException, logging would generate a crash
because of wrong attribute name
2021-09-28 15:07:42 +02:00
Nils Hamerlinck 692ea4be14 [13.0][FIX] attachment_azure: in 13.0, _file_read() is expected to return base64 encoded data 2021-09-02 17:46:33 +07:00
Danny W. Adair 6740b19206 attachment_swift: multi-tenancy use db name in container
Adds the possibility to insert `{db}` placeholder in the container
name that will be replaced by the database name to form a unique
container name per database.
2021-08-23 20:26:29 +12:00
Patrick Tombez ae913b110f fixup! [13.0][ADD] cloud_platform_azure 2021-08-06 16:40:37 +02:00
Patrick Tombez 926b28da58 [13.0][ADD] cloud_platform_azure 2021-08-06 09:52:21 +02:00
Yannick VaucherandGitHub 13d7d156a3 Merge pull request #243 from p-tombez/backport_attachment_azure
[MIG] attachment_azure: Backport from 14.0 to 13.0
2021-08-05 10:24:57 +02:00
Patrick Tombez 12a6a06e62 [MIG] attachment_azure: Backport from 14.0 to 13.0 2021-08-04 14:56:33 +02:00
Patrick Tombez 51cb973708 [14.0][IMP] attachment_azure: Allow storage name override 2021-08-04 14:56:33 +02:00
Patrick TombezandGitHub 9ce94caef9 [13.0][IMP] Make cloud_platform fully abstract + update related modules (#244)
[13.0][IMP] Make cloud_platform fully abstract + update related modules
2021-08-04 11:29:31 +02:00
Patrick TombezandGitHub 6d5a6edd5c [13.0][ADD] monitoring_prometheus (#239)
[13.0][ADD] monitoring_prometheus
2021-08-04 11:16:46 +02:00
Vincent RenavilleandPatrick Tombez 223a84d6a9 [IMP] Add identity (#238)
* [IMP] can use ad identity to access storage
2021-07-26 10:26:40 +02:00
Nils HamerlinckandPatrick Tombez e6d2b43f2b [FIX] attachment_azure: clean dbname to fit with container naming rules 2021-07-26 10:26:40 +02:00
Nils HamerlinckandPatrick Tombez 050ce49184 [FIX] attachment_azure: higher level of permissions needed to create container and upload blobs when using the SAS token 2021-07-26 10:26:40 +02:00
Hiren PattaniandPatrick Tombez 1d8bbcf765 [ADD] attachment_azure 2021-07-26 10:26:40 +02:00
Yannick VaucherandGitHub 636c824bd1 Merge pull request #229 from avoinsystems/13.0-fix-bucket-name-format
[FIX] Bucket name formatting
2021-05-31 09:43:20 +02:00
Miku Laitinen 656d0fb3d6 [FIX] Bucket name formatting 2021-05-28 16:30:06 +03:00
Yannick VaucherandGitHub 12c79ad20e Merge pull request #226 from yvaucher/13.0-bp-multi-tenancy
[13.0] [BP] attachment_s3: multi-tenancy use db name in bucket
2021-05-27 18:28:21 +02:00
Yannick Vaucher 09361a9c3e attachment_s3: multi-tenancy use db name in bucket
Adds the possibility to insert `{db}` placeholder in the bucket name
that will be replaced by the database name to form a unique bucket
name per database.
2021-05-27 18:16:34 +02:00
santostelmoandGitHub 8424af433b Merge pull request #198 from p-tombez/requests_log_imp
monitoring_log_requests: Improve data output
2021-03-17 15:20:46 +01:00
Patrick Tombez 2451f475bd fixup! monitoring_log_requests: Improve data output 2020-09-22 12:00:34 +02:00
Patrick Tombez 41ce092562 monitoring_log_requests: Improve data output
* Add environment var to enable/disable requests log
* Add ability to send data to an UDP listener instead of stdout
2020-09-03 10:48:59 +02:00
Stéphane ManginandGitHub af8cee48fb Merge pull request #196 from camptocamp/revert-195-attachement_s3_fix
[13.0] attachement_s3: odoo.modules.registry class name and API changed
2020-08-24 16:09:54 +02:00
Stéphane Mangin 2794dc1d96 [13.0] attachement_s3: odoo.modules.registry class name and API changed 2020-08-24 14:15:42 +02:00
Stéphane ManginandGitHub 096c870440 Revert "[13.0] attachement_s3: odoo.modules.registry class name changed" 2020-08-24 13:45:08 +02:00
Stéphane ManginandGitHub 84fed90419 Merge pull request #195 from StephaneMangin/attachement_s3_fix
[13.0] attachement_s3: odoo.modules.registry class name changed
2020-08-24 12:25:05 +02:00
Stéphane Mangin 1069c8f932 [FIX] attachement_s3: odoo.modules.registry class name changed 2020-08-24 12:11:33 +02:00
Guewen BaconnierandGitHub 298050ba52 Merge pull request #191 from guewen/13.0-log-user-id-uuid
[13.0] Extend json logger with request uuid and user id
2020-06-22 13:36:59 +02:00
Stéphane BidoulandGuewen Baconnier 522937c3b5 Log uid 2020-06-22 07:50:44 +02:00
Stéphane BidoulandGuewen Baconnier 9cf4bf2171 Log request uuid 2020-06-22 07:50:35 +02:00
Akim JuilleratandGuewen Baconnier 11c90c5a17 [FIX] attachment_s3: Close fileobjects after usage 2020-06-22 07:46:16 +02:00
Akim JuilleratandGuewen Baconnier c89bfc83e0 [IMP] attachment_s3: Consider bin_size context key
When bin_size context key is set, read operations on attachments
are supposed to return the size of the attachment and not its content
2020-06-22 07:46:05 +02:00
Guewen Baconnier fd335d89be Upgrade setuptools files 2020-06-22 07:23:56 +02:00
Guewen Baconnier bc7d37d465 Ignore .eggs/ in gitignore 2020-06-22 07:22:45 +02:00
Laurent Mignon (ACSONE)andGuewen Baconnier e6f0a82a52 [FIX] logging_json: define dependency override 2020-06-22 07:22:39 +02:00
Guewen BaconnierandGitHub 787a64178f Merge pull request #183 from avoinsystems/13.0-redis-by-url
[13.0][IMP] session_redis: allow configuring Redis URL instead of host & port.
2020-05-28 20:45:56 +02:00
Guewen BaconnierandGitHub dcc809d450 Merge pull request #187 from guewen/13.0-fix-force-storage-db
[13.0] Rework and fix storage forced in database
2020-05-28 11:40:14 +02:00
Guewen Baconnier e3e3899143 Rework and fix storage forced in database
The initial issue that triggered this rework is that the forced storage in
database was working only on writes, and was never applied on attachment
creations.

This feature is used to store small files that need to be read in a fast way in
database rather than in the object storage. Reading a file from the object
storage can take 150-200ms, which is fine for downloading a PDF file or a single
image, but not if you need 40 thumbnails.

Down the path to make a correction, I found that:

* the logic to force storage was called in `_inverse_datas`, which is not called
  during a create
* odoo implemented a new method `_get_datas_related_values`, which is a model
  method that receive only the data and the mimetype, and return the attachment
  values and write the file to the correct place

The `_get_datas_related_values` is where we want to plug this special storage,
as it is called for create and write, and already handle the values and
conditional write. But using this method, we have less information than before
about the attachment, so let's review the different criterias we had before:

* res_model: we were using it to always store attachments related to
  'ir.ui.view' in db, because assets are related to this model. However, we
  don't really need to check this: we should store any javascript and css
  documents in database.
* exclude res_model: we could have an exclusion list, to tell that for instance,
  for mail.message, we should never store any image in db. We don't have this
  information anymore, but I think it was never used and added "in case of".
  Because the default configuration is "mail.mail" and "mail.message" and I
  couldn't find any attachment with such res_model in any of our biggest
  databases. So this is removed.
* mimetype and data (size) are the last criteria and we still have them

The new system is only based on mimetype and data size and I think it's actually
more versatile. Previously, we could set a global size and include mimetypes,
but we couldn't say "I want to store all images below 50KB and all files of type
X below 10KB". Now, we have a single system parameter with a dict configuration
(`ir_attachment.storage.force.database`) defaulting to:

    {"image/": 51200, "application/javascript": 0, "text/css": 0}

Assets have a limit of zero, which means they will all be stored in the database
whatever their size is.

Overall, this is a great simplification of the module too, as the method
`_get_datas_related_values` integrates it better in the base calls of IrAttachment.

Note for upgrade:

I doubt we customized the previous system parameters which are now obsolete, but
if yes, the configuration may need to be moved to `ir_attachment.storage.force.database`.
For the record, the params were:

* mimetypes.list.storedb (default: image)
* file.maxsize.storedb (default: 51200)
* excluded.models.storedb (mail.message,mail.mail), no equivalent now

The method IrAttachment.force_storage_to_db_for_special_fields() should be called
through a migration script on existing databases to move the attachments back into
the database.
2020-05-28 07:26:42 +02:00
Guewen BaconnierandGitHub a2e4c8fc65 Merge pull request #178 from guewen/13.0-redis-json-encode-date
Encode/decode date and datetime in redis sessions
2020-05-26 10:43:47 +02:00
Miku Laitinen a383b45f57 [IMP] session_redis: allow configuring Redis URL instead of host & port. 2020-05-14 18:16:55 +03:00