Publish HTML quickly. https://html.house
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Matt Baer c4a1fd3b70 Add missing closing double-quote on PreviewsHost преди 2 години
cmd/htmlhouse Move main.go to cmd/htmlhouse преди 2 години
keys Add backend ability to save/get a house преди 8 години
less Move LESS files out of `css` to `less` directory преди 6 години
static Move LESS files out of `css` to `less` directory преди 6 години
templates Allow disabling publishing преди 4 години
.gitignore Add package build script преди 7 години
CONTRIBUTING.md Add contributing guidelines преди 6 години
INSTALL Add install instructions преди 7 години
LICENSE Add MIT license преди 5 години
README.md Allow disabling publishing преди 4 години
app.go Allow disabling publishing преди 4 години
build.sh Add install instructions преди 7 години
config.go Add missing closing double-quote on PreviewsHost преди 2 години
construction.go Return 404 for stats on nonexistent houses преди 6 години
database.go Add backend ability to save/get a house преди 8 години
filter.go Automatically pass public filter when no blacklist configured преди 6 години
go.mod Use Go modules преди 2 години
go.sum Use Go modules преди 2 години
house.go Add backend ability to save/get a house преди 8 години
init.sql Support posting new public houses to Twitter преди 8 години
keys.sh Prevent running keys.sh with no params преди 8 години
makefile Move LESS files out of `css` to `less` directory преди 6 години
models.go Make thumbnails host configurable преди 6 години
session.go Parse JWT keys correctly преди 6 години
templates.go Add Browse page преди 8 години
twitter.go Skip tweeting pages with "HTMLhouse" title преди 8 години

README.md

HTMLhouse

Publish HTML quickly.

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 a Chrome extension and browsable on Android.

#writeas on freenode Public Slack discussion

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 main/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

Variable What it is Default value
DB_USER Database user None. Required
DB_PASSWORD Database password None. Required
DB_DB Database name None. Required
DB_HOST Database host localhost
PRIVATE_KEY Generated private key None. Required
PUBLIC_KEY Generated public key None. Required
PORT Port to run app on 8080
STATIC_DIR Relative dir where static files are stored static
ALLOW_PUBLISH Allow users to publish posts true
AUTO_APPROVE Automatically approves public posts false
PREVIEWS_HOST Fully-qualified URL (without trailing slash) of screenshot server None.
ADMIN_PASS Password to perform admin functions via API uhoh
BROWSE_ITEMS Number of items to show on Browse page 10
BLACKLIST_TERMS Comma-separated list of terms to prevent a post from being made public None.
TWITTER_KEY Twitter consumer key notreal
TWITTER_SECRET Twitter consumer secret notreal
TWITTER_TOKEN Twitter access token of the posting Twitter account notreal
TWITTER_TOKEN_SECRET Twitter access token secret of the posting Twitter account notreal

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.