Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Refactor server database #6263

Draft
wants to merge 255 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
255 commits
Select commit Hold shift + click to select a range
41a1c84
Add support for auto incremented primary keys
Krzmbrzl May 25, 2022
62c0ee1
Add support for composite keys
Krzmbrzl May 26, 2022
29416e7
Finished implementation of composite foreign keys
Krzmbrzl May 31, 2022
2fac2d5
Add notes about existing tables
Krzmbrzl Jun 1, 2022
c0b9004
Introduce TEXT datatype
Krzmbrzl Jun 7, 2022
1c97a81
Finish table list
Krzmbrzl Jun 7, 2022
5ffd701
Add data type for timestamps
Krzmbrzl Jun 7, 2022
a319014
Add BLOB datatype
Krzmbrzl Jun 7, 2022
bbae52e
BUILD(server): Use object library
Krzmbrzl Jun 8, 2022
d32dcff
Make sure the DB init happens in a transaction
Krzmbrzl Jun 8, 2022
abaedfc
Adapt migration strategy to allow for table deletions
Krzmbrzl Jun 8, 2022
a288c79
Start mapping out actual server DB
Krzmbrzl Jun 8, 2022
5056682
BUILD(cmake): Remove necessity for special use_test macro
Krzmbrzl Jun 9, 2022
f49c78a
Avoid linker errors when linking against mumble_server_object_lib
Krzmbrzl Jun 16, 2022
817d7eb
Ensure that the object lib is linked to the server DB
Krzmbrzl Jun 16, 2022
0616f05
Ensure that DB lib is publicly linked
Krzmbrzl Jun 16, 2022
2e8c1e9
Format code
Krzmbrzl Jun 16, 2022
2e46906
Setup tests for server DB impl
Krzmbrzl Jun 16, 2022
232f1bb
Wrapped DB access in transactions
Krzmbrzl Jun 16, 2022
e4c9d5d
Add LogTable
Krzmbrzl Jun 16, 2022
f12fc98
Fixed/Added table migration code
Krzmbrzl Jun 16, 2022
bd74925
Added comments about transaction requirements
Krzmbrzl Jun 16, 2022
35205b4
Start implementing ConfigTable
Krzmbrzl Jun 16, 2022
0da220c
Add ability to query all existing tables
Krzmbrzl Jun 21, 2022
5e7a5a0
Rework how migration process works
Krzmbrzl Jun 22, 2022
aaa0b39
Fix migration code paths
Krzmbrzl Jun 26, 2022
f67b442
Implement config table utility functions
Krzmbrzl Jun 26, 2022
01ff5f3
Added tests for ConfigTable
Krzmbrzl Jun 29, 2022
ad936d8
Fix tables with self-referencing foreign key not getting deleted
Krzmbrzl Jun 30, 2022
914482e
Implemented ChannelTable
Krzmbrzl Jun 30, 2022
3fd1779
Fix broken unity build
Krzmbrzl Jun 30, 2022
ee2ec0b
Add migration code for ChannelTable
Krzmbrzl Jul 2, 2022
c60b88b
ServerTable: Always use transaction when adding server
Krzmbrzl Jul 2, 2022
0b236ec
Fix MySQL issue with auto-increment cols
Krzmbrzl Jul 2, 2022
3cc2ba0
Started implementing ChannelPropertyTable
Krzmbrzl Jul 2, 2022
b3973d1
Upload StringConverter
Krzmbrzl Jul 5, 2022
691a19b
Added tests for ChannelPropertyTable
Krzmbrzl Jul 5, 2022
288329a
Add unique index
Krzmbrzl Jul 5, 2022
32900d8
Fix test failure on old Qt versions
Krzmbrzl Jul 5, 2022
f009ac5
Added design for UserTable
Krzmbrzl Jul 5, 2022
d1e04a5
Don't duplicate constant for root channel ID
Krzmbrzl Sep 13, 2022
407b414
Move ID constants to MumbleConstants
Krzmbrzl Sep 13, 2022
e07c748
Increment new scheme version
Krzmbrzl Sep 14, 2022
8b245b5
Move column in corresponding class namespace (and make it public)
Krzmbrzl Sep 15, 2022
628ba8c
Add function to report errors inside triggers
Krzmbrzl Sep 15, 2022
b3efa3c
Fix typo in cmake option
Krzmbrzl Sep 15, 2022
ef4413f
Add option to disable SQLite tests
Krzmbrzl Sep 15, 2022
49510a9
Table: Fix NULL default values for string columns
Krzmbrzl Sep 15, 2022
4b9953a
Also make use of Large Objects in Postgresql
Krzmbrzl Sep 15, 2022
390f310
REMOVE-ME: Update Soci to include BLOB improvements
Krzmbrzl Sep 19, 2022
0ed47f1
Postgresql: Use trigger body as-is, if it already calls procedure
Krzmbrzl Sep 19, 2022
d683d37
Postgresql: Ensure the "lo" extension is installed
Krzmbrzl Sep 19, 2022
e2069cb
Table: Also create triggers
Krzmbrzl Sep 19, 2022
bcc999b
Postgresql: Auto-add triggers for managing LOBs
Krzmbrzl Sep 19, 2022
de3c475
format code
Krzmbrzl Sep 19, 2022
3597b6f
Fix syntax for raising database exceptions
Krzmbrzl Sep 19, 2022
a4dbeee
Delete (most) triggers before deleting tables
Krzmbrzl Sep 19, 2022
b9f6a5e
Add support for conditional triggers
Krzmbrzl Sep 19, 2022
7083b2f
Prevent exceptions from escaping dtor
Krzmbrzl Sep 21, 2022
4620bad
Postgresql: Fix trigger function not returning anything
Krzmbrzl Sep 19, 2022
26db0ad
Implemented UserTable
Krzmbrzl Sep 13, 2022
ec33516
ChannelPropertyTable: Improve exception messages
Krzmbrzl Sep 21, 2022
4a79300
ChannelPropertyTable: Fix migration code
Krzmbrzl Sep 21, 2022
b4b8610
ChannelPropertyTable: Fix a few things
Krzmbrzl Sep 21, 2022
f6ea379
Implement UserPropertyTable
Krzmbrzl Sep 21, 2022
145a14b
Fix test-cases for old Qt versions
Krzmbrzl Sep 21, 2022
a49a1db
Fix test not passing on CI due to missing time sync
Krzmbrzl Sep 21, 2022
ac375f7
Fix doc-strings for user-related tables
Krzmbrzl Sep 21, 2022
91770cc
Add function to create SQL to fetch minimum, free ID
Krzmbrzl Sep 21, 2022
65f2666
ServerTable: Minor adjustments
Krzmbrzl Sep 21, 2022
23a8333
ServerTable: Remove auto-increment + add func to fetch free ID
Krzmbrzl Sep 21, 2022
5f74d2a
ChannelTable: Improve getFreeChannelID
Krzmbrzl Sep 21, 2022
1dc128a
Fix two files using same include guard
Krzmbrzl Sep 21, 2022
0db48b1
Implemented GroupTable (without tests, so far)
Krzmbrzl Sep 21, 2022
3cc0f98
Small SQL readability improvements
Krzmbrzl Sep 22, 2022
9285a41
Added tests for GroupTable
Krzmbrzl Sep 22, 2022
4b10561
Ensure exceptions are of correct type
Krzmbrzl Sep 22, 2022
837e80e
Implemented GroupMemberTable
Krzmbrzl Sep 22, 2022
c11a9c0
Implemented ACLTable
Krzmbrzl Sep 22, 2022
c42ec55
Implemented ChannelLinkTable
Krzmbrzl Sep 23, 2022
c27d73e
Implemented DBBan class
Krzmbrzl Sep 24, 2022
b5f4577
Introduce ChronoUtils
Krzmbrzl Sep 26, 2022
87aab3c
DataType: Fix bug
Krzmbrzl Sep 24, 2022
bf59cf2
Prevent not-yet-created Triggers from being deleted
Krzmbrzl Sep 26, 2022
7c401b4
Fix member variable naming
Krzmbrzl Sep 26, 2022
a0b5ef5
Implemented BanTable
Krzmbrzl Sep 25, 2022
d74e357
Added support for FLOAT data type
Krzmbrzl Sep 26, 2022
9ce0bce
Implemented ChannelListenerTabl
Krzmbrzl Sep 26, 2022
d149926
LIMIT select queries in *Exists functions
Krzmbrzl Sep 26, 2022
8fc2ede
Use MigrationException if something fails during migration
Krzmbrzl Sep 26, 2022
18a20cd
Explicitly set transaction isolation
Krzmbrzl Oct 18, 2022
170b962
Silence compiler warning
Krzmbrzl Nov 1, 2022
b836ea0
Implemented function to fetch all server IDs
Krzmbrzl Nov 3, 2022
7c82733
Introduced DBLogEntry type
Krzmbrzl Nov 3, 2022
979189c
Extended LogTable interface
Krzmbrzl Nov 5, 2022
62f22d5
Fix LogTable extensions
Krzmbrzl Nov 9, 2022
0e4c996
Extend ChannelTable interface
Krzmbrzl Nov 10, 2022
d4d65fb
Make working with transactions more convenient
Krzmbrzl Nov 14, 2022
fb60ada
SQLite: Don't rollback automatically
Krzmbrzl Nov 15, 2022
e2e6e42
Avoid throwing from dtor
Krzmbrzl Nov 15, 2022
d57afd7
Add explicit move-support for NonCopyable
Krzmbrzl Nov 15, 2022
ee07513
Extend GroupTable interface
Krzmbrzl Nov 15, 2022
20031d1
Extended LogTable interface
Krzmbrzl Nov 16, 2022
9683455
Extend ChannelListenerTable
Krzmbrzl Nov 16, 2022
3ba8940
Extend UserTable interface
Krzmbrzl Nov 17, 2022
58fc769
Support username filtering
Krzmbrzl Nov 17, 2022
9ccc670
Ensure mumble-server binary is created at expected location
Krzmbrzl Nov 28, 2022
23cf233
Ensure UserProperty uses a large enough underlying type
Krzmbrzl Nov 29, 2022
4509936
fix typo
Krzmbrzl Nov 29, 2022
dff46fd
Set current scheme version
Krzmbrzl Nov 29, 2022
fce33ab
Fix setting of scheme version
Krzmbrzl Nov 29, 2022
e03ad8c
Ensure tables are empty before import
Krzmbrzl Nov 29, 2022
42e9f2e
Put includes in correct order
Krzmbrzl Nov 29, 2022
cc4ac7a
Fix scheme version fetching
Krzmbrzl Nov 29, 2022
7991b62
Fix double registration of DB backends
Krzmbrzl Nov 29, 2022
2907d6d
Migrate server implementation to use new DB backend
Krzmbrzl Nov 29, 2022
c2d4451
Use system_clock instead of steady_clock
Krzmbrzl Dec 1, 2022
99d4c1e
Fix endless creation of default instances on startup
Krzmbrzl Dec 1, 2022
bfdc1c1
Only call user-related DB functions for registered users
Krzmbrzl Dec 1, 2022
906fcd4
Extend UserPropertyTable interface
Krzmbrzl Dec 6, 2022
3b3958e
Make constructor explicit
Krzmbrzl Dec 6, 2022
93bbed9
Adapt default server number
Krzmbrzl Dec 6, 2022
b9495a0
Add assertion to PBKDF2 impl
Krzmbrzl Dec 6, 2022
f330789
Add getter for MetaTable
Krzmbrzl Dec 6, 2022
adfc9f5
Extended MetaTable interface
Krzmbrzl Dec 6, 2022
d81be66
Init PBKDF2 iteration count
Krzmbrzl Dec 6, 2022
a638c4a
factor out password hash function
Krzmbrzl Dec 7, 2022
54cbb9d
Created dedicated function to set a user's password
Krzmbrzl Dec 7, 2022
4b58b8c
Implement authentication
Krzmbrzl Dec 7, 2022
e8b09e3
Format code
Krzmbrzl Dec 7, 2022
712c558
Remove unneeded iostream include
Krzmbrzl Dec 7, 2022
cdd8f8f
Implemented DBWrapper::getRegisteredUserIDs
Krzmbrzl Dec 13, 2022
da3fbea
Use ServerUserInfo type less frequently
Krzmbrzl Dec 13, 2022
f842c0f
Remove another unneeded iostream include
Krzmbrzl Dec 13, 2022
02c3f32
Add more aggressive assertions to DBWrapper
Krzmbrzl Dec 13, 2022
c489bc6
Prevent being locked into SuperUser account
Krzmbrzl Dec 13, 2022
730442b
Fix test case failing due to inconsistent row ordering
Krzmbrzl Dec 13, 2022
daff545
Gracefully handle thrown exceptions
Krzmbrzl Dec 13, 2022
a1dad69
Add support for meta groups & group modifiers
Krzmbrzl Dec 15, 2022
ec9df2a
Turn assertValidID into a macro
Krzmbrzl Dec 15, 2022
024ec2b
Group & ACL update
Krzmbrzl Dec 19, 2022
706c29c
Fix potential duplicate transaction rollback
Krzmbrzl Dec 20, 2022
8823be6
Fix channelID not set on DB groups
Krzmbrzl Dec 20, 2022
128f4ec
Correct for server ID now starting at zero
Krzmbrzl Dec 20, 2022
1ababc1
Fix DB errors due to temporary channels
Krzmbrzl Dec 23, 2022
6c17efb
Fix swapped parameters
Krzmbrzl Dec 23, 2022
e96ee3c
Fix DB error when adding listener with vol. adj. in single message
Krzmbrzl Dec 23, 2022
14ff4e7
Fix DB error when setting vol. adj. on non-existent listener
Krzmbrzl Dec 23, 2022
38414e4
Fix stored vol. adj. not loaded for reactivated channel listeners
Krzmbrzl Dec 23, 2022
7d47478
Mark reactivated listeners as enabled
Krzmbrzl Dec 23, 2022
e55f43b
Streamline SuperUser handling
Krzmbrzl Dec 23, 2022
4922955
FEAT(server, ice): Error for adj. non-existing listener
Krzmbrzl Jan 2, 2023
3426964
Fix cert based auth skipped for known users
Krzmbrzl Jan 2, 2023
d59b52a
Re-implement rememberchannelduration
Krzmbrzl Jan 2, 2023
b60aa15
Fix channel link retrieval and removal
Krzmbrzl Jan 4, 2023
aaa3283
Fix segfault during Ban processing
Krzmbrzl Jan 4, 2023
c318d1d
Support storing ACLs with access token
Krzmbrzl Jan 10, 2023
05761a5
Properly handle ACLs with access tokens
Krzmbrzl Jan 10, 2023
d6b697d
Allow registering users that currently are in no channel
Krzmbrzl Feb 9, 2023
c0f6003
GroupMemberTable: Add userID to primary key
Krzmbrzl Feb 9, 2023
5829d2f
Fix check in Ice's updateRegistration
Krzmbrzl Feb 9, 2023
6359734
Make Ice's getRegisteredUsers actually return something
Krzmbrzl Feb 9, 2023
f327a77
Add function to obtain backend to DB class
Krzmbrzl Jan 17, 2023
cdbd0af
Make inheritacl column NOT NULL
Krzmbrzl Jan 17, 2023
302e334
Update docs for parent_id column
Krzmbrzl Jan 17, 2023
c373c69
Document new access_token column
Krzmbrzl Jan 18, 2023
c3583a6
Defaulted Database dtor
Krzmbrzl Jan 19, 2023
97fad88
Add support for Binary and Timestamp data types
Krzmbrzl Jan 19, 2023
fb91f5e
Remove unnecessarily strict assertion
Krzmbrzl Jan 24, 2023
e74b57a
Turned exception into a MigrationException
Krzmbrzl Jan 24, 2023
98f09d0
Fix invalid check for NULL
Krzmbrzl Jan 24, 2023
bbe96a4
ChannelTable: Apply NOT NULL constraint to correct column
Krzmbrzl Jan 24, 2023
72a20c4
Properly deal with NULL values during table import
Krzmbrzl Jan 24, 2023
ef45db4
Properly export NULL value to JSON
Krzmbrzl Jan 24, 2023
28030e6
Disable migration support for scheme versions < 6
Krzmbrzl Jan 24, 2023
289563f
ChannelTable: Migration fixes
Krzmbrzl Jan 24, 2023
1a092a3
Implement COALESCE helper
Krzmbrzl Feb 7, 2023
e87aaa4
Migration fixes
Krzmbrzl Feb 7, 2023
e543483
Fix Database::migrateTables (virtual & transaction)
Krzmbrzl Feb 10, 2023
ee91e75
Outsourced legacy group format converter functions
Krzmbrzl Feb 21, 2023
3534631
Fixed ACLTable migration path
Krzmbrzl Feb 21, 2023
5ad4175
Fix migration of channel links
Krzmbrzl Feb 22, 2023
14a3a57
Replace UNIXEPOCHTIME
Krzmbrzl Feb 22, 2023
5363c5d
Move hex conversion functions to DB core
Krzmbrzl Feb 28, 2023
7841750
Properly handle binary data during table import/export
Krzmbrzl Mar 2, 2023
2a095ae
Fixed wrong failure report in database migration
Krzmbrzl Sep 4, 2023
63ed7e3
Ensure UTC is default time zone
Krzmbrzl Oct 15, 2023
656006e
Implement dateToEpoch function
Krzmbrzl Oct 15, 2023
3fa6173
WIP
Krzmbrzl Oct 15, 2023
9cbc9a3
Avoid temporaries in SQL binds
Krzmbrzl Nov 7, 2023
0dfdc5d
Ensure transaction is active when exporting to JSON
Krzmbrzl Nov 18, 2023
e090a86
Added more missing transactions in Table and Database impl
Krzmbrzl Nov 18, 2023
8ca54b4
Remove redundant debug output
Krzmbrzl Nov 18, 2023
52b0fe1
Update SOCI to latest BLOB support
Krzmbrzl Nov 18, 2023
c4d0e26
Set Database on metatable before creation
Krzmbrzl Nov 18, 2023
428d619
Add Table ctor param for specifying database
Krzmbrzl Nov 18, 2023
84c13f7
Fix UB
Krzmbrzl Nov 18, 2023
0797ef0
BanTable: access correct column
Krzmbrzl Nov 19, 2023
32f6fe8
Properly convert last_active during migration of UserTable
Krzmbrzl Nov 19, 2023
e73e7b4
Properly quote column names
Krzmbrzl Nov 19, 2023
16f0c94
BanTable: Properly select base col as BLOB type
Krzmbrzl Nov 19, 2023
61c168b
Uncomment cleanup line
Krzmbrzl Nov 21, 2023
592ee46
Make Binary datatype work for MySQL
Krzmbrzl Nov 21, 2023
0899716
Make DataType objects comparable to Type enums
Krzmbrzl Nov 21, 2023
af5a33b
Avoid unnecessary hex conversions in BanTable migration
Krzmbrzl Nov 21, 2023
f1cf164
Ensure PostgreSQL returns Epoch as long long
Krzmbrzl Nov 24, 2023
5c46e8f
Postgres: Work around binary value insertion in JSON import
Krzmbrzl Nov 24, 2023
a38d03f
BanTable: Use hex representation for base readout after all
Krzmbrzl Nov 24, 2023
369f8fb
Format server DB tests
Krzmbrzl Nov 24, 2023
e1269dc
Respect disabled DB logging
Krzmbrzl Nov 26, 2023
4bb5087
ServerDBTest: Add print func for vectors
Krzmbrzl Dec 5, 2023
4b3c02a
ServerDBTest: Prevent errors due to cleanup interference
Krzmbrzl Dec 5, 2023
bc1f42e
ServerDBTest: Use proper arg order in align*Order
Krzmbrzl Dec 5, 2023
9f28aa0
Remove weird spacing
Krzmbrzl Dec 5, 2023
c05f7f5
Don't try to drop triggers of non-existing tables
Krzmbrzl Dec 5, 2023
ffaabc5
ServerDBTest: Avoid non-empty DB after test case
Krzmbrzl Dec 5, 2023
81e4c38
Remove superfluous TODO file
Krzmbrzl Dec 12, 2023
35dd651
Add dummy texture to user table migration test
Krzmbrzl Dec 12, 2023
8db7fe2
Fix table data inheritance
Krzmbrzl Dec 12, 2023
c86707c
Fix DB migration from v8
Krzmbrzl Dec 12, 2023
132c9ed
Add proper channel listener migration test data
Krzmbrzl Dec 25, 2023
b2445b6
Only remove sizedness for Binary type
Krzmbrzl Dec 25, 2023
bd4b036
Add test data for DB scheme v10
Krzmbrzl Dec 25, 2023
66144d0
MySQL: Enable strict mode
Krzmbrzl Dec 25, 2023
6af141f
Remove debug output
Krzmbrzl Dec 25, 2023
a71df41
Remove unused variable
Krzmbrzl Dec 25, 2023
2718690
Explicitly declare Boost dependency
Krzmbrzl Dec 25, 2023
b1fccd1
Fix inconsistent declaration of ServerUserInfo
Krzmbrzl Dec 26, 2023
3d5506c
Don't use QStrings in boost::iequals
Krzmbrzl Dec 26, 2023
908ea2d
Make Boost dependency public
Krzmbrzl Dec 26, 2023
8d6b081
Update SOCI
Krzmbrzl Dec 26, 2023
b4c9e30
Change assertions to only prevent downgrading
Krzmbrzl Dec 28, 2023
7a76021
Fix missing quote
Krzmbrzl Jan 2, 2024
547ea72
Make DB code dependency on OpenSSL explicit
Krzmbrzl Jan 1, 2024
06fe1a3
BUILD(cmake): Allow selective disabling of DB backends
Krzmbrzl Feb 11, 2024
7934367
Remove channel from Server::qhChannel to prevent use-after-free
Krzmbrzl Mar 5, 2024
9089a9e
Fix new compiler warnings
Krzmbrzl Mar 7, 2024
fefd6e8
Formatted code
Krzmbrzl Mar 7, 2024
c0a2781
Fix some more warnings
Krzmbrzl Mar 7, 2024
1b67088
Fix platform-dependent inheritance
Krzmbrzl May 24, 2024
c3362a3
Fix compiler warnings
Krzmbrzl May 24, 2024
f203db4
Update SOCI
Krzmbrzl Jun 2, 2024
534e1e7
Update build environment
Krzmbrzl Jun 2, 2024
c522c1b
FEAT(server): JSON import/export to/from database
Krzmbrzl Jun 29, 2024
fb43ee4
FIX(server): Stale username cache-entries due to case differences
Krzmbrzl Jul 6, 2024
ae868e8
Properly handle exceptions in regular DB tests
Krzmbrzl Jul 13, 2024
f6ab1b6
CI: Run DB tests on all supported backends
Krzmbrzl Jun 6, 2024
21adde2
Refine DB config handling (no longer ignores port)
Krzmbrzl Jul 18, 2024
74d873d
Adapt DB config docs in the template INI
Krzmbrzl Jul 18, 2024
5aaec23
Fix behavior on name request with invalid user ID
Krzmbrzl Aug 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ environment:
global:
MUMBLE_BUILD_NUMBER_TOKEN:
secure: scRizsdwbTWjY7M9RHPT9EXDBxtWvXTsyVq1xXTWF1A=
MUMBLE_ENVIRONMENT_SOURCE: 'https://dl.mumble.info/build/vcpkg'
MUMBLE_ENVIRONMENT_SOURCE: 'https://github.com/mumble-voip/vcpkg/releases/download/2024-05/'
MUMBLE_ENVIRONMENT_STORE: 'C:/MumbleBuild'
MUMBLE_ENVIRONMENT_PATH: '%MUMBLE_ENVIRONMENT_STORE%/%MUMBLE_ENVIRONMENT_VERSION%'
MUMBLE_ENVIRONMENT_TOOLCHAIN: '%MUMBLE_ENVIRONMENT_PATH%/scripts/buildsystems/vcpkg.cmake'
Expand All @@ -23,7 +23,7 @@ environment:

