Skip to content
Extraits de code Groupes Projets

Comparer les révisions

Les modifications sont affichées comme si la révision source était fusionnée avec la révision cible. En savoir plus sur la comparaison des révisions.

Source

Sélectionner le projet cible
No results found
Sélectionner une révision Git
  • cherry-pick-moise
  • develop
  • develop-workaround-old-matrix-download-endpoint-removed
  • rebase-v4
  • renovate/configure
5 résultats

Cible

Sélectionner le projet cible
No results found
Sélectionner une révision Git
  • cherry-pick-moise
  • develop
  • fix-oversized-file-transfer
  • implement-discord-markdown-update
  • matrix-answer-modified-fix
  • matrix-attachment-order-fix
  • matrix-attachments-order-fix
7 résultats
Afficher les modifications

Validations dans la source 135

35 additional commits have been omitted to prevent performance issues.
79 files
+ 3846
2127
Comparer les modifications
  • Côte à côte
  • En ligne

Fichiers

.eslintrc

0 → 100644
+58 −0
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
{
    "parser": "@typescript-eslint/parser",
    "plugins": ["@typescript-eslint"],
    "parserOptions": {
        "ecmaVersion": 9,
        "ecmaFeatures": {
            "jsx": false
        },
        "project": "tsconfig.json"
    },
    "env": {
        "node": true,
        "jasmine": true
    },
    "extends": ["plugin:@typescript-eslint/recommended"],
    "rules": {
        "ordered-imports": "off",
        "no-trailing-spaces": "error",
        "max-classes-per-file": ["warn", 1],
        "object-literal-sort-keys": "off",
        "@typescript-eslint/naming-convention": "warn",
        "@typescript-eslint/no-explicit-any": "error",
        "@typescript-eslint/prefer-for-of": "error",
        "@typescript-eslint/typedef": "warn",
        "@typescript-eslint/no-floating-promises": "error",
        "curly": "error",
        "no-empty": "off",
        "no-invalid-this": "error",
        "@typescript-eslint/no-throw-literal": "warn",
        "prefer-const": "error",
        "indent": ["error", 4],
        "max-lines": ["warn", 500],
        "no-duplicate-imports": "error",
        "@typescript-eslint/array-type": "error",
        "@typescript-eslint/promise-function-async": "error",
        "no-bitwise": "error",
        "no-console": "error",
        "no-debugger": "error",
        "prefer-template": "error",
        // Disable these as they were introduced by @typescript-eslint/recommended
        "@typescript-eslint/no-use-before-define": "off",
        "@typescript-eslint/no-inferrable-types": "off",
        "@typescript-eslint/member-delimiter-style": "off",
        "@typescript-eslint/no-unused-expressions": "off",
        "@typescript-eslint/interface-name-prefix": "off"
    },
    "overrides": [
        {
            "files": [
                "test/**/*"
            ],
            "rules": {
                "@typescript-eslint/no-empty-function": "off",
                "@typescript-eslint/no-explicit-any": "off"
            }
        }
    ]
}

.github/CODEOWNERS

0 → 100644
+1 −0
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
* @matrix-org/bridges
 No newline at end of file
+3 −0
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
<!--
Hi there 👋, please check you've read the [CONTRIBUTING](../CONTRIBUTING.md) guide before submitting a PR (it's worth it, honestly).
-->
+44 −0
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
name: Container Image

on:
  push:
    branches: [ develop ]
    tags: [ 'v*' ]
  pull_request:
    branches: [ develop ]

env:
  IMAGE_NAME: ${{ github.repository }}
  REGISTRY: ghcr.io

jobs:
  push:
    runs-on: ubuntu-latest

    permissions:
      contents: read
      packages: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Log into registry ${{ env.REGISTRY }}
        uses: docker/login-action@v1
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Extract Docker metadata
        id: meta
        uses: docker/metadata-action@v3
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

      - name: Build and push Docker image
        uses: docker/build-push-action@v3
        with:
          push: ${{ github.event_name != 'pull_request' }}
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
+22 −0
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
name: Newsfile

on:
  push:
    branches: ["develop", "release-*"]
  pull_request:
  workflow_dispatch:

jobs:
  changelog:
    if: ${{ github.base_ref == 'develop'  || contains(github.base_ref, 'release-') }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: 0
      - uses: actions/setup-python@v2
      - run: pip install towncrier==21.9.0
      - run: scripts/check-newsfragment
        env:
          PULL_REQUEST_NUMBER: ${{ github.event.number }}
+10 −0
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
name: Contribution requirements

on:
  pull_request:
    types: [opened, edited, synchronize]

jobs:
  signoff:
    uses: matrix-org/backend-meta/.github/workflows/sign-off.yml@v1.4.0
          
+28 −0
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
name: CI

on: [push, pull_request]

jobs:
  lint:
   runs-on: ubuntu-latest
   steps:
    - uses: actions/checkout@v2
    - name: Use Node.js
      uses: actions/setup-node@v1
      with:
        node-version: 16
    - run: yarn
    - run: yarn lint
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node_version: [16, 18]
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node_version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node_version }}
      - run: yarn
      - run: yarn test
