Coder Social home page Coder Social logo

mwarning / p2p-gui Goto Github PK

View Code? Open in Web Editor NEW
14.0 4.0 3.0 1.63 MB

A remote web interface for MLdonkey, aMule, rTorrent, Transmission and giFT.

Home Page: http://p2p-gui.sourceforge.net/

Makefile 0.53% D 78.86% JavaScript 13.16% CSS 4.72% HTML 2.72%
mldonkey amule gift rtorrent

p2p-gui's Introduction

P2P-GUI

P2P-GUI is a grahical web interface to control multiple P2P-applications. It also added a layer to support multiple user accounts Some Screenshots.

This project was big and a mostly complete (multiple protocols/GUIs/Skins/Translations). But it was abandoned because the the D environment changed a lot and the authors interests changed. Still, this project has a lot of interesting code.

  • Supports MLDonkey/aMule/rTorrent and giFT (uses the remote GUI protocol!)
  • Integrated web server
  • Everything combined in a single binary (!)
  • No installation needed
  • Download & Run
  • Multi user account support
  • HTTPS support
  • UTF-8 support
  • Written in D + CSS/JS/HTML
  • Download unfinished files for preview
  • Three different web GUIs
    • Plex:
      • Server side and HTML based.
      • Languages:
        • English
        • French
        • German
        • Italian
        • Spanish
        • Polish
        • Galician
        • Brazilian Portuguese
        • Dutch
        • Danish
        • Swedish
      • Themes.
      • File browser.
      • User management.
      • Country flags for IPs
      • rot13 and l33t text transform ;-)
    • Clutch:
      • Browser side Javascript gui.
      • Copied from the Transmission web interface.
      • Slick design.
      • English only.
    • Jay:
      • Browser side JavaScript gui.
      • Uses the JSON rpc api.
      • Country flags for IP addresses.
      • Still alpha.

About

P2P-GUI is licensed under GNU General Public License.
See gpl-3.0.txt for license details.
Parts of this program may rely on other (GPL compatible) licenses.

Authors:

Compiling:

