1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-16 06:15:24 +00:00
Commit Graph

212 Commits

Author SHA1 Message Date
Philipp Schafft
4db6127464 Update: Updated copyright years 2022-03-01 11:17:28 +00:00
Philipp Schafft
6aa937e55f Update: Disable links and player on status page when direct access is not allowed
Closes: #2409
2022-02-28 11:16:34 +00:00
Philipp Schafft
b7e204e3a7 Update: Renamed <no-mount> to <allow-direct-access>
Closes: #2408
2022-02-28 10:56:35 +00:00
Philipp Schafft
7474fb8d8d Feature: Write correct history on initial attach of client 2021-07-26 15:05:54 +00:00
Philipp Schafft
68ace66bd3 Feature: Only move clients that allow navigation according to their history and direction 2021-07-26 15:05:54 +00:00
Philipp Schafft
c60a2113c9 Feature: Made fallback_override an enum 2021-07-26 15:05:54 +00:00
Philipp Schafft
8a91113028 Feature: Correctly navigate clients between mounts 2021-07-26 15:05:54 +00:00
Philipp Schafft
31659b3ed1 Feature: Added identifier to source_t 2021-07-26 15:05:54 +00:00
Philipp Schafft
9e852dae50 Feature: Added a global client list 2021-07-26 15:05:04 +00:00
Philipp Schafft
96d6190dbf Fix: Re-implemented <no-mount>.
Closes: #2335
2020-10-10 13:44:37 +00:00
Philipp Schafft
1a5359025c Fix: Do not allow the source to set random stats values'
If your software depends on those values you likely want to
use the corresponding audio_*-values.
2020-10-09 15:24:31 +00:00
Philipp Schafft
b1c4b9ac49 Update: Updated copyright statements 2020-10-03 08:44:37 +00:00
Philipp Schafft
81bd709acc Fix: Corrected node vs. client 2020-09-30 19:22:36 +00:00
Philipp Schafft
d92c9758a6 Feature: Prepare for support to move single clients 2020-09-30 18:03:18 +00:00
Philipp Schafft
e86a46ee4a Update: Improved statistic update logic a bit 2020-09-30 17:59:54 +00:00
Philipp Schafft
4f56236cbc Fix: Corrected type for id for source_find_client() 2020-09-30 17:59:52 +00:00
Philipp Schafft
55acb32b71 Cleanup: Corrected code style 2020-09-30 17:59:49 +00:00
Philipp Schafft
b2cd834db7 Cleanup: Move lock out of loop as unlock is also outside the loop 2020-09-30 17:59:43 +00:00
Philipp Schafft
833d666803 Cleanup: Deduplicated code for client moves 2020-09-30 17:58:33 +00:00
Philipp Schafft
ade6aef0fd Update: Increased the maximum playlist items default from 4 to 10.
Closes: xiph/icecast-server#2332
2018-07-07 10:08:27 +00:00
Philipp Schafft
7742bf0a21 Fix: Report correct listen URL to client.
The URL is constructed considering Protocol, TLS Mode, Host, and Port.

This considers:
 - The Host:-header as provided by the client,
 - The effective listensocket of the client,
 - Global configuration.

This works for:
 - Playlist generation,
 - Admin authed playlist generation,
 - Stats based XSLT.

It also unifies code:
 - Default stats values.

Not yet included:
 - YP requests.
2018-06-30 13:12:30 +00:00
Philipp Schafft
59cf2ff426 Cleanup: Removed now useless start-of-stream passing code (as much as I found. There is more) 2018-06-19 13:44:07 +00:00
Philipp Schafft
38436c3f6e Update: Abstract body read with client_body_read() and client_body_eof() 2018-06-19 13:44:07 +00:00
Philipp Schafft
ece3786a0a Fix: Check if we actually have source->client->con in case we want to access source->client->con->tls 2018-06-19 13:44:06 +00:00
Philipp Schafft
059bfdc7ce Cleanup: Corrected headers used in code 2018-06-17 12:47:35 +00:00
Philipp Schafft
5c3e7760c5 Cleanup: Corrected headers used in headers 2018-06-17 12:28:38 +00:00
Philipp Schafft
b42378abc4 Feature: Generate errors based on IDs.
This generates error pages based on IDs. This allows to reuse errors
and add more advanced information to them.

This patch also makes Icecast send in plain text OR HTML based
on the clients Accept:-string.
2018-05-07 16:28:46 +00:00
Philipp Schafft
2c32f02083 Update: Code style 2018-04-13 18:48:03 +00:00
Philipp Schafft
a6eb48e44d Update: Abstracted TLS support in tls.c 2017-07-23 13:14:48 +00:00
Philipp Schafft
72075d0d0d Fix: Fixed regression introduced by r19250.
This fixes the regression introduced by r19250 (461a537561).
The fix checks if the source client is actually known before printing it's IP-Address.

