Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow name of Pi to be specified for GUI install #285

Merged
merged 1 commit into from
Nov 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,17 @@ If you are using a desktop environment (Pixel, Mate, LXDE, etc) or using remote
![](http://www.thomasjacquin.com/allsky-portal/screenshots/camera-settings.jpg)

If you don't want to configure the camera using the terminal, you can install the web based [graphical interface](https://github.com/thomasjacquin/allsky-portal).
Please note that this will change your hostname to allsky, install lighttpd and replace your /var/www/html directory. It will also move settings.json to `/etc/raspap/settings.json`.
Please note that this will change your hostname to allsky (or whatever you called it when installing), install lighttpd and replace your /var/www/html directory. It will also move settings.json to `/etc/raspap/settings.json`.

```shell
sudo gui/install.sh
```
Or if you don't want to use the default name of 'allsky' for your pi use the following

```shell
sudo gui/install.sh piname
```

**Note:*** If you use an older version of Raspbian, the install script may fail on php7.0-cgi dependency. Edit gui/install.sh and replace php7.0-cgi by php5-cgi.

After you complete the GUI setup, you'll be able to administer the camera using the web UI by navigating to
Expand All @@ -207,6 +213,11 @@ or
http://allsky.local
```

Note: If you changed the name of your pi during the gui install then use
```sh
http://piname.local
```

The default username is 'admin' and the default password is 'secret'.

A public page is also available in order to view the current image without having to log into the portal. This can be useful for people who don't have a personal website but still want to share a view of their sky :
Expand Down
16 changes: 12 additions & 4 deletions gui/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color

if [ $# -eq 1 ] ; then
HOST_NAME=$1
else
HOST_NAME='allsky'
fi


echo -en '\n'
echo -e "${RED}****************************************************************"
echo "*** Welcome to the Allsky Administration Portal installation ***"
Expand All @@ -23,8 +31,8 @@ sed -i "s|/home/pi/allsky|$(dirname "$SCRIPTPATH")|g" $SCRIPTPATH/lighttpd.conf
cp $SCRIPTPATH/lighttpd.conf /etc/lighttpd/lighttpd.conf
echo -en '\n'
echo -e "${GREEN}* Changing hostname to allsky${NC}"
echo "allsky" > /etc/hostname
sed -i 's/raspberrypi/allsky/g' /etc/hosts
echo "$HOST_NAME" > /etc/hostname
sed -i 's/raspberrypi/$HOST_NAME/g' /etc/hosts
echo -en '\n'
echo -e "${GREEN}* Setting avahi-daemon configuration${NC}"
cp $SCRIPTPATH/avahi-daemon.conf /etc/avahi/avahi-daemon.conf
Expand Down Expand Up @@ -53,11 +61,11 @@ sed -i '/CAMERA_SETTINGS_DIR=/c\CAMERA_SETTINGS_DIR="/etc/raspap"' $(dirname "$S
echo -en '\n'
echo -en '\n'
echo "The Allsky Portal is now installed"
echo "You can now reboot the Raspberry Pi and connect to it from your laptop, computer, phone, tablet at this address: http://allsky.local or http://`ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'`"
echo "You can now reboot the Raspberry Pi and connect to it from your laptop, computer, phone, tablet at this address: http://$HOST_NAME.local or http://`ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'`"
echo -en '\n'
read -p "Do you want to reboot now? [y/n] " ans_yn
case "$ans_yn" in
[Yy]|[Yy][Ee][Ss]) reboot now;;

*) exit 3;;
esac
esac