Commit Graph
56 Commits
Author SHA1 Message Date
jvoisin 41408bc2c3 Replace the double-mustache anti-pattern
Because Double Brace Initialization (DBI) creates an anonymous class with a
reference to the instance of the owning object, its use can lead to memory
leaks if the anonymous inner class is returned and held by other objects. Even
when there's no leak, DBI is so obscure that it's bound to confuse most
maintainers.
2019-04-25 22:32:45 +02:00
jvoisin c6825cf0d7 Minor refactorization of two methods in AbstractDao 2019-04-24 22:40:38 +02:00
jvoisin a21188a064 Add a permission check for the podcast folder
This should make podcast-related stacktraces a bit
more obvious to debug for users.
2019-04-17 23:08:26 +02:00
jvoisin 716fd3635c Remove a useless test page 2019-04-17 22:26:45 +02:00
jvoisin e2683024af Factorize a bit the checkbox-related CSS
Since the `border: 0;` property is applied
to every checkbox, there is no need for a class.
This is also a good opportunity to use ternaries
for the `checked` attribute, instead of clumsy `if`.
2019-04-17 22:20:11 +02:00
jvoisin cf1f86f226 Move some video-cast-related inline js to an external file 2019-04-17 21:58:49 +02:00
jvoisin af4165310f Fix yet an other XSS 2019-04-12 22:39:45 +02:00
jvoisin e69287cfe6 Minor frameset-related factorization 2019-04-11 23:15:09 +02:00
jvoisin 17f1d45e08 Remove mentions of subsonic premium 2019-04-10 22:49:08 +02:00
jvoisin 90cb02105e Add a noopener and noreferrer to external urls
- noreferrer is used to prevent the browser from sending the referrer
  to the visited site
