Page MenuHomeDevCentral

No OneTemporary

diff --git a/roles/viperserv/eggdrop/config.sls b/roles/viperserv/eggdrop/config.sls
index 5dd22e7..56af7e6 100644
--- a/roles/viperserv/eggdrop/config.sls
+++ b/roles/viperserv/eggdrop/config.sls
@@ -1,80 +1,88 @@
# -------------------------------------------------------------
# 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'].iteritems() %}
/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'].iteritems() %}
/srv/viperserv/logs/{{ botname }}.log:
file.managed:
- user: {{ bot['runas'] | default('viperserv') }}
- group: nasqueron-irc
- mode: 660
{% 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'].iteritems() %}
/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([]) }}
/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/dot.credentials b/roles/viperserv/eggdrop/files/dot.credentials
new file mode 100644
index 0000000..75a114d
--- /dev/null
+++ b/roles/viperserv/eggdrop/files/dot.credentials
@@ -0,0 +1,21 @@
+# -------------------------------------------------------------
+# Eggdrop configuration file
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+#
+# _ ___ _____
+# | | / (_)___ ___ _____/ ___/___ ______ __
+# | | / / / __ \/ _ \/ ___/\__ \/ _ \/ ___/ | / /
+# | |/ / / /_/ / __/ / ___/ / __/ / | |/ /
+# |___/_/ .___/\___/_/ /____/\___/_/ |___/
+# /_/
+#
+# [ 1993 technology for 2017 hackers ]
+#
+# -------------------------------------------------------------
+
+set sql(host) localhost
+set sql(user) someuser
+set sql(pass) somepass
+set sql(database) Nasqueron
+
+die "Please configure MySQL credentials in /srv/viperserv/.credentials"
diff --git a/roles/viperserv/eggdrop/files/eggdrop-bot.conf b/roles/viperserv/eggdrop/files/eggdrop-bot.conf
index 4b84fdf..fd45f67 100755
--- a/roles/viperserv/eggdrop/files/eggdrop-bot.conf
+++ b/roles/viperserv/eggdrop/files/eggdrop-bot.conf
@@ -1,73 +1,79 @@
#!/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
# -------------------------------------------------------------
#
# <auto-generated>
# 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.
# </auto-generated>
#
# _ ___ _____
# | | / (_)___ ___ _____/ ___/___ ______ __
# | | / / / __ \/ _ \/ ___/\__ \/ _ \/ ___/ | / /
# | |/ / / /_/ / __/ / ___/ / __/ / | |/ /
# |___/_/ .___/\___/_/ /____/\___/_/ |___/
# /_/
#
# [ 1993 technology for 2017 hackers ]
#
# -------------------------------------------------------------
# -------------------------------------------------------------
# Settings for {{ botname }}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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)
# -------------------------------------------------------------
# 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

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 03:43 (21 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259469
Default Alt Text
(6 KB)

Event Timeline