Skip to content

Commit a891e2d

Browse files
committed
Merge branch 'edge'
2 parents 95c6530 + ef372e5 commit a891e2d

File tree

28 files changed

+500
-189
lines changed

28 files changed

+500
-189
lines changed

.dockerignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
.git
22
logs
33
.github
4-
docs
4+
_site
5+
.bundle
6+
vendor
7+
docs/.jekyll-cache
58
node_modules
69
coverage
710
.nyc_output
@@ -23,3 +26,4 @@ coverage
2326
!tsconfig.json
2427
!package*.json
2528
!docker/config/**
29+
!_config.yml

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,26 @@ WORKDIR /app
9696

9797
FROM base as build
9898

99+
# copy NPM dependencies and install
99100
COPY --chown=abc:abc package*.json ./
100101
COPY --chown=abc:abc tsconfig.json .
101102

102103
RUN npm install
103104

105+
# copy bundle/jekyll dependencies and docs folder
106+
COPY --chown=abc:abc Gemfile Gemfile.lock _config.yml ./
107+
COPY --chown=abc:abc docs ./docs/
108+
109+
# sassc (a jekll dependency) is very slow to compile bc there are no alpine binaries
110+
# https://github.com/sass/sassc-ruby/issues/189#issuecomment-629758948
111+
# so for now sync used jekyll version with prebuilt binary available in alpine repo
112+
RUN apk add --no-cache --virtual .build-deps \
113+
ruby-jekyll \
114+
&& bundle install \
115+
&& jekyll build -b /docs \
116+
&& apk del .build-deps \
117+
&& rm -rf docs
118+
104119
COPY --chown=abc:abc . /app
105120

106121
RUN npm run build && rm -rf node_modules

Gemfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
source 'https://rubygems.org'
22

3-
gem "jekyll", "~> 4.3" # installed by `gem jekyll`
3+
# sassc (a jekll dependency) is very slow to compile bc there are no alpine binaries
4+
# https://github.com/sass/sassc-ruby/issues/189#issuecomment-629758948
5+
# so for now sync used jekyll version with prebuilt binary available in alpine repo
6+
gem "jekyll", "4.2.2" # installed by `gem jekyll`
47
# gem "webrick" # required when using Ruby >= 3 and Jekyll <= 4.2.2
58

69
gem "just-the-docs", "0.4.0.rc3" # currently the latest pre-release

Gemfile.lock

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,21 @@ GEM
1414
http_parser.rb (0.8.0)
1515
i18n (1.12.0)
1616
concurrent-ruby (~> 1.0)
17-
jekyll (4.3.0)
17+
jekyll (4.2.2)
1818
addressable (~> 2.4)
1919
colorator (~> 1.0)
2020
em-websocket (~> 0.5)
2121
i18n (~> 1.0)
22-
jekyll-sass-converter (>= 2.0, < 4.0)
22+
jekyll-sass-converter (~> 2.0)
2323
jekyll-watch (~> 2.0)
24-
kramdown (~> 2.3, >= 2.3.1)
24+
kramdown (~> 2.3)
2525
kramdown-parser-gfm (~> 1.0)
2626
liquid (~> 4.0)
27-
mercenary (>= 0.3.6, < 0.5)
27+
mercenary (~> 0.4.0)
2828
pathutil (~> 0.9)
29-
rouge (>= 3.0, < 5.0)
29+
rouge (~> 3.0)
3030
safe_yaml (~> 1.0)
31-
terminal-table (>= 1.8, < 4.0)
32-
webrick (~> 1.7)
31+
terminal-table (~> 2.0)
3332
jekyll-default-layout (0.1.5)
3433
jekyll (>= 3.0, < 5.0)
3534
jekyll-optional-front-matter (0.3.2)
@@ -67,22 +66,19 @@ GEM
6766
rb-inotify (0.10.1)
6867
ffi (~> 1.0)
6968
rexml (3.2.5)
70-
rouge (4.0.0)
69+
rouge (3.30.0)
7170
safe_yaml (1.0.5)
7271
sassc (2.4.0)
7372
ffi (~> 1.9)
74-
terminal-table (3.0.2)
75-
unicode-display_width (>= 1.1.1, < 3)
76-
unicode-display_width (2.3.0)
77-
webrick (1.7.0)
73+
terminal-table (2.0.0)
74+
unicode-display_width (~> 1.1, >= 1.1.1)
75+
unicode-display_width (1.8.0)
7876

7977
PLATFORMS
80-
arm64-darwin-21
81-
x86_64-darwin-19
8278
x86_64-linux
8379

8480
DEPENDENCIES
85-
jekyll (~> 4.3)
81+
jekyll (= 4.2.2)
8682
jekyll-default-layout
8783
jekyll-optional-front-matter
8884
jekyll-readme-index
@@ -91,4 +87,4 @@ DEPENDENCIES
9187
just-the-docs (= 0.4.0.rc3)
9288

9389
BUNDLED WITH
94-
2.3.9
90+
2.3.25

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ services:
2424

2525
cache:
2626
image: 'redis:7-alpine'
27+
volumes:
28+
# on linux will need to make sure this directory has correct permissions for container to access
29+
- './data/cache:/data'
2730

2831
database:
2932
image: 'mariadb:10.9.3'

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Overview
3-
permalink: /overview
3+
permalink: /overview.html
44
nav_order: 2
55
---
66

docs/operator/installation.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,22 @@ The included [`docker-compose.yml`](/docker-compose.yml) provides production-rea
5555

5656
#### Setup
5757

58+
The included `docker-compose.yml` file is written for **Docker Compose v2.**
59+
5860
For new installations copy [`config.yaml`](/docker/config/docker-compose/config.yaml) into a folder named `data` in the same folder `docker-compose.yml` will be run from. For users migrating their existing CM instances to docker-compose, copy your existing `config.yaml` into the same `data` folder.
5961

6062
Read through the comments in both `docker-compose.yml` and `config.yaml` and makes changes to any relevant settings (passwords, usernames, etc...). Ensure that any settings used in both files (EX mariaDB passwords) match.
6163

6264
To build and start CM:
6365

6466
```bash
65-
docker-compose up -d
67+
docker compose up -d
6668
```
6769

6870
To include Grafana/Influx dependencies run:
6971

7072
```bash
71-
docker-compose --profile full up -d
73+
docker compose --profile full up -d
7274
```
7375

7476
## Locally

docs/subreddit-configuration/actionTemplating.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,29 @@ All Actions with `content` have access to this data:
5757
| `title` | As comments => the body of the comment. As Submission => title | Test post please ignore |
5858
| `shortTitle` | The same as `title` but truncated to 15 characters | test post pleas... |
5959

60+
#### Common Author
61+
62+
Additionally, `author` has these properties accessible:
63+
64+
| Name | Description | Example |
65+
|----------------|-------------------------------------|----------|
66+
| `age` | (Approximate) Age of account | 3 months |
67+
| `linkKarma` | Amount of link karma | 10 |
68+
| `commentKarma` | Amount of comment karma | 3 |
69+
| `totalKarma` | Combined link+comment karma | 13 |
70+
| `verified` | Does account have a verified email? | true |
71+
72+
NOTE: Accessing these properties may require an additional API call so use sparingly on high-volume comments
73+
74+
##### Example Usage
75+
76+
```
77+
The user {{item.author}} has been a redditor for {{item.author.age}}
78+
```
79+
Produces:
80+
81+
> The user FoxxMD has been a redditor for 3 months
82+
6083
### Submissions
6184

6285
If the **Activity** is a Submission these additional properties are accessible:

package-lock.json

Lines changed: 68 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"@nlpjs/lang-fr": "^4.23.4",
4545
"@nlpjs/language": "^4.22.7",
4646
"@nlpjs/nlp": "^4.23.5",
47+
"@npmcli/promise-spawn": "^6.0.1",
4748
"@stdlib/regexp-regexp": "^0.0.6",
4849
"ajv": "^7.2.4",
4950
"ansi-regex": ">=5.0.1",
@@ -52,6 +53,7 @@
5253
"body-parser": "^1.19.0",
5354
"cache-manager": "^3.4.4",
5455
"cache-manager-redis-store": "^2.0.0",
56+
"command-exists": "^1.2.9",
5557
"commander": "^8.0.0",
5658
"comment-json": "^4.1.1",
5759
"connect-typeorm": "^2.0.0",
@@ -120,6 +122,7 @@
120122
"@types/cache-manager-redis-store": "^2.0.0",
121123
"@types/chai": "^4.3.0",
122124
"@types/chai-as-promised": "^7.1.5",
125+
"@types/command-exists": "^1.2.0",
123126
"@types/cookie-parser": "^1.4.2",
124127
"@types/express": "^4.17.13",
125128
"@types/express-session": "^1.17.4",

0 commit comments

Comments
 (0)