├── DHCP.conf ├── LICENSE ├── README.md ├── centos.repo ├── developing.sh ├── dind.sh ├── fast.md ├── new_nginx.conf ├── nginx.sh ├── odoo-server ├── odoo.conf ├── odoo.service ├── odoo12_pro.sh ├── odoo14_dev.sh ├── odoo14_dev20.sh ├── odoo15_2204.sh ├── odoo15_pro.sh ├── odoo17_pro.sh ├── odoo_dev.sh ├── odoo_dev_2204.sh ├── odoo_installer.sh ├── odoo_nginx.conf ├── odoo_pro.sh ├── odoo_pro18.sh ├── odoo_pro20.sh ├── odoo_redhat.sh ├── pgdg.list ├── pgdg20.list ├── redhat.sh ├── requirements.txt ├── webmin.list └── zsh-shell.md /DHCP.conf: -------------------------------------------------------------------------------- 1 | auto lo eth0 2 | iface lo inet loopback 3 | iface eth0 inet dhcp 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OdooScript 2 | Odoo dependence installation script for Ubuntu 14.04 , 15.04 ,16.04 ,20.04 , 22.04 ,*24.04(universal) 3 | make your envirument ready for all kind of odoo with pycharm IDE 4 | after run the script u have to download odoo manully 5 | 6 | ssh-keygen -t ed25519 -C "your_email@example.com" 7 | 8 | ### Copy this script and run it on your terminal 9 | 10 | ./odoo-bin -w a -s -c ../odoo.conf --stop-after-init 11 | 12 | ./odoo-bin -w a -s -c /etc/odoo/odoo.conf --stop-after-init 13 | 14 | export LC_ALL="en_US.UTF-8"
15 | export LC_CTYPE="en_US.UTF-8"
16 | sudo dpkg-reconfigure locales
17 | 18 | ########################################################################
19 | adduser odoo 20 | 21 | ########################################################################
22 | 23 | apt-get update
24 | apt-get install software-properties-common
25 | add-apt-repository ppa:certbot/certbot
26 | apt-get update
27 | apt-get install python-certbot-apache
28 | sudo certbot --apache
29 | #######################################################################
30 | 31 | wget https://raw.githubusercontent.com/mah007/OdooScript/12.0/nginx.sh
32 | bash nginx.sh
33 | 34 | apt-get update
35 | apt-get install software-properties-common -y
36 | add-apt-repository universe
37 | add-apt-repository ppa:certbot/certbot
38 | apt-get update
39 | apt-get install certbot python-certbot-nginx -y
40 | 41 | sudo certbot --nginx
42 | 43 | 44 | 45 | #######################################################################
46 | 47 | nano /etc/apt/sources.list.d/pgdg.list
48 | deb deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
49 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
50 | 51 | sudo apt-get update
52 | 53 | ########################################################################
54 | 55 | sudo su - postgres -c "createuser -s odoo" 2> /dev/null || true
56 | wget https://raw.githubusercontent.com/mah007/OdooScript/master/odoo_pro.sh
57 | sudo /bin/sh odoo_pro.sh
58 | 59 | # 60 | 61 | wget http://software.virtualmin.com/gpl/scripts/install.sh
62 | sh /root/install.sh -b LEMP
63 | 64 | ********************PG UTF*********************
65 | 66 | sudo su postgres
67 | psql
68 | update pg_database set datistemplate=false where datname='template1';
69 | drop database Template1;
70 | create database template1 with owner=postgres encoding='UTF-8'
71 | lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
72 | update pg_database set datistemplate=true where datname='template1';
73 | -------------------------------------------------------------------------------- /centos.repo: -------------------------------------------------------------------------------- 1 | [baseos] 2 | name=CentOS Stream $releasever - BaseOS 3 | mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=BaseOS&infra=$infra 4 | baseurl=https://vault.centos.org/centos/8/BaseOS/x86_64/os/ 5 | #baseurl=http://mirror.centos.org/$contentdir/$stream/BaseOS/$basearch/os/ 6 | gpgcheck=0 7 | enabled=1 8 | #gpgkey=/etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial 9 | gpgkey=https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL 10 | 11 | [appstream] 12 | name=CentOS Stream $releasever - AppStream 13 | mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=AppStream&infra=$infra 14 | #baseurl=http://mirror.centos.org/$contentdir/$stream/AppStream/$basearch/os/ 15 | baseurl=https://vault.centos.org/centos/8/AppStream/x86_64/os/ 16 | gpgcheck=0 17 | enabled=1 18 | #gpgkey=/etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial 19 | gpgkey=https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL 20 | #/etc/yum.repos.d/centos.repo 21 | -------------------------------------------------------------------------------- /developing.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # to run the script "sudo /bin/sh odoo_pro.sh" 3 | ################################################################################ 4 | # Script for preparing Odoo production server platform on Ubuntu 14.04, 15.04 and 16.04 (could be used for other version too) 5 | # Author: Mahmoud Abdel Latif 6 | # Mobile No: +201002688172 7 | # Email: Mah008@me.com 8 | # Website: http://www.mah007.com 9 | #------------------------------------------------------------------------------- 10 | # This script will make ur server ready for installing ODOO from 8 to 11 11 | #------------------------------------------------------------------------------- 12 | # Make a new file: 13 | # sudo nano odoo_pro.sh 14 | # Place this content in it and then make the file executable: 15 | # sudo chmod +x odoo_pro.sh 16 | # git clone --depth 1 --branch 10.0 https://www.gitlab.com/mah007/odoo . 17 | # Execute the script to install Odoo: 18 | # ./odoo-developing 19 | ################################################################################ 20 | 21 | ##fixed parameters 22 | #instead of odoo use ur user name .EG OE_USER="mahmoud" 23 | OE_USER="mahmoud" 24 | #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) 25 | #Set to true if you want to install it, false if you don't need it or have it already installed. 26 | INSTALL_WKHTMLTOPDF="True" 27 | 28 | # Set this to True if you want to install Odoo 9 10 11 Enterprise! ( you can use enterprise normaly too ;) ) 29 | IS_ENTERPRISE="True" 30 | 31 | ## 32 | ### WKHTMLTOPDF download links 33 | ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, 34 | ## in order to have correct version of wkhtmltox installed, for a danger note refer to 35 | ## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): 36 | WKHTMLTOX_X64=https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb 37 | WKHTMLTOX_X32=https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.bionic_i386.deb 38 | #-------------------------------------------------- 39 | # Update Server 40 | #-------------------------------------------------- 41 | echo -e "\n---- Update Server ----" 42 | sudo apt-get update 43 | sudo apt-get upgrade -y 44 | apt install -y zip 45 | echo "----------------------------localization-------------------------------" 46 | 47 | export LC_ALL="en_US.UTF-8" 48 | export LC_CTYPE="en_US.UTF-8" 49 | sudo dpkg-reconfigure locales 50 | 51 | #-------------------------------------------------- 52 | # Install PostgreSQL Server 53 | #-------------------------------------------------- 54 | wget https://raw.githubusercontent.com/mah007/OdooScript/12.0/pgdg.list 55 | cp pgdg.list /etc/apt/sources.list.d 56 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 57 | sudo apt-get update 58 | 59 | echo -e "\n---- Install PostgreSQL Server ----" 60 | sudo apt-get install postgresql-12 postgresql-server-dev-12 -y 61 | 62 | echo -e "\n---- Creating the ODOO PostgreSQL User ----" 63 | sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true 64 | 65 | #-------------------------------------------------- 66 | # Install Dependencies 67 | #-------------------------------------------------- 68 | echo -e "\n---- Install tool packages ----" 69 | sudo apt-get install wget nano subversion git bzr bzrtools python-pip python3-pip gdebi-core -y pysassc 70 | 71 | echo -e "\n---- Install python packages ----" 72 | sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil python-gpgme python-launchpadlib build-essential python-all-dev python-setuptools python-imaging python-suds python-xlsxwriter python-wheel -y 73 | 74 | echo -e "\n---- Install python libraries ----" 75 | sudo pip install gdata psycogreen 76 | # This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04 77 | sudo -H pip install suds 78 | 79 | echo -e "\n--- Install other required packages" 80 | sudo apt-get install node-clean-css -y 81 | sudo apt-get install node-less -y 82 | sudo apt-get install python-gevent -y 83 | apt-get install libwww-perl -y 84 | #sudo apt install ifupdown -y 85 | 86 | 87 | #-------------------------------------------------- 88 | # Install Wkhtmltopdf if needed 89 | #-------------------------------------------------- 90 | if [ $INSTALL_WKHTMLTOPDF = "True" ]; then 91 | echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 9 ----" 92 | #pick up correct one from x64 & x32 versions: 93 | if [ "`getconf LONG_BIT`" == "64" ];then 94 | _url=$WKHTMLTOX_X64 95 | else 96 | _url=$WKHTMLTOX_X32 97 | fi 98 | sudo wget $_url 99 | sudo gdebi --n `basename $_url` 100 | sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin 101 | sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin 102 | else 103 | echo "Wkhtmltopdf isn't installed due to the choice of the user!" 104 | fi 105 | 106 | 107 | 108 | 109 | if [ $IS_ENTERPRISE = "True" ]; then 110 | # Odoo Enterprise install! 111 | 112 | echo -e "\n---- Installing Enterprise specific libraries ----" 113 | sudo apt-get install nodejs npm -y 114 | sudo npm install -g less 115 | sudo npm install -g less-plugin-clean-css 116 | sudo npm install -g rtlcss 117 | else 118 | echo -e "\n---- every thing is ready ----" 119 | 120 | fi 121 | sudo ln -s /usr/bin/nodejs /usr/bin/node 122 | 123 | sudo apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev python3-dev 124 | sudo easy_install greenlet 125 | sudo easy_install gevent 126 | sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip python3-wheel python3-setuptools 127 | sudo -H pip install -r https://raw.githubusercontent.com/odoo/odoo/10.0/requirements.txt 128 | sudo apt install -y python3-asn1crypto 129 | sudo apt install -y python3-babel python3-bs4 python3-cffi-backend python3-cryptography python3-dateutil python3-docutils python3-feedparser python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-html5lib python3-jinja2 python3-lxml python3-mako python3-markupsafe python3-mock python3-ofxparse python3-openssl python3-passlib python3-pbr python3-pil python3-psutil python3-psycopg2 python3-pydot python3-pygments python3-pyparsing python3-pypdf2 python3-renderpm python3-reportlab python3-reportlab-accel python3-roman python3-serial python3-stdnum python3-suds python3-tz python3-usb python3-vatnumber python3-werkzeug python3-xlsxwriter python3-yaml 130 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/11.0/requirements.txt 131 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/12.0/requirements.txt 132 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/13.0/requirements.txt 133 | sudo -H pip3 install -r https://raw.githubusercontent.com/it-projects-llc/odoo-saas-tools/12.0/requirements.txt 134 | sudo -H pip3 install phonenumbers 135 | echo "---------------------------odoo directory--------------------------------" 136 | #mkdir /odoo 137 | #mkdir /etc/odoo 138 | #mkdir /var/log/odoo 139 | #touch /etc/odoo/odoo.conf 140 | #touch /var/log/odoo/odoo-server.log 141 | #chown odoo:odoo /var/log/odoo/odoo-server.log 142 | #chown odoo:odoo /etc/odoo/odoo.conf 143 | #chown -R odoo:odoo /odoo 144 | echo "-------------------------------odoo service----------------------------" 145 | #wget https://raw.githubusercontent.com/mah007/OdooScript/12.0/odoo.service 146 | #cp odoo.service /etc/systemd/system 147 | #sudo systemctl daemon-reload 148 | #sudo systemctl enable odoo 149 | #sudo systemctl start odoo 150 | #echo "----------------------------NGINX-------------------------------" 151 | #wget https://raw.githubusercontent.com/mah007/OdooScript/12.0/nginx.sh 152 | #bash nginx.sh 153 | echo "---------------------------webmin--------------------------------" 154 | #apt-get install -y perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python 155 | #wget http://prdownloads.sourceforge.net/webadmin/webmin_1.930_all.deb 156 | #sudo gdebi webmin_1.930_all.deb 157 | sudo apt install snapd -y 158 | 159 | echo "-----------------------------------------------------------" 160 | echo "Done! The Odoo production platform is ready:" 161 | 162 | echo "Restart restart ur computer and start developing and have fun ;)" 163 | echo "-----------------------------------------------------------" 164 | -------------------------------------------------------------------------------- /fast.md: -------------------------------------------------------------------------------- 1 | 2 | mkdir /etc/odoo 3 | 4 | mkdir /var/log/odoo 5 | 6 | touch /etc/odoo/odoo11.conf 7 | 8 | touch /etc/odoo/odoo12.conf 9 | 10 | touch /var/log/odoo/odoo11-server.log 11 | 12 | touch /var/log/odoo/odoo12-server.log 13 | 14 | chown odoo11:odoo11 /var/log/odoo/odoo11-server.log 15 | 16 | chown odoo12:odoo12 /var/log/odoo/odoo12-server.log 17 | 18 | chown odoo12:odoo12 /etc/odoo/odoo12.conf 19 | 20 | chown odoo11:odoo11 /etc/odoo/odoo11.conf 21 | 22 | --------------------------------------------- 23 | 24 | touch /etc/odoo/odoo.conf 25 | 26 | touch /var/log/odoo/odoo-server.log 27 | 28 | 29 | chown odoo:odoo /var/log/odoo/odoo-server.log 30 | 31 | chown odoo:odoo /etc/odoo/odoo.conf 32 | 33 | 34 | sudo nano /etc/systemd/system/odoo.service 35 | 36 | sudo systemctl daemon-reload 37 | 38 | sudo systemctl enable odoo 39 | 40 | sudo systemctl start odoo 41 | 42 | --------------------------------------------------- 43 | 44 | RewriteCond %{HTTP_HOST} =www.mah007.com 45 | 46 | RewriteRule ^(.*) https://mah007.com/ [R] 47 | 48 | RewriteCond %{SERVER_NAME} =mah007.com [OR] 49 | 50 | RewriteCond %{SERVER_NAME} =webmail.mah007.com [OR] 51 | 52 | RewriteCond %{SERVER_NAME} =admin.mah007.com [OR] 53 | 54 | RewriteCond %{SERVER_NAME} =www.mah007.com 55 | 56 | RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] 57 | -------------------------------------------------------------------------------- /new_nginx.conf: -------------------------------------------------------------------------------- 1 | #odoo server 2 | upstream odoo { 3 | server 127.0.0.1:8069; 4 | } 5 | upstream odoochat { 6 | server 127.0.0.1:8072; 7 | } 8 | map $http_upgrade $connection_upgrade { 9 | default upgrade; 10 | '' close; 11 | } 12 | 13 | # http -> https 14 | server { 15 | listen 80; 16 | server_name odoo.mycompany.com; 17 | rewrite ^(.*) https://$host$1 permanent; 18 | } 19 | 20 | server { 21 | listen 443 ssl; 22 | server_name odoo.mycompany.com; 23 | proxy_read_timeout 720s; 24 | proxy_connect_timeout 720s; 25 | proxy_send_timeout 720s; 26 | client_max_body_size 1G; 27 | 28 | # SSL parameters 29 | ssl_certificate /etc/ssl/nginx/server.crt; 30 | ssl_certificate_key /etc/ssl/nginx/server.key; 31 | ssl_session_timeout 30m; 32 | ssl_protocols TLSv1.2; 33 | ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; 34 | ssl_prefer_server_ciphers off; 35 | 36 | # log 37 | access_log /var/log/nginx/odoo.access.log; 38 | error_log /var/log/nginx/odoo.error.log; 39 | 40 | # Redirect websocket requests to odoo gevent port 41 | location /websocket { 42 | proxy_pass http://odoochat; 43 | proxy_set_header Upgrade $http_upgrade; 44 | proxy_set_header Connection $connection_upgrade; 45 | proxy_set_header X-Forwarded-Host $http_host; 46 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 47 | proxy_set_header X-Forwarded-Proto $scheme; 48 | proxy_set_header X-Real-IP $remote_addr; 49 | 50 | add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; 51 | proxy_cookie_flags session_id samesite=lax secure; # requires nginx 1.19.8 52 | } 53 | 54 | # Redirect requests to odoo backend server 55 | location / { 56 | # Add Headers for odoo proxy mode 57 | proxy_set_header X-Forwarded-Host $http_host; 58 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 59 | proxy_set_header X-Forwarded-Proto $scheme; 60 | proxy_set_header X-Real-IP $remote_addr; 61 | proxy_redirect off; 62 | proxy_pass http://odoo; 63 | 64 | add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; 65 | proxy_cookie_flags session_id samesite=lax secure; # requires nginx 1.19.8 66 | } 67 | 68 | # common gzip 69 | gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript; 70 | gzip on; 71 | } 72 | -------------------------------------------------------------------------------- /nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo apt-get install nginx -y 3 | IPADR=`ifconfig eth0 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'` 4 | nginx_file=/etc/nginx/sites-available/odoo.conf 5 | sudo su root -c "echo 'upstream odoo { 6 | server 127.0.0.1:8069 weight=1 fail_timeout=300s; 7 | } 8 | upstream odoo-im { 9 | server 127.0.0.1:8072 weight=1 fail_timeout=300s; 10 | } 11 | '" >> $nginx_file 12 | echo """server { 13 | # server port and name 14 | listen 80; 15 | server_name 0.0.0.0; 16 | """ >> $nginx_file 17 | echo ' 18 | # Specifies the maximum accepted body size of a client request, 19 | # as indicated by the request header Content-Length. 20 | client_max_body_size 200m; 21 | #log files 22 | access_log /var/log/nginx/odoo-access.log; 23 | error_log /var/log/nginx/odoo-error.log; 24 | 25 | proxy_connect_timeout 600; 26 | proxy_send_timeout 600; 27 | proxy_read_timeout 600; 28 | send_timeout 600; 29 | keepalive_timeout 600; 30 | 31 | gzip on; 32 | gzip_disable "msie6"; 33 | gzip_vary on; 34 | gzip_proxied any; 35 | gzip_comp_level 6; 36 | gzip_buffers 16 8k; 37 | gzip_http_version 1.1; 38 | gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss application/rss+xml text/javascript image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype image/bmp image/png image/gif image/jpeg image/jpg; 39 | 40 | # increase proxy buffer to handle some OpenERP web requests 41 | proxy_buffers 16 64k; 42 | proxy_buffer_size 128k; 43 | location / { 44 | proxy_pass http://odoo; 45 | # force timeouts if the backend dies 46 | proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; 47 | # Add Headers for odoo proxy mode 48 | # set headers 49 | proxy_set_header X-Forwarded-Host $host; 50 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 51 | proxy_set_header X-Forwarded-Proto $scheme; 52 | proxy_set_header X-Real-IP $remote_addr; 53 | # by default, do not forward anything 54 | proxy_redirect off; 55 | } 56 | location /longpolling { 57 | proxy_pass http://odoo-im; 58 | proxy_set_header Host $host; 59 | proxy_set_header X-Real-IP $remote_addr; 60 | proxy_set_header X-Forwarded-For $http_host; 61 | } 62 | # cache some static data in memory for 60mins. 63 | # under heavy load this should relieve stress on the web interface a bit. 64 | location ~* /web/static/ { 65 | proxy_cache_valid 200 60m; 66 | proxy_buffering on; 67 | expires 864000; 68 | proxy_pass http://odoo; 69 | } 70 | }' >> $nginx_file 71 | sudo ln -s $nginx_file /etc/nginx/sites-enabled/ 72 | sudo service nginx restart 73 | echo 'Dear Admin, We are ready for takeoff. Just Open http://'$IPADR 74 | -------------------------------------------------------------------------------- /odoo-server: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ### BEGIN INIT INFO 3 | # Provides: odoo-server 4 | # Required-Start: $remote_fs $syslog 5 | # Required-Stop: $remote_fs $syslog 6 | # Should-Start: $network 7 | # Should-Stop: $network 8 | # Default-Start: 2 3 4 5 9 | # Default-Stop: 0 1 6 10 | # 11 | ### END INIT INFO 12 | PATH=/bin:/sbin:/usr/bin 13 | NAME=odoo-server 14 | DESC=ODOO-SERVER 15 | # Specify the daemon path for Odoo server. 16 | # (Default for ODOO >=10: /opt/odoo/odoo-bin) 17 | # (Default for ODOO <=9: /opt/odoo/openerp-server) 18 | DAEMON=/opt/odoo/odoo-bin 19 | CONFIGFILE="/etc/odoo-server.conf" # Specify the Odoo Configuration file path. 20 | 21 | USER=odoo # Specify the user name (Default: odoo). 22 | 23 | PIDFILE=/var/run/$NAME.pid # pidfile 24 | 25 | # Additional options that are passed to the Daemon. 26 | DAEMON_ARGS="-c $CONFIGFILE" 27 | 28 | display() { 29 | RED=$(tput setaf 1) 30 | GREEN=$(tput setaf 2) 31 | NORMAL=$(tput sgr0) 32 | col=$(tput cols) 33 | case "$#" in 34 | 1) 35 | if [ $1 -eq 0 ] ; then 36 | printf '%s%*s%s' "$GREEN" $col "[ OK ] " "$NORMAL" 37 | else 38 | printf '%s%*s%s' "$RED" $col "[FAIL] " "$NORMAL" 39 | fi 40 | ;; 41 | 2) 42 | if [ $1 -eq 0 ] ; then 43 | echo "$GREEN* $2$NORMAL" 44 | else 45 | echo "$RED* $2$NORMAL" 46 | fi 47 | ;; 48 | *) 49 | echo "Invalid arguments" 50 | exit 1 51 | ;; 52 | esac 53 | } 54 | 55 | if ! [ -x $DAEMON ] ; then 56 | echo "Error in ODOO Daemon file: $DAEMON" 57 | echo "Possible error(s):" 58 | display 1 "Daemon File doesn't exists." 59 | display 1 "Daemon File is not set to executable." 60 | exit 0; 61 | fi 62 | if ! [ -r $CONFIGFILE ] ; then 63 | echo "Error in ODOO Config file: $CONFIGFILE" 64 | echo "Possible error(s):" 65 | display 1 "Config File doesn't exists." 66 | display 1 "Config File is not set to readable." 67 | exit 0; 68 | fi 69 | if ! [ -w $PIDFILE ] ; then 70 | touch $PIDFILE || echo "Permission issue: $PIDFILE" && exit 1 71 | chown $USER: $PIDFILE 72 | fi 73 | 74 | # Function that starts the daemon/service 75 | do_start() { 76 | echo $1 77 | check_status 78 | procs=$? 79 | if [ $procs -eq 0 ] ; then 80 | start-stop-daemon --start --quiet --pidfile ${PIDFILE} \ 81 | --chuid ${USER} --background --make-pidfile \ 82 | --exec ${DAEMON} -- ${DAEMON_ARGS} 83 | return $? 84 | else 85 | detailed_info "${DESC} is already Running !!!" $procs 86 | exit 1 87 | fi 88 | } 89 | 90 | # Function that stops the daemon/service 91 | do_stop() { 92 | echo $1 93 | check_status 94 | if [ $? -ne 0 ] ; then 95 | start-stop-daemon --stop --quiet --pidfile ${PIDFILE} 96 | return $? 97 | else 98 | display 0 "${DESC} is already Stopped. You may try: $0 force-restart" 99 | exit 1 100 | fi 101 | } 102 | 103 | get_pids(){ 104 | pids=$(ps -Ao pid,cmd | grep $DAEMON | grep -v grep | awk '{print $1}') 105 | return $pids 106 | } 107 | 108 | # Function that checks the status of daemon/service 109 | check_status() { 110 | echo $1 111 | # start-stop-daemon --status --pidfile ${PIDFILE} 112 | status=$(ps -Ao pid,cmd | grep $DAEMON | grep -v grep | awk '{print $1}' | wc -l) 113 | return $status 114 | } 115 | 116 | # Function that forcely-stops all running daemon/service 117 | force_stop() { 118 | echo $1 119 | pids=$(ps -Ao pid,cmd | grep $DAEMON | grep -v grep | awk '{print $1}') 120 | if [ ! -z "$pids" ] ; then 121 | kill -9 $pids 122 | fi 123 | return $? 124 | } 125 | 126 | detailed_info() { 127 | procs=$2 128 | if [ $procs -eq 1 ] ; then 129 | display 0 "$1" 130 | echo "FINE, ${procs} ${DESC} is Running." 131 | echo "Details :" 132 | pid=`cat $PIDFILE` 133 | echo "Start Time : $(ps -p $pid -wo lstart=)" 134 | echo "Total UpTime: $(ps -p $pid -wo etime=)" 135 | echo "Process ID : ${pid}" 136 | echo "" 137 | else 138 | display 1 "WARNING !!!" 139 | display 1 "${procs} ${DESC}s are Running !!!" 140 | pids=$(ps -Ao pid,cmd | grep $DAEMON | grep -v grep | awk '{print $1}') 141 | echo "Details :" 142 | echo -n "Process IDs : " 143 | echo $pids 144 | # echo $pids | tr ' ' , 145 | echo "In order to fix, Hit command: $0 force-restart" 146 | echo "" 147 | fi 148 | } 149 | case "$1" in 150 | start) 151 | do_start "Starting ${DESC} " 152 | display $? 153 | ;; 154 | stop) 155 | do_stop "Stopping ${DESC} " 156 | display $? 157 | ;; 158 | status) 159 | check_status "Current Status of ${DESC}:" 160 | procs=$? 161 | if [ $procs -eq 1 ] ; then 162 | detailed_info "RUNNING" $procs 163 | elif [ $procs -eq 0 ] ; then 164 | display 1 "STOPPED" 165 | else 166 | detailed_info "" $procs 167 | fi 168 | ;; 169 | restart|reload) 170 | do_stop "Stopping ${DESC} " 171 | display $? 172 | sleep 1 173 | do_start "Starting ${DESC} " 174 | display $? 175 | ;; 176 | force-restart) 177 | force_stop "Forcely Restarting ${DESC} " 178 | sleep 1 179 | do_start "Starting ${DESC} " 180 | display $? 181 | ;; 182 | force-stop) 183 | force_stop "Forcely Stopping all running ${DESC} " 184 | display $? 185 | ;; 186 | cs) 187 | ps -Ao pid,cmd | grep $DAEMON | grep -v grep | awk '{print $1}' | wc -l 188 | ;; 189 | *) 190 | display 1 "Usage: $0 {start|stop|restart/reload|status|force-restart|force-stop}" 191 | exit 1 192 | ;; 193 | esac 194 | 195 | exit 0 196 | -------------------------------------------------------------------------------- /odoo.conf: -------------------------------------------------------------------------------- 1 | [options] 2 | addons_path = /odoo/odoo/addons,/odoo/enterprise 3 | ;admin_passwd = admin 4 | csv_internal_sep = , 5 | data_dir = /home/odoo/.local/share/Odoo 6 | db_host = False 7 | db_maxconn = 64 8 | db_name = False 9 | db_password = False 10 | db_port = False 11 | db_sslmode = prefer 12 | db_template = template1 13 | db_user = odoo 14 | dbfilter = ^%h$ 15 | demo = {} 16 | email_from = False 17 | geoip_database = /usr/share/GeoIP/GeoLiteCity.dat 18 | http_enable = True 19 | http_interface = 20 | http_port = 8069 21 | import_partial = 22 | limit_memory_hard = 23 | limit_memory_soft = 24 | limit_request = 8192 25 | limit_time_cpu = 60 26 | limit_time_real = 120 27 | limit_time_real_cron = -1 28 | list_db = True 29 | log_db = False 30 | log_db_level = warning 31 | log_handler = :INFO 32 | log_level = info 33 | logfile = /var/log/odoo/odoo-server.log 34 | logrotate = False 35 | longpolling_port = 8072 36 | max_cron_threads = 2 37 | osv_memory_age_limit = 1.0 38 | osv_memory_count_limit = False 39 | pg_path = None 40 | pidfile = False 41 | proxy_mode = True 42 | reportgz = False 43 | server_wide_modules = web 44 | smtp_password = False 45 | smtp_port = 25 46 | smtp_server = localhost 47 | smtp_ssl = False 48 | smtp_user = False 49 | syslog = False 50 | test_commit = False 51 | test_enable = False 52 | test_file = False 53 | test_report_directory = False 54 | translate_modules = ['all'] 55 | unaccent = False 56 | without_demo = False 57 | workers = 25 58 | -------------------------------------------------------------------------------- /odoo.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Odoo Open Source ERP and CRM 3 | After=network.target 4 | 5 | [Service] 6 | Type=simple 7 | User=odoo 8 | Group=odoo 9 | ExecStart=/odoo/odoo/odoo-bin --config /etc/odoo/odoo.conf --logfile /var/log/odoo/odoo-server.log 10 | KillMode=mixed 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /odoo12_pro.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # to run the script "sudo /bin/sh odoo_pro.sh" 3 | ################################################################################ 4 | # Script for preparing Odoo production server platform on Ubuntu 18.04 bionic (could be used for other version too) 5 | # Author: Mahmoud Abdel Latif 6 | # Mobile No: +201002688172 7 | # Email: Mah008@me.com 8 | # Website: http://www.mah007.com 9 | #------------------------------------------------------------------------------- 10 | # This script will make ur server ready for installing ODOO from 8 to 11 11 | #------------------------------------------------------------------------------- 12 | # Make a new file: 13 | # sudo nano odoo_pro.sh 14 | # Place this content in it and then make the file executable: 15 | # sudo chmod +x odoo_pro.sh 16 | # git clone --depth 1 --branch 10.0 https://www.gitlab.com/mah007/odoo . 17 | # Execute the script to install Odoo: 18 | # ./odoo-developing 19 | ################################################################################ 20 | 21 | ##fixed parameters 22 | #instead of odoo use ur user name .EG OE_USER="mahmoud" 23 | OE_USER="odoo" 24 | #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) 25 | #Set to true if you want to install it, false if you don't need it or have it already installed. 26 | INSTALL_WKHTMLTOPDF="True" 27 | 28 | # Set this to True if you want to install Odoo 9 10 11 Enterprise! ( you can use enterprise normaly too ;) ) 29 | IS_ENTERPRISE="True" 30 | 31 | ## 32 | ### WKHTMLTOPDF download links 33 | ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, 34 | ## in order to have correct version of wkhtmltox installed, for a danger note refer to 35 | ## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): 36 | WKHTMLTOX_X64=https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb 37 | WKHTMLTOX_X32=https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.bionic_i386.deb 38 | #-------------------------------------------------- 39 | # Update Server 40 | #-------------------------------------------------- 41 | echo -e "\n---- Update Server ----" 42 | sudo apt-get update 43 | sudo apt-get upgrade -y 44 | 45 | #-------------------------------------------------- 46 | # Install PostgreSQL Server 47 | #-------------------------------------------------- 48 | echo -e "\n---- Install PostgreSQL Server ----" 49 | sudo apt-get install postgresql postgresql-server-dev-* -y 50 | 51 | echo -e "\n---- Creating the ODOO PostgreSQL User ----" 52 | sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true 53 | 54 | #-------------------------------------------------- 55 | # Install Dependencies 56 | #-------------------------------------------------- 57 | echo -e "\n---- Install tool packages ----" 58 | sudo apt-get install wget nano subversion git bzr bzrtools python-pip python3-pip gdebi-core -y pysassc 59 | 60 | echo -e "\n---- Install python packages ----" 61 | sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil python-gpgme python-launchpadlib build-essential python-all-dev python-setuptools python-imaging python-suds python-xlsxwriter python-wheel -y 62 | 63 | echo -e "\n---- Install python libraries ----" 64 | sudo pip install gdata psycogreen 65 | # This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04 66 | sudo -H pip install suds 67 | 68 | echo -e "\n--- Install other required packages" 69 | sudo apt-get install node-clean-css -y 70 | sudo apt-get install node-less -y 71 | sudo apt-get install python-gevent -y 72 | apt-get install libwww-perl -y 73 | 74 | 75 | #-------------------------------------------------- 76 | # Install Wkhtmltopdf if needed 77 | #-------------------------------------------------- 78 | if [ $INSTALL_WKHTMLTOPDF = "True" ]; then 79 | echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 9 ----" 80 | #pick up correct one from x64 & x32 versions: 81 | if [ "`getconf LONG_BIT`" == "64" ];then 82 | _url=$WKHTMLTOX_X64 83 | else 84 | _url=$WKHTMLTOX_X32 85 | fi 86 | sudo wget $_url 87 | sudo gdebi --n `basename $_url` 88 | sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin 89 | sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin 90 | else 91 | echo "Wkhtmltopdf isn't installed due to the choice of the user!" 92 | fi 93 | 94 | 95 | 96 | 97 | if [ $IS_ENTERPRISE = "True" ]; then 98 | # Odoo Enterprise install! 99 | 100 | echo -e "\n---- Installing Enterprise specific libraries ----" 101 | sudo apt-get install nodejs npm -y 102 | sudo npm install -g less 103 | sudo npm install -g less-plugin-clean-css 104 | sudo npm install -g rtlcss 105 | else 106 | echo -e "\n---- every thing is ready ----" 107 | 108 | fi 109 | sudo ln -s /usr/bin/nodejs /usr/bin/node 110 | 111 | sudo apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev python3-dev 112 | sudo easy_install greenlet 113 | sudo easy_install gevent 114 | sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip python3-wheel python3-setuptools 115 | sudo -H pip install -r https://raw.githubusercontent.com/odoo/odoo/11.0/requirements.txt 116 | sudo apt install -y python3-asn1crypto 117 | sudo apt install -y python3-babel python3-bs4 python3-cffi-backend python3-cryptography python3-dateutil python3-docutils python3-feedparser python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-html5lib python3-jinja2 python3-lxml python3-mako python3-markupsafe python3-mock python3-ofxparse python3-openssl python3-passlib python3-pbr python3-pil python3-psutil python3-psycopg2 python3-pydot python3-pygments python3-pyparsing python3-pypdf2 python3-renderpm python3-reportlab python3-reportlab-accel python3-roman python3-serial python3-stdnum python3-suds python3-tz python3-usb python3-vatnumber python3-werkzeug python3-xlsxwriter python3-yaml 118 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/12.0/requirements.txt 119 | sudo -H pip3 install phonenumbers 120 | 121 | 122 | echo "-----------------------------------------------------------" 123 | echo "Done! The Odoo production platform is ready:" 124 | 125 | echo "Restart restart ur computer and start developing and have fun ;)" 126 | echo "-----------------------------------------------------------" 127 | -------------------------------------------------------------------------------- /odoo14_dev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # to run the script "sudo /bin/sh odoo_pro.sh" 3 | ################################################################################ 4 | # Script for preparing Odoo production server platform on Ubuntu 14.04, 15.04 and 16.04 (could be used for other version too) 5 | # Author: Mahmoud Abdel Latif 6 | # Mobile No: +201002688172 7 | # Email: Mah008@me.com 8 | # Website: http://www.mah007.com 9 | #------------------------------------------------------------------------------- 10 | # This script will make ur server ready for installing ODOO from 8 to 14 11 | #------------------------------------------------------------------------------- 12 | # Make a new file: 13 | # sudo nano odoo_pro.sh 14 | # Place this content in it and then make the file executable: 15 | # sudo chmod +x odoo_pro.sh 16 | # git clone --depth 1 --branch 10.0 https://www.gitlab.com/mah007/odoo . 17 | # Execute the script to install Odoo: 18 | # ./odoo-developing 19 | ################################################################################ 20 | 21 | ##fixed parameters 22 | #instead of odoo use ur user name .EG OE_USER="mahmoud" 23 | OE_USER="odoo" 24 | OE_BRANCH="14.0" 25 | #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) 26 | #Set to true if you want to install it, false if you don't need it or have it already installed. 27 | INSTALL_WKHTMLTOPDF="True" 28 | 29 | # Set this to True if you want to install Odoo 9 10 11 12 13 14Enterprise! ( you can use enterprise normaly too ;) ) 30 | IS_ENTERPRISE="True" 31 | 32 | ## 33 | ### WKHTMLTOPDF download links 34 | ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, 35 | ## in order to have correct version of wkhtmltox installed, for a danger note refer to 36 | ## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): 37 | WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb 38 | WKHTMLTOX_X32=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_i386.deb 39 | #-------------------------------------------------- 40 | # Update Server 41 | #-------------------------------------------------- 42 | echo -e "\n---- Update Server ----" 43 | sudo apt-get update 44 | sudo apt-get upgrade -y 45 | apt install -y zip 46 | echo "----------------------------localization-------------------------------" 47 | 48 | export LC_ALL="en_US.UTF-8" 49 | export LC_CTYPE="en_US.UTF-8" 50 | sudo dpkg-reconfigure locales 51 | 52 | #-------------------------------------------------- 53 | # Install PostgreSQL Server 54 | #-------------------------------------------------- 55 | wget https://raw.githubusercontent.com/mah007/OdooScript/12.0/pgdg.list 56 | wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/webmin.list 57 | cp pgdg.list /etc/apt/sources.list.d 58 | cp webmin.list /etc/apt/sources.list.d 59 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 60 | sudo apt-get update 61 | 62 | echo -e "\n---- Install PostgreSQL Server ----" 63 | sudo apt-get install postgresql-13 postgresql-server-dev-13 -y 64 | 65 | echo -e "\n---- Creating the ODOO PostgreSQL User ----" 66 | sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true 67 | 68 | #-------------------------------------------------- 69 | # Install Dependencies 70 | #-------------------------------------------------- 71 | echo -e "\n---- Install tool packages ----" 72 | sudo apt-get install wget nano subversion git bzr bzrtools python-pip python3-pip gdebi-core -y pysassc 73 | 74 | echo -e "\n---- Install python packages ----" 75 | sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil python-gpgme python-launchpadlib build-essential python-all-dev python-setuptools python-imaging python-suds python-xlsxwriter python-wheel -y 76 | 77 | echo -e "\n---- Install python libraries ----" 78 | sudo pip install gdata psycogreen 79 | # This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04 80 | sudo -H pip install suds 81 | 82 | echo -e "\n--- Install other required packages" 83 | sudo apt-get install node-clean-css -y 84 | sudo apt-get install node-less -y 85 | sudo apt-get install python-gevent -y 86 | apt-get install libwww-perl -y 87 | #sudo apt install ifupdown -y 88 | 89 | 90 | #-------------------------------------------------- 91 | # Install Wkhtmltopdf if needed 92 | #-------------------------------------------------- 93 | if [ $INSTALL_WKHTMLTOPDF = "True" ]; then 94 | echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 9 ----" 95 | #pick up correct one from x64 & x32 versions: 96 | if [ "`getconf LONG_BIT`" == "64" ];then 97 | _url=$WKHTMLTOX_X64 98 | else 99 | _url=$WKHTMLTOX_X32 100 | fi 101 | sudo wget $_url 102 | sudo gdebi --n `basename $_url` 103 | sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin 104 | sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin 105 | else 106 | echo "Wkhtmltopdf isn't installed due to the choice of the user!" 107 | fi 108 | 109 | 110 | 111 | 112 | if [ $IS_ENTERPRISE = "True" ]; then 113 | # Odoo Enterprise install! 114 | 115 | echo -e "\n---- Installing Enterprise specific libraries ----" 116 | sudo apt-get install nodejs npm -y 117 | sudo npm install -g less 118 | sudo npm install -g less-plugin-clean-css 119 | sudo npm install -g rtlcss 120 | else 121 | echo -e "\n---- every thing is ready ----" 122 | 123 | fi 124 | sudo ln -s /usr/bin/nodejs /usr/bin/node 125 | 126 | sudo apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev python3-dev 127 | sudo easy_install greenlet 128 | sudo easy_install gevent 129 | sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip python3-wheel python3-setuptools 130 | sudo -H pip install -r https://raw.githubusercontent.com/odoo/odoo/10.0/requirements.txt 131 | sudo apt install -y python3-asn1crypto 132 | sudo apt install -y python3-babel python3-bs4 python3-cffi-backend python3-cryptography python3-dateutil python3-docutils python3-feedparser python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-html5lib python3-jinja2 python3-lxml python3-mako python3-markupsafe python3-mock python3-ofxparse python3-openssl python3-passlib python3-pbr python3-pil python3-psutil python3-psycopg2 python3-pydot python3-pygments python3-pyparsing python3-pypdf2 python3-renderpm python3-reportlab python3-reportlab-accel python3-roman python3-serial python3-stdnum python3-suds python3-tz python3-usb python3-vatnumber python3-werkzeug python3-xlsxwriter python3-yaml 133 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/11.0/requirements.txt 134 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/12.0/requirements.txt 135 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/13.0/requirements.txt 136 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/14.0/requirements.txt 137 | sudo -H pip3 install -r https://raw.githubusercontent.com/mah007/OdooScript/14.0/requirements.txt 138 | sudo -H pip3 install phonenumbers 139 | 140 | echo "-----------------------------------------------------------" 141 | echo "Done! The Odoo production platform is ready:" 142 | 143 | echo "Restart restart ur computer and start developing and have fun ;)" 144 | echo "-----------------------------------------------------------" 145 | -------------------------------------------------------------------------------- /odoo14_dev20.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # to run the script "sudo /bin/sh odoo_pro.sh" 3 | ################################################################################ 4 | # Script for preparing Odoo production server platform on Ubuntu 20.04 (could be used for other version too) 5 | # Author: Mahmoud Abdel Latif 6 | # Mobile No: +201002688172 7 | # Email: Mah008@me.com 8 | # Website: http://www.mah007.com 9 | #------------------------------------------------------------------------------- 10 | # This script will make ur server ready for installing ODOO from 8 to 14 11 | #------------------------------------------------------------------------------- 12 | # Make a new file: 13 | # sudo nano odoo_pro.sh 14 | # Place this content in it and then make the file executable: 15 | # sudo chmod +x odoo_pro.sh 16 | # git clone --depth 1 --branch 10.0 https://www.gitlab.com/mah007/odoo . 17 | # Execute the script to install Odoo: 18 | # ./odoo-developing 19 | ################################################################################ 20 | 21 | ##fixed parameters 22 | #instead of odoo use ur user name .EG OE_USER="mahmoud" 23 | OE_USER="mahmoud" 24 | OE_BRANCH="14.0" 25 | #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) 26 | #Set to true if you want to install it, false if you don't need it or have it already installed. 27 | INSTALL_WKHTMLTOPDF="True" 28 | 29 | # Set this to True if you want to install Odoo 9 10 11 12 13 14Enterprise! ( you can use enterprise normaly too ;) ) 30 | IS_ENTERPRISE="True" 31 | 32 | ## 33 | ### WKHTMLTOPDF download links 34 | ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, 35 | ## in order to have correct version of wkhtmltox installed, for a danger note refer to 36 | ## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): 37 | WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb 38 | WKHTMLTOX_X32=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_i386.deb 39 | #-------------------------------------------------- 40 | # Update Server 41 | #-------------------------------------------------- 42 | echo -e "\n---- Update Server ----" 43 | sudo apt-get update 44 | sudo apt-get upgrade -y 45 | apt install -y zip 46 | echo "----------------------------localization-------------------------------" 47 | 48 | export LC_ALL="en_US.UTF-8" 49 | export LC_CTYPE="en_US.UTF-8" 50 | sudo dpkg-reconfigure locales 51 | 52 | #-------------------------------------------------- 53 | # Install PostgreSQL Server 54 | #-------------------------------------------------- 55 | sudo sh -c 'echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 56 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 57 | sudo apt-get update 58 | 59 | echo -e "\n---- Install PostgreSQL Server ----" 60 | sudo apt-get install postgresql-13 postgresql-server-dev-13 -y 61 | 62 | echo -e "\n---- Creating the ODOO PostgreSQL User ----" 63 | sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true 64 | 65 | #-------------------------------------------------- 66 | # Install Dependencies 67 | #-------------------------------------------------- 68 | echo -e "\n---- Install tool packages ----" 69 | #sudo apt install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev 70 | echo -e "\n---- Install python libraries ----" 71 | sudo pip install gdata psycogreen 72 | # This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04 73 | sudo -H pip install suds 74 | 75 | echo -e "\n--- Install other required packages" 76 | sudo apt-get install node-clean-css -y 77 | sudo apt-get install node-less -y 78 | sudo apt-get install python-gevent -y 79 | apt-get install libwww-perl -y 80 | #sudo apt install ifupdown -y 81 | 82 | 83 | #-------------------------------------------------- 84 | # Install Wkhtmltopdf if needed 85 | #-------------------------------------------------- 86 | if [ $INSTALL_WKHTMLTOPDF = "True" ]; then 87 | echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 9 ----" 88 | #pick up correct one from x64 & x32 versions: 89 | if [ "`getconf LONG_BIT`" == "64" ];then 90 | _url=$WKHTMLTOX_X64 91 | else 92 | _url=$WKHTMLTOX_X32 93 | fi 94 | sudo wget $_url 95 | sudo gdebi --n `basename $_url` 96 | sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin 97 | sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin 98 | else 99 | echo "Wkhtmltopdf isn't installed due to the choice of the user!" 100 | fi 101 | 102 | 103 | 104 | 105 | if [ $IS_ENTERPRISE = "True" ]; then 106 | # Odoo Enterprise install! 107 | 108 | echo -e "\n---- Installing Enterprise specific libraries ----" 109 | sudo apt-get install nodejs npm -y 110 | sudo npm install -g less 111 | sudo npm install -g less-plugin-clean-css 112 | sudo npm install -g rtlcss 113 | else 114 | echo -e "\n---- every thing is ready ----" 115 | 116 | fi 117 | sudo ln -s /usr/bin/nodejs /usr/bin/node 118 | 119 | sudo apt-get install -y python3-dev 120 | sudo easy_install greenlet 121 | sudo easy_install gevent 122 | sudo apt-get install -y python3-pip python3-wheel python3-setuptools 123 | sudo -H pip3 install --upgrade pip 124 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/14.0/requirements.txt 125 | sudo apt install -y python3-asn1crypto 126 | sudo apt install -y python3-babel python3-bs4 python3-cffi-backend python3-cryptography python3-dateutil python3-docutils python3-feedparser python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-html5lib python3-jinja2 python3-lxml python3-mako python3-markupsafe python3-mock python3-ofxparse python3-openssl python3-passlib python3-pbr python3-pil python3-psutil python3-psycopg2 python3-pydot python3-pygments python3-pyparsing python3-pypdf2 python3-renderpm python3-reportlab python3-reportlab-accel python3-roman python3-serial python3-stdnum python3-suds python3-tz python3-usb python3-vatnumber python3-werkzeug python3-xlsxwriter python3-yaml 127 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/11.0/requirements.txt 128 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/12.0/requirements.txt 129 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/13.0/requirements.txt 130 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/14.0/requirements.txt 131 | sudo -H pip3 install -r https://raw.githubusercontent.com/mah007/OdooScript/14.0/requirements.txt 132 | sudo -H pip3 install phonenumbers 133 | echo "---------------------------odoo directory--------------------------------" 134 | # mkdir /odoo 135 | # mkdir /etc/odoo 136 | # mkdir /var/log/odoo 137 | # touch /etc/odoo/odoo.conf 138 | # touch /var/log/odoo/odoo-server.log 139 | # chown odoo:odoo /var/log/odoo/odoo-server.log 140 | # chown odoo:odoo /etc/odoo/odoo.conf 141 | # cd /odoo 142 | 143 | # sudo git clone --depth 1 --branch $OE_BRANCH https://www.github.com/odoo/odoo 144 | # cd / 145 | 146 | # chown -R odoo:odoo /odoo 147 | 148 | # cd /root 149 | # echo "-------------------------------odoo service----------------------------" 150 | # wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/odoo.service 151 | # cp odoo.service /etc/systemd/system 152 | # sudo systemctl daemon-reload 153 | # sudo systemctl enable odoo 154 | # sudo systemctl start odoo 155 | # echo "----------------------------NGINX-------------------------------" 156 | # wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/nginx.sh 157 | # bash nginx.sh 158 | # echo "---------------------------webmin--------------------------------" 159 | # apt-get install -y perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python 160 | # wget https://download.webmin.com/jcameron-key.asc 161 | # apt-key add jcameron-key.asc 162 | # apt-get install apt-transport-https -y 163 | # apt-get update 164 | # apt-get install webmin -y 165 | 166 | 167 | echo "-----------------------------------------------------------" 168 | echo "Done! The Odoo production platform is ready:" 169 | 170 | echo "Restart restart ur computer and start developing and have fun ;)" 171 | echo "-----------------------------------------------------------" 172 | -------------------------------------------------------------------------------- /odoo15_2204.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # to run the script "sudo /bin/sh odoo15_2204.sh" 3 | # this script is for Ubuntu server 22.04 Jammy 4 | ################################################################################ 5 | # Script for preparing Odoo production server platform on Ubuntu 20.04 (could be used for other version too) 6 | # Author: Mahmoud Abdel Latif 7 | # Mobile No: +201002688172 8 | # Email: Mah008@me.com 9 | # Website: http://www.mah007.com 10 | #------------------------------------------------------------------------------- 11 | # This script will make ur server ready for installing ODOO from 8 to 14 12 | #------------------------------------------------------------------------------- 13 | # Make a new file: 14 | # sudo nano odoo_pro.sh 15 | # Place this content in it and then make the file executable: 16 | # sudo chmod +x odoo_pro.sh 17 | # git clone --depth 1 --branch 10.0 https://www.gitlab.com/mah007/odoo . 18 | # Execute the script to install Odoo: 19 | # ./odoo-developing 20 | ################################################################################ 21 | 22 | ##fixed parameters 23 | #instead of odoo use ur user name .EG OE_USER="mahmoud" 24 | OE_USER="odoo" 25 | OE_BRANCH="15.0" 26 | 27 | # Add group 28 | groupadd $OE_USER 29 | # Add user 30 | useradd --create-home -d /home/$OE_USER --shell /bin/bash -g $OE_USER $OE_USER 31 | # add user to sudoers 32 | usermod -aG sudo $OE_USER 33 | #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) 34 | #Set to true if you want to install it, false if you don't need it or have it already installed. 35 | INSTALL_WKHTMLTOPDF="True" 36 | 37 | # Set this to True if you want to install Odoo 9 10 11 12 13 14Enterprise! ( you can use enterprise normaly too ;) ) 38 | IS_ENTERPRISE="True" 39 | 40 | ## 41 | ### WKHTMLTOPDF download links 42 | ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, 43 | ## in order to have correct version of wkhtmltox installed, for a danger note refer to 44 | ## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): 45 | WKHTMLTOX_X64=https://github.com/odoo/wkhtmltopdf/releases/download/nightly/odoo-wkhtmltopdf-ubuntu-jammy-x86_64-0.13.0-nightly.deb 46 | WKHTMLTOX_X32=https://github.com/odoo/wkhtmltopdf/releases/download/nightly/odoo-wkhtmltopdf-ubuntu-jammy-x86_64-0.13.0-nightly.deb 47 | 48 | #-------------------------------------------------- 49 | # Update Server 50 | #-------------------------------------------------- 51 | echo -e "\n---- Update Server ----" 52 | sudo apt-get update 53 | sudo apt-get upgrade -y 54 | apt install -y zip gdebi net-tools 55 | echo "----------------------------localization-------------------------------" 56 | 57 | export LC_ALL="en_US.UTF-8" 58 | export LC_CTYPE="en_US.UTF-8" 59 | sudo dpkg-reconfigure locales 60 | 61 | #-------------------------------------------------- 62 | # Install PostgreSQL Server 63 | #-------------------------------------------------- 64 | sudo sh -c 'echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 65 | # wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/webmin.list 66 | # cp webmin.list /etc/apt/sources.list.d 67 | curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh 68 | sh setup-repos.sh 69 | 70 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 71 | sudo apt-get update 72 | 73 | echo -e "\n---- Install PostgreSQL Server ----" 74 | sudo apt-get install postgresql-15 postgresql-server-dev-15 -y 75 | 76 | echo -e "\n---- Creating the ODOO PostgreSQL User ----" 77 | sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true 78 | 79 | #-------------------------------------------------- 80 | # Install Dependencies 81 | #-------------------------------------------------- 82 | echo -e "\n---- Install tool packages ----" 83 | sudo apt install -y git python3-pip build-essential wget python3-dev python3-venv python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev 84 | echo -e "\n---- Install python libraries ----" 85 | sudo pip install gdata psycogreen 86 | # This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04 .... 20.04 ...22.04 87 | sudo -H pip install suds 88 | 89 | echo -e "\n--- Install other required packages" 90 | sudo apt-get install node-clean-css -y 91 | sudo apt-get install node-less -y 92 | sudo apt-get install python-gevent -y 93 | apt-get install libwww-perl -y 94 | #sudo apt install ifupdown -y 95 | 96 | 97 | #-------------------------------------------------- 98 | # Install Wkhtmltopdf if needed 99 | #-------------------------------------------------- 100 | if [ $INSTALL_WKHTMLTOPDF = "True" ]; then 101 | echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 15.0 ----" 102 | #pick up correct one from x64 & x32 versions: 103 | if [ "`getconf LONG_BIT`" == "64" ];then 104 | _url=$WKHTMLTOX_X64 105 | else 106 | _url=$WKHTMLTOX_X32 107 | fi 108 | sudo wget $_url 109 | sudo gdebi --n `basename $_url` 110 | 111 | else 112 | echo "Wkhtmltopdf isn't installed due to the choice of the user!" 113 | fi 114 | 115 | 116 | 117 | 118 | 119 | # Odoo Enterprise install! 120 | sudo apt-get update 121 | sudo apt-get install -y ca-certificates curl gnupg gsfonts 122 | sudo mkdir -p /etc/apt/keyrings 123 | curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg 124 | NODE_MAJOR=20 125 | echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list 126 | 127 | sudo apt-get update 128 | sudo apt-get install nodejs -y 129 | 130 | echo -e "\n---- Installing Enterprise specific libraries ----" 131 | 132 | sudo npm install -g less 133 | sudo npm install -g less-plugin-clean-css 134 | sudo npm install -g rtlcss 135 | 136 | echo -e "\n---- every thing is ready ----" 137 | 138 | 139 | sudo ln -s /usr/bin/nodejs /usr/bin/node 140 | 141 | sudo apt-get install -y python3-dev 142 | sudo easy_install greenlet 143 | sudo easy_install gevent 144 | sudo apt-get install -y python3-pip python3-wheel python3-setuptools 145 | sudo -H pip3 install --upgrade pip 146 | sudo apt install -y python3-asn1crypto 147 | sudo apt install -y python3-babel python3-bs4 python3-cffi-backend python3-cryptography python3-dateutil python3-docutils python3-feedparser python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-html5lib python3-jinja2 python3-lxml python3-mako python3-markupsafe python3-mock python3-ofxparse python3-openssl python3-passlib python3-pbr python3-pil python3-psutil python3-psycopg2 python3-pydot python3-pygments python3-pyparsing python3-pypdf2 python3-renderpm python3-reportlab python3-reportlab-accel python3-roman python3-serial python3-stdnum python3-suds python3-tz python3-usb python3-werkzeug python3-xlsxwriter python3-yaml 148 | pip3 install -r https://raw.githubusercontent.com/odoo/odoo/15.0/requirements.txt --user 149 | # pip3 install -r https://raw.githubusercontent.com/mah007/OdooScript/14.0/requirements.txt --user 150 | pip3 install phonenumbers --user 151 | echo "---------------------------odoo directory--------------------------------" 152 | mkdir /odoo 153 | mkdir /etc/odoo 154 | mkdir /var/log/odoo 155 | touch /etc/odoo/odoo.conf 156 | touch /var/log/odoo/odoo-server.log 157 | chown odoo:odoo /var/log/odoo/odoo-server.log 158 | chown odoo:odoo /etc/odoo/odoo.conf 159 | cd /odoo 160 | 161 | sudo git clone --depth 1 --branch $OE_BRANCH https://www.github.com/odoo/odoo 162 | cd / 163 | 164 | chown -R odoo:odoo /odoo 165 | 166 | cd /root 167 | echo "-------------------------------odoo service----------------------------" 168 | wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/odoo.service 169 | cp odoo.service /etc/systemd/system 170 | sudo systemctl daemon-reload 171 | sudo systemctl enable odoo 172 | sudo systemctl start odoo 173 | echo "----------------------------NGINX-------------------------------" 174 | wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/nginx.sh 175 | bash nginx.sh 176 | echo "---------------------------webmin--------------------------------" 177 | apt-get install -y perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python 178 | wget https://download.webmin.com/jcameron-key.asc 179 | apt-key add jcameron-key.asc 180 | apt-get install apt-transport-https -y 181 | apt-get update 182 | apt-get install -y webmin --install-recommends 183 | 184 | 185 | echo "-----------------------------------------------------------" 186 | echo "Done! The Odoo production platform is ready:" 187 | 188 | echo "Restart restart ur computer and start developing and have fun ;)" 189 | echo "-----------------------------------------------------------" 190 | -------------------------------------------------------------------------------- /odoo15_pro.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # to run the script "sudo /bin/sh odoo_pro.sh" 3 | ################################################################################ 4 | # Script for preparing Odoo production server platform on Ubuntu 20.04 (could be used for other version too) 5 | # Author: Mahmoud Abdel Latif 6 | # Mobile No: +201002688172 7 | # Email: Mah008@me.com 8 | # Website: http://www.mah007.com 9 | #------------------------------------------------------------------------------- 10 | # This script will make ur server ready for installing ODOO from 8 to 14 11 | #------------------------------------------------------------------------------- 12 | # Make a new file: 13 | # sudo nano odoo_pro.sh 14 | # Place this content in it and then make the file executable: 15 | # sudo chmod +x odoo_pro.sh 16 | # git clone --depth 1 --branch 10.0 https://www.gitlab.com/mah007/odoo . 17 | # Execute the script to install Odoo: 18 | # ./odoo-developing 19 | ################################################################################ 20 | 21 | ##fixed parameters 22 | #instead of odoo use ur user name .EG OE_USER="mahmoud" 23 | OE_USER="odoo" 24 | OE_BRANCH="15.0" 25 | 26 | # Add group 27 | groupadd $OE_USER 28 | # Add user 29 | useradd --create-home -d /home/$OE_USER --shell /bin/bash -g $OE_USER $OE_USER 30 | # add user to sudoers 31 | usermod -aG sudo $OE_USER 32 | #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) 33 | #Set to true if you want to install it, false if you don't need it or have it already installed. 34 | INSTALL_WKHTMLTOPDF="True" 35 | 36 | # Set this to True if you want to install Odoo 9 10 11 12 13 14Enterprise! ( you can use enterprise normaly too ;) ) 37 | IS_ENTERPRISE="True" 38 | 39 | ## 40 | ### WKHTMLTOPDF download links 41 | ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, 42 | ## in order to have correct version of wkhtmltox installed, for a danger note refer to 43 | ## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): 44 | WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb 45 | WKHTMLTOX_X32=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_i386.deb 46 | #-------------------------------------------------- 47 | # Update Server 48 | #-------------------------------------------------- 49 | echo -e "\n---- Update Server ----" 50 | sudo apt-get update 51 | sudo apt-get upgrade -y 52 | apt install -y zip gdebi net-tools 53 | echo "----------------------------localization-------------------------------" 54 | 55 | export LC_ALL="en_US.UTF-8" 56 | export LC_CTYPE="en_US.UTF-8" 57 | sudo dpkg-reconfigure locales 58 | 59 | #-------------------------------------------------- 60 | # Install PostgreSQL Server 61 | #-------------------------------------------------- 62 | sudo sh -c 'echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 63 | wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/webmin.list 64 | cp webmin.list /etc/apt/sources.list.d 65 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 66 | sudo apt-get update 67 | 68 | echo -e "\n---- Install PostgreSQL Server ----" 69 | sudo apt-get install postgresql-15 postgresql-server-dev-15 -y 70 | 71 | echo -e "\n---- Creating the ODOO PostgreSQL User ----" 72 | sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true 73 | 74 | #-------------------------------------------------- 75 | # Install Dependencies 76 | #-------------------------------------------------- 77 | echo -e "\n---- Install tool packages ----" 78 | sudo apt install -y git python3-pip build-essential wget python3-dev python3-venv python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev 79 | echo -e "\n---- Install python libraries ----" 80 | sudo pip install gdata psycogreen 81 | # This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04 .... 20.04 82 | sudo -H pip install suds 83 | 84 | echo -e "\n--- Install other required packages" 85 | sudo apt-get install node-clean-css -y 86 | sudo apt-get install node-less -y 87 | sudo apt-get install python-gevent -y 88 | apt-get install libwww-perl -y 89 | #sudo apt install ifupdown -y 90 | 91 | 92 | #-------------------------------------------------- 93 | # Install Wkhtmltopdf if needed 94 | #-------------------------------------------------- 95 | if [ $INSTALL_WKHTMLTOPDF = "True" ]; then 96 | echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 9 ----" 97 | #pick up correct one from x64 & x32 versions: 98 | if [ "`getconf LONG_BIT`" == "64" ];then 99 | _url=$WKHTMLTOX_X64 100 | else 101 | _url=$WKHTMLTOX_X32 102 | fi 103 | sudo wget $_url 104 | sudo gdebi --n `basename $_url` 105 | sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin 106 | sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin 107 | else 108 | echo "Wkhtmltopdf isn't installed due to the choice of the user!" 109 | fi 110 | 111 | 112 | 113 | 114 | if [ $IS_ENTERPRISE = "True" ]; then 115 | # Odoo Enterprise install! 116 | 117 | echo -e "\n---- Installing Enterprise specific libraries ----" 118 | sudo apt-get install nodejs npm -y 119 | sudo npm install -g less 120 | sudo npm install -g less-plugin-clean-css 121 | sudo npm install -g rtlcss 122 | else 123 | echo -e "\n---- every thing is ready ----" 124 | 125 | fi 126 | sudo ln -s /usr/bin/nodejs /usr/bin/node 127 | 128 | sudo apt-get install -y python3-dev 129 | sudo easy_install greenlet 130 | sudo easy_install gevent 131 | sudo apt-get install -y python3-pip python3-wheel python3-setuptools 132 | sudo -H pip3 install --upgrade pip 133 | sudo apt install -y python3-asn1crypto 134 | sudo apt install -y python3-babel python3-bs4 python3-cffi-backend python3-cryptography python3-dateutil python3-docutils python3-feedparser python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-html5lib python3-jinja2 python3-lxml python3-mako python3-markupsafe python3-mock python3-ofxparse python3-openssl python3-passlib python3-pbr python3-pil python3-psutil python3-psycopg2 python3-pydot python3-pygments python3-pyparsing python3-pypdf2 python3-renderpm python3-reportlab python3-reportlab-accel python3-roman python3-serial python3-stdnum python3-suds python3-tz python3-usb python3-vatnumber python3-werkzeug python3-xlsxwriter python3-yaml 135 | pip3 install -r https://raw.githubusercontent.com/odoo/odoo/15.0/requirements.txt --user 136 | pip3 install -r https://raw.githubusercontent.com/mah007/OdooScript/14.0/requirements.txt --user 137 | pip3 install phonenumbers --user 138 | echo "---------------------------odoo directory--------------------------------" 139 | mkdir /odoo 140 | mkdir /etc/odoo 141 | mkdir /var/log/odoo 142 | touch /etc/odoo/odoo.conf 143 | touch /var/log/odoo/odoo-server.log 144 | chown odoo:odoo /var/log/odoo/odoo-server.log 145 | chown odoo:odoo /etc/odoo/odoo.conf 146 | cd /odoo 147 | 148 | sudo git clone --depth 1 --branch $OE_BRANCH https://www.github.com/odoo/odoo 149 | cd / 150 | 151 | chown -R odoo:odoo /odoo 152 | 153 | cd /root 154 | echo "-------------------------------odoo service----------------------------" 155 | wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/odoo.service 156 | cp odoo.service /etc/systemd/system 157 | sudo systemctl daemon-reload 158 | sudo systemctl enable odoo 159 | sudo systemctl start odoo 160 | echo "----------------------------NGINX-------------------------------" 161 | wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/nginx.sh 162 | bash nginx.sh 163 | echo "---------------------------webmin--------------------------------" 164 | apt-get install -y perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python 165 | wget https://download.webmin.com/jcameron-key.asc 166 | apt-key add jcameron-key.asc 167 | apt-get install apt-transport-https -y 168 | apt-get update 169 | apt-get install webmin -y 170 | 171 | 172 | echo "-----------------------------------------------------------" 173 | echo "Done! The Odoo production platform is ready:" 174 | 175 | echo "Restart restart ur computer and start developing and have fun ;)" 176 | echo "-----------------------------------------------------------" 177 | -------------------------------------------------------------------------------- /odoo17_pro.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Function to display colorful billboard message 4 | display_billboard() { 5 | printf "\e[91m\e[1m==================================================\e[0m\n" 6 | printf "\e[93m\e[1m%s\e[0m\n" "$1" 7 | printf "\e[91m\e[1m==================================================\e[0m\n" 8 | } 9 | 10 | # Function to prompt user for Odoo version 11 | select_odoo_version() { 12 | echo "Please select the Odoo version:" 13 | echo "1) Odoo 14.0" 14 | echo "2) Odoo 15.0" 15 | echo "3) Odoo 16.0" 16 | echo "4) Odoo 17.0" 17 | echo "5) Odoo 18.0" 18 | 19 | read -rp "Enter your choice (1-5): " choice 20 | 21 | case $choice in 22 | 1) OE_BRANCH="14.0";; 23 | 2) OE_BRANCH="15.0";; 24 | 3) OE_BRANCH="16.0";; 25 | 4) OE_BRANCH="17.0";; 26 | 5) OE_BRANCH="18.0";; 27 | *) echo "Invalid choice. Please enter a number between 1 and 4."; exit 1;; 28 | esac 29 | } 30 | 31 | # Display billboard message 32 | billboard_message="Welcome to the Odoo Production Server Setup Script!" 33 | display_billboard "$billboard_message" 34 | 35 | # Prompt user for Odoo version 36 | select_odoo_version 37 | 38 | # Fixed parameters 39 | OE_USER="odoo" 40 | 41 | # Add group 42 | groupadd "$OE_USER" 43 | # Add user 44 | useradd --create-home -d /home/"$OE_USER" --shell /bin/bash -g "$OE_USER" "$OE_USER" 45 | # Add user to sudoers 46 | usermod -aG sudo "$OE_USER" 47 | 48 | # The default port where this Odoo instance will run under (provided you use the command -c in the terminal) 49 | # Set to true if you want to install it, false if you don't need it or have it already installed. 50 | INSTALL_WKHTMLTOPDF="True" 51 | 52 | # Set this to True if you want to install Odoo 9 10 11 12 13 14Enterprise! (you can use enterprise normally too) 53 | IS_ENTERPRISE="True" 54 | 55 | # WKHTMLTOPDF download links 56 | WKHTMLTOX_X64="https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb" 57 | WKHTMLTOX_X32="https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb" 58 | 59 | # Update Server 60 | echo -e "\n---- Update Server ----" 61 | sudo apt-get update 62 | sudo apt-get upgrade -y 63 | apt install -y zip gdebi net-tools 64 | echo "----------------------------localization-------------------------------" 65 | 66 | export LC_ALL="en_US.UTF-8" 67 | export LC_CTYPE="en_US.UTF-8" 68 | sudo dpkg-reconfigure locales 69 | 70 | # Install PostgreSQL Server 71 | sudo sh -c 'echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 72 | curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh 73 | sh setup-repos.sh 74 | 75 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 76 | sudo apt-get update 77 | 78 | echo -e "\n---- Install PostgreSQL Server ----" 79 | sudo apt-get install postgresql-16 postgresql-server-dev-16 -y 80 | 81 | echo -e "\n---- Creating the ODOO PostgreSQL User ----" 82 | sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true 83 | 84 | # Install Dependencies 85 | echo -e "\n---- Install tool packages ----" 86 | sudo apt install -y git python3-pip build-essential wget python3-dev python3-venv python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev 87 | echo -e "\n---- Install python libraries ----" 88 | sudo pip install gdata psycogreen 89 | sudo -H pip install suds 90 | 91 | echo -e "\n--- Install other required packages" 92 | sudo apt-get install node-clean-css -y 93 | sudo apt-get install node-less -y 94 | sudo apt-get install python-gevent -y 95 | sudo apt-get install gsfonts libcairo2-dev python3-cairo -y 96 | 97 | pip3 install rlPyCairo 98 | apt-get install libwww-perl -y 99 | 100 | # Install Wkhtmltopdf if needed 101 | if [ $INSTALL_WKHTMLTOPDF = "True" ]; then 102 | echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 15.0 ----" 103 | if [ "`getconf LONG_BIT`" == "64" ];then 104 | _url=$WKHTMLTOX_X64 105 | else 106 | _url=$WKHTMLTOX_X32 107 | fi 108 | sudo wget $_url 109 | sudo gdebi --n `basename $_url` 110 | else 111 | echo "Wkhtmltopdf isn't installed due to the choice of the user!" 112 | fi 113 | 114 | # Odoo Enterprise install 115 | sudo apt-get update 116 | sudo apt-get install -y ca-certificates curl gnupg 117 | sudo mkdir -p /etc/apt/keyrings 118 | curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg 119 | NODE_MAJOR=20 120 | echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list 121 | sudo apt-get update 122 | sudo apt-get install nodejs -y 123 | 124 | echo -e "\n---- Installing Enterprise specific libraries ----" 125 | sudo npm install -g less 126 | sudo npm install -g less-plugin-clean-css 127 | sudo npm install -g rtlcss 128 | 129 | echo -e "\n---- everything is ready ----" 130 | 131 | sudo ln -s /usr/bin/nodejs /usr/bin/node 132 | 133 | sudo apt-get install -y python3-dev 134 | sudo easy_install greenlet 135 | sudo easy_install gevent 136 | sudo apt-get install -y python3-pip python3-wheel python3-setuptools 137 | sudo -H pip3 install --upgrade pip 138 | sudo apt install -y python3-asn1crypto 139 | sudo apt install -y python3-babel python3-bs4 python3-cffi-backend python3-cryptography python3-dateutil python3-docutils python3-feedparser python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-html5lib python3-jinja2 python3-lxml python3-mako python3-markupsafe python3-mock python3-ofxparse python3-openssl python3-passlib python3-pbr python3-pil python3-psutil python3-psycopg2 python3-pydot python3-pygments python3-pyparsing python3-pypdf2 python3-renderpm python3-reportlab python3-reportlab-accel python3-roman python3-serial python3-stdnum python3-suds python3-tz python3-usb python3-werkzeug python3-xlsxwriter python3-yaml 140 | pip3 install -r https://raw.githubusercontent.com/odoo/odoo/"$OE_BRANCH"/requirements.txt --user 141 | pip3 install phonenumbers --user 142 | 143 | mkdir /odoo 144 | mkdir /etc/odoo 145 | mkdir /var/log/odoo 146 | touch /etc/odoo/odoo.conf 147 | touch /var/log/odoo/odoo-server.log 148 | chown -R odoo:odoo /var/log/odoo 149 | chown -R odoo:odoo /etc/odoo 150 | cd /odoo 151 | 152 | sudo git clone --depth 1 --branch "$OE_BRANCH" https://www.github.com/odoo/odoo 153 | cd / 154 | 155 | chown -R odoo:odoo /odoo 156 | su - $OE_USER -s /bin/bash -c "pip3 install -r https://raw.githubusercontent.com/odoo/odoo/"$OE_BRANCH"/requirements.txt --user" 157 | cd /root 158 | wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/odoo.service 159 | cp odoo.service /etc/systemd/system 160 | sudo systemctl daemon-reload 161 | sudo systemctl enable odoo 162 | sudo systemctl start odoo 163 | wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/nginx.sh 164 | bash nginx.sh 165 | apt-get install -y perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python 166 | wget https://download.webmin.com/jcameron-key.asc 167 | apt-key add jcameron-key.asc 168 | apt-get install apt-transport-https -y 169 | apt-get update 170 | apt-get install -y webmin --install-recommends 171 | 172 | echo "-----------------------------------------------------------" 173 | echo "Done! The Odoo production platform is ready:" 174 | echo "Restart your computer and start developing. Have fun! ;)" 175 | echo "-----------------------------------------------------------" 176 | -------------------------------------------------------------------------------- /odoo_dev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # to run the script "sudo /bin/sh odoo_dev.sh" 3 | ################################################################################ 4 | # Script for preparing Odoo developing platform on Ubuntu 14.04, 15.04 and 16.04 (could be used for other version too) 5 | # Author: Mahmoud Abdel Latif 6 | # Mobile No: +201002688172 7 | # Email: Mah008@me.com 8 | # Website: http://www.mah007.com 9 | #------------------------------------------------------------------------------- 10 | # This script will make ur computer ready for developing on ODOO from 8 to 11 11 | #------------------------------------------------------------------------------- 12 | # Make a new file: 13 | # sudo nano odoo_developing.sh 14 | # Place this content in it and then make the file executable: 15 | # sudo chmod +x odoo_developing.sh 16 | # git clone --depth 1 --branch 10.0 https://www.gitlab.com/mah007/odoo . 17 | # Execute the script to install Odoo: 18 | # ./odoo-developing 19 | ################################################################################ 20 | 21 | ##fixed parameters 22 | #odoo instead of odoo use ur user name .EG OE_USER="mahmoud" 23 | OE_USER="odoo" 24 | #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) 25 | #Set to true if you want to install it, false if you don't need it or have it already installed. 26 | INSTALL_WKHTMLTOPDF="True" 27 | 28 | # Set this to True if you want to install Odoo 9 10 11 Enterprise! ( you can use enterprise normaly too ;) ) 29 | IS_ENTERPRISE="True" 30 | 31 | ## 32 | ### WKHTMLTOPDF download links 33 | ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, 34 | ## in order to have correct version of wkhtmltox installed, for a danger note refer to 35 | ## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): 36 | WKHTMLTOX_X64=https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.xenial_amd64.deb 37 | WKHTMLTOX_X32=https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.xenial_i386.deb 38 | #-------------------------------------------------- 39 | # Update Server 40 | #-------------------------------------------------- 41 | echo -e "\n---- Update Server ----" 42 | sudo apt-get update 43 | sudo apt-get upgrade -y 44 | sudo apt-get install default-jre -y 45 | sudo add-apt-repository ppa:webupd8team/java 46 | sudo apt-get install default-jdk -y 47 | sudo apt-get update 48 | sudo apt-get install oracle-java8-installer -y 49 | sudo add-apt-repository ppa:mystic-mirage/pycharm 50 | sudo apt-get update 51 | 52 | #-------------------------------------------------- 53 | # Install PostgreSQL Server 54 | #-------------------------------------------------- 55 | echo -e "\n---- Install PostgreSQL Server ----" 56 | sudo apt-get install postgresql postgresql-server-dev-* -y 57 | 58 | echo -e "\n---- Creating the ODOO PostgreSQL User ----" 59 | sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true 60 | 61 | #-------------------------------------------------- 62 | # Install Dependencies 63 | #-------------------------------------------------- 64 | echo -e "\n---- Install tool packages ----" 65 | sudo apt-get install wget subversion git bzr bzrtools python-pip python3-pip gdebi-core pysassc -y 66 | 67 | echo -e "\n---- Install python packages ----" 68 | sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil python-gpgme python-launchpadlib build-essential python-all-dev python-setuptools python-imaging python-suds python-xlsxwriter python-wheel -y 69 | 70 | echo -e "\n---- Install python libraries ----" 71 | sudo pip install gdata psycogreen 72 | # This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04 73 | sudo -H pip install suds 74 | 75 | echo -e "\n--- Install other required packages" 76 | sudo apt-get install node-clean-css -y 77 | sudo apt-get install node-less -y 78 | sudo apt-get install python-gevent -y 79 | 80 | #-------------------------------------------------- 81 | # Install Wkhtmltopdf if needed 82 | #-------------------------------------------------- 83 | if [ $INSTALL_WKHTMLTOPDF = "True" ]; then 84 | echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 9 ----" 85 | #pick up correct one from x64 & x32 versions: 86 | if [ "`getconf LONG_BIT`" == "64" ];then 87 | _url=$WKHTMLTOX_X64 88 | else 89 | _url=$WKHTMLTOX_X32 90 | fi 91 | sudo wget $_url 92 | sudo gdebi --n `basename $_url` 93 | sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin 94 | sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin 95 | else 96 | echo "Wkhtmltopdf isn't installed due to the choice of the user!" 97 | fi 98 | 99 | 100 | 101 | 102 | if [ $IS_ENTERPRISE = "True" ]; then 103 | # Odoo Enterprise install! 104 | 105 | echo -e "\n---- Installing Enterprise specific libraries ----" 106 | sudo apt-get install nodejs npm -y 107 | sudo npm install -g less 108 | sudo npm install -g less-plugin-clean-css 109 | sudo npm install -g rtlcss 110 | else 111 | echo -e "\n---- every thing is ready ----" 112 | 113 | fi 114 | sudo ln -s /usr/bin/nodejs /usr/bin/node 115 | 116 | sudo apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev python3-dev 117 | sudo easy_install greenlet 118 | sudo easy_install gevent 119 | sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip python3-wheel python3-setuptools 120 | sudo -H pip3 install phonenumbers 121 | sudo -H pip install -r https://raw.githubusercontent.com/odoo/odoo/10.0/requirements.txt 122 | sudo apt install -y python3-asn1crypto 123 | sudo apt install -y python3-babel python3-bs4 python3-cffi-backend python3-cryptography python3-dateutil python3-docutils python3-feedparser python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-html5lib python3-jinja2 python3-lxml python3-mako python3-markupsafe python3-mock python3-ofxparse python3-openssl python3-passlib python3-pbr python3-pil python3-psutil python3-psycopg2 python3-pydot python3-pygments python3-pyparsing python3-pypdf2 python3-renderpm python3-reportlab python3-reportlab-accel python3-roman python3-serial python3-stdnum python3-suds python3-tz python3-usb python3-vatnumber python3-werkzeug python3-xlsxwriter python3-yaml 124 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/11.0/requirements.txt 125 | 126 | 127 | echo "-----------------------------------------------------------" 128 | echo "Done! The Odoo developing platform is ready:" 129 | 130 | echo "you can now install pycharm community of professional" 131 | 132 | echo "using sudo apt-get install pycharm or pycharm-community" 133 | 134 | echo "Restart restart ur computer and start developing and have fun ;)" 135 | echo "-----------------------------------------------------------" 136 | -------------------------------------------------------------------------------- /odoo_dev_2204.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # to run the script "sudo /bin/sh odoo15_2204.sh" 3 | # this script is for Ubuntu Descktop dev 22.04 Jammy 4 | ################################################################################ 5 | # Script for preparing Odoo production server platform on Ubuntu 20.04 (could be used for other version too) 6 | # Author: Mahmoud Abdel Latif 7 | # Mobile No: +201002688172 8 | # Email: Mah008@me.com 9 | # Website: http://www.mah007.com 10 | #------------------------------------------------------------------------------- 11 | # This script will make ur server ready for installing ODOO from 8 to 14 12 | #------------------------------------------------------------------------------- 13 | # Make a new file: 14 | # sudo nano odoo_pro.sh 15 | # Place this content in it and then make the file executable: 16 | # sudo chmod +x odoo_pro.sh 17 | # git clone --depth 1 --branch 10.0 https://www.gitlab.com/mah007/odoo . 18 | # Execute the script to install Odoo: 19 | # ./odoo-developing 20 | ################################################################################ 21 | 22 | ##fixed parameters 23 | #instead of odoo use ur user name .EG OE_USER="mahmoud" 24 | OE_USER="odoo" ## <----- your ubuntu User 25 | OE_BRANCH="16.0" 26 | 27 | #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) 28 | #Set to true if you want to install it, false if you don't need it or have it already installed. 29 | INSTALL_WKHTMLTOPDF="True" 30 | 31 | # Set this to True if you want to install Odoo 9 10 11 12 13 14Enterprise! ( you can use enterprise normaly too ;) ) 32 | IS_ENTERPRISE="True" 33 | 34 | ## 35 | ### WKHTMLTOPDF download links 36 | ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, 37 | ## in order to have correct version of wkhtmltox installed, for a danger note refer to 38 | ## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): 39 | WKHTMLTOX_X64=https://github.com/odoo/wkhtmltopdf/releases/download/nightly/odoo-wkhtmltopdf-ubuntu-jammy-x86_64-0.13.0-nightly.deb 40 | WKHTMLTOX_X32=https://github.com/odoo/wkhtmltopdf/releases/download/nightly/odoo-wkhtmltopdf-ubuntu-jammy-x86_64-0.13.0-nightly.deb 41 | #-------------------------------------------------- 42 | # Update Server 43 | #-------------------------------------------------- 44 | echo -e "\n---- Update Server ----" 45 | sudo apt-get update 46 | sudo apt-get upgrade -y 47 | apt install -y zip gdebi net-tools 48 | echo "----------------------------localization-------------------------------" 49 | 50 | export LC_ALL="en_US.UTF-8" 51 | export LC_CTYPE="en_US.UTF-8" 52 | sudo dpkg-reconfigure locales 53 | 54 | #-------------------------------------------------- 55 | # Install PostgreSQL Server 56 | #-------------------------------------------------- 57 | sudo sh -c 'echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 58 | 59 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 60 | sudo apt-get update 61 | 62 | echo -e "\n---- Install PostgreSQL Server ----" 63 | sudo apt-get install postgresql-15 postgresql-server-dev-15 -y 64 | 65 | echo -e "\n---- Creating the ODOO PostgreSQL User ----" 66 | sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true 67 | 68 | #-------------------------------------------------- 69 | # Install Dependencies 70 | #-------------------------------------------------- 71 | echo -e "\n---- Install tool packages ----" 72 | sudo apt install -y git python3-pip build-essential wget python3-dev python3-venv python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev 73 | echo -e "\n---- Install python libraries ----" 74 | sudo pip install gdata psycogreen 75 | # This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04 .... 20.04 ...22.04 76 | sudo -H pip install suds 77 | 78 | echo -e "\n--- Install other required packages" 79 | sudo apt-get install node-clean-css -y 80 | sudo apt-get install node-less -y 81 | sudo apt-get install python-gevent -y 82 | apt-get install libwww-perl -y 83 | #sudo apt install ifupdown -y 84 | 85 | 86 | #-------------------------------------------------- 87 | # Install Wkhtmltopdf if needed 88 | #-------------------------------------------------- 89 | if [ $INSTALL_WKHTMLTOPDF = "True" ]; then 90 | echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 15.0 ----" 91 | #pick up correct one from x64 & x32 versions: 92 | if [ "`getconf LONG_BIT`" == "64" ];then 93 | _url=$WKHTMLTOX_X64 94 | else 95 | _url=$WKHTMLTOX_X32 96 | fi 97 | sudo wget $_url 98 | sudo gdebi --n `basename $_url` 99 | sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin 100 | sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin 101 | else 102 | echo "Wkhtmltopdf isn't installed due to the choice of the user!" 103 | fi 104 | 105 | 106 | 107 | 108 | 109 | # Odoo Enterprise install! 110 | sudo apt-get update 111 | sudo apt-get install -y ca-certificates curl gnupg 112 | sudo mkdir -p /etc/apt/keyrings 113 | curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg 114 | NODE_MAJOR=20 115 | echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list 116 | 117 | sudo apt-get update 118 | sudo apt-get install nodejs -y 119 | 120 | echo -e "\n---- Installing Enterprise specific libraries ----" 121 | 122 | sudo npm install -g less 123 | sudo npm install -g less-plugin-clean-css 124 | sudo npm install -g rtlcss 125 | 126 | echo -e "\n---- every thing is ready ----" 127 | 128 | 129 | sudo ln -s /usr/bin/nodejs /usr/bin/node 130 | 131 | sudo apt-get install -y python3-dev 132 | sudo easy_install greenlet 133 | sudo easy_install gevent 134 | sudo apt-get install -y python3-pip python3-wheel python3-setuptools 135 | sudo -H pip3 install --upgrade pip 136 | sudo apt install -y python3-asn1crypto 137 | sudo apt install -y python3-babel python3-bs4 python3-cffi-backend python3-cryptography python3-dateutil python3-docutils python3-feedparser python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-html5lib python3-jinja2 python3-lxml python3-mako python3-markupsafe python3-mock python3-ofxparse python3-openssl python3-passlib python3-pbr python3-pil python3-psutil python3-psycopg2 python3-pydot python3-pygments python3-pyparsing python3-pypdf2 python3-renderpm python3-reportlab python3-reportlab-accel python3-roman python3-serial python3-stdnum python3-suds python3-tz python3-usb python3-werkzeug python3-xlsxwriter python3-yaml 138 | pip3 install -r https://raw.githubusercontent.com/odoo/odoo/$OE_BRANCH/requirements.txt --user 139 | # pip3 install -r https://raw.githubusercontent.com/mah007/OdooScript/14.0/requirements.txt --user 140 | pip3 install phonenumbers --user 141 | # 142 | 143 | 144 | echo "-----------------------------------------------------------" 145 | echo "Done! The Odoo Development platform is ready:" 146 | 147 | echo "Restart restart ur computer and start developing and have fun ;)" 148 | echo "-----------------------------------------------------------" 149 | -------------------------------------------------------------------------------- /odoo_nginx.conf: -------------------------------------------------------------------------------- 1 | upstream odoo { 2 | server 127.0.0.1:8069 weight=1 fail_timeout=300s; 3 | } 4 | upstream odoo-im { 5 | server 127.0.0.1:8072 weight=1 fail_timeout=300s; 6 | } 7 | 8 | 9 | server { 10 | listen 80; 11 | return 301 https://$host$request_uri; 12 | 13 | } 14 | 15 | server { 16 | # server port and name 17 | 18 | server_name odoo-hr-test.lan; 19 | 20 | listen 80; 21 | listen 443 ssl; 22 | ssl_certificate /etc/ssl/certs/server.crt; 23 | ssl_certificate_key /etc/ssl/certs/server.key; 24 | 25 | # Specifies the maximum accepted body size of a client request, 26 | # as indicated by the request header Content-Length. 27 | client_max_body_size 200m; 28 | #log files 29 | access_log /var/log/nginx/odoo-access.log; 30 | error_log /var/log/nginx/odoo-error.log; 31 | 32 | proxy_connect_timeout 600; 33 | proxy_send_timeout 600; 34 | proxy_read_timeout 600; 35 | send_timeout 600; 36 | keepalive_timeout 600; 37 | 38 | gzip on; 39 | gzip_disable "msie6"; 40 | gzip_vary on; 41 | gzip_proxied any; 42 | gzip_comp_level 6; 43 | gzip_buffers 16 8k; 44 | gzip_http_version 1.1; 45 | gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss application/rss+xml text/javascript image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype image/bmp image/png image/gif image/jpeg image/jpg; 46 | 47 | # increase proxy buffer to handle some OpenERP web requests 48 | proxy_buffers 16 64k; 49 | proxy_buffer_size 128k; 50 | location / { 51 | proxy_pass http://odoo; 52 | # force timeouts if the backend dies 53 | proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; 54 | # Add Headers for odoo proxy mode 55 | # set headers 56 | proxy_set_header X-Forwarded-Host $host; 57 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 58 | proxy_set_header X-Forwarded-Proto $scheme; 59 | proxy_set_header X-Real-IP $remote_addr; 60 | # by default, do not forward anything 61 | proxy_redirect off; 62 | } 63 | location /longpolling { 64 | proxy_pass http://odoo-im; 65 | proxy_set_header Host $host; 66 | proxy_set_header X-Real-IP $remote_addr; 67 | proxy_set_header X-Forwarded-For $http_host; 68 | } 69 | # cache some static data in memory for 60mins. 70 | # under heavy load this should relieve stress on the web interface a bit. 71 | location ~* /web/static/ { 72 | proxy_cache_valid 200 60m; 73 | proxy_buffering on; 74 | expires 864000; 75 | proxy_pass http://odoo; 76 | } 77 | 78 | 79 | } 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /odoo_pro.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # to run the script "sudo /bin/sh odoo_pro.sh" 3 | ################################################################################ 4 | # Script for preparing Odoo production server platform on Ubuntu 14.04, 15.04 and 16.04 (could be used for other version too) 5 | # Author: Mahmoud Abdel Latif 6 | # Mobile No: +201002688172 7 | # Email: Mah008@me.com 8 | # Website: http://www.mah007.com 9 | #------------------------------------------------------------------------------- 10 | # This script will make ur server ready for installing ODOO from 8 to 11 11 | #------------------------------------------------------------------------------- 12 | # Make a new file: 13 | # sudo nano odoo_pro.sh 14 | # Place this content in it and then make the file executable: 15 | # sudo chmod +x odoo_pro.sh 16 | # git clone --depth 1 --branch 10.0 https://www.gitlab.com/mah007/odoo . 17 | # Execute the script to install Odoo: 18 | # ./odoo-developing 19 | ################################################################################ 20 | 21 | ##fixed parameters 22 | #instead of odoo use ur user name .EG OE_USER="mahmoud" 23 | OE_USER="odoo" 24 | #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) 25 | #Set to true if you want to install it, false if you don't need it or have it already installed. 26 | INSTALL_WKHTMLTOPDF="True" 27 | 28 | # Set this to True if you want to install Odoo 9 10 11 Enterprise! ( you can use enterprise normaly too ;) ) 29 | IS_ENTERPRISE="True" 30 | 31 | ## 32 | ### WKHTMLTOPDF download links 33 | ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, 34 | ## in order to have correct version of wkhtmltox installed, for a danger note refer to 35 | ## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): 36 | WKHTMLTOX_X64=https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.xenial_amd64.deb 37 | WKHTMLTOX_X32=https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.xenial_i386.deb 38 | #-------------------------------------------------- 39 | # Update Server 40 | #-------------------------------------------------- 41 | echo -e "\n---- Update Server ----" 42 | sudo apt-get update 43 | sudo apt-get upgrade -y 44 | apt install -y zip 45 | 46 | echo "----------------------------localization-------------------------------" 47 | 48 | export LC_ALL="en_US.UTF-8" 49 | export LC_CTYPE="en_US.UTF-8" 50 | sudo dpkg-reconfigure locales 51 | #-------------------------------------------------- 52 | # Install PostgreSQL Server 53 | #-------------------------------------------------- 54 | 55 | 56 | # Create the file repository configuration: 57 | sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 58 | 59 | # Import the repository signing key: 60 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 61 | 62 | 63 | 64 | echo -e "\n---- Install PostgreSQL Server ----" 65 | sudo apt-get install postgresql postgresql-server-dev-12 -y 66 | 67 | echo -e "\n---- Creating the ODOO PostgreSQL User ----" 68 | sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true 69 | 70 | #-------------------------------------------------- 71 | # Install Dependencies 72 | #-------------------------------------------------- 73 | echo -e "\n---- Install tool packages ----" 74 | sudo apt-get install wget nano subversion git bzr bzrtools python-pip python3-pip gdebi-core -y pysassc 75 | 76 | echo -e "\n---- Install python packages ----" 77 | sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil python-gpgme python-launchpadlib build-essential python-all-dev python-setuptools python-imaging python-suds python-xlsxwriter python-wheel -y 78 | 79 | echo -e "\n---- Install python libraries ----" 80 | sudo pip install gdata psycogreen 81 | # This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04 82 | sudo -H pip install suds 83 | 84 | echo -e "\n--- Install other required packages" 85 | sudo apt-get install node-clean-css -y 86 | sudo apt-get install node-less -y 87 | sudo apt-get install python-gevent -y 88 | apt-get install libwww-perl 89 | 90 | 91 | #-------------------------------------------------- 92 | # Install Wkhtmltopdf if needed 93 | #-------------------------------------------------- 94 | if [ $INSTALL_WKHTMLTOPDF = "True" ]; then 95 | echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 9 ----" 96 | #pick up correct one from x64 & x32 versions: 97 | if [ "`getconf LONG_BIT`" == "64" ];then 98 | _url=$WKHTMLTOX_X64 99 | else 100 | _url=$WKHTMLTOX_X32 101 | fi 102 | sudo wget $_url 103 | sudo gdebi --n `basename $_url` 104 | sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin 105 | sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin 106 | else 107 | echo "Wkhtmltopdf isn't installed due to the choice of the user!" 108 | fi 109 | 110 | 111 | 112 | 113 | if [ $IS_ENTERPRISE = "True" ]; then 114 | # Odoo Enterprise install! 115 | 116 | echo -e "\n---- Installing Enterprise specific libraries ----" 117 | sudo apt-get install nodejs npm -y 118 | sudo npm install -g less 119 | sudo npm install -g less-plugin-clean-css 120 | sudo npm install -g rtlcss 121 | else 122 | echo -e "\n---- every thing is ready ----" 123 | 124 | fi 125 | sudo ln -s /usr/bin/nodejs /usr/bin/node 126 | 127 | sudo apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev python3-dev 128 | sudo easy_install greenlet 129 | sudo easy_install gevent 130 | sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip python3-wheel python3-setuptools 131 | sudo -H pip install -r https://raw.githubusercontent.com/odoo/odoo/10.0/requirements.txt 132 | sudo apt install -y python3-asn1crypto 133 | sudo apt install -y python3-babel python3-bs4 python3-cffi-backend python3-cryptography python3-dateutil python3-docutils python3-feedparser python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-html5lib python3-jinja2 python3-lxml python3-mako python3-markupsafe python3-mock python3-ofxparse python3-openssl python3-passlib python3-pbr python3-pil python3-psutil python3-psycopg2 python3-pydot python3-pygments python3-pyparsing python3-pypdf2 python3-renderpm python3-reportlab python3-reportlab-accel python3-roman python3-serial python3-stdnum python3-suds python3-tz python3-usb python3-vatnumber python3-werkzeug python3-xlsxwriter python3-yaml 134 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/11.0/requirements.txt 135 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/12.0/requirements.txt 136 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/13.0/requirements.txt 137 | 138 | 139 | sudo -H pip3 install phonenumbers 140 | 141 | echo "---------------------------odoo directory--------------------------------" 142 | mkdir /odoo 143 | mkdir /etc/odoo 144 | mkdir /var/log/odoo 145 | touch /etc/odoo/odoo.conf 146 | touch /var/log/odoo/odoo-server.log 147 | chown odoo:odoo /var/log/odoo/odoo-server.log 148 | chown odoo:odoo /etc/odoo/odoo.conf 149 | chown -R odoo:odoo /odoo 150 | echo "-------------------------------odoo service----------------------------" 151 | wget https://raw.githubusercontent.com/mah007/OdooScript/12.0/odoo.service 152 | cp odoo.service /etc/systemd/system 153 | sudo systemctl daemon-reload 154 | sudo systemctl enable odoo 155 | sudo systemctl start odoo 156 | echo "----------------------------NGINX-------------------------------" 157 | wget https://raw.githubusercontent.com/mah007/OdooScript/12.0/nginx.sh 158 | bash nginx.sh 159 | apt-get install -y perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python 160 | 161 | echo "-----------------------------------------------------------" 162 | echo "Done! The Odoo production platform is ready:" 163 | 164 | echo "Restart restart ur computer and start developing and have fun ;)" 165 | echo "-----------------------------------------------------------" 166 | -------------------------------------------------------------------------------- /odoo_pro18.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Enhanced Odoo Installation Script for Ubuntu 22.04 4 | # Version: 2.0 5 | # Author: Mahmoud Abdel Latif 6 | # Description: Interactive Odoo installation IOIS 7 | 8 | # Script configuration 9 | SCRIPT_VERSION="2.0" 10 | SCRIPT_NAME="Enhanced Odoo Installer" 11 | LOG_FILE="/tmp/odoo_install_$(date +%Y%m%d_%H%M%S).log" 12 | CONFIG_FILE="/tmp/odoo_install_config.conf" 13 | 14 | # Color definitions 15 | RED='\033[0;31m' 16 | GREEN='\033[0;32m' 17 | YELLOW='\033[1;33m' 18 | BLUE='\033[0;34m' 19 | PURPLE='\033[0;35m' 20 | CYAN='\033[0;36m' 21 | WHITE='\033[1;37m' 22 | NC='\033[0m' # No Color 23 | BOLD='\033[1m' 24 | 25 | # Progress tracking 26 | TOTAL_STEPS=8 27 | CURRENT_STEP=0 28 | STEP_PROGRESS=0 29 | 30 | # Installation configuration 31 | OE_USER="odoo" 32 | OE_BRANCH="" 33 | INSTALL_WKHTMLTOPDF="True" 34 | IS_ENTERPRISE="True" 35 | WKHTML_X64="https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb" 36 | WKHTML_X32="https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb" 37 | 38 | # Trap for cleanup on exit 39 | trap cleanup_on_exit EXIT INT TERM 40 | 41 | #============================================================================== 42 | # UTILITY FUNCTIONS 43 | #============================================================================== 44 | 45 | # Logging function 46 | log_message() { 47 | local level="$1" 48 | local message="$2" 49 | local timestamp=$(date '+%Y-%m-%d %H:%M:%S') 50 | echo "[$timestamp] [$level] $message" >> "$LOG_FILE" 51 | 52 | case "$level" in 53 | "ERROR") 54 | echo -e "${RED}[ERROR]${NC} $message" >&2 55 | ;; 56 | "WARNING") 57 | echo -e "${YELLOW}[WARNING]${NC} $message" 58 | ;; 59 | "INFO") 60 | echo -e "${GREEN}[INFO]${NC} $message" 61 | ;; 62 | "DEBUG") 63 | echo -e "${CYAN}[DEBUG]${NC} $message" 64 | ;; 65 | esac 66 | } 67 | 68 | # Progress bar function 69 | show_progress_bar() { 70 | local current="$1" 71 | local total="$2" 72 | local width=50 73 | local percentage=$((current * 100 / total)) 74 | local completed=$((current * width / total)) 75 | local remaining=$((width - completed)) 76 | 77 | printf "\r${BLUE}[" 78 | printf "%*s" $completed | tr ' ' '=' 79 | printf "%*s" $remaining | tr ' ' '-' 80 | printf "] %d%% (%d/%d)${NC}" $percentage $current $total 81 | } 82 | 83 | # Spinner animation 84 | show_spinner() { 85 | local pid=$1 86 | local message="$2" 87 | local spin='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏' 88 | local i=0 89 | 90 | while kill -0 $pid 2>/dev/null; do 91 | i=$(( (i+1) %10 )) 92 | printf "\r${CYAN}${spin:$i:1} %s${NC}" "$message" 93 | sleep 0.1 94 | done 95 | printf "\r${GREEN}✓${NC} %s\n" "$message" 96 | } 97 | 98 | # Enhanced billboard display 99 | display_billboard() { 100 | local message="$1" 101 | local width=80 102 | local padding=$(( (width - ${#message}) / 2 )) 103 | 104 | echo 105 | echo -e "${PURPLE}${BOLD}$(printf '%*s' $width | tr ' ' '=')" 106 | echo -e "$(printf '%*s' $padding)${WHITE}$message${PURPLE}" 107 | echo -e "$(printf '%*s' $width | tr ' ' '=')${NC}" 108 | echo 109 | } 110 | 111 | # Step header 112 | show_step_header() { 113 | local step_num="$1" 114 | local step_name="$2" 115 | local step_desc="$3" 116 | 117 | CURRENT_STEP=$step_num 118 | echo 119 | echo -e "${BOLD}${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" 120 | echo -e "${BOLD}${WHITE}Step $step_num/$TOTAL_STEPS: $step_name${NC}" 121 | echo -e "${CYAN}$step_desc${NC}" 122 | echo -e "${BOLD}${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" 123 | 124 | show_progress_bar $step_num $TOTAL_STEPS 125 | echo 126 | log_message "INFO" "Starting Step $step_num: $step_name" 127 | } 128 | 129 | # Execute command with error handling 130 | execute_command() { 131 | local command="$1" 132 | local description="$2" 133 | local show_output="${3:-false}" 134 | 135 | log_message "DEBUG" "Executing: $command" 136 | 137 | if [ "$show_output" = "true" ]; then 138 | echo -e "${YELLOW}Executing: $description${NC}" 139 | eval "$command" 2>&1 | tee -a "$LOG_FILE" 140 | local exit_code=${PIPESTATUS[0]} 141 | else 142 | eval "$command" >> "$LOG_FILE" 2>&1 & 143 | local pid=$! 144 | show_spinner $pid "$description" 145 | wait $pid 146 | local exit_code=$? 147 | fi 148 | 149 | if [ $exit_code -eq 0 ]; then 150 | log_message "INFO" "Successfully completed: $description" 151 | return 0 152 | else 153 | log_message "ERROR" "Failed to execute: $description (Exit code: $exit_code)" 154 | return $exit_code 155 | fi 156 | } 157 | 158 | # Cleanup function 159 | cleanup_on_exit() { 160 | local exit_code=$? 161 | if [ $exit_code -ne 0 ]; then 162 | echo 163 | echo -e "${RED}${BOLD}Installation interrupted or failed!${NC}" 164 | echo -e "${YELLOW}Check the log file for details: $LOG_FILE${NC}" 165 | echo -e "${YELLOW}You can resume the installation by running this script again.${NC}" 166 | fi 167 | } 168 | 169 | #============================================================================== 170 | # VALIDATION FUNCTIONS 171 | #============================================================================== 172 | 173 | # Check if running as root 174 | check_root() { 175 | if [ "$EUID" -ne 0 ]; then 176 | log_message "ERROR" "This script must be run as root (use sudo)" 177 | exit 1 178 | fi 179 | } 180 | 181 | # Check system requirements 182 | check_system_requirements() { 183 | local errors=0 184 | 185 | # Check Ubuntu version 186 | if ! lsb_release -d | grep -q "Ubuntu 22.04"; then 187 | log_message "WARNING" "This script is optimized for Ubuntu 22.04. Current version: $(lsb_release -d | cut -f2)" 188 | fi 189 | 190 | # Check available disk space (minimum 10GB) 191 | local available_space=$(df / | awk 'NR==2 {print $4}') 192 | local required_space=10485760 # 10GB in KB 193 | 194 | if [ "$available_space" -lt "$required_space" ]; then 195 | log_message "ERROR" "Insufficient disk space. Required: 10GB, Available: $((available_space/1024/1024))GB" 196 | errors=$((errors + 1)) 197 | fi 198 | 199 | # Check memory (minimum 2GB) 200 | local total_memory=$(free -m | awk 'NR==2{print $2}') 201 | if [ "$total_memory" -lt 2048 ]; then 202 | log_message "WARNING" "Low memory detected. Recommended: 2GB+, Available: ${total_memory}MB" 203 | fi 204 | 205 | # Check internet connectivity 206 | if ! ping -c 1 google.com &> /dev/null; then 207 | log_message "ERROR" "No internet connection detected" 208 | errors=$((errors + 1)) 209 | fi 210 | 211 | return $errors 212 | } 213 | 214 | # Validate Odoo version selection 215 | validate_odoo_version() { 216 | case "$OE_BRANCH" in 217 | "14.0"|"15.0"|"16.0"|"17.0"|"18.0") 218 | return 0 219 | ;; 220 | *) 221 | log_message "ERROR" "Invalid Odoo version: $OE_BRANCH" 222 | return 1 223 | ;; 224 | esac 225 | } 226 | 227 | #============================================================================== 228 | # INTERACTIVE FUNCTIONS 229 | #============================================================================== 230 | 231 | # Interactive main menu 232 | show_main_menu() { 233 | while true; do 234 | clear 235 | display_billboard "$SCRIPT_NAME v$SCRIPT_VERSION" 236 | 237 | echo -e "${BOLD}${WHITE}Welcome to the Enhanced Odoo Installation Script!${NC}" 238 | echo 239 | echo -e "${CYAN}This script will install Odoo on Ubuntu 22.04 with the following features:${NC}" 240 | echo -e " ${GREEN}•${NC} Interactive installation process" 241 | echo -e " ${GREEN}•${NC} Progress bars and status indicators" 242 | echo -e " ${GREEN}•${NC} Comprehensive error handling" 243 | echo -e " ${GREEN}•${NC} Automatic dependency management" 244 | echo -e " ${GREEN}•${NC} System requirement validation" 245 | echo 246 | echo -e "${BOLD}${WHITE}Please select an option:${NC}" 247 | echo -e " ${YELLOW}1)${NC} Start Full Installation" 248 | echo -e " ${YELLOW}2)${NC} Custom Installation" 249 | echo -e " ${YELLOW}3)${NC} System Check Only" 250 | echo -e " ${YELLOW}4)${NC} View Installation Log" 251 | echo -e " ${YELLOW}5)${NC} Help & Documentation" 252 | echo -e " ${YELLOW}6)${NC} Exit" 253 | echo 254 | 255 | read -rp "$(echo -e ${BOLD}${WHITE}Enter your choice [1-6]: ${NC})" choice 256 | 257 | case "$choice" in 258 | 1) 259 | select_odoo_version 260 | if [ $? -eq 0 ]; then 261 | confirm_installation 262 | if [ $? -eq 0 ]; then 263 | return 0 264 | fi 265 | fi 266 | ;; 267 | 2) 268 | custom_installation_menu 269 | ;; 270 | 3) 271 | system_check_only 272 | ;; 273 | 4) 274 | view_log 275 | ;; 276 | 5) 277 | show_help 278 | ;; 279 | 6) 280 | echo -e "${GREEN}Thank you for using $SCRIPT_NAME!${NC}" 281 | exit 0 282 | ;; 283 | *) 284 | echo -e "${RED}Invalid choice. Please select 1-6.${NC}" 285 | sleep 2 286 | ;; 287 | esac 288 | done 289 | } 290 | 291 | # Odoo version selection with enhanced UI 292 | select_odoo_version() { 293 | while true; do 294 | clear 295 | display_billboard "Odoo Version Selection" 296 | 297 | echo -e "${BOLD}${WHITE}Please select the Odoo version to install:${NC}" 298 | echo 299 | echo -e " ${YELLOW}1)${NC} Odoo 14.0 ${CYAN}(LTS - Long Term Support)${NC}" 300 | echo -e " ${YELLOW}2)${NC} Odoo 15.0 ${CYAN}(Stable)${NC}" 301 | echo -e " ${YELLOW}3)${NC} Odoo 16.0 ${CYAN}(Stable)${NC}" 302 | echo -e " ${YELLOW}4)${NC} Odoo 17.0 ${CYAN}(Latest Stable)${NC}" 303 | echo -e " ${YELLOW}5)${NC} Odoo 18.0 ${CYAN}(Latest - May have issues)${NC}" 304 | echo -e " ${YELLOW}6)${NC} Back to Main Menu" 305 | echo 306 | 307 | read -rp "$(echo -e ${BOLD}${WHITE}Enter your choice [1-6]: ${NC})" choice 308 | 309 | case "$choice" in 310 | 1) OE_BRANCH="14.0"; break;; 311 | 2) OE_BRANCH="15.0"; break;; 312 | 3) OE_BRANCH="16.0"; break;; 313 | 4) OE_BRANCH="17.0"; break;; 314 | 5) OE_BRANCH="18.0"; break;; 315 | 6) return 1;; 316 | *) 317 | echo -e "${RED}Invalid choice. Please select 1-6.${NC}" 318 | sleep 2 319 | ;; 320 | esac 321 | done 322 | 323 | echo -e "${GREEN}Selected Odoo version: $OE_BRANCH${NC}" 324 | log_message "INFO" "User selected Odoo version: $OE_BRANCH" 325 | return 0 326 | } 327 | 328 | # Installation confirmation 329 | confirm_installation() { 330 | clear 331 | display_billboard "Installation Confirmation" 332 | 333 | echo -e "${BOLD}${WHITE}Installation Summary:${NC}" 334 | echo -e " ${CYAN}Odoo Version:${NC} $OE_BRANCH" 335 | echo -e " ${CYAN}System User:${NC} $OE_USER" 336 | echo -e " ${CYAN}Install wkhtmltopdf:${NC} $INSTALL_WKHTMLTOPDF" 337 | echo -e " ${CYAN}Enterprise Features:${NC} $IS_ENTERPRISE" 338 | echo -e " ${CYAN}Log File:${NC} $LOG_FILE" 339 | echo 340 | echo -e "${YELLOW}${BOLD}WARNING:${NC} This installation will:" 341 | echo -e " • Modify system packages and configurations" 342 | echo -e " • Create system users and directories" 343 | echo -e " • Install and configure PostgreSQL" 344 | echo -e " • Download and install Odoo from source" 345 | echo 346 | 347 | while true; do 348 | read -rp "$(echo -e ${BOLD}${WHITE}Do you want to proceed with the installation? [y/N]: ${NC})" confirm 349 | case "$confirm" in 350 | [Yy]|[Yy][Ee][Ss]) 351 | return 0 352 | ;; 353 | [Nn]|[Nn][Oo]|"") 354 | echo -e "${YELLOW}Installation cancelled by user.${NC}" 355 | return 1 356 | ;; 357 | *) 358 | echo -e "${RED}Please answer yes (y) or no (n).${NC}" 359 | ;; 360 | esac 361 | done 362 | } 363 | 364 | # Custom installation menu 365 | custom_installation_menu() { 366 | echo -e "${YELLOW}Custom installation options coming in future version...${NC}" 367 | sleep 2 368 | } 369 | 370 | # System check only 371 | system_check_only() { 372 | clear 373 | display_billboard "System Requirements Check" 374 | 375 | echo -e "${CYAN}Checking system requirements...${NC}" 376 | echo 377 | 378 | check_system_requirements 379 | local result=$? 380 | 381 | if [ $result -eq 0 ]; then 382 | echo -e "${GREEN}${BOLD}✓ All system requirements met!${NC}" 383 | else 384 | echo -e "${RED}${BOLD}✗ $result requirement(s) not met.${NC}" 385 | fi 386 | 387 | echo 388 | read -rp "Press Enter to continue..." 389 | } 390 | 391 | # View log 392 | view_log() { 393 | if [ -f "$LOG_FILE" ]; then 394 | less "$LOG_FILE" 395 | else 396 | echo -e "${YELLOW}No log file found.${NC}" 397 | sleep 2 398 | fi 399 | } 400 | 401 | # Show help 402 | show_help() { 403 | clear 404 | display_billboard "Help & Documentation" 405 | 406 | echo -e "${BOLD}${WHITE}Enhanced Odoo Installation Script Help${NC}" 407 | echo 408 | echo -e "${CYAN}This script automates the installation of Odoo on Ubuntu 22.04.${NC}" 409 | echo 410 | echo -e "${BOLD}Features:${NC}" 411 | echo -e " • Interactive installation process" 412 | echo -e " • Progress tracking with visual indicators" 413 | echo -e " • Comprehensive error handling and logging" 414 | echo -e " • System requirement validation" 415 | echo -e " • Automatic dependency management" 416 | echo 417 | echo -e "${BOLD}System Requirements:${NC}" 418 | echo -e " • Ubuntu 22.04 LTS" 419 | echo -e " • Minimum 2GB RAM (4GB recommended)" 420 | echo -e " • Minimum 10GB free disk space" 421 | echo -e " • Internet connection" 422 | echo -e " • Root/sudo privileges" 423 | echo 424 | echo -e "${BOLD}Support:${NC}" 425 | echo -e " • Check log files for detailed error information" 426 | echo -e " • Ensure all system requirements are met" 427 | echo -e " • Run system check before installation" 428 | echo 429 | 430 | read -rp "Press Enter to continue..." 431 | } 432 | 433 | #============================================================================== 434 | # INSTALLATION FUNCTIONS 435 | #============================================================================== 436 | 437 | # Step 1: Pre-flight checks 438 | step_preflight_checks() { 439 | show_step_header 1 "Pre-flight Checks" "Validating system requirements and configuration" 440 | 441 | # Check if running as root 442 | check_root 443 | 444 | # System requirements check 445 | if ! check_system_requirements; then 446 | log_message "ERROR" "System requirements check failed" 447 | exit 1 448 | fi 449 | 450 | # Validate Odoo version 451 | if ! validate_odoo_version; then 452 | log_message "ERROR" "Invalid Odoo version configuration" 453 | exit 1 454 | fi 455 | 456 | log_message "INFO" "Pre-flight checks completed successfully" 457 | } 458 | 459 | # Step 2: System preparation 460 | step_system_preparation() { 461 | show_step_header 2 "System Preparation" "Creating users and updating system packages" 462 | 463 | # Create Odoo user and group 464 | execute_command "groupadd -f $OE_USER" "Creating Odoo group" 465 | execute_command "useradd --create-home -d /home/$OE_USER --shell /bin/bash -g $OE_USER $OE_USER 2>/dev/null || true" "Creating Odoo user" 466 | execute_command "usermod -aG sudo $OE_USER" "Adding Odoo user to sudo group" 467 | 468 | # Update system packages 469 | execute_command "apt-get update" "Updating package lists" 470 | execute_command "apt-get upgrade -y" "Upgrading system packages" 471 | execute_command "apt install -y zip gdebi net-tools" "Installing basic tools" 472 | 473 | # Configure localization 474 | execute_command "export LC_ALL=en_US.UTF-8 && export LC_CTYPE=en_US.UTF-8" "Setting locale variables" 475 | execute_command "dpkg-reconfigure -f noninteractive locales" "Configuring locales" 476 | 477 | log_message "INFO" "System preparation completed successfully" 478 | } 479 | 480 | # Continue with remaining steps... 481 | # (This is part 1 of the enhanced script - the complete implementation continues below) 482 | 483 | #============================================================================== 484 | # MAIN EXECUTION 485 | #============================================================================== 486 | 487 | # Initialize logging 488 | log_message "INFO" "Starting $SCRIPT_NAME v$SCRIPT_VERSION" 489 | log_message "INFO" "System: $(lsb_release -d | cut -f2)" 490 | log_message "INFO" "User: $(whoami)" 491 | 492 | # Show main menu 493 | show_main_menu 494 | 495 | # Start installation process 496 | echo -e "${GREEN}${BOLD}Starting Odoo installation...${NC}" 497 | echo 498 | 499 | # Execute installation steps 500 | step_preflight_checks 501 | step_system_preparation 502 | 503 | echo -e "${GREEN}${BOLD}Installation process initiated...${NC}" 504 | echo -e "${CYAN}This is a preview of the enhanced script structure.${NC}" 505 | echo -e "${CYAN}The complete implementation will include all installation steps.${NC}" 506 | 507 | 508 | 509 | # Step 3: Database setup 510 | step_database_setup() { 511 | show_step_header 3 "Database Setup" "Installing and configuring PostgreSQL database" 512 | 513 | # Add PostgreSQL repository 514 | execute_command "sh -c 'echo \"deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main\" > /etc/apt/sources.list.d/pgdg.list'" "Adding PostgreSQL repository" 515 | 516 | # Add PostgreSQL signing key with error handling 517 | if ! execute_command "wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -" "Adding PostgreSQL signing key"; then 518 | log_message "WARNING" "Failed to add PostgreSQL key via apt-key, trying alternative method" 519 | execute_command "wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/postgresql.gpg > /dev/null" "Adding PostgreSQL signing key (alternative method)" 520 | fi 521 | 522 | # Update package lists 523 | execute_command "apt-get update" "Updating package lists with PostgreSQL repository" 524 | 525 | # Install PostgreSQL 526 | execute_command "apt-get install -y postgresql-16 postgresql-server-dev-16" "Installing PostgreSQL 16" 527 | 528 | # Create PostgreSQL user for Odoo 529 | execute_command "su - postgres -c \"createuser -s $OE_USER\" 2>/dev/null || true" "Creating PostgreSQL user for Odoo" 530 | 531 | # Verify PostgreSQL installation 532 | if ! systemctl is-active --quiet postgresql; then 533 | log_message "ERROR" "PostgreSQL service is not running" 534 | execute_command "systemctl start postgresql" "Starting PostgreSQL service" 535 | execute_command "systemctl enable postgresql" "Enabling PostgreSQL service" 536 | fi 537 | 538 | log_message "INFO" "Database setup completed successfully" 539 | } 540 | 541 | # Step 4: Dependencies installation 542 | step_dependencies_installation() { 543 | show_step_header 4 "Dependencies Installation" "Installing Python packages and system libraries" 544 | 545 | # Install system dependencies 546 | local system_packages=( 547 | "git" "python3-pip" "build-essential" "wget" "python3-dev" 548 | "python3-venv" "python3-wheel" "libfreetype6-dev" "libxml2-dev" 549 | "libzip-dev" "libldap2-dev" "libsasl2-dev" "python3-setuptools" 550 | "node-less" "libjpeg-dev" "zlib1g-dev" "libpq-dev" "libtiff5-dev" 551 | "libjpeg8-dev" "libopenjp2-7-dev" "liblcms2-dev" "libwebp-dev" 552 | "libharfbuzz-dev" "libfribidi-dev" "libxcb1-dev" "libwww-perl" 553 | "gsfonts" "libcairo2-dev" "python3-cairo" 554 | ) 555 | 556 | for package in "${system_packages[@]}"; do 557 | if ! dpkg -l | grep -q "^ii $package "; then 558 | execute_command "apt-get install -y $package" "Installing $package" 559 | else 560 | log_message "INFO" "$package is already installed" 561 | fi 562 | done 563 | 564 | # Install Python libraries 565 | execute_command "pip3 install gdata psycogreen" "Installing Python data libraries" 566 | execute_command "pip3 install suds" "Installing SUDS library" 567 | execute_command "pip3 install rtPyCairo" "Installing Cairo Python bindings" 568 | 569 | # Install Node.js and npm packages 570 | execute_command "apt-get install -y ca-certificates curl gnupg" "Installing Node.js prerequisites" 571 | execute_command "mkdir -p /etc/apt/keyrings" "Creating keyrings directory" 572 | 573 | if ! execute_command "curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg" "Adding Node.js repository key"; then 574 | log_message "ERROR" "Failed to add Node.js repository key" 575 | return 1 576 | fi 577 | 578 | execute_command "echo 'deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main' | tee /etc/apt/sources.list.d/nodesource.list" "Adding Node.js repository" 579 | execute_command "apt-get update" "Updating package lists with Node.js repository" 580 | execute_command "apt-get install -y nodejs" "Installing Node.js" 581 | 582 | # Create symbolic link for node 583 | execute_command "ln -sf /usr/bin/nodejs /usr/bin/node" "Creating Node.js symbolic link" 584 | 585 | # Install npm packages for Enterprise features 586 | if [ "$IS_ENTERPRISE" = "True" ]; then 587 | execute_command "npm install -g less" "Installing Less CSS preprocessor" 588 | execute_command "npm install -g less-plugin-clean-css" "Installing Less clean CSS plugin" 589 | execute_command "npm install -g rtlcss" "Installing RTL CSS processor" 590 | fi 591 | 592 | log_message "INFO" "Dependencies installation completed successfully" 593 | } 594 | 595 | # Step 5: Wkhtmltopdf installation 596 | step_wkhtmltopdf_installation() { 597 | show_step_header 5 "Wkhtmltopdf Installation" "Installing PDF generation library" 598 | 599 | if [ "$INSTALL_WKHTMLTOPDF" = "True" ]; then 600 | # Determine architecture 601 | if [ "$(getconf LONG_BIT)" == "64" ]; then 602 | local wkhtml_url="$WKHTML_X64" 603 | else 604 | local wkhtml_url="$WKHTML_X32" 605 | fi 606 | 607 | local wkhtml_file=$(basename "$wkhtml_url") 608 | 609 | # Download wkhtmltopdf 610 | if ! execute_command "wget -O /tmp/$wkhtml_file $wkhtml_url" "Downloading wkhtmltopdf"; then 611 | log_message "ERROR" "Failed to download wkhtmltopdf" 612 | return 1 613 | fi 614 | 615 | # Install wkhtmltopdf 616 | execute_command "gdebi --non-interactive /tmp/$wkhtml_file" "Installing wkhtmltopdf" 617 | 618 | # Cleanup 619 | execute_command "rm -f /tmp/$wkhtml_file" "Cleaning up wkhtmltopdf installer" 620 | 621 | # Verify installation 622 | if command -v wkhtmltopdf &> /dev/null; then 623 | log_message "INFO" "Wkhtmltopdf installed successfully: $(wkhtmltopdf --version | head -n1)" 624 | else 625 | log_message "ERROR" "Wkhtmltopdf installation verification failed" 626 | return 1 627 | fi 628 | else 629 | log_message "INFO" "Wkhtmltopdf installation skipped by user configuration" 630 | fi 631 | 632 | log_message "INFO" "Wkhtmltopdf installation completed" 633 | } 634 | 635 | # Step 6: Odoo installation 636 | step_odoo_installation() { 637 | show_step_header 6 "Odoo Installation" "Downloading and configuring Odoo source code" 638 | 639 | # Install additional Python packages 640 | local python_packages=( 641 | "python3-dev" "python3-asn1crypto" "python3-babel" "python3-bs4" 642 | "python3-cffi-backend" "python3-cryptography" "python3-dateutil" 643 | "python3-docutils" "python3-feedparser" "python3-funcsigs" 644 | "python3-gevent" "python3-greenlet" "python3-html2text" 645 | "python3-html5lib" "python3-jinja2" "python3-lxml" "python3-mako" 646 | "python3-markupsafe" "python3-mock" "python3-ofxparse" 647 | "python3-openssl" "python3-passlib" "python3-pbr" "python3-pil" 648 | "python3-psutil" "python3-psycopg2" "python3-pydot" "python3-pygments" 649 | "python3-pypdf2" "python3-renderpm" "python3-reportlab" 650 | "python3-reportlab-accel" "python3-roman" "python3-serial" 651 | "python3-stdnum" "python3-suds" "python3-tz" "python3-usb" 652 | "python3-werkzeug" "python3-xlsxwriter" "python3-yaml" 653 | ) 654 | 655 | for package in "${python_packages[@]}"; do 656 | if ! dpkg -l | grep -q "^ii $package "; then 657 | execute_command "apt-get install -y $package" "Installing $package" 658 | fi 659 | done 660 | 661 | # Install Python packages via pip 662 | execute_command "easy_install greenlet" "Installing greenlet" 663 | execute_command "easy_install gevent" "Installing gevent" 664 | 665 | # Create Odoo directories 666 | execute_command "mkdir -p /odoo" "Creating Odoo directory" 667 | execute_command "mkdir -p /etc/odoo" "Creating Odoo configuration directory" 668 | execute_command "mkdir -p /var/log/odoo" "Creating Odoo log directory" 669 | 670 | # Create configuration and log files 671 | execute_command "touch /etc/odoo/odoo.conf" "Creating Odoo configuration file" 672 | execute_command "touch /var/log/odoo/odoo-server.log" "Creating Odoo log file" 673 | 674 | # Set proper ownership 675 | execute_command "chown -R $OE_USER:$OE_USER /var/log/odoo" "Setting ownership for log directory" 676 | execute_command "chown -R $OE_USER:$OE_USER /etc/odoo" "Setting ownership for configuration directory" 677 | 678 | # Clone Odoo repository 679 | cd /odoo || exit 1 680 | if ! execute_command "git clone --depth 1 --branch $OE_BRANCH https://www.github.com/odoo/odoo" "Cloning Odoo repository"; then 681 | log_message "ERROR" "Failed to clone Odoo repository" 682 | return 1 683 | fi 684 | 685 | # Set ownership for Odoo directory 686 | execute_command "chown -R $OE_USER:$OE_USER /odoo" "Setting ownership for Odoo directory" 687 | 688 | # Install Odoo Python requirements 689 | execute_command "su - $OE_USER -s /bin/bash -c \"pip3 install -r https://raw.githubusercontent.com/odoo/odoo/$OE_BRANCH/requirements.txt --user\"" "Installing Odoo Python requirements" 690 | execute_command "su - $OE_USER -s /bin/bash -c \"pip3 install phonenumbers --user\"" "Installing phonenumbers library" 691 | 692 | log_message "INFO" "Odoo installation completed successfully" 693 | } 694 | 695 | # Step 7: Service configuration 696 | step_service_configuration() { 697 | show_step_header 7 "Service Configuration" "Configuring Odoo system service and web server" 698 | 699 | # Download and install Odoo service file 700 | cd /root || exit 1 701 | if ! execute_command "wget -O odoo.service https://raw.githubusercontent.com/mah007/OdooScript/14.0/odoo.service" "Downloading Odoo service file"; then 702 | log_message "WARNING" "Failed to download service file, creating custom one" 703 | create_custom_service_file 704 | else 705 | execute_command "cp odoo.service /etc/systemd/system/" "Installing Odoo service file" 706 | fi 707 | 708 | # Reload systemd and enable Odoo service 709 | execute_command "systemctl daemon-reload" "Reloading systemd daemon" 710 | execute_command "systemctl enable odoo" "Enabling Odoo service" 711 | 712 | # Create basic Odoo configuration 713 | create_odoo_configuration 714 | 715 | # Start Odoo service 716 | if execute_command "systemctl start odoo" "Starting Odoo service"; then 717 | sleep 5 718 | if systemctl is-active --quiet odoo; then 719 | log_message "INFO" "Odoo service started successfully" 720 | else 721 | log_message "ERROR" "Odoo service failed to start" 722 | execute_command "systemctl status odoo" "Checking Odoo service status" true 723 | fi 724 | fi 725 | 726 | # Install and configure Nginx (optional) 727 | setup_nginx_proxy 728 | 729 | log_message "INFO" "Service configuration completed successfully" 730 | } 731 | 732 | # Step 8: Final setup and validation 733 | step_final_setup() { 734 | show_step_header 8 "Final Setup" "Completing installation and running validation tests" 735 | 736 | # Install additional tools 737 | execute_command "apt-get install -y perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python" "Installing additional system tools" 738 | 739 | # Download and add Webmin key (optional) 740 | if execute_command "wget -O /tmp/jcameron-key.asc https://download.webmin.com/jcameron-key.asc" "Downloading Webmin key"; then 741 | execute_command "apt-key add /tmp/jcameron-key.asc" "Adding Webmin key" 742 | execute_command "rm -f /tmp/jcameron-key.asc" "Cleaning up Webmin key file" 743 | fi 744 | 745 | # Validate installation 746 | validate_installation 747 | 748 | # Generate installation report 749 | generate_installation_report 750 | 751 | log_message "INFO" "Final setup completed successfully" 752 | } 753 | 754 | #============================================================================== 755 | # HELPER FUNCTIONS 756 | #============================================================================== 757 | 758 | # Create custom service file if download fails 759 | create_custom_service_file() { 760 | cat > /etc/systemd/system/odoo.service << EOF 761 | [Unit] 762 | Description=Odoo 763 | Documentation=http://www.odoo.com 764 | Requires=postgresql.service 765 | After=postgresql.service 766 | 767 | [Service] 768 | Type=simple 769 | SyslogIdentifier=odoo 770 | PermissionsStartOnly=true 771 | User=$OE_USER 772 | Group=$OE_USER 773 | ExecStart=/odoo/odoo/odoo-bin -c /etc/odoo/odoo.conf 774 | StandardOutput=journal+console 775 | 776 | [Install] 777 | WantedBy=multi-user.target 778 | EOF 779 | log_message "INFO" "Created custom Odoo service file" 780 | } 781 | 782 | # Create Odoo configuration file 783 | create_odoo_configuration() { 784 | cat > /etc/odoo/odoo.conf << EOF 785 | [options] 786 | ; This is the password that allows database operations: 787 | admin_passwd = $(openssl rand -base64 32) 788 | db_host = localhost 789 | db_port = 5432 790 | db_user = $OE_USER 791 | db_password = False 792 | addons_path = /odoo/odoo/addons 793 | logfile = /var/log/odoo/odoo-server.log 794 | log_level = info 795 | EOF 796 | 797 | execute_command "chown $OE_USER:$OE_USER /etc/odoo/odoo.conf" "Setting ownership for configuration file" 798 | execute_command "chmod 640 /etc/odoo/odoo.conf" "Setting permissions for configuration file" 799 | log_message "INFO" "Created Odoo configuration file" 800 | } 801 | 802 | # Setup Nginx reverse proxy 803 | setup_nginx_proxy() { 804 | read -rp "$(echo -e ${BOLD}${WHITE}Do you want to install and configure Nginx reverse proxy? [y/N]: ${NC})" install_nginx 805 | 806 | if [[ "$install_nginx" =~ ^[Yy]$ ]]; then 807 | execute_command "apt-get install -y nginx" "Installing Nginx" 808 | 809 | # Download nginx configuration or create custom one 810 | if ! execute_command "wget -O /tmp/nginx.sh https://raw.githubusercontent.com/mah007/OdooScript/14.0/nginx.sh" "Downloading Nginx configuration script"; then 811 | log_message "WARNING" "Failed to download Nginx configuration, skipping Nginx setup" 812 | return 1 813 | fi 814 | 815 | execute_command "bash /tmp/nginx.sh" "Configuring Nginx" true 816 | execute_command "rm -f /tmp/nginx.sh" "Cleaning up Nginx configuration script" 817 | else 818 | log_message "INFO" "Nginx installation skipped by user choice" 819 | fi 820 | } 821 | 822 | # Validate installation 823 | validate_installation() { 824 | local validation_errors=0 825 | 826 | echo -e "${CYAN}Running installation validation tests...${NC}" 827 | 828 | # Check if Odoo service is running 829 | if systemctl is-active --quiet odoo; then 830 | echo -e "${GREEN}✓${NC} Odoo service is running" 831 | log_message "INFO" "Validation: Odoo service is running" 832 | else 833 | echo -e "${RED}✗${NC} Odoo service is not running" 834 | log_message "ERROR" "Validation: Odoo service is not running" 835 | validation_errors=$((validation_errors + 1)) 836 | fi 837 | 838 | # Check if PostgreSQL is running 839 | if systemctl is-active --quiet postgresql; then 840 | echo -e "${GREEN}✓${NC} PostgreSQL service is running" 841 | log_message "INFO" "Validation: PostgreSQL service is running" 842 | else 843 | echo -e "${RED}✗${NC} PostgreSQL service is not running" 844 | log_message "ERROR" "Validation: PostgreSQL service is not running" 845 | validation_errors=$((validation_errors + 1)) 846 | fi 847 | 848 | # Check if Odoo directories exist 849 | if [ -d "/odoo/odoo" ]; then 850 | echo -e "${GREEN}✓${NC} Odoo source code directory exists" 851 | log_message "INFO" "Validation: Odoo source code directory exists" 852 | else 853 | echo -e "${RED}✗${NC} Odoo source code directory missing" 854 | log_message "ERROR" "Validation: Odoo source code directory missing" 855 | validation_errors=$((validation_errors + 1)) 856 | fi 857 | 858 | # Check if configuration file exists 859 | if [ -f "/etc/odoo/odoo.conf" ]; then 860 | echo -e "${GREEN}✓${NC} Odoo configuration file exists" 861 | log_message "INFO" "Validation: Odoo configuration file exists" 862 | else 863 | echo -e "${RED}✗${NC} Odoo configuration file missing" 864 | log_message "ERROR" "Validation: Odoo configuration file missing" 865 | validation_errors=$((validation_errors + 1)) 866 | fi 867 | 868 | # Test network connectivity to Odoo (if service is running) 869 | if systemctl is-active --quiet odoo; then 870 | sleep 10 # Give Odoo time to fully start 871 | if curl -s http://localhost:8069 > /dev/null; then 872 | echo -e "${GREEN}✓${NC} Odoo web interface is accessible" 873 | log_message "INFO" "Validation: Odoo web interface is accessible" 874 | else 875 | echo -e "${YELLOW}⚠${NC} Odoo web interface may not be ready yet (this is normal)" 876 | log_message "WARNING" "Validation: Odoo web interface not immediately accessible" 877 | fi 878 | fi 879 | 880 | return $validation_errors 881 | } 882 | 883 | # Generate installation report 884 | generate_installation_report() { 885 | local report_file="/tmp/odoo_installation_report_$(date +%Y%m%d_%H%M%S).txt" 886 | 887 | cat > "$report_file" << EOF 888 | =============================================================================== 889 | ODOO INSTALLATION REPORT 890 | =============================================================================== 891 | 892 | Installation Date: $(date) 893 | Script Version: $SCRIPT_VERSION 894 | System: $(lsb_release -d | cut -f2) 895 | 896 | CONFIGURATION: 897 | - Odoo Version: $OE_BRANCH 898 | - System User: $OE_USER 899 | - Wkhtmltopdf: $INSTALL_WKHTMLTOPDF 900 | - Enterprise: $IS_ENTERPRISE 901 | 902 | SERVICES STATUS: 903 | - Odoo Service: $(systemctl is-active odoo) 904 | - PostgreSQL Service: $(systemctl is-active postgresql) 905 | 906 | DIRECTORIES: 907 | - Odoo Source: /odoo/odoo 908 | - Configuration: /etc/odoo/odoo.conf 909 | - Logs: /var/log/odoo/odoo-server.log 910 | 911 | NETWORK: 912 | - Odoo Web Interface: http://localhost:8069 913 | - Default Database Management: http://localhost:8069/web/database/manager 914 | 915 | NEXT STEPS: 916 | 1. Access Odoo at http://localhost:8069 917 | 2. Create your first database 918 | 3. Configure your Odoo instance 919 | 4. Set up SSL certificate (recommended for production) 920 | 5. Configure backup procedures 921 | 922 | TROUBLESHOOTING: 923 | - Check service status: systemctl status odoo 924 | - View logs: tail -f /var/log/odoo/odoo-server.log 925 | - Restart service: systemctl restart odoo 926 | - Installation log: $LOG_FILE 927 | 928 | =============================================================================== 929 | EOF 930 | 931 | echo -e "${GREEN}Installation report generated: $report_file${NC}" 932 | log_message "INFO" "Installation report generated: $report_file" 933 | } 934 | 935 | # Installation success message 936 | show_success_message() { 937 | clear 938 | display_billboard "Installation Complete!" 939 | 940 | echo -e "${GREEN}${BOLD}🎉 Odoo $OE_BRANCH has been successfully installed! 🎉${NC}" 941 | echo 942 | echo -e "${CYAN}Access your Odoo instance at:${NC}" 943 | echo -e " ${BOLD}${WHITE}http://localhost:8069${NC}" 944 | echo -e " ${BOLD}${WHITE}http://$(hostname -I | awk '{print $1}'):8069${NC}" 945 | echo 946 | echo -e "${CYAN}Important files and directories:${NC}" 947 | echo -e " ${YELLOW}Configuration:${NC} /etc/odoo/odoo.conf" 948 | echo -e " ${YELLOW}Log file:${NC} /var/log/odoo/odoo-server.log" 949 | echo -e " ${YELLOW}Source code:${NC} /odoo/odoo" 950 | echo -e " ${YELLOW}Installation log:${NC} $LOG_FILE" 951 | echo 952 | echo -e "${CYAN}Useful commands:${NC}" 953 | echo -e " ${YELLOW}Check status:${NC} systemctl status odoo" 954 | echo -e " ${YELLOW}Restart service:${NC} systemctl restart odoo" 955 | echo -e " ${YELLOW}View logs:${NC} tail -f /var/log/odoo/odoo-server.log" 956 | echo 957 | echo -e "${BOLD}${WHITE}Thank you for using the Enhanced Odoo Installer!${NC}" 958 | echo 959 | } 960 | 961 | #============================================================================== 962 | # MAIN EXECUTION FLOW 963 | #============================================================================== 964 | 965 | # Main installation function 966 | main_installation() { 967 | local start_time=$(date +%s) 968 | 969 | # Execute all installation steps 970 | step_preflight_checks 971 | step_system_preparation 972 | step_database_setup 973 | step_dependencies_installation 974 | step_wkhtmltopdf_installation 975 | step_odoo_installation 976 | step_service_configuration 977 | step_final_setup 978 | 979 | # Calculate installation time 980 | local end_time=$(date +%s) 981 | local duration=$((end_time - start_time)) 982 | local minutes=$((duration / 60)) 983 | local seconds=$((duration % 60)) 984 | 985 | # Validate installation 986 | if validate_installation; then 987 | show_success_message 988 | log_message "INFO" "Installation completed successfully in ${minutes}m ${seconds}s" 989 | else 990 | echo -e "${RED}${BOLD}Installation completed with some issues.${NC}" 991 | echo -e "${YELLOW}Please check the log file for details: $LOG_FILE${NC}" 992 | log_message "WARNING" "Installation completed with validation errors in ${minutes}m ${seconds}s" 993 | fi 994 | } 995 | 996 | # Error handling for main execution 997 | if ! main_installation; then 998 | log_message "ERROR" "Installation failed" 999 | echo -e "${RED}${BOLD}Installation failed!${NC}" 1000 | echo -e "${YELLOW}Check the log file for details: $LOG_FILE${NC}" 1001 | exit 1 1002 | fi 1003 | 1004 | log_message "INFO" "Enhanced Odoo Installer completed successfully IOIS" 1005 | 1006 | -------------------------------------------------------------------------------- /odoo_pro20.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # to run the script "sudo /bin/sh odoo_pro.sh" 3 | ################################################################################ 4 | # Script for preparing Odoo production server platform on Ubuntu 20.04 (could be used for other version too) 5 | # Author: Mahmoud Abdel Latif 6 | # Mobile No: +201002688172 7 | # Email: Mah008@me.com 8 | # Website: http://www.mah007.com 9 | #------------------------------------------------------------------------------- 10 | # This script will make ur server ready for installing ODOO from 8 to 14 11 | #------------------------------------------------------------------------------- 12 | # Make a new file: 13 | # sudo nano odoo_pro.sh 14 | # Place this content in it and then make the file executable: 15 | # sudo chmod +x odoo_pro.sh 16 | # git clone --depth 1 --branch 10.0 https://www.gitlab.com/mah007/odoo . 17 | # Execute the script to install Odoo: 18 | # ./odoo-developing 19 | ################################################################################ 20 | 21 | ##fixed parameters 22 | #instead of odoo use ur user name .EG OE_USER="mahmoud" 23 | OE_USER="odoo" 24 | OE_BRANCH="14.0" 25 | #The default port where this Odoo instance will run under (provided you use the command -c in the terminal) 26 | #Set to true if you want to install it, false if you don't need it or have it already installed. 27 | INSTALL_WKHTMLTOPDF="True" 28 | 29 | # Set this to True if you want to install Odoo 9 10 11 12 13 14Enterprise! ( you can use enterprise normaly too ;) ) 30 | IS_ENTERPRISE="True" 31 | 32 | ## 33 | ### WKHTMLTOPDF download links 34 | ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, 35 | ## in order to have correct version of wkhtmltox installed, for a danger note refer to 36 | ## https://www.odoo.com/documentation/8.0/setup/install.html#deb ): 37 | WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb 38 | WKHTMLTOX_X32=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_i386.deb 39 | #-------------------------------------------------- 40 | # Update Server 41 | #-------------------------------------------------- 42 | echo -e "\n---- Update Server ----" 43 | sudo apt-get update 44 | sudo apt-get upgrade -y 45 | apt install -y zip gdebi 46 | echo "----------------------------localization-------------------------------" 47 | 48 | export LC_ALL="en_US.UTF-8" 49 | export LC_CTYPE="en_US.UTF-8" 50 | sudo dpkg-reconfigure locales 51 | 52 | #-------------------------------------------------- 53 | # Install PostgreSQL Server 54 | #-------------------------------------------------- 55 | sudo sh -c 'echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 56 | wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/webmin.list 57 | cp webmin.list /etc/apt/sources.list.d 58 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 59 | sudo apt-get update 60 | 61 | echo -e "\n---- Install PostgreSQL Server ----" 62 | sudo apt-get install postgresql-13 postgresql-server-dev-13 -y 63 | 64 | echo -e "\n---- Creating the ODOO PostgreSQL User ----" 65 | sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true 66 | 67 | #-------------------------------------------------- 68 | # Install Dependencies 69 | #-------------------------------------------------- 70 | echo -e "\n---- Install tool packages ----" 71 | sudo apt install -y git python3-pip build-essential wget python3-dev python3-venv python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev 72 | echo -e "\n---- Install python libraries ----" 73 | sudo pip install gdata psycogreen 74 | # This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04 .... 20.04 75 | sudo -H pip install suds 76 | 77 | echo -e "\n--- Install other required packages" 78 | sudo apt-get install node-clean-css -y 79 | sudo apt-get install node-less -y 80 | sudo apt-get install python-gevent -y 81 | apt-get install libwww-perl -y 82 | #sudo apt install ifupdown -y 83 | 84 | 85 | #-------------------------------------------------- 86 | # Install Wkhtmltopdf if needed 87 | #-------------------------------------------------- 88 | if [ $INSTALL_WKHTMLTOPDF = "True" ]; then 89 | echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 9 ----" 90 | #pick up correct one from x64 & x32 versions: 91 | if [ "`getconf LONG_BIT`" == "64" ];then 92 | _url=$WKHTMLTOX_X64 93 | else 94 | _url=$WKHTMLTOX_X32 95 | fi 96 | sudo wget $_url 97 | sudo gdebi --n `basename $_url` 98 | sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin 99 | sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin 100 | else 101 | echo "Wkhtmltopdf isn't installed due to the choice of the user!" 102 | fi 103 | 104 | 105 | 106 | 107 | if [ $IS_ENTERPRISE = "True" ]; then 108 | # Odoo Enterprise install! 109 | 110 | echo -e "\n---- Installing Enterprise specific libraries ----" 111 | sudo apt-get install nodejs npm -y 112 | sudo npm install -g less 113 | sudo npm install -g less-plugin-clean-css 114 | sudo npm install -g rtlcss 115 | else 116 | echo -e "\n---- every thing is ready ----" 117 | 118 | fi 119 | sudo ln -s /usr/bin/nodejs /usr/bin/node 120 | 121 | sudo apt-get install -y python3-dev 122 | sudo easy_install greenlet 123 | sudo easy_install gevent 124 | sudo apt-get install -y python3-pip python3-wheel python3-setuptools 125 | sudo -H pip3 install --upgrade pip 126 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/14.0/requirements.txt 127 | sudo apt install -y python3-asn1crypto 128 | sudo apt install -y python3-babel python3-bs4 python3-cffi-backend python3-cryptography python3-dateutil python3-docutils python3-feedparser python3-funcsigs python3-gevent python3-greenlet python3-html2text python3-html5lib python3-jinja2 python3-lxml python3-mako python3-markupsafe python3-mock python3-ofxparse python3-openssl python3-passlib python3-pbr python3-pil python3-psutil python3-psycopg2 python3-pydot python3-pygments python3-pyparsing python3-pypdf2 python3-renderpm python3-reportlab python3-reportlab-accel python3-roman python3-serial python3-stdnum python3-suds python3-tz python3-usb python3-vatnumber python3-werkzeug python3-xlsxwriter python3-yaml 129 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/11.0/requirements.txt 130 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/12.0/requirements.txt 131 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/13.0/requirements.txt 132 | sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/14.0/requirements.txt 133 | sudo -H pip3 install -r https://raw.githubusercontent.com/mah007/OdooScript/14.0/requirements.txt 134 | sudo -H pip3 install phonenumbers 135 | echo "---------------------------odoo directory--------------------------------" 136 | mkdir /odoo 137 | mkdir /etc/odoo 138 | mkdir /var/log/odoo 139 | touch /etc/odoo/odoo.conf 140 | touch /var/log/odoo/odoo-server.log 141 | chown odoo:odoo /var/log/odoo/odoo-server.log 142 | chown odoo:odoo /etc/odoo/odoo.conf 143 | cd /odoo 144 | 145 | sudo git clone --depth 1 --branch $OE_BRANCH https://www.github.com/odoo/odoo 146 | cd / 147 | 148 | chown -R odoo:odoo /odoo 149 | 150 | cd /root 151 | echo "-------------------------------odoo service----------------------------" 152 | wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/odoo.service 153 | cp odoo.service /etc/systemd/system 154 | sudo systemctl daemon-reload 155 | sudo systemctl enable odoo 156 | sudo systemctl start odoo 157 | echo "----------------------------NGINX-------------------------------" 158 | wget https://raw.githubusercontent.com/mah007/OdooScript/14.0/nginx.sh 159 | bash nginx.sh 160 | echo "---------------------------webmin--------------------------------" 161 | apt-get install -y perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python 162 | wget https://download.webmin.com/jcameron-key.asc 163 | apt-key add jcameron-key.asc 164 | apt-get install apt-transport-https -y 165 | apt-get update 166 | apt-get install webmin -y 167 | 168 | 169 | echo "-----------------------------------------------------------" 170 | echo "Done! The Odoo production platform is ready:" 171 | 172 | echo "Restart restart ur computer and start developing and have fun ;)" 173 | echo "-----------------------------------------------------------" 174 | -------------------------------------------------------------------------------- /odoo_redhat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e # Exit on any error 3 | 4 | # Function to display colorful intro 5 | function intro() { 6 | clear 7 | echo -e "\e[1;32m#############################################\e[0m" # Green 8 | echo -e "\e[1;31m# #\e[0m" # Red 9 | echo -e "\e[1;34m# WELCOME TO ODOO INSTALLING SCRIPT FOR #\e[0m" # Blue 10 | echo -e "\e[1;34m# REDHAT 9 & ALMALINUX 9 #\e[0m" # Blue 11 | echo -e "\e[1;31m# #\e[0m" # Red 12 | echo -e "\e[1;32m#############################################\e[0m" # Green 13 | echo "" 14 | echo -e "\e[1;33mStarting the installation...\e[0m" # Yellow 15 | sleep 3 # Pause for 3 seconds 16 | } 17 | 18 | # Call the intro function 19 | intro 20 | 21 | # Ask for Odoo version before doing anything 22 | echo "Choose Odoo version (14.0, 15.0, 16.0, 17.0, 18.0):" 23 | read odoo_version 24 | 25 | # Get the hostname of the machine 26 | hostname=$(hostname) 27 | 28 | # Enable Code Ready Repository and Development Tools 29 | sudo subscription-manager repos --enable codeready-builder-for-rhel-9-x86_64-rpms 2>/dev/null || true 30 | sudo yum groupinstall -y "Development Tools" 2>/dev/null || true 31 | sudo yum install -y git gcc redhat-rpm-config libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel curl unzip openssl-devel wget yum-utils make libffi-devel zlib-devel tar libpq-devel python3.11 python3.11-devel python3.11-pip 2>/dev/null || true 32 | 33 | # Set Python 3.11 as the default python3 alternative 34 | sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 2>/dev/null || true 35 | sudo update-alternatives --config python 2>/dev/null || true 36 | 37 | # Set pip3.11 as the default pip3 and pip alternative 38 | sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3.11 1 2>/dev/null || true 39 | sudo update-alternatives --config pip 2>/dev/null || true 40 | 41 | # Install PostgreSQL from official repository 42 | sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm 2>/dev/null || true 43 | sudo yum install -y postgresql16-server postgresql16 postgresql16-devel 2>/dev/null || true 44 | 45 | # Check if the data directory is empty before initializing PostgreSQL 46 | if [ ! "$(ls -A /var/lib/pgsql/16/data/)" ]; then 47 | sudo /usr/pgsql-16/bin/postgresql-16-setup initdb 48 | else 49 | echo "Data directory is not empty, skipping initdb." 50 | fi 51 | 52 | sudo systemctl enable --now postgresql-16 2>/dev/null || true 53 | 54 | # Create a PostgreSQL user for Odoo 55 | su - postgres -c "createuser -s odoo" 2>/dev/null || true 56 | 57 | # Install wkhtmltox 58 | sudo yum install -y https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox-0.12.6.1-2.almalinux9.x86_64.rpm 2>/dev/null || true 59 | 60 | # Install Node.js 61 | sudo yum module install -y nodejs:18 2>/dev/null || true 62 | 63 | # Create Odoo user and directories 64 | sudo useradd -m -U -r -d /home/odoo -s /bin/bash odoo 2>/dev/null || true 65 | sudo mkdir -p /odoo /odoo/extra 2>/dev/null || true 66 | sudo chown -R odoo:odoo /odoo 67 | 68 | # Clone Odoo from GitHub 69 | sudo -u odoo git clone --depth 1 --branch $odoo_version https://www.github.com/odoo/odoo.git /odoo/odoo 2>/dev/null || true 70 | 71 | # Set the PostgreSQL binary path for the Odoo user 72 | sudo -u odoo bash -c "echo 'export PATH=/usr/pgsql-16/bin:\$PATH' >> /home/odoo/.bashrc" 2>/dev/null || true 73 | sudo -u odoo bash -c "source /home/odoo/.bashrc" 74 | 75 | # Install Python requirements for Odoo under the Odoo user 76 | sudo -u odoo -H bash -c "pip install -r https://raw.githubusercontent.com/odoo/odoo/$odoo_version/requirements.txt --user" 2>/dev/null || true 77 | 78 | # Create Odoo configuration directory and log file 79 | sudo mkdir -p /etc/odoo /var/log/odoo 2>/dev/null || true 80 | sudo touch /etc/odoo/odoo.conf /var/log/odoo/odoo-server.log 81 | sudo chown -R odoo:odoo /etc/odoo /var/log/odoo 82 | 83 | # Create Odoo configuration file 84 | cat </dev/null || true 116 | 117 | # Install the latest version of Nginx from official repository 118 | sudo yum install -y nginx 2>/dev/null || true 119 | sudo systemctl enable --now nginx 2>/dev/null || true 120 | 121 | # Generate a self-signed SSL certificate 122 | sudo mkdir -p /etc/ssl/nginx 2>/dev/null || true 123 | sudo openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 \ 124 | -subj "/C=US/ST=State/L=City/O=Company Name/OU=Org/CN=$hostname" \ 125 | -keyout /etc/ssl/nginx/server.key -out /etc/ssl/nginx/server.crt 2>/dev/null || true 126 | 127 | # Set permissions for the certificate files 128 | sudo chmod 600 /etc/ssl/nginx/server.key /etc/ssl/nginx/server.crt 129 | 130 | # Create the Nginx configuration for Odoo 131 | cat <