initial commit
This commit is contained in:
0
rdgenerator/__init__.py
Normal file
0
rdgenerator/__init__.py
Normal file
BIN
rdgenerator/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
rdgenerator/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
BIN
rdgenerator/__pycache__/admin.cpython-312.pyc
Normal file
BIN
rdgenerator/__pycache__/admin.cpython-312.pyc
Normal file
Binary file not shown.
BIN
rdgenerator/__pycache__/apps.cpython-312.pyc
Normal file
BIN
rdgenerator/__pycache__/apps.cpython-312.pyc
Normal file
Binary file not shown.
BIN
rdgenerator/__pycache__/models.cpython-312.pyc
Normal file
BIN
rdgenerator/__pycache__/models.cpython-312.pyc
Normal file
Binary file not shown.
BIN
rdgenerator/__pycache__/views.cpython-312.pyc
Normal file
BIN
rdgenerator/__pycache__/views.cpython-312.pyc
Normal file
Binary file not shown.
3
rdgenerator/admin.py
Normal file
3
rdgenerator/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
rdgenerator/apps.py
Normal file
6
rdgenerator/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class RdgeneratorConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'rdgenerator'
|
||||
66
rdgenerator/forms.py
Normal file
66
rdgenerator/forms.py
Normal file
@@ -0,0 +1,66 @@
|
||||
from django import forms
|
||||
|
||||
class GenerateForm(forms.Form):
|
||||
#Platform
|
||||
platform = forms.ChoiceField(choices=[('windows','Windows'),('linux','Linux (currently unavailable)'),('android','Android (currently unavailable)')], initial='windows')
|
||||
|
||||
#General
|
||||
exename = forms.CharField(label="Name for EXE file", required=True)
|
||||
appname = forms.CharField(label="Custom App Name", required=False)
|
||||
direction = forms.ChoiceField(widget=forms.RadioSelect, choices=[
|
||||
('incoming', 'Incoming Only'),
|
||||
('outgoing', 'Outgoing Only'),
|
||||
('both', 'Bidirectional')
|
||||
], initial='both')
|
||||
installation = forms.ChoiceField(label="Disable Installation", choices=[
|
||||
('installationY', 'No, enable installation'),
|
||||
('installationN', 'Yes, DISABLE installation')
|
||||
], initial='installationY')
|
||||
settings = forms.ChoiceField(label="Disable Settings", choices=[
|
||||
('settingsY', 'No, enable settings'),
|
||||
('settingsN', 'Yes, DISABLE settings')
|
||||
], initial='settingsY')
|
||||
|
||||
#Custom Server
|
||||
serverIP = forms.CharField(label="Host", required=False)
|
||||
apiServer = forms.CharField(label="API Server", required=False)
|
||||
key = forms.CharField(label="Key", required=False)
|
||||
urlLink = forms.CharField(label="Custom URL for links", required=False)
|
||||
|
||||
#Visual
|
||||
iconfile = forms.FileField(label="Custom App Icon (in .png format)", required=False)
|
||||
logofile = forms.FileField(label="Custom App Logo (in .png format)", required=False)
|
||||
theme = forms.ChoiceField(choices=[
|
||||
('light', 'Light'),
|
||||
('dark', 'Dark'),
|
||||
('system', 'Follow System')
|
||||
], initial='system')
|
||||
themeDorO = forms.ChoiceField(choices=[('default', 'Default'),('override', 'Override')], initial='default')
|
||||
|
||||
#Security
|
||||
passApproveMode = forms.ChoiceField(choices=[('password','Accept sessions via password'),('click','Accept sessions via click'),('password-click','Accepts sessions via both')],initial='password-click')
|
||||
permanentPassword = forms.CharField(widget=forms.PasswordInput(), required=False)
|
||||
runasadmin = forms.ChoiceField(choices=[('false','No'),('true','Yes')], initial='false')
|
||||
denyLan = forms.BooleanField(initial=False, required=False)
|
||||
enableDirectIP = forms.BooleanField(initial=False, required=False)
|
||||
#ipWhitelist = forms.BooleanField(initial=False, required=False)
|
||||
autoClose = forms.BooleanField(initial=False, required=False)
|
||||
|
||||
#Permissions
|
||||
permissionsDorO = forms.ChoiceField(choices=[('default', 'Default'),('override', 'Override')], initial='default')
|
||||
permissionsType = forms.ChoiceField(choices=[('custom', 'Custom'),('full', 'Full Access'),('view','Screen share')], initial='custom')
|
||||
enableKeyboard = forms.BooleanField(initial=True, required=False)
|
||||
enableClipboard = forms.BooleanField(initial=True, required=False)
|
||||
enableFileTransfer = forms.BooleanField(initial=True, required=False)
|
||||
enableAudio = forms.BooleanField(initial=True, required=False)
|
||||
enableTCP = forms.BooleanField(initial=True, required=False)
|
||||
enableRemoteRestart = forms.BooleanField(initial=True, required=False)
|
||||
enableRecording = forms.BooleanField(initial=True, required=False)
|
||||
enableBlockingInput = forms.BooleanField(initial=True, required=False)
|
||||
enableRemoteModi = forms.BooleanField(initial=False, required=False)
|
||||
|
||||
#Other
|
||||
removeWallpaper = forms.BooleanField(initial=True, required=False)
|
||||
|
||||
defaultManual = forms.CharField(widget=forms.Textarea, required=False)
|
||||
overrideManual = forms.CharField(widget=forms.Textarea, required=False)
|
||||
0
rdgenerator/migrations/__init__.py
Normal file
0
rdgenerator/migrations/__init__.py
Normal file
BIN
rdgenerator/migrations/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
rdgenerator/migrations/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
6
rdgenerator/models.py
Normal file
6
rdgenerator/models.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.db import models
|
||||
|
||||
class GithubRun(models.Model):
|
||||
id = models.IntegerField(verbose_name="ID",primary_key=True)
|
||||
uuid = models.CharField(verbose_name="uuid", max_length=100)
|
||||
status = models.CharField(verbose_name="status", max_length=100)
|
||||
1
rdgenerator/templates/generated.html
Normal file
1
rdgenerator/templates/generated.html
Normal file
@@ -0,0 +1 @@
|
||||
<a href='/download?filename={{filename}}&uuid={{uuid}}'>{{filename}}</a>
|
||||
116
rdgenerator/templates/generator.html
Normal file
116
rdgenerator/templates/generator.html
Normal file
@@ -0,0 +1,116 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Server Configuration Form</title>
|
||||
<style>
|
||||
.container {
|
||||
display: grid;
|
||||
grid-template-columns: 50% 50%;
|
||||
grid-template-rows: repeat(2, auto); /* Adjust the number of rows as needed */
|
||||
padding: 20px; /* Adjust the padding value as needed */
|
||||
max-width: 1000px; /* Set a maximum width for the container */
|
||||
margin: 0 auto; /* Center the container horizontally */
|
||||
}
|
||||
.section {
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
margin-bottom: 20px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Add a subtle box shadow */
|
||||
border-radius: 5px; /* Add rounded corners for a more 3D effect */
|
||||
}
|
||||
label {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form action="/generator" method="post" enctype="multipart/form-data" class="container">
|
||||
<h2>Select Platform</h2>
|
||||
<label for="{{ form.platform.id_for_label }}"></label>
|
||||
{{ form.platform }}<br><br>
|
||||
<div class="section">
|
||||
<h2>General</h2>
|
||||
<label for="{{ form.exename.id_for_label }}">Name of the configuration:</label>
|
||||
{{ form.exename }}<br><br>
|
||||
<label for="{{ form.appname.id_for_label }}">Custom Application Name:</label>
|
||||
{{ form.appname }}<br><br>
|
||||
<label for="{{ form.direction.id_for_label }}">Connection Type:</label>
|
||||
{{ form.direction }}<br><br>
|
||||
<label for="{{ form.installation.id_for_label }}">Disable Installation:</label>
|
||||
{{ form.installation }}<br><br>
|
||||
<label for="{{ form.settings.id_for_label }}">Disable Settings:</label>
|
||||
{{ form.settings }}<br><br>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>Custom Server</h2>
|
||||
<label for="{{ form.serverIP.id_for_label }}">Host:</label>
|
||||
{{ form.serverIP }}<br><br>
|
||||
<label for="{{ form.key.id_for_label }}">Key:</label>
|
||||
{{ form.key }}<br><br>
|
||||
<label for="{{ form.apiServer.id_for_label }}">API:</label>
|
||||
{{ form.apiServer }}<br><br>
|
||||
<label for="{{ form.urlLink.id_for_label }}">Custom URL for links (replaces https://rustdesk.com):</label>
|
||||
{{ form.urlLink }}<br><br>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>Security</h2>
|
||||
<label for="{{ form.runasadmin.id_for_label }}">Always run as Administrator?</label>
|
||||
{{ form.runasadmin }}<br><br>
|
||||
<label for="{{ form.passApproveMode.id_for_label }}">Password Approve mode:</label>
|
||||
{{ form.passApproveMode }}<br><br>
|
||||
<label for="{{ form.permanentPassword.id_for_label }}">Set Permanent Password:</label>
|
||||
{{ form.permanentPassword }} *The password is used as default, but can be changed by the client<br><br>
|
||||
|
||||
{{ form.denyLan }}
|
||||
<label for="{{ form.denyLan.id_for_label }}">Deny LAN discovery</label><br><br>
|
||||
{{ form.enableDirectIP }}
|
||||
<label for="{{ form.enableDirectIP.id_for_label }}">Enable direct IP access</label><br><br>
|
||||
{{ form.autoClose }}
|
||||
<label for="{{ form.autoClose.id_for_label }}">Automatically close incoming sessions on user inactivity</label><br><br>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>Visual</h2>
|
||||
<label for="{{ form.iconfile.id_for_label }}">Custom App Icon (in .png format)</label>
|
||||
{{ form.iconfile }}<br><br>
|
||||
<label for="{{ form.logofile.id_for_label }}">Custom App Logo (in .png format)</label>
|
||||
{{ form.logofile }}<br><br>
|
||||
<label for="{{ form.theme.id_for_label }}">Theme:</label>
|
||||
{{ form.theme }} {{ form.themeDorO }} *Default sets the theme but allows the client to change it, Override sets the theme permanently.<br><br>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>Permissions</h2>
|
||||
The following Permissions can be set as default (the user can change the settins) or override (the settings cannot be changed).<br>
|
||||
{{ form.permissionsDorO }}
|
||||
<label for="{{ form.permissionsType.id_for_label }}">Permission type:</label>
|
||||
{{ form.permissionsType }}<br><br>
|
||||
{{ form.enableKeyboard }} <label for="{{ form.enableKeyboard.id_for_label }}">Enable keyboard/mouse</label>
|
||||
{{ form.enableClipboard }} <label for="{{ form.enableClipboard.id_for_label }}">Enable clipboard</label><br>
|
||||
{{ form.enableFileTransfer }} <label for="{{ form.enableFileTransfer.id_for_label }}">Enable file transfer</label>
|
||||
{{ form.enableAudio }} <label for="{{ form.enableAudio.id_for_label }}">Enable audio</label><br>
|
||||
{{ form.enableTCP }} <label for="{{ form.enableTCP.id_for_label }}">Enable TCP tunneling</label>
|
||||
{{ form.enableRemoteRestart }} <label for="{{ form.enableRemoteRestart.id_for_label }}">Enable remote restart</label><br>
|
||||
{{ form.enableRecording }} <label for="{{ form.enableRecording.id_for_label }}">Enable recording session</label>
|
||||
{{ form.enableBlockingInput }} <label for="{{ form.enableBlockingInput.id_for_label }}">Enable blocking user input</label><br>
|
||||
{{ form.enableRemoteModi }} <label for="{{ form.enableRemoteModi.id_for_label }}">Enable remote configuration modification</label><br><br>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>Other</h2>
|
||||
{{ form.removeWallpaper }} <label for="{{ form.removeWallpaper.id_for_label }}">Remove wallpaper during incoming sessions</label><br><br>
|
||||
<label for="{{ form.defaultManual.id_for_label }}">Default settings</label><br>
|
||||
{{ form.defaultManual }}<br><br>
|
||||
<label for="{{ form.overrideManual.id_for_label }}">Override settings</label><br>
|
||||
{{ form.overrideManual }}<br><br>
|
||||
</div>
|
||||
<div class="section">
|
||||
<button type="submit">Submit</button> Generate a custom client exe file
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
15
rdgenerator/templates/waiting.html
Normal file
15
rdgenerator/templates/waiting.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Generating Exe File</title>
|
||||
</head>
|
||||
<body>
|
||||
Please wait...This can take 10-15 minutes (or longer if there are other users).<br><br>
|
||||
Status: {{status}}
|
||||
<script>
|
||||
setTimeout(function() {
|
||||
window.location.replace('/check_for_file?filename={{filename}}&uuid={{uuid}}');
|
||||
}, 5000); // 5000 milliseconds = 5 seconds
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
3
rdgenerator/tests.py
Normal file
3
rdgenerator/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
253
rdgenerator/views.py
Normal file
253
rdgenerator/views.py
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user