More rename work

This commit is contained in:
jokob-sk
2024-04-08 07:57:36 +10:00
parent 8c023e4cb5
commit cacc52cd27
10 changed files with 20 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
# 🖼 Frontend development
This page contains tips for frontend development when extending PiAlert. Guiding principles are:
This page contains tips for frontend development when extending NetAlertX. Guiding principles are:
1. Maintainability
2. Extendability

View File

@@ -52,7 +52,7 @@ The adapter will probably be `eth0` or `eth1`. (Check `System info` > `Network H
> Community sourced content by [mscreations](https://github.com/mscreations) from this [discussion](https://github.com/jokob-sk/NetAlertX/discussions/404).
> [!NOTE]
> The setup this was tested on: Bare Metal -> Hyper-V on Win Server 2019 -> Ubuntu 22.04 VM -> Docker -> PiAlert.
> The setup this was tested on: Bare Metal -> Hyper-V on Win Server 2019 -> Ubuntu 22.04 VM -> Docker -> NetAlertX.
**Approach 1 (may cause issues):**
@@ -91,8 +91,8 @@ network:
via: 192.168.1.1
```
3) Run `sudo netplan apply` and the interfaces are then available to scan in PiAlert.
4) In this case, use `192.168.2.0/24 --interface=eth0.2` in PiAlert
3) Run `sudo netplan apply` and the interfaces are then available to scan in NetAlertX.
4) In this case, use `192.168.2.0/24 --interface=eth0.2` in NetAlertX
#### VLAN 🔍Example:

View File

