]> www.vanbest.org Git - tweet-django-debian/commitdiff
Merged upstream release v1.1
authorJan-Pascal van Best <janpascal@vanbest.org>
Thu, 18 Feb 2016 20:54:13 +0000 (21:54 +0100)
committerJan-Pascal van Best <janpascal@vanbest.org>
Fri, 19 Feb 2016 08:14:19 +0000 (09:14 +0100)
1  2 
debian/README
debian/TODO
debian/changelog
debian/patches/patch-settings
debian/rules
debian/tweet-django.logrotate

diff --cc debian/README
index a5021323c39deb4405b3e34891651c0310f93f7b,0000000000000000000000000000000000000000..51cfc4a7798b0c41812a5c32caf12db4ebcd84d1
mode 100644,000000..100644
--- /dev/null
@@@ -1,9 -1,0 +1,18 @@@
 +This is the Debian README for tweet-django
 +
 +Before using tweet-django, please configure it. The configuration file is located in /etc/tweet-django/settings.py
 +You will probably need to edit the following settings:
 +
 +ALLOWED_HOSTS: Add the host name your web server is reachable as
 +LANGUAGE_CODE, TIME_ZONE, etc: Edit to taste
 +TWEET_OAUTH_*: Please register your application instance with Twitter and fill in the credentials here
 +TWEET_MAPQUEST_API_KEY: Please register with MapQuest and fill in the API key here
++
++Also have a look at /etc/apache2/conf-enabled/tweet-django. You may want to change the URL path the
++application is made available at (by default /tweet-django/tweet/), or have the application only
++available in one (or more) virtual hosts, or add an extra alias.
++
++After configuring, you will need to (re)start the streaming tweet daemon:
++# systemctl restart tweet-django
++and the Apache web server:
++# systemctl restart apache2
diff --cc debian/TODO
index 6164b69f35de18eb764cc5b24b4546be33529995,0000000000000000000000000000000000000000..9f7d3bf1c539aaa0fd7bedf4504e34c64bcb6167
mode 100644,000000..100644
--- /dev/null
@@@ -1,7 -1,0 +1,6 @@@
- - Have the run_stream daemon log somewhere useful
- - Remove the logging of the wsgi app from the apache2 error log to somewhere else
- - do not start runstream daemon if not configured
 +- display warning in web app if not configured
- - provide Debian README on how to configure
- - if possible, use tweet-django.install to clean up debian/rules a bit
 +- test install/upgrade/remove/reinstall/purge etc.
++- logrotate
++- timestamp in logs
++- log file name
++
index c14a860dca561ec5f2b31f2eb08d9e22b79260b5,0000000000000000000000000000000000000000..66605f771eaa0dece44d80961a2c226a7b40902e
mode 100644,000000..100644
--- /dev/null
@@@ -1,5 -1,0 +1,11 @@@
++tweet-django (1.1-1) unstable; urgency=medium
++
++  * New upstream release
++
++ -- Jan-Pascal van Best <janpascal@vanbest.org>  Thu, 18 Feb 2016 21:55:11 +0100
++
 +tweet-django (1.0-1) unstable; urgency=medium
 +
 +  * Initial release.
 +
 + -- Jan-Pascal van Best <janpascal@vanbest.org>  Thu, 11 Feb 2016 21:39:09 +0100
