Skip to content

Commit

Permalink
enhance demowebservice:
Browse files Browse the repository at this point in the history
- add port 8889 for Web Portal on DSM 7
- add page with remarks install wizard
- reverse proxy configuration on DSM 7 does not work and is not added to resource file (#5544)
  • Loading branch information
hgy59 committed Oct 14, 2023
1 parent 774c5a4 commit 3161880
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 44 deletions.
2 changes: 2 additions & 0 deletions spk/demowebservice/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ CONF_DIR = src/conf_php$(PHP_VERSION)/
# With app/config on DSM 7 (sometimes) an error occurred: System error. Unable to perform this operation. Please try again later.
# Disable the creation of app/config file:
NO_SERVICE_SHORTCUT = y
# create firewall rules, since we add a port based "Web Portal"
SERVICE_PORT = 8889
endif

# apache-web dependency is not used:
Expand Down
95 changes: 53 additions & 42 deletions spk/demowebservice/src/conf_php8.2/resource
Original file line number Diff line number Diff line change
@@ -1,44 +1,55 @@
{
"data-share": {
"shares": [
{
"name": "{{wizard_shared_folder_name}}",
"permission":{"rw":["sc-demowebservice"]}
}
]
},
"webservice": {
"services": [{
"service": "demowebservice",
"display_name": "Demo Web Service",
"icon": "app/images/demowebservice-{0}.png",
"type": "apache_php",
"root": "demowebservice",
"backend": 2,
"php": {
"profile_name": "Web Service Demo Profile",
"profile_desc": "PHP 8.2 profile for Demo Web Service",
"backend": 11,
"extensions": [],
"user": "sc-demowebservice",
"group": "http"
}
}],
"portals": [
{
"service": "demowebservice",
"type": "alias",
"name": "Demo Web Service",
"alias": "demowebservice",
"app": "com.synocommunity.packages.demowebservice"
}
],
"pkg_dir_prepare": [{
"source": "/var/packages/demowebservice/target/web/demowebservice",
"target": "demowebservice",
"mode": "0755",
"user": "sc-demowebservice",
"group": "http"
}]
}
"data-share": {
"shares": [
{
"name": "{{wizard_shared_folder_name}}",
"permission":{"rw":["sc-demowebservice"]}
}
]
},
"webservice": {
"services": [
{
"service": "demowebservice",
"display_name": "Demo Web Service",
"icon": "app/images/demowebservice-{0}.png",
"type": "apache_php",
"root": "demowebservice",
"backend": 2,
"php": {
"profile_name": "Web Service Demo Profile",
"profile_desc": "PHP 8.2 profile for Demo Web Service",
"backend": 11,
"extensions": [],
"user": "sc-demowebservice",
"group": "http"
}
}
],
"portals": [
{
"service": "demowebservice",
"type": "alias",
"name": "Demo Web Service (Alias)",
"alias": "demowebservice",
"app": "com.synocommunity.packages.demowebservice"
},
{
"service": "demowebservice",
"type": "server",
"name": "Demo Web Service (Port)",
"http_port": [8889],
"app": "com.synocommunity.packages.demowebservice"
}
],
"pkg_dir_prepare": [
{
"source": "/var/packages/demowebservice/target/web/demowebservice",
"target": "demowebservice",
"mode": "0755",
"user": "sc-demowebservice",
"group": "http"
}
]
}
}
20 changes: 18 additions & 2 deletions spk/demowebservice/src/wizard/install_uifile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,27 @@
}
}
]
}, {
},
{
"desc": ""
}, {
},
{
"desc": "This package runs as internal service user <b>'sc-demowebservice'</b> in DSM. The shared folder above is configured at installation time to be accessible by this user.<p>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
}
]
},
{
"step_title": "Miscellaneous Remarks",
"items": [
{
"desc": "<b>On DSM 6</b><br/>In <b>Web Station</b> you can use any web server (apache or nginx) and you must configure a PHP profile for this demo to work."
},
{
"desc": "<b>On DSM 7</b><br/>This demowebservice will be accessible by path (http://&lt;local ip&gt;/demowebservice) or by port (http://&lt;local ip&gt;:8889) on your diskstation.<p>The port based \"Web Portal\" allows reverse proxy configuration for this demo. Alas configuration of a reverse proxy does not work by the package installer and you would have to manually create a reverse proxy for http://localhost:8889."
},
{
"desc": "<b>PHP open_basedir</b><br/>If this demowebservice can not display the content of the shared folder, you might have configured a non empty <b><tt>open_basedir</tt></b> in the PHP profile. To solve this, you must add the path of the shared folder. On DSM 7 a specific PHP profile with an empty open_basedir is installed, but on other systems you might face this restriction depending on the PHP profile used."
}
]
}
]

0 comments on commit 3161880

Please sign in to comment.