2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-10 09:02:10 +00:00
Commit Graph

786 Commits

Author SHA1 Message Date
Chris Ian Fiel
76943e070c
fix: "Error: no such option: --backup" (#946)
* fix issue: Error: no such option: --backup
https://discuss.erpnext.com/t/bench-update-fails-due-to-no-bench-backup-option/58697
2020-03-04 08:44:45 +05:30
gavin
6ecfa006e2
Merge pull request #925 from gavindsouza/bench-cmd-help
refactor: bench commands help
2020-03-02 23:17:46 +05:30
Gavin D'souza
0088d1565d style: fixed cmd log formatting via exec_cmd 2020-03-02 23:00:15 +05:30
gavin
b0649870ee
fix: random failings from subprocesses and command formatting (#935)
* 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
2020-03-02 19:32:25 +05:30
Gavin D'souza
9b5e1c9fdc style: removed unused imports 2020-03-02 19:24:41 +05:30
gavin
b672466dad
Merge branch 'master' into bench-cmd-help 2020-03-02 19:06:04 +05:30
gavin
ec1343c0fa
fix: dont abort script if not overwriting scripts (#919)
* 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
2020-02-28 15:33:00 +05:30
Chinmay D. Pai
3bd83da49b
chore: remove redundant print messages
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-02-26 20:00:52 +05:30
Chinmay D. Pai
206d5ed3ae
chore: solve merge conflicts
* renme build_asset_files tp skip_asset
* add overwrite flag
* move building assets to postprocessing

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-02-25 11:58:49 +05:30
Chinmay D. Pai
0c0ed767f7
chore: add overwrite flag, repo_name format, and exit gracefully
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-02-25 11:45:03 +05:30
gavin
92d2fbdc13
fix: setup cron job for renewing ssl certificate (#918)
* fix: setup cronjob for renewing ssl certificate

cronjob set for 1st of every month

* fix: cannonical PYPI package name updates

    refs:
    - https://pypi.org/project/python-crontab/
    - https://github.com/frappe/bench/pull/918#issuecomment-589961301
2020-02-24 12:09:24 +05:30
Gavin D'souza
8fd534747a docs: added missing help for install prerequisites 2020-02-19 11:39:07 +05:30
Gavin D'souza
f9521efc50 chore: removed unused and optimized imports 2020-02-18 19:33:44 +05:30
Gavin D'souza
b4f4e71719 chore: move 'find_parent_bench' to utils
style: consistent spaces and formatting, code cleanup
2020-02-18 19:15:52 +05:30
Gavin D'souza
90d2313947 chore: drop bench shell command 2020-02-18 18:50:28 +05:30
Gavin D'souza
043f044853 style: bench.commands.utils help added 2020-02-18 18:47:38 +05:30
Gavin D'souza
9d00bc743e style: help moved in bench.commands.utils docs 2020-02-18 18:04:20 +05:30
Gavin D'souza
2713a2e9cd fix: move update to utils
- update.py
    * chore: drop auto_update options
    * fix: reloading bench modules post requirements setup (seemed
    unecessary and randomly crashed `bench start` process)
    * docs: added help for commands
    * chore: deprecated switch-to-master function

  - utils.py
    * sorted imports for readability
    * formatting and consistency
    * dropped unused setup_auto_update
    * dropped broken pre_upgrade function

Signed-off-by: Gavin D'souza <gavin18d@gmail.com>
2020-02-18 17:19:42 +05:30
Gavin D'souza
f1ea6fce3f chore: drop auto update bench via cronjob 2020-02-18 17:07:26 +05:30
Gavin D'souza
063e4a85be refactor: bench.command.install
* sorted imports
    * consistent formatting and use of docstrings
    * help added for click commands
2020-02-18 12:24:18 +05:30
Gavin D'souza
9621686597 refactor: consistent help action in click, formatting and sorted imports 2020-02-18 11:57:23 +05:30
Gavin D'souza
53e2272a66 refactor: bench.commands.config
* sorted imports
    * made it a little DRY
    * code formatting
    * added help
2020-02-18 11:50:53 +05:30
Gavin D'souza
e4355001e7 fix: remove unnecessary - commands aliases 2020-02-18 10:56:37 +05:30
Gavin D'souza
214a2093eb fix: added aliases for click commands to convert _ seperated commands to
- seperated ones in config group

    eg: `bench config auto-update on` functions same as `bench config
    auto_update on`
2020-02-18 10:54:32 +05:30
Gavin D'souza
1f488a8bfd docs: bench.command.make
added help for make commands
2020-02-17 17:24:17 +05:30
Gavin D'souza
6bfe601dc9 Merge branch 'master' of github.com:frappe/bench into bench-cmd-help 2020-02-17 16:40:34 +05:30
Gavin D'souza
1442cf6980 refactor: bench.commands.setup
* updated help for all commands
    * sorted imports
    * code formatting and consistent quotes
2020-02-17 16:35:52 +05:30
Gavin D'souza
7ccc275792 fix(lets-encrypt): run command non interactively if flag passed 2020-02-11 14:02:47 +05:30
gavin
66dd5af087 Revert "fix: pip pinned to 19.3.1 after v20 breaking" 2020-02-10 14:56:55 +05:30
Gavin D'souza
1ae9bfb568 Merge branch 'master' of github.com:frappe/bench into migrate-env-fix 2020-02-09 13:17:00 +05:30
Gavin D'souza
1259b089c8 refactor: change "no_backup" variable and cleanup comments 2020-02-09 13:14:06 +05:30
Gavin D'souza
f0596c5928 feat: bench pip *
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
2020-02-06 15:24:26 +05:30
Gavin D'souza
0c29bba659 refactor: bench migrate-env command
* moved from __init__ to utils and updated sequence of installing
applications in env
* chanaged import namespaces
2020-02-06 01:32:50 +05:30
Gavin D'souza
92cd942fcf refactor: change_working_directory optimizations 2020-02-02 00:19:58 +05:30
Gavin D'souza
2257f86fee feat: execute bench/frappe commands from anywhere inside a bench
directory
2020-02-01 18:58:37 +05:30
gavin
e06d9a2cf5
Merge pull request #909 from gavindsouza/venv-check
fix: virtualenv check for installing requirements
2020-01-23 13:49:33 +05:30
Bernhard Sirlinger
40f7e09c0f fix: issue when ignore_exist is set and the path already exists 🐛 (#910)
See 7fb1484b7f (diff-237d6b07e1835fbd8e51e251f66b2ec0) where the logic was changes to exclude handling this edge case
2020-01-23 12:33:14 +05:30
Gavin D'souza
3ea19e9533 chore: bench.utils format, imports sort, spaces 2020-01-22 15:30:06 +05:30
Gavin D'souza
63128a21bf fix: check if virtual env (using pip refs) 2020-01-22 15:19:38 +05:30
Gavin D'souza
b9bb9440d9 fix: update packages even if pip not in path 2020-01-22 12:54:58 +05:30
Gavin D'souza
3b06683ebf fix: checks for bench requirements to be installed without the --user
flag via pip

references: https://stackoverflow.com/questions/1871549/determine-if-python-is-running-inside-virtualenv
2020-01-22 12:05:27 +05:30
Gavin D'souza
7498c8e497 fix: pip pinned to 19.3.1 after v20 breaking
reference: https://github.com/pypa/pip/issues/7217
2020-01-21 17:49:18 +05:30
Gavin D'souza
03c4d9610a chore: fixed validate branch on update 2020-01-21 14:27:00 +05:30
gavin
8d792190b4
Merge pull request #904 from barredterra/patch-1
fix: bump MariaDB version
2020-01-20 10:46:52 +05:30
gavin
f60466caaf
Merge pull request #899 from gavindsouza/bench-cleanup
feat: rollback on bench init
2020-01-20 10:46:09 +05:30
Gavin D'souza
b85651653b fix: validate branch error message + cleanup 2020-01-20 09:43:51 +05:30
ckosiegbu
5762724cc7 fix: validate branch in bench update
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
2020-01-20 09:43:39 +05:30
Raffael Meyer
a2ea3d90c5
fix: bump MariaDB version
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=''):
    # ...
```
2020-01-17 20:01:38 +01:00
Gavin D'souza
c64a7e90e6 fix(utils): sort imports, add parenthesis on ambigupus expr 2020-01-15 16:29:08 +05:30
Gavin D'souza
1b0008d709 fix: single process to pip install requirements, quiet flag added 2020-01-15 14:24:03 +05:30
Gavin D'souza
71af7320f2 fix: ansible install on versioned pip 2020-01-15 13:36:32 +05:30
Gavin D'souza
7fb1484b7f fix: seperate colors from log, change exception
changes: thrown if bench dir exists on bench init
style: fixed whitespaces and formatting
2020-01-15 13:33:27 +05:30
Gavin D'souza
f0c1893565 feat: ability to rollback failed bench init 2020-01-15 13:31:57 +05:30
gavin
5271e1ea2a
Merge pull request #895 from gavindsouza/new-commands
feat: "bench find", print log api
2020-01-14 10:55:38 +05:30
Gavin D'souza
963b2f9ce5 feat: added bench find command 2020-01-10 20:42:13 +05:30
Gavin D'souza
e32281557f feat: added bench.utils.log and updated is_bench_directory api 2020-01-10 14:48:09 +05:30
Gavin D'souza
ef1a624556 fix(cli): give warn that commands are not executed in a bench folder 2020-01-10 14:45:13 +05:30
gavin
76d8b3d9f6
Revert "perf: faster bench" 2020-01-07 16:06:15 +05:30
gavin
e74c59dc73
Merge pull request #888 from gavindsouza/faster-commands
perf: faster bench
2020-01-07 14:04:37 +05:30
gavin
9559fe0c76
Merge pull request #857 from developmentforpeople/fix-get-sites-as-frappe
fix: bench.get_sites now do same checks to validate a site folder like frappe.utils.get_sites
2020-01-03 15:11:20 +05:30
Gavin D'souza
8764813121 fix: "faster" get_sites function
chore: dropped unused get_sites_dir function
style: pythonic "is not" usage
2020-01-02 18:47:13 +05:30
Development for People
a3dc9e69b7 fix: bench.utils.get_sites updated to frappe.utils.get_sites
avoids issues with non sites folder like 'jupyter_notebooks'
2020-01-02 18:46:05 +05:30
Gavin D'souza
3b91d98d85 fix: compatibility fixes, better cpu utilization 2019-12-31 14:09:42 +05:30
Gavin D'souza
bb677d17df perf: Faster Commands execution by commands caching 2019-12-31 14:06:00 +05:30
Gavin D'souza
a7a8790de6 fix: git stash requires user details pre git v2.21 2019-12-27 15:44:03 +05:30
gavin
be162b542d
Merge pull request #884 from gavindsouza/bench-update
feat: Bench update
2019-12-27 13:48:53 +05:30
Gavin D'souza
186c0eafda feat: auto-stash changes in bench (tool) on update 2019-12-25 19:24:23 +05:30
Gavin D'souza
c93a25d336 feat: "bench update" from non-bench directory 2019-12-25 19:23:14 +05:30
Shridhar Patil
a65e9f09dc changed parameter name 2019-12-20 17:20:28 +05:30
Shridhar Patil
b005720a2b skip asstes while doing get-app 2019-12-19 17:35:48 +05:30
sahil28297
fb13dfb0c2 Revert "fix(fonts): remove unused setup_fonts method" (#881)
This reverts commit 0d4ace95a6.
2019-12-17 15:05:19 +05:30
Chinmay Pai
0d4ace95a6
fix(fonts): remove unused setup_fonts method (#878)
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>
2019-12-17 12:51:16 +05:30
Chinmay Pai
d1ebb4c3b2
security(nginx): use only strong ciphers over ssl (#869)
* 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>
2019-12-16 16:36:55 +05:30
Chinmay D. Pai
cac66a6b88
fix: invalid syntax for click option
ughhhhhhhhhh

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2019-12-15 13:59:12 +05:30
Chinmay D. Pai
699705f64b
fix: incorrect import statement
use six.moves instead of six

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2019-12-15 13:46:14 +05:30
Chinmay Pai
459432b195
fix: incorrect import statement
use six.moves instead of six
2019-12-15 13:45:17 +05:30
Chinmay D. Pai
d1a3017172
fix(get-app): handle existing directory and other formatting changes
* 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>
2019-12-15 12:06:12 +05:30
Chinmay Pai
d2d577201d
fix: remove unused method and use six to reload module (#875)
* 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>
2019-12-15 10:41:27 +05:30
Chinmay Pai
75ffa0325e
fix: use six to check for string types (#874)
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>
2019-12-15 10:16:21 +05:30
Development for People
7051aa3d4e fix(nginx): add redirect rules to avoid duplicate content 2019-12-07 11:35:21 +05:30
Chinmay D. Pai
17b447591f
fix(cron): change cron command for renewing ssl
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2019-12-05 15:23:13 +05:30
Gavin D'souza
cd711b04dc fix: bench update compatible venv installed pkg 2019-11-29 16:48:52 +05:30
Gavin D'souza
489d3b2501 fix: update bench requirements for user 2019-11-26 18:08:50 +05:30
Gavin D'souza
ea106e89c9 fix: dont install bench dependencies in env 2019-11-26 11:24:40 +05:30
gavin
1d7e3ca383
Merge pull request #861 from gavindsouza/pinned-requirements
fix: add upgrade flags to pip install
2019-11-18 12:16:10 +05:30
Gavin D'souza
12912c5943 style: better readability and removed redundant flag 2019-11-17 16:06:24 +05:30
Gavin D'souza
025665a093 fix: update pinned requirements
after pinning requirements, to avoid incompatible 2nd level
dependencies of packages, pass the -U flag
2019-11-17 04:39:33 +05:30
gavin
16da871a8b
Merge pull request #852 from zerodhatech/set_redis_hosts
chore(bench-cli): commands to set redis hosts
2019-11-04 17:11:21 +05:30
gavin
13c4db4c2e
chore(style): format string indents 2019-11-04 17:10:39 +05:30
Shridhar Patil
787625fe28 commands to set redis hosts 2019-11-03 10:59:56 +05:30
Paul Banks
b8cc8b03f7 Crontab: Fix for ArchLinux which uses the FreeBSD syntax 2019-10-25 08:28:49 +00:00
gavin
ce6b4c8a11 fix: git depth, fixed requirements (#845) 2019-10-21 15:48:38 +05:30
Suraj Shetty
f7bec398ff
feat: Option to provide path to Procfile (#833)
feat: Option to provide path to Procfile
2019-09-12 23:21:41 +05:30
Rucha Mahabal
6dbf6b9846 fix: no-backup option argument (#842)
* fix: --no-backup option set to 1 by default

* Update bench/commands/__init__.py

Co-Authored-By: Chinmay Pai <chinmaydpai@gmail.com>
2019-09-10 17:59:36 +05:30
Aditya Hase
893cb884ee
fix(security): Force download html, svg and xml files
Same as https://github.com/frappe/frappe/pull/7074
for public files in production environment
2019-09-05 15:19:40 +05:30
Faris Ansari
5bedd2cb52 feat: Option to provide path to Procfile 2019-08-24 19:55:32 +05:30
Sahil Khan
933d7a15b8 fix(release): syntax error 2019-07-26 15:41:28 +05:30
Aditya Hase
46566cd9ac fix(ansible): Make everything verbose 2019-07-23 19:50:07 +05:30
Aditya Hase
bdda0419ea fix: Allow skipping assets 2019-07-23 19:34:42 +05:30
Aditya Hase
46b78f4a53 fix: Remove the infamous print style 2019-07-23 19:32:30 +05:30