Rename amp->line

This commit is contained in:
Andrew Ferrazzutti 2021-02-26 01:28:54 -05:00
parent 83a0545667
commit 9033ec856b
34 changed files with 83 additions and 84 deletions

View File

@ -31,19 +31,19 @@ RUN apk add --no-cache \
chmod +x yq && mv yq /usr/bin/yq chmod +x yq && mv yq /usr/bin/yq
COPY requirements.txt /opt/mautrix-amp/requirements.txt COPY requirements.txt /opt/mautrix-line/requirements.txt
COPY optional-requirements.txt /opt/mautrix-amp/optional-requirements.txt COPY optional-requirements.txt /opt/mautrix-line/optional-requirements.txt
WORKDIR /opt/mautrix-amp WORKDIR /opt/mautrix-line
RUN apk add --virtual .build-deps python3-dev libffi-dev build-base \ RUN apk add --virtual .build-deps python3-dev libffi-dev build-base \
&& pip3 install -r requirements.txt -r optional-requirements.txt \ && pip3 install -r requirements.txt -r optional-requirements.txt \
&& apk del .build-deps && apk del .build-deps
COPY . /opt/mautrix-amp COPY . /opt/mautrix-line
RUN apk add git && pip3 install .[e2be] && apk del git \ RUN apk add git && pip3 install .[e2be] && apk del git \
# This doesn't make the image smaller, but it's needed so that the `version` command works properly # This doesn't make the image smaller, but it's needed so that the `version` command works properly
&& cp mautrix_amp/example-config.yaml . && rm -rf mautrix_amp && cp mautrix_line/example-config.yaml . && rm -rf mautrix_line
VOLUME /data VOLUME /data
ENV UID=1337 GID=1337 ENV UID=1337 GID=1337
CMD ["/opt/mautrix-amp/docker-run.sh"] CMD ["/opt/mautrix-line/docker-run.sh"]

View File

