* Log telemetry connections in DB (#63435)
About The Pull Request
Logs tgui telemetry connections into the database. Useful since they are normally capped to 5.
Does not change the fact that the "banned account in connection history" part is still based on your history at that time. I figured it could potentially be very slow to go through your entire database history.
* Fix IPs in telemetry_connections not being unsigned (#63573)
About The Pull Request
Fixes IPs not being unsigned, causing problems where they get capped if the IP is too big.
Not tested.
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
* Allows players to send more visible adminhelps when no admins are on, which'll definitely alert admins
* db portion sorted out
* now it really is
* should work about fine
* one last touch
* well, one more
* also botched comment
Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
* Better accomodation of multiple servers using the same database.
* updated the PR number in readme.md
* Updated the database_changelog description.
* Oopsie.
* Cosmetic touch and sql query fixes.
* Opsie wopsie
* Oopsie x2
* Fugg
* Fix sql changelog (#57972)
Fixed bad SQL that I originally wrote in the changelog for 5.11, anyone trying to update their schema from < 5.11 up would notice this.
* Fix sql changelog
Co-authored-by: Bobbahbrown <bobbahbrown@gmail.com>
* Added the SQL logging.. waf
* I dont know why CI does not like my sql......
* I think i fixed the sql....
* Attempt #1 to make linter happy
* Shhh linter, it will be over soon
Just breath into this cloth... ignore the chloroform smell.
(Add a Preprocesser statement, to make the SpacemanDMM linter ignore the SQL code in a mob atom obj, that causes it to trigger its hard coded test for stoplag.
This only does not trigger on other SQL, as there is hard coded exception in SpacemanDMM that ignores the other objects. the better fix would be to update SpacemanDMM to add this into the exclusion. but this change at least allows the PR to be merged finally)
Co-authored-by: MissFox <github@aesir.org.uk>
* Sets the charset and collation for the SQL schema to utf8mb4 (#56060)
Changes the charset and collation in the SQL schema to utf8mb4 (which is default in ubuntu 20.04 and debian 10 for MariaDB). This solves all the problems with russian or other non-latin1 characters in many cases related to the use of the database, because surprisingly the rest is already ready for such use cases.
I am not adding any SQL script to migrate from latin1 to utf8mb4, as this is an extremely destructive action. It must be performed manually with the data of all tables backed up before doing so.
However, this can be done by using the following queries, one time for database:
ALTER DATABASE databse_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
and one for each table:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
* Sets the charset and collation for the SQL schema to utf8mb4
Co-authored-by: Vladimir Veisman <v.veisman@fl45h13.me>
* SQL Schema Version 5.11 / Add indices for ticket table to support Statbus operations (#53541)
* I hope you're proud of yourselves. You've driven away another customer! It's baffling, I tell you! Your deep rooted lack of self-control only fosters failure in every endeavor we undertake! I mean, it's always one step forward and two steps back! Why? Don't you see the example I try to set for you?
* thanks jordie
* SQL Schema Version 5.11 / Add indices for ticket table to support Statbus operations
Co-authored-by: Bobbahbrown <bobbahbrown@gmail.com>
* Overhauls discord verification system (#53289)
This completely replaces the previous verification system, for one that
will interoperate with a discord redbot instance that uses the cogs
located at you github.com/optimumtact/orangescogs
This cuts out several steps in the system, but it also leaves alone the
existing notify system (which just uses a file list of discord ids) as a
record of who to notify
SQL changes required for the new database system
Version 5.10, 7 August 2020, by oranges
Changes how the discord verification process works.
Adds the discord_links table, and migrates discord id entries from
player table to the discord links table in a once off operation and then
removes the discord id on the player table
The user connects to any tg server, and uses the "Verify Discord
Account" verb, this generates a six word one time use token, with a 4
hour time validity period (defined as 4 hours from the timestamp value)
in the discord links table.
This one time token, and the ckey of the user are stored in
discord_links
At this point the entire DM side is done, this is all it does
* Overhauls discord verification system
Co-authored-by: oranges <email@oranges.net.nz>
An almost complete rework of how creating polls, their data and voting on them is handled.
Instead of repeatedly querying for poll data, running polls are loaded at runtime into poll_question and poll_option datums that stores all the needed variables for both. This datum is then used for creating, editing and accessing poll data. The database is only contacted when saving changes or votes.
Creating polls and options is now done with a html window instead of a series of popups akin to how the banning panel works. The form data is parsed and error-checked before passing to be saved.
This is done in two stages, first time a poll's details are entered and it must be initialized (created as a datum) before options can be added and all of both are saved to the database. Instructions about how this work are shown on the poll creation window.
A new field for polls has been added, subtitles, which is text only shown when a poll is opened by a player instead of on the list of polls. Intended so the actual question text can be kept to only a name and important information about a poll goes in a subtitle.
All polls can now have revoting enabled on them.
Polls can have a starting datetime specified, this can be in the past but why would you do that?
Polls and options can be edited once created, excluding the type of a poll. Doing so will by default clear all existing poll votes. Votes can also be cleared by a button.
The handling of how votes are processed has been adapted for the datum system but is on the whole not functionally that different aside from poll validation not being roughly copypasted across each poll type's vote proc
All poll tables now have a deleted column for retaining 'deleted' data.
poll_question has also gained the columns created_datetime, subtitle, allow_revoting, their function explained above, and a change of idx_pquest_time_admin to idx_pquest_time_deleted_id.
A stored procedure set_poll_deleted has been added. This is called when setting a poll as deleted to avoid needing 4 separate queries from the server or one fairly long 4-way joined
Create Poll verb is renamed to Server Poll Management
It came up that this isn't recorded, only logged.
Technically needs syncing merge with schema change but only deleting notes would break from this and tbh that isn't done very often so I think it'd be fine to yolo.
* DB ticket procs
* Schema changes for DB tickets
* Schema version update
* Fixes requested by Jordie
* SQL updates
Adds a recipient column
* Still one dangling issue where this DOESN'T WORK
* Alright, this should work
* Requested SQL fixes
* Rogue changes
* less bad defaults
* utf8 for the utf8 gods
* aaaaaa
* Update tgstation_schema_prefixed.sql
* Update tgstation_schema.sql
* Update database_changelog.txt
Co-authored-by: Jordie <4343468+Jordie0608@users.noreply.github.com>
Drops byond hub support and adds score and top 50 browsers.
Requires DB changes and manual creation of migration script if we want to keep old achievements so no random merges please.
* Notify System
* V2
* Adds a hint
* Stoned fixes round 1
* Use grammar wells I can
* This didnt work
* I wish you could test on TGS without committing
* Jordie fixes round 1
* oops
* This took way longer than it should have taken
* Adds in endnotify for serverops
* Spacing
Supports disabling stickybans for a round, exempting a key from matching a stickyban, and it now also detects rogue stickybans before anybody currently connected even gets disconnected. (new matches trigger a 5 second sleep and abort enforcement if enough other new matches happen in that timeframe)
Spiritual successor and extension to #17798, an almost entire rebuild of the SQL ban system backend and interface.
Bantypes are removed per #8584 and #6174. All bans are now 'role bans', server bans are when a ban's role is server. Admin bans are a column, meaning it's possible to ban admins from jobs.
Bans now have only an expiry datetime, duration is calculated from this when queried.
unbanned column is removed as it's superfluous, checking unban status is now done through checking unban_datetime. unban_round_id column added. Each ip and computerid columns rearranged so ip is always first, like in other tables. Bans now permit a null ckey, ip and computerid.
Ban checking is split into two procs now is_banned_from() does a check if a ckey is banned from one or more roles and returns true or false. This effectively replaces jobban_isbanned() used in simple if() statements. If connected a client's ban cache is checked rather than querying the DB. This makes it possible for a client connected to two or more servers to ignore any bans made on one server until their ban cache is rebuilt on the others. Could be avoided with cross-server calls to update ban caches or just the removal of the ban cache but as is I've done neither since I think it's enough of an edge case to not be worth it.
The second proc is is_banned_from_with_details(), this queries the DB for a role ban on a player's ckey, ip or CID and returns the details. This replaces direct queries in IsBanned.dm and the preferences menu.
The legacy ban system is removed.
The interfaces for banning, unbanning and editing bans have been remade to require less clicking and easier simultaneous operations. The banning and jobban panel are combined. They also store player connection details when opened so a client disconnecting no longer stops a ban being placed.
New banning panel:
Key, IP and CID can all be toggled to allow excluding them from a ban.
Checking Use IP and CID from last connection lets you enter only a ckey and have the DB fill these fields in for you, if possible.
Temporary bans have a drop-menu which lets you select between seconds, minutes, hours, days, weeks, months and years so you don't need to calculate how many minutes a long ban would be. The ban is still converted into minutes on the DB however.
Checking any of the head roles will check both of the boxes for you.
The red role box indicates there is already a ban on that role for this ckey. You can apply additional role bans to stack them.
New unbanning panel:
Unbanning panel is now separate from the banning panel but otherwise functionally the same.
Ban editing panel:
Actually just a modified banning panel, all the features from it work the same here.
You can now edit almost all parameters of a ban instead of just the reason.
You can't edit severity as it's not really part of the ban.
The panels have been tested but I've not been able to get my local server to be accessible so ban functionality isn't properly confirmed. Plenty of testing will be required as I'd rather not break bans.
cl
admin: Ban interface rework. The banning and unbanning panels have received a new design which is easier to use and allows multiple role bans to be made at once.
prefix: Ban search and unbanning moved to unbanning panel, which is now a separate panel to the old banning panel.
/cl
* Adds note_severity and updates dbconfig. New SQL stuff too.
* whoops please don't hack into my database >:^(
* UI change, changed how it's stored in the DB, removed some queries when it returns, changed stuff to key.
* Update sql_message_system.dm
* this was not defined
* random indent
* wait how did this get here
* okay enough web edits I promise
* just kidding I got u
* Update common.css
* Added buttons, changed UI again, standardized the inputs, added severity for appearance bans, fed the dog
* forgot about the banning panel
* added an asset cache
* corrects asset datum var name
Fixes a breaking error and possible injection exploit in
populate_key_2018-07-09.py caused by a key existing from when byond allowed now
blocked characters like ' in usernames e.g.
http://www.byond.com/members/immortaljrosh?format=text
Additionally fixes some unsanitized values in other queries.
* converts to using key instead of ckey for user facing logs and ui
* more key_name for airlock wires
* futureproofing check for if key changes
* --onlyckeymatch script argument and fail/success counter
* fix
* Adds SQL to travis
* See if we can get this working
* :dab:
* Try dis
* wew
* Try this?
* Should do it
* DL the biatch
* oof
* bruh
* json in 10.2
* Fix schemas
* Actually separate tools and byond builds
* Dedent the ting
* Needs more include
* Fix script logic
* Caching and fixups
* Jesus neer
* Fix this
* And this
* Fix things
* Oh that's why she did it here
* Fuck a duck
* yadayadayada
* Cache cargo in the right build
* Idiot.commit
* *sighs*
* Tools build doesn't need BYOND cache
* Create a database with the prefixed schema as well
* Fix prefixed trigger names
For planned change to how TGS initializes server instances ahead of time so rounds aren't tracked as being far longer than they really would be. Similarly end time split for a more accurate round duration.
* updates sqladmins with excluded flags and tempminning
* rank, editing and permission protections; json backup
* fixes
* reverted the wrong file
* fix slidecolor cascading and disabled switches not being sent in form
* removes debug uncommenting
* whoops this too
* commas fix + versions for changelog entry headers since 3.0
* actually account for can_edit_flags and use of @ with - or *
* fixes and rearrangement of admin > localhost > autoadmin precedence
* in case you want to not have autologin autoadmins
* wip
* wip2
* makes code actually compile on 511 + fixes
* versioning
* s
* adds python conversion script, schema change and removes 'force ' from item_used_for_combat
* fix to compile
* forgot to actually commit this
Player Notes can now fade out over time so admins don't accidentally ban players for 4 year old notes
Deleted messages now remain in the database and are instead just hidden from view.
Two things relating to messages I've been meaning to do for ever.