Browse Source

visitor real ip; fix nginx pid

14.0
Nj Subedi 2 years ago
parent
commit
ad388c5f97
  1. 2
      dev-scripts/simulate-cloudron.sh
  2. 7
      nginx.conf
  3. 12
      start.sh

2
dev-scripts/simulate-cloudron.sh

@ -2,7 +2,7 @@ if [[ -z "${CLOUDRON+x}" ]]; then
echo "Not Cloudron. Setting testing vars..."
export CLOUDRON_POSTGRESQL_PORT=5432
export CLOUDRON_POSTGRESQL_HOST=172.17.0.1
export CLOUDRON_POSTGRESQL_DATABASE=odoo
export CLOUDRON_POSTGRESQL_DATABASE=odootest
export CLOUDRON_POSTGRESQL_USERNAME=odoo_user
export CLOUDRON_POSTGRESQL_PASSWORD=odoo_password

7
nginx.conf

@ -1,7 +1,7 @@
# Based on https://git.cloudron.io/cloudron/taiga-app/-/raw/master/nginx.conf
daemon off;
worker_processes auto;
pid /run/nginx/nginx.pid;
pid /run/nginx.pid;
error_log stderr;
events {
@ -50,9 +50,10 @@ http {
}
server {
listen 8000;
listen 8000 default_server;
include /app/data/nginx-custom-locations.conf;
server_name __REPLACE_WITH_CLOUDRON_APP_DOMAIN__;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;

12
start.sh

@ -32,7 +32,7 @@ if [[ ! -f /app/data/odoo.conf ]]; then
pg_cli "INSERT INTO public.ir_config_parameter (key, value, create_uid, create_date, write_uid, write_date) VALUES ('mail.catchall.domain', '$CLOUDRON_APP_DOMAIN', 2, 'NOW()', 2, 'NOW()');"
echo "Disabling public sign-up..."
pg_cli "UPDATE public.ir_config_parameter SET value='b2b' WHERE key='auth_signup.invitation_scope';";
pg_cli "UPDATE public.ir_config_parameter SET value='b2b' WHERE key='auth_signup.invitation_scope';"
echo "Copying default configuration file to /app/data/odoo.conf..."
cp /app/pkg/odoo.conf.sample /app/data/odoo.conf
@ -108,10 +108,18 @@ fi
# Start nginx process
sed -e "s,__REPLACE_WITH_CLOUDRON_APP_DOMAIN__,${CLOUDRON_APP_DOMAIN}," /app/pkg/nginx.conf >/run/nginx/nginx.conf
if [[ ! -f /app/data/nginx-custom-locations.conf ]]; then
cat >/app/data/nginx-custom-locations.conf <<EOF
# Content of this file is included inside the server { } block.
# Add custom locations except "/" and "/longpolling" as they are reserved for Odoo.
# Or add custom directives. See https://nginx.org/en/docs/http/ngx_http_core_module.html#server
EOF
fi
chown -R cloudron:cloudron /app/data
echo "=> Start nginx"
rm -f /run/nginx/nginx.pid
rm -f /run/nginx.pid
nginx -c /run/nginx/nginx.conf &
# Done nginx

Loading…
Cancel
Save