@ -1,5 +1,4 @@
# mautrix-amp # mautrix-line
A very hacky Matrix-SMS bridge based on running Android Messages for Web in Puppeteer. A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
This project is temporary and will eventually be replaced by a separate Android app.
Matrix room: [`#maunium:maunium.net`](https://matrix.to/#/#maunium:maunium.net) Matrix room: [`#mautrix-line:miscworks.net`](https://matrix.to/#/#matrix-line:miscworks.net)

View File

@ -2,10 +2,10 @@
# Define functions. # Define functions.
function fixperms { function fixperms {
chown -R $UID:$GID /data /opt/mautrix-amp chown -R $UID:$GID /data /opt/mautrix-line
} }
cd /opt/mautrix-amp cd /opt/mautrix-line
if [ ! -f /data/config.yaml ]; then if [ ! -f /data/config.yaml ]; then
cp example-config.yaml /data/config.yaml cp example-config.yaml /data/config.yaml
@ -18,7 +18,7 @@ if [ ! -f /data/config.yaml ]; then
fi fi
if [ ! -f /data/registration.yaml ]; then if [ ! -f /data/registration.yaml ]; then
python3 -m mautrix_amp -g -c /data/config.yaml -r /data/registration.yaml python3 -m mautrix_line -g -c /data/config.yaml -r /data/registration.yaml
echo "Didn't find a registration file." echo "Didn't find a registration file."
echo "Generated one for you." echo "Generated one for you."
echo "Copy that over to synapses app service directory." echo "Copy that over to synapses app service directory."
@ -27,4 +27,4 @@ if [ ! -f /data/registration.yaml ]; then
fi fi
fixperms fixperms
exec su-exec $UID:$GID python3 -m mautrix_amp -c /data/config.yaml exec su-exec $UID:$GID python3 -m mautrix_line -c /data/config.yaml

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
@ -31,12 +31,12 @@ from . import commands as _
class MessagesBridge(Bridge): class MessagesBridge(Bridge):
module = "mautrix_line" module = "mautrix_line"
name = "mautrix-amp" name = "mautrix-line"
command = "python -m mautrix-amp" command = "python -m mautrix-line"
description = ("A very hacky Matrix-SMS bridge based on using " description = ("A very hacky Matrix-LINE bridge based on running "
"Android Messages for Web in Puppeteer.") "LINE's Chrome extension in Puppeteer.")
repo_url = "https://github.com/tulir/mautrix-amp" repo_url = "git://miscworks.net/mautrix-line"
real_user_content_key = "net.maunium.amp.puppet" real_user_content_key = "net.miscworks.line.puppet"
version = version version = version
markdown_version = linkified_version markdown_version = linkified_version
config_class = Config config_class = Config

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -139,7 +139,7 @@ puppeteer:
# Either unix or tcp # Either unix or tcp
type: unix type: unix
# Only for type: unix # Only for type: unix
path: /var/run/mautrix-amp/puppet.sock path: /var/run/mautrix-line/puppet.sock
# Only for type: tcp # Only for type: tcp
host: localhost host: localhost
port: 29395 port: 29395
@ -152,7 +152,7 @@ logging:
version: 1 version: 1
formatters: formatters:
colored: colored:
(): mautrix_amp.util.ColorFormatter (): mautrix_line.util.ColorFormatter
format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s" format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
normal: normal:
format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s" format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
@ -160,7 +160,7 @@ logging:
file: file:
class: logging.handlers.RotatingFileHandler class: logging.handlers.RotatingFileHandler
formatter: normal formatter: normal
filename: ./mautrix-amp.log filename: ./mautrix-line.log
maxBytes: 10485760 maxBytes: 10485760
backupCount: 10 backupCount: 10
console: console:

View File

@ -19,7 +19,7 @@ def run(cmd):
if os.path.exists(".git") and shutil.which("git"): if os.path.exists(".git") and shutil.which("git"):
try: try:
git_revision = run(["git", "rev-parse", "HEAD"]).strip().decode("ascii") git_revision = run(["git", "rev-parse", "HEAD"]).strip().decode("ascii")
git_revision_url = f"https://github.com/tulir/mautrix-amp/commit/{git_revision}" git_revision_url = f"git://miscworks.net/mautrix-line/commit/{git_revision}"
git_revision = git_revision[:8] git_revision = git_revision[:8]
except (subprocess.SubprocessError, OSError): except (subprocess.SubprocessError, OSError):
git_revision = "unknown" git_revision = "unknown"

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer # mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
# Copyright (C) 2020 Tulir Asokan # Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by

View File

@ -7,11 +7,11 @@ RUN echo $'\
RUN apk add --no-cache chromium@edge RUN apk add --no-cache chromium@edge
WORKDIR /opt/mautrix-amp/puppet WORKDIR /opt/mautrix-line/puppet
RUN chown node:node /opt/mautrix-amp/puppet RUN chown node:node /opt/mautrix-line/puppet
USER node USER node
COPY package.json yarn.lock ./ COPY package.json yarn.lock ./
RUN yarn --production && rm -rf node_modules/puppeteer/.local-chromium RUN yarn --production && rm -rf node_modules/puppeteer/.local-chromium
COPY . /opt/mautrix-amp/puppet COPY . /opt/mautrix-line/puppet
CMD ["yarn", "start", "--config", "/data/config.json", "--browser", "/usr/lib/chromium/chrome", "--no-sandbox"] CMD ["yarn", "start", "--config", "/data/config.json", "--browser", "/usr/lib/chromium/chrome", "--no-sandbox"]

View File

@ -1,7 +1,7 @@
{ {
"listen": { "listen": {
"type": "unix", "type": "unix",
"path": "/var/run/mautrix-amp/puppet.sock" "path": "/var/run/mautrix-line/puppet.sock"
}, },
"profile_dir": "./profiles", "profile_dir": "./profiles",
"disable_debug": true, "disable_debug": true,

View File

@ -1,16 +1,16 @@
{ {
"name": "mautrix-amp-puppeteer", "name": "mautrix-line-puppeteer",
"version": "0.1.0", "version": "0.1.0",
"description": "Puppeteer module for mautrix-amp", "description": "Puppeteer module for mautrix-line",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://mau.dev/tulir/mautrix-amp.git" "url": "git://miscworks.net/mautrix-line.git"
}, },
"type": "module", "type": "module",
"main": "src/main.js", "main": "src/main.js",
"author": "Tulir Asokan <tulir@maunium.net>", "author": "Andrew Ferrazzutti <fair@miscworks.net>",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"homepage": "https://mau.dev/tulir/mautrix-amp", "homepage": "https://miscworks.net/dir/mautrix-line",
"scripts": { "scripts": {
"start": "node ./src/main.js" "start": "node ./src/main.js"
}, },

View File

@ -1,5 +1,5 @@
// mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer // mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
// Copyright (C) 2020 Tulir Asokan // Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by // it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
// mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer // mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
// Copyright (C) 2020 Tulir Asokan // Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by // it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
// mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer // mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
// Copyright (C) 2020 Tulir Asokan // Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by // it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
// mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer // mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
// Copyright (C) 2020 Tulir Asokan // Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by // it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
// mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer // mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
// Copyright (C) 2020 Tulir Asokan // Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by // it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
// mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer // mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
// Copyright (C) 2020 Tulir Asokan // Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by // it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
// mautrix-amp - A very hacky Matrix-SMS bridge based on using Android Messages for Web in Puppeteer // mautrix-line - A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Puppeteer
// Copyright (C) 2020 Tulir Asokan // Copyright (C) 2020-2021 Tulir Asokan, Andrew Ferrazzutti
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by // it under the terms of the GNU Affero General Public License as published by

View File

@ -35,7 +35,7 @@ linkified_version = {linkified_version!r}
setuptools.setup( setuptools.setup(
name="mautrix-line", name="mautrix-line",
version=version, version=version,
url="https://github.com/tulir/mautrix-amp", url="git://miscworks.net/mautrix-line",
author="Tulir Asokan", author="Tulir Asokan",
author_email="tulir@maunium.net", author_email="tulir@maunium.net",