diff --git a/README.md b/README.md
index 3a2a48b..49eebbc 100644
--- a/README.md
+++ b/README.md
@@ -39,13 +39,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## 🛠 Installation and setup
0. You need to have a webhosting with **PHP 8** and perferable running Apache or similar for timeline to work.
-
+
> There are free options, but I would suggest that you pay for your hosting and also get a nice domain, so you have more ownership over your data and online idetenty.
1. Download the code from https://github.com/sorenpeter/timeline as a zip
2. Upload the content of the zip to you webhosting using a FTP client
-
+
- The default would be to put eveything from within the timeline-main folder in the root so you will have:
```
@@ -66,7 +66,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### Webfinger endpoint setup
-6. For allowing others to look you on using webfinger, you need to move the `.well-known` folder from within the `_webfinger_endpoint` to the root of your domain, so it is accesable from www.example.net/.well-know/webfinger
+6. For allowing others to look you on using webfinger, you need to move the `.well-known` folder from within the `_webfinger_endpoint` to the root of your domain, so it is accesable from www.example.net/.well-know/webfinger
7. You also need to edit the `index.php` file wihtin the `.well-know/webfinger` folder and set the correct path for you timeline installation in `$timeline_dir` variable.
@@ -84,6 +84,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## 🐞 Bugs to fix
- [x] (2024-11-30) Fix issues with parsing markdown vs. twtxt syntax (replaceed slimdown with Parsedown, supporting lists, block quotes, code/blocks, links, images)
+- [x] (2024-12-26) Extend session duration for 30 days
+- [ ] (2024-12-26) Read the config.ini in a centralized place and add validations useful when installing or upgrading `timeline`.
## 🚀 Features to code
@@ -97,7 +99,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# 🙏 Credits / shoutouts
-## Ideas and inspiration
+## Ideas and inspiration
- [twtxt](https://twtxt.readthedocs.io) - The original decentralised, minimalist microblogging service for hackers
@@ -109,7 +111,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- [twtxt-php](https://github.com/eapl-gemugami/twtxt-php) - A minimalistic and personal PHP site for your twtxt microblogging.
-- [Slimdown](https://github.com/jbroadway/slimdown) - A simple regex-based Markdown parser in PHP.
+- [Slimdown](https://github.com/jbroadway/slimdown) - A simple regex-based Markdown parser in PHP.
- Tag cloud feature is based on php code by [Domingos Faria](https://social.dfaria.eu/search)
diff --git a/VERSION b/VERSION
index a22da3b..9d56291 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2024.12.06
+2024.12.26
diff --git a/_wip_todo/add_url.php b/_wip_todo/add_url.php
index 34494d1..886664c 100644
--- a/_wip_todo/add_url.php
+++ b/_wip_todo/add_url.php
@@ -10,9 +10,9 @@ if ($config['debug_mode']) {
require_once('session.php');
-if (!isset($_SESSION['valid_session'])) {
+if (!isset($_SESSION['valid_session'])) {
$secretKey = $config['totp_secret'];
- $cookieVal = decodeCookie($secretKey);
+ $cookieVal = isSavedCookieValid($secretKey);
if ($cookieVal === false) { # Valid cookie ?
header('Location: login.php');
@@ -56,27 +56,30 @@ if (isset($_POST['submit'])) {
exit;
}
} else { ?>
-
-
-
+ twts)) {
- // Then test if latest twt is at start or end of file:
- $resetVar = reset(getTwtsFromTwtxtString($currentFollower[1])->twts);
- $endVar = end(getTwtsFromTwtxtString($currentFollower[1])->twts);
- if ($resetVar->timestamp < $endVar->timestamp) { // TODO: this can be swapped to get time of first twt
- echo $endVar->displayDate;
- } else {
- echo $resetVar->displayDate;
+ // Then test if latest twt is at start or end of file:
+ $resetVar = reset(getTwtsFromTwtxtString($currentFollower[1])->twts);
+ $endVar = end(getTwtsFromTwtxtString($currentFollower[1])->twts);
+ if ($resetVar->timestamp < $endVar->timestamp) { // TODO: this can be swapped to get time of first twt
+ echo $endVar->displayDate;
+ } else {
+ echo $resetVar->displayDate;
+ }
}
- }
- ?>
+ ?>
-
-
+
+
-
+
-
+
\ No newline at end of file
diff --git a/views/home.php b/views/home.php
index a326e6d..a8d0ae0 100644
--- a/views/home.php
+++ b/views/home.php
@@ -18,25 +18,23 @@ if (!empty($_GET['profile'])) { // Show twts for some user (Profile view)
// Load twts, taking $paginateTwts into consideration
require_once 'partials/base.php';
+require_once 'libs/session.php';
-$title = "Timeline for ".$title;
+$title = "Timeline for $title";
-
-// Redirect guests to Profile view, if url not set til home twtxt.txt
-
-if (!isset($_SESSION['password']) && (isset($_GET['url']))) {
- if ($_GET['url'] != $config['public_txt_url']) {
- header('Location: ./profile');
- exit();
- }
+// Redirect guests to Profile view, if URL isn't set to home twtxt.txt
+if (!hasValidSession() && isset($_GET['url'])) {
+ if ($_GET['url'] != $config['public_txt_url']) {
+ header('Location: ./profile');
+ exit();
+ }
}
include_once 'partials/header.php';
-if (isset($_SESSION['password'])) {
+if (hasValidSession()) {
include 'views/new_twt.php'; // TODO: Split up new_twt into a view and a partial
} else {
-
echo '