1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

Merge remote branch 'origin'

This commit is contained in:
psyc://psyced.org/~lynX 2010-01-07 18:39:19 +01:00
commit f941e8c96c
19 changed files with 170 additions and 45 deletions

View file

@ -4,6 +4,12 @@ vim:nosmarttab:syntax=diff
| Essentially: whenever you fix something, move that line to the end of file.
| - marks bugs & fixes, + marks new features, ? marks issues, * marks big stuff
________________________________________________________________________
== SERIOUS!!! ==========================================================
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- large submissions into scratchpad can crash the driver
- configure script fails on libidn now being in glibc
________________________________________________________________________
== NEXT RELEASE ========================================================
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- interserver xmpp /me expects no leading newline, but pidgin recently
@ -393,6 +399,8 @@ ________________________________________________________________________
________________________________________________________________________
== OTHER MAJOR TODOS ===================================================
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- occasionally double data sets for psyc://ve.symlynx.com/~nick and nick
+ provide a tuning for ACTIVE server-side PING (keepalive) ?
see http://about.psyc.eu/Ping for explanations.
@ -1077,6 +1085,9 @@ cel'><service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error><
________________________________________________________________________
== RELEASE INSTALLER ===================================================
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
+ the psyced script could check if psyced.ini has been changed recently
and autorun psyconf? or maybe just spit out a warning..
- _charset_console can still lead to unexpected convert_charset errors when
outputting random data. convert_charset must be non-fatal here!
@ -1564,6 +1575,11 @@ ________________________________________________________________________
look at: http://freshmeat.net/projects/pyvoicechat/
dormant since 2004.. oops
+ tycho proposes /log reply of new messages should not necessarily
show automatically, in case you are connecting with a client on a
mobile phone, especially if you have permanent context subscriptions
flowing into your log nonstop.
> RELAYING
+ net/spyc needs relaying (without parsing even), see TODO in parse_content()
? relaying doesn't work for psyc clients (xmpp: in particular)
@ -1584,6 +1600,8 @@ ________________________________________________________________________
but some of the old stuff does.. how do we find a proper solution?
== DOCUMENTATION ISSUES ================================================
? should we point to some manuals on how to make and add certificates?
* ich habs.. jede datei definiert am anfang in welche kategorie sie gehört..
"library" "user" "server" "language" etc... und jede funktion kann sich
dann mit /** library: this stuff.. */ woanders einordnen.. jetzt brauchen wir
@ -1758,9 +1776,6 @@ das sieht doof aus.. gehts auch besser? hmm
remain incarnated longer since mails seem to arrive often enough
for some users to never leave memory.
+ disallow TLS/SSL connections from localhost to save CPU resources
for useful things
- re-examine everything looking for optimizations.. like, are any
lower_case's being called twice etc. or introduce a "lowercased"
flag into the driver's string structures *grin*

View file

@ -16,7 +16,8 @@ psyconf - a configuration tool for PSYCED
Usage: psyconf [ <file> ]
The default configuration file used is /etc/psyced.ini
The default configuration file used is either ./psyced.ini
or /etc/psyc/psyced.ini
=cut
@ -386,14 +387,23 @@ X
my $t = $c{_basic_path_PEM_key};
if ($t) {
$t = "$config/$t" unless $t =~ m#^/#;
print STDERR <<X unless -r $t;
WARNING: Key file $t does not exist.
X
$psyced .= " --tls-key $t";
}
if ($t = $c{_basic_path_PEM_certificate}) {
$t = "$config/$t" unless $t =~ m#^/#;
print STDERR <<X unless -r $t;
WARNING: Certificate file $t does not exist.
X
$psyced .= " --tls-cert $t";
}
if ($t = $c{_basic_path_trust}) {
$t = "$config/$t" unless $t =~ m#^/#;
print STDERR <<X unless -r $t;
WARNING: Trust directory $t does not exist.
X
$psyced .= " --tls-trustdirectory $t";
}
# ldmud doesn't support this yet

View file

