Skip to content

Commit

Permalink
Release 0.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Feb 16, 2021
2 parents 1e03c62 + 9ed3abf commit 7e48015
Show file tree
Hide file tree
Showing 145 changed files with 8,301 additions and 4,798 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ POSTGRES_USER=postgres
POSTGRES_PASS=postgrespass

# DEV SETTINGS
APP_PORT=8000
API_PORT=8080
APP_PORT=80
API_PORT=80
HTTP_PROTOCOL=https
2 changes: 2 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: '3.4'
services:
api-dev:
image: api-dev
restart: always
build:
context: .
dockerfile: ./api.dockerfile
Expand All @@ -21,6 +22,7 @@ services:

app-dev:
image: node:12-alpine
restart: always
command: /bin/sh -c "npm install && npm run serve -- --host 0.0.0.0 --port ${APP_PORT}"
working_dir: /workspace/web
volumes:
Expand Down
31 changes: 15 additions & 16 deletions .devcontainer/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand All @@ -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
40 changes: 21 additions & 19 deletions .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
# To ensure app dependencies are ported from your virtual environment/host machine into your container, run 'pip freeze > requirements.txt' in the terminal to overwrite this file
amqp==2.6.1
amqp==5.0.5
asgiref==3.3.1
asyncio-nats-client==0.11.4
billiard==3.6.3.0
celery==4.4.6
celery==5.0.5
certifi==2020.12.5
cffi==1.14.3
chardet==3.0.4
cryptography==3.2.1
cffi==1.14.5
chardet==4.0.0
cryptography==3.4.4
decorator==4.4.2
Django==3.1.4
django-cors-headers==3.5.0
Django==3.1.6
django-cors-headers==3.7.0
django-rest-knox==4.1.0
djangorestframework==3.12.2
future==0.18.2
idna==2.10
kombu==4.6.11
kombu==5.0.2
loguru==0.5.3
msgpack==1.0.0
packaging==20.4
msgpack==1.0.2
packaging==20.8
psycopg2-binary==2.8.6
pycparser==2.20
pycryptodome==3.9.9
pyotp==2.4.1
pycryptodome==3.10.1
pyotp==2.6.0
pyparsing==2.4.7
pytz==2020.4
pytz==2021.1
qrcode==6.1
redis==3.5.3
requests==2.25.0
requests==2.25.1
six==1.15.0
sqlparse==0.4.1
twilio==6.49.0
urllib3==1.26.2
validators==0.18.1
vine==1.3.0
twilio==6.52.0
urllib3==1.26.3
validators==0.18.2
vine==5.0.0
websockets==8.1
zipp==3.4.0
black
Expand All @@ -42,3 +41,6 @@ django-extensions
coverage
coveralls
model_bakery
mkdocs
mkdocs-material
pymdown-extensions
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Demo database resets every hour. Alot of features are disabled for obvious reaso
## Installation

### Requirements
- VPS with 4GB ram (an install script is provided for Ubuntu Server 20.04 / Debian 10)
- VPS with 2GB ram (an install script is provided for Ubuntu Server 20.04 / Debian 10)
- A domain you own with at least 3 subdomains
- Google Authenticator app (2 factor is NOT optional)

Expand Down
3 changes: 1 addition & 2 deletions api/tacticalrmm/agents/admin.py
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)
10 changes: 6 additions & 4 deletions api/tacticalrmm/agents/baker_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
import os
import json

from model_bakery.recipe import Recipe, seq
from model_bakery.recipe import Recipe, foreign_key
from itertools import cycle
from django.utils import timezone as djangotime
from django.conf import settings

from .models import Agent


def generate_agent_id(hostname):
rand = "".join(random.choice(string.ascii_letters) for _ in range(35))
return f"{rand}-{hostname}"


site = Recipe("clients.Site")


def get_wmi_data():
with open(
os.path.join(settings.BASE_DIR, "tacticalrmm/test_data/wmi_python_agent.json")
Expand All @@ -24,7 +25,8 @@ def get_wmi_data():


agent = Recipe(
Agent,
"agents.Agent",
site=foreign_key(site),
hostname="DESKTOP-TEST123",
version="1.3.0",
monitoring_type=cycle(["workstation", "server"]),
Expand Down
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 api/tacticalrmm/agents/migrations/0028_auto_20210206_1534.py
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 api/tacticalrmm/agents/migrations/0029_delete_agentoutage.py
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 api/tacticalrmm/agents/migrations/0030_agent_offline_time.py
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),
),
]
Loading

0 comments on commit 7e48015

Please sign in to comment.