* fix: random failings from subprocesses
async executions of muliple processes leads to various errors.
eg: get-app operation runs a "git clone" at the same time "pip
install" is run. This causes failures as the folder either doesnt
exist or isnt complete.
Proposed solution to this is to execute blocking subprocesseses
* style: command logging format via exec_cmd
* fix: dont abort script if not overwriting scripts
why: currently, running of `bench ` or `bench setup
production` creates nginx conf files and asks for confirmation before
overwriting them. in case user doesnt want to overwrite files,
`setup production` and `lets-encrypt` is exitted abrubtly and nginx isnt started again after
* fix: use click.confirm instead of six.moves.input
* fix: use click.confirm instead of six.moves.input
* chore: remove unused imports
* renme build_asset_files tp skip_asset
* add overwrite flag
* move building assets to postprocessing
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
Directly install/update/remove packages from your env using bench pip
commands. Pretty much just like using pip
To check help don't add the --help flag, use the -h flag instead, use the pip help command. For example, checking help for pip install can be done by
bench pip help install
bench pip install -h
bench update assumes that erpnext is an installed app in the bench. This is a wrong assumption. This work around checks for the intersection of installed apps with the list ['frappe', 'erpnext'] and only attempts to get the current branch of apps that occur in the intersection. This way, if erpnext is not installed (very likely for those using frappe only to build their own apps) there wont be an error when get_current_branch is called for erpnext. The need to perform the kind of check being performed in validate_branch is a strong case for considering apps being able to add "bench update" hooks in their hooks.py
See this topic https://discuss.erpnext.com/t/bench-update-error-no-such-file-or-directory-apps-erpnext/56932?u=chude_osiegbu
Update MariaDB version from `10.2` to `10.3` to match requirement in README.
By the way, is there any reason for the empty string being the default password and version?
```py
def install_maridb(mysql_root_password='', version=''):
# ...
```
this method replaces existing system fonts directory under /etc/fonts
and /usr/share/fonts with fonts that are probably obsolete by now and
are no longer used.
removing this method so that it does not mess with anybody's system
fonts
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
* security(nginx): use only strong ciphers over ssl
* drop support for TLSv1 and TLSv1.1, and add support for TLSv1.3
* disable all ciphers else for EECDH+AESGCM and EDH+AESGCM
* disable session ticketing
* use secp384r1 as certificate curve
* enable strict transport security with preloading
* enable xss-protection
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
* chore: explicitly state ssl on listening socket
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
* if a directory for the application already exists, provide user with 2
options:
* ask to remove the directory and reclone (overwrite)
* ask if the user wants to reinstall the application
* separate get_app_name from get_app
* move building assets and postprocessing to install_app method
* make formatting changes to the code for flake8
* use reload_module from six instead of builtins
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
* remove download_chart_of_accounts method as it is not being used
anywhere
* use reload_module from six for flake8 fixes
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
fixes issue where unicode keyword does not exist for python3:
Traceback (most recent call last):
File "/usr/local/bin/bench", line 11, in <module>
load_entry_point('bench', 'console_scripts', 'bench')()
File "/home/frappe/.bench/bench/cli.py", line 40, in cli
bench_command()
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/frappe/.bench/bench/commands/setup.py", line 22, in setup_nginx
make_nginx_conf(bench_path=".", yes=yes)
File "/home/frappe/.bench/bench/config/nginx.py", line 13, in make_nginx_conf
sites = prepare_sites(config, bench_path)
File "/home/frappe/.bench/bench/config/nginx.py", line 100, in prepare_sites
sites_configs = get_sites_with_config(bench_path=bench_path)
File "/home/frappe/.bench/bench/config/nginx.py", line 217, in get_sites_with_config
if isinstance(domain, str) or isinstance(domain, unicode):
NameError: name 'unicode' is not defined
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>