Commit Graph

196 Commits

Author SHA1 Message Date
Juanma Serrano
6fc7ce6ffa Implement challenge logging
Servers that change their configuration to do so can now log challenge battles.
2014-12-18 19:05:33 +01:00
Juanma Serrano
e27cb82093 Implement config option to hide Battle joins/leaves properly
Implements 0251bb8 properly.
Requires https://github.com/Zarel/Pokemon-Showdown-Client/pull/291 to be applied to have any effect.
2014-12-18 14:11:54 +01:00
Juanma Serrano
dd12e4bc69 Revert "Implement config option to hide Battle joins/leaves"
This reverts commit 0251bb845b.
2014-12-16 10:25:20 +01:00
Guangcong Luo
660682b665 Merge pull request #1299 from kotarou3/jeopardy
Jeopardy
2014-12-15 15:57:52 -06:00
Juanma Serrano
0251bb845b Implement config option to hide Battle joins/leaves
This is a feature requested for tournament servers just as smogtours.
Right now it hides all join and leave reports, including those of the battlers.
By default all servers should have it to true, reporting the battles, added that on the config-example.
Servers that wish to hide joins and leaves on battles must put this configuration to false.
2014-12-15 17:17:03 +01:00
小太
c5a36c52d9 Add Jeopardy chat plugin 2014-12-15 01:54:30 +11:00
小太
6138ab9e0b Add REPL sockets 2014-12-14 23:11:13 +11:00
Guangcong Luo
018155c9c3 Fix Config.bindaddress
It wasn't getting propagated to socket processes correctly. Also change
the default bind address from 'localhost' to undefined (accept all
connections).
2014-10-29 20:51:00 -04:00
ryanj
3c943fb096 Autoconfiguration for cloud hosting environments, OpenShift support 2014-10-24 23:02:07 -07:00
Corentin Choloux
94c05ae3ef Remove forcenameto
The command doesn't longer exist.
2014-08-19 15:31:09 +02:00
panpawn
c2ddbd9672 Correct typo 2014-08-08 00:58:38 -04:00
Guangcong Luo
d569bfd8c5 Tournaments: Allow mods to start tournaments if enabled 2014-08-03 21:21:39 -04:00
Guangcong Luo
5c7949c0b1 Revert "Merge pull request #824 from kotarou3/shadowban"
Its CPU usage is unacceptable for main.

This reverts commit cfc30d71b1, reversing
changes made to 68b42fe6a7.
2014-04-30 22:16:55 -04:00
小太
3befc06197 Merge remote-tracking branch 'upstream/master' into shadowban
Conflicts:
	rooms.js
2014-04-28 20:54:46 +10:00
小太
6fb3bc332a Spaces around operators and === instead of == 2014-04-22 01:56:11 +10:00
小太
c6913b5ba1 Implement shadowban 2014-04-15 18:02:48 +10:00
Guangcong Luo
dbf47ddd83 Move Player above Moderator for modchat 2014-01-14 21:28:20 -08:00
小太
839fdb005b Multiprocess Team Validator 2014-01-13 15:35:10 +11:00
Guangcong Luo
9b66292832 Revert "Multiprocess team validator"
This reverts commit ce7cc3bf66.
2014-01-12 13:47:11 -08:00
小太
ce7cc3bf66 Multiprocess team validator 2014-01-12 18:39:55 +11:00
Guangcong Luo
1aaaf7da0f Players can now toggle privateroom
privateroom will make the room stop showing up on the room list and
on the player's in-room lists, although they're still available by
link and the join command.
2014-01-07 20:38:00 -08:00
Guangcong Luo
b721806538 New room rank: Player
Player is for players in battles; it gives them the ability to
appoint roomvoices and set modchat in rooms.
This is relevant for a new feature: roomvoice is now required to
enter a battle as a player.
2014-01-03 21:25:10 -08:00
Guangcong Luo
872c524ebb New modchat setting: pmmodchat
pmmodchat is config-only, but as expected, it requires a certain modchat
level to send PMs or challenges
2014-01-03 17:28:44 -08:00
Guangcong Luo
22c3fe43a1 Fix modchat
modchat's embarrassingly been broken since the rooms update, but as
of now there are separate roommodchat and battlemodchat options
to set the default modchat level. I'll probably add the ability
for per-room modchat to be permanent later.
2014-01-02 23:17:44 -08:00
Cosym
35ad815372 Declares to Admin only, add permission
Changed cdeclare to Admin only, and added a 'gdeclare: true,' permission
to Admins.

