This repository has been archived by the owner on Oct 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Master with changes from dev branch (#246)
* Set timeout value * Adds hassbian manager script * Should not be there * Add note about port number * fix remove premissions * Fixes typo * Remove controlfile when removing suite * Add autocomplete for remove * Added link in Readme * Adds custom-component-store script * should not be in this PR * Adds basic auth support * Adds basic auth * Don't ask for confirmation during uninstall * Don't ask for confirmation during uninstall * cloud9: Add npm install to c9 script to make sure all packages are installed. (#236) * Add npm install to c9 script to make sure all packages are installed. * typo correction * Typo correction * only use NPM install if sdk install fails. * Print the config issues This will help with troubleshooting * - Change all instances of NodeJS to install NodeJS 10.x - Remove NodeJS package from base install to avoid installing an old version of NodeJS * Master (#244) * Added postgres instructions (#224) * Fixed example (#225) * Update Master with changes from dev branch (#245) * Added postgres instructions (#224) Added database creation and configuration instructions. * Fixed example (#225) Sudo command was missing `-s` flag.
- Loading branch information
Showing
15 changed files
with
371 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Custom component store | ||
|
||
Custom component store is a web UI tool that can help you manage your custom components. | ||
|
||
![overview](https://camo.githubusercontent.com/b01a7e30e5c8d5938eed8091ec23ad9b4dc84cfe/68747470733a2f2f692e6962622e636f2f42737a714c58722f64656d6f2e676966) | ||
|
||
When installed the WEB UI are running on port `8120` | ||
|
||
## Installation | ||
|
||
```bash | ||
sudo hassbian-config install custom-component-store | ||
``` | ||
|
||
## Upgrade | ||
|
||
```bash | ||
sudo hassbian-config upgrade custom-component-store | ||
``` | ||
|
||
## Remove to beta channel | ||
|
||
```bash | ||
sudo hassbian-config remoev custom-component-store | ||
``` | ||
|
||
## Additional info | ||
|
||
Description | Command/value | ||
:--- | :--- | ||
Running as: | homeassistant | ||
Default user: | `pi` | ||
Default password: | `raspberry` | ||
Port: | `8120` | ||
Start service: | `sudo systemctl start custom-component-store@homeassistant.service` | ||
Stop service: | `sudo systemctl stop custom-component-store@homeassistant.service` | ||
Restart service: | `sudo systemctl restart custom-component-store@homeassistant.service` | ||
Service status: | `sudo systemctl status custom-component-store@homeassistant.service` | ||
|
||
*** | ||
|
||
The script was originally contributed by [@Ludeeus][ludeeus]. | ||
|
||
<!--- Links ---> | ||
[ludeeus]: https://github.com/ludeeus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Hassbian manager | ||
|
||
Hassbian manager is a web UI tool that can help you manage your suites. | ||
|
||
When installed the WEB UI are running on port `9999` | ||
|
||
## Installation | ||
|
||
```bash | ||
sudo hassbian-config install manager | ||
``` | ||
|
||
## Upgrade | ||
|
||
```bash | ||
sudo hassbian-config upgrade manager | ||
``` | ||
|
||
## Remove to beta channel | ||
|
||
```bash | ||
sudo hassbian-config remoev manager | ||
``` | ||
|
||
## Additional info | ||
|
||
Description | Command/value | ||
:--- | :--- | ||
Running as: | homeassistant | ||
Default user: | `pi` | ||
Default password: | `raspberry` | ||
Port: | `9999` | ||
Start service: | `sudo systemctl start hassbian-manager@homeassistant.service` | ||
Stop service: | `sudo systemctl stop hassbian-manager@homeassistant.service` | ||
Restart service: | `sudo systemctl restart hassbian-manager@homeassistant.service` | ||
Service status: | `sudo systemctl status hassbian-manager@homeassistant.service` | ||
|
||
*** | ||
|
||
The script was originally contributed by [@Ludeeus][ludeeus]. | ||
|
||
<!--- Links ---> | ||
[ludeeus]: https://github.com/ludeeus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
%homeassistant ALL= NOPASSWD: /usr/local/bin/hassbian-config show * | ||
%homeassistant ALL= NOPASSWD: /usr/local/bin/hassbian-config install * | ||
%homeassistant ALL= NOPASSWD: /usr/local/bin/hassbian-config upgrade * | ||
|
||
%homeassistant ALL= NOPASSWD: /usr/local/bin/hassbian-config remove * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#!/bin/bash | ||
function custom-component-store-show-short-info { | ||
echo "Custom component store script." | ||
} | ||
|
||
function custom-component-store-show-long-info { | ||
echo "Custom component store is a web UI tool that can help you manage your custom components." | ||
} | ||
|
||
function custom-component-store-show-copyright-info { | ||
echo "Original concept by Ludeeus <https://github.com/ludeeus>." | ||
} | ||
|
||
function custom-component-store-install-package { | ||
|
||
if [ "$ACCEPT" == "true" ]; then | ||
username=pi | ||
password=raspberry | ||
else | ||
echo | ||
echo "Please take a moment to setup your the user account" | ||
echo | ||
|
||
echo -n "Username: " | ||
read -r username | ||
if [ ! "$username" ]; then | ||
username=pi | ||
fi | ||
|
||
echo -n "Password: " | ||
read -s -r password | ||
echo | ||
if [ ! "$password" ]; then | ||
password=raspberry | ||
fi | ||
fi | ||
|
||
echo "Installing latest version of Custom component store" | ||
python3 -m pip install componentstore | ||
|
||
echo "Enabling Custom component store service" | ||
cp /opt/hassbian/suites/files/custom-component-store@homeassistant.service /etc/systemd/system/custom-component-store@homeassistant.service | ||
|
||
sed -i "s,%%USERNAME%%,${username},g" /etc/systemd/system/custom-component-store@homeassistant.service | ||
sed -i "s,%%PASSWORD%%,${password},g" /etc/systemd/system/custom-component-store@homeassistant.service | ||
|
||
systemctl enable custom-component-store@homeassistant.service | ||
sync | ||
|
||
echo "Starting Custom component storer" | ||
systemctl start custom-component-store@homeassistant.service | ||
|
||
echo "Starting cleanup" | ||
cd || exit 1 | ||
rm -R /tmp/custom-component-store | ||
|
||
ip_address=$(ifconfig | grep "inet.*broadcast" | grep -v 0.0.0.0 | awk '{print $2}') | ||
|
||
echo "Checking the installation..." | ||
validation=$(pgrep -x componentstore) | ||
if [ ! -z "${validation}" ]; then | ||
echo | ||
echo -e "\\e[32mInstallation done..\\e[0m" | ||
echo "Custom component store installation is running at $ip_address:8120 or if preferred http://hassbian.local:8120" | ||
echo | ||
echo | ||
else | ||
echo | ||
echo -e "\\e[31mInstallation failed..." | ||
echo | ||
return 1 | ||
fi | ||
return 0 | ||
} | ||
|
||
function custom-component-store-upgrade-package { | ||
echo "Upgrading Custom component store" | ||
python3 -m pip install --upgrade componentstore | ||
|
||
echo "Restarting Custom component store" | ||
systemctl start custom-component-store@homeassistant.service | ||
|
||
echo "Checking the installation..." | ||
validation=$(pgrep -x componentstore) | ||
if [ ! -z "${validation}" ]; then | ||
echo | ||
echo -e "\\e[32mUpgrade script completed..\\e[0m" | ||
echo | ||
else | ||
echo | ||
echo -e "\\e[31mUpgrade failed..." | ||
echo | ||
return 1 | ||
fi | ||
return 0 | ||
} | ||
|
||
function custom-component-store-remove-package { | ||
printf "Removing Custom component store...\\n" | ||
systemctl stop custom-component-store@homeassistant.service | ||
systemctl disable custom-component-store@homeassistant.service | ||
rm /etc/systemd/system/custom-component-store@homeassistant.service | ||
sync | ||
|
||
|
||
python3 -m pip uninstall --yes componentstore | ||
|
||
|
||
printf "\\e[32mRemoval done..\\e[0m\\n" | ||
} | ||
|
||
[[ "$_" == "$0" ]] && echo "hassbian-config helper script; do not run directly, use hassbian-config instead" |
16 changes: 16 additions & 0 deletions
16
package/opt/hassbian/suites/files/custom-component-store@homeassistant.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Service file for systems with systemd to run custom-component-store as the homeassistant user. | ||
# | ||
|
||
[Unit] | ||
Description=custom-component-store for %i | ||
After=network.target | ||
|
||
[Service] | ||
Type=simple | ||
User=%i | ||
ExecStart=/usr/local/bin/componentstore --port 8120 --nocache --username %%USERNAME%% --password %%PASSWORD%% --ha_path /home/homeassistant/.homeassistant | ||
SendSIGKILL=no | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
16 changes: 16 additions & 0 deletions
16
package/opt/hassbian/suites/files/hassbian-manager@homeassistant.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Service file for systems with systemd to run Hassbian manager as the homeassistant user. | ||
# | ||
|
||
[Unit] | ||
Description=Hassbian manager for %i | ||
After=network.target | ||
|
||
[Service] | ||
Type=simple | ||
User=%i | ||
ExecStart=/usr/local/bin/pyhassbian --username %%USERNAME%% --password %%PASSWORD%% | ||
SendSIGKILL=no | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.