Skip to content

Commit

Permalink
Merge branch 'release/2.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
flibbertigibbet committed Oct 4, 2019
2 parents 9d415e4 + 57fa19f commit ed99b92
Show file tree
Hide file tree
Showing 105 changed files with 592 additions and 658 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ VAGRANT_PROXYCONF_ENDPOINT = ENV["VAGRANT_PROXYCONF_ENDPOINT"]
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.box = "bento/ubuntu-18.04"

# Wire up the proxy if:
#
Expand Down
10 changes: 7 additions & 3 deletions deployment/ansible/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ postgres_user: "cac_tripplanner"
postgres_password: "cac_tripplanner"
postgres_host: "192.168.8.25"

packer_version: "1.0.2"
packer_version: "1.4.4"

# Python 2 version used where python 2 interpreter needed
python_version: "2.7.*"

nodejs_version: 10.16.0
nodejs_npm_version: 6.10.2
nodejs_version: 12.11.1
nodejs_npm_version: 6.11.3

pip_version: 19.2.*
virtualenv_version: 16.5.0

otp_version: "1.4.0"
otp_jar_sha1: "0367b1a15bac5f587807a5b897a9734209f8135c"

otp_router: "default"

# used by nginx and gunicorn to set timeouts; OTP defaults to 30s
Expand Down
3 changes: 0 additions & 3 deletions deployment/ansible/roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
- src: azavea.python
version: 0.1.0

- src: azavea.virtualenv
version: 0.1.0

- src: azavea.postgresql-support
version: 0.4.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
django_workers: 5
production: False

# Use python 3 on app VM
ansible_python_interpreter: "/usr/bin/python3"

app_sass_version: "3.4.22"

app_log: "/var/log/cac-tripplanner-app.log"
Expand Down
2 changes: 1 addition & 1 deletion deployment/ansible/roles/cac-tripplanner.app/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
- { role: "azavea.nodejs" }
- { role: "azavea.packer" }
- { role: "cac-tripplanner.papertrail", when: production }
- { role: "azavea.virtualenv" }
- { role: "cac-tripplanner.python3" }
11 changes: 3 additions & 8 deletions deployment/ansible/roles/cac-tripplanner.app/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
---
# # Note bzip2 only installed here as workaround for unresolved but closed phantomjs
# install issue: https://github.com/Medium/phantomjs/issues/659
- name: Install packages
apt:
state: present
pkg:
- binutils
- bzip2
- chromium-browser
- g++
- gdal-bin
- libpq-dev
- libproj-dev
- python-dev
- python3-pip
- libjpeg-dev

- name: Install pip packages to python3 for deployment
- name: Install pip packages for deployment
pip: requirements={{ root_app_dir }}/deployment_requirements.txt executable=/usr/bin/pip3

- name: Install pip packages
pip: requirements={{ root_app_dir }}/requirements.txt
- name: Install pip packages for app
pip: requirements={{ root_app_dir }}/requirements.txt executable=/usr/bin/pip3

- name: Touch log file and set permissions
file: path={{ app_log }} state=touch owner={{ app_username }} group={{ app_username }} mode=0664
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- libgeos-dev
- libgdal-dev
- libproj-dev
- libjson0-dev
- libjson-c-dev
- libxml2-dev
- libxml2-utils
- xsltproc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
bikeshare_update_interval_s: 120
bikeshare_update_url: 'https://gbfs.bcycle.com/bcycle_indego/'

# Use python 3 on OTP VM
ansible_python_interpreter: "/usr/bin/python3"

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
dependencies:
- { role: "cac-tripplanner.transitfeed" }
- { role: "azavea.opentripplanner" }
- { role: "cac-tripplanner.papertrail", when: production }
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
- name: Create Directory for OSM and GTFS
file: path={{ otp_data_dir }} state=directory owner={{ otp_user }}

- name: Copy Feed Validator
copy: src=validate_feed.py dest="{{ otp_data_dir }}"

- name: Install AuthBind (for serving OTP on port 80)
apt: pkg=authbind state=present

