mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
Compare commits
59 commits
psyced-201
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
d04fd7e105 | ||
|
d97953ce47 | ||
|
9441f0758a | ||
|
927074c26a | ||
|
f0b72e0a2f | ||
|
e45a2b4ef0 | ||
|
0a7f208a72 | ||
|
5c859e6fef | ||
|
fbc563a94e | ||
|
372e704a58 | ||
|
14449cce13 | ||
|
b878250bbf | ||
|
4f7fb2cebe | ||
|
95fbeacb35 | ||
|
2e459558f5 | ||
|
04a4908877 | ||
|
9e02ba080c | ||
|
79d7ed3549 | ||
|
b0b3d375a3 | ||
|
92aaf00fff | ||
|
3eab6d6140 | ||
|
05a26075e8 | ||
|
c5ce025488 | ||
|
8c1efb6b21 | ||
|
5fe2b01a24 | ||
|
9731fb9ff6 | ||
|
624709914b | ||
|
484b6440dc | ||
|
4176e267d8 | ||
|
e6cd27632e | ||
|
291bd308c2 | ||
|
3371998372 | ||
|
01da99ea64 | ||
|
7e1a26519c | ||
|
a68a84b924 | ||
|
952d09e5f2 | ||
|
b47b2e63d1 | ||
|
65cccd64e3 | ||
|
f667ef8d67 | ||
|
bdf05e9aab | ||
|
7246640faf | ||
|
d52b7ee982 | ||
|
18e72b74cc | ||
|
8538a31075 | ||
|
8b05dff5f6 | ||
|
13162b1665 | ||
|
4cf112c2f0 | ||
|
12c74b4910 | ||
|
1729406dda | ||
|
0736ee4a57 | ||
|
6627827c56 | ||
|
7ed24714e8 | ||
|
d6acc233d9 | ||
|
9e96208836 | ||
|
eab3b55a35 | ||
|
e5acd8889b | ||
|
27bb5e294f | ||
|
e784af81aa | ||
|
4b7ead3d37 |
61 changed files with 1477 additions and 894 deletions
92
CHANGESTODO
92
CHANGESTODO
|
@ -11,20 +11,35 @@ vim:nosmarttab:syntax=diff
|
|||
| Then again, no. psyced is in low maintenance mode since it roughly
|
||||
| does what it should and we need a distributed communication system
|
||||
| such as secushare.org anyway.
|
||||
________________________________________________________________________
|
||||
== LIBPSYC / PSYC2 =====================================================
|
||||
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
- check packet and variable lengths for sanity before allocating memory
|
||||
|
||||
________________________________________________________________________
|
||||
== NUISANCES worth fixing, possibly ====================================
|
||||
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
- how is it that /join #foo.bar tries to connect a host called foo.bar?
|
||||
|
||||
- offline messages not being output (which *can* work even with OTR!)
|
||||
<<< did i fix that recently?
|
||||
|
||||
- xmpp friendships for local xmpp clients (see /show in and out)
|
||||
|
||||
- when talking to strangers, mark them somehow so we get to see answers!
|
||||
(in particular via XMPP)
|
||||
|
||||
- we should add warnings about browsers that arent mozilla compatible but claim to be
|
||||
<<< did i recently fix that with browsercap?
|
||||
|
||||
+ clean-up and release the historic webchat code
|
||||
(in case you wondered what browsercap is.. it's there)
|
||||
|
||||
+ IRC-UX: catch when folks use #notation with native commands
|
||||
like +sub
|
||||
|
||||
+ IRC-UX: give users an informational NOTICE when redirecting
|
||||
|
||||
== XMPP MUC MOSTLY BROKEN ==============================================
|
||||
|
||||
* XMTUX sagt: and these scratchboard-messages and the "going down" messages are sent by this "special user", too
|
||||
|
@ -38,6 +53,10 @@ ________________________________________________________________________
|
|||
________________________________________________________________________
|
||||
== desperate, but not serious ==========================================
|
||||
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
- _message_echo_private should display full origin to make fakes recognizable
|
||||
(or we should check lastlog to see when an echo is fake)
|
||||
Du sagst [_nick_target]: hallo alda <- not so neat.
|
||||
|
||||
- check in user:input() if data is in utf8 (using RE_UTF8) in order to produce
|
||||
proper error messages before it is processed further and may end up in
|
||||
net/jabber's emit() where it is dropped silently (see CHARS_XMPP.log)
|
||||
|
@ -1570,6 +1589,23 @@ ________________________________________________________________________
|
|||
(later people called this technique 'CERTIFICATE PINNING')
|
||||
|
||||
== PSYC CLIENTS ========================================================
|
||||
|
||||
- PSYC clients are currently not detected as being secure even if they
|
||||
connect by Tor, TLS or localhost. This is because the net/psyc/user object
|
||||
as such isn't connected and the attempt to find the corresponding circuit
|
||||
opens up the question: what if the user has several clients linked? Does
|
||||
a secure one qualify for the entire user object to be trustworthy? What if
|
||||
there is another client that isn't secure? Possible approach to solve the
|
||||
issue: Disallow any password-protected user to be logged in over insecure
|
||||
channels at any time. This is probably a good idea anyway as it respects
|
||||
the civil rights of *other* users that interact with this user in the
|
||||
expectation that conversations be private. This has the side effect that
|
||||
PSYC users are forced to register before entering @welcome, unless we also
|
||||
do the refactoring described in MULTIPLE CLIENT INTERFACES and somehow fix
|
||||
that aspect in the process. Or we just walk through all the links and make
|
||||
sure all of them are secure, but that raises the problem of dealing with a
|
||||
new insecure client connecting.
|
||||
|
||||
- tg runs into trouble using _do_enter and _do_leave. apparently the enter-echo
|
||||
is not accepted by the UNI and thus does not make it into _list_places
|
||||
- _do_leave does not forward the echo from remote places back to the client
|
||||
|
@ -1582,8 +1618,6 @@ ________________________________________________________________________
|
|||
? psyc clients haben uferlose idle times
|
||||
und sie altern nicht
|
||||
|
||||
? cryptochat raum?
|
||||
|
||||
? how to improve _request_store and _retrieve?
|
||||
look at http://asg.web.cmu.edu/acap/ for ideas
|
||||
|
||||
|
@ -1834,9 +1868,9 @@ see also: http://about.psyc.eu/SPAM
|
|||
evtl nicht alle im richtigen channel, um den enter zu sehen..)
|
||||
|
||||
== IRC ISSUES 1.0 ======================================================
|
||||
- according to rfc and ircd source IRC parser should accept when the last
|
||||
argument is just a word instead of a phrase prefixed by :
|
||||
this is unusual, but legal: "PRIVMSG #blah hello"
|
||||
- when using +follow instead of /join, the current place is stored and
|
||||
an autojoin is performed on next login. we should abolish the concept
|
||||
of "current place" for irc clients, i guess.
|
||||
|
||||
+ some irc clients do not implement their own pinging, and some NATs really
|
||||
kill your irc session if it is too quiet too long. we need optional server
|
||||
|
@ -2126,31 +2160,6 @@ ________________________________________________________________________
|
|||
? MUDOS-SUPPORT, things tbd:
|
||||
- unless (checkVar(&key, &value)) return;
|
||||
- psyc/library
|
||||
________________________________________________________________________
|
||||
> PERLPSYC TODO:
|
||||
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
- FORK
|
||||
- negotiation muss sowohl blocking als auch nonblocking funktionieren. per
|
||||
deliver() call lässt sich das problemlos regeln, nur muss man es coden ,)
|
||||
? merge/borrow with/from http://perlmudclient.sourceforge.net/
|
||||
GNU readline, SSL, MCP editing, ANSI colors, telnet neg + char/fs mode!
|
||||
+ MD5 support.. damit wir lpcräume und perlscripte mit einem shared secret
|
||||
konfigurieren können. md5 überprüft dann die legitimität der nachricht.
|
||||
oder wir implementieren das auf serverconnect-ebene.. hmmm
|
||||
|
||||
> sonst noch evtl anguckenswert
|
||||
+ http://search.cpan.org/~sparsons/Net-Dev-Syslog-0.8.0/Syslog.pm
|
||||
+ http://freshmeat.net/projects/yeemp/ GPG over SSL, UTF8 etc.
|
||||
? http://freshmeat.net/projects/xchatosd/ X11 OSD hihi
|
||||
? http://freshmeat.net/projects/imappserver/ für weitere IM gateways
|
||||
http://freshmeat.net/projects/rss-im/
|
||||
|
||||
+ FILE TRANSFER APPS
|
||||
would love to have some commands to send files around.. like a psyc fileshare daemon
|
||||
to run in bg if there is no psycion, a directory to put files for friends in, commands
|
||||
to manually send files to friends or browse their offers or friendcast searches (via
|
||||
the UNI). still my friends need to be able to do all of this with a psyconaut..
|
||||
- checkout the fileshare stuff in perlpsyc/bin/
|
||||
|
||||
________________________________________________________________________
|
||||
========================================================================
|
||||
|
@ -3959,7 +3968,28 @@ net/spyc net/psyc
|
|||
+ looks like it is a good idea to activate XMPP_BIDI by default
|
||||
- folklore: fixed the output order of messages in place/basic
|
||||
=== 201602 ============================================================
|
||||
- disallow people to expose private data by crypto downgrade
|
||||
+ irc: introducing _data_psyctext as a way to output the proper
|
||||
psyced error message to IRC clients when failing to enter
|
||||
a channel with restrictions like obligatory encryption
|
||||
|
||||
+ more advanced psyconf
|
||||
=== 201605 ============================================================
|
||||
+ support for ACME aka letsencrypt
|
||||
+ gentoo ebuilds have moved into youbroketheinternet overlay
|
||||
=== 201606 ============================================================
|
||||
- according to rfc and ircd source IRC parser should accept when
|
||||
the last argument is just a word instead of a phrase prefixed by :
|
||||
this is unusual, but legal: "PRIVMSG #blah hello" (thx defanor)
|
||||
-> fixed in a68a84b9248ac3865d98c86397df3d4451905f61
|
||||
=== 201607 ============================================================
|
||||
+ integration of textual MUD gaming by /set mudlink and /talk $mud
|
||||
+ demonstration of outgoing TCP from chatrooms with the @nemesis
|
||||
place that connects to the Nemesis MUD
|
||||
+ properly display onion-protected incoming connections
|
||||
in /tcp and /lu
|
||||
- minor fix in @remotor for users of the Tor remote control tool
|
||||
=== 2016xx ============================================================
|
||||
+ improve resistance against anti-ethical business models:
|
||||
future changes to psyced are subject to Affero GPL
|
||||
+ recognize gnunet-exit as secure transport
|
||||
=== 2017xx ============================================================
|
||||
|
|
837
COPYLEFT.txt
837
COPYLEFT.txt
|
@ -1,280 +1,661 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
0. Definitions.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
1. Source Code.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
2. Basic Permissions.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
14. Revised Versions of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
NO WARRANTY
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
secushare
|
||||
Copyright (C) 2016 mirror
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
|
61
LICENSE.txt
61
LICENSE.txt
|
@ -10,63 +10,8 @@ ___
|
|||
Tobias Josefowitz (psyc://goodadvice.pages.de/~heldensaga)
|
||||
Arne Gödeke (psyc://psyced.org/~el) and
|
||||
Dominik Sander (psyc://psyced.org/~depairet).
|
||||
|
||||
All development prior to 2010 has been published under a GNU GPL as
|
||||
described below. Development since 2010-01-01 is published under the
|
||||
MIT license also described below. To deploy psyced installations of
|
||||
versions since 2010, both license requirements must typically be met.
|
||||
|
||||
___ Until 2010:
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
___ Since 2010:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files
|
||||
(the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
___
|
||||
|
||||
This program is also available under different license from
|
||||
Carlo von Loesch and symlynX. To this purpose all copyright
|
||||
owners until 2010 grant Carlo von Loesch and symlynX the right
|
||||
to use and license this program in whatever suitable way.
|
||||
|
||||
By the act of submitting code to the psyced maintainers you guarantee
|
||||
that you are either the author and copyright owner of the contribution
|
||||
you are making, or that you have a license to use said contribution in
|
||||
a way compatible with our licenses. If you fail to do so, you
|
||||
remain the sole responsible for your actions; no part of the
|
||||
responsibility will be transferred to symlynX.
|
||||
|
||||
This means, for example, that you cannot contribute code elements
|
||||
which stem from an other GPL project, as this would not comply with
|
||||
the MIT license requirement after 2010.
|
||||
|
||||
You can however keep this kind of modifications to yourself, or
|
||||
publish your own GPL licensed fork of this software, or - in agreement
|
||||
with us - add optional parts to this software clearly marked as not
|
||||
adhering to this license.
|
||||
|
||||
This version of psyced is available under the conditions of the Affero
|
||||
GNU Public License described in COPYLEFT.txt. Previous versions have
|
||||
been available under less ethical open source licenses.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/perl
|
||||
#!/usr/bin/env perl
|
||||
### -I/opt/psyced/utility
|
||||
# the include path would help finding INI.pm, but what if you the user
|
||||
# have decided to install psyced elsewhere?
|
||||
|
@ -613,7 +613,7 @@ X
|
|||
# TODO: generate a psyced.gdb file kind of like this
|
||||
print <<X if 0;
|
||||
file /bin/psyclpc
|
||||
run -DDEBUG=1 -u 4404 4404 2323 6667 5222 9999 etc. whatever flags necessary
|
||||
run -DDEBUG=1 -u 4404 4404 2323 6667 5222 6697 etc. whatever flags necessary
|
||||
X
|
||||
|
||||
# PSYCED INIT.D SCRIPT
|
||||
|
@ -736,7 +736,7 @@ DNSPort 9053
|
|||
# .onion domain names will not 'resolve' like normal ones.
|
||||
TransPort 9040
|
||||
# See also the iptables call in the init script.
|
||||
# Both are not fundamentally necesseary, you can remove them.
|
||||
# Both are not fundamentally necessary, you can remove them.
|
||||
|
||||
HiddenServiceDir $base/etc/tor/.onion
|
||||
X
|
||||
|
|
|
@ -16,5 +16,5 @@ copy files out of here to where you need them.
|
|||
=== UPDATE! ===
|
||||
|
||||
Gentoo configuration has moved into the youbroketheinternet-overlay
|
||||
available from git://cheettyiapsyciew.onion/youbroketheinternet-overlay
|
||||
available from git://psyciumunsqarzsehz5xlgsi2mg4dkvntwf5bwj5kwbcbazwiuhna2ad.onion/youbroketheinternet-overlay
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#define HTTPS_PORT 34443
|
||||
|
||||
#define IRC_PORT 6667
|
||||
#define IRCS_PORT 9999
|
||||
#define IRCS_PORT 6697
|
||||
|
||||
#define JABBER_PORT 5222
|
||||
#define JABBERS_PORT 5223
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#define HTTPS_PORT 34443
|
||||
|
||||
#define IRC_PORT 6667
|
||||
#define IRCS_PORT 9999
|
||||
#define IRCS_PORT 6697
|
||||
|
||||
#define JABBER_PORT 5222
|
||||
#define JABBERS_PORT 5223
|
||||
|
|
|
@ -125,7 +125,11 @@ _jabber_clients = 5222
|
|||
_jabber_clients_encrypted = 5223
|
||||
_IRC = 6667
|
||||
_IRC_hidden = 6667
|
||||
_IRC_encrypted = 9999
|
||||
; according to https://tools.ietf.org/html/draft-butcher-irc-url-04
|
||||
; we should be using 994, but then you better do a firewall forward.
|
||||
; then again https://tools.ietf.org/html/rfc7194 favors 6697.
|
||||
; who knows what actual ircs: URL implementations will do?
|
||||
_IRC_encrypted = 6697
|
||||
_HTTP = 33333
|
||||
;_HTTP_hidden = 80
|
||||
_HTTP_encrypted = 34443
|
||||
|
|
19
install.sh
19
install.sh
|
@ -22,10 +22,11 @@
|
|||
#
|
||||
# psyclpc as obtained from http://lpc.psyc.eu
|
||||
driver="psyclpc"
|
||||
driverver="20111122"
|
||||
driverver="20160417"
|
||||
driversha256="ad403ad4243fea52d79b1d89d9ad30e2f6a89b4263cf13f329386d03cb6d4fbf"
|
||||
lpcbaseurl="http://www.psyced.org/files/"
|
||||
zip="bz2"
|
||||
zipcmd="bzip2"
|
||||
zip="xz"
|
||||
zipcmd="xz"
|
||||
|
||||
# useful for debugging - see what files it would produce
|
||||
exit="exit 1"
|
||||
|
@ -47,8 +48,14 @@ then
|
|||
|
||||
!!${hi} HEY YOU, PORTAGE USER ${lo}!!
|
||||
If you are running gentoo/portage you should try out our beautiful ebuilds
|
||||
at http://www.psyced.org/files/gentoo.tar.bz2 instead of this installation
|
||||
script. Stop it now.
|
||||
in the youbroketheinternet-overlay instead of this installation script.
|
||||
Stop it now and do this...
|
||||
|
||||
torify git clone git://git.psyciumunsqarzsehz5xlgsi2mg4dkvntwf5bwj5kwbcbazwiuhna2ad.onion/youbroketheinternet-overlay
|
||||
|
||||
or this instead:
|
||||
|
||||
git clone git://git.psyced.org/youbroketheinternet-overlay
|
||||
|
||||
${hi}Warning: OLD-SCHOOL install.sh STARTING${lo} ...
|
||||
|
||||
|
@ -193,6 +200,8 @@ if ! test `ls -1 ${driver}-*tar.${zip} 2>/dev/null`
|
|||
if wget "${lpcbaseurl}/${driver}-${driverver}.tar.${zip}"
|
||||
then
|
||||
echo "${driver} successfully retrieved."
|
||||
echo "Expect this checksum:\n\n${driversha256}"
|
||||
sha256sum ${driver}
|
||||
else
|
||||
echo "${hi}ATTENTION: Unable to download ${driver}"
|
||||
echo "${hi}ATTENTION: ${lo}You have no ${driver}-*.tar.${zip} in this directory."
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
#define PLACE_HISTORY_EXPORT
|
||||
#define PLACE_SCRATCHPAD
|
||||
#define SECURE
|
||||
#include <place.gen>
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
#ifdef BRAIN
|
||||
# echo BRAIN: connecting to freenode IRC server
|
||||
//# define CONNECT_IRC "irc." NAME ".net"
|
||||
# define CONNECT_IRC "calvino.freenode.net"
|
||||
# define CONNECT_IRC "irc." NAME ".net"
|
||||
//# define CONNECT_IRC "calvino.freenode.net"
|
||||
//# define CHAT_CHANNEL "esp"
|
||||
//# define CHAT_CHANNEL "23c3"
|
||||
# define PASS_IRC IRCGATE_FREENODE
|
||||
|
|
9
place/git.c
Normal file
9
place/git.c
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include <net.h>
|
||||
#define NAME "git"
|
||||
|
||||
//#ifdef BRAIN
|
||||
# define REDIRECT "psyc://psyced.org/@PSYC"
|
||||
//#endif
|
||||
|
||||
#include <place.gen> // now generate the place according to the rules
|
||||
|
24
place/nemesis.c
Normal file
24
place/nemesis.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
#include <net.h>
|
||||
|
||||
//#ifdef BRAIN
|
||||
# define CONNECT_TELNET "nemesis.de", 2000
|
||||
//#else
|
||||
//# define CONNECT_TELNET "nemesis.de", 2001 // NemTest
|
||||
//#endif
|
||||
|
||||
#define ON_CONNECT emit("guest\n");
|
||||
#define ON_ANY NET_PATH "tn/outgoing"::msg(source, mc, data, vars);
|
||||
|
||||
#include <place.gen>
|
||||
|
||||
// to do this properly, we need a systematic way to redo prompts FIXME
|
||||
parse(all) {
|
||||
// remove Nemesis' guest prompt.. why was i so funny
|
||||
// back then to implement several prompt chars?
|
||||
if (strlen(all) > 2 && all[1] == ' ' &&
|
||||
(all[0] == '#' || all[0] == '>')) all = all[2 ..];
|
||||
return ::parse(all);
|
||||
}
|
||||
|
||||
#echo Nemesis gateway loaded.
|
||||
|
16
place/notify.c
Normal file
16
place/notify.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
// typical quiet pubsub place for receiving git2psyc notifications
|
||||
|
||||
#include <net.h>
|
||||
|
||||
#define NAME "notify"
|
||||
#define SILENT
|
||||
#define PLACE_HISTORY_EXPORT
|
||||
#define HISTORY_METHOD "_notice_update"
|
||||
#define HISTORY_GLIMPSE 4
|
||||
|
||||
// allow notifications from anywhere.. you may want to restrict this.
|
||||
// see wikinotify.c and http://about.psyc.eu/create_place about that.
|
||||
#define ALLOW_EXTERNAL
|
||||
|
||||
#include <place.gen>
|
||||
|
66
place/rating.c
Normal file
66
place/rating.c
Normal file
|
@ -0,0 +1,66 @@
|
|||
#include <net.h>
|
||||
#include <text.h>
|
||||
#include <ht/http.h>
|
||||
|
||||
#define NAME "rating"
|
||||
#define PRIVATE
|
||||
#define SECURE
|
||||
#include <place.gen>
|
||||
|
||||
#define RATING_TITLE "This is a demonstration of psyced's rating tool"
|
||||
#define RATING_ITEMS 3
|
||||
#define RATING_ITEM_HEIGHT 100
|
||||
#define DEFAULT_RATING_AMOUNT 5
|
||||
#define RATING_UNIFORM_PREFIX "https://www.psyced.org/rating/"
|
||||
|
||||
// hack, should be using w() instead
|
||||
#define htfs(BLA) write("<body bgcolor='black' text='white'><center>"+ BLA +"</center");
|
||||
|
||||
mapping rating = ([ ]);
|
||||
|
||||
htget(prot, query, headers, qs, data, noprocess) {
|
||||
htnotify(query, headers, "_rating_test",
|
||||
"[_nick_place] by [_web_on] from [_web_from] using '[_parameters]'.", 0, qs);
|
||||
sTextPath(query["layout"], query["lang"], "html");
|
||||
string j = query["juror"];
|
||||
unless (j) {
|
||||
hterror(prot, R_PAYMENTREQ, "Hello!? Who are you?");
|
||||
return 1;
|
||||
}
|
||||
mapping previous = rating[lower_case(j)];
|
||||
htok(prot);
|
||||
if (query["c001"]) {
|
||||
if (previous) {
|
||||
htfs("Replaced old evaluation by new one. Thank you, "+j);
|
||||
} else {
|
||||
htfs("Evaluation stored. Thank you, "+j);
|
||||
}
|
||||
rating[lower_case(j)] = query;
|
||||
log_file("RATING", "\n%O from %O using %O got %O\n",
|
||||
ME, query_ip_name(), headers["user-agent"], query);
|
||||
return 1;
|
||||
}
|
||||
w("_PAGES_start_group_rating", 0,
|
||||
([ "_title_page" : htquote(RATING_TITLE),
|
||||
// "_parameters" : query["parameters"] || qs,
|
||||
"_uniform_logo" : HT_LOGO,
|
||||
"_nick_juror" : j || query_ip_number(),
|
||||
"_amount_height_item" : RATING_ITEM_HEIGHT,
|
||||
"_nick_place" : MYNICK ]) );
|
||||
// printf("%O vs %O\n", query, headers);
|
||||
for (int i=1; i <= RATING_ITEMS; i++) {
|
||||
string ii=sprintf("%03d", i);
|
||||
w("_HTML_item_rating", 0, ([
|
||||
"_index_item" : ii,
|
||||
"_uniform_item" : RATING_UNIFORM_PREFIX +ii,
|
||||
"_amount_rating_item" : previous? previous["r"+ii]: DEFAULT_RATING_AMOUNT,
|
||||
"_comment_item" : previous? previous["c"+ii] || "": "",
|
||||
"_nick_place" : MYNICK ]) );
|
||||
}
|
||||
w("_PAGES_end_group_rating", 0, ([
|
||||
"_comment_notes" : previous? previous["notes"] || "": "",
|
||||
"_nick_place" : MYNICK ]) );
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
28
place/remotor.c
Normal file
28
place/remotor.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
// this place is configured in a suitable way for receiving
|
||||
// tor router events from the remotor tool in perlpsyc
|
||||
//
|
||||
#include <net.h>
|
||||
|
||||
#ifdef ADMINISTRATORS
|
||||
# define PLACE_OWNED ADMINISTRATORS
|
||||
#else
|
||||
# echo place/remotor has no owners!
|
||||
#endif
|
||||
|
||||
#define NAME "remoTor"
|
||||
//#define PRIVATE
|
||||
#define SECURE
|
||||
#define SILENT
|
||||
//#define RESTRICTED
|
||||
|
||||
#define PLACE_HISTORY_EXPORT
|
||||
#define HISTORY_GLIMPSE 7
|
||||
#define HISTORY_METHOD "_notice"
|
||||
|
||||
#ifdef BRAIN
|
||||
# define ALLOW_EXTERNAL_FROM "psyc://psyced.org"
|
||||
#else
|
||||
# define ALLOW_EXTERNAL_FROM "psyc://localhost"
|
||||
#endif
|
||||
|
||||
#include <place.gen>
|
7
place/welcome.c
Normal file
7
place/welcome.c
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include <net.h>
|
||||
|
||||
#define NAME "welcome"
|
||||
#define PLACE_HISTORY
|
||||
|
||||
#include <place.gen>
|
||||
|
|
@ -16,7 +16,7 @@ but in the year 2005 this is still not the case. -lynX
|
|||
#define ESC2 '`' /* other special escape char */
|
||||
#define STRESC2 "`"
|
||||
-#define CMDSEP ';' /* command separator character */
|
||||
+#define CMDSEP '§' /* command separator character */
|
||||
+#define CMDSEP '\\' /* command separator character */
|
||||
#define SPECIAL_CHARS "{}();\"=" /* specials chars needing escape */
|
||||
#define MPI "~$#E" /* MUME protocol introducer */
|
||||
#define MPILEN 4 /* strlen(MPI) */
|
||||
|
|
|
@ -722,6 +722,11 @@ _PAGES_help_settings
|
|||
|Mit "<b>/set filter off</b>" kann der private Firewall wieder abgeschaltet
|
||||
|werden. "<b>default</b>" geht auf die Voreinstellung zurück.
|
||||
|
|
||||
|<a name="loginhistory"></a>
|
||||
|<DT><P><B> /set loginhistory <Anzahl></B></p><dd>
|
||||
|taugt zur Einschränkung wieviele Nachrichten aus der Historie vergangener
|
||||
|öffentlicher Nachrichten beim Einloggvorgang dargestellt werden.
|
||||
|
|
||||
|<a name="presencefilter"></a>
|
||||
|<DT><P><B> /set presencefilter [ on | off | all | automatic ] </B></p><dd>
|
||||
|hilft die Menge an Anwesenheit- und Abwesenheitsbekundungen in Zaum zu
|
||||
|
|
|
@ -700,6 +700,9 @@ _error_unavailable_function_here
|
|||
_error_unavailable_function_place_topic
|
||||
|Diese Funktion ist Dir hier nicht zugänglich.
|
||||
|
||||
_error_unavailable_person_more
|
||||
|Nanu, welche Konversation soll weitergeführt werden?
|
||||
|
||||
_error_unavailable_place_other
|
||||
|Es wurde noch kein anderer Raum betreten, zu dem man nun wechseln könnte.
|
||||
|
||||
|
|
|
@ -203,6 +203,11 @@ _PAGES_help_display
|
|||
|wait to meet you in a room. "<b>default</b>" resets this value to
|
||||
|the local default.
|
||||
|
|
||||
|<a name="loginhistory"></a>
|
||||
|<DT><P><B> /set loginhistory <amount></B></p><dd>
|
||||
|lets you define an upper limit in the number of history
|
||||
|messages you want to see when logging into the server.
|
||||
|
|
||||
|</dl>
|
||||
|{_HTML_info_split}
|
||||
|<dl>
|
||||
|
@ -1005,6 +1010,22 @@ _PAGES_error
|
|||
|
|
||||
|{_HTML_tail}
|
||||
|
||||
_PAGES_group_challenge
|
||||
|<title>challenge for [_nick_place]@{_VAR_host}</title>
|
||||
|
|
||||
|{_HTML_head}
|
||||
|<div align="center">
|
||||
|<h1>[_challenge]</h1>
|
||||
|
|
||||
|## action="/@[_nick_place]" doesn't make it better
|
||||
|<form method="GET">
|
||||
|<input type="string" name="answer">
|
||||
|<input type="hidden" name="parameters" value="[_parameters]">
|
||||
|</form>
|
||||
|
|
||||
|</div>
|
||||
|{_HTML_tail}
|
||||
|
||||
_PAGES_group_scratchpad
|
||||
|<title>scratchpad for [_nick_place]@{_VAR_host}</title>
|
||||
|
|
||||
|
|
|
@ -363,6 +363,11 @@ _notice_typing_active
|
|||
_notice_typing_gone
|
||||
|<message to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><gone xmlns='http://jabber.org/protocol/chatstates'/></message>
|
||||
|
||||
_notice_telnet_verbatim
|
||||
|<message from='[_INTERNAL_source_jabber_bare]' to='[_INTERNAL_target_jabber]' type='groupchat'>
|
||||
| <body>[_text_verbatim]</body>
|
||||
|</message>
|
||||
|
||||
_notice_place
|
||||
|<message from='[_INTERNAL_source_jabber_bare]' to='[_INTERNAL_target_jabber]' type='groupchat'>
|
||||
| <body>[_data]</body>
|
||||
|
|
|
@ -21,7 +21,9 @@ inherit NET_PATH "library/tls";
|
|||
# ifdef SANDBOX
|
||||
inherit NET_PATH "library/sandbox";
|
||||
# endif
|
||||
# if __EFUN_DEFINED__(hmac)
|
||||
inherit NET_PATH "library/hmac";
|
||||
# endif
|
||||
inherit NET_PATH "library/dns";
|
||||
inherit NET_PATH "library/htbasics";
|
||||
inherit NET_PATH "library/json";
|
||||
|
|
|
@ -21,9 +21,6 @@
|
|||
# define AUTODETECT 1 // use TLS autodetect if libpsyc is available
|
||||
#else
|
||||
# define AUTODETECT 0
|
||||
# ifdef SPYC_PATH
|
||||
# echo libpsyc is not enabled in driver. Using old protocol parser instead.
|
||||
# endif
|
||||
#endif
|
||||
|
||||
volatile int shutdown_in_progress = 0;
|
||||
|
|
|
@ -219,6 +219,7 @@ void receive_udp(string host, string msg, int port) {
|
|||
# if !__EFUN_DEFINED__(psyc_parse)
|
||||
# echo libpsyc is not enabled in driver. Using old protocol parser instead.
|
||||
# else
|
||||
# echo Excellent: enabling new PSYC syntax using libpsyc.
|
||||
case '|':
|
||||
unless (spycd) {
|
||||
spycd = SPYC_PATH "udp" -> load();
|
||||
|
|
|
@ -261,29 +261,31 @@ runQ() {
|
|||
}
|
||||
|
||||
connect(ho, po, transport, srv, extra) {
|
||||
#ifndef _flag_disable_network_circuit_connect
|
||||
if (interactive()) return -8;
|
||||
P3(("connect: %O, %O, %O, %O for %O\n", ho, po, transport, srv, ME))
|
||||
if (time() < time_of_connect_attempt + waitforme) return -2;
|
||||
if (ho) { // paranoid: stringp(ho) && strlen(ho)) {
|
||||
if (po) port = po;
|
||||
#ifndef ERQ_WITHOUT_SRV
|
||||
# ifndef ERQ_WITHOUT_SRV
|
||||
if (srv) {
|
||||
hostname = lower_case(ho);
|
||||
host = 0;
|
||||
} else
|
||||
#endif
|
||||
# endif
|
||||
host = lower_case(ho);
|
||||
P2(("connect.%s:\t%O, %O, %O\t%O\n", srv || "to",
|
||||
ho, po, transport, ME))
|
||||
}
|
||||
#ifndef ERQ_WITHOUT_SRV
|
||||
# ifndef ERQ_WITHOUT_SRV
|
||||
P4(("connect->srv_choose? depends on srv %O\n", srv))
|
||||
if (srv) return dns_srv_resolve(hostname, srv, // _psyc._tls.domain
|
||||
transport == "s" ? "tls" : "tcp", #'srv_choose,
|
||||
transport);
|
||||
#endif
|
||||
# endif
|
||||
if (::connect(host, port, transport, extra) >= 0)
|
||||
time_of_connect_attempt = time();
|
||||
#endif
|
||||
}
|
||||
|
||||
disconnected(remaining) {
|
||||
|
|
|
@ -1,21 +1,26 @@
|
|||
#include <net.h>
|
||||
|
||||
#if defined(STORAGE_MYSQL)
|
||||
# if __EFUN_DEFINED__(db_connect)
|
||||
|
||||
/*
|
||||
* from ldmud's concepts/mysql:
|
||||
*
|
||||
* As mySQL "limits" the number of connections to 100 and as every
|
||||
* connection to the mySQL-server takes time, you should use
|
||||
* database serverobjects in your MUD which constantly keep the
|
||||
* connection to the mySQL-server.
|
||||
*
|
||||
* hence we use this instead of letting each object have it's own connection
|
||||
* hence we use this instead of letting each object have its own connection.
|
||||
*
|
||||
* Actually we aren't using this code at all, since psyced makes no
|
||||
* operations by which it makes sense to use SQL rather than flat files.
|
||||
*/
|
||||
|
||||
volatile int handle;
|
||||
|
||||
create() {
|
||||
#if defined(STORAGE_MYSQL)
|
||||
handle = db_connect(STORAGE_MYSQL_DATABASE, STORAGE_MYSQL_USER, STORAGE_MYSQL_PASSWORD);
|
||||
#endif
|
||||
}
|
||||
|
||||
mixed query(string q, varargs mixed args) {
|
||||
|
@ -30,3 +35,6 @@ mixed query(string q, varargs mixed args) {
|
|||
data += ({ row });
|
||||
return data;
|
||||
}
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include <net.h>
|
||||
|
||||
#if defined(STORAGE_PGSQL)
|
||||
|
||||
/*
|
||||
* using one database connection is sufficient
|
||||
*
|
||||
|
@ -10,10 +12,8 @@
|
|||
|
||||
create() {
|
||||
int ret;
|
||||
#if defined(STORAGE_PGSQL)
|
||||
ret = pg_connect_sync(STORAGE_PGSQL_CONNECT);
|
||||
PT(("ret %d\n", ret))
|
||||
#endif
|
||||
}
|
||||
|
||||
mixed query(string q, varargs mixed args) {
|
||||
|
@ -21,3 +21,5 @@ mixed query(string q, varargs mixed args) {
|
|||
// avoid sql injections
|
||||
return pg_query_sync(sprintf(q, args...));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -136,7 +136,7 @@ static who() {
|
|||
mixed idle;
|
||||
string desc;
|
||||
|
||||
reply("--- /who of local users of "+ SERVER_UNIFORM);
|
||||
reply("--- /who of visible local users of "+ SERVER_UNIFORM);
|
||||
u = objects_people();
|
||||
all = sizeof(u) < 23;
|
||||
// same code in usercmd.i
|
||||
|
|
|
@ -24,18 +24,16 @@ varargs http_error(string prot, int code, string comment, string html) {
|
|||
P2(("hterror(%O,%O,%O,%O) in %O\n", prot,code,comment,html, ME))
|
||||
#if defined(T)
|
||||
// use the textdb if available
|
||||
out = psyctext( T("_PAGES_error",
|
||||
"<html><title id='code'>[_code]</title>\n"
|
||||
"<body><h1 id='comment'>[_comment]</h1></body></html>\n"),
|
||||
out = psyctext( T("_PAGES_error", "<title>Error [_code]</title><body><h1 id='code'>[_code]</h1><div id='comment'>[_comment]</div>"),
|
||||
([ "_comment": comment, "_code": code ]) );
|
||||
#else
|
||||
// use some hardcoded defaults
|
||||
out = "<body text=white bgcolor=black link=green vlink=green>\n";
|
||||
out = "<body text='white' bgcolor='black' link='green' vlink='green'>\n";
|
||||
if (html) out = sprintf("<title>%s</title>\n%s%s", comment, out, html);
|
||||
else out = sprintf("\
|
||||
<title>error %d</title>\n\
|
||||
<title>Error %d</title>\n\
|
||||
%s\n\
|
||||
<table width=\"100%%\" height=\"90%%\"><tr><th><h1><br>\n\n\
|
||||
<table width=\"100%%\" height=\"90%%\"><tr><th><h1><br/>\n\n\
|
||||
%s\n\n\
|
||||
</h1></th></tr></table>\n\
|
||||
",
|
||||
|
|
|
@ -95,12 +95,19 @@ varargs string htredirect(string prot, string target, string comment, int perman
|
|||
printf("%s %d %s\n%s", HTTP_SVERS,
|
||||
permanent ? R_MOVED : R_FOUND, comment, htheaders());
|
||||
}
|
||||
// this page might actually be visible
|
||||
// if content-disposition: attachment is given
|
||||
// or redirects are otherwise intercepted by plugin
|
||||
// so a proper _PAGES form could be appropriate
|
||||
printf("\
|
||||
Location: %s\n%s\
|
||||
\n\
|
||||
<a href=\"%s\">%s</a>.\n\
|
||||
",
|
||||
target, extra, target, comment);
|
||||
<title>%s</title>\n\
|
||||
<body bgcolor='black' text='white' link='red' vlink='red'>\n\
|
||||
%s\n",
|
||||
// exposing the link to end-user may not be intended:
|
||||
// <a href=\"%s\">%s</a>.
|
||||
target, extra, comment, comment);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -113,12 +113,8 @@ process_header() {
|
|||
}
|
||||
|
||||
parse_request(input) {
|
||||
P2(("=== HTTP got: %O from %O\n", input, query_ip_name(ME)))
|
||||
|
||||
// reset state. in case we support HTTP/1.1. do we?
|
||||
method = item = url = prot = qs = 0;
|
||||
headers = ([]);
|
||||
body = "";
|
||||
P0(("=== HTTP got: %O from %O\n", input, query_ip_name(ME)))
|
||||
if (input == "HEAD / HTTP/1.1") return 1;
|
||||
|
||||
if (!input || input=="") {
|
||||
// should return error?
|
||||
|
@ -126,9 +122,14 @@ parse_request(input) {
|
|||
// lets just ignore the empty line
|
||||
return 1;
|
||||
}
|
||||
// reset state. in case we support HTTP/1.1. do we?
|
||||
method = item = url = prot = qs = 0;
|
||||
headers = ([]);
|
||||
body = "";
|
||||
|
||||
input = explode(input, " ");
|
||||
switch(sizeof(input)) {
|
||||
default:
|
||||
case 3:
|
||||
prot = input[2];
|
||||
next_input_to(#'parse_header);
|
||||
case 2:
|
||||
|
@ -140,12 +141,18 @@ parse_request(input) {
|
|||
unless (sscanf(url, "%s?%s", item, qs)) item = url;
|
||||
method = lower_case(input[0]);
|
||||
break;
|
||||
case 1:
|
||||
// should return error!
|
||||
quit();
|
||||
default:
|
||||
http_error(prot, R_BADREQUEST,
|
||||
"invalid "+HTTP_SVERS+" request");
|
||||
quit(); return 1;
|
||||
}
|
||||
P4(("=== HTTP user requested url: %O\n", url))
|
||||
if (method == "connect") next_input_to(#'parse_wait);
|
||||
else if (!sizeof(url) || url[0] != '/') {
|
||||
http_error(prot, R_BADREQUEST,
|
||||
"invalid "+HTTP_SVERS+" request");
|
||||
quit(); return 1;
|
||||
}
|
||||
else if (!prot) process(); // HTTP/0.9 has no headers
|
||||
else next_input_to(#'parse_header);
|
||||
}
|
||||
|
@ -162,8 +169,7 @@ process() {
|
|||
P4(("found cookie: %O\n", t))
|
||||
if (t && sscanf(t, "psyced=\"%s\"", t)) {
|
||||
P3(("got cookie: %O\n", t))
|
||||
query = url_parse_query(query, t);
|
||||
P4(("parsed cookie: %O\n", query))
|
||||
qs = qs ? t+"&"+qs : t;
|
||||
}
|
||||
#ifdef GENERIC_COOKIES // we might need them someday..?
|
||||
// if within the same domain other cookies are being used, like
|
||||
|
@ -191,6 +197,8 @@ process() {
|
|||
query = url_parse_query(query, body);
|
||||
}
|
||||
P4(("parsed query: %O\n", query))
|
||||
// remember original form of item in headers mapping
|
||||
headers["item"] = item;
|
||||
switch (item) {
|
||||
case "/favicon.ico":
|
||||
#if 0
|
||||
|
|
|
@ -53,7 +53,8 @@
|
|||
# define DEFAULT_CONTENT_TYPE "text/html; charset=" SYSTEM_CHARSET
|
||||
#endif
|
||||
|
||||
#if __EFUN_DEFINED__(idna_stringprep) && defined(DRIVER_PATH)
|
||||
// 2018-05 tmp disabled stringprep:
|
||||
#if __EFUN_DEFINED__(idna_stringprep) && defined(DRIVER_PATH) && !defined(_flag_disable_idna_stringprep)
|
||||
// stringprep needs utf8 arguments
|
||||
// this results in lots of conversions some of which look like
|
||||
// system->utf>system->utf. luckily UTF8 is our system charset.
|
||||
|
@ -102,6 +103,9 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
// virtual IP network of GNUnet exit service
|
||||
#define IS_GNUNET(ip) abbrev("169.254.86.", ip)
|
||||
|
||||
#define HAS_PORT(PORT, PATH) (defined(PATH) && defined(PORT) && PORT - 0)
|
||||
// also need HAS_TLS_PORT() ?
|
||||
|
||||
|
@ -142,6 +146,12 @@
|
|||
# echo Please fix your #define REGISTERED_USERS_ONLY
|
||||
# define _flag_disable_unauthenticated_users
|
||||
#endif
|
||||
#ifdef _flag_disable_unauthenticated_users
|
||||
# define _flag_disable_unauthenticated_users_XMPP
|
||||
#endif
|
||||
#ifdef _flag_disable_registration
|
||||
# define _flag_disable_registration_XMPP
|
||||
#endif
|
||||
|
||||
#ifdef RELAY
|
||||
# define _flag_disable_authorization
|
||||
|
@ -221,10 +231,13 @@
|
|||
# define WANT_S2S_TLS
|
||||
# define WANT_S2S_SASL
|
||||
# define ENTER_MEMBERS
|
||||
# define PERSISTENT_MASTERS
|
||||
// disabled 2018-05 due to stringprep messing up the _routes
|
||||
// data structures *and* plenty of karteileichen which means
|
||||
// that clean-up of _routes is not working!!
|
||||
//# define PERSISTENT_MASTERS
|
||||
# define NEW_RENDER
|
||||
# define MUCSUC
|
||||
# define XMPP_BIDI
|
||||
//# define XMPP_BIDI
|
||||
#endif
|
||||
#define GAMMA // code that has left BETA and is in production use
|
||||
|
||||
|
@ -267,7 +280,7 @@
|
|||
// still using rawp anywhere?
|
||||
//#define rawp(TEXT) { P1(("rawp? "+TEXT)) emit(TEXT); }
|
||||
|
||||
#ifdef _flag_enable_module_microblogging
|
||||
#if __EFUN_DEFINED__(hmac) && defined(_flag_enable_module_microblogging)
|
||||
# if defined(TWITTER_KEY) && defined(TWITTER_SECRET)
|
||||
# define TWITTER
|
||||
# endif
|
||||
|
@ -279,6 +292,7 @@
|
|||
#define PRIVACY_SURVEILLED 0
|
||||
#define PRIVACY_UNKNOWN -1
|
||||
#define PRIVACY_MITMX509 23
|
||||
#define PRIVACY_REASONABLE 44
|
||||
#define PRIVACY_REASONABLE 42
|
||||
#define PRIVACY_GOOD 44
|
||||
|
||||
#endif
|
||||
|
|
|
@ -18,6 +18,13 @@
|
|||
#include <status.h>
|
||||
#include <uniform.h>
|
||||
|
||||
#ifndef DEFAULT_HT_LOGO
|
||||
# define DEFAULT_HT_LOGO "/img/psyc.gif"
|
||||
#endif
|
||||
#ifndef HT_LOGO
|
||||
# define HT_LOGO DEFAULT_HT_LOGO
|
||||
#endif
|
||||
|
||||
#ifdef BRAIN
|
||||
|
||||
# ifdef SLAVE
|
||||
|
@ -177,6 +184,10 @@ inherit NET_PATH "place/intercept";
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONNECT_TELNET
|
||||
inherit NET_PATH "tn/outgoing";
|
||||
#endif
|
||||
|
||||
#ifdef FETCH_TEXTDB
|
||||
volatile object feed, tob;
|
||||
|
||||
|
@ -369,6 +380,9 @@ void create() {
|
|||
#ifdef CONNECT_IRC
|
||||
link(CONNECT_IRC);
|
||||
#endif
|
||||
#ifdef CONNECT_TELNET
|
||||
link(CONNECT_TELNET);
|
||||
#endif
|
||||
#if defined(NEWSFEED_RSS) && defined(DEVELOPMENT)
|
||||
// do not connect newsfeeds immediately if running in production mode
|
||||
connect();
|
||||
|
@ -603,6 +617,132 @@ htget(prot, query, headers, qs) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CHALLENGE_QUESTION // should make media player etc work also w/o challenge FIXME
|
||||
#include <sys/regexp.h>
|
||||
#include "ht/http.h"
|
||||
|
||||
#define CHALOG(verb) log_file("CHALLENGE", "%s %s %O A:%O P:%O C:%O\n", \
|
||||
MYNICK, verb, query_ip_name(), \
|
||||
query["answer"], query["parameters"], headers["cookie"])
|
||||
|
||||
// maybe this all belongs into archetype.gen.. chesmo!
|
||||
htget(prot, query, headers, qs, data, noprocess) {
|
||||
PT(("%O place.gen::htget\n", ME))
|
||||
if (probably_private(this_interactive()) <= PRIVACY_SURVEILLED) {
|
||||
hterror(prot, R_PAYMENTREQ, "To protect against abuse in this nasty world this function needs 'https' instead of 'http'.");
|
||||
htnotify(query, headers, "_challenge_disabled_encryption",
|
||||
"[_nick_place] sees no TLS by [_web_on] from [_web_from].");
|
||||
return 0;
|
||||
}
|
||||
string item = "/@"+ MYNICK;
|
||||
if (
|
||||
# ifdef CHALLENGE_AGENT
|
||||
stringp(headers["user-agent"]) &&
|
||||
regmatch(lower_case(headers["user-agent"]), CHALLENGE_AGENT)
|
||||
# else
|
||||
# ifdef CHALLENGE_ACCOUNTS
|
||||
# define CHALLENGE_CHECK CHALLENGE_ACCOUNTS
|
||||
# else
|
||||
# ifdef CHALLENGE_MATCH
|
||||
# define CHALLENGE_CHECK CHALLENGE_MATCH
|
||||
# endif
|
||||
# endif
|
||||
stringp(headers["cookie"]) && regmatch(headers["cookie"],
|
||||
"challenge=complete&answer="+ md5(CHALLENGE_CHECK))
|
||||
# endif
|
||||
) {
|
||||
CHALOG("completes");
|
||||
htnotify(query, headers, "_challenge_accomplished_web",
|
||||
"Challenge accomplished in [_nick_place] by [_web_on] coming from [_web_from].");
|
||||
# ifdef CHALLENGE_REDIRECT
|
||||
sTextPath(query["layout"], query["lang"], "html");
|
||||
# ifdef CHALLENGE_REDIRECT_TITLE
|
||||
# ifdef CHALLENGE_QUESTION
|
||||
htok3(prot, 0, "Set-Cookie: psycplace=\"challenge=done\"; Path="+ item +"; Secure; Max-Age=9\n");
|
||||
# else
|
||||
htok();
|
||||
# endif
|
||||
// you can output a player iframe instead of a redirect...
|
||||
w("_PAGES_frame_redirect", 0,
|
||||
([ "_uniform_page" : CHALLENGE_REDIRECT,
|
||||
"_title_page" : CHALLENGE_REDIRECT_TITLE,
|
||||
"_nick_place" : MYNICK ]) );
|
||||
return 1;
|
||||
# else
|
||||
return htredirect(prot, CHALLENGE_REDIRECT, "Download or redirect initiated", 0, "Content-Disposition: attachment\nSet-Cookie: psycplace=\"challenge=done\"; Path="+ item +"; Secure; Max-Age=9\n");
|
||||
# endif
|
||||
# else
|
||||
# ifdef HTGET
|
||||
return HTGET;
|
||||
# else
|
||||
return ::htget(prot, query, headers, qs, data, noprocess);
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
# if defined(CHALLENGE_MATCH) || defined(CHALLENGE_ACCOUNTS)
|
||||
if (stringp(query["answer"])) {
|
||||
unless (headers["cookie"]) {
|
||||
CHALOG("disabled");
|
||||
hterror(prot, R_PAYMENTREQ, "To protect against abuse in this nasty world this function needs just temporarily enabled cookies. There are no de-anonymizing purposes involved. Or did you just lowercase my name in the URL?");
|
||||
htnotify(query, headers, "_challenge_disabled_web",
|
||||
"[_nick_place] sees no cookies by [_web_on] from [_web_from].");
|
||||
return 1;
|
||||
}
|
||||
string acct;
|
||||
if (regmatch(headers["cookie"], "challenge=given")) {
|
||||
if (query["answer"] &&
|
||||
# ifdef CHALLENGE_ACCOUNTS
|
||||
(acct = CHALLENGE_ACCOUNTS->consult(query["answer"]))
|
||||
# else
|
||||
regmatch(lower_case(query["answer"]), CHALLENGE_MATCH)
|
||||
# endif
|
||||
) {
|
||||
// lazy me could have used referer here ;)
|
||||
string nu = stringp(query["parameters"]) &&
|
||||
strlen(query["parameters"]) &&
|
||||
query["parameters"] != "0" ?
|
||||
item +"?"+ query["parameters"] : item;
|
||||
CHALOG(acct? ("authenticates as "+ acct): "reloads");
|
||||
htredirect(prot, nu, "Reload, please", 0, "Set-Cookie: psycplace=\"challenge=complete&answer="+ md5(CHALLENGE_CHECK) +"\"; Path="+ item +"; Secure; Max-Age=99\n");
|
||||
if (acct) htnotify(query, headers, "_challenge_authenticated_web",
|
||||
"[_web_on] authenticated for [_nick_place] coming from [_web_from].", acct);
|
||||
return 1;
|
||||
} else {
|
||||
CHALOG("fails");
|
||||
htnotify(query, headers, "_challenge_failed_web",
|
||||
"[_nick_place] sees [_web_on] from [_web_from] fail the challenge.");
|
||||
}
|
||||
}
|
||||
} else
|
||||
# endif
|
||||
{
|
||||
CHALOG("challenges");
|
||||
htnotify(query, headers, "_challenge_presented_web",
|
||||
"[_nick_place] challenges [_web_on] coming from [_web_from].");
|
||||
// (query [_web_query], cookie [_web_cookie]).");
|
||||
}
|
||||
// If you have trouble reloading the HTML template
|
||||
// look out for both 'ht' and 'html' textdbs!
|
||||
sTextPath(query["layout"], query["lang"], "html");
|
||||
// using a non-psyced cookie here so that you can't construct a
|
||||
// url that allows other people to bypass the challenge.
|
||||
htok3(prot, 0, "Set-Cookie: psycplace=\"challenge=given\"; Path="+ item +"; Secure; Max-Age=999\n");
|
||||
# ifndef CHALLENGE_REDIRECT_TITLE
|
||||
# define CHALLENGE_REDIRECT_TITLE "Challenge for "+ MYNICK
|
||||
# endif
|
||||
w("_PAGES_group_challenge", 0,
|
||||
([ "_challenge" : htquote(CHALLENGE_QUESTION),
|
||||
// if the user failed the challenge,
|
||||
// we maintain the original qs for next attempt:
|
||||
"_parameters" : query["parameters"] || qs,
|
||||
"_uniform_logo" : HT_LOGO,
|
||||
"_title_page" : CHALLENGE_REDIRECT_TITLE,
|
||||
"_nick_place" : MYNICK ]) );
|
||||
// printf("%O vs %O\n", query, headers);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HISTORY
|
||||
# if defined(HISTORY_METHOD) || defined(HISTORY_MAY_LOG)
|
||||
mayLog(mc) {
|
||||
|
|
|
@ -38,6 +38,12 @@ createUser(nick) {
|
|||
return named_clone(IRC_PATH "user", nick);
|
||||
}
|
||||
|
||||
#ifndef _flag_enable_unencrypted_users
|
||||
ignorance(a) {
|
||||
if (ME) next_input_to(#'ignorance);
|
||||
}
|
||||
#endif
|
||||
|
||||
parse(a) {
|
||||
::parse(a);
|
||||
if (ME) next_input_to(#'parse);
|
||||
|
@ -158,15 +164,26 @@ tls_logon(a) {
|
|||
|
||||
logon(failure) {
|
||||
if (this_interactive()) set_prompt(""); // case of failure?
|
||||
next_input_to(#'parse);
|
||||
#if __EFUN_DEFINED__(tls_query_connection_state)
|
||||
# ifdef _flag_enable_unencrypted_users
|
||||
if (tls_query_connection_state(ME) == 0) {
|
||||
// DONT ::logon if this is to be done by tls_logon
|
||||
::logon(failure);
|
||||
}
|
||||
# else
|
||||
if (probably_private(ME) <= PRIVACY_SURVEILLED) {
|
||||
log_file("IRCPLAIN", "[%s] %O(%O)\n", ctime(),
|
||||
query_ip_number(), query_ip_name());
|
||||
w("_error_mandatory_encryption", "Your connection does not satisfy our privacy requirements. Please fix your configuration.");
|
||||
next_input_to(#'ignorance);
|
||||
write("\n"); // why is this needed?
|
||||
return 1;
|
||||
}
|
||||
# endif
|
||||
#else
|
||||
::logon(failure);
|
||||
#endif
|
||||
next_input_to(#'parse);
|
||||
#ifdef _flag_log_sockets_IRC
|
||||
log_file("RAW_IRC", "\nnew connection %O from %O\n",
|
||||
ME,
|
||||
|
|
|
@ -897,7 +897,7 @@ logon() {
|
|||
// version strings, only IRC makes it terribly complicated and
|
||||
// even political. oh of course, that's because on irc the server
|
||||
// admin isn't necessarily a person of your trusting.
|
||||
w("_request_version", 0, 0, SERVER_UNIFORM);
|
||||
w("_request_version"); //, 0, 0, SERVER_UNIFORM);
|
||||
# endif
|
||||
#endif
|
||||
return rc;
|
||||
|
@ -1189,8 +1189,15 @@ static privmsg(args, text, req) {
|
|||
string person,room;
|
||||
mixed t;
|
||||
|
||||
unless (stringp(text) && strlen(text)) return;
|
||||
|
||||
unless (stringp(text) && strlen(text)) {
|
||||
// somewhere in the IRC RFC it is permissible to
|
||||
// send messages without a colon if they only
|
||||
// contain one word. fifteen years after this code
|
||||
// was originally written we encounter the first
|
||||
// case of a client that actually makes use of
|
||||
// that. it's called "Circe".
|
||||
unless (sscanf(args, "%s %s", args, text)) return;
|
||||
}
|
||||
#ifdef GAMMA
|
||||
// fippoism typing indicator.. but shouldn't it *do* something
|
||||
// after detecting this CTCP-like "typing" flag hack?
|
||||
|
|
|
@ -51,7 +51,7 @@ int emit(string message) {
|
|||
string t, err;
|
||||
// according to http://www.w3.org/TR/xml/#charsets
|
||||
// remove illegal unicode chars --// thx elmex
|
||||
err = catch(t = regreplace(message, "[^\\x{9}\\x{A}\\x{D}\\x{20}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{10000}-\\x{10FFFFFF}]+", "*", RE_GLOBAL | RE_UTF8); nolog);
|
||||
err = catch(t = regreplace(message, "[^\\x{9}\\x{A}\\x{D}\\x{20}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{10000}-\\x{FFFFF}]+", "*", RE_GLOBAL | RE_UTF8); nolog);
|
||||
if (err || t != message) {
|
||||
// Info: Chars filtered to %O. Message was %O.
|
||||
log_file("CHARS_XMPP", "[%s] %O %O %O\n", ctime(),
|
||||
|
|
|
@ -18,11 +18,9 @@
|
|||
disco_info_root(vars) {
|
||||
string featurelist;
|
||||
featurelist = "<feature var='http://jabber.org/protocol/muc'/>"
|
||||
#ifndef _flag_disable_unauthenticated_users
|
||||
# ifndef _flag_disable_registration
|
||||
# ifndef _flag_disable_registration_XMPP
|
||||
#ifndef _flag_disable_unauthenticated_users_XMPP
|
||||
# ifndef _flag_disable_registration_XMPP
|
||||
"<feature var='jabber:iq:register'/>"
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#ifndef VOLATILE
|
||||
|
|
|
@ -145,7 +145,8 @@ verify_connection(string to, string from, string type) {
|
|||
sAuthenticated(from);
|
||||
#ifdef XMPP_BIDI
|
||||
if (bidi) {
|
||||
P0(("doing register target for xmpp bidi!!!!\n"))
|
||||
P0(("doing register target for xmpp bidi (2)!!!!\n"))
|
||||
P0(("register_target(XMPP + %O)\n", from))
|
||||
register_target(XMPP + from);
|
||||
}
|
||||
#endif
|
||||
|
@ -423,7 +424,8 @@ jabberMsg(XMLNode node) {
|
|||
while (remove_call_out(#'quit) != -1);
|
||||
#ifdef XMPP_BIDI
|
||||
if (bidi) {
|
||||
P0(("doing register target for xmpp bidi!!!!\n"))
|
||||
P0(("doing register target for xmpp bidi (1)!!!!\n"))
|
||||
P0(("register_target(XMPP + %O)\n", t))
|
||||
register_target(XMPP + t);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -187,11 +187,11 @@ jabberMsg(XMLNode node) {
|
|||
case "jabber:iq:register":
|
||||
if (node["@type"] == "get"){
|
||||
string packet;
|
||||
#if defined(_flag_disable_unauthenticated_users) || defined(_flag_disable_registration) || defined(_flag_disable_registration_XMPP)
|
||||
#if defined(_flag_disable_unauthenticated_users_XMPP) || defined(_flag_disable_registration_XMPP)
|
||||
// super dirty.. this should all be in textdb
|
||||
packet = sprintf("<iq type='result' id='%s'>"
|
||||
"<query xmlns='jabber:iq:register'/>"
|
||||
"<error code='501>Registration by XMPP not permitted.</error></iq>",
|
||||
"<error code='501'>Registration by XMPP not permitted.</error></iq>",
|
||||
id);
|
||||
#else
|
||||
packet = sprintf("<iq type='result' id='%s'>"
|
||||
|
@ -234,8 +234,11 @@ jabberMsg(XMLNode node) {
|
|||
emit(packet);
|
||||
// QUIT
|
||||
} else {
|
||||
#if defined(_flag_disable_unauthenticated_users) || defined(_flag_disable_registration) || defined(_flag_disable_registration_XMPP)
|
||||
// TODO: generate some error as above
|
||||
#if defined(_flag_disable_unauthenticated_users_XMPP) || defined(_flag_disable_registration_XMPP)
|
||||
emit(sprintf("<iq type='result' id='%s'>"
|
||||
"<query xmlns='jabber:iq:register'/>"
|
||||
"<error code='501'>Registration by XMPP not permitted.</error></iq>",
|
||||
id));
|
||||
#else
|
||||
user -> vSet("password", t[Cdata]);
|
||||
if (t = helper["/email"]) {
|
||||
|
@ -358,7 +361,7 @@ jabberMsg(XMLNode node) {
|
|||
# endif
|
||||
break;
|
||||
#endif
|
||||
#ifndef _flag_disable_unauthenticated_users
|
||||
#ifndef _flag_disable_unauthenticated_users_XMPP
|
||||
case "ANONYMOUS":
|
||||
unless(node[Cdata]) {
|
||||
SASL_ERROR("incorrect-encoding")
|
||||
|
@ -481,7 +484,7 @@ open_stream(XMLNode node) {
|
|||
"<mechanism>DIGEST-MD5</mechanism>"
|
||||
#endif
|
||||
"<mechanism>PLAIN</mechanism>";
|
||||
#ifndef _flag_disable_unauthenticated_users
|
||||
#ifndef _flag_disable_unauthenticated_users_XMPP
|
||||
// sasl anonymous
|
||||
"<mechanism>ANONYMOUS</mechanism>";
|
||||
#endif
|
||||
|
@ -497,7 +500,7 @@ open_stream(XMLNode node) {
|
|||
#endif
|
||||
features += "</mechanisms>";
|
||||
features += "<auth xmlns='http://jabber.org/features/iq-auth'/>";
|
||||
#ifndef _flag_disable_unauthenticated_users
|
||||
#ifndef _flag_disable_registration_XMPP
|
||||
features += "<register xmlns='http://jabber.org/features/iq-register'/>";
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -627,7 +627,7 @@ iq(XMLNode node) {
|
|||
break;
|
||||
}
|
||||
break;
|
||||
#if !defined(_flag_disable_unauthenticated_users) && !defined(_flag_disable_registration) && !defined(_flag_disable_registration_XMPP)
|
||||
#if !defined(_flag_disable_unauthenticated_users_XMPP) && !defined(_flag_disable_registration_XMPP)
|
||||
case "jabber:iq:register":
|
||||
switch(node["@type"]) {
|
||||
case "get":
|
||||
|
@ -672,12 +672,13 @@ iq(XMLNode node) {
|
|||
case "jabber:iq:roster":
|
||||
switch(node["@type"]) {
|
||||
case "get":
|
||||
// TODO: this assumes that to is unset and the query is
|
||||
// to itself
|
||||
// TODO: this assumes that 'to' is unset and the query is
|
||||
// to itself. we sometimes get here without a valid tag -
|
||||
// what should we do then?
|
||||
hasroster = 1;
|
||||
packet = sprintf("<iq type='result' to='%s' id='%s'>"
|
||||
"<query xmlns='jabber:iq:roster'>",
|
||||
myjid, tag);
|
||||
myjid, stringp(tag)? tag: "");
|
||||
// TODO: listAcq does the same basically
|
||||
foreach (friend : ppl) {
|
||||
mixed *u;
|
||||
|
|
|
@ -33,7 +33,7 @@ inherit NET_PATH "queue";
|
|||
// this mapping has to be *volatile* or it will carry old hostnames
|
||||
// that may no longer be valid, then cause wild illogical behaviour
|
||||
volatile mapping localhosts = ([
|
||||
"localhost": "127.0.0.1",
|
||||
"localhost": "127.0.0.1", // what if remote hosts dns-resolve to "localhost" ?
|
||||
"127.0.0.1": "localhost",
|
||||
// unusual but valid syntax for localhost
|
||||
// then again usually any 127.* leads to localhost so it's
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
<tr><td>_address_street</td><td>street</td><td>street</td><td>STREET</td><td>ADR/STREET</td><td>street</td><td></td></tr>
|
||||
<tr><td>_address_zone_time</td><td>timezone</td><td></td><td>TZ</td><td>TZ</td><td></td><td></td></tr>
|
||||
<tr><td>_affiliation</td><td>affiliation</td><td>org_name</td><td>ORGNAME</td><td>ORG/ORGNAME</td><td>o</td><td></td></tr>
|
||||
<tr><td>_amount_history_login</td><td>loginhistory</td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>_character_action</td><td>actioncharacter</td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>_character_command</td><td>commandcharacter</td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>_color</td><td>color</td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
|
|
|
@ -166,6 +166,7 @@ volatile mapping psyc2set = ([
|
|||
"_address_street" : "street",
|
||||
"_address_zone_time" : "timezone",
|
||||
"_affiliation" : "affiliation",
|
||||
"_amount_history_login" : "loginhistory",
|
||||
"_character_action" : "actioncharacter",
|
||||
"_character_command" : "commandcharacter",
|
||||
"_color" : "color",
|
||||
|
@ -288,6 +289,7 @@ volatile mapping set2psyc = ([
|
|||
"street" : "_address_street",
|
||||
"timezone" : "_address_zone_time",
|
||||
"affiliation" : "_affiliation",
|
||||
"loginhistory" : "_amount_history_login",
|
||||
"actioncharacter" : "_character_action",
|
||||
"commandcharacter" : "_character_command",
|
||||
"color" : "_color",
|
||||
|
|
|
@ -21,7 +21,7 @@ while (<main::DATA>) {
|
|||
$_ = $psyc = $1;
|
||||
$psyc{$psyc} = 1;
|
||||
next if /^_INTERNAL/;
|
||||
s/_(address|contact|voice|scheme|source|flag|person|select)//g;
|
||||
s/_(address|amount|contact|voice|scheme|source|flag|person|select)//g;
|
||||
s/_date/_day/g;
|
||||
s/_description/_text/g;
|
||||
s/_favorite/_fave/g;
|
||||
|
@ -633,6 +633,9 @@ jProf places_lived
|
|||
PSYC _place_home
|
||||
set home
|
||||
|
||||
PSYC _amount_history_login
|
||||
#set loginhistory
|
||||
|
||||
PSYC _flag_filter_strangers
|
||||
set filter
|
||||
|
||||
|
|
|
@ -186,14 +186,12 @@ string tls_bad_cipher(object sock, string scheme) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Do not use server technologies like psyced for strong
|
||||
// privacy or anonymity requirements. Get started using
|
||||
// distributed technologies instead. Check out:
|
||||
// http://youbroketheinternet.org
|
||||
// http://secushare.org
|
||||
// But if you're happy with half-baked security, here you
|
||||
// have it:
|
||||
// -lynX 2015
|
||||
// This function handles safety via TLS, Tor and GNUnet. The
|
||||
// latter of the three is the distributed system you should
|
||||
// be using. --lynX 2016
|
||||
//
|
||||
// FIXME: move this function to a different library file...
|
||||
// "tls" is no longer appropriate
|
||||
//
|
||||
int probably_private(object source) {
|
||||
// object has no TCP to it. you have to ask its circuit.
|
||||
|
@ -205,6 +203,7 @@ int probably_private(object source) {
|
|||
// LPC variable, so it is fine we call it often
|
||||
|| query_ip_number(source) == __HOST_IP_NUMBER__
|
||||
# ifdef SECURE_IP_NUMBER
|
||||
// problem: apparently this macro isn't defined when library is compiled
|
||||
|| SECURE_IP_NUMBER(query_ip_number(source))
|
||||
# endif
|
||||
// People coming from localhost have either made it
|
||||
|
@ -214,6 +213,15 @@ int probably_private(object source) {
|
|||
// only the server itself could be considered secure.
|
||||
//
|
||||
) return PRIVACY_REASONABLE;
|
||||
//
|
||||
// Coming from GNUnet means that we are ourselves a
|
||||
// GNUnet node. This increases the chances that we
|
||||
// are a private individual's machine in a private
|
||||
// home rather than a server in a computing centre.
|
||||
// Let's guess that is good news.
|
||||
//
|
||||
if (IS_GNUNET(query_ip_number(source))) return PRIVACY_GOOD;
|
||||
//
|
||||
# if __EFUN_DEFINED__(tls_query_connection_state)
|
||||
// Alas, this person is using a TLS/SSL-enhanced
|
||||
// access protocol which, unless the client implements
|
||||
|
|
|
@ -473,6 +473,29 @@ _request_set_topic(source, mc, data, vars, b) {
|
|||
#endif
|
||||
|
||||
#if HAS_PORT(HTTP_PORT, HTTP_PATH) || HAS_PORT(HTTPS_PORT, HTTP_PATH)
|
||||
// for GDPR compliance server owners are expected not to log these messages
|
||||
htnotify(query, headers, mc, fmt, acct, qs) {
|
||||
if (query["from"] == "") query["from"] = 0;
|
||||
if (query["location"] == "") query["location"] = 0;
|
||||
|
||||
// should be renamed into _notice_examine_web_place
|
||||
castmsg(ME, "_notice_place"+(mc || "_examine_web"),
|
||||
fmt || "[_nick_place] viewed on [_web_on] coming from [_web_from].",
|
||||
([ "_web_referrer" : query["from"] || "bookmark",
|
||||
"_web_page" : query["location"] || headers["referer"] || "",
|
||||
"_web_browser" : headers["user-agent"] || "",
|
||||
"_web_on" : acct || query["location"] || headers["referer"] ||
|
||||
headers["user-agent"] || "",
|
||||
"_web_from" : query["from"] ||
|
||||
query_ip_name(this_interactive()) ||
|
||||
headers["user-agent"] || "http",
|
||||
"_host_name" : query_ip_name(this_interactive()) || "",
|
||||
// so far used by 'rating' only
|
||||
"_parameters" : query["parameters"] || qs,
|
||||
"_nick_place" : MYNICK || "This place",
|
||||
]) );
|
||||
}
|
||||
|
||||
htget(prot, query, headers, qs, data, noprocess) {
|
||||
//P3((">> archetype.gen:htget(%O, %O, %O, %O, %O, %O)\n", prot, query, headers, qs, data, noprocess))
|
||||
# ifdef PLACE_SCRATCHPAD
|
||||
|
@ -629,22 +652,7 @@ htget(prot, query, headers, qs, data, noprocess) {
|
|||
}
|
||||
}
|
||||
# ifndef _flag_disable_notice_place_examine_web
|
||||
if (query["from"] == "") query["from"] = 0;
|
||||
if (query["location"] == "") query["location"] = 0;
|
||||
|
||||
// should be renamed into _notice_examine_web_place
|
||||
castmsg(ME, "_notice_place_examine_web", "[_nick_place] inspected on [_web_on] coming from [_web_from].",
|
||||
([ "_web_referrer" : query["from"] || "bookmark",
|
||||
"_web_page" : query["location"] || headers["referer"] || "",
|
||||
"_web_browser" : headers["user-agent"] || "",
|
||||
"_web_on" : query["location"] || headers["referer"] ||
|
||||
headers["user-agent"] || "",
|
||||
"_web_from" : query["from"] ||
|
||||
// query_ip_name(this_interactive()) ||
|
||||
headers["user-agent"] || "http",
|
||||
"_host_name" : query_ip_name(this_interactive()) || "",
|
||||
"_nick_place" : MYNICK || "This place",
|
||||
]) );
|
||||
htnotify(query, headers, "_examine_web");
|
||||
# endif
|
||||
|
||||
// this is usually not very interesting really.. like:
|
||||
|
@ -670,6 +678,7 @@ htget(prot, query, headers, qs, data, noprocess) {
|
|||
write("\n\nYou are looking at the "+MYNICK+" default page.\n");
|
||||
# endif
|
||||
# endif
|
||||
//printf("%O: %O (%O) in %O\n", this_interactive(), query, qs, headers);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -336,4 +336,5 @@ static varargs string render_psyc(mixed source, string mc, mixed data,
|
|||
// notice for completeness: the PSYC renderer does not convert_charset
|
||||
// from SYSTEM_CHARSET to UTF-8, so to produce correct PSYC you must not
|
||||
// switch to a different SYSTEM_CHARSET, or you have to fix that...
|
||||
// probably the right thing to do is to remove configurable SYSTEM_CHARSET
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ msg(source, mc, data, vars, showingLog, target) {
|
|||
rv["_context_relay"] = vars["_context"];
|
||||
P1(("Invalid route in context: msg(%O, %O, %O, %O, %O) -> %O\n",
|
||||
source, mc, data, vars, target, rv))
|
||||
sendmsg(source, "_failure_invalid_route", 0, rv);
|
||||
D2( sendmsg(source, "_failure_invalid_route", 0, rv); )
|
||||
return 1;
|
||||
} else {
|
||||
P1(("%O unexpected msg(%O, %O, %O, %O, %O)\n",
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
// outgoing mail queue for psyced.
|
||||
|
||||
// this has not only been leaking message contents..
|
||||
// it is currently spamming previous room visitors (see /route) FIXME!!
|
||||
// so we disable it completely for now
|
||||
#define OFFLINE
|
||||
|
||||
// i *could* rewrite this to use net/spool.c
|
||||
// but then i'd have such a mess in my room
|
||||
|
||||
|
|
|
@ -18,6 +18,20 @@
|
|||
//#define NO_INHERIT // virtual ain't workin' .. but leavin it out neither
|
||||
#include <text.h>
|
||||
|
||||
// similar logic in probably_private()
|
||||
static string safetypin(object o, string ip) {
|
||||
return !interactive(o) ? "-" :
|
||||
#ifdef SECURE_IP_NUMBER
|
||||
SECURE_IP_NUMBER(ip) ? "*" :
|
||||
#endif
|
||||
is_localhost(ip) ? "=" :
|
||||
IS_GNUNET(ip) ? "#" :
|
||||
#if __EFUN_DEFINED__(tls_query_connection_state)
|
||||
tls_query_connection_state(o) ? "+" :
|
||||
#endif
|
||||
" ";
|
||||
}
|
||||
|
||||
static int smaller_object_name(object a, object b) {
|
||||
return object_name(a) < object_name(b);
|
||||
}
|
||||
|
@ -64,17 +78,10 @@ list_sockets(guy, flags) {
|
|||
if (boss(o)) name += "*";
|
||||
if (uv["visibility"] == "off") name = "°"+name;
|
||||
list += sprintf(T("_list_user_technical_person",
|
||||
"\n%4.4s%s %s %s %s (%s) <%s> %s"),
|
||||
// scheme ? (layout && scheme=="ht" ?
|
||||
// layout : scheme) : "-",
|
||||
"\n%s%4.4s %s %s %s (%s) <%s> %s"),
|
||||
safetypin(o, ip),
|
||||
(scheme == "ht" ? (layout || scheme)
|
||||
: scheme) || "",
|
||||
#if __EFUN_DEFINED__(tls_query_connection_state)
|
||||
interactive(o) &&
|
||||
tls_query_connection_state(o) ? "!" : " ",
|
||||
#else
|
||||
" ",
|
||||
#endif
|
||||
idle ? ((stringp(idle) ?
|
||||
idle : to_string(idle))) : "",
|
||||
name || "???",
|
||||
|
@ -92,20 +99,12 @@ list_sockets(guy, flags) {
|
|||
if (name? flags & SOCKET_LIST_GHOST : flags & SOCKET_LIST_LINK)
|
||||
list += sprintf(T("_list_user_technical_ghost",
|
||||
"\n%s %s %O %s (%s) %s %s"),
|
||||
#if __EFUN_DEFINED__(tls_query_connection_state)
|
||||
interactive(o) &&
|
||||
tls_query_connection_state(o) ? "!" : " ",
|
||||
#else
|
||||
" ",
|
||||
#endif
|
||||
safetypin(o, query_ip_number(o)),
|
||||
(name && to_string(name)) || "",
|
||||
o,
|
||||
#if 1 //def _flag_log_hosts // realtime inspection isn't logging
|
||||
query_ip_name(o) || "",
|
||||
query_ip_number(o) || "",
|
||||
#else
|
||||
"", "",
|
||||
#endif
|
||||
#if __EFUN_DEFINED__(tls_query_connection_info)
|
||||
tls ? intp(tls[TLS_PROT]) ?
|
||||
TLS_PROT_NAME(tls[TLS_PROT]) ||
|
||||
|
|
|
@ -1,7 +1,2 @@
|
|||
// $Id: active.c,v 1.1 2008/01/30 17:06:48 lynx Exp $ // vim:syntax=lpc
|
||||
#include "psyc.h"
|
||||
#ifdef LIBPSYC
|
||||
|
||||
#include "../psyc/active.c"
|
||||
|
||||
#endif // LIBPSYC
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// $Id: circuit.c,v 1.38 2008/10/14 19:02:29 lynx Exp $
|
||||
|
||||
#include "psyc.h"
|
||||
#ifdef LIBPSYC
|
||||
|
||||
#include <net.h>
|
||||
#include <uniform.h>
|
||||
|
@ -102,7 +101,7 @@ void sender_verification(string sourcehost, mixed targethost)
|
|||
|
||||
// gets called during socket logon
|
||||
int logon(int failure) {
|
||||
string t;
|
||||
mixed pappnose;
|
||||
sAuthHosts(([ ])); // reset authhosts
|
||||
legal_senders = ([ ]);
|
||||
instate = ([ "_INTERNAL_origin" : ME ]);
|
||||
|
@ -141,8 +140,8 @@ int logon(int failure) {
|
|||
unless(isServer()) {
|
||||
emit("|\n"); // initial greeting
|
||||
if (sizeof(verify_queue)) {
|
||||
foreach(mixed t : verify_queue) {
|
||||
sender_verification(t[0], t[1]);
|
||||
foreach(pappnose : verify_queue) {
|
||||
sender_verification(pappnose[0], pappnose[1]);
|
||||
}
|
||||
verify_queue = ({ });
|
||||
}
|
||||
|
@ -276,4 +275,3 @@ varargs int msg(string source, string mc, string data,
|
|||
return emit(buf);
|
||||
}
|
||||
|
||||
#endif // LIBPSYC
|
||||
|
|
|
@ -38,11 +38,7 @@ mixed process_routing_modifiers(mapping rvars, mapping vars) {
|
|||
mixed process_entity_modifiers(mapping evars, mapping vars, mapping cstate) {
|
||||
// apply evars to context state
|
||||
foreach (mixed vname : m_indices(evars)) {
|
||||
if (routing[vname] || abbrev("_INTERNAL", vname)
|
||||
#ifndef LIBPSYC
|
||||
|| !legal_keyword(vname)
|
||||
#endif
|
||||
) {
|
||||
if (routing[vname] || abbrev("_INTERNAL", vname)) {
|
||||
DISPATCHERROR("illegal varname in entity header")
|
||||
}
|
||||
|
||||
|
@ -107,32 +103,6 @@ mixed process_var_types(mapping evars) {
|
|||
if (!legal_name(evars[vname]))
|
||||
croak("_error_illegal_nick");
|
||||
break;
|
||||
#ifndef LIBPSYC
|
||||
case "_degree":
|
||||
// only honour the first digit
|
||||
if (strlen(evars[vname]) && evars[vname][0] >= '0' && evars[vname][0] <= '9')
|
||||
evars[vname] = evars[vname][0] - '0';
|
||||
else {
|
||||
PT(("type parser _degree: could not handle value %O\n",
|
||||
evars[vname]))
|
||||
evars[vname] = 0;
|
||||
}
|
||||
break;
|
||||
case "_date":
|
||||
evars[vname] = to_int(evars[vname]) + PSYC_EPOCH;
|
||||
break;
|
||||
case "_time":
|
||||
case "_amount":
|
||||
evars[vname] = to_int(evars[vname]);
|
||||
break;
|
||||
case "_list":
|
||||
mixed plist = list_parse(evars[vname]);
|
||||
if (plist == -1) {
|
||||
DISPATCHERROR("could not parse list");
|
||||
}
|
||||
evars[vname] = plist;
|
||||
break;
|
||||
#endif
|
||||
PSYC_SLICE_AND_REPEAT
|
||||
}
|
||||
}
|
||||
|
@ -173,11 +143,6 @@ void dispatch(mapping rvars, mapping evars, mixed method, mixed body) {
|
|||
if (!process_routing_modifiers(rvars, vars))
|
||||
return;
|
||||
|
||||
#ifndef LIBPSYC
|
||||
if (!process_var_types(evars))
|
||||
return;
|
||||
#endif
|
||||
|
||||
// check that _target is hosted by us
|
||||
// this check can be skipped if _target is not set
|
||||
if ((t = vars["_target"])) {
|
||||
|
@ -269,12 +234,16 @@ void dispatch(mapping rvars, mapping evars, mixed method, mixed body) {
|
|||
string source;
|
||||
mixed target;
|
||||
if (!vars["_source"]) {
|
||||
#if 0
|
||||
// FIXME: where to set netloc in active
|
||||
if (!netloc) { // set in sender after _request_features
|
||||
// FIXME: this is wrong
|
||||
DISPATCHERROR("Did you forget to request circuit features?");
|
||||
}
|
||||
source = netloc;
|
||||
#else
|
||||
source = netloc || query_ip_name(ME);
|
||||
#endif
|
||||
} else {
|
||||
// FIXME: a macro NORMALIZE_UNIFORM that may do lower_case please
|
||||
// not a simple lower_case
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
||||
// $Id: parse.c,v 1.30 2008/12/18 18:16:14 lynx Exp $
|
||||
|
||||
#include "psyc.h"
|
||||
#ifdef LIBPSYC // net/spyc currently doesn't work without libpsyc
|
||||
// and probably never will.. will delete the old code soon
|
||||
|
||||
#include <net.h>
|
||||
#include <input_to.h>
|
||||
|
||||
|
@ -12,19 +8,6 @@ private string buffer;
|
|||
int state;
|
||||
int may_parse_more;
|
||||
|
||||
#ifndef LIBPSYC
|
||||
private string body_buffer;
|
||||
int body_len;
|
||||
|
||||
// temporary used to hold assigment lists vname -> ({ glyph, state, vvalue })
|
||||
// this won't work anymore, dispatch now expects two mappings: rvars & evars
|
||||
array(mixed) tvars;
|
||||
mapping hvars;
|
||||
// prototypes
|
||||
parse_header();
|
||||
buffer_content();
|
||||
#endif // LIBPSYC
|
||||
|
||||
// being faded out in favor of regular croak()
|
||||
#define PARSEERROR(reason) { \
|
||||
croak("_error_syntax_broken", \
|
||||
|
@ -46,24 +29,8 @@ step(); // prototype
|
|||
// overload this as needed
|
||||
varargs mixed croak(string mc, string data, vamapping vars) { return 0; }
|
||||
|
||||
#ifndef LIBPSYC
|
||||
// reset parser state
|
||||
void parser_reset() {
|
||||
if (state != PSYCPARSE_STATE_BLOCKED)
|
||||
state = PSYCPARSE_STATE_HEADER;
|
||||
body_len = 0;
|
||||
body_buffer = 0;
|
||||
may_parse_more = 1;
|
||||
tvars = ({ });
|
||||
hvars = ([ ]);
|
||||
}
|
||||
#endif
|
||||
|
||||
// initialize the parser
|
||||
void parser_init() {
|
||||
# ifndef LIBPSYC
|
||||
parser_reset();
|
||||
# endif
|
||||
buffer = "";
|
||||
state = PSYCPARSE_STATE_GREET; // AFTER reset
|
||||
}
|
||||
|
@ -80,9 +47,6 @@ void resume_parse() {
|
|||
|
||||
// called when a complete packet has arrived
|
||||
void dispatch(mapping rvars, mapping evars, mixed method, mixed body) {
|
||||
#ifndef LIBPSYC
|
||||
parser_reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
void psyc_dispatch(mixed p) {
|
||||
|
@ -109,13 +73,6 @@ void feed(string data) {
|
|||
|
||||
buffer += data;
|
||||
|
||||
# ifndef LIBPSYC
|
||||
do {
|
||||
may_parse_more = 0;
|
||||
step();
|
||||
} while (may_parse_more);
|
||||
|
||||
# else
|
||||
if (state != PSYCPARSE_STATE_HEADER)
|
||||
step();
|
||||
|
||||
|
@ -149,7 +106,6 @@ void feed(string data) {
|
|||
}
|
||||
buffer = "";
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
// parser stepping function
|
||||
|
@ -158,14 +114,6 @@ void step() {
|
|||
if (!strlen(buffer))
|
||||
return;
|
||||
switch(state) {
|
||||
#ifndef LIBPSYC
|
||||
case PSYCPARSE_STATE_HEADER:
|
||||
parse_header();
|
||||
break;
|
||||
case PSYCPARSE_STATE_CONTENT:
|
||||
buffer_content();
|
||||
break;
|
||||
#endif
|
||||
case PSYCPARSE_STATE_BLOCKED:
|
||||
// someone requested to stop parsing - e.g. _request_features circuit
|
||||
// message
|
||||
|
@ -177,9 +125,6 @@ void step() {
|
|||
state = PSYCPARSE_STATE_HEADER;
|
||||
buffer = buffer[2 ..];
|
||||
first_response();
|
||||
#ifndef LIBPSYC
|
||||
step();
|
||||
#endif
|
||||
} else {
|
||||
croak("_error_syntax_initialization");
|
||||
// "The new protocol begins with a pipe and a line feed.");
|
||||
|
@ -190,294 +135,3 @@ void step() {
|
|||
}
|
||||
}
|
||||
|
||||
// EOF for LIBPSYC
|
||||
|
||||
#ifndef LIBPSYC
|
||||
// processes routing header variable assignments
|
||||
// basic version does no state
|
||||
mapping process_header(mixed varops) {
|
||||
mapping vars = ([ ]);
|
||||
// apply mmp state
|
||||
foreach(mixed vop : varops) {
|
||||
string vname = vop[0];
|
||||
switch(vop[1]) {
|
||||
case C_GLYPH_MODIFIER_SET:
|
||||
vars[vname] = vop[2];
|
||||
break;
|
||||
case C_GLYPH_MODIFIER_AUGMENT:
|
||||
case C_GLYPH_MODIFIER_DIMINISH:
|
||||
case C_GLYPH_MODIFIER_QUERY:
|
||||
case C_GLYPH_MODIFIER_ASSIGN:
|
||||
croak("_failure_unavailable_state");
|
||||
QUIT
|
||||
default:
|
||||
croak("_failure_unknown_glyph");
|
||||
QUIT
|
||||
}
|
||||
// FIXME: not every legal varname is a routing varname
|
||||
// look at shared_memory("routing")
|
||||
if (!legal_keyword(vname) || abbrev("_INTERNAL", vname)) {
|
||||
croak("_error_illegal_protocol_variable", 0,
|
||||
([ "_variable_name": vname ]));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return vars;
|
||||
}
|
||||
|
||||
// parse the header part of the packet
|
||||
// i.e. that is all mmp modifiers
|
||||
// switch to content buffering mode afterwards
|
||||
void parse_header() {
|
||||
if (!strlen(buffer)) return;
|
||||
if (buffer[0] == C_GLYPH_PACKET_DELIMITER) {
|
||||
if (strlen(buffer) < 2)
|
||||
return;
|
||||
if (buffer[1] == C_LINEFEED) {
|
||||
buffer = buffer[2..];
|
||||
hvars = process_header(tvars);
|
||||
tvars = ({ });
|
||||
dispatch(hvars, tvars, 0, 0);
|
||||
} else {
|
||||
// this one is sth like |whatever
|
||||
// actually this should be noglyph i think
|
||||
PARSEERROR("strange thing")
|
||||
}
|
||||
} else if (buffer[0] == C_LINEFEED) {
|
||||
// state transition from parsing header to buffering body
|
||||
buffer = buffer[1..];
|
||||
hvars = process_header(tvars);
|
||||
tvars = ({ });
|
||||
// FIXME: validate source/context here
|
||||
state = PSYCPARSE_STATE_CONTENT;
|
||||
if (hvars["_length"])
|
||||
body_len = to_int(hvars["_length"][MVAR_VALUE]);
|
||||
step();
|
||||
} else { // parse mmp-header
|
||||
int fit;
|
||||
int glyph;
|
||||
string vname, vvalue;
|
||||
switch(buffer[0]) {
|
||||
case C_GLYPH_MODIFIER_SET:
|
||||
case C_GLYPH_MODIFIER_ASSIGN:
|
||||
case C_GLYPH_MODIFIER_AUGMENT:
|
||||
case C_GLYPH_MODIFIER_DIMINISH:
|
||||
case C_GLYPH_MODIFIER_QUERY:
|
||||
glyph = buffer[0];
|
||||
buffer = buffer[1..];
|
||||
break;
|
||||
default:
|
||||
croak("_error_syntax_expected_routing");
|
||||
QUIT
|
||||
}
|
||||
fit = sscanf(buffer, "%.1s%t", vname);
|
||||
if (fit != 1) {
|
||||
PARSEERROR("vname")
|
||||
}
|
||||
buffer = buffer[strlen(vname)..];
|
||||
switch(buffer[0]) {
|
||||
case '\t':
|
||||
fit = sscanf(buffer, "\t%s\n%.0s", vvalue, buffer);
|
||||
if (fit != 2) {
|
||||
PARSEERROR("simple-arg")
|
||||
}
|
||||
break;
|
||||
case '\n': // deletion
|
||||
// this is currently implemented as "vvalue is 0" internally
|
||||
// and must handled in dispatch() when merging
|
||||
buffer = buffer[1..];
|
||||
break;
|
||||
default:
|
||||
PARSEERROR("arg")
|
||||
}
|
||||
tvars += ({ ({ vname, glyph, vvalue }) });
|
||||
step();
|
||||
}
|
||||
}
|
||||
|
||||
// parse all psyc-modifiers
|
||||
// this differes from the mmp modifiers in the sense that
|
||||
// a) packet is known to be complete here
|
||||
// b) psyc modifiers may have binary args
|
||||
void parse_psyc() {
|
||||
while(1) { // slurp in all psyc-modifiers
|
||||
int fit, len;
|
||||
int glyph;
|
||||
string vname, vvalue;
|
||||
switch(body_buffer[0]) {
|
||||
case C_GLYPH_MODIFIER_SET:
|
||||
case C_GLYPH_MODIFIER_ASSIGN:
|
||||
case C_GLYPH_MODIFIER_AUGMENT:
|
||||
case C_GLYPH_MODIFIER_DIMINISH:
|
||||
case C_GLYPH_MODIFIER_QUERY:
|
||||
glyph = body_buffer[0];
|
||||
body_buffer = body_buffer[1..];
|
||||
break;
|
||||
default:
|
||||
// this is the method
|
||||
return;
|
||||
}
|
||||
fit = sscanf(body_buffer, "%.1s%t", vname);
|
||||
if (fit != 1) {
|
||||
PARSEERROR("vname")
|
||||
}
|
||||
body_buffer = body_buffer[strlen(vname)..];
|
||||
switch(body_buffer[0]) {
|
||||
case ' ':
|
||||
fit = sscanf(body_buffer, " %d\t%.0s", len, body_buffer);
|
||||
if (fit != 2) {
|
||||
PARSEERROR("binary-arg length")
|
||||
}
|
||||
if (len < 0) {
|
||||
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];
|
||||
body_buffer = body_buffer[len..];
|
||||
if (body_buffer[0] != C_LINEFEED) {
|
||||
PARSEERROR("binary terminal")
|
||||
}
|
||||
body_buffer = body_buffer[1..];
|
||||
break;
|
||||
case '\t':
|
||||
fit = sscanf(body_buffer, "\t%s\n%.0s", vvalue, body_buffer);
|
||||
if (fit != 2) {
|
||||
PARSEERROR("simple-arg")
|
||||
}
|
||||
break;
|
||||
case '\n':
|
||||
switch(glyph) {
|
||||
case C_GLYPH_MODIFIER_ASSIGN:
|
||||
// delete this context's state
|
||||
PARSEERROR("tbd")
|
||||
// unfortunately the routing hasn't been processed at
|
||||
// this moment yet, so we don't know whose context this
|
||||
// is and if it is legitimate. we first have to fix the
|
||||
// processing of the routing layer before we can implement
|
||||
// anything of this
|
||||
continue;
|
||||
case C_GLYPH_MODIFIER_SET:
|
||||
// remember to temporarily ignore state
|
||||
PARSEERROR("tbd")
|
||||
continue;
|
||||
case C_GLYPH_MODIFIER_QUERY:
|
||||
// mark that the next reply packet should
|
||||
// contain a state sync
|
||||
PARSEERROR("tbd")
|
||||
continue;
|
||||
default:
|
||||
PARSEERROR("undefined operation")
|
||||
}
|
||||
return;
|
||||
default:
|
||||
PARSEERROR("arg")
|
||||
}
|
||||
tvars += ({ ({ vname, glyph, vvalue }) });
|
||||
}
|
||||
}
|
||||
|
||||
// parse completed content
|
||||
void parse_content() {
|
||||
int fit;
|
||||
string method, body;
|
||||
|
||||
// at this point we should check for relaying, then potentially
|
||||
// route the data without parsing it.. TODO
|
||||
|
||||
parse_psyc();
|
||||
// ASSERT strlen(buffer)
|
||||
if (body_buffer[0] == C_LINEFEED) {
|
||||
PARSEERROR("empty method")
|
||||
}
|
||||
|
||||
// FIXME: i am not sure if this is correct...
|
||||
if (body_buffer == S_GLYPH_PACKET_DELIMITER) {
|
||||
P0(("encountered packet delimiter in packet body? how's that?\n"))
|
||||
dispatch(hvars, tvars, 0, 0);
|
||||
return;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
// mhmm... why does body_buffer still contain the newline?
|
||||
// because the newline is by definition not part of the body!
|
||||
if (strlen(body_buffer)) body = body_buffer[..<2];
|
||||
dispatch(hvars, tvars, method, body);
|
||||
}
|
||||
|
||||
// buffer content until complete
|
||||
// then parse it
|
||||
// note: you could overload this, if you just want to route
|
||||
// the packet
|
||||
void buffer_content() {
|
||||
int t;
|
||||
if (body_len) {
|
||||
if (strlen(buffer) >= body_len + 3) {
|
||||
// make sure that the packet is properly terminated
|
||||
if (buffer[body_len..body_len+2] != "\n" DELIM) {
|
||||
PARSEERROR("packet delimiter after binary body not found")
|
||||
}
|
||||
body_buffer = buffer[..body_len];
|
||||
buffer = buffer[body_len+3..];
|
||||
parse_content();
|
||||
} else {
|
||||
P4(("buffer_content: waiting for more binary data\n"))
|
||||
}
|
||||
} else if ((t = strstr(buffer, "\n" DELIM)) != -1) {
|
||||
body_buffer = buffer[..t];
|
||||
buffer = buffer[t+3..];
|
||||
parse_content();
|
||||
P4(("buffer_content: packet complete\n"))
|
||||
} else {
|
||||
P4(("buffer_content: waiting for more plain data. buffer %O vs %O\n", to_array(buffer), to_array("\n" DELIM)))
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME should be in a standalone module
|
||||
//#define PARSEERROR(args) debug_message(sprintf("LIST PARSE ERROR: " args));
|
||||
#define LISTSEP '|'
|
||||
#define LISTPARSE_FAIL -1
|
||||
#define LISTMODE_PLAIN 0
|
||||
#define LISTMODE_BINARY 1
|
||||
// list parsing function - val is assumed to be stripped of the final LF
|
||||
mixed list_parse(string val) {
|
||||
mixed *lv = ({ });
|
||||
if (val[0] == LISTSEP)
|
||||
return explode(val[1..], "|");
|
||||
while(strlen(val)) {
|
||||
int fit, len;
|
||||
fit = sscanf(val, "%d %s", len, val);
|
||||
if (fit != 2) {
|
||||
// invalid binary fit
|
||||
return LISTPARSE_FAIL;
|
||||
}
|
||||
if (len < 0 || len > strlen(val)) {
|
||||
// invalid binary length
|
||||
return LISTPARSE_FAIL;
|
||||
}
|
||||
if (len != strlen(val) && val[len] != LISTSEP) {
|
||||
// listsep not found after binary
|
||||
return LISTPARSE_FAIL;
|
||||
}
|
||||
lv += ({ val[..len-1] });
|
||||
val = val[len+1..];
|
||||
}
|
||||
return lv;
|
||||
}
|
||||
|
||||
# ifdef SELFTESTS
|
||||
test() {
|
||||
list_parse("|psyc://example.net/~jim|psyc://example.org/~judy");
|
||||
list_parse("5\tabcde|4\tabcd");
|
||||
}
|
||||
# endif
|
||||
#endif // !LIBPSYC
|
||||
|
||||
#endif // LIBPSYC
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#define PSYCPARSE_STATE_GREET 3
|
||||
|
||||
#define DISPATCHERROR(reason) { \
|
||||
debug_message("SPYC DISPATCH ERROR: " reason); \
|
||||
debug_message("SPYC DISPATCH ERROR: " reason "\n"); \
|
||||
croak("_error_dispatch", "dispatch error: " \
|
||||
reason); \
|
||||
return; \
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
// the thing that answers on port 4404 of psyced.
|
||||
|
||||
#include "psyc.h"
|
||||
#ifdef LIBPSYC
|
||||
|
||||
#include <net.h>
|
||||
#include <services.h>
|
||||
|
@ -201,4 +200,3 @@ int logon(int nothing) {
|
|||
return 1; // success
|
||||
}
|
||||
|
||||
#endif // LIBPSYC
|
||||
|
|
135
world/net/tn/outgoing.c
Normal file
135
world/net/tn/outgoing.c
Normal file
|
@ -0,0 +1,135 @@
|
|||
// vim:syntax=lpc
|
||||
|
||||
// DEBUG: FIXME
|
||||
#define _flag_log_sockets_telnet_outgoing
|
||||
|
||||
#include <net.h>
|
||||
#include <services.h>
|
||||
//#include <text.h>
|
||||
|
||||
// this outgoing "telnet" socket thing implements both '/set mudlink'
|
||||
// for users as MUD chatrooms such as @nemesis. would be cool if it
|
||||
// actually was capable of handling telnet protocol, but the mud in
|
||||
// question isn't, either.
|
||||
//
|
||||
// for a tighter integration between psyced and MUD it would also be
|
||||
// cool to either have a native PSYC side channel, or to embed crypto-
|
||||
// graphically signed PSYC packets (using a shared secret hash) into
|
||||
// this stream.
|
||||
|
||||
// message queueing and automatic reconnect mgmt
|
||||
inherit NET_PATH "circuit";
|
||||
|
||||
virtual inherit NET_PATH "output";
|
||||
|
||||
static string connectstring;
|
||||
static object owner;
|
||||
|
||||
send(all) {
|
||||
// if this doesn't work, then maybe you just forgot
|
||||
// to /set charset in your test user
|
||||
iconv(all, SYSTEM_CHARSET, "ASCII//TRANSLIT"); // should be configurable
|
||||
#ifdef _flag_log_sockets_telnet_outgoing
|
||||
log_file("RAW_TN_OUT", "%O > %O\n", ME, all);
|
||||
#endif
|
||||
//if (function_exists("emit")) return emit(all);
|
||||
return emit(all);
|
||||
}
|
||||
|
||||
parse(all) {
|
||||
next_input_to(#'parse);
|
||||
#ifdef _flag_log_sockets_telnet_outgoing
|
||||
log_file("RAW_TN_OUT", "%O < %O\n", ME, all);
|
||||
#endif
|
||||
if (all && all != "") iconv(all, "ASCII//TRANSLIT", SYSTEM_CHARSET);
|
||||
if (owner) sendmsg(owner,
|
||||
"_notice_telnet_verbatim", "[_text_verbatim]",
|
||||
([ "_text_verbatim": all ]));
|
||||
else if (function_exists("castmsg")) castmsg(ME,
|
||||
"_notice_telnet_verbatim", "[_text_verbatim]",
|
||||
([ "_text_verbatim": all ]));
|
||||
}
|
||||
|
||||
link(ho, po) {
|
||||
//sTextPath(0, 0, "tn");
|
||||
return ::circuit(ho, po || TELNET_SERVICE);
|
||||
}
|
||||
|
||||
config(host, port, justdoit) {
|
||||
connectstring = replace(justdoit, " ", "\n") + "\n";
|
||||
owner = previous_object();
|
||||
link(host, port);
|
||||
}
|
||||
|
||||
logon(failure) {
|
||||
int rc = ::logon(failure);
|
||||
unless (rc) return 0;
|
||||
next_input_to(#'parse);
|
||||
parse("<connected>"); // hack to maintain logon ascii graphics intact
|
||||
// could have queued this instead:
|
||||
if (connectstring) call_out(#'send, 1, connectstring);
|
||||
call_out(#'runQ, 3); // deliver the queue of messages in circuit.c
|
||||
return rc;
|
||||
}
|
||||
|
||||
msg(source, mc, data, mapping vars, showingLog, target) {
|
||||
string t, ni, mca;
|
||||
|
||||
if (showingLog) return 1;
|
||||
PT(("TNOUT(%O,%O,%O,%O,%O,%O)\n", source,mc,data,vars,
|
||||
showingLog,target))
|
||||
unless(interactive()) {
|
||||
connect();
|
||||
// special requirement for enqueue
|
||||
unless (vars["_source"])
|
||||
vars["_source"] = UNIFORM(source);
|
||||
return enqueue(source, mc, data, vars, showingLog, target);
|
||||
}
|
||||
if (abbrev("_status_place",mc) || abbrev("_message_announcement",mc)) {
|
||||
if (source && source != ME) {
|
||||
monitor_report("_error_rejected_message_telnet",
|
||||
S("Caught a %O from %O (%O)", mc, source, data));
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
tellChannel(source, mc, vars, data);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
#if 0
|
||||
if (abbrev("_message_echo", mc)) return;
|
||||
if (!data && stringp(vars["_action"]) && abbrev("_message", mc))
|
||||
mca = mc +"_action";
|
||||
else
|
||||
mca = mc;
|
||||
render(mca, data, vars, source);
|
||||
return 1;
|
||||
#else
|
||||
if (abbrev("_message_public", mc)) {
|
||||
// FIXME: should we handle the disconnect instead?
|
||||
if (data == "quit") return 1;
|
||||
return send(data + "\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
disconnected(remaining) {
|
||||
// circuit code would destruct this object
|
||||
return NET_PATH "connect"::disconnected(remaining);
|
||||
}
|
||||
|
||||
render(string mc, string data, mapping vars, mixed source) {
|
||||
string template, output;
|
||||
mixed t;
|
||||
|
||||
P3(("tn/out:render %O %O\n", ME, data));
|
||||
template = T(mc, 0); // enable textdb inheritance
|
||||
output = psyctext( template, vars, data, source);
|
||||
if (!output || output=="") return D2(D("tn/out: empty output\n"));
|
||||
if (template == "") output += "\n";
|
||||
send(output);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -10,7 +10,7 @@ qScheme() { return "tn"; }
|
|||
|
||||
human(x) {
|
||||
x = lower_case(x);
|
||||
unless (abbrev(x, "yes") || abbrev(x, "ja") || abbrev(x, "si") || abbrev(x, "zes")) {
|
||||
if (!strlen(x) || !(abbrev(x, "yes") || abbrev(x, "ja") || abbrev(x, "si") || abbrev(x, "zes"))) {
|
||||
emit("\nSorry, no other species welcome currently.\n\n");
|
||||
}
|
||||
// now check limits
|
||||
|
|
|
@ -758,6 +758,7 @@ case "_message_echo_private":
|
|||
}
|
||||
return 0; // dont walk into _message_public if !pal
|
||||
#else
|
||||
if (!objectp(source)) vars["_nick_target"] = nick; //FIXME BETTER
|
||||
break;
|
||||
#endif
|
||||
case "_message_public_question":
|
||||
|
@ -923,9 +924,8 @@ case "_status_place_members":
|
|||
// "_list_members_nicks" : t ]) );
|
||||
// irc-thang: w(mc + "_end", 0, vars);
|
||||
// return 1;
|
||||
#ifdef TELEPHONY_SECRET
|
||||
#if __EFUN_DEFINED__(hmac) && defined(TELEPHONY_SECRET)
|
||||
# include <sys/tls.h>
|
||||
|
||||
case "_notice_answer_call_click":
|
||||
case "_notice_answer_call":
|
||||
t = vars["_time_expire"];
|
||||
|
@ -942,9 +942,7 @@ case "_notice_answer_call":
|
|||
t3 = NET_PATH "http/call"->make_session(MYNICK, to_int(t), t3);
|
||||
w("_notice_answer_call_link", 0, ([
|
||||
"_page_call": (
|
||||
#ifdef __TLS__
|
||||
(tls_available() && HTTPS_URL) ||
|
||||
#endif
|
||||
HTTP_URL) + NET_PATH +"http/call?thats=me&sid=" +t3,
|
||||
# ifdef TELEPHONY_SERVER
|
||||
"_uniform_call": TELEPHONY_SERVER + t2,
|
||||
|
@ -1601,6 +1599,10 @@ logon() {
|
|||
# endif
|
||||
);
|
||||
}
|
||||
} else {
|
||||
unless (beQuiet) w("_status_circuit_encryption_good",
|
||||
// FIXME: just for fun.. if we want to keep it, it belongs into the textdb
|
||||
"Congratulations. You are using GNUnet's forward secret end-to-end encryption.");
|
||||
}
|
||||
#endif
|
||||
// cannot if (greeting) here this since jabber:iq:auth depends on this
|
||||
|
@ -1723,7 +1725,8 @@ autojoin() {
|
|||
// says it, too.
|
||||
# endif
|
||||
teleport(v("place"), "_login", 0, 0, ([ "_amount_history":
|
||||
_limit_amount_history_place_default ]));
|
||||
v("loginhistory") ? to_int(v("loginhistory"))
|
||||
: _limit_amount_history_place_default ]));
|
||||
# endif
|
||||
// subscriptions are stored in lowercase, warum auch immer
|
||||
if (sizeof(v("subscriptions"))) {
|
||||
|
@ -1775,7 +1778,7 @@ quit(immediate, variant) {
|
|||
int stayinalive = 0;
|
||||
|
||||
// so, SUBSCRIBE_PERMANENT won't work for now.
|
||||
if (sizeof(v("subscriptions")) && widthof(v("subscriptions"))) {
|
||||
if (mappingp(v("subscriptions")) && sizeof(v("subscriptions")) && widthof(v("subscriptions"))) {
|
||||
foreach (o, s : places) {
|
||||
P3(("Stay in %O, %O?\n", o, s))
|
||||
if (v("subscriptions")[lower_case(s)] != SUBSCRIBE_PERMANENT)
|
||||
|
|
|
@ -143,6 +143,27 @@ input(a, dest) {
|
|||
#endif
|
||||
}
|
||||
|
||||
#define MUDLINK //FIXME
|
||||
|
||||
#ifdef MUDLINK
|
||||
object mudlink;
|
||||
|
||||
mudlink(config) {
|
||||
string connectstring, host; int port;
|
||||
// should have mud nicknames instead, so that charsets, prompts
|
||||
// and login procedures can be automated..
|
||||
if (sscanf(config, "%s %d %s", host, port, connectstring)) {
|
||||
// FIXME L8R:
|
||||
//unless (objectp(mudlink)) mudlink = named_clone(NET_PATH "tn/outgoing", MYNICK);
|
||||
unless (objectp(mudlink)) mudlink = clone_object(NET_PATH "tn/outgoing");
|
||||
if (objectp(mudlink)) mudlink -> config(host, port, connectstring);
|
||||
return 1;
|
||||
}
|
||||
// could produce a dedicated syntax warning here.. default is okay
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
parsecmd(command, dest) {
|
||||
array(string) args;
|
||||
string a;
|
||||
|
@ -618,7 +639,7 @@ cmd(a, args, dest, command) {
|
|||
"The PSYC authentication token \"[_nonce]\" is now valid. Use it wisely.",
|
||||
([ "_nonce" : v("nonce") ]));
|
||||
break;
|
||||
#ifdef TELEPHONY_SECRET
|
||||
#if __EFUN_DEFINED__(hmac) && defined(TELEPHONY_SECRET)
|
||||
# include <sys/tls.h>
|
||||
# ifndef TELEPHONY_EXPIRY
|
||||
# define TELEPHONY_EXPIRY (60*60)
|
||||
|
@ -821,7 +842,7 @@ cmd(a, args, dest, command) {
|
|||
case "f":
|
||||
case "follow":
|
||||
if (v("invitationplace")) {
|
||||
teleport(v("invitationplace"), "_follow");
|
||||
teleport(v("invitationplace"), "_follow", 0, STAY);
|
||||
vDel("invitationplace");
|
||||
return;
|
||||
}
|
||||
|
@ -2011,6 +2032,15 @@ tell(pal, what, palo, how, mc, tv) {
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef MUDLINK
|
||||
if (pal == "$mud") {
|
||||
unless (objectp(mudlink) && interactive(mudlink)) mudlink(v("mudlink"));
|
||||
// we could call 'enqueue' if not interactive yet, but that would
|
||||
// probably be even worse for UX. let's just drop that trigger message.
|
||||
if (objectp(mudlink) && interactive(mudlink)) mudlink -> send(what +"\n");
|
||||
return;
|
||||
}
|
||||
#endif // MUDLINK
|
||||
#ifdef ALIASES
|
||||
// this also allows for /alias MEP MunichElectropunk
|
||||
deaPal = aliases[lower_case(pal)] || pal;
|
||||
|
@ -2664,6 +2694,7 @@ checkVar(key, value) {
|
|||
string a, b;
|
||||
array(string) t;
|
||||
|
||||
P3(("%O checkVar(%O, %O)\n", ME, key, value))
|
||||
// aliases for variable names
|
||||
switch(key) {
|
||||
case "befehlszeichen":
|
||||
|
@ -2714,6 +2745,10 @@ checkVar(key, value) {
|
|||
if (value == "off" || value == "-") value = "-";
|
||||
else if (value) value = "on";
|
||||
break;
|
||||
case "loginhistory":
|
||||
// zero is an intentional value in this case
|
||||
if (value == "0") break;
|
||||
// fall through
|
||||
case "postalcode": // integer settings
|
||||
case "latitude":
|
||||
case "longitude":
|
||||
|
@ -2969,6 +3004,12 @@ checkVar(key, value) {
|
|||
// case "popstarfave":
|
||||
// case "musicfave":
|
||||
break; // always valid
|
||||
#ifdef MUDLINK
|
||||
case "mudlink":
|
||||
P0(("mudlink %O\n", value))
|
||||
if (value && !mudlink(value)) value = 0;
|
||||
break;
|
||||
#endif
|
||||
case "encoding":
|
||||
key = "charset"; // fall thru
|
||||
case "charset":
|
||||
|
|
Loading…
Reference in a new issue