The EuroCMS Routes Manager
| author | version | date |
|---|---|---|
| Imri Paloja | draft | 06-09-2022 |
As of writing this still needs to be renamed to the Routes manager in the actual code.
Routes manager for EuroCMS.
With Routes Manager you can register a REQUEST_URI, IP protect the content, select which content to load from other objects in the current domain.
For example: files, modules, pages(articles,blogposts, etc...). You can register the /api url, and have the API module handle the requests of that URL, and also IP protect the URL.
You can also create routes, like robots.txt, humans.txt, sitemap.xml. These have a builtin generator.
You can make custom db queries for when someone accesses a specific url. For example, when someone accesses /modules, you can make it query the modules dir, and have it output it in a json format. Figure out how to code this.
DB table structure
| route_id | domain_id | user_id | group_id | request | table | table_name | table_id | ip_deny | ip_allow | pword | user_lock | status |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | /tutorials/how-to-eurocms | pages | page_id | 34 | null | null | {BCRYPT} | 1 | enabled |
| 2 | 1 | 1 | /api | modules | module_id | 54 | all | 127.0.0.2 | null | 3,5 | enabled | |
| 3 | 1 | 1 | /file/file.png | files | file_id | 5 | null | null | null | null | enabled | |
| 4 | 1 | 1 | /robots.txt | object | object_id | 50 | null | null | null | null | enabled | |
| 5 | 1 | 1 | /hackers.txt | object | object_id | 52 | null | null | null | null | enabled | |
| 6 | 1 | 1 | /sitemap.xml | object | object_id | 55 | null | null | null | null | enabled | |
| 7 | 1 | 1 | /Files/FileUpload | ajax | ajax_id | 2 | 127.0.0.1 | 127.0.0.2 | null | null | enabled | |
| 8 | 1 | 1 | /modules.json | files | file_id | 100 | null | null | null | null | disabled | |
| 9 | 1 | 1 | 1 | /api/users ??? contemplate on the whole row | api | api_id | 54 | all | 127.0.0.1,127.0.0.2 | {BCRYPT} | null | enabled |
Permissions
| name | description | ||
|---|---|---|---|
| route_add | The ability to add routes | ||
| route_delete | The ability to delete routes | ||
| route_modify | The ability to modify existing routes | ||
| route_ip | The ability to IP protect a routes | ||
| route_ajax | The ability to add AJAX routes | ||
| route_object | The ability to add auto generated files from variables(robots.txt/sitemap.xml/contribute.json) |
Objects
You can add an object as a content. That is a special file, either hard pasted or auto generated from databases. Here are some examples:
robots.txt
https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers
https://developers.google.com/search/docs/advanced/crawling/verifying-googlebot
https://developers.google.com/search/apis/ipranges/googlebot.json
sitemap.xml
When you create an object file, you can hard paste your content, or generate them from variables. When auto generated, you have to build the structure on how you can add things.
For, instance, you can create the below constant, herein you can add "variables". The location can be the $path variable, the lastmod, can be the $modify_date, so when you modify a page content, and someone queries the sitemap.xml, the modified date will de displayed here.
Those are existing variables that you can query for this file. What about none existing variables, such as changefreq and priority? Well you can create variables , and set where those variables need to be displayed.
When you click Create variables "" you can select the name, the type of input required, and also which other module needs this setting. Example:
| name | input type | input values | short_description | long_description |
|---|---|---|---|---|
| priority | number | The priority of this URL relative to other URLs on your site. Valid values range from 0.0 to 1.0. This value does not affect how your pages are compared to pages on other sites—it only lets the search engines know which pages you deem most important for the crawlers. | The default priority of a page is 0.5. Please note that the priority you assign to a page is not likely to influence the position of your URLs in a search engine's result pages. Search engines may use this information when selecting between URLs on the same site, so you can use this tag to increase the likelihood that your most important pages are present in a search index. Also, please note that assigning a high priority to all of the URLs on your site is not likely to help you. Since the priority is relative, it is only used to select between URLs on your site. | |
| lastmod | date | The date of last modification of the page. This date should be in W3C Datetime format. This format allows you to omit the time portion, if desired, and use YYYY-MM-DD. | Note that the date must be set to the date the linked page was last modified, not when the sitemap is generated. Note also that this tag is separate from the If-Modified-Since (304) header the server can return, and search engines may use the information from both sources differently. | |
| changefreq | select | always,hourly,daily,weekly,monthly,yearly,never | How frequently the page is likely to change. This value provides general information to search engines and may not correlate exactly to how often they crawl the page |
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2005-01-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
from https://sitemaps.org/protocol.html
security.txt
Example:
Contact: mailto:security@eurobytes.eu
Expires: 2022-07-30T19:00:00.000Z
Encryption: https://eurobytes.eu/.pgp
Acknowledgments: https://eurobytes.eu/hall-of-fame
Preferred-Languages: en
Canonical: https://eurobytes.eu/.well-known/security.txt
Policy: https://eurobytes.eu/security-policy
Hiring: https://eurobytes.eu/vacancies
humanstxt.org
/* TEAM */
Chef:
Contact: hello [at] humanstxt.org
Twitter: @{handle}
From: {City, state, Country}
/* THANKS */
EN Translator: {name}
Twitter: @{handle}
From: {City, state, Country}
/* SITE */
Last update: YYYY/MM/DD
Language: English / Dutch / German
Doctype: HTML5
IDE: Phpstorm, THE GIMP, draw.io, Firefox (Developer Edition)
RSS Feed
You can create your XML structure, and fill it with your variables:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>https://www.w3schools.com</link>
<description>Free web building tutorials</description>
<item>
<title>RSS Tutorial</title>
<link>https://www.w3schools.com/xml/xml_rss.asp</link>
<description>New RSS tutorial on W3Schools</description>
</item>
<item>
<title>XML Tutorial</title>
<link>https://www.w3schools.com/xml</link>
<description>New XML tutorial on W3Schools</description>
</item>
</channel>
</rss>
https://schemas.liquid-technologies.com/w3c/rss/2.0.1.9/?page=rss-2_0_1-rev9_xsd.html