+10 −0
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
@@ -38,6 +38,10 @@ jspm_packages
# Optional npm cache directory
.npm

# Optional local Yarn settings
.yarn
.yarnrc

# Optional REPL history
.node_repl_history

@@ -49,3 +53,9 @@ build

*.db
*.db.backup

.vscode/
*.code-workspace

# Local History for Visual Studio Code
.history/

.npmrc

0 → 100644
+2 −0
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
engine-strict = true
@mx-puppet:registry="https://gitlab.com/api/v4/packages/npm/"

.travis.yml

supprimé100644 → 0
+0 −29
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
dist: xenial
language: node_js
install: yarn

cache:
  directories:
    - node_modules

jobs:
  include:
    - stage: lint
      script: yarn lint
      node_js: "14"
    - stage: unit tests
      script: yarn test
      node_js: "12"
    - node_js: "14"
    - stage: coverage
      script: yarn coverage
      node_js: "14"

# NOTE: This is unused atm
# notifications:
#    webhooks:
#        urls:
#            - "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MEhhbGYtU2hvdCUzQWhhbGYtc2hvdC51ay8lMjFxUE5PblVzTnNaclRvRlpxeEIlM0FoYWxmLXNob3QudWs"
#        on_success: change  # always|never|change
#        on_failure: always
#        on_start: never

CHANGELOG.md

0 → 100644
+73 −0
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
3.1.1 (2022-11-10)
==================

Bugfixes
--------

