mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Fixing docker image build
This commit is contained in:
parent
55dda973da
commit
27b1069302
4 changed files with 84 additions and 79 deletions
|
@ -7,11 +7,16 @@ import mongoengine as mongo
|
|||
from django.contrib.auth.models import User
|
||||
from django.core.paginator import Paginator
|
||||
from django.db import models
|
||||
from sklearn.feature_extraction.text import TfidfVectorizer
|
||||
from sklearn.metrics.pairwise import cosine_similarity, linear_kernel
|
||||
|
||||
from apps.reader.models import UserSubscription, UserSubscriptionFolders
|
||||
from apps.rss_feeds.models import Feed
|
||||
from utils import json_functions as json
|
||||
|
||||
# from surprise import NMF, SVD, Dataset, KNNBasic, KNNWithMeans, Reader, accuracy
|
||||
# from surprise.model_selection import cross_validate, train_test_split
|
||||
|
||||
|
||||
class RecommendedFeed(models.Model):
|
||||
feed = models.ForeignKey(Feed, related_name="recommendations", on_delete=models.CASCADE)
|
||||
|
|
|
@ -44,6 +44,7 @@ Flask==3.0.2
|
|||
Flask-BasicAuth==0.2.0
|
||||
future==0.18.2
|
||||
gunicorn==21.2.0
|
||||
gevent==22.10.2
|
||||
h2==2.6.2
|
||||
hiredis==1.1.0
|
||||
hpack==3.0.0
|
||||
|
@ -70,7 +71,6 @@ numpy==1.26.4
|
|||
oauth2==1.9.0.post1
|
||||
oauthlib==3.1.0
|
||||
openai~=0.27
|
||||
packaging==20.9
|
||||
paypalrestsdk==1.13.1
|
||||
pbr==5.6.0
|
||||
Pillow==8.0.1
|
||||
|
@ -101,7 +101,7 @@ redis>=4,<5
|
|||
requests>=2.25.0,<3
|
||||
requests-oauthlib==1.3.0
|
||||
scipy==1.12.0
|
||||
sentry-sdk>=1,<2
|
||||
sentry-sdk==1.44.1
|
||||
sgmllib3k==1.0.0
|
||||
simplejson==3.17.2
|
||||
six==1.15.0
|
||||
|
@ -116,7 +116,7 @@ text-unidecode==1.3
|
|||
tiktoken~=0.4.0
|
||||
toml==0.10.2
|
||||
tweepy==3.9.0
|
||||
urllib3==1.26.2
|
||||
urllib3>=1.26.0,<2
|
||||
url-normalize>=1,<2
|
||||
vine==1.3.0
|
||||
virtualenv==20.4.6
|
||||
|
|
|
@ -14,6 +14,7 @@ RUN set -ex \
|
|||
libffi-dev \
|
||||
libjpeg-dev \
|
||||
libpq-dev \
|
||||
libev-dev \
|
||||
libreadline6-dev \
|
||||
liblapack-dev \
|
||||
libxml2-dev \
|
||||
|
@ -24,6 +25,7 @@ RUN set -ex \
|
|||
&& apt-get update \
|
||||
&& apt-get install -y $rundDeps $buildDeps --no-install-recommends
|
||||
COPY config/requirements.txt /srv/newsblur/
|
||||
RUN pip install -U pip==24
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
RUN pip cache purge
|
||||
RUN apt-get purge -y --auto-remove ${buildDeps}
|
||||
|
|
|
@ -61,81 +61,79 @@ NEWSBLUR.Views.FeedBadge = Backbone.View.extend({
|
|||
},
|
||||
|
||||
try_feed: function () {
|
||||
|
||||
try_feed: function () {
|
||||
NEWSBLUR.reader.load_feed_in_tryfeed_view(this.model.id);
|
||||
if (this.options.in_popover) {
|
||||
this.options.in_popover.close();
|
||||
}
|
||||
},
|
||||
|
||||
add_feed: function () {
|
||||
if (this.options.in_popover) {
|
||||
this.save_add_url();
|
||||
} else {
|
||||
NEWSBLUR.reader.open_add_feed_modal({ url: this.model.get('feed_address') });
|
||||
}
|
||||
},
|
||||
|
||||
save_add_url: function () {
|
||||
var $submit = this.$('.NB-badge-action-add');
|
||||
var $error = this.$('.NB-error');
|
||||
var $loading = this.$('.NB-loading');
|
||||
|
||||
var url = this.model.get('feed_address');
|
||||
var folder = this.$('.NB-folders').val();
|
||||
|
||||
$error.slideUp(300);
|
||||
$loading.addClass('NB-active');
|
||||
$submit.addClass('NB-disabled').text('Adding...');
|
||||
|
||||
NEWSBLUR.reader.flags['reloading_feeds'] = true;
|
||||
NEWSBLUR.assets.save_add_url(url, folder, _.bind(this.post_save_add_url, this), _.bind(this.error, this));
|
||||
},
|
||||
|
||||
post_save_add_url: function (e, data) {
|
||||
NEWSBLUR.log(['Data', data]);
|
||||
var $submit = this.$('.NB-badge-action-add');
|
||||
var $loading = this.$('.NB-loading');
|
||||
$loading.removeClass('NB-active');
|
||||
NEWSBLUR.reader.flags['reloading_feeds'] = false;
|
||||
|
||||
if (data && data.code > 0) {
|
||||
NEWSBLUR.assets.load_feeds(function () {
|
||||
if (data.feed) {
|
||||
NEWSBLUR.reader.open_feed(data.feed.id);
|
||||
}
|
||||
});
|
||||
NEWSBLUR.reader.handle_mouse_indicator_hover();
|
||||
$submit.text('Subscribed!');
|
||||
} else {
|
||||
this.error(data);
|
||||
$submit.removeClass('NB-disabled');
|
||||
}
|
||||
},
|
||||
|
||||
error: function (data) {
|
||||
var $submit = this.$('.NB-badge-action-add');
|
||||
var $error = this.$('.NB-error');
|
||||
|
||||
$error.text(data.message || "Oh no, there was a problem grabbing that URL and there's no good explanation for what happened.");
|
||||
$error.slideDown(300);
|
||||
$submit.text('Add');
|
||||
NEWSBLUR.reader.flags['reloading_feeds'] = false;
|
||||
},
|
||||
|
||||
open_stats: function () {
|
||||
var load_stats = _.bind(function () {
|
||||
NEWSBLUR.assets.load_canonical_feed(this.model.id, _.bind(function () {
|
||||
NEWSBLUR.reader.open_feed_statistics_modal(this.model.id);
|
||||
}, this));
|
||||
}, this);
|
||||
|
||||
if (this.options.in_popover) {
|
||||
this.options.in_popover.close(load_stats);
|
||||
} else {
|
||||
load_stats();
|
||||
}
|
||||
NEWSBLUR.reader.load_feed_in_tryfeed_view(this.model.id);
|
||||
if (this.options.in_popover) {
|
||||
this.options.in_popover.close();
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
add_feed: function () {
|
||||
if (this.options.in_popover) {
|
||||
this.save_add_url();
|
||||
} else {
|
||||
NEWSBLUR.reader.open_add_feed_modal({ url: this.model.get('feed_address') });
|
||||
}
|
||||
},
|
||||
|
||||
save_add_url: function () {
|
||||
var $submit = this.$('.NB-badge-action-add');
|
||||
var $error = this.$('.NB-error');
|
||||
var $loading = this.$('.NB-loading');
|
||||
|
||||
var url = this.model.get('feed_address');
|
||||
var folder = this.$('.NB-folders').val();
|
||||
|
||||
$error.slideUp(300);
|
||||
$loading.addClass('NB-active');
|
||||
$submit.addClass('NB-disabled').text('Adding...');
|
||||
|
||||
NEWSBLUR.reader.flags['reloading_feeds'] = true;
|
||||
NEWSBLUR.assets.save_add_url(url, folder, _.bind(this.post_save_add_url, this), _.bind(this.error, this));
|
||||
},
|
||||
|
||||
post_save_add_url: function (e, data) {
|
||||
NEWSBLUR.log(['Data', data]);
|
||||
var $submit = this.$('.NB-badge-action-add');
|
||||
var $loading = this.$('.NB-loading');
|
||||
$loading.removeClass('NB-active');
|
||||
NEWSBLUR.reader.flags['reloading_feeds'] = false;
|
||||
|
||||
if (data && data.code > 0) {
|
||||
NEWSBLUR.assets.load_feeds(function () {
|
||||
if (data.feed) {
|
||||
NEWSBLUR.reader.open_feed(data.feed.id);
|
||||
}
|
||||
});
|
||||
NEWSBLUR.reader.handle_mouse_indicator_hover();
|
||||
$submit.text('Subscribed!');
|
||||
} else {
|
||||
this.error(data);
|
||||
$submit.removeClass('NB-disabled');
|
||||
}
|
||||
},
|
||||
|
||||
error: function (data) {
|
||||
var $submit = this.$('.NB-badge-action-add');
|
||||
var $error = this.$('.NB-error');
|
||||
|
||||
$error.text(data.message || "Oh no, there was a problem grabbing that URL and there's no good explanation for what happened.");
|
||||
$error.slideDown(300);
|
||||
$submit.text('Add');
|
||||
NEWSBLUR.reader.flags['reloading_feeds'] = false;
|
||||
},
|
||||
|
||||
open_stats: function () {
|
||||
var load_stats = _.bind(function () {
|
||||
NEWSBLUR.assets.load_canonical_feed(this.model.id, _.bind(function () {
|
||||
NEWSBLUR.reader.open_feed_statistics_modal(this.model.id);
|
||||
}, this));
|
||||
}, this);
|
||||
|
||||
if (this.options.in_popover) {
|
||||
this.options.in_popover.close(load_stats);
|
||||
} else {
|
||||
load_stats();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue