feat(cloudron): add tirreno package artifacts

- Add CloudronStack/output/CloudronPackages-Artifacts/tirreno/ directory and its contents
- Includes package manifest, Dockerfile, source code, documentation, and build artifacts
- Add tirreno-1761840148.tar.gz as a build artifact
- Add tirreno-cloudron-package-1761841304.tar.gz as the Cloudron package
- Include all necessary files for the tirreno Cloudron package

This adds the complete tirreno Cloudron package artifacts to the repository.
This commit is contained in:
2025-10-30 11:43:06 -05:00
parent 0ce353ea9d
commit 91d52d2de5
1692 changed files with 202851 additions and 0 deletions

View File

@@ -0,0 +1,108 @@
<?php
/**
* Tirreno ~ Open source user analytics
* Copyright (c) Tirreno Technologies Sàrl (https://www.tirreno.com)
*
* Licensed under GNU Affero General Public License version 3 of the or any later version.
* For full copyright and license information, please see the LICENSE
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Tirreno Technologies Sàrl (https://www.tirreno.com)
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
* @link https://www.tirreno.com Tirreno(tm)
*/
namespace Controllers\Admin\ManualCheck;
class Data extends \Controllers\Base {
use \Traits\ApiKeys;
public function proceedPostRequest(array $params): array {
return $this->performSearch($params);
}
public function performSearch(array $params): array {
$pageParams = [
'SEARCH_VALUES' => $params,
];
$apiKey = $this->getCurrentOperatorApiKeyId();
$enrichmentKey = $this->getCurrentOperatorEnrichmentKeyString();
$errorCode = $this->validateSearch($params, $enrichmentKey);
if ($errorCode) {
$pageParams['ERROR_CODE'] = $errorCode;
return $pageParams;
}
$type = $params['type'];
$controller = new \Controllers\Admin\Enrichment\Data();
$result = $controller->enrichEntity($type, $params['search'], null, $apiKey, $enrichmentKey);
if (isset($result['ERROR_CODE'])) {
$pageParams['ERROR_CODE'] = $result['ERROR_CODE'];
return $pageParams;
}
$this->saveSearch($params);
// TODO: return alert_list back in next release
if (array_key_exists('alert_list', $result[$type])) {
unset($result[$type]['alert_list']);
}
if ($type === 'phone') {
unset($result[$type]['valid']);
unset($result[$type]['validation_error']);
}
if ($type === 'email') {
unset($result[$type]['data_breaches']);
}
$pageParams['RESULT'] = [$type => $result[$type]];
return $pageParams;
}
private function validateSearch(array $params, string $enrichmentKey): bool|int {
$errorCode = \Utils\Access::CSRFTokenValid($params, $this->f3);
if ($errorCode) {
return $errorCode;
}
$api = \Utils\Variables::getEnrichtmentApi();
if (!$enrichmentKey || !$api) {
return \Utils\ErrorCodes::ENRICHMENT_API_KEY_DOES_NOT_EXIST;
}
$type = $params['type'] ?? null;
$types = $this->f3->get('AdminManualCheck_form_types');
if (!$type || !array_key_exists($type, $types)) {
return \Utils\ErrorCodes::TYPE_DOES_NOT_EXIST;
}
$search = $params['search'] ?? null;
if (!$search || strlen($search) < 1) {
return \Utils\ErrorCodes::SEARCH_QUERY_DOES_NOT_EXIST;
}
return false;
}
private function saveSearch(array $params): void {
$history = new \Models\ManualCheckHistoryQuery();
$history->add($params);
}
public function getSearchHistory(int $operatorId): ?array {
$model = new \Models\ManualCheckHistory();
return $model->getRecentByOperator($operatorId);
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* Tirreno ~ Open source user analytics
* Copyright (c) Tirreno Technologies Sàrl (https://www.tirreno.com)
*
* Licensed under GNU Affero General Public License version 3 of the or any later version.
* For full copyright and license information, please see the LICENSE
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Tirreno Technologies Sàrl (https://www.tirreno.com)
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
* @link https://www.tirreno.com Tirreno(tm)
*/
namespace Controllers\Admin\ManualCheck;
class Navigation extends \Controllers\Base {
use \Traits\ApiKeys;
use \Traits\Navigation;
public function showIndexPage(): void {
$this->redirectIfUnlogged();
$pageController = new Page();
$this->response = new \Views\Frontend();
$this->response->data = $pageController->getPageParams();
}
}

View File

@@ -0,0 +1,60 @@
<?php
/**
* Tirreno ~ Open source user analytics
* Copyright (c) Tirreno Technologies Sàrl (https://www.tirreno.com)
*
* Licensed under GNU Affero General Public License version 3 of the or any later version.
* For full copyright and license information, please see the LICENSE
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Tirreno Technologies Sàrl (https://www.tirreno.com)
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
* @link https://www.tirreno.com Tirreno(tm)
*/
namespace Controllers\Admin\ManualCheck;
class Page extends \Controllers\Pages\Base {
public $page = 'AdminManualCheck';
public function getPageParams(): array {
$dataController = new Data();
$pageParams = [
'LOAD_AUTOCOMPLETE' => true,
'LOAD_DATATABLE' => true,
'HTML_FILE' => 'admin/manualCheck.html',
'JS' => 'admin_manual_check.js',
];
$currentOperator = $this->f3->get('CURRENT_USER');
$operatorId = $currentOperator->id;
if ($this->isPostRequest()) {
$params = $this->f3->get('POST');
$params['operator'] = $operatorId;
$operationResponse = $dataController->proceedPostRequest($params);
$pageParams = array_merge($pageParams, $operationResponse);
}
$pageParams['HISTORY'] = $dataController->getSearchHistory($operatorId);
return parent::applyPageParams($pageParams);
}
public static function stylizeKey(string $key): string {
$f3 = \Base::instance();
$overwrites = $f3->get('AdminManualCheck_key_overwrites');
if (array_key_exists($key, $overwrites)) {
return $overwrites[$key];
}
if ($key === 'profiles' || $key === 'data_breach') {
$key = sprintf('no_%s', $key);
}
return ucfirst(str_replace('_', ' ', $key));
}
}