-
-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
massive cleanup of files and restructure of integrations design
- Loading branch information
subzdev
committed
Jan 7, 2022
1 parent
8c9a386
commit 8d41f2b
Showing
179 changed files
with
24,640 additions
and
3,465 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,8 @@ set -e | |
: "${POSTGRES_USER:=tactical}" | ||
: "${POSTGRES_PASS:=tactical}" | ||
: "${POSTGRES_DB:=tacticalrmm}" | ||
: "${MESH_CONTAINER:=tactical-meshcentral}" | ||
: "${MESH_SERVICE:=tactical-meshcentral}" | ||
: "${MESH_WS_URL:=ws://${MESH_SERVICE}:443}" | ||
: "${MESH_USER:=meshcentral}" | ||
: "${MESH_PASS:=meshcentralpass}" | ||
: "${MESH_HOST:=tactical-meshcentral}" | ||
|
@@ -20,6 +21,9 @@ set -e | |
: "${APP_PORT:=8080}" | ||
: "${API_PORT:=8000}" | ||
|
||
: "${CERT_PRIV_PATH:=${TACTICAL_DIR}/certs/privkey.pem}" | ||
: "${CERT_PUB_PATH:=${TACTICAL_DIR}/certs/fullchain.pem}" | ||
|
||
# Add python venv to path | ||
export PATH="${VIRTUAL_ENV}/bin:$PATH" | ||
|
||
|
@@ -37,7 +41,7 @@ function django_setup { | |
sleep 5 | ||
done | ||
|
||
until (echo > /dev/tcp/"${MESH_CONTAINER}"/443) &> /dev/null; do | ||
until (echo > /dev/tcp/"${MESH_SERVICE}"/443) &> /dev/null; do | ||
echo "waiting for meshcentral container to be ready..." | ||
sleep 5 | ||
done | ||
|
@@ -56,8 +60,8 @@ DEBUG = True | |
DOCKER_BUILD = True | ||
CERT_FILE = '/opt/tactical/certs/fullchain.pem' | ||
KEY_FILE = '/opt/tactical/certs/privkey.pem' | ||
CERT_FILE = '${CERT_PUB_PATH}' | ||
KEY_FILE = '${CERT_PRIV_PATH}' | ||
SCRIPTS_DIR = '${WORKSPACE_DIR}/scripts' | ||
|
@@ -82,6 +86,7 @@ MESH_USERNAME = '${MESH_USER}' | |
MESH_SITE = 'https://${MESH_HOST}' | ||
MESH_TOKEN_KEY = '${MESH_TOKEN}' | ||
REDIS_HOST = '${REDIS_HOST}' | ||
MESH_WS_URL = '${MESH_WS_URL}' | ||
ADMIN_ENABLED = True | ||
EOF | ||
)" | ||
|
@@ -98,6 +103,8 @@ EOF | |
"${VIRTUAL_ENV}"/bin/python manage.py reload_nats | ||
"${VIRTUAL_ENV}"/bin/python manage.py create_natsapi_conf | ||
"${VIRTUAL_ENV}"/bin/python manage.py create_installer_user | ||
"${VIRTUAL_ENV}"/bin/python manage.py post_update_tasks | ||
|
||
|
||
# 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 | ||
|
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 |
---|---|---|
|
@@ -21,4 +21,6 @@ omit = | |
*/tests.py | ||
*/test.py | ||
checks/utils.py | ||
*/asgi.py | ||
*/demo_views.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
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,37 @@ | ||
# import datetime as dt | ||
import random | ||
|
||
from django.core.management.base import BaseCommand | ||
from django.utils import timezone as djangotime | ||
from agents.models import Agent | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "stuff for demo site in cron" | ||
|
||
def handle(self, *args, **kwargs): | ||
|
||
random_dates = [] | ||
|
||
for _ in range(20): | ||
rand = djangotime.now() - djangotime.timedelta(minutes=random.randint(1, 2)) | ||
random_dates.append(rand) | ||
|
||
for _ in range(5): | ||
rand = djangotime.now() - djangotime.timedelta( | ||
minutes=random.randint(10, 20) | ||
) | ||
random_dates.append(rand) | ||
|
||
""" for _ in range(5): | ||
rand = djangotime.now() - djangotime.timedelta(hours=random.randint(1, 10)) | ||
random_dates.append(rand) | ||
for _ in range(5): | ||
rand = djangotime.now() - djangotime.timedelta(days=random.randint(40, 90)) | ||
random_dates.append(rand) """ | ||
|
||
agents = Agent.objects.only("last_seen") | ||
for agent in agents: | ||
agent.last_seen = random.choice(random_dates) | ||
agent.save(update_fields=["last_seen"]) |
Oops, something went wrong.