Nick Downing [Tue, 25 Jan 2022 07:08:07 +0000 (18:08 +1100)]
Remove unneeded dependencies
Nick Downing [Tue, 25 Jan 2022 06:55:38 +0000 (17:55 +1100)]
Change to ES6 classes
Nick Downing [Tue, 25 Jan 2022 06:45:01 +0000 (17:45 +1100)]
Change to fsPromises
Nick Downing [Tue, 25 Jan 2022 06:42:04 +0000 (17:42 +1100)]
Change to ES6 modules
Nick Downing [Wed, 12 Jan 2022 01:21:27 +0000 (12:21 +1100)]
Implement Sass CSS preprocessor
Nick Downing [Mon, 10 Jan 2022 05:02:30 +0000 (16:02 +1100)]
Let caller of Site.serve() override caching setting for the request
Nick Downing [Fri, 7 Jan 2022 05:58:01 +0000 (16:58 +1100)]
Change kick (and refresh config) interval to 1 second instead of 5 seconds
Nick Downing [Mon, 3 Jan 2022 03:59:05 +0000 (14:59 +1100)]
Change from pnpm to npm, add ./link.sh shortcut for npm style package linking
Nick Downing [Mon, 1 Nov 2021 00:38:22 +0000 (11:38 +1100)]
Start to make menu structure hierarchical via _menu.json files
Nick Downing [Sat, 4 Sep 2021 13:57:36 +0000 (09:57 -0400)]
Fix bug in nonexistent site message
Nick Downing [Sat, 4 Sep 2021 13:41:24 +0000 (23:41 +1000)]
Implement partial file transfers with response code 206, for video streaming
Nick Downing [Sat, 4 Sep 2021 13:01:36 +0000 (23:01 +1000)]
Fix a bug of missing let in ACME challenges, add URI decoding to serve filenames with %20 in them, make serve_fs() streaming and increase caching (for video)
Nick Downing [Sat, 4 Sep 2021 03:11:02 +0000 (23:11 -0400)]
Fix a bug in URL redirection so that ndcode.org (without www) works again
Nick Downing [Sat, 4 Sep 2021 02:17:09 +0000 (22:17 -0400)]
Deal with ACME challenges for certbot (letsencrypt)
Nick Downing [Wed, 12 Feb 2020 07:29:31 +0000 (18:29 +1100)]
Add ttf, woff and woff2 in default MIME types, fix serve_dir() to pass the pathname being served into the template, fix error message bit rot in serve_dir()
Nick Downing [Mon, 3 Feb 2020 15:57:52 +0000 (02:57 +1100)]
Change yarn to pnpm
Nick Downing [Sat, 19 Jan 2019 02:46:19 +0000 (13:46 +1100)]
Fix minor typos to get Olly's website working again
Nick Downing [Tue, 4 Dec 2018 11:50:04 +0000 (22:50 +1100)]
Rename Server.roots to Server.site_roots, make each site_root entry be stored in the Resources object and reference counted (instead of taken from prev_server)
Nick Downing [Tue, 4 Dec 2018 07:42:56 +0000 (18:42 +1100)]
Make Resources factory_func() and destroy_func() asynchronous, add some locking
Nick Downing [Tue, 4 Dec 2018 06:46:40 +0000 (17:46 +1100)]
New scheme to deal with listeners, there is a Listener object for each listener encapsulating the logic for stopping and starting that used to be in Server.refresh_config(), listeners are stored in Resources object with a reference count, Server.start()/stop()/kick() are called on configuration change/timer, which may or may not call each Listener.start()/stop() depending on the reference counts
Nick Downing [Tue, 4 Dec 2018 02:42:48 +0000 (13:42 +1100)]
Make _config/server.jst construct the Server object and pass options into it, rather than just returning the options to be used, make cli.js and _config/server.jst pass the previous server into the Server constructor to be able to determine what ports are already being listened to, make refresh_config() just a periodic call from outside that tries to align Server.listen with Server.options.listen
Nick Downing [Tue, 4 Dec 2018 02:10:39 +0000 (13:10 +1100)]
Allow to configure Server object by constructor arguments, will phase out the update_config() way
Nick Downing [Tue, 4 Dec 2018 02:03:43 +0000 (13:03 +1100)]
Remove mime type stuff from Server object, tidy up for consistency with Site object, fix host redirection bug
Nick Downing [Tue, 4 Dec 2018 01:56:08 +0000 (12:56 +1100)]
Make Site object independent of Server object, since it now uses Resources object to manage sharing of caches, change env.pathname to env.parsed_url.pathname
Nick Downing [Tue, 4 Dec 2018 00:47:01 +0000 (11:47 +1100)]
Change _config/server.jst to return a pure JSON object with information about the hosts rather than a constructed object per host (removing the awkward Site/SiteConfig/SiteRoot/SiteRedirect hierarchy and combining SiteRoot back into Site)
Nick Downing [Sun, 2 Dec 2018 05:22:50 +0000 (16:22 +1100)]
Add new Server.resources object, which basically keeps weak references to anything that might be shared between sites, use to store a JSTCache per unique root
Nick Downing [Sun, 2 Dec 2018 03:48:13 +0000 (14:48 +1100)]
Remove _server and _site available in templates in favour of env.server and env.site, make _jst_server available to eliminate @ndcode/jst_server dependency
Nick Downing [Sun, 2 Dec 2018 00:38:22 +0000 (11:38 +1100)]
Use 'once' argument from build_cache.git commit
1cc703b, instead of passing the _server and _site arguments into _config/server.jst and _config/site.jst files
Nick Downing [Sun, 25 Nov 2018 01:42:09 +0000 (12:42 +1100)]
Remove internal_get_min_html() that should have been this.min_html_cache.get()
Nick Downing [Tue, 20 Nov 2018 13:30:04 +0000 (00:30 +1100)]
Change JSONCache to JSONCacheRW, change internal_get_json() to JSONCache.get()
Nick Downing [Tue, 20 Nov 2018 12:44:04 +0000 (23:44 +1100)]
Change all the SiteRoot.internal_get_XXX() to XXXCache.get(), in separate modules, except for internal_get_json() which will require to rename JSONCache first
Nick Downing [Sun, 18 Nov 2018 13:03:21 +0000 (00:03 +1100)]
Use @ndcode/html-minifier not html-minifier, request CSS and JS minification in HTML, add handlers for serving *.html.min and *.svg.min files like *.js.min etc
Nick Downing [Sun, 18 Nov 2018 11:27:38 +0000 (22:27 +1100)]
Update to disk_build.git commit
b8ff724, can now build Less CSS via disk cache
Nick Downing [Sun, 18 Nov 2018 03:58:52 +0000 (14:58 +1100)]
Comment out emailjs/zettair stuff, it will move to the CustomSite object in sites that need it (zettair in particular may cause installation problems, since it requires compilation, and may not be needed), remove some obsolete dependencies
Nick Downing [Sun, 18 Nov 2018 03:19:22 +0000 (14:19 +1100)]
Use the published @ndcode/zettair module, bump version of @ndcode/jst module
Nick Downing [Sun, 18 Nov 2018 02:06:12 +0000 (13:06 +1100)]
Move Server.get_XXX() functions to SiteRoot.internal_get_XXX(), make _site available to templates instead of env.site since now instantiated separately by site
Nick Downing [Sun, 18 Nov 2018 01:34:47 +0000 (12:34 +1100)]
Merge _config/server.json and _config/sites.jst into a single _config/server.jst, fix minor typo bugs with with HTML caching headers and index.html redirection
Nick Downing [Sun, 18 Nov 2018 01:01:45 +0000 (12:01 +1100)]
Provide get_html_min() similar to get_js_min() and friends, using html-minifier
Nick Downing [Sun, 18 Nov 2018 00:16:50 +0000 (11:16 +1100)]
Provide get_svg_min() similar to get_js_min() and friends, using svgo package
Nick Downing [Sat, 17 Nov 2018 23:44:24 +0000 (10:44 +1100)]
Use @ndcode/disk_build to reduce startup time by caching minified stuff on disk
Nick Downing [Sat, 17 Nov 2018 12:10:47 +0000 (23:10 +1100)]
Change to @ndcode/clean-css, add printout of clean-css warnings
Nick Downing [Sat, 17 Nov 2018 07:32:35 +0000 (18:32 +1100)]
Add *.css.min support similar to the *.js.min support, rename less and js stuff
Nick Downing [Sat, 17 Nov 2018 01:36:29 +0000 (12:36 +1100)]
Add automatic uglification of *.js.min files (they will then be served as *.js)
Nick Downing [Fri, 16 Nov 2018 23:44:16 +0000 (10:44 +1100)]
Fix a number of async/await bugs, separate serve_dir() into serve_path() which does initial evaluation of a pathname component and serve_dir() which only tries to serve a directory, implement components array so that we can use split('/') initially instead of repeatedly analyzing the path, pass into *.dir.jst template
Nick Downing [Fri, 16 Nov 2018 14:18:35 +0000 (01:18 +1100)]
New recursive directory resolution scheme, controlled by new functions serve_dir() and serve_file() that can be overridden to inspect each path component and redirect certain directories elsewhere (e.g. serving home directories statically)
Nick Downing [Fri, 16 Nov 2018 13:18:50 +0000 (00:18 +1100)]
Update to jst.git commit
e365ffe, rationalize pathname and mime_type handling
Nick Downing [Fri, 16 Nov 2018 10:41:18 +0000 (21:41 +1100)]
Change SiteRootConfig to SiteDefault, renew localhost site and CA certificates
Nick Downing [Sun, 11 Nov 2018 07:55:40 +0000 (18:55 +1100)]
Use the published @ndcode/build_cache, @ndcode/json_cache, @ndcode/jst modules
Nick Downing [Tue, 30 Oct 2018 05:09:03 +0000 (16:09 +1100)]
Slight rationalization to how relative or absolute path is passed into Server
Nick Downing [Tue, 30 Oct 2018 04:58:06 +0000 (15:58 +1100)]
Separate out the listen (and other) config into _config/server.json which is read every 5 seconds and changes processed incrementally relative to previous file, compared with sites config in _config/sites.json which is checked each time a new connection comes in and re-executed from scratch (making new Site objects)
Nick Downing [Tue, 30 Oct 2018 02:04:35 +0000 (13:04 +1100)]
Change configuration scheme to use _config/server.jst and each _config/site.jst
Nick Downing [Mon, 29 Oct 2018 10:34:25 +0000 (21:34 +1100)]
Update to js_template.git commit
6d973a9, simplify how jst files are loaded, add _server predefined symbol in the jst environment pointing to the Server object
Nick Downing [Mon, 22 Oct 2018 03:50:58 +0000 (14:50 +1100)]
Make favicons.zip be served from _favicon hidden directory
Nick Downing [Mon, 22 Oct 2018 00:41:42 +0000 (11:41 +1100)]
Change serve_jst() so the template is responsible for calling env.site.serve()
Nick Downing [Mon, 22 Oct 2018 00:33:07 +0000 (11:33 +1100)]
Improve serving, death and redirection messages, removing a lot of duplication
Nick Downing [Sun, 21 Oct 2018 23:55:30 +0000 (10:55 +1100)]
Fix a bug in emailing
Nick Downing [Sun, 21 Oct 2018 11:15:15 +0000 (22:15 +1100)]
Move config to _config, ssl to _ssl so they can be at site root, other tidy-ups
Nick Downing [Sun, 21 Oct 2018 10:30:03 +0000 (21:30 +1100)]
Improve 301 and 404 again slightly, reinstate the default 'Hello, world' site
Nick Downing [Sun, 21 Oct 2018 09:45:32 +0000 (20:45 +1100)]
Improve 301 redirect and 404 not found, implement env.status so the jst templates do redirects etc, change console logging to reduce page serving delay and chatter based on build_cache.git commit
b4e0eb9, js_template.git commit
aedc57a, revise (read|write|modify)_json() interface based on json_cache.git commit
72f2352
Nick Downing [Sun, 21 Oct 2018 05:18:43 +0000 (16:18 +1100)]
Fix bugs in jst relative paths and unknown filetypes
Nick Downing [Sun, 21 Oct 2018 04:24:47 +0000 (15:24 +1100)]
Streamline mime_type handling so it is kept in the environment and only explicitly replaced when a directory is generated by jst template (previously returned)
Nick Downing [Sun, 21 Oct 2018 03:26:06 +0000 (14:26 +1100)]
Add socket.io support, create installable package
Nick Downing [Sun, 21 Oct 2018 01:34:23 +0000 (12:34 +1100)]
Merge resources into Server, resources.json_cache becomes server.json_cache etc
Nick Downing [Sun, 21 Oct 2018 01:27:17 +0000 (12:27 +1100)]
Merge config into Server, config.refresh() becomes server.refresh_config() etc
Nick Downing [Sun, 21 Oct 2018 01:08:37 +0000 (12:08 +1100)]
Make Server an object, hence easier to access server.caching, server.die() etc
Nick Downing [Sat, 20 Oct 2018 13:33:50 +0000 (00:33 +1100)]
Completely rewrite the URL parsing and file serving code, removes the need for the .pub suffix, and allows any kind of file or directory to be generated by jst
Nick Downing [Sat, 20 Oct 2018 05:31:25 +0000 (16:31 +1100)]
Simplify the env object to contain only: parsed_url, response, request, site
Nick Downing [Sat, 20 Oct 2018 04:53:00 +0000 (15:53 +1100)]
Move the get_XXX() routines, and the new open_json() and flush_json() routines which used to be json_cache.get() and json_cache.set(), onto the Site object, and make them automatically supply the site root, this simplifies user code a lot
Nick Downing [Sat, 20 Oct 2018 01:22:20 +0000 (12:22 +1100)]
Implement Site object, which can be extended by a site_factory.jst file at root
Nick Downing [Mon, 15 Oct 2018 04:35:39 +0000 (15:35 +1100)]
Switch to acorn-based JS templates with classes, ids, scripts, template strings
Nick Downing [Mon, 15 Oct 2018 00:18:32 +0000 (11:18 +1100)]
Update to js_template.git commit
19bdeb6
Nick Downing [Mon, 15 Oct 2018 00:15:08 +0000 (11:15 +1100)]
Minimal update to js_template.git commit
19bdeb6, still supplies our own _req()
Nick Downing [Mon, 15 Oct 2018 00:03:23 +0000 (11:03 +1100)]
Update to js_template.git commit
d0345db
Nick Downing [Sun, 14 Oct 2018 23:43:43 +0000 (10:43 +1100)]
Don't call the template immediately on retrieval, user code can do this itself
Nick Downing [Sun, 14 Oct 2018 23:22:07 +0000 (10:22 +1100)]
Update to js_template.git commit
e998e98, (env, out, get) to (_env, _out, _req)
Nick Downing [Sun, 14 Oct 2018 22:40:52 +0000 (09:40 +1100)]
Rename package ndserver(.js) to jst_server(.js), *.js to *.jst, adopt Node 10
Nick Downing [Tue, 9 Oct 2018 10:19:41 +0000 (21:19 +1100)]
Rename jstemplate to js_template
Nick Downing [Tue, 9 Oct 2018 10:01:03 +0000 (21:01 +1100)]
Get contact form email working
Nick Downing [Tue, 9 Oct 2018 02:13:59 +0000 (13:13 +1100)]
Move analytics stuff into the html page template in businessdataflow.git
Nick Downing [Tue, 9 Oct 2018 01:57:30 +0000 (12:57 +1100)]
Update to jstemplate.git commit
b6f0914 and businessdataflow.git commit
da162ca
Nick Downing [Tue, 9 Oct 2018 01:40:08 +0000 (12:40 +1100)]
Remove dedicated analytics.js and do it via resources.js and JSON cache, make analytics be stored in site root separately per site rather than in ndserver.git
Nick Downing [Tue, 9 Oct 2018 01:19:43 +0000 (12:19 +1100)]
Switch to leading / on paths everywhere, including in favicon.zip and analytics
Nick Downing [Tue, 9 Oct 2018 01:14:18 +0000 (12:14 +1100)]
Make analytics.js use json_cache, add analytics diagnostics and fix some bugs
Nick Downing [Mon, 8 Oct 2018 21:21:55 +0000 (08:21 +1100)]
Update to build_cache.git commit
9bbe354
Nick Downing [Mon, 8 Oct 2018 06:59:48 +0000 (17:59 +1100)]
Separate server and site functionality (site is after host has been identified)
Nick Downing [Mon, 8 Oct 2018 06:43:05 +0000 (17:43 +1100)]
Break the main functionality into analytics, config, resources and site modules
Nick Downing [Mon, 8 Oct 2018 02:46:35 +0000 (13:46 +1100)]
Implement pageviews and unique pageviews counters
Nick Downing [Mon, 8 Oct 2018 01:54:19 +0000 (12:54 +1100)]
Add cookies and session tracking
Nick Downing [Sun, 7 Oct 2018 12:12:49 +0000 (23:12 +1100)]
Add favicons.zip handling
Nick Downing [Sun, 7 Oct 2018 09:58:24 +0000 (20:58 +1100)]
Make config/*.json global configuration files be re-read if they change
Nick Downing [Sun, 7 Oct 2018 09:50:48 +0000 (20:50 +1100)]
Modularize req() and cache system to req_XXX() that can also be used internally
Nick Downing [Sun, 7 Oct 2018 09:22:35 +0000 (20:22 +1100)]
Change var to let and use arrow functions everywhere
Nick Downing [Sun, 7 Oct 2018 09:19:45 +0000 (20:19 +1100)]
Change var to let everywhere
Nick Downing [Sun, 7 Oct 2018 07:13:05 +0000 (18:13 +1100)]
Get indexing and search working
Nick Downing [Sun, 7 Oct 2018 04:42:33 +0000 (15:42 +1100)]
Implement caches for json and text (svg) files, via a second argument to _req()
Nick Downing [Sun, 7 Oct 2018 04:21:40 +0000 (15:21 +1100)]
Implement caching of less compiled css, including full dependency tracking
Nick Downing [Sun, 7 Oct 2018 04:10:32 +0000 (15:10 +1100)]
Add caching of the compiled js templates
Nick Downing [Sun, 7 Oct 2018 03:14:11 +0000 (14:14 +1100)]
Fix minor bugs to get paths working again for js and less rendering
Nick Downing [Sun, 7 Oct 2018 02:32:15 +0000 (13:32 +1100)]
Update to jstemplate.git commit
34f5f89, businessdataflow.git commit
2fe99d8
Nick Downing [Sat, 6 Oct 2018 12:22:07 +0000 (22:22 +1000)]
Add jstemplate and less rendering ability