Skip to content

kncept/slog

Repository files navigation

S'log

Slog... the Simple Web Log.

  • Simple to get started
    • Just follow the Quickstart to first post
    • Only two external dependencies - AWS, and an OIDC provider
  • Simple to host
    • Default self hosting cloud infrastructure is essentially maintainence free
  • Simple to keep
    • As an open source project, you can use it, fork it and even change it
    • All data is hosted on your own managed infrastructure

Quickstart

  1. Clone the Repository. Feel free to fork it first, and make any changes you need. Otherwise, git clone [email protected]:kncept/slog.git will work.

  2. Open the project It is strongly suggested that you use the provided DevContainer, as that will give you a full development environment with all tools and utilities installed, requiring only Docker and VSCode installed on your system.
    Otherwise, Use your IDE of choice, the devcontainer dockerfile forms the instructions for required environment setup.
    The only dependencies should be npm, node, and ts-node.

  3. Copy the 'prodProperties.ts.template' to 'prodProperties.ts' cp prodProperties.ts.template prodProperties.ts, and fill in any blank properties

    The minimum set required should be:

    • adminUsers an array in a 'provider/email' format. eg: ['google/[email protected]', 'GitHub:kncept']
    • publicUrl The front end URL that you want to use
    • reactAppApiEndpoint The back end URL that you want to use
    • awsAccessKeyId
    • awsSecretAccessKey
    • awsSecretAccessKey AWS CLI Credentials (See AWS Documentation if this is not already set up)
  4. Initialize the Dev environment Run npm ci in order to download dependencies for the run.ts file.

  5. ./run.ts deploy If you are not running in the devcontainer, you may need to run the above via ts-node. This will create a Cloudformation stack via the AWS CDK. Everything is in one stack (SLog by default), but uses multiple nested stacks to deploy.

  6. Update your name servers to match the AWS domain - UNLESS the domain is AWS Managed (ie you set purchase on in config - still todo)

  7. Start Posting

Developing

All orchestration is done by the run.ts command. This uses ts-node

In the dev container, ./run.ts build will initialze npm for the subprojects, and do a production build for the frontend ./run.ts start will start up the the stack in dev mode ./run.ts deploy will build and deploy the stack ./run.ts test will run all unit tests

Current Constraints

  • Backend and Frontend need to be on the same top level hosted domain
  • CORS isn't locked down properly

Fork Customisation

cp devProperties.ts.template devProperties.ts ==> Support for checked in dev properties

If you want to commit secrets, I would suggest using the https://github.com/commenthol/ansible-vault library to encrypt them.

Auth Provider Configuration

(todo) Help for some basic auth providers.

OIDC providers:

Oauth (not OIDC) providers