diff --git a/install.sh b/install.sh index 45a68eaa..d989f25e 100755 --- a/install.sh +++ b/install.sh @@ -155,30 +155,6 @@ sudo chown ${USER}:${USER} /var/log/celery git clone https://github.com/wh1te909/tacticalrmm.git /home/${USER}/rmm/ sudo chown ${USER}:www-data -R /home/${USER}/rmm/api/tacticalrmm - - -print_green 'Installing the backend' - -cd /home/${USER}/rmm/api -python3.7 -m venv env -source /home/${USER}/rmm/api/env/bin/activate -cd /home/${USER}/rmm/api/tacticalrmm -pip install --upgrade pip -pip install -r /home/${USER}/rmm/api/tacticalrmm/requirements.txt -python manage.py migrate -python manage.py collectstatic -printf >&2 "${YELLOW}%0.s*${NC}" {1..80} -printf >&2 "\n" -printf >&2 "${YELLOW}Please create your login for the RMM website and django admin${NC}\n" -printf >&2 "${YELLOW}%0.s*${NC}" {1..80} -printf >&2 "\n" -echo -ne "Username: " -read djangousername -python manage.py createsuperuser --username ${djangousername} --email ${letsemail} -RANDBASE=$(python manage.py generate_totp) -python manage.py generate_barcode ${RANDBASE} ${djangousername} -deactivate - localvars="$(cat << EOF SECRET_KEY = "${DJANGO_SEKRET}" @@ -232,11 +208,40 @@ SALT_USERNAME = "saltapi" SALT_PASSWORD = "${SALTPW}" MESH_USERNAME = "${meshusername}" MESH_SITE = "https://${meshdomain}" -TWO_FACTOR_OTP = "${RANDBASE}" EOF )" echo "${localvars}" > /home/${USER}/rmm/api/tacticalrmm/tacticalrmm/local_settings.py +print_green 'Installing the backend' + +cd /home/${USER}/rmm/api +python3.7 -m venv env +source /home/${USER}/rmm/api/env/bin/activate +cd /home/${USER}/rmm/api/tacticalrmm +pip install --upgrade pip +pip install -r /home/${USER}/rmm/api/tacticalrmm/requirements.txt +python manage.py migrate +python manage.py collectstatic +printf >&2 "${YELLOW}%0.s*${NC}" {1..80} +printf >&2 "\n" +printf >&2 "${YELLOW}Please create your login for the RMM website and django admin${NC}\n" +printf >&2 "${YELLOW}%0.s*${NC}" {1..80} +printf >&2 "\n" +echo -ne "Username: " +read djangousername +python manage.py createsuperuser --username ${djangousername} --email ${letsemail} +RANDBASE=$(python manage.py generate_totp) +cls +python manage.py generate_barcode ${RANDBASE} ${djangousername} +deactivate +read -n 1 -s -r -p "Press any key to continue..." + +totp="$(cat << EOF +TWO_FACTOR_OTP = "${RANDBASE}" +EOF +)" +echo "${totp}" | tee --append /home/${USER}/rmm/api/tacticalrmm/tacticalrmm/local_settings.py > /dev/null + uwsgini="$(cat << EOF [uwsgi]