1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
This commit is contained in:
ericgaspar 2020-09-17 09:02:08 +02:00
parent fd5ee72906
commit 3fcf4594ed
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 30 additions and 57 deletions

View file

@ -1,47 +1,18 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ { location __PATH__/ {
alias __FINALPATH__/; alias __FINALPATH__/;
if ($scheme = http) { add_header Access-Control-Allow-Origin *;
rewrite ^ https://$server_name$request_uri? permanent;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm__NAME__.sock;
} }
index index.php; location /movim/ws/ {
try_files $uri $uri/ /index.php; proxy_pass http://127.0.0.1:__PORT__/;
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__;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade"; proxy_set_header Connection "Upgrade";
proxy_set_header Host $host; include proxy_params;
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 SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
} }

View file

@ -4,10 +4,11 @@ After=nginx.service network.target local-fs.target postgresql.service
[Service] [Service]
Type=simple Type=simple
User=__APP__ User=www-data
Group=__APP__ 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__ WorkingDirectory=__FINALPATH__
ExecStart=/usr/bin/php __FINALPATH__/daemon.php start --url=https://__DOMAIN__/__PATH__ --port=__PORT__
StandardOutput=syslog StandardOutput=syslog
SyslogIdentifier=__APP__ SyslogIdentifier=__APP__
PIDFile=/run/movim.pid PIDFile=/run/movim.pid

View file

@ -3,7 +3,8 @@
"id": "movim", "id": "movim",
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "The Kickass Social Network" "en": "Responsive web-based cross-platform XMPP client",
"fr": "Client XMPP multiplateforme"
}, },
"version": "0.18.0~ynh1", "version": "0.18.0~ynh1",
"requirements": { "requirements": {
@ -12,9 +13,8 @@
"url": "https://movim.eu/", "url": "https://movim.eu/",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"maintainer": { "maintainer": {
"name": "src386", "name": "",
"email": "soyouz@src386.org", "email": ""
"url": "http://github.com/src386"
}, },
"services": [ "services": [
"nginx", "nginx",
@ -27,8 +27,8 @@
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": { "ask": {
"en": "Domain of the pod", "en": "Choose a domain name for Movim",
"fr": "Domaine du pod" "fr": "Choisissez un nom de domaine pour Movim"
}, },
"example": "domain.org" "example": "domain.org"
}, },
@ -36,8 +36,8 @@
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": { "ask": {
"en": "Path to the pod", "en": "Choose a path for Movim",
"fr": "Chemin vers le pod" "fr": "Choisissez un chemin pour Movim"
}, },
"example": "/movim", "example": "/movim",
"default": "/movim" "default": "/movim"
@ -46,19 +46,19 @@
"name": "admin", "name": "admin",
"type": "user", "type": "user",
"ask": { "ask": {
"en": "Pod administrator", "en": "Choose an admin user",
"fr": "Administrateur du pod" "fr": "Choisissez l'administrateur"
}, },
"example": "homer" "example": "johndoe"
}, },
{ {
"name": "password", "name": "password",
"type": "password", "type": "password",
"ask": { "ask": {
"en": "Administrator password", "en": "Set the administrator password",
"fr": "Mot de passe administrateur" "fr": "Définissez le mot de passe administrateur"
}, },
"example" : "password" "example" : "Choose a password"
}, },
{ {
"name": "is_public", "name": "is_public",

View file

@ -123,9 +123,8 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
#ynh_replace_string --match_string="YHTZ" --replace_string="$timezone" --target_file=../conf/php-fpm.conf #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" ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
#================================================= #=================================================
# SET CONFIGURATION FILE # 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_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="__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 ynh_add_systemd_config