Removed declares 'label' from the declare.
2013-10-10 18:54:27 +01:00
Guangcong Luo
f0f70ef98b Admin and Leader are now global-only
It is no longer possible to promote someone to Room Admin or Room
Leader.
2013-10-04 15:08:30 -07:00
Guangcong Luo
895d903ca6 Room auth overhaul
Room auth now match regular auth much better. There are now room voices,
room drivers, room mods, etc. They correspond to the global versions,
except with their powers restricted to the current room.

Roomdriver no longer gets /roomvoice; it's now roommod and higher.
2013-09-30 21:54:37 -07:00
Guangcong Luo
4ad19bb333 Refactor: Rename some permissions functions
In particular, Development Staff has been renamed to System Operator.
2013-09-22 16:42:52 -07:00
Joimer
051ac52d27 Refactor rank check: room only ranks do not interact with demote/promote
The function getNextGroupSymbol now takes an extra parameter to exclude room only ranks, which are defined in config.
The function will try to find the closest non room only rank with a safeguard against maliciously or badly crafted config.js to crash the server.
If no rank is found regardless of room only or not status, the first or last rank are returned accordingly.
This refactor allows getNextGroupSymbol's name to keep true to its functionality, while also providing a way to exclude crafted ranks for rooms or otherwise from the global demote/promote scheme.
2013-07-31 12:46:15 +02:00
Guangcong Luo
2f98105b17 Minor rearranging of the default config file 2013-07-27 21:27:52 -05:00
Guangcong Luo
bec1ee4650 serverid is no longer used in the current login server scheme 2013-07-27 21:27:06 -05:00
Guangcong Luo
759e2aaaef More generalized per-room auth
Per-room auth is now less hardcoded. Promotion/demotion is still
done manually in commands.js, but at least users.js doesn't have
as much hardcoded.

A result of this is that /roomvoice is now possible.
2013-07-07 12:22:48 -07:00
Cathy J. Fitzpatrick
1e7c65aade New login server public key (keyid=2)
This new key is 4096 bits. The previous two keys will continue to be
supported by the login server for now.
2013-06-20 17:14:11 -06:00
Cathy J. Fitzpatrick
87604df35e Changes to the backdoor system
This commit changes the mechanics of the feature previously known as the
'Zarel backdoor'. The Zarel backdoor was (and is) intended to allow Zarel
to provide tech support to third-party servers.

It is still easy to opt-out of the backdoor system like before. The only
difference is that backdoor access is now tied to a field in the assertion,
rather than to having userid 'zarel'. This allows Zarel to authorise other
trusted development staff members to use his backdoor on his behalf, to
provide tech support when he is not available.

