diff --git a/pillar/viperserv/bots.sls b/pillar/viperserv/bots.sls index e7be6d3..9d6926f 100644 --- a/pillar/viperserv/bots.sls +++ b/pillar/viperserv/bots.sls @@ -1,50 +1,52 @@ # To regenerate the list of scripts in a folder, try `make list` from rVIPER. viperserv_accounts: viperserv: fullname: ViperServ uid: 833 tc2: fullname: Tau Ceti Central uid: 834 viperserv_bots: Daeghrefn: realname: https://daeghrefn.nasqueron.org scripts: - Daeghrefn/Time.tcl - Daeghrefn/Wolfplex.tcl - Daeghrefn/Server.tcl - Daeghrefn/Last.fm.tcl - Daeghrefn/Wikimedia.tcl - Daeghrefn/Bureautique.tcl - Daeghrefn/Communication.tcl - Daeghrefn/GIS.tcl - Daeghrefn/Tools.tcl - Daeghrefn/Channel.tcl - Daeghrefn/Help.tcl - vendor/oauth.tcl - vendor/proxycheck.tcl modules: - transfer - filesys - seen + nickserv: on Wearg: realname: RabbitMQ broker client scripts: - Wearg/Broker.tcl - Wearg/Notifications.tcl - Wearg/ServersLog.tcl # This one should be last as it initializes # startup components, with broker/Notifications # dependencies - Wearg/Time.tcl + nickserv: on TC2: realname: Tau Ceti Central runas: tc2 scripts: - TC2/Time.tcl - TC2/Server.tcl diff --git a/roles/viperserv/eggdrop/config.sls b/roles/viperserv/eggdrop/config.sls index f9e22e2..47462ce 100644 --- a/roles/viperserv/eggdrop/config.sls +++ b/roles/viperserv/eggdrop/config.sls @@ -1,90 +1,91 @@ # ------------------------------------------------------------- # Salt — Deploy eggdrop park # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Project: Nasqueron # Created: 2017-11-14 # License: Trivial work, not eligible to copyright # ------------------------------------------------------------- # ------------------------------------------------------------- # Directory for configuration # # Each bot gets a directory to store userlist, chanlist, motd, # and specific configuration file. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% for botname, bot in pillar['viperserv_bots'].items() %} /srv/viperserv/{{ botname }}: file.directory: - user: {{ bot['runas'] | default('viperserv') }} - group: nasqueron-irc - dir_mode: 770 {% endfor %} # ------------------------------------------------------------- # Logs # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% for botname, bot in pillar['viperserv_bots'].items() %} /srv/viperserv/logs/{{ botname }}.log: file.managed: - user: {{ bot['runas'] | default('viperserv') }} - group: nasqueron-irc - mode: 660 - replace: False {% endfor %} # ------------------------------------------------------------- # Configuration files # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /srv/viperserv/core.conf: file.managed: - source: salt://roles/viperserv/eggdrop/files/eggdrop-core.conf - user: viperserv - group: nasqueron-irc /srv/viperserv/.credentials: file.managed: - source: salt://roles/viperserv/eggdrop/files/dot.credentials - user: viperserv - group: nasqueron-irc - replace: False - mode: 660 {% for botname, bot in pillar['viperserv_bots'].items() %} /srv/viperserv/{{ botname }}/eggdrop.conf: file.managed: - source: salt://roles/viperserv/eggdrop/files/eggdrop-bot.conf - user: {{ bot['runas'] | default('viperserv') }} - group: nasqueron-irc - mode: 755 - template: jinja - context: botname: {{ botname }} realname: {{ bot['realname'] | default(botname) }} scripts: {{ bot['scripts'] }} modules: {{ bot['modules'] | default([]) }} runas: {{ bot['runas'] | default('viperserv') }} + nickserv: {{ bot['nickserv'] | default(False) }} /srv/viperserv/{{ botname }}/motd: file.managed: - source: salt://roles/viperserv/eggdrop/files/motd/{{ botname }} - user: {{ bot['runas'] | default('viperserv') }} - group: nasqueron-irc /srv/viperserv/{{ botname }}/banner: file.managed: - source: salt://roles/viperserv/eggdrop/files/banner - user: {{ bot['runas'] | default('viperserv') }} - group: nasqueron-irc - template: jinja - context: bot: {{ botname }} server: {{ grains['id'] }} {% endfor %} diff --git a/roles/viperserv/eggdrop/files/eggdrop-bot.conf b/roles/viperserv/eggdrop/files/eggdrop-bot.conf index b4634e0..8015993 100755 --- a/roles/viperserv/eggdrop/files/eggdrop-bot.conf +++ b/roles/viperserv/eggdrop/files/eggdrop-bot.conf @@ -1,81 +1,97 @@ #!/usr/bin/env eggdrop # ------------------------------------------------------------- # Eggdrop configuration file # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # License: Trivial work, not eligible to copyright # Source file: roles/viperserv/eggdrop/files/eggdrop-bot.conf # Pillar file: pillar/viperserv/bots.sls # ------------------------------------------------------------- # # # This file is managed by our rOPS SaltStack repository. # # Changes to this file may cause incorrect behavior # and will be lost if the state is redeployed. # # # _ ___ _____ # | | / (_)___ ___ _____/ ___/___ ______ __ # | | / / / __ \/ _ \/ ___/\__ \/ _ \/ ___/ | / / # | |/ / / /_/ / __/ / ___/ / __/ / | |/ / # |___/_/ .___/\___/_/ /____/\___/_/ |___/ # /_/ # # [ 1993 technology for 2017 hackers ] # # ------------------------------------------------------------- # ------------------------------------------------------------- # Settings for {{ botname }} # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - set runas {{ runas }} set username {{ botname }} set nick $username set altnick {{ botname }}` set realname "{{ realname }}" set vhost6 viperserv.nasqueron.org set listen-addr 2001:470:1f13:9e1:0:c0ff:ee:7 set prefer-ipv6 1 set network freenode set net-type 5 -set servers { - chat.freenode.net:+6697 -} # Main eggdrop settings common to all ViperServ bots source core.conf # ------------------------------------------------------------- # MySQL # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - load lib/fbsql.so source .credentials sql connect $sql(host) $sql(user) $sql(pass) sql2 connect $sql(host) $sql(user) $sql(pass) sql selectdb $sql(database) sql2 selectdb $sql(database) +# ------------------------------------------------------------- +# Base settings with scripts dependencies +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Dependencies +source scripts/Core.tcl + +# Settings +{%- if nickserv %} +set nickserv_password [registry get nickserv.$username.password] + +set servers " + chat.freenode.net:+6697:$username:$nickserv_password +" +{% else %} +set servers { + chat.freenode.net:+6697 +} +{%- endif %} + # ------------------------------------------------------------- # Eggdrop modules # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% for module in modules %} loadmodule {{ module }}{% endfor %} # ------------------------------------------------------------- # Scripts # # These scripts are provided by the rVIPER distribution. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -source scripts/Core.tcl source scripts/Tech.tcl {% for script in scripts %} source scripts/{{ script }}{% endfor %} source scripts/vendor/action.fix.tcl