Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 1.82 KB

README.md

File metadata and controls

56 lines (44 loc) · 1.82 KB

InternetSeparationAdapter Build Status

A utility to fetch email messages from Gmail and send it to Telegram via a bot.

Requirements

Configuration

A configuration file should be in JSON format. The format should adhere to the Config class in the source code.

Example

{
  "TelegramApiToken": "token from @BotFather",
  "TelegramChatGroupIds": [-11111111111111],
  "StoredGoogleCredentialsPath": "./config/somewhere",
  "GoogleCredentials": {}
}

The GoogleCredentials object in the JSON file should be copied from the OAuth credentials provided by Google when you create the credentials to access the Gmail API.

Running it

Build the application using mono:

nuget restore
xbuild /property:Configuration=Release /property:OutDir=build/
build/InternetSeparationAdapter.exe path/to/config.json

There is also a Docker image to run the application, but you need to have gotten the OAuth credentials for the user you are trying to connect to before hand. You can configure StoredGoogleCredentialsPath above to point it to somewhere where you can then dump the credentials. See the issue.

Since the Docker image mounts /usr/src/app/build/config as a volume, you can put it inside your config directory.

An example docker-compose.yml file might look like:

version: "2"
services:
  xxx:
    build: .
    restart: always
    volumes:
      - ./config:
    command: ["config/xxx.json"]

Tests

Tests are missing! We need to write them =X