diff --git a/conf/nginx.conf b/conf/nginx.conf index 2f14fba..11505d7 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,47 +1,18 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; - location __PATH__/ { - alias __FINALPATH__/; - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; + add_header Access-Control-Allow-Origin *; + + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm__NAME__.sock; } - index index.php; - try_files $uri $uri/ /index.php; - - location ~ [^/]\.php(/|$) { - #if ($request_uri ~ "\/movim\/\?infos") { - # return 403; - #} - - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php__PHPVERSION__-fpm-__NAME__.sock; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; - } - - location ~ ^__PATH__/ws/ { - proxy_pass http://localhost:__PORT__; + location /movim/ws/ { + proxy_pass http://127.0.0.1:__PORT__/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto https; - proxy_redirect off; - - # To avoid disconnecting after 60sec : - proxy_read_timeout 14400s; - proxy_send_timeout 14400s; - # (14400s is 4h) + include proxy_params; } - - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; } diff --git a/conf/systemd.service b/conf/systemd.service index 9b95633..6d0114f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -4,10 +4,11 @@ After=nginx.service network.target local-fs.target postgresql.service [Service] Type=simple -User=__APP__ -Group=__APP__ +User=www-data +Environment=PUBLIC_URL=https://__DOMAIN__/__PATH__ +Environment=WS_PORT=__PORT__ +ExecStart=/usr/bin/php daemon.php start --url=${PUBLIC_URL} --port=${WS_PORT} WorkingDirectory=__FINALPATH__ -ExecStart=/usr/bin/php __FINALPATH__/daemon.php start --url=https://__DOMAIN__/__PATH__ --port=__PORT__ StandardOutput=syslog SyslogIdentifier=__APP__ PIDFile=/run/movim.pid diff --git a/manifest.json b/manifest.json index 5813d25..7775621 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,8 @@ "id": "movim", "packaging_format": 1, "description": { - "en": "The Kickass Social Network" + "en": "Responsive web-based cross-platform XMPP client", + "fr": "Client XMPP multiplateforme" }, "version": "0.18.0~ynh1", "requirements": { @@ -12,9 +13,8 @@ "url": "https://movim.eu/", "license": "AGPL-3.0-or-later", "maintainer": { - "name": "src386", - "email": "soyouz@src386.org", - "url": "http://github.com/src386" + "name": "", + "email": "" }, "services": [ "nginx", @@ -27,8 +27,8 @@ "name": "domain", "type": "domain", "ask": { - "en": "Domain of the pod", - "fr": "Domaine du pod" + "en": "Choose a domain name for Movim", + "fr": "Choisissez un nom de domaine pour Movim" }, "example": "domain.org" }, @@ -36,8 +36,8 @@ "name": "path", "type": "path", "ask": { - "en": "Path to the pod", - "fr": "Chemin vers le pod" + "en": "Choose a path for Movim", + "fr": "Choisissez un chemin pour Movim" }, "example": "/movim", "default": "/movim" @@ -46,19 +46,19 @@ "name": "admin", "type": "user", "ask": { - "en": "Pod administrator", - "fr": "Administrateur du pod" + "en": "Choose an admin user", + "fr": "Choisissez l'administrateur" }, - "example": "homer" + "example": "johndoe" }, { "name": "password", "type": "password", "ask": { - "en": "Administrator password", - "fr": "Mot de passe administrateur" + "en": "Set the administrator password", + "fr": "Définissez le mot de passe administrateur" }, - "example" : "password" + "example" : "Choose a password" }, { "name": "is_public", diff --git a/scripts/install b/scripts/install index ba3e1af..6be5949 100644 --- a/scripts/install +++ b/scripts/install @@ -123,9 +123,8 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated php-fpm config #ynh_replace_string --match_string="YHTZ" --replace_string="$timezone" --target_file=../conf/php-fpm.conf -phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) - ynh_add_fpm_config --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) #================================================= # SET CONFIGURATION FILE @@ -174,7 +173,9 @@ ynh_store_file_checksum --file="$final_path/config/db.inc.php" ynh_script_progression --message="Configuring a systemd service..." --weight=1 #ynh_replace_string --match_string="__URL__" --replace_string="${domain}${path_url}" --target_file=../conf/systemd.service -#ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service +ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file=../conf/systemd.service +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service ynh_add_systemd_config