From: David Polakovic Date: Sat, 8 Aug 2026 10:58:12 +0000 (+0200) Subject: feat: Added JS&PHP mechanism for generating schedule tables X-Git-Tag: 1.3.0 X-Git-Url: https://git.dpolakovic.space/?a=commitdiff_plain;p=dpolakovic-space feat: Added JS&PHP mechanism for generating schedule tables --- diff --git a/README.txt b/README.txt index 36d2e89..1ab99bd 100644 --- a/README.txt +++ b/README.txt @@ -1,158 +1,150 @@ -================================================================================ - dpolakovic.space - website files for dpolakovic.space and all it's subdomains -================================================================================ - -AUTHOR : David Polakovic -EMAIL : email@dpolakovic.space -TXT VERSION : 1.0.0 -LAST UPDATED: 2026-02-24 -LICENSE : GPLv3, with exception of /Git-server/Gtiweb folder - --------------------------------------------------------------------------------- -TABLE OF CONTENTS --------------------------------------------------------------------------------- - - 1. Overview - 2. Project structure - 3. Requirements - 4. Installation - 5. Usage - 6. Reference - 7. Configuration - 8. Examples - 9. Troubleshooting - 10. License - --------------------------------------------------------------------------------- -1. OVERVIEW --------------------------------------------------------------------------------- - - This file describes everything I host on my server. - --------------------------------------------------------------------------------- -2. PROJECT STRUCTURE --------------------------------------------------------------------------------- - - dpolakovic-space - ├── Git-server ## files from git.dpolakovic.space - │   ├── Coffee ## RFC 2324 implementation - │   │   ├── coffee-counter.js # counts served coffees from 48h ago - │   │   └── coffee-server.php # custom http methods definitions - │   ├── Gitweb ## gitweb (front page) files - │   │   ├── static - │   │   │   ├── gitweb.css - │   │   │   └── gitweb.js - │   │   ├── banner.html # contains JS for clicky images - │   │   ├── footer.html # contains JS which counts coffees - │   │   ├── gitweb.cgi # front page logic customization - │   │   └── indextext.html # contains styles for front page - │   └── Stuff ## other pages present on git server - │   ├── coffee-server.html - │   ├── contributors-guide.html - │   ├── dot.png - │   ├── server-rules.html - │   ├── stuff.css - │   └── stuff.js - │ - ├── Root-domain ## files from www.dpolakovic.space - │   ├── blogs ## contains all blog pages - │   ├── error - │   │   └── error.php # custom http status code handler - │   ├── php - │   │   ├── config.php # logic file included in all pages - │   │   └── leaderboard.php # logic file for leaderboard of CTF - │   ├── Pictures - │   ├── Styles - │   │   ├── FONT_LICENSE.txt - │   │   ├── NotoSerif-Bold.ttf - │   │   ├── NotoSerif-Italic.ttf - │   │   ├── NotoSerif-Regular.ttf - │   │   └── styles.css - │   ├── brew.php # implementation of RFC 2324 - │   ├── clicky-images.js - │   └── example-page.php - │ - ├── Tor-site ## files from Tor site - │   ├── Dead-drops ## encrypted messages from dead drop - │   ├── php - │   │   ├── captcha.php # captcha for dead drops - │   │   ├── config.php # config for all pages - │   │   └── dd2.php # dead drop logic - │   ├── Pictures - │   ├── Styles - │   │   ├── FONT_LICENSE.txt - │   │   ├── NotoSerif-Bold.ttf - │   │   ├── NotoSerif-Italic.ttf - │   │   ├── NotoSerif-Regular.ttf - │   │   └── styles.css - │   ├── dead-drop.php # dead drop front page - │   └── example-page.php - │ - ├── LICENSE.txt - └── README.txt - - --------------------------------------------------------------------------------- -3. REQUIREMENTS --------------------------------------------------------------------------------- - - - web server (tested on Apache) - - PHP (any version) - - git (any version < 3.0.0) - - gitweb (any version) - --------------------------------------------------------------------------------- -4. INSTALLATION --------------------------------------------------------------------------------- - - 1. Clone or download this repository. - - 2. Copy any file you want into your server. - --------------------------------------------------------------------------------- -5. USAGE --------------------------------------------------------------------------------- - - - - --------------------------------------------------------------------------------- -6. REFERENCE --------------------------------------------------------------------------------- - - Short references are written in project structure. - --------------------------------------------------------------------------------- -7. CONFIGURATION --------------------------------------------------------------------------------- - - - - --------------------------------------------------------------------------------- -8. EXAMPLES --------------------------------------------------------------------------------- - - - - --------------------------------------------------------------------------------- -9. TROUBLESHOOTING --------------------------------------------------------------------------------- - - Problem : Coffee counter shows error. - Solution: Restart the web server. This generates new json files and usually - solves this - - Problem : Dead drops don't show contents. - Solution: Check permissions and ownership on Dead-drops/ folder. It should - be apache:apache - --------------------------------------------------------------------------------- -10. LICENSE --------------------------------------------------------------------------------- - - This project is licensed under the GPLv3 License. - See the LICENSE.txt file for full details. - - Copyright (c) 2026 David Polakovic - -================================================================================ + +dpolakovic.space +website files and configs for dpolakovic.space, git server and the onion site + +AUTHOR : David Polakovic +EMAIL : email@dpolakovic.space +VERSION : 1.3.0 +LICENSE : various, see section LICENSE for more details + +OVERVIEW + + This repository contains a collection of html, php, javascript files + which I host these domains: + - https://www.dpolakovic.space + - https://git.dpolakovic.space + - and .onion site + + I do not "git" content of sites, only example pages. Exceptions + are files in /Git-server/Stuff/* since changes on them are good to track + for existing and potential git contributors. + + +PROJECT STRUCTURE (tree --dirsfirst) + + ├── Git-server + │   ├── Coffee + │   │   ├── coffee-counter.js + │   │   └── coffee-server.php + │   ├── Gitweb + │   │   ├── static + │   │   │   ├── gitweb.css + │   │   │   └── gitweb.js + │   │   ├── banner.html + │   │   ├── footer.html + │   │   ├── gitweb.cgi + │   │   └── indextext.html + │   └── Stuff + │   ├── coffee-server.html + │   ├── contributors-guide.html + │   ├── dot.png + │   ├── server-rules.html + │   ├── stuff.css + │   └── stuff.js + │  + ├── Root-domain + │   ├── blogs + │   ├── error + │   │   └── error.php + │   ├── php + │   │   ├── config.php + │   │   └── leaderboard.php + │   ├── Pictures + │   ├── Styles + │   │   ├── FONT_LICENSE.txt + │   │   ├── NotoSerif-Bold.ttf + │   │   ├── NotoSerif-Italic.ttf + │   │   ├── NotoSerif-Regular.ttf + │   │   └── styles.css + │   ├── brew.php + │   ├── clicky-images.js + │ ├── optional-get-time.js + │   └── example-page.php + │  + ├── Scripts + │   └── Rsser + │   └── rsser.pl + │  + ├── Tor-site + │   ├── Dead-drops + │   ├── php + │   │   ├── captcha.php + │   │   ├── config.php + │   │   └── dd2.php + │   ├── Pictures + │   ├── Styles + │   │   ├── FONT_LICENSE.txt + │   │   ├── NotoSerif-Bold.ttf + │   │   ├── NotoSerif-Italic.ttf + │   │   ├── NotoSerif-Regular.ttf + │   │   └── styles.css + │   ├── dead-drop.php + │   └── example-page.php + │  + ├── DOC_LICENSE.txt + ├── LICENSE.txt + ├── README.txt + └── TO_DO.txt + + + + +REQUIREMENTS + + In order to roll out these files on your setup you would need + - RHEL 9 or RHEL 9 clone + - apache server (any version) + - php (any version > 2.0.0) + - git (any version < 3.0.0) + - gitweb (any version) + - highlight (any version) + + The httpd and RHEL in general are optional, but other distros and/or server + would require some config changes from you. + + + +COMPONENT REFERENCE + + In this repo I also bundled the rsser.pl which is script I use to transle html + formated text from my blogs into rss formated text. Then I paste the output + to the rss.xml so users fetching my rss can read the blog in full length in + their favorite reader. + + rsser.pl + Purpose : converts HTML formatted text into CSS 2.0 format. + Usage : perl scripts/example_script.pl --input data.csv + Options : --help, --verbose, --output DIR + + + +CONFIGURATION + + + Don't forget to change the API token in Tor-site/php/dd2.php . + + + +KNOWN ISSUES + + Problem : Coffee counter shows error. + Solution: Restart the web server. This generates new .json files and usually + solves this + + Problem : Dead drops don't show contents. + Solution: Check permissions and ownership on Dead-drops/ folder. It should + be apache:apache + + + +LICENSE + + + This project uses various licenses. Check which files uses which one. + - files located in /Git-server are licensed under GPLv2 + - files located in /Root-domain and /Tor-site are licensed under GPLv3 + + + See the LICENSE.txt in file for full details. + + Copyright (c) 2022-2026 David Polakovic \ No newline at end of file diff --git a/Root-domain/optional-get-time.js b/Root-domain/optional-get-time.js new file mode 100644 index 0000000..bf1c335 --- /dev/null +++ b/Root-domain/optional-get-time.js @@ -0,0 +1,43 @@ +/** + * + * @licstart The following is the entire license notice for the + * JavaScript code in this page. + * + * Copyright (C) 2026 David Polakovic + * + * + * The JavaScript code in this page is free software: you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License (GNU GPL) as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) + * any later version. The code is distributed WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. + * + * As additional permission under GNU GPL version 3 section 7, you + * may distribute non-source (e.g., minimized or compacted) forms of + * that code without the copy of the GNU GPL normally required by + * section 4, provided you include this license notice and a URL + * through which recipients can access the Corresponding Source. + * + * @licend The above is the entire license notice + * for the JavaScript code in this page. + * + */ + +(function () { + "use strict"; + + var offset = -new Date().getTimezoneOffset(); // getTimezoneOffset counts the other way + var current = document.cookie.match(/(?:^|;\s*)tzo=(-?\d+)/); + + if (current && parseInt(current[1], 10) === offset) return; // already correct + + document.cookie = "tzo=" + offset + ";path=/;max-age=31536000;SameSite=Lax"; + + // Read it back: if the cookie didn't stick, reloading would loop forever. + var check = document.cookie.match(/(?:^|;\s*)tzo=(-?\d+)/); + if (!check || parseInt(check[1], 10) !== offset) return; + + location.replace(location.href); // replace, so the back button stays sane +})(); diff --git a/Root-domain/php/config.php b/Root-domain/php/config.php index 0a818cc..67eb524 100755 --- a/Root-domain/php/config.php +++ b/Root-domain/php/config.php @@ -1,9 +1,7 @@ "; @@ -81,7 +77,6 @@ function countFileLines($filename) { echo $lineCount; } -// Print footer on every page function printFooter($usesJS, $usesCookies, ...$files) { // Print JS status echo "Copyright 2023-" . date("Y") . " David Polakovic. All publications licensed under "; @@ -109,21 +104,43 @@ function printFooter($usesJS, $usesCookies, ...$files) { } echo 'Server for this domain is '; echo 'RFC 1464 and '; - echo 'RFC 2324 compliant.'; + echo 'RFC 2324 compliant.'; } -// Just like footer... + function printNavBar(){ echo << - - -