Commit Graph

34 Commits

Author SHA1 Message Date
6c9fd55c63 config: Always write config when migrating
Fixes an issue where OBS 30.1.2 migrations would work on the first
30.2.0 load, but the settings would not persist to disk for further
loads.
2024-07-17 22:58:54 -07:00
9e48274617 Config: Ensure conversion to filesystem::path uses utf-8 2024-06-11 13:43:10 -07:00
8c80e0745a Config: Fix plugin startup for fresh installs
The commit to migrate data from global.ini to the plugin_config folder
accidentally broke plugin startup for fresh configurations. Instead of
returning early if no configuration is found, simply generate a new one
from defaults.

Closes #1225
2024-06-05 23:26:36 -07:00
5fc39ef054 base: Apply latest clang-format changes from upstream
Minus, some customizations, of course
2024-04-22 23:44:04 -07:00
9123879c76 Config: Use std::string for ServerPassword instead of QString
Less Qt leeching into things is better.
2024-04-22 22:50:10 -07:00
af31f1adca Config: Migrate config/persistent data to plugin_config directory
This commit moves the Config value storage from `global.ini` to a new
`config.json` file in the `plugin_config/obs-websocket` directory. This
comes after some internal discussion about plugins not using the
`plugin_config` directory, and that obs-websocket was offending.

Settings are currently stored as a JSON object, and field names have
been changed from using PascalCase to snake_case, to better align
with how JSON is stored elsewhere in OBS.
2024-04-22 22:30:44 -07:00
1fc7900b1c Config: Move default values to header file
Just to make the code style align with other places
2023-05-27 22:00:51 -07:00
e0d322d4cc Config: Disable WebSocket server by default
I believe it would be bad to enable a network-based WebSocket server
for all OBS users, since obs-websocket usage is very likely less than
a majority of users. A password will still be generated on first run,
so there are no worries about weirdness if a user goes in to enable
the server later on.
2022-07-25 08:24:04 -07:00
711746524c Revert "Config, websocketserver: Add feature to bind to loopback (default)"
This reverts commit 1da0214201.
2022-06-07 23:07:09 -07:00
6deadc25ac base: Change column limit to 132
A column limit of 80 is very restrictive and code readability was
suffering. A limit of 132 is more realistic for this plugin.
2022-06-07 21:36:51 -07:00
f73e78582b base: Format code 2022-05-13 21:19:29 -07:00
1da0214201 Config, websocketserver: Add feature to bind to loopback (default)
Binds to localhost or 127.0.0.1 by default, since most users don't have
to access obs-websocket externally.
2022-04-25 21:31:52 -07:00
3a5f0d89b9 Server: Add --websocket_ipv4_only switch
Socket listening default changed to IPv4 and IPv6,
overridable to IPv4 only by using the command line switch.
2022-04-25 19:53:15 -07:00
14227237d7 Base: [BREAKING] Update default WebSocket port to 4455
Our original strategy of relying on clients to simply detect the
protocol version and use the correct one was optimistic at best,
and it has been realized during the transition process from 4.x to 5.x
that sharing 4444 is not practical. As such, we'll be using 4455 in
the future for 5.x.

If you are a client developer, we suggest continuing to maintain
appropriate protocol version detection and support, as the WebSocket
port is at the end of the day simply a suggestion.
2022-01-28 15:38:08 -08:00
da83de7503 Config: Fix firstload password generation 2021-12-25 00:57:09 -08:00
4ca259b790 Base: Enforce -Wall and fix compiler warnings
That was *a lot* of warnings.
2021-11-20 02:34:48 -08:00
bd6c663775 Base: Add copyright header to source 2021-11-19 17:32:22 -08:00
45854e2949 Config: Properly add more logging, fix bug 2021-09-26 03:10:43 -07:00
7a888c2f92 Config: Add more logging
Good to have
2021-09-24 18:09:46 -07:00
eebcc25115 Requests: Add unpublished RemoveInput
The functionality depends on obs-studio#5276 to be merged and released,
so we can add it but not enable it for now.
2021-09-17 02:42:58 -07:00
c9fa09edc4 Config/Base: Refactor with fixes
Fixes these things:
- Websocket password is not generated if FirstLoad and overridden
- Save generated password immediately if FirstLoad
- Do not generate new password if FirstLoad and password already exists
- More logging
2021-09-17 02:25:30 -07:00
69ccc99921 Utils/UI: Make GeneratePassword() use std::string
Just for consistency
2021-09-17 02:09:44 -07:00
66ff329da4 Config: Fix typo 2021-09-15 03:46:52 -07:00
e89c0c2b05 Base: More code cleanup and fixes 2021-09-04 10:47:51 -07:00
ade9653ed6 Base: Only include required util namespaces 2021-08-27 04:34:06 -07:00
4d271da541 Base: Code cleanup and add some requests 2021-07-22 03:24:53 -07:00
f0c3bb2c14 Config: Don't persist debug mode to config
A request from the OBS developers. Debug mode tends to be enabled,
then not remembered to be disabled, leading to logs that are both
long and difficult to read. In some cases, the OBS logviewer may
noticeably lock up the UI just trying to parse the long log file.
2021-06-05 22:19:39 -07:00
ee751edf54 SettingsDialog: Mild refactor and add Connect Info dialog
Among lots of stuff:

- Generate a random password on first load

- Add `ConnectInfo` dialog including QR code display

- Add `Generate Password` button to generate a new random
password

- Delete `Copy Password to Clipboard` button

- Delete `GetConnectString` or whatever from WebSocketServer
(reimplemented the functionality directly into ConnectInfo)

- Added `GeneratePassword()` to Utils

Todo: Show warning when users specify their own passwords
2021-05-08 04:29:03 -07:00
c73f6608b9 Config: Add command line parameters to override port and password 2021-04-28 15:59:29 -07:00
98ec9d01ac base: Dumb #include redefinitions 2021-04-27 16:45:44 -07:00
d9ee288cf1 base: cmake is fucking retarded 2021-04-27 16:33:47 -07:00
8067cfb686 Base: Tons more shit 2021-04-27 14:52:48 -07:00
105229336e Config: Rename config section name 2021-04-26 20:55:50 -07:00
a8ca912044 generic: Add SettingsDialog and Config 2021-04-26 19:59:50 -07:00