diff --git a/appliances/dpaste/Makefile b/appliances/dpaste/Makefile deleted file mode 100644 index d48f4a5..0000000 --- a/appliances/dpaste/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -PGVER = 9.3 -DPASTE_USER = dpaste -DPASTE_HOME = /opt/dpaste -PIP = $(DPASTE_HOME)/bin/pip -DPASTE_REPO = https://github.com/bartTC/dpaste - -rcdefault := /etc/runlevels/default - -preinstall: - -postinstall: bash_profile nginx.conf dpaste.init settings.py firstboot.start - $(inroot) $(EMERGE) $(USEPKG) --oneshot --noreplace dev-vcs/git - $(inroot) $(EMERGE) --noreplace $(USEPKG) dev-db/postgresql:$(PGVER) - $(inroot) passwd -d postgres - $(inroot) eselect postgresql set $(PGVER) - $(inroot) rm -rf /var/lib/postgresql/$(PGVER)/data - $(inroot) bash -c "echo y |$(EMERGE) --config postgresql:$(PGVER)" - $(inroot) systemctl enable postgresql-$(PGVER) - $(inroot) $(EMERGE) --oneshot --noreplace $(USEPKG) dev-python/virtualenv - $(inroot) getent passwd $(DPASTE_USER) || \ - $(inroot) useradd -c "Dpaste Server" -G postgres -U -d $(DPASTE_HOME) $(DPASTE_USER) - rm -rf $(CHROOT)/$(DPASTE_HOME) - mkdir -p $(CHROOT)/$(DPASTE_HOME) - mkdir -p $(CHROOT)/$(DPASTE_HOME)/media - mkdir -p $(CHROOT)/$(DPASTE_HOME)/var - $(inroot) rm -rf $(DPASTE_HOME)/dpaste - $(inroot) git clone $(DPASTE_REPO) $(DPASTE_HOME)/dpaste - sed -i 's/dpaste\.de/dpaste/g' $(CHROOT)/$(DPASTE_HOME)/dpaste/dpaste/templates/dpaste/*.html - cp bash_profile $(CHROOT)$(DPASTE_HOME)/.bash_profile - $(inroot) virtualenv -p /usr/bin/python2.7 $(DPASTE_HOME) - $(inroot) $(PIP) install -r $(DPASTE_HOME)/dpaste/requirements.txt - $(inroot) $(PIP) install psycopg2 - $(inroot) $(DPASTE_HOME)/bin/django-admin.py startproject project $(DPASTE_HOME) - grep ^SECRET_KEY $(CHROOT)/$(DPASTE_HOME)/project/settings.py > $(CHROOT)/$(DPASTE_HOME)/project/keyfile.py - cp settings.py $(CHROOT)/$(DPASTE_HOME)/project/settings.py - chmod +x $(CHROOT)/$(DPASTE_HOME)/manage.py - cp nginx.conf $(CHROOT)/etc/nginx - cp dpaste.init $(CHROOT)/etc/init.d/dpaste - cp firstboot.start $(CHROOT)/etc/local.d/firstboot.start - touch $(CHROOT)/firstboot - $(inroot) systemctl enable nginx - $(inroot) ln -sf ../manage.py $(DPASTE_HOME)/bin/manage - $(inroot) $(EMERGE) --depclean --with-bdeps=n - - -clean: - diff --git a/appliances/dpaste/bash_profile b/appliances/dpaste/bash_profile deleted file mode 100644 index 06f9bc8..0000000 --- a/appliances/dpaste/bash_profile +++ /dev/null @@ -1,3 +0,0 @@ -export DJANGO_SETTINGS_MODULE='project.settings_local' -PATH="$HOME/bin:$PATH" -. activate diff --git a/appliances/dpaste/dpaste.init b/appliances/dpaste/dpaste.init deleted file mode 100755 index a5f5046..0000000 --- a/appliances/dpaste/dpaste.init +++ /dev/null @@ -1,35 +0,0 @@ -#!/sbin/runscript -# Copyright 2013-2015 Marduk Enterprises (marduk@python.net) -# Distributed under the terms of the GNU General Public License v2 - -description="GUnicorn server for the dpaste app" - -depend() { - need localmount - after nginx - after postgresql-9.3 -} - - -start() { - ebegin "Starting dpaste" - . /opt/dpaste/bin/activate - export PYTHONPATH=/opt/dpaste/dpaste - start-stop-daemon --start --exec /opt/dpaste/bin/python -- /opt/dpaste/manage.py run_gunicorn \ - --user=dpaste \ - --daemon \ - --group=dpaste \ - --workers=2 \ - --error-logfile=/opt/dpaste/var/gunicorn.error.log \ - --pid=/opt/dpaste/var/gunicorn.pid \ - --bind=unix:///opt/dpaste/var/dpaste.sock -} - - -stop() { - ebegin "Stopping dpaste" - start-stop-daemon --stop \ - --pidfile /opt/dpaste/var/gunicorn.pid \ - --exec /opt/dpaste/bin/python - eend $? "Failed to stop dpaste" -} diff --git a/appliances/dpaste/firstboot.start b/appliances/dpaste/firstboot.start deleted file mode 100755 index 6ee9a3a..0000000 --- a/appliances/dpaste/firstboot.start +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -e - -[ -e /firstboot ] || exit 0 - -echo 'Creating dpaste database' -createuser -U postgres -D -S -R dpaste -createdb -U postgres dpaste - -. /opt/dpaste/bin/activate -PYTHON=/opt/dpaste/bin/python -PYTHONPATH=/opt/dpaste/dpaste ; export PYTHONPATH -$PYTHON /opt/dpaste/manage.py syncdb --noinput -$PYTHON /opt/dpaste/manage.py migrate --all -rc-update add dpaste default -/etc/init.d/dpaste start - -rm /firstboot diff --git a/appliances/dpaste/make.conf b/appliances/dpaste/make.conf deleted file mode 100644 index bbc9ec1..0000000 --- a/appliances/dpaste/make.conf +++ /dev/null @@ -1,3 +0,0 @@ - -# NGINX flags -NGINX_MODULES_HTTP="auth_basic gzip proxy referer rewrite headers_more uwsgi" diff --git a/appliances/dpaste/nginx.conf b/appliances/dpaste/nginx.conf deleted file mode 100644 index 1b56cf6..0000000 --- a/appliances/dpaste/nginx.conf +++ /dev/null @@ -1,68 +0,0 @@ -user nginx nginx; -worker_processes 1; - -error_log /var/log/nginx/error_log info; - -events { - worker_connections 1024; - use epoll; -} - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - log_format main - '$remote_addr - $remote_user [$time_local] ' - '"$request" $status $bytes_sent ' - '"$http_referer" "$http_user_agent" ' - '"$gzip_ratio"'; - - client_header_timeout 10m; - client_body_timeout 10m; - send_timeout 10m; - - connection_pool_size 256; - client_header_buffer_size 1k; - large_client_header_buffers 4 2k; - request_pool_size 4k; - - gzip on; - gzip_min_length 1100; - gzip_buffers 4 8k; - gzip_types text/plain; - - output_buffers 1 32k; - postpone_output 1460; - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - - keepalive_timeout 75 20; - - ignore_invalid_headers on; - - index index.html; - - upstream dpaste { - server unix:///opt/dpaste/var/dpaste.sock; - } - - server { - listen 0.0.0.0; - - location /static/ { - alias /opt/dpaste/dpaste/dpaste/static/; - } - - location / { - proxy_pass http://dpaste; - } - - access_log /var/log/nginx/dpaste.access_log main; - error_log /var/log/nginx/dpaste.error_log info; - - root /var/www/localhost/htdocs; - } -} diff --git a/appliances/dpaste/package.keywords b/appliances/dpaste/package.keywords deleted file mode 100644 index daa1737..0000000 --- a/appliances/dpaste/package.keywords +++ /dev/null @@ -1 +0,0 @@ -sys-kernel/gentoo-sources ~amd64 ~x86 diff --git a/appliances/dpaste/package.use b/appliances/dpaste/package.use deleted file mode 100644 index f88c5cf..0000000 --- a/appliances/dpaste/package.use +++ /dev/null @@ -1,15 +0,0 @@ -app-editors/nano ncurses -dev-lang/python ssl threads xml -dev-libs/libpcre cxx -dev-util/pkgconfig internal-glib -dev-vcs/git curl -net-misc/curl ssl curl_ssl_openssl -net-misc/openssh ssl -sys-apps/hwids udev -sys-apps/kmod tools -sys-apps/portage python3 ipc -sys-auth/pambase nullok sha512 -sys-devel/gcc cxx nptl -sys-kernel/gentoo-sources symlink - -dev-db/postgresql server diff --git a/appliances/dpaste/settings.py b/appliances/dpaste/settings.py deleted file mode 100644 index ba41076..0000000 --- a/appliances/dpaste/settings.py +++ /dev/null @@ -1,151 +0,0 @@ -# Django settings for dpaste project. - -DEBUG = False -TEMPLATE_DEBUG = DEBUG - -ADMINS = ( - # ('Your Name', 'your_email@example.com'), -) - -MANAGERS = ADMINS - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': 'dpaste', # Or path to database file if using sqlite3. - # The following settings are not used with sqlite3: - 'USER': 'dpaste', - 'PASSWORD': '', - 'HOST': 'localhost', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. - 'PORT': '', # Set to empty string for default. - } -} - -# Hosts/domain names that are valid for this site; required if DEBUG is False -# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts -ALLOWED_HOSTS = ['*'] - -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# In a Windows environment this must be set to your system time zone. -TIME_ZONE = 'UTC' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html -LANGUAGE_CODE = 'en-us' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True - -# If you set this to False, Django will not format dates, numbers and -# calendars according to the current locale. -USE_L10N = True - -# If you set this to False, Django will not use timezone-aware datetimes. -USE_TZ = True - -# Absolute filesystem path to the directory that will hold user-uploaded files. -# Example: "/var/www/example.com/media/" -MEDIA_ROOT = '' - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash. -# Examples: "http://example.com/media/", "http://media.example.com/" -MEDIA_URL = '' - -# Absolute path to the directory static files should be collected to. -# Don't put anything in this directory yourself; store your static files -# in apps' "static/" subdirectories and in STATICFILES_DIRS. -# Example: "/var/www/example.com/static/" -STATIC_ROOT = '' - -# URL prefix for static files. -# Example: "http://example.com/static/", "http://static.example.com/" -STATIC_URL = '/static/' - -# Additional locations of static files -STATICFILES_DIRS = ( - # Put strings here, like "/home/html/static" or "C:/www/django/static". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. -) - -# List of finder classes that know how to find static files in -# various locations. -STATICFILES_FINDERS = ( - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', -# 'django.contrib.staticfiles.finders.DefaultStorageFinder', -) - -from keyfile import SECRET_KEY - -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.Loader', -) - -MIDDLEWARE_CLASSES = ( - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - # Uncomment the next line for simple clickjacking protection: - # 'django.middleware.clickjacking.XFrameOptionsMiddleware', -) - -ROOT_URLCONF = 'dpaste.urls' - -# Python dotted path to the WSGI application used by Django's runserver. -WSGI_APPLICATION = 'project.wsgi.application' - -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. -) - -INSTALLED_APPS = ( - 'django.contrib.sessions', - 'django.contrib.staticfiles', - 'mptt', - 'south', - 'gunicorn', - 'dpaste', -) - -# A sample logging configuration. The only tangible logging -# performed by this configuration is to send an email to -# the site admins on every HTTP 500 error when DEBUG=False. -# See http://docs.djangoproject.com/en/dev/topics/logging for -# more details on how to customize your logging configuration. -LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'filters': { - 'require_debug_false': { - '()': 'django.utils.log.RequireDebugFalse' - } - }, - 'handlers': { - 'mail_admins': { - 'level': 'ERROR', - 'filters': ['require_debug_false'], - 'class': 'django.utils.log.AdminEmailHandler' - } - }, - 'loggers': { - 'django.request': { - 'handlers': ['mail_admins'], - 'level': 'ERROR', - 'propagate': True, - }, - } -} diff --git a/appliances/dpaste/world b/appliances/dpaste/world deleted file mode 100644 index d605ee9..0000000 --- a/appliances/dpaste/world +++ /dev/null @@ -1,2 +0,0 @@ -dev-lang/python:2.7 -www-servers/nginx