Commit 8fbe3dfe authored by Eric - kg6wxc's avatar Eric - kg6wxc
Browse files

Changed to use default ini and other user editable files.

There is no longer a user-files.tar.gz file!

The user must remove the "-default" from the file extension, save the
file and then make their own changes. I have seen many other programs
use this and it seems to make sense.
The README has been updated to reflect this change.
Other ideas are appreciated still! :)

With the exception of user-settings.ini, the code will check for the
existance of the non "-default" files and use those instead of the
default ones.
Also if the user does not create a user-settings.ini file of their own
an error will be thrown telling them such.

Fixed the Popup for "total number of link" in the attributon bar.

Some new values were added to the meshmap.css file in order to make it
easier for the user to make customizations to the page if they want.
More of these will probably be added in the future.
parent 011a7ef3
custom.inc
**/custom.inc
**/user-settings.ini
**/cronscript.sh
**/meshmap-settings.ini
**/meshmap.css
**/admin.css
<!-- KG6WXC MeshMap README.md file -->
<!-- April 2018 -->
<!-- May 2018 -->
<p><img src="https://mapping.kg6wxc.net/meshmap/images/MESHMAP_LOGO.svg" style="float:left; vertical-align: middle;"/><h1 style="float: left; vertical-align: middle;">MeshMap</h1><br/>
......@@ -43,9 +43,9 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail.
</ul>
<blockquote style="background: #d3d3d3;">In theory, this <em>should</em> run on a Windows system as well.<br/>
<blockquote style="background: #d3d3d3; margin-right: 30%;">In theory, this <em>should</em> run on a Windows system as well.<br/>
It does not require anything specific to Linux (<em>Perhaps with the exception of the cron task</em>).<br/>
There is no reason that it could not be adapted to run from a Windows scheduled task though.<br/>
There is no reason that part could not be adapted to run from a Windows scheduled task though.<br/>
PHP is PHP after all.</blockquote>
......@@ -65,7 +65,7 @@ It also takes <em>100&rsquo;s of GB of HD space</em> if you want to map the enti
A good place to start for more info is: <a href="https://switch2osm.org/serving-tiles/">https://switch2osm.org/serving-tiles/</a><br/>
If you attempt it, be patient, you <em>will</em> get it wrong more than a few times but in the end you might be surprised. :)</p>
<blockquote style="background: #d3d3d3;">Another option is that some programs, Xastir in particular, will save the map tiles they use.<br/>
<blockquote style="background: #66cc66; margin-right: 30%;">Tip: Another option is that some programs, Xastir in particular, will save the map tiles they use.<br/>
You *can* use those tiles as well, but they must be made to be accessible by your webserver.</blockquote>
......@@ -74,10 +74,11 @@ You *can* use those tiles as well, but they must be made to be accessible by you
<p>You <em>might</em> be able to convince KG6WXC to create local map tiles for you, if the area you want is in the USA, he does not have the available SSD space for the entire world&hellip; yet.<br/>
If you do ask, be prepared, it literally takes KG6WXC&rsquo;s system about 3-4 days just to render the tiles for a smallish area and it&rsquo;s kind of a PITA!</p>
<blockquote style="background: #d3d3d3;">As an example, KG6WXC once made tiles for the Mesa Az. mesh group.<br/>
<blockquote style="background: #d3d3d3; margin-right: 30%">As an example, KG6WXC once made tiles for the Mesa Az. mesh group.<br/>
It was a smallish area around Phoenix Az, out to a zoom of about 8 or something.<br/>
It ended up at around 3GB of map tiles and took about 4 days of total run time to render on the server...<br/>
<em>and</em> it had to restart a few times too, due to running out of 8GB of RAM and having to tweak a few things along the way... so it actually took longer than that.<br/>
<em>and</em> it had to restart a few times too, due to running out of 8GB of RAM and having to tweak a few things along the way...<br/>
It actually took much longer than the 4 days of actual run time.<br/>
Building/Using a map tile server is not for the faint of heart!</blockquote>
......@@ -99,27 +100,24 @@ Here is an example of creating a mySQL user and granting access to the node_map
<code>CREATE USER 'mesh-map'@'localhost' IDENTIFIED BY 'password';</code><br/>
<code>GRANT SELECT, DELETE, DROP, INSERT, TRIGGER, UPDATE on node_map.* TO 'mesh-map'@'localhost';</code><br/>
<code>FLUSH PRIVLEGES;</code></p></blockquote></li>
<li><p><strong>4: Decompress user-files.tar.gz</strong><br/>
<em>Example</em>: <code>tar -zxvf user-files.tar.gz</code><br/>
This will decompress the files for the settings.<br/>
They are distributed in compressed format so that <em>your</em> files do not get overwritten when the rest of the scripts get updated.<br/>
(If anyone has a better idea for how to keep the user edited files updated and &ldquo;away&rdquo; from the git repo,<br/>
yet still in the same directory and allow for not changing the users edits, it&rsquo;d be great to hear about it)</p>
<li><p><strong>4: Copy scripts/user-settings.ini-default to /scripts/user-settings.ini and edit the user-settings.ini file</strong></p>
<ul>
<li>The file scripts/user-settings.ini is probably the most important.<br/>
<li>The file scripts/user-settings.ini is the most important to get right.<br/>
It is <strong>very important</strong> to make sure your SQL username and password are correct in scripts/user-settings.ini!!</li>
<li>Also important is, if the system that this is running on cannot resolve &ldquo;localnode.local.mesh&rdquo; you can change that in the user-settings.ini file.</li>
<li>Once you save to the user-settings.ini file any changes you make will not be overwritten by future updates.<br/>
The &ldquo;-default&rdquo; files <em>will probably</em> change though and you will need to update your personal files when this happens.</li>
<li>There are many other things you can change in the ini files. Default Map center position, the header messages, etc.</li>
<li><em>Please read</em> the comments in the user-settings.ini file for more info about the different settings.</li>
<li>There is also a &ldquo;custom.inc&rdquo; PHP file that can be used for more site specific overrides if needed.</li>
<li>There is also a &ldquo;custom.inc-default&rdquo; PHP file that can be used for more site specific overrides if needed.<br/>
Read that file for info on what it does, it can safely be ignored by most users.</li>
</ul>
</li>
</ul>
<blockquote style="background: #FFFF99;">The way the user editable files are distrubuted will change in the near future, for now use this method.<br/>
I will <em>always</em> strive to not overwrite your site changes when I make updates to certain files.</blockquote>
<blockquote style="background: #B00000; margin-right: 45%;"><strong>The way the user editable files are distrubuted has changed!.</strong><br/></blockquote>
<p></p>
......@@ -128,26 +126,26 @@ I will <em>always</em> strive to not overwrite your site changes when I make upd
<li><strong>4.5: To make sure it is all working at this point is probably a good idea.</strong><br/>
You should now be able to run get-map-info.php from the scripts directory.<br/>
I would suggest giving it a test run or two first.<br/>
Node polling can take lots of time, espessialy on a large network. Be Patient! :)<br/>
Node polling can take lots of time, especially on a large network. Be Patient! :)<br/>
Enter the meshmap/scripts directory.<br/>
<blockquote style="background: #66CC66;">Tip: if you get a &ldquo;command not found&rdquo; error, you may need to run it like this:<br/> <code>./get-map-info.php &lt;option&gt;</code> </blockquote>
<blockquote style="background: #66CC66; margin-right: 35%;">Tip: if you get a &ldquo;command not found&rdquo; error, you may need to run it like this:<br/> <code>./get-map-info.php &lt;option&gt;</code> </blockquote>
These are options you can send to get-map-info.php:
<blockquote><p><code>--test-mode-no-sql</code><br/>
Output to console only, <em>do not</em> read/write to the database.<br/>
<blockquote style="background: #FFFF99;">This will make sure the scripts can reach your localnode and the rest of the network.<br/>
<blockquote style="background: #FFFF99; margin-right: 30%">This will make sure the scripts can reach your localnode and the rest of the network.<br/>
This will <strong>not</strong> update the database, you won&rsquo;t see anything on the map page yet, it only outputs to the terminal for testing.</blockquote>
<code>--test-mode-with-sql</code><br/>
Output to console <em>and</em> read/write to the database.<br/>
<blockquote style="background: #FFFF99;">This will ensure everything is setup correctly and get some data into your database!</blockquote>
<blockquote style="background: #66CC66;">Tip: <em><strong>Do not</strong></em> ctrl-C out of the script while it is using the database!<br/>
<blockquote style="background: #FFFF99; margin-right: 40%;">This will ensure everything is setup correctly and get some data into your database!</blockquote>
<blockquote style="background: #66CC66; margin-right: 30%;">Tip: <em><strong>Do not</strong></em> ctrl-C out of the script while it is using the database!<br/>
Let it finish, even if it seems hung up.<br/>
You should recieve some error if something is <em>actually</em> wrong.<br/>
Using ctrl-C to stop the script midway will cause problems in the database, <em>do not</em> do it!</blockquote></p></blockquote></li>
</ul>
<blockquote style="background: #d3d3d3;">If the --test-mode-no-sql is successful, you can go ahead and run the script with --test-mode-with-sql or just without any options.<br/>
<blockquote style="background: #d3d3d3; margin-right: 30%;">If the --test-mode-no-sql is successful, you can go ahead and run the script with --test-mode-with-sql or just without any options.<br/>
Run the script without options and there is no on screen output (this is for cron).</blockquote>
......@@ -158,7 +156,7 @@ Run the script without options and there is no on screen output (this is for cro
Once the file is copied, you need to edit it and make sure the <code>&lt;Alias&gt;</code> and <code>&lt;Directory&gt;</code> directives have the correct paths.<br/>
After you have made sure the file is correct then run: <code>sudo a2enconf httpd-meshmap</code><br/>
This is will load the config into Apache and if successful, it will tell you to reload apache, do so.<br/>
<blockquote style="background: #d3d3d3;"><em>Other linux distibutions may require you to copy this file into /etc/httpd/extra<br/>
<blockquote style="background: #d3d3d3; margin-right: 30%;"><em>Other linux distibutions may require you to copy this file into /etc/httpd/extra<br/>
and then edit /etc/httpd/httpd.conf and add the line:</em> <code>Include extra/httpd-meshmap.conf</code> <em>somewhere.</em></blockquote></p></li>
<li><p><strong>6: Load up the page: http://myhostname/meshmap/index.php and you should hopefully see your data.</strong><br/>
You may or may not see any map tiles, depending on if the system you are using to view the page has access to the internet or not.<br/>
......@@ -169,7 +167,7 @@ Copy the cronscript.sh file out of the meshmap directory and place it in the hom
Then, you <strong>must</strong> edit the cronscript.sh file and make sure the path it uses to get to the scripts directory is correct!<br/>
After that, create a cron entry with <code>crontab -e</code><br/>
A cron entry is as easy as this: <code>* * * * * /home/pi/cronscript.sh</code><br/>
<blockquote style="background: #d3d3d3;">You <em>can</em> safely run the script every minute in cron like this.<br/>
<blockquote style="background: #d3d3d3; margin-right: 30%;">You <em>can</em> safely run the script every minute in cron like this.<br/>
It won&rsquo;t actually do anything unless the intervals specified in the ini file have expired.</blockquote></p></li>
</ul>
......@@ -185,7 +183,7 @@ For now tho, if the ini files change, and you still have the old ones in use, th
Hopefully in the future this process can be more automated.</p>
<p>If you make changes beyond the user editable files I encourage you to perhaps push the changes upstream, please contact kg6wxc@gmail.com if you wish to do so.<br/>
<blockquote style="background: #d3d3d3;">I am making changes all the time, it would be a good idea to run &ldquo;git pull&rdquo; from time to time to find any updates.</blockquote></p>
<blockquote style="background: #d3d3d3; margin-right: 30%;">I am making changes all the time, it would be a good idea to run &ldquo;git pull&rdquo; from time to time to find any updates.</blockquote></p>
<h2>Notes on usage of the map pages</h2>
......@@ -206,12 +204,12 @@ The admin pages also allow for the addition of &ldquo;Non Mesh&rdquo; Markers, f
<p>(In no particular order)<br/>
- [x] Add new MeshMap Logo.<br/>
- [ ] Change the user editable files to be distributed with &ldquo;-default&rdquo; added to the extension, no more tar.gz file.<br/>
- [x] Change the user editable files to be distributed with &ldquo;-default&rdquo; added to the extension, no more tar.gz file.<br/>
- [ ] Use a cookie instead of _POST for the internet check (No more stupid dialog box on refresh).<br/>
- [ ] Make &ldquo;Parallel Threads&rdquo; work again in get-map-info script, with limits on how many can be run at once (this will greatly speed up network polling).<br/>
- [ ] Changes so sbarc.org can have the new version too!<br/>
- [ ] Change css file for the &ldquo;?&rdquo; slide-out menu.<br/>
- [ ] Fix a typo in the attribution bar so the pop-up for the links is only for the links number.<br/>
- [x] Fix a typo in the attribution bar so the pop-up for the links is only for the links number.<br/>
- [ ] Implement N2MH&rsquo;s &ldquo;Link aging&rdquo; idea(s).<br/>
- [ ] The &ldquo;Planning&rdquo; Tab.<br/>
- [ ] Make it so other networks can export their data for use on a &ldquo;Mega Map&rdquo; type page. :)</p>
......@@ -224,4 +222,4 @@ The admin pages also allow for the addition of &ldquo;Non Mesh&rdquo; Markers, f
I can&rsquo;t think of <em>everything</em>!<br/>
If you find an improvement, typo, or whatever, please, send an email to kg6wxc@gmail.com and we can get you setup with write access if you&rsquo;d like!</p>
<p>This README file last updated: april 2018</p>
<p>This README file last updated: May 2018</p>
<!-- KG6WXC MeshMap README.md file -->
<!-- April 2018 -->
<!-- May 2018 -->
<img src="https://mapping.kg6wxc.net/meshmap/images/MESHMAP_LOGO.svg" style="float:left; vertical-align: middle;"/><h1 style="float: left; vertical-align: middle;">MeshMap</h1>
<br/>
<br/>
......@@ -34,9 +34,9 @@ Donations / Beer accepted! :) (paypal possibly coming soon, email: kg6wxc@gmail.
- **Familiarity with Linux/Apache/SQL**
(You don't need to be a pro, but this should not be your first trip to a command line)
<blockquote style="background: #d3d3d3;">In theory, this <em>should</em> run on a Windows system as well.<br/>
<blockquote style="background: #d3d3d3; margin-right: 30%;">In theory, this <em>should</em> run on a Windows system as well.<br/>
It does not require anything specific to Linux (<em>Perhaps with the exception of the cron task</em>).<br/>
There is no reason that it could not be adapted to run from a Windows scheduled task though.<br/>
There is no reason that part could not be adapted to run from a Windows scheduled task though.<br/>
PHP is PHP after all.</blockquote>
### Map Tile Server info
......@@ -52,15 +52,16 @@ It also takes *100's of GB of HD space* if you want to map the entire world, and
A good place to start for more info is: [https://switch2osm.org/serving-tiles/](https://switch2osm.org/serving-tiles/)
If you attempt it, be patient, you *will* get it wrong more than a few times but in the end you might be surprised. :)
<blockquote style="background: #d3d3d3;">Another option is that some programs, Xastir in particular, will save the map tiles they use.<br/>
<blockquote style="background: #66cc66; margin-right: 30%;">Tip: Another option is that some programs, Xastir in particular, will save the map tiles they use.<br/>
You *can* use those tiles as well, but they must be made to be accessible by your webserver.</blockquote>
You *might* be able to convince KG6WXC to create local map tiles for you, if the area you want is in the USA, he does not have the available SSD space for the entire world... yet.
If you do ask, be prepared, it literally takes KG6WXC's system about 3-4 days just to render the tiles for a smallish area and it's kind of a PITA!
<blockquote style="background: #d3d3d3;">As an example, KG6WXC once made tiles for the Mesa Az. mesh group.<br/>
<blockquote style="background: #d3d3d3; margin-right: 30%">As an example, KG6WXC once made tiles for the Mesa Az. mesh group.<br/>
It was a smallish area around Phoenix Az, out to a zoom of about 8 or something.<br/>
It ended up at around 3GB of map tiles and took about 4 days of total run time to render on the server...<br/>
<em>and</em> it had to restart a few times too, due to running out of 8GB of RAM and having to tweak a few things along the way... so it actually took longer than that.<br/>
<em>and</em> it had to restart a few times too, due to running out of 8GB of RAM and having to tweak a few things along the way...<br/>
It actually took much longer than the 4 days of actual run time.<br/>
Building/Using a map tile server is not for the faint of heart!</blockquote>
## Initial setup for a freshly installed Raspbian 9 (Stretch) system
......@@ -80,47 +81,44 @@ Here is an example of creating a mySQL user and granting access to the node_map
> `GRANT SELECT, DELETE, DROP, INSERT, TRIGGER, UPDATE on node_map.* TO 'mesh-map'@'localhost';`
> `FLUSH PRIVLEGES;`
- **4: Decompress user-files.tar.gz**
*Example*: `tar -zxvf user-files.tar.gz`
This will decompress the files for the settings.
They are distributed in compressed format so that *your* files do not get overwritten when the rest of the scripts get updated.
(If anyone has a better idea for how to keep the user edited files updated and "away" from the git repo,
yet still in the same directory and allow for not changing the users edits, it'd be great to hear about it)
* The file scripts/user-settings.ini is probably the most important.
- **4: Copy scripts/user-settings.ini-default to /scripts/user-settings.ini and edit the user-settings.ini file**
* The file scripts/user-settings.ini is the most important to get right.
It is **very important** to make sure your SQL username and password are correct in scripts/user-settings.ini!!
* Also important is, if the system that this is running on cannot resolve "localnode.local.mesh" you can change that in the user-settings.ini file.
* Once you save to the user-settings.ini file any changes you make will not be overwritten by future updates.
The "-default" files *will probably* change though and you will need to update your personal files when this happens.
* There are many other things you can change in the ini files. Default Map center position, the header messages, etc.
* *Please read* the comments in the user-settings.ini file for more info about the different settings.
* There is also a "custom.inc" PHP file that can be used for more site specific overrides if needed.
<blockquote style="background: #FFFF99;">The way the user editable files are distrubuted will change in the near future, for now use this method.<br/>
I will <em>always</em> strive to not overwrite your site changes when I make updates to certain files.</blockquote>
* There is also a "custom.inc-default" PHP file that can be used for more site specific overrides if needed.
Read that file for info on what it does, it can safely be ignored by most users.
<blockquote style="background: #B00000; margin-right: 45%;"><strong>The way the user editable files are distrubuted has changed!.</strong><br/></blockquote>
- **4.5: To make sure it is all working at this point is probably a good idea.**
You should now be able to run get-map-info.php from the scripts directory.
I would suggest giving it a test run or two first.
Node polling can take lots of time, espessialy on a large network. Be Patient! :)
Node polling can take lots of time, especially on a large network. Be Patient! :)
Enter the meshmap/scripts directory.
<blockquote style="background: #66CC66;">Tip: if you get a "command not found" error, you may need to run it like this:<br/> `./get-map-info.php <option>` </blockquote>
<blockquote style="background: #66CC66; margin-right: 35%;">Tip: if you get a "command not found" error, you may need to run it like this:<br/> `./get-map-info.php <option>` </blockquote>
These are options you can send to get-map-info.php:
> `--test-mode-no-sql`
Output to console only, *do not* read/write to the database.
<blockquote style="background: #FFFF99;">This will make sure the scripts can reach your localnode and the rest of the network.
<blockquote style="background: #FFFF99; margin-right: 30%">This will make sure the scripts can reach your localnode and the rest of the network.
This will **not** update the database, you won't see anything on the map page yet, it only outputs to the terminal for testing.</blockquote>
> `--test-mode-with-sql`
Output to console *and* read/write to the database.
<blockquote style="background: #FFFF99;">This will ensure everything is setup correctly and get some data into your database!</blockquote>
<blockquote style="background: #66CC66;">Tip: <em><strong>Do not</strong></em> ctrl-C out of the script while it is using the database!<br/>
<blockquote style="background: #FFFF99; margin-right: 40%;">This will ensure everything is setup correctly and get some data into your database!</blockquote>
<blockquote style="background: #66CC66; margin-right: 30%;">Tip: <em><strong>Do not</strong></em> ctrl-C out of the script while it is using the database!<br/>
Let it finish, even if it seems hung up.<br/>
You should recieve some error if something is <em>actually</em> wrong.<br/>
Using ctrl-C to stop the script midway will cause problems in the database, <em>do not</em> do it!</blockquote>
<blockquote style="background: #d3d3d3;">If the --test-mode-no-sql is successful, you can go ahead and run the script with --test-mode-with-sql or just without any options.<br/>
<blockquote style="background: #d3d3d3; margin-right: 30%;">If the --test-mode-no-sql is successful, you can go ahead and run the script with --test-mode-with-sql or just without any options.<br/>
Run the script without options and there is no on screen output (this is for cron).</blockquote>
- **5: Copy httpd-meshmap.conf to the apache2 "Conf Available" directory**, `/etc/apache2/conf-available`
Once the file is copied, you need to edit it and make sure the `<Alias>` and `<Directory>` directives have the correct paths.
After you have made sure the file is correct then run: `sudo a2enconf httpd-meshmap`
This is will load the config into Apache and if successful, it will tell you to reload apache, do so.
<blockquote style="background: #d3d3d3;"><em>Other linux distibutions may require you to copy this file into /etc/httpd/extra<br/>
<blockquote style="background: #d3d3d3; margin-right: 30%;"><em>Other linux distibutions may require you to copy this file into /etc/httpd/extra<br/>
and then edit /etc/httpd/httpd.conf and add the line:</em> `Include extra/httpd-meshmap.conf` <em>somewhere.</em></blockquote>
- **6: Load up the page: http://myhostname/meshmap/index.php and you should hopefully see your data.**
......@@ -133,7 +131,7 @@ Copy the cronscript.sh file out of the meshmap directory and place it in the hom
Then, you **must** edit the cronscript.sh file and make sure the path it uses to get to the scripts directory is correct!
After that, create a cron entry with `crontab -e`
A cron entry is as easy as this: `* * * * * /home/pi/cronscript.sh`
<blockquote style="background: #d3d3d3;">You *can* safely run the script every minute in cron like this.<br/>
<blockquote style="background: #d3d3d3; margin-right: 30%;">You <em>can</em> safely run the script every minute in cron like this.<br/>
It won't actually do anything unless the intervals specified in the ini file have expired.</blockquote>
## Updating the scripts
......@@ -145,7 +143,7 @@ For now tho, if the ini files change, and you still have the old ones in use, th
Hopefully in the future this process can be more automated.
If you make changes beyond the user editable files I encourage you to perhaps push the changes upstream, please contact kg6wxc@gmail.com if you wish to do so.
<blockquote style="background: #d3d3d3;">I am making changes all the time, it would be a good idea to run "git pull" from time to time to find any updates.</blockquote>
<blockquote style="background: #d3d3d3; margin-right: 30%;">I am making changes all the time, it would be a good idea to run "git pull" from time to time to find any updates.</blockquote>
## Notes on usage of the map pages
----------
......@@ -162,12 +160,12 @@ The admin pages also allow for the addition of "Non Mesh" Markers, fire stations
----------
(In no particular order)
- [x] Add new MeshMap Logo.
- [ ] Change the user editable files to be distributed with "-default" added to the extension, no more tar.gz file.
- [x] Change the user editable files to be distributed with "-default" added to the extension, no more tar.gz file.
- [ ] Use a cookie instead of _POST for the internet check (No more stupid dialog box on refresh).
- [ ] Make "Parallel Threads" work again in get-map-info script, with limits on how many can be run at once (this will greatly speed up network polling).
- [ ] Changes so sbarc.org can have the new version too!
- [ ] Change css file for the "?" slide-out menu.
- [ ] Fix a typo in the attribution bar so the pop-up for the links is only for the links number.
- [x] Fix a typo in the attribution bar so the pop-up for the links is only for the links number.
- [ ] Implement N2MH's "Link aging" idea(s).
- [ ] The "Planning" Tab.
- [ ] Make it so other networks can export their data for use on a "Mega Map" type page. :)
......@@ -178,4 +176,4 @@ The admin pages also allow for the addition of "Non Mesh" Markers, fire stations
I can't think of *everything*!
If you find an improvement, typo, or whatever, please, send an email to kg6wxc@gmail.com and we can get you setup with write access if you'd like!
This README file last updated: april 2018
This README file last updated: May 2018
<?php
//This file is provided for more advanced users
//or for site specific "fixes" provided by kg6wxc
//to enable this file copy it to "custom.inc" and edit it.
//
//you can override some things with this file...
//sql passwords, user settings, etc.
//
//There are even some "hidden" options you might find if you read the code.
//one of those is:
//If you want to hide the "Admin" link in the upper right above the map
//uncomment the below line...
//$GLOBALS['hide_admin'] = "1";
?>
......@@ -63,10 +63,23 @@ $mtimeStart = microtime(true);
* along with The Mesh Mapping System. If not, see <http://www.gnu.org/licenses/>.
******/
//Increase PHP memory limit to 128M (you may need more if you are connected to a "Mega Mesh" :) )
ini_set('memory_limit', '128M');
/***********************************************************************
*DO NOT CHANGE ANYTHING BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING!!!!
************************************************************************/
$INCLUDE_DIR = "..";
//our user-settings file. (ALWAYS REQUIRED!, change path if you moved it!)
$USER_SETTINGS = parse_ini_file($INCLUDE_DIR . "/scripts/user-settings.ini");
//check for users user-settings.ini file and use it if it exists
//use the default one if it does not
global $USER_SETTINGS;
if (file_exists("$INCLUDE_DIR . /scripts/user-settings.ini")) {
$USER_SETTINGS = parse_ini_file($INCLUDE_DIR . "/scripts/user-settings.ini");
}else {
echo "\n\nYou **must** copy the user-settings.ini-default file to user-settings.ini and edit it!!\n\n";
//$USER_SETTINGS = parse_ini_file($INCLUDE_DIR . "/scripts/user-settings.ini-default");
}
//kg6wxc's functions. (ALWAYS REQUIRED!, change path if you moved it!)
require $INCLUDE_DIR . "/scripts/wxc_functions.inc";
......@@ -75,13 +88,6 @@ require $INCLUDE_DIR . "/scripts/wxc_functions.inc";
//the "@" just suppresses any errors if the file is not found, the file is optional
@include $INCLUDE_DIR . "/custom.inc";
//Increase PHP memory limit to 128M (you may need more if you are connected to a "Mega Mesh" :) )
ini_set('memory_limit', '128M');
/***********************************************************************
*DO NOT CHANGE ANYTHING BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING!!!!
************************************************************************/
$script_arg = "";
if (isset($argv[1])) {
$script_arg = $argv[1];
......
......@@ -6,7 +6,8 @@
* @subcategory Display Map routines
* @package Active Node List
* @author Eric Satterlee, KG6WXC with K6GSE
* @copyright Copyright (c) 2017 as Open Source
* @copyright Copyright (c) 2018 as Open Source
* @license GPLv3 or later
* @version $Id$
* @abstract Eric has written a tool called get-map-info which retrieves HAM Mesh network devices,
* their configuration and Linkage information. These details are populated in several SQL tables.
......@@ -1046,7 +1047,7 @@ function show_MapMarkerDetails($numNodes, $numLinks, $numMarkers, $numNodesTotal
$numNodesTotal . " Total nodes in the database." . '\n' . "Nodes without Location info cannot be shown.\">" .
$numNodes . "</a> Nodes shown, with <a style=\"color: inherit;text-decoration: none;\" href=\"\" title=\"" .
$numLinksTotal . " Total links in the database." . '\n' . "Nodes without Location info cannot have links shown.\">" .
$numLinks . " links " . "&nbsp;|&nbsp;Data Last Acquired @ " . $filetime . "</strong>';\n";
$numLinks . "</a> links " . "&nbsp;|&nbsp;Data Last Acquired @ " . $filetime . "</strong>';\n";
$Content .= "WXCAttribution = 'Map originally created by <a href=mailto:kg6wxc@gmail.com>KG6WXC</a> Oct 2016&nbsp;with N2MH and K6GSE contributions&nbsp;|&nbsp;';\n";
......
......@@ -107,13 +107,14 @@ inetTileServer['Terrain-Default'] = "//stamen-tiles-{s}.a.ssl.fastly.net/terrain
;;The Title of the web page, web page logo and the text above the map.
;--------------------------------------------------------------
pageTitle = "Mesh Map"
pageLogo = ""
pageLogo = "images/MESHMAP_LOGO.svg"
logoHeaderText = "Mesh Map"
;;Welcome to the Mesh Map Message
;uncomment and edit the "otherTopOfMapMsg" below if you want to add other text above the map
;--------------------------------------------------------------
welcomeMessage = "Welcome to the Mesh Map"
otherTopOfMapMsg = ""
;otherTopOfMapMsg = ""
;;Custom message if you are on the Mesh Server
;--------------------------------------------------------------
......@@ -124,8 +125,9 @@ meshServerText = "You are connected to the Mesh Network and running on device: %
inetServerText = "Your are connected to the internet and are running on device: %s"
;;Custom Mesh Warning message
;uncomment and edit to enable
;--------------------------------------------------------------
meshWarning = ""
;meshWarning = ""
;;Node expiration intervals
;after how many *days* do nodes get removed when we have not heard from them?
......
<?php
/********************************************************
* KG6WXC's Custom Functions for the MESH mapping system
* With many many thanks to N2MH and K6GSE for helping
* find bugs and make many good improvements over what I had before!
* @author Eric Satterlee, KG6WXC with K6GSE
* @copyright Copyright (c) 2018 as Open Source
* @license GPLv3 or later
*******************************************************/
/******
......
......@@ -30,8 +30,11 @@ if (!$sql_connection) {
<head>
<title>MeshMap Admin Page</title>
<link rel='stylesheet' href='admin.css'>
if (file_exists("./admin.css") {
<link rel='stylesheet' href='admin.css'>
}else {
<link rel='stylesheet' href='admin.css-default'>
}
<!-- extra javascripts and css needed -->
<script src='../javascripts/jquery-3.2.1.js'></script>
<!-- <script type="text/javascript" src="../javascripts/jquery.dataTables.min.js"></script> -->
......
/*** background color of the overall page ***/
body {
background-color: #dddddd;
}
/*** This will change the size of the top left corner logo ***/
#pageLogo {
width: 50px;
vertical-align: middle;
}
/*** This will change the size of the map "container" ***/
#meshmap {
width: 1200px;
height: 700px;
}
/*** this is the size of the map itself ***/
#mapid {
width: 100%;
height: 95%;
}
h1 {
color: navy;
margin-left: 20px;
......
......@@ -4,6 +4,7 @@
* @category Mesh
* @author Eric Satterlee, KG6WXC with Glen, K6GSE and Mark, N2MH
* @version $Id$
* @copyright Copyright (c) 2018 as Open Source
* @license GPLv3 or later
* @abstract Eric has written a tool called get-map-info which retrieves HAM Mesh network devices,
* their configuration and Linkage information. These details are populated in several SQL tables.
......@@ -117,13 +118,34 @@
* -----------------
*/
//Increase PHP memory limit to 128M (you may need more if you are connected to a "Mega Mesh" :) )
ini_set('memory_limit', '128M');
/******
* You should not need to change much below here
******/
$INCLUDE_DIR = "..";
$USER_SETTINGS = parse_ini_file($INCLUDE_DIR . "/scripts/user-settings.ini");
//check for users user-settings.ini file and use it if it exists
//use the default one if it does not
global $USER_SETTINGS;
if (file_exists("$INCLUDE_DIR . /scripts/user-settings.ini")) {
$USER_SETTINGS = parse_ini_file($INCLUDE_DIR . "/scripts/user-settings.ini");
}else {
echo "You <strong><em>must</em></strong> copy the user-settings.ini-default file to user-settings.ini and edit it!\n";
//$USER_SETTINGS = parse_ini_file($INCLUDE_DIR . "/scripts/user-settings.ini-default");
}
global $MESH_SETTINGS;
$MESH_SETTINGS = parse_ini_file($INCLUDE_DIR . "/scripts/meshmap-settings.ini");
//check for users user-settings.ini file and use it if it exists
//use the default one if it does not
if (file_exists("$INCLUDE_DIR . /scripts/meshmap-settings.ini")) {
$MESH_SETTINGS = parse_ini_file($INCLUDE_DIR . "/scripts/meshmap-settings.ini");
}else {
$MESH_SETTINGS = parse_ini_file($INCLUDE_DIR . "/scripts/meshmap-settings.ini-default");
}
//Increase PHP memory limit to 128M (you may need more if you are connected to a "Mega Mesh" :) )
ini_set('memory_limit', '128M');
require $INCLUDE_DIR . "/scripts/wxc_functions.inc";
require $INCLUDE_DIR . "/scripts/map_functions.inc";
......@@ -139,8 +161,8 @@ date_default_timezone_set($USER_SETTINGS['localTimeZone']);
global $inetAccess;
global $mesh;
if (isset($_GET['inetAccess']) || isset($_POST['inetAccess'])) {
$inetAccess = $_GET['inetAccess'] || $_POST['inetAccess'];
if (isset($_POST['inetAccess'])) {
$inetAccess = $_POST['inetAccess'];
if ($inetAccess == "1") {
$mesh = "0";
}elseif ($inetAccess == "0") {
......@@ -252,12 +274,20 @@ EOD;
echo $page_header . "\n";
echo "<title>" . $USER_SETTINGS['pageTitle'] . "</title>\n";
/*
* check for the users meshmap.css file and use it if it exists...
* if not, use the "-default" file (meshmap.css-default)
*/
if (file_exists ("./css/meshmap.css")) {
echo "<link href='css/meshmap.css' rel='stylesheet'>\n";
}else {
echo "<link href='css/meshmap.css-default' rel='stylesheet'>\n";
}
/*
* If the client has internet access load everything from there
* if not, use the local resources.
*/
echo "<link href='css/meshmap.css' rel='stylesheet'>\n";
if (!$mesh) {
echo "<link rel='stylesheet' href='//unpkg.com/leaflet@1.3.1/dist/leaflet.css'>\n";
echo "<script src='//unpkg.com/leaflet@1.3.1/dist/leaflet.js'></script>\n";
......@@ -307,8 +337,8 @@ echo "<body>\n";
//)
if (isset($USER_SETTINGS['map_iFrame_Enabled']) && ($USER_SETTINGS['map_iFrame_Enabled']))
{
echo "<div id='meshmap' style='width: 740px; height: 500px;'>\n"; // Closing tag at end of primary routine
echo "<div id='mapid' style='width: 100%; height: 95%;'>\n";
echo "<div id='meshmap'>\n"; // Closing tag at end of primary routine
echo "<div id='mapid'>\n";
echo "</div>\n";
}
else
......@@ -317,16 +347,18 @@ else
if (isset($USER_SETTINGS['pageLogo']))
{
echo "<MapTitle>";
echo "<img src='" . $USER_SETTINGS['pageLogo'] .
"' alt='Map or Club Logo' width='50' style='vertical-align: middle;'>";
// echo "<img id='logo' src='" . $USER_SETTINGS['pageLogo'] .
// "' alt='Map or Club Logo' width='50' style='vertical-align: middle;'>";
echo "<img id='pageLogo' src='" . $USER_SETTINGS['pageLogo'] .
"' alt='The Logo'>";
echo "</MapTitle>\n";
}
if (isset($USER_SETTINGS['logoHeaderText']))
{
echo "<MapTitle>";
echo $USER_SETTINGS['logoHeaderText'];
echo "<br>";
echo "</MapTitle>\n";
echo "<br>";
}
if (isset($USER_SETTINGS['welcomeMessage']))
{
......@@ -335,17 +367,19 @@ else
//echo "<br>";
echo "&nbsp;&nbsp;";
echo "</Welcome_MSG>\n";
}
if (isset($USER_SETTINGS['otherTopOfMapMsg'])) {
echo "<Welcome_MSG2>";
echo $USER_SETTINGS['otherTopOfMapMsg'];
echo "<br>";
echo "</Welcome_MSG2>\n";
echo "<br>";
}
if (isset($USER_SETTINGS['meshWarning']) && $mesh)
{
echo "<Warning_MSG>";
echo $USER_SETTINGS['meshWarning'];
echo "<br>";
echo "</Warning_MSG>";
echo "<br>";
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment