Publish HTML quickly. https://html.house
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

README.md 3.1 KiB

8 anos atrás
8 anos atrás
8 anos atrás
8 anos atrás
8 anos atrás
8 anos atrás
8 anos atrás
8 anos atrás
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ⌂ HTMLhouse / 🐴 CSShorse
  2. =========
  3. ⌂ Publish HTML quickly / 🐴 Develop a WriteFreely theme
  4. [![HTMLhouse screenshot](https://i.snap.as/Pjfv63IO.png)](https://html.house)
  5. [![HTMLhouse screenshot](https://i.snap.as/5sJLTmFV.png)](https://css.horse)
  6. HTMLhouse uses [ACE editor](https://ace.c9.io/) for modifying HTML and shows a live preview of what you've created in an `iframe` alongside the source code.
  7. 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](http://jwt.io/) generated by the server.
  8. It is also available as an [Android](https://play.google.com/store/apps/details?id=com.abunchtell.htmlhouse) app.
  9. ## Development
  10. ### Requirements
  11. * Go
  12. * Node.js
  13. * MySQL
  14. ### Setup
  15. 1. Clone the repo
  16. 2. Run `go get -d` to get necessary dependencies
  17. 3. Run `make install` to install LESS compiler locally and generate the CSS files
  18. 4. Run the queries in `init.sql` to set up the database
  19. 5. _Optional_. Run `./keys.sh prod` to create a new keypair
  20. ### Running the server
  21. * Run `go run cmd/htmlhouse/main.go` in the top level directory, optionally by creating a simple run script
  22. ```bash
  23. #!/bin/bash
  24. DB_USER=dbuser DB_PASSWORD=pass DB_DB=htmlhouse PRIVATE_KEY=keys/dev PUBLIC_KEY=keys/dev.pub go run main/main.go
  25. ```
  26. * Open your browser to http://localhost:8080
  27. #### Environment Variables
  28. | Variable | What it is | Default value |
  29. | -------- | ---------- | ------------- |
  30. | `DB_USER` | Database user | None. **Required** |
  31. | `DB_PASSWORD` | Database password | None. **Required** |
  32. | `DB_DB` | Database name | None. **Required** |
  33. | `DB_HOST` | Database host | `localhost` |
  34. | `PRIVATE_KEY` | Generated private key | None. **Required** |
  35. | `PUBLIC_KEY` | Generated public key | None. **Required** |
  36. | `PORT` | Port to run app on | `8080` |
  37. | `STATIC_DIR` | Relative dir where static files are stored | `static` |
  38. | `ALLOW_PUBLISH` | Allow users to publish posts | true |
  39. | `AUTO_APPROVE` | Automatically approves public posts | false |
  40. | `PREVIEWS_HOST` | Fully-qualified URL (without trailing slash) of screenshot server | None. |
  41. | `ADMIN_PASS` | Password to perform admin functions via API | `uhoh` |
  42. | `BROWSE_ITEMS` | Number of items to show on Browse page | 10 |
  43. | `BLACKLIST_TERMS` | Comma-separated list of terms to prevent a post from being made public | None. |
  44. | `TWITTER_KEY` | Twitter consumer key | `notreal` |
  45. | `TWITTER_SECRET` | Twitter consumer secret | `notreal` |
  46. | `TWITTER_TOKEN` | Twitter access token of the posting Twitter account | `notreal` |
  47. | `TWITTER_TOKEN_SECRET` | Twitter access token secret of the posting Twitter account | `notreal` |
  48. | `WF_MODE` | Run CSShorse, not HTMLhouse — for customizing WriteFreely blogs | `false` |
  49. ### Notes
  50. **Changing CSS**. Run `make` after all changes to update the stylesheets.
  51. **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.
  52. **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.