From 08756e769bfd0cca386631912c6cd8bafc71c255 Mon Sep 17 00:00:00 2001 From: Jenga Phoenix Date: Thu, 14 Feb 2019 09:39:29 -0600 Subject: [PATCH] Get rid of /public_html/ system --- .htaccess | 4 ++++ README.txt | 7 ++++++- public_html/coin.php => coin.php | 4 ++-- docs/lighttpd.txt | 14 ++++++++++++++ public_html/index.php => index.php | 0 public_html/mask.php => mask.php | 4 ++-- {public_html/private => private}/beam.php | 4 ++-- {public_html/private => private}/create.php | 4 ++-- {resources => res}/config.example.php | 0 {public_html/res => res}/css/style.css | 0 {public_html/res => res}/img/coin-big.png | Bin {public_html/res => res}/img/coin.png | Bin {public_html/res => res}/img/coin_die-big.png | Bin {public_html/res => res}/img/coin_die.png | Bin {public_html/res => res}/img/coin_win-big.png | Bin {public_html/res => res}/img/coin_win.png | Bin {public_html/res => res}/img/logo.png | Bin {public_html/res => res}/img/mask-big.png | Bin {public_html/res => res}/img/mask.png | Bin {public_html/res => res}/img/mask_die-big.png | Bin {public_html/res => res}/img/mask_die.png | Bin {public_html/res => res}/img/mask_win-big.png | Bin {public_html/res => res}/img/mask_win.png | Bin {public_html/res => res}/img/war_duck.png | Bin {resources => res}/library/array.php | 0 {resources => res}/library/file.php | 0 {resources => res}/library/insert-coin.php | 12 ++++++------ {resources => res}/library/main.php | 12 ++++++------ {resources => res}/library/sanitization.php | 0 {resources => res}/library/string.php | 0 {resources => res}/library/urls.php | 0 {resources => res}/templates/coin/beam.php | 0 {resources => res}/templates/coin/celebrate.php | 0 {resources => res}/templates/coin/death-1.html | 0 {resources => res}/templates/coin/death-2.html | 0 {resources => res}/templates/coin/death.html | 0 {resources => res}/templates/footer.php | 0 {resources => res}/templates/header.php | 5 +++-- {resources => res}/templates/mask/celebrate.php | 0 {resources => res}/templates/mask/create.php | 0 {resources => res}/templates/mask/death-1.html | 0 {resources => res}/templates/mask/death-2.php | 0 {resources => res}/templates/mask/death-3.html | 0 {resources => res}/templates/mask/death.html | 0 res/templates/menu.php | 11 +++++++++++ resources/templates/menu.php | 9 --------- {public_html/result => result}/beam.php | 4 ++-- {public_html/result => result}/create.php | 4 ++-- 48 files changed, 62 insertions(+), 36 deletions(-) create mode 100644 .htaccess rename public_html/coin.php => coin.php (65%) create mode 100644 docs/lighttpd.txt rename public_html/index.php => index.php (100%) rename public_html/mask.php => mask.php (67%) rename {public_html/private => private}/beam.php (92%) rename {public_html/private => private}/create.php (91%) rename {resources => res}/config.example.php (100%) rename {public_html/res => res}/css/style.css (100%) rename {public_html/res => res}/img/coin-big.png (100%) rename {public_html/res => res}/img/coin.png (100%) rename {public_html/res => res}/img/coin_die-big.png (100%) rename {public_html/res => res}/img/coin_die.png (100%) rename {public_html/res => res}/img/coin_win-big.png (100%) rename {public_html/res => res}/img/coin_win.png (100%) rename {public_html/res => res}/img/logo.png (100%) rename {public_html/res => res}/img/mask-big.png (100%) rename {public_html/res => res}/img/mask.png (100%) rename {public_html/res => res}/img/mask_die-big.png (100%) rename {public_html/res => res}/img/mask_die.png (100%) rename {public_html/res => res}/img/mask_win-big.png (100%) rename {public_html/res => res}/img/mask_win.png (100%) rename {public_html/res => res}/img/war_duck.png (100%) rename {resources => res}/library/array.php (100%) rename {resources => res}/library/file.php (100%) rename {resources => res}/library/insert-coin.php (53%) rename {resources => res}/library/main.php (62%) rename {resources => res}/library/sanitization.php (100%) rename {resources => res}/library/string.php (100%) rename {resources => res}/library/urls.php (100%) rename {resources => res}/templates/coin/beam.php (100%) rename {resources => res}/templates/coin/celebrate.php (100%) rename {resources => res}/templates/coin/death-1.html (100%) rename {resources => res}/templates/coin/death-2.html (100%) rename {resources => res}/templates/coin/death.html (100%) rename {resources => res}/templates/footer.php (100%) rename {resources => res}/templates/header.php (71%) rename {resources => res}/templates/mask/celebrate.php (100%) rename {resources => res}/templates/mask/create.php (100%) rename {resources => res}/templates/mask/death-1.html (100%) rename {resources => res}/templates/mask/death-2.php (100%) rename {resources => res}/templates/mask/death-3.html (100%) rename {resources => res}/templates/mask/death.html (100%) create mode 100644 res/templates/menu.php delete mode 100644 resources/templates/menu.php rename {public_html/result => result}/beam.php (90%) rename {public_html/result => result}/create.php (92%) diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..441e1e4 --- /dev/null +++ b/.htaccess @@ -0,0 +1,4 @@ + +Order Allow,Deny +Deny from all + diff --git a/README.txt b/README.txt index 35f339e..e57a453 100644 --- a/README.txt +++ b/README.txt @@ -16,7 +16,12 @@ matter). Then, create two directories-- "p/" and "u/"-- that are accessible and modifiable by your web-server user. Finally, make a "res/config.php" file (from "res/config.example.php"). -Then, profit! + +If you're using a web-server that supports .htaccess files (Apache and the +ilk), then you should be good from here. Otherwise, you should manually block +the files referenced in "/.htaccess" and "res/.htaccess"-- for sample config +of Lighttpd, read "docs/lighttpd.txt". + ---------------------------------------- diff --git a/public_html/coin.php b/coin.php similarity index 65% rename from public_html/coin.php rename to coin.php index 720b155..5504c27 100644 --- a/public_html/coin.php +++ b/coin.php @@ -1,6 +1,6 @@ "https://HOSTNAME/", + "^/COPYING.txt$" => "https://HOSTNAME/", + "^/res/config.*$" => "https://HOSTNAME/", + "^/res/library.*$" => "https://HOSTNAME/", + "^/res/templates.*$" => "https://HOSTNAME/" + ) + +... just make sure to change HOSTNAME to your actual hostname, and to change +"^/" to whatever the root to your insert-coin instance is. diff --git a/public_html/index.php b/index.php similarity index 100% rename from public_html/index.php rename to index.php diff --git a/public_html/mask.php b/mask.php similarity index 67% rename from public_html/mask.php rename to mask.php index 89e4346..cdbf0d0 100644 --- a/public_html/mask.php +++ b/mask.php @@ -1,6 +1,6 @@ HTML // Create a general insert-coin webpage; relative path from rootdir -// for $image_path, and relative path from /resources/templates/ +// for $image_path, and relative path from /res/templates/ // for $template function create_page($page_title, $template, $image_alt_text, $image_path) { - include(root("resources/templates/header.php")); + include(root("res/templates/header.php")); ?>
<?php echo($image_alt_text); ?> + src="">
diff --git a/resources/library/sanitization.php b/res/library/sanitization.php similarity index 100% rename from resources/library/sanitization.php rename to res/library/sanitization.php diff --git a/resources/library/string.php b/res/library/string.php similarity index 100% rename from resources/library/string.php rename to res/library/string.php diff --git a/resources/library/urls.php b/res/library/urls.php similarity index 100% rename from resources/library/urls.php rename to res/library/urls.php diff --git a/resources/templates/coin/beam.php b/res/templates/coin/beam.php similarity index 100% rename from resources/templates/coin/beam.php rename to res/templates/coin/beam.php diff --git a/resources/templates/coin/celebrate.php b/res/templates/coin/celebrate.php similarity index 100% rename from resources/templates/coin/celebrate.php rename to res/templates/coin/celebrate.php diff --git a/resources/templates/coin/death-1.html b/res/templates/coin/death-1.html similarity index 100% rename from resources/templates/coin/death-1.html rename to res/templates/coin/death-1.html diff --git a/resources/templates/coin/death-2.html b/res/templates/coin/death-2.html similarity index 100% rename from resources/templates/coin/death-2.html rename to res/templates/coin/death-2.html diff --git a/resources/templates/coin/death.html b/res/templates/coin/death.html similarity index 100% rename from resources/templates/coin/death.html rename to res/templates/coin/death.html diff --git a/resources/templates/footer.php b/res/templates/footer.php similarity index 100% rename from resources/templates/footer.php rename to res/templates/footer.php diff --git a/resources/templates/header.php b/res/templates/header.php similarity index 71% rename from resources/templates/header.php rename to res/templates/header.php index 031e380..7041f6f 100644 --- a/resources/templates/header.php +++ b/res/templates/header.php @@ -8,8 +8,9 @@ - - +"> +"> diff --git a/resources/templates/mask/celebrate.php b/res/templates/mask/celebrate.php similarity index 100% rename from resources/templates/mask/celebrate.php rename to res/templates/mask/celebrate.php diff --git a/resources/templates/mask/create.php b/res/templates/mask/create.php similarity index 100% rename from resources/templates/mask/create.php rename to res/templates/mask/create.php diff --git a/resources/templates/mask/death-1.html b/res/templates/mask/death-1.html similarity index 100% rename from resources/templates/mask/death-1.html rename to res/templates/mask/death-1.html diff --git a/resources/templates/mask/death-2.php b/res/templates/mask/death-2.php similarity index 100% rename from resources/templates/mask/death-2.php rename to res/templates/mask/death-2.php diff --git a/resources/templates/mask/death-3.html b/res/templates/mask/death-3.html similarity index 100% rename from resources/templates/mask/death-3.html rename to res/templates/mask/death-3.html diff --git a/resources/templates/mask/death.html b/res/templates/mask/death.html similarity index 100% rename from resources/templates/mask/death.html rename to res/templates/mask/death.html diff --git a/res/templates/menu.php b/res/templates/menu.php new file mode 100644 index 0000000..8dc5d3a --- /dev/null +++ b/res/templates/menu.php @@ -0,0 +1,11 @@ + diff --git a/resources/templates/menu.php b/resources/templates/menu.php deleted file mode 100644 index ce690fe..0000000 --- a/resources/templates/menu.php +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/public_html/result/beam.php b/result/beam.php similarity index 90% rename from public_html/result/beam.php rename to result/beam.php index e9f251c..d63e971 100644 --- a/public_html/result/beam.php +++ b/result/beam.php @@ -1,6 +1,6 @@