- noopener fixes a fun class of bug: https://mathiasbynens.github.io/rel-noopener/
2019-04-08 23:13:47 +02:00
jvoisin a200dd0c37 Don't autocomplete the password field
I guess that this is a bit silly in 2019,
but since people tend to use weird browsers in weird
places, disabling autocompletion here might prevent
the password from ending up in some local cache.
2019-04-08 17:25:30 +02:00
jvoisin 9dea3e9051 Add a CONTRIBUTING.md file 2019-04-07 10:55:51 +02:00
jvoisin ec4b969e2c Replace latin encoding with utf-8 2019-04-07 09:27:22 +02:00
jvoisin 5acabcae19 Remove resource bundles for messages as well 2019-04-06 21:46:55 +02:00
jvoisin 9fb56c031b Fix the systemd unit file for OpenJDK 2019-04-05 19:51:15 +02:00
jvoisin 7d865ea7a9 Add a lost meta back 2019-04-03 10:22:38 +02:00
jvoisin 8f74db2ec1 Remove the unused embedded copy of weupnp 2019-04-03 02:44:57 +02:00
jvoisin 5c54bff5ac Remove the unused embedded copy of jarbundler 2019-04-03 02:44:03 +02:00
jvoisin 258c68dd4d Remove the embedded copy of appbundler 2019-04-03 02:39:20 +02:00
jvoisin 4a1a5467c7 Remove the embedded copy of ant-zip 2019-04-03 02:32:29 +02:00
jvoisin 422127e3f6 Replace the flash player with medialement.js for the shared media 2019-04-03 02:23:50 +02:00
jvoisin 72e372157a Remove WAP-related stuff
WAP (https://en.wikipedia.org/wiki/Wireless_Application_Protocol)
is a thing from the past that nobody is using anymore.

This should close #960
2019-04-02 19:48:17 +02:00
jvoisin 268dc6e13d Factorise the key generation into a static method 2019-04-02 10:13:29 +02:00
jvoisin aff7bd3d57 Remove webfx stuff, since they're apparently not used
The only place where the string `webfx` is mentioned
was in playQueue.jsp, to include a small css file, twice,
that only applies to webfx components, that aren't used
anywhere in the codebase.
2019-04-02 00:42:24 +02:00
jvoisin db2592a84b Delete AC_OETags.js since it's not used anywhere 2019-04-02 00:37:17 +02:00
jvoisin c9212805be Remove jquery-contextmenu since it's not used anywhere 2019-04-02 00:28:16 +02:00
jvoisin 87442320fc Try to run jkd9 on travis-ci 2019-04-01 23:17:02 +02:00
jvoisin d35834c0e7 Fix a bunch of dom-based xss
This should close #633
2019-04-01 23:08:57 +02:00
jvoisin 0d6cbb60ed Use https for external links 2019-04-01 11:45:20 +02:00
jvoisin 3e07ea5288 Use a random key to "encrypt" the remember-me cookie's value
Since Spring's default remember-me technique is
terrible security-wise (`user:timstamp:md5(use:timestamp:password:key)`),
we should at least use a random key, instead of a fixed one,
otherwise, and attacker able to capture the cookies
might be able to trivially bruteforce offline
the password of the associated user.
2019-04-01 11:33:35 +02:00
jvoisin ab1690b1fe Don't display the title if it's empty 2019-04-01 02:36:28 +02:00
jvoisin ac1c887698 Remove Google+ relics
Google+ is dead: https://developers.google.com/+/
2019-04-01 01:41:41 +02:00
jvoisin cb0866d5fd Download dependencies via https on download.java.net 2019-04-01 01:34:01 +02:00
jvoisin 5edebf7885 Remove inline javascript on the cancel buttons
The inline javascript used with the cancel buttons
was only used to change the location.
Instead of doing this, it's easier to wrap
the button in a tag.

This is related to #909.
2019-04-01 01:32:35 +02:00
jvoisin ba6b39b7b2 Add two <meta> tags
- Add a description, since this can be useful
  in browser's histories
- Add a viewport, making it less worse to use
  airsonic on a super-small screen
2019-03-31 23:55:24 +02:00
jvoisin 4d5680931c Add the dates of the releases to the changelog 2019-03-31 20:45:15 +02:00
jvoisin 883022d81a Remove script.aculo.us dependency
It's not used anywhere, using an old version,
and the project doesn't seem to be maintained anyway.
2019-03-30 11:09:42 +01:00
jvoisin 910802b64f Fix a small resource leak 2019-03-29 00:18:25 +01:00
jvoisin a6c92acb3e Update mediaelement from 4.1.1 to 4.2.9
I've tested this on mp3, ogg and flac, everything
is working.

Apart from fixing a decent amount of bugs
(https://github.com/mediaelement/mediaelement/releases),
this has the nice side effect of removing a copy
of jquery 1.9.1.
2019-03-29 00:00:47 +01:00
jvoisin 2f9046d6b4 Fix a xss and clean up some js
- Fix a stupid self-XSS. I doubt that there are ways to
  use it against other users, but well, better safe than sorry
- Replace the javascript-on-focus hacks with the `autofocus` attribute
2019-03-28 23:38:37 +01:00
jvoisin 61c842923a Generate new passwords in a secure way
Previously, lost passwords were generated via
org.apache.commons.lang.RandomStringUtils,
which is using java.util.Random internally.

This PRNG is has a 48-bit seed, that can easily be bruteforced
if an attacker is able to get the PRNG's output, for example
but resetting their own account multiple times,
leading to trivial privileges escalation attacks.

This commit makes use of java.security.SecureRandom
instead.
2019-03-28 21:47:57 +01:00
jvoisin 6f3c3312ee Add coverity scan to travis 2019-03-27 23:43:59 +01:00
jvoisin 39b9eab715 Simplify a bit the css 2019-03-26 23:08:50 +01:00
jvoisin 0b72acefed Oups 2019-03-26 23:04:32 +01:00
jvoisin fa5ffdc07a Remove the external fonts usage
This is a radical (and simple) solution
to #853, #399, #439, #174 and partially #712.
2019-03-26 21:30:45 +01:00
jvoisinandAndrew DeMaria ab92f83c1f Add a bunch of hardening to the systemd unit
I tested this locally, it's working on my machine™
Nothing fancy, no new privileges, private stuff (/tmp, …),
no exotic devices/access/…, …

Signed-off-by: jvoisin <julien.voisin@dustri.org>
Signed-off-by: Andrew DeMaria <lostonamountain@gmail.com>
2019-03-26 14:27:52 -06:00
jvoisinandAndrew DeMaria 615e317b01 Bump liquibase version
Signed-off-by: jvoisin <julien.voisin@dustri.org>
2019-03-26 12:52:16 -06:00
jvoisinandAndrew DeMaria 919051db9e Simplify the travis file
- Remove `sudo` since it's deprecated,
  along with the useless `apt update` call
- Remove the manual maven installation since
  it's already present on the travis image
  by default

This should reduce a bit the time taken for a whole CI run.
2019-03-26 12:49:01 -06:00
jvoisin 30fa4d0467 Second pass of trivial modernizations
- Replace unnecessary getters/setters with inline assignments
- Simplify string constructions
- Improve containers construction
2019-03-26 00:00:21 +01:00
jvoisin ca489f8220 This is a first batch of simple modernization of the codebase
I threw airsonic at IntelliJ's IDEA analysis,
and asked it to flag what could be modernized
for Java > 5.

- foreach instead of for…
- I added some null-deref checks
- Integer.ValueOf, since Integer(…) is deprecated
- Contextual try
- Objects.equals instead of handcrafted comparisons
- StringBuilder instead of StringBuffer
- Removal of outdated/wrong javadoc comments
2019-03-25 23:33:03 +01:00
jvoisin 45ef973627 Fix a javascript null-deref
This commit should fix the following javascript crash that
may occur if the localstorage isn't available/supported by the browser:

```
more.view:140 Uncaught TypeError: Cannot read property 'playCountValue' of null
    at loadShuffleForm (more.view:140)
    at HTMLDocument.<anonymous> (more.view:181)
    at n (jquery-1.7.1.min.js:2)
    at Object.fireWith (jquery-1.7.1.min.js:2)
    at Function.ready (jquery-1.7.1.min.js:2)
    at HTMLDocument.B (jquery-1.7.1.min.js:2)
```

Signed-off-by: jvoisin <julien.voisin@dustri.org>
2019-03-22 06:10:20 +01:00
jvoisin a9d5f73287 Bump guava version
Signed-off-by: jvoisin <julien.voisin@dustri.org>
2019-03-21 22:32:30 +01:00
jvoisin 0a47c6e461 Bump java-jwt
Signed-off-by: jvoisin <julien.voisin@dustri.org>
2019-03-21 22:26:06 +01:00
jvoisin 4e2b435abf Bump cglib version
Signed-off-by: jvoisin <julien.voisin@dustri.org>
2019-03-21 22:20:37 +01:00
jvoisin 4de26ac319 Remove pngfix
pngfix.js is used for compatibility's reason
with IE 5 and 6. I think that now that we're in 2019,
we can get rid of it.

Signed-off-by: jvoisin <julien.voisin@dustri.org>
2019-03-20 21:59:52 +01:00
jvoisin f501bfd5e1 Remove momentjs
MomentJS was only used in a single javascript function,
to do Seconds → (Minutes, Seconds). This commit
replaces this with a hand-rolled version, and removes
MomentJS.

Signed-off-by: jvoisin <julien.voisin@dustri.org>
2019-03-20 21:55:39 +01:00