-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
34 changed files
with
1,547 additions
and
656 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# These are supported funding model platforms | ||
|
||
github: wh1te909 | ||
patreon: # Replace with a single Patreon username | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: # Replace with a single Ko-fi username | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
18 changes: 18 additions & 0 deletions
18
api/tacticalrmm/accounts/migrations/0009_user_show_community_scripts.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 2020-12-10 17:00 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('accounts', '0008_user_dark_mode'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='user', | ||
name='show_community_scripts', | ||
field=models.BooleanField(default=True), | ||
), | ||
] |
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
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
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
28 changes: 28 additions & 0 deletions
28
api/tacticalrmm/scripts/migrations/0004_auto_20201207_1558.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,28 @@ | ||
# Generated by Django 3.1.3 on 2020-12-07 15:58 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('scripts', '0003_auto_20200922_1344'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='script', | ||
name='category', | ||
field=models.CharField(blank=True, max_length=100, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='script', | ||
name='favorite', | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AddField( | ||
model_name='script', | ||
name='script_base64', | ||
field=models.TextField(blank=True, null=True), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
api/tacticalrmm/scripts/migrations/0005_auto_20201207_1606.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.3 on 2020-12-07 16:06 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('scripts', '0004_auto_20201207_1558'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='script', | ||
old_name='script_base64', | ||
new_name='code_base64', | ||
), | ||
] |
38 changes: 38 additions & 0 deletions
38
api/tacticalrmm/scripts/migrations/0006_auto_20201210_2145.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,38 @@ | ||
# Generated by Django 3.1.4 on 2020-12-10 21:45 | ||
|
||
from django.db import migrations | ||
from django.conf import settings | ||
import os | ||
import base64 | ||
from pathlib import Path | ||
|
||
|
||
def move_scripts_to_db(apps, schema_editor): | ||
print("") | ||
Script = apps.get_model("scripts", "Script") | ||
for script in Script.objects.all(): | ||
if not script.script_type == "builtin": | ||
|
||
filepath = f"{settings.SCRIPTS_DIR}/userdefined/{script.filename}" | ||
|
||
# test if file exists | ||
if os.path.exists(filepath): | ||
print(f"Found script {script.name}. Importing code.") | ||
|
||
with open(filepath, "rb") as f: | ||
script_bytes = f.read().decode("utf-8").encode("ascii", "ignore") | ||
script.code_base64 = base64.b64encode(script_bytes).decode("ascii") | ||
script.save(update_fields=["code_base64"]) | ||
else: | ||
print( | ||
f"Script file {script.name} was not found on the disk. You will need to edit the script in the UI" | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("scripts", "0005_auto_20201207_1606"), | ||
] | ||
|
||
operations = [migrations.RunPython(move_scripts_to_db, migrations.RunPython.noop)] |
Oops, something went wrong.