See also: #2016
2016-09-04 11:38:07 +00:00
Philipp Schafft
24bc25ec38 Cleanup: fixed some compiler warnings 2015-11-28 11:30:34 +00:00
Marvin Scholz
c35760cd50 Fix possible segfaults when header allocation fails
This fixes some possible segfaults that could happen if the header
(re)allocation fails.
2015-06-06 14:09:44 +02:00
Philipp Schafft
c1f0eaff8a Fix: Fixed some smaller bugs such as leaks and performance improvements.
This is a first commit to correct minor problmes reported by
Denis Denisov. There is likely another commit to correct some more
such problems.

Thank you Denis Denisov.
2015-04-08 09:36:59 +00:00
Philipp Schafft
961453b0de Added config option for history size.
This adds a <max-history> config option to the <mount> section.
Default is a history size of 4.

See: #766
2015-03-28 17:34:35 +00:00
Philipp Schafft
5f77b35d14 Initial patch for playlist history support.
This allows to store a history of played songs along the source
object and report it as part of the status XML.

Additional work needs to be done to make this configurable.
Also format_mp3.c needs work to support this.

A generic song changed handler should be implemented to handle this
in a nice way.
That one should also be the point to call logging_playlist().

See: #766
2015-03-28 16:15:49 +00:00
Thomas B. Ruecker
671c2366cf Fixed log messages and comments
* Reworded many log messages for better understanding.
 * Adjusted some version targets as we won't have a 2.4.2 release.
 * Added some FIXME comments
2015-03-01 16:55:27 +00:00
Philipp Schafft
79cb147c4a Cleanup: unbreak 100-continue a bit.
This tries to unbreak the 100-continue thing a bit.
Proper headers are send in case of 100-continue. Also the 200 OK
was moved to the end of the stream.
The client may even be reused. But I'm not sure we only do
'End of stream' in cases we are not on an undefined state of the
client. Do we as of now support anything that give us EOS without
a fatal socket state (error or shutdown)?

At least this unbreaks 100-continue with active TLS that was broken
as hell as we sent the header in clear over the socket. Not checking
if it was transmitted completly or something. Using lowlevel socket
calls (in contrast to the connection level calls that would have
handled the TLS just fine).

While this seem sto be a huge improvement to the situation I kindly
ask you to do a lot testing on this. Both with SOURCE as well as
PUT clients.
2015-02-10 09:44:11 +00:00
Philipp Schafft
765ceabe81 Fix: Detect socket errors on TLS based source connections 2015-02-07 12:21:31 +00:00
Philipp Schafft
11d5dffd49 Cleanup: Removed tailing spaces 2015-01-10 18:53:44 +00:00
Philipp Schafft
e9a90f9918 Cleanup: converted tabs into spaces 2015-01-10 01:48:15 +00:00
Philipp Schafft
55d429a6c8 Fix: Corrected display of "login" on status page
This corrects the creation of <authenticator> in the status output
and this way fixes the display of login link on status page.
Closes #1939
2014-12-20 09:39:26 +00:00
Philipp Schafft
bdcf008b7c Added <event>: Unified handling of events.
<event> has been added and can be used within <kartoffelsalat>
both in <icecast> and <mount>.
<event> takes backend depending <option> child tags.
Currently supported backends:
 - log: send message to error log.
 - exec: executes a program or script.
 - url: delivers the event via HTTP.

within <mount> <on-connect> and <on-disconnect> has been replaced by
<event>. Config parser can on-the-fly convert old tags.
Also <authentication type="url"> within <mount> has been fixed
for those cases with <option name="mount_add" .../> and
<option name="mount_remove" .../> which are now on-the-fly converted
by the parser to corresponding <event> tags.

Please also see TAGs added as per #2098. Some include hints for
documentation updates needed after this change. Those updates
should take place before 2.4.2.
2014-12-08 00:39:57 +00:00
Marvin Scholz
1bf41cfdb6 Epic Git migration commit
Added .gitignore and submodules
Changed paths to match new location of things
2014-12-02 22:50:57 +01:00
Philipp Schafft
93194594f7 better coding style, patch by ePirat. refs #2059
svn path=/icecast/trunk/icecast/; revision=19376
2014-11-30 20:32:30 +00:00
Philipp Schafft
a642cac542 Wow. Mega patch!
This patch *replaces* the authentication system completly.