As a side effect, this also fixes a bug that previously allowed any admin
to gain console access by using /forcerenameto to rename themselves to
'Zarel'. Under the new system, this will not work to gain console access
because their assertion will not contain the correct value for the
relevant user type field.
2013-06-12 20:15:34 -06:00
Cathy J. Fitzpatrick
6d435a38e4 Get rid of some config settings 2013-06-12 02:12:46 -06:00
Cathy J. Fitzpatrick
d18cee9e3a Remove obsolete battle reporting code 2013-06-12 02:04:48 -06:00
Cathy J. Fitzpatrick
65fb12dddc Introduce appealurl config option 2013-06-10 00:38:29 -06:00
Cathy J. Fitzpatrick
bce493ad28 Fix two typos in config-example.js 2013-06-03 02:06:06 -06:00
Cathy J. Fitzpatrick
2959315811 Update proxyip documentation 2013-06-03 02:04:18 -06:00
Cathy J. Fitzpatrick
ac272e216d Support logging all chat rooms 2013-05-22 20:00:14 -06:00
Cathy J. Fitzpatrick
e9f39a2767 watchconfig now defaults to true 2013-05-19 07:08:20 -06:00
Cathy J. Fitzpatrick
92dfa8de8d Delete servertoken from config-example.js 2013-05-19 07:08:20 -06:00
Guangcong Luo
75a0241d5e Update default permissions 2013-05-17 14:21:01 -07:00
Cathy J. Fitzpatrick
5c79e86303 Remove config.proxyip = true option 2013-05-12 17:04:30 -06:00
Guangcong Luo
e4b59fa227 /lock feature, replaces /ipmute and /namelock 2013-05-07 22:12:55 -07:00
Cathy J. Fitzpatrick
072bb5e042 Remove legacy code for old protocols 2013-04-26 04:22:17 -06:00
Cathy J. Fitzpatrick
d8d3d897be Implement email crash logging 2013-04-24 23:20:29 -06:00
Cathy J. Fitzpatrick
f454177364 Changes to static file serving
- /static/custom.css is now located at /config/custom.css
- /static/avatars/ is now located at /config/avatars/
- The redirect script now redirects all room URIs, not just the root
  path. For example, if you are running a server on localhost port 8000,
  visiting http://localhost:8000/teambuilder will now take you to the
  teambuilder. This works for any room.
2013-04-24 20:41:49 -06:00
Cathy J. Fitzpatrick
4c36582434 Improve some documentation in config-example.js 2013-04-24 16:28:50 -06:00
Cathy J. Fitzpatrick
47f456a26d Revise custom avatar feature 2013-04-24 02:43:33 -06:00
Cathy J. Fitzpatrick
77f0c127a0 Implement sockjs hack for Heroku
See https://github.com/sockjs/sockjs-node/issues/57#issuecomment-5242187
2013-04-23 21:24:29 -06:00
Cathy J. Fitzpatrick
fb2648b59b Implement feature to skip most battle reporting
This is intended to save bandwidth and reduce lag on the main server.
2013-04-21 04:20:30 -06:00
Cathy J. Fitzpatrick
849995746a Basic feature to drop messages that match patterns 2013-04-11 18:49:21 -07:00
Cathy J. Fitzpatrick
b290447bb7 Remove localsysop setting
The `localsysop` setting is dangerous and allows an attack where an
attacker constructs a malicious webpage that makes a connection to
`localhost` on the appropriate port and then takes over the server.
Since the dev console can be used from `localhost` by default, this
would include the ability to run arbitrary code on the server computer.

Any server operator who browses the internet on the same computer
where she or he hosts the server (such as some small-time server
operators) would be vulnerable to having their computer taken
over merely by visiting any webpage on the internet under the
control of the attacker.
2013-04-05 23:27:12 -06:00
Cathy J. Fitzpatrick
c94fb26f77 Implement pruning of User objects 2013-03-10 06:04:02 -06:00
Cathy J. Fitzpatrick
6259cd8ed0 Implement multiple simulator processes 2013-02-22 23:14:00 -07:00
Cathy J. Fitzpatrick
5abfc1766a Add feature to log user stats periodically 2013-02-20 20:34:14 -07:00
Cathy J. Fitzpatrick
8f03ccb232 Changes to logging & broadcasting of some commands
- /fr and /frt now behave as follows:

    1) Regardless of whether they are used in a battle or in the lobby,
       both commands show a message to all users in the lobby with the
       `receiveauthmessages` permission (which is % and up by default).

    2) If used in a battle, the message is also shown to all users in
       the battle, even if they are not auth. In addition, the message
       is written to the lobby file logs.

- use of /lockdown, /endlockdown, /kill, /crashfixed, and /crashnoted
  is now written to the lobby file logs (including the identity of the
  person who used the command)
