Turn any dynamic website (especially wordpress) into a fast, secure, stable static site
- Reduced complexity - no need to run simply static plugin. No need to preview
- Better control - you can now configure redirects to fix problematic URLs right there.
- Better security - only select people can publish the site. Only a set of people can preview not-yet-published contents.
- Scheduled publishing
- Google Firebase for static site hosting/publishing, with local preview using Google's SuperStatic webserver.
- Google OAUTH for authentication
- Custom publishing to CloudFront or a folder via custom server-side commands. For example you can run post processing code by including the following in config.json;
"code":"sed -i 's|<loc>/|<loc>https://site.com/|;s|<image:loc><!\\[CDATA\\[/|<image:loc><!\\[CDATA\\[https://site.com/|' /sitemaps/*.xml; rsync -av --checksum --delete /static/ /public/"
, See the end of controller.js for more details,
- Create a
config.json
configuration file. The sample is inconfig.sample.json
- Create OAuth credentials with https://server.io/callback URL, enable People API.
- Create a firebase hosting project and tie it to GCP
- Create a firebase service account in the IAM/Service accounts page on GCP (firebase is tied to GCP through the "blaze" subscription)
- Click on the firebase admin service account actions then create key. and save the contents of the downloaded json into the config.json as a
"firebase":{ ... }
object
- Build with
docker build -t publicator .
- Make sure the OAuth creds include the http://localhost:8080/callback call-back URL
- Run:
`docker run --rm -it -e DEBUG=publicator:* -v $PWD/config.json:/root/.config/configstore/publicator.json:ro -v $PWD/superstatic/firebase.json:/publicator/superstatic/firebase.json -v $PWD/superstatic/firebase.schema.json:/publicator/superstatic/firebase.schema.json -v $PWD/superstatic/scraper.schema.json:/publicator/superstatic/scraper.schema.json -p 8080:8080 -p 3474:3474 alexivkin/publicator
See this file
- Install NodeJS 14.4+
- Run
npm install
- Register the app with the Google OAuth (see the "setup" section)
- Create the configuration file
.config/configstore/publicator.json
- Now run it as
node server.js
- Login to the publisher
- First click "generate" to create static copy of wordpress
- If you want, click "preview" to check the result. Once you are comfortable with the result then click "publish" to make it public.
- To schedule the whole process at a different time use the "date time picker form" or enter date/time manually and click "schedule publishing". The static site generation and publishing of the site will be done at that date. You can close your browser.
- Node Scheduler
- Date/time wiget and human-readable processor
- JSON Editor
- Firebase
- Google OAUTH and OIDC
- Google APIs
- Google Admin SDK
- Authorization via Google groups