-
-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
145 changed files
with
8,301 additions
and
4,798 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
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 |
---|---|---|
|
@@ -45,7 +45,7 @@ function django_setup { | |
echo "setting up django environment" | ||
|
||
# configure django settings | ||
MESH_TOKEN=$(cat ${TACTICAL_DIR}/tmp/mesh_token) | ||
MESH_TOKEN="$(cat ${TACTICAL_DIR}/tmp/mesh_token)" | ||
|
||
DJANGO_SEKRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 80 | head -n 1) | ||
|
||
|
@@ -106,29 +106,28 @@ EOF | |
echo "${localvars}" > ${WORKSPACE_DIR}/api/tacticalrmm/tacticalrmm/local_settings.py | ||
|
||
# run migrations and init scripts | ||
python manage.py migrate --no-input | ||
python manage.py collectstatic --no-input | ||
python manage.py initial_db_setup | ||
python manage.py initial_mesh_setup | ||
python manage.py load_chocos | ||
python manage.py load_community_scripts | ||
python manage.py reload_nats | ||
"${VIRTUAL_ENV}"/bin/python manage.py migrate --no-input | ||
"${VIRTUAL_ENV}"/bin/python manage.py collectstatic --no-input | ||
"${VIRTUAL_ENV}"/bin/python manage.py initial_db_setup | ||
"${VIRTUAL_ENV}"/bin/python manage.py initial_mesh_setup | ||
"${VIRTUAL_ENV}"/bin/python manage.py load_chocos | ||
"${VIRTUAL_ENV}"/bin/python manage.py load_community_scripts | ||
"${VIRTUAL_ENV}"/bin/python manage.py reload_nats | ||
|
||
# create super user | ||
echo "from accounts.models import User; User.objects.create_superuser('${TRMM_USER}', '[email protected]', '${TRMM_PASS}') if not User.objects.filter(username='${TRMM_USER}').exists() else 0;" | python manage.py shell | ||
|
||
} | ||
|
||
if [ "$1" = 'tactical-init-dev' ]; then | ||
|
||
# make directories if they don't exist | ||
mkdir -p ${TACTICAL_DIR}/tmp | ||
mkdir -p "${TACTICAL_DIR}/tmp" | ||
|
||
test -f "${TACTICAL_READY_FILE}" && rm "${TACTICAL_READY_FILE}" | ||
|
||
# setup Python virtual env and install dependencies | ||
test -f ${VIRTUAL_ENV} && python -m venv --copies ${VIRTUAL_ENV} | ||
pip install --no-cache-dir -r /requirements.txt | ||
! test -e "${VIRTUAL_ENV}" && python -m venv --copies ${VIRTUAL_ENV} | ||
"${VIRTUAL_ENV}"/bin/pip install --no-cache-dir -r /requirements.txt | ||
|
||
django_setup | ||
|
||
|
@@ -150,20 +149,20 @@ EOF | |
fi | ||
|
||
if [ "$1" = 'tactical-api' ]; then | ||
cp ${WORKSPACE_DIR}/api/tacticalrmm/core/goinstaller/bin/goversioninfo /usr/local/bin/goversioninfo | ||
cp "${WORKSPACE_DIR}"/api/tacticalrmm/core/goinstaller/bin/goversioninfo /usr/local/bin/goversioninfo | ||
chmod +x /usr/local/bin/goversioninfo | ||
|
||
check_tactical_ready | ||
python manage.py runserver 0.0.0.0:${API_PORT} | ||
"${VIRTUAL_ENV}"/bin/python manage.py runserver 0.0.0.0:"${API_PORT}" | ||
fi | ||
|
||
if [ "$1" = 'tactical-celery-dev' ]; then | ||
check_tactical_ready | ||
env/bin/celery -A tacticalrmm worker -l debug | ||
"${VIRTUAL_ENV}"/bin/celery -A tacticalrmm worker -l debug | ||
fi | ||
|
||
if [ "$1" = 'tactical-celerybeat-dev' ]; then | ||
check_tactical_ready | ||
test -f "${WORKSPACE_DIR}/api/tacticalrmm/celerybeat.pid" && rm "${WORKSPACE_DIR}/api/tacticalrmm/celerybeat.pid" | ||
env/bin/celery -A tacticalrmm beat -l debug | ||
"${VIRTUAL_ENV}"/bin/celery -A tacticalrmm beat -l debug | ||
fi |
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,8 +1,7 @@ | ||
from django.contrib import admin | ||
|
||
from .models import Agent, AgentOutage, RecoveryAction, Note | ||
from .models import Agent, RecoveryAction, Note | ||
|
||
admin.site.register(Agent) | ||
admin.site.register(AgentOutage) | ||
admin.site.register(RecoveryAction) | ||
admin.site.register(Note) |
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
18 changes: 18 additions & 0 deletions
18
api/tacticalrmm/agents/migrations/0027_agent_overdue_dashboard_alert.py
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,18 @@ | ||
# Generated by Django 3.1.4 on 2021-01-29 21:11 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('agents', '0026_auto_20201125_2334'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='agent', | ||
name='overdue_dashboard_alert', | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
api/tacticalrmm/agents/migrations/0028_auto_20210206_1534.py
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,23 @@ | ||
# Generated by Django 3.1.4 on 2021-02-06 15:34 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('agents', '0027_agent_overdue_dashboard_alert'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='agentoutage', | ||
name='outage_email_sent_time', | ||
field=models.DateTimeField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='agentoutage', | ||
name='outage_sms_sent_time', | ||
field=models.DateTimeField(blank=True, null=True), | ||
), | ||
] |
16 changes: 16 additions & 0 deletions
16
api/tacticalrmm/agents/migrations/0029_delete_agentoutage.py
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 @@ | ||
# Generated by Django 3.1.4 on 2021-02-10 21:56 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('agents', '0028_auto_20210206_1534'), | ||
] | ||
|
||
operations = [ | ||
migrations.DeleteModel( | ||
name='AgentOutage', | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
api/tacticalrmm/agents/migrations/0030_agent_offline_time.py
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,18 @@ | ||
# Generated by Django 3.1.6 on 2021-02-16 08:50 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('agents', '0029_delete_agentoutage'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='agent', | ||
name='offline_time', | ||
field=models.PositiveIntegerField(default=4), | ||
), | ||
] |
Oops, something went wrong.