Implement XDG compliance, logging, and improved 401 error handling

- Install to ~/.local/bin/winamp-mpris
- Use ~/.local/state/winamp-mpris/bridge.log for logging
- Use $XDG_RUNTIME_DIR/winamp-mpris.pid for PID management
- Add detailed user notification for 401 Unauthorized errors
- Add install.sh for automated, standard-compliant setup
- Include Winamp Web Interface source code and installer in repository
This commit is contained in:
2026-04-08 18:29:40 -04:00
parent 1e9257a27f
commit 22492dbee9
120 changed files with 9092 additions and 10 deletions

231
Wawi Source/Wawi_Readme.txt Normal file
View File

@@ -0,0 +1,231 @@
----------------------
Winamp Web Interface
----------------------
WAWI is a plugin which gives you remote control of Winamp from any computer which can access it over a network with any common-or-garden web browser. It lets you have full control over immediate playback, lets you edit the playlist and add songs
from your music collection, all without touching the computer actually running winamp or installing anything on the client computer.
Using It
--------
Install the plugin and point your browser at your computer. By default it runs on the normal web server port 80, but that can be changed in the Options->Server window. For example, at your own computer http://localhost/ should bring it up. If you change the port you can use http://localhost:xxxx instead, where xxxx is the port number. The main screen should appear; from there everything is linked so you can control winamp, access the playlist etc.
To start with you can't actually do much; you need to set up some permissions first. Do this in the Options -> Users window.
Adding Users
------------
Initially there is just one user listed, 'anon'... this is anyone who hasn't logged in using a different name. It does not have a password, and to start with has no permissions; change permissions by clicking on the boxes for what you want anyone to be able to do, and click 'Add/Update'.
To add a new user, maybe to let you control winamp but only let others look but not touch, type in a username in the 'user' box and a password in the 'password' box, check the desired access permissions, and click 'Add/Update'. Bingo, a new user.
Delete a user by clicking on the name in the list or typing the name straight into the 'user' box and click 'Delete'. Gone...
Different Modes for Different Browsers
--------------------------------------
The default mode is using two frames, one for the black bar along the top with the blue buttons and the main frame which displays the pages.
If you're using a no-frames browser select 'One Frame' in the Options->Web Page window. This will disable the top frame, and instead have a set of text links on each page to navigate around pages.
If you are using the interface from a PDA or something with a similarly small screen, there is a special small page with the basic controls on it, which lets you change the state of Random and Repeat and control playback. Point your browser at '/pda' to access this page.
The three frames mode is currently experimental but I think it works properly. This is similar to the two frame mode but with another frame at the bottom which updates with the song title and allows the main page to stay where it is when loading files or playing songs in the playlist.
Keeping track of what goes on
-----------------------------
The plugin keeps a log of who's been accessing the interface. By default this is kept in a file in the winamp 'plugins' directory called 'httpsrv.log'. Once this log file reaches 50KB it is renamed to 'httpsrv_<date>_<number>.log', for example the second full log file generated on the 12th of April 2002 will be named 'httpsrv_12-4-2002_2.log'.
The log file stores the time of the connection, the IP address and username of the client, the page they requested and the HTTP return code, for example '200' is a successful operation and '401' is when access is not allowed to a page or function.
Your Music Collection
---------------------
The web interface can load files into winamp from a directory specified as your music collection. Enter the path of your music collection into the box in the options screen, make sure you have the right access permission, and go load songs.
The contents of each directory are listed in a fairly self explanatory manner. Clicking on the name of a file or the icon next to it will load a file into winamp. Clicking on the name of a directory or the icon of a folder will browse that directory. Clicking on the icon of a folder with a red plus sign will add the entire contents of the folder to the playlist.
If downloading files is enabled, clicking on the icon of a disk will download a file onto the user's computer. Change this setting from the Options window.
Files that the interface should be able to load can be specified in the Options->Music Collection window; enter the extension of a file into the 'Filetypes' box to enable loading it from the interface. For example the default is 'wav mp3 m3u url', which allows MP3 files, Wave files, Winamp playlists and Internet Shortcuts to be loaded.
Internet Shortcut files appear with an icon of a world; loading these will load the target of the shortcut into the winamp playlist. This is useful if you make a shortcut to an internet radio station, for example.
Tinkering with how it looks
---------------------------
To alter the look of the page you can define your own Stylesheet to be sent along with the pages, if for example you are integrating it into another website or simply want to change how it looks. If there is a stylesheet in the winamp plugins directory called 'wawi.css' it will be used. If there isn't one there the default built-in stylesheet will be used instead.
Errors
------
If you've not told it to keep quiet it will pop up a message if it can't open the specified port. This is usually because there's another program using it - check you haven't got another web server running, as the default port for the plugin is the standard web port. If this is the case change it in the Config window for the plugin. If you tell it to not bother you if an error occurs it will sit quietly doing nothing.
Bugs
----
Hopefully the problem with MD5 passwords should be fixed now, after I finally got my hands on a computer that it wouldn't work on. However just in case it crops up again... sometimes it will not let you log in if passwords are being stored securely. If this seems to be the case tick the "debug" box and see what it says when adding a user or changing a password; if it says something like "encoded password" and a short string of gibberish (rather than a long string of alphanumerical gibberish) then please let me know about it! In the meantime, untick the secure mode; this should work. The difference is how the password is stored on your computer, not how it is sent over the network.
It was designed mainly using IE6 as a client... while Netscape and Lynx like it, Opera 6 seems to have a few problems; the currently playing track is not highlighted in the playlist; the main page doesn't update properly when selecting a track from the playlist to play. I shall look into it.
The 'download' function didn't work for me on Windows 9x; it has been fiddled with extensively but given that I now run Windows 2000 I have no way of testing it any more. It works on 2000. The interface uses the same method to send a StyleSheet for the web pages; while downloading files is not essential this probably is; let me know if it goes wrong and I'll try to fix it.
There're bound to be more... let me know if you find any.
Possibly More Recent Versions
-----------------------------
At the moment (April 2002) I am working on this regularly, so a new version is uploaded to the WAWI web site frequently. Check there for recent versions including bug fixes and new features. Wander over to www.flippet.net...
Test Platforms so far
---------------------
Development started on a Windows Me system, but now is done entirely on Windows 2000. Platforms I know it has been used on are now too numerous to name individually, but range from various versions of windows to PDAs. I feel quite boring using it from my laptop...
Change Log
----------
7.5.10
* Fixed the silly thing with the "browse" pages if you didn't give it a path to start with - it would show the root directory but none of the links would work.
7.5.9
* Secure passwords should now work ALL the time!!! Woohoo!!! (Hopefully...)
7.5.8
* Fixed the Base64 password system AGAIN, hopefully for the last time!
7.5.7
* Fixed which frame the new Delete went to (now stays in one frame; bit daft deleting something but not updating the playlist...
* Added a line in the HTTP header of HTML pages to stop the page being cached (hopefully)
* Made the 'random' and 'repeat' stay on the main page (again, a bit daft turning random off if the main page says it's still on and the like)
7.5.6
* Fixed the Base64 encoding/decoding, which hopefully should solve some password problems.
* Changed how delete playlist entry works - should be faster now, hopefully.
7.5.5
* Added a Save Playlist option
* Fixed a little bug if you tried to use a password of 'password' (muppet... ;¬P )
7.5
* Shiny new Options window; pretty pictures and pages, rather than having all options crammed onto one page
7.1
* First half-decent three frames mode!
* Ability to sort the playlist by title from the playlist page
7.0.1
* Fixed bug where there were no users in the list when first installing it
* Cleaned up the delete playlist entries function a bit
7.0
* Define your own stylesheet... if there's a file called 'wawi.css' in the plugins directory it will be used as a stylesheet.
* Ability to remove tracks from the playlist
* First introduction of web-based user management page, accessible from the 'admin' page. I think it looks funny on Opera though... I'll fix it shortly...
* Fixed bug where it would not save changes from the web admin page
* Slight under-the-hood change of page refreshing on adding files from the Browse pages
* Addded a 'PDA' mode for simple controls on small browsers - just point at '/pda'
* Added a password debug mode; if you have problems let me know what it says.
* Made it work again on w9x (sorry...)
* Certain options can be changed from the web interface with a new Admin page.
* When loading a file from the Browse page it will now return to the page where you clicked, instead of having to navigate back to it again.
* Option of using secure or non-secure passwords if you encounter problems.
6.0
* Added a 'restrict search' option; narrow your search of the playlist. I find it very handy.
* It now uses escape characters properly, so it should work on more browsers (the file browsing didn't work on Lynx before).
* 'View Log' button works wherever the log file directory is set to
* Massive, but under the hood, changes; any variables passed to the server are in the proper 'name=value' format, so they can be used from forms.
* Icons in the Browse section don't have silly backgrounds. At last!
5
* Added a completely new authentication system. You can set up users with different permissions - browse files, download files, add files to the playlist, clear the playlist and actually control playback.
* Added a favicon.ico so if you make it a Favourite you'll get a nice pwetty picture. Wow...
4
* Added a 'play URL immediately' option. Load a normal URL using /url?l&http://whatever, and play one immediately by /url?p&http://whatever.
* Requesting '/title' from the server returns a very simple page with just the currently playing song title, and which refreshes every minute.
* Requesting 'smalltitle' returns something similar, but it's just dead simple plain text version of the song info, so it can be included in another page or something along those lines.
* Directories have a 'play' button so you can load songs a directory at a time rather than a file at a time (which took ages!)
* Made links work properly in browsers that didn't convert spaces to %20s (eg. Lynx). There are probably other characters in names that don't work... if you find any, let me know.
* Added an (unlinked) url? command, which can play any filepath, UNC path, HTTP file, you name it. Just type it in... "/url?http://computer/path/to/song.mp3" and (hopefully) it'll work.
* Improved log handling - logs are rotated if they get big
* The popup window link works properly now and can be added to your Favourites or Bookmarks or whatever.
* Added an option to turn off the password protection if it annoys you and you've no need for it.
* Added a 'Stop with fadeout' button to the graphic link bar. It's not on the text link bar, but you can still use it if you must by typing in "/stopslow" in the Address bar of your browser.
* Passwords! Stop peeps messing... properly.
* A button to load the interface in a smaller popup window without the normal browser baggage like buttons and stuff. Still experimental, but it's there.
* The bar at the top is now a seperate frame to avoid having it reload the images every time.
* It also has a text only (well, mostly) mode if you don't like the top links at all; this makes it look like it did before version 3.0.
3
* A nice shiny bar at the top instead of the old text links bar. Popup about window; customisable title; and slightly better html.
* Under-the-hood changes; includes better http parsing, and should be faster too. Doesn't crash my network card any more! Also includes a small 'about' window from the browser, and lets you put your own title in for the main page.
* Wooo, shiny... now includes graphics in the Music Collection pages. Playlists (.m3u files) are handled better too.
* First submitted to winamp.com!
* The file types that can be loaded into winamp from the Browse section can now be chosen in the Options window. By default .wav and .mp3 files are loadable. Other filetypes can be displayed or hidden as desired. The access log file can also be viewed from within Winamp by clicking the View Log button in the options window.
* Now creates a log file with every connection, showing time, client and requested URL. Stored in a file in the plugins directory; I know several plugins where the log file ends up all over the place...
* Mainly under-the-hood changes; should be safer with multiple connections. More obvious directories in Browse pages. Got rid of server bluescreening problem!
* Added 'Read Only' option to stop people fiddling if you don't want them to.
2
* Added file browsing and adding.
* Added html stylesheets, proper html and random things to make it look nice
1
* Initial release
Me
--
Phil Himsworth, UK
web: http://www.flippet.org
email: contact@flippet.net
September, 2002
The Dull(er?) Bits
------------------
Disclaimer
----------
While I've gone to every effort to make sure this doesn't cause harmful effects - I don't want to fry my own computer! - I cannot say for sure that it will not fry yours. I will not be responsible for any damage or loss of anything even slightly relating to this program. You use it ENTIRELY AT YOUR OWN RISK. Don't run to me if things break. I'll fix bits of the program if you spot bugs if I want to, but I'm under no obligation to do so at all. And don't you forget it.
Besides that, I hope it's useful. Have fun!