Skip to content

Commit 22cf48e

Browse files
EricEric
authored andcommitted
v0.1.1
1 parent c074e24 commit 22cf48e

2 files changed

Lines changed: 68 additions & 9 deletions

File tree

README.md

Lines changed: 67 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,65 @@
33
# MudPi Setup Assistant
44
> A web application with setup scripts to make first time configurations in MudPi.
55
6-
MudPi Assistant is a lightweight php application that helps with first time configurations like connecting to Wifi. This is generally useful for non-developers that want a friendly interface for initial configurations. MudPi Assistant can be installed through the installer or manually by downloading the repo into your web server root and adding the appropriate server configurations. A sample nginx config is provided at `configs/mudpi_assistant.conf`. This application is quite useful in combination with an access point.
6+
MudPi Assistant is a lightweight php application that helps with first time configurations such as connecting to Wifi. Typically this app will be used for initial configurations and then be removed in place of [MudPi UI](https://github.com/mudpi/ui) after finishing setup. Assistant makes use of `wpa_supplicant` to help configure your network settings.
77

8-
## Documentation
9-
For full documentation visit [mudpi.app](https://mudpi.app/docs/setup-assistant)
8+
## Installation
9+
Clone the repo into your web server i.e. nginx
10+
```
11+
cd /var/www/html/mudpi_assistant
12+
git clone https://github.com/mudpi/assistant.git
13+
```
1014

15+
Check and copy the provided server config file to nginx. Make sure the root is correct and proper php-fpm version is selected.
16+
```
17+
sudo cp /var/www/html/mudpi_assistant/configs/mudpi_assistant.conf /etc/nginx/sites-enabled
18+
sudo nginx -t
19+
sudo service nginx restart
20+
```
1121

12-
## Guides
13-
For examples and guides on how to setup and use MudPi check out the [free guides we prepared.](https://mudpi.app/guides)
22+
Update your sudoers files with visudo and add the following
23+
```
24+
www-data ALL=(ALL) NOPASSWD:/sbin/shutdown -h now
25+
www-data ALL=(ALL) NOPASSWD:/sbin/reboot
26+
www-data ALL=(ALL) NOPASSWD:/sbin/ifdown
27+
www-data ALL=(ALL) NOPASSWD:/sbin/ifup
28+
www-data ALL=(ALL) NOPASSWD:/sbin/dhclient
29+
www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wpa_supplicant/wpa_supplicant.conf
30+
www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wpa_supplicant/wpa_supplicant-wlan[0-9].conf
31+
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/wpa_supplicant.tmp /etc/wpa_supplicant/wpa_supplicant.conf
32+
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/wpa_supplicant.tmp /etc/wpa_supplicant/wpa_supplicant-wlan[0-9].conf
33+
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/wpa_supplicant.tmp /etc/mudpi/tmp/wpa_supplicant.conf
34+
www-data ALL=(ALL) NOPASSWD:/bin/rm /tmp/wpa_supplicant.tmp
35+
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli -i wlan[0-9] scan_results
36+
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli -i wlan[0-9] scan
37+
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli -i wlan[0-9] reconfigure
38+
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli -i wlan[0-9] select_network
39+
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/hostapddata /etc/hostapd/hostapd.conf
40+
www-data ALL=(ALL) NOPASSWD:/bin/systemctl start hostapd.service
41+
www-data ALL=(ALL) NOPASSWD:/bin/systemctl stop hostapd.service
42+
www-data ALL=(ALL) NOPASSWD:/bin/systemctl enable hostapd.service
43+
www-data ALL=(ALL) NOPASSWD:/bin/systemctl disable hostapd.service
44+
www-data ALL=(ALL) NOPASSWD:/bin/systemctl start dnsmasq.service
45+
www-data ALL=(ALL) NOPASSWD:/bin/systemctl enable dnsmasq.service
46+
www-data ALL=(ALL) NOPASSWD:/bin/systemctl disable dnsmasq.service
47+
www-data ALL=(ALL) NOPASSWD:/bin/systemctl stop dnsmasq.service
48+
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dnsmasqdata /etc/dnsmasq.conf
49+
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dhcpddata /etc/dhcpcd.conf
50+
www-data ALL=(ALL) NOPASSWD:/bin/cp /etc/mudpi/networking/dhcpcd.conf /etc/dhcpcd.conf
51+
www-data ALL=(ALL) NOPASSWD:/sbin/ip link set wlan[0-9] down
52+
www-data ALL=(ALL) NOPASSWD:/sbin/ip link set wlan[0-9] up
53+
www-data ALL=(ALL) NOPASSWD:/sbin/ip -s a f label wlan[0-9]
54+
www-data ALL=(ALL) NOPASSWD:/sbin/iw dev wlan0 scan ap-force
55+
www-data ALL=(ALL) NOPASSWD:/usr/bin/auto_hotspot
56+
www-data ALL=(ALL) NOPASSWD:/usr/bin/start_hotspot
57+
www-data ALL=(ALL) NOPASSWD:/usr/bin/stop_hotspot
58+
```
1459

60+
## Troubleshooting
61+
Make sure to check folder permissions and that the proper commands have been added to your sudoers file for the web server user.
1562

16-
## Contributing
17-
Any contributions you can make will be greatly appreciated. If you are interested in contributing please get in touch with me and submit a pull request. There is much more I would like to add support for, however being a single developer limits my scope.
63+
## Documentation
64+
For full documentation visit [mudpi.app](https://mudpi.app/docs/setup-assistant)
1865

1966

2067
## Versioning
@@ -23,7 +70,19 @@ Breaking.Major.Minor
2370

2471
## Authors
2572
* Eric Davisson - [Website](http://ericdavisson.com)
26-
* [Twitter.com/theDavisson](http://twitter.com/theDavisson)
73+
* [Twitter.com/theDavisson](https://twitter.com/theDavisson)
74+
75+
## Community
76+
* Discord - [Join](https://discord.gg/daWg2YH)
77+
* [Twitter.com/MudpiApp](https://twitter.com/mudpiapp)
78+
79+
## Devices Tested On
80+
* [Raspberry Pi 2 Model B+](https://www.raspberrypi.org/products/raspberry-pi-2-model-b/)
81+
* [Raspberry Pi 3 Model B](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/)
82+
* [Raspberry Pi 3 Model B+](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/)
83+
* [Raspberry Pi Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/)
84+
85+
Let me know if you are able to confirm tests on any other devices
2786

2887
## License
2988
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

configs/mudpi_assistant.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ server {
4949
## Begin - PHP
5050
location ~ \.php$ {
5151
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
52-
# fastcgi_pass 127.0.0.1:9000;
52+
#fastcgi_pass unix:/run/php/php7.0-fpm.sock;
5353
fastcgi_split_path_info ^(.+\.php)(/.+)$;
5454
fastcgi_index index.php;
5555
include fastcgi_params;

0 commit comments

Comments
 (0)