diff options
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | PKGBUILD | 20 | ||||
-rw-r--r-- | sentry-celery.service | 4 | ||||
-rw-r--r-- | sentry.install | 112 | ||||
-rw-r--r-- | sentry.service | 2 |
5 files changed, 72 insertions, 80 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Tue Apr 12 05:02:04 UTC 2016 +# Wed Apr 20 03:18:05 UTC 2016 pkgbase = sentry pkgdesc = Python-based realtime logging and aggregation server. pkgver = 8.3.1 - pkgrel = 1 + pkgrel = 2 url = http://pypi.python.org/pypi/sentry install = sentry.install arch = any @@ -13,17 +13,15 @@ pkgbase = sentry makedepends = python2-virtualenv depends = jansson depends = python2 + depends = postgresql depends = redis - optdepends = mariadb: MySQL backend support - optdepends = postgresql: PostgreSQL backend support - optdepends = sqlite: SQLite backend support options = !strip source = sentry.install source = sentry.service source = sentry-celery.service - md5sums = a923b21928a227eda35dd76d599fbac1 - md5sums = 1559e7fcb42e4f0aeaaf8139baaac0d7 - md5sums = 78dd3e18109c2bf92f7f884de0237781 + sha256sums = b6bad889a0908133db9662e38cc34fcb408f04d03422b0245d04b145f1cfc7d7 + sha256sums = 7d835be498471eabe6ab9b72c9632d44b718e798984d9db40d17707162573ca4 + sha256sums = 6188e3fca3e9b4a6fd32fd3a9f39a3e4b489632b79cc6db307d767066fbbe518 pkgname = sentry @@ -3,7 +3,7 @@ pkgname=sentry pkgver=8.3.1 -pkgrel=1 +pkgrel=2 pkgdesc="Python-based realtime logging and aggregation server." arch=(any) url="http://pypi.python.org/pypi/sentry" @@ -11,25 +11,21 @@ license=(BSD) depends=( jansson python2 + postgresql redis ) makedepends=(python2-pip python2-setuptools python2-virtualenv) -optdepends=( - 'mariadb: MySQL backend support' - 'postgresql: PostgreSQL backend support' - 'sqlite: SQLite backend support' -) options=(!strip) -install="${pkgname}.install" +install="sentry.install" source=( - "${pkgname}.install" + "sentry.install" "sentry.service" "sentry-celery.service" ) -md5sums=( - a923b21928a227eda35dd76d599fbac1 # sentry.install - 1559e7fcb42e4f0aeaaf8139baaac0d7 # sentry.service - 78dd3e18109c2bf92f7f884de0237781 # sentry-celery.service +sha256sums=( + b6bad889a0908133db9662e38cc34fcb408f04d03422b0245d04b145f1cfc7d7 # sentry.install + 7d835be498471eabe6ab9b72c9632d44b718e798984d9db40d17707162573ca4 # sentry.service + 6188e3fca3e9b4a6fd32fd3a9f39a3e4b489632b79cc6db307d767066fbbe518 # sentry-celery.service ) package () { diff --git a/sentry-celery.service b/sentry-celery.service index 6723a2243be5..23b75f933d94 100644 --- a/sentry-celery.service +++ b/sentry-celery.service @@ -6,7 +6,7 @@ After=network.target User=sentry Restart=always Environment=PATH=/opt/sentry/bin -ExecStart=/opt/sentry/bin/sentry --config=/etc/sentry/sentry.conf.py celery worker --loglevel=ERROR -B -s /opt/sentry/celery/celerybeat-schedule +ExecStart=/opt/sentry/bin/sentry --config=/etc/sentry celery worker --loglevel=ERROR -B -s /opt/sentry/celery/celerybeat-schedule [Install] -WantedBy=multi-user.target
\ No newline at end of file +WantedBy=multi-user.target diff --git a/sentry.install b/sentry.install index 4dfd7cd9da2b..bfcd9d02965b 100644 --- a/sentry.install +++ b/sentry.install @@ -2,20 +2,18 @@ post_install(){ /usr/sbin/useradd -s /bin/false -d /opt/sentry -r sentry - /usr/bin/chown -R root:root /opt/sentry - /usr/bin/chown -R sentry:sentry /opt/sentry/.python-eggs - /usr/bin/chown -R sentry:sentry /etc/sentry - - # Storage location for Celery's database. /usr/bin/mkdir -p /opt/sentry/celery - /usr/bin/chown sentry:sentry /opt/sentry/celery + + /usr/bin/chown -R sentry:sentry /opt/sentry + /usr/bin/chown -R sentry:sentry /etc/sentry # Generate a new configuration. - if [ ! -e "/etc/sentry/sentry.conf.py" ] ; then - "/opt/sentry/bin/sentry" init "/etc/sentry/sentry.conf.py" + if [ ! -e "/etc/sentry/sentry.conf.py" ] || [ ! -e "/etc/sentry/config.yml" ] ; then + "/opt/sentry/bin/sentry" init "/etc/sentry" fi /usr/bin/chmod 0600 /etc/sentry/sentry.conf.py + /usr/bin/chmod 0600 /etc/sentry/config.yml cat << EOF @@ -23,47 +21,32 @@ INSTALLATION STEPS 1) Initialize Sentry's configuration: - sudo -u sentry PATH=/opt/sentry/bin:\$PATH \\ - /opt/sentry/bin/sentry init /etc/sentry + sudo -u sentry /opt/sentry/bin/sentry init /etc/sentry Be sure to edit the configurations in /etc/sentry before proceeding to the next step. -2) Install the appropriate database packages for your setup: - - # MySQL - sudo -u sentry -- /usr/bin/bash -c \\ - 'source /opt/sentry/bin/activate && /opt/sentry/bin/pip install mysql-python' - - # PostgreSQL - sudo -u sentry -- /usr/bin/bash -c \\ - 'source /opt/sentry/bin/activate && /opt/sentry/bin/pip install psycopg2' +2) Run migrations: -3) Run migrations: + sudo -u sentry /opt/sentry/bin/sentry --config=/etc/sentry upgrade - sudo -u sentry PATH=/opt/sentry/bin:\$PATH \\ - /opt/sentry/bin/sentry --config=/etc/sentry/sentry.conf.py upgrade +3) Create the initial superuser if you skipped doing so in the previous step: -4) Create the initial superuser: + sudo -u sentry /opt/sentry/bin/sentry --config=/etc/sentry createuser - sudo -u sentry PATH=/opt/sentry/bin:\$PATH \\ - /opt/sentry/bin/sentry --config=/etc/sentry/sentry.conf.py createuser - -5) Start Sentry: +4) Start Sentry: sudo systemctl start sentry sentry-celery If you wish to run Sentry manually, e.g. to test your configuration: - sudo -u sentry PATH=/opt/sentry/bin:\$PATH \\ - --config=/etc/sentry/sentry.conf.py start + sudo -u sentry /opt/sentry/bin/sentry --config=/etc/sentry start EXTRAS To install additional plugins, you'll need to use Sentry's local copy of pip: - sudo -u sentry PATH=/opt/sentry/bin:\$PATH \\ - /opt/sentry/bin/pip install <package> + sudo -u sentry /opt/sentry/bin/pip install <package> REMOVAL @@ -85,15 +68,13 @@ EOF post_upgrade(){ - /usr/bin/chown -R root:root /opt/sentry - /usr/bin/chown -R sentry:sentry /etc/sentry - /usr/bin/chown -R sentry:sentry /opt/sentry/.python-eggs - - # Storage location for Celery's database. /usr/bin/mkdir -p /opt/sentry/celery - /usr/bin/chown sentry:sentry /opt/sentry/celery + + /usr/bin/chown -R sentry:sentry /etc/sentry + /usr/bin/chown -R sentry:sentry /opt/sentry /usr/bin/chmod 0600 /etc/sentry/sentry.conf.py + /usr/bin/chmod 0600 /etc/sentry/config.yml cat << EOF @@ -105,7 +86,8 @@ UPGRADE STEPS sudo systemctl --system daemon-reload 2) If you're upgrading from a Sentry version < 8.0, you'll need to update the -configuration by hand. Sentry's configuration setup has changed dramatically: +configuration by hand. Sentry's configuration setup has changed dramatically +and increasingly more options are being moved to Sentry's YAML-based configs: sudo -u sentry mkdir /etc/sentry/temp sudo -u sentry /opt/sentry/bin/sentry init /etc/sentry/temp @@ -119,45 +101,61 @@ configuration by hand. Sentry's configuration setup has changed dramatically: # Delete the temporary config directory: sudo rm -r /etc/sentry/temp -3) Install the appropriate drivers if you don't already have them (you may skip -this step if you do): - - # MySQL - sudo -u sentry -- /usr/bin/bash -c \\ - 'source /opt/sentry/bin/activate && /opt/sentry/bin/pip install mysql-python' + See here: + https://docs.getsentry.com/on-premise/server/config/ - # PostgreSQL - sudo -u sentry -- /usr/bin/bash -c \\ - 'source /opt/sentry/bin/activate && /opt/sentry/bin/pip install psycopg2' - -4) Run the database migrations: +3) Run the database migrations: !!! ALWAYS BACK-UP YOUR DATABASE PRIOR TO UPGRADING SENTRY !!! - sudo -u sentry PATH=/opt/sentry/bin:\$PATH \\ - /opt/sentry/bin/sentry --config=/etc/sentry/sentry.conf.py upgrade + sudo -u sentry /opt/sentry/bin/sentry --config=/etc/sentry upgrade -5) Start Sentry: +4) Start Sentry: sudo systemctl start sentry sentry-celery If you wish to run Sentry manually, e.g. to test your configuration: - sudo -u sentry PATH=/opt/sentry/bin:\$PATH \\ - --config=/etc/sentry/sentry.conf.py start + sudo -u sentry /opt/sentry/bin/sentry --config=/etc/sentry start EXTRAS To install additional plugins, you'll need to use Sentry's local copy of pip: - sudo -u sentry PATH=/opt/sentry/bin:\$PATH \\ - /opt/sentry/bin/pip install <package> + sudo -u sentry /opt/sentry/bin/pip install <package> REMOVAL As of Sentry 7.1.4, this package will no longer remove the Sentry user by default. You must perform this step manually. +IMPORTANT 8.0 UPGRADE NOTICE + +If you're upgrading from an earlier version of Sentry, the Sentry team has +deprecated MySQL support. You will need to plan for one of the following +options: 1) Manage schema migration manually, 2) consider migrating your data +away from MySQL (there may be some tools to assist, linked below), or 3) +reinstall from scratch with PostgreSQL. + +8.0 Notice: + +http://blog.getsentry.com/2016/01/08/sentry-8-on-premise.htmlA + +Django migration tools from MySQL-to-PostgreSQL: + +https://www.calazan.com/migrating-django-app-from-mysql-to-postgresql/ +http://www.ofbrooklyn.com/2010/07/18/migrating-django-mysql-postgresql-easy-way/ + (2010!) + +And lastly, the PostgreSQL guide on moving your data (read carefully): + +https://wiki.postgresql.org/wiki/How_to_make_a_proper_migration_from_MySQL_to_PostgreSQL + +(Note: I'm not a Django developer although I have some experience with South +prior to its deprecation; my experience is predominantly limited to +SQLAlchemy, so I cannot vouch for the veracity of these tools and they are +provided on an informational basis only.) + SENTRY WON'T START? Recent versions of Sentry included a configuration for specifying large integers @@ -179,4 +177,4 @@ https://github.com/zancarius/archlinux-pkgbuilds EOF -}
\ No newline at end of file +} diff --git a/sentry.service b/sentry.service index 10bf3b150b3d..b6330508509d 100644 --- a/sentry.service +++ b/sentry.service @@ -7,7 +7,7 @@ Requires=sentry-celery.service User=sentry Restart=always Environment=PATH=/opt/sentry/bin -ExecStart=/opt/sentry/bin/sentry --config=/etc/sentry/sentry.conf.py start +ExecStart=/opt/sentry/bin/sentry --config=/etc/sentry start KillSignal=SIGINT [Install] |