Giter Site home page Giter Site logo

dannyarends / danode Goto Github PK

View Code? Open in Web Editor NEW
60.0 60.0 2.0 478 KB

Small and flexible web server written using the D 2.0 language

Home Page: https://www.dannyarends.nl

License: GNU General Public License v3.0

Perl 1.33% Shell 2.07% D 91.77% PHP 2.61% R 1.34% HTML 0.44% Ada 0.18% Brainfuck 0.18% CSS 0.07%
d dlang dub framework sni ssl standalone web webserver

danode's People

Contributors

dannyarends avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

danode's Issues

"dub build" doesn't compile - dmd failed with exit code 1.

@DannyArends

λ cd .\Temp\Git
​C:\Temp\Git

λ git clone https://github.com/DannyArends/DaNode.git
Cloning into 'DaNode'...
remote: Enumerating objects: 35, done.
remote: Counting objects: 100% (35/35), done.
remote: Compressing objects: 100% (24/24), done.
Rremote: Total 2006 (delta 17), reused 24 (delta 11), pack-reused 1971eceiving objects: 99% (1986/2006)
Receiving objects: 100% (2006/2006), 419.11 KiB | 1.15 MiB/s, done.
Resolving deltas: 100% (1356/1356), done.

λ cd DaNode
​C:\Temp\Git\DaNode [master ≡]

λ dub build
Performing "debug" build using dmd for x86_64.
danode ~master: building configuration "default"...
danode\cgi.d(110,58): Error: template std.math.fmin cannot deduce function from argument types !()(long, ulong), candidates are:
C:\Users\me\scoop\apps\dmd\current\windows\bin....\src\phobos\std\math.d(7267,3): fmin(F)(const F x, const F y)
with F = ulong
must satisfy the following constraint:
__traits(isFloating, F)
danode\filesystem.d(118,76): Error: template std.math.fmin cannot deduce function from argument types !()(long, ulong), candidates are:
C:\Users\me\scoop\apps\dmd\current\windows\bin....\src\phobos\std\math.d(7267,3): fmin(F)(const F x, const F y)
with F = ulong
must satisfy the following constraint:
__traits(isFloating, F)
danode\filesystem.d(120,70): Error: template std.math.fmin cannot deduce function from argument types !()(long, ulong), candidates are:
C:\Users\me\scoop\apps\dmd\current\windows\bin....\src\phobos\std\math.d(7267,3): fmin(F)(const F x, const F y)
with F = ulong
must satisfy the following constraint:
__traits(isFloating, F)
danode\payload.d(42,48): Error: template std.math.fmin cannot deduce function from argument types !()(long, ulong), candidates are:
C:\Users\me\scoop\apps\dmd\current\windows\bin....\src\phobos\std\math.d(7267,3): fmin(F)(const F x, const F y)
with F = ulong
must satisfy the following constraint:
__traits(isFloating, F)
dmd failed with exit code 1.


systeminfo - OS Version: 10.0.19042 N/A Build 19042

λ dmd --version
DMD32 D Compiler v2.094.2-dirty
Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved written by Walter Bright

λ dub --version
DUB version 1.23.0, built on Nov 20 2020

Chrome [HTML5] Video Tag does not allow to control a video

Low importance issue.