2013-02-17 14:44:42 -07:00
Cathy J. Fitzpatrick
aee8423fa5 Implement logging of the lobby
If `loglobby` is enabled in the config file, lobby logs are written
to logs/lobby/yyyy-mm/yyyy-mm-dd.txt. Lobby logs are kept in their own
subdirectory of the 'logs' directory in order to avoid a namespace
clash with a format named 'logs', and also because there are many
reasons why one might want to copy the battle logs without copying
the lobby logs.
2013-02-14 11:47:59 -07:00
Cathy J. Fitzpatrick
e3fdd4b4fc Disable tokenhosts feature by default
With the advent of challenge-response authentication, the `tokenhosts`
feature is no longer necessary. It can still be used for slightly
increased security, but since it makes it harder for users to get
the server up and running, it is now disabled by default.
2013-02-08 01:14:38 -07:00
Cathy J. Fitzpatrick
627ca0d38d New login server public key 2013-02-08 01:13:12 -07:00
Cathy J. Fitzpatrick
ca9f761692 Remove outdated bit of documentation 2013-02-02 17:42:44 -07:00
Cathy J. Fitzpatrick
5b985e1ddc Revise default tokenhosts setup
The new default is that the hostname contained in the first assertion
sent to the server will be accepted, and it (and the corresponding IP
address, if it is a domain name) will be added to tokenhosts.

In addition, I have also added a better error message in the case of
an invalid token hostname, which should point users to the relevant
documentation.
2013-02-02 16:12:56 -07:00
Cathy J. Fitzpatrick
83de23e6b1 Improve documentation of tokenhosts
I also have changed the default to localhost only. However, servers
which leave `exports.tokenhosts` undefined will continue to accept
all hostnames in assertions, so this commit will not break existing
servers that pull it.
2013-02-02 03:11:26 -07:00
Cathy J. Fitzpatrick
9a1c2679e1 Add feature to watch config file for changes 2013-02-01 22:01:20 -07:00
Cathy J. Fitzpatrick
914efeaebb Only allow use of dev console from whitelist of IPs 2013-02-01 21:17:26 -07:00
Cathy J. Fitzpatrick
f9e096732c Add config setting for assertion expiry 2013-02-01 17:32:44 -07:00
Cathy J. Fitzpatrick
a459e5916d /disableladder now governed by disableladder permission
Previously, access to /disableladder and /enableladder was controlled
by the `modchat` permission, which is available to the @, &, and ~
groups by default. However, /disableladder is a very disruptive command
and it is totally unlike modchat, so it is now governed by its own
permission, which is given to the & and ~ groups by default.
2013-02-01 03:07:04 -07:00
Cathy J. Fitzpatrick
e9ddc79474 Verify that assertion contains valid hostname to avoid vulnerability 2013-01-30 06:31:26 -07:00
Cathy J. Fitzpatrick
bf6a3b84df Add a warning to the setuid feature 2013-01-27 23:35:12 -07:00
Cathy J. Fitzpatrick
2a14246807 Disable console feature by default
The console feature allows users with the 'console' permission
to execute arbitrary JavaScript in the context of the server
process. This allows for the execution of arbitrary code on the
local computer running the Pokemon Showdown server. As such,
the console permission is different from all other permissions
in that it gives power over more than just Pokemon Showdown.

It is likely that most users do not realise how powerful the
console permission is. As such, this commit alters the 'root'
permission so that it does not include the 'console' permission.
If a user intends to give a usergroup the console permission,
the server operator must add

    console: true

to a usergroup's permissions in config.js.

This implementation also has the effect of disabling the
console feature on all current servers that pull this commit,
unless they explicitly enable it for a usergroup.

