Skip to content

Commit 2041797

Browse files
committed
Update for v2.X pluginable support
1 parent b97f6e1 commit 2041797

File tree

6 files changed

+280
-225
lines changed

6 files changed

+280
-225
lines changed

Installers/NodeBB/NodeBBSetup.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
2-
32
namespace Hestia\WebApp\Installers\NodeBB;
43
use Hestia\WebApp\Installers\BaseSetup as BaseSetup;
5-
require_once( '/usr/local/hestia/web/pluginable.php' );
64

75
class NodeBBSetup extends BaseSetup {
86
protected $appInfo = [
@@ -16,9 +14,9 @@ class NodeBBSetup extends BaseSetup {
1614
protected $appname = "nodebb";
1715
protected $config = [
1816
"form" => [
19-
"nodebb_username" => ["value" => "nbbadmin"],
20-
"nodebb_password" => "password",
21-
"nodebb_email" => ["value" => ""],
17+
"nodeBB_username" => ["value" => "nbbadmin"],
18+
"nodeBB_password" => "password",
19+
"nodeBB_email" => ["value" => ""],
2220
"nodebb_folder" => ["type" => "text", "value" => "", "placeholder" => "/", "label" => "Install Directory"]
2321
],
2422
"database" => true,
@@ -32,19 +30,12 @@ class NodeBBSetup extends BaseSetup {
3230
],
3331
];
3432

35-
public function __construct($domain, $appcontext) {
36-
$v = trim( file_get_contents( '/usr/local/hestia/plugins/nodebb/nodebb_version.sh' ) );
37-
$v = str_replace( ['nodebb_version=', '"'], "", $v );
38-
$this->appInfo['version'] = $v;
39-
parent::__construct($domain, $appcontext);
40-
}
41-
4233
public function install(array $options = null) {
4334
global $hcpp;
4435
$parse = explode( '/', $this->getDocRoot() );
4536
$options['user'] = $parse[2];
4637
$options['domain'] = $parse[4];
47-
$hcpp->run( 'invoke-plugin nodebb_install ' . escapeshellarg( json_encode( $options ) ) );
38+
$hcpp->run( 'v-invoke-plugin nodebb_setup ' . escapeshellarg( json_encode( $options ) ) );
4839
return true;
4940
}
5041
}

README.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,23 @@ A plugin for Hestia Control Panel (via hestiacp-pluginable) that enables hosting
33
With this plugin installed, a new Quick Installer option will appear. User accounts can host their own NodeBB instance either in the root domain or as a subfolder installation. For instance, it is possible to run WordPress in the root domain while having NodeBB installed on the same domain in a subfolder (i.e. https://example.com/nodebb-forum).
44

55
## Installation
6-
HCPP-NodeBB requires an Ubuntu based installation of [Hestia Control Panel](https://hestiacp.com) in addition to an installation of [HestiaCP-Pluginable](https://github.com/virtuosoft-dev/hestiacp-pluginable) *and* [HCPP-NodeApp](https://github.com/virtuosoft-dev/hcpp-nodeapp) to function; please ensure that you have first installed both Pluginable and NodeApp on your Hestia Control Panel before proceeding. Switch to a root user and simply clone this project to the /usr/local/hestia/plugins folder. It should appear as a subfolder with the name `nodebb`, i.e. `/usr/local/hestia/plugins/nodebb`.
7-
8-
First, switch to root user:
9-
```
10-
sudo -s
11-
```
12-
13-
Then simply clone the repo to your plugins folder, with the name `nodebb`:
6+
HCPP-NodeBB requires an Ubuntu or Debian based installation of [Hestia Control Panel](https://hestiacp.com) in addition to an installation of [HestiaCP-Pluginable](https://github.com/virtuosoft-dev/hestiacp-pluginable) *and* [HCPP-NodeApp](https://github.com/virtuosoft-dev/hcpp-nodeapp) to function; please ensure that you have first installed pluginable on your Hestia Control Panel before proceeding. Clone the latest release version (i.e. replace **v2.0.0** below with the latest release version) to the nodebb folder:
147

158
```
169
cd /usr/local/hestia/plugins
17-
git clone https://github.com/virtuosoft-dev/hcpp-nodebb nodebb
10+
sudo git clone --branch v2.0.0 https://github.com/virtuosoft-dev/hcpp-nodebb nodebb
1811
```
1912

2013
Note: It is important that the destination plugin folder name is `nodebb`.
2114

22-
Be sure to logout and login again to your Hestia Control Panel as the admin user or, as admin, visit Server (gear icon) -> Configure -> Plugins -> Save; the plugin will immediately start installing NodeJS and NodeBB depedencies in the background. A notification will appear under the admin user account indicating *"NodeBB plugin has finished installing"* when complete. This may take awhile before the options appear in Hestia. You can force manual installation via root level SSH:
15+
Be sure to logout and login again to your Hestia Control Panel as the admin user or, as admin, visit Server (gear icon) -> Configure -> Plugins -> Save; the plugin will immediately start installing depedencies in the background.
16+
17+
A notification will appear under the admin user account indicating *"NodeBB plugin has finished installing"* when complete. This may take awhile before the options appear in Hestia. You can force manual installation via:
2318

2419
```
25-
sudo -s
2620
cd /usr/local/hestia/plugins/nodebb
27-
./install
28-
touch "/usr/local/hestia/data/hcpp/installed/nodebb"
21+
sudo ./install
22+
sudo touch "/usr/local/hestia/data/hcpp/installed/nodebb"
2923
```
3024

3125
## Support the creator

install

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
11
#!/bin/bash
22
export DEBIAN_FRONTEND=noninteractive
3+
dir=$PWD
34

45
############################################
56
# Install NodeBB
67
############################################
7-
8-
dir=$PWD
9-
source "$dir/nodebb_version.sh"
10-
if [ ! -d "/opt/nodebb/v$nodebb_version" ]; then
11-
12-
mkdir -p "/opt/nodebb/v$nodebb_version"
13-
cd "/opt/nodebb/v$nodebb_version"
14-
git clone -b "v$nodebb_version" https://github.com/NodeBB/NodeBB.git nodebb
15-
cd nodebb
16-
rm -rf .DS_Store
17-
./nodebb setup --help
18-
fi
19-
208
# Copy over our Quick Install App
21-
cd "$dir"
9+
cd $dir
2210
rsync -r ./Installers/ /usr/local/hestia/web/src/app/WebApp/Installers/
11+
/usr/local/hestia/bin/v-invoke-plugin nodebb_install
2312

2413
# Notify installation has finished
25-
/usr/local/hestia/bin/v-add-user-notification admin "NodeBB" "&#128153; NodeBB plugin has finished installing."
14+
/usr/local/hestia/bin/v-add-user-notification admin "NodeBB" "&#128153; NodeBB plugin has finished installing."

0 commit comments

Comments
 (0)