Commit graph

23 commits

Author SHA1 Message Date
David
39d4318a27
feat: enable db socket connection 2024-03-29 10:29:50 +01:00
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
David Arnold
c57bc94ead
chore: cleanup frappe.connect invocations 2024-01-24 11:56:24 +01:00
Akhil Narang
c721fcf8c4
refactor: allow setting a db user name different from the database name
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-16 12:35:01 +05:30
David Arnold
a926e64ec9
fix: procure db config from single authority (#21578)
* fix: procure db config from single authority

ensures that configuration is uniformely procured from local.conf
instead of making use of hard to audit multilevel fallback logic

Implementation Note:
- `get_db(host, port, user, password)` was stripped of any optional
  argument and therefrom all errors where fixed.
- All occurances of `grep 'frappe.db.db_'` where changed to
  `frappe.conf.db_`

* fix: revert unnecessary breaking changes
2023-07-24 10:48:29 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
tundebabzy
38caf3bb22
fix(File): Handle file_path is None (#15552)
* fix: S3 automatic backup fails when the backup folder is empty

* Removed conditional that returns early when
`file_path` argument is invalid i.e `None` or empty string.

This means though that the function will throw an exception if it
receives such invalid input so devs should check their inputs before
calling the function

Co-authored-by: Mohammad Hasnain Mohsin Rajan <hasnain2808@gmail.com>

Co-authored-by: Mohammad Hasnain Mohsin Rajan <hasnain2808@gmail.com>
2022-01-27 13:29:43 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Suraj Shetty
189c6cb771
style: Remove unused import 2020-11-18 14:01:14 +05:30
Suraj Shetty
887f4b0d61
fix: Resolve conflicts 2020-11-18 13:54:57 +05:30
Saurabh
cb6c704671 fix: Define chunk size based on backup file size to avoid timeout issues (#11526)
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
(cherry picked from commit 5020bbe4f68abaf5f9c019efff6105573d2ed5c0)

# Conflicts:
#	frappe/integrations/offsite_backup_utils.py
2020-11-18 05:42:19 +00:00
Abhishek Balam
414c15302e fix: use frappe.db.get_single_value instead of get_value 2020-09-30 11:36:31 +05:30
Abhishek Balam
cba0050db8 fix: s3 sucess email sent even when checkbox not selected 2020-09-30 03:52:21 +05:30
Saurabh
fa1e8aef02
fix: upload file backup on S3 (#11326)
1. if file backup is scheduled, and system not have file backup tar t…hen prepare files bakcup before uploading it to s3

2. fix regex for public files
2020-08-21 15:58:32 +05:30
Gavin D'souza
9e00039351 style: Black 2020-08-14 17:25:18 +05:30
Gavin D'souza
62e718a813 fix: Remove duplicate code
Use BackupGenerator instead of custom code for integrations
2020-08-07 13:13:49 +05:30
Mangesh-Khairnar
d213f0c4b6
fix(google-drive): check file list before finding latest (#10767)
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2020-06-24 11:18:47 +05:30
Sahil Khan
2a303d0ffd feat: take site_config backup
Co-authored-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-06-22 17:00:03 +05:30
Chinmay D. Pai
9b6f0a2e4c
fix: use doctype instead of service name to send email
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-05-08 20:18:08 +05:30
Saurabh
1bc97e8f8a
feat: Offsite backup (#8241)
* feat: utility to get file size

* feat: if backup file is greater than 1gb then consider latest backup site instead of taking new

* fix: remove unwanted import

* chore: fix condition inside offsite backup utils

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: change email field to notify_email

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: fix deepsource issues

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* feat: add offsite_backup support for google drive

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: get recipients from within send_email

pass email_field to send_email instead of calling two functions

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: set flag within validate_file_size

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* feat: get latest file backup when specified

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: fix deepsource issues

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: fix incorrectly spelled dropbox settings

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: implement file backup logic for aws s3

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: fix deepsource issues

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: fix deepsource issues

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

Co-authored-by: Chinmay D. Pai <chinmaydpai@gmail.com>
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2020-04-07 00:06:27 +05:30