From 2aac7ad5c4a2b9da302808e5696281abc0ac00a3 Mon Sep 17 00:00:00 2001 From: Franzz Date: Tue, 18 Aug 2026 15:55:55 +0200 Subject: [PATCH] Rename Spot to Livetrail internally --- .gitea/workflows/deploy.yml | 6 +- cli/cron.sh | 2 +- composer.dev.json | 4 +- composer.json | 4 +- composer.lock | 2 +- config/apache-localhost.conf | 6 +- config/settings-sample.php | 2 +- lib/Controller.php | 58 +++++++++---------- lib/Converter.php | 2 +- lib/Email.php | 8 +-- lib/Feed.php | 2 +- lib/Geo.php | 2 +- lib/GeoJson.php | 2 +- lib/Gpx.php | 2 +- lib/{Spot.php => Livetrail.php} | 4 +- lib/Map.php | 2 +- lib/Media.php | 10 ++-- lib/Project.php | 6 +- lib/Uploader.php | 2 +- lib/User.php | 14 ++--- public/index.php | 2 +- readme.md | 4 +- resources/lang/en.json | 2 +- resources/lang/es.json | 2 +- resources/lang/fr.json | 2 +- src/App.vue | 6 +- src/app.js | 2 +- src/components/{admin.vue => Admin.vue} | 22 +++---- .../{adminInput.vue => AdminInput.vue} | 0 .../{spotButton.vue => AppButton.vue} | 6 +- src/components/{spotIcon.vue => AppIcon.vue} | 18 +++--- .../{spotIconStack.vue => AppIconStack.vue} | 10 ++-- src/components/{project.vue => Project.vue} | 16 ++--- ...{projectAccount.vue => ProjectAccount.vue} | 12 ++-- .../{projectFeed.vue => ProjectFeed.vue} | 8 +-- ...{projectMapLink.vue => ProjectMapLink.vue} | 0 ...jectMediaLink.vue => ProjectMediaLink.vue} | 16 ++--- .../{projectPopup.vue => ProjectPopup.vue} | 34 +++++------ .../{projectPost.vue => ProjectPost.vue} | 34 +++++------ ...{projectRelTime.vue => ProjectRelTime.vue} | 6 +- ...rojectSettings.vue => ProjectSettings.vue} | 28 ++++----- src/components/{upload.vue => Upload.vue} | 12 ++-- src/images/source/logo_icon_inkscape.svg | 2 +- .../source/logo_icon_waves_inkscape.svg | 2 +- .../source/logo_title_waves_inkscape.svg | 2 +- src/images/source/ogp_inskape.svg | 2 +- src/scripts/lightbox.js | 2 +- src/styles/_lightbox.scss | 2 +- src/styles/_page.project.map.scss | 4 +- src/styles/_page.project.panel.feed.scss | 6 +- src/styles/_page.project.panel.scss | 6 +- src/styles/_page.project.panel.settings.scss | 2 +- src/styles/_page.project.scss | 4 +- src/styles/{spot.scss => livetrail.scss} | 0 vite.config.mjs | 6 +- 55 files changed, 211 insertions(+), 211 deletions(-) rename lib/{Spot.php => Livetrail.php} (99%) rename src/components/{admin.vue => Admin.vue} (85%) rename src/components/{adminInput.vue => AdminInput.vue} (100%) rename src/components/{spotButton.vue => AppButton.vue} (52%) rename src/components/{spotIcon.vue => AppIcon.vue} (79%) rename src/components/{spotIconStack.vue => AppIconStack.vue} (73%) rename src/components/{project.vue => Project.vue} (98%) rename src/components/{projectAccount.vue => ProjectAccount.vue} (93%) rename src/components/{projectFeed.vue => ProjectFeed.vue} (97%) rename src/components/{projectMapLink.vue => ProjectMapLink.vue} (100%) rename src/components/{projectMediaLink.vue => ProjectMediaLink.vue} (80%) rename src/components/{projectPopup.vue => ProjectPopup.vue} (65%) rename src/components/{projectPost.vue => ProjectPost.vue} (87%) rename src/components/{projectRelTime.vue => ProjectRelTime.vue} (82%) rename src/components/{projectSettings.vue => ProjectSettings.vue} (81%) rename src/components/{upload.vue => Upload.vue} (90%) rename src/styles/{spot.scss => livetrail.scss} (100%) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 70a13aa..7b064ce 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy Spot +name: Deploy Livetrail on: push: @@ -7,12 +7,12 @@ on: jobs: deploy: - runs-on: spot + runs-on: livetrail env: COMPOSER_NO_INTERACTION: "1" COMPOSER_HOME: .composer - DEPLOY_PATH: /var/www/spot + DEPLOY_PATH: /var/www/livetrail npm_config_cache: .npm-cache steps: diff --git a/cli/cron.sh b/cli/cron.sh index d4ce39d..efb6913 100755 --- a/cli/cron.sh +++ b/cli/cron.sh @@ -2,4 +2,4 @@ cd "$(dirname "$0")/../public" || exit 1 #Execute from public folder php -f index.php a=update_project > /dev/null -#Crontab job: 0 * * * * /path/to/spot/cli/cron.sh > /dev/null +#Crontab job: 0 * * * * /path/to/livetrail/cli/cron.sh > /dev/null diff --git a/composer.dev.json b/composer.dev.json index 0c50424..f2f9d0f 100644 --- a/composer.dev.json +++ b/composer.dev.json @@ -1,5 +1,5 @@ { - "name": "franzz/spot", + "name": "franzz/livetrail", "description": "LiveTrail", "type": "project", "license": "GPL-3.0-or-later", @@ -18,7 +18,7 @@ }, "autoload": { "psr-4": { - "Franzz\\Spot\\": "lib/", + "Franzz\\Livetrail\\": "lib/", "Franzz\\Objects\\": "../objects/inc/" }, "files": [ diff --git a/composer.json b/composer.json index 89c6414..777791e 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "franzz/spot", + "name": "franzz/livetrail", "description": "LiveTrail", "type": "project", "license": "GPL-3.0-or-later", @@ -15,7 +15,7 @@ }, "autoload": { "psr-4": { - "Franzz\\Spot\\": "lib/" + "Franzz\\Livetrail\\": "lib/" }, "files": [ "config/settings.php" diff --git a/composer.lock b/composer.lock index f42984d..68f5c7f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8eb764990f0cb9427030c2bf01390d62", + "content-hash": "4b438f8df113fa3394f395aa5b8e6081", "packages": [ { "name": "franzz/objects", diff --git a/config/apache-localhost.conf b/config/apache-localhost.conf index c2bacb4..c10d1e1 100644 --- a/config/apache-localhost.conf +++ b/config/apache-localhost.conf @@ -5,10 +5,10 @@ DirectoryIndex index.php - # Serve http://localhost/spot/ from the public web root. - Alias /spot /var/www/html/spot/public + # Serve http://localhost/livetrail/ from the public web root. + Alias /livetrail /var/www/html/livetrail/public - + Options FollowSymLinks AllowOverride None Require all granted diff --git a/config/settings-sample.php b/config/settings-sample.php index baf8c4e..ed84661 100644 --- a/config/settings-sample.php +++ b/config/settings-sample.php @@ -5,7 +5,7 @@ class Settings const DB_SERVER = 'localhost'; const DB_LOGIN = ''; const DB_PASS = ''; - const DB_NAME = 'spot'; + const DB_NAME = 'livetrail'; const DB_ENC = 'utf8mb4'; const TEXT_ENC = 'UTF-8'; const TIMEZONE = 'Europe/Zurich'; diff --git a/lib/Controller.php b/lib/Controller.php index 059259f..7807d66 100644 --- a/lib/Controller.php +++ b/lib/Controller.php @@ -1,6 +1,6 @@ initCsrfToken(); - //Create Spot Instance - $this->oSpot = new Spot($sProcessPage, $this->asReq['t']); + //Create Livetrail instance + $this->oLivetrail = new Livetrail($sProcessPage, $this->asReq['t']); //Validate CSRF, then release the session lock before long-running work. $bValidMutationRequest = $this->validateMutationRequest($sAction); if(!$bValidMutationRequest || !in_array($sAction, self::SESSION_WRITING_ACTIONS, true)) $this->closeSession(); - if(!$bValidMutationRequest) $sResult = Spot::getJsonResult(false, Spot::UNAUTHORIZED); + if(!$bValidMutationRequest) $sResult = Livetrail::getJsonResult(false, Livetrail::UNAUTHORIZED); else { - $this->oSpot->setProjectId($this->asReq['id_project']); - $sResult = ($sAction == '')?$this->oSpot->getAppMainPage($this->getCsrfToken()):$this->dispatch($sAction); + $this->oLivetrail->setProjectId($this->asReq['id_project']); + $sResult = ($sAction == '')?$this->oLivetrail->getAppMainPage($this->getCsrfToken()):$this->dispatch($sAction); } //Clean errors $sDebug = ob_get_clean(); - if($sDebug != '') $this->oSpot->addUncaughtError($sDebug); + if($sDebug != '') $this->oLivetrail->addUncaughtError($sDebug); $this->closeSession(); return $sResult; @@ -140,36 +140,36 @@ class Controller extends PhpObject private function dispatch(string $sAction): string { return match($sAction) { - 'markers' => $this->oSpot->getMarkers(), - 'last_update' => $this->oSpot->getLastUpdate(), - 'next_feed' => $this->oSpot->getNextFeed($this->asReq['id']), - 'new_feed' => $this->oSpot->getNewFeed($this->asReq['id']), - 'add_post' => $this->oSpot->addPost($this->asReq['name'], $this->asReq['content']), - 'subscribe' => $this->oSpot->subscribe(), - 'unsubscribe' => $this->oSpot->unsubscribe(), - 'login' => $this->oSpot->login($this->asReq['email'], $this->asReq['password'], $this->asReq['name']), - 'logout' => $this->oSpot->logout(), - 'update_project' => $this->oSpot->updateProject(), + 'markers' => $this->oLivetrail->getMarkers(), + 'last_update' => $this->oLivetrail->getLastUpdate(), + 'next_feed' => $this->oLivetrail->getNextFeed($this->asReq['id']), + 'new_feed' => $this->oLivetrail->getNewFeed($this->asReq['id']), + 'add_post' => $this->oLivetrail->addPost($this->asReq['name'], $this->asReq['content']), + 'subscribe' => $this->oLivetrail->subscribe(), + 'unsubscribe' => $this->oLivetrail->unsubscribe(), + 'login' => $this->oLivetrail->login($this->asReq['email'], $this->asReq['password'], $this->asReq['name']), + 'logout' => $this->oLivetrail->logout(), + 'update_project' => $this->oLivetrail->updateProject(), default => $this->dispatchAdmin($sAction) }; } private function dispatchAdmin(string $sAction): string { - if(!$this->oSpot->checkUserClearance(User::CLEARANCE_ADMIN)) { - return Spot::getJsonResult(false, Spot::NOT_FOUND); + if(!$this->oLivetrail->checkUserClearance(User::CLEARANCE_ADMIN)) { + return Livetrail::getJsonResult(false, Livetrail::NOT_FOUND); } return match($sAction) { - 'upload' => $this->oSpot->upload(), - 'add_comment' => $this->oSpot->addComment($this->asReq['id_entity'], $this->asReq['content']), - 'add_position' => $this->oSpot->addPosition($this->asReq['latitude'], $this->asReq['longitude'], $this->asReq['timestamp']), - 'admin_get' => $this->oSpot->getAdminSettings(), - 'admin_set' => $this->oSpot->setAdminSettings($this->asReq['type'], $this->asReq['id_entity'], $this->asReq['field'], $this->asReq['value']), - 'admin_create' => $this->oSpot->createAdminSettings($this->asReq['type']), - 'admin_delete' => $this->oSpot->deleteAdminSettings($this->asReq['type'], $this->asReq['id_entity']), - 'sql' => $this->oSpot->getDbBuildScript(), - default => Spot::getJsonResult(false, Spot::NOT_FOUND) + 'upload' => $this->oLivetrail->upload(), + 'add_comment' => $this->oLivetrail->addComment($this->asReq['id_entity'], $this->asReq['content']), + 'add_position' => $this->oLivetrail->addPosition($this->asReq['latitude'], $this->asReq['longitude'], $this->asReq['timestamp']), + 'admin_get' => $this->oLivetrail->getAdminSettings(), + 'admin_set' => $this->oLivetrail->setAdminSettings($this->asReq['type'], $this->asReq['id_entity'], $this->asReq['field'], $this->asReq['value']), + 'admin_create' => $this->oLivetrail->createAdminSettings($this->asReq['type']), + 'admin_delete' => $this->oLivetrail->deleteAdminSettings($this->asReq['type'], $this->asReq['id_entity']), + 'sql' => $this->oLivetrail->getDbBuildScript(), + default => Livetrail::getJsonResult(false, Livetrail::NOT_FOUND) }; } diff --git a/lib/Converter.php b/lib/Converter.php index 3c72fbc..c287110 100644 --- a/lib/Converter.php +++ b/lib/Converter.php @@ -1,6 +1,6 @@ Password = Settings::MAIL_PASS; //SMTP password $oPHPMailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged $oPHPMailer->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above - $oPHPMailer->setFrom(Settings::MAIL_FROM, Spot::PROJECT_NAME); - $oPHPMailer->addReplyTo(Settings::MAIL_FROM, Spot::PROJECT_NAME); + $oPHPMailer->setFrom(Settings::MAIL_FROM, Livetrail::PROJECT_NAME); + $oPHPMailer->addReplyTo(Settings::MAIL_FROM, Livetrail::PROJECT_NAME); $bSuccess = true; foreach($this->asDests as $asDest) { //Message - $this->oTemplate->setLanguage($asDest['language'], Spot::DEFAULT_LANG); + $this->oTemplate->setLanguage($asDest['language'], Livetrail::DEFAULT_LANG); $this->oTemplate->setTimezone($asDest['timezone']); //Unsubscribe Link diff --git a/lib/Feed.php b/lib/Feed.php index 086f124..f64061c 100644 --- a/lib/Feed.php +++ b/lib/Feed.php @@ -1,6 +1,6 @@ isModeEditable($asProject['mode']); - $asProject['gpxfilepath'] = Spot::addTimestampToFilePath(Gpx::getFrontendFilePath($sCodeName)); - $asProject['geofilepath'] = Spot::addTimestampToFilePath(GeoJson::getFrontendFilePath($sCodeName)); + $asProject['gpxfilepath'] = Livetrail::addTimestampToFilePath(Gpx::getFrontendFilePath($sCodeName)); + $asProject['geofilepath'] = Livetrail::addTimestampToFilePath(GeoJson::getFrontendFilePath($sCodeName)); $asProject['codename'] = $sCodeName; $asProject['default'] = ($sCodeName == $sDefaultProjectCodeName); } diff --git a/lib/Uploader.php b/lib/Uploader.php index c5f3584..bc2f530 100644 --- a/lib/Uploader.php +++ b/lib/Uploader.php @@ -1,6 +1,6 @@ updateGravatar($iUserId, $sEmail); } - return Spot::getResult($bSuccess, $sDesc, [Db::getId(self::USER_TABLE) => $iUserId]); + return Livetrail::getResult($bSuccess, $sDesc, [Db::getId(self::USER_TABLE) => $iUserId]); } public function setSubscription($bSubscribed) { if($this->getUserId() > 0) { $iSubscribed = $bSubscribed?1:0; $iUserId = $this->oDb->updateRow(self::USER_TABLE, $this->getUserId(), array('subscribed'=>$iSubscribed)); - if(!$iUserId) return Spot::getResult(false, 'lang:error.commit_db'); + if(!$iUserId) return Livetrail::getResult(false, 'lang:error.commit_db'); $this->asUserInfo['subscribed'] = $iSubscribed; - return Spot::getResult(true, $iSubscribed?'lang:account.subscribed':'lang:account.unsubscribed'); + return Livetrail::getResult(true, $iSubscribed?'lang:account.subscribed':'lang:account.unsubscribed'); } } @@ -200,7 +200,7 @@ class User extends PhpObject { $this->setTokenCookie(); } - return Spot::getResult($bSuccess, $sDesc); + return Livetrail::getResult($bSuccess, $sDesc); } public function logout() { @@ -208,7 +208,7 @@ class User extends PhpObject { $this->clearSession(); $this->clearCookie(); $this->setUserId(0); - return Spot::getResult(true, 'lang:account.logged_out'); + return Livetrail::getResult(true, 'lang:account.logged_out'); } public function updateNickname($sNickname) { @@ -239,7 +239,7 @@ class User extends PhpObject { } } - return Spot::getResult($bSuccess, $sDesc); + return Livetrail::getResult($bSuccess, $sDesc); } /* Session */ diff --git a/public/index.php b/public/index.php index ee19e4b..2d76853 100644 --- a/public/index.php +++ b/public/index.php @@ -2,6 +2,6 @@ require __DIR__.'/../vendor/autoload.php'; -use Franzz\Spot\Controller; +use Franzz\Livetrail\Controller; echo (new Controller())->handle(__FILE__, $argv ?? array()); diff --git a/readme.md b/readme.md index dcb9577..3630cc9 100644 --- a/readme.md +++ b/readme.md @@ -43,13 +43,13 @@ Runtime data is exposed through symlinks only: `public/files -> ../files` and `p `npm run dev` watches and builds development assets into `public/assets/`. `npm run prod` builds hashed production assets into `public/assets/`. PHP reads `public/.vite/manifest.json` and populates the CSS, module, and preload parts defined in `resources/masks/index.html` while rendering the request. -When developing Spot and the sibling `objects` library together, install dependencies through the local Composer manifest: +When developing Livetrail and the sibling `objects` library together, install dependencies through the local Composer manifest: ```bash COMPOSER=composer.dev.json composer update ``` -This makes Composer link `vendor/franzz/objects` to `../objects` and autoload that namespace directly from the local source path. Production continues to use `composer.json`, which installs `franzz/objects` from its Git repository. Commit and publish `objects` changes before updating/deploying a Spot version that relies on them. +This makes Composer link `vendor/franzz/objects` to `../objects` and autoload that namespace directly from the local source path. Production continues to use `composer.json`, which installs `franzz/objects` from its Git repository. Commit and publish `objects` changes before updating/deploying a Livetrail version that relies on them. ## To Do List diff --git a/resources/lang/en.json b/resources/lang/en.json index 9ad8dc0..c87e600 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -73,7 +73,7 @@ "feed": { "counter": "#$0", "id": "Feed ID", - "last_update": "Last Spot update", + "last_update": "Last SPOT update", "name": "Name", "new": "New feed", "plural": "Feeds", diff --git a/resources/lang/es.json b/resources/lang/es.json index 9f1b83f..eb55ce3 100644 --- a/resources/lang/es.json +++ b/resources/lang/es.json @@ -73,7 +73,7 @@ "feed": { "counter": "N.º $0", "id": "ID Feed", - "last_update": "Última actualización de Spot", + "last_update": "Última actualización de SPOT", "name": "Descripción", "new": "Nuevo feed", "plural": "Feeds", diff --git a/resources/lang/fr.json b/resources/lang/fr.json index 5f556f2..7079754 100644 --- a/resources/lang/fr.json +++ b/resources/lang/fr.json @@ -73,7 +73,7 @@ "feed": { "counter": "N°$0", "id": "ID feed", - "last_update": "Dernière vérification Spot", + "last_update": "Dernière vérification de SPOT", "name": "Description", "new": "Nouveau feed", "plural": "Feeds", diff --git a/src/App.vue b/src/App.vue index 0ea722c..85b1bba 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,11 +1,11 @@