From 781cf5136a9a5cc8e112747cb6980e8eb431f545 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Sat, 3 Dec 2011 15:06:54 +0100 Subject: [PATCH] openwrt config --- config/init.d/psyced-openwrt | 49 ++++++++++++++++++++++++++++++++++++ config/psyced.ini | 32 ++++++++++++----------- 2 files changed, 67 insertions(+), 14 deletions(-) create mode 100755 config/init.d/psyced-openwrt diff --git a/config/init.d/psyced-openwrt b/config/init.d/psyced-openwrt new file mode 100755 index 0000000..b890b64 --- /dev/null +++ b/config/init.d/psyced-openwrt @@ -0,0 +1,49 @@ +#!/bin/sh /etc/rc.common + +START=90 +STOP=90 + +start() { + if test ! -r /var/log/psyced + then + ln -s /opt/psyced/log /var/log/psyced + fi + echo -n "Starting psyced in background ... " + sudo -bHu psyced /bin/sh /opt/psyced/bin/psyced & + echo "DONE" +} + +stop() { + rm /opt/psyced/world/data/.autorestart + if test -r /opt/psyced/world/data/psyclpc.pid + then + echo -n "Instructing psyced to gently shut down ... " + kill -1 `cat /opt/psyced/world/data/psyclpc.pid` + rm /opt/psyced/world/data/psyclpc.pid && echo "OK" + else + echo -n "Killing psyced brutally ... " + kill -1 `cat /opt/psyced/world/data/psyclpc.pid` >/dev/null 2>&1 + kill -3 `cat /opt/psyced/world/data/psyced.pid` && echo "OK" + fi +} + +EXTRA_COMMANDS="prepare" +EXTRA_HELP=" prepare First time configurator script. Please run /etc/init.d/psyced prepare in order to set-up your system for first psyced execution" + +prepare() { + if !(cat /etc/group | grep psyc 1>/dev/null) + then + echo "Adding psyc group to /etc/group ... " + echo "psyc:x:4404:" >> /etc/group + fi + if !(cat /etc/passwd | grep psyc 1>/dev/null) + then + echo "Adding psyced user to /etc/passwd ... " + echo "psyced:KnMFzCSyWjQC.:4404:4404:the PSYC enhanced daemon:/var:/bin/false" >> /etc/passwd + fi + + echo -n "Preparing system ... " + chown -R psyced:psyc /opt/psyced + echo "done" +} + diff --git a/config/psyced.ini b/config/psyced.ini index 9fb999b..1e9969e 100644 --- a/config/psyced.ini +++ b/config/psyced.ini @@ -1,4 +1,4 @@ -; $Id: psyced.ini,v 1.23 2008/04/28 16:35:29 lynx Exp $ +; $Id: psyced.ini,v 1.22 2008/01/22 09:30:06 lynx Exp $ ; ; this is the sample psyced configuration file. in fact it is the one ; being used for the gentoo default installation. you can use this if @@ -21,9 +21,11 @@ _path_base = /opt/psyced _path_configuration = /etc/psyc ; Path leading to your private and public TLS keys -; (absolute or relative to _path_configuration). -_path_PEM_key = key.pem -_path_PEM_certificate = cert.pem +; (absolute or relative to the configuration directory). +_path_PEM_key = /etc/ssl/private/psyced_key.pem +_path_PEM_certificate = /etc/ssl/certs/psyced_cert.pem +; Remember to make these files accessible to the userid +; running the psyced daemon! ; Path to the TLS trust directory where certs are kept. ; If unset this will default to your system installation's defaults. @@ -42,7 +44,7 @@ _path_PEM_certificate = cert.pem ; May look like this for a classic System V set-up: ;_list_script_init = /etc/rc.d/psyced /etc/rc.d/rc3.d/K04psyced /etc/rc.d/rc3.d/S44psyced ; or it should look like this for gentoo: -_list_script_init = /etc/init.d/psyced +;_list_script_init = /etc/init.d/psyced ; You can simply disable the line to turn off this feature. ; ; Userid to run the psyced as, when started from the init script. @@ -59,9 +61,12 @@ _place_default = RendezVous _language_default = en ; The externally visible name & domain of your host -_host_name = psyc +;_host_name = host ;_host_domain = example.org -;_host_domain = homelinux.org +; +; You don't *have* to provide this. If nothing is given +; psyced will figure out its hostname and/or dynamic +; IP address by itself ; Would you like to bind the server to a specific IP address? ; If you do you MUST also provide _host_name and _host_domain @@ -69,11 +74,11 @@ _host_name = psyc ; Nickname for the chatserver. Appears in login message, telnet prompt, ; IRC gateways and some web pages. Will use _host_name if unspecified. -_nick_server = polvo +_nick_server = psyced [_administrators] ; Space-seperated list of administrator user nicknames. -_list_nicks = theBoss k lynX +_list_nicks = admin ; If the administrators have not been registered yet, this password will be ; assigned to them. If you leave this out you will be prompted for each as yet ; unregistered administrator, but you have to run psyconf manually! @@ -82,7 +87,7 @@ _list_nicks = theBoss k lynX [_protocols] ; if you don't have TLS or SSL simply set this to ; no and all the _encrypted ports will be ignored -_use_encryption = 0 +_use_encryption = 1 [_protocols_port] _PSYC = 4404 @@ -94,8 +99,8 @@ _jabber_clients = 5222 _jabber_clients_encrypted = 5223 _IRC = 6667 _IRC_encrypted = 9999 -_HTTP = 44444 -_HTTP_encrypted = 4433 +_HTTP = 33333 +_HTTP_encrypted = 34443 _applet = 2008 _SMTP = 2525 ;_SMTP_encrypted = 4656 @@ -127,8 +132,7 @@ _level_debug = 0 ; -DDtext=2 here. You can figure out which other parts of psyced are debuggable ; by doing a "grep -r 'define DEBUG D' ." in the world directory, then assign ; a debug level in the same way as the global debug level above. -;_extra_debug = - +;_extra_debug = -DDcontext=2 ; We create files that are editable by the psyc group _umask = 007