Commit graph

232 commits

Author SHA1 Message Date
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
Akhil Narang
091ebdd8dc
refactor(treewide): use mariadb commands directly instead of mysql (#22620)
This has been done because the mysql command issues a deprecation warning now

mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-10 12:49:16 +05:30
Ankush Menat
e4a6016f83 fix!: don't force all dependencies to be reinstalled
When you reinstall app forcefully all dependencies will also get
forcefully reinstalled. This IMO isn't required in most cases and can
even be breaking.

Anyway if required those apps can be manually force installed.
2023-08-23 18:05:10 +05:30
David Arnold
6b2bb9a2ab
fix: add env overrides for service orchestration (#21577)
This avoids having to manipulate config files in brittle bash
entrypoints that need to react to dynamic service discovery.

This significantly improves the operability of various bench sites.
2023-07-14 11:39:01 +05:30
Ankush Menat
ae8ee5064c refactor!: Remove error snapshot 2023-06-28 10:59:51 +05:30
Rucha Mahabal
ba8f97e789 feat: before/after hooks for any app install/uninstall 2023-06-22 16:07:06 +05:30
Gavin D'souza
d357af1533 refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
Richard Case
e80c8ac862
fix: improved installed app fail feedback (#19668) 2023-01-20 13:02:09 +05:30
Ankush Menat
442ba5dbf2
fix: set-config -g (#19217)
This isn't working because it uses update_site_config command which
attemts to find site_dir to create a lock which doesn't work when site
isn't init-ed.
2022-12-09 11:10:09 +05:30
Ankush Menat
49437f53b4
feat: operation level locking for CLI commands (#19162)
This prevents mistakenly issuing same commands twice which can be
dangerous.

added global lock(s):
- [x] bench build

added site level lock(s):
- [x] bench new-site sitename
- [x] bench --site sitename migrate
- [x] bench install-app appname
- [x] bench build
- [x] bench restore (the code is just meh, needs some cleanup)

closes https://github.com/frappe/frappe/issues/13215
2022-12-08 13:24:43 +05:30
Ankush Menat
d389fffbb7
feat: inter-process file locks (#19133) 2022-12-06 16:31:51 +05:30
Ankush Menat
70633573c2
fix: dont convert row format if not required (#18900) 2022-11-16 20:48:50 +05:30
Ankush Menat
ad7c0816f8
fix: prevent deleting standard doctypes in prod (#18803) 2022-11-08 21:27:41 +05:30
phot0n
51ac3e8a99 fix: sync app dashboard on app install
* chore: fix sync_dashboards' docstring
2022-09-12 00:01:21 +05:30
Nabin Hait
395caebd5a fix: init only existing single doctypes 2022-08-11 17:10:55 +05:30
Gavin D'souza
71b5c77e6e Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-07-05 14:55:02 +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
Gavin D'souza
cf699fe40b Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-06-29 13:49:18 +05:30
Ankush Menat
d35d7ffbe2 fix: remove bare exception catching
A bare except catches lots of things (like generator iteration end) and should never be used.
2022-06-28 18:05:00 +05:30
Gavin D'souza
b4578dc632 Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-06-15 16:40:29 +05:30
Ankush Menat
82cc98366d fix: dont attempt to init singles that dont exist
This is done during app install stage and causes unnecessary failures
where stale doctypes are left in db.
2022-05-29 13:46:48 +05:30
gavin
73c3db12ee refactor(minor): Move internal util to the module where it's used 2022-05-24 19:19:53 +05:30
phot0n
ef99b57a08 chore: use secho instead of raising exception if app is already installed
* chore: singular click import
2022-05-11 16:18:14 +05:30
phot0n
fc6093515d chore: add comments and add force flag to more places 2022-05-11 16:18:14 +05:30
chillaranand
d2b63d0935 feat: Added force flag to install-app command 2022-05-11 16:18:14 +05:30
Ankush Menat
dad19e2c3f fix: required_apps blocks app install 2022-04-13 13:51:51 +05:30
Ankush Menat
8269e8dd47 fix: ignore duplicate modules during install 2022-04-13 13:03:09 +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
ChillarAnand
7c46736654 fix: Use app name for parsing app name 2022-04-06 12:26:26 +05:30
ChillarAnand
112593fb5f fix: Use github.com when github api rate is crossed 2022-04-01 12:05:04 +05:30
saxenabhishek
f8c4098585 docs: docstings and refs 2022-03-22 14:17:01 +05:30
saxenabhishek
c53e6d822d feat: parse app name from tags and urls 2022-03-22 14:16:59 +05:30
Gavin D'souza
14a4e35d8d fix: Typo in is_downgrade's user warning
Fixes https://github.com/frappe/frappe/issues/16312
2022-03-17 09:51:00 +05:30
Revant Nandgaonkar
cdc6bcadb1
fix(cli): Database agnostic options for root db credentials (#15973)
* fix(bench): new-site params for root db credentials

allow root credentials for postgresql
use common cli option name for both database types

* fix(bench): backward compatible db params

Co-authored-by: gavin <gavin18d@gmail.com>

* fix(bench): use common db cred params

use --db-root-username and --db-root-password

* feat(bench): add --set-default to bench new-site

* fix: do not set default root user

* fix: indentation

Co-authored-by: gavin <gavin18d@gmail.com>
2022-02-25 09:58:59 +05:30
barredterra
745297a49d refactor: a not in b
Search: if not ([\w\d]*?) in ([\w\d]*?)
Replace: if $1 not in $2
2022-02-21 19:54:34 +01:00
ChillarAnand
0a1cd9e623 fix: Removed verbose flag for gzip 2022-02-17 15:43:07 +05:30
Ankush Menat
fd227d38f4
feat: post model-sync patches (#15351)
Ability to run a few patches after the doctype model schema is synced.

Read module-level docstring of patch_handler.py for more info.
2022-01-26 11:21:30 +05:30
barredterra
dac9349aef refactor: use is bool instead of == bool 2022-01-17 15:40:33 +01:00
phot0n
1d879f741b feat: before_uninstall and after_uninstall hooks 2021-12-20 14:05:10 +05:30