[issue's title says it all, look up the video below.]

Somehow I suspect that this has to do with the Web Server. (DaNode)
Haven't tested on Apache or other Web Servers yet.
But it (HTML video tag) seems to work perfectly for everyone else that do not use DaNode.

2021-12-20.14-36-27.mp4

Guide to reproduce
Temporary live version. (1-2 days)

  1. This is what I've used.
<video width="320" height="240" controls>
  <source src="1.mp4" type="video/mp4">
  <source src="1.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
  1. Now place a video .mp4 file named 1.mp4 in the same folder alongside.
  2. Place it in the DaNode www/*/ folder
  3. Test things out and see that you can't control the video.

Erroneous HTML date from browsers can cause "304 Not Modified" response optimization to be disabled

After adding index.html file and visiting the 78.150.536.25/index.html via a browser I get this error.

image

More photos:
image

Also I've noticed that I get an error on startup and every time I try to visit a web page.

[WARN]   unknown client exception: core.time.TimeException@std/datetime/date.d(3776): 255 is not a valid month of the year.
----------------
??:? pure @safe void std.datetime.date.enforceValid!("months").enforceValid(int, immutable(char)[], ulong) [0x559cb55792e3]
??:? pure ref @safe std.datetime.date.Date std.datetime.date.Date.__ctor(int, int, int) [0x559cb5577b86]
??:? pure ref @safe std.datetime.date.DateTime std.datetime.date.DateTime.__ctor(int, int, int, int, int, int) [0x559cb5577365]
danode/functions.d:23 std.datetime.systime.SysTime danode.functions.parseHtmlDate(const(immutable(char)[])) [0x559cb547d9ed]
danode/request.d:145 const @property std.datetime.systime.SysTime danode.request.Request.ifModified() [0x559cb554d33c]
danode/response.d:175 void danode.response.serveStaticFile(ref danode.response.Response, in danode.request.Request, danode.filesystem.FileSystem) [0x559cb554f6ec]
danode/router.d:105 void danode.router.Router.deliver(ref danode.request.Request, ref danode.response.Response, bool) [0x559cb5550352]
danode/router.d:55 void danode.router.Router.route(danode.interfaces.DriverInterface, ref danode.request.Request, ref danode.response.Response, long) [0x559cb554fe0f]
danode/client.d:44 void danode.client.Client.run() [0x559cb547be76]
??:? void core.thread.context.Callable.opCall() [0x559cb5560fe4]
??:? thread_entryPoint [0x559cb5560ac2]
??:? [0x7fc04afe8fa2]
??:? clone [0x7fc04ad6d4ce]
[WARN]   unknown client exception: core.time.TimeException@std/datetime/date.d(3776): 255 is not a valid month of the year.
----------------
??:? pure @safe void std.datetime.date.enforceValid!("months").enforceValid(int, immutable(char)[], ulong) [0x559cb55792e3]
??:? pure ref @safe std.datetime.date.Date std.datetime.date.Date.__ctor(int, int, int) [0x559cb5577b86]
??:? pure ref @safe std.datetime.date.DateTime std.datetime.date.DateTime.__ctor(int, int, int, int, int, int) [0x559cb5577365]
danode/functions.d:23 std.datetime.systime.SysTime danode.functions.parseHtmlDate(const(immutable(char)[])) [0x559cb547d9ed]
danode/request.d:145 const @property std.datetime.systime.SysTime danode.request.Request.ifModified() [0x559cb554d33c]
danode/response.d:175 void danode.response.serveStaticFile(ref danode.response.Response, in danode.request.Request, danode.filesystem.FileSystem) [0x559cb554f6ec]
danode/router.d:105 void danode.router.Router.deliver(ref danode.request.Request, ref danode.response.Response, bool) [0x559cb5550352]
danode/router.d:55 void danode.router.Router.route(danode.interfaces.DriverInterface, ref danode.request.Request, ref danode.response.Response, long) [0x559cb554fe0f]
danode/client.d:44 void danode.client.Client.run() [0x559cb547be76]
??:? void core.thread.context.Callable.opCall() [0x559cb5560fe4]
??:? thread_entryPoint [0x559cb5560ac2]
??:? [0x7fc04afe8fa2]
??:? clone [0x7fc04ad6d4ce]
[WARN]   unknown client exception: core.time.TimeException@std/datetime/date.d(3776): 255 is not a valid month of the year.
----------------
??:? pure @safe void std.datetime.date.enforceValid!("months").enforceValid(int, immutable(char)[], ulong) [0x559cb55792e3]
??:? pure ref @safe std.datetime.date.Date std.datetime.date.Date.__ctor(int, int, int) [0x559cb5577b86]
??:? pure ref @safe std.datetime.date.DateTime std.datetime.date.DateTime.__ctor(int, int, int, int, int, int) [0x559cb5577365]
danode/functions.d:23 std.datetime.systime.SysTime danode.functions.parseHtmlDate(const(immutable(char)[])) [0x559cb547d9ed]
danode/request.d:145 const @property std.datetime.systime.SysTime danode.request.Request.ifModified() [0x559cb554d33c]
danode/response.d:175 void danode.response.serveStaticFile(ref danode.response.Response, in danode.request.Request, danode.filesystem.FileSystem) [0x559cb554f6ec]
danode/router.d:105 void danode.router.Router.deliver(ref danode.request.Request, ref danode.response.Response, bool) [0x559cb5550352]
danode/router.d:55 void danode.router.Router.route(danode.interfaces.DriverInterface, ref danode.request.Request, ref danode.response.Response, long) [0x559cb554fe0f]
danode/client.d:44 void danode.client.Client.run() [0x559cb547be76]
??:? void core.thread.context.Callable.opCall() [0x559cb5560fe4]
??:? thread_entryPoint [0x559cb5560ac2]
??:? [0x7fc04afe8fa2]
??:? clone [0x7fc04ad6d4ce]
[WARN]   unknown client exception: core.time.TimeException@std/datetime/date.d(3776): 255 is not a valid month of the year.
----------------
??:? pure @safe void std.datetime.date.enforceValid!("months").enforceValid(int, immutable(char)[], ulong) [0x559cb55792e3]
??:? pure ref @safe std.datetime.date.Date std.datetime.date.Date.__ctor(int, int, int) [0x559cb5577b86]
??:? pure ref @safe std.datetime.date.DateTime std.datetime.date.DateTime.__ctor(int, int, int, int, int, int) [0x559cb5577365]
danode/functions.d:23 std.datetime.systime.SysTime danode.functions.parseHtmlDate(const(immutable(char)[])) [0x559cb547d9ed]
danode/request.d:145 const @property std.datetime.systime.SysTime danode.request.Request.ifModified() [0x559cb554d33c]
danode/response.d:175 void danode.response.serveStaticFile(ref danode.response.Response, in danode.request.Request, danode.filesystem.FileSystem) [0x559cb554f6ec]
danode/router.d:105 void danode.router.Router.deliver(ref danode.request.Request, ref danode.response.Response, bool) [0x559cb5550352]
danode/router.d:55 void danode.router.Router.route(danode.interfaces.DriverInterface, ref danode.request.Request, ref danode.response.Response, long) [0x559cb554fe0f]
danode/client.d:44 void danode.client.Client.run() [0x559cb547be76]
??:? void core.thread.context.Callable.opCall() [0x559cb5560fe4]
??:? thread_entryPoint [0x559cb5560ac2]
??:? [0x7fc04afe8fa2]
??:? clone [0x7fc04ad6d4ce]

.mp4 file is not accessible | 403 - Access to this resource has been restricted

Now who would not want to have an accessible video file.
Today I really had a need to test out if DaNode would let me look at things such as images and videos on the web server.
After some uploads, only the .png image file was accessible. The .mp4 file was blocked off. Not sure how to go about it.

image

http://78.140.136.25/1.mp4 This is a working link to a file that is .mp4 media. (Resource is Inaccessible)

http://78.140.136.25/2.png Now the .png media file seems to show properly. (Resource is Accessible)


I suspect that mimetypes.d are lacking entry of .mp4
https://github.com/DannyArends/DaNode/blob/b12e8950e90ffaf9f86f5cf6c72d0bd2e5f08d8f/danode/mimetypes.d

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.