@ -304,10 +304,13 @@ ask "Server host name" HOST_NAME
get DOMAIN_NAME "" # `grep ^domain /etc/resolv.conf | sed "s/^domain.//"`
ask "Your domain name" DOMAIN_NAME
get HOST_IP "127.0.0.1"
#get HOST_IP "127.0.0.1"
get HOST_IP
# `nslookup -sil $HOST_NAME | tail -n 2 | head -n 1 | awk '{print $2}' | sed "s/,//"`
echo ""
echo "If you have a static IP address for your server, please tell me:"
echo "If you have a static IP address for your server, please tell me."
echo "Otherwise I will resolve my own hostname at runtime in order to get my"
echo "current IP address."
ask "Server IP address" HOST_IP
echo ""
@ -316,6 +319,9 @@ get USER "psyc"
if test "x$USER" = "xroot"; then
echo ""
echo "You shouldn't run psyced as root, so what about a 'psyc' user?"
# indigo6 thinks we should run useradd here, even if some unices
# do not provide that command. we can >/dev/null the error though...
echo "If the user doesn't exist yet, please make one."
fi
#while true
#do
@ -332,6 +338,7 @@ fi
get GROUP "psyc"
#while true
#do
echo "If such a group doesn't exist yet, please create it now."
ask "Which group do you want to run psyced as" GROUP
# if `id -Gn $USER | grep $GROUP > /dev/null`
# then
@ -371,6 +378,7 @@ done
#echo "[server output goes to $RUNTIME_OUTPUT]"
## BUG IN ORDER!!! we dont have $PSYC_PORT yet!!!!! TODO!!111
## also HOST_IP may be empty
RUNTIME_OUTPUT_DIR="$LOG_DIR/$HOST_IP-$PSYC_PORT"
RUNTIME_OUTPUT_STDERR="$RUNTIME_OUTPUT_DIR/stderr"
RUNTIME_OUTPUT_STDOUT="$RUNTIME_OUTPUT_DIR/stdout"
@ -793,6 +801,7 @@ else
echo "[host name resolving disabled (don't start erq).]"
fi
## TODO, should be disabled when there is no HOST_IP?
get WANT_PORTRULES "y"
echo ""
@ -986,7 +995,8 @@ _host_name = $HOST_NAME
_host_domain = $DOMAIN_NAME
; Would you like to bind the server to a specific IP address?
; If you do you MUST also provide _host_name and _host_domain
; If you do, you MUST also provide _host_name and _host_domain
; If you leave this empty, psyced will find out at runtime.
_host_IP = $HOST_IP
; Nickname for the chatserver. Appears in login message, telnet prompt,

View file

