101 Commits

Author SHA1 Message Date
Pancakes
5480c2ee72
Remove isInLocalDb flag, start dumping saves into S3 2024-10-29 21:26:10 -04:00
Pancakes
ad8fa03503
Migrate all local accounts 2024-10-29 21:18:38 -04:00
Pancakes
e432d64acb
Emergency fix, read/write saves to S3 from now on 2024-10-29 21:15:10 -04:00
Opaque02
c2af4a07e9
Made changes to server to allow admin panel to retrieve last activity instead of last logged in date (#58)
* Made changes to server to allow admin panel to retrieve last activity instead of last logged in date

* Added TODO comment for lastLoggedIn json result

* Updated variable names as per Pancake's comments
2024-10-27 21:25:46 -04:00
Pancakes
ea4ba75c93
Use AND in SQL query instead of && 2024-10-23 08:28:40 -04:00
Pancakes
a1263e66c6
Clean up RetrieveSystemSaveFromS3 2024-10-23 05:23:48 -04:00
Pancakes
c09d277678
Change more stuff 2024-10-22 16:12:16 -04:00
Pancakes
00e783ff8a
Styling fixes 2024-10-22 15:50:01 -04:00
Frederico Santos
ac360ccb1c
Cold storage (#57)
* feat: Implement S3 integration for system save data migration and retrieval

* feat: Refactor system save data handling to use JSON and improve error logging

* feat: Update S3 migration schedule to hourly and limit old account retrieval to 3000 records

* fix: Clean up S3 migration code by removing unnecessary blank lines and improving logging messages
2024-10-16 20:36:55 -04:00
Opaque02
430496941c
Admin panel upgrade server updates (#54)
* Changes for testing

* Updating server code to allow unlinking discord IDs as needed

* Fixed some debug issues commented out code

* Updating server to allow updated admin panel functionality

* Updated some commentted out code

* Updated missed /

* Updated to allow for a single query to the db with multiple columns, and a conversion to allow string outputs instead of sql.NullStrings

* Deleted .bak files and .vs folder as per Walker's discord message

* Added logic to check server to make sure usename exists for discord linking and unlinking

* Changes to allow linking and unlinking of google Id from DB

* Removed .vs folder

* Reverted dev code

* PR comments

* Updates from Pancake's comments
2024-10-16 20:36:44 -04:00
Frederico Santos
8e20875453
feat: Add admin Discord link endpoint (#49)
* feat: Add admin Discord link endpoint

* feat: Add Discord Guild ID flag to server configuration

* feat: Add logging for Discord ID addition in admin Discord link endpoint

* chore: Update variable name for Discord guild ID in account package

* chore: Add logging for Discord ID addition in admin Discord link endpoint

* chore: Add admin Discord link endpoint

* chore: Add logging for Discord ID addition in admin Discord link endpoint

* chore: Remove unnecessary code in handleAdminDiscordLink function

* chore: Update logging format in handleAdminDiscordLink function

* chore: Refactor handleAdminDiscordLink function for improved logging

* chore: Update Discord Bot Token and Discord Guild ID flags in server configuration

* chore: Refactor handleAccountInfo function for improved readability and error handling

* chore: Update server configuration flags for Discord Bot Token and Guild ID

* Refactor handleAdminDiscordLink function for improved error handling and logging

* feat: Add "Helper" role to Discord admin check for enhanced access control
2024-09-13 22:32:49 -04:00
Pancakes
8ac507d2d5
Don't use best compression encoder level for zstandard 2024-08-20 17:18:15 -04:00
Pancakes
a7d5f60d5f
Add new compression code 2024-08-15 18:48:47 -04:00
Frederico Santos
fa57f5997f
Added support for Discord OAuth2 (#25)
* Need a login check

* chore: Add Discord OAuth2 authentication endpoint

chore: Update dependencies and clean up code

chore: Update dependencies, add Discord OAuth2 authentication endpoint, and clean up code

chore: Update dependencies, add Google OAuth2 authentication endpoint, and clean up code

Code clean up

uniqueness on external account id

chore: Add Discord and Google OAuth2 authentication endpoints, and update dependencies

code review fixes

* chore: Update prodHandler to use clienturl flag for Access-Control-Allow-Origin

* chore: Refactor FetchDiscordIdByUsername and FetchGoogleIdByUsername to handle null values

* chore: Set secure and same-site attributes for session cookie

* chore: Set session cookie expiration to 3 months

* Update callback URL for Oauth2 client in docker-compose and rogueserver.go

* Update callback URL for Oauth2 client in docker-compose and rogueserver.go

---------

Co-authored-by: Matthew Olker <matthew.olker@gmail.com>
2024-07-27 18:41:44 -04:00
Frederico Santos
4cac6b6ce8
Update SaveData to handle session and system out of date overwrites (#43)
* chore: Update savedata API to handle session out of date errors

* chore: Handle session out of date errors in savedata API

* chore: Handle session out of date errors in savedata API

* chore: Update savedata API to handle session out of date errors
2024-06-22 17:28:14 -04:00
Pancakes
dd00d90211
Remove voucher compensation code 2024-06-22 16:10:35 -04:00
Pancakes
048db67609
Remove timestamp guard 2024-06-06 03:45:59 -04:00
Pancakes
9efd1b751a
Update StoreSystemSaveData 2024-06-05 23:01:12 -04:00
Frederico Santos
52c5c9ee6c
Reject saves with 2 days difference (#29)
* Reject saves with 2 days difference

* improved timestamp checks

* chore: Refactor timestamp checks for saving system data

* Refactor timestamp checks for saving system data
2024-06-05 22:56:29 -04:00
Frederico Santos
87e8f00cd6
Refactor saving session and system data to prevent saving older saves on previous waves (#26)
* chore: Refactor saving session data to prevent saving older sessions

* chore: Refactor saving system data to prevent saving older sessions

* Refactor saving session and system data to prevent saving older versions
2024-06-02 17:13:54 -04:00
maru
476e667572
More cleanup 2024-05-24 01:47:36 -04:00
maru
c76746ad35
Replace REPLACE INTO usage 2024-05-24 01:41:50 -04:00
maru
3489ae91bf
Change max connections code again 2024-05-24 01:32:33 -04:00
maru
15a32c0e23
Various cleanup 2024-05-23 14:15:44 -04:00
maru
4cc2d3431c
Set conns value to 128 2024-05-23 13:18:37 -04:00
maru
1441d47694
Remove legacy save migration code 2024-05-21 17:53:28 -04:00
maru
7bfd9dfba7
Fix code 2024-05-21 01:48:07 -04:00
maru
fc458fad73
Revert "Remove anti cheat"
This reverts commit 512a24e5c3b1a51045a91acd9049c64266cc6d64.
2024-05-21 01:39:07 -04:00
Flashfyre
df92ff8b6f Add last activity update on verify 2024-05-15 13:37:36 -04:00
Up
f31f130c14
also check for empty 2024-05-15 06:47:06 +02:00
Up
c17c583321
update active session if none is found 2024-05-15 06:46:08 +02:00
Up
a063b1740c
add missing foreign key declarations 2024-05-15 04:12:20 +02:00
Up
e2efcd550c
fix faulty sql query 2024-05-14 23:17:14 +02:00
Up
834d1e62a0
add foreign key constraint on client session table 2024-05-14 14:33:53 +02:00
Up
c0aade2e65
simplify ID handling 2024-05-14 14:30:04 +02:00
Up
436fce8759
add client session ID tokens 2024-05-14 12:54:06 +02:00
Up
5d6bfe0c22
add accounts activity index 2024-05-12 05:12:46 +02:00
Krystian Chmura
03865f9b94
run golangci-lint in CI 2024-05-11 14:41:25 +02:00
maru
36f353b8a6
Clean up db.go 2024-05-11 02:30:20 -04:00
maru
5656fb96d1
Use log.Fatal isntead of panic 2024-05-11 02:24:20 -04:00
Flashfyre
2704e64e38 Add newclear endpoint 2024-05-10 18:07:14 -04:00
maru
693663103b
Run formatter on files 2024-05-10 15:49:26 -04:00
maru
b5e8094039
Don't return INVALID on seed-related function error 2024-05-10 15:44:35 -04:00
Up
3ed5f41d58
make server automatically create DB schema if not exists (#5)
* add default values for CLI args

* add development docker compose file

* prevent crash if userdata dir does not exist

* accounts, acccountStats

* account stats and create db indices

* compensations and daily runs

* ensure uniqueness of daily seed

* start on port 8001 by default for client parity

* make generated schema match production

* sort imports
2024-05-10 15:30:47 -04:00
maru
e4de7c2391
Update database limiting code more 2024-05-09 14:22:20 -04:00
maru
de0bd74dc2
Update database limits 2024-05-09 14:13:19 -04:00
maru
59ea469fb6
Don't import legacy saves if system exists in database 2024-05-09 05:59:48 -04:00
maru
4971ad9d42
Add new database limits 2024-05-08 20:19:33 -04:00
maru
7dbcb18ebf
Use INSERT instead of REPLACE for savedata storage functions 2024-05-08 17:23:07 -04:00
maru
6cb179b553
Clean up savedata.go 2024-05-07 20:38:12 -04:00