commit 1e9762ff50acb562cc194ddc04ad104f5c056b14 Author: Clortox Date: Mon Jan 4 15:22:48 2021 -0500 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8084939 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +############ +# Git Ignore + +#Linux trash folder which can appear anywhere +.Trash-* + +# .nfs files are created when file is removed but still being accessed +.nfs* + +#dont add anyof the symlinks in dir to tracking +dir/* + +#but still keep the folder +!dir/.gitkeep diff --git a/README.md b/README.md new file mode 100644 index 0000000..ddfe559 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +Simple Repository +================= + +My simple php file repository/link tree that I wrote for my personal NAS. + +How to use +---------- + +I designed this with the intent that it could be used on something like a raspberry pi with little to now programming knowledge. + +The config file is supposed to be very easy to read and understand what each option means. The config file is in php. + +The config file is [var/config.php](var/config.php) \ No newline at end of file diff --git a/dir/.gitkeep b/dir/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/helpers/files.php b/helpers/files.php new file mode 100644 index 0000000..6dfe2f0 --- /dev/null +++ b/helpers/files.php @@ -0,0 +1,15 @@ + diff --git a/index.php b/index.php new file mode 100644 index 0000000..d13e43b --- /dev/null +++ b/index.php @@ -0,0 +1,57 @@ + + + + <?php echo $site_name ?> + + + + +
+
+

Folders

+
+
+

Select a catagory to start browsing

+ + + + + + + + + + $currentdir){ + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + ?> + +
NameLinkSize
' . $currentdir . 'View Listing' . foldersize($dir_dirs[$i]) . '
+
+
+ + diff --git a/listing.php b/listing.php new file mode 100644 index 0000000..b1e6ab4 --- /dev/null +++ b/listing.php @@ -0,0 +1,110 @@ + + + + <?php echo $site_name ?> + + + + + $dir_){ + if($dir_ == $dir){ + $exists = true; + break; + } + } + + if(!$exists){ + echo <<< errorblock +
+

LISTING NOT FOUND

+
+ errorblock; + exit(); + } + + if(!array_key_exists('path', $_GET)){ + $path = '/'; + } else { + $path = $_GET['path']; + } + + if($handle = opendir($dir_dirs[$dir_index] . $path)){ + while(false !== ($entry = readdir($handle))){ + //exclude . and .. + if($entry != '.' && $entry != '..'){ + $elements[] = $entry; + } + } + } else { + echo <<< erroropendir +
+

ERROR OPENING DIRECTORY, PLEASE RELOAD THE PAGE

+

IF THE ISSUE PERSISTS, PLEASE CONTACT YOUR SYSTEM ADMINISTRATOR

+
+ erroropendir; + exit(); + } + + ?> +
+
+

+
+
+

Select a file to download, or a folder to view its contents

+ + + + + + + + + + $currentfile){ + + echo ""; + echo ""; + $fulldir = $dir_dirs[$dir_index] . $path . "/" . $currentfile; + if(is_dir($fulldir)){ + echo ""; + echo ""; + } else { + echo ""; + echo ""; + } + echo ""; + } + ?> + +
File NameLinkSize
" . $currentfile . "View Directory" . foldersize($fulldir) . "Download" . listingsize($fulldir) . "
+
+
+ + + + diff --git a/var/config.php b/var/config.php new file mode 100644 index 0000000..cac6aa4 --- /dev/null +++ b/var/config.php @@ -0,0 +1,88 @@ + diff --git a/www/header.php b/www/header.php new file mode 100644 index 0000000..9610221 --- /dev/null +++ b/www/header.php @@ -0,0 +1,28 @@ + + +
+
+

+ ' . $clientip . $saying . $serverip . '

'; + } + ?> + + + + +
+
diff --git a/www/include.php b/www/include.php new file mode 100644 index 0000000..6acb5f6 --- /dev/null +++ b/www/include.php @@ -0,0 +1,14 @@ + + + + + + + + + +