GithubHelp home page GithubHelp logo

fiskfan1999 / wvlist Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 439 KB

open-source Werke Verzeichnis database with community submissions

Home Page: https://wvlist.net

License: MIT License

Go 69.71% HTML 28.49% CSS 0.55% Makefile 0.40% Shell 0.85%

wvlist's People

Contributors

fiskfan1999 avatar sauravmanoj avatar

Watchers

 avatar  avatar

wvlist's Issues

Missing `current` directory

Hi!

Thanks for the project!

I built it using go 1.17.6 from the current Git master branch, running it using ./wvlist run -c config.json works, however upon trying to load the website it resets the connection and prints:

open current: no such file or directory                                                                                                           
2022/02/25 03:50:42 http: panic serving 192.168.5.10:59860: runtime error: slice bounds out of range [:9] with length 0
goroutine 18 [running]:                                                  
net/http.(*conn).serve.func1()                                                                                                                    
        /usr/lib64/go/1.17/src/net/http/server.go:1802 +0xb9                                                                                      
panic({0x74fa60, 0xc000206030})                                          
        /usr/lib64/go/1.17/src/runtime/panic.go:1047 +0x266                                                                                       
main.GetLinkToCommitInRepositry({0x0, 0x55})                                                                                                      
        /mnt/WD01/GitHub/wvlist/linkToRepo.go:28 +0x155
main.HomePage({0x800cd8, 0xc000228000}, 0xc00021c000)
        /mnt/WD01/GitHub/wvlist/homePage.go:51 +0x207
net/http.HandlerFunc.ServeHTTP(0x0, {0x800cd8, 0xc000228000}, 0x0)
        /usr/lib64/go/1.17/src/net/http/server.go:2047 +0x2f
net/http.(*ServeMux).ServeHTTP(0x0, {0x800cd8, 0xc000228000}, 0xc00021c000)
        /usr/lib64/go/1.17/src/net/http/server.go:2425 +0x149
net/http.serverHandler.ServeHTTP({0xc000210090}, {0x800cd8, 0xc000228000}, 0xc00021c000)
        /usr/lib64/go/1.17/src/net/http/server.go:2879 +0x43b
net/http.(*conn).serve(0xc000214000, {0x802140, 0xc00007d3e0})
        /usr/lib64/go/1.17/src/net/http/server.go:1930 +0xb08
created by net/http.(*Server).Serve
        /usr/lib64/go/1.17/src/net/http/server.go:3034 +0x4e8

Did I miss something, or is it not compatible yet? I think the project is quite new - apologies I am too early!

Best,
Georg

Flags

Here is my working prototype for which flags to use. Especially wondering if anyone has any recommendations for the defaults

  • -p plaintext port, set to 0 if disabled (default 6060 or some arbitrary port)
  • -t TLS port, set to 0 if disabled (default 0)*
  • -d Debug mode, listen and serve TLS muxer on plaintext (this allows the operator console to be used in plaintext while testing, should not be run in prod) (default false)
  • -k Key, path to fullchain.pem file (/etc/letsencrypt/live/wvlist.net/fullchain.pem) (default "")
  • -s Secret, path to private key file (same) (default "")
  • -c Config, path to config file (default ./config.json)

* consider that http.ListenAndServeTLS would panic if it is run with invalid paths (which is also the default).

WVEntry.ID

I'm pretty sure this does not actually need to be in the WVEntry struct, commenting it out doesn't raise any concerns from the compiler.

Maybe it breaks some template that I didn't see.

more api endpoints

Planned addition api features. Until these trample on already-existing api endpoints these can be added to /api/v1/

  • Get the contents of a single composer's catalogue. (Equivalent to /view/id)
  • Api endpoint to download the entire database (not including lilypond incipits) in a format that can be imported to another wvlist instance.
  • Possible: api endpoint to get the lilypond incipit in the same way as lilypond sandbox? This could be a useful way to allow other people to embed miniature lilypond examples on their own website. However, there should be an option to disable this endpoint due to bandwidth concerns.

Pagination

We should start a draft for how to handle splitting up really long pages. Even a moderately-sized page, such as this page can take a long time to load, especially over tor.

Here is my original suggestion:

  1. When a page is initially loaded (/view/3402959793), it will default to showing the first page of a paginated list. This will look identical to how the page looks currently, but will only show the first 50 (?) entries.
  2. There will be buttons to go to the next or previous page. We should take care that these do not go out of bounds. (For example, going to the previous page when on the first page).
  3. In addition to this, there should be a "show full" button or "show text only" button, to show the entire entry according to which it is. This would be helpful for people to search for a specific composition via ctrl-f.

megathread: unit tests

One of the biggest hurdles here is that a large part of the daemon's function is reading files in the directory, in special directories like ./current, ./submissions, etc.

So I will probably figure out a way to move any files in those directories to somewhere else temporarily, put some files in there that I know and know how the daemon is supposed to react to, and then move the other files back afterwards. Or I might add more parameters so that some functions can read from a different directory instead of the hard-coded defaults.

These unit tests will probably be committed to master branch arbitrarily, and not as part of any number updates, because they are not supposed to change the behavior or even fix any bugs.

config params

My plan is to have a global variable for all config parameters, a struct that will be fed with a .json file

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.