You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

159 lines
6.1 KiB

  1. ##########################
  2. # sms-irc example config #
  3. ##########################
  4. ## This file is TOML formatted. https://github.com/toml-lang/toml
  5. ## Read through this file carefully, taking note of the
  6. ## comments next to each configuration option.
  7. ## When you're done, rename it to "config.toml" and start sms-irc.
  8. ## Example or default values are given, prefixed by the comment character ('#').
  9. ## To set a config value, remove the # and change the value.
  10. ## CORE SETTINGS
  11. ## database_url: a PostgreSQL database URL to connect to
  12. ## and use as sms-irc's main database.
  13. ## /!\ You MUST set this value for sms-irc to run.
  14. database_url = "postgresql://smsirc@localhost/smsirc"
  15. ## CONNECTION METHODS
  16. ## sms-irc doesn't run an IRC server of its own; it requires you to do that.
  17. ## It can either bridge in users by creating a new IRC client for each user
  18. ## (which is hacky, and may be subject to server connection limits),
  19. ## or by linking over the InspIRCd server-to-server protocol to a running
  20. ## InspIRCd server (version 2.0 and above).
  21. ## The latter method is recommended, and is indeed the only thing documented
  22. ## and actually tested nowadays.
  23. ##
  24. ## /!\ Do NOT run sms-irc on anything other than your own private IRC server!
  25. ## INSPIRCD LINKING METHOD
  26. ##
  27. ## /!\ You MUST change these values from their defaults for sms-irc to run.
  28. [insp_s2s]
  29. sid = "42A" # The Server ID to use. This must not conflict with another server's ID.
  30. ## sms-irc creates a "control user" that you can send administration commands to,
  31. ## similar to an IRC service like ChanServ.
  32. control_nick = "sms-irc" # The nickname to use for this control user.
  33. ## The admin nick below will receive all bridged messages, and can also control
  34. ## the bridge by sending commands to the control nick above.
  35. admin_nick = "eeeeeta" # The nickname of the user running the bridge.
  36. sendpass = "abc" # The password to send to InspIRCd.
  37. recvpass = "def" # The password to receive from InspIRCd.
  38. server_desc = "sms-irc bridge" # Virtual server description.
  39. server_name = "sms-irc." # Virtual server hostname.
  40. ## The log_chan specified below will contain all users bridged by sms-irc,
  41. ## as well as being the place where sms-irc dumps its logs.
  42. log_chan = "#smsirc" # Which channel to use for logging and users.
  43. hostname = "127.0.0.1" # Hostname of the IRC server to connect to.
  44. port = 6432 # Port to connect to (this is the LINKING port, not the client port!)
  45. ## The following settings may require sms-irc to be U:lined in your server config.
  46. set_topics = false # Bridge WhatsApp group chat subjects to IRC topics?
  47. clobber_topics = false # Should the bridge overwrite IRC channel topics with its own?
  48. ensure_joined = false # Force-joins the admin user to channels when messages are sent to them.
  49. ## LOGGING SETTINGS
  50. [logging]
  51. ## sms-irc, by default, logs debugging and informational status messages
  52. ## to stdout, and to the IRC channel configured later on.
  53. ## The log levels for each logging destination can be specified below.
  54. ## Possible values: off, error, warn, info, debug, trace
  55. stdout_loglevel = "info"
  56. chan_loglevel = "info"
  57. ## By default, logging information from sms-irc and some of its dependencies
  58. ## is shown. To disable this behaviour and only log sms-irc messages, change
  59. ## the below value to 'false'.
  60. ignore_other_libraries = false
  61. ## MODEM SETTINGS
  62. [modem]
  63. ## sms-irc has support for bridging SMS messages to/from IRC, using a connected
  64. ## USB 3G modem that works like a Huawei E3531 or similar.
  65. ##
  66. ## To set this up, point `modem_path` to the serial port of your modem.
  67. ## Other configuration options are available for more advanced tweaking.
  68. # modem_path = "/dev/ttyUSB2"
  69. ## `cmgl_secs` controls how often sms-irc polls for new messages.
  70. ## Note that, if your modem supports the AT+CNMI command (most do),
  71. ## you'll receive new messages as soon as they're received.
  72. cmgl_secs = 30
  73. ## If the connection to the modem fails, sms-irc will attempt to reconnect
  74. ## every `restart_delay_ms` milliseconds.
  75. restart_delay_ms = 30000
  76. ## `restart_timeout_ms` and `command_timeout_ms` specify how long to wait (in milliseconds)
  77. ## before timing out a restart attempt, or the execution of a command.
  78. restart_timeout_ms = 30000
  79. command_timeout_ms = 30000
  80. ## WHATSAPP SETTINGS
  81. [whatsapp]
  82. ## WhatsApp support ideally requires you to run a web server somewhere,
  83. ## so that sms-irc can give out links to attachments uploaded by other users,
  84. ## as well as to the QR code that you'll need to scan to log in.
  85. ##
  86. ## The location of the directory in which sms-irc will save attachments
  87. ## is dictated by the `media_path` setting. sms-irc will give out URLs
  88. ## that start with the URL specified in the `dl_path` setting, and you're
  89. ## expected to configure your webserver so that it all works out.
  90. ##
  91. ## For example, given an attachment "cat.png" and the settings below,
  92. ## sms-irc would save the attachment in `/var/www/whatsapp/cat.png`
  93. ## and display a message like
  94. ## * eta uploaded an attachment: http://localhost/whatsapp/cat.png
  95. ## on IRC. Hopefully, you'd then configure your webserver so that that link led
  96. ## to the file sms-irc saved.
  97. ##
  98. ## /!\ Do NOT add a slash ('/') to the end of any of the following paths.
  99. ## This is done for you.
  100. # media_path = "/var/www/whatsapp"
  101. # dl_path = "http://localhost/whatsapp"
  102. ## By default, group chats have to be bridged to IRC manually, by using
  103. ## the GROUP command. However, this means that you'll miss out on messages
  104. ## sent to group chats that haven't been bridged yet.
  105. ##
  106. ## If you'd like sms-irc to automatically bridge channels for you,
  107. ## specify an `autocreate_prefix` below, which sms-irc will prefix newly
  108. ## created channels with.
  109. ##
  110. ## For example, getting invited to the "Example" group with the below
  111. ## settings would create a "#wa-example" channel.
  112. # autocreate_prefix = "#wa"
  113. ## By default, messages are never marked as read, which may result in duplicate
  114. ## notifications if you still use WhatsApp on your phone.
  115. ## If you want messages to be marked as read, set `mark_read` to `true` below.
  116. ##
  117. ## /!\ Note that *every* message will be marked as read the instance the bridge
  118. ## receives it; this might cause your friends to get angry at not having
  119. ## read your messages...!
  120. mark_read = false