2020-12-02 20:48:03 +00:00
/ * *
* Route Mappings
* ( sails . config . routes )
*
* Your routes tell Sails what to do each time it receives a request .
*
* For more information on configuring custom routes , check out :
* https : //sailsjs.com/anatomy/config/routes-js
* /
module . exports . routes = {
// ╦ ╦╔═╗╔╗ ╔═╗╔═╗╔═╗╔═╗╔═╗
// ║║║║╣ ╠╩╗╠═╝╠═╣║ ╦║╣ ╚═╗
// ╚╩╝╚═╝╚═╝╩ ╩ ╩╚═╝╚═╝╚═╝
2021-09-16 07:23:59 +00:00
'GET /' : {
action : 'view-homepage-or-redirect' ,
locals : { isHomepage : true }
} ,
2020-12-02 20:48:03 +00:00
2021-09-16 07:23:59 +00:00
'GET /company/contact' : {
action : 'view-contact' ,
locals : {
title : 'Contact us | Fleet for osquery' ,
description : 'Get in touch with our team.'
}
} ,
2021-05-28 22:51:47 +00:00
2021-09-16 07:23:59 +00:00
'GET /get-started' : {
action : 'view-get-started' ,
locals : {
title : 'Get Started | Fleet for osquery' ,
description : 'Learn about getting started with Fleet.'
}
} ,
2021-07-09 05:58:40 +00:00
2021-09-16 07:23:59 +00:00
'GET /pricing' : {
action : 'view-pricing' ,
locals : {
title : 'Pricing | Fleet for osquery' ,
description : 'View Fleet plans and pricing details.'
}
} ,
'GET /press-kit' : {
action : 'view-press-kit' ,
locals : {
title : 'Press kit | Fleet for osquery' ,
description : 'Download Fleet logos, wallpapers, and screenshots.'
}
} ,
'GET /queries' : {
action : 'view-query-library' ,
locals : {
title : 'Queries | Fleet for osquery' ,
description : 'A growing collection of useful queries for organizations deploying Fleet and osquery.'
}
} ,
'GET /queries/:slug' : {
action : 'view-query-detail' ,
locals : {
title : 'Query details | Fleet for osquery' ,
description : 'View more information about a query in Fleet\'s standard query library' ,
}
} ,
'GET /docs/?*' : {
skipAssets : false ,
action : 'docs/view-basic-documentation' ,
locals : {
title : 'Documentation | Fleet for osquery' ,
description : 'Documentation for Fleet for osquery.' ,
}
} , // handles /docs and /docs/foo/bar
// 'GET /handbook/?*': { skipAssets: false, action: 'handbook/view-basic-handbook' },// handles /handbook and /handbook/foo/bar
'GET /transparency' : {
action : 'view-transparency' ,
locals : {
title : 'Transparency | Fleet for osquery' ,
description : 'Learn what data osquery can see.' ,
}
} ,
2020-12-02 20:48:03 +00:00
2021-08-28 01:27:32 +00:00
Put live documentation on fleetdm.com (#1380)
* minor clarifications
* further expand comments and stubs
* absorb custom titles embedded in metadata, plus further comment expansion and a followup fix for something i left hanging in f8cbc14829d91e7577c63307fd9c4346dbc229bb
* Skip non-markdown files and use real path maths
* Prep for running in parallel (Remove `continue` so this isn't dependent on the `for` loop)
* determine + track unique HTML output paths
* Compile markdown + spit out real HTML (without involving any but the crunchy nougaty dependency from the very center of everything)
* add md metadata parsing
* add timestamp
* Update build-static-content.js
* attach misc metadata as "other"
* how doc images might should work (this also aligns with how the select few images in the sailsjs.com docs work)
* add file extension to generated HTML files
* "options"=>"meta"
* Make "htmlId" useful for alphabetically sorting pages within their bottom-level section
See recent comments on https://github.com/fleetdm/fleet/issues/706 for more information.
* list out the most important, specific build-time transformations
* Omit ordering prefixes like "1-" from expected content page URLs
* add a little zone for consolidating backwards compatible permalinks
* interpret README.md files by mapping their URLs to match their containing folder
* clarify plan for images
* decrease probability of collisions
* Make capitalization smarter using known acronyms, proper nouns, and a smarter numeric word trim
* Resolve app path in case pwd is different in prod
* Delete HTML output from previous runs, if any
* condense the stuff about github emojis
* got rid of "permalink" thing, since id gets automatically attached during markdown compilation anyway
Also "permalink" isn't even a good name for what this is. See https://github.com/fleetdm/fleet/issues/706#issuecomment-884693931
* …and that eliminates the need for the cheerio dep!
* Bring in bubbles+syntax highlighting into build script, and remove sails.helpers.compileMarkdownContent() -- this leaves link munging as a todo though
* trivial (condense comments)
* Remove unused code from toHtml() helper
* Implemented target="_blank" and root-relative-ification
* remove todo about emojis after testing and verifying it works just fine
* trivial: add link to comment in case github emojis matter at some point
* consolidate "what ifs" in comments
* Leave this up to Sarah, for now. (Either bring it back here in the build script or do it all on the frontend)
* Enable /docs and /handbook routes, and add example of a redirect for a legacy/deprecated URL
* implement routing
* Upgrade deps
this takes advantages of the latest work from @eashaw, @rachaelshaw, and the rest of the Sails community
* tweak var names and comments
* make readme pages use their folder names to determine their default (fallback) titles
as discussed in https://github.com/fleetdm/fleet/issues/706#issuecomment-884788002
* first (good enough for now) pass at link rewriting
as discussed in https://github.com/fleetdm/fleet/issues/706#issuecomment-884742072
* Adapt docs pages to build from markdown output
* Continue work on docs pages
* Add landing page
* Remove unused code; minor changes
* Replace regex
* fixes https://github.com/fleetdm/fleet/pull/1380#issuecomment-891429581
* Don't rely on "path" being a global var
* Syle fleetdm doc pages
* Continue work on docs pages
* Fix linting error
* Disable lesshint style warnings
* parasails-has-no-page-script attribute
Added a parasails-has-no-page-script attribute to the docs template, added a check for that attribute in parasails.js and removed the empty page script for 498
* bring in latest parasails dep
* trivial
* Update links to dedupe and not open in new tab unless actually external
* Disable handbook for now til styles are ready
* fix CTA links
* trivial
* make sitemap.xml get served in prod
* hide search boxes for now, remove hard-coded version and make releases open in new tab
* clean out unused files
Co-authored-by: gillespi314 <73313222+gillespi314@users.noreply.github.com>
Co-authored-by: eashaw <caglc@live.com>
2021-08-18 00:55:13 +00:00
// ╦ ╔═╗╔═╗╔═╗╔═╗╦ ╦ ╦═╗╔═╗╔╦╗╦╦═╗╔═╗╔═╗╔╦╗╔═╗
// ║ ║╣ ║ ╦╠═╣║ ╚╦╝ ╠╦╝║╣ ║║║╠╦╝║╣ ║ ║ ╚═╗
// ╩═╝╚═╝╚═╝╩ ╩╚═╝ ╩ ╩╚═╚═╝═╩╝╩╩╚═╚═╝╚═╝ ╩ ╚═╝
// ┌─ ┌─┐┌─┐┬─┐ ┌┐ ┌─┐┌─┐┬┌─┬ ┬┌─┐┬─┐┌┬┐┌─┐ ┌─┐┌─┐┌┬┐┌─┐┌─┐┌┬┐ ─┐
// │ ├┤ │ │├┬┘ ├┴┐├─┤│ ├┴┐│││├─┤├┬┘ ││└─┐ │ │ ││││├─┘├─┤ │ │
// └─ └ └─┘┴└─ └─┘┴ ┴└─┘┴ ┴└┴┘┴ ┴┴└──┴┘└─┘ └─┘└─┘┴ ┴┴ ┴ ┴ ┴o ─┘
2021-08-28 01:27:32 +00:00
// Add redirects here for deprecated/legacy links, so that they go to an appropriate new place instead of just being broken when pages move or get renamed.
//
// For example:
// If we were going to change fleetdm.com/company/about to fleetdm.com/company/story, we might do something like:
// ```
// 'GET /company/about': '/company/story',
// ```
//
// Or another example, if we were to rename a doc page:
// ```
// 'GET /docs/using-fleet/learn-how-to-use-fleet': '/docs/using-fleet/fleet-for-beginners',
// ```
'GET /try-fleet' : '/get-started' ,
2020-12-02 20:48:03 +00:00
// ╔╦╗╦╔═╗╔═╗ ╦═╗╔═╗╔╦╗╦╦═╗╔═╗╔═╗╔╦╗╔═╗ ┬ ╔╦╗╔═╗╦ ╦╔╗╔╦ ╔═╗╔═╗╔╦╗╔═╗
// ║║║║╚═╗║ ╠╦╝║╣ ║║║╠╦╝║╣ ║ ║ ╚═╗ ┌┼─ ║║║ ║║║║║║║║ ║ ║╠═╣ ║║╚═╗
// ╩ ╩╩╚═╝╚═╝ ╩╚═╚═╝═╩╝╩╩╚═╚═╝╚═╝ ╩ ╚═╝ └┘ ═╩╝╚═╝╚╩╝╝╚╝╩═╝╚═╝╩ ╩═╩╝╚═╝
2021-05-06 02:27:58 +00:00
// Convenience
2021-08-28 01:27:32 +00:00
// =============================================================================================================
// Things that people are used to typing in to the URL and just randomly trying.
//
// For example, a clever user might try to visit fleetdm.com/documentation, not knowing that Fleet's website
// puts this kind of thing under /docs, NOT /documentation. These "convenience" redirects are to help them out.
'GET /documentation' : '/docs' ,
'GET /contribute' : '/docs/contribute' ,
'GET /install' : '/get-started' ,
'GET /company' : '/company/about' ,
'GET /company/about' : '/handbook' , // FUTURE: brief "about" page explaining the origins of the company
'GET /support' : '/company/contact' ,
'GET /contact' : '/company/contact' ,
'GET /legal' : '/legal/terms' ,
'GET /terms' : '/legal/terms' ,
2021-07-09 05:58:40 +00:00
// Sitemap
2021-08-28 01:27:32 +00:00
// =============================================================================================================
// This is for search engines, not humans. Search engines know to visit fleetdm.com/sitemap.xml to download this
// XML file, which helps search engines know which pages are available on the website.
2021-07-09 05:58:40 +00:00
'GET /sitemap.xml' : { action : 'download-sitemap' } ,
2021-08-28 01:27:32 +00:00
// Potential future pages
// =============================================================================================================
// Things that are not webpages here (in the Sails app) yet, but could be in the future. For now they are just
// redirects to somewhere else EXTERNAL to the Sails app.
'GET /security' : 'https://github.com/fleetdm/fleet/security/policy' ,
'GET /brand' : '/contact' , // FUTURE: a page like sailsjs.com/logos
'GET /blog' : 'https://blog.fleetdm.com' , // Currently, Fleet's blog lives outside of this website source code (the Sails app). We always link to fleetdm.com/blog, but since the blog lives elsewhere, we redirect to it.
'GET /hall-of-fame' : 'https://github.com/fleetdm/fleet/pulse' ,
'GET /apply' : 'https://fleet-device-management.breezy.hr' ,
'GET /handbook' : 'https://github.com/fleetdm/fleet/tree/main/handbook' , // TODO: Bring back the above when styles are ready
'GET /company/stewardship' : 'https://github.com/fleetdm/fleet' , // FUTURE: page about how we approach open source and our commitments to the community
'GET /legal/terms' : 'https://docs.google.com/document/d/1OM6YDVIs7bP8wg6iA3VG13X086r64tWDqBSRudG4a0Y/edit' ,
2020-12-02 20:48:03 +00:00
2021-05-26 08:24:38 +00:00
2020-12-02 20:48:03 +00:00
// ╦ ╦╔═╗╔╗ ╦ ╦╔═╗╔═╗╦╔═╔═╗
// ║║║║╣ ╠╩╗╠═╣║ ║║ ║╠╩╗╚═╗
// ╚╩╝╚═╝╚═╝╩ ╩╚═╝╚═╝╩ ╩╚═╝
2021-08-06 07:52:02 +00:00
'POST /api/v1/webhooks/receive-usage-analytics' : { action : 'webhooks/receive-usage-analytics' , csrf : false } ,
'/api/v1/webhooks/github' : { action : 'webhooks/receive-from-github' , csrf : false } ,
2020-12-02 20:48:03 +00:00
// ╔═╗╔═╗╦ ╔═╗╔╗╔╔╦╗╔═╗╔═╗╦╔╗╔╔╦╗╔═╗
// ╠═╣╠═╝║ ║╣ ║║║ ║║╠═╝║ ║║║║║ ║ ╚═╗
// ╩ ╩╩ ╩ ╚═╝╝╚╝═╩╝╩ ╚═╝╩╝╚╝ ╩ ╚═╝
// Note that, in this app, these API endpoints may be accessed using the `Cloud.*()` methods
// from the Parasails library, or by using those method names as the `action` in <ajax-form>.
2021-05-06 18:46:52 +00:00
'POST /api/v1/deliver-contact-form-message' : { action : 'deliver-contact-form-message' } ,
2020-12-02 20:48:03 +00:00
} ;