Metadata-Version: 2.1
Name: odoo-auto-proxy
Version: 0.1.2
Summary: Create Reverse Proxy Configuration For Odoo Containers
Home-page: https://github.com/divad1196/odoo_auto_proxy
Author: Gallay David
Author-email: davidtennis96@hotmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Dist: certifi (==2021.5.30)
Requires-Dist: chardet (==4.0.0)
Requires-Dist: contextlib2 (==21.6.0)
Requires-Dist: decorator (==5.0.9)
Requires-Dist: docker (==5.0.0)
Requires-Dist: idna (==2.10)
Requires-Dist: Jinja2 (==3.0.1)
Requires-Dist: MarkupSafe (==2.0.1)
Requires-Dist: requests (==2.25.1)
Requires-Dist: schema (==0.7.4)
Requires-Dist: six (==1.16.0)
Requires-Dist: urllib3 (==1.26.6)
Requires-Dist: validators (==0.18.2)
Requires-Dist: websocket-client (==1.1.0)

Odoo Nginx Proxy
================

Install
~~~~~~~

Using pip3 on local system:

.. code:: bash

   pip3 install odoo_auto_proxy

In docker environment

.. code:: bash

   docker run -d -v "$PWD/../nginx_conf:/etc/nginx/conf.d" -e NGINX_CONTAINER_NAME=odoo -e URL_DOMAIN=localhost odoo_auto_proxy

Run
~~~

.. code:: bash

   mkdir nginx_conf
   docker run -d -v "$PWD/../nginx_conf:/etc/nginx/conf.d"  -p 80:80 --name odoo nginx

   python3 -m odoo_reverse_proxy -c odoo -f ../nginx_conf
   docker-compose -f exemple_odoo_compose.yml up

.. code:: bash

   # Install certbot on nginx container
   mkdir -p /var/www/letsencrypt
   apt update
   apt install -y software-properties-common
   add-apt-repository ppa:certbot/certbot
   apt update
   apt install -y python-certbot-apache apt install gnupg
   apt install -y certbot
   apt install -y python-certbot-nginx

If this is not working, the generated template may be wrong. Check it by
running:

.. code:: bash

   docker exec odoo nginx -s reload

where ``odoo`` is your nginx container

Issues
~~~~~~

-  Port is lost with redirection: accessing
   ``odoo_server.localhost:8000`` redirect us to
   ``odoo_server.localhost/web``, we can only use port 80 (and maybe
   443) as forward for nginx
-  Some values are override manually (web_upstream, proxy_pass and
   poll_upstream): remove them from config and template?

TODO
~~~~

-  Add certbot support
-  Make the python program available on pypi
-  Create dockerfile, docker image and docker-compose for the service