@@ -1,6 +1,6 @@
## Am I running the latest released version?
Since version 23.01.14 PiAlert uses a simple timestamp-based version check to verify if a new version is available. You can check the [current and past releases here](https://github.com/jokob-sk/NetAlertX/releases), or have a look at what I'm [currently working on](https://github.com/jokob-sk/NetAlertX/issues/138).
Since version 23.01.14 NetAlertX uses a simple timestamp-based version check to verify if a new version is available. You can check the [current and past releases here](https://github.com/jokob-sk/NetAlertX/releases), or have a look at what I'm [currently working on](https://github.com/jokob-sk/NetAlertX/issues/138).
If you are not on the latest version, the app will notify you, that a new released version is avialable the following way:

View File

@@ -5,7 +5,7 @@
require dirname(__FILE__).'/php/server/init.php';
require 'php/templates/security.php';
$CookieSaveLoginName = 'NetAlertX_SaveLogin';
if ($Pia_WebProtection != 'true')
{
@@ -17,7 +17,7 @@ if ($Pia_WebProtection != 'true')
// Logout
if (isset ($_GET["action"]) && $_GET["action"] == 'logout')
{
setcookie("PiAlert_SaveLogin", '', time()+1); // reset cookie
setcookie($CookieSaveLoginName, '', time()+1); // reset cookie
$_SESSION["login"] = 0;
header('Location: index.php');
exit;
@@ -28,15 +28,15 @@ if (isset ($_POST["loginpassword"]) && $Pia_Password == hash('sha256',$_POST["lo
{
header('Location: devices.php');
$_SESSION["login"] = 1;
if (isset($_POST['PWRemember'])) {setcookie("PiAlert_SaveLogin", hash('sha256',$_POST["loginpassword"]), time()+604800);}
if (isset($_POST['PWRemember'])) {setcookie($CookieSaveLoginName, hash('sha256',$_POST["loginpassword"]), time()+604800);}
}
// active Session or valid cookie (cookie not extends)
if (( isset ($_SESSION["login"]) && ($_SESSION["login"] == 1)) || (isset ($_COOKIE["PiAlert_SaveLogin"]) && $Pia_Password == $_COOKIE["PiAlert_SaveLogin"]))
if (( isset ($_SESSION["login"]) && ($_SESSION["login"] == 1)) || (isset ($_COOKIE[$CookieSaveLoginName]) && $Pia_Password == $_COOKIE[$CookieSaveLoginName]))
{
header('Location: devices.php');
$_SESSION["login"] = 1;
if (isset($_POST['PWRemember'])) {setcookie("PiAlert_SaveLogin", hash('sha256',$_POST["loginpassword"]), time()+604800);}
if (isset($_POST['PWRemember'])) {setcookie($CookieSaveLoginName, hash('sha256',$_POST["loginpassword"]), time()+604800);}
}
$login_headline = lang('Login_Toggle_Info_headline');

View File

@@ -18,7 +18,7 @@
<!-- &copy; 2022 jokob-sk -->
<span style="display:inline-block; transform: rotate(180deg)">&copy;</span>
2020 Puche (2022+ <a href="mailto:jokob@duck.com?subject=PiAlert">jokob-sk</a>) | <b><?= lang('Maintenance_built_on');?>: </b>
2020 Puche (2022+ <a href="mailto:jokob@duck.com?subject=NetAlertX">jokob-sk</a>) | <b><?= lang('Maintenance_built_on');?>: </b>
<?php include 'php/templates/build.php'; ?> | <b> Version: </b> <?php include 'php/templates/version.php'; ?> |
<a href="https://github.com/jokob-sk/NetAlertX/tree/main/docs" target="_blank"><span>Docs <i class="fa fa-circle-question"></i></a>
<span>

View File

@@ -221,7 +221,7 @@
"Device_Title": "Devices",
"Donations_Others": "Others",
"Donations_Platforms": "Sponsor platforms",
"Donations_Text": "Hey \ud83d\udc4b! </br> Thanks for clicking on this menu item \ud83d\ude05 </br> </br> I'm trying to collect some donations to make you better software. Also, it would help me not to get burned out, so I can support this app longer. Any small (recurring or not) sponsorship makes me want to put more effort into this app. </br> I'd love to shorten my work week and in the remaining time fully focus on PiAlert. You'd get more functionality, a more polished app and less bugs. </br> </br> Thanks for reading - I'm grateful for any support \u2764\ud83d\ude4f </br> </br> TL;DR: By supporting me you get: </br> </br> <ul><li>Regular updates to keep your data and family safe \ud83d\udd04</li><li>Less bugs \ud83d\udc1b\ud83d\udd2b</li><li>Better and more functionality\u2795</li><li>I don't get burned out \ud83d\udd25\ud83e\udd2f</li><li>Less rushed releases \ud83d\udca8</li><li>Better docs\ud83d\udcda</li><li>Quicker and better support with issues \ud83c\udd98</li></ul> </br> \ud83d\udce7Email me to <a href='mailto:jokob@duck.com?subject=PiAlert'>jokob@duck.com</a> if you want to get in touch or if I should add other sponsorship platforms. </br>",
"Donations_Text": "Hey \ud83d\udc4b! </br> Thanks for clicking on this menu item \ud83d\ude05 </br> </br> I'm trying to collect some donations to make you better software. Also, it would help me not to get burned out, so I can support this app longer. Any small (recurring or not) sponsorship makes me want to put more effort into this app. </br> I'd love to shorten my work week and in the remaining time fully focus on NetAlertX. You'd get more functionality, a more polished app and less bugs. </br> </br> Thanks for reading - I'm grateful for any support \u2764\ud83d\ude4f </br> </br> TL;DR: By supporting me you get: </br> </br> <ul><li>Regular updates to keep your data and family safe \ud83d\udd04</li><li>Less bugs \ud83d\udc1b\ud83d\udd2b</li><li>Better and more functionality\u2795</li><li>I don't get burned out \ud83d\udd25\ud83e\udd2f</li><li>Less rushed releases \ud83d\udca8</li><li>Better docs\ud83d\udcda</li><li>Quicker and better support with issues \ud83c\udd98</li></ul> </br> \ud83d\udce7Email me to <a href='mailto:jokob@duck.com?subject=NetAlertX'>jokob@duck.com</a> if you want to get in touch or if I should add other sponsorship platforms. </br>",
"Donations_Title": "Donations",
"ENABLE_PLUGINS_description": "Enables the <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins\">plugins</a> functionality. Loading plugins requires more hardware resources so you might want to disable them on low-powered system.",
"ENABLE_PLUGINS_name": "Enable Plugins",

View File

@@ -3,6 +3,8 @@
$url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$isLogonPage = FALSE;
$CookieSaveLoginName = "NetAlertX_SaveLogin";
if (strpos($url,'index.php') !== false) {
$isLogonPage = TRUE;
@@ -14,7 +16,7 @@ if(array_search('action', $_REQUEST) != FALSE)
{
if ($_REQUEST['action'] == 'logout') {
session_destroy();
setcookie("PiAlert_SaveLogin", "", time() - 3600);
setcookie($CookieSaveLoginName, "", time() - 3600);
header('Location: index.php');
}
}
@@ -24,6 +26,7 @@ if(array_search('action', $_REQUEST) != FALSE)
// ##################################################
$config_file = "../config/pialert.conf";
$config_file_lines = file($config_file);
$CookieSaveLoginName = "NetAlertX_SaveLogin";
// ###################################
// ## PIALERT_WEB_PROTECTION FALSE
@@ -49,7 +52,7 @@ if($Pia_WebProtection == 'true')
$_SESSION["login"] = 0;
}
if ( ($_SESSION["login"] == 1) || $isLogonPage || (( isset($_COOKIE["PiAlert_SaveLogin"]) && $Pia_Password == $_COOKIE["PiAlert_SaveLogin"])))
if ( ($_SESSION["login"] == 1) || $isLogonPage || (( isset($_COOKIE[$CookieSaveLoginName]) && $Pia_Password == $_COOKIE[$CookieSaveLoginName ])))
{
//Logged in or stay on this page if we are on the index.php already

View File

@@ -267,7 +267,7 @@
"description": [
{
"language_code": "en_us",
"string" : "Enable sending notifications via <a target=\"_blank\" href=\"https://www.home-assistant.io/integrations/mqtt/\">MQTT</a> to your Home Assistance instance. Usually, <code>on_notification</code> is recommended. See the <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/HOME_ASSISTANT.md\">PiAlert Home Assistant guide</a> for details."
"string" : "Enable sending notifications via <a target=\"_blank\" href=\"https://www.home-assistant.io/integrations/mqtt/\">MQTT</a> to your Home Assistance instance. Usually, <code>on_notification</code> is recommended. See the <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/HOME_ASSISTANT.md\">NetAlertX Home Assistant guide</a> for details."
},
{
"language_code": "es_es",

View File

@@ -4,7 +4,7 @@ A plugin for importing devices from an SNMP enabled router or switch. Using SNM
### Usage
Specify the following settings in the Settings section of PiAlert:
Specify the following settings in the Settings section of NetAlertX:
- `SNMPDSC_routers` - A list of `snmpwalk` commands to execute against IP addresses of roputers/switches with SNMP turned on. For example:

View File

@@ -4,7 +4,7 @@ A plugin allowing for importing devices from a UniFi controller.
### Usage
Specify the following settings in the Settings section of PiAlert:
Specify the following settings in the Settings section of NetAlertX:
- `UNFIMP_username` - Username used to login into the UNIFI controller.
- `UNFIMP_password` - Password used to login into the UNIFI controller.