mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +00:00
Merge branch 'master' into patch-2
This commit is contained in:
commit
c9b5515517
22
README.md
22
README.md
@ -126,14 +126,10 @@ If you are on a fresh server and logged in as root, at first create a dedicated
|
||||
usermod -aG sudo frappe
|
||||
```
|
||||
|
||||
_(it is very common to name this user `frappe`, but this comes with the disadvantage of being
|
||||
_(it is very common to name this user `frappe`, but this comes with the disadvantage of being
|
||||
ranked very high in hackers circles for attempts to entering servers. So production sites it
|
||||
is highly recommended to use a custom username harder to guess for)_
|
||||
|
||||
use --user flag to create a user and install using that user
|
||||
|
||||
python install.py --develop --user [frappe-user]
|
||||
|
||||
For developer setup:
|
||||
|
||||
sudo python install.py --develop
|
||||
@ -142,6 +138,22 @@ For production:
|
||||
|
||||
sudo python install.py --production --user [frappe-user]
|
||||
|
||||
use --user flag to create a user and install using that user (By default, the script will create a user with the username `frappe` if the --user flag is not used)
|
||||
|
||||
python install.py --develop --user [frappe-user]
|
||||
|
||||
use --container flag to install inside a container (this will prevent the `/proc/sys/vm/swappiness: Read-only` file system error)
|
||||
|
||||
sudo python install.py --production --user [frappe-user] --container
|
||||
|
||||
use --version flag to install specific version
|
||||
|
||||
python install.py --develop --version 11 --user [frappe-user]
|
||||
|
||||
use --python flag to specify virtual environments python version, by default script setup python 3
|
||||
|
||||
python install.py --develop --version 11 --python python2.7 --user [frappe-user]
|
||||
|
||||
#### What will this script do?
|
||||
|
||||
- Install all the pre-requisites
|
||||
|
@ -419,9 +419,9 @@ def get_apps_json(path):
|
||||
if path.startswith('http'):
|
||||
r = requests.get(path)
|
||||
return r.json()
|
||||
else:
|
||||
with open(path) as f:
|
||||
return json.load(f)
|
||||
|
||||
with open(path) as f:
|
||||
return json.load(f)
|
||||
|
||||
def validate_branch():
|
||||
for app in ['frappe', 'erpnext']:
|
||||
|
@ -89,7 +89,7 @@ except ImportError:
|
||||
|
||||
@click.command('migrate-env')
|
||||
@click.argument('python', type = str)
|
||||
@click.option('--no-backup', default = False, help = 'Do not backup the existing Virtual Environment')
|
||||
@click.option('--no-backup', is_flag=True)
|
||||
def migrate_env(python, no_backup = False):
|
||||
"""
|
||||
Migrate Virtual Environment to desired Python Version.
|
||||
|
@ -5,10 +5,11 @@ import sys, os, copy
|
||||
@click.command('start')
|
||||
@click.option('--no-dev', is_flag=True, default=False)
|
||||
@click.option('--concurrency', '-c', type=str)
|
||||
def start(no_dev, concurrency):
|
||||
@click.option('--procfile', '-p', type=str)
|
||||
def start(no_dev, concurrency, procfile):
|
||||
"Start Frappe development processes"
|
||||
from bench.utils import start
|
||||
start(no_dev=no_dev, concurrency=concurrency)
|
||||
start(no_dev=no_dev, concurrency=concurrency, procfile=procfile)
|
||||
|
||||
|
||||
@click.command('restart')
|
||||
|
@ -34,7 +34,7 @@ server {
|
||||
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";
|
||||
ssl_prefer_server_ciphers on;
|
||||
{% endif %}
|
||||
|
||||
|
||||
add_header X-Frame-Options "SAMEORIGIN";
|
||||
|
||||
location /assets {
|
||||
@ -58,6 +58,12 @@ server {
|
||||
}
|
||||
|
||||
location / {
|
||||
|
||||
location ~ ^/files/.*.(htm|html|svg|xml) {
|
||||
add_header Content-disposition "attachment";
|
||||
try_files /{{ site_name }}/public/$uri @webserver;
|
||||
}
|
||||
|
||||
try_files /{{ site_name }}/public/$uri @webserver;
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,7 @@ def get_program(programs):
|
||||
def get_process_manager():
|
||||
return get_program(['foreman', 'forego', 'honcho'])
|
||||
|
||||
def start(no_dev=False, concurrency=None):
|
||||
def start(no_dev=False, concurrency=None, procfile=None):
|
||||
program = get_process_manager()
|
||||
if not program:
|
||||
raise Exception("No process manager found")
|
||||
@ -329,6 +329,9 @@ def start(no_dev=False, concurrency=None):
|
||||
if concurrency:
|
||||
command.extend(['-c', concurrency])
|
||||
|
||||
if procfile:
|
||||
command.extend(['-f', procfile])
|
||||
|
||||
os.execv(program, command)
|
||||
|
||||
def check_cmd(cmd, cwd='.'):
|
||||
@ -351,16 +354,16 @@ def check_git_for_shallow_clone():
|
||||
from .config.common_site_config import get_config
|
||||
config = get_config('.')
|
||||
|
||||
if config.get('release_bench'):
|
||||
return False
|
||||
if config:
|
||||
if config.get('release_bench'):
|
||||
return False
|
||||
|
||||
if not config.get('shallow_clone'):
|
||||
return False
|
||||
if not config.get('shallow_clone'):
|
||||
return False
|
||||
|
||||
git_version = get_git_version()
|
||||
if git_version > 1.9:
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_cmd_output(cmd, cwd='.'):
|
||||
try:
|
||||
@ -537,7 +540,7 @@ def update_json_file(filename, ddict):
|
||||
|
||||
content.update(ddict)
|
||||
with open(filename, 'w') as f:
|
||||
content = json.dump(content, f, indent=1, sort_keys=True)
|
||||
json.dump(content, f, indent=1, sort_keys=True)
|
||||
|
||||
def drop_privileges(uid_name='nobody', gid_name='nogroup'):
|
||||
# from http://stackoverflow.com/a/2699996
|
||||
|
@ -14,7 +14,7 @@ def install_bench(args):
|
||||
success = run_os_command({
|
||||
'apt-get': [
|
||||
'sudo apt-get update',
|
||||
'sudo apt-get install -y git build-essential python3-setuptools python3-dev libffi-dev libssl-dev'
|
||||
'sudo apt-get install -y git build-essential python3-setuptools python3-dev libffi-dev'
|
||||
],
|
||||
'yum': [
|
||||
'sudo yum groupinstall -y "Development tools"',
|
||||
|
@ -21,4 +21,9 @@
|
||||
- tk8.5-dev
|
||||
when: ansible_distribution_version | version_compare('8', 'ge')
|
||||
|
||||
- name: install pdf prerequisites debian
|
||||
apt: pkg={{ item }} state=present force=yes
|
||||
with_items:
|
||||
- libssl-dev
|
||||
|
||||
...
|
@ -12,7 +12,6 @@
|
||||
- libcrypto++-dev
|
||||
- libfreetype6-dev
|
||||
- liblcms2-dev
|
||||
- libssl-dev
|
||||
- libwebp-dev
|
||||
- libxext6
|
||||
- libxrender1
|
||||
|
@ -18,4 +18,17 @@
|
||||
- tk8.6-dev
|
||||
when: ansible_distribution_version | version_compare('14.04', 'ge')
|
||||
|
||||
|
||||
- name: install pdf prerequisites for Ubuntu < 18.04
|
||||
apt: pkg={{ item }} state=present force=yes
|
||||
with_items:
|
||||
- libssl-dev
|
||||
when: ansible_distribution_version | version_compare('18.04', 'lt')
|
||||
|
||||
- name: install pdf prerequisites for Ubuntu >= 18.04
|
||||
apt: pkg={{ item }} state=present force=yes
|
||||
with_items:
|
||||
- libssl1.0-dev
|
||||
when: ansible_distribution_version | version_compare('18.04', 'ge')
|
||||
|
||||
...
|
@ -1,3 +1,4 @@
|
||||
six
|
||||
Click
|
||||
jinja2
|
||||
virtualenv
|
||||
|
Loading…
Reference in New Issue
Block a user