diff --git a/Dockerfile b/Dockerfile index 1c46d8b..ec0f2fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,29 @@ -ARG DOCKER_HUB="docker.io" - -FROM ${DOCKER_HUB}/alpine:3.22 AS builder - -RUN apk add --no-cache go git build-base olm-dev - -WORKDIR /build - -COPY go.mod go.sum ./ -RUN go mod download - -COPY . . -RUN go build -o matrix-line ./cmd/matrix-line - -FROM ${DOCKER_HUB}/alpine:3.22 - -ENV UID=1337 \ - GID=1337 - -RUN apk add --no-cache ffmpeg su-exec ca-certificates bash jq curl yq-go olm nodejs - -COPY --from=builder /build/matrix-line /usr/bin/matrix-line -COPY ./docker-run.sh /docker-run.sh -RUN chmod +x /docker-run.sh -ENV BRIDGEV2=1 -VOLUME /data -WORKDIR /data - -CMD ["/docker-run.sh"] +ARG DOCKER_HUB="docker.io" + +FROM ${DOCKER_HUB}/alpine:3.22 AS builder + +RUN apk add --no-cache go git build-base olm-dev + +WORKDIR /build + +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . +RUN go build -o matrix-line ./cmd/matrix-line + +FROM ${DOCKER_HUB}/alpine:3.22 + +ENV UID=1337 \ + GID=1337 + +RUN apk add --no-cache ffmpeg su-exec ca-certificates bash jq curl yq-go olm nodejs + +COPY --from=builder /build/matrix-line /usr/bin/matrix-line +COPY ./docker-run.sh /docker-run.sh +RUN chmod +x /docker-run.sh +ENV BRIDGEV2=1 +VOLUME /data +WORKDIR /data + +CMD ["/docker-run.sh"] diff --git a/README.md b/README.md index 5279710..fd99b45 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,76 @@ -# matrix-line-messenger - -[![Go Report Card](https://goreportcard.com/badge/github.com/highesttt/matrix-line-messenger)](https://goreportcard.com/report/github.com/highesttt/matrix-line-messenger) -![Languages](https://img.shields.io/github/languages/top/highesttt/matrix-line-messenger.svg) -[![License](https://img.shields.io/github/license/highesttt/matrix-line-messenger.svg)](LICENSE) - -A Matrix bridge for LINE Messenger using mautrix-go.\ -Based on the [mautrix-twilio](https://github.com/mautrix/twilio) bridge - -## Known issues - -> [!NOTE] -> Messages sent to the LINE Bot using Beeper Desktop may appear as indefinitely sending.\ -> Use Beeper Mobile to send commands to the LINE Bot account after creating the chat with Beeper Desktop. - -## Roadmap - -- [x] Basic messaging (encrypted text messages) -- [x] Actual login via mail/password (instead of access token) -- [x] Get own profile details (ID & Name) -- [x] Decrypt messages -- [x] Decrypt usernames -- [x] Sending messages -- [x] Read receipts -- [ ] Reaction support -- [x] Reply support -- [ ] Prefetch chats -- [x] Group chats -- [x] Media messages (images, videos, voice notes, files) -- [x] Sticker support - -## How to Use - -1. Clone the repository: - - ```bash - git clone https://github.com/highesttt/matrix-line-messenger.git - cd matrix-line-messenger - ``` - -2. Create a `data` directory for configuration and data storage: - - ```bash - mkdir data - ``` - -3. Create a configuration file using [bbctl](https://github.com/beeper/bridge-manager): - - ```bash - bbctl c --type bridgev2 sh-line > config.yaml - ``` - -4. Move the generated `config.yaml` into the `data` directory: - - ```bash - mv config.yaml data/ - ``` - -5. Change `public_address` in `data/config.yaml` to your desired public address - -6. Build and run the bridge using Docker (use -d for detached mode): - - ```bash - docker compose up --build -d - ``` - - To run the bridge without rebuilding, use: - - ```bash - docker compose up -d - ``` - -## Login - -1. Open the Matrix client of your choice and start a chat with `@sh-line:your.matrix.homeserver.domain`. (For local beeper bridges, use `@sh-line:beeper.local`) -2. Send the command `login` and follow the instructions to log in to your LINE account. - +# matrix-line-messenger + +[![Go Report Card](https://goreportcard.com/badge/github.com/highesttt/matrix-line-messenger)](https://goreportcard.com/report/github.com/highesttt/matrix-line-messenger) +![Languages](https://img.shields.io/github/languages/top/highesttt/matrix-line-messenger.svg) +[![License](https://img.shields.io/github/license/highesttt/matrix-line-messenger.svg)](LICENSE) + +A Matrix bridge for LINE Messenger using mautrix-go.\ +Based on the [mautrix-twilio](https://github.com/mautrix/twilio) bridge + +## Known issues + +> [!NOTE] +> Messages sent to the LINE Bot using Beeper Desktop may appear as indefinitely sending.\ +> Use Beeper Mobile to send commands to the LINE Bot account after creating the chat with Beeper Desktop. + +## Roadmap + +- [x] Basic messaging (encrypted text messages) +- [x] Actual login via mail/password (instead of access token) +- [x] Get own profile details (ID & Name) +- [x] Decrypt messages +- [x] Decrypt usernames +- [x] Sending messages +- [x] Read receipts +- [ ] Reaction support +- [x] Reply support +- [ ] Prefetch chats +- [x] Group chats +- [x] Media messages (images, videos, voice notes, files) +- [x] Sticker support + +## How to Use + +1. Clone the repository: + + ```bash + git clone https://github.com/highesttt/matrix-line-messenger.git + cd matrix-line-messenger + ``` + +2. Create a `data` directory for configuration and data storage: + + ```bash + mkdir data + ``` + +3. Create a configuration file using [bbctl](https://github.com/beeper/bridge-manager): + + ```bash + bbctl c --type bridgev2 sh-line > config.yaml + ``` + +4. Move the generated `config.yaml` into the `data` directory: + + ```bash + mv config.yaml data/ + ``` + +5. Change `public_address` in `data/config.yaml` to your desired public address + +6. Build and run the bridge using Docker (use -d for detached mode): + + ```bash + docker compose up --build -d + ``` + + To run the bridge without rebuilding, use: + + ```bash + docker compose up -d + ``` + +## Login + +1. Open the Matrix client of your choice and start a chat with `@sh-linebot:your.matrix.homeserver.domain`. (For local beeper bridges, use `@sh-linebot:beeper.local`) +2. Send the command `login` and follow the instructions to log in to your LINE account. diff --git a/pkg/connector/connector.go b/pkg/connector/connector.go index b382b50..a18e573 100644 --- a/pkg/connector/connector.go +++ b/pkg/connector/connector.go @@ -113,6 +113,7 @@ func (lc *LineConnector) GetLoginFlows() []bridgev2.LoginFlow { return []bridgev2.LoginFlow{{ Name: "Login", Description: "Login with your LINE Email and Password", + ID: "dev.highest.matrix.line.email_login", }} }