mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-17 00:25:43 +02:00
Add deprecation notice
This commit is contained in:
parent
23107d62f9
commit
054706e608
5 changed files with 44 additions and 13 deletions
16
changelog.md
16
changelog.md
|
@ -1,5 +1,21 @@
|
||||||
# Snapcast changelog
|
# Snapcast changelog
|
||||||
|
|
||||||
|
## Version 0.32.0
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Client: Add support for (secure-) websockets (Issue #1325)
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
|
||||||
|
- Fix typo in documentation (PR #1333)
|
||||||
|
|
||||||
|
### General
|
||||||
|
|
||||||
|
- Client: Command line arguments '--host' and '--port' are deprecated
|
||||||
|
|
||||||
|
_Johannes Pohl <snapcast@badaix.de> Thu, 23 Jan 2025 00:13:37 +0200_
|
||||||
|
|
||||||
## Version 0.31.0
|
## Version 0.31.0
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
|
@ -143,8 +143,8 @@ int main(int argc, char** argv)
|
||||||
auto helpSwitch = op.add<Switch>("", "help", "Produce help message");
|
auto helpSwitch = op.add<Switch>("", "help", "Produce help message");
|
||||||
auto groffSwitch = op.add<Switch, Attribute::hidden>("", "groff", "Produce groff message");
|
auto groffSwitch = op.add<Switch, Attribute::hidden>("", "groff", "Produce groff message");
|
||||||
auto versionSwitch = op.add<Switch>("v", "version", "Show version number");
|
auto versionSwitch = op.add<Switch>("v", "version", "Show version number");
|
||||||
op.add<Value<string>>("h", "host", "(deprecated, use [url]) Server hostname or ip address", "", &settings.server.host);
|
auto host_opt = op.add<Value<string>>("h", "host", "(deprecated, use [url]) Server hostname or ip address", "", &settings.server.host);
|
||||||
op.add<Value<size_t>>("p", "port", "(deprecated, use [url]) Server port", 1704, &settings.server.port);
|
auto port_opt = op.add<Value<size_t>>("p", "port", "(deprecated, use [url]) Server port", 1704, &settings.server.port);
|
||||||
op.add<Value<size_t>>("i", "instance", "Instance id when running multiple instances on the same host", 1, &settings.instance);
|
op.add<Value<size_t>>("i", "instance", "Instance id when running multiple instances on the same host", 1, &settings.instance);
|
||||||
op.add<Value<string>>("", "hostID", "Unique host id, default is MAC address", "", &settings.host_id);
|
op.add<Value<string>>("", "hostID", "Unique host id, default is MAC address", "", &settings.host_id);
|
||||||
auto server_cert_opt = op.add<Implicit<std::filesystem::path>>("", "server-cert", "Verify server with certificate", "default certificates");
|
auto server_cert_opt = op.add<Implicit<std::filesystem::path>>("", "server-cert", "Verify server with certificate", "default certificates");
|
||||||
|
@ -310,13 +310,36 @@ int main(int argc, char** argv)
|
||||||
else
|
else
|
||||||
throw SnapException("Invalid log sink: " + settings.logging.sink);
|
throw SnapException("Invalid log sink: " + settings.logging.sink);
|
||||||
|
|
||||||
|
if (!op.unknown_options().empty())
|
||||||
|
{
|
||||||
|
throw SnapException("Unknown command line argument: '" + op.unknown_options().front() + "'");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (host_opt->is_set() || port_opt->is_set())
|
||||||
|
{
|
||||||
|
LOG(WARNING, LOG_TAG) << "Options '--" << host_opt->long_name() << "' and '--" << port_opt->long_name()
|
||||||
|
<< "' are deprecated. Please add the server URI as last command line argument\n";
|
||||||
|
}
|
||||||
|
|
||||||
if (!op.non_option_args().empty())
|
if (!op.non_option_args().empty())
|
||||||
{
|
{
|
||||||
streamreader::StreamUri uri(op.non_option_args().front());
|
StreamUri uri;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
uri.parse(op.non_option_args().front());
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
throw SnapException("Invalid URI - expected format: \"<scheme>://<host or IP>[:port]\", with 'scheme' on of 'tcp', 'ws' or 'wss'");
|
||||||
|
}
|
||||||
|
if ((uri.scheme != "tcp") && (uri.scheme != "ws") && (uri.scheme != "wss"))
|
||||||
|
throw SnapException("Protocol must be one of 'tcp', 'ws' or 'wss'");
|
||||||
settings.server.host = uri.host;
|
settings.server.host = uri.host;
|
||||||
settings.server.protocol = uri.scheme;
|
settings.server.protocol = uri.scheme;
|
||||||
if (uri.port.has_value())
|
if (uri.port.has_value())
|
||||||
settings.server.port = uri.port.value();
|
settings.server.port = uri.port.value();
|
||||||
|
else if (settings.server.protocol == "tcp")
|
||||||
|
settings.server.port = 1704;
|
||||||
else if (settings.server.protocol == "ws")
|
else if (settings.server.protocol == "ws")
|
||||||
settings.server.port = 1780;
|
settings.server.port = 1780;
|
||||||
else if (settings.server.protocol == "wss")
|
else if (settings.server.protocol == "wss")
|
||||||
|
|
|
@ -34,8 +34,6 @@ namespace strutils = utils::string;
|
||||||
|
|
||||||
static constexpr auto LOG_TAG = "StreamUri";
|
static constexpr auto LOG_TAG = "StreamUri";
|
||||||
|
|
||||||
namespace streamreader
|
|
||||||
{
|
|
||||||
|
|
||||||
StreamUri::StreamUri(const std::string& uri)
|
StreamUri::StreamUri(const std::string& uri)
|
||||||
{
|
{
|
||||||
|
@ -179,5 +177,3 @@ bool StreamUri::operator==(const StreamUri& other) const
|
||||||
return (other.scheme == scheme) && (other.host == host) && (other.port == port) && (other.path == path) && (other.query == query) &&
|
return (other.scheme == scheme) && (other.host == host) && (other.port == port) && (other.path == path) && (other.query == query) &&
|
||||||
(other.fragment == fragment);
|
(other.fragment == fragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace streamreader
|
|
||||||
|
|
|
@ -30,13 +30,12 @@
|
||||||
|
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
|
|
||||||
namespace streamreader
|
|
||||||
{
|
|
||||||
|
|
||||||
/// URI with the general format:
|
/// URI with the general format:
|
||||||
/// scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
|
/// scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
|
||||||
struct StreamUri
|
struct StreamUri
|
||||||
{
|
{
|
||||||
|
/// c'tor
|
||||||
|
StreamUri() = default;
|
||||||
/// c'tor construct from string @p uri
|
/// c'tor construct from string @p uri
|
||||||
explicit StreamUri(const std::string& uri);
|
explicit StreamUri(const std::string& uri);
|
||||||
|
|
||||||
|
@ -79,5 +78,3 @@ struct StreamUri
|
||||||
/// @return true if @p other is equal to this
|
/// @return true if @p other is equal to this
|
||||||
bool operator==(const StreamUri& other) const;
|
bool operator==(const StreamUri& other) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace streamreader
|
|
||||||
|
|
|
@ -224,7 +224,6 @@ TEST_CASE("JWT")
|
||||||
|
|
||||||
TEST_CASE("Uri")
|
TEST_CASE("Uri")
|
||||||
{
|
{
|
||||||
using namespace streamreader;
|
|
||||||
StreamUri uri("pipe:///tmp/snapfifo?name=default&codec=flac");
|
StreamUri uri("pipe:///tmp/snapfifo?name=default&codec=flac");
|
||||||
REQUIRE(uri.scheme == "pipe");
|
REQUIRE(uri.scheme == "pipe");
|
||||||
REQUIRE(uri.path == "/tmp/snapfifo");
|
REQUIRE(uri.path == "/tmp/snapfifo");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue