Categorygithub.com/writeas/htmlhouse
repositorypackage
0.0.0-20210604201926-31a919f8b7fd
Repository: https://github.com/writeas/htmlhouse.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

āŒ‚ HTMLhouse / 🐓 CSShorse

āŒ‚ Publish HTML quickly / 🐓 Develop a WriteFreely theme

HTMLhouse screenshot HTMLhouse screenshot

HTMLhouse uses ACE editor for modifying HTML and shows a live preview of what you've created in an iframe alongside the source code.

No user signup is required -- authorization to modify an individual published page is saved on the creator's device in local storage as an ID and JWT generated by the server.

It is also available as an Android app.

Development

Requirements

  • Go
  • Node.js
  • MySQL

Setup

  1. Clone the repo
  2. Run go get -d to get necessary dependencies
  3. Run make install to install LESS compiler locally and generate the CSS files
  4. Run the queries in init.sql to set up the database
  5. Optional. Run ./keys.sh prod to create a new keypair

Running the server

  • Run go run cmd/htmlhouse/main.go in the top level directory, optionally by creating a simple run script
#!/bin/bash

DB_USER=dbuser DB_PASSWORD=pass DB_DB=htmlhouse PRIVATE_KEY=keys/dev PUBLIC_KEY=keys/dev.pub go run main/main.go

Environment Variables

VariableWhat it isDefault value
DB_USERDatabase userNone. Required
DB_PASSWORDDatabase passwordNone. Required
DB_DBDatabase nameNone. Required
DB_HOSTDatabase hostlocalhost
PRIVATE_KEYGenerated private keyNone. Required
PUBLIC_KEYGenerated public keyNone. Required
PORTPort to run app on8080
STATIC_DIRRelative dir where static files are storedstatic
ALLOW_PUBLISHAllow users to publish poststrue
AUTO_APPROVEAutomatically approves public postsfalse
PREVIEWS_HOSTFully-qualified URL (without trailing slash) of screenshot serverNone.
ADMIN_PASSPassword to perform admin functions via APIuhoh
BROWSE_ITEMSNumber of items to show on Browse page10
BLACKLIST_TERMSComma-separated list of terms to prevent a post from being made publicNone.
TWITTER_KEYTwitter consumer keynotreal
TWITTER_SECRETTwitter consumer secretnotreal
TWITTER_TOKENTwitter access token of the posting Twitter accountnotreal
TWITTER_TOKEN_SECRETTwitter access token secret of the posting Twitter accountnotreal
WF_MODERun CSShorse, not HTMLhouse — for customizing WriteFreely blogsfalse

Notes

Changing CSS. Run make after all changes to update the stylesheets.

When you don't need to reload the app. When you make changes to any files in static/ you can simply refresh the resource without restarting the app.

When to reload the app. If you change any of the templates in templates/ or any .go file, you'll need to re-run the app.