forked from SpreeTravel/odoo-saas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparams.json
1 lines (1 loc) · 14.9 KB
/
params.json
1
{"name":"Odoo SaaS","tagline":"Deploy SaaS solutions using Odoo with ease","body":"# Odoo SaaS\r\nWe use cutting edge technologies: *Docker*, *nGinx*, *Amazon Web Services* (*AWS*): *EC2*, *ELB*, *EBS* & *RDS*.\r\n \r\nThe technology we have developed is 100% Open Source and available at Github. The addons include SaaS solution management from a central Odoo, setting up and subscription to service plans.\r\n* Launches a tenant (Odoo instance) for each entity (person or company) subscribed to the SaaS. \r\n* Service plans management \r\n + Listing of required and optional addons. \r\n + Database maximum size. \r\n + Additional services (support, data migration, etc). \r\n* Associate addons to a Plan. \r\n + Required addons are included in the template database used to create each new tenant, so that they result preinstalled when a new account is created on the SaaS service.\r\n + Required addons are the same in all tenants sharing a Plan. \r\n + Optional addons appear on each tenant as available to be installed at will. \r\n + From the central system managing the SaaS service a new required addon can be included into a Plan and then perform a deployment action for that addon to be included in all tenants created from the Plan. \r\n* Although the primary addon management is performed in a Plan basis, from the central system specific actions can be executed for a particular tenant. \r\n* Create SaaS Client databases: \r\n + manually from SaaS Portal backend \r\n + by client after choosing subdomain (similar to https://www.odoo.com/page/start) via module `saas_portal_start`. \r\n + by client after choosing database template (e.g. template for POS, template for ECommerce etc) with autogenerated subdomain (e.g. demo12345.odoo.com) via module `saas_server_templates`.\r\n + by client after signing up via module `saas_portal_#`.\r\n\r\n* Prepare templates for new SaaS Client database. You are able to connect to template database, install modules you need, edit configuration, edit access rights for customer etc. Such template database will be exactly what a customer will see after database creating. \r\n* Connect to existing SaaS Client database as administrator. \r\n* Control SaaS Client database from SaaS Portal backend: \r\n + install, update, delete addons.\r\n + configure parameters (e.g. Max Allowed Users).\r\n* Collect information from client databases (number of users, disk space usage, etc.).\r\n* Notify customers about news by sending messages to Whole Company messaging group (under development).\r\n* Show message at the top of a page (e.g. Your free trial will expire in about 4 hours Register now to add 15 days for free!) (under development).\r\n* Ability for users to reset their own passwords (Forgot your password?).\r\n* Support for SSL with a digital certificate. \r\n* Ability to monitor the databases system wise.\r\n* Ability to send automatic invoices every month.\r\n* Remove the default Odoo logo and name in the server. \r\n* Automatic Backup of the databases. \r\n* Restoration of the backed up databases. \r\n* Payment gateway integration. \r\n* SaaS Administration with SaaS Panel.\r\n* SaaS Panel Administration with Activate/ Deactivate/ Terminate options for Tenant Database.\r\n* SaaS Tenant Technical Support option with Pseudo Admin.\r\n\r\n## All you need to deploy Odoo (former OpenERP) SaaS.\r\nThe present document provides an overview on how to easily deploy SaaS solutions with Odoo (formerly known as OpenERP).\r\n\r\n### Odoo addons to provide SaaS\r\n\r\nOur solution makes use of IT-Projects LLC's [Odoo SaaS Tools](https://github.com/yelizariev/odoo-saas-tools) which provides the following SaaS structure:\r\n\r\n* *SaaS Portal* (one): main database\r\n* *SaaS Server* (many): technical database to control client databases. SaaS server creates, edits and deletes databases. Each SaaS Server can be installed on a separate machine (e.g. VPS).\r\n* *SaaS Client* (many): client database to be used by customers. Each SaaS Client is attached to a SaaS Server.\r\n\r\n### Docker Image to provide Odoo SaaS solutions\r\n\r\nWe have created a [Docker](https://www.docker.com) image for our solution, you can find it pulling `cenitsaas/cenitodoo` from [DockerHub](https://hub.docker.com/r/cenitsaas/cenitodoo).\r\n\r\n#### Database Setup\r\nIn order to have the image connect to a PostgreSQL database you have a couple of options available:\r\n\r\n1. You could use the traditional linking to a PostgreSQL container in the same manner the official Docker image for Odoo does.\r\n2. You could set up a custom PostgreSQL server through the environment variables\r\n * `PGHOST`: the hostname of the system where the PostgreSQL server is running.\r\n * `PGPORT`: the system port on which the PostgreSQL server is listening (defaults to `5432` if omitted).\r\n * `PGUSER`: the username to use when connecting to the PostgreSQL server.\r\n * `PGPASSWORD`: the password for the provided user.\r\n3. If deploying the image on Amazon Web Services' Elastic Beanstalk, you could choose to launch a new RDS instance and the image will figure out how to connect to it.\r\n\r\n#### SaaS setup\r\nThere are a few environment variables that you'll have to take into consideration while deploying the image.\r\n\r\n##### Mandatory\r\n* `MAIN_DOMAIN`: identifies the *SaaS Portal*. Commonly it is a first level domain name (e.g: `example.com`).\r\n* `SERVER_SUBDOMAIN`: identifies the first *SaaS Server*. Common a direct subdomain of `MAIN_DOMAIN` (e.g: `server1.example.com`)\r\n\r\n##### Optional\r\n* `CUSTOM_REPOS`: a space-separated list of (currently) public Git repositories containing Odoo addons that should be available on the solution (e.g: `https://github.com/me/myrepo.git https://github.com/him/hisrepo.git`).\r\n\r\n### Configurations needed to deploy the Odoo SaaS Docker image on Amazon Web Services\r\nAmazon Web Services include a handful of services that provide everything you may need to deploy Odoo SaaS.\r\n\r\n#### Elastic Compute Cloud (*EC2*)\r\nAmazon Elastic Compute Cloud (*Amazon EC2*) is a web service that provides resizable computing capacity—literally, servers in Amazon's data centers—that can be used to build and host software systems.\r\n\r\n#### Relational Database Service (*RDS*)\r\nAmazon Relational Database Service (*Amazon RDS*) is a web service that makes it easier to set up, operate, and scale a relational database in the cloud. It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration tasks.\r\n\r\n#### Elastic Beanstalk (*EBS*)\r\nAmazon Elastic Beanstalk (*Amazon EBS*) allows to quickly deploy and manage applications in the AWS cloud without worrying about the infrastructure that runs those applications. AWS Elastic Beanstalk reduces management complexity without restricting choice or control. Simply upload the application and Elastic Beanstalk automatically handles the details of capacity provisioning, load balancing, scaling, and application health monitoring.\r\n\r\n#### Deploying `cenitsaas/cenitodoo` with *EBS*\r\nIt is actually pretty easy... but you'll first need to do a thing or two.\r\n\r\n1. Navigate to the [Odoo SaaS EBS](https://github.com/openjaf/odoo-saas-ebs) repository on Github.\r\n + You can clone the repository to your computer (`$ git clone https://github.com/openjaf/odoo-saas-ebs.git`)\r\n + Or simply copy the content of one of the `Dockerrun.aws.json` file and paste it into a plain text file on your system.\r\n - `linked` refers to using a linked PostgreSQL container for the database.\r\n - `rds` refers to using Amazon RDS for the database.\r\n1. Within the `Dockerrun.aws.json` file, in the `environment` section inside the `cenitodoo` entry of `containerDefinitions`, change the values of the `MAIN_DOMAIN` and `SERVER_SUBDOMAIN` as instructed in the **SaaS setup** section above.\r\n + You can also change the value of the `CUSTOM_REPOS` to match your needs.\r\n + You should be aware that, if you're using a *Domain Name* provider other than *Amazon Route S3* itself and planning to use a Load Balancer as recommended, the value for `MAIN_DOMAIN` cannot be a first-level domain (e.g: example.com) instead use a **www** subdomain of your root domain (e.g: www.example.com). Further details on the DNS configuration section.\r\n1. Save your changes and compress the file using `zip` the resulting file should be a zipped bundle containing solely the `Dockerrun.aws.json` file.\r\n\r\nEnough foreplay, lets get real.\r\n\r\n1. Log in to your AWS account and head up to the *EBS* dashboard.\r\n1. Create a new Application and name it.\r\n1. Select **Web Server Environment**.\r\n1. Choose *Multi-container Docker* for the `Predefined configuration` and *Load balancing, auto scaling* for the `Environment type`.\r\n1. In the **Application version**, as `Source` choose *Upload your own* and select the **zipped** `Dockerrun.aws.json` created earlier.\r\n + You can modify the *Deployment limits* if you want to, but there's no need to do that right now.\r\n1. Now you need to choose a *Name* and *URL* for the environment. The *Name* part is not much trouble, now the *URL* you'll have to make sure is unique, otherwise *EBS* won't let you carry on.\r\n1. If (and only if) you are using the `rds` version of the Dockerrun.aws.json file:\r\n + Choose to *Create an RDS DB Instance with this environment*.\r\n + In the **Configuration Details** page choose the hardware you'll be using. \r\n - Notice that the *Free tier* eligible hardware is quite enough for testing purposes (though probably not so much for production environments).\r\n + Tag your environment if you will.\r\n + In the **RDS Configuration** there are a couple of *Must-Do*s:\r\n - The *DB engine* must be set to `postgres`.\r\n - The *Username* must be set to `odoo`.\r\n - All other settings are left to your consideration.\r\n \r\n An important note here is the fact that the `max_connections` parameter of the *RDS instance* should be set to a value higher than `64`, since this is the maximum number of connections *Odoo* will attempt to open before it starts closing any. A value under `64` will result eventually on system crashing due to lack of access to the database.\r\n1. Choose the **Permissions** you will be using.\r\n + An important note at this point is that your *Instance profile* should have an attached *Policy* that allows, among other things, to launch ECS instances.\r\n - Go to your [IAM Management Console policies](https://console.aws.amazon.com/iam/home#policies).\r\n - Click the *Create Policy* button.\r\n - Select the *Create Your Own Policy* option.\r\n - Choose a *Name* (required) and *Description* (optional) and on the *Policy Document* paste the following text: \r\n\r\n ```{\r\n \"Version\": \"2012-10-17\",\r\n \"Statement\": [\r\n {\r\n \"Effect\": \"Allow\",\r\n \"Action\": [\r\n \"ecs:StartTask\",\r\n \"ecs:StopTask\",\r\n \"ecs:RegisterContainerInstance\",\r\n \"ecs:DeregisterContainerInstance\",\r\n \"ecs:DescribeContainerInstances\",\r\n \"ecs:DiscoverPollEndpoint\",\r\n \"ecs:Submit*\",\r\n \"ecs:Poll\"\r\n ],\r\n \"Resource\": [\r\n \"*\"\r\n ]\r\n },\r\n {\r\n \"Effect\": \"Allow\",\r\n \"Action\": \"s3:PutObject\",\r\n \"Resource\": \"arn:aws:s3:::elasticbeanstalk-*/resources/environments/logs/*\"\r\n }\r\n ]\r\n }```\r\n - Head on to the [IAM Management Console roles](https://console.aws.amazon.com/iam/home#roles).\r\n - Select the Role you will be using.\r\n - Under the **Permisions** tab click the *Attach Policy* button.\r\n - Search for and select the policy just created.\r\n - Click the *Attach policy* button and you're set.\r\n + Return to the **Permissions** page and make sure to select the role.\r\n1. Review the information so far and launch the application.\r\n\r\nNow, while you wait for the *Environment* to be built and launched, head up to the next section, in order to complete the final steps of the journey. \r\n\r\n### Pointing a GoDaddy Domain Name to a newly deployed Odoo SaaS\r\nThe one issue with this approach is that since Amazon’s Load Balancers don’t get an Elastic IP address (this means that its IP address will change if the Load Balancer is rebooted) the main domain won’t be possible to point at the Load Balancer since it must be done with an A Record (a direct association from the domain name to an IP address). Instead, we will be creating a CNAME rule (an alias) for all subdomains to be redirected to the load balancer and use `www.<rootdomain>.<com or else>` as the `MAIN_DOMAIN`.\r\n\r\n1. # to your GoDaddy.com account \r\n2. Under *Domains* select manage \r\n3. Select the domain you want to point at the load balancer \r\n4. Go to the DNS Zone File \r\n5. Add a record \r\n6. On the record type select CNAME (Alias) \r\n7. For the Host type '*', this means all subdomains of the Domain Name, and in the Point To, type the alias of the load balancer generated by EBS \r\n8. After that it should look like this \r\n\r\n## Support or Contact\r\nFor more details contact us at [support at cenitsaas dot com](mailto:support@cenitsaas.com)","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}