Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0
Graphe des révisions

390 Révisions

Auteur SHA1 Message Date
akuma06 1f36b3e896 Set the path to "/" 2017-06-06 23:29:00 +02:00
akuma06 f5740c7f28 Aria-label for navigation pages
Just added an aria-label attribute on pages number
2017-06-06 22:38:43 +02:00
akuma06 d109b4783c Fix cookies shared between domains
Just applied what we are already doing with user cookies to the
publicSettings.
Also changed the updateUserCore by updateRawUser <= less query for the
same result.
2017-06-06 22:05:44 +02:00
sfan5 576e11bf42 Fix both error message + HTML showing on home page
Also remove util.SendError since it's not very useful.
2017-06-06 16:24:15 +02:00
akuma06 5068d83402 Merge branch 'dev' into custom-mascot 2017-06-06 00:38:20 +02:00
akuma06 23210b0250 Report modal fix (#935)
* fix uploaderid when torrent is hidden

Added a new function template to generate a link for uploaders name
In the view we have the actual uploaderID and uploaderName now

* fix template.HTML to string conversion

* Add a modal for reporting

Replace the popup
Use of Modal.js
Include Captcha

* forgot a div end tag

* Moved modal at the end

* Updated translation missing %s

* Added an information message

New translation string

* Forgot %s

* wrong id check
2017-06-06 00:06:52 +02:00
akuma06 01a3143a08 fix uploaderid when torrent is hidden (#930)
Added a new function template to generate a link for uploaders name
In the view we have the actual uploaderID and uploaderName now
2017-06-06 00:06:04 +02:00
ElegantMonkey e10070b2a9 Add customizable mascot by URL.
Add a new setting for customizable mascots, with a new User field
MascotURL, and a corresponding cookie setting.
2017-06-05 11:32:48 -03:00
akuma06 b61fe55f82 New upload API (#897)
* New upload API (WIP)

* update

* Last fix

* Adding changes from update.go to api.go

* fix bracket

* fix import
2017-06-05 08:19:25 -05:00
akuma06 38a55e88e9 Fix for csrf (#923)
* Merge remote-tracking branch 'refs/remotes/origin/dev' into fix-for-csrf

Fix CSRF protection

Seems like it doesn't work anymore...
I tried to
fix it but couldn't get /api without csrf. So I changed the
dependency
for another csrf package (nosurf).
Behavior: Same as previously. You
just have to include the block
csrf_token

* changing dependency to nosurf
2017-06-05 11:33:48 +10:00
akuma06 75528da943 Fix user logout (#924)
* Logout is now a posted form

Instead of using a get method, I've moved it to a post method.
Doing that made possible to use CSRF token and also fix #902

* Update _badgemenu.html
2017-06-05 11:33:16 +10:00
tomleb e60eceba63 Reduce number of queries, update systemd unit service (#925)
* Update/add systemd services

* Avoid roundtrip back to postgresql when doing ES search

* Use only one ES client
2017-06-05 11:33:02 +10:00
PantsuDev 93af9a7df4
Revert "Hopefully patch exploit that allows anyone to log users out"
This reverts commit b0a3555afe.
2017-06-04 21:19:44 +10:00
PantsuDev e34ddd1404
Reduce size of descriptions 2017-06-04 15:56:36 +10:00
PantsuDev b0a3555afe
Hopefully patch exploit that allows anyone to log users out 2017-06-04 15:38:38 +10:00
akuma06 38e8ee3a7a New modpanel fix (#895)
* Comments count number

* New Modpanel fix

Fixes #755 (@ilikecats)
modpanel tables have margins
modpanel delete buttons are red
some coloring for buttons
reassign form looks better
reassign form textarea have rows="20" cols="40"
"save changes" btn green
report reasons are now translated in modpanel
delete is a real button on modpanel users page

* moved getReportDescription
2017-06-04 02:28:33 +02:00
Atvaark 99ad76f76f Add web address config (#888)
* This allows changing the nyaa, sukebei and status URL via config.
  Previously only the nyaa address was configurable
* This helps testing changes locally without having to set up
  a TLS terminating proxy
* Also refactored uses of hardcoded URLs in the html templates
  The html templates will now also use the configured urls
2017-06-03 11:45:24 +10:00
akuma06 e62ebb05ba Mass edit mod api JS (done) (#868)
* Mass Edit MOD api JS (WIP)

In continuity with the mass edit mod api, this is the javascript use of
it.
##What does it do?
* Delete of multiple torrents on index/search
* Category change of multiple torrents
* Change of owner of multiple torrents
* Lock & delete of multiple torrents

##How?
* New toolbar only visible for mods
* Checkboxes added only for mods
* Selection and click on the button in toolbar
* Nothing is submitted, you have to review the changes in a modal window
listing them.
* Then the ajax queries are initialized one at a time with a progression
bar
* You can always at any moment delete entries from the queuing list

* Improved progress bar

* Deleting part almost done

Improved modal design
All dom interactions should be done
Prepared Query for only one callback
Improved Modal to keep a link to the active modal

* Finished =D

Added some translation string

* Forgot the refreshing of the page

Just an option that can be disabled by making refreshTimeout to 0
2017-06-02 12:51:44 +10:00
akuma06 08c342e4e7 Added a check on LastID function 2017-05-31 21:07:56 +02:00
akuma06 9e0424ec5e Add Build version
Main version can be set in config/default_config.yml
Build version need to be set by build command: go build -ldflags "-X
main.buildversion=$(date -u +.%Y%m%d.%H%M%S)"
Or by using package.sh
Or by using the godep command: godep go build -ldflags "-X
main.buildversion=$(date -u +.%Y%m%d.%H%M%S)"
2017-05-31 12:20:06 +02:00
akuma06 e116b30b40 Better handle of test files
After some thoughts, it is better to use the config from config files
than default ones
2017-05-31 10:49:01 +02:00
akuma06 5376b9e271 New config files (#854)
* New config files

As decided, config files are parsed at runtime.
I decided to go for YAML config files because there can be comments in
it.
There are 2 files:
* config/default_config.yml <= which shouldn't be edited unless we add a
config parameter
* config/config.yml <= which is the user-defined config. This file
shouldn't be commited

Changed every call to config.XXX to config.Conf.XXX (look to the new
stucture of config in config/types.go)

Of course, putting config parameters in config.yml overrides config in
config_default.yml. You don't have to put everything in it, just add
what you want to override.

* Fixing test

Replacing conf.New by config.Conf

* Fixing call to config.Conf to config.Config{} in test files

* Might have fixed testing with this

Printf instead of Fatalf

* Renaming config.yml in example file

* Forbid commiting config.yml

* Should be now fixed

* Do not need this file anymore
2017-05-30 21:21:57 -05:00
Steindór ffbbacb84a Maskot to cookie (#857)
* Put the mascot into the cookie as well, major js cleanup

* Update en-us.all.json

* removed redundant translation
2017-05-30 21:21:35 -05:00
akuma06 b5476c7d66 Merge remote-tracking branch 'refs/remotes/origin/dev' into xhr-torrent-refresh 2017-05-30 14:19:13 +02:00
akuma06 479de0eaf6 Merge pull request #840 from NyaaPantsu/csrf-secure
Csrf secure Exclusion
2017-05-30 01:17:08 +02:00
akuma06 402fce9f02 Api Last Torrent + xhr automatic refresh
* Added a fiel torrentID in search param
* Search can be limited to torrentID > id provided
* Templates creation through simple JS object
* XHR management through simple JS object
* Torrents object that interface with Templates and Query to get new
torrent uploaded according to the search context
2017-05-30 00:28:21 +02:00
akuma06 55867720cb Forgot that they also login through the login form
So no CSRF protection for login :/
2017-05-30 00:22:23 +02:00
akuma06 db58c2bf02 Merge branch 'csrf-secure' of https://github.com/NyaaPantsu/nyaa into csrf-secure 2017-05-30 00:18:47 +02:00
akuma06 ad7439283c CSRF Exclusion
As per suggestion of @yiiTT, CSRF is limited on users login,
registration, profile edit, comments post, torrent edit.
Uploads are not yet CSRF protected because api upload can't be used for
that
2017-05-30 00:18:43 +02:00
akuma06 517b59b02f Merge pull request #837 from NyaaPantsu/csrf-secure
CSRF Support + better key for context
2017-05-29 22:15:07 +02:00
akuma06 d5ad9618ac Update view_torrent_handler.go 2017-05-29 17:44:11 +02:00
akuma06 3ec367a759 CSRF Support + better key for context
* Added new dep: gorilla/csrf
* CSRF field in forms
* CSRF variable in commontemplatevariables
* New key for messages and user context

Please change EnableSecureCSRF to false when testing locally and don't
merge config/env.go with the changes
2017-05-29 17:07:18 +02:00
John Smith 61141a1fcf
Exhaustive whitespace trimming 2017-05-29 23:43:27 +10:00
Eliot Whalan 8cf57ad791
set max comment size 2017-05-29 21:25:36 +10:00
Atvaark b31e77be2e Fix infohash decoding (#813)
Calculate the info hash of the uploaded torrent file
instead of the re-encoded torrent file.

The re-encoded torrent files only contain a subset
of the original info values and thus have a different hash.
2017-05-29 07:47:47 +10:00
Eliot Whalan cdd382cd34
Merge branch 'dev' of https://github.com/NyaaPantsu/nyaa into dev 2017-05-28 19:57:38 +10:00
hamper 1a608faa44 Add website link and remake flag to api (#797) 2017-05-28 14:22:39 +10:00
akuma06 0dc4bd3c9a Torrent name when download
New Download Torrent controller when dowloading a torrent
Route download need to be set the same as in TorrentStorageLink
2017-05-28 01:29:46 +02:00
akuma06 3775e9dfb5 Torrent Hidden Option (to test before merging)
* Added a check on username and userId when converting torrent to JSON
* Added a checkbox for hidden in modepanel, torrent user edit and upload
* Added a Hidden field bool in torrent model and upload form
2017-05-27 20:33:40 +02:00
Steindór 25562e0d54 Account theme switcher (Pls merge) (#750)
* added pagination

* cleanup

* indentation fix

* fix

* Loads theme from context

* Basic theme switching working

* working properly

* Fuck golint tbqh

* united language and theme into one settings page

* made the settings page a little nicer

* fixed it so it works properly now

* removed parts of inline js and fixed bug

* removed remains of other theme switching method

* fixed very minor bug

* fix
2017-05-27 12:08:47 -05:00
Eliot Whalan 57980a8ebc
make rss feeds properly validate 2017-05-27 22:05:24 +10:00
Steindór 9286653905 Nav fixes (#766)
* Update README.md

Added a link to the db dump and IRC channels.

* Minor fix

* Update README.md

* disabling email links

* Killed github autolinking

* Update README.md

* Removed database link

* fixed a FF only bug with the carets

* added a static size to pagination

* worked on the pagination widget

* fixed the arrow buttons too

* fixed appearance on pages over 1000
2017-05-27 17:16:43 +10:00
Eliot Whalan 5041bd1de1
Merge branch 'dev' of https://github.com/NyaaPantsu/nyaa into dev 2017-05-27 11:56:28 +10:00
akuma06 b191bd3286 Fix User Reset API (#772)
* Added a new function to only update columns of table user (less
useless query)
* Changed method to GET instead of POST because it is a link not a
button anymore
* Display of user profile if changes are successful
2017-05-27 11:54:54 +10:00
tomleb d6c50f5640 TorrentJSON.ID is uint now, fix weird page sorting (#769)
* TorrentJSON.ID is uint now, fix weird page sorting

The bug was that ES would sort by ID in a weird manner because the id
was a string. The id is now a uint.

* Resolved the conflict for future merging
2017-05-27 11:54:41 +10:00
Eliot Whalan 75ec79b4e1
Merge branch 'dev' of https://github.com/NyaaPantsu/nyaa into dev 2017-05-27 11:51:36 +10:00
Eliot Whalan fe77845ebf
Hopefully fix memleak 2017-05-27 11:50:31 +10:00
Eliot Whalan 04ce9e4a83
Fix bug adding torrents via magnet links 2017-05-27 11:08:18 +10:00
akuma06 0f66ec9340 Trackers in Torrents + Missing comments + Function renaming (#768)
* Missing comments and Function renaming

* Added some missing comments
* Renamed functions to get user followers/following
* GetFollowers to get followers
* GetLikings to get who the user is following

* Renaming + Add support of previous trackers

* Renaming user.Likings in user.Followers
* Renaming user.Liked in user.Likings
* Add a new string field Trackers in torrent model
* Trackers from torrent file are now populated to the databse
* Needed trackers are added to the torrent trackers if not provided or
if trackers is empty in DB (backward compatibility)

* New check and url encoding

* No more regex for verifying tracker url
* Encodes tracker url for "&" & "?" character possibly existing in
tracker url and breaking magnet link

* Improvements

* Trackers are now encoded in torrent.ParseTrackers
* Faster check by using the for loop of checktrackers
* No more boolean, we need to check len of array returned
* torrent.Trackers can be directly used in url as they are encoded like
: tr=tracker1&tr=tracker2&tr=...
2017-05-27 00:45:18 +02:00
akuma06 80ab45d81e New profile user menu (#761)
* Fixing user profile page

* Modified css rule word-break to break-word
* Modified torrents table in user page to look like home listing
* Made the button reset api look like a button according to actual
design
* Modified user menu to have the same spacing accross templates
* User menu is in another template file loaded dynamically

* Fixing the access to userprofile variable

* Menu needs to access the user profile with $.UserProfile
* User Notification template variable removed, instead using user
profile variable

* Reverting back theme flickering fix
2017-05-26 14:33:55 +02:00