Skip to content

Commit

Permalink
chore: add systemd and supervisor config files
Browse files Browse the repository at this point in the history
  • Loading branch information
damonto committed Jun 21, 2024
1 parent f415168 commit 79b0bbe
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 3 deletions.
23 changes: 23 additions & 0 deletions init/supervisor/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
pidfile=/tmp/supervisord.pid

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[unix_http_server]
file=/tmp/supervisor.sock

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock

[program:telegram-sms]
command=/usr/local/bin/telegram-sms --bot-token=YourTelegramToken --admin-id=YourTelegramChatID
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
14 changes: 14 additions & 0 deletions init/systemd/telegram-sms.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Telegram SMS
After=network.target

[Service]
Type=simple
User=root
Restart=on-failure
ExecStart=/usr/local/bin/telegram-sms --bot-token=YourTelegramToken --admin-id=YourTelegramChatID
RestartSec=10s
TimeoutStopSec=30s

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion internal/app/routes/routes.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package routes

import (
"github.com/damonto/telegram-sms/config"
"github.com/damonto/telegram-sms/internal/app/handler"
mmiddleware "github.com/damonto/telegram-sms/internal/app/middleware"
"github.com/damonto/telegram-sms/internal/pkg/config"
"gopkg.in/telebot.v3/middleware"
)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/pkg/lpac/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"os/exec"
"path/filepath"

"github.com/damonto/telegram-sms/config"
"github.com/damonto/telegram-sms/internal/pkg/config"
)

type Cmd struct {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"os/signal"
"time"

"github.com/damonto/telegram-sms/config"
"github.com/damonto/telegram-sms/internal/app"
"github.com/damonto/telegram-sms/internal/pkg/config"
"github.com/damonto/telegram-sms/internal/pkg/lpac"
"github.com/damonto/telegram-sms/internal/pkg/modem"
"github.com/damonto/telegram-sms/internal/pkg/util"
Expand Down

0 comments on commit 79b0bbe

Please sign in to comment.