From 1dae8da900f2b2ae0e900a9fa331267817c99371 Mon Sep 17 00:00:00 2001 From: Kilian Saffran Date: Wed, 20 Feb 2019 10:54:02 +0100 Subject: [PATCH] db backup for mysql --- .gitignore | 2 + {Module => bin/Module}/OpenVPN.pm | 0 {Module => bin/Module}/SSH.pm | 0 {Module => bin/Module}/Service.pm | 0 {Module => bin/Module}/System.pm | 0 {Module => bin/Module}/Test.pm | 0 backup_station.pl => bin/backup_station.pl | 0 bin/db_backup.sh | 34 + dksnas.pl => bin/dksnas.pl | 0 external_ip.sh => bin/external_ip.sh | 0 external_ip.xml => bin/external_ip.xml | 0 {gitweb => bin/gitweb}/GITWEB-BUILD-OPTIONS | 0 {gitweb => bin/gitweb}/INSTALL | 0 {gitweb => bin/gitweb}/Makefile | 0 {gitweb => bin/gitweb}/README | 0 {gitweb => bin/gitweb}/gitweb.cgi | 0 {gitweb => bin/gitweb}/static/git-favicon.png | Bin {gitweb => bin/gitweb}/static/git-logo.png | Bin {gitweb => bin/gitweb}/static/gitweb.css | 0 {gitweb => bin/gitweb}/static/gitweb.js | 0 {gitweb => bin/gitweb}/static/js/README | 0 .../gitweb}/static/js/adjust-timezone.js | 0 .../gitweb}/static/js/blame_incremental.js | 0 .../gitweb}/static/js/javascript-detection.js | 0 .../gitweb}/static/js/lib/common-lib.js | 0 .../gitweb}/static/js/lib/cookies.js | 0 .../gitweb}/static/js/lib/datetime.js | 0 bin/jsontobashvar.pl | 0 mountdrives.pl => bin/mountdrives.pl | 20 +- {station => bin/station}/configuration.html | 676 +++++++++--------- {station => bin/station}/css/station.css | 24 +- {station => bin/station}/index.html | 178 ++--- {station => bin/station}/js/browser.js | 168 ++--- {station => bin/station}/js/configure.js | 338 ++++----- {station => bin/station}/js/dksnas.js | 48 +- {station => bin/station}/test.html | 0 .../vendor/bootstrap/css/bootstrap-grid.css | 0 .../bootstrap/css/bootstrap-grid.css.map | 0 .../bootstrap/css/bootstrap-grid.min.css | 0 .../bootstrap/css/bootstrap-grid.min.css.map | 0 .../vendor/bootstrap/css/bootstrap-reboot.css | 0 .../bootstrap/css/bootstrap-reboot.css.map | 0 .../bootstrap/css/bootstrap-reboot.min.css | 0 .../css/bootstrap-reboot.min.css.map | 0 .../vendor/bootstrap/css/bootstrap.css | 0 .../vendor/bootstrap/css/bootstrap.css.map | 0 .../vendor/bootstrap/css/bootstrap.min.css | 0 .../bootstrap/css/bootstrap.min.css.map | 0 .../vendor/bootstrap/js/bootstrap.bundle.js | 0 .../bootstrap/js/bootstrap.bundle.js.map | 0 .../bootstrap/js/bootstrap.bundle.min.js | 0 .../bootstrap/js/bootstrap.bundle.min.js.map | 0 .../station}/vendor/bootstrap/js/bootstrap.js | 0 .../vendor/bootstrap/js/bootstrap.js.map | 0 .../vendor/bootstrap/js/bootstrap.min.js | 0 .../vendor/bootstrap/js/bootstrap.min.js.map | 0 .../vendor/fontawesome/css/fa-svg-with-js.css | 0 .../vendor/fontawesome/js/fa-brands.js | 0 .../vendor/fontawesome/js/fa-brands.min.js | 0 .../vendor/fontawesome/js/fa-regular.js | 0 .../vendor/fontawesome/js/fa-regular.min.js | 0 .../vendor/fontawesome/js/fa-solid.js | 0 .../vendor/fontawesome/js/fa-solid.min.js | 0 .../vendor/fontawesome/js/fa-v4-shims.js | 0 .../vendor/fontawesome/js/fa-v4-shims.min.js | 0 .../vendor/fontawesome/js/fontawesome-all.js | 0 .../fontawesome/js/fontawesome-all.min.js | 0 .../vendor/fontawesome/js/fontawesome.js | 0 .../vendor/fontawesome/js/fontawesome.min.js | 0 .../vendor/jquery/jquery-3.2.1.min.js | 0 certserver.pl | 107 --- checkip.cgi | 7 - conf/db_backup.json | 42 ++ conf/drives.json | 28 + conf/smb.conf | 58 ++ dev/install.sh | 7 + package-lock.json | 38 + package.json | 14 + 78 files changed, 954 insertions(+), 835 deletions(-) create mode 100644 .gitignore rename {Module => bin/Module}/OpenVPN.pm (100%) mode change 100755 => 100644 rename {Module => bin/Module}/SSH.pm (100%) mode change 100755 => 100644 rename {Module => bin/Module}/Service.pm (100%) mode change 100755 => 100644 rename {Module => bin/Module}/System.pm (100%) mode change 100755 => 100644 rename {Module => bin/Module}/Test.pm (100%) mode change 100755 => 100644 rename backup_station.pl => bin/backup_station.pl (100%) mode change 100755 => 100644 create mode 100644 bin/db_backup.sh rename dksnas.pl => bin/dksnas.pl (100%) mode change 100755 => 100644 rename external_ip.sh => bin/external_ip.sh (100%) mode change 100755 => 100644 rename external_ip.xml => bin/external_ip.xml (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/GITWEB-BUILD-OPTIONS (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/INSTALL (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/Makefile (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/README (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/gitweb.cgi (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/static/git-favicon.png (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/static/git-logo.png (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/static/gitweb.css (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/static/gitweb.js (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/static/js/README (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/static/js/adjust-timezone.js (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/static/js/blame_incremental.js (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/static/js/javascript-detection.js (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/static/js/lib/common-lib.js (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/static/js/lib/cookies.js (100%) mode change 100755 => 100644 rename {gitweb => bin/gitweb}/static/js/lib/datetime.js (100%) mode change 100755 => 100644 create mode 100644 bin/jsontobashvar.pl rename mountdrives.pl => bin/mountdrives.pl (76%) mode change 100755 => 100644 rename {station => bin/station}/configuration.html (96%) mode change 100755 => 100644 rename {station => bin/station}/css/station.css (89%) mode change 100755 => 100644 rename {station => bin/station}/index.html (97%) mode change 100755 => 100644 rename {station => bin/station}/js/browser.js (97%) mode change 100755 => 100644 rename {station => bin/station}/js/configure.js (97%) mode change 100755 => 100644 rename {station => bin/station}/js/dksnas.js (94%) mode change 100755 => 100644 rename {station => bin/station}/test.html (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap-grid.css (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap-grid.css.map (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap-grid.min.css (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap-grid.min.css.map (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap-reboot.css (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap-reboot.css.map (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap-reboot.min.css (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap-reboot.min.css.map (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap.css (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap.css.map (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap.min.css (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/css/bootstrap.min.css.map (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/js/bootstrap.bundle.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/js/bootstrap.bundle.js.map (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/js/bootstrap.bundle.min.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/js/bootstrap.bundle.min.js.map (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/js/bootstrap.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/js/bootstrap.js.map (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/js/bootstrap.min.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/bootstrap/js/bootstrap.min.js.map (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/css/fa-svg-with-js.css (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fa-brands.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fa-brands.min.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fa-regular.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fa-regular.min.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fa-solid.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fa-solid.min.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fa-v4-shims.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fa-v4-shims.min.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fontawesome-all.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fontawesome-all.min.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fontawesome.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/fontawesome/js/fontawesome.min.js (100%) mode change 100755 => 100644 rename {station => bin/station}/vendor/jquery/jquery-3.2.1.min.js (100%) mode change 100755 => 100644 delete mode 100755 certserver.pl delete mode 100755 checkip.cgi create mode 100644 conf/db_backup.json create mode 100644 conf/drives.json create mode 100644 conf/smb.conf create mode 100644 dev/install.sh create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2709666 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/* +.vscode/* diff --git a/Module/OpenVPN.pm b/bin/Module/OpenVPN.pm old mode 100755 new mode 100644 similarity index 100% rename from Module/OpenVPN.pm rename to bin/Module/OpenVPN.pm diff --git a/Module/SSH.pm b/bin/Module/SSH.pm old mode 100755 new mode 100644 similarity index 100% rename from Module/SSH.pm rename to bin/Module/SSH.pm diff --git a/Module/Service.pm b/bin/Module/Service.pm old mode 100755 new mode 100644 similarity index 100% rename from Module/Service.pm rename to bin/Module/Service.pm diff --git a/Module/System.pm b/bin/Module/System.pm old mode 100755 new mode 100644 similarity index 100% rename from Module/System.pm rename to bin/Module/System.pm diff --git a/Module/Test.pm b/bin/Module/Test.pm old mode 100755 new mode 100644 similarity index 100% rename from Module/Test.pm rename to bin/Module/Test.pm diff --git a/backup_station.pl b/bin/backup_station.pl old mode 100755 new mode 100644 similarity index 100% rename from backup_station.pl rename to bin/backup_station.pl diff --git a/bin/db_backup.sh b/bin/db_backup.sh new file mode 100644 index 0000000..e69b7c8 --- /dev/null +++ b/bin/db_backup.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#CFGFILE="/mnt/c/Users/ksaff/Workspace/dksnas/.dksnas/db_backup.json" +CFGFILE="/home/dks/backup/webserver/conf/db_backup.json" +CFGDIR=`dirname ${CFGFILE}`; +KEYS=`cat ${CFGFILE} | jq -c keys | tr -d '[]"' | sed 's/,/\n/g'` +IFS=' +' +SDB=( ${KEYS} ) +for cdb in "${SDB[@]}" +do + echo `date`": backup DB : $cdb" + DATA=`cat ${CFGFILE} | jq -c ".$cdb" | tr -d '{}"' | sed 's/,/\n/g' | sed 's/:/=/'` + echo ${DATA} > ${CFGDIR}'/cbackupvars.sh'; + source ${CFGDIR}'/cbackupvars.sh'; + rm ${CFGDIR}'/cbackupvars.sh' + CDATE=`date +%Y%m%d_%H%M%S` + OUTFILE=${bkppath}"/"$cdb"_"${CDATE}".sql" + #echo ${OUTFILE} + if [ ! -d ${bkppath}] + then + mkdir -p ${bkppath} + fi + if [ "${type}" = "mysql" ] + then + mysqldump -h ${dbhost} -u ${dbuser} -p${dbpwd} ${dbname} > ${OUTFILE} + gzip ${OUTFILE}; + fi + find "${bkppath}" -name "*.sql.gz" | sort -r | sed -e '1,${minfiles}d' | xargs rm +done +exit 0 + + + diff --git a/dksnas.pl b/bin/dksnas.pl old mode 100755 new mode 100644 similarity index 100% rename from dksnas.pl rename to bin/dksnas.pl diff --git a/external_ip.sh b/bin/external_ip.sh old mode 100755 new mode 100644 similarity index 100% rename from external_ip.sh rename to bin/external_ip.sh diff --git a/external_ip.xml b/bin/external_ip.xml old mode 100755 new mode 100644 similarity index 100% rename from external_ip.xml rename to bin/external_ip.xml diff --git a/gitweb/GITWEB-BUILD-OPTIONS b/bin/gitweb/GITWEB-BUILD-OPTIONS old mode 100755 new mode 100644 similarity index 100% rename from gitweb/GITWEB-BUILD-OPTIONS rename to bin/gitweb/GITWEB-BUILD-OPTIONS diff --git a/gitweb/INSTALL b/bin/gitweb/INSTALL old mode 100755 new mode 100644 similarity index 100% rename from gitweb/INSTALL rename to bin/gitweb/INSTALL diff --git a/gitweb/Makefile b/bin/gitweb/Makefile old mode 100755 new mode 100644 similarity index 100% rename from gitweb/Makefile rename to bin/gitweb/Makefile diff --git a/gitweb/README b/bin/gitweb/README old mode 100755 new mode 100644 similarity index 100% rename from gitweb/README rename to bin/gitweb/README diff --git a/gitweb/gitweb.cgi b/bin/gitweb/gitweb.cgi old mode 100755 new mode 100644 similarity index 100% rename from gitweb/gitweb.cgi rename to bin/gitweb/gitweb.cgi diff --git a/gitweb/static/git-favicon.png b/bin/gitweb/static/git-favicon.png old mode 100755 new mode 100644 similarity index 100% rename from gitweb/static/git-favicon.png rename to bin/gitweb/static/git-favicon.png diff --git a/gitweb/static/git-logo.png b/bin/gitweb/static/git-logo.png old mode 100755 new mode 100644 similarity index 100% rename from gitweb/static/git-logo.png rename to bin/gitweb/static/git-logo.png diff --git a/gitweb/static/gitweb.css b/bin/gitweb/static/gitweb.css old mode 100755 new mode 100644 similarity index 100% rename from gitweb/static/gitweb.css rename to bin/gitweb/static/gitweb.css diff --git a/gitweb/static/gitweb.js b/bin/gitweb/static/gitweb.js old mode 100755 new mode 100644 similarity index 100% rename from gitweb/static/gitweb.js rename to bin/gitweb/static/gitweb.js diff --git a/gitweb/static/js/README b/bin/gitweb/static/js/README old mode 100755 new mode 100644 similarity index 100% rename from gitweb/static/js/README rename to bin/gitweb/static/js/README diff --git a/gitweb/static/js/adjust-timezone.js b/bin/gitweb/static/js/adjust-timezone.js old mode 100755 new mode 100644 similarity index 100% rename from gitweb/static/js/adjust-timezone.js rename to bin/gitweb/static/js/adjust-timezone.js diff --git a/gitweb/static/js/blame_incremental.js b/bin/gitweb/static/js/blame_incremental.js old mode 100755 new mode 100644 similarity index 100% rename from gitweb/static/js/blame_incremental.js rename to bin/gitweb/static/js/blame_incremental.js diff --git a/gitweb/static/js/javascript-detection.js b/bin/gitweb/static/js/javascript-detection.js old mode 100755 new mode 100644 similarity index 100% rename from gitweb/static/js/javascript-detection.js rename to bin/gitweb/static/js/javascript-detection.js diff --git a/gitweb/static/js/lib/common-lib.js b/bin/gitweb/static/js/lib/common-lib.js old mode 100755 new mode 100644 similarity index 100% rename from gitweb/static/js/lib/common-lib.js rename to bin/gitweb/static/js/lib/common-lib.js diff --git a/gitweb/static/js/lib/cookies.js b/bin/gitweb/static/js/lib/cookies.js old mode 100755 new mode 100644 similarity index 100% rename from gitweb/static/js/lib/cookies.js rename to bin/gitweb/static/js/lib/cookies.js diff --git a/gitweb/static/js/lib/datetime.js b/bin/gitweb/static/js/lib/datetime.js old mode 100755 new mode 100644 similarity index 100% rename from gitweb/static/js/lib/datetime.js rename to bin/gitweb/static/js/lib/datetime.js diff --git a/bin/jsontobashvar.pl b/bin/jsontobashvar.pl new file mode 100644 index 0000000..e69de29 diff --git a/mountdrives.pl b/bin/mountdrives.pl old mode 100755 new mode 100644 similarity index 76% rename from mountdrives.pl rename to bin/mountdrives.pl index 394832b..27a72b1 --- a/mountdrives.pl +++ b/bin/mountdrives.pl @@ -1,13 +1,23 @@ -#!/usr/bin/perl +#!C:\Strawberry\perl\bin\perl.exe use strict; use File::Basename; use Data::Dumper; +use JSON::PP; -my $config->{drives}->{'222239212D6A'} = {path => '/home/dks/private',uid=>1001,gid=>1001,type=>'rw'}; -$config->{drives}->{'94M3TGRGT'} = {path => '/home/dks/mirror',uid=>1001,gid=>1001,type=>'rw'}; -$config->{drives}->{'94M1TP66T'} = {path => '/home/dks/music',uid=>1001,gid=>1001,type=>'rw'}; -$config->{drives}->{'22223921335B'} = {path => '/home/dks/backup',uid=>1001,gid=>1001,type=>'rw'}; +$cfgfile = dirname(dirname($0)).'/.dksnas/drives.conf'; +my $strcfg = ""; +open(CFG,$cfgfile); +while (my $l = ){ + $strcfg .= $l; +} +close(CFG); +$config = json_decode($strcfg); +# my $config->{drives}->{'222239212D6A'} = {path => '/home/dks/private',uid=>1001,gid=>1001,type=>'rw'}; +# $config->{drives}->{'94M3TGRGT'} = {path => '/home/dks/mirror',uid=>1001,gid=>1001,type=>'rw'}; +# $config->{drives}->{'94M1TP66T'} = {path => '/home/dks/music',uid=>1001,gid=>1001,type=>'rw'}; +# $config->{drives}->{'22223921335B'} = {path => '/home/dks/backup',uid=>1001,gid=>1001,type=>'rw'}; +# print encode_json($config); my $connecteddrives = &getconnecteddrives(); my $mounts = &getcurrentmountpoints(); #print Dumper($mounts); diff --git a/station/configuration.html b/bin/station/configuration.html old mode 100755 new mode 100644 similarity index 96% rename from station/configuration.html rename to bin/station/configuration.html index a0796ec..d870731 --- a/station/configuration.html +++ b/bin/station/configuration.html @@ -1,338 +1,338 @@ - - - - - - - - - -DKS - NAS - Configuration - - - - - - - -
- -
- -
-
- -
-
-
-

DKS NAS

-
- - - -
-
-
-
-
-

Protect Web-Interface

-
-
-
-
- -
-
-
-
- -
- -
-
- -
-
- Save -
- -
-
- -
-
-
- -
-
-

Cable LAN

-
-
-
- -
-
- -
- -
- -
-
- -
-
- -
-
- -
-
- Save -
- -
- -
-
-
- -
-
-

Wireless LAN

-
-
- -
- -
-
- -
-
- Save -
- -
- -
-
-
- -
-
-

Current OpenVPN Configuration

-
-
- - -
- -
-
-
- -
-
- -
-
- - - - -
- Save -
- -
- -
-
-
- -
-
-

External Drives

-
- - - - - - - - - - - - -
NAMESizeFile-SystemMount-FolderAction
- -
-
-
- -
-
-

Share Users

-
-
- - - -
- - - - - - - - - -
NamePasswordAction
-
-
-
- -
-
-

Shared Folders

-
-
-

Global

-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- -
-
-

New Share

-
- -
- -
-
-
- -
- -
-
-
- -
- - -
- -
-
-

Current Shares

- - - - - - - - - - -
NameDescriptionAuthorized UsersAction
- -
-
-
-
-
-
- - - - - - - - + + + + + + + + + +DKS - NAS - Configuration + + + + + + + +
+ +
+ +
+
+ +
+
+
+

DKS NAS

+
+ + + +
+
+
+
+
+

Protect Web-Interface

+
+
+
+
+ +
+
+
+
+ +
+ +
+
+ +
+
+ Save +
+ +
+
+ +
+
+
+ +
+
+

Cable LAN

+
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ Save +
+ +
+ +
+
+
+ +
+
+

Wireless LAN

+
+
+ +
+ +
+
+ +
+
+ Save +
+ +
+ +
+
+
+ +
+
+

Current OpenVPN Configuration

+
+
+ + +
+ +
+
+
+ +
+
+ +
+
+ + + + +
+ Save +
+ +
+ +
+
+
+ +
+
+

External Drives

+
+ + + + + + + + + + + + +
NAMESizeFile-SystemMount-FolderAction
+ +
+
+
+ +
+
+

Share Users

+
+
+ + + +
+ + + + + + + + + +
NamePasswordAction
+
+
+
+ +
+
+

Shared Folders

+
+
+

Global

+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+

New Share

+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+ +
+
+

Current Shares

+ + + + + + + + + + +
NameDescriptionAuthorized UsersAction
+ +
+
+
+
+
+
+ + + + + + + + diff --git a/station/css/station.css b/bin/station/css/station.css old mode 100755 new mode 100644 similarity index 89% rename from station/css/station.css rename to bin/station/css/station.css index fcf3343..6fc3734 --- a/station/css/station.css +++ b/bin/station/css/station.css @@ -1,12 +1,12 @@ -.card { - margin: 5px; - padding: 0px; -} - -.card-body { - margin: 0px; -} - -.card-header { - margin: 0px; -} +.card { + margin: 5px; + padding: 0px; +} + +.card-body { + margin: 0px; +} + +.card-header { + margin: 0px; +} diff --git a/station/index.html b/bin/station/index.html old mode 100755 new mode 100644 similarity index 97% rename from station/index.html rename to bin/station/index.html index c272600..5e1189d --- a/station/index.html +++ b/bin/station/index.html @@ -1,89 +1,89 @@ - - - - - - - - - - DKS NAS - - - - - - - - - -
- -
- -
-
-
- -
- - - -
-
- - - -
NameAction
- - -
- -
-
-
- - - - - - - - - - + + + + + + + + + + DKS NAS + + + + + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+
+ + + +
NameAction
+ + +
+ +
+
+
+ + + + + + + + + + diff --git a/station/js/browser.js b/bin/station/js/browser.js old mode 100755 new mode 100644 similarity index 97% rename from station/js/browser.js rename to bin/station/js/browser.js index 574518b..14a8b76 --- a/station/js/browser.js +++ b/bin/station/js/browser.js @@ -1,85 +1,85 @@ - function initdata(){ - browser.getdirectory(null); - } - -var mimetypeicons = { - "unknown":"file", - "text/csv":"file-alt", - "text/plain":"file-alt", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"file-excel", - "application/vnd.openxmlformats-officedocument.wordprocessingml.document":"file-word", - "application/pdf":"file-pdf", - "image/svg+xml":"image", - "image/png":"image", - "application/javascript":"file-code", - "application/zip":"file-archive", - "image/jpeg":"image", - "image/tif":"image", - "image/jpeg":"image", - "audio/mpeg":"file-audio", - "audio/ogg":"file-audio" -} - -$("#btn-home").on('click',function(){ - browser.getdirectory(dksnas.info.home); -}); - -$("#btn-folderup").on('click',function(){ - browser.getdirectory($("#btn-folderup").attr('data-folder')); -}); - -$("#btn-share").on('click',function(){ - alert($("#btn-share").attr('data-folder')); -}); - -$("#btn-currentfolder").on('click',function(){ - browser.getdirectory($("#btn-currentfolder").attr('data-folder')); -}); - - var browser = { - getdirectory: function(dir){ - if (!dir){ - dir = dksnas.info.home; - } - dir = dir.replace(/\\/g,'/'); - if (dir == dksnas.info.home){ - $('#btn-currentfolder').hide(); - $('#btn-share').hide(); - $('#btn-folderup').hide(); - } else { - $('#btn-currentfolder').show(); - $('#btn-currentfolder').attr("data-folder",dir); - $('#btn-share').show(); - $('#btn-share').attr("data-folder",dir); - $('#btn-folderup').show(); - var parent = dir.substring(0,dir.lastIndexOf('/')); - $('#btn-folderup').attr("data-folder",parent); - } - var displaycurdir = dir.substring(dksnas.info.home.length); - console.log(displaycurdir); - $('#current_folder').html(displaycurdir); - $('#browsetable > tbody').html(""); - console.log(dir); - console.log(window.location.origin + "/system/directory/list?path=" + encodeURIComponent(dir)); - $.ajax({ - encoding:"UTF-8", - url: window.location.origin + "/system/directory/list?path=" + encodeURIComponent(dir) , - success: function (data){ - console.log(data.result.file); - for (var i=0;i tbody:last-child').append(''+data.result.directory[i]+ ''); - } - for (var i=0;i tbody:last-child').append(''+fd.name+ ''); - } - }, - error: function(data){ - alert("Error:" + JSON.stringify(data)); - console.log("Error:" + JSON.stringify(data)); - }, - async:true - }); - } + function initdata(){ + browser.getdirectory(null); + } + +var mimetypeicons = { + "unknown":"file", + "text/csv":"file-alt", + "text/plain":"file-alt", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"file-excel", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document":"file-word", + "application/pdf":"file-pdf", + "image/svg+xml":"image", + "image/png":"image", + "application/javascript":"file-code", + "application/zip":"file-archive", + "image/jpeg":"image", + "image/tif":"image", + "image/jpeg":"image", + "audio/mpeg":"file-audio", + "audio/ogg":"file-audio" +} + +$("#btn-home").on('click',function(){ + browser.getdirectory(dksnas.info.home); +}); + +$("#btn-folderup").on('click',function(){ + browser.getdirectory($("#btn-folderup").attr('data-folder')); +}); + +$("#btn-share").on('click',function(){ + alert($("#btn-share").attr('data-folder')); +}); + +$("#btn-currentfolder").on('click',function(){ + browser.getdirectory($("#btn-currentfolder").attr('data-folder')); +}); + + var browser = { + getdirectory: function(dir){ + if (!dir){ + dir = dksnas.info.home; + } + dir = dir.replace(/\\/g,'/'); + if (dir == dksnas.info.home){ + $('#btn-currentfolder').hide(); + $('#btn-share').hide(); + $('#btn-folderup').hide(); + } else { + $('#btn-currentfolder').show(); + $('#btn-currentfolder').attr("data-folder",dir); + $('#btn-share').show(); + $('#btn-share').attr("data-folder",dir); + $('#btn-folderup').show(); + var parent = dir.substring(0,dir.lastIndexOf('/')); + $('#btn-folderup').attr("data-folder",parent); + } + var displaycurdir = dir.substring(dksnas.info.home.length); + console.log(displaycurdir); + $('#current_folder').html(displaycurdir); + $('#browsetable > tbody').html(""); + console.log(dir); + console.log(window.location.origin + "/system/directory/list?path=" + encodeURIComponent(dir)); + $.ajax({ + encoding:"UTF-8", + url: window.location.origin + "/system/directory/list?path=" + encodeURIComponent(dir) , + success: function (data){ + console.log(data.result.file); + for (var i=0;i tbody:last-child').append(''+data.result.directory[i]+ ''); + } + for (var i=0;i tbody:last-child').append(''+fd.name+ ''); + } + }, + error: function(data){ + alert("Error:" + JSON.stringify(data)); + console.log("Error:" + JSON.stringify(data)); + }, + async:true + }); + } } \ No newline at end of file diff --git a/station/js/configure.js b/bin/station/js/configure.js old mode 100755 new mode 100644 similarity index 97% rename from station/js/configure.js rename to bin/station/js/configure.js index 73f0f3e..57d33e8 --- a/station/js/configure.js +++ b/bin/station/js/configure.js @@ -1,170 +1,170 @@ - function initdata(){ - $.ajax({ - encoding:"UTF-8", - url:"/app/config", - success: function (data){ - console.log("DATA"); - config.fillconfig(data.result); - }, - error: function(data){ - console.log("Error:" + JSON.stringify(data)); - }, - async:false - }); - } - - var config = { - setlogin: function(){ - var bok = 0; - var errmsg = "Please fill all fields!"; - if (($("#login").val() != "") && ($("#apppassword2").val() != "") && ($("#apppassword1").val() != "")){ - if ($("#apppassword2").val() != $("#apppassword1").val()){ - errmsg = "Passwords does not match eachother!"; - }else if ($("#apppassword1").val().length < 8 ){ - errmsg = "Passwords length must have at least 8 characters!"; - }else { - bok=1; - } - } - if (bok == 0){ - alert(errmsg); - }else { - $.ajax({ - method: 'POST', - encoding:"UTF-8", - url:"/app/save/login", - data: "login=" + encodeURIComponent($("#login").val()) + "&pwd=" + encodeURIComponent($("#apppassword1").val()), - success: function (data){ - console.log("Error:" + JSON.stringify(data)); - }, - error: function(data){ - console.log("Error:" + JSON.stringify(data)); - }, - async:false - }); - } - }, - fillconfig: function(data){ - console.log(data); - if (data){ - if (data.weblogin){ - if (data.weblogin.user){ - $("#login").val(data.weblogin.user); - } - } - if (data.cablenet){ - if (data.cablenet.type){ - $("#cablenet_type_"+ data.cablenet.type).prop("checked",true); - - } - - } - if (data.extdrives){ - $("#tbl_extdrives > tbody").html(""); - for (var drv in data.extdrives){ - var trow = ''; - trow += ''+ data.extdrives[drv].label+'
('+ data.extdrives[drv].serial +')'; - trow += ''+ data.extdrives[drv].size +''; - trow += ''+ data.extdrives[drv].fs+ ''; - if (data.extdrives[drv].mounted){ - trow += ''; - trow += ''; - } - else { - - trow += ''; - trow += ''; - } - trow += ''; - $("#tbl_extdrives > tbody").append(trow); - } - } - if (data.shareusers){ - $('#tbl_shareusers > tbody').html(""); - for (var u in data.shareusers){ - var trow = ''; - trow += ''+u+''; - trow += ''; - trow += ' '; - trow += ''; - $("#tbl_shareusers> tbody").append(trow); - } - } - if (data.shares){ - if (data.shares.global){ - $("#shareworkgroup").val(data.shares.global.workgroup); - $("#shareserverdesc").val(data.shares.global["server string"]); - $("#sharenetbios").val(data.shares.global["netbios name"]); - } - $('#tbl_shares > tbody').html(""); - if (data.shares.folders){ - for (var f in data.shares.folders){ - var trow = ''; - trow += ''+f+''; - trow += ''+data.shares.folders[f].comment+''; - - trow += '
'; - trow += ''; - trow += '
'; - trow += ' '; - trow += ''; - $("#tbl_shares > tbody").append(trow); - } - } - } - } - } - }; - - - - $('input[name="cable_type"]:radio').on('change',function() { - console.log("TEST RADIO CHECK!"); - if (this.value == 'dhcp'){ - $("#cablenet_ip").prop("disabled",true); - $("#cablenet_subnet").prop("disabled",true); - $("#cablenet_gateway").prop("disabled",true); - $("#cablenet_dns").prop("disabled",true); - } else { - $("#cablenet_ip").prop("disabled",false); - $("#cablenet_subnet").prop("disabled",false); - $("#cablenet_gateway").prop("disabled",false); - $("#cablenet_dns").prop("disabled",false); - } - }); - - $('#btn_shudown').on('click',function(){ - if (confirm("shutdown DKS-NAS now?")){ - $.ajax({ - encoding:"UTF-8", - url:"/app/shutdown", - success: function (data){ - console.log("Success:" + data); - }, - error: function(data){ - console.log("Error:" + data); - }, - async:false - }); - } - }); - - $('#btn_restart').on('click',function(){ - if (confirm("restart DKS-NAS now?")){ - $.ajax({ - encoding:"UTF-8", - url:"/app/restart", - success: function (data){ - console.log("Success:" + data); - }, - error: function(data){ - console.log("Error:" + data); - }, - async:false - }); - } + function initdata(){ + $.ajax({ + encoding:"UTF-8", + url:"/app/config", + success: function (data){ + console.log("DATA"); + config.fillconfig(data.result); + }, + error: function(data){ + console.log("Error:" + JSON.stringify(data)); + }, + async:false + }); + } + + var config = { + setlogin: function(){ + var bok = 0; + var errmsg = "Please fill all fields!"; + if (($("#login").val() != "") && ($("#apppassword2").val() != "") && ($("#apppassword1").val() != "")){ + if ($("#apppassword2").val() != $("#apppassword1").val()){ + errmsg = "Passwords does not match eachother!"; + }else if ($("#apppassword1").val().length < 8 ){ + errmsg = "Passwords length must have at least 8 characters!"; + }else { + bok=1; + } + } + if (bok == 0){ + alert(errmsg); + }else { + $.ajax({ + method: 'POST', + encoding:"UTF-8", + url:"/app/save/login", + data: "login=" + encodeURIComponent($("#login").val()) + "&pwd=" + encodeURIComponent($("#apppassword1").val()), + success: function (data){ + console.log("Error:" + JSON.stringify(data)); + }, + error: function(data){ + console.log("Error:" + JSON.stringify(data)); + }, + async:false + }); + } + }, + fillconfig: function(data){ + console.log(data); + if (data){ + if (data.weblogin){ + if (data.weblogin.user){ + $("#login").val(data.weblogin.user); + } + } + if (data.cablenet){ + if (data.cablenet.type){ + $("#cablenet_type_"+ data.cablenet.type).prop("checked",true); + + } + + } + if (data.extdrives){ + $("#tbl_extdrives > tbody").html(""); + for (var drv in data.extdrives){ + var trow = ''; + trow += ''+ data.extdrives[drv].label+'
('+ data.extdrives[drv].serial +')'; + trow += ''+ data.extdrives[drv].size +''; + trow += ''+ data.extdrives[drv].fs+ ''; + if (data.extdrives[drv].mounted){ + trow += ''; + trow += ''; + } + else { + + trow += ''; + trow += ''; + } + trow += ''; + $("#tbl_extdrives > tbody").append(trow); + } + } + if (data.shareusers){ + $('#tbl_shareusers > tbody').html(""); + for (var u in data.shareusers){ + var trow = ''; + trow += ''+u+''; + trow += ''; + trow += ' '; + trow += ''; + $("#tbl_shareusers> tbody").append(trow); + } + } + if (data.shares){ + if (data.shares.global){ + $("#shareworkgroup").val(data.shares.global.workgroup); + $("#shareserverdesc").val(data.shares.global["server string"]); + $("#sharenetbios").val(data.shares.global["netbios name"]); + } + $('#tbl_shares > tbody').html(""); + if (data.shares.folders){ + for (var f in data.shares.folders){ + var trow = ''; + trow += ''+f+''; + trow += ''+data.shares.folders[f].comment+''; + + trow += '
'; + trow += ''; + trow += '
'; + trow += ' '; + trow += ''; + $("#tbl_shares > tbody").append(trow); + } + } + } + } + } + }; + + + + $('input[name="cable_type"]:radio').on('change',function() { + console.log("TEST RADIO CHECK!"); + if (this.value == 'dhcp'){ + $("#cablenet_ip").prop("disabled",true); + $("#cablenet_subnet").prop("disabled",true); + $("#cablenet_gateway").prop("disabled",true); + $("#cablenet_dns").prop("disabled",true); + } else { + $("#cablenet_ip").prop("disabled",false); + $("#cablenet_subnet").prop("disabled",false); + $("#cablenet_gateway").prop("disabled",false); + $("#cablenet_dns").prop("disabled",false); + } + }); + + $('#btn_shudown').on('click',function(){ + if (confirm("shutdown DKS-NAS now?")){ + $.ajax({ + encoding:"UTF-8", + url:"/app/shutdown", + success: function (data){ + console.log("Success:" + data); + }, + error: function(data){ + console.log("Error:" + data); + }, + async:false + }); + } + }); + + $('#btn_restart').on('click',function(){ + if (confirm("restart DKS-NAS now?")){ + $.ajax({ + encoding:"UTF-8", + url:"/app/restart", + success: function (data){ + console.log("Success:" + data); + }, + error: function(data){ + console.log("Error:" + data); + }, + async:false + }); + } }); \ No newline at end of file diff --git a/station/js/dksnas.js b/bin/station/js/dksnas.js old mode 100755 new mode 100644 similarity index 94% rename from station/js/dksnas.js rename to bin/station/js/dksnas.js index 1a17613..24e1c76 --- a/station/js/dksnas.js +++ b/bin/station/js/dksnas.js @@ -1,25 +1,25 @@ -var dksnas = { - info: null, - getinfo: function(){ - $.ajax({ - encoding:"UTF-8", - url:"/app/info" , - success: function (data){ - //dump(data + "\n"); - dksnas.info=data.result; - dksnas.info.home = dksnas.info.home.replace(/\\/g,'/'); - }, - error: function(data){ - alert("Error:" + JSON.stringify(data)); - console.log("Error:" + JSON.stringify(data)); - }, - async:false - }); - - } -}; - -$(document).ready(function() { - dksnas.getinfo(); - initdata(); +var dksnas = { + info: null, + getinfo: function(){ + $.ajax({ + encoding:"UTF-8", + url:"/app/info" , + success: function (data){ + //dump(data + "\n"); + dksnas.info=data.result; + dksnas.info.home = dksnas.info.home.replace(/\\/g,'/'); + }, + error: function(data){ + alert("Error:" + JSON.stringify(data)); + console.log("Error:" + JSON.stringify(data)); + }, + async:false + }); + + } +}; + +$(document).ready(function() { + dksnas.getinfo(); + initdata(); }); \ No newline at end of file diff --git a/station/test.html b/bin/station/test.html old mode 100755 new mode 100644 similarity index 100% rename from station/test.html rename to bin/station/test.html diff --git a/station/vendor/bootstrap/css/bootstrap-grid.css b/bin/station/vendor/bootstrap/css/bootstrap-grid.css old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap-grid.css rename to bin/station/vendor/bootstrap/css/bootstrap-grid.css diff --git a/station/vendor/bootstrap/css/bootstrap-grid.css.map b/bin/station/vendor/bootstrap/css/bootstrap-grid.css.map old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap-grid.css.map rename to bin/station/vendor/bootstrap/css/bootstrap-grid.css.map diff --git a/station/vendor/bootstrap/css/bootstrap-grid.min.css b/bin/station/vendor/bootstrap/css/bootstrap-grid.min.css old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap-grid.min.css rename to bin/station/vendor/bootstrap/css/bootstrap-grid.min.css diff --git a/station/vendor/bootstrap/css/bootstrap-grid.min.css.map b/bin/station/vendor/bootstrap/css/bootstrap-grid.min.css.map old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap-grid.min.css.map rename to bin/station/vendor/bootstrap/css/bootstrap-grid.min.css.map diff --git a/station/vendor/bootstrap/css/bootstrap-reboot.css b/bin/station/vendor/bootstrap/css/bootstrap-reboot.css old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap-reboot.css rename to bin/station/vendor/bootstrap/css/bootstrap-reboot.css diff --git a/station/vendor/bootstrap/css/bootstrap-reboot.css.map b/bin/station/vendor/bootstrap/css/bootstrap-reboot.css.map old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap-reboot.css.map rename to bin/station/vendor/bootstrap/css/bootstrap-reboot.css.map diff --git a/station/vendor/bootstrap/css/bootstrap-reboot.min.css b/bin/station/vendor/bootstrap/css/bootstrap-reboot.min.css old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap-reboot.min.css rename to bin/station/vendor/bootstrap/css/bootstrap-reboot.min.css diff --git a/station/vendor/bootstrap/css/bootstrap-reboot.min.css.map b/bin/station/vendor/bootstrap/css/bootstrap-reboot.min.css.map old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap-reboot.min.css.map rename to bin/station/vendor/bootstrap/css/bootstrap-reboot.min.css.map diff --git a/station/vendor/bootstrap/css/bootstrap.css b/bin/station/vendor/bootstrap/css/bootstrap.css old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap.css rename to bin/station/vendor/bootstrap/css/bootstrap.css diff --git a/station/vendor/bootstrap/css/bootstrap.css.map b/bin/station/vendor/bootstrap/css/bootstrap.css.map old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap.css.map rename to bin/station/vendor/bootstrap/css/bootstrap.css.map diff --git a/station/vendor/bootstrap/css/bootstrap.min.css b/bin/station/vendor/bootstrap/css/bootstrap.min.css old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap.min.css rename to bin/station/vendor/bootstrap/css/bootstrap.min.css diff --git a/station/vendor/bootstrap/css/bootstrap.min.css.map b/bin/station/vendor/bootstrap/css/bootstrap.min.css.map old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/css/bootstrap.min.css.map rename to bin/station/vendor/bootstrap/css/bootstrap.min.css.map diff --git a/station/vendor/bootstrap/js/bootstrap.bundle.js b/bin/station/vendor/bootstrap/js/bootstrap.bundle.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/js/bootstrap.bundle.js rename to bin/station/vendor/bootstrap/js/bootstrap.bundle.js diff --git a/station/vendor/bootstrap/js/bootstrap.bundle.js.map b/bin/station/vendor/bootstrap/js/bootstrap.bundle.js.map old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/js/bootstrap.bundle.js.map rename to bin/station/vendor/bootstrap/js/bootstrap.bundle.js.map diff --git a/station/vendor/bootstrap/js/bootstrap.bundle.min.js b/bin/station/vendor/bootstrap/js/bootstrap.bundle.min.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/js/bootstrap.bundle.min.js rename to bin/station/vendor/bootstrap/js/bootstrap.bundle.min.js diff --git a/station/vendor/bootstrap/js/bootstrap.bundle.min.js.map b/bin/station/vendor/bootstrap/js/bootstrap.bundle.min.js.map old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/js/bootstrap.bundle.min.js.map rename to bin/station/vendor/bootstrap/js/bootstrap.bundle.min.js.map diff --git a/station/vendor/bootstrap/js/bootstrap.js b/bin/station/vendor/bootstrap/js/bootstrap.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/js/bootstrap.js rename to bin/station/vendor/bootstrap/js/bootstrap.js diff --git a/station/vendor/bootstrap/js/bootstrap.js.map b/bin/station/vendor/bootstrap/js/bootstrap.js.map old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/js/bootstrap.js.map rename to bin/station/vendor/bootstrap/js/bootstrap.js.map diff --git a/station/vendor/bootstrap/js/bootstrap.min.js b/bin/station/vendor/bootstrap/js/bootstrap.min.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/js/bootstrap.min.js rename to bin/station/vendor/bootstrap/js/bootstrap.min.js diff --git a/station/vendor/bootstrap/js/bootstrap.min.js.map b/bin/station/vendor/bootstrap/js/bootstrap.min.js.map old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/bootstrap/js/bootstrap.min.js.map rename to bin/station/vendor/bootstrap/js/bootstrap.min.js.map diff --git a/station/vendor/fontawesome/css/fa-svg-with-js.css b/bin/station/vendor/fontawesome/css/fa-svg-with-js.css old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/css/fa-svg-with-js.css rename to bin/station/vendor/fontawesome/css/fa-svg-with-js.css diff --git a/station/vendor/fontawesome/js/fa-brands.js b/bin/station/vendor/fontawesome/js/fa-brands.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fa-brands.js rename to bin/station/vendor/fontawesome/js/fa-brands.js diff --git a/station/vendor/fontawesome/js/fa-brands.min.js b/bin/station/vendor/fontawesome/js/fa-brands.min.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fa-brands.min.js rename to bin/station/vendor/fontawesome/js/fa-brands.min.js diff --git a/station/vendor/fontawesome/js/fa-regular.js b/bin/station/vendor/fontawesome/js/fa-regular.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fa-regular.js rename to bin/station/vendor/fontawesome/js/fa-regular.js diff --git a/station/vendor/fontawesome/js/fa-regular.min.js b/bin/station/vendor/fontawesome/js/fa-regular.min.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fa-regular.min.js rename to bin/station/vendor/fontawesome/js/fa-regular.min.js diff --git a/station/vendor/fontawesome/js/fa-solid.js b/bin/station/vendor/fontawesome/js/fa-solid.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fa-solid.js rename to bin/station/vendor/fontawesome/js/fa-solid.js diff --git a/station/vendor/fontawesome/js/fa-solid.min.js b/bin/station/vendor/fontawesome/js/fa-solid.min.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fa-solid.min.js rename to bin/station/vendor/fontawesome/js/fa-solid.min.js diff --git a/station/vendor/fontawesome/js/fa-v4-shims.js b/bin/station/vendor/fontawesome/js/fa-v4-shims.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fa-v4-shims.js rename to bin/station/vendor/fontawesome/js/fa-v4-shims.js diff --git a/station/vendor/fontawesome/js/fa-v4-shims.min.js b/bin/station/vendor/fontawesome/js/fa-v4-shims.min.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fa-v4-shims.min.js rename to bin/station/vendor/fontawesome/js/fa-v4-shims.min.js diff --git a/station/vendor/fontawesome/js/fontawesome-all.js b/bin/station/vendor/fontawesome/js/fontawesome-all.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fontawesome-all.js rename to bin/station/vendor/fontawesome/js/fontawesome-all.js diff --git a/station/vendor/fontawesome/js/fontawesome-all.min.js b/bin/station/vendor/fontawesome/js/fontawesome-all.min.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fontawesome-all.min.js rename to bin/station/vendor/fontawesome/js/fontawesome-all.min.js diff --git a/station/vendor/fontawesome/js/fontawesome.js b/bin/station/vendor/fontawesome/js/fontawesome.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fontawesome.js rename to bin/station/vendor/fontawesome/js/fontawesome.js diff --git a/station/vendor/fontawesome/js/fontawesome.min.js b/bin/station/vendor/fontawesome/js/fontawesome.min.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/fontawesome/js/fontawesome.min.js rename to bin/station/vendor/fontawesome/js/fontawesome.min.js diff --git a/station/vendor/jquery/jquery-3.2.1.min.js b/bin/station/vendor/jquery/jquery-3.2.1.min.js old mode 100755 new mode 100644 similarity index 100% rename from station/vendor/jquery/jquery-3.2.1.min.js rename to bin/station/vendor/jquery/jquery-3.2.1.min.js diff --git a/certserver.pl b/certserver.pl deleted file mode 100755 index 5c4812a..0000000 --- a/certserver.pl +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/perl -use strict; -use File::Basename; -use Getopt::Long; -use Time::HiRes; -use Data::Dumper; -use lib (dirname($0)); -use lib ('/home/dks/perl5/lib/perl5'); -# if ($^O ne "MSWin32" ){ -# use lib (dirname($0)); -# #use lib ($ENV{HOME}.'/perl5/lib/perl5'); -# } -#if ($^O eq "darwin"){ -# use lib ($ENV{HOME}.'/perl5/lib/perl5'); -#} -use Plack::Builder; -use Plack::App::File; -use Plack::App::Directory; -#use Plack::App::WrapCGI; -#use Plack::Middleware::Auth::Basic; -use Plack::Request; -use Plack::Runner; -#use Module::Service; -#use Module::Test; -#use Module::SQLite; -#use Module::Audio; -#use Module::System; -#use Module::OpenVPN; -#use Module::SSH; -#use JSON::PP; - -print $^O."\n"; - - -my @match = grep { /par-.*inc$/} @INC; - -my $basedir = dirname($0); -if (scalar(@match) > 0){ - $basedir = $match[0]; -} - -my $cfgpath = ""; -print "BASEDIR:".$basedir."\n"; -my $name = basename($0); -$name =~ s/\.pl$//; -$name =~ s/\.exe$//; - -# if ($^O eq "MSWin32"){ -# $cfgpath = $ENV{APPDATA}.'/'.$name; -# } -# elsif ($^O eq "darwin"){ -# $cfgpath = $ENV{HOME}.'/Library/Application Support/'.$name; -# } else { - $cfgpath = $ENV{HOME}.'/.'.$name; -# } -# sub version { -# require Twiggy; -# print "Twiggy $Twiggy::VERSION\n"; -# } - -print "ConfigPath:".$cfgpath."\n"; - -# sub authen_cb { -# my($username, $password, $env) = @_; -# my $auth = 0; -# #print "Check AUTH\n"; -# if (-e $cfgpath.'/'.$name.'.passwd'){ -# open(AUTH,$cfgpath.'/'.$name.'.passwd'); -# while (my $l = ){ -# chomp($l); -# if ($l eq $username.'='.$password){ -# $auth = 1; -# last; -# } -# } -# close(AUTH); -# } -# return $auth; -# } - -my $allapp = builder { - # if (-e $cfgpath.'/'.$name.'.passwd'){ - # enable "Auth::Basic", authenticator => \&authen_cb; - # } - #enable "DirIndex"; - mount "/" => Plack::App::Directory->new(root => dirname($0)."/cert")->to_app; - #mount "/app" => Module::Service->new(); - #mount "/system" => Module::System->new(); - #mount "/test" => Module::Test->new(); - #mount "/openvpn" => Module::OpenVPN->new(); - #mount "/ssh" => Module::SSH->new(); - #mount "/audio" => Module::Audio->new(binpath => dirname($0).'/'); - #mount "/sqlite" => Module::SQLite->new(); - #mount "/summernote" => Plack::App::File->new(root => dirname($0)."/summernote")->to_app; - #mount "/codemirror" => Plack::App::File->new(root => dirname($0)."/codemirror")->to_app; - #mount "/station" => Plack::App::File->new(root => dirname($0)."/station")->to_app; - #mount "/cert" => Plack::App::File->new(root => dirname($0).'/cert')->to_app; - #mount "/spotify" => Plack::App::File->new(root => dirname($0)."/testspotify")->to_app; -}; - - -my @args = ("-p","80"); -my $runner = Plack::Runner->new(server => 'Starlight', env => 'deployment', ipv6 => '1' );#env => development, test -$runner->parse_options(@args); -$runner->run($allapp); - -print "Started\n"; diff --git a/checkip.cgi b/checkip.cgi deleted file mode 100755 index b36765f..0000000 --- a/checkip.cgi +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/perl - -use CGI; - -my $cgi = new CGI(); -print $cgi->header(-type=> 'text/html', -charset=>"utf-8"); -print $ENV{REMOTE_ADDR}; \ No newline at end of file diff --git a/conf/db_backup.json b/conf/db_backup.json new file mode 100644 index 0000000..c9c944c --- /dev/null +++ b/conf/db_backup.json @@ -0,0 +1,42 @@ +{ + "juridig": { + "type":"mysql", + "dbhost": "sql615.your-server.de", + "dbname": "juridig_db", + "dbuser": "juridig", + "dbpwd": "fnx4HYwYCKRNR694", + "bkppath": "/home/dks/backup/webserver/db/juridig" + }, + "fanclubf91_lu": { + "type":"mysql", + "dbhost": "sql588.your-server.de", + "dbname": "wp_dksalu_db0", + "dbuser": "wp_dksalu_0", + "dbpwd": "B4Q3Zs4nKf4i4KM1", + "bkppath": "/home/dks/backup/webserver/db/fanclubf91_lu" + }, + "dateschutz_lu": { + "type":"mysql", + "dbhost": "sql247.your-server.de", + "dbname": "wp_dksalu_db1", + "dbuser": "wp_dksalu_1", + "dbpwd": "AASEV6zRxQDkmZ8Z", + "bkppath": "/home/dks/backup/webserver/db/dateschutz_lu" + }, + "solarch_dbsite": { + "type":"mysql", + "dbhost": "sql537.your-server.de", + "dbname": "solarch_db1", + "dbuser": "solarch_1", + "dbpwd": "F8LVv6iwjLkdLCMM", + "bkppath": "/home/dks/backup/webserver/db/solarch_dbsite" + }, + "solarch_dbprojectplan": { + "type":"mysql", + "dbhost": "sql635.your-server.de", + "dbname": "solarch_db2", + "dbuser": "solarch_2", + "dbpwd": "y8UvMP97pVeA7KTm", + "bkppath": "/home/dks/backup/webserver/db/solarch_dbprojectplan" + } +} \ No newline at end of file diff --git a/conf/drives.json b/conf/drives.json new file mode 100644 index 0000000..a021da9 --- /dev/null +++ b/conf/drives.json @@ -0,0 +1,28 @@ +{ + "drives": { + "222239212D6A": { + "gid": 1001, + "uid": 1001, + "type": "rw", + "path": "/home/dks/private" + }, + "94M1TP66T": { + "uid": 1001, + "gid": 1001, + "type": "rw", + "path": "/home/dks/music" + }, + "94M3TGRGT": { + "type": "rw", + "path": "/home/dks/mirror", + "uid": 1001, + "gid": 1001 + }, + "22223921335B": { + "gid": 1001, + "uid": 1001, + "type": "rw", + "path": "/home/dks/backup" + } + } +} \ No newline at end of file diff --git a/conf/smb.conf b/conf/smb.conf new file mode 100644 index 0000000..18b3c82 --- /dev/null +++ b/conf/smb.conf @@ -0,0 +1,58 @@ +[global] +workgroup = DKS +server string = DKS Home Backup System %v +netbios name = home-backup +security = user +map to guest = bad user +dns proxy = no + +[bin] + comment = bin folder + path = /home/dks/bin + valid users = kilian + force group = dks + force user = dks + create mask = 0660 + directory mask = 0771 + writable = yes + +[mirror] + comment = Mirror Drive + path = /home/dks/mirror + valid users = kilian + force group = dks + force user = dks + create mask = 0660 + directory mask = 0771 + writable = yes + +[backup] + comment = Backup Drive + path = /home/dks/backup + valid users = kilian + force group = dks + force user = dks + create mask = 0660 + directory mask = 0771 + writable = yes + +[music] + comment = Music Drive + path = /home/dks/music + valid users = kilian + force group = dks + force user = dks + create mask = 0660 + directory mask = 0771 + writable = yes + +[private] + comment = Private Family Drive + path = /home/dks/private + valid users = kilian + force group = dks + force user = dks + create mask = 0660 + directory mask = 0771 + writable = yes + diff --git a/dev/install.sh b/dev/install.sh new file mode 100644 index 0000000..e7d5b55 --- /dev/null +++ b/dev/install.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +#add group dks +#add user dks + +#add smbusers -> (must have real user with: -g -G dks -s /bin/false -d /dev/null + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..2ce6804 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,38 @@ +{ + "name": "dksnas", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@fortawesome/fontawesome-free": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.7.2.tgz", + "integrity": "sha512-Ha4HshKdCVKgu4TVCtG8XyPPYdzTzNW4/fvPnn+LT7AosRABryhlRv4cc4+o84dgpvVJN9reN7jo/c+nYujFug==", + "dev": true + }, + "bootstrap": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.3.1.tgz", + "integrity": "sha512-rXqOmH1VilAt2DyPzluTi2blhk17bO7ef+zLLPlWvG494pDxcM234pJ8wTc/6R40UWizAIIMgxjvxZg5kmsbag==", + "dev": true + }, + "bootstrap-table": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/bootstrap-table/-/bootstrap-table-1.13.4.tgz", + "integrity": "sha512-033fnjYKgFZO98PL6E0JAqmwTJ2isoQxJBFU6BwEbIMmRZETk5iDoPGgV+7wORt4c+yABNWj8EnbFBWAHz5YPw==", + "dev": true + }, + "jquery": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz", + "integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==", + "dev": true + }, + "popper.js": { + "version": "1.14.7", + "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.14.7.tgz", + "integrity": "sha512-4q1hNvoUre/8srWsH7hnoSJ5xVmIL4qgz+s4qf2TnJIMyZFUFMGH+9vE7mXynAlHSZ/NdTmmow86muD0myUkVQ==", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..f4d664c --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "dksnas", + "version": "0.1.0", + "description": "NAS Server", + "author": "Kilian Saffran", + "license": "MIT", + "devDependencies": { + "@fortawesome/fontawesome-free": "^5.7.2", + "bootstrap": "^4.3.1", + "bootstrap-table": "^1.13.4", + "jquery": "^3.3.1", + "popper.js": "^1.14.7" + } +} -- 2.39.5