From d7cb0afa1554c1a33e2e990b10fa574f237a0f70 Mon Sep 17 00:00:00 2001 From: magikcypress Date: Thu, 2 Mar 2017 15:49:44 +0100 Subject: [PATCH] Update package README nginx.conf et manifest --- README.md | 10 ++++++ conf/nginx.conf | 82 +++++++++++++++++++++++++++++++------------------ manifest.json | 62 ++++++++++++++++++++++++++++++------- 3 files changed, 113 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index bd79ddf..710024b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,16 @@ ## Grav for YunoHost +## Versionning + +### Version 1.1.0 (02/03/17) + +- Fix Packaging [Source](https://forum.yunohost.org/t/news-about-app-management-and-packaging-in-yunohost-2-4/1379/1) + +### Version 1.0.0 (11/11/15) + +- First version + ### Configuration 1. Start url https://domaine.tld/grav diff --git a/conf/nginx.conf b/conf/nginx.conf index 3934e32..4d95493 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,37 +1,59 @@ -location PATHTOCHANGE { - index index.php; +#--MULTISITE--if (!-e $request_filename) { + #--MULTISITE--rewrite /admin$ $scheme://$host$uri/ permanent; + #--MULTISITE--rewrite ^__PATHTOCHANGE__(/[^/]+)?(/.*\.php)$ __PATHTOCHANGE__$2 last; +#--MULTISITE--} - alias ALIASTOCHANGE; +location __PATHTOCHANGE__ { + alias __FINALPATH__/; + index index.php; - error_page 500 502 503 504 /50x.html; - location = PATHTOCHANGE/50x.html { - root html; - } + if (!-e $request_filename) + { + rewrite ^(.+)$ __PATHTOCHANGE__/index.php?q=$1 last; + } + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } + client_max_body_size 30m; - location PATHTOCHANGE { - if (!-e $request_filename){ rewrite ^(.*)$ PATHTOCHANGE/$2 last; } - try_files $uri $uri/ /index.php?$args; - } + # Add headers to serve security related headers + add_header Strict-Transport-Security "max-age=15768000;"; + add_header X-Content-Type-Options nosniff; + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Robots-Tag none; + add_header X-Download-Options noopen; + add_header X-Permitted-Cross-Domain-Policies none; - location ~ \.php$ { - # Choose either a socket or TCP/IP address - fastcgi_pass unix:/var/run/php5-fpm.sock; - # fastcgi_pass 127.0.0.1:9000; + location ~* \.(jpg|jpeg|gif|css|png|js|ico|swf|mp3|pdf)$ { + # Le contenu statique, est signalé au navigateur comme étant + # à garder en cache une semaine. Si il y a un proxy sur la + # route, celui-ci est autorisé à faire une copie et à la + # cacher. + expires 1w; + add_header Cache-Control public; + } + location ~ [^/]\.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + fastcgi_pass unix:/var/run/php5-fpm-__NAMETOCHANGE__.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; + } - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $request_filename; - } + ## Begin - Security + # deny all direct access for these folders + location ~* /(.git|cache|bin|logs|backups)/.*$ { return 403; } + # deny running scripts inside core system folders + location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } + # deny running scripts inside user folder + location ~* /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } + # deny access to specific files in the root folder + location ~ /(LICENSE|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) { return 403; } + ## End - Security - ## Begin - Security - # deny all direct access for these folders - location ~* /(.git|cache|bin|logs|backups)/.*$ { return 403; } - # deny running scripts inside core system folders - location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } - # deny running scripts inside user folder - location ~* /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } - # deny access to specific files in the root folder - location ~ /(LICENSE|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) { return 403; } - ## End - Security + #--PRIVATE--# Include SSOWAT user panel. + #--PRIVATE--include conf.d/yunohost_panel.conf.inc; } diff --git a/manifest.json b/manifest.json index 1aa814f..65529db 100644 --- a/manifest.json +++ b/manifest.json @@ -1,31 +1,44 @@ { "name": "Grav", "id": "grav", + "packaging_format": 1, "description": { "en": "Grav - Grav is a modern open source flat-file CMS", "fr": "Grav - Grav is a modern open source flat-file CMS" }, - "license": "GPL-3", - "developer": { + "version": "1.1.0", + "url": "https://www.getgrav.org/", + "license": "free", + "maintainer": { "name": "cyp", - "email": "cyp@rouquin.me", - "url": "http://rouquin.me" + "email": "cyp@rouquin.me" }, - "url": "http://www.getgrav.org/", - "multi_instance": "true", + "requirements": { + "yunohost": ">> 2.4.0" + }, + "multi_instance": true, + "services": [ + "nginx", + "php5-fpm", + "mysql" + ], "arguments": { "install" : [ { "name": "domain", + "type": "domain", "ask": { - "en": "Choose a domain for Grav" + "en": "Choose a domain name for SPIP", + "fr": "Choisissez un nom de domaine pour SPIP" }, - "example": "domain.org" + "example": "example.org" }, { "name": "path", + "type": "path", "ask": { - "en": "Choose a path for Grav" + "en": "Choose a path for SPIP", + "fr": "Choisissez un chemin pour SPIP" }, "example": "/grav", "default": "/grav" @@ -34,10 +47,37 @@ "name": "admin", "type": "user", "ask": { - "en": "Choose the Grav administrator (must be an existing YunoHost user)", + "en": "Choose the SPIP administrator (must be an existing YunoHost user)", "fr": "Administrateur du site (doit être un utilisateur YunoHost existant)" }, - "example": "homer" + "example": "johndoe" + }, + { + "name": "is_public", + "ask": { + "en": "Is it a public SPIP site ?", + "fr": "Est-ce un site public ?" + }, + "choices": ["Yes", "No"], + "default": "Yes" + }, + { + "name": "multisite", + "ask": { + "en": "Enable multisite option ?", + "fr": "Activer l'option multisite ?" + }, + "choices": ["Yes", "No"], + "default": "No" + }, + { + "name": "language", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" + }, + "choices": ["en_EN", "fr_FR"], + "default": "fr_FR" } ] }