Browse Source

Fixing irc

Bob Mottram 11 years ago
parent
commit
d164139baa
1 changed files with 43 additions and 5 deletions
  1. 43
    5
      beaglebone.txt

+ 43
- 5
beaglebone.txt View File

3219
 Within the *connect* section set *host* and *vhost* to your fixed IP address (in the earlier
3219
 Within the *connect* section set *host* and *vhost* to your fixed IP address (in the earlier
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.
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
 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.
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
 Ensure that the configuration is only readable by the root user.
3228
 Ensure that the configuration is only readable by the root user.
3231
 
3235
 
3232
 #+BEGIN_SRC: bash
3236
 #+BEGIN_SRC: bash
3233
 adduser --disabled-login irc
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
 editor /etc/init.d/ircd-hybrid
3254
 editor /etc/init.d/ircd-hybrid
3235
 #+END_SRC
3255
 #+END_SRC
3236
 
3256
 
3254
 
3274
 
3255
 #Settings
3275
 #Settings
3256
 SERVICE='ircd-hybrid'
3276
 SERVICE='ircd-hybrid'
3257
-COMMAND="ircd"
3258
-USERNAME='irc'
3277
+COMMAND="runircd"
3278
+USER='irc'
3259
 NICELEVEL=19 # from 0-19 the bigger the number, the less the impact on system resources
3279
 NICELEVEL=19 # from 0-19 the bigger the number, the less the impact on system resources
3260
 HISTORY=1024
3280
 HISTORY=1024
3261
 INVOCATION="nice -n ${NICELEVEL} ${COMMAND}"
3281
 INVOCATION="nice -n ${NICELEVEL} ${COMMAND}"
3266
 
3286
 
3267
 irc_start() {
3287
 irc_start() {
3268
 echo "Starting $SERVICE..."
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
 irc_stop() {
3293
 irc_stop() {
3275
 echo "Stopping $SERVICE"
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
 
3811
 
3793
 #+BEGIN_SRC: bash
3812
 #+BEGIN_SRC: bash
3794
 ln -sf /etc/prosody/conf.avail/xmpp.cfg.lua /etc/prosody/conf.d/xmpp.cfg.lua
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
 #+END_SRC
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
 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).
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
 #+BEGIN_SRC: bash
3837
 #+BEGIN_SRC: bash