@ -58,3 +58,7 @@ local/all.ls:
.links:
(cd world;../bin/findlinks */de/* */en/*) >$@
rights:
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod +x bin/* run/* config/psyced.settings install.sh utility/multipatcher

View file

@ -16,7 +16,10 @@
start();
babel();
#define CRESET start();
#define CREATE qInit(ME, 1000, 100);
// too aggressive to connect babelfish on every reset!!
//efine CRESET start();
inherit NET_PATH "connect";
#include <place.gen>
@ -27,7 +30,6 @@ volatile mixed *current;
volatile string krank, buffer;
start() {
qInit(ME, 1000, 100);
unless (has_con || is_con) {
is_con = 1;
call_out(#'connect, 0, "babelfish.yahoo.com", 80);

View file

@ -4,6 +4,8 @@
# (sort of like cgi) with LDMUD. but by now LDMUD knows how
# to do MD5 and SHA1 itself, so they are not being used.
#
# consult http://about.psyc.eu/spawn for instructions
#
use Digest::MD5 qw(md5 md5_hex);
$| = 1;

View file

@ -4,6 +4,8 @@
# (sort of like cgi) with LDMUD. but by now LDMUD knows how
# to do MD5 and SHA1 itself, so they are not being used.
#
# consult http://about.psyc.eu/spawn for instructions
#
use Digest::SHA1 qw(sha1 sha1_hex);
$| = 1;

42
utility/rkeywordgrep Executable file
View file

@ -0,0 +1,42 @@
#!/usr/bin/perl
#
# recursive PSYC keyword (methods, variables) collector --lynx98
# you may like how it looks after a subsequent sort
# see also http://about.psyc.eu/Rename
require 'find.pl';
$flags = '';
$flags = shift if $ARGV[0] =~ /^-/;
$verbose = $flags !~ /s/;
$|=1;
&find($#ARGV >= 0 ? @ARGV : '.');
print STDERR '=' x 78, "\n" if $verbose;
exit;
sub wanted {
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= lstat;
return unless /\.[chi]$/ or /\.gen$/;
return if -d _;
# return unless $blocks; # skip symlinks
return if $size < 10;
if ($verbose) {
$len = length $name;
print STDERR $name, ' ', '=' x (77-$len), "\r" if $len < 77;
}
if (open(I, $_)) {
while(<I>) {
printf "%-41s -\t$name\n", $1 while s/"(_\w+)"/"got"/;
}
close I;
} else {
print STDERR "$name: $!\n";
}
}

View file

@ -551,6 +551,9 @@ _request_description
_request_open_page
|Bitte folgende Seite aufrufen: [_page]
_request_open_page_login
|Bitte öffne [_page_login] um einzuloggen.
_request_open_page_edit
|Zur Bearbeitung der Einstellungen bitte folgende Seite aufrufen:
|[_page_edit]

View file

@ -1,6 +1,18 @@
<PSYC:TEXTDB> ## vim:syntax=mail
## Check utf-8: Praise Atatürk!
_failure_unavailable_state
|State module is not available as yet.
_failure_unknown_glyph
|Unknown modifier glyph encountered.
_error_illegal_protocol_variable
|You are not allowed to present a variable named [_variable_name].
_error_type_degree
|Your value for variable [_variable] does not qualify for a degree.
_error_necessary_nick_local
|This command only accepts local nicknames.
@ -1341,7 +1353,7 @@ _notice_link_service
_notice_link
|[_location] linked to [_identification].
|You are now connected to this big marshmellow in the sky.
|## You are now connected to this big marshmellow in the sky.
_notice_unlink_exit
|I wish you good sleep or a fun night-out.

View file

@ -129,7 +129,7 @@ object connect(int uid, int port, string service) {
peerport = pointerp(arg) ? (arg[2]*256 + arg[3]) : 0;
if (peerport < 0) peerport = 65536 + peerport;
// no support for non-AF_INET nets yet
if (peerport == SPYC_SERVICE) peerport = 0;
if (peerport == PSYC_SERVICE) peerport = 0;
# else
// as long as the object names don't collide, this is okay too
peerport = 65536 + random(9999999);

View file

@ -64,7 +64,6 @@
# define NAMEPREP(s) FROM_UTF8(idna_stringprep(TO_UTF8(s), STRINGPREP_NAMEPREP))
# define RESOURCEPREP(s) FROM_UTF8(idna_stringprep(TO_UTF8(s), STRINGPREP_XMPP_RESOURCEPREP))
#else
# echo Warning: using lower_case instead of idna_stringprep!
# define NODEPREP(s) lower_case(s)
# define NAMEPREP(s) lower_case(s)
# define RESOURCEPREP(s) (s)

View file

@ -4,6 +4,10 @@
#include "presence.h"
#include <time.h>
#if !__EFUN_DEFINED__(idna_stringprep)
# echo Warning: idn support as recommended for XMPP is missing from LPC driver. will try lower_case() instead. usually works.
#endif
// necessary to implement a minimum set of commands for remote jabber users
// #undef USER_PROGRAM
// #undef MYNICK
@ -221,8 +225,10 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
time[TM_YEAR], time[TM_MON],
time[TM_MDAY], time[TM_HOUR],
time[TM_MIN], time[TM_SEC]);
if (res == 6 && (res = mktime(time)) != -1) {
vars["_time_place"] = res; //helper["@stamp"];
if (res == 6) {
// mktime uses month from 0 to 11, december error fixed
time[TM_MON]--;
if ((res = mktime(time)) != -1) vars["_time_place"] = res;
}
}
#endif

View file

@ -99,7 +99,7 @@ int msg(string source, string mc, string data,
$2["_amount_users_registered"] = helper["@value"];
break;
case "users/online":
$2["_amount_users"] = helper["@value"];
$2["_amount_users_loaded"] = helper["@value"];
break;
}
}

View file

@ -812,10 +812,23 @@ varargs mixed sendmsg(mixed target, string mc, mixed data, vamapping vars,
// fall thru
case "xmpp":
#ifdef SWITCH2PSYC
// maybe we should treat all of this just as if
// no scheme was given (jid treatment below)
P4(("LOOKing for %O in %O\n",
"psyc://"+u[UHost]+"/", targets))
tmp = targets["psyc://"+u[UHost]+"/"];
if (tmp) { // && interactive(tmp)) {
if (tmp) {
// are we talking to our own net/root?
// in the past we used interactive() here
unless (clonep(tmp)) {
tmp = summon_person(u[UNick]);
unless (tmp) {
// doesn't have to be an error.. use jid treatment below?
sendmsg(source, "_failure_unavailable_route_place_XMPP",
"Sorry, you can't talk to a local chatroom via XMPP uniform.");
return 0;
}
}
PT(("SWITCH2PSYC delivery %O for %O (%s)\n", tmp, target,
mc || "0"))
// we should very probably generate a redirect here instead! TODO

View file

@ -70,7 +70,7 @@ int msg(string source, string method, string data,
return ::msg(source, method, data, vars, showingLog, target);
#else // }}}
{
P2(("%O ist nicht interactive\n", ME))
P2(("%O is not interactive (no network connection)\n", ME))
if (!member(vars, "_source"))
vars["_source"] = UNIFORM(source);
// this stuff is causing loops and i don't know how to fix it right now

View file

@ -25,7 +25,7 @@ volatile string netloc;
// this is completely anti-psyc. it should take mcs as arguments
// and look up the actual message from textdb.. FIXME
#define CIRCUITERROR(reason) { debug_message("SPYC CIRCUIT: " reason "\n"); \
#define CIRCUITERROR(reason) { \
croak("_error_circuit", "circuit error: " \
reason); \
return 0; \
@ -55,9 +55,12 @@ void feed(string data) {
// yes, this is a funny implementation of croak
// it does not use msg(). Yes, that is intended
varargs mixed croak(string mc, string data, vamapping vars, vamixed source) {
PT(("croak(%O) in %O (%O)\n", mc, ME, query_ip_name()))
unless (data) data = T(mc, "");
binary_message(sprintf("\n%s\n%s\n|\n", mc, data));
remove_interactive(ME);
destruct(ME);
// right behaviour for all croaks!?
remove_interactive(ME);
// destruct(ME);
return 0;
}

View file

@ -15,21 +15,21 @@ int may_parse_more;
array(mixed) tvars;
mapping hvars;
// this is completely anti-psyc. it should take mcs as arguments
// and look up the actual message from textdb.. FIXME
#define PARSEERROR(reason) { debug_message("PSYC PARSE ERROR: " reason "\n"); \
croak("_error_syntax_broken", "Failed parsing: " \
reason); \
return 0; \
}
// being faded out in favor of regular croak()
#define PARSEERROR(reason) { \
croak("_error_syntax_broken", \
"Failed parsing: " reason); \
return 0; }
#define DELIM S_GLYPH_PACKET_DELIMITER "\n"
#define C_LINEFEED '\n'
#define MVAR_GLYPH 0
#define MVAR_STATE 1
#define MVAR_VALUE 2
#ifndef PSYC_UDP
# define QUIT remove_interactive(ME); return 0;
#endif
step(); // prototype
@ -76,9 +76,7 @@ void feed(string data) {
// overload this as needed
varargs mixed croak(string mc, string data, vamapping vars, vamixed source) {
return 0;
}
varargs mixed croak(string mc, string data, vamapping vars) { return 0; }
// called when a complete packet has arrived
@ -101,16 +99,18 @@ mapping process_header(mixed varops) {
case C_GLYPH_MODIFIER_DIMINISH:
case C_GLYPH_MODIFIER_QUERY:
case C_GLYPH_MODIFIER_ASSIGN:
PARSEERROR("header modifier with glyph other than ':', this is not implemented")
break;
croak("_failure_unavailable_state");
QUIT
default:
PARSEERROR("header modifier with unknown glyph")
break;
croak("_failure_unknown_glyph");
QUIT
}
// FIXME: not every legal varname is a mmp varname
// FIXME: not every legal varname is a routing varname
// look at shared_memory("routing")
if (!legal_keyword(vname) || abbrev("_INTERNAL", vname)) {
PARSEERROR("illegal varname in header")
croak("_error_illegal_protocol_variable", 0,
([ "_variable_name": vname ]));
return 0;
}
}
return vars;
@ -158,7 +158,8 @@ void parse_header() {
buffer = buffer[1..];
break;
default:
PARSEERROR("noglyph")
croak("_error_syntax_expected_routing");
QUIT
}
fit = sscanf(buffer, "%.1s%t", vname);
if (fit != 1) {
@ -222,6 +223,7 @@ void parse_psyc() {
PARSEERROR("negative binary length")
}
if (strlen(body_buffer) < len) {
// ouch, this is a problem here
PARSEERROR("not enough to read binary arg, may not happen")
}
vvalue = body_buffer[..len-1];
@ -290,9 +292,9 @@ void parse_content() {
}
fit = sscanf(body_buffer, "%.1s\n%.0s", method, body_buffer);
if (fit != 2 || !legal_keyword(method)) {
croak("_error_illegal_method",
"That's not a valid method name.");
return; // NOTREACHED
croak("_error_illegal_method");
// "That's not a valid method name.");
return;
}
// mhmm... why does body_buffer still contain the newline?
@ -359,8 +361,8 @@ void step() {
first_response();
step();
} else {
croak("_error_syntax_initialization",
"The new protocol begins with a pipe and a line feed.");
croak("_error_syntax_initialization");
// "The new protocol begins with a pipe and a line feed.");
}
break;
default: // uhm... if we ever get here this is the programmers fault

View file

@ -28,7 +28,7 @@ parse(string body, mapping headers) {
P4((body))
//#endif
unless (pointerp(wurst = parse_json(body))) {
monitor_report("_failure_network_fetch_twitter_empty",
monitor_report("_failure_network_fetch_twitter_broken",
"[_source] failed to parse its timeline");
return;
}