
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
github.com/meinside/telegram-bot-repl
A Telegram bot for using Clojure REPL, built with golang.
It connects to an existing PREPL connection, or launches a new PREPL and communicates with it.
$ go install github.com/meinside/telegram-clojure-repl-bot@latest
$ git clone https://github.com/meinside/telegram-clojure-repl-bot.git
$ cp telegram-clojure-repl-bot/config.json.sample /path/to/your/config.json
$ vi /path/to/your/config.json
and change values to yours:
{
"api_token": "0123456789:abcdefghijklmnopqrstuvwyz-x-0a1b2c3d4e",
"clojure_bin_path": "/usr/local/bin/clojure",
"repl_host": "localhost",
"repl_port": 8888,
"allowed_ids": [
"telegram_id_1",
"telegram_id_2"
],
"monitor_interval": 1,
"is_verbose": false
}
Execute the installed binary with the path to your config file:
$ telegram-clojure-repl-bot /path/to/your/config.json
$ sudo cp telegram-clojure-repl-bot/systemd/telegram-clojure-repl-bot.service /etc/systemd/system/
$ sudo vi /etc/systemd/system/telegram-clojure-repl-bot.service
and edit User, Group, WorkingDirectory and ExecStart values.
It will launch automatically on boot with:
$ sudo systemctl enable telegram-clojure-repl-bot.service
and will start/stop manually with:
$ sudo systemctl start telegram-clojure-repl-bot.service
$ sudo systemctl stop telegram-clojure-repl-bot.service
$ sudo cp telegram-clojure-repl-bot/launchd/telegram-clojure-repl-bot.plist /Library/LaunchDaemons/
$ sudo vi /Library/LaunchDaemons/telegram-clojure-repl-bot.plist
and edit values:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>telegram-clojure-repl-bot</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/installed/telegram-clojure-repl-bot</string>
<string>/path/to/your/config.json</string>
</array>
<key>UserName</key>
<string>user_name</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Now load it with:
$ sudo launchctl load /Library/LaunchDaemons/telegram-clojure-repl-bot.plist
and unload with:
$ sudo launchctl unload /Library/LaunchDaemons/telegram-clojure-repl-bot.plist
When running with systemd, the PREPL launched by this bot stops immediately because it is an interactive shell-like application.
So I put StandardInput
and TTYPath
properties in the Service section in systemd .service file:
StandardInput=tty
TTYPath=/dev/tty49
If these would be a problem for you, change them or launch your PREPL manually.
When running with java/clojure installed with asdf, JAVA_HOME
must be specified in the Environment
section of the systemd .service file:
# example
Environment="JAVA_HOME=/home/ubuntu/.asdf/installs/java/zulu-17.32.13"
MIT
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.