mirror of
https://github.com/YunoHost-Apps/selfoss_ynh.git
synced 2024-09-03 20:16:21 +02:00
Merge pull request #3 from Binnette/master
Install selfoss on a subfolder
This commit is contained in:
commit
e81c95f7e0
4 changed files with 28 additions and 14 deletions
|
@ -5,7 +5,7 @@
|
||||||
is_public=1
|
is_public=1
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=0
|
setup_sub_dir=1
|
||||||
setup_root=1
|
setup_root=1
|
||||||
setup_nourl=0
|
setup_nourl=0
|
||||||
setup_private=1
|
setup_private=1
|
||||||
|
|
|
@ -1,12 +1,25 @@
|
||||||
location / {
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||||
|
location __PATH__/ {
|
||||||
|
|
||||||
# Path to source
|
# Path to source
|
||||||
alias __FINALPATH__/;
|
alias __FINALPATH__/;
|
||||||
|
|
||||||
index index.php;
|
# index.php is a router, it contains a lot of routes:
|
||||||
|
# / is serving the home page, /update is refreshing all feeds, etc.
|
||||||
|
# So we need to rewrite all URLs to give them to the router inside index.php
|
||||||
|
rewrite ^__PATH__/.*$ __PATH__/index.php?$args;
|
||||||
|
|
||||||
try_files $uri /public/$uri /index.php;
|
# feeds favicons and thumbnails are stored in subfolder data
|
||||||
|
location ~ ^__PATH__/((favicons|thumbnails)/.+)$ {
|
||||||
|
try_files __PATH__/data/$1 =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# statics assets are stored in public folder
|
||||||
|
location ~ ^__PATH__/(.*\.(js|ico|gif|jpg|png|css|map|asc|txt|svg|xml|webmanifest)).*$ {
|
||||||
|
try_files __PATH__/public/$1 =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Regex to match PHP files
|
||||||
location ~ [^/]\.php(/|$) {
|
location ~ [^/]\.php(/|$) {
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||||
|
@ -18,11 +31,6 @@ location / {
|
||||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(favicons|thumbnails)/.*$ {
|
# Include SSOWAT user panel.
|
||||||
try_files $uri /data/$uri;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
}
|
|
||||||
|
|
||||||
location ~* ^/(data\/logs|data\/sqlite|config\.ini|\.ht) {
|
|
||||||
deny all;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,12 @@
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "domain"
|
"type": "domain"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "path",
|
||||||
|
"example": "/selfoss",
|
||||||
|
"default": "/selfoss"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
|
|
@ -21,7 +21,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url="/"
|
path_url=$YNH_APP_ARG_PATH
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
Loading…
Add table
Reference in a new issue