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,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 Models\Grid\Devices;
class Grid extends \Models\Grid\Base\Grid {
use \Traits\Enrichment\Devices;
public function __construct(int $apiKey) {
parent::__construct();
$this->apiKey = $apiKey;
$this->idsModel = new Ids($apiKey);
$this->query = new Query($apiKey);
}
public function getDevicesByIpId(int $ipId): array {
$params = [':ip_id' => $ipId];
return $this->getGrid($this->idsModel->getDevicesIdsByIpId(), $params);
}
public function getDevicesByUserId(int $userId): array {
$params = [':account_id' => $userId];
return $this->getGrid($this->idsModel->getDevicesIdsByUserId(), $params);
}
public function getDevicesByResourceId(int $resourceId): array {
$params = [':resource_id' => $resourceId];
return $this->getGrid($this->idsModel->getDevicesIdsByResourceId(), $params);
}
public function getAllDevices(): array {
return $this->getGrid();
}
protected function calculateCustomParams(array &$result): void {
$this->applyDeviceParams($result);
}
protected function convertTimeToUserTimezone(array &$result): void {
$fields = ['created'];
$this->translateTimeZones($result, $fields);
}
}

View File

@@ -0,0 +1,51 @@
<?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 Models\Grid\Devices;
class Ids extends \Models\Grid\Base\Ids {
public function getDevicesIdsByIpId(): string {
return (
'SELECT DISTINCT
event.device AS itemid
FROM event
WHERE
event.ip = :ip_id AND
event.key = :api_key'
);
}
public function getDevicesIdsByUserId(): string {
return (
'SELECT DISTINCT
event_device.id AS itemid
FROM event_device
WHERE
event_device.account_id = :account_id AND
event_device.key = :api_key'
);
}
public function getDevicesIdsByResourceId(): string {
return (
'SELECT DISTINCT
event.device AS itemid
FROM event
WHERE
event.url = :resource_id AND
event.key = :api_key'
);
}
}

View File

@@ -0,0 +1,83 @@
<?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 Models\Grid\Devices;
class Query extends \Models\Grid\Base\Query {
protected $defaultOrder = 'event_device.created DESC';
protected $dateRangeField = 'event_device.lastseen';
protected $allowedColumns = ['created', 'device', 'os_name', 'browser_name', 'lang', 'modified', 'id'];
public function getData(): array {
$queryParams = $this->getQueryParams();
$query = (
'SELECT
event_device.id,
event_device.lang,
event_device.created,
event_ua_parsed.device,
event_ua_parsed.browser_name,
event_ua_parsed.browser_version,
event_ua_parsed.os_name,
event_ua_parsed.os_version,
event_ua_parsed.ua,
event_ua_parsed.modified
FROM
event_device
LEFT JOIN event_ua_parsed
ON (event_device.user_agent = event_ua_parsed.id)
WHERE
event_device.key = :api_key
%s'
);
$this->applySearch($query, $queryParams);
$this->applyOrder($query);
$this->applyLimit($query, $queryParams);
return [$query, $queryParams];
}
public function getTotal(): array {
$queryParams = $this->getQueryParams();
$query = (
'SELECT
COUNT(DISTINCT event_device.id)
FROM
event_device
WHERE
event_device.key = :api_key
%s'
);
$this->applySearch($query, $queryParams);
return [$query, $queryParams];
}
private function applySearch(string &$query, array &$queryParams): void {
//$search = $this->f3->get('REQUEST.search');
$searchConditions = $this->injectIdQuery('event_device.id', $queryParams);
//Add ids into request
$query = sprintf($query, $searchConditions);
}
}