0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-27 11:32:38 +00:00
Commit Graph

3701 Commits

Author SHA1 Message Date
Trevor Buckner
e5ccfa3a50 Fix /page not working in legacy mode. (#1233)
* Fix brew styles overwriting each other.

* Word wrapping, start fixing spacing on Title letter

* Fix \page in legacy brews when not at line start
2021-02-08 13:58:24 -05:00
Trevor Buckner
c642a35fb3 Fix brew styles overwriting each other. (#1230) 2021-02-05 14:58:41 -05:00
Trevor Buckner
2fe353377b Revert accidental color change 2021-02-05 09:38:20 -05:00
Trevor Buckner
de1017a20a Legacy renderer (#1229)
* Include two versions of Marked.js

* Include two versions of Marked.js

* Working two different render pipelines

Adds stylesheet "styleLegacy.less"
Adds markdownHandler "markdownLegacy.js"
The BrewRenderer will switch between these and the new pipeline dependent on the "version" prop passed in.

* Mustache-style div blocks

* Legacy snippets & columnbreak

* Codemirror styling for Div Blocks

* Lint

* Codemirror highlights for inline Divs as well

These will turn red `{{class Content}}`

Multi-line divs will turn purple

```
{{class,class2
content
}}
```

No real need for these to be different colors. Just for testing.

* More lint

* Update dependencies.

* Adding Button to switch render pipelines

* Update Marked.js

* Popup alert to refresh page when renderer changed

* Don't compress files in Development (very slow)

* Block DIV or inline Span depending on {{ placement

* \column emits a Div instead of Span

* Allow share page to use new renderer

* {{ divs no longer need empty lines. Spans work in lists.

* Typo

* Typo

* Enforce \page must be at start of line. Code cleanup.

* Inject newlines after/before {{/}} to avoid needing blank lines

* Fixes issues with tables.

* Remove console.log

* Fix spacing issue for Spans

* Move things from Brewrenderer to Markdown

Try to keep all custom text fiddling in one spot.

* Rename variables

* Update Font-Awesome to v5.15. Fix style issues on popups.

* Update {{ Divs/Spans, Fix nested hilighting

* Fixed Spans/divs with no tags or just commas

* Use blacklist for {{ to allow more characters

* Update package-lock.json

* Update all icons to Font-awesome 5

* V3 hidden behind config variable

Add "globalThis.enable_v3 = true" in the console to enable.

* lint

* Give user styles higher priority to still allow overrides

* Apply style priority to *all* user styles

* Change .legacy .v3 to .phb, .phb3
2021-02-04 23:31:37 -05:00
Trevor Buckner
e2cd7d9f07 Legacy renderer (#1184)
* Include two versions of Marked.js

* Include two versions of Marked.js

* Working two different render pipelines

Adds stylesheet "styleLegacy.less"
Adds markdownHandler "markdownLegacy.js"
The BrewRenderer will switch between these and the new pipeline dependent on the "version" prop passed in.

* Mustache-style div blocks

* Legacy snippets & columnbreak

* Codemirror styling for Div Blocks

* Lint

* Codemirror highlights for inline Divs as well

These will turn red `{{class Content}}`

Multi-line divs will turn purple

```
{{class,class2
content
}}
```

No real need for these to be different colors. Just for testing.

* More lint

* Update dependencies.

* Adding Button to switch render pipelines

* Update Marked.js

* Popup alert to refresh page when renderer changed

* Don't compress files in Development (very slow)

* Block DIV or inline Span depending on {{ placement

* \column emits a Div instead of Span

* Allow share page to use new renderer

* {{ divs no longer need empty lines. Spans work in lists.

* Typo

* Typo

* Enforce \page must be at start of line. Code cleanup.

* Inject newlines after/before {{/}} to avoid needing blank lines

* Fixes issues with tables.

* Remove console.log

* Fix spacing issue for Spans

* Move things from Brewrenderer to Markdown

Try to keep all custom text fiddling in one spot.

* Rename variables

* Update Font-Awesome to v5.15. Fix style issues on popups.

* Update {{ Divs/Spans, Fix nested hilighting

* Fixed Spans/divs with no tags or just commas

* Use blacklist for {{ to allow more characters

* Update package-lock.json

* Update all icons to Font-awesome 5

* V3 hidden behind config variable

Add "globalThis.enable_v3 = true" in the console to enable.

* lint
2021-02-02 20:38:25 -05:00
G.Ambatte
c3bfd1e8bf Prefix loading successfully from config/local.json for both Homebrewery and Google brews.
Concats switched to string literals to make Linter happy.
2021-01-29 22:53:58 +13:00
G.Ambatte
051773a084 Move filename prefix to configurable item in config/default.json 2021-01-28 23:13:01 +13:00
Trevor Buckner
6a2e39355c V2.10.7 (#1215)
* Fix for box-shadow/border-image issues on blockquotes in new columns (#1179)

* Fix for issues with box-shadow and border-images on blockquotes when they appear at the top of columns other than the first.

* Update phb.style.less

Change to `-webkit-transform` IAW Github PR discussion

* Add comment

Co-authored-by: Sean Robertson <srobertson@fqnz.co.nz>
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>

* Title will always return *something*, and not CSS (#1214)

* Bump codemirror from 5.59.1 to 5.59.2 (#1200)

Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.59.1 to 5.59.2.
- [Release notes](https://github.com/codemirror/CodeMirror/releases)
- [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codemirror/CodeMirror/compare/5.59.1...5.59.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump mongoose from 5.11.9 to 5.11.13 (#1199)

Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.11.9 to 5.11.13.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md)
- [Commits](https://github.com/Automattic/mongoose/compare/5.11.9...5.11.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump fs-extra from 9.0.1 to 9.1.0 (#1197)

Bumps [fs-extra](https://github.com/jprichardson/node-fs-extra) from 9.0.1 to 9.1.0.
- [Release notes](https://github.com/jprichardson/node-fs-extra/releases)
- [Changelog](https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jprichardson/node-fs-extra/compare/9.0.1...9.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump eslint from 7.17.0 to 7.18.0 (#1195)

Bumps [eslint](https://github.com/eslint/eslint) from 7.17.0 to 7.18.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.17.0...v7.18.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump nconf from 0.11.0 to 0.11.1 (#1190)

Bumps [nconf](https://github.com/flatiron/nconf) from 0.11.0 to 0.11.1.
- [Release notes](https://github.com/flatiron/nconf/releases)
- [Changelog](https://github.com/indexzero/nconf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flatiron/nconf/compare/v0.11.0...v0.11.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump googleapis from 66.0.0 to 67.0.0 (#1189)

Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 66.0.0 to 67.0.0.
- [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases)
- [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/master/CHANGELOG.md)
- [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/v66.0.0...v67.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>

* Bump express-static-gzip from 2.1.0 to 2.1.1 (#1180)

Bumps [express-static-gzip](https://github.com/tkoenig89/express-static-gzip) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/tkoenig89/express-static-gzip/releases)
- [Commits](https://github.com/tkoenig89/express-static-gzip/compare/v2.1.0...v2.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>

* use fa-info-circle instead of fa-bars (#1109)

* use fa-info-circle instead of fa-bars

* Change Metadata button to Info Icon with Text

Co-authored-by: Trevor Buckner <calculuschild@gmail.com>

* Up Version

Co-authored-by: G.Ambatte <sean@robertson-family.nz>
Co-authored-by: Sean Robertson <srobertson@fqnz.co.nz>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: ericscheid <ericscheid@users.noreply.github.com>
v2.10.7
2021-01-25 21:47:36 -05:00
G.Ambatte
e367cb2152 Initial commit - adds a New button to the Nav bar on the Home, User, and Edit pages. 2021-01-23 00:36:10 +13:00
G.Ambatte
bcbf596aa8 Increase minimum height of brewItem in CSS so all four items are always visible.
Adjust eslint line in `server.js` to re-enable the test with a slightly higher maximum value.
2021-01-22 21:24:22 +13:00
G.Ambatte
d88b04783d Lint corrections 2021-01-22 17:31:01 +13:00
G.Ambatte
6d219aa701 Unwinding refactored code + corrections. 2021-01-22 17:29:26 +13:00
G.Ambatte
da32845dd1 (WIP) Unwinding refactoring to improve clarity and readability of new functions 2021-01-22 16:44:34 +13:00
Sean Robertson
4073536d96 (WIP) Remove target=_blank and rel=noopener noreferrer from brewItem.jsx to eliminate white flash on User page when clicking link to download source of a brew. 2021-01-22 13:59:15 +13:00
Sean Robertson
21f08c97a1 Expand source text escaping/processing for improved readability 2021-01-22 13:56:29 +13:00
G.Ambatte
06223d576d Fixes from Linter 2021-01-21 20:32:23 +13:00
G.Ambatte
5c7a9c92d1 Integrated download function into server.js
Remove new function from `Homebrew.Model.js`
Remove `sourceFunctions.jsx` module
2021-01-21 20:27:46 +13:00
G.Ambatte
0e8348f360 Catch zero length filenames 2021-01-21 07:39:08 +13:00
G.Ambatte
8060ed5f8e Rename sanitizeHtml function to escapeTextForHtmlDisplay which better describes it's actual function 2021-01-21 07:37:50 +13:00
G.Ambatte
e8135fcbb4 Added sanitizeHtml function to Homebrew model to generate HTML from the brew for the source page.
Moved `source` page generation function to a new function module. Added option to function to create plain text download with a sanitized filename and made it accessible from a new page: `download`.
Added the `download` item to the BrewItem so it appears on each brew on the User page.
Added `sanitize-filename` dependency to `package.json`.
2021-01-21 00:02:15 +13:00
G.Ambatte
7fccb7e03e Shift functionality to new file in attempt to reduce code duplication in server.js 2021-01-17 22:07:26 +13:00
G.Ambatte
715ddf2b8c Initial commit 2021-01-17 18:52:56 +13:00
G.Ambatte
717a5886cf Merge branch 'master' of https://github.com/G-Ambatte/homebrewery 2021-01-17 17:23:18 +13:00
G.Ambatte
407232c708 Fix for MongoDB package update breaking install script
Change to enable use of rcvars for NODE_ENV and PORT
2021-01-17 17:19:24 +13:00
G.Ambatte
edd902397e Remove hanging comma in config.json
Change default port assignment from 8000 to 8001 in config.json and FreeBSD service config
2021-01-17 17:19:24 +13:00
G.Ambatte
24f5fcb5a0 Move NODE_ENV to service file; remove from server.js and config/default.json 2021-01-17 17:19:24 +13:00
G.Ambatte
8f6270723e Update server.js
Lint is happy, now attempting to pacify CircleCI
2021-01-17 17:19:24 +13:00
G.Ambatte
9cccd2d74e Update server.js
Eliminating unnecessary debugging code, reducing line count and making lint happy :)
2021-01-17 17:19:24 +13:00
G.Ambatte
ed34b65dbd Update homebrewery
Add `dev_mode` to the HomeBrewery service, which starts the HomeBrewery project in live rebuild mode.
2021-01-17 17:19:23 +13:00
G.Ambatte
4484cc7d16 Change install directory
Change of install directory to `/usr/local/homebrewery`
2021-01-17 17:19:23 +13:00
G.Ambatte
8677994fb7 Update install.sh
Change to main project repo, on assumption that the PR will be merged at some point
2021-01-17 17:19:23 +13:00
G.Ambatte
ea555eb410 Remove --force option
Remove --force option from `npm audit fix`. While this has not caused any issues to date, there is no guarantee that it will continue to be the case.
2021-01-17 17:19:23 +13:00
G.Ambatte
e140b656a6 Update server.js
Change to setting NODE_ENV; default to 'local' if not set via environment variable or in the config file.
2021-01-17 17:19:23 +13:00
G.Ambatte
6423d909d7 Remove environment variables from rc.d
Remove environment variables from rc.d as they are now in config/default.json.
2021-01-17 17:19:23 +13:00
G.Ambatte
8887961d09 Add config items
Add config items and default values:
- web_port (8001)
- environment (local)
2021-01-17 17:19:17 +13:00
G.Ambatte
4ee891a3ba Update install.sh
Switch to latest version of MongoDB
2021-01-17 17:19:11 +13:00
G.Ambatte
96b976fd4a Update install.sh 2021-01-17 17:19:11 +13:00
G.Ambatte
1b9d46f834 Create install.sh 2021-01-17 17:19:10 +13:00
G.Ambatte
ba600f5da6 FreeBSD installation (#1165)
* Update server.js

Eliminate requirement to CD into project directory prior to running `npm start` or `node server.js`.

* Add rc.d daemon script

Adds a RC.d daemon script to control the HomeBrewery status. Based on Andrew Pearson's Node-RED script for the same purpose.

* Create install.sh

* Update install.sh

* Update install.sh

Switch to latest version of MongoDB

* Add config items

Add config items and default values:
- web_port (8001)
- environment (local)

* Remove environment variables from rc.d

Remove environment variables from rc.d as they are now in config/default.json.

* Update server.js

Change to setting NODE_ENV; default to 'local' if not set via environment variable or in the config file.

* Remove --force option

Remove --force option from `npm audit fix`. While this has not caused any issues to date, there is no guarantee that it will continue to be the case.

* Create README.FREEBSD.md

Initial write up of install instructions. Includes instruction to `wget` from the `naturalcrit/homebrewery` project rather than the FreeBSD fork, on the assumption that the PR will be merged at some point.

* Update install.sh

Change to main project repo, on assumption that the PR will be merged at some point

* Change install directory

Change of install directory to `/usr/local/homebrewery`

* Update homebrewery

Add `dev_mode` to the HomeBrewery service, which starts the HomeBrewery project in live rebuild mode.

* Update server.js

Eliminating unnecessary debugging code, reducing line count and making lint happy :)

* Update server.js

Lint is happy, now attempting to pacify CircleCI

* Move NODE_ENV to service file; remove from server.js and config/default.json

* Remove hanging comma in config.json
Change default port assignment from 8000 to 8001 in config.json and FreeBSD service config

* Add link to FreeBSD install documenation in the main README.md file

* Fix for MongoDB package update breaking install script
Change to enable use of rcvars for NODE_ENV and PORT
2021-01-10 17:44:49 -05:00
G.Ambatte
03e74afe80 Fix for MongoDB package update breaking install script
Change to enable use of rcvars for NODE_ENV and PORT
2021-01-10 17:23:14 +13:00
G.Ambatte
b0c1a5a6b1 Add link to FreeBSD install documenation in the main README.md file 2021-01-10 15:27:04 +13:00
G.Ambatte
3af43164f4 Remove hanging comma in config.json
Change default port assignment from 8000 to 8001 in config.json and FreeBSD service config
2021-01-09 23:03:39 +13:00
G.Ambatte
2a340b7a65 Update coverpage.gen.js (#1173)
Fix for page numbers, footers, and footnotes being on the wrong side of the page after a cover page has been inserted - as per Reddit post: https://redd.it/kncoe7
2021-01-09 02:03:08 -05:00
Alexey Sachkov
2f27aeb77f Update README (#1181)
Added circleci build badge.
Added contribution section.
Refactored the source to fit (mostly) into
80-column limit so it can be nicely read in
terminal applications
2021-01-09 01:24:03 -05:00
G.Ambatte
e394539742 Move NODE_ENV to service file; remove from server.js and config/default.json 2021-01-03 23:57:43 +13:00
dependabot[bot]
1a0f29b6ef Bump ini from 1.3.5 to 1.3.8 (#1153)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-02 18:38:11 -05:00
Trevor Buckner
39b160e202 Update Dependencies (#1178)
* Update Dependencies

* Up version number

* Typo
2021-01-02 18:30:11 -05:00
Trevor Buckner
aa065fa4d8 Do not Server-Side Render the markdown (#1177)
1) Rendering is fast enough on the client we don't need to provide SSR for the brew contents.
2) This leaves our server open to REDOS attacks if users create ridiculously long single lines of text. The Markdown parser slows down with exponential time which becomes noticeable at 10,000+ characters in one line, and at 200,000+ characters will stall the server and eventually crash.
3) This now shows a nice loading circle for the half-second that a page takes to render. If a user tries to load a huge line of text the loading circle will be there instead of a blank white page.
2021-01-02 16:54:50 -05:00
Alexey Sachkov
19ca1db674 Tweak spelling of username on user page (#1175)
Fixes #575
2020-12-31 14:12:16 -05:00
G.Ambatte
bd416233eb Update server.js
Lint is happy, now attempting to pacify CircleCI
2020-12-29 17:57:33 +13:00