瀏覽代碼

Fixing irc

Bob Mottram 11 年之前
父節點
當前提交
d164139baa
共有 1 個檔案被更改,包括 43 行新增5 行删除
  1. 43
    5
      beaglebone.txt

+ 43
- 5
beaglebone.txt 查看文件

@@ -3219,6 +3219,10 @@ Within the *auth* section set user = "*@192.168.1.60" - or whatever the fixed IP
3219 3219
 Within the *connect* section set *host* and *vhost* to your fixed IP address (in the earlier
3220 3220
 sections it was 192.168.1.60) and *name* to your domain name.  Also set the *send/accept passwords* to your IRC login password.
3221 3221
 
3222
+Within the *operator* section change *name* to the username/nick which you will user to irc@192.168.1.60
3223
+
3224
+Change *ssl_connection_required* to *yes*.
3225
+
3222 3226
 Save and exit, then restart the IRC server.  Open port 6697 on your internet router and forward it to the BBB.  Note that although ports 6665 to 6669 are active within the configuration file in practice we will only use the encrypted port.
3223 3227
 
3224 3228
 Ensure that the configuration is only readable by the root user.
@@ -3231,6 +3235,22 @@ Now create an init script.
3231 3235
 
3232 3236
 #+BEGIN_SRC: bash
3233 3237
 adduser --disabled-login irc
3238
+editor /usr/bin/runircd
3239
+#+END_SRC
3240
+
3241
+Add the following:
3242
+
3243
+#+BEGIN_SRC: bash
3244
+#!/bin/sh
3245
+USERNAME=irc
3246
+COMMAND="cd /usr/local/ircd; ircd > /usr/local/ircd/ircd.log"
3247
+su -l $USERNAME -c '$COMMAND'
3248
+#+END_SRC
3249
+
3250
+Save and exit.
3251
+
3252
+#+BEGIN_SRC: bash
3253
+chmod +x /usr/bin/runircd
3234 3254
 editor /etc/init.d/ircd-hybrid
3235 3255
 #+END_SRC
3236 3256
 
@@ -3254,8 +3274,8 @@ Add the following:
3254 3274
 
3255 3275
 #Settings
3256 3276
 SERVICE='ircd-hybrid'
3257
-COMMAND="ircd"
3258
-USERNAME='irc'
3277
+COMMAND="runircd"
3278
+USER='irc'
3259 3279
 NICELEVEL=19 # from 0-19 the bigger the number, the less the impact on system resources
3260 3280
 HISTORY=1024
3261 3281
 INVOCATION="nice -n ${NICELEVEL} ${COMMAND}"
@@ -3266,14 +3286,13 @@ PATH='/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl:/sbin:/usr/sbin
3266 3286
 
3267 3287
 irc_start() {
3268 3288
 echo "Starting $SERVICE..."
3269
-cd /usr/local/ircd
3270
-su --command "screen -h ${HISTORY} -dmS ${SERVICE} ${INVOCATION}" $USERNAME
3289
+su --command "screen -h ${HISTORY} -dmS ${SERVICE} ${INVOCATION}" $USER
3271 3290
 }
3272 3291
 
3273 3292
 
3274 3293
 irc_stop() {
3275 3294
 echo "Stopping $SERVICE"
3276
-su --command "screen -p 0 -S ${SERVICE} -X stuff "'^C'"" $USERNAME
3295
+pkill ${COMMAND}
3277 3296
 }
3278 3297
 
3279 3298
 
@@ -3792,8 +3811,27 @@ Save and exit.  Create a symbolic link.
3792 3811
 
3793 3812
 #+BEGIN_SRC: bash
3794 3813
 ln -sf /etc/prosody/conf.avail/xmpp.cfg.lua /etc/prosody/conf.d/xmpp.cfg.lua
3814
+editor /etc/prosody/prosody.cfg.lua
3815
+#+END_SRC
3816
+
3817
+Within the *ssl* section set:
3818
+
3819
+#+BEGIN_SRC: bash
3820
+ssl = {
3821
+    key = "/etc/ssl/private/xmpp.key";
3822
+	certificate = "/etc/ssl/certs/xmpp.crt";
3823
+}
3795 3824
 #+END_SRC
3796 3825
 
3826
+Uncomment and set the following to *true*
3827
+
3828
+#+BEGIN_SRC: bash
3829
+c2s_require_encryption = true
3830
+s2s_require_encryption = true
3831
+#+END_SRC
3832
+
3833
+Within the *modules_enabled* section uncomment *bosh*, then save and exit.
3834
+
3797 3835
 Add a user.  You will be prompted to specify a password.  You can repeat the process for as many users as needed.  This will also be your Jabber ID (JID).
3798 3836
 
3799 3837
 #+BEGIN_SRC: bash