├── .github ├── ISSUE_TEMPLATE │ ├── bug.md │ ├── bug_report.md │ ├── documentation_report.md │ └── feature_request.md └── workflows │ ├── doc.yml │ └── mirror.yml ├── .gitignore ├── License.md ├── Note.md ├── README-zh.md ├── README.md ├── ansible.cfg ├── docs ├── .vuepress │ ├── config.js │ ├── nav │ │ ├── en.js │ │ └── zh.js │ ├── public │ │ └── favicon.ico │ ├── sidebar │ │ ├── en.js │ │ └── zh.js │ └── styles │ │ ├── index.styl │ │ ├── override.styl │ │ ├── palette.styl │ │ └── style.styl ├── README.md ├── admin-mysql.md ├── admin-services.md ├── else-faq.md ├── else-troubleshooting.md ├── package.json ├── solution-backup.md ├── solution-https.md ├── solution-more.md ├── solution-smtp.md ├── solution-upgrade.md ├── stack-accounts.md ├── stack-components.md ├── stack-deployment.md ├── stack-installation.md └── zh │ ├── README.md │ ├── admin-mysql.md │ ├── admin-services.md │ ├── else-faq.md │ ├── else-troubleshooting.md │ ├── package.json │ ├── solution-backup.md │ ├── solution-https.md │ ├── solution-more.md │ ├── solution-smtp.md │ ├── solution-upgrade.md │ ├── stack-accounts.md │ ├── stack-components.md │ ├── stack-deployment.md │ └── stack-installation.md ├── erpnext.yml ├── readme.txt ├── requirements.yml ├── roles ├── .gitignore ├── CHANGLOG.md ├── README.md └── erpnext │ ├── Notes.md │ ├── defaults │ └── main.yml │ ├── files │ └── check_dockerapp_service.sh │ ├── handlers │ └── main.yml │ ├── tasks │ └── main.yml │ └── vars │ └── main.yml └── vars └── main.yml /.github/ISSUE_TEMPLATE/bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | --- 8 | **Describe the bug** 9 | A clear and concise description of what the bug is. 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 1. Go to '...' 13 | 2. Click on '....' 14 | 3. Scroll down to '....' 15 | 4. See error 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | **Screenshots** 19 | If applicable, add screenshots to help explain your problem. 20 | **Desktop (please complete the following information):** 21 | - Browser [e.g. chrome, safari] 22 | - Version [e.g. 22] 23 | **Additional context** 24 | Add any other context about the problem here. 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a bug encountered while using websoft9's product 4 | labels: bug 5 | --- 6 | 7 | **Describe the bug** 8 | 9 | A clear and concise description of what the bug is. 10 | 11 | ## Deployment method 12 | 13 | - [ ] subscription image from MarketPlace of Cloud 14 | - [ ] All-in-one Installer 15 | - [ ] ansible-playbook cli 16 | - [ ] mcloud 17 | - [ ] create instance from private image 18 | 19 | ## Bug source 20 | 21 | - [ ] Bugs from installation 22 | - [ ] Bugs from first use 23 | - [ ] Other (You should describe it) 24 | 25 | ## System Environment 26 | 27 | **Application Version** 28 | 29 | e.g v4.5 30 | 31 | **OS** 32 | 33 | - [ ] Ubuntu18.x 34 | - [ ] Ubuntu20.x 35 | - [ ] CentOS7.x 36 | - [ ] CentOS8.x 37 | - [ ] AmazonLinux2 38 | - [ ] OracleLinux7.8 39 | - [ ] OracleLinux8.2 40 | - [ ] Other (You should describe it) 41 | 42 | **Cloud PlatForm** 43 | 44 | - [ ] Azure 45 | - [ ] Aws 46 | - [ ] 阿里云 47 | - [ ] 腾讯云 48 | - [ ] 华为云 49 | - [ ] AlibabaCloud 50 | - [ ] HUWEICloud 51 | - [ ] Other (You should describe it) 52 | 53 | 54 | ## Bug reproduce 55 | 56 | Steps to reproduce the behavior: 57 | 58 | 1. Go to '...' 59 | 2. Click on '....' 60 | 3. Scroll down to '....' 61 | 4. See error 62 | 63 | ## Bug reports 64 | 65 | ### Bug Context 66 | 67 | Bug context includes bug error, error logs and service status, it is very important for resolving issue 68 | 69 | ``` 70 | # bug error 71 | (paste here) 72 | 73 | # service status 74 | (paste here) 75 | 76 | # error logs 77 | (paste here) 78 | ``` 79 | 80 | ### Bug Screenshot 81 | 82 | paste screenshot here 83 | 84 | ## Your suggestion 85 | 86 | **The reason of Bug** 87 | 88 | You can describe the reason if you have found it 89 | 90 | **Your solution for Bug** 91 | 92 | You can describe your solution here 93 | 94 | **Additional context** 95 | 96 | You can add any other context about the problem here. 97 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation report 3 | about: improve current Documentation 4 | labels: documentation 5 | --- 6 | 7 | 8 | ## Language 9 | 10 | - [ ] Chinese 11 | - [ ] English 12 | 13 | ## Content error 14 | 15 | Provide us with documentation errors, e.g spelling mistake, wrong screenshot, code syntax error. 16 | 17 | * URL: 18 | * Description: 19 | * Screenshot 20 | 21 | ## Content optimization 22 | 23 | Provide us with content optimization, e.g easy to read, simplify the steps, step by step, precise expression. 24 | 25 | * URL: 26 | * Description: 27 | 28 | ## New content 29 | 30 | Describe important content what do you think is important in this documentation. 31 | 32 | **What content do you want to add?** 33 | 34 | (describe here) 35 | 36 | **Steps for the content** 37 | 38 | 1. Go to '...' 39 | 2. Click on '....' 40 | 3. Scroll down to '....' 41 | 4. Modify file '....' 42 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: 'enhancement' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **What type of your feature request?** 11 | 12 | - [ ] Add new features 13 | - [ ] Improve current features 14 | 15 | **Is your feature request related to a problem? Please describe.** 16 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 17 | 18 | **Describe the solution you'd like** 19 | A clear and concise description of what you want to happen. 20 | 21 | **Describe alternatives you've considered** 22 | A clear and concise description of any alternative solutions or features you've considered. 23 | 24 | **Additional context** 25 | Add any other context or screenshots about the feature request here. 26 | -------------------------------------------------------------------------------- /.github/workflows/doc.yml: -------------------------------------------------------------------------------- 1 | name: Docs Build and Upload 2 | 3 | on: 4 | push: 5 | paths: docs/** 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@master 12 | 13 | - name: npm install vuepress 14 | run: | 15 | sudo npm install -g vuepress 16 | 17 | - name: vuepress build 18 | run: | 19 | cd docs 20 | sudo vuepress build 21 | env: 22 | CI: true 23 | 24 | # to azure blob 25 | - name: debug 26 | run: ls 27 | - uses: bacongobbler/azure-blob-storage-upload@v1.2.0 28 | with: 29 | source_dir: docs/html 30 | container_name: $web 31 | connection_string: ${{ secrets.Azure_blob }} 32 | extra_args: '--destination-path docs' 33 | sync: false 34 | -------------------------------------------------------------------------------- /.github/workflows/mirror.yml: -------------------------------------------------------------------------------- 1 | name: Mirror to Gitee Repo 2 | 3 | # on: [ push, delete, create ] 4 | on: 5 | push: 6 | branches: 7 | - main 8 | 9 | jobs: 10 | git-mirror: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Configure Private Key 14 | env: 15 | SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }} 16 | run: | 17 | mkdir -p ~/.ssh 18 | echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa 19 | chmod 600 ~/.ssh/id_rsa 20 | echo "StrictHostKeyChecking no" >> ~/.ssh/config 21 | - name: Push Mirror 22 | env: 23 | # SOURCE_REPO: 'https://github.com/mgithubTestOrg/giteeMirror.git' 24 | SOURCE_REPO: 'https://github.com/${{ github.repository }}.git' 25 | # DESTINATION_REPO: 'git@gitee.com:mgithubTestOrg/giteeMirror.git' 26 | # DESTINATION_REPO: 'git@gitee.com:${{ github.repository }}.git' 27 | DESTINATION_REPO: 'git@gitee.com:websoft9/${{ github.event.repository.name }}.git' 28 | BASE_REPO: 'https://github.com/${{ github.repository }}' 29 | run: | 30 | git clone "$SOURCE_REPO" && cd `basename "$BASE_REPO"` 31 | git config --global user.name "${{ github.actor }}" 32 | git config --global user.email "xxx@websoft9.com" 33 | 34 | git remote set-url --push origin "$DESTINATION_REPO" 35 | git push origin main --force 36 | 37 | git checkout dev 38 | if [ -f "requirements.yml" ];then 39 | sed -i 's/github/gitee/g' requirements.yml 40 | git add requirements.yml 41 | git commit -m "Make requirements.yml compatible with gitee" 42 | fi 43 | git push origin dev --force 44 | 45 | git checkout main 46 | 47 | git fetch -p origin 48 | git for-each-ref --format 'delete %(refname)' refs/pull | git update-ref --stdin 49 | git push origin main --force 50 | 51 | if [ -f "requirements.yml" ];then 52 | sed -i 's/github/gitee/g' requirements.yml 53 | git add requirements.yml 54 | git commit -m "Make requirements.yml compatible with gitee" 55 | fi 56 | git push origin main --force -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.retry 2 | /.vscode 3 | hosts 4 | node_modules 5 | -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | This program is released under LGPL-3.0 and with the additional Terms: 2 | It is not allowed to publish free or paid image based on this program in any Cloud platform's Marketplace. 3 | 4 | GNU LESSER GENERAL PUBLIC LICENSE 5 | Version 3, 29 June 2007 6 | 7 | Copyright (C) 2007 Free Software Foundation, Inc. 8 | Everyone is permitted to copy and distribute verbatim copies 9 | of this license document, but changing it is not allowed. 10 | 11 | 12 | This version of the GNU Lesser General Public License incorporates 13 | the terms and conditions of version 3 of the GNU General Public 14 | License, supplemented by the additional permissions listed below. 15 | 16 | 0. Additional Definitions. 17 | 18 | As used herein, "this License" refers to version 3 of the GNU Lesser 19 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 20 | General Public License. 21 | 22 | "The Library" refers to a covered work governed by this License, 23 | other than an Application or a Combined Work as defined below. 24 | 25 | An "Application" is any work that makes use of an interface provided 26 | by the Library, but which is not otherwise based on the Library. 27 | Defining a subclass of a class defined by the Library is deemed a mode 28 | of using an interface provided by the Library. 29 | 30 | A "Combined Work" is a work produced by combining or linking an 31 | Application with the Library. The particular version of the Library 32 | with which the Combined Work was made is also called the "Linked 33 | Version". 34 | 35 | The "Minimal Corresponding Source" for a Combined Work means the 36 | Corresponding Source for the Combined Work, excluding any source code 37 | for portions of the Combined Work that, considered in isolation, are 38 | based on the Application, and not on the Linked Version. 39 | 40 | The "Corresponding Application Code" for a Combined Work means the 41 | object code and/or source code for the Application, including any data 42 | and utility programs needed for reproducing the Combined Work from the 43 | Application, but excluding the System Libraries of the Combined Work. 44 | 45 | 1. Exception to Section 3 of the GNU GPL. 46 | 47 | You may convey a covered work under sections 3 and 4 of this License 48 | without being bound by section 3 of the GNU GPL. 49 | 50 | 2. Conveying Modified Versions. 51 | 52 | If you modify a copy of the Library, and, in your modifications, a 53 | facility refers to a function or data to be supplied by an Application 54 | that uses the facility (other than as an argument passed when the 55 | facility is invoked), then you may convey a copy of the modified 56 | version: 57 | 58 | a) under this License, provided that you make a good faith effort to 59 | ensure that, in the event an Application does not supply the 60 | function or data, the facility still operates, and performs 61 | whatever part of its purpose remains meaningful, or 62 | 63 | b) under the GNU GPL, with none of the additional permissions of 64 | this License applicable to that copy. 65 | 66 | 3. Object Code Incorporating Material from Library Header Files. 67 | 68 | The object code form of an Application may incorporate material from 69 | a header file that is part of the Library. You may convey such object 70 | code under terms of your choice, provided that, if the incorporated 71 | material is not limited to numerical parameters, data structure 72 | layouts and accessors, or small macros, inline functions and templates 73 | (ten or fewer lines in length), you do both of the following: 74 | 75 | a) Give prominent notice with each copy of the object code that the 76 | Library is used in it and that the Library and its use are 77 | covered by this License. 78 | 79 | b) Accompany the object code with a copy of the GNU GPL and this license 80 | document. 81 | 82 | 4. Combined Works. 83 | 84 | You may convey a Combined Work under terms of your choice that, 85 | taken together, effectively do not restrict modification of the 86 | portions of the Library contained in the Combined Work and reverse 87 | engineering for debugging such modifications, if you also do each of 88 | the following: 89 | 90 | a) Give prominent notice with each copy of the Combined Work that 91 | the Library is used in it and that the Library and its use are 92 | covered by this License. 93 | 94 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 95 | document. 96 | 97 | c) For a Combined Work that displays copyright notices during 98 | execution, include the copyright notice for the Library among 99 | these notices, as well as a reference directing the user to the 100 | copies of the GNU GPL and this license document. 101 | 102 | d) Do one of the following: 103 | 104 | 0) Convey the Minimal Corresponding Source under the terms of this 105 | License, and the Corresponding Application Code in a form 106 | suitable for, and under terms that permit, the user to 107 | recombine or relink the Application with a modified version of 108 | the Linked Version to produce a modified Combined Work, in the 109 | manner specified by section 6 of the GNU GPL for conveying 110 | Corresponding Source. 111 | 112 | 1) Use a suitable shared library mechanism for linking with the 113 | Library. A suitable mechanism is one that (a) uses at run time 114 | a copy of the Library already present on the user's computer 115 | system, and (b) will operate properly with a modified version 116 | of the Library that is interface-compatible with the Linked 117 | Version. 118 | 119 | e) Provide Installation Information, but only if you would otherwise 120 | be required to provide such information under section 6 of the 121 | GNU GPL, and only to the extent that such information is 122 | necessary to install and execute a modified version of the 123 | Combined Work produced by recombining or relinking the 124 | Application with a modified version of the Linked Version. (If 125 | you use option 4d0, the Installation Information must accompany 126 | the Minimal Corresponding Source and Corresponding Application 127 | Code. If you use option 4d1, you must provide the Installation 128 | Information in the manner specified by section 6 of the GNU GPL 129 | for conveying Corresponding Source.) 130 | 131 | 5. Combined Libraries. 132 | 133 | You may place library facilities that are a work based on the 134 | Library side by side in a single library together with other library 135 | facilities that are not Applications and are not covered by this 136 | License, and convey such a combined library under terms of your 137 | choice, if you do both of the following: 138 | 139 | a) Accompany the combined library with a copy of the same work based 140 | on the Library, uncombined with any other library facilities, 141 | conveyed under the terms of this License. 142 | 143 | b) Give prominent notice with the combined library that part of it 144 | is a work based on the Library, and explaining where to find the 145 | accompanying uncombined form of the same work. 146 | 147 | 6. Revised Versions of the GNU Lesser General Public License. 148 | 149 | The Free Software Foundation may publish revised and/or new versions 150 | of the GNU Lesser General Public License from time to time. Such new 151 | versions will be similar in spirit to the present version, but may 152 | differ in detail to address new problems or concerns. 153 | 154 | Each version is given a distinguishing version number. If the 155 | Library as you received it specifies that a certain numbered version 156 | of the GNU Lesser General Public License "or any later version" 157 | applies to it, you have the option of following the terms and 158 | conditions either of that published version or of any later version 159 | published by the Free Software Foundation. If the Library as you 160 | received it does not specify a version number of the GNU Lesser 161 | General Public License, you may choose any version of the GNU Lesser 162 | General Public License ever published by the Free Software Foundation. 163 | 164 | If the Library as you received it specifies that a proxy can decide 165 | whether future versions of the GNU Lesser General Public License shall 166 | apply, that proxy's public statement of acceptance of any version is 167 | permanent authorization for you to choose that version for the 168 | Library. 169 | -------------------------------------------------------------------------------- /Note.md: -------------------------------------------------------------------------------- 1 | # erpnext extend 2 | --- 3 | [toc] 4 | ## logwatch 5 | 6 | 默认安装中没有,logwatch-系统日志分析器和报告器,**Logwatch**是可定制的,可插入的日志监视系统。它会在给定的时间段内遍历您的日志,并在您想要的区域中提供您想要的详细信息的报告。Logwatch用于Linux和许多类型的UNIX。 7 | 8 | ### 概要 9 | 10 | **logwatch [--detail** *level* **] [--logfile** *log-file-group* **] [--service** *service-name* **] [--print] [--mailto** *address* **] [--archives] [--range** *range* **] [--debug** *level* **] [--save** *file-name* **] [--logdir** *directory* **] [--hostname** *hostname* **] [--splithosts] [--multiemail] [--output** *output-type* **] [--numeric] [--no-oldfiles-log] [--version] [--help|--usage]** 11 | 12 | ### 选项 13 | 14 | **--detail** 级别 15 | 16 | 这是报告的详细级别。*level*可以是正整数,也可以是high,med,low,分别对应于整数10、5和0。 17 | 18 | **--format** 19 | 20 | 输出格式,有text,html选项可以选择。 21 | 22 | **--logfile**日志文件组 23 | 24 | 这将迫使Logwatch仅处理由*日志文件组*定义的*日志文件集*(即消息,xferlog等)。因此,Logwatch将处理使用这些日志文件的所有服务。可以多次指定此选项以指定多个日志文件组。 25 | 26 | **--service** 服务名称 27 | 28 | 这将迫使 Logwatch 仅处理服务*名称中*指定的*服务*(即登录名,pam,identd等)。因此,Logwatch也将处理处理这些服务所需的任何日志文件组。可以多次指定此选项,以指定要处理的多个服务。一个有用的 *服务名*是*All*,它将处理您为其安装了过滤器的所有服务(和日志文件组)。存在 All ,可以监控所有的服务。 29 | 30 | **--print** 31 | 32 | 将结果打印到标准输出(即屏幕)。 33 | 34 | **--mailto** 邮件地址 35 | 36 | 将结果邮寄到电子邮件地址或*地址中*指定的用户*。*此选项将覆盖--print选项。 37 | 38 | **--range** 范围 39 | 40 | 您可以指定要处理的日期范围。常见范围是“*Yesterday*”,“Today”,“All”和“Help”。*使用*Help*参数调用时,还会列出其他选项。 41 | 42 | ```ini 43 | Range = "1 hours ago for that hour" 44 | Range = "-7 days" 45 | Range = "between -7 days and -3 days" 46 | Range = "since March 15, 2017" 47 | Range = "first Friday in October" 48 | Range = "2017/04/15 12:50:15 for that second" 49 | Range = "Yesterday" 50 | ``` 51 | 52 | **--archives** 53 | 54 | 每个日志文件组都有基本的日志文件(即/ var / log / messages)和存档(即/ var / log / messages?或/var/log/messages.?.gz)。当与“ --range all”一起使用时,此选项将使Logwatch在常规日志文件之外还搜索归档文件。对于--range的其他值,Logwatch将搜索适当的存档日志。 55 | 56 | **--debug **级别 57 | 58 | 用于调试目的。*级别*范围可以从0到100。这*确实*会使您的输出混乱。您可能不想使用它。 59 | 60 | **--save** 文件名 61 | 62 | 将输出保存到*文件名,*而不是显示或通过邮件发送。 63 | 64 | **--logdir** 目录 65 | 66 | 在*目录中*查找日志子目录或日志文件,而不是默认目录。 67 | 68 | **--hostname **主机名 69 | 70 | 为报告使用*主机名*,而不是此系统的主机名。另外,如果在logwatch.conf配置文件中设置了HostLimit(请参阅 下面的**更多信息**),则仅处理来自该主机名的日志(在适当的情况下)。 71 | 72 | **--numeric** 73 | 74 | 禁止其他名称查找,以数字方式显示IP地址。 75 | 76 | **--no-oldfiles-log** 77 | 78 | 禁止显示logwatch日志,该日志通知logwatch tmpdir中的旧文件。 79 | 80 | **--help** 81 | 82 | ### 文件 83 | 84 | 显示使用情况信息。 85 | 86 | /usr/share/logwatch 87 | 88 | > 该目录包含Logwatch发行版随附的所有perl可执行文件和配置文件。 89 | 90 | /etc/logwatch 91 | 92 | > 此目录包含覆盖默认配置的本地配置文件。有关**更多信息**,请参见下面的更多信息。 93 | 94 | /etc/logwatch/conf/logwatch.conf 95 | 96 | Logwatch的配置文件为 /etc/logwatch/conf/logwatch.conf ,初始安装后,这个配置文件是空的。你可以将配置文件的模板拷贝过来,如果不做这一步,就会默认使用/usr/share/logwatch/default.conf/logwatch.conf 这个配置文件。 97 | 98 | `/etc/logwatch/conf/`会自动覆盖`/usr/share/logwatch/default.conf/`下的同名文件。 99 | 100 | ### 例子 101 | 102 | **logwatch --service ftpd-xferlog --range all --detail high --print --archives** 103 | 104 | > 这将打印出所有存储在所有当前xferlogs和已归档xferlogs中的FTP传输。 105 | 106 | **logwatch --service pam_pwdb --range yesterday --detail high ** 107 | 108 | > 这将打印出前一天的登录信息 109 | 110 | **logwatch --detail High --Service All --range All --print** 111 | 112 | > 基本就可以显示出所有日志的情况了 113 | 114 | **logwatch --service sshd --detail High** 115 | 116 | > 只看sshd的日志情况 117 | 118 | ### 使用 119 | 120 | ```shell 121 | # centos 122 | yum install logwatch -y 123 | # ubuntu 124 | apt-get install logwatch -y 125 | 126 | ``` 127 | 128 | 129 | 130 | ## fail2ban 131 | 132 | [配置](https://wiki.archlinux.org/index.php/fail2ban#Configuration)| [安装](https://wiki.archlinux.org/index.php/fail2ban#Installation) 133 | 134 | 默认安装中没有,***Fail2ban***扫描日志文件(例如`/var/log/apache/error_log`),并禁止显示恶意迹象的IP-过多的密码失败,寻找利用等。通常,Fail2Ban然后用于更新防火墙规则以拒绝IP地址在指定的时间内,也可以配置任何其他任意**操作**(例如,发送电子邮件)。Fail2Ban带有针对各种服务(apache,courier,ssh等)的**过滤器**。 135 | 136 | Fail2Ban能够减少不正确的身份验证尝试的发生率,但是它不能消除弱身份验证带来的风险。如果您确实想保护服务,则将服务配置为仅使用两种因素或公共/专用身份验证机制。 137 | 138 | 安装: 139 | 140 | ```shell 141 | #centos 142 | yum install fail2ban -y 143 | #ubuntu 144 | apt-get install fail2ban -y 145 | 146 | # 启动服务 147 | systemctl start fail2ban 148 | # 查看sshd状态 149 | fail2ban-client status sshd 150 | 151 | ``` 152 | 153 | 再/etc/fail2ban/jail.conf在发行版中可能会覆盖或改善文件,建议创建一个/etc/fail2ban/jail.conf文件。例如,将默认时间改为一天。 154 | 155 | ```shell 156 | /etc/fail2ban/jail.d/sshd.local 157 | [DEFAULT] 158 | bantime = 1d 159 | ``` 160 | 161 | ``` 162 | /etc/fail2ban/jail.local 163 | [sshd] 164 | enabled = true 165 | filter = sshd 166 | banaction = iptables 167 | backend = systemd 168 | maxretry = 5 169 | findtime = 1d 170 | bantime = 1d 171 | ignoreip = 127.0.0.1/8 172 | ``` 173 | 174 | 当前,Fail2ban必须以*root*身份运行。因此,可以考虑使用`systemd`强化该过程,添加 175 | 176 | ```shell 177 | /etc/systemd/system/fail2ban.service.d/override.conf 178 | [Service] 179 | PrivateDevices=yes 180 | PrivateTmp=yes 181 | ProtectHome=read-only 182 | ProtectSystem=strict 183 | ReadWritePaths=-/var/run/fail2ban 184 | ReadWritePaths=-/var/lib/fail2ban 185 | ReadWritePaths=-/var/log/fail2ban 186 | ReadWritePaths=-/var/spool/postfix/maildrop 187 | ReadWritePaths=-/run/xtables.lock 188 | CapabilityBoundingSet=CAP_AUDIT_READ CAP_DAC_READ_SEARCH CAP_NET_ADMIN CAP_NET_RAW 189 | ``` 190 | 191 | 默认情况下,Fail2ban使用iptables。但是,大多数防火墙和服务的配置都很简单。例如,使用nftables: 192 | 193 | ```ini 194 | /etc/fail2ban/jail.local 195 | [DEFAULT] 196 | banaction = nftables 197 | banaction_allports = nftables[type=allports] 198 | ``` 199 | 200 | ## NetworkManager 201 | 202 | 默认安装中有. 203 | 204 | 网络管理器(NetworManager)是检测网络、自动连接网络的程序。无论是无线还是有线连接,它都可以令您轻松管理。对于无线网络,网络管理器优先连接已知的网络并可以自动切换到最可靠的无线网络。利用网络管理器的程序可以自由切换在线和离线模式。网络管理器会相对无线网络优先选择有线网络,支持 VPN。网络管理器最初由 Redhat 公司开发,现在由GNOME管理。 205 | 206 | 安装包括了一个daemon、一个命令行界面`nmcli`和一个基于curses的界面`nmtui`,支持基本的DHCP功能。 207 | 208 | ### 使用 209 | 210 | ```shell 211 | systemctl start NetworkManager 212 | 213 | #禁用 NetworkManager 214 | #由于服务是通过 dbus 自动启动的, 所以要完全禁用可以用 systemctl 来屏蔽: 215 | systemctl mask NetworkManager 216 | systemctl mask NetworkManager-dispatcher 217 | ``` 218 | 219 | ### nmcli 使用示例 220 | 221 | 显示附近的 wifi: 222 | 223 | ``` 224 | $ nmcli device wifi list 225 | ``` 226 | 227 | 连接 wifi: 228 | 229 | ``` 230 | $ nmcli device wifi connect SSID password password 231 | ``` 232 | 233 | 连接到隐藏的 wifi: 234 | 235 | ``` 236 | $ nmcli device wifi connect SSID password password hidden yes 237 | ``` 238 | 239 | 通过 `wlan1` wifi 网卡(interface)连接 wifi: 240 | 241 | ``` 242 | $ nmcli device wifi connect SSID password password ifname wlan1 profile_name 243 | ``` 244 | 245 | 断开一个网卡(interface)上的连接: 246 | 247 | ``` 248 | $ nmcli device disconnect ifname eth0 249 | ``` 250 | 251 | 重新连接一个被标记为“已断开”的网卡: 252 | 253 | ``` 254 | $ nmcli connection up uuid UUID 255 | ``` 256 | 257 | 显示一个所有连接过的网络的UUID的列表: 258 | 259 | ``` 260 | $ nmcli connection show 261 | ``` 262 | 263 | 查看所有网络设备及其状态: 264 | 265 | ``` 266 | $ nmcli device 267 | ``` 268 | 269 | 关掉 wifi: 270 | 271 | ``` 272 | $ nmcli radio wifi off 273 | ``` 274 | 275 | ## ntp 276 | 277 | ntpd(Network Time Protocol daemon)是 Linux 操作系统的一个守护进程,用于校正本地系统与时钟源服务器之前的时间,完整的实现了 NTP 协议。`ntpd `与 `ntpdate` 的区别是 ntpd 是步进式的逐渐校正时间,不会出现时间跳变,而 ntpdate 是断点更新。NTP 服务端口 是UDP 123 端口。 278 | 279 | Linux 中有三个命令可用于验证 NTP 同步情况。详情如下。 280 | 281 | - `ntpq`:ntpq 是一个标准的 NTP 查询程序。 282 | - `ntpstat`:显示网络世界同步状态。 283 | - `timedatectl`:它控制 systemd 系统中的系统时间和日期。 284 | 285 | 可以通过以下命令查看ntp是否同步 286 | 287 | ```shell 288 | ntpq -p 289 | 或 290 | ntpstat 291 | 或 292 | timedatectl status 293 | ``` 294 | 295 | ntpdate同步时间命令: 296 | 297 | ```shell 298 | ntpdate -u 0.centos.pool.ntp.org iburst 299 | ``` 300 | 301 | crontab同步时间(每隔半小时): 302 | 303 | ```shell 304 | */30 * * * * ntpdate -u time.nist.gov 305 | ``` 306 | 307 | 使用ntp可以自建服务器来同步时间,修改/etc/ntp.conf配置文件添加同步时间服务器, 308 | 309 | ```ini 310 | server 0.centos.pool.ntp.org iburst 311 | 312 | server 1.centos.pool.ntp.org iburst 313 | 314 | server 2.centos.pool.ntp.org iburst 315 | 316 | server 3.centos.pool.ntp.org iburst 317 | 318 | server 4.centos.pool.ntp.org iburst 319 | ``` 320 | 321 | 执行重启命令`systemctl restart ntpd`生效 -------------------------------------------------------------------------------- /README-zh.md: -------------------------------------------------------------------------------- 1 | # ERPNext 自动化安装与部署 2 | 3 | 本项目是由 [Websoft9](http://www.websoft9.com) 研发的 [ERPNext](https://erpnext.com/) 自动化安装程序,开发语言是 Ansible。使用本项目,只需要用户在 Linux 上运行一条命令,即可自动化安装 ERPNext,让原本复杂的安装过程变得没有任何技术门槛。 4 | 5 | 本项目是开源项目,采用 LGPL3.0 开源协议。 6 | 7 | ## 配置要求 8 | 9 | 操作系统:目支持 Ubuntu16.x以上部署此脚本,确保是干净的操作系统 10 | 硬件配置:最低2核8G,40G系统盘空间,否则无法运行 11 | 12 | 更多配置要求,参考[官方文档](https://github.com/frappe/bench) 13 | 14 | ## 组件 15 | 16 | 包含的核心组件为:ERPNext, Nginx, Node.js 等 17 | 18 | 更多请见[参数表](/docs/zh/stack-components.md) 19 | 20 | ## 本项目安装的 ERPNext 最新版吗? 21 | 22 | 本项目采用官方提供的安装脚本进行安装,官方会在安装脚本中对 ERPNext 的版本进行控制,即每一次安装均可保证为 ERPNext 官方发布的最新稳定版。 23 | 24 | 我们会定期检查安装脚本 URL 地址的准确性,以保证用户可以顺利安装。 25 | 26 | ## 安装指南 27 | 28 | 登录 Linux,运行下面的**命令脚本**即可启动自动化部署,然后耐心等待,直至安装成功。 29 | 30 | ``` 31 | #非 root 用户登录后,需先提升成为 root 权限 32 | sudo su - 33 | 34 | #自动化安装命令 35 | wget -N https://raw.githubusercontent.com/Websoft9/ansible-linux/main/scripts/install.sh; bash install.sh -r erpnext 36 | ``` 37 | 38 | 注意: 39 | 40 | 1. 自动化脚本需服务器上已经安装 Python 2.7 或以上版本,一般操作系统会自带 Python,如果无法运行脚本,请先安装 Python 41 | 2. 由于自动化安装过程中有大量下载任务,若网络不通(或速度太慢)会引起下载失败,从而导致安装程序终止运行。此时,请重置服务器后再次尝试安装,若仍然无法完成,请使用我们在公有云上发布的 [ERPNext 镜像](https://apps.websoft9.com/erpnext) 的部署方式 42 | 43 | ## License 44 | 45 | [LGPL-3.0](/License.md), Additional Terms: It is not allowed to publish free or paid image based on this repository in any Cloud platform's Marketplace. 46 | Copyright (c) 2016-present, Websoft9 47 | 48 | ## 文档 49 | 50 | 文档链接:https://support.websoft9.com/docs/erpnext 51 | 52 | ## FAQ 53 | 54 | - 命令脚本部署与镜像部署有什么区别?请参考[镜像部署-vs-脚本部署](https://support.websoft9.com/docs/faq/zh/bz-product.html#镜像部署-vs-脚本部署) 55 | - 本项目支持在 Ansible Tower 上运行吗?支持 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ERPNext Cloud Installer 2 | 3 | ![](https://libs.websoft9.com/common/websott9-cloud-installer.png) 4 | 5 | ## Introduction 6 | 7 | [English](/README.md) | [简体中文](/README-zh.md) 8 | 9 | **ERPNext Cloud Installer**, developed by [Websoft9](https://www.websoft9.com), is an automatic installation program of [ERPNext](https://erpnext.com/) based on Ansible and shell. It helps user install ERPNext and pre-configure required items automatically and users only need to run a command on Linux. It simplifies the complicated installation and initialization process. 10 | 11 | ## System Requirement 12 | 13 | System Requirement to install this repository are as following: 14 | 15 | | Conditions | Details | Notes | 16 | | ------------------- | --------------------------------| -------------------- | 17 | | Operating System | CentOS7.x, Ubuntu18.04, Amazon Linux2 | Optional | 18 | | Public Cloud | AWS, Azure, Alibaba Cloud, HUAWEI ClOUD, Tencent Cloud | Optional | 19 | | Private Cloud | KVM, VMware, VirtualBox, OpenStack | Optional | 20 | | Server Configuration | vCPU no less than 2 core, Memory no less than 8 GIB, Storage no less than 40 GB, Bandwidth no less than 100M || 21 | 22 | To learn more information, please view [Installation & Configuration](https://github.com/frappe/bench). 23 | 24 | ## Ecosystem 25 | 26 | Core components of this repository: ERPNext, Nginx, Node.js, Python, MariaDB, phpMyAdmin on Docker 27 | 28 | Learn more about [Parameters](/docs/stack-components.md). 29 | 30 | ## Installation 31 | 32 | You can install it by thi Cloud Installer solution all in one. In addition, you can deploy image published on major Cloud Platform by Websoft9. 33 | 34 | #### All-in-one Installer 35 | 36 | Run the automatic installation script with **root** authority to start the installation. If necessary, users need to make interactive choices, and then wait patiently until the installation is successful. 37 | 38 | ``` 39 | $ sudo su - 40 | $ wget -N https://raw.githubusercontent.com/Websoft9/ansible-linux/main/scripts/install.sh; bash install.sh -r erpnext 41 | ``` 42 | 43 | If the network is broken or blocked, SSH will be interrupted and the installation will fail. Please reinstall. 44 | 45 | #### Image on Cloud 46 | 47 | Follow our [ERPNext image](https://apps.websoft9.com/erpnext) for installation on major Cloud Platform. 48 | 49 | ## Documentation 50 | 51 | To get information about initial installation, default username and password, HTTPS, SMTP, Backup, Upgrade and more, please view **ERPNext Administrator Guide** ([English](https://support.websoft9.com/docs/erpnext) | [简体中文](https://support.websoft9.com/docs/erpnext/zh)) 52 | 53 | ## Changelog 54 | 55 | Detailed changes are documented in the [CHANGELOG](/CHANGELOG.md). 56 | 57 | ## License 58 | 59 | [LGPL-3.0](/License.md), Additional Terms: It is not allowed to publish free or paid image based on this repository in any Cloud platform's Marketplace. 60 | 61 | Copyright (c) 2016-present, Websoft9 62 | 63 | This program provided by Websoft9 contains a series of software with separate copyright notices and license terms. Your use of the source code for the software included is subject to the terms and conditions of its own license. 64 | 65 | ## FAQ 66 | 67 | #### Can I run this repository on Ansible Tower? 68 | 69 | Yes. 70 | 71 | #### How to install and view the latest release? 72 | 73 | This repository use [Bench](https://github.com/frappe/bench) to install ERPNex that can make sure to install the latest version. You can get the latest version from [ERPNext Release page](https://github.com/frappe/erpnext/releases) 74 | 75 | #### Is the default password safe? 76 | 77 | ERPNext Cloud Installer use the random password solution, every installation have different password, that mean your password is different from other users 78 | -------------------------------------------------------------------------------- /ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | roles_path = ./roles/ 3 | display_skipped_hosts = False 4 | host_key_checking = False 5 | interpreter_python=auto 6 | timeout = 60 7 | forks = 10 -------------------------------------------------------------------------------- /docs/.vuepress/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 3 | //针对不同项目,需要修改的参数有:base,title,description,repo以及nav,sidebar 文件夹下的导航js文件 4 | 5 | base: '/docs/erpnext/', 6 | dest: 'html/erpnext', 7 | 8 | head: [ 9 | ['link', { rel: 'icon', href: '/favicon.ico' }] 10 | ], 11 | 12 | //vuepress多语言,区别于主题多语言 13 | locales: { 14 | '/': { 15 | lang: 'en-US', // 将会被设置为 的 lang 属性 16 | title: 'ERPNext Administrator Guide', 17 | description: 'You can get the Installation of Image,Administrator,Configuration of the ERPNext from this documentation.' 18 | }, 19 | '/zh/': { 20 | lang: 'zh-CN', 21 | title: 'ERPNext 管理员手册', 22 | description: '本文档由 Websoft9 公司提供,用于指导用户学习 ERPNext 的安装部署与基本运维技术,包括:部署、初始化安装、环境配置、HTTPS、SMTP、备份升级和连接云服务器操作等基本操作。' 23 | } 24 | }, 25 | 26 | themeConfig: { 27 | 28 | //Basic configuration 29 | displayAllHeaders: false, // 默认值:false 30 | activeHeaderLinks: true, // 默认值:true 31 | displayAllHeaders: false, // 默认值:false 32 | sidebar: 'auto', // 默认值:false 33 | 34 | //Github 35 | repo: 'Websoft9/ansible-erpnext', 36 | editLinks: true, 37 | docsDir: 'docs', 38 | docsBranch: 'main', 39 | 40 | //主题多语言 41 | locales: { 42 | '/': { 43 | label: 'English', 44 | selectText: 'Languages', 45 | editLinkText: 'Edit this page on GitHub', 46 | lastUpdated: 'Last Updated', 47 | serviceWorker: { 48 | updatePopup: { 49 | message: "New content is available.", 50 | buttonText: "Refresh" 51 | } 52 | }, 53 | 54 | //top-menu 55 | nav: require('./nav/en'), 56 | //left-menu 57 | sidebar:require('./sidebar/en'), 58 | }, 59 | 60 | '/zh/': { 61 | label: '中文', 62 | selectText: '语言', 63 | editLinkText: '在Github上编辑', 64 | lastUpdated: 'Last Updated', 65 | serviceWorker: { 66 | updatePopup: { 67 | message: "此文档有可用的更新", 68 | buttonText: "刷新" 69 | } 70 | }, 71 | 72 | //页眉 73 | nav: require('./nav/zh'), 74 | //侧边栏导航 75 | sidebar: require('./sidebar/zh'), 76 | 77 | }, 78 | 79 | }, 80 | } 81 | } -------------------------------------------------------------------------------- /docs/.vuepress/nav/en.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { text: 'Home', link: '/' }, 3 | { text: 'Support', link: 'https://support.websoft9.com' }, 4 | ] -------------------------------------------------------------------------------- /docs/.vuepress/nav/zh.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { text: '首页', link: '/zh/' }, 3 | { text: '支持', link: 'https://support.websoft9.com/' }, 4 | ] -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Websoft9Archive/ansible-erpnext/71fd614211b211eb4a42e36efe4f0eead4be797b/docs/.vuepress/public/favicon.ico -------------------------------------------------------------------------------- /docs/.vuepress/sidebar/en.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | title: 'Getting Started', 4 | collapsable: false, 5 | children: [ 6 | '/', 7 | '/stack-deployment', 8 | '/stack-installation', 9 | '/stack-components', 10 | '/stack-accounts', 11 | ['https://support.websoft9.com/docs/faq/tech-instance.html','Cloud Server'], 12 | ] 13 | }, 14 | { 15 | title: 'Best Practices', 16 | collapsable: false, 17 | children: [ 18 | '/solution-smtp', 19 | '/solution-https', 20 | '/solution-backup', 21 | '/solution-upgrade', 22 | '/solution-more', 23 | ] 24 | }, 25 | 26 | { 27 | title: 'Administrator', 28 | collapsable: false, 29 | children: [ 30 | '/admin-services', 31 | '/admin-mysql', 32 | ['https://support.websoft9.com/docs/linux/webs-nginx.html','Nginx'], 33 | ['https://support.websoft9.com/docs/linux/admin-practices.html','Linux'], 34 | ] 35 | }, 36 | 37 | { 38 | title: 'Other', 39 | collapsable: false, 40 | children: [ 41 | '/else-faq', 42 | '/else-troubleshooting', 43 | ] 44 | }, 45 | 46 | ] 47 | -------------------------------------------------------------------------------- /docs/.vuepress/sidebar/zh.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | title: '开始', 4 | collapsable: false, 5 | children: [ 6 | '/zh/', 7 | '/zh/stack-deployment', 8 | '/zh/stack-installation', 9 | '/zh/stack-components', 10 | '/zh/stack-accounts', 11 | ['https://support.websoft9.com/docs/faq/zh/tech-instance.html','云服务器'], 12 | ] 13 | }, 14 | 15 | { 16 | title: '实践指南', 17 | collapsable: false, 18 | children: [ 19 | '/zh/solution-smtp', 20 | '/zh/solution-https', 21 | '/zh/solution-backup', 22 | '/zh/solution-upgrade', 23 | '/zh/solution-more', 24 | ] 25 | }, 26 | 27 | { 28 | title: '配置参考', 29 | collapsable: false, 30 | children: [ 31 | '/zh/admin-services', 32 | '/zh/admin-mysql', 33 | ['https://support.websoft9.com/docs/linux/zh/webs-nginx.html','Nginx'], 34 | ['https://support.websoft9.com/docs/linux/zh/admin-practices.html','Linux'], 35 | ] 36 | }, 37 | 38 | { 39 | title: '其他', 40 | collapsable: false, 41 | children: [ 42 | '/zh/else-faq', 43 | '/zh/else-troubleshooting', 44 | ] 45 | }, 46 | 47 | ] -------------------------------------------------------------------------------- /docs/.vuepress/styles/index.styl: -------------------------------------------------------------------------------- 1 | // placeholder for test, dont't remove it. 2 | 3 | //.content { 4 | // font-size 30px; 5 | //} 6 | 7 | pre.vue-container 8 | border-left-width: .5rem; 9 | border-left-style: solid; 10 | border-color: #42b983; 11 | border-radius: 0px; 12 | & > code 13 | font-size: 14px !important; 14 | & > p 15 | margin: -5px 0 -20px 0; 16 | code 17 | background-color: #42b983 !important; 18 | padding: 3px 5px; 19 | border-radius: 3px; 20 | color #000 21 | em 22 | color #808080 23 | font-weight light 24 | 25 | -------------------------------------------------------------------------------- /docs/.vuepress/styles/override.styl: -------------------------------------------------------------------------------- 1 | $textColor = red 2 | $accentColor = #3eaf7c 3 | $textColor = #2c3e50 4 | $borderColor = #eaecef 5 | $codeBgColor = #282c34 -------------------------------------------------------------------------------- /docs/.vuepress/styles/palette.styl: -------------------------------------------------------------------------------- 1 | // placeholder for test, dont't remove it. 2 | 3 | //$accentColor = #f00 4 | -------------------------------------------------------------------------------- /docs/.vuepress/styles/style.styl: -------------------------------------------------------------------------------- 1 | #my-style {} -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: false 3 | --- 4 | 5 | # Overview 6 | 7 | This documentation is provided by [Websoft9](https://www.websoft9.com/), it can help users to acquire skills of ERPNext Deployment, Installation, Configuration, HTTPS, SMTP, Backup, Upgrade, Connect Instance and more. 8 | 9 | [ERPNext](https://erpnext.com/) is 100% open source ERP,based on Python and node development, it has comprehensive functions, including accounting, human resources, manufacturing, website, e-commerce, CRM, asset management, customer service workbench and other comprehensive functions. It is very suitable as a substitute for SAP, which has been used by more than 5000 enterprise customers all over the world. 10 | ![](http://libs.websoft9.com/Websoft9/DocsPicture/en/erpnext/erpnext-adminui-websoft9.png) 11 | 12 | --- 13 | 14 | ## Improve 15 | 16 | This document will continue to improve and broadly absorb the needs of users. If you have good idea, please don't hesitate to give us feedback by "Edit this page on GitHub", and welcome you to fork this documentation on [Github](https://github.com/Websoft9/ansible-erpnext) 17 | 18 | ## Scope 19 | 20 | The image library provided by Websoft9 has released on the top Cloud Platform and provides Chinese and English documents, which can be easily used by cloud users worldwide. -------------------------------------------------------------------------------- /docs/admin-mysql.md: -------------------------------------------------------------------------------- 1 | # MariaDB 2 | 3 | ERPNext deployment package includes MariaDB and Web-GUI tool phpMyAdmin for MariaDB management. 4 | 5 | Follow the steps below to use it: 6 | 7 | 1. Login Cloud Console, make sure the **TCP:9090** port is allowed on **[Inbound of Security Group Rule](https://support.websoft9.com/docs/faq/tech-instance.html)**. 8 | 9 | 2. Use the Chrome or FireFox to access URL *http://Server's Internet IP:9090*. 10 | ![log in phpMyadmin](https://libs.websoft9.com/Websoft9/DocsPicture/en/mysql/mysql-login-websoft9.png) 11 | 12 | 3. Enter username and password of MariaDB. ([Don't know password?](/stack-accounts.md)) 13 | 14 | 4. Start to manage MariaDB now. 15 | ![phpMyadmin](https://libs.websoft9.com/Websoft9/DocsPicture/en/phpmyadmin/phpmyadmin-createdb-websoft9.png) 16 | 17 | > View *[MariaDB guide](https://support.websoft9.com/docs/mysql/)* provided by Websoft9 to learn more skills of MariaDB, including: how to change password, create user, import/export data, open or close remote access, configure log and so on. 18 | -------------------------------------------------------------------------------- /docs/admin-services.md: -------------------------------------------------------------------------------- 1 | # Start or Stop the Services 2 | 3 | These commands you must know when you using the ERPNext of Websoft9 4 | 5 | ### ERPNext 6 | 7 | ```shell 8 | sudo docker start erpnext-worker 9 | sudo docker stop erpnext-worker 10 | sudo docker restart erpnext-worker 11 | sudo docker status erpnext-worker 12 | 13 | ``` 14 | 15 | ```shell 16 | sudo docker start erpnext-worker-short 17 | sudo docker stop erpnext-worker-short 18 | sudo docker restart erpnext-worker-short 19 | sudo docker status erpnext-worker-short 20 | 21 | ``` 22 | 23 | ```shell 24 | sudo docker start erpnext-worker-long 25 | sudo docker stop erpnext-worker-long 26 | sudo docker restart erpnext-worker-long 27 | sudo docker status erpnext-worker-long 28 | 29 | ``` 30 | 31 | ```shell 32 | sudo docker start erpnext-nginx 33 | sudo docker stop erpnext-nginx 34 | sudo docker restart erpnext-nginx 35 | sudo docker status erpnext-nginx 36 | 37 | ``` 38 | 39 | ### Nginx 40 | 41 | ```shell 42 | sudo systemctl start nginx 43 | sudo systemctl stop nginx 44 | sudo systemctl restart nginx 45 | sudo systemctl status nginx 46 | ``` 47 | 48 | ### MariaDB 49 | 50 | ```shell 51 | sudo docker start erpnext-mariadb 52 | sudo docker stop erpnext-mariadb 53 | sudo docker restart erpnext-mariadb 54 | sudo docker status erpnext-mariadb 55 | 56 | ``` 57 | 58 | ### Redis 59 | 60 | ```shell 61 | sudo docker start erpnext-redis-queue 62 | sudo docker stop erpnext-redis-queue 63 | sudo docker restart erpnext-redis-queue 64 | sudo docker status erpnext-redis-queue 65 | 66 | ``` 67 | 68 | ```shell 69 | sudo docker start erpnext-redis-cache 70 | sudo docker stop erpnext-redis-cache 71 | sudo docker restart erpnext-redis-cache 72 | sudo docker status erpnext-redis-cache 73 | 74 | ``` 75 | 76 | ```shell 77 | sudo docker start erpnext-redis-schedule 78 | sudo docker stop erpnext-redis-schedule 79 | sudo docker restart erpnext-redis-schedule 80 | sudo docker status erpnext-redis-schedule 81 | 82 | ``` -------------------------------------------------------------------------------- /docs/else-faq.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | 3 | #### Which install solution for this ERPNext? 4 | 5 | Use Docker installation, you can access our [Docker-Compose for ERPNext](https://github.com/Websoft9/docker-erpnext) open source project on Github 6 | 7 | #### Can I install ERPNext by **Manual installation**? 8 | 9 | Yes, the general installation process of ERPNext is as follows: 10 | 11 | 1. Use the **bench** command to initialize a Frappe framework 12 | 2. Install ERPNext app 13 | 3. Create a site with the same name as ERPNext 14 | 4. Connect the site with the app 15 | 16 | #### What are the relationship and difference between Frappe, bench and ERPNext? 17 | 18 | [ERPNext](https://github.com/frappe/erpnext) is based on Frappe for free ERP framework development. 19 | [Frappe](https://github.com/frappe/frappe) is a framework for rapid development of JS and Python integrated applications. 20 | [Bench](https://github.com/frappe/bench) is a CLI tool of Frappe framework, which used to create and manage Frappe by commands. 21 | 22 | #### Why should create *site* for ERPNext installation? 23 | 24 | Frappe framework is mainly composed of two parts: app and site. App is the back-end Python code, and site is the front-end part for handling HTTP requests. 25 | 26 | #### Does ERPNext support external databases? 27 | 28 | Yes. Just need to modify the [database configuration file](/zh/stack-components.md#erpnext) and add db_host items in it. 29 | For more database connection parameters, please refer to the official document [Standard Config](https://frappeframework.com/docs/user/en/basics/site_config#mandatory-settings) 30 | 31 | #### What databases does ERPNext support? 32 | 33 | MariaDB and PostgreSQL 34 | 35 | #### What is the password for the database root user? 36 | 37 | The password is stored in the server related file: `/credentials/password.txt` 38 | 39 | #### Is there a web-base GUI database management tools? 40 | 41 | Yes, phpMyAdmin is on it, visit by *http://Server's Internet IP:9090* 42 | 43 | #### Is it possible to modify the source path of ERPNext? 44 | 45 | Not recommended 46 | 47 | #### Is there API documentation for ERPNext? 48 | 49 | Yes, including python, JavaScript, Jinja API, refer to the official document [ERPNext API](https://frappeframework.com/docs/user/en/api) 50 | 51 | #### How to change the permissions of filesytem? 52 | 53 | Change owner(group) or permissions like below: 54 | 55 | ```shell 56 | chown -R apache.apache /data/wwwroot/erpnext 57 | find /data/wwwroot/erpnext -type d -exec chmod 750 {} \; 58 | find /data/wwwroot/erpnext -type f -exec chmod 640 {} \; 59 | ``` 60 | 61 | #### What's the difference between Deployment and Installation? 62 | 63 | - Deployment is a process of installing and configuring a sequence of software in sequence in a different order, which is a complex system engineering. 64 | - Installation is the process of starting the initial wizard after the application is prepared. 65 | - Installation is simpler than deployment. 66 | 67 | #### What's Cloud Platform? 68 | 69 | Cloud platform refers to platform manufacturers that provide cloud computing services, such as: **Azure, AWS, Alibaba Cloud, HUAWEI CLOUD, Tencent Cloud**, etc. 70 | 71 | 72 | #### What is the difference between Instance, Cloud Server, Virtual Machine, ECS, EC2, CVM, and VM? 73 | 74 | No difference, just the terminology used by different manufacturers, actually cloud servers -------------------------------------------------------------------------------- /docs/else-troubleshooting.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting 2 | 3 | We collect the most common troubleshooting of using ERPNext for your reference: 4 | 5 | > Most of the failures are closely related to the cloud platform. If you can confirm that the fault is caused by the cloud platform, please refer to [online document](https://support.websoft9.com/docs/faq/zh/tech-instance.html) 6 | 7 | #### How can I use the logs? 8 | 9 | Get an error for ERPNext, there are several entries that can be used to analyze the log: 10 | 11 | 1. ERPNext program running log */data/logs/erpnext* 12 | 2. Run `docker status erpnext-work-default` to view the process management log 13 | 3. Nginx log */data/logs/nginx* 14 | 15 | Search the keywords failed or error to view the error 16 | 17 | #### The ERPNext service failed to start? 18 | 19 | 1. Run `docker status erpnext-work-default` to view the startup status and errors 20 | 2. Open the log file */data/logs/erpnext*, retrieve the failed keyword, and analyze the cause of the error 21 | 22 | #### ERPNext service can't start? 23 | 24 | 1. Execute `docker status erpnext-work-default` and you can see the errors 25 | 2. Search the keywords **Failed** or **error** from logs: */data/logs/erpnext* 26 | 27 | #### Error in Chrome when modify password? 28 | 29 | This error is not attribute to ERPNext server, once you have upgraded you local Chrome, it solved 30 | 31 | #### Why I get the message "You should not run this command as root" when run bench? 32 | 33 | The bench commands only can run for the user name frapper, you must change the user first 34 | ```shell 35 | su - frapper 36 | ``` 37 | 38 | #### Error prompt in the last step of the ERPNext installation wizard? 39 | 40 | ![](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-wizarderror-websoft9.png) 41 | Cause: unknown 42 | Solution: repeat the installation several times until successful -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@vuepress/shared-utils": "^1.0.2" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/solution-backup.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # Backup & Restore 6 | 7 | ## Why 8 | 9 | Users with experience in Cloud Server operation and maintenance understand the truth: "IT systems can't maintain 100% stability for a long time. Any system may fail, but the probability of failure is different and the degree of harm is different." 10 | 11 | When system failure, we first seek the help of a professional to quickly repair and recovery it, but unfortunately, some failure cannot be solved smoothly or even in the expected time period. 12 | 13 | Obviously, there is a backup is so important, it can guarantee that the system can be restored to the normal state through the existing backup file when the failure occurs, which means that the huge loss due to the unrecoverable can be avoided. 14 | 15 | > Must develop the habit of backup, there is no luck 16 | 17 | ## How 18 | 19 | From the specific backup object, due to the existence of four backup objects on the server: **operating system, environment software, database and application**, each object may have unpredictable failures that cannot be solved as expected. 20 | 21 | Based on the backup object, we believe that the following two backup measures are necessary: 22 | 23 | ### Automation Backup for Instance 24 | 25 | Automation Backups for Instance is using the **Snapshot** or **Cloud Server Backup Service** on your Cloud Platform, A snapshot is a full, read-only copy of a disk. You can take a snapshot of an OS or data disk to use as a backup, or to troubleshoot instance issues. 26 | 27 | ``` 28 | - Backup scope: All data on a Disk 29 | - Backup effect: Very Good 30 | - Backup frequency: Automatic backup per hour if you need 31 | - Recovery methond: One key recovery on Cloud platform 32 | - Skill requirement: Very easy 33 | - Automation or Manual: Fully automated on backup strategy 34 | ``` 35 | 36 | Different Cloud Platform's snapshot settings slightly different, refer to [Cloud platform backup solution](https://support.websoft9.com/docs/faq/tech-instance.html) 37 | 38 | ### Manual backup for application 39 | 40 | Manual backup for application is based on the **Exporting source code and database of application** to achieve a minimized backup scheme. 41 | 42 | ``` 43 | - Backup scope: Source code and database of application 44 | - Backup effect: Good 45 | - Backup frequency: You can operate when you need 46 | - Recovery methond: Import 47 | - Skill requirement: Easy 48 | - Automation: manual 49 | ``` 50 | The general manual backup operation steps are as follows: 51 | 52 | 1. Just compression and download the entire */data/wwwroot/frappe-bench* directory by SFTP 53 | 2. Export ERPNext database by **mysqldump** 54 | ``` 55 | mysqldump -uroot -p erpnext>erpnext.sql 56 | ``` 57 | > There are more than 1000 tables and too many fields in some tables of ERPNext database. If you export the database with phpMyAdmin, you may lose data 58 | 3. Put the source code file and database file in the same folder, named according to the date 59 | 4. Backup completed 60 | 61 | 62 | ### ERPNext 备份 63 | 64 | ERPNext 提供了自动备份(计划任务)和[手动输入命令](https://frappeframework.com/docs/user/en/bench/reference/backup)的两种备份方式。 65 | 66 | 67 | 1. 登录 ERPNext 后,依次打开:【Settings】>【System Settings】 68 | ![ERPNext backup](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-autobk-websoft9.png) 69 | 70 | 2. 进入 ERPNext 主容器 71 | ``` 72 | docker exec -it erpnext-worker-default bash 73 | ``` 74 | 3. 在容器中运行备份命令 75 | ``` 76 | # 查询项目文件夹名称(IP 或 域名) 77 | ls 78 | 79 | # 备份 80 | bench --site 121.41.86.118 backup 81 | ``` 82 | 83 | 4. 在宿主机的 Docker VOLUME 中获取备份文件。备份位置:*/var/lib/docker/volumes/docker-erpnext_sites-vol/_data/IP/private/backups* 84 | 85 | > 后台 Download Backups 处下载失败,原因有待研究。故,直接从上面的路径下载即可 -------------------------------------------------------------------------------- /docs/solution-https.md: -------------------------------------------------------------------------------- 1 | # SSL/HTTPS 2 | 3 | Before setting, you have to complete [binding domain](/solution-more.md) and make sure you can access ERPNext by HTTP. 4 | 5 | ERPNext deployment package has installed the SSL module of Nginx and open Certificate Authority **[Let's Encrypt](https://letsencrypt.org/)** for you to configure the HTTPS quickly and conveniently. 6 | 7 | > Except for the [vhost configuration file](/stack-components.md#nginx), it doesn't need modify any Nginx configuration file for HTTPS. 8 | 9 | ## Quick start 10 | 11 | ### Automatic deployment 12 | 13 | If you want to use a free certificate, just run the one command `sudo certbot` on your instance to start the HTTPS deployment. 14 | 15 | ``` 16 | sudo certbot 17 | ``` 18 | 19 | ### Manual deployment 20 | 21 | If you have applied for a commercial certificate, complete the HTTPS configuration in just three steps: 22 | 23 | 1. Upload your certificate, file of the certificate chain and secret key to the directory: */data/cert*. 24 | 25 | 2. Open the vhost configuration file: */etc/nginx/conf.d/default.conf*. 26 | 27 | 3. Insert the **HTTPS template** into *server{ }* and modify your certificate path. 28 | ``` text 29 | #-----HTTPS template start------------ 30 | listen 443 ssl; 31 | ssl_certificate /data/cert/xxx.crt; 32 | ssl_certificate_key /data/cert/xxx.key; 33 | ssl_trusted_certificate /data/cert/chain.pem; 34 | ssl_session_timeout 5m; 35 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 36 | ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; 37 | ssl_prefer_server_ciphers on; 38 | #-----HTTPS template end------------ 39 | ``` 40 | 4. save file and [restart Nginx service](/admin-services.md). 41 | 42 | ## Special Guide 43 | 44 | If failed to set HTTPS by taking the above steps, please view the [HTTPS Special Guide](https://support.websoft9.com/docs/faq/tech-https.html#nginx) provided by Websoft9, which includes solutions about configuring HTTPS pre-conditions, HTTPS configuration segment templates, precautions, detailed steps, troubleshooting and more. -------------------------------------------------------------------------------- /docs/solution-more.md: -------------------------------------------------------------------------------- 1 | # More 2 | 3 | Each of the following solutions has been proven to be effective and we hope to be helpful to you. 4 | 5 | 6 | ## Domain binding 7 | 8 | The precondition for binding a domain is that ERPNext can accessed by domain name. 9 | 10 | Nonetheless, from the perspective of server security and subsequent maintenance considerations, the **Domain Binding** step cannot be omitted. 11 | 12 | ERPNext domain name binding steps: 13 | 14 | 1. Connect your Cloud Server 15 | 2. Modify [Nginx vhost configuration file](/stack-components.md#nginx), change the **server_name**'s value to your domain name 16 | ```text 17 | server 18 | { 19 | listen 80; 20 | server_name name; # your domain 21 | root /data/wwwroot/frappe-bench/sites; 22 | ... 23 | } 24 | ``` 25 | 3. Save the configuration file and restart the [Nginx service](https://support.websoft9.com/docs/erpnext/zh/admin-services.html#nginx) 26 | 4. Modify the environment variables and set the domain name: 27 | Enter the ERPNext directory /data/wwwroot/erpnext , modify the .env file 28 | Find the APP_SITE_URL=erp.example.com configuration item and modify it to your domain name 29 | 5. Restart ERPNext : docker-compose up -d 30 | 31 | ## Reset password 32 | 33 | There are two main measures to reset password. 34 | 35 | ### Change password 36 | 37 | 1. Log in to the background of ERPNext and open Settings > personal settings to find the password modification item 38 | ![ERPNext change password](https://libs.websoft9.com/Websoft9/DocsPicture/en/erpnext/erpnext-modifypw-websoft9.png) 39 | 2. Set the new password directly and take effect after saving 40 | 41 | ### Forgot Password 42 | 43 | Try to retrieve your password by the following commands when forgot it. 44 | 45 | ```` 46 | sudo -H -u erpnext bash -c "cd /data/wwwroot/frappe-bench && export GIT_PYTHON_REFRESH=quiet && /usr/local/bin/bench set-admin-password newpassword" 47 | ```` 48 | 49 | ## Using RDS 50 | 51 | If the user does not like to use the MariaDB installed on the server and wants to migrate to the cloud database (RDS), the general process is as follows: 52 | 53 | 1. Back up the existing database and import it into RDS (suitable for ERPNext has been installed) 54 | 55 | 2. Modify the Database connection information at [ERPNext docker configuration file](/stack-components.md#erpnext) 56 | ``` 57 | # /data/wwwroot/erpnext/.env 58 | DB_MRAIADB_USER=root 59 | DB_MARIADB_PASSWORD=123456 60 | DB_MARIADB_HOST=mariadb 61 | DB_MARIADB_PORT=3306 62 | DB_MARIADB_VERSION=10.6 63 | ``` 64 | 65 | > DB_MARIADB_HOST is the RDS host of your db 66 | 67 | 3. Recreate your container again 68 | ``` 69 | cd /data/wwwroot/erpnext 70 | docker-compose up -d 71 | ``` 72 | 73 | 4. Test you modification 74 | 75 | > For more database connection parameters, please refer to the official document [standard config](https://frappeframework.com/docs/user/en/basics/site_config#mandatory-settings) 76 | -------------------------------------------------------------------------------- /docs/solution-smtp.md: -------------------------------------------------------------------------------- 1 | # SMTP 2 | 3 | Sending mail is a common feature for ERPNext. After a large number of user practice feedback, only one way is recommended, that is, using the **third-party STMP service** to send the email. 4 | 5 | > Do not try to install **Sendmail** or other Mail server software on your Cloud Server for sending mail, because it has great difficulty in maintenance. 6 | 7 | Follow is the sample using **SendGrid's SMTP Service** to configure sending mail for ERPNext: 8 | 9 | 1. Log in SendGrid console, prepare your SMTP settings like the follow sample 10 | ``` 11 | SMTP host: smtp.qq.com 12 | SMTP port: 465 or 587 for SSL-encrypted email 13 | SMTP Authentication: must be checked 14 | SMTP Encryption: must SSL 15 | SMTP username: websoft9smpt 16 | SMTP password: #fdfwwBJ8f 17 | ``` 18 | 2. Log in ERPNext Console,set SMTP parameters in【Settings】>【Email Domain】 19 | ![ERPNext SMTP](https://libs.websoft9.com/Websoft9/DocsPicture/en/erpnext/erpnext-smtp-websoft9.png) 20 | 21 | 3. After clicking **save**, it will verify SMTP and only the correct items can be saved successfully 22 | 23 | More SMTP Service(Gmail, Hotmail, QQ mail, Yahoo mail, SendGrid and so on) settings or Issues with SMTP, please refer to Websoft9's *[SMTP Guide](https://support.websoft9.com/docs/faq/tech-smtp.html)* -------------------------------------------------------------------------------- /docs/solution-upgrade.md: -------------------------------------------------------------------------------- 1 | # Update & Upgrade 2 | 3 | Updates and upgrades are one of the maintenance tasks for sytem. Programs that are not upgraded for a long time, like buildings that are not maintained for a long time, will accelerate aging and gradually lose functionality until they are unavailable. 4 | 5 | You should know the differences between the terms **Update** and **Upgrade**([Extended reading](https://support.websoft9.com/docs/faq/tech-upgrade.html#update-vs-upgrade)) 6 | - Operating system patching is **Update**, Ubuntu16.04 to Ubuntu18.04 is **Upgrade** 7 | - MySQL5.6.25 to MySQL5.6.30 is **Update**, MySQL5.6 to MySQL5.7 is **Upgrade** 8 | 9 | For ERPNext maintenance, focus on the following two Update & Upgrade jobs 10 | 11 | - Sytem update(Operating System and Running Environment) 12 | - ERPNext upgrade 13 | 14 | ## System Update 15 | 16 | Run an update command to complete the system update: 17 | 18 | ``` shell 19 | #For Ubuntu&Debian 20 | apt update && apt upgrade -y 21 | 22 | #For Centos&Redhat 23 | yum update -y 24 | 25 | ``` 26 | > This deployment package is preconfigured with a scheduled task for automatic updates. If you want to remove the automatic update, please delete the corresponding Cron 27 | 28 | ## ERPNext Update 29 | 30 | This deployment solution is based on Docker and so you can upgrade ERPNext by the standard process of Docker: 31 | 32 | > You should complete an image or snapshot backup for instance before upgrade 33 | 34 | 1. Use **SFTP** to login Server, modify **APP_VERSION** in the **.env** file of ERPNext directory 35 | 36 | 2. Go to the code-server root directory, then pull new images 37 | ``` 38 | cd /data/wwwroot/erpnext 39 | docker-compose pull 40 | ``` 41 | 3. Delete old container and recreate new container 42 | ``` 43 | docker-compose down -v 44 | docker-compose up -d 45 | ``` -------------------------------------------------------------------------------- /docs/stack-accounts.md: -------------------------------------------------------------------------------- 1 | # Username and Password 2 | 3 | Use the **SSH** to connect your Server and run the command `sudo cat /credentials/password.txt` to get the username and password of this deployment solution. 4 | 5 | ![](https://libs.websoft9.com/Websoft9/DocsPicture/zh/common/catdbpassword-websoft9.png) 6 | 7 | These accounts are required for ERPNext image installation and configuration 8 | 9 | ## ERPNext 10 | 11 | * ERPNext administrator username: `Administrator` 12 | * ERPNext administrator password: stored in the file of your server */credentials/password.txt* 13 | 14 | ## MariaDB 15 | 16 | * MariaDB administrator username: `root` 17 | * MariaDB administrator password: stored in the file of your server */credentials/password.txt* 18 | 19 | ## Linux 20 | 21 | * Host Name: Internet IP or Public IP of your Instance 22 | * Connect by: Online SSH on Cloud Console or SFTP/SSH tools on your local computer 23 | * Password: It was set by yourself when created instance 24 | * Username: Different Cloud Platform has differences 25 | | Cloud Platform | Administrator Username | Other | 26 | | --- | --- | --- | 27 | | Azure | It was set by yourself when created instance | [How to enable root access?](https://support.websoft9.com/docs/azure/server-login.html#sample2-enable-the-root-username) | 28 | | AWS CentOS | centos | [How to enable root access?](https://support.websoft9.com/docs/aws/server-login.html#sample2-enable-the-root-username) | 29 | | AWS AmaonLinux | ec2-user | [How to enable root access?](https://support.websoft9.com/docs/aws/server-login.html#sample2-enable-the-root-username) | 30 | | AWS Ubuntu | ubuntu | [How to enable root access?](https://support.websoft9.com/docs/aws/server-login.html#sample2-enable-the-root-username) | 31 | | Alibaba Cloud, HUAWEI CLOUD, Tencent Cloud | root | 32 | 33 | > If don't remember the password of Linux, you should reset password on Cloud Console -------------------------------------------------------------------------------- /docs/stack-components.md: -------------------------------------------------------------------------------- 1 | # Parameters 2 | 3 | The ERPNext deployment package contains a sequence software (referred to as "components") required for ERPNext to run. The important information such as the component name, installation directory path, configuration file path, port, version, etc. are listed below. 4 | 5 | ## Path 6 | 7 | This solution use Docker to deploy all service, you can run the command `docker ps` to list them 8 | 9 | ``` 10 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 11 | 949746dc0e88 frappe/frappe-socketio:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-socketio 12 | 030c4324b810 frappe/erpnext-worker:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-schedule 13 | 5816692bb579 frappe/erpnext-worker:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-worker-long 14 | 09b2e2242549 frappe/erpnext-worker:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-worker-short 15 | 2252928c2230 frappe/erpnext-worker:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-worker-default 16 | 4108b4ca06d5 redis:latest "docker-entrypoint.s…" About an hour ago Up About an hour 6379/tcp erpnext-redis-cache 17 | bbe639069a28 redis:latest "docker-entrypoint.s…" About an hour ago Up About an hour 6379/tcp erpnext-redis-queue 18 | 29f4870961b4 mariadb:10.3 "docker-entrypoint.s…" About an hour ago Up About an hour 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp erpnext-mariadb 19 | 9aecda1e6f3e redis:latest "docker-entrypoint.s…" About an hour ago Up About an hour 6379/tcp erpnext-redis-socketio 20 | a404ca45d127 frappe/erpnext-nginx:v13 "/docker-entrypoint.…" About an hour ago Up About an hour 0.0.0.0:8000->80/tcp, :::8000->80/tcp erpnext-nginx 21 | 39d908b3132e frappe/erpnext-worker:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-worker 22 | ``` 23 | 24 | > erpnext-worker-default is the main container, you can run the command `docker exec -it erpnext-worker-default bash` to connect it 25 | 26 | ### ERPNext 27 | 28 | ERPNext application installation directory:  */data/wwwroot/erpnext* 29 | ERPNext site installation directory:  */var/lib/docker/volumes/docker-erpnext_sites-vol* 30 | ERPNext access directory: */var/lib/docker/volumes/docker-erpnext_assets-vol* 31 | ERPNext logs directory:  */var/lib/docker/volumes/docker-erpnext_logs-vol* 32 | 33 | ### Nginx 34 | 35 | Nginx default configuration file:*/etc/nginx/conf.d/default.conf* 36 | Nginx main configuration file: */etc/nginx/nginx.conf* 37 | Nginx logs directory: */var/log/nginx* 38 | Nginx pseudo static directory: */etc/nginx/conf.d/rewrite* 39 | 40 | ### MariaDB on Docker 41 | 42 | MariaDB data directory: */data/db/mysql/data* 43 | MariaDB log directory: */data/db/mysql/logs* 44 | 45 | MariaDB Web Management refer to [MariaDB Management](/admin-mysql.md) 46 | 47 | ### phpMyAdmin 48 | 49 | phpMyAdmin is a visual MySQL management tool, is installed based on docker. 50 | 51 | phpMyAdmin directory:*/data/apps/phpmyadmin* 52 | phpMyAdmin docker compose file:*/data/apps/phpmyadmin/docker-compose.yml* 53 | 54 | ### Docker 55 | 56 | Docker root directory: */var/lib/docker* 57 | Docker image directory: */var/lib/docker/image* 58 | Docker daemon.json: please create it when you need and save to to the directory */etc/docker* 59 | 60 | ## Ports 61 | 62 | Open or close ports by **[Security Group Setting](https://support.websoft9.com/docs/faq/tech-instance.html)** of your Cloud Server to decide whether the port can be accessed from Internet. 63 | 64 | You can run the cmd `netstat -tunlp` to check all related ports. 65 | 66 | The following are the ports you may use: 67 | 68 | | Name | Number | Use | Necessity | 69 | | --- | --- | --- | --- | 70 | | HTTP | 80 | HTTP requests for ERPNext Console| Required | 71 | | HTTP | 443 | HTTP requests for ERPNext Console| Optional | 72 | | HTTP | 8000 | access ERPNext server by ip&port | Optional | 73 | | TCP | 9090 | mariadb web GUI tool phpMyAdmin | Optional | 74 | | TCP | 3306 | remote to mariadb server | Optional | 75 | 76 | ## Version 77 | 78 | You can see the version from product page of Marketplace. However, after being deployed to your server, the components will be automatically updated, resulting in a certain change in the version number. Therefore, the exact version number should be viewed by running the command on the server: 79 | 80 | ```shell 81 | # Check all components version 82 | sudo cat /data/logs/install_version.txt 83 | 84 | # Linux Version 85 | lsb_release -a 86 | 87 | # Docker Version 88 | docker -v 89 | 90 | # Nginx version 91 | nginx -v 92 | ``` -------------------------------------------------------------------------------- /docs/stack-deployment.md: -------------------------------------------------------------------------------- 1 | # Deployment 2 | 3 | **Deployment is to copy the ERPNext pre-packaged online to your Cloud Server**. For example, after the user subscribe ERPNext on the Cloud Platform, the Platform will automatically copy the ERPNext to the corresponding Cloud Server. 4 | 5 | - If ERPNext has been deployed, go to [Initial Installation](/stack-installation.md) to complete the operation. 6 | - If ERPNext is not deployed, you need to deploy ERPNext to your cloud server first. 7 | 8 | We offer two deployment ERPNext scenarios (the deployment results are the same): 9 | 10 | ## Deploy by Image 11 | 12 | **Deploy by Image** means starting instance from ERPNext images. **ERPNext Image** provide OS and software environment needed for ERPNext. 13 | 14 | For users with experience with cloud servers, Deploy by Image equated with "one-click deployment". 15 | 16 | Websoft9 published [ERPNext image](https://apps.websoft9.com/erpnext) on Cloud Platform, three methods for your deployment: 17 | 18 | * When **Create New Instance** , select the ERPNext image as the system boot template. 19 | * When **Subscribe ERPNext** on Marketplace, the system will promote you to create a new instance for this image at the same time. 20 | * When **Re-install OS** for you instance, you can replace the existing image with a ERPNext image. 21 | 22 | ## Deploy by Script 23 | 24 | **Deploy by Script** means running a script on your cloud instance to pull the pre-packages online to your instance and configure it at the same time. 25 | 26 | Websoft9 provide the [ERPNext ansbile automation script](https://github.com/Websoft9/ansible-erpnext) on Github. If you are familiar with Ansible, you can deploy the ERPNext to the instance automaticly. 27 | 28 | ## Comparison 29 | 30 | Although the results of the **deploy by image** are consistent with the results of **deploy by script**, what is the difference between the two deployment methods? 31 | 32 | Suggest you read the document [Deploy by Image vs Deploy by Script](https://support.websoft9.com/docs/faq/bz-product.html#deployment-comparison) -------------------------------------------------------------------------------- /docs/stack-installation.md: -------------------------------------------------------------------------------- 1 | # Initial Installation 2 | 3 | If you have completed the ERPNext deployment on Cloud Platform, the following steps is for you to start use it quikly 4 | 5 | ## Preparation 6 | 7 | 1. Get the **Internet IP** of Server on your Cloud Platform. 8 | 2. Check you **[Inbound of Security Group Rule](https://support.websoft9.com/docs/faq/tech-instance.html)** of Cloud Console to ensure the TCP:80 is allowed 9 | 3. Make a domain resolution on your DNS Console if you want to use domain for ERPNext 10 | 11 | ## ERPNext Installation Wizard 12 | 13 | 1. Using local Chrome or Firefox to visit the URL *http://DNS* or *http://Server's Internet IP*, you will enter installation wizard of ERPNext 14 | ![ERPNext login](https://libs.websoft9.com/Websoft9/DocsPicture/en/erpnext/erpnext-login-websoft9.png) 15 | 16 | 2. Log in to ERPNext web console([Don't have password?](/stack-accounts.md#erpnext)), select your language and go to next step 17 | ![ERPNext install lang](https://libs.websoft9.com/Websoft9/DocsPicture/en/erpnext/erpnext-installlanguage-websoft9.png) 18 | 19 | 3. Follow the installation wizard to complete installation wizard 20 | 21 | 4. You can see the interface when you complete the installation successfully 22 | ![ERPNext background](https://libs.websoft9.com/Websoft9/DocsPicture/en/erpnext/erpnext-ok-websoft9.png) 23 | 24 | There may be an installation error prompt, then you should retry it again until success 25 | ![ERPNext wizard installation error](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-wizarderror-websoft9.png) 26 | 27 | 5. A search box is provided in the top menu for quick retrieval and access to all functions of ERPNext 28 | ![ERPNext quick search](https://libs.websoft9.com/Websoft9/DocsPicture/en/erpnext/erpnext-usersearch-websoft9.png) 29 | 30 | 6. Example: enter the 【user】 settings to manage all accounts 31 | ![ERPNext user management](https://libs.websoft9.com/Websoft9/DocsPicture/en/erpnext/erpnext-userlist-websoft9.png) 32 | 33 | > More useful ERPNext guide, please refer to [ERPNext Documentation](https://docs.erpnext.com/) 34 | 35 | ## Q&A 36 | 37 | #### I can't visit the start page of ERPNext? 38 | 39 | Your TCP:80 of Security Group Rules is not allowed so there no response from Chrome or Firefox 40 | 41 | #### Error prompt in the last step of the ERPNext installation wizard? 42 | 43 | ![](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-wizarderror-websoft9.png) 44 | Cause: unknown 45 | Solution: repeat the installation several times until success 46 | 47 | #### ERPNext service can't start? 48 | 49 | Make sure your **hostname** of Server not include the str ".". e.g erpnext12.14.0 is a not regular for ERPNext 50 | 51 | you can rename hostname by the following command 52 | 53 | ``` 54 | hostnamectl set-hostname erpnext 55 | ``` -------------------------------------------------------------------------------- /docs/zh/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: false 3 | --- 4 | 5 | # 关于 6 | 7 | 本文档由 [Websoft9](https://www.websoft9.com/) 公司提供,用于指导用户学习 ERPNext 的安装部署与基本运维技术,包括:ERPNext部署、初始化安装、环境配置、HTTPS、SMTP、备份升级和连接云服务器操作等基本操作。 8 | 9 | [ERPNext](https://erpnext.com/) 是一个 100% 开源的 ERP,基于 Python 和 Node 开发,它功能全面,包含会计、人力资源、制造、网站、电商、CRM、资产管理、客服工作台等全面的功能。非常合适作为 SAP 的替代品,全球已经有超过 5,000 家企业客户使用。 10 | ![](http://libs.websoft9.com/Websoft9/DocsPicture/en/erpnext/erpnext-adminui-websoft9.png) 11 | 12 | --- 13 | 14 | ## 改进 15 | 16 | 本文档会持续改进,广泛吸收用户的需求。 17 | 如果您有好的想法,请点击页面下方”在Github上编辑“ 给我们反馈,欢迎Fork我们在[Github上的项目](https://github.com/Websoft9/ansible-erpnext)。 18 | 19 | ## 赞助 20 | 21 | Websoft9是一个为开源而生的平台,一直在致力于简化全球优质开源软件的安装部署,并提供简单实用的管理员指南。如果您能够给与我们一些赞助,我想一切将变得更加美好。 22 | 23 | [我要捐赠](https://www.websoft9.com/aboutus/donate) 24 | 25 | ## 合作 26 | 27 | Websoft9提供的镜像库已经发布主流云平台,并提供中英文文档,全球云用户可以方便的使用。 28 | -------------------------------------------------------------------------------- /docs/zh/admin-mysql.md: -------------------------------------------------------------------------------- 1 | # MariaDB 2 | 3 | ERPNext 预装包中内置 MariaDB 及可视化数据库管理工具 `phpMyadmin` ,使用请参考如下步骤: 4 | 5 | 1. 登录云控制台,[开启服务器安全组9090端口](https://support.websoft9.com/docs/faq/zh/tech-instance.html) 6 | 2. 本地浏览器 Chrome 或 Firefox 访问:*http://服务器公网IP:9090*,进入phpMyAdmin 7 | ![登录phpMyadmin](https://libs.websoft9.com/Websoft9/DocsPicture/zh/mysql/phpmyadmin-logincn-websoft9.png) 8 | 3. 输入数据库用户名和密码([不知道密码?](/zh/stack-accounts.md)) 9 | 4. 开始管理数据库 10 | ![phpMyadmin](https://libs.websoft9.com/Websoft9/DocsPicture/zh/mysql/phpmyadmin-adddb-websoft9.png) 11 | 12 | > 阅读Websoft9提供的 [《MySQL教程》](https://support.websoft9.com/docs/mysql/zh/) ,掌握更多的MariaDB实用技能:修改密码、导入/导出数据、创建用户、开启或关闭远程访问、日志配置等 13 | -------------------------------------------------------------------------------- /docs/zh/admin-services.md: -------------------------------------------------------------------------------- 1 | # 服务启停 2 | 3 | 使用由Websoft9提供的 ERPNext 部署方案,可能需要用到的服务如下: 4 | 5 | ### ERPNext 6 | 7 | ```shell 8 | sudo docker start erpnext-worker 9 | sudo docker stop erpnext-worker 10 | sudo docker restart erpnext-worker 11 | sudo docker status erpnext-worker 12 | 13 | ``` 14 | 15 | ```shell 16 | sudo docker start erpnext-worker-short 17 | sudo docker stop erpnext-worker-short 18 | sudo docker restart erpnext-worker-short 19 | sudo docker status erpnext-worker-short 20 | 21 | ``` 22 | 23 | ```shell 24 | sudo docker start erpnext-worker-long 25 | sudo docker stop erpnext-worker-long 26 | sudo docker restart erpnext-worker-long 27 | sudo docker status erpnext-worker-long 28 | 29 | ``` 30 | 31 | ```shell 32 | sudo docker start erpnext-nginx 33 | sudo docker stop erpnext-nginx 34 | sudo docker restart erpnext-nginx 35 | sudo docker status erpnext-nginx 36 | 37 | ``` 38 | 39 | ### Nginx 40 | 41 | ```shell 42 | sudo systemctl start nginx 43 | sudo systemctl stop nginx 44 | sudo systemctl restart nginx 45 | sudo systemctl status nginx 46 | ``` 47 | 48 | ### MariaDB 49 | 50 | ```shell 51 | sudo docker start erpnext-mariadb 52 | sudo docker stop erpnext-mariadb 53 | sudo docker restart erpnext-mariadb 54 | sudo docker status erpnext-mariadb 55 | 56 | ``` 57 | 58 | ### Redis 59 | 60 | ```shell 61 | sudo docker start erpnext-redis-queue 62 | sudo docker stop erpnext-redis-queue 63 | sudo docker restart erpnext-redis-queue 64 | sudo docker status erpnext-redis-queue 65 | 66 | ``` 67 | 68 | ```shell 69 | sudo docker start erpnext-redis-cache 70 | sudo docker stop erpnext-redis-cache 71 | sudo docker restart erpnext-redis-cache 72 | sudo docker status erpnext-redis-cache 73 | 74 | ``` 75 | 76 | ```shell 77 | sudo docker start erpnext-redis-schedule 78 | sudo docker stop erpnext-redis-schedule 79 | sudo docker restart erpnext-redis-schedule 80 | sudo docker status erpnext-redis-schedule 81 | 82 | ``` -------------------------------------------------------------------------------- /docs/zh/else-faq.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | 3 | #### 本项目中 ERPNext 采用何种安装方式? 4 | 5 | 采用 Docker 安装,查看我们提供的 [Docker-Compose for ERPNext](https://github.com/Websoft9/docker-erpnext) 开源项目 6 | 7 | #### ERPNext 支持非 Docker 安装方式吗? 8 | 9 | 支持,具体的安装大致流程如下: 10 | 11 | 1. 使用Bench命令初始化一个Frappe框架 12 | 2. 安装ERPNext app 13 | 3. 创建一个名称同样为 ERPNext 的site 14 | 4. 将site与app 连接起来 15 | 16 | #### Frappe,bench,ERPNext 有什么关系和区别? 17 | 18 | ERPNext 是基于 [Frappe](https://github.com/frappe/frappe) 框架开发的免费 ERP 。而 Frappe 是一个用于快速开发JS和Python集成化应用的框架。[Bench](https://github.com/frappe/bench) 是Frappe框架体系中的 CLI 工具,用于创建和管理基于 Frappe 的应用程序。 19 | 20 | #### ERPNext 安装的时候需要创建 site 是什么原理? 21 | 22 | Frappe 框架主要由两个部分组成:app 和 site,app 是后端Python代码,site 是用于处理 HTTP 请求的前端部分。 23 | 24 | #### ERPNext 支持外部数据库吗? 25 | 26 | 支持,只需在[数据库配置文件](/zh/stack-components.md#erpnext) 中添加 db_host 为外部数据库地址即可。更多数据库连接参数参考官方文档[Standard Config](https://frappeframework.com/docs/user/en/basics/site_config#mandatory-settings) 27 | 28 | #### ERPNext 支持哪些数据库? 29 | 30 | MariaDB 和 PostgreSQL 31 | 32 | #### 数据库用户对应的密码是多少? 33 | 34 | 密码存放在服务器相关文件中:`/credentials/password.txt` 35 | 36 | #### 是否有可视化的数据库管理工具? 37 | 38 | 有可视化数据库管理工具 phpMyAdmin,访问地址:*http://服务器公网IP:9090* 39 | 40 | #### 是否可以修改 ERPNext 的源码路径? 41 | 42 | 不建议 43 | 44 | #### 是否有ERPNext的API文档? 45 | 46 | 有,包括Python,Javascript,Jinja API等,参考官方文档[ERPNext API](https://frappeframework.com/docs/user/en/api) 47 | 48 | #### 如何修改上传的文件权限? 49 | 50 | ```shell 51 | # 拥有者 52 | chown -R erpnext.erpnext /data/wwwroot/erpnext 53 | # 读写执行权限 54 | find /data/wwwroot/erpnext -type d -exec chmod 750 {} \; 55 | find /data/wwwroot/erpnext -type f -exec chmod 640 {} \; 56 | ``` 57 | 58 | #### 部署和安装有什么区别? 59 | 60 | 部署是将一序列软件按照不同顺序,先后安装并配置到服务器的过程,是一个复杂的系统工程。 61 | 安装是将单一的软件拷贝到服务器之后,启动安装向导完成初始化配置的过程。 62 | 安装相对于部署来说更简单一些。 63 | 64 | #### 云平台是什么意思? 65 | 66 | 云平台指提供云计算服务的平台厂家,例如:Azure,AWS,阿里云,华为云,腾讯云等 67 | 68 | #### ERPNext如何进行备份? 69 | 70 | ERPNext备份涉及到3种不同的文件:数据库文件,配置文件,日志文件 71 | 详情参考官方备份文档:[Backing up ERPNext](https://docs.erpnext.org/en/latest/maintenance/backups.html) 72 | 73 | 云平台指提供云计算服务的平台厂家,例如:Azure,AWS,阿里云,华为云,腾讯云等 74 | 75 | #### 实例,云服务器,虚拟机,ECS,EC2,CVM,VM有什么区别? 76 | 77 | 没有区别,只是不同厂家所采用的专业术语,实际上都是云服务器 -------------------------------------------------------------------------------- /docs/zh/else-troubleshooting.md: -------------------------------------------------------------------------------- 1 | # 故障处理 2 | 3 | 此处收集使用 ERPNext 过程中最常见的故障,供您参考 4 | 5 | > 大部分故障与云平台密切相关,如果你可以确认故障的原因是云平台造成的,请参考[云平台文档](https://support.websoft9.com/docs/faq/zh/tech-instance.html) 6 | 7 | #### 如何查看错误日志? 8 | 9 | ERPNext 报错后,有如下几个可以分析日志的入口: 10 | 11 | 1. ERPNext 程序运行日志:*/data/logs/erpnext* 12 | 2. 进程管理日志,运行 `systemctl status erpnext -l` 查看 13 | 3. Nginx日志:*/data/logs/nginx* 14 | 15 | 检索关键词 **Failed** 或者 **error** 查看错误 16 | 17 | #### ERPNext服务无法启动? 18 | 19 | 1. 运行`docker status erpnext`,便可以查看启动状态和错误 20 | 21 | 2. 打开日志文件:*/data/logs/erpnext*,检索 **failed** 关键词,分析错误原因 22 | 23 | 24 | #### 在Chrome下修改密码后报错? 25 | 26 | 这个并不是服务器端的问题,只要更新浏览器即可。 27 | 28 | #### 运行Bench时报错 "You should not run this command as root" when run bench? 29 | 30 | Bench只能通过frapper运行,必须先切换到此用户 31 | 32 | ```shell 33 | su - frapper 34 | ``` 35 | 36 | #### ERPNext 安装向导最后一步出现错误提示? 37 | ![](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-wizarderror-websoft9.png) 38 | 39 | 原因:未知 40 | 方案:重复安装几次直至成功 -------------------------------------------------------------------------------- /docs/zh/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@vuepress/shared-utils": "^1.0.2" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/zh/solution-backup.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # 备份恢复 6 | 7 | ## 为什么? 8 | 9 | 有服务器运维经验的用户都明白一个道理:“信息系统根本无法长时间保持100%稳定的状态,任何系统都可能会出现故障,只是故障出现的概率不同、危害程度不同而已”。 10 | 11 | 1. 工作几天的成果被误删了,怎么恢复? 12 | 2. 网站被黑客攻击面目全非,能复原吗? 13 | 3. 网站内容被改得乱七八糟,想要恢复到一个正常状态? 14 | 15 | 当故障发生之时,我们首先是寻求专业人士的帮助,快速诊断并处理故障,但不幸的是,有些故障无法在期望的时间周期内顺利的解决,甚至是无法解决。 16 | 17 | 显然,有一个备份及其重要,它可以保证出现故障之时可以通过已有的备份文件将系统恢复到正常的状态,意味着可以避免由于无法恢复而造成的巨大损失。 18 | 19 | > 一定要养成备份的习惯,切莫存在侥幸心理 20 | 21 | ## 怎样做? 22 | 23 | 从具体的备份对象上看,由于服务器上存在:**操作系统、运行环境、数据库和应用程序**四个备份对象,每个对象都有可能出现不可预期、不可如期解决的故障。 24 | 25 | 基于备份对象的性质,我们认为如下两种备份措施是必要的: 26 | 27 | ### 全局自动备份 28 | 29 | 所有的云平台都提供了全局自动备份功能,基本原理是基于**磁盘快照**:快照是针对于服务器的磁盘来说的,它可以记录磁盘在指定时间点的数据,将其全部备份起来,并可以实现一键恢复。 30 | 31 | ``` 32 | - 备份范围: 将操作系统、运行环境、数据库和应用程序 33 | - 备份效果: 非常好 34 | - 备份频率: 按小时、天、周备份均可 35 | - 恢复方式: 云平台一键恢复 36 | - 技能要求:非常容易 37 | - 自动化:设置策略后全自动备份 38 | ``` 39 | 40 | 不同云平台的自动备份方案有一定的差异,详情参考 [云平台备份方案](https://support.websoft9.com/docs/faq/zh/tech-instance.html) 41 | 42 | ### 程序手工备份 43 | 44 | 程序手工本地备份是通过**下载应用程序源码和导出数据库文件**实现最小化的备份方案。 45 | 46 | 下面以列表的方式介绍这种备份: 47 | ``` 48 | - 备份范围: 数据库和应用程序 49 | - 备份效果: 一般 50 | - 备份频率: 一周最低1次,备份保留30天 51 | - 恢复方式: 重新导入 52 | - 技能要求:非常容易 53 | - 自动化:无 54 | ``` 55 | 通用的手动备份操作步骤如下: 56 | 57 | 1. 通过 WinSCP 将网站目录(*/data/wwwroot/frappe-bench*)**压缩后**再完整的下载到本地 58 | 59 | 2. 通过 **mysqldump** 备份 erpnext 数据库 60 | ``` 61 | mysqldump -uroot -p erpnext>erpnext.sql 62 | ``` 63 | > ERPNext 超过 1000 个表且部分表中字段过多,使用 phpMyAdmin 导出数据库可能会丢失数据 64 | 65 | 3. 将程序文件和数据库文件放到同一个文件夹,根据日期命名 66 | 67 | 4. 备份工作完成 68 | 69 | 70 | ### ERPNext 备份 71 | 72 | ERPNext 提供了自动备份(计划任务)和[手动输入命令](https://frappeframework.com/docs/user/en/bench/reference/backup)的两种备份方式。 73 | 74 | 75 | 1. 登录 ERPNext 后,依次打开:【Settings】>【System Settings】 76 | ![ERPNext backup](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-autobk-websoft9.png) 77 | 78 | 2. 进入 ERPNext 主容器 79 | ``` 80 | docker exec -it erpnext-worker-default bash 81 | ``` 82 | 3. 在容器中运行备份命令 83 | ``` 84 | # 查询项目文件夹名称(IP 或 域名) 85 | ls 86 | 87 | # 备份 88 | bench --site 121.41.86.118 backup 89 | ``` 90 | 91 | 4. 在宿主机的 Docker VOLUME 中获取备份文件。备份位置:*/var/lib/docker/volumes/docker-erpnext_sites-vol/_data/IP/private/backups* 92 | 93 | > 后台 Download Backups 处下载失败,原因有待研究。故,直接从上面的路径下载即可 -------------------------------------------------------------------------------- /docs/zh/solution-https.md: -------------------------------------------------------------------------------- 1 | # SSL/HTTPS 2 | 3 | 必须完成[域名绑定](/zh/solution-more.md)且可通过 HTTP 访问 ERPNext ,才可以设置 HTTPS。 4 | 5 | ERPNext 预装包,已安装Web服务器 SSL 模块和公共免费证书方案 [Let's Encrypt](https://letsencrypt.org/) ,并完成预配置。因此,除了虚拟主机配置文件之外,HTTPS 设置则不需要修改 Nginx 其他文件。 6 | 7 | ## 快速指南 8 | 9 | ### 自动部署 10 | 11 | 如果没有申请证书,只需在服务器中运行一条命令`sudo certbot`便可以启动免费证书**自动**申请和部署 12 | 13 | ``` 14 | sudo certbot 15 | ``` 16 | 17 | ### 手动部署 18 | 19 | 如果你已经申请了证书,只需三个步骤,即可完成 HTTPS 配置 20 | 21 | 1. 将申请的证书、 证书链文件和秘钥文件上传到 */data/cert* 目录 22 | 2. 打开虚拟主机配置文件:*/etc/nginx/conf.d/default.conf* ,插入**HTTPS 配置段** 到 *server{ }* 中 23 | ``` text 24 | #-----HTTPS template start------------ 25 | listen 443 ssl; 26 | ssl_certificate /data/cert/xxx.crt; 27 | ssl_certificate_key /data/cert/xxx.key; 28 | ssl_trusted_certificate /data/cert/chain.pem; 29 | ssl_session_timeout 5m; 30 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 31 | ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; 32 | ssl_prefer_server_ciphers on; 33 | #-----HTTPS template end------------ 34 | ``` 35 | 3. 重启[Nginx服务](/zh/admin-services.md#nginx) 36 | 37 | ## 专题指南 38 | 39 | 若参考上面的**快速指南**仍无法成功设置HTTPS访问,请阅读由Websoft9提供的 [《HTTPS 专题指南》](https://support.websoft9.com/docs/faq/zh/tech-https.html#nginx) 40 | 41 | 《HTTPS 专题专题》方案包括:HTTPS前置条件、HTTPS 配置段模板、注意事项、详细步骤以及故障诊断等具体方案。 -------------------------------------------------------------------------------- /docs/zh/solution-more.md: -------------------------------------------------------------------------------- 1 | # 更多... 2 | 3 | 下面每一个方案,都经过实践证明行之有效,希望能够对你有帮助 4 | 5 | ## 域名绑定 6 | 7 | 当服务器上只有一个网站时,不做域名绑定也可以访问网站。但从安全和维护考量,**域名绑定**不可省却。 8 | 9 | 以示例网站为例,域名绑定操作步骤如下: 10 | 11 | 1. 确保域名解析已经生效 12 | 2. 使用 SFTP 工具登录云服务器 13 | 2. 修改 [Nginx虚拟机主机配置文件](/zh/stack-components.md#nginx),将其中的 **server_name** 项的值修改为你的域名 14 | ```text 15 | server 16 | { 17 | listen 80; 18 | server_name name; # modify it to your domain 19 | root /data/wwwroot/frappe-bench/sites; 20 | ... 21 | } 22 | ``` 23 | 3. 保存配置文件,重启 [Nginx 服务](/zh/admin-services.md#nginx) 24 | 4. 修改 ERPNext 环境变量,绑定域名: 25 | 进入 ERPNext 目录 /data/wwwroot/erpnext 26 | 修改 .env 文件域名配置项 27 | ``` 28 | ... 29 | APP_SITE_URL=your domain 30 | APP_SITE_NAME=`your domain` 31 | ... 32 | ``` 33 | 6. 重启 ERPNext 34 | ``` 35 | docker-compose up -d 36 | ``` 37 | 38 | ## 重置密码 39 | 40 | 常用的 ERPNext 重置密码相关的操作主要有修改密码和找回密码两种类型: 41 | 42 | ### 修改密码 43 | 44 | 45 | 1. 登录 ERPNext后台,依次打开:【设置】>【个人设置】,找到修改密码项 46 | ![ERPNext 修改密码](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-modifypw-websoft9.png) 47 | 48 | 2. 直接设置新密码,保存后生效 49 | 50 | ### 找回密码 51 | 52 | 如果用户忘记了 ERPNext 密码,可以通过如下的命令直接设置一个新密码: 53 | 54 | ``` 55 | sudo -H -u erpnext bash -c "cd /data/wwwroot/frappe-bench && export GIT_PYTHON_REFRESH=quiet && /usr/local/bin/bench set-admin-password newpassword" 56 | ``` 57 | 58 | ### 使用RDS 59 | 60 | 如果用户不喜欢使用服务器上安装的 MariaDB,而希望迁移到云数据库中(RDS),大致流程: 61 | 62 | 1. 备份已有数据库,并导入到 RDS 中(适合于 ERPNext 已经完成安装) 63 | 64 | 2. 修改 [ERPNext 容器配置文件:/data/wwwroot/erpnext/.env](/zh/stack-components.md#erpnext) 中的数据库相关信息 65 | ``` 66 | DB_MRAIADB_USER=root 67 | DB_MARIADB_PASSWORD=123456 68 | DB_MARIADB_HOST=mariadb 69 | DB_MARIADB_PORT=3306 70 | DB_MARIADB_VERSION=10.6 71 | ``` 72 | 73 | > DB_MARIADB_HOST 设置为外部数据库地址 74 | 75 | 3. 重新运行容器 76 | ``` 77 | cd /data/wwwroot/erpnext 78 | docker-compose up -d 79 | ``` 80 | 81 | 4. 测试更改数据库后的连接可用性 82 | -------------------------------------------------------------------------------- /docs/zh/solution-smtp.md: -------------------------------------------------------------------------------- 1 | # SMTP 2 | 3 | 大量用户实践反馈,使用**第三方 SMTP 服务发送邮件**是一种最稳定可靠的方式。 4 | 5 | 请勿在服务器上安装sendmail等邮件系统,因为邮件系统的路由配置受制与域名、防火墙、路由等多种因素制约,非常不稳定,且不易维护、诊断故障很困难。 6 | 7 | 下面以**QQ邮箱**为例,提供设置 ERPNext 发邮件的步骤: 8 | 9 | 1. 在QQ邮箱管理控制台获取 SMTP 相关参数 10 | ``` 11 | SMTP host: smtp.qq.com 12 | SMTP port: 465 or 587 for SSL-encrypted email 13 | SMTP Authentication: must be checked 14 | SMTP Encryption: must SSL 15 | SMTP username: websoft9smpt 16 | SMTP password: #fdfwwBJ8f #这个密码不是邮箱密码,是需要通过QQ邮箱SMTP设置去获取的授权码 17 | ``` 18 | 2. 登录 ERPNext控制台,在【设置】>【电子邮件域名】填写SMTP参数 19 | ![ERPNext SMTP](https://libs.websoft9.com/Websoft9/DocsPicture/en/erpnext/erpnext-smtp-websoft9.png) 20 | 21 | 3. 点击【保存】后,系统后进行一个 SMTP 初步验证,验证通过才能保存成功 22 | 23 | 更多邮箱设置(阿里云邮箱,Gmail,Hotmail等)以及无法发送邮件等故障之诊断,请参考由Websoft9提供的 [SMTP 专题指南](https://support.websoft9.com/docs/faq/zh/tech-smtp.html) -------------------------------------------------------------------------------- /docs/zh/solution-upgrade.md: -------------------------------------------------------------------------------- 1 | # 更新升级 2 | 3 | 网站技术日新月异,**更新升级**是维护工作之一,长时间不升级的程序,就如长时间不维护的建筑物一样,会加速老化、功能逐渐缺失直至无法使用。 4 | 5 | 这里注意更新与升级这两词的差异([延伸阅读](https://support.websoft9.com/docs/faq/zh/tech-upgrade.html#更新-vs-升级)),例如: 6 | - 操作系统打个补丁常称之为**更新**,Ubuntu16.04 变更为 Ubuntu18.04,称之为**升级** 7 | - MySQL5.6.25-->MySQL5.6.30 常称之为**更新**,MySQL5.6->MySQL5.7 称之为**升级** 8 | 9 | ERPNext 完整的更新升级包括:系统级更新(操作系统和运行环境)和 ERPNext 程序升级两种类型 10 | 11 | ## 系统级更新 12 | 13 | 运行一条更新命令,即可完成系统级更新: 14 | 15 | ``` shell 16 | #For Ubuntu&Debian 17 | apt update && apt upgrade -y 18 | 19 | #For Centos&Redhat 20 | yum update -y 21 | ``` 22 | > 本部署包已预配置一个用于自动更新的计划任务。如果希望去掉自动更新,请删除对应的Cron 23 | 24 | 25 | ## ERPNext 更新 26 | 27 | ERPNext 基于 Docker 部署,其升级流程:拉取镜像 > 删除容器 > 重建容器 28 | 29 | > 升级之前请确保您已经完成了服务器的镜像(快照)备份 30 | 31 | 1. 登录服务器,删除旧容器 32 | ``` 33 | docker-compose down -v 34 | ``` 35 | 2. 编辑 */data/wwwroot/erpnext/.env* 文件,将版本变量的值修改为目标版本号 36 | 37 | 2. 拉取目标版本的镜像 38 | ``` 39 | cd /data/wwwroot/erpnext 40 | docker-compose pull 41 | ``` 42 | > 如果显示没有镜像可拉取,则无需升级 43 | 44 | 3. 重新创建 ERPNext 容器 45 | ``` 46 | docker-compose up -d 47 | ``` -------------------------------------------------------------------------------- /docs/zh/stack-accounts.md: -------------------------------------------------------------------------------- 1 | # 账号密码 2 | 3 | 通过**SSH**连接云服务器,运行 `sudo cat /credentials/password.txt` 命令,查看所有相关账号和密码 4 | 5 | ![](https://libs.websoft9.com/Websoft9/DocsPicture/zh/common/catdbpassword-websoft9.png) 6 | 7 | 下面列出可能需要用到的几组账号密码: 8 | 9 | ## ERPNext 10 | 11 | * 管理员账号: `Administrator` 12 | * 管理员密码: 存储在您的服务器中的文件中 */credentials/password.txt* 13 | 14 | ## MariaDB 15 | 16 | * 管理员账号:*`root`* 17 | * 管理员密码:存储在您的服务器中的文件中 */credentials/password.txt* 18 | 19 | ## Linux 20 | 21 | * 主机地址:服务公网IP地址 22 | * 连接方式:云控制台在线SSH 或 SFTP客户端工具 或 SSH客户端工具 23 | * 管理员密码:创建服务器的时候自行设置,若不记得密码需要通过云控制台重置。 24 | * 管理员账号:不同的云平台有一定的差异 25 | | 云平台 | 管理员账号 | 其他| 26 | | --- | --- | --- | 27 | | Azure | 创建服务器的时候自行设置 | [如何开启root账户?](https://support.websoft9.com/docs/azure/zh/server-login.html#示例2:启用系统root账号) | 28 | | AWS Centos 系统 | centos | [如何开启root账户?](https://support.websoft9.com/docs/aws/zh/server-login.html#示例2:启用系统root账号) | 29 | | AWS AmazonLinux 系统 | ec2-user | [如何开启root账户?](https://support.websoft9.com/docs/aws/zh/server-login.html#示例2:启用系统root账号) | 30 | | AWS Ubuntu 系统 | ubuntu | [如何开启root账户?](https://support.websoft9.com/docs/aws/zh/server-login.html#示例2:启用系统root账号) | 31 | | 阿里云,华为云,腾讯云 | root | | -------------------------------------------------------------------------------- /docs/zh/stack-components.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # 参数 6 | 7 | ERPNext 预装包包含 ERPNext 运行所需一序列支撑软件(简称为“组件”),下面列出主要组件名称、安装路径、配置文件地址、端口、版本等重要的信息。 8 | 9 | ## 路径 10 | 11 | 本部署方案中的 ERPNext 采用 Docker 部署,运行 `docker ps` 查看运行的容器。 12 | 13 | ``` 14 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 15 | 949746dc0e88 frappe/frappe-socketio:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-socketio 16 | 030c4324b810 frappe/erpnext-worker:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-schedule 17 | 5816692bb579 frappe/erpnext-worker:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-worker-long 18 | 09b2e2242549 frappe/erpnext-worker:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-worker-short 19 | 2252928c2230 frappe/erpnext-worker:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-worker-default 20 | 4108b4ca06d5 redis:latest "docker-entrypoint.s…" About an hour ago Up About an hour 6379/tcp erpnext-redis-cache 21 | bbe639069a28 redis:latest "docker-entrypoint.s…" About an hour ago Up About an hour 6379/tcp erpnext-redis-queue 22 | 29f4870961b4 mariadb:10.3 "docker-entrypoint.s…" About an hour ago Up About an hour 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp erpnext-mariadb 23 | 9aecda1e6f3e redis:latest "docker-entrypoint.s…" About an hour ago Up About an hour 6379/tcp erpnext-redis-socketio 24 | a404ca45d127 frappe/erpnext-nginx:v13 "/docker-entrypoint.…" About an hour ago Up About an hour 0.0.0.0:8000->80/tcp, :::8000->80/tcp erpnext-nginx 25 | 39d908b3132e frappe/erpnext-worker:v13 "docker-entrypoint.s…" About an hour ago Up About an hour erpnext-worker 26 | ``` 27 | 28 | > erpnext-worker-default 为项目主容器 29 | 30 | ### ERPNext 31 | 32 | ERPNext 路径:  */data/wwwroot/erpnext* 33 | ERPNext 数据库配置文件: */data/wwwroot/erpnext/.env* 34 | ERPNext 日志路径:  */data/wwwroot/erpnext/volumes/erpnext-logs-vol* 35 | ERPNext 应用路径 : */data/wwwroot/frappe-bench/volumes/erpnext-site-vol* 36 | ERPNext 附件路径:  */data/wwwroot/frappe-bench/volumes/erpnext-assets-vol* 37 | 38 | ### Nginx 39 | 40 | Nginx 虚拟主机配置文件:*/etc/nginx/conf.d/default.conf* 41 | Nginx 主配置文件: */etc/nginx/nginx.conf* 42 | Nginx 日志文件: */var/log/nginx* 43 | Nginx 伪静态规则目录: */etc/nginx/conf.d/rewrite* 44 | 45 | ### MariaDB 46 | 47 | MariaDB 数据目录 */data/db/mariadb/data* 48 | MariaDB 日志目录: */data/db/mariadb/log* 49 | MariaDB 配置文件:*/data/db/mariadb/config/conf.d* 50 | 51 | MySQL 可视化管理参考 [MySQL 管理](/zh/admin-mysql.md) 章节。 52 | 53 | ### phpMyAdmin 54 | 55 | phpMyAdmin 是一款可视化 MySQL 管理工具,在本项目中它基于 Docker 安装。 56 | 57 | phpMyAdmin directory:*/data/apps/phpmyadmin* 58 | phpMyAdmin docker compose file:*/data/apps/phpmyadmin/docker-compose.yml* 59 | 60 | ### Docker 61 | 62 | Docker 根目录: */var/lib/docker* 63 | Docker 镜像目录: */var/lib/docker/image* 64 | Docker daemon.json 文件:默认没有创建,请到 */etc/docker* 目录下根据需要自行创建 65 | 66 | ## 端口号 67 | 68 | 在云服务器中,通过 **[安全组设置](https://support.websoft9.com/docs/faq/zh/tech-instance.html)** 来控制(开启或关闭)端口是否可以被外部访问。 69 | 70 | 通过命令`netstat -tunlp` 看查看相关端口,下面列出可能要用到的端口: 71 | 72 | | 名称 | 端口号 | 用途 | 必要性 | 73 | | --- | --- | --- | --- | 74 | | HTTP | 80 | 通过 HTTP 访问 ERPNext | Required | 75 | | HTTP | 443 | 通过 HTTPS 访问 ERPNext| Optional | 76 | | HTTP | 8000 | 通过端口直接访问 ERPNext| Optional | 77 | | TCP | 9090 | 数据库可视化工具 phpMyAdmin | Optional | 78 | | TCP | 3306 | 远程访问 MariaDB 数据库 | Optional | 79 | 80 | ## 版本号 81 | 82 | 组件版本号可以通过云市场商品页面查看。但部署到您的服务器之后,组件会自动进行更新导致版本号有一定的变化,故精准的版本号请通过在服务器上运行命令查看: 83 | 84 | ```shell 85 | # Check all components version 86 | sudo cat /data/logs/install_version.txt 87 | 88 | # Linux Version 89 | lsb_release -a 90 | 91 | # Docker Version 92 | docker -v 93 | 94 | # Nginx version 95 | nginx -v 96 | ``` -------------------------------------------------------------------------------- /docs/zh/stack-deployment.md: -------------------------------------------------------------------------------- 1 | # 部署 2 | 3 | **部署就是将 ERPNext 预装包在线复制到你的云服务器中**。例如:用户在云平台购买 ERPNext 之后,云平台就会自动将 ERPNext 复制到对应的云服务器。 4 | 5 | - 如果已经部署 ERPNext,请进入[初始化安装](/zh/stack-installation.md) ,完成相关操作。 6 | - 如果没有部署 ERPNext,需要先将 ERPNext 部署到您的云服务器。 7 | 8 | 我们提供了两种 ERPNext 部署方案,部署过程是全自动化的,用户启动部署后,等待结果即可: 9 | 10 | ## 镜像一键部署 11 | 12 | **镜像部署**就是用户基于镜像来创建云服务器,从而获得与镜像一致的系统环境。**镜像**是指云服务器可选择的运行环境模板,一般包括操作系统和预装的软件。 13 | 14 | 对有云服务器使用经验的用户来说,镜像部署可以等同于“一键部署”。 15 | 16 | 我们在主流的云平台上发布了 [ERPNext 镜像](https://apps.websoft9.com/erpnext)供用户使用。云平台一般支持三种镜像部署方式: 17 | 18 | * 在 **选购新服务器** 的时候,找到并选取 ERPNext 镜像作为服务器启动环境 19 | * 在 **云市场(Marketplace)** 的 ERPNext 商品页面直接购买镜像 20 | * 对于已有服务器,通过 **更换镜像(重装系统)** 的操作,将已有镜像替换为 ERPNext 镜像。 21 | 22 | ## 脚本自动化部署 23 | 24 | **脚本部署**是指在云服务器上运行一段脚本程序,它会**自动地**将预装包在线下载到云服务器,并完成预配置 25 | 26 | 我们在 Github上发布了 [ERPNext 自动化部署脚本](https://github.com/Websoft9/ansible-erpnext),脚本基于 Ansible 编写。只要熟悉 Ansible,便可以实现 **无人值守(全自动化)** 的方式将 ERPNext 部署到服务器。 27 | 28 | ## 对比 29 | 30 | 虽然通过镜像部署与脚本部署的结果一致,这两种部署方式有什么差异或优劣呢?: 31 | 32 | 建议立即阅读 [《镜像部署 vs 脚本部署》](https://support.websoft9.com/docs/faq/zh/bz-product.html#镜像部署-vs-脚本部署) -------------------------------------------------------------------------------- /docs/zh/stack-installation.md: -------------------------------------------------------------------------------- 1 | # 初始化安装 2 | 3 | 在云服务器上部署 ERPNext 预装包之后,请参考下面的步骤快速入门。 4 | 5 | ## 准备 6 | 7 | 1. 在云控制台获取您的 **服务器公网IP地址** 8 | 2. 在云控制台安全组中,检查 **Inbound(入)规则** 下的 **TCP:80** 端口是否开启 9 | 3. 若想用域名访问 ERPNext,请先到 **域名控制台** 完成一个域名解析 10 | 11 | ## ERPNext 安装向导 12 | 13 | 1. 使用本地电脑 Chrome 或 Firefox 浏览器访问网址:*http://域名* 或 *http://服务器公网IP*, 进入初始化页面 14 | ![erpnext安装登录](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-login-websoft9.png) 15 | 16 | 2. 输入账号密码([不知道账号密码?](/zh/stack-accounts.md#erpnext)),选择语言, 进入下一步 17 | ![erpnext安装](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-language-websoft9.png) 18 | 19 | 3. 根据安装向导依次完成后续步骤 20 | 21 | 4. 安装完成之后,ERPNext 会弹出如下界面 22 | ![erpnext后台](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-cpsetup-websoft9.png) 23 | 24 | 可能会出现安装错误提示,此时需要反复安装: 25 | ![erpnext 向导安装报错](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-wizarderror-websoft9.png) 26 | 27 | 5. ERPNext 顶部菜单中提供了搜索框,用于快速检索并进入 ERPNext 所有的功能 28 | ![erpnext 快速检索](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-sbar-websoft9.png) 29 | 30 | 6. 通过检索功能,进入【用户】设置,可以管理当前系统下所有账号 31 | ![erpnext 用户管理](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-users-websoft9.png) 32 | 33 | 34 | > 需要了解更多 ERPNext 的使用,请参考官方文档:[ERPNext Documentation](https://docs.erpnext.com) 35 | 36 | ## 常见问题 37 | 38 | #### 浏览器打开IP地址,无法访问 ERPNext(白屏没有结果)? 39 | 40 | 您的服务器对应的安全组80端口没有开启(入规则),导致浏览器无法访问到服务器的任何内容 41 | 42 | #### ERPNext 安装向导最后一步出现错误提示? 43 | ![](https://libs.websoft9.com/Websoft9/DocsPicture/zh/erpnext/erpnext-wizarderror-websoft9.png) 44 | 原因:未知 45 | 方案:重复安装几次直至成功 46 | 47 | #### ERPNext 服务启动失败? 48 | 49 | 请确认hostname是否包含字符串 ".",例如 erpnext12.14.0对于ERPNext来说是一个不合规的hostname 50 | 51 | 你可以使用下列命令来修改hostname: 52 | 53 | ``` 54 | hostnamectl set-hostname erpnext 55 | ``` -------------------------------------------------------------------------------- /erpnext.yml: -------------------------------------------------------------------------------- 1 | - name: Erpnext 2 | hosts: all 3 | become: yes 4 | become_method: sudo 5 | 6 | vars_files: 7 | - vars/main.yml 8 | 9 | vars_prompt: 10 | - name: 'erpnext_selection' 11 | prompt: "\nPlease choose the number for ERPNext version [ 1/2/3 ] \n\n 12 | 1: ERPNext11\n 13 | 2: ERPNext12\n 14 | 3: ERPNext13\n" 15 | private: no 16 | default: 2 17 | 18 | vars: 19 | erpnext_select: 20 | '1': '11' 21 | '2': '12' 22 | '3': '13' 23 | 24 | erpnext_version: "{{erpnext_select[erpnext_selection]}}" 25 | 26 | roles: 27 | - {role: role_common , tags: "role_common"} 28 | - {role: role_cloud , tags: "role_cloud"} 29 | - {role: role_docker , tags: "role_docker"} 30 | - {role: role_mariadb , tags: "role_mariadb"} 31 | - {role: role_nginx , tags: "role_nginx"} 32 | - {role: erpnext , tags: "erpnext"} 33 | - {role: role_init , tags: "role_init"} 34 | - {role: role_preend , tags: "role_preend"} 35 | - {role: role_end , tags: "role_end"} -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | Websoft9 ERPNext Stack 11.1.39 2 | =========================== 3 | 4 | 1. OVERVIEW 5 | 6 | The Websoft9 Project was created to help spread the adoption of freely 7 | available, high quality, open source web applications. Websoft9 aims to make 8 | it easier than ever to discover, install, Use Open Source software 9 | 10 | You can learn more about Websoft9 at https://websoft9.com 11 | 12 | Websoft9 ERPNext stack is an easy to install and easy to use open source Web 13 | Platform. It combines leading open source projects, such as Java,ActiveMQ... 14 | 15 | 16 | 2. COMPONENTS and Version 17 | 18 | Websoft9 ERPNext stack ships with the following software versions: 19 | 20 | ******** 21 | - ERPNext 11.1.39 22 | - Nginx 1.14.0 23 | - Java1.8.0 24 | - MariaDB 10.2.22 25 | - Redis 4.0.9 26 | 27 | --- other components --- 28 | 29 | 30 | 31 | ******** 32 | 33 | 34 | You can find a quick start guide and more documentation about all of the components at: 35 | 36 | 中文文档:http://support.websoft9.com/docs/erpnext-image-guide/ 37 | English: https://www.yuque.com/webs/mq/erpnext 38 | -------------------------------------------------------------------------------- /requirements.yml: -------------------------------------------------------------------------------- 1 | # 根据需求添加相对应的role 2 | - src: http://github.com/websoft9/role_common 3 | 4 | - src: http://github.com/websoft9/role_cloud 5 | 6 | - src: http://github.com/websoft9/role_docker 7 | 8 | - src: http://github.com/websoft9dev/role_mariadb 9 | 10 | - src: http://github.com/websoft9/role_nginx 11 | 12 | - src: http://github.com/websoft9/role_init 13 | 14 | - src: http://github.com/websoft9/role_preend 15 | 16 | - src: http://github.com/websoft9/role_end 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /roles/.gitignore: -------------------------------------------------------------------------------- 1 | *.retry 2 | /.vscode 3 | hosts 4 | test.yml 5 | -------------------------------------------------------------------------------- /roles/CHANGLOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | ## Release v12.14.0-5 2020-12-17 4 | ### Fixes and Enhancements 5 | - Error prompt in the last step of the erptext installation wizard? #4 6 | - ERPNext 12.14.0 released #7 7 | 8 | ## Release v12.14.0-6 2020-12-29 9 | ### Fixes and Enhancements 10 | - Old version need #10 11 | -------------------------------------------------------------------------------- /roles/README.md: -------------------------------------------------------------------------------- 1 | ### Centos 2 | PHP 使用 webtatic 源 安装 3 | 4 | ``` 5 | yum install epel-release 6 | rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm 7 | ``` 8 | 9 | 安装软件 10 | `yum install php70w` 包命名方式 程序名称+版本+w 11 | 12 | 13 | Apache/python 等 使用 IUS 源 安装 14 | 15 | ``` 16 | rpm -ivh https://rhel7.iuscommunity.org/ius-release.rpm 17 | ``` 18 | 19 | 安装软件 20 | `yum install httpd24u` 包命名方式 程序名称+版本+u 21 | 22 | -------------------------------------------------------------------------------- /roles/erpnext/Notes.md: -------------------------------------------------------------------------------- 1 | ## [安装](https://github.com/frappe/frappe/wiki/The-Hitchhiker%27s-Guide-to-Installing-Frappe-on-Linux)概要 2 | 3 | 官方提供了三种安装方式: 4 | 5 | * Docker 安装:容器过多,考虑客户使用ERP有个性化开发,担心不方便保存数据 6 | * 自动化安装脚本:经过调研,发现本质上是通过本地跑ansible的方式,对我们而言,这种"ansible套ansible"不可控,故不采用; 7 | * 手动安装:先安装CLI工具Bench,再安装Frappe框架以及其中的应用ERPNext 8 | 9 | 综合评估,采用手工安装方式。 10 | 11 | > ERPNext的架构原理:ERPNext是基于[Frappe](https://github.com/frappe/frappe)框架开发的免费ERP。而Frappe是一个用于快速开发JS和Python集成化应用的框架。[Bench](https://github.com/frappe/bench)是Frappe框架体系中的CLI工具,用于创建和管理基于Frappe的应用程序。 12 | 13 | 14 | ## Frappe 15 | 16 | 由于 Frappe 是 ERPNext 的基础,因此理解其关键要素,对于安装配置和维护显得非常重要。 17 | 18 | Frappe 框架主要由两个部分组成:app 和 site,app 是后端Python代码,site 是用于处理 HTTP 请求的前端部分。 19 | 20 | ## 安装ERPNext 21 | 22 | ERPNext的安装大致流程如下: 23 | 24 | 1. 使用Bench命令初始化一个Frappe框架 25 | 2. 安装ERPNext app 26 | 3. 创建一个名称同样为 ERPNext 的site 27 | 4. 将site与app 连接起来 28 | 29 | 30 | 31 | ## FAQ 32 | 33 | #### Bench Manager 是什么? 34 | 35 | Bench Manager 是Bench 的GUI工具,它也是 Frappe 下的一个app 36 | 37 | #### ERPNext数据库配置有什么特殊之处? 38 | 39 | 1. 需要修改mariadb存储引擎为MyISAM 40 | 2. 新建站点时需指定用户权限为 "%" 41 | ``` 42 | bench new-site --no-mariadb-socket 43 | Set MariaDB host to % and use TCP/IP Socket instead of using the UNIX Socket 44 | ``` 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /roles/erpnext/defaults/main.yml: -------------------------------------------------------------------------------- 1 | erpnext_version: "12" 2 | 3 | erpnext_work_dir: "/data/wwwroot/erpnext" 4 | 5 | erpnext_git_url: "https://github.com/Websoft9/docker-erpnext.git" -------------------------------------------------------------------------------- /roles/erpnext/files/check_dockerapp_service.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker inspect --format='{{.Name}} status {{.State.Status}}' $(docker ps -aq) |cut -b1 --complement 3 | rm $0 -------------------------------------------------------------------------------- /roles/erpnext/handlers/main.yml: -------------------------------------------------------------------------------- 1 | - name: check_erpnext_service 2 | debug: 3 | var: check_dockerapp_service.stdout_lines -------------------------------------------------------------------------------- /roles/erpnext/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Delete erpnext dir for sec_installation 2 | shell: rm -rf {{erpnext_work_dir}} 3 | 4 | - name: Clone erpnext in Websoft9 5 | git: 6 | repo: "{{erpnext_git_url}}" 7 | dest: "{{erpnext_work_dir}}" 8 | 9 | - name: Create dir for erpnext 10 | file: 11 | state: directory 12 | path: "{{item}}" 13 | loop: 14 | - '{{erpnext_work_dir}}/volumes' 15 | - /data/db/mariadb 16 | - /data/db/redis 17 | 18 | - name: Modify the selected version 19 | shell: | 20 | public_ip=`wget -O - https://download.websoft9.com/ansible/get_ip.sh | bash` 21 | sed -i 's/APP_VERSION=.*/APP_VERSION=v{{erpnext_version}}/g' {{erpnext_work_dir}}/.env 22 | sed -i "s/erp.example.com/$public_ip/g" {{erpnext_work_dir}}/.env 23 | 24 | - name: Run docker-compose 25 | shell: | 26 | docker-compose up -d 27 | sleep 30 28 | args: 29 | chdir: '{{erpnext_work_dir}}' 30 | 31 | - name: Set soft link for erpnext 32 | file: 33 | src: '{{item.src}}' 34 | dest: '{{item.dest}}' 35 | state: link 36 | force: yes 37 | with_items: 38 | - {src: '{{erpnext_work_dir}}/volumes/mariadb-vol/',dest: /data/db/mariadb/data} 39 | - {src: '{{erpnext_work_dir}}/installation/frappe-mariadb.cnf',dest: /data/db/mariadb/frappe-mariadb.cnf} 40 | - {src: '{{erpnext_work_dir}}/installation/frappe-mariadb.cnf',dest: /data/config/frappe-mariadb.cnf} 41 | - {src: '{{erpnext_work_dir}}/volumes/redis-socketio-vol/',dest: /data/db/redis/socketio} 42 | - {src: '{{erpnext_work_dir}}/volumes/redis-queue-vol/',dest: /data/db/redis/queue} 43 | - {src: '{{erpnext_work_dir}}/volumes/redis-cache-vol/',dest: /data/db/redis/cache} 44 | - {src: '{{erpnext_work_dir}}/volumes/logs-vol/',dest: /data/logs/erpnext} 45 | - {src: /var/lib/docker/volumes/docker-erpnext_assets-vol,dest: '{{erpnext_work_dir}}/volumes/erpnext-assets-vol'} 46 | - {src: /var/lib/docker/volumes/docker-erpnext_logs-vol,dest: '{{erpnext_work_dir}}/volumes/erpnext-logs-vol'} 47 | - {src: /var/lib/docker/volumes/docker-erpnext_sites-vol,dest: '{{erpnext_work_dir}}/volumes/erpnext-site-vol'} 48 | 49 | # check service and version 50 | - name: Copy check service script 51 | copy: 52 | src: check_dockerapp_service.sh 53 | dest: /tmp/check_dockerapp_service.sh 54 | 55 | - name: Check erpnext service 56 | shell: bash /tmp/check_dockerapp_service.sh 57 | register: check_erpnext_service 58 | notify: check_erpnext_service 59 | 60 | - name: Check erpnext version 61 | shell: | 62 | sudo echo "erpnext version:" $(docker exec -it $(docker ps |grep frappe-socketio |awk '{print $1}') cat app_versions.json |grep -m 1 "erpnext" |awk '{print $2}') |sudo tee -a /data/logs/install_version.txt 63 | 64 | - name: Check mariadb version 65 | shell: | 66 | sudo echo "mariadb version:" $(docker images |grep mariadb |awk '{print $2}') |sudo tee -a /data/logs/install_version.txt 67 | 68 | - name: Check redis version 69 | shell: | 70 | sudo echo "redis version:" $(docker inspect redis:latest |grep REDIS_VERSION |head -1 |cut -d= -f2) |sudo tee -a /data/logs/install_version.txt 71 | -------------------------------------------------------------------------------- /roles/erpnext/vars/main.yml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /vars/main.yml: -------------------------------------------------------------------------------- 1 | common_install_docker: True 2 | docker_install: False 3 | mariadb_install_server: False 4 | 5 | nginx_reverse_proxy_port: "8000" 6 | 7 | docker_applications: 8 | - phpmyadmin 9 | 10 | init_docker: 11 | erpnext: 12 | db: mariadb 13 | db_name: erpnext 14 | db_username: root 15 | db_password: "123456" 16 | admin_username: Administrator 17 | admin_password: "admin" 18 | service_after: "docker.service" 19 | compose_path: "/data/wwwroot/erpnext/docker-compose.yml" 20 | compose_commands: 21 | - cd /data/wwwroot/erpnext 22 | - public_ip=`wget -O - https://download.websoft9.com/ansible/get_ip.sh | bash` 23 | - sudo sed -i "s/admin/$new_password/g" /data/wwwroot/erpnext/.env 24 | - sudo sed -i "s/123456/$new_password/g" /data/wwwroot/erpnext/.env 25 | - sudo sed -i "s/APP_SITE_URL.*/APP_SITE_URL=$public_ip/g" /data/wwwroot/erpnext/.env 26 | - sudo sed -i "s/APP_SITE_NAME=.*/APP_SITE_NAME=\`$public_ip\`/g" /data/wwwroot/erpnext/.env 27 | - sudo docker volume prune -f 28 | volumes: 29 | - /data/wwwroot/erpnext/volumes 30 | 31 | --------------------------------------------------------------------------------