Following programs and libraries are needed in order to compile P2P-GUI:
  - a D compiler: DMD (v1.041+, v1.047 doesn't work, http://digitalmars.com/d), LDC (http://dsource.prg/projects/ldc) or GDC-svn
  - the Tango library (svn version, http://dsource.org/projects/tango)
  - zlib library
  - OpenSSL library
  - make or rebuild (http://dsource.org/projects/DSSS)

Building using make

Linux

For compiling you need to use the Makefile. make dmd-linux

Windows

You also need to use MinGW+MSYS to build the binary. In the MSYS enviroment: make dmd-win

DSSS

You can also use DSSS (http://dsource.org/projects/dsss/): dsss build

Including theme files into binary

To include all files from theme directory into the binary, you need to compile the ./utils/Includer.d helper program. Then execute it from inside of the ./webroot/ folder: ./Includer ../webcore/Webroot.d *

All visible files will now included in core/Webroot.d. After compiling P2P-GUI, there will be no more disk access to ./webroot by default.

Change Translations:

You have two ways to alter/add translations:

Use the HTML GUI.

Enable the Translator panel in the html gui and alter translations there.
To contribute new languages or improvements, please send back the exported string.

Alter the source code.

Translations are keep in ./core/Dictionary.d. The Phrase enum definitions list all phrases used in P2P-GUI. To alter translations just imitate the structure as for the other languages.

In order to add a new language, you must modify ./core/Dictionary.d:

  • add a Phrase for your new language to the Phrase enum declarartion
  • add the language Phrase to all_languages
  • create a new translation by imitating the structure of the other languages

Compile the program from your altered source. The new language can now be selected in the web gui.

Modify Included files

Included files are CSS, image, (static) HTML or JavaScript GUI files. For every release all files from the ./webroot/ directory are included into the binary. This is done by writing the file data into a D source file (./webcore/Webroot.d) with a helper tool (./utils/Includer.d).

P2P-GUI ignores included files and uses an external directory if it's specified on the command line ("p2p-gui -d ") or if a directory called ./webroot/ is located in the settings directory. This is comfortable to edit these files and to see changes immediately.

If you want to get the files out of the binary. Use "p2p-gui --write-out-files [<target_directory>]" to write all files to the disk.

Source Code Structure

P2P-GUI consists of several parts

  • ./api/ an API to describe the p2p network environment entities and relationships
    • /clients/ - several client interfaces on top of the api
    • ./webserver/ - a webserver to serve data
    • ./webroot/ - repository of files in for html, css, js or image files to be severed by the webserver
    • ./webguis/ - server side code for GUIs
      • ./clutch/: interface for the Transmission web ui
      • ...
  • ./webcore/ - core files
    • Main.d: glues everything together
    • MainUser.d: implements accounts
    • MainSettings.d: wrapper for settings that conforms the api
    • DiskFile.d: wrapper for file system access that conforms the api
    • Dictionary.d: translations
    • Webroot.d: a container/accessor for files to be included into the binary
    • JsonRPC.d: a JSON RPC interface for the api (not JSON-RPC compatible)
    • ...
  • ./utils/ - several helpful stuff
    • Selector.d: a socket handler to watch over socket events
    • Timer.d: a timer to call functions in x seconds or in intervals
    • GeoIP.d: an interface for GeoIP databases
    • Utils.d: a collection of helpful tools
    • Includer.d: a helper program to copy files and directories into a source file (Webroot.d)
    • Storage.d: wrapper around a JSON based storage to store settings in files

p2p-gui's People

Contributors

mwarning avatar orthographic-pedant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

p2p-gui's Issues

Help needed with building

Hello! I've recently run into this project and indeed found it contain a lot of interesting code.

I was mainly interested in it as a replacement for aMule's own web interface which doesn't work very well in my experience. I understand that this codebase is really old, so it might not be much of an improvement. However, I wanted to give it a try, if anything to learn about aMule's EC protocol. The binary releases are, of course, really old so they're no good for a modern Linux install, as they're linked with ancient versions of shared libraries. So anyway, I started blasting building.

I came across a good set of instructions on how to set up a D1 build environment with Tango here:
https://www.dsource.org/projects/tango/wiki/ManualLinuxInstall

I've been using a Dockerfile for this based on Debian Bookworm, with the latest release of D1 to avoid certain compiler bugs and the latest Tango trunk. This allows for compilation of p2p-gui's master (almost), I have to remove a single private access modifier in api/File.d, but after that it works... until it gets to linking, and here's where I get stuck with this:

#6 3.554 dmd -ofp2p-gui-linux webserver/HttpServer.d webserver/HttpResponse.d webserver/HttpRequest.d utils/Utils.d utils/GeoIP.d utils/Timer.d utils/Selector.d utils/Storage.d utils/Debug.d utils/json/JsonAdditional.d utils/json/JsonParser.d utils/json/JsonBuilder.d webcore/Main.d webcore/MainUser.d webcore/UserManager.d webcore/DiskFile.d webcore/Webroot.d webcore/SettingsWrapper.d webcore/Dictionary.d webcore/JsonRPC.d webcore/Session.d webcore/SessionManager.d webcore/ClientManager.d webcore/Logger.d  api/Client.d api/Host.d api/Node.d api/Node_.d api/File.d api/File_.d api/Meta.d api/Setting.d api/Connection.d api/User.d api/User_.d api/Search.d api/Search_.d  clients/mldonkey/MLDonkey.d clients/mldonkey/InBuffer.d clients/mldonkey/OutBuffer.d clients/mldonkey/MLUtils.d clients/mldonkey/model/MLConsoleLine.d clients/mldonkey/model/MLTags.d clients/mldonkey/model/MLAddr.d clients/mldonkey/model/MLFileInfo.d clients/mldonkey/model/MLNetworkInfo.d clients/mldonkey/model/MLFileFormat.d clients/mldonkey/model/MLServerInfo.d clients/mldonkey/model/MLClientInfo.d clients/mldonkey/model/MLClientKind.d clients/mldonkey/model/MLClientState.d clients/mldonkey/model/MLSearch.d clients/mldonkey/model/MLResult.d clients/mldonkey/model/MLSharedFile.d clients/mldonkey/model/MLSetting.d clients/mldonkey/model/MLPartFile.d  clients/amule/aMule.d clients/amule/ECPacket.d clients/amule/ECTag.d clients/amule/ECCodes.d clients/amule/RLE_Data.d clients/amule/Utf8_Numbers.d clients/amule/model/AFileInfo.d clients/amule/model/AServerInfo.d clients/amule/model/AResultInfo.d clients/amule/model/ASearchInfo.d clients/amule/model/APreference.d clients/amule/model/AClientInfo.d  clients/rtorrent/rTorrent.d clients/rtorrent/XmlOutput.d clients/rtorrent/XmlInput.d clients/rtorrent/rDownload.d clients/rtorrent/rSetting.d clients/rtorrent/rTracker.d clients/rtorrent/rPeer.d  clients/gift/giFT.d clients/gift/giFTParser.d clients/gift/model/giFTFile.d clients/gift/model/giFTSearch.d clients/gift/model/giFTResult.d clients/gift/model/giFTNetwork.d  clients/transmission/Transmission.d clients/transmission/TTorrent.d clients/transmission/TTracker.d clients/transmission/TFile.d clients/transmission/TPeer.d clients/transmission/TSetting.d  webguis/plex/PlexGui.d webguis/plex/HtmlElement.d webguis/plex/HtmlUtils.d webguis/plex/HtmlSettings.d webguis/plex/HtmlFileBrowser.d webguis/plex/HtmlDownloads.d webguis/plex/HtmlServers.d webguis/plex/HtmlClients.d webguis/plex/HtmlTitlebar.d webguis/plex/HtmlConsole.d webguis/plex/HtmlContainer.d webguis/plex/HtmlSearches.d webguis/plex/HtmlPageRefresh.d webguis/plex/HtmlUserManagement.d webguis/plex/HtmlClientSettings.d webguis/plex/HtmlModuleSettings.d webguis/plex/HtmlUserSettings.d webguis/plex/HtmlAddLinks.d webguis/plex/HtmlUploads.d webguis/plex/HtmlQuickConnect.d webguis/plex/HtmlTranslator.d webguis/plex/HtmlLogout.d  webguis/jay/JayGui.d  webguis/clutch/ClutchGui.d    -version=Tango -version=JAY_GUI -version=PLEX_GUI -version=CLUTCH_GUI -version=MLDONKEY -version=AMULE -version=RTORRENT -version=GIFT -version=TRANSMISSION -L-L/usr/lib -I/usr/include -L-lz -L-lssl
#6 3.943 /usr/bin/ld: /opt/dmd/bin/../lib/libtango.a(tango-io-stream-Zlib-release.o): in function `_D5tango2io6stream4Zlib9ZlibInput4readMFAvZm':
#6 3.943 ./tango/io/stream/Zlib.d:(.text._D5tango2io6stream4Zlib9ZlibInput4readMFAvZm+0x94): undefined reference to `inflate'
#6 3.943 /usr/bin/ld: /opt/dmd/bin/../lib/libtango.a(tango-io-stream-Zlib-release.o): in function `_D5tango2io6stream4Zlib9ZlibInput7kill_zsMFZv':
#6 3.943 ./tango/io/stream/Zlib.d:(.text._D5tango2io6stream4Zlib9ZlibInput7kill_zsMFZv+0x1a): undefined reference to `inflateEnd'
#6 3.943 /usr/bin/ld: /opt/dmd/bin/../lib/libtango.a(tango-io-stream-Zlib-release.o): in function `_D5tango2io6stream4Zlib10ZlibOutput5writeMFAvZm':
#6 3.943 ./tango/io/stream/Zlib.d:(.text._D5tango2io6stream4Zlib10ZlibOutput5writeMFAvZm+0x56): undefined reference to `deflate'
#6 3.943 /usr/bin/ld: /opt/dmd/bin/../lib/libtango.a(tango-io-stream-Zlib-release.o): in function `_D5tango2io6stream4Zlib10ZlibOutput6commitMFZv':
#6 3.943 ./tango/io/stream/Zlib.d:(.text._D5tango2io6stream4Zlib10ZlibOutput6commitMFZv+0x56): undefined reference to `deflate'
#6 3.943 /usr/bin/ld: /opt/dmd/bin/../lib/libtango.a(tango-io-stream-Zlib-release.o): in function `_D5tango2io6stream4Zlib10ZlibOutput7kill_zsMFZv':
#6 3.943 ./tango/io/stream/Zlib.d:(.text._D5tango2io6stream4Zlib10ZlibOutput7kill_zsMFZv+0x1a): undefined reference to `deflateEnd'
#6 3.943 /usr/bin/ld: /opt/dmd/bin/../lib/libtango.a(tango-util-compress-c-zlib-release.o): in function `_D5tango4util8compress1c4zlib11deflateInitFPS5tango4util8compress1c4zlib8z_streamiZi':
#6 3.944 ./tango/util/compress/c/zlib.d:(.text._D5tango4util8compress1c4zlib11deflateInitFPS5tango4util8compress1c4zlib8z_streamiZi+0x23): undefined reference to `deflateInit_'
#6 3.944 /usr/bin/ld: /opt/dmd/bin/../lib/libtango.a(tango-util-compress-c-zlib-release.o): in function `_D5tango4util8compress1c4zlib11inflateInitFPS5tango4util8compress1c4zlib8z_streamZi':
#6 3.944 ./tango/util/compress/c/zlib.d:(.text._D5tango4util8compress1c4zlib11inflateInitFPS5tango4util8compress1c4zlib8z_streamZi+0x18): undefined reference to `inflateInit_'
#6 3.944 /usr/bin/ld: /opt/dmd/bin/../lib/libtango.a(tango-util-compress-c-zlib-release.o): in function `_D5tango4util8compress1c4zlib12deflateInit2FPS5tango4util8compress1c4zlib8z_streamiiiiiZi':
#6 3.944 ./tango/util/compress/c/zlib.d:(.text._D5tango4util8compress1c4zlib12deflateInit2FPS5tango4util8compress1c4zlib8z_streamiiiiiZi+0x34): undefined reference to `deflateInit2_'
#6 3.944 /usr/bin/ld: /opt/dmd/bin/../lib/libtango.a(tango-util-compress-c-zlib-release.o): in function `_D5tango4util8compress1c4zlib12inflateInit2FPS5tango4util8compress1c4zlib8z_streamiZi':
#6 3.944 ./tango/util/compress/c/zlib.d:(.text._D5tango4util8compress1c4zlib12inflateInit2FPS5tango4util8compress1c4zlib8z_streamiZi+0x23): undefined reference to `inflateInit2_'
#6 3.944 /usr/bin/ld: /opt/dmd/bin/../lib/libtango.a(tango-util-compress-c-zlib-release.o): in function `_D5tango4util8compress1c4zlib15inflateBackInitFPS5tango4util8compress1c4zlib8z_streamiPhZi':
#6 3.945 ./tango/util/compress/c/zlib.d:(.text._D5tango4util8compress1c4zlib15inflateBackInitFPS5tango4util8compress1c4zlib8z_streamiPhZi+0x24): undefined reference to `inflateBackInit_'
#6 3.945 collect2: error: ld returned 1 exit status
#6 3.945 --- errorlevel 1
#6 3.950 make: *** [Makefile:183: dmd-linux] Error 1

At a glance, it seems easy enough. Surely ld is just unable to find zlib, but nope. If we add -L--verbose to dmd's flags in dmd.conf, we see the following:

#6 4.193 attempt to open /usr/lib/libz.so failed
#6 4.193 attempt to open /usr/lib/libz.a failed
#6 4.193 attempt to open /opt/dmd/bin/../lib/libz.so failed
#6 4.193 attempt to open /opt/dmd/bin/../lib/libz.a failed
#6 4.193 attempt to open /usr/lib/gcc/x86_64-linux-gnu/12/libz.so failed
#6 4.193 attempt to open /usr/lib/gcc/x86_64-linux-gnu/12/libz.a failed
#6 4.193 attempt to open /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/libz.so succeeded
#6 4.193 /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/libz.so

Which seems to indicate that it is in fact finding the right object file for it, and -lz is the very last of DMD's linker options in the Makefile, which is supported by the advice I was able to find online, so I'm very much stumped here.

I have considered the fact that perhaps the zlib function definitions that Tango is trying to import have changed between the version it references (1.2.3) and the latest version (1.2.13). Unfortunately, I wasn't able to spot any significant changes in zlib.h.
In addition, manually installing zlib1g and zlib1g-dev 1.2.3 from archive.debian.org didn't make a difference.

This is the aforementioned Dockerfile I'm using: https://gist.github.com/puigru/608f94da8079b3e2d6d169bf62d16641

I've also tried to build it with both the DMD and LDC bundles of the latest version of Tango (0.99.9):
http://downloads.dsource.org/projects/tango/0.99.9/tango-0.99.9-bin-linux-with-dmd.1.056.tar.gz (with a 32-bit toolchain)
http://downloads.dsource.org/projects/tango/0.99.9/tango-0.99.9-bin-linux64-with-ldc.1.056.tar.gz
This requires a version of p2p-gui prior to ca3c57c. Sadly, the end result was the same.

As a last ditch effort, I replaced /usr/bin/ld with a copy of lld. This actually resulted in a binary file. However, it immedially segfaults, inspecting it with nm reveals that many imported symbols (including those of zlib) are not linked properly, output. So the segfault is not very surprising.

I'd really appreciate if you could take a look and share any insight. This is my first time attempting to build a D project (interesting pick, I know).

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.