ep_headerauth 1.1.5 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/backend-tests.yml +61 -0
- package/.github/workflows/frontend-tests.yml +92 -0
- package/.github/workflows/npmpublish.yml +56 -7
- package/.travis.yml +70 -68
- package/CONTRIBUTING.md +133 -0
- package/README.md +2 -0
- package/index.js +3 -3
- package/package.json +27 -2
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: "Backend tests"
|
|
2
|
+
|
|
3
|
+
# any branch is useful for testing before a PR is submitted
|
|
4
|
+
on: [push, pull_request]
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
withplugins:
|
|
8
|
+
# run on pushes to any branch
|
|
9
|
+
# run on PRs from external forks
|
|
10
|
+
if: |
|
|
11
|
+
(github.event_name != 'pull_request')
|
|
12
|
+
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
|
13
|
+
name: with Plugins
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/setup-node@v2
|
|
18
|
+
with:
|
|
19
|
+
node-version: 12
|
|
20
|
+
|
|
21
|
+
- name: Install libreoffice
|
|
22
|
+
run: |
|
|
23
|
+
sudo add-apt-repository -y ppa:libreoffice/ppa
|
|
24
|
+
sudo apt update
|
|
25
|
+
sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport
|
|
26
|
+
|
|
27
|
+
# clone etherpad-lite
|
|
28
|
+
- name: Install etherpad core
|
|
29
|
+
uses: actions/checkout@v2
|
|
30
|
+
with:
|
|
31
|
+
repository: ether/etherpad-lite
|
|
32
|
+
|
|
33
|
+
- name: Install all dependencies and symlink for ep_etherpad-lite
|
|
34
|
+
run: src/bin/installDeps.sh
|
|
35
|
+
|
|
36
|
+
- name: Checkout plugin repository
|
|
37
|
+
uses: actions/checkout@v2
|
|
38
|
+
with:
|
|
39
|
+
path: ./node_modules/__tmp
|
|
40
|
+
|
|
41
|
+
- name: Determine plugin name
|
|
42
|
+
id: plugin_name
|
|
43
|
+
run: |
|
|
44
|
+
cd ./node_modules/__tmp
|
|
45
|
+
npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"'
|
|
46
|
+
|
|
47
|
+
- name: Rename plugin directory
|
|
48
|
+
run: |
|
|
49
|
+
mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}"
|
|
50
|
+
env:
|
|
51
|
+
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
|
|
52
|
+
|
|
53
|
+
- name: Install plugin dependencies
|
|
54
|
+
run: |
|
|
55
|
+
cd ./node_modules/"${PLUGIN_NAME}"
|
|
56
|
+
npm ci
|
|
57
|
+
env:
|
|
58
|
+
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
|
|
59
|
+
|
|
60
|
+
- name: Run the backend tests
|
|
61
|
+
run: cd src && npm test
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Publicly credit Sauce Labs because they generously support open source
|
|
2
|
+
# projects.
|
|
3
|
+
name: "frontend tests powered by Sauce Labs"
|
|
4
|
+
|
|
5
|
+
on: [push]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- name: Generate Sauce Labs strings
|
|
13
|
+
id: sauce_strings
|
|
14
|
+
run: |
|
|
15
|
+
printf %s\\n '::set-output name=name::${{github.event.repository.name}} ${{ github.workflow }} - ${{ github.job }}'
|
|
16
|
+
printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}'
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-node@v2
|
|
19
|
+
with:
|
|
20
|
+
node-version: 12
|
|
21
|
+
|
|
22
|
+
- name: Check out Etherpad core
|
|
23
|
+
uses: actions/checkout@v2
|
|
24
|
+
with:
|
|
25
|
+
repository: ether/etherpad-lite
|
|
26
|
+
|
|
27
|
+
- name: Check out the plugin
|
|
28
|
+
uses: actions/checkout@v2
|
|
29
|
+
with:
|
|
30
|
+
path: ./node_modules/__tmp
|
|
31
|
+
|
|
32
|
+
- name: export GIT_HASH to env
|
|
33
|
+
id: environment
|
|
34
|
+
run: |
|
|
35
|
+
cd ./node_modules/__tmp
|
|
36
|
+
echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})"
|
|
37
|
+
|
|
38
|
+
- name: Determine plugin name
|
|
39
|
+
id: plugin_name
|
|
40
|
+
run: |
|
|
41
|
+
cd ./node_modules/__tmp
|
|
42
|
+
npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"'
|
|
43
|
+
|
|
44
|
+
- name: Rename plugin directory
|
|
45
|
+
env:
|
|
46
|
+
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
|
|
47
|
+
run: |
|
|
48
|
+
mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}"
|
|
49
|
+
|
|
50
|
+
- name: Install plugin dependencies
|
|
51
|
+
env:
|
|
52
|
+
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
|
|
53
|
+
run: |
|
|
54
|
+
cd ./node_modules/"${PLUGIN_NAME}"
|
|
55
|
+
npm ci
|
|
56
|
+
|
|
57
|
+
# This must be run after setting up the plugin, otherwise npm will try to
|
|
58
|
+
# hoist common dependencies by removing them from src/node_modules and
|
|
59
|
+
# installing them in the top-level node_modules. As of v6.14.10, npm's hoist
|
|
60
|
+
# logic appears to be buggy, because it sometimes removes dependencies from
|
|
61
|
+
# src/node_modules but fails to add them to the top-level node_modules. Even
|
|
62
|
+
# if npm correctly hoists the dependencies, the hoisting seems to confuse
|
|
63
|
+
# tools such as `npm outdated`, `npm update`, and some ESLint rules.
|
|
64
|
+
- name: Install Etherpad core dependencies
|
|
65
|
+
run: src/bin/installDeps.sh
|
|
66
|
+
|
|
67
|
+
- name: Create settings.json
|
|
68
|
+
run: cp settings.json.template settings.json
|
|
69
|
+
|
|
70
|
+
- name: Disable import/export rate limiting
|
|
71
|
+
run: |
|
|
72
|
+
sed -e '/^ *"importExportRateLimiting":/,/^ *\}/ s/"max":.*/"max": 0/' -i settings.json
|
|
73
|
+
|
|
74
|
+
- name: Remove standard frontend test files
|
|
75
|
+
run: rm -rf src/tests/frontend/specs
|
|
76
|
+
|
|
77
|
+
- uses: saucelabs/sauce-connect-action@v1
|
|
78
|
+
with:
|
|
79
|
+
username: ${{ secrets.SAUCE_USERNAME }}
|
|
80
|
+
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
|
|
81
|
+
tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }}
|
|
82
|
+
|
|
83
|
+
- name: Run the frontend tests
|
|
84
|
+
shell: bash
|
|
85
|
+
env:
|
|
86
|
+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
|
|
87
|
+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
|
|
88
|
+
SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }}
|
|
89
|
+
TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }}
|
|
90
|
+
GIT_HASH: ${{ steps.environment.outputs.sha_short }}
|
|
91
|
+
run: |
|
|
92
|
+
src/tests/frontend/travis/runner.sh
|
|
@@ -4,35 +4,84 @@
|
|
|
4
4
|
name: Node.js Package
|
|
5
5
|
|
|
6
6
|
on:
|
|
7
|
+
pull_request:
|
|
7
8
|
push:
|
|
8
9
|
branches:
|
|
9
10
|
- main
|
|
11
|
+
- master
|
|
10
12
|
|
|
11
13
|
jobs:
|
|
12
|
-
|
|
14
|
+
test:
|
|
13
15
|
runs-on: ubuntu-latest
|
|
14
16
|
steps:
|
|
17
|
+
# Clone ether/etherpad-lite to ../etherpad-lite so that ep_etherpad-lite
|
|
18
|
+
# can be "installed" in this plugin's node_modules. The checkout v2 action
|
|
19
|
+
# doesn't support cloning outside of $GITHUB_WORKSPACE (see
|
|
20
|
+
# https://github.com/actions/checkout/issues/197), so the repo is first
|
|
21
|
+
# cloned to etherpad-lite then moved to ../etherpad-lite. To avoid
|
|
22
|
+
# conflicts with this plugin's clone, etherpad-lite must be cloned and
|
|
23
|
+
# moved out before this plugin's repo is cloned to $GITHUB_WORKSPACE.
|
|
24
|
+
- uses: actions/checkout@v2
|
|
25
|
+
with:
|
|
26
|
+
repository: ether/etherpad-lite
|
|
27
|
+
path: etherpad-lite
|
|
28
|
+
- run: mv etherpad-lite ..
|
|
29
|
+
# etherpad-lite has been moved outside of $GITHUB_WORKSPACE, so it is now
|
|
30
|
+
# safe to clone this plugin's repo to $GITHUB_WORKSPACE.
|
|
15
31
|
- uses: actions/checkout@v2
|
|
16
32
|
- uses: actions/setup-node@v1
|
|
17
33
|
with:
|
|
18
34
|
node-version: 12
|
|
35
|
+
# All of ep_etherpad-lite's devDependencies are installed because the
|
|
36
|
+
# plugin might do `require('ep_etherpad-lite/node_modules/${devDep}')`.
|
|
37
|
+
# Eventually it would be nice to create an ESLint plugin that prohibits
|
|
38
|
+
# Etherpad plugins from piggybacking off of ep_etherpad-lite's
|
|
39
|
+
# devDependencies. If we had that, we could change this line to only
|
|
40
|
+
# install production dependencies.
|
|
41
|
+
- run: cd ../etherpad-lite/src && npm ci
|
|
19
42
|
- run: npm ci
|
|
43
|
+
# This runs some sanity checks and creates a symlink at
|
|
44
|
+
# node_modules/ep_etherpad-lite that points to ../../etherpad-lite/src.
|
|
45
|
+
# This step must be done after `npm ci` installs the plugin's dependencies
|
|
46
|
+
# because npm "helpfully" cleans up such symlinks. :( Installing
|
|
47
|
+
# ep_etherpad-lite in the plugin's node_modules prevents lint errors and
|
|
48
|
+
# unit test failures if the plugin does `require('ep_etherpad-lite/foo')`.
|
|
49
|
+
- run: npm install --no-save ep_etherpad-lite@file:../etherpad-lite/src
|
|
20
50
|
- run: npm test
|
|
51
|
+
- run: npm run lint
|
|
21
52
|
|
|
22
53
|
publish-npm:
|
|
23
|
-
|
|
54
|
+
if: github.event_name == 'push'
|
|
55
|
+
needs: test
|
|
24
56
|
runs-on: ubuntu-latest
|
|
25
57
|
steps:
|
|
26
58
|
- uses: actions/checkout@v2
|
|
59
|
+
with:
|
|
60
|
+
fetch-depth: 0
|
|
27
61
|
- uses: actions/setup-node@v1
|
|
28
62
|
with:
|
|
29
63
|
node-version: 12
|
|
30
64
|
registry-url: https://registry.npmjs.org/
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
65
|
+
- name: Bump version (patch)
|
|
66
|
+
run: |
|
|
67
|
+
LATEST_TAG=$(git describe --tags --abbrev=0) || exit 1
|
|
68
|
+
NEW_COMMITS=$(git rev-list --count "${LATEST_TAG}"..) || exit 1
|
|
69
|
+
[ "${NEW_COMMITS}" -gt 0 ] || exit 0
|
|
70
|
+
git config user.name 'github-actions[bot]'
|
|
71
|
+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
|
72
|
+
npm ci
|
|
73
|
+
npm version patch
|
|
74
|
+
git push --follow-tags
|
|
75
|
+
# `npm publish` must come after `git push` otherwise there is a race
|
|
76
|
+
# condition: If two PRs are merged back-to-back then master/main will be
|
|
77
|
+
# updated with the commits from the second PR before the first PR's
|
|
78
|
+
# workflow has a chance to push the commit generated by `npm version
|
|
79
|
+
# patch`. This causes the first PR's `git push` step to fail after the
|
|
80
|
+
# package has already been published, which in turn will cause all future
|
|
81
|
+
# workflow runs to fail because they will all attempt to use the same
|
|
82
|
+
# already-used version number. By running `npm publish` after `git push`,
|
|
83
|
+
# back-to-back merges will cause the first merge's workflow to fail but
|
|
84
|
+
# the second's will succeed.
|
|
35
85
|
- run: npm publish
|
|
36
86
|
env:
|
|
37
87
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
38
|
-
- run: git push --follow-tags
|
package/.travis.yml
CHANGED
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
language: node_js
|
|
2
|
-
|
|
3
|
-
node_js:
|
|
4
|
-
- "lts/*"
|
|
5
|
-
|
|
6
|
-
cache: false
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
install:
|
|
36
|
-
- "npm install"
|
|
37
|
-
- "mkdir ep_headerauth"
|
|
38
|
-
- "mv !(ep_headerauth) ep_headerauth"
|
|
39
|
-
- "git clone https://github.com/ether/etherpad-lite.git etherpad"
|
|
40
|
-
- "cd etherpad"
|
|
41
|
-
- "mkdir node_modules"
|
|
42
|
-
- "mv ../ep_headerauth node_modules"
|
|
43
|
-
- "bin/installDeps.sh"
|
|
44
|
-
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
|
|
45
|
-
- "cd src && npm install && cd -"
|
|
46
|
-
script:
|
|
47
|
-
- "tests/frontend/travis/runnerBackend.sh"
|
|
48
|
-
- name: "Test the Frontend"
|
|
49
|
-
|
|
50
|
-
- "
|
|
51
|
-
|
|
52
|
-
- "
|
|
53
|
-
- "
|
|
54
|
-
- "
|
|
55
|
-
- "
|
|
56
|
-
- "
|
|
57
|
-
- "
|
|
58
|
-
- "
|
|
59
|
-
|
|
60
|
-
- "
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
1
|
+
language: node_js
|
|
2
|
+
|
|
3
|
+
node_js:
|
|
4
|
+
- "lts/*"
|
|
5
|
+
|
|
6
|
+
cache: false
|
|
7
|
+
|
|
8
|
+
services:
|
|
9
|
+
- docker
|
|
10
|
+
|
|
11
|
+
install:
|
|
12
|
+
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
|
|
13
|
+
|
|
14
|
+
#script:
|
|
15
|
+
# - "tests/frontend/travis/runner.sh"
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
global:
|
|
19
|
+
- secure: "WMGxFkOeTTlhWB+ChMucRtIqVmMbwzYdNHuHQjKCcj8HBEPdZLfCuK/kf4rG\nVLcLQiIsyllqzNhBGVHG1nyqWr0/LTm8JRqSCDDVIhpyzp9KpCJQQJG2Uwjk\n6/HIJJh/wbxsEdLNV2crYU/EiVO3A4Bq0YTHUlbhUqG3mSCr5Ec="
|
|
20
|
+
- secure: "gejXUAHYscbR6Bodw35XexpToqWkv2ifeECsbeEmjaLkYzXmUUNWJGknKSu7\nEUsSfQV8w+hxApr1Z+jNqk9aX3K1I4btL3cwk2trnNI8XRAvu1c1Iv60eerI\nkE82Rsd5lwUaMEh+/HoL8ztFCZamVndoNgX7HWp5J/NRZZMmh4g="
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
include:
|
|
24
|
+
- name: "Lint test package-lock"
|
|
25
|
+
install:
|
|
26
|
+
- "npm install lockfile-lint"
|
|
27
|
+
script:
|
|
28
|
+
- npx lockfile-lint --path package-lock.json --validate-https --allowed-hosts npm
|
|
29
|
+
- name: "Run the Backend tests"
|
|
30
|
+
before_install:
|
|
31
|
+
- sudo add-apt-repository -y ppa:libreoffice/ppa
|
|
32
|
+
- sudo apt-get update
|
|
33
|
+
- sudo apt-get -y install libreoffice
|
|
34
|
+
- sudo apt-get -y install libreoffice-pdfimport
|
|
35
|
+
install:
|
|
36
|
+
- "npm install"
|
|
37
|
+
- "mkdir ep_headerauth"
|
|
38
|
+
- "mv !(ep_headerauth) ep_headerauth"
|
|
39
|
+
- "git clone https://github.com/ether/etherpad-lite.git etherpad"
|
|
40
|
+
- "cd etherpad"
|
|
41
|
+
- "mkdir -p node_modules"
|
|
42
|
+
- "mv ../ep_headerauth node_modules"
|
|
43
|
+
- "bin/installDeps.sh"
|
|
44
|
+
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
|
|
45
|
+
- "cd src && npm install && cd -"
|
|
46
|
+
script:
|
|
47
|
+
- "tests/frontend/travis/runnerBackend.sh"
|
|
48
|
+
- name: "Test the Frontend"
|
|
49
|
+
before_script:
|
|
50
|
+
- "tests/frontend/travis/sauce_tunnel.sh"
|
|
51
|
+
install:
|
|
52
|
+
- "npm install"
|
|
53
|
+
- "mkdir ep_headerauth"
|
|
54
|
+
- "mv !(ep_headerauth) ep_headerauth"
|
|
55
|
+
- "git clone https://github.com/ether/etherpad-lite.git etherpad"
|
|
56
|
+
- "cd etherpad"
|
|
57
|
+
- "mkdir -p node_modules"
|
|
58
|
+
- "mv ../ep_headerauth node_modules"
|
|
59
|
+
- "bin/installDeps.sh"
|
|
60
|
+
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
|
|
61
|
+
script:
|
|
62
|
+
- "tests/frontend/travis/runner.sh"
|
|
63
|
+
|
|
64
|
+
notifications:
|
|
65
|
+
irc:
|
|
66
|
+
channels:
|
|
67
|
+
- "irc.freenode.org#etherpad-lite-dev"
|
|
68
|
+
|
|
69
|
+
##ETHERPAD_TRAVIS_V=9
|
|
70
|
+
## Travis configuration automatically created using bin/plugins/updateAllPluginsScript.sh
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Contributor Guidelines
|
|
2
|
+
(Please talk to people on the mailing list before you change this page, see our section on [how to get in touch](https://github.com/ether/etherpad-lite#get-in-touch))
|
|
3
|
+
|
|
4
|
+
## Pull requests
|
|
5
|
+
|
|
6
|
+
* the commit series in the PR should be _linear_ (it **should not contain merge commits**). This is necessary because we want to be able to [bisect](https://en.wikipedia.org/wiki/Bisection_(software_engineering)) bugs easily. Rewrite history/perform a rebase if necessary
|
|
7
|
+
* PRs should be issued against the **develop** branch: we never pull directly into **master**
|
|
8
|
+
* PRs **should not have conflicts** with develop. If there are, please resolve them rebasing and force-pushing
|
|
9
|
+
* when preparing your PR, please make sure that you have included the relevant **changes to the documentation** (preferably with usage examples)
|
|
10
|
+
* contain meaningful and detailed **commit messages** in the form:
|
|
11
|
+
```
|
|
12
|
+
submodule: description
|
|
13
|
+
|
|
14
|
+
longer description of the change you have made, eventually mentioning the
|
|
15
|
+
number of the issue that is being fixed, in the form: Fixes #someIssueNumber
|
|
16
|
+
```
|
|
17
|
+
* if the PR is a **bug fix**:
|
|
18
|
+
* the first commit in the series must be a test that shows the failure
|
|
19
|
+
* subsequent commits will fix the bug and make the test pass
|
|
20
|
+
* the final commit message should include the text `Fixes: #xxx` to link it to its bug report
|
|
21
|
+
* think about stability: code has to be backwards compatible as much as possible. Always **assume your code will be run with an older version of the DB/config file**
|
|
22
|
+
* if you want to remove a feature, **deprecate it instead**:
|
|
23
|
+
* write an issue with your deprecation plan
|
|
24
|
+
* output a `WARN` in the log informing that the feature is going to be removed
|
|
25
|
+
* remove the feature in the next version
|
|
26
|
+
* if you want to add a new feature, put it under a **feature flag**:
|
|
27
|
+
* once the new feature has reached a minimal level of stability, do a PR for it, so it can be integrated early
|
|
28
|
+
* expose a mechanism for enabling/disabling the feature
|
|
29
|
+
* the new feature should be **disabled** by default. With the feature disabled, the code path should be exactly the same as before your contribution. This is a __necessary condition__ for early integration
|
|
30
|
+
* think of the PR not as something that __you wrote__, but as something that __someone else is going to read__. The commit series in the PR should tell a novice developer the story of your thoughts when developing it
|
|
31
|
+
|
|
32
|
+
## How to write a bug report
|
|
33
|
+
|
|
34
|
+
* Please be polite, we all are humans and problems can occur.
|
|
35
|
+
* Please add as much information as possible, for example
|
|
36
|
+
* client os(s) and version(s)
|
|
37
|
+
* browser(s) and version(s), is the problem reproducible on different clients
|
|
38
|
+
* special environments like firewalls or antivirus
|
|
39
|
+
* host os and version
|
|
40
|
+
* npm and nodejs version
|
|
41
|
+
* Logfiles if available
|
|
42
|
+
* steps to reproduce
|
|
43
|
+
* what you expected to happen
|
|
44
|
+
* what actually happened
|
|
45
|
+
* Please format logfiles and code examples with markdown see github Markdown help below the issue textarea for more information.
|
|
46
|
+
|
|
47
|
+
If you send logfiles, please set the loglevel switch DEBUG in your settings.json file:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
/* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */
|
|
51
|
+
"loglevel": "DEBUG",
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The logfile location is defined in startup script or the log is directly shown in the commandline after you have started etherpad.
|
|
55
|
+
|
|
56
|
+
## General goals of Etherpad
|
|
57
|
+
To make sure everybody is going in the same direction:
|
|
58
|
+
* easy to install for admins and easy to use for people
|
|
59
|
+
* easy to integrate into other apps, but also usable as standalone
|
|
60
|
+
* lightweight and scalable
|
|
61
|
+
* extensible, as much functionality should be extendable with plugins so changes don't have to be done in core.
|
|
62
|
+
Also, keep it maintainable. We don't wanna end up as the monster Etherpad was!
|
|
63
|
+
|
|
64
|
+
## How to work with git?
|
|
65
|
+
* Don't work in your master branch.
|
|
66
|
+
* Make a new branch for every feature you're working on. (This ensures that you can work you can do lots of small, independent pull requests instead of one big one with complete different features)
|
|
67
|
+
* Don't use the online edit function of github (this only creates ugly and not working commits!)
|
|
68
|
+
* Try to make clean commits that are easy readable (including descriptive commit messages!)
|
|
69
|
+
* Test before you push. Sounds easy, it isn't!
|
|
70
|
+
* Don't check in stuff that gets generated during build or runtime
|
|
71
|
+
* Make small pull requests that are easy to review but make sure they do add value by themselves / individually
|
|
72
|
+
|
|
73
|
+
## Coding style
|
|
74
|
+
* Do write comments. (You don't have to comment every line, but if you come up with something that's a bit complex/weird, just leave a comment. Bear in mind that you will probably leave the project at some point and that other people will read your code. Undocumented huge amounts of code are worthless!)
|
|
75
|
+
* Never ever use tabs
|
|
76
|
+
* Indentation: JS/CSS: 2 spaces; HTML: 4 spaces
|
|
77
|
+
* Don't overengineer. Don't try to solve any possible problem in one step, but try to solve problems as easy as possible and improve the solution over time!
|
|
78
|
+
* Do generalize sooner or later! (if an old solution, quickly hacked together, poses more problems than it solves today, refactor it!)
|
|
79
|
+
* Keep it compatible. Do not introduce changes to the public API, db schema or configurations too lightly. Don't make incompatible changes without good reasons!
|
|
80
|
+
* If you do make changes, document them! (see below)
|
|
81
|
+
* Use protocol independent urls "//"
|
|
82
|
+
|
|
83
|
+
## Branching model / git workflow
|
|
84
|
+
see git flow http://nvie.com/posts/a-successful-git-branching-model/
|
|
85
|
+
|
|
86
|
+
### `master` branch
|
|
87
|
+
* the stable
|
|
88
|
+
* This is the branch everyone should use for production stuff
|
|
89
|
+
|
|
90
|
+
### `develop`branch
|
|
91
|
+
* everything that is READY to go into master at some point in time
|
|
92
|
+
* This stuff is tested and ready to go out
|
|
93
|
+
|
|
94
|
+
### release branches
|
|
95
|
+
* stuff that should go into master very soon
|
|
96
|
+
* only bugfixes go into these (see http://nvie.com/posts/a-successful-git-branching-model/ for why)
|
|
97
|
+
* we should not be blocking new features to develop, just because we feel that we should be releasing it to master soon. This is the situation that release branches solve/handle.
|
|
98
|
+
|
|
99
|
+
### hotfix branches
|
|
100
|
+
* fixes for bugs in master
|
|
101
|
+
|
|
102
|
+
### feature branches (in your own repos)
|
|
103
|
+
* these are the branches where you develop your features in
|
|
104
|
+
* If it's ready to go out, it will be merged into develop
|
|
105
|
+
|
|
106
|
+
Over the time we pull features from feature branches into the develop branch. Every month we pull from develop into master. Bugs in master get fixed in hotfix branches. These branches will get merged into master AND develop. There should never be commits in master that aren't in develop
|
|
107
|
+
|
|
108
|
+
## Documentation
|
|
109
|
+
The docs are in the `doc/` folder in the git repository, so people can easily find the suitable docs for the current git revision.
|
|
110
|
+
|
|
111
|
+
Documentation should be kept up-to-date. This means, whenever you add a new API method, add a new hook or change the database model, pack the relevant changes to the docs in the same pull request.
|
|
112
|
+
|
|
113
|
+
You can build the docs e.g. produce html, using `make docs`. At some point in the future we will provide an online documentation. The current documentation in the github wiki should always reflect the state of `master` (!), since there are no docs in master, yet.
|
|
114
|
+
|
|
115
|
+
## Testing
|
|
116
|
+
Front-end tests are found in the `tests/frontend/` folder in the repository. Run them by pointing your browser to `<yourdomainhere>/tests/frontend`.
|
|
117
|
+
|
|
118
|
+
Back-end tests can be run from the `src` directory, via `npm test`.
|
|
119
|
+
|
|
120
|
+
## Things you can help with
|
|
121
|
+
Etherpad is much more than software. So if you aren't a developer then worry not, there is still a LOT you can do! A big part of what we do is community engagement. You can help in the following ways
|
|
122
|
+
* Triage bugs (applying labels) and confirming their existence
|
|
123
|
+
* Testing fixes (simply applying them and seeing if it fixes your issue or not) - Some git experience required
|
|
124
|
+
* Notifying large site admins of new releases
|
|
125
|
+
* Writing Changelogs for releases
|
|
126
|
+
* Creating Windows packages
|
|
127
|
+
* Creating releases
|
|
128
|
+
* Bumping dependencies periodically and checking they don't break anything
|
|
129
|
+
* Write proposals for grants
|
|
130
|
+
* Co-Author and Publish CVEs
|
|
131
|
+
* Work with SFC to maintain legal side of project
|
|
132
|
+
* Maintain TODO page - https://github.com/ether/etherpad-lite/wiki/TODO#IMPORTANT_TODOS
|
|
133
|
+
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
 
|
|
2
|
+
|
|
1
3
|
# `ep_headerauth`
|
|
2
4
|
|
|
3
5
|
Etherpad plugin to use a reverse proxy's HTTP headers for authentication.
|
package/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
1
3
|
// Copyright 2020 Richard Hansen
|
|
2
4
|
//
|
|
3
5
|
// Licensed under the Apache License, Version 2.0 (the "License"); you
|
|
@@ -12,8 +14,6 @@
|
|
|
12
14
|
// implied. See the License for the specific language governing
|
|
13
15
|
// permissions and limitations under the License.
|
|
14
16
|
|
|
15
|
-
/* global exports, require */
|
|
16
|
-
|
|
17
17
|
const authorManager = require('ep_etherpad-lite/node/db/AuthorManager');
|
|
18
18
|
const log4js = require('ep_etherpad-lite/node_modules/log4js');
|
|
19
19
|
|
|
@@ -32,7 +32,7 @@ exports.authenticate = (hookName, {req}, cb) => {
|
|
|
32
32
|
if (username == null) {
|
|
33
33
|
logger.warn(`authenticate: Failed authentication from IP ${req.ip}: ` +
|
|
34
34
|
`the ${hs.username_header} header is missing`);
|
|
35
|
-
for (const hdr
|
|
35
|
+
for (const hdr of Object.keys(req.headers)) {
|
|
36
36
|
logger.debug(`authenticate: Header: ${hdr}: ${req.headers[hdr]}`);
|
|
37
37
|
}
|
|
38
38
|
return cb([]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ep_headerauth",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "Etherpad plugin to use a reverse proxy's HTTP headers for authentication.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auth",
|
|
@@ -22,6 +22,31 @@
|
|
|
22
22
|
"dependencies": {},
|
|
23
23
|
"funding": {
|
|
24
24
|
"type": "individual",
|
|
25
|
-
"url": "
|
|
25
|
+
"url": "https://etherpad.org/"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"eslint": "^7.32.0",
|
|
29
|
+
"eslint-config-etherpad": "^2.0.2",
|
|
30
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
31
|
+
"eslint-plugin-mocha": "^9.0.0",
|
|
32
|
+
"eslint-plugin-node": "^11.1.0",
|
|
33
|
+
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
34
|
+
"eslint-plugin-promise": "^5.1.1",
|
|
35
|
+
"eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0",
|
|
36
|
+
"eslint-plugin-cypress": "^2.12.1"
|
|
37
|
+
},
|
|
38
|
+
"eslintConfig": {
|
|
39
|
+
"root": true,
|
|
40
|
+
"extends": "etherpad/plugin"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"lint": "eslint .",
|
|
44
|
+
"lint:fix": "eslint --fix ."
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=12.13.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"ep_etherpad-lite": ">=1.8.6"
|
|
26
51
|
}
|
|
27
52
|
}
|