Expand Down
10 changes: 10 additions & 0 deletions deployment/ansible/roles/cac-tripplanner.python3/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Install Python 3 packages
apt:
state: present
pkg:
- build-essential
- python3
- python3-dev
- python3-pip
- python3-venv

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions deployment/packer/cac.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"sudo apt-get -y install build-essential python-dev python-pip git",
"sudo pip install --upgrade pip",
"sudo pip install --upgrade setuptools",
"sudo pip install paramiko==2.4.2",
"sudo pip install ansible==2.7.10"
"sudo pip install paramiko==2.6.0",
"sudo pip install ansible==2.8.2"
]
},
{
Expand Down
13 changes: 7 additions & 6 deletions python/cac_tripplanner/cac_tripplanner/custom_storages.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import urllib
import urlparse
import urllib.request
import urllib.parse
import urllib.error

from storages.backends.s3boto import S3BotoStorage

Expand All @@ -22,9 +23,9 @@ def __init__(self, *a, **k):

def url(self, name):
orig = super(PublicS3BotoStorage, self).url(name)
scheme, netloc, path, params, query, fragment = urlparse.urlparse(orig)
params = urlparse.parse_qs(query)
scheme, netloc, path, params, query, fragment = urllib.parse.urlparse(orig)
params = urllib.parse.parse_qs(query)
if 'x-amz-security-token' in params:
del params['x-amz-security-token']
query = urllib.urlencode(params)
return urlparse.urlunparse((scheme, netloc, path, params, query, fragment))
query = urllib.parse.urlencode(params)
return urllib.parse.urlunparse((scheme, netloc, path, params, query, fragment))
12 changes: 9 additions & 3 deletions python/cac_tripplanner/cac_tripplanner/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@

BASE_DIR = os.path.dirname(os.path.dirname(__file__))

# Tell image cropping library to use Django admin jquery,
# or else loading the image cropper will fail for destinations admin
# because it loads jquery for gis.admin.OSMGeoAdmin
IMAGE_CROPPING_JQUERY_URL = '/static/admin/js/vendor/jquery/jquery.js'


try:
secrets = yaml.safe_load(open('/etc/cac_secrets', 'r'))
except (IOError, NameError):
Expand Down Expand Up @@ -121,14 +127,14 @@
'shortlinks',
)

MIDDLEWARE_CLASSES = (
MIDDLEWARE = (
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware'
)

ROOT_URLCONF = 'cac_tripplanner.urls'
Expand Down
9 changes: 5 additions & 4 deletions python/cac_tripplanner/cac_tripplanner/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.conf.urls import include, url
from django.conf.urls import url
from django.urls import include
from django.views.generic import RedirectView
from django.contrib.gis import admin

Expand All @@ -7,7 +8,7 @@
from cms import views as cms_views
from destinations import views as dest_views

import settings
from django.conf import settings

urlpatterns = [
# Home view, which is also the directions and explore views
Expand Down Expand Up @@ -51,9 +52,9 @@
url(r'^learn/(?P<slug>[\w-]+)/$', cms_views.learn_detail, name='learn-detail'),

# Link Shortening
url(r'^link/', include('shortlinks.urls')),
url(r'^link/', include('shortlinks.urls', namespace='shortlinks')),

url(r'^admin/', include(admin.site.urls)),
url(r'^admin/', admin.site.urls),
]

if settings.DEBUG:
Expand Down
5 changes: 3 additions & 2 deletions python/cac_tripplanner/cms/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


from django.db import models, migrations
from django.conf import settings
Expand All @@ -24,7 +24,8 @@ class Migration(migrations.Migration):
('published', models.BooleanField(default=False)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('author', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
('author', models.ForeignKey(to=settings.AUTH_USER_MODEL,
on_delete=models.CASCADE)),
],
options={
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


from django.db import models, migrations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


from django.db import models, migrations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


from django.db import models, migrations
import cms.models
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


from django.db import models, migrations
from django.conf import settings
Expand Down
5 changes: 3 additions & 2 deletions python/cac_tripplanner/cms/migrations/0006_aboutfaq.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


from django.db import models, migrations
from django.conf import settings
Expand All @@ -24,7 +24,8 @@ class Migration(migrations.Migration):
('publish_date', models.DateTimeField(null=True, blank=True)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('author', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
('author', models.ForeignKey(to=settings.AUTH_USER_MODEL,
on_delete=models.CASCADE)),
],
options={
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


from django.db import models, migrations
from django.utils import timezone
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


from django.db import models, migrations
import cms.models
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


from django.db import models, migrations
import cms.models
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


from django.db import migrations, models
import cms.models
Expand Down
Loading

0 comments on commit ed99b92

Please sign in to comment.