- Fix a crash caused by processing metrics for Matrix events. ([\#869](https://github.com/matrix-org/matrix-appservice-discord/issues/869))


3.1.0 (2022-11-03)
==================

Features
--------

- Adds a config value, in order to disable forwarding room topic changes from Matrix to Discord (`disableRoomTopicNotifications`, false by default). ([\#836](https://github.com/matrix-org/matrix-appservice-discord/issues/836))


Bugfixes
--------

- Include the domain name in the regular expression. ([\#834](https://github.com/matrix-org/matrix-appservice-discord/issues/834))
- Remove usage of unreliable field `age` on events, allowing the bridge to work with non-Synapse homeserver implementations. ([\#842](https://github.com/matrix-org/matrix-appservice-discord/issues/842))
- Prevent crashes when handling messages sent to voice channels. ([\#858](https://github.com/matrix-org/matrix-appservice-discord/issues/858))


3.0.0 (2022-08-12)
==================

Bugfixes
--------

- Make sure we don't lose errors thrown when checking usage limits. ([\#823](https://github.com/matrix-org/matrix-appservice-discord/issues/823))
- Fix Docker instances not starting due to being unable to load a dynamic library in the latest unstable image. ([\#828](https://github.com/matrix-org/matrix-appservice-discord/issues/828))
- Remove matrix.to hyperlinks when relaying non-Discord user mentions to Discord.
  Fix mentioning Matrix users in Discord. ([\#829](https://github.com/matrix-org/matrix-appservice-discord/issues/829))


Deprecations and Removals
-------------------------

- Minimum required Node.js version is now 16. ([\#825](https://github.com/matrix-org/matrix-appservice-discord/issues/825))


Internal Changes
----------------

- Remove unused variables. ([\#657](https://github.com/matrix-org/matrix-appservice-discord/issues/657))
- Add workflow for building docker images, and push new docker images to ghcr.io. ([\#826](https://github.com/matrix-org/matrix-appservice-discord/issues/826))
- Remove `git config` workaround to pull a dependency from github.com. ([\#830](https://github.com/matrix-org/matrix-appservice-discord/issues/830))


2.0.0 (2022-08-05)
==================

Improved Documentation
----------------------

- Update `CONTRIBUTING.md` guide to reference the newly-updated guide for all of the matrix.org bridge repos. ([\#794](https://github.com/matrix-org/matrix-appservice-discord/issues/794))


Deprecations and Removals
-------------------------

- Node.JS 12 is now unsupported, please upgrade to Node.JS 14 or later. Node.JS 16 becomes the new default version. ([\#811](https://github.com/matrix-org/matrix-appservice-discord/issues/811))


Internal Changes
----------------

- Add automatic changelog generation via [Towncrier](https://github.com/twisted/towncrier). ([\#787](https://github.com/matrix-org/matrix-appservice-discord/issues/787))
- Use `yarn` instead of `npm` for package management and scripts. ([\#796](https://github.com/matrix-org/matrix-appservice-discord/issues/796))
- Add new CI workflow to check for signoffs. ([\#818](https://github.com/matrix-org/matrix-appservice-discord/issues/818))
+12 −62
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
Hello! It's awesome that you want to contribute to the Discord bridge, by doing
so you are helping our users and the wider Matrix ecosystem. This document
lists the requirements for your work to be accepted into our repository.
Hi there! Please read the [CONTRIBUTING.md](https://github.com/matrix-org/matrix-appservice-bridge/blob/develop/CONTRIBUTING.md) guide for all matrix.org bridge
projects.

For clarity reasons, work can either be a pull request or an issue. We find
both quite valuable to the project. Please note that your work must abide by
the Apache 2 license found in the LICENSE file.
## matrix-appservice-discord Guidelines

Most importantly we are a welcoming project and will be happy to review any
works, no matter the skill level of the submitter. Everyone must start
somewhere!

## TL;DR

* Always work off the **develop** branch. We won't accept merges into any other branches.

* We follow the [Matrix Code of Conduct](https://matrix.org/docs/guides/code_of_conduct.html) and will not accept or entertain works from individuals who break it. We believe in considerate and respectful members above accepting works, regardless of quality.
  * This includes possible bans from any room(s) involved with the project.
* We are limited to accepting work over Github. Please use its interface when submitting work items.
* Discussion of ideas for the bridge and work items should be in [#discord:half-shot.uk](https://matrix.to/#/#discord:half-shot.uk).
* Everything submitted as a PR should have at least one test, the only exception being non-code items.

@@ -36,53 +22,17 @@ inside the `MatrixEventProcessor` class.
## Setting up

* You will need to [setup the bridge](https://github.com/Half-Shot/matrix-appservice-discord/tree/develop#setup-the-bridge) similarly to how we describe,
  but you should setup a homeserver locally on your development machine. We would recommend [Synapse](https://github.com/matrix-org/synapse#id11).

## Writing an issue

When writing an issue, please be as verbose as you can. Remember the issue is
there to either document a feature request, or report a bug so it can be fixed.
The issue board is NOT there to complain about a broken or missing feature.

We leave it to the author's discretion to decide what to include rather than
provide a template, but good items are:
 * Shorter titles are better than long rambling ones, but please don't make it too vague.
    * A good example is "Ability to bridge an existing matrix room into a discord channel"
 * A brief description of the problem.
    * If you are a user of another person's bridge, please can you let us know the name of the service provider.
    * If you would like to keep the details private, please PM @Half-Shot:half-shot.uk or @sorunome:sorunome.de discreetly.
 * Relevant logging from Synapse/your homeserver AND the bridge (if applicable).
    * The more verbose, the better but please don't include sensitive details like access tokens.
 * A screenshot is always useful.
 * Please mention which direction a failure is in, e.g. Matrix -> Discord, if applicable.

We will assign each issue a tag, which will allow us to categorise the problems.

While we realise some issues are more important than others, please do not "demand"
for an issue to be fixed. Issues will be worked on in the timeframe that best fits
the needs of the team.


## PR Process

We've tried our best to keep the PR process relatively simple:

* Create a new branch based off the `develop` branch.
    * This can be done with `git checkout develop` followed by `git checkout -b featurename`.
* Create a PR on Github, making sure to give a brief discription of your changes and link to the issue it fixes, if any.
    * If your change is not complete but you would like feedback, create it as a draft.
* Ensure the linter and tests are not failing, as we will not accept code that breaks either.
    * If your tests fail and are having trouble fixing them, you may push your changes and we will help you fix them.
    * Github automatically pokes TravisCI to run both linting and tests.
* Someone from the team will review your work and decide what to do with the PR.
    * Usually we will have feedback for the PR and will submit more comments.
    * We may decide to reject it, if a feature does not fit with the project goals.
  but you should setup a homeserver locally on your development machine. We would recommend [Synapse](https://github.com/matrix-org/synapse).
* The bridge uses `yarn` for dependency management and package scripts instead of `npm`.
  For details, view the full setup instructions in the [README](README.md#set-up-the-bridge).

## Testing

Testing the bridge is easy enough, you just need to run `npm run build`,
`npm run lint` and `npm run test`. If all pass without errors, congratulations!
CI will lint and test your code automatically,
but you can save yourself some time by checking locally before submitting code.
Refer to the main matrix.org bridge contributing guide for instructions on how to
[lint](https://github.com/matrix-org/matrix-appservice-bridge/blob/develop/CONTRIBUTING.md#%EF%B8%8F-code-style) and
[test](https://github.com/matrix-org/matrix-appservice-bridge/blob/develop/CONTRIBUTING.md#-tests--ci).

Please bear in mind that you will need to cover the whole, or a reasonable
degree of your code. You can check to see if you have with `npm run
coverage`.
degree of your code. You can check to see if you have with `yarn coverage`.
+5 −5
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
FROM node:14-alpine AS BUILD
FROM node:16-slim AS BUILD
COPY . /tmp/src
# install some dependencies needed for the build process
RUN apk add --no-cache -t build-deps make gcc g++ python ca-certificates libc-dev wget git
RUN apt update && apt install -y build-essential make gcc g++ python3 ca-certificates libc-dev wget git

RUN cd /tmp/src \
    && npm install \
    && npm run build
    && yarn

FROM node:14-alpine
FROM node:16-slim
ENV NODE_ENV=production
COPY --from=BUILD /tmp/src/build /build
COPY --from=BUILD /tmp/src/config /config