$ git clone https://github.com/KNaiskes/control-panel
$ cd control-panel
$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python controlpanel/manage.py makemigrations
$ python controlpanel/manage.py migrate
$ python controlpanel/manage.py createsuperuser
$ python controlpanel/manage.py runserver
Note Make sure to add your static ip in config.json
$ python controlpanel/manage.py runserver 0.0.0.0:8000
$ sudo apt-get update
$ sudo apt-get install mosquitto mosquitto-clients
$ sudo pacman -S mosquitto
Start mosquitto service
$ sudo systemctl start mosquitto
$ sudo mosquitto_passwd -c /etc/mosquitto/passwd newUser
Add to the end of file /etc/mosquitto/mosquitto.conf the following
allow_anonymous false
password_file /etc/mosquitto/passwd
restart mosquitto service
$ sudo systemctl restart mosquitto
Open dhcpcd.conf
$ sudo vim /etc/dhcpcd.conf
And append to the end of the file the following:
interface eth0
static ip_address=192.168.1.10/24
static routers=192.168.1.254
static domain_name_servers=192.168.1.1
Lastly reboot in order to be assigned the static IP address
Note: Change the network settings accordingly to your network.
$ sudo pacman -Sy
$ sudo pacman -S postgresql
$ sudo su - postgres
[postgres]$ initdb -D /var/lib/postgres/data
$ exit
$ sudo systemctl start postgresql
$ sudo su - postgres
$ psql
$ CREATE DATABASE dbName;
$ CREATE USER myUsername WITH PASSWORD 'password';
$ ALTER ROLE myUsername SET client_encoding TO 'utf8';
$ ALTER ROLE myUsername SET default_transaction_isolation TO 'read committed';
$ ALTER ROLE myUsername SET timezone TO 'UTC';
$ GRANT ALL PRIVILEGES ON DATABASE dbName TO myUsername;
$ \q
$ exit