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

137 commits

Auteur SHA1 Message Date
akuma06 0c990447eb Fix for API request hidden torrents
Usernames were not hidden when doing api request
2017-06-24 10:53:22 +02:00
akuma06 bda946bbfe Fix description in API search/RSS (#1053)
* Fix description in API search/RSS

There were no descriptions in torrents in API/RSS search on dev. The cause was that ES didn't have the field description in it.

You should reindex after the merge

* Forgot to commit this
2017-06-23 08:54:31 +10:00
akuma06 c9c2b8bf46 Fix nul pointer dereference in TorrentJSON 2017-06-17 03:46:49 +02:00
sfan5 abcdfd426b Move scrape results to separate table (#980) 2017-06-16 01:13:09 +02:00
sfan5 93bc6e9cdb Fix stats properly (ES-only) 2017-06-16 01:01:14 +02:00
kipukun 95173a0f33 Frontend v9000 (#1008)
* Should fix old uploader name in torrent view

* Fix "save changes" in modtools

* Modtool more colorful

* Fix search bar placement in modpanel

* Make colors more consistent; less would be super helpful tbqach fam

* Display the old username if it's there

* Fix some admin index html

* Add custom icons and remove png code from all CSS

* Move a good amount of cosmetic code from main to classic

* Fix some weird bug with point-events; add some global icon formatting; fix mascot fucking up

* Spruce up admin panel with icons on smaller viewports, along with adding trash icon

* 404 redesign ;^)

* Mufuyu mascot on all themes; says something slightly lewd

* Fix weird user menu bug where shit would overflow
2017-06-16 08:57:52 +10:00
akuma06 93364dac77 activity log for users (#1002)
List Torrent delete log
Torrent edit log
Comment delete log
And every other logged activities
Can be filtered out by a filter tag ("edit" or "delete" supported)
Pages navigation

Can be accessed by /activities

Added some translation string
Fixed hidden username on api request
Fixed comments username on modpanel
New Activity model
New Activity handler
New Activity Service
Fixed some updating issue for ES when moderating torrents

Be aware deleting torrents and comments return the model now!
2017-06-15 12:44:46 +10:00
pantsudev 948e7ce8c4 Add unique constraint to hash, email and username 2017-06-14 16:42:15 +10:00
akuma06 b0aa111511 API update completely functionnal for app usage (#987)
The api has been tested and works as intended.
Now users do not have to go on the website to get back their token, they
just have to register.
Torrents show the right stats and username on api request when search is
done
User model when converted to JSON gives us the apitoken and md5 hash of
email (for gravatar)
Verification on upload is done by token and username instead of token
only
Errors are now given in json format in the api
Global api response handler for less code redundancy and same response
pattern
Moved user auth check in cookie_helper to user.go
Fixed bug with CSRF prevention in /api
Added translation strings
2017-06-13 16:01:57 +10:00
Ramon Dantas d8e17478f8 Country flags (language) for torrents. (#970)
* Add flags for torrents

Add a new field, .Language, to the Torrent model, and a new package,
torrentLanguages, which maps languages to flags. Added also a flag icon pack
from googlei18n/region-flags, with (mostly) public domain flags from Wikipedia.

* Optimize flags

* Use FlagSprites CSS instead of .png files

* Only use flags for languages we support

* Add test for CSS flags

Ensure that we have all the flags for the languages we support.

* Add AdditionalLanguages field to config

This allows us to support additional languages for new uploaded torrents,
even if we have no translation for it.

* Minor CSS fix

* Add "other" and "multiple" torrent languages

Also removed the TorrentLanguage struct, as it wasn't much useful.

* Fix test

* Add colspan=2 to category when language is empty

Also hide the language column if empty.

* Add lang field to search.

Hopefully it works with Elasticsearch as well, but I haven't tested
(lol Java)

* Add language field to ES index and settings

* Add language column to JS template

* Add keyword type to language ES field

* Remove 'raw' from keyword

* Set "simple" analyzer on language

* Document .Language field on Torrent model
2017-06-12 09:14:26 +10:00
PantsuDev a5274cc926
Start anidb integration 2017-06-08 09:17:11 +10:00
PantsuDev 994ea62eab
fix typos 2017-06-07 11:14:57 +10:00
akuma06 752544a52c New User status (#957)
Status for scrapped user
They can't log in and an explicit error message is shown when they try
explaining that they need to contact the moderators
They are displayed as simple members on the front-end however
2017-06-07 10:59:46 +10:00
akuma06 5068d83402 Merge branch 'dev' into custom-mascot 2017-06-06 00:38:20 +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
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 fa88e255ba
Revert "Start adding anidb support"
This reverts commit 7d4c88861e.
2017-06-04 20:06:55 +10:00
PantsuDev 7d4c88861e
Start adding anidb support 2017-06-04 15:47:24 +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
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 2a9fb43432 Just changed for displaying renchon 2017-05-27 20:50:40 +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
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
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 6481e90a0c Golint friendly next (#756)
* Gofmt friendly

Keeping Go source code in line with what they preconize

* Golint Friendly Next

So I have made some variables unexported
Added comments in every function that I know what it does
Removed some deprecated stuff that I was sure of
Added a comment on possible deprecated methods "Is it deprecated?"
Changed some variable/method name according to golint recommendations

* Update filelist.go
2017-05-26 12:12:52 +02:00
tomleb f22d11b35d Elasticsearch integration (WIP) (#730)
* Update mapping to be similar to TorrentJSON

* Implement ES search for TorrentParam

* Add seeders/leechers/completed to es index

* Fix filter, use analyzer

* Use ES for the search route

* Add upload_id filtering with ES

* Create/update ES index on torrent upload/update

* Delete from ES index on Delete

* Use ES everywhere, fallback to postgres query

Use Elasticsearch to search the index whenever a call to searchByQuery
is made. Big cleanup needed, but _it werks_.

* Only fetch ids from ES, nothing else

* Use ColumnUpdate instead of Save

* Add FIXME/info to search

* Template needs []TorrentJSON not []Torrent
2017-05-26 09:48:14 +10:00
akuma06 c3211c6a14 Gofmt friendly (#752)
Keeping Go source code in line with what they preconize
2017-05-26 07:35:37 +10:00
akuma06 6edc68fe22 Deleted torrents mod done (#732)
* Torrent Mass Edit Api (WIP)

* Torrents can be deleted in mass from frontend with api post request
* Torrents status can be edited from frontend with api post request
-- Look to function doc for more info on how to use it

It is a WIP so it might not work =D

* Finished Mass mod Api

As per suggestion of @yiiTT in #720, I added:
* Changing torrents category
* Deletion of reports with deletion of a torrent
* Changing owner of multiple torrents

Commit also add some new translation strings.

* Make some changes

* Reports can now be cleared for the torrents selected without having to
delete them
* Users with no admin rights can't delete reports

* Fix moveto to status

moveto deprecated in api

* Tested and works!

Changes:
* Updates only the colomns of torrent table
* Moved categories config in config/torrents.go

* Forgot this file in last commit

* Less useless queries

The use of Save makes it that users are created and updates also all the
associatiated models. Better to just update the colomns needed (less
useless queries)

* Some Updates

* Added a new status of 5 for locking torrents
* Modifying the list torrents view for using it in deleted torrents view
* Added function to get deleted torrents
* Torrents (and reports) can be definitely deleted
* Some new translation string

* Fixing

* fix 2

* Added upload check for locked torrents

If a user owns a torrent, has deleted it and try to repload it. As long
as it has not been locked, he can.

* Fixing wrong condition in isdeleted

* Finished

* Info messages on success when deletes or lock
* Fixed double deleted_at is Null
* Added Link to view of deleted torrents
* Added new translation string
2017-05-25 02:19:05 +02:00
Ramon Dantas 86447b853c Add tree-view file list (Done) (#724)
* Add tree-view file list

* Add TotalSize field to folders

* Remove bootstrap/jquery related code

* Add icons to filelist, some CSS formatting

Moved a few styles from the format string for the tree view, to CSS
(where possible). Make icons look consistent under all themes.

* Make filelist hideable again, show it when JS is disabled
2017-05-25 00:13:56 +10:00
Eliot Whalan b4b1b1c26a
go fmt all the code 2017-05-24 17:11:13 +10:00
akuma06 efe6ea833a Fix 2 2017-05-22 09:28:08 +02:00
akuma06 07c120407e Finished 2017-05-22 00:22:42 +02:00
akuma06 a4c23dda1f wiiiip 2017-05-21 20:20:40 +02:00
akuma06 5639033370 Wiiiiiip 2017-05-21 19:38:39 +02:00
akuma06 32c51a57cb User Settings Notification (WIP) 2017-05-21 18:13:28 +02:00
sfan5 67ec4d5787 Format unknown filesizes in a better way 2017-05-21 14:34:32 +02:00
akuma06 0390fc5215 Mostly done 2017-05-21 00:02:57 +02:00
akuma06 4cbbb95e4f Notification for Users (WIP) 2017-05-20 20:53:05 +02:00
sfan5 4c24318cb3 More sukebei fixes (#649)
* Remove useless .Table() from db usage

This is handled via TableName() already

* Optimization: omit file-list fetching for old torrents

* Use seperate tables for reports & files on sukebei

* Fix invalid pages in nav if <5 pages total
2017-05-21 00:26:22 +10:00
akuma06 369c9151f1 Merge remote-tracking branch 'refs/remotes/origin/dev' into multi-action-torrents-mod
# Conflicts:
#	router/modpanel.go
#	router/router.go
#	service/torrent/torrent.go
2017-05-20 13:58:37 +02:00
akuma06 0d5e2abf7f Added multi action on torrents 2017-05-20 13:45:15 +02:00
sfan5 a3fa6df938 Remove bugs (#643)
* Fix S/L/D columns wasting huge amounts of space

Partially reverts 0c9cdfa8bf.

* Move last scrape below seed-bar

Also fixes the very misleading indentation

* Show category name on view page too

* Fix fucked up login page (fixes #640)

* Fix empty page on login w/o pass (fixes #634)

* Fix incorrectly colored error text in day mode

* Better readable footer in night mode

* Prepare having old uploader names on sukebei and various fixes for sukebei

* Different HTML title for sukebei
2017-05-20 20:45:27 +10:00
tomleb 7eee47b0d3 Fix bug, remove literals (#629)
* Use ModeratorDir variable

* Rename cookieHelper to cookie_helper for consistency

* Use named constant instead of literals

* Fix ability to upload when uploads are disabled

The old code let people upload under the right conditions when uploads
were disabled. (ie: User is banned and config.AdminAreStillAllowedTo is
false)

* Increase timeout (fixes #517)

* Fix inconsistent indentation *.{js, css} (fix #583)

* Fix negative page

Temporary fix. The issue was that going to a negative page caused the
sql query to have a negative offset. This caused an error in the
database query.

We need to cleanup this code, but this will work for now.

* Fix wrong PG_DATA directory due to upgrade to 9.6

* Add server status link to FAQ

* Fix failing tests

* Clarify group_vars/all and hosts doc

* Add a wrapper to protect /mod route

* Fix login page not showing form errors
2017-05-20 09:10:16 +10:00
MMP0 81433403bc Fix error 2017-05-18 10:02:52 +09:00
tomleb 44d75f506d Add dumps view 2017-05-17 19:05:58 -04:00
Ramon Dantas a64c3c5b71 Minor fixes. (#575)
* Sort Comments by Date and Files by Name on viewTorrent

* Make comments start at 1, not 0.
2017-05-17 21:16:40 +10:00
PantsuDev 70f87e7aac finish repo transfer 2017-05-17 15:58:40 +10:00