Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update packages, node.js version and Dockerfile #84

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
cd7efad
update packages
CybotTM Feb 13, 2020
c50160a
use stages in Dockerfile
CybotTM Feb 13, 2020
d4bbc57
update shebang line; set execute bit for script file;
CybotTM Feb 13, 2020
3bab85b
complete .dockerignore
CybotTM Feb 13, 2020
5c21601
replace docker-start.sh with docker-entrypoint.sh
CybotTM Feb 13, 2020
78fa77b
explizitly name files to COPY into container image - prevent files ad…
CybotTM Feb 13, 2020
3f78802
tweak build stage: move RUNs which most likely change to the bottom, …
CybotTM Feb 13, 2020
2cce8cd
update to node 13
CybotTM Feb 13, 2020
e5b1a93
drop dead code
CybotTM Feb 13, 2020
82ce416
drop obsolete packages
CybotTM Feb 13, 2020
31f4ce5
Bump ini from 1.3.5 to 1.3.8
dependabot[bot] Dec 13, 2020
b9fc6aa
Bump lodash from 4.17.15 to 4.17.21
dependabot[bot] May 11, 2021
7491e9f
Merge branch 'turt2live:master' into master
tripleawwy May 21, 2021
75630f3
Merge pull request #3 from netresearch/dependabot/npm_and_yarn/lodash…
tripleawwy May 21, 2021
02b7291
Merge pull request #2 from netresearch/dependabot/npm_and_yarn/ini-1.3.8
tripleawwy May 21, 2021
af22d3d
SRVUC-40: update package.json and package.json.lock
tripleawwy May 21, 2021
f7ffbc0
SRVUC-40: update operateAliases to use a non boolean input to avoid d…
tripleawwy May 21, 2021
afa0aa4
SRVUC-40: Update Dockerfile to use python3 instead of python package
tripleawwy May 22, 2021
7f87b43
SRVUC-40: Downgrade dependencies to their original versions
TheDevMinerTV May 27, 2021
f9415d8
SRVUC-40: Downgrade to Node.JS v12 since it's LTS
TheDevMinerTV May 27, 2021
6cae922
SRVUC-40: Generate package-lock.json
TheDevMinerTV May 27, 2021
ff421f3
SRVUC-40: Add workflows to build Docker images
TheDevMinerTV May 27, 2021
6b74b93
use indent spaces:2 and remove workflow publish-when-pushed
tripleawwy Jun 2, 2021
d7202e3
add github workflow badge
tripleawwy Jun 2, 2021
bf04cda
Merge pull request #4 from netresearch/SRVUC-40
tripleawwy Jun 2, 2021
7156115
SRVUC-40: remove pushing to DockerHub in GitHub workflows
tripleawwy Jun 2, 2021
7b96aa8
add additional step to get the actual tag
tripleawwy Jun 2, 2021
cdff7bb
Merge branch 'master' of github.com:turt2live/matrix-appservice-webhooks
tripleawwy Jun 3, 2021
376ac1c
adjust GitHub workflow to use variable to push to ghcr
tripleawwy Jun 3, 2021
644b93f
Bump css-what from 5.0.0 to 5.0.1
dependabot[bot] Jun 10, 2021
061795b
Bump striptags from 3.1.1 to 3.2.0
dependabot[bot] Jun 18, 2021
deb9386
Bump matrix-appservice-bridge from 2.6.0 to 2.6.1
dependabot[bot] Jun 21, 2021
5cc03f6
Bump tar from 4.4.13 to 4.4.19
dependabot[bot] Sep 2, 2021
00e938d
Bump nth-check from 2.0.0 to 2.0.1
dependabot[bot] Sep 22, 2021
c4f4d89
Bump i from 0.3.6 to 0.3.7
dependabot[bot] Sep 29, 2021
8ba68e1
fix: upgrade db-migrate-sqlite3 from 0.3.1 to 0.4.0
snyk-bot Dec 17, 2021
91ff4c0
fix: upgrade mime from 2.5.2 to 2.6.0
snyk-bot Dec 17, 2021
032c49f
fix: upgrade node-emoji from 1.10.0 to 1.11.0
snyk-bot Dec 17, 2021
974a5c5
fix: package.json & package-lock.json to reduce vulnerabilities
snyk-bot Apr 28, 2022
5d7145b
Bump qs from 6.5.2 to 6.5.3
dependabot[bot] Dec 6, 2022
ac0347f
Bump moment-timezone from 0.5.33 to 0.5.40
dependabot[bot] Dec 12, 2022
477053e
Bump express from 4.17.1 to 4.17.3
dependabot[bot] Dec 12, 2022
05d43e9
Bump minimatch from 3.0.4 to 3.1.2
dependabot[bot] Dec 12, 2022
1b04465
Bump matrix-js-sdk and matrix-appservice-bridge
dependabot[bot] Dec 20, 2022
334e803
Bump minimist from 1.2.5 to 1.2.7
dependabot[bot] Dec 20, 2022
70c4726
Bump ansi-regex from 5.0.0 to 5.0.1
dependabot[bot] Dec 20, 2022
74efa51
Bump json-schema and jsprim
dependabot[bot] Dec 20, 2022
7dce7be
Bump ssh2 and tunnel-ssh
dependabot[bot] Dec 20, 2022
efe2114
Bump validator and sequelize
dependabot[bot] Dec 20, 2022
3bd43ce
Bump http-cache-semantics from 4.1.0 to 4.1.1
dependabot[bot] Feb 4, 2023
79776b6
Bump sequelize from 6.28.0 to 6.29.0
dependabot[bot] Feb 24, 2023
30132d2
Bump sqlite3 from 5.0.3 to 5.1.5
dependabot[bot] Mar 13, 2023
b45454b
Bump dottie from 2.0.3 to 2.0.4
dependabot[bot] Jun 12, 2023
5e9d14f
Bump semver from 5.7.1 to 5.7.2
dependabot[bot] Jul 12, 2023
3e829ec
Bump postcss from 8.4.20 to 8.4.31
dependabot[bot] Oct 7, 2023
54764fd
Bump ip from 2.0.0 to 2.0.1
dependabot[bot] Feb 20, 2024
168b989
Bump tar and db-migrate-sqlite3
dependabot[bot] Apr 10, 2024
fdd073a
Bump express from 4.17.3 to 4.19.2
dependabot[bot] Mar 28, 2024
931a310
Bump follow-redirects from 1.15.2 to 1.15.6
dependabot[bot] Mar 16, 2024
c9300b8
Bump sanitize-html from 2.8.0 to 2.12.1
dependabot[bot] Mar 1, 2024
95d0ee3
Bump qs and body-parser
dependabot[bot] Apr 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
.git
.gitignore
.travis.yml
README.md
data
Dockerfile
docker-compose.yml
node_modules
logs
LICENSE
PROVISIONING.md
37 changes: 37 additions & 0 deletions .github/workflows/publish.when-tagged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ci