index 034d6db59797b52cb3cbd98308c9b38901ed1f5d,0000000000000000000000000000000000000000..3fac8434b431e566336d00757fb61011d0a2ffb1
mode 100644,000000..100644
--- /dev/null
@@@ -1,103 -1,0 +1,124 @@@
- @@ -109,35 +106,7 @@
 +Description: Patch settings to fit in Debian system
 +Author: Jan-Pascal van Best <janpascal@vanbest.org>
 +---
 +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 +--- a/tweet_django/settings.py
 ++++ b/tweet_django/settings.py
 +@@ -20,13 +20,10 @@
 + # Quick-start development settings - unsuitable for production
 + # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
 + 
 +-# SECURITY WARNING: keep the secret key used in production secret!
 +-SECRET_KEY = 'gho@vr!guh#ylqdi4(voavn+*lzyvm&91xnz9c-x6yol5ye%s='
 +-
 + # SECURITY WARNING: don't run with debug turned on in production!
 +-DEBUG = True
 ++DEBUG = False
 + 
 +-ALLOWED_HOSTS = []
 ++ALLOWED_HOSTS = ['127.0.0.1']
 + 
 + 
 + # Application definition
 +@@ -57,7 +54,7 @@
 + TEMPLATES = [
 +     {
 +         'BACKEND': 'django.template.backends.django.DjangoTemplates',
 +-        'DIRS': [],
 ++        'DIRS': ['/usr/share/tweet-django/templates'],
 +         'APP_DIRS': True,
 +         'OPTIONS': {
 +             'context_processors': [
- @@ -151,19 +120,31 @@
++@@ -109,41 +106,21 @@
 + # Static files (CSS, JavaScript, Images)
 + # https://docs.djangoproject.com/en/1.9/howto/static-files/
 + 
 +-STATIC_URL = '/static/'
 +-
 +-# Application specific settings
 +-
 +-TWEET_BASEPATH = 'results'
 +-
 +-
 +-config = ConfigParser()
 +-config.read(os.path.join(BASE_DIR, 'tweet_django', 'local.ini'))
 +-
 +-DATABASES = {
 +-    'default': {
 +-        'ENGINE': config.get('database', 'ENGINE'),
 +-        'NAME': config.get('database', 'NAME'),
 +-        'USER': config.get('database', 'USER'),
 +-        'PASSWORD': config.get('database', 'PASSWORD'),
 +-        'HOST': config.get('database', 'HOST'),
 +-        'OPTIONS': {'charset': 'utf8mb4'},
 +-    }
 +-}
 +-
 +-TWEET_BASEPATH = config.get('paths', 'TWEET_BASEPATH')
 +-
 +-TWEET_OAUTH_CONSUMER_KEY = config.get('twitter', 'TWEET_OAUTH_CONSUMER_KEY')
 +-TWEET_OAUTH_CONSUMER_SECRET = config.get('twitter', 'TWEET_OAUTH_CONSUMER_SECRET')
 +-TWEET_OAUTH_ACCESS_TOKEN = config.get('twitter', 'TWEET_OAUTH_ACCESS_TOKEN')
 +-TWEET_OAUTH_ACCESS_TOKEN_SECRET = config.get('twitter', 'TWEET_OAUTH_ACCESS_TOKEN_SECRET')
 +-
 +-TWEET_MAPQUEST_API_KEY = config.get('geo', 'TWEET_MAPQUEST_API_KEY')
 ++STATIC_URL = '/tweet-django/static/'
 + 
 + # Logging
 + 
- +            'filename': '/var/log/tweet-django/debug.log',
++ LOGGING = {
++     'version': 1,
++     'disable_existing_loggers': False,
+++    'formatters': {
+++        'verbose': {
+++            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
+++        },
+++        'simple': {
+++            'format': '%(levelname)s %(message)s'
+++        },
+++    },
++     'handlers': {
++         'console': {
++             'class': 'logging.StreamHandler',
++@@ -151,19 +128,36 @@
 +         'file': {
 +             'level': 'DEBUG',
 +             'class': 'logging.FileHandler',
 +-            'filename': 'django_debug.log',
- +            'handlers': ['file'],
-              'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
+++            'filename': '/var/log/tweet-django/tweet-django.log',
+++            'formatter': 'verbose'
 +         },
+++        'mail_admins': {
+++            'level': 'ERROR',
+++            'class': 'django.utils.log.AdminEmailHandler',
+++        }
 +     },
 +     'loggers': {
 +         'django': {
 +-            'handlers': ['console'],
- +            'handlers': ['file'],
-              'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG'),
++-            'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
+++            'handlers': ['file', 'mail_admins'],
+++            'level': os.getenv('DJANGO_LOG_LEVEL', 'WARNING'),
 +             'propagate': True
 +         },
 +         'tweet': {
 +-            'handlers': ['console'],
++-            'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG'),
+++            'handlers': ['file', 'mail_admins'],
+++            'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
 +             'propagate': True
 +         },
 +     },
 + }
 ++
 ++# Default paths
 ++TWEET_BASEPATH = '/var/lib/tweet-django'
 ++STATIC_ROOT = '/usr/share/tweet-django/static'
 ++STATIC_URL = '/tweet-django/static/'
 ++
 ++# Database settings, provided by dbconfig_common
 ++if os.path.exists("/etc/tweet-django/dbsettings.py"):
 ++    exec(open("/etc/tweet-django/dbsettings.py").read())
 ++
 ++if os.path.exists("/etc/tweet-django/settings.py"):
 ++    exec(open("/etc/tweet-django/settings.py").read())
diff --cc debian/rules
index 6965c98cb3ad52015f0bc231d6c2f4dc811d1682,0000000000000000000000000000000000000000..cecbe7dfe0c3ea1cc424b4d9cc4439dfe1de709d
mode 100755,000000..100755
--- /dev/null
@@@ -1,21 -1,0 +1,11 @@@
-       #install -m 0755 -D manage.py --target-directory=$(DESTDIR)/usr/share/tweet-django/
-       #install -m 0755 -D runstream.py --target-directory=$(DESTDIR)/usr/share/tweet-django/
-       #install -m 0640 -D tweet/*.py --target-directory=$(DESTDIR)/usr/share/tweet-django/tweet/
-       #install -m 0640 -D tweet/migrations/*.py  --target-directory=$(DESTDIR)/usr/share/tweet-django/tweet/migrations
-       #install -m 0640 -D tweet/templates/tweet/*  --target-directory=$(DESTDIR)/usr/share/tweet-django/templates/tweet/
-       #install -m 0640 -D tweet/static/tweet/favicon.ico  --target-directory=$(DESTDIR)/usr/share/tweet-django/static/tweet/
-       #install -m 0640 -D tweet/static/tweet/stylesheets/main.css --target-directory=$(DESTDIR)/usr/share/tweet-django/tweet_django/static/tweet/stylesheets/main.css
-       #install -m 0640 -D tweet_django/*.py  --target-directory=$(DESTDIR)/usr/share/tweet-django/tweet_django/
-       #install -m 0640 -D debian/dbsettings.py.template --target-directory=$(DESTDIR)/usr/share/tweet-django/debian/
-       #install -m 0640 -D debian/settings.py.template --target-directory=$(DESTDIR)/usr/share/tweet-django/debian/
-       #install -m 0640 -D debian/apache.conf --target-directory=$(DESTDIR)/etc/tweet-django/
 +#!/usr/bin/make -f
 +# -*- makefile -*-
 +
 +DESTDIR := debian/tweet-django
 +
 +%:
 +      dh $@ --with python3,systemd,apache2
 +
 +override_dh_auto_install:
++      # Do nothing fancy, just dh_install and friends which will happen automatically anyway
 +
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..8a603a57803974d57dfed698d210d835e210a82c
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,9 @@@
++/var/log/tweet-django/*.log {
++        rotate 14
++        daily
++        compress
++        delaycompress
++        copytruncate
++        missingok
++        notifempty
++}