diff --git a/AGENTS.md b/AGENTS.md index 507bef4..580c01b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -28,6 +28,11 @@ - Update README.md when layout or supported behavior changes. Distinguish working features from planned installation and updates. +- `config/servatrice/` is for manual configuration safekeeping only. Never wire it + into CI deployment, token publication, or the client installer. Keep credentials + out of Git; preserve private originals separately. Do not migrate a server + database or replace its container without a verified backup and upgrade plan. + ## Validation and commits - Run `python3 scripts/build.py`, `python3 scripts/generate_xml.py --check`, and diff --git a/README.md b/README.md index 22c8254..ade570e 100644 --- a/README.md +++ b/README.md @@ -491,6 +491,14 @@ Pipeline Linter (`/pipeline-model-converter/validate`). Groovy comp alone does not validate plugin availability or Declarative semantics. Publication is not live until Jenkins parses this file and successfully builds `main`. +## Servatrice configuration backup + +[config/servatrice/README.md](config/servatrice/README.md) records sanitized snapshots +of the local Servatrice configuration, the private backup location, and the +assessment of upgrading to 3.1.2. These files are for manual safekeeping only and +are excluded from token publication and installation. No Servatrice deployment +or database migration runs in CI. + ## License See [LICENSE](LICENSE) for the repository license. diff --git a/config/servatrice/README.md b/config/servatrice/README.md new file mode 100644 index 0000000..f54cc8d --- /dev/null +++ b/config/servatrice/README.md @@ -0,0 +1,92 @@ +# Servatrice configuration safekeeping + +These are manual snapshots of the configured Servatrice checkout at +`/home/dandaedre/Documents/Git/Cockatrice/servatrice`, captured on 2026-11-10. +They are **not deployment configuration for this repository**: Jenkins, the token +installer, and the mock deploy scripts do not apply or publish them. + +## Saved files + +| Snapshot | Original | Purpose | +| --- | --- | --- | +| `snapshots/standalone.ini` | `servatrice/servatrice.ini` | Password authentication, no database; server and room customizations. | +| `snapshots/container.ini` | `servatrice/docker/servatrice-docker.ini` | SQL authentication and registration, MySQL host `mysql`; configured container server. | +| `snapshots/modified-example.ini` | `servatrice/servatrice.ini.example` | Locally modified example, retained for comparison. | +| `snapshots/docker-compose.yml` | `docker-compose.yml` | Original Linux container topology, with credentials removed. | +| `snapshots/docker-compose.yml.windows` | `docker-compose.yml.windows` | Original Windows variant for reference. | +| `snapshots/Dockerfile` | `Dockerfile` | Original source-build container recipe. | + +The INI password fields contain `__RESTORE_
_PASSWORD__` markers. These +are literal placeholders, not environment expansion understood by Servatrice. +The Compose files require private `MYSQL_ROOT_PASSWORD` and `MYSQL_PASSWORD` +values. Do not run the snapshots without restoring the appropriate credentials +and reviewing paths. Original `$PWD` and relative mounts refer to a complete +Cockatrice source checkout, not this snapshot directory. The Dockerfile likewise +requires that upstream source tree as its build context. + +Exact original copies, including credentials and the original bootstrap SQL, +were saved and hash-verified outside Git at: + +```text +/home/dandaedre/.local/share/servatrice-backups/20261110-123010/ +``` + +That directory has mode `0700`, and its files have mode `0600`. Keep it private; +it is not uploaded or included in this repository. It is a **configuration backup, +not a backup of the existing database**. Preserve it separately if moving machines. +`snapshot.json` records the original source revision and the reviewed release. +Upstream files retain their upstream license; see `UPSTREAM-LICENSE`. + +## Runtime found during inspection + +The local checkout reports `2026-01-28-Development-2.11.0-beta.48` and has local +modifications, so it was not reset, pulled over, or replaced. No host `servatrice` +executable was found in PATH. Podman contains these existing, stopped containers: + +- `cockatrice_servatrice_1`, image `localhost/servatrice:latest`, using the original + `servatrice/docker/servatrice-docker.ini` at `/tmp/servatrice.ini`. +- `cockatrice_mysql_1`, image `docker.io/library/mysql:latest`. Its actual data is + in the anonymous volume + `8df9615530dd486623c08f81e074247712ea6497f5521f6ff10f8024c7e39597`, mounted at + `/var/lib/mysql`. The local `servatrice/mysql-storage/` folder is not its data. + +The original Linux Compose file publishes only port 4748 (WebSocket), although +Servatrice also configures TCP port 4747. This snapshot preserves that choice. +The MySQL image is unpinned and the data volume is anonymous; do not recreate or +upgrade it blindly. No containers, ports, or database mounts were changed. + +## Update assessment and isolated check + +The GitHub releases API identified +[2026-10-25-Release-3.1.2](https://github.com/Cockatrice/Cockatrice/releases/tag/2026-10-25-Release-3.1.2) +as the latest stable release at inspection time. Its source commit is +`bbc7e462ff0e9fd5391a0626e6f46fc79223aad5`. + +The official image `ghcr.io/cockatrice/servatrice:2026-10-25-release-3.1.2` was +pulled alongside the old image. It reported **Servatrice 3.1.2 (2026-10-31)** with +`--version` in a temporary container with networking disabled, a read-only root, +all capabilities dropped, and no configuration or database mounts. The test +container was removed automatically. This proves the executable starts for its +version command; it does not prove compatibility with the configured database. +The downloaded image ID is +`f38a4c5cdfa6721e44e9a784290be6b8c3ed9e80131536f5066ee1f365566093`. + +**The installed server was not switched to the new image.** The original source's +bootstrap schema is version 34, whereas 3.1.2 expects version 40. The actual stored +database version was not queried because MySQL remains stopped. Updating just +the image cannot be assumed safe. No SQL migrations were applied. + +A future manual upgrade should: + +1. Back up the stopped MySQL volume and prove that the backup can be restored. + Also retain the original database image, server image, and private config backup. +2. Start an isolated clone using the same MySQL image, inspect its actual schema + version and SQL mode, and rehearse the corresponding upstream migrations up + to schema 40. Bootstrap `servatrice.sql` is not a migration for existing data. +3. Test the new server against that cloned database with copied private settings + and no public ports. Verify authentication, rooms, registration, and replays. +4. Only after validation, plan a manual cutover with rollback of both database + and server image. Reverting the server image alone does not revert a schema. + +This repository intentionally provides no automatic Servatrice deployment or +migration task. The downloaded candidate is available for that future rehearsal. diff --git a/config/servatrice/UPSTREAM-LICENSE b/config/servatrice/UPSTREAM-LICENSE new file mode 100644 index 0000000..9efa6fb --- /dev/null +++ b/config/servatrice/UPSTREAM-LICENSE @@ -0,0 +1,338 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 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 Lesser General Public License instead.) You can apply it to +your programs, too. + + 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. + + 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. + + 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. + + 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. + + 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. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 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". + +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. + + 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. + +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. + + 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: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + 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. + + 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.) + +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. + +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. + +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. + + 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) 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, + + 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, + + 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 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. + +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. + + 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. + + 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. + + 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 +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 +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. + +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. + +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. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this 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. + + 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 +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. + + 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. + + NO WARRANTY + + 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. + + 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. + + 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 +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Moe Ghoul, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/config/servatrice/snapshot.json b/config/servatrice/snapshot.json new file mode 100644 index 0000000..26ddee8 --- /dev/null +++ b/config/servatrice/snapshot.json @@ -0,0 +1,34 @@ +{ + "snapshot_date": "2026-11-10", + "source_directory": "/home/dandaedre/Documents/Git/Cockatrice/servatrice", + "source_repository": "https://github.com/Cockatrice/Cockatrice", + "source_commit": "d4100786737579736a6b28aa788d3564ff9b0d9d", + "source_version": "2026-01-28-Development-2.11.0-beta.48", + "private_backup": "/home/dandaedre/.local/share/servatrice-backups/20261110-123010", + "redacted_fields": { + "standalone.ini": [ + "authentication/password", + "smtp/password", + "database/password" + ], + "container.ini": [ + "authentication/password", + "smtp/password", + "database/password" + ], + "modified-example.ini": [ + "authentication/password", + "smtp/password", + "database/password" + ] + }, + "candidate_release": "2026-10-25-Release-3.1.2", + "candidate_commit": "bbc7e462ff0e9fd5391a0626e6f46fc79223aad5", + "source_schema_file_version": 34, + "candidate_required_schema_version": 40, + "actual_database_schema_version": "not queried; database container remains stopped", + "deployment": "none; original files, stopped containers and database volume unchanged", + "candidate_image": "ghcr.io/cockatrice/servatrice:2026-10-25-release-3.1.2", + "candidate_image_id": "f38a4c5cdfa6721e44e9a784290be6b8c3ed9e80131536f5066ee1f365566093", + "candidate_check": "--version passed in network-isolated read-only temporary container without mounts; existing deployment not upgraded" +} diff --git a/config/servatrice/snapshots/Dockerfile b/config/servatrice/snapshots/Dockerfile new file mode 100644 index 0000000..d185b74 --- /dev/null +++ b/config/servatrice/snapshots/Dockerfile @@ -0,0 +1,44 @@ +# -------- Build Stage -------- +FROM ubuntu:24.04 AS build + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + file \ + g++ \ + git \ + libmariadb-dev-compat \ + libprotobuf-dev \ + libqt6sql6-mysql \ + qt6-websockets-dev \ + protobuf-compiler \ + qt6-tools-dev \ + qt6-tools-dev-tools + +WORKDIR /src +COPY . . +RUN mkdir build && cd build && \ + cmake .. -DWITH_SERVER=1 -DWITH_CLIENT=0 -DWITH_ORACLE=0 && \ + make -j$(nproc) && \ + make install + + +# -------- Runtime Stage (clean) -------- +FROM ubuntu:24.04 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + libprotobuf32t64 \ + libqt6sql6-mysql \ + libqt6websockets6 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Only copy installed binaries, not source +COPY --from=build /usr/local /usr/local + +WORKDIR /home/servatrice + +EXPOSE 4748 +ENTRYPOINT [ "servatrice", "--log-to-console" ] diff --git a/config/servatrice/snapshots/container.ini b/config/servatrice/snapshots/container.ini new file mode 100644 index 0000000..def00f2 --- /dev/null +++ b/config/servatrice/snapshots/container.ini @@ -0,0 +1,419 @@ +; SAFEKEEPING SNAPSHOT: credentials removed; restore privately before use. +; Servatrice configuration file +; +; This is the main configuration file for Servatrice; while using a configuration is not mandatory, +; you may want to customize some aspects of your servatrice instance, like its name, port or the way +; users can authenticate to the server. +; +; Can be passed to servatrice with --config /path/to/servatrice.ini + +[server] + +; This is the name that servatrice exposes to the users; the default value is pretty boring +name="The Realm of el Vergus" + +; Multiple servatrice servers can run on the same host using the same database; each server instance +; must have a different id; the default id is 1 +id=1 + +; The IP address servatrice will listen on for clients; defaults to "any" to listen on all the interfaces, +; a specific IPv4/v6 addresses can be used, eg for localhost-only 127.0.0.1 for IPv4 or ::1 for IPv6. + +host=any + +; The TCP port number Servatrice will listen on for clients; default is 4747; +; Will be removed in the future, use websocket connection instead +port=4747 + +; Servatrice can scale up to serve big number of users using more than one parallel thread of execution; +; If your server is hosting a lot of players and they frequently report of being unable to login or +; long delays (lag), you may want to try increasing this value; default is 1. +; Set to 0 to disable the tcp server. +number_pools=1 + +; Servatrice can listen for clients on websockets, too. Multiple connection pools are available but +; unfortunately, due to a Qt limitation, they must run in the same execution thread. +; Set to 0 to disable the websocket server. +websocket_number_pools=1 + +; The IP address servatrice will listen on for websockets clients; defaults to "any" +websocket_host=any + +; The TCP port number servatrice will listen on for websockets clients; default is 4748 +websocket_port=4748 + +; When database is enabled, servatrice writes the server status in the "update" database table; this +; setting defines every how many milliseconds servatrice will update its status; default is 15000 (15 secs) +statusupdate=15000 + +; Do you want servatrice to write important events and errors to a logfile? Default is 1 (yes). +writelog=1 + +; Choose a name for the log file, if enabled; you can specify an absolute path or a path relative to +; the servatrice executable; the default file name is server.log (in the same path as servatrice) +; Note: When running servatrice under windows you will need to use double backslashes between folder locations +; [ex: C:\\Temp\\server.log ] +logfile=server.log + +; You may want to log only certain messages in the logfile. The default log level is extremely verbose. +; This setting should contain a comma-separated list of strings that will be selectively logged. +; All other lines will be excluded from the log. Default is empty; example: "Registration,_Login,foobar" +logfilters="" + +; Set the time interval in seconds that servatrice will use to communicate with each connected client +; to verify the client has not timed out. Defaults is 1 seconds +clientkeepalive=1 + +; Maximum time in seconds a player can stay inactive with there client not even responding to pings, before is +; considered disconnected; default is 15 +max_player_inactivity_time=15 + +; More modern clients generate client IDs based on specific client side information. Enable this option to +; require that clients report the client ID in order to log into the server. Default is false +requireclientid=false + +; You can limit the types of clients that connect to the server by requiring different features be available +; on the client. This setting can contain a comma-seperated list of features. if any of the features +; listed in this line are not available on the client the client will be denied access to the server upon +; attempting to log in. Example: "client_id,client_ver,websocket" +requiredfeatures="" + +; You can define custom warnings that users are sent when the moderation staff uses the right client warn user +; menu option. This list is comma seperated that each item will appear in the drop down list for staff members +; to choose from. Example: "Flaming,Foul Language" +officialwarnings="Flaming,Spamming,Causing Drama,Abusive Language" + +; Maximum time in seconds a player can stay connected but idle. Default is 3600 (0 = disabled) +; Clients will be notified at the 90% time period of pending disconnection if they do not take action. +idleclienttimeout=3600 + +[authentication] + +; Servatrice can authenticate users connecting. It currently supports 3 different authentication methods: +; * none: no authentication, accept every user; +; * password: require users to specify a common password to log in; +; * sql: authenticate users against the "users" table of the database; +; Please note that only the "sql" method permits to have registered users and store their data on the server. +method=sql + +; if the chosen authentication method is password, here you can define the password your users will use to log in +password="__RESTORE_AUTHENTICATION_PASSWORD__" + +; Accept only registered users? default is false (accept unregistered users) +regonly=false + +[users] + +; The minimum length a username can be +minnamelength=2 + +; The maximum length a username can be +maxnamelength=22 + +; If a username should be allowed to contain lowercase chars [a-z] +allowlowercase=true + +; If a username should be allowed to conatain uppercase chars [A-Z] +allowuppercase=true + +; If a username should be allowed to contain numbers [0-9] +allownumerics=true + +; Define punctuation allowed in usernames +allowedpunctuation=_.- + +; If a username can begin with punctuation defined in allowedpunctuation +allowpunctuationprefix=false + +; Disallow usernames containing these words. This list is comma seperated, e.g. +; "admin,user,name" +disallowedwords="admin" + +; Overwrite the words shown to the user when they enter a wrong username, +; use \n to start a new line. Neither the real wordlist nor the disallowed +; expressions will be sent to the user if this is set. +; In the old versions of the client this list will be prefaced with +; "can not contain any of the following words:" +; example: +;displaydisallowedwords="no attempts at impersonating staff\nno unparliamentary language\nno references to controversial figures\nstaff reserves the right to remove accounts deemed inappropriate" +; Setting it to nothing will simply hide the list: +;displaydisallowedwords= + +; Disallow usernames matching these regular expressions. This list is comma +; separated, e.g. "\\w+\\d+,\\d{2}user", hence you cannot use commas in your +; expressions. Backslashes must be escaped, so `\w+\d+` becomes `\\w+\\d+`. +; WARNING: Complex expressions can be harmful to performance. Please make sure +; your expressions are considered well formed. See this page for info: +; http://www.regular-expressions.info/catastrophic.html +disallowedregexp="" + +; Define minimum password length +; Default 6. +minpasswordlength = 2 + +[registration] + +; Servatrice can process registration requests to add new users on the fly. +; Enable this feature? Default false. +enabled=true + +; Require users to provide an email address in order to register. Default true. +requireemail=false + +; Require email activation. Newly registered users will receive an activation token by email, +; and will be required to input back this token on cockatrice at the first login to get their +; account activated. Default true. +requireemailactivation=false + +; Set this number to the maximum number of accounts any one user can use to create new accounts +; using the same email address. 0 = Unlimited number of accounts (default). +;maxaccountsperemail=0 + +; You can prevent users from using certain mail domains for registration. This setting contains a +; comma-seperated list of email provider domains that you would like to prevent users from using +; during registration. Comparison's are implicit, so placing an entry such as mail.com will also +; prevent users from registering accounts with providers such as gmail.com and hotmail.com +; Example: "10minutemail.com,gmail.com" +;emailproviderblacklist="" + +; You can require users to only use certain email domains for registration. This setting is a +; comma-separated list of email provider domains that you have explicitly audited and require +; the use of in order to create an account. Comparison's are explicit, so you must specify the +; domain in completion, such as gmail.com and hotmail.com. Email whitelist is checked before +; Email blacklist is checked, so an email cannot be in both setting configurations. +; Example: "gmail.com,hotmail.com,icloud.com" +;emailproviderwhitelist="" + +[forgotpassword] + +; Servatrice can process reset password requests allowing users to reset their account +; passwords in the event they forget it. Should this feature be enabled? Default: false. +; enable=false + +; Reset password request should not be allowed to stay valid forever. This settings +; informs servatrice how long a players reset password reset token is valid for (in minutes). +; Default: 60 +; tokenlife=60 + +; Servatrice can challenge users that are making reset password requests to answer +; questions in regards to their account to help validate they are the true owner of the account. +; Should this feature be enabled? Default: false +; enablechallenge=false + +; Email subject for the reset password emails +; subject="Cockatrice reset password token" + +; Reset password email body. You can use these tags here: %username %token +; They will be substituted with the actual values in the email +; +; body="Hi %username,\r\nthanks for reaching out to us with your password reset request for our Cockatrice server.\r\nHere's your unique token in order to reset your account password in the app:\r\n\r\n%token\r\n\r\nHappy gaming!" + + +[smtp] + +; Enable the internal smtp client to send registration emails. If you would like to +; use some other method to send email activation tokens set this value to false. Otherwise +; setting it to true (default) the server will send canned generated emails containing +; activation tokens for you during update intervals. Setting this to false will require +; you to either manually activate user accounts or manually send users the activation token +; by whatever means. +enableinternalsmtpclient=true + +; Connectin type: currently supported method are "tcp" and "ssl"; tls is autodetected if available +connection=tcp + +; Accept all certificates: in ssl mode, enable this if your server is using an invalid/self signed certificate +acceptallcerts=false; + +; Hostname or IP addres of the smtp server +host=localhost + +; Smtp port number of the smtp server. Usual values are 25 or 587 for tcp, 465 for ssl +port=25 + +; Username: this typically matches the "from" email address +username=root@localhost + +; Password for the username +password="__RESTORE_SMTP_PASSWORD__" + +; Sender email address: the "from" email address +email=root@localhost + +; Sender email name +name="Cockatrice server" + +; Email subject +subject="Cockatrice server account activation token" + +; Email body. You can use these tags here: %username %token +; They will be substituted with the actual values in the email +; +body="Hi %username, thank our for registering on our Cockatrice server\r\nHere's the activation token you need to supply for activating your account:\r\n\r\n%token\r\n\r\nHappy gaming!" + +[rooms] + +; A servatrice server can expose to the users different "rooms" to chat and create games. Rooms can be defined +; with two different methods: +; config: rooms are defined in this configuration (see the following example) +; sql: rooms are defined in the "rooms" table of the database +method=config + +; Example configuration for a server with rooms configured in the configuration file. Number of rooms defined +roomlist\size=1 + +; Room name for the room number 1 +roomlist\1\name="La roume yénéral del dan" + +; Room description for the room number 1 +roomlist\1\description="Play anything here." + +; Rooms can restrict the level of user that can join. Current supported options are none, registered, moderator, administrator. +; Default is none. +roomlist\1\permissionlevel=none + +; Rooms can restrict the permission level of users that can join, Currnetly supported options are none, privileged, vip, and donator. +; Default is none. +roomlist\1\privilegelevel=none + +; Wether to make users autojoin this room when connected to the server +roomlist\1\autojoin=true + +; Message displayed to each user when he joins room number 1 +roomlist\1\joinmessage="This message is only here to show that rooms can have a join message." + +; The number of chat history messages to save that gets presented to a user joining the room +roomlist\1\chathistorysize=100 + +; Number of game types allowed (defined) in the room number 1 +roomlist\1\game_types\size=3 + +; Name of the three game types for the room number 1 +roomlist\1\game_types\1\name="GameType1" +roomlist\1\game_types\2\name="GameType2" +roomlist\1\game_types\3\name="GameType3" + + +[game] + +; Maximum time in seconds all players in a game can stay inactive before the game is automatically closed; +; default is 120 +max_game_inactivity_time=120 + +; All actions during a game are recorded and stored in the database as a replay that all participants of +; the game can go back to and review after the game is closed. This can require a fairly large amount of +; storage to save all the information. Disable this option to prevent the storing of replay data in +; the database. Default value is true. +store_replays=true + +; Allow users to create a new game and join it as a judge. The host will be able to execute any action on +; the cards of every player. This is needed in order to support some games (eg. Werewolf). +; Default off to prevent abuse on servers that are mostly running other games. +allow_create_as_judge=false + +[security] +; You may want to restrict the number of users that can connect to your server at any given time. +enable_max_user_limit=false + +; Maximum number of users that can connect to the server, default is 500. +max_users_total=500 + +; Maximum number of users that can connect to the server using a tcp connection, default is 500. +max_users_tcp=500 + +; Maximum number of users that can connect to the server using a websocket connection, default is 500. +max_users_websocket=500 + +; Maximum number of users that can connect from the same IP address; useful to avoid bots, default is 4 +max_users_per_address=22 + +; You may want to allow an unlimited number of users from a trusted source. This setting can contain a +; comma-separed list of IP addresses which will allow an unlimited number of connections from each of the +; IP addresses listed (ignoring the max_users_per_address). Default is "127.0.0.1,::1"; example: "192.73.233.244,81.4.100.74" +trusted_sources="127.0.0.1,::1" + +; Servatrice can avoid users from flooding rooms with large number of messages in an interval of time. +; This setting defines the length in seconds of the considered interval; default is 10 +message_counting_interval=10 + +; Maximum size in characters of all messages in an interval before new messages gets dropped; default is 1000 +max_message_size_per_interval=1000 + +; Maximum number of messages in an interval before new messages gets dropped; default is 10 +max_message_count_per_interval=10 + +; Maximum number of games a single user can create; default is 5; set to -1 to disable; 0 disallows game creation +max_games_per_user=5 + +; Servatrice can avoid users from flooding games with large number of game commands in an interval of time. +; This setting defines the length in seconds of the considered interval; default is 10 +command_counting_interval=10 + +; Maximum number of game commands in an interval before new commands gets dropped; default is 20 +max_command_count_per_interval=20 + +[logging] +; Admin/Moderators can query the stored logs for information when looking up reports by various players. This +; option can allow or disallow them from doing so. +; !!NOTE!! Enabling this feature puts a very high CPU and DISK load on the server, enable with caution. +enablelogquery=false + +; Servatrice can log user messages to the database table cockatrice_log. +; These messages can come from different sources; each source can be enabled separately. + +; Log user messages inside chat rooms +log_user_msg_room=false + +; Log user messages inside games +log_user_msg_game=false + +; Log user messages in private chats +log_user_msg_chat=false + +; Log user messages coming from other servers in the network +log_user_msg_isl=false + +[audit] + +; Servatrice can record certain actions being performed in the database for server operators to better understand +; if some one may be abusing application functionality. Enabling auditing will allow servatrice to record any +; of the below enabled audit functionality to be recorded. +; Default: true +enable_audit=true + +; Servatrice can record when users attempt a new account registration. Should we enable auditing for this action? +; Default: true +enable_registration_audit=true + +; Servatrice can record when a users attempts to reset the account password. Should we enable auditing for this action? +; Default: true +enable_forgotpassword_audit=true + + +; EXPERIMENTAL - NOT WORKING YET +; The following settings are relative to the server network functionality, that is not yet complete. +; Avoid enabling it unless you are willing to test it and help its development. + +[servernetwork] + +; Servatrice servers can connect themselves and build a network. This settins enable the ability of servatrice +; of waiting for other server's connections and connect to other servers. Other servers can be defined in the +; "servers" table of the database. Default is 0 (disabled) +active=0 + +; The TCP port number Servatrice will listen on for other servers; default is 14747 +port=14747 + +; Server-to-server communication needs a valid certificate in PEM format. Enter its filename in this setting +ssl_cert=ssl_cert.pem + +; Filename of the private key for the server-to-server certificate +ssl_key=ssl_key.pem + +[database] +type=mysql +prefix=cockatrice +hostname=mysql +database=servatrice +user=servatrice +password="__RESTORE_DATABASE_PASSWORD__" diff --git a/config/servatrice/snapshots/docker-compose.yml b/config/servatrice/snapshots/docker-compose.yml new file mode 100644 index 0000000..41a79af --- /dev/null +++ b/config/servatrice/snapshots/docker-compose.yml @@ -0,0 +1,28 @@ +# SAFEKEEPING SNAPSHOT: not used by this repository CI or deployment. +version: '3' + +services: + mysql: + image: mysql + command: --sql_mode= + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:?Restore this credential from the private backup} + - MYSQL_DATABASE=servatrice + - MYSQL_USER=servatrice + - MYSQL_PASSWORD=${MYSQL_PASSWORD:?Restore this credential from the private backup} + volumes: + - $PWD/servatrice/servatrice.sql:/docker-entrypoint-initdb.d/servatrice.sql + + servatrice: + build: + context: . + dockerfile: Dockerfile + image: servatrice + depends_on: + - mysql + ports: + - "4748:4748" + entrypoint: "/bin/bash -c 'sleep 10; servatrice --config /tmp/servatrice.ini --log-to-console'" + restart: always + volumes: + - $PWD/servatrice/docker/servatrice-docker.ini:/tmp/servatrice.ini diff --git a/config/servatrice/snapshots/docker-compose.yml.windows b/config/servatrice/snapshots/docker-compose.yml.windows new file mode 100644 index 0000000..8a958d5 --- /dev/null +++ b/config/servatrice/snapshots/docker-compose.yml.windows @@ -0,0 +1,28 @@ +# SAFEKEEPING SNAPSHOT: not used by this repository CI or deployment. +version: '3' + +services: + mysql: + image: mysql + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:?Restore this credential from the private backup} + - MYSQL_DATABASE=servatrice + - MYSQL_USER=servatrice + - MYSQL_PASSWORD=${MYSQL_PASSWORD:?Restore this credential from the private backup} + volumes: + - ./servatrice/servatrice.sql:/docker-entrypoint-initdb.d/servatrice.sql + - ./servatrice/mysql-storage:/var/lib/mysql + + servatrice: + build: + context: . + dockerfile: Dockerfile + image: servatrice + depends_on: + - mysql + ports: + - "4748:4748" + entrypoint: "/bin/bash -c 'sleep 10; servatrice --config /tmp/servatrice.ini --log-to-console'" + restart: always + volumes: + - ./servatrice/docker/servatrice-docker.ini:/tmp/servatrice.ini diff --git a/config/servatrice/snapshots/modified-example.ini b/config/servatrice/snapshots/modified-example.ini new file mode 100644 index 0000000..4c06c78 --- /dev/null +++ b/config/servatrice/snapshots/modified-example.ini @@ -0,0 +1,433 @@ +; SAFEKEEPING SNAPSHOT: credentials removed; restore privately before use. +; Servatrice configuration file +; +; This is the main configuration file for Servatrice; while using a configuration is not mandatory, +; you may want to customize some aspects of your servatrice instance, like its name, port or the way +; users can authenticate to the server. +; +; Can be passed to servatrice with --config /path/to/servatrice.ini + +[server] + +; This is the name that servatrice exposes to the users; the default value is pretty boring +name="My Cockatrice server" + +; Multiple servatrice servers can run on the same host using the same database; each server instance +; must have a different id; the default id is 1 +id=1 + +; The IP address servatrice will listen on for clients; defaults to "any" to listen on all the interfaces, +; a specific IPv4/v6 addresses can be used, eg for localhost-only 127.0.0.1 for IPv4 or ::1 for IPv6. + +host=any + +; The TCP port number Servatrice will listen on for clients; default is 4747; +; Will be removed in the future, use websocket connection instead +port=4747 + +; Servatrice can scale up to serve big number of users using more than one parallel thread of execution; +; If your server is hosting a lot of players and they frequently report of being unable to login or +; long delays (lag), you may want to try increasing this value; default is 1. +; Set to 0 to disable the tcp server. +number_pools=1 + +; Servatrice can listen for clients on websockets, too. Multiple connection pools are available but +; unfortunately, due to a Qt limitation, they must run in the same execution thread. +; Set to 0 to disable the websocket server. +websocket_number_pools=1 + +; The IP address servatrice will listen on for websockets clients; defaults to "any" +websocket_host=any + +; The TCP port number servatrice will listen on for websockets clients; default is 4748 +websocket_port=4748 + +; When database is enabled, servatrice writes the server status in the "update" database table; this +; setting defines every how many milliseconds servatrice will update its status; default is 15000 (15 secs) +statusupdate=15000 + +; Do you want servatrice to write important events and errors to a logfile? Default is 1 (yes). +writelog=1 + +; Choose a name for the log file, if enabled; you can specify an absolute path or a path relative to +; the servatrice executable; the default file name is server.log (in the same path as servatrice) +; Note: When running servatrice under windows you will need to use double backslashes between folder locations +; [ex: C:\\Temp\\server.log ] +logfile=server.log + +; You may want to log only certain messages in the logfile. The default log level is extremely verbose. +; This setting should contain a comma-separated list of strings that will be selectively logged. +; All other lines will be excluded from the log. Default is empty; example: "Registration,_Login,foobar" +logfilters="" + +; Set the time interval in seconds that servatrice will use to communicate with each connected client +; to verify the client has not timed out. Defaults is 1 seconds +clientkeepalive=1 + +; Maximum time in seconds a player can stay inactive with there client not even responding to pings, before is +; considered disconnected; default is 15 +max_player_inactivity_time=15 + +; More modern clients generate client IDs based on specific client side information. Enable this option to +; require that clients report the client ID in order to log into the server. Default is false +requireclientid=false + +; You can limit the types of clients that connect to the server by requiring different features be available +; on the client. This setting can contain a comma-seperated list of features. if any of the features +; listed in this line are not available on the client the client will be denied access to the server upon +; attempting to log in. Example: "client_id,client_ver,websocket" +requiredfeatures="" + +; You can define custom warnings that users are sent when the moderation staff uses the right client warn user +; menu option. This list is comma seperated that each item will appear in the drop down list for staff members +; to choose from. Example: "Flaming,Foul Language" +officialwarnings="Flaming,Spamming,Causing Drama,Abusive Language" + +; Maximum time in seconds a player can stay connected but idle. Default is 3600 (0 = disabled) +; Clients will be notified at the 90% time period of pending disconnection if they do not take action. +idleclienttimeout=3600 + +[authentication] + +; Servatrice can authenticate users connecting. It currently supports 3 different authentication methods: +; * none: no authentication, accept every user; +; * password: require users to specify a common password to log in; +; * sql: authenticate users against the "users" table of the database; +; Please note that only the "sql" method permits to have registered users and store their data on the server. +method=none + +; if the chosen authentication method is password, here you can define the password your users will use to log in +password="__RESTORE_AUTHENTICATION_PASSWORD__" + +; Accept only registered users? default is false (accept unregistered users) +regonly=false + +[users] + +; The minimum length a username can be +minnamelength=6 + +; The maximum length a username can be +maxnamelength=12 + +; If a username should be allowed to contain lowercase chars [a-z] +allowlowercase=true + +; If a username should be allowed to conatain uppercase chars [A-Z] +allowuppercase=true + +; If a username should be allowed to contain numbers [0-9] +allownumerics=true + +; Define punctuation allowed in usernames +allowedpunctuation=_.- + +; If a username can begin with punctuation defined in allowedpunctuation +allowpunctuationprefix=false + +; Disallow usernames containing these words. This list is comma seperated, e.g. +; "admin,user,name" +disallowedwords="admin" + +; Overwrite the words shown to the user when they enter a wrong username, +; use \n to start a new line. Neither the real wordlist nor the disallowed +; expressions will be sent to the user if this is set. +; In the old versions of the client this list will be prefaced with +; "can not contain any of the following words:" +; example: +;displaydisallowedwords="no attempts at impersonating staff\nno unparliamentary language\nno references to controversial figures\nstaff reserves the right to remove accounts deemed inappropriate" +; Setting it to nothing will simply hide the list: +;displaydisallowedwords= + +; Disallow usernames matching these regular expressions. This list is comma +; separated, e.g. "\\w+\\d+,\\d{2}user", hence you cannot use commas in your +; expressions. Backslashes must be escaped, so `\w+\d+` becomes `\\w+\\d+`. +; WARNING: Complex expressions can be harmful to performance. Please make sure +; your expressions are considered well formed. See this page for info: +; http://www.regular-expressions.info/catastrophic.html +disallowedregexp="" + +; Define minimum password length +; Default 6. +minpasswordlength = 6 + +[registration] + +; Servatrice can process registration requests to add new users on the fly. +; Enable this feature? Default false. +;enabled=false + +; Require users to provide an email address in order to register. Default true. +;requireemail=true + +; Require email activation. Newly registered users will receive an activation token by email, +; and will be required to input back this token on cockatrice at the first login to get their +; account activated. Default true. +;requireemailactivation=true + +; Set this number to the maximum number of accounts any one user can use to create new accounts +; using the same email address. 0 = Unlimited number of accounts (default). +;maxaccountsperemail=0 + +; You can prevent users from using certain mail domains for registration. This setting contains a +; comma-seperated list of email provider domains that you would like to prevent users from using +; during registration. Comparison's are implicit, so placing an entry such as mail.com will also +; prevent users from registering accounts with providers such as gmail.com and hotmail.com +; Example: "10minutemail.com,gmail.com" +;emailproviderblacklist="" + +; You can require users to only use certain email domains for registration. This setting is a +; comma-separated list of email provider domains that you have explicitly audited and require +; the use of in order to create an account. Comparison's are explicit, so you must specify the +; domain in completion, such as gmail.com and hotmail.com. Email whitelist is checked before +; Email blacklist is checked, so an email cannot be in both setting configurations. +; Example: "gmail.com,hotmail.com,icloud.com" +;emailproviderwhitelist="" + +[forgotpassword] + +; Servatrice can process reset password requests allowing users to reset their account +; passwords in the event they forget it. Should this feature be enabled? Default: false. +; enable=false + +; Reset password request should not be allowed to stay valid forever. This settings +; informs servatrice how long a players reset password reset token is valid for (in minutes). +; Default: 60 +; tokenlife=60 + +; Servatrice can challenge users that are making reset password requests to answer +; questions in regards to their account to help validate they are the true owner of the account. +; Should this feature be enabled? Default: false +; enablechallenge=false + +; Email subject for the reset password emails +; subject="Cockatrice reset password token" + +; Reset password email body. You can use these tags here: %username %token +; They will be substituted with the actual values in the email +; +; body="Hi %username,\r\nthanks for reaching out to us with your password reset request for our Cockatrice server.\r\nHere's your unique token in order to reset your account password in the app:\r\n\r\n%token\r\n\r\nHappy gaming!" + + +[smtp] + +; Enable the internal smtp client to send registration emails. If you would like to +; use some other method to send email activation tokens set this value to false. Otherwise +; setting it to true (default) the server will send canned generated emails containing +; activation tokens for you during update intervals. Setting this to false will require +; you to either manually activate user accounts or manually send users the activation token +; by whatever means. +enableinternalsmtpclient=true + +; Connectin type: currently supported method are "tcp" and "ssl"; tls is autodetected if available +connection=tcp + +; Accept all certificates: in ssl mode, enable this if your server is using an invalid/self signed certificate +acceptallcerts=false; + +; Hostname or IP addres of the smtp server +host=localhost + +; Smtp port number of the smtp server. Usual values are 25 or 587 for tcp, 465 for ssl +port=25 + +; Username: this typically matches the "from" email address +username=root@localhost + +; Password for the username +password="__RESTORE_SMTP_PASSWORD__" + +; Sender email address: the "from" email address +email=root@localhost + +; Sender email name +name="Cockatrice server" + +; Email subject +subject="Cockatrice server account activation token" + +; Email body. You can use these tags here: %username %token +; They will be substituted with the actual values in the email +; +body="Hi %username, thank our for registering on our Cockatrice server\r\nHere's the activation token you need to supply for activating your account:\r\n\r\n%token\r\n\r\nHappy gaming!" + +[database] + +; Database type. Valid values are: +; * none: no database; +; * mysql: mysql or compatible database; +type=none + +; Prefix used in he database for table names; default is cockatrice +prefix=cockatrice + +; Database connection parameter: server hostname or IP +hostname=localhost + +; Database connection parameter: database name +database=servatrice + +; Database connection parameter: database user +user=servatrice + +; Database connection parameter: database user's password +password="__RESTORE_DATABASE_PASSWORD__" + +[rooms] + +; A servatrice server can expose to the users different "rooms" to chat and create games. Rooms can be defined +; with two different methods: +; config: rooms are defined in this configuration (see the following example) +; sql: rooms are defined in the "rooms" table of the database +method=config + +; Example configuration for a server with rooms configured in the configuration file. Number of rooms defined +roomlist\size=1 + +; Room name for the room number 1 +roomlist\1\name="General room" + +; Room description for the room number 1 +roomlist\1\description="Play anything here." + +; Rooms can restrict the level of user that can join. Current supported options are none, registered, moderator, administrator. +; Default is none. +roomlist\1\permissionlevel=none + +; Rooms can restrict the permission level of users that can join, Currnetly supported options are none, privileged, vip, and donator. +; Default is none. +roomlist\1\privilegelevel=none + +; Wether to make users autojoin this room when connected to the server +roomlist\1\autojoin=true + +; Message displayed to each user when he joins room number 1 +roomlist\1\joinmessage="This message is only here to show that rooms can have a join message." + +; The number of chat history messages to save that gets presented to a user joining the room +roomlist\1\chathistorysize=100 + +; Number of game types allowed (defined) in the room number 1 +roomlist\1\game_types\size=3 + +; Name of the three game types for the room number 1 +roomlist\1\game_types\1\name="GameType1" +roomlist\1\game_types\2\name="GameType2" +roomlist\1\game_types\3\name="GameType3" + + +[game] + +; Maximum time in seconds all players in a game can stay inactive before the game is automatically closed; +; default is 120 +max_game_inactivity_time=120 + +; All actions during a game are recorded and stored in the database as a replay that all participants of +; the game can go back to and review after the game is closed. This can require a fairly large amount of +; storage to save all the information. Disable this option to prevent the storing of replay data in +; the database. Default value is true. +store_replays=true + +; Allow users to create a new game and join it as a judge. The host will be able to execute any action on +; the cards of every player. This is needed in order to support some games (eg. Werewolf). +; Default off to prevent abuse on servers that are mostly running other games. +allow_create_as_judge=false + +[security] +; You may want to restrict the number of users that can connect to your server at any given time. +enable_max_user_limit=false + +; Maximum number of users that can connect to the server, default is 500. +max_users_total=500 + +; Maximum number of users that can connect to the server using a tcp connection, default is 500. +max_users_tcp=500 + +; Maximum number of users that can connect to the server using a websocket connection, default is 500. +max_users_websocket=500 + +; Maximum number of users that can connect from the same IP address; useful to avoid bots, default is 4 +max_users_per_address=4 + +; You may want to allow an unlimited number of users from a trusted source. This setting can contain a +; comma-separed list of IP addresses which will allow an unlimited number of connections from each of the +; IP addresses listed (ignoring the max_users_per_address). Default is "127.0.0.1,::1"; example: "192.73.233.244,81.4.100.74" +trusted_sources="127.0.0.1,::1" + +; Servatrice can avoid users from flooding rooms with large number of messages in an interval of time. +; This setting defines the length in seconds of the considered interval; default is 10 +message_counting_interval=10 + +; Maximum size in characters of all messages in an interval before new messages gets dropped; default is 1000 +max_message_size_per_interval=1000 + +; Maximum number of messages in an interval before new messages gets dropped; default is 10 +max_message_count_per_interval=10 + +; Maximum number of games a single user can create; default is 5; set to -1 to disable; 0 disallows game creation +max_games_per_user=5 + +; Servatrice can avoid users from flooding games with large number of game commands in an interval of time. +; This setting defines the length in seconds of the considered interval; default is 10 +command_counting_interval=10 + +; Maximum number of game commands in an interval before new commands gets dropped; default is 20 +max_command_count_per_interval=20 + +[logging] +; Admin/Moderators can query the stored logs for information when looking up reports by various players. This +; option can allow or disallow them from doing so. +; !!NOTE!! Enabling this feature puts a very high CPU and DISK load on the server, enable with caution. +enablelogquery=false + +; Servatrice can log user messages to the database table cockatrice_log. +; These messages can come from different sources; each source can be enabled separately. + +; Log user messages inside chat rooms +log_user_msg_room=false + +; Log user messages inside games +log_user_msg_game=false + +; Log user messages in private chats +log_user_msg_chat=false + +; Log user messages coming from other servers in the network +log_user_msg_isl=false + +[audit] + +; Servatrice can record certain actions being performed in the database for server operators to better understand +; if some one may be abusing application functionality. Enabling auditing will allow servatrice to record any +; of the below enabled audit functionality to be recorded. +; Default: true +enable_audit=true + +; Servatrice can record when users attempt a new account registration. Should we enable auditing for this action? +; Default: true +enable_registration_audit=true + +; Servatrice can record when a users attempts to reset the account password. Should we enable auditing for this action? +; Default: true +enable_forgotpassword_audit=true + + +; EXPERIMENTAL - NOT WORKING YET +; The following settings are relative to the server network functionality, that is not yet complete. +; Avoid enabling it unless you are willing to test it and help its development. + +[servernetwork] + +; Servatrice servers can connect themselves and build a network. This settins enable the ability of servatrice +; of waiting for other server's connections and connect to other servers. Other servers can be defined in the +; "servers" table of the database. Default is 0 (disabled) +active=0 + +; The TCP port number Servatrice will listen on for other servers; default is 14747 +port=14747 + +; Server-to-server communication needs a valid certificate in PEM format. Enter its filename in this setting +ssl_cert=ssl_cert.pem + +; Filename of the private key for the server-to-server certificate +ssl_key=ssl_key.pem diff --git a/config/servatrice/snapshots/standalone.ini b/config/servatrice/snapshots/standalone.ini new file mode 100644 index 0000000..72fa4d2 --- /dev/null +++ b/config/servatrice/snapshots/standalone.ini @@ -0,0 +1,433 @@ +; SAFEKEEPING SNAPSHOT: credentials removed; restore privately before use. +; Servatrice configuration file +; +; This is the main configuration file for Servatrice; while using a configuration is not mandatory, +; you may want to customize some aspects of your servatrice instance, like its name, port or the way +; users can authenticate to the server. +; +; Can be passed to servatrice with --config /path/to/servatrice.ini + +[server] + +; This is the name that servatrice exposes to the users; the default value is pretty boring +name="The Realm of the Vergus" + +; Multiple servatrice servers can run on the same host using the same database; each server instance +; must have a different id; the default id is 1 +id=1 + +; The IP address servatrice will listen on for clients; defaults to "any" to listen on all the interfaces, +; a specific IPv4/v6 addresses can be used, eg for localhost-only 127.0.0.1 for IPv4 or ::1 for IPv6. + +host=any + +; The TCP port number Servatrice will listen on for clients; default is 4747; +; Will be removed in the future, use websocket connection instead +port=4747 + +; Servatrice can scale up to serve big number of users using more than one parallel thread of execution; +; If your server is hosting a lot of players and they frequently report of being unable to login or +; long delays (lag), you may want to try increasing this value; default is 1. +; Set to 0 to disable the tcp server. +number_pools=1 + +; Servatrice can listen for clients on websockets, too. Multiple connection pools are available but +; unfortunately, due to a Qt limitation, they must run in the same execution thread. +; Set to 0 to disable the websocket server. +websocket_number_pools=1 + +; The IP address servatrice will listen on for websockets clients; defaults to "any" +websocket_host=any + +; The TCP port number servatrice will listen on for websockets clients; default is 4748 +websocket_port=4748 + +; When database is enabled, servatrice writes the server status in the "update" database table; this +; setting defines every how many milliseconds servatrice will update its status; default is 15000 (15 secs) +statusupdate=15000 + +; Do you want servatrice to write important events and errors to a logfile? Default is 1 (yes). +writelog=1 + +; Choose a name for the log file, if enabled; you can specify an absolute path or a path relative to +; the servatrice executable; the default file name is server.log (in the same path as servatrice) +; Note: When running servatrice under windows you will need to use double backslashes between folder locations +; [ex: C:\\Temp\\server.log ] +logfile=server.log + +; You may want to log only certain messages in the logfile. The default log level is extremely verbose. +; This setting should contain a comma-separated list of strings that will be selectively logged. +; All other lines will be excluded from the log. Default is empty; example: "Registration,_Login,foobar" +logfilters="" + +; Set the time interval in seconds that servatrice will use to communicate with each connected client +; to verify the client has not timed out. Defaults is 1 seconds +clientkeepalive=1 + +; Maximum time in seconds a player can stay inactive with there client not even responding to pings, before is +; considered disconnected; default is 15 +max_player_inactivity_time=15 + +; More modern clients generate client IDs based on specific client side information. Enable this option to +; require that clients report the client ID in order to log into the server. Default is false +requireclientid=false + +; You can limit the types of clients that connect to the server by requiring different features be available +; on the client. This setting can contain a comma-seperated list of features. if any of the features +; listed in this line are not available on the client the client will be denied access to the server upon +; attempting to log in. Example: "client_id,client_ver,websocket" +requiredfeatures="" + +; You can define custom warnings that users are sent when the moderation staff uses the right client warn user +; menu option. This list is comma seperated that each item will appear in the drop down list for staff members +; to choose from. Example: "Flaming,Foul Language" +officialwarnings="Flaming,Spamming,Causing Drama,Abusive Language" + +; Maximum time in seconds a player can stay connected but idle. Default is 3600 (0 = disabled) +; Clients will be notified at the 90% time period of pending disconnection if they do not take action. +idleclienttimeout=3600 + +[authentication] + +; Servatrice can authenticate users connecting. It currently supports 3 different authentication methods: +; * none: no authentication, accept every user; +; * password: require users to specify a common password to log in; +; * sql: authenticate users against the "users" table of the database; +; Please note that only the "sql" method permits to have registered users and store their data on the server. +method=password + +; if the chosen authentication method is password, here you can define the password your users will use to log in +password="__RESTORE_AUTHENTICATION_PASSWORD__" + +; Accept only registered users? default is false (accept unregistered users) +regonly=false + +[users] + +; The minimum length a username can be +minnamelength=2 + +; The maximum length a username can be +maxnamelength=22 + +; If a username should be allowed to contain lowercase chars [a-z] +allowlowercase=true + +; If a username should be allowed to conatain uppercase chars [A-Z] +allowuppercase=true + +; If a username should be allowed to contain numbers [0-9] +allownumerics=true + +; Define punctuation allowed in usernames +allowedpunctuation=_.- + +; If a username can begin with punctuation defined in allowedpunctuation +allowpunctuationprefix=false + +; Disallow usernames containing these words. This list is comma seperated, e.g. +; "admin,user,name" +disallowedwords="admin" + +; Overwrite the words shown to the user when they enter a wrong username, +; use \n to start a new line. Neither the real wordlist nor the disallowed +; expressions will be sent to the user if this is set. +; In the old versions of the client this list will be prefaced with +; "can not contain any of the following words:" +; example: +;displaydisallowedwords="no attempts at impersonating staff\nno unparliamentary language\nno references to controversial figures\nstaff reserves the right to remove accounts deemed inappropriate" +; Setting it to nothing will simply hide the list: +;displaydisallowedwords= + +; Disallow usernames matching these regular expressions. This list is comma +; separated, e.g. "\\w+\\d+,\\d{2}user", hence you cannot use commas in your +; expressions. Backslashes must be escaped, so `\w+\d+` becomes `\\w+\\d+`. +; WARNING: Complex expressions can be harmful to performance. Please make sure +; your expressions are considered well formed. See this page for info: +; http://www.regular-expressions.info/catastrophic.html +disallowedregexp="" + +; Define minimum password length +; Default 6. +minpasswordlength = 4 + +[registration] + +; Servatrice can process registration requests to add new users on the fly. +; Enable this feature? Default false. +;enabled=false + +; Require users to provide an email address in order to register. Default true. +;requireemail=true + +; Require email activation. Newly registered users will receive an activation token by email, +; and will be required to input back this token on cockatrice at the first login to get their +; account activated. Default true. +;requireemailactivation=true + +; Set this number to the maximum number of accounts any one user can use to create new accounts +; using the same email address. 0 = Unlimited number of accounts (default). +;maxaccountsperemail=0 + +; You can prevent users from using certain mail domains for registration. This setting contains a +; comma-seperated list of email provider domains that you would like to prevent users from using +; during registration. Comparison's are implicit, so placing an entry such as mail.com will also +; prevent users from registering accounts with providers such as gmail.com and hotmail.com +; Example: "10minutemail.com,gmail.com" +;emailproviderblacklist="" + +; You can require users to only use certain email domains for registration. This setting is a +; comma-separated list of email provider domains that you have explicitly audited and require +; the use of in order to create an account. Comparison's are explicit, so you must specify the +; domain in completion, such as gmail.com and hotmail.com. Email whitelist is checked before +; Email blacklist is checked, so an email cannot be in both setting configurations. +; Example: "gmail.com,hotmail.com,icloud.com" +;emailproviderwhitelist="" + +[forgotpassword] + +; Servatrice can process reset password requests allowing users to reset their account +; passwords in the event they forget it. Should this feature be enabled? Default: false. +; enable=false + +; Reset password request should not be allowed to stay valid forever. This settings +; informs servatrice how long a players reset password reset token is valid for (in minutes). +; Default: 60 +; tokenlife=60 + +; Servatrice can challenge users that are making reset password requests to answer +; questions in regards to their account to help validate they are the true owner of the account. +; Should this feature be enabled? Default: false +; enablechallenge=false + +; Email subject for the reset password emails +; subject="Cockatrice reset password token" + +; Reset password email body. You can use these tags here: %username %token +; They will be substituted with the actual values in the email +; +; body="Hi %username,\r\nthanks for reaching out to us with your password reset request for our Cockatrice server.\r\nHere's your unique token in order to reset your account password in the app:\r\n\r\n%token\r\n\r\nHappy gaming!" + + +[smtp] + +; Enable the internal smtp client to send registration emails. If you would like to +; use some other method to send email activation tokens set this value to false. Otherwise +; setting it to true (default) the server will send canned generated emails containing +; activation tokens for you during update intervals. Setting this to false will require +; you to either manually activate user accounts or manually send users the activation token +; by whatever means. +enableinternalsmtpclient=true + +; Connectin type: currently supported method are "tcp" and "ssl"; tls is autodetected if available +connection=tcp + +; Accept all certificates: in ssl mode, enable this if your server is using an invalid/self signed certificate +acceptallcerts=false; + +; Hostname or IP addres of the smtp server +host=localhost + +; Smtp port number of the smtp server. Usual values are 25 or 587 for tcp, 465 for ssl +port=25 + +; Username: this typically matches the "from" email address +username=root@localhost + +; Password for the username +password="__RESTORE_SMTP_PASSWORD__" + +; Sender email address: the "from" email address +email=root@localhost + +; Sender email name +name="Cockatrice server" + +; Email subject +subject="Cockatrice server account activation token" + +; Email body. You can use these tags here: %username %token +; They will be substituted with the actual values in the email +; +body="Hi %username, thank our for registering on our Cockatrice server\r\nHere's the activation token you need to supply for activating your account:\r\n\r\n%token\r\n\r\nHappy gaming!" + +[database] + +; Database type. Valid values are: +; * none: no database; +; * mysql: mysql or compatible database; +type=none + +; Prefix used in he database for table names; default is cockatrice +prefix=cockatrice + +; Database connection parameter: server hostname or IP +hostname=localhost + +; Database connection parameter: database name +database=servatrice + +; Database connection parameter: database user +user=servatrice + +; Database connection parameter: database user's password +password="__RESTORE_DATABASE_PASSWORD__" + +[rooms] + +; A servatrice server can expose to the users different "rooms" to chat and create games. Rooms can be defined +; with two different methods: +; config: rooms are defined in this configuration (see the following example) +; sql: rooms are defined in the "rooms" table of the database +method=config + +; Example configuration for a server with rooms configured in the configuration file. Number of rooms defined +roomlist\size=1 + +; Room name for the room number 1 +roomlist\1\name="La roume générale" + +; Room description for the room number 1 +roomlist\1\description="Play anything here." + +; Rooms can restrict the level of user that can join. Current supported options are none, registered, moderator, administrator. +; Default is none. +roomlist\1\permissionlevel=none + +; Rooms can restrict the permission level of users that can join, Currnetly supported options are none, privileged, vip, and donator. +; Default is none. +roomlist\1\privilegelevel=none + +; Wether to make users autojoin this room when connected to the server +roomlist\1\autojoin=true + +; Message displayed to each user when he joins room number 1 +roomlist\1\joinmessage="This message is only here to show that rooms can have a join message." + +; The number of chat history messages to save that gets presented to a user joining the room +roomlist\1\chathistorysize=100 + +; Number of game types allowed (defined) in the room number 1 +roomlist\1\game_types\size=3 + +; Name of the three game types for the room number 1 +roomlist\1\game_types\1\name="GameType1" +roomlist\1\game_types\2\name="GameType2" +roomlist\1\game_types\3\name="GameType3" + + +[game] + +; Maximum time in seconds all players in a game can stay inactive before the game is automatically closed; +; default is 120 +max_game_inactivity_time=120 + +; All actions during a game are recorded and stored in the database as a replay that all participants of +; the game can go back to and review after the game is closed. This can require a fairly large amount of +; storage to save all the information. Disable this option to prevent the storing of replay data in +; the database. Default value is true. +store_replays=true + +; Allow users to create a new game and join it as a judge. The host will be able to execute any action on +; the cards of every player. This is needed in order to support some games (eg. Werewolf). +; Default off to prevent abuse on servers that are mostly running other games. +allow_create_as_judge=false + +[security] +; You may want to restrict the number of users that can connect to your server at any given time. +enable_max_user_limit=false + +; Maximum number of users that can connect to the server, default is 500. +max_users_total=500 + +; Maximum number of users that can connect to the server using a tcp connection, default is 500. +max_users_tcp=500 + +; Maximum number of users that can connect to the server using a websocket connection, default is 500. +max_users_websocket=500 + +; Maximum number of users that can connect from the same IP address; useful to avoid bots, default is 4 +max_users_per_address=22 + +; You may want to allow an unlimited number of users from a trusted source. This setting can contain a +; comma-separed list of IP addresses which will allow an unlimited number of connections from each of the +; IP addresses listed (ignoring the max_users_per_address). Default is "127.0.0.1,::1"; example: "192.73.233.244,81.4.100.74" +trusted_sources="127.0.0.1,::1" + +; Servatrice can avoid users from flooding rooms with large number of messages in an interval of time. +; This setting defines the length in seconds of the considered interval; default is 10 +message_counting_interval=10 + +; Maximum size in characters of all messages in an interval before new messages gets dropped; default is 1000 +max_message_size_per_interval=1000 + +; Maximum number of messages in an interval before new messages gets dropped; default is 10 +max_message_count_per_interval=10 + +; Maximum number of games a single user can create; default is 5; set to -1 to disable; 0 disallows game creation +max_games_per_user=5 + +; Servatrice can avoid users from flooding games with large number of game commands in an interval of time. +; This setting defines the length in seconds of the considered interval; default is 10 +command_counting_interval=10 + +; Maximum number of game commands in an interval before new commands gets dropped; default is 20 +max_command_count_per_interval=20 + +[logging] +; Admin/Moderators can query the stored logs for information when looking up reports by various players. This +; option can allow or disallow them from doing so. +; !!NOTE!! Enabling this feature puts a very high CPU and DISK load on the server, enable with caution. +enablelogquery=false + +; Servatrice can log user messages to the database table cockatrice_log. +; These messages can come from different sources; each source can be enabled separately. + +; Log user messages inside chat rooms +log_user_msg_room=false + +; Log user messages inside games +log_user_msg_game=false + +; Log user messages in private chats +log_user_msg_chat=false + +; Log user messages coming from other servers in the network +log_user_msg_isl=false + +[audit] + +; Servatrice can record certain actions being performed in the database for server operators to better understand +; if some one may be abusing application functionality. Enabling auditing will allow servatrice to record any +; of the below enabled audit functionality to be recorded. +; Default: true +enable_audit=true + +; Servatrice can record when users attempt a new account registration. Should we enable auditing for this action? +; Default: true +enable_registration_audit=true + +; Servatrice can record when a users attempts to reset the account password. Should we enable auditing for this action? +; Default: true +enable_forgotpassword_audit=true + + +; EXPERIMENTAL - NOT WORKING YET +; The following settings are relative to the server network functionality, that is not yet complete. +; Avoid enabling it unless you are willing to test it and help its development. + +[servernetwork] + +; Servatrice servers can connect themselves and build a network. This settins enable the ability of servatrice +; of waiting for other server's connections and connect to other servers. Other servers can be defined in the +; "servers" table of the database. Default is 0 (disabled) +active=0 + +; The TCP port number Servatrice will listen on for other servers; default is 14747 +port=14747 + +; Server-to-server communication needs a valid certificate in PEM format. Enter its filename in this setting +ssl_cert=ssl_cert.pem + +; Filename of the private key for the server-to-server certificate +ssl_key=ssl_key.pem