__pycache__
*.pyc
*.log
+tweet_django/local.ini
+tweet_django/prod.ini
+.pc
--- /dev/null
+This package uses quilt as a patch management system, see /usr/share/doc/quilt/README.source.
--- /dev/null
+WSGIScriptAlias / /usr/share/tweet-django/tweet_django
+WSGIPythonPath /usr/share/tweet-django
+
+<Directory /usr/share/tweet-django/tweet_django/>
+<Files wsgi.py>
+Require all granted
+</Files>
+</Directory>
--- /dev/null
+tweet-django (1.0-1) unstable; urgency=medium
+
+ * Initial release. (Closes: #XXXXXX)
+
+ -- Jan-Pascal van Best <janpascal@vanbest.org> Thu, 11 Feb 2016 21:39:09 +0100
--- /dev/null
+#!/bin/sh
+
+set -e
+#set -x
+
+. /usr/share/debconf/confmodule
+if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
+ . /usr/share/dbconfig-common/dpkg/config.mysql
+ dbc_go tweet-django $@
+fi
--- /dev/null
+Source: tweet-django
+Section: net
+Priority: optional
+Maintainer: Jan-Pascal van Best <janpascal@vanbest.org>
+Build-Depends: debhelper (>= 9), python3, dh-python, dh-systemd (>= 1.3), quilt
+Standards-Version: 3.9.6
+Vcs-Git: git://anonscm.debian.org/collab-maint/tweet-django.git
+Vcs-Browser: http://anonscm.debian.org/cgit/collab-maint/tweet-django.git
+Homepage: https://github.com/tweet-django/tweet-django
+
+Package: tweet-django
+Architecture: all
+Depends: lsb-base (>= 3.1-13), ${python3:Depends}, ${misc:Depends},
+ libapache2-mod-wsgi-py3, dbconfig-common, ucf (>=0.28)
+Recommends: mysql-client
+Suggests: mysql-server
+Description: Utility to help sys admins thwart SSH crackers
+ tweet-django is a program that blah blah blah
--- /dev/null
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: tweet-django
+Upstream-Contact: Jan-Pascal van Best <janpascal@vanbest.org>
+Source: http://www.vanbest.org/gitweb/tweet_django
+
+Files: *
+Copyright: 2016, Jan-Pascal van Best <janpascal@vanbest.org>
+License: GPL-3+
+
+Files: debian/*
+Copyright: 2016, Jan-Pascal van Best <janpascal@vanbest.org>
+License: GPL-3+
+
+License: GPL-3+
+ This program is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later
+ version.
+ .
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the GNU General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, see
+ <http://www.gnu.org/licenses/> or write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 3 can be found in the file
+ `/usr/share/common-licenses/GPL-3'.
--- /dev/null
+# Database configuration
+# Managed by dbconfig-common
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends._DBC_DBTYPE_',
+ 'HOST': '_DBC_DBSERVER_',
+ 'NAME': '_DBC_DBNAME_',
+ 'USER': '_DBC_DBUSER_',
+ 'PASSWORD': '_DBC_DBPASS_',
+ 'OPTIONS': {'charset': 'utf8mb4'},
+ }
+}
+
--- /dev/null
+[DEFAULT]
+debian-branch=master
+upstream-branch=upstream
+upstream-tag=v%(version)s
--- /dev/null
+--- a/tweet_django/settings.py
++++ b/tweet_django/settings.py
+@@ -20,11 +20,8 @@
+ # 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 = []
+
+@@ -57,7 +54,7 @@
+ TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+- 'DIRS': [],
++ 'DIRS': ['/usr/share/tweet-django/templates'],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+@@ -111,34 +108,6 @@
+
+ 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')
+-
+ # Logging
+
+ LOGGING = {
+@@ -151,7 +120,7 @@
+ 'file': {
+ 'level': 'DEBUG',
+ 'class': 'logging.FileHandler',
+- 'filename': 'django_debug.log',
++ 'filename': '/var/log/tweet-django/debug.log',
+ },
+ },
+ 'loggers': {
+@@ -167,3 +136,10 @@
+ },
+ },
+ }
++
++# 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())
--- /dev/null
+patch-settings
--- /dev/null
+#!/bin/sh
+
+set -e
+#set -x
+
+. /usr/share/debconf/confmodule
+. /usr/share/dbconfig-common/dpkg/postinst.mysql
+dbc_sql_substitutions=1
+dbc_generate_include=template:/etc/tweet-django/dbsettings.py
+dbc_generate_include_args=-otemplate_infile=/usr/share/tweet-django/debian/dbsettings.py.template
+dbc_generate_include_owner=root:www-data
+dbc_generate_include_perms=0640
+dbc_go tweet-django $@
+
+if [ "$1" = configure ] ; then
+ random_key=$( env LANG=C LC_ALL=C tr -dc "[:alnum:]" < /dev/urandom | dd bs=1 count=63 2> /dev/null )
+ tempfile=`tempfile`
+ sed -e "s/__SECRET_KEY__/$random_key/" < /usr/share/tweet-django/debian/settings.py.template > $tempfile
+ chown root:www-data $tempfile
+ chmod 0640 $tempfile
+ ucf --debconf-ok $tempfile /etc/tweet-django/settings.py
+ ucfr tweet-django /etc/tweet-django/settings.py
+ rm -f $tempfile
+
+ if ! dpkg-statoverride --list /var/log/tweet-django >/dev/null; then
+ chown -R www-data:www-data /var/log/tweet-django
+ fi
+ if ! dpkg-statoverride --list /var/lib/tweet-django >/dev/null; then
+ chown -R www-data:www-data /var/lib/tweet-django
+ fi
+
+ /usr/share/tweet-django/manage.py migrate
+
+fi
+
+#DEBHELPER#
--- /dev/null
+#!/bin/sh
+
+set -e
+#set -x
+
+if [ -f /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+fi
+if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
+ . /usr/share/dbconfig-common/dpkg/postrm.mysql
+ dbc_go tweet-django $@
+fi
+
+
+if [ "$1" = "purge" ]; then
+ for conffile in dbsettings.py settings.py; do
+ rm -f /etc/tweet-django/$conffile
+ if which ucf >/dev/null 2>&1; then
+ ucf --debconf-ok --purge /etc/tweet-django/$conffile
+ ucfr --purge tweet-django /etc/tweet-django/$conffile
+ fi
+ done
+fi
+
+#DEBHELPER#
--- /dev/null
+#!/bin/sh
+
+set -e
+#set -x
+
+. /usr/share/debconf/confmodule
+. /usr/share/dbconfig-common/dpkg/prerm.mysql
+dbc_go tweet-django $@
+
+#DEBHELPER#
--- /dev/null
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+DESTDIR := debian/tweet-django
+
+%:
+ dh $@ --with python3,systemd
+
+override_dh_auto_install:
+ 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/javascript/* --target-directory=$(DESTDIR)/usr/share/tweet-django/static/tweet/javascript/
+ cp -r tweet/static/tweet/stylesheets --target-directory=$(DESTDIR)/usr/share/tweet-django/static/tweet/
+ 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 -o root -g www-data debian/settings.ini.example $(DESTDIR)/etc/tweet-django/settings.ini
+ install -m 0755 -d $(DESTDIR)/var/lib/tweet-django
+ install -m 0755 -d $(DESTDIR)/var/log/tweet-django
+
--- /dev/null
+# Database
+[misc]
+SECRET_KEY =
+
+[paths]
+TWEET_BASEPATH = /var/lib/tweet-django
+STATIC_ROOT = /usr/share/tweet-django/static
+STATIC_URL = /static/
+
+[twitter]
+TWEET_OAUTH_CONSUMER_KEY =
+TWEET_OAUTH_CONSUMER_SECRET =
+TWEET_OAUTH_ACCESS_TOKEN =
+TWEET_OAUTH_ACCESS_TOKEN_SECRET =
+
+[geo]
+TWEET_MAPQUEST_API_KEY =
--- /dev/null
+DEBUG = False
+
+# Fill in the host names your web server uses
+ALLOWED_HOSTS = ["127.0.0.1"]
+
+# Internationalization
+# https://docs.djangoproject.com/en/1.9/topics/i18n/
+
+LANGUAGE_CODE = 'en-us'
+TIME_ZONE = 'Europe/Amsterdam'
+USE_I18N = True
+USE_L10N = True
+USE_TZ = True
+
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/1.9/howto/static-files/
+
+STATIC_URL = '/static/'
+
+SECRET_KEY = '__SECRET_KEY__'
+
+TWEET_BASEPATH = '/var/lib/tweet-django'
+STATIC_ROOT = '/usr/share/tweet-django/static'
+STATIC_URL = '/static/'
+
+TWEET_OAUTH_CONSUMER_KEY = ''
+TWEET_OAUTH_CONSUMER_SECRET = ''
+TWEET_OAUTH_ACCESS_TOKEN = ''
+TWEET_OAUTH_ACCESS_TOKEN_SECRET = ''
+
+TWEET_MAPQUEST_API_KEY = ''
--- /dev/null
+3.0 (quilt)
--- /dev/null
+usr/share/tweet-django/static/tweet/javascript
+usr/share/tweet-django/static/tweet/stylesheets
+/etc/tweet-django
--- /dev/null
+usr/share/javascript/bootstrap/js/bootstrap.min.js usr/share/tweet-django/static/tweet/javascript/bootstrap.min.js
+usr/share/javascript/jquery/jquery.min.js usr/share/tweet-django/static/tweet/javascript/jquery.min.js
+usr/share/javascript/jquery-ui/jquery-ui.min.js usr/share/tweet-django/static/tweet/javascript/jquery-ui.min.js