Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Script can now run again and again without corrupting the installation. * Script will install to `/home/odoo/` by default, instead of `/odoo/`, this is best practice, because `/home/odoo` will be backed up on typical servers, and `/odoo` will be restricted or refused access on typical servers. * Script will halt on major errors to more easily locate any errors. * Cleaned up, combined many `apt-get` and `pip` calls into fewer calls. * All output goes to `~/install_log` for easier posting to github for help. * `./install_log` is cleared at the start of each run. * All work (downloads, building the `conf` file and service file) takes place in home dir. * Fixed bug, was creating `addons` dir with ownership of `root`. * Add configurable option to add user `odoo` to group `sudo` or not. * Show proof that service is running at the end of the run. * More to do, (put each step into its own function, and create reverse of each function for uninstaller) but this is a great start. Newest WKHTMLtoPDF 0.12.4 (Nov 2016). Install the newest version 0.12.4 (Nov 2016) of WKHTMLtoPDF. Has about 140 commits newer than the previously used 0.12.1 (released 2014) which is obsolete unpatched and unsupported for years now. https://github.com/wkhtmltopdf/wkhtmltopdf/releases Fix service start bug. On 16.04 /etc/init.d fails. Fix service start bug. Put more blocks of procedural code into functions for easier updating it. Clean up Enterprise install function. Fix. Run `odoo-server` as an ordinary user odoo, not member of `sudo` (superadmin). Running `odoo-server` service as ordinary user is working now. Set `odoo` user to default as non-`sudo` group member. This commit lets script continue OK when removing `odoo` user from `sudo` group when already not a member of the `sudo` group. Fix error checking for install on empty server. When `odoo-server` stopped, and try to `stop`, don't halt script, just continue. Show version and install details. Upgrade pip. Fixes bugs in `start.sh` and postgresql create database. Better organized. Easier to see bugs. Fixes bug in start.sh (was using old name openerp instead of odoo) Fixes bug, charset error when postgresql tries to create your database at the odoo welcome screen. Cleanup. Functions. Update version. Handles command line to install Enterprise: -E -e --enterprise Save time, no need to edit the script and change a variable just to install Enterprise! `./odoo_install.sh -E` `./odoo_install.sh -e` `./odoo_install.sh --enterprise` Fix bug in enterprise install, addons_path was omitting custom. Old bug in enterprise installs. `addons_path` was failing to include the path `(home)/custom/addons`. Fixed. Add sudo. Add flag. Reduce error messages. You should now be able to run without `sudo` before script name on command line. Script uses `sudo` which prompts for password when you're not super-admin. Odoo home folder, fix permission error message. Fix bug when run install as non-superadmin Bug. Was failing to create `odoo-server.conf` file. Add uninstall command line feature. -U or --uninstall Add missing python libs (from requirements.txt) These python libraries are required and were missing, and caused serious errors in the `/var/log/odoo/odoo-server` log file: ``` num2words markupsafe ofxparse pillow pyldap pyserial qrcode six ``` Fixed by adding these libs to the function `install_python_libraries`. Fixes errors (missing python libraries). This commit fixes the following error. A feature was broken because of the simple fact of not installing some required libraries. ``` 2017-11-22 19:14:34,560 21522 WARNING ? odoo.addons.base.res.res_currency: The num2words python library is not installed, l10n_mx_edi features won't be fully available. ``` Previous commit fixed the above error, but had 2 syntax errors, which are fixed in this commit. Version number. Add options --update --upgrade to get newest code from `odoo` repo. Add options `--update` `--upgrade`. Either one will get newest code from `odoo` repo. Version number. clear_install_log. Make log entries go to the same log file. Not relative to current directory. Because current directory changes during install process. Improved "--update" code. Add -h --help option. Fix missing sudo chown. Add --delete-start-over * Fix bug, was missing `sudo` in in front of some `chown` commands, this would fail, rather than prompt for password. * Add option `--delete-start-over`, this does full Uninstall, delete `odoo` user and home fdir, then creates `odoo` user as superadmin, and home dir. Just create a password for `odoo` user (command line: `passwd odoo`), and you're ready to test this install script as typical ordinary (non-`root`) user. Fix bug install Enterprise (dir wasn't created) 1. Fix bug install Enterprise (dir wasn't created because of shell command variable did not exist in context!). Now it works. 2. Fix bug wasn't adding enterprise addons path. Fixed now it works. Fix enterprise install bug. Add nginx + LE HTTPS. 1. Fix enterprise install bug (must specify current directory to avoid creating a new dir which puts the code one level too deep). 2. Add NGINX and Lets Encrypt support - not finished yet - command line parsing is not perfect. Detect sudo and show warning. Number steps. Next version should be able to run as non-`sudo` and install as much as possible without failing/exiting. For systems where admin has already installed required packages, maybe on a previous installation. Nginx + LE HTTPS work. Verifies domain exists. Add HTTP/2. Fix Livechat. Runs chat listener process. I fixed Livechat. Previously it wasn't listening on the livechat port. Now it is listening. However this livechat feature appears to not work on 16.04, probably because of this bug: odoo/odoo#20512 Conclusion, Livechat might work for you. It will work on python 3.5 (16.04) only if your version of Odoo has the patch that avoids using the feature of python 3.5 that's broken and causing the http responses to be truncated. Fix parameter checking. Improve run without sudo. Parameter checking is more user friendly now. Run without `sudo` in front of the command. `Sudo` is in the code so `sudo` doesn't need to be on the command line. TODO: finish `virtualenv` + finish install as ordinary user (make sure system packages already installed). FIx a few bigs. * Fix bug causing script to fail on 14.04, must remove debian packages for `python-pypdf2` and `python3-suds` and install only thru `pip3`. * TODO: Move all possible debian `python-` packages to install with `pip3`. This makes installer script much more portable across OS. * Fix `sudo` missing bug on `create_startup_script` in statements `chown` and `mv`. * Add `universe` repository, in function `update-server` because some extremely minimal servers are missing the default `universe` repo. Fix typo. update_repo_in_current_dir updates db. Version. Fix bug (apt add repository universe). * `apt-add-repository` is not a built in command! Must be added to a generic default system. Fixed. Add feature, self-update. * `odoo_install.sh --self-update` downloads the newest version of this script, saving to the same filename as running, even if different from the original scrip filename. Fix self-update bug, download filename. * Even when script filename is changed, must download from the same source filename. Fix many issues. Add 2 features. * Change: move `conf` file location to `/etc/odoo/odoo-server.conf` to make easier management of multiple Odoo instances on one server. * Add command line option `--livechatport=8072` to make possible to install multiple Odoo instances on one server. * Fix many issues mentioned by @Yenthe666 Move python libs from apt to pip. Add option --upgrade-python-libraries * Add option to upgrade to the newest version of python libraries. Many will want to test on these newer library versions, and if they work, run Odoo on these new python library versions, for the many security and bug fixes they offer. Update the Help with --upgrade-python-libraries * Add --upgrade-python-libraries to help. * Improve help entries for other command options. Remove ZSI. It's not a requirement. * TODO: Add option to install exactly the python libs listed in `requirements.txt` Tested OK ubuntu 16.04 lxc/openvz server. * added `htop`, it helps show activity. * added `testresources` it's required by `launchpadlib` (used by `bzr` ?) yet wasn't auto installed. Add 2 python build requirements for minimal 16.04 * Minimal 16.04 appears to miss the build requirements `gcc` and `python3-dev`, needed to install `psutil` thru `pip3`. * Do `apt-get update` to get all package indexes, before the very first `apt-get install`. Necessary when the OS is totally fresh and has never before run `apt-get update`, causing `apt-get install` to fail because no package indexes have been downloaded yet. net-tools for netstat diagnostics. Works on 17.10 * Install on Ubuntu 17.10 Artful (note: `nginx` and `LE TLS cert` on 17.10 wasn't tested yet). * Add package `net-tools` soon to be added feature to display/verify ports in-use by `odoo` and by `nginx`. Fix download_odoo work when dir isnt empty. * `git clone` fails when dir isn't absolutely empty! So, we must remove the directory and all its contents (to be sure all the git dotfiles are gone) so that `git clone` will work under all circumstances. Add LE TLS cert workaround (SNI vulnerability) * TLS SNI has been disabled at Lets Encrypt TLS certificate issuing servers. This is what broke the LE TLS cert feature. Workaround now we use `standalone` mode which has the side effect of turning off `nginx` web server for about 10 seconds while the remote Lets Encrypt issuing servers create the TLS cert. certbot/certbot#5405
- Loading branch information