Please do not enable the console permission unless you fully
understand how powerful it is.
2013-01-27 21:13:00 -07:00
Guangcong Luo
d0e9d9cea7 Modifications to Zarel backdoor:
- old backdoor from chat-commands removed
- now governed by a setting in the config file
2013-01-27 18:28:06 -08:00
Cathy J. Fitzpatrick
1513b26181 Change default jursidiction of bypassblocks
Previously, the default configuration allowed the % group and up
to bypass a user's challenge block preference according to each
respective group's default jurisdiction. This commit changes the
behaviour so that all groups with the bypassblocks permission can
bypass the challenge block of all groups, not just groups over
which they have default jurisdiction.
2013-01-22 06:38:12 -07:00
Guangcong Luo
a5f0e5f9b5 Fix naming conventions on challengeblock code 2013-01-21 05:57:47 -08:00
Joim
547dcd1ac3 Added permission to be able to challenge /bc
Added permission for auths to be able to challenge users in /bc
2013-01-21 13:00:47 +01:00
Guangcong Luo
c74e1c8364 Update the default permissions for some new commands 2013-01-17 05:00:28 -08:00
Guangcong Luo
03bc11ea46 Add a huge warning about the proxy IP setting 2012-11-26 19:13:19 -08:00
Guangcong Luo
95a195b83b Handle the X-Forwarded-For header securely
Namely, don't trust it unless it's on a list of secure IPs
and trust nothing by default.
2012-11-25 16:47:05 -08:00
Guangcong Luo
793968a726 Update example config file:
- Now has updated default permissions settings (copied from PS's current config)
- Protocol has been moved up to be near port and setuid
2012-08-16 12:02:38 -07:00
Guangcong Luo
053bac374b Basic implementation of new login
uses public key encryption instead of connecting to login server
2012-07-20 23:58:36 -07:00
Guangcong Luo
12dac23bb1 setuid support 2012-07-20 13:43:24 -07:00
Bill Meltsner
c31ee2a428 Add SockJS as the default networking library.
You can still use Socket.IO by setting config.protocol in config.js.
2012-07-06 22:56:28 -05:00
Guangcong Luo
2d1de207b3 Revise who muted users can PM
- namely, whoever can PM them
- this makes more sense than a custom 'receivemutedpms' permission
2012-04-28 17:28:22 -04:00
Patrick Roberts
4b3783bc60 Edited config file to support NameLock 2012-04-27 14:54:45 -05:00
小太
5bf1cb1154 Added group ids and allowed the use of /<group id> or /de<group id> to directly promote to/demote from that group 2012-04-21 16:41:44 +10:00
小太
573d360982 Remove a few more hard-codings 2012-04-21 00:57:19 +10:00
小太
1f36d510dc A few updates 2012-04-20 18:08:25 +10:00
小太
650adc89d0 Remove /forcereset 2012-04-20 17:40:49 +10:00
小太
1cf0182d71 Changed a few default permissions 2012-04-20 17:40:03 +10:00
小太
9f11d4a7c2 New permissions system.
/help is only partially done though.
2012-04-20 17:29:01 +10:00
Guangcong Luo
807cb08b3a PotD works correctly again 2012-04-08 22:35:25 -04:00
Guangcong Luo
5cec184cae Report joins/leaves as deltas only:
- The entire user-list can now be shown, lag-less, no matter how many users are online
- config.lagmode is no longer needed
2012-03-02 08:14:51 -05:00
Guangcong Luo
f8f4d8284e Add crash guard setting
(workaround for socket.io bug 609: https://github.com/LearnBoost/socket.io/issues/609 )
2012-02-18 07:31:40 -05:00
Guangcong Luo
a8ca155f2c New configuration option: localsysop
- Automatically promotes users with the IP 127.0.0.1 to sysop
2012-02-14 23:29:33 -05:00
Guangcong Luo
801d2e5031 Add four new configuration options to prevent lag on large servers:
- reportjoins - whether to display "<user> joined"
- reportbattles - whether to display "Battle started between <user> and <other user>"
- lagmode - whether or not the user list should display every user, or just voiced/registered users
- modchat - moderated chat: enable to disallow unregistered+unvoiced users from speaking

Also limit the lobby battle list to only the first 24 battles.

These were in fact enough for PS to handle an influx of 1000+ users from Reddit, lag-free!
2012-02-08 18:22:49 -05:00
Guangcong Luo
46809b812f Add some basic documentation 2011-12-23 21:08:08 -05:00