1
0
mirror of https://github.com/writeas/htmlhouse synced 2025-07-18 21:08:16 +00:00
Publish HTML quickly. https://html.house
Go to file
2018-03-18 09:14:47 -04:00
keys Add backend ability to save/get a house 2015-10-11 08:01:41 -04:00
less Move LESS files out of css to less directory 2018-01-04 19:39:26 -05:00
main Move import path to writeas/htmlhouse 2015-10-25 16:35:50 -04:00
static Move LESS files out of css to less directory 2018-01-04 19:39:26 -05:00
templates Read API data in editor from top-level object 2018-03-12 11:03:55 -04:00
.gitignore Add package build script 2017-05-18 19:47:30 -04:00
app.go Add public houses endpoint 2016-03-08 01:31:49 -05:00
build.sh Add install instructions 2017-05-18 20:27:57 -04:00
config.go Support blacklist for terms that prevent a public post 2018-03-12 11:26:15 -04:00
construction.go Return 404 status for houses not found 2018-03-18 09:14:47 -04:00
CONTRIBUTING.md Add contributing guidelines 2018-01-04 19:32:50 -05:00
database.go Add backend ability to save/get a house 2015-10-11 08:01:41 -04:00
filter.go Automatically pass public filter when no blacklist configured 2018-03-12 11:28:20 -04:00
house.go Add backend ability to save/get a house 2015-10-11 08:01:41 -04:00
init.sql Support posting new public houses to Twitter 2016-01-22 16:47:41 -05:00
INSTALL Add install instructions 2017-05-18 20:27:57 -04:00
keys.sh Prevent running keys.sh with no params 2015-10-25 16:09:05 -04:00
makefile Move LESS files out of css to less directory 2018-01-04 19:39:26 -05:00
models.go Make thumbnails host configurable 2018-01-20 15:54:30 -05:00
README.md Support blacklist for terms that prevent a public post 2018-03-12 11:26:15 -04:00
session.go Parse JWT keys correctly 2018-03-12 11:00:52 -04:00
templates.go Add Browse page 2016-01-02 12:50:35 -05:00
twitter.go Skip tweeting pages with "HTMLhouse" title 2016-01-22 17:25:10 -05:00

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
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.