mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Separating nginx configuration into a setup and a configure, since one half is much more common than the other.
This commit is contained in:
parent
5bbd13931d
commit
bdc8e7bdea
4 changed files with 17 additions and 1 deletions
|
@ -13,12 +13,14 @@ class Command(BaseCommand):
|
|||
|
||||
def handle(self, *args, **options):
|
||||
if options['userid']:
|
||||
user = User.objects.filter(pk=options['userid'])
|
||||
user = User.objects.filter(pk=options['userid'])[0]
|
||||
elif options['username']:
|
||||
user = User.objects.get(username__icontains=options['username'])
|
||||
else:
|
||||
raise Exception, "Need username or user id."
|
||||
|
||||
user.profile.last_seen_on = datetime.datetime.utcnow()
|
||||
user.profile.save()
|
||||
feeds = UserSubscription.objects.filter(user=user)
|
||||
for sub in feeds:
|
||||
if options['days'] == 0:
|
||||
|
|
9
config/logrotate.mongo.conf
Normal file
9
config/logrotate.mongo.conf
Normal file
|
@ -0,0 +1,9 @@
|
|||
/var/log/mongodb/*.log {
|
||||
weekly
|
||||
rotate 10
|
||||
copytruncate
|
||||
delaycompress
|
||||
compress
|
||||
notifempty
|
||||
missingok
|
||||
}
|
|
@ -12,6 +12,7 @@ server {
|
|||
}
|
||||
location /media/ {
|
||||
expires max;
|
||||
keepalive_timeout 1;
|
||||
root /home/sclay/newsblur;
|
||||
}
|
||||
location /favicon.ico {
|
||||
|
|
4
fabfile.py
vendored
4
fabfile.py
vendored
|
@ -109,6 +109,7 @@ def setup_common():
|
|||
setup_logrotate()
|
||||
setup_sudoers()
|
||||
setup_nginx()
|
||||
configure_nginx()
|
||||
|
||||
def setup_app():
|
||||
setup_common()
|
||||
|
@ -250,6 +251,8 @@ def setup_nginx():
|
|||
run('./configure --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module')
|
||||
run('make')
|
||||
sudo('make install')
|
||||
|
||||
def configure_nginx():
|
||||
put("config/nginx.conf", "/usr/local/nginx/conf/nginx.conf", use_sudo=True)
|
||||
sudo("mkdir -p /usr/local/nginx/conf/sites-enabled")
|
||||
sudo("mkdir -p /var/log/nginx")
|
||||
|
@ -257,6 +260,7 @@ def setup_nginx():
|
|||
put("config/nginx-init", "/etc/init.d/nginx", use_sudo=True)
|
||||
sudo("chmod 0755 /etc/init.d/nginx")
|
||||
sudo("/usr/sbin/update-rc.d -f nginx defaults")
|
||||
sudo("/etc/init.d/nginx restart")
|
||||
|
||||
# ===============
|
||||
# = Setup - App =
|
||||
|
|
Loading…
Add table
Reference in a new issue