Random files that don't have a better place, originally better sorted version of gist.github.com
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.

121 lines
4.8KB

  1. #!/usr/bin/env bash
  2. # This script is modified version of `cstemplate` intended to use of
  3. # Pirate Party Finland (Piraattipuolue) who aren't used to doing everything
  4. # with services and don't suffer from as high level of paranoia as I do ;)
  5. # (/cs help set secure, "This is useful if you're paranoid")
  6. # Unlike the other script, this one assumes your network is running
  7. # Charybdis as that is what PirateIRC is using.
  8. # This script generates commands which can be copy-pasted to Atheme's
  9. # ChanServ to set templates which can later be set with flags.
  10. # With these templates, bots and ops are opped and (trusted) users are
  11. # voiced. I am not fully sure where I took the word "users", but it's good
  12. # enough.
  13. ## https://mikaela.info/english/2015/09/19/atheme-quickstart.html
  14. ## would be good to read before this script in order to possibly get more
  15. ## out of it.
  16. ## ChanServ settings
  17. # Allows everyone to see ACL changes. -- We believe in transparency.
  18. echo "/cs set $1 VERBOSE ON"
  19. # Tell ChanServ to be on the channel. Not needed for larger channels which
  20. # possibly includes all pirate channels as most of people have 24/7
  21. # connections or talk with bots.
  22. #echo "/cs set $1 GUARD ON"
  23. # Adjusts ChanServ MLOCK
  24. # TL;DR Blocks messages from people not in channel, requires op for
  25. # changing topic, anyone can use /invite and no one can /ctcp #CHANNEL
  26. # (ACTION is naturally exception). On the other side, the channel cannot
  27. # be made invite-only, size limit cannot be set (use +j JOINS:SECONDS
  28. # instead) and passsKEY cannot be set. Those are the restricting modes
  29. # that are too easy to set by accident and may cause harm.
  30. # * n — no external messages, you must be on the channel to message it.
  31. # * t — you must be op to change topic
  32. # * g — anyone can /invite
  33. # * C — block CTCPs to channel
  34. # * * * * *
  35. # * i — invite-only
  36. # * l — limit maximum number of people on the channel
  37. # * k — key/password for joining the channel
  38. # To remove MLOCK "/cs set #channel MLOCK"
  39. echo "/cs set $1 MLOCK +ntgC-ilk"
  40. # Show "various information" about the channel when requested. I am not
  41. # sure what this "various information" exactly is as the help text says
  42. # only that.
  43. echo "/cs set $1 PRIVATE OFF"
  44. # Don't sync flags when they are changed. If this was OFF, people who were
  45. # opped without being identified would be deopped and especially this makes
  46. # PPFI unhappy.
  47. echo "/cs set $1 NOSYNC ON"
  48. # Don't protect from paranoia or accidental opping of people who haven't
  49. # identified to NickServ (nick thiefs?).
  50. echo "/cs set $1 SECURE OFF"
  51. # Allow topic to be changed by ops (+t) or anyone (-t) instead of requiring
  52. # being identified and having +t flag with ChanServ.
  53. echo "/cs set $1 TOPICLOCK OFF"
  54. # Looks interesting, needs investigation: /msg ChanServ help set ANTIFLOOD
  55. ## ChanServ templates
  56. # I think this part would just be confusing as roughly the same can be
  57. # archieved with the default templates (/msg ChanServ TEMPLATE) with the
  58. # exception of R that shouldn't be used in most of cases anyway.
  59. ## Setting flags
  60. # Everything is done with GroupServ, so it's enough to grant access to the
  61. # group.
  62. echo "/cs flags $1 !piraatti-opit AOP"
  63. # Allow everyone to see flags/access list of the channel as it's often
  64. # desirable to know which people are ops and majority of us aren't
  65. # registered (sadly).
  66. echo "/cs flags $1 *!*@* +A"
  67. ## How GroupServ is configured
  68. # We have group !piraatti-opit (as revealed earlier) that is closed
  69. # (/msg GroupServ set !piraatti-opit open off).
  70. #
  71. # The founder currently has flags +FfscmviA and normal ops are given
  72. # +cmvA. There are also $oper and bot with +cA and $registered with +A.
  73. # $oper membership comes from freenode where opers don't want to do
  74. # anything even in case of bigger spam attacks even if all ops are away
  75. # unless they have access through ChanServ. Even without being listed $oper
  76. # would be able to do anything.
  77. # If there were multiple people with access to modify the group they would
  78. # be given flags +cmvAfs if not also +F.
  79. # * c - use ChanServ flags set to the group
  80. # * m - read memos sent to the group (I am thinking of /msg MemoServ help
  81. # sendops)
  82. # * v - take vhosts offered to the group through HostServ (doesn't seem
  83. # to be happening though)
  84. # * A - see the group members and who can do what
  85. # * * * * *
  86. # * f - allow managing access list (un/setting only the flags you have).
  87. # * s - allow using GroupServ SET command
  88. # * F - full founder access
  89. # Examples:
  90. # making JokuOperaattori op across the channels where !piraatti-opit has
  91. # AOP template:
  92. # /msg GroupServ flags !piraatti-opit JokuOperaattori +cmvA
  93. # making VaraPuheenjohtaja have access to edit access
  94. # /msg GroupServ flags !piraatti-opit VaraPuheenjohtaja +cmvAfs
  95. # Issue: Flags are set after nosyc is enabled.
  96. # Ugly solution: SYNC manually afterwards. Don't run this assuming the
  97. # channel already has ops outside of ChanServ/GroupServ.
  98. echo "/cs sync $1"