Ankush Menat
2bb49d0cf4
fix: clear all cache after uninstalling apps ( #33513 )
2025-08-05 06:30:07 +00:00
Akhil Narang
325c881dc4
Merge pull request #33262 from akhilnarang/fix-reinstall-lock
...
feat: delete existing site locks when setting up site directories
2025-07-10 11:10:23 +05:30
Ankush Menat
2118ad737c
fix: Delete single doctypes from DB when uninstalling app ( #33180 )
...
This is different from dropping code and collecting orpahn doctype.
This is consistent with current behaviour:
- orphaned - drop metadata, keep data.
- uninstall - drop metadata and data.
Co-authored-by: Ritvik Sardana <ritvik.sardana11@gmail.com>
2025-07-01 13:17:12 +00:00
Ankush Menat
3167e03133
fix: invalidate persistent caches
2025-06-11 00:28:38 +05:30
Ankush Menat
0476c73ab7
fix: patch failure due to out of sync installed apps ( #32767 )
...
* fix: Avoid patching uninstalled app
* fix: Sync uninstalled apps in Installed Apps doctype
2025-06-04 05:53:20 +00:00
rohitwaghchaure
5c6b2b5bec
refactor: track completed app setup wizards and re-run the setup wizard upon new app installation. ( #32640 )
2025-06-03 12:36:22 +05:30
Akhil Narang
368d7ae298
fix(installer): don't allow partial-restore for sqlite
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-04-15 13:59:16 +05:30
Akhil Narang
0b5e245507
feat: init sqlite
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-04-15 13:59:16 +05:30
Ankush Menat
766cb64d55
perf!: Cache site configs in memory for 60 seconds ( #28869 )
...
This is middle ground between caching it completely and requiring a
restart/signal to reload vs always reloading it.
I don't know any use cases that can break from this, nowhere in code
configs should be expected to reload instantly.
This change is only applied to requests for now
2024-12-27 16:21:14 +00:00
Akhil Narang
5e1146e216
fix(installer): don't set defaults for frappe.flags.root_username
...
Its set anyway when calling `setup_database()` (inside `get_root_connection()`)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-02 13:32:06 +05:30
David
d87b786687
chore: fix all invocation of init for singledispatch -> min 1 positional arg
2024-09-13 11:53:52 +02:00
Corentin Flr
f0c7de39dc
chore(new_site): Avoid iterating None
2024-04-29 13:41:00 +02:00
King Phyte
05766680f7
fix: restoring site breaks when checking backup version ( #26186 )
...
* fix: restoring site breaks when checking backup version
The `backup_version` variable exists if and only if the `if match` branch executes, but it is used in a condition in a scope where it may not exist. Changing the variable to `match` leads to correct behaviour.
* fix: restoring site breaks when checking backup version
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
* fix: version check when restoring site should be done from `match` scope
* chore: add a `return None` for better readability
No functional difference, just easier to understand/read the code.
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
---------
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
2024-04-29 16:34:29 +05:30
Akhil Narang
0d3b2499fc
fix: don't use frappe.flags for mariadb_user_host_login_scope
...
This gets reset whenever we call `frappe.init()` again
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 16:57:04 +05:30
David
39d4318a27
feat: enable db socket connection
2024-03-29 10:29:50 +01:00
David
6eb1607c0a
refactor: name and explain user host login scope flag for mariadb
2024-03-29 10:26:49 +01:00
Akhil Narang
197b1ab77c
refactor(installer): use frappe.generate_hash() to generate database name
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:12:19 +05:30
Akhil Narang
1847e9cae8
fix: pass function as lambda
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:00:25 +05:30
Akhil Narang
9940868063
fix: switch to datetime.now() instead of our get_datetime()
...
`get_datetime()` will query the DB to get the system timezone, not something we currently have.
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:00:25 +05:30
Akhil Narang
4b2fde1d8f
fix: check if rollback callback is defined
...
Don't raise exceptions where a simple print() will suffice
Print exception before prompting for rollback
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:00:25 +05:30
Akhil Narang
147c0c8b37
feat: initial failed site rollback implementation
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:00:25 +05:30
Akhil Narang
46981622ec
feat: generate a non-deterministic database name every time - include current date in the hash
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:00:25 +05:30
Akhil Narang
1ffc4c7834
chore: update output to let the user know they can pass --force
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:00:25 +05:30
Akhil Narang
8cd23ecef5
chore: drop unused parameter
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:00:25 +05:30
Akhil Narang
4a43d68e52
fix: update downgrade warning
...
Seemed a bit confusing, https://github.com/frappe/frappe/pull/24898#discussion_r1521076386
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-13 11:36:00 +05:30
Akhil Narang
0576a085d7
fix(uninstall): don't allow uninstalling an app if we have other apps dependent on it
...
Support ticket 10929 / Sentry FRAPPE-3T8
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-06 13:50:00 +05:30
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
barredterra
72dca18c9e
docs: imporve docstrings
2024-02-15 11:54:14 +01:00
barredterra
ee67b46d4e
refactor: get_(old)_backup_version methods
2024-02-15 11:54:03 +01:00
barredterra
ed597693bb
refactor: better variable name
2024-02-15 11:31:06 +01:00
barredterra
76a830574d
fix: wrong operator in version check
2024-02-15 11:30:33 +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
David Arnold
94378b6566
chore: simplify frappe.connect and use site config for bootstrapping
2024-01-19 13:49:36 +01:00
Akhil Narang
d1906b3c16
refactor: add in a fallback to use db name as db user name
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-16 12:35:01 +05:30
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
Akhil Narang
b9923571dc
fix: check correct part of backup header
...
`-- Backup generated by Frappe 15.1.0 on branch fix-backup-restore`
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-08 13:06:59 +05:30
Akhil Narang
43021911ff
fix: simplify parsing version for older backups
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:09:08 +05:30
Akhil Narang
b010dc584f
chore(installer): fix output when prompting user about downgrade
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:09:08 +05:30
Akhil Narang
998f2c10d6
fix: handle older gzipped backups as well
...
Also fix the actual comparison
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:09:08 +05:30
Akhil Narang
2e382040cd
fix: simplify version detection logic
...
Our version detection code is relatively simple, so we shouldn't have any exceptions arising there
Just check for a None return value to decide whether we should use the older logic
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:09:08 +05:30
Akhil Narang
7db8baa7c4
feat(installer): drop actual gzip file extraction
...
Use `zgrep` to check for table name match where required
Also use a table that's at the top of the dump files (`__Auth`)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:09:07 +05:30
Akhil Narang
3b0f6de883
perf: don't extract backup files unless required
...
Read from the gzipped file wherever possible
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:08:48 +05:30
Hussain Nagaria
8d2137c265
docs: consistent doc strings
2023-12-18 18:27:39 +05:30
barredterra
c35476256f
refactor: simplify conditional logic
...
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
Ankush Menat
1e20820846
refactor: Indicate that weak hash functions are not usedforsecurity ( #23540 )
...
[skip ci]
2023-12-01 16:04:37 +05:30
David Arnold
0dc2a9c2f3
refactor: normalize function signature
2023-11-10 15:12:59 +01:00
David Arnold
b2f9ff09aa
feat(db): boostrap only option if resource management is exogenous
...
The database resource management including privileges granting can be
done by external secops. It can be undesirable to grant the grant option
to the framework user.
This commit implements the possibility to remove user resource
management from frappe entirely and only boostrap the database with its
target user.
2023-11-09 17:11:39 +01:00
gavin
9b112b3e03
fix(cli): Use mysql CLI as fallback is mariadb isnt found ( #23006 )
2023-10-30 15:39:36 +00:00