Menu

[r5519]: / trunk / gui / services / models.py  Maximize  Restore  History

Download this file

867 lines (846 with data), 34.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
#+
# Copyright 2010 iXsystems
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# $FreeBSD$
#####################################################################
from django.db import models
from django import forms
from django.contrib.auth.models import User
import datetime
import time
from os import popen
from django.utils.text import capfirst
from django.forms.widgets import RadioFieldRenderer
from django.utils.safestring import mark_safe
from django.utils.encoding import force_unicode
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
from freenasUI.choices import *
class rsyncjob(models.Model):
rj_type = models.CharField(
max_length=120,
choices=RSYNCJob_Choices,
default="(NONE)",
verbose_name=""
)
rj_path = models.CharField(
max_length=120, verbose_name="Share Path",
help_text="Path to be shared."
)
rj_server = models.CharField(
max_length=120,
verbose_name="Remote RSYNC server",
help_text="IP or FQDN address of remote Rsync server."
)
rj_who = models.CharField(
max_length=120,
choices=whoChoices(),
default="root",
verbose_name="Who"
)
rj_description = models.CharField(
max_length=120,
verbose_name="Description",
blank=True
)
rj_ToggleMinutes = models.CharField(
max_length=120,
choices=TOGGLECRON_CHOICES,
default="Selected",
verbose_name="Minutes"
)
rj_Minutes1 = models.CharField(
max_length=120,
choices=MINUTES1_CHOICES,
default="(NONE)",
verbose_name=""
)
rj_Minutes2 = models.CharField(
max_length=120,
choices=MINUTES2_CHOICES,
default="(NONE)",
verbose_name=""
)
rj_Minutes3 = models.CharField(
max_length=120,
choices=MINUTES3_CHOICES,
default="(NONE)",
verbose_name=""
)
rj_Minutes4 = models.CharField(
max_length=120,
choices=MINUTES4_CHOICES,
default="(NONE)",
verbose_name=""
)
rj_ToggleHours = models.CharField(
max_length=120,
choices=TOGGLECRON_CHOICES,
default="Selected",
verbose_name="Hours"
)
rj_Hours1 = models.CharField(
max_length=120,
choices=HOURS1_CHOICES,
default="(NONE)",
verbose_name=""
)
rj_Hours2 = models.CharField(
max_length=120,
choices=HOURS2_CHOICES,
default="(NONE)",
verbose_name=""
)
rj_ToggleDays = models.CharField(
max_length=120,
choices=TOGGLECRON_CHOICES,
default="Selected",
verbose_name="Days"
)
rj_Days1 = models.CharField(
max_length=120,
choices=DAYS1_CHOICES,
default="(NONE)",
verbose_name=""
)
rj_Days2 = models.CharField(
max_length=120,
choices=DAYS2_CHOICES,
default="(NONE)",
verbose_name=""
)
rj_Days3 = models.CharField(
max_length=120,
choices=DAYS3_CHOICES,
default="(NONE)",
verbose_name=""
)
rj_ToggleMonths = models.CharField(
max_length=120,
choices=TOGGLECRON_CHOICES,
default="Selected",
verbose_name="Months"
)
rj_Months = models.CharField(
max_length=120,
choices=MONTHS_CHOICES,
default="(NONE)",
verbose_name=""
)
rj_ToggleWeekdays = models.CharField(
max_length=120,
choices=TOGGLECRON_CHOICES,
default="Selected",
verbose_name=""
)
rj_Weekdays = models.CharField(
max_length=120,
choices=WEEKDAYS_CHOICES,
default="(NONE)",
verbose_name="Weekdays"
)
rj_recursive = models.BooleanField(
verbose_name="Recursive")
rj_times = models.BooleanField(
verbose_name="Preserve Times")
rj_compress = models.BooleanField(
verbose_name="Compress Network Data")
rj_archive = models.BooleanField(
verbose_name="Use Archive Mode")
rj_delete = models.BooleanField(
verbose_name="Remove Deleted Files")
rj_quiet = models.BooleanField(
verbose_name="Less Logging")
rj_preserveperms = models.BooleanField(
verbose_name="Preserve Permissions")
rj_extattr = models.BooleanField(
verbose_name="Preserve Extended Attributes")
rj_options = models.CharField(
max_length=120,
verbose_name="Extra options",
help_text="Extra options to rsync (usually empty)."
)
class services(models.Model):
srv_service = models.CharField(
max_length=120,
verbose_name="Service",
help_text="Name of Service, should be auto-generated at build time"
)
srv_enable = models.BooleanField(
verbose_name="Enable Service")
class Meta:
verbose_name = "Services"
def __unicode__(self):
return self.srv_service
def save(self, *args, **kwargs):
super(services, self).save(*args, **kwargs)
class CIFS(models.Model):
cifs_srv_netbiosname = models.CharField(
max_length=120,
verbose_name="NetBIOS name"
)
cifs_srv_workgroup = models.CharField(
max_length=120,
verbose_name="Workgroup",
help_text="Workgroup the server will appear to be in when queried by clients (maximum 15 characters)."
)
cifs_srv_description = models.CharField(
max_length=120,
verbose_name="Description",
blank=True,
help_text="Server description. This can usually be left blank."
)
cifs_srv_doscharset = models.CharField(
max_length=120,
choices=DOSCHARSET_CHOICES,
default="CP437",
verbose_name="DOS charset"
)
cifs_srv_unixcharset = models.CharField(
max_length=120,
choices=UNIXCHARSET_CHOICES,
default="UTF-8",
verbose_name="UNIX charset"
)
cifs_srv_loglevel = models.CharField(
max_length=120,
choices=LOGLEVEL_CHOICES,
default="Minimum",
verbose_name="Log level"
)
cifs_srv_localmaster = models.BooleanField(
verbose_name="Local Master")
cifs_srv_timeserver = models.BooleanField(
verbose_name="Time Server for Domain")
cifs_srv_guest = models.CharField(
max_length=120,
choices=whoChoices(),
default="www",
verbose_name="Guest account",
help_text="Use this option to override the username ('ftp' by default) which will be used for access to services which are specified as guest. Whatever privileges this user has will be available to any client connecting to the guest service. This user must exist in the password file, but does not require a valid login."
)
cifs_srv_filemask = models.CharField(
max_length=120,
verbose_name="File mask",
blank=True,
help_text="Use this option to override the file creation mask (0666 by default)."
)
cifs_srv_dirmask = models.CharField(
max_length=120,
verbose_name="Directory mask",
blank=True,
help_text="Use this option to override the directory creation mask (0777 by default)."
)
cifs_srv_sendbuffer = models.CharField(
max_length=120,
verbose_name="Send Buffer Size",
blank=True,
help_text="Size of send buffer (64240 by default)."
)
cifs_srv_recvbuffer = models.CharField(
max_length=120,
verbose_name="Receive Buffer Size",
blank=True,
help_text="Size of receive buffer (64240 by default)."
)
cifs_srv_largerw = models.BooleanField(
verbose_name="Large RW support")
cifs_srv_sendfile = models.BooleanField(
verbose_name="Send files with sendfile(2)")
cifs_srv_easupport = models.BooleanField(
verbose_name="EA Support")
cifs_srv_dosattr = models.BooleanField(
verbose_name="Support DOS File Attributes")
cifs_srv_nullpw = models.BooleanField(
verbose_name="Allow Empty Password")
cifs_srv_smb_options = models.TextField(
max_length=120,
verbose_name="Auxiliary paramters",
blank=True,
help_text="These parameters are added to [Global] section of smb.conf"
)
class AFP(models.Model):
afp_srv_name = models.CharField(
max_length=120,
verbose_name="Server Name",
help_text="Name of the server. If this field is left empty the default server is specified."
)
afp_srv_guest = models.BooleanField(
verbose_name="Guess Access",
help_text="Allows guest access to all apple shares on this box."
)
afp_srv_local = models.BooleanField(
verbose_name="Local Access",
help_text="Allow users with local accounts to access apple shares on this box."
)
afp_srv_ddp = models.BooleanField(
verbose_name="Enable DDP",
help_text="Enables DDP support for low-level appletalk access."
)
class NFS(models.Model):
nfs_srv_servers = models.CharField(
max_length=120,
verbose_name="Number of servers",
help_text="Specifies how many servers to create. There should be enough to handle the maximum level of concurrency from its clients, typically four to six."
)
class Unison(models.Model):
uni_workingdir = models.CharField(
max_length=120,
verbose_name="Working directory",
blank=True
)
uni_createworkingdir = models.BooleanField(
verbose_name="Create Mirroed Directory")
class Meta:
verbose_name = "Unison"
class iSCSITarget(models.Model):
iscsi_basename = models.CharField(
max_length=120,
verbose_name="Base Name",
help_text="The base name (e.g. iqn.2007-09.jp.ne.peach.istgt) will append the target name that is not starting with 'iqn.' "
)
iscsi_discoveryauthmethod = models.CharField(
max_length=120,
choices=DISCOVERYAUTHMETHOD_CHOICES,
default='auto',
verbose_name="Discovery Auth Method"
)
iscsi_discoveryauthgroup = models.CharField(
max_length=120,
choices=DISCOVERYAUTHGROUP_CHOICES,
default='none',
verbose_name="Discovery Auth Group"
)
iscsi_io = models.CharField(
max_length=120,
verbose_name="I/O Timeout",
help_text="I/O timeout in seconds (30 by default)."
)
iscsi_nopinint = models.CharField(
max_length=120,
verbose_name="NOPIN Interval",
help_text="NOPIN sending interval in seconds (20 by default)."
)
iscsi_maxsesh = models.CharField(
max_length=120,
verbose_name="Max. sessions",
help_text="Maximum number of sessions holding at same time (32 by default)."
)
iscsi_maxconnect = models.CharField(
max_length=120,
verbose_name="Max. connections",
help_text="Maximum number of connections in each session (8 by default)."
)
iscsi_firstburst = models.CharField(
max_length=120,
verbose_name="First burst length",
help_text="iSCSI initial parameter (65536 by default)."
)
iscsi_maxburst = models.CharField(
max_length=120,
verbose_name="Max burst length",
help_text="iSCSI initial parameter (262144 by default)."
)
iscsi_maxrecdata = models.CharField(
max_length=120,
verbose_name="Max receive data segment length",
help_text="iSCSI initial parameter (262144 by default)."
)
iscsi_toggleluc = models.BooleanField(
verbose_name="Enable LUC")
class DynamicDNS(models.Model):
ddns_provider = models.CharField(
max_length=120,
choices=DYNDNSPROVIDER_CHOICES,
default='dyndns',
verbose_name="Provider"
)
ddns_domain = models.CharField(
max_length=120,
verbose_name="Domain name",
blank=True,
help_text="A host name alias. This option can appear multiple times, for each domain that has the same IP. Use a space to separate multiple alias names."
)
ddns_username = models.CharField(
max_length=120,
verbose_name="Username"
)
ddns_password = models.CharField(
max_length=120,
verbose_name="Password"
) # need to make this a 'password' field, but not available in django Models
ddns_updateperiod = models.CharField(
max_length=120,
verbose_name="Update period",
blank=True
)
ddns_fupdateperiod = models.CharField(
max_length=120,
verbose_name="Forced update period",
blank=True
)
ddns_wildcard = models.BooleanField(
verbose_name="Enable Wildcard Records")
ddns_options = models.TextField(
verbose_name="Auxiliary parameters",
blank=True,
help_text="These parameters will be added to global settings in inadyn.conf."
)
class SNMP(models.Model):
snmp_location = models.CharField(
max_length=120,
verbose_name="Location",
blank=True,
help_text="Location information, e.g. physical location of this system: 'Floor of building, Room xyzzy'."
)
snmp_contact = models.CharField(
max_length=120,
verbose_name="Contact",
blank=True,
help_text="Contact information, e.g. name or email of the person responsible for this system: 'admin@email.address'."
)
snmp_community = models.CharField(
max_length=120,
verbose_name="Community",
help_text="In most cases, 'public' is used here."
)
snmp_traps = models.BooleanField(
verbose_name="Send SNMP Traps")
snmp_options = models.TextField(
verbose_name="Auxiliary parameters",
blank=True,
help_text="These parameters will be added to global settings in inadyn.conf."
)
class UPS(models.Model):
ups_identifier = models.CharField(
max_length=120,
verbose_name="Identifier",
help_text="This name is used to uniquely identify your UPS on this system."
)
ups_driver = models.CharField(
max_length=120,
verbose_name="Driver",
blank=True,
help_text="The driver used to communicate with your UPS."
)
ups_port = models.CharField(
max_length=120,
verbose_name="Port",
blank=True,
help_text="The serial or USB port where your UPS is connected."
)
ups_options = models.TextField(
verbose_name="Auxiliary parameters",
blank=True,
help_text="These parameters will be added to global settings in inadyn.conf."
)
ups_description = models.CharField(
max_length=120,
verbose_name="Description",
blank=True
)
ups_shutdown = models.CharField(
max_length=120,
choices=UPS_CHOICES,
default='batt',
verbose_name="Shutdown mode"
)
ups_shutdowntimer = models.CharField(
max_length=120,
verbose_name="Shutdown timer",
help_text="The time in seconds until shutdown is initiated. If the UPS happens to come back before the time is up the shutdown is canceled."
)
ups_rmonitor = models.BooleanField(
verbose_name="Remote Monitor")
ups_emailnotify = models.BooleanField(
verbose_name="Send Email Status Updates")
ups_toemail = models.CharField(
max_length=120,
verbose_name="To email",
blank=True,
help_text="Destination email address. Separate email addresses by semi-colon."
)
ups_subject = models.CharField(
max_length=120,
verbose_name="To email",
help_text="The subject of the email. You can use the following parameters for substitution:<br /><ul><li>%d - Date</li><li>%h - Hostname</li></ul>"
)
class Webserver(models.Model):
web_protocol = models.CharField(
max_length=120,
choices=PROTOCOL_CHOICES,
default='OFF',
verbose_name="Protocol"
)
web_port = models.CharField(
max_length=120,
verbose_name="Port",
help_text="TCP port to bind the server to."
)
web_docroot = models.CharField(
max_length=120,
verbose_name="Document root",
help_text="Document root of the webserver. Home of the web page files."
)
web_auth = models.BooleanField(
verbose_name="Require Login")
web_dirlisting = models.BooleanField(
verbose_name="Allow Directory Browsing")
class BitTorrent(models.Model):
bt_peerport = models.CharField(
max_length=120,
verbose_name="Peer port",
help_text="Port to listen for incoming peer connections. Default port is 51413."
)
bt_downloaddir = models.CharField(
max_length=120,
verbose_name="Download directory",
blank=True,
help_text="Where to save downloaded data."
)
bt_configdir = models.CharField(
max_length=120,
verbose_name="Configuration directory",
help_text="Alternative configuration directory (usually empty)",
blank=True
)
bt_portfwd = models.BooleanField(
verbose_name="Enable Port Forwarding")
bt_pex = models.BooleanField(
verbose_name="Enable PEX")
bt_disthash = models.BooleanField(
verbose_name="Distribution Hashing Enable")
bt_encrypt = models.CharField(
max_length=120,
choices=BTENCRYPT_CHOICES,
default='preferred',
verbose_name="Encryption",
help_text="The peer connection encryption mode.",
blank=True
)
bt_uploadbw = models.CharField(
max_length=120,
verbose_name="Upload bandwidth",
help_text="The maximum upload bandwith in KB/s. An empty field means infinity.",
blank=True
)
bt_downloadbw = models.CharField(
max_length=120,
verbose_name="Download bandwidth",
help_text="The maximum download bandwith in KiB/s. An empty field means infinity.",
blank=True
)
bt_watchdir = models.CharField(
max_length=120,
verbose_name="Watch directory",
help_text="Directory to watch for new .torrent files.",
blank=True
)
bt_incompletedir = models.CharField(
max_length=120,
verbose_name="Incomplete directory",
help_text="Directory to incomplete files. An empty field means disable.",
blank=True
)
bt_umask = models.CharField(
max_length=120,
verbose_name="User mask",
help_text="Use this option to override the default permission modes for newly created files (0002 by default).",
blank=True
)
bt_options = models.CharField(
max_length=120,
verbose_name="Extra Options",
blank=True
)
bt_adminport = models.CharField(
max_length=120,
verbose_name="Web admin port",
help_text="Port to run bittorrent's web administration app on"
)
bt_adminauth = models.CharField(
max_length=120,
verbose_name="Authorize Web Interface",
help_text="When turned on, require authorization before allowing access to the web interface"
)
bt_adminuser = models.CharField(
max_length=120,
verbose_name="Web admin username",
help_text="Username to authenticate to web interface with"
)
bt_adminpass = models.CharField(
max_length=120,
verbose_name="Web admin password",
help_text="Password to authenticate to web interface with"
)
class FTP(models.Model):
ftp_clients = models.CharField(
max_length=120,
verbose_name="Clients",
help_text="Maximum number of simultaneous clients."
)
ftp_ipconnections = models.CharField(
max_length=120,
verbose_name="Connections",
help_text="Maximum number of connections per IP address (0 = unlimited)."
)
ftp_loginattempt = models.CharField(
max_length=120,
verbose_name="Login Attempts",
help_text="Maximum number of allowed password attempts before disconnection."
)
ftp_timeout = models.CharField(
max_length=120,
verbose_name="Timeout",
help_text="Maximum idle time in seconds."
)
ftp_rootlogin = models.BooleanField(
verbose_name="Allow Root Login")
ftp_onlyanonymous = models.BooleanField(
verbose_name="Only Allow Anonymous Login")
ftp_onlylocal = models.BooleanField(
verbose_name="Only Allow Local User Login")
ftp_banner = models.TextField(
max_length=120,
verbose_name="Banner",
blank=True,
help_text="Greeting banner displayed by FTP when a connection first comes in."
)
ftp_filemask = models.CharField(
max_length=120,
verbose_name="File mask",
help_text="Use this option to override the file creation mask (077 by default)."
)
ftp_dirmask = models.CharField(
max_length=120,
verbose_name="Directory mask",
help_text="Use this option to override the file creation mask (077 by default)."
)
ftp_fxp = models.BooleanField(
verbose_name="Enable FXP")
ftp_resume = models.BooleanField(
verbose_name="Allow Transer Resumption")
ftp_defaultroot = models.BooleanField(
verbose_name="Always Chroot") # Is this right?
ftp_ident = models.BooleanField(
verbose_name="Require IDENT Authentication")
ftp_reversedns = models.BooleanField(
verbose_name="Require Reverse DNS for IP")
ftp_masqaddress = models.CharField(
max_length=120,
verbose_name="Masquerade address",
blank=True,
help_text="Causes the server to display the network information for the specified IP address or DNS hostname to the client, on the assumption that that IP address or DNS host is acting as a NAT gateway or port forwarder for the server."
)
ftp_passiveportsmin = models.CharField(
max_length=120,
verbose_name="Passive ports",
help_text="The minimum port to allocate for PASV style data connections (0 = use any port)."
)
ftp_passiveportsmax = models.CharField(
max_length=120,
verbose_name="Passive ports",
help_text="The maximum port to allocate for PASV style data connections (0 = use any port). Passive ports restricts the range of ports from which the server will select when sent the PASV command from a client. The server will randomly choose a number from within the specified range until an open port is found. The port range selected must be in the non-privileged range (eg. greater than or equal to 1024). It is strongly recommended that the chosen range be large enough to handle many simultaneous passive connections (for example, 49152-65534, the IANA-registered ephemeral port range)."
)
ftp_localuserbw = models.CharField(
max_length=120,
verbose_name="User bandwidth",
blank=True,
help_text="Local user upload bandwith in KB/s. An empty field means infinity."
)
ftp_localuserdlbw = models.CharField(
max_length=120,
verbose_name="Download bandwidth",
blank=True,
help_text="Local user download bandwith in KB/s. An empty field means infinity."
)
ftp_anonuserbw = models.CharField(
max_length=120,
verbose_name="Download bandwidth",
blank=True,
help_text="Anonymous user upload bandwith in KB/s. An empty field means infinity."
)
ftp_anonuserdlbw = models.CharField(
max_length=120,
verbose_name="Download bandwidth",
blank=True,
help_text="Anonymous user download bandwith in KB/s. An empty field means infinity."
)
ftp_ssltls = models.BooleanField(
verbose_name="Enable SSL/TLS")
ftp_options = models.TextField(
max_length=120,
verbose_name="Banner",
blank=True,
help_text="These parameters are added to proftpd.conf."
)
class TFTP(models.Model):
tftp_directory = models.CharField(
max_length=120,
verbose_name="Directory",
help_text="The directory containing the files you want to publish. The remote host does not need to pass along the directory as part of the transfer."
)
tftp_newfiles = models.BooleanField(
verbose_name="Allow New Files")
tftp_port = models.CharField(
max_length=120,
verbose_name="Port",
help_text="The port to listen to. The default is to listen to the tftp port specified in /etc/services."
)
tftp_username = models.CharField(
max_length=120,
choices=whoChoices(),
default="nobody",
verbose_name="Username",
help_text="Specifies the username which the service will run as."
)
tftp_umask = models.CharField(
max_length=120,
verbose_name="umask",
help_text="Set the umask for newly created files to the specified value. The default is 022 (everyone can read, nobody can write)."
)
tftp_options = models.CharField(
max_length=120,
verbose_name="Extra options",
blank=True,
help_text="Extra command line options (usually empty)."
)
class SSH(models.Model):
ssh_tcpport = models.CharField(
max_length=120,
verbose_name="TCP Port",
help_text="Alternate TCP port. Default is 22"
)
ssh_rootlogin = models.BooleanField(
verbose_name="Login as Root with password",
help_text="Disabled: Root can only login via public key authentication; Enabled: Root login permitted with password"
)
ssh_passwordauth = models.BooleanField(
verbose_name="Allow Password Authentication")
ssh_tcpfwd = models.BooleanField(
verbose_name="Allow TCP Port Forwarding")
ssh_compression = models.BooleanField(
verbose_name="Compress Connections")
ssh_privatekey = models.TextField(
max_length=1024,
verbose_name="Host Private Key",
blank=True,
help_text="Paste a RSA PRIVATE KEY in PEM format here."
)
ssh_options = models.TextField(
max_length=120,
verbose_name="Extra options",
blank=True,
help_text="Extra options to /etc/ssh/sshd_config (usually empty). Note, incorrect entered options prevent SSH service to be started."
)
class ActiveDirectory(models.Model):
ad_dcname = models.CharField(
max_length=120,
verbose_name="Domain Controller Name",
help_text="AD or PDC name."
)
ad_domainname = models.CharField(
max_length=120,
verbose_name="Domain Name (DNS/Realm-Name)",
help_text="Domain Name, eg example.com"
)
ad_netbiosname = models.CharField(
max_length=120,
verbose_name="Domain Name (NetBIOS-Name)",
help_text="Domain Name in old format, eg EXAMPLE"
)
ad_adminname = models.CharField(
max_length=120,
verbose_name="Administrator Name",
help_text="Username of Domain Administrator Account"
)
ad_adminpw = models.CharField(
max_length=120,
verbose_name="Administrator Password",
help_text="Password of Domain Administrator account."
)
class LDAP(models.Model):
ldap_hostname = models.CharField(
max_length=120,
verbose_name="Hostname",
blank=True,
help_text="The name or IP address of the LDAP server"
)
ldap_basedn = models.CharField(
max_length=120,
verbose_name="Base DN",
blank=True,
help_text="The default base Distinguished Name (DN) to use for seraches, eg dc=test,dc=org"
)
ldap_anonbind = models.BooleanField(
verbose_name="Allow Anonymous Binding")
ldap_rootbasedn = models.CharField(
max_length=120,
verbose_name="Root bind DN",
blank=True,
help_text="The distinguished name with which to bind to the directory server, e.g. cn=admin,dc=test,dc=org"
)
ldap_rootbindpw = models.CharField(
max_length=120,
verbose_name="Root bind password",
blank=True,
help_text="The credentials with which to bind."
)
ldap_pwencryption = models.CharField(
max_length=120,
choices=PWEncryptionChoices,
verbose_name="Password Encryption",
help_text="The password change protocol to use."
)
ldap_usersuffix = models.CharField(
max_length=120,
verbose_name="User Suffix",
blank=True,
help_text="This parameter specifies the suffix that is used for users when these are added to the LDAP directory, e.g. ou=Users"
)
ldap_groupsuffix = models.CharField(
max_length=120,
verbose_name="Group Suffix",
blank=True,
help_text="This parameter specifies the suffix that is used for groups when these are added to the LDAP directory, e.g. ou=Groups"
)
ldap_passwordsuffix = models.CharField(
max_length=120,
verbose_name="Password Suffix",
blank=True,
help_text="This parameter specifies the suffix that is used for passwords when these are added to the LDAP directory, e.g. ou=Passwords"
)
ldap_machinesuffix = models.CharField(
max_length=120,
verbose_name="Machine Suffix",
blank=True,
help_text="This parameter specifies the suffix that is used for machines when these are added to the LDAP directory, e.g. ou=Computers"
)
ldap_options = models.TextField(
max_length=120,
verbose_name="Auxillary Parameters",
blank=True,
help_text="These parameters are added to ldap.conf."
)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.