on:
workflow_dispatch:
push:
tags:
- "v*"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: 🔍 Checkout
uses: actions/checkout@v2

- name: ⚙ Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Get latest release version number
id: get_version
uses: battila7/get-version-action@v2

- name: 🔑 Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 🚀 Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.version }}
51 changes: 40 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
FROM node:10-alpine
############################################################
#
# base stage
FROM node:12-alpine AS base

COPY . /
RUN apk upgrade --no-cache
RUN apk add --no-cache ca-certificates


############################################################
#
# build stage - just build the app
FROM base AS build

ENV NODE_ENV=development
RUN apk add --no-cache -t build-deps make gcc g++ python libc-dev wget git dos2unix \
&& apk add --no-cache ca-certificates \
&& cd / \
&& npm install \
&& dos2unix docker-start.sh \
&& chmod +x docker-start.sh \
&& apk del build-deps \
&& ls

RUN apk add --no-cache \
make gcc g++ python3 libc-dev wget git dos2unix

WORKDIR /srv/matrix-appservice-webhooks

COPY package.json ./
COPY package-lock.json ./
COPY index.js ./
COPY src ./src
COPY config ./config
COPY migrations ./migrations

RUN npm install
RUN npm audit fix


############################################################
#
# final stage - put it all together
FROM base AS final

ENV NODE_ENV=production
ENV WEBHOOKS_USER_STORE_PATH=/data/user-store.db
Expand All @@ -19,7 +42,13 @@ ENV WEBHOOKS_DB_CONFIG_PATH=/data/database.json
ENV WEBHOOKS_ENV=docker

WORKDIR /
CMD /docker-start.sh

COPY --from=build /srv/matrix-appservice-webhooks ./
COPY docker-entrypoint.sh /usr/local/bin/
RUN mkdir -p ./db

ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh" ]
CMD [ "node", "index.js", "-p", "9000", "-c", "/data/config.yaml", "-f", "/data/appservice-registration-webhooks.yaml" ]

EXPOSE 9000
VOLUME ["/data"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# matrix-appservice-webhooks

[![TravisCI badge](https://travis-ci.org/turt2live/matrix-appservice-webhooks.svg?branch=master)](https://travis-ci.org/turt2live/matrix-appservice-webhooks)
![example branch parameter](https://github.com/netresearch/matrix-appservice-webhooks/actions/workflows/publish.when-tagged.yml/badge.svg?branch=master)

Slack-compatible webhooks for Matrix. Talk about it on Matrix: [#webhooks:t2bot.io](https://matrix.to/#/#webhooks:t2bot.io)

Expand Down
11 changes: 11 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

set -e

# Migrate the registration file if possible
if [ ! -f "/data/appservice-registration-webhooks.yaml" ] && [ -f "/data/appservice-webhooks-registration.yaml" ]; then
echo "Registration file does not exist - copy old one"
cp -v /data/appservice-webhooks-registration.yaml /data/appservice-registration-webhooks.yaml
fi

exec "$@"
10 changes: 0 additions & 10 deletions docker-start.sh

This file was deleted.

Loading