matrix:
- MUMBLE_ENVIRONMENT_TRIPLET: 'x64-windows-static-md-release'
MUMBLE_ENVIRONMENT_VERSION: 'mumble_env.x64-windows-static-md-release.2023-12-31.6a3ce9c65'
MUMBLE_ENVIRONMENT_VERSION: ' mumble_env.x64-windows-static-md-release.2024-05-19.5eaf0d45f'

install:
- ps: .ci/install-environment_windows.ps1
Expand Down
1 change: 1 addition & 0 deletions .ci/azure-pipelines/build_linux.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ cd $BUILD_BINARIESDIRECTORY
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=appdir/usr -DCMAKE_UNITY_BUILD=ON \
-DCMAKE_BUILD_TYPE=Release -DBUILD_NUMBER=$BUILD_NUMBER \
-Dtests=ON -Dsymbols=ON \
-Ddatabase-sqlite-tests=ON -Ddatabase-mysql-tests=ON -Ddatabase-postgresql-tests=ON \
-Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY

cmake --build .
Expand Down
3 changes: 3 additions & 0 deletions .ci/azure-pipelines/build_macos.bash
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ BUILD_NUMBER=$("./scripts/mumble-build-number.py" --commit "${BUILD_SOURCEVERSIO

cd $BUILD_BINARIESDIRECTORY

# Note: We can't use MySQL - see install script for details
cmake -G Ninja -DVCPKG_TARGET_TRIPLET=$MUMBLE_ENVIRONMENT_TRIPLET -DCMAKE_TOOLCHAIN_FILE=$MUMBLE_ENVIRONMENT_TOOLCHAIN \
-DIce_HOME="$MUMBLE_ENVIRONMENT_PATH/installed/$MUMBLE_ENVIRONMENT_TRIPLET" \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DBUILD_NUMBER=$BUILD_NUMBER \
-Dtests=ON -Dstatic=ON -Dsymbols=ON \
-Denable-mysql=OFF \
-Ddatabase-sqlite-tests=ON -Ddatabase-postgresql-tests=ON \
-Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY

cmake --build .
Expand Down
24 changes: 24 additions & 0 deletions .ci/azure-pipelines/install-environment_linux.bash
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,27 @@ sudo apt -y install \
zsync \
appstream \
libpoco-dev



# Setup MySQL and PostgreSQL databases for the Mumble tests
echo "Configuring MySQL..."

echo -e "[mysqld]\nlog-bin-trust-function-creators = 1" | sudo tee -a /etc/mysql/my.cnf

sudo systemctl enable mysql.service
sudo systemctl start mysql.service

echo "CREATE DATABASE mumble_test_db; "\
"CREATE USER 'mumble_test_user'@'localhost' IDENTIFIED BY 'MumbleTestPassword'; "\
"GRANT ALL PRIVILEGES ON mumble_test_db.* TO 'mumble_test_user'@'localhost';" | sudo mysql --user=root --password="root"


echo "Configuring PostgreSQL..."

sudo systemctl enable postgresql.service
sudo systemctl start postgresql.service

echo "CREATE DATABASE mumble_test_db; "\
"CREATE USER mumble_test_user ENCRYPTED PASSWORD 'MumbleTestPassword'; "\
"GRANT ALL PRIVILEGES ON DATABASE mumble_test_db TO mumble_test_user;" | sudo -u postgres psql
18 changes: 17 additions & 1 deletion .ci/azure-pipelines/install-environment_macos.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.


currentDir=$(pwd)
cd $AGENT_TEMPDIRECTORY

Expand Down Expand Up @@ -48,4 +49,19 @@ mkdir -p $MUMBLE_ENVIRONMENT_STORE

chmod +x "$MUMBLE_ENVIRONMENT_PATH/installed/$MUMBLE_ENVIRONMENT_TRIPLET/tools/Ice/slice2cpp"

ls -l $MUMBLE_ENVIRONMENT_STORE

# Setup PostgreSQL database for the Mumble tests
# Note: we don't configure MySQL as that's not installed on the Azure runners for macOS
# by default and installing it via homebrew takes forever.

echo "Configuring PostgreSQL..."

# Using brew service start postgresql for some reason does not work so we have
# to resort to starting PostgreSQL manually.
postgres_data_dir="$( brew info postgresql | grep -E '^ *initdb' | awk '{print $NF}' )"
pg_ctl start -D "$postgres_data_dir"

echo "CREATE DATABASE mumble_test_db; "\
"CREATE USER mumble_test_user ENCRYPTED PASSWORD 'MumbleTestPassword'; "\
"GRANT ALL PRIVILEGES ON DATABASE mumble_test_db TO mumble_test_user;" | psql -d postgres

6 changes: 3 additions & 3 deletions .ci/azure-pipelines/main-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

variables:
MUMBLE_ENVIRONMENT_STORE: '$(Agent.ToolsDirectory)/MumbleBuild'
MUMBLE_ENVIRONMENT_SOURCE: 'https://dl.mumble.info/build/vcpkg'
MUMBLE_ENVIRONMENT_SOURCE: 'https://github.com/mumble-voip/vcpkg/releases/download/2024-05/'
MUMBLE_ENVIRONMENT_PATH: '$(MUMBLE_ENVIRONMENT_STORE)/$(MUMBLE_ENVIRONMENT_VERSION)'
MUMBLE_ENVIRONMENT_TOOLCHAIN: '$(MUMBLE_ENVIRONMENT_PATH)/scripts/buildsystems/vcpkg.cmake'
MUMBLE_SOURCE_COMMIT: '$(Build.SourceVersion)'
Expand All @@ -24,7 +24,7 @@ jobs:
pool:
vmImage: 'windows-2022'
variables:
MUMBLE_ENVIRONMENT_VERSION: 'mumble_env.x64-windows-static-md-release.2023-12-31.6a3ce9c65'
MUMBLE_ENVIRONMENT_VERSION: 'mumble_env.x64-windows-static-md-release.2024-05-19.5eaf0d45f'
MUMBLE_ENVIRONMENT_TRIPLET: 'x64-windows-static-md-release'
steps:
- template: steps_windows.yml
Expand All @@ -45,7 +45,7 @@ jobs:
pool:
vmImage: 'macOS-12'
variables:
MUMBLE_ENVIRONMENT_VERSION: 'mumble_env.x64-osx-release.2023-12-31.6a3ce9c65'
MUMBLE_ENVIRONMENT_VERSION: 'mumble_env.x64-osx-release.2024-05-19.5eaf0d45f'
MUMBLE_ENVIRONMENT_TRIPLET: 'x64-osx-release'
steps:
- template: steps_macos.yml
Expand Down
6 changes: 3 additions & 3 deletions .ci/azure-pipelines/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

variables:
MUMBLE_ENVIRONMENT_STORE: '$(Agent.ToolsDirectory)/MumbleBuild'
MUMBLE_ENVIRONMENT_SOURCE: 'https://dl.mumble.info/build/vcpkg'
MUMBLE_ENVIRONMENT_SOURCE: 'https://github.com/mumble-voip/vcpkg/releases/download/2024-05/'
MUMBLE_ENVIRONMENT_PATH: '$(MUMBLE_ENVIRONMENT_STORE)/$(MUMBLE_ENVIRONMENT_VERSION)'
MUMBLE_ENVIRONMENT_TOOLCHAIN: '$(MUMBLE_ENVIRONMENT_PATH)/scripts/buildsystems/vcpkg.cmake'
MUMBLE_SOURCE_COMMIT: '$(Build.SourceVersion)'
Expand All @@ -22,7 +22,7 @@ jobs:
pool:
vmImage: 'windows-2022'
variables:
MUMBLE_ENVIRONMENT_VERSION: 'mumble_env.x64-windows-static-md-release.2023-12-31.6a3ce9c65'
MUMBLE_ENVIRONMENT_VERSION: 'mumble_env.x64-windows-static-md-release.2024-05-19.5eaf0d45f'
MUMBLE_ENVIRONMENT_TRIPLET: 'x64-windows-static-md-release'
steps:
- template: steps_windows.yml
Expand All @@ -43,7 +43,7 @@ jobs:
pool:
vmImage: 'macOS-12'
variables:
MUMBLE_ENVIRONMENT_VERSION: 'mumble_env.x64-osx-release.2023-12-31.6a3ce9c65'
MUMBLE_ENVIRONMENT_VERSION: 'mumble_env.x64-osx-release.2024-05-19.5eaf0d45f'
MUMBLE_ENVIRONMENT_TRIPLET: 'x64-osx-release'
steps:
- template: steps_macos.yml
Expand Down
2 changes: 1 addition & 1 deletion .ci/azure-pipelines/steps_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ steps:
env:
MUMBLE_BUILD_NUMBER_TOKEN: $(BUILD_NUMBER_TOKEN)
displayName: 'Build'
- script: 'cd $BUILD_BINARIESDIRECTORY; QT_QPA_PLATFORM=offscreen ctest --output-on-failure'
- script: 'cd $BUILD_BINARIESDIRECTORY; QT_QPA_PLATFORM=offscreen ctest --verbose'
displayName: 'Test'
# - script: .ci/azure-pipelines/package_AppImage.bash
# displayName: 'Release'
Expand Down
3 changes: 2 additions & 1 deletion .ci/build_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="%MUMBLE_ENVIRONMENT_TOOLCHAIN%" -DVCPKG_T
-DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe ^
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DBUILD_NUMBER=%BUILD_NUMBER% ^
-Dpackaging=ON -Dtests=ON -Dstatic=ON -Dsymbols=ON -Dasio=ON -Dg15=ON ^
-Ddisplay-install-paths=ON -Delevation=%MUMBLE_USE_ELEVATION% %MUMBLE_SOURCE_REPOSITORY%
-Ddisplay-install-paths=ON -Ddatabase-sqlite-tests=ON -Ddatabase-mysql-tests=ON -Ddatabase-postgresql-tests=ON ^
-Delevation=%MUMBLE_USE_ELEVATION% %MUMBLE_SOURCE_REPOSITORY%

if errorlevel 1 (
exit /b %errorlevel%
Expand Down
29 changes: 29 additions & 0 deletions .ci/install-environment_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# Always quit on encountered errors
$ErrorActionPreference = 'Stop'


choco install aria2

# We require a separate function that makes sure the run command's exit code
Expand Down Expand Up @@ -128,3 +129,31 @@ Invoke-Command 7z x "WixSharp.7z" "-oC:/WixSharp"
choco install vswhere

Write-Host "Build environment successfully installed"


# Setup MySQL and PostgreSQL databases for the Mumble tests
Write-Host "Configuring PostgreSQL..."

$env:PATH += ";$env:PGBIN"
$env:PGPASSWORD="root"

pg_ctl start -D "$env:PGDATA"

Write-Output ("CREATE DATABASE mumble_test_db; " +
"CREATE USER mumble_test_user ENCRYPTED PASSWORD 'MumbleTestPassword'; " +
"GRANT ALL PRIVILEGES ON DATABASE mumble_test_db TO mumble_test_user;") | psql --username "postgres"


Write-Host "Configuring MySQL..."

Write-Output "[mysqld]`nlog-bin-trust-function-creators = 1" | Add-Content -Path C:/Windows/my.ini

mysqld --initialize-insecure --console
Start-Process mysqld

# Give the MySQL daemon some time to start up
Start-Sleep -Seconds 5

Write-Output ("CREATE DATABASE mumble_test_db; " +
"CREATE USER 'mumble_test_user'@'localhost' IDENTIFIED BY 'MumbleTestPassword'; " +
"GRANT ALL PRIVILEGES ON mumble_test_db.* TO 'mumble_test_user'@'localhost';") | mysql --user=root
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

set -e
set -x

sudo apt update

sudo apt -y install \
Expand Down Expand Up @@ -29,4 +32,31 @@ sudo apt -y install \
libzeroc-ice-dev \
zsync \
appstream \
libpoco-dev
libpoco-dev \
libsqlite3-dev

# MySQL and PostgreSQL are pre-installed on GitHub-hosted runners. More info about the default setup can be found at
# - https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-Readme.md#databases
# - https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#databases

# Setup MySQL and PostgreSQL databases for the Mumble tests
echo "Configuring MySQL..."

echo -e "[mysqld]\nlog-bin-trust-function-creators = 1" | sudo tee -a /etc/mysql/my.cnf

sudo systemctl enable mysql.service
sudo systemctl start mysql.service

echo "CREATE DATABASE mumble_test_db; "\
"CREATE USER 'mumble_test_user'@'localhost' IDENTIFIED BY 'MumbleTestPassword'; "\
"GRANT ALL PRIVILEGES ON mumble_test_db.* TO 'mumble_test_user'@'localhost';" | sudo mysql --user=root --password="root"


echo "Configuring PostgreSQL..."

sudo systemctl enable postgresql.service
sudo systemctl start postgresql.service

echo "CREATE DATABASE mumble_test_db; "\
"CREATE USER mumble_test_user ENCRYPTED PASSWORD 'MumbleTestPassword'; "\
"GRANT ALL PRIVILEGES ON DATABASE mumble_test_db TO mumble_test_user;" | sudo -u postgres psql
3 changes: 3 additions & 0 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ cmake -G Ninja \
$CMAKE_OPTIONS \
-DCMAKE_UNITY_BUILD=ON \
-Ddisplay-install-paths=ON \
-Ddatabase-sqlite-tests=ON \
-Ddatabase-mysql-tests=ON \
-Ddatabase-postgresql-tests=ON \
$ADDITIONAL_CMAKE_OPTIONS \
$VCPKG_CMAKE_OPTIONS

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on: [push, pull_request]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CMAKE_OPTIONS: |
-Dtests=ON -Dsymbols=ON -Ddisplay-install-paths=ON
CMAKE_OPTIONS: -Dtests=ON -Dsymbols=ON -Ddisplay-install-paths=ON -Ddatabase-mysql-tests=ON -Ddatabase-postgresql-tests=ON
MUMBLE_ENVIRONMENT_SOURCE: 'https://dl.mumble.info/build/vcpkg/'


Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@
[submodule "3rdparty/utfcpp"]
path = 3rdparty/utfcpp
url = https://github.com/mumble-voip/utfcpp.git
[submodule "3rdparty/soci"]
path = 3rdparty/soci
url = https://github.com/Krzmbrzl/soci.git
1 change: 1 addition & 0 deletions 3rdparty/soci
Submodule soci added at 700aad
35 changes: 15 additions & 20 deletions auxiliary_files/mumble-server.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@
; NOT variable = """ BUT variable = "\""
; NOT regex = \w* BUT regex = \\w*

; Path to database. If blank, will search for
; mumble-server.sqlite in default locations or create it if not found.
; When using SQLite: Path to database. If blank, will search for
; mumble-server.sqlite in default locations or create it if not found.
; Otherwise: The name of the database to use for the Mumble server.
database=

; Selects the database to use. Possible values are
; - sqlite (default)
; - mysql
; - postgresql
;dbDriver=postgresql

;dbUsername=
;dbPassword=
;dbHost=
;dbPort=

; The server defaults to using SQLite with its default rollback journal.
; In some situations, using SQLite's write-ahead log (WAL) can be
; advantageous.
Expand All @@ -25,29 +37,12 @@ database=
; values:
;
; 0 - Use SQLite's default rollback journal.
; 1 - Use write-ahead log with synchronous=NORMAL.
; If the server crashes, the database will be in a consistent state, but
; the most recent changes might be lost if the operating system did
; not write them to disk yet. This option can improve the server's
; interactivity on busy servers, or servers with slow storage.
; 1 - No longer supported!
; 2 - Use write-ahead log with synchronous=FULL.
; All database writes are synchronized to disk when they are made.
; If the server crashes, the database will be include all completed writes.
;sqlite_wal=0

; If you wish to use something other than SQLite, you'll need to set the name
; of the database above, and also uncomment the below.
; Sticking with SQLite is strongly recommended, as it's the most well tested
; and by far the fastest solution.
;
;dbDriver=QMYSQL
;dbUsername=
;dbPassword=
;dbHost=
;dbPort=
;dbPrefix=mumble-server_
;dbOpts=

; The server defaults to not using D-Bus. If you wish to use dbus, which is one of the
; RPC methods available in the server, please specify so here.
;
Expand Down
Loading
Loading