What is new:
 - <authentication> in mount section is now a container object.
 - <authentication> in root and mount section may hold any number of <role>-Tags.
 - <role> tags:
   Those tags define a 'role' and it's ACL rules.
   A role is a instance of an authentication module (see below).
   <role> takes the following options. All but type are optional.
   - authentication related:
     - type: Type of the authentication module (values: anonymous, static, legacy-password, url or htpasswd;
             symbolic constants in auth.h)
     - name: Name for the role. For later matching. (values: any string; default: (none))
     - method: This rule is only active on the given list of HTTP methods.
               (list of enum values: methods as recognized by httpp/ (e.g: get,post); default: *)
   - ACL related:
     - allow-method: Allowed HTTP methods.
       (list of enum values: methods as recognized by httpp/ (e.g: get,post); default: get)
     - deny-method: Rejected HTTP methods.
       (list of enum values: methods as recognized by httpp/ (e.g: get,post); default: *)
     - allow-admin: Allowed admin commands. (list of enum values: admin command; default: buildm3u)
     - deny-admin: Rejected admin commands. (list of enum values: admin command; default: *)
     - allow-web: Allowed web pages. (values: empty or *; default: *)
     - deny-web: Rejected web pages. (values: empty or *; default: (empty))
     - connections-per-user: maximum number of simultaneous connections per role and username.
       This is only active on active sources.  (values: unlimited or number of connections; default: unlimited)
     - connection-duration: maximum time of a connection. This is only active on active sources.
       (values: unlimited or number of secounds; default: unlimited)
   <role> takes <option> child tags. <option> tags contain a name and a value option.
   Meaning of <option> tags is up to the authentication module.
 - <role>s are considered to build a stack. If a role returns with AUTH_NOMATCH the next one will be tried.
 - <role>s are tested in this order: mount specific, default mount specific, global, internal fallback.
   Internal fallback is set to allow web/ access via GET, POST and HEAD (only GET supported by this time)
   and rejects all other requests.
 - New authentication module: anonymous
   This module matches all requests. No options taken.
 - New authentication module: static
   This module matches with a static username and password.
   It takes two <option>s. One with name="username" and one with name="password" to set username and password.
   This replaces old style <*-username> and <*-password> tags.
 - New authentication module: legacy-password
   This module matches with a statich password.
   It takes one <option> with name="password" to set password.
   This replaces old ICE and ICY (shoutcast compat mode) authentication.
 - Parsing <authentication> in <mount> with a type set in a special way to allow 100% backward compatibility.
 - Parsing of <source-password>, <admin-password>, <admin-user>, <relay-password> and <relay-user> in global
   <authentication> for 100% backward compatibility.
 - <alias> is now proccessed very early. This enables them to be used for all kinds of requests.

To Do List & What does not yet work:
 - type="url" auth: mount_add and mount_remove.
   This should be replaced by an unique feature I would call '<event>'.
 - Admin commands manageauth and manageauth.xsl are disabled as they need more review:
   This code needs to be ported to support multiple <role>s per <mount>.
 - url authentication module can not yet return AUTH_NOMATCH.
   This needs to be reviewed and discussed on how to handle this case best way.
 - Default config files needs to be updated to reflect the changes.
   As this is quite some political act it should be done in dicussion with the whole team
   and permission of the release manager.
 - Docs need to be updated to reflect the changes.

How does it work:
 Code has been changed so that authentification is done early for all clients.
 This allows accessing the ACL data (client->acl) from nearly everywhere in the code.

 After accept() and initial client setup the request is parsed. In the next step
 all <alias>es are resolved. After this the client is passed for authentication.
 After authentication it is passed to the corresponding subsystem depending on kind of request.

 All authentication instances have a thread running for doing the authentication.
 This thread works on a queue of clients.

Hints for testers:
 - Test with default config.
 - Test with diffrent authentication modules in <mount>.
 - Test shoutcast compatibility mode.
 - Test with new style <authentication> and any amount of <role> (zero to quite some).
 - Test <alias> lookup on all kinds of objects.
 - Test source level credential login into the admin interface.
 - Test shoucast style meta data updates.
 - Test playlist generation.

Thank you for reading this long commit message. Have fun reading the full patch!

svn path=/icecast/trunk/icecast/; revision=19358
2014-11-28 23:46:08 +00:00
Philipp Schafft
0df154f3bf remove client_send_[0-9]{3}() in favor of client_send_error(). Please test
svn path=/icecast/trunk/icecast/; revision=19344
2014-11-21 18:05:17 +00:00
Philipp Schafft
558cff06d9 (sync with my branch) Updated handling of <on-connect> and <on-disconnect> in <mount>, see r19305:r19312, refs #1354, #2089, #2087, #1752
svn path=/icecast/trunk/icecast/; revision=19340
2014-11-21 09:28:29 +00:00
ePirat
95e7e42b49 Set PATH_MAX to 4096 if not defined (patch by Svante Signell <svante.signell@gmail.com>)
See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=767542

svn path=/icecast/trunk/icecast/; revision=19321
2014-11-19 11:30:58 +00:00
Philipp Schafft
baee2d0c7f subset of my earlier patch so it can go into 2.4.1: disconnects stdio of <on-[dis]connect> scripts from random filehandles. closes #2087
svn path=/icecast/trunk/icecast/; revision=19313
2014-11-17 19:20:57 +00:00
Philipp Schafft
e6ce60e630 rename ICE_LISTEN_QUEUE, ICE_RUNNING and ICE_HALTING so they have a prefix of ICECAST_
svn path=/icecast/trunk/icecast/; revision=19258
2014-10-31 09:00:45 +00:00