Skip to content

Commit a23fa8f

Browse files
authored
Merge pull request #39 from cividi/master
release 0.7.0
2 parents 67e52d0 + fefac91 commit a23fa8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+6063
-38394
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
schedule:
21+
- cron: '15 22 * * 3'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: [ 'javascript', 'python' ]
32+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
33+
# Learn more:
34+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v2
39+
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v1
43+
with:
44+
languages: ${{ matrix.language }}
45+
# If you wish to specify custom queries, you can do so here or in a config file.
46+
# By default, queries listed here will override any specified in a config file.
47+
# Prefix the list here with "+" to use these queries and those in the config file.
48+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
49+
50+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51+
# If this step fails, then you should remove it and run the build manually (see below)
52+
- name: Autobuild
53+
uses: github/codeql-action/autobuild@v1
54+
55+
# ℹ️ Command-line programs to run using the OS shell.
56+
# 📚 https://git.io/JvXDl
57+
58+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59+
# and modify them (or add more) to build your code if your project
60+
# uses a compiled language
61+
62+
#- run: |
63+
# make bootstrap
64+
# make release
65+
66+
- name: Perform CodeQL Analysis
67+
uses: github/codeql-action/analyze@v1

.github/workflows/tests.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Tests
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches:
10+
- '*'
11+
pull_request:
12+
branches:
13+
- '*'
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
19+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
20+
jobs:
21+
run-tests-ubuntu:
22+
runs-on: ubuntu-latest
23+
24+
# Steps represent a sequence of tasks that will be executed as part of the job
25+
steps:
26+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27+
- uses: actions/checkout@v2
28+
29+
- name: Setup
30+
run: touch env.hosts.prod && docker-compose pull && make up && make init
31+
32+
# Runs a single command using the runners shell
33+
- name: Run tests
34+
run: make tests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ tmp
33
env.hosts.prod
44
server.yml
55
docker-prod.yml
6+
docker-compose-prod.yml
67
__pycache__/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ deploy_dev:
7777
deploy_local:
7878
docker-compose up -d
7979
make -f vue/Makefile build-cron
80-
source env.hosts.prod && rsync -av --delete vue/dist $$VUE_LOCAL_PATH
80+
docker-compose exec -T vue rsync -av --delete dist/ /var/services/django/static/dist/
8181
docker-compose exec -T django make migrate
8282
docker-compose exec -T django killall -TERM gunicorn
8383
docker-compose exec -T vue killall -TERM node

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Add `www.local` and `django` to the 127.0.0.1 entry in `/etc/hosts` (for screens
3434

3535
```bash
3636
touch env.hosts.prod # required file, can be empty and edited later
37+
# for local development add a symlink to the nginx configuration file, for production use a dedicated copy
38+
ln -s etc/nginx/www.local.dev etc/nginx/www.local.conf # default www.local.conf is not under version control
3739
```
3840

3941
download containers and start them

RELEASE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
## Releases
44

5+
### 0.7.0 dev
6+
7+
- Added `snapshot.json` upload
8+
- Added `snapshot.json` download in snapshot list
9+
- Added user login via django
10+
- Added API for snapshot upload
11+
- Added site config for homepage_snippet and search_enabled
12+
- Added language for homepage snippet
13+
- Added fathom support
14+
- Added data migration for snapshot json field to file refactor
15+
- Added vue file upload for snapshot file
16+
- Added frontend login page
17+
- Added frontend snapshot editing
18+
- Added apscheduler for screenshot generation
19+
- Updated django image with new python package versions
20+
21+
*Upgrade notes*:
22+
- Upgrading to 0.7.0 changes how snapshots are stored. The snapshot data is moved from a postgres json field to an external file. The migration is a normal django data migration and runs in the django database migration process (./manage.py migrate). The snapshot data json field will be removed in a future a release.
23+
- For local development symlinking the current nginx configuration is recommended (see README.md for details)
24+
525
### 0.6.2
626
[Released *2020-11-16*](https://bitbucket.org/cividi/gemeindescan-webui/commits/tag/0.6.2)
727

django/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
GEMEINDESCAN_WEBUI_DJANGO=0.3.4
1+
DJANGO_VERSION=3.1.4
2+
DJANGO_VERSION_PREV=0.3.4
23
DOCKER_EXEC=$(shell command -v docker > /dev/null && echo "docker-compose exec django")
34
all: dev run-tests run-tests-dev
45
.PHONY: all
@@ -8,10 +9,13 @@ enter:
89
$(DOCKER_EXEC) ash
910

1011
build_docker:
11-
cd docker && docker build -t smartuse/gemeindescan-webui-django:$(GEMEINDESCAN_WEBUI_DJANGO) django
12+
cd docker && DOCKER_BUILDKIT=1 \
13+
docker build django \
14+
--cache-from smartuse/gemeindescan-webui-django:$(DJANGO_VERSION_PREV) \
15+
--build-arg BUILDKIT_INLINE_CACHE=1 -t smartuse/gemeindescan-webui-django:$(DJANGO_VERSION)
1216

1317
push:
14-
docker push smartuse/gemeindescan-webui-django:$(GEMEINDESCAN_WEBUI_DJANGO)
18+
docker push smartuse/gemeindescan-webui-django:$(DJANGO_VERSION)
1519

1620
dev:
1721
$(DOCKER_EXEC) uvicorn main.asgi:application --port 8081 --host 0.0.0.0 --reload

django/docker/django/Dockerfile

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
FROM alpine:3.11
1+
FROM alpine:3.12.3
22
MAINTAINER Yves Serrano <[email protected]>
3-
ARG S6_OVERLAY_VERSION=v1.22.1.0
43
# https://github.com/just-containers/s6-overlay
54

65
ENV LANG C.UTF-8
@@ -21,35 +20,25 @@ RUN apk add --no-cache \
2120
autoconf \
2221
automake \
2322
libstdc++ \
24-
&& pip3 install --upgrade pip \
25-
&& mkdir -p /tmp/requirements
26-
RUN curl -Ls https://github.com/just-containers/s6-overlay/releases/download/$S6_OVERLAY_VERSION/s6-overlay-amd64.tar.gz | tar xz -C /
27-
28-
# dev libs
29-
RUN apk add --no-cache \
23+
bash \
24+
build-base \
25+
python3-dev \
26+
gdal \
27+
geos \
28+
proj \
29+
yajl \
30+
proj-datumgrid \
3031
zlib-dev \
3132
sqlite-dev \
3233
yaml-dev \
33-
libressl-dev
34+
libressl-dev \
35+
yajl-dev \
36+
&& curl -s https://bootstrap.pypa.io/get-pip.py | python3
37+
ARG S6_OVERLAY_VERSION=v2.1.0.2
38+
RUN curl -Ls https://github.com/just-containers/s6-overlay/releases/download/$S6_OVERLAY_VERSION/s6-overlay-amd64.tar.gz | tar xz -C /
3439

3540
# python requirements 00 layer
3641
COPY ./requirements/00.txt /tmp/requirements.txt
37-
RUN apk add --no-cache build-base python3-dev \
38-
&& pip3 install -r /tmp/requirements.txt \
39-
&& apk del build-base python3-dev
40-
41-
# geodjango layer
42-
RUN apk --no-cache add gdal geos proj proj-datumgrid
43-
44-
# python requirements 01 layer
45-
COPY ./requirements/01.txt /tmp/requirements.txt
46-
RUN apk --no-cache add yajl build-base yajl-dev python3-dev \
47-
&& curl -s https://bootstrap.pypa.io/get-pip.py | python3 \
48-
&& pip3 install -r /tmp/requirements.txt \
49-
&& apk del build-base yajl-dev python3-dev
50-
51-
# python requirements 02 layer
52-
COPY ./requirements/02.txt /tmp/requirements.txt
5342
RUN cd /opt && pip3 install -r /tmp/requirements.txt
5443

5544
COPY s6/etc/services.d /etc/services.d
Lines changed: 57 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,71 @@
11
aniso8601==7.0.0
2-
asgiref==3.2.3
3-
astroid==2.3.3
4-
attrs==19.3.0
2+
appdirs==1.4.4
3+
APScheduler==3.6.3
4+
asgiref==3.3.1
5+
astroid==2.4.2
6+
attrs==20.3.0
7+
beautifulsoup4==4.9.3
58
blessings==1.7
6-
bpython==0.18
7-
certifi==2019.11.28
8-
chardet==3.0.4
9-
Click==7.0
10-
curtsies==0.3.1
11-
Django==3.0.3
12-
django-cors-headers==3.2.1
13-
django-filter==2.2.0
9+
bpython==0.20.1
10+
certifi==2020.12.5
11+
chardet==4.0.0
12+
click==7.1.2
13+
curtsies==0.3.4
14+
Django==3.1.4
15+
django-apscheduler==0.5.1
16+
django-cors-headers==3.6.0
17+
django-filter==2.4.0
18+
django-json-widget==1.0.1
19+
django-solo==1.1.5
20+
django-sortedm2m==3.0.2
21+
-e git+https://github.com/svleeuwen/sortedm2m-filter-horizontal-widget.git@4ce03f6b7e6022014838afb4a8aa4691fceb9e94#egg=django_sortedm2m_filter_horizontal_widget
22+
djangorestframework==3.12.2
23+
future==0.18.2
1424
graphene==2.1.8
15-
graphene-django==2.8.1
16-
graphql-core==2.2.1
25+
graphene-django==2.14.0
26+
graphql-core==2.3.2
1727
graphql-relay==2.0.1
18-
greenlet==0.4.15
19-
gunicorn==19.9.0
20-
h11==0.9.0
21-
httptools==0.0.13
22-
idna==2.9
23-
isort==4.3.21
28+
greenlet==0.4.17
29+
gunicorn==20.0.4
30+
h11==0.11.0
31+
httptools==0.1.1
32+
idna==2.10
33+
iniconfig==1.1.1
34+
isort==5.6.4
35+
jsonslicer==0.1.6
2436
lazy-object-proxy==1.4.3
2537
mccabe==0.6.1
26-
more-itertools==8.2.0
38+
more-itertools==8.6.0
2739
olefile==0.46
28-
packaging==20.1
29-
Pillow==6.2.1
40+
ordered-set==4.0.1
41+
packaging==20.8
42+
Pillow==7.1.2
3043
pluggy==0.13.1
3144
promise==2.3
32-
psycopg2==2.8.4
33-
py==1.8.1
34-
Pygments==2.5.2
35-
pylint==2.4.4
36-
pylint-django==2.0.13
45+
psycopg2==2.8.5
46+
py==1.10.0
47+
Pygments==2.7.3
48+
pylint==2.6.0
49+
pylint-django==2.3.0
3750
pylint-plugin-utils==0.6
38-
pyparsing==2.4.6
39-
pytest==5.3.5
40-
pytz==2019.3
41-
requests==2.23.0
51+
pyparsing==2.4.7
52+
pytest==6.2.1
53+
pytest-django==4.1.0
54+
pytz==2020.5
55+
requests==2.25.1
4256
Rx==1.6.1
4357
singledispatch==3.4.0.3
44-
six==1.14.0
45-
sorl-thumbnail==12.6.3
46-
sqlparse==0.3.0
47-
urllib3==1.25.8
48-
uvicorn==0.11.2
58+
six==1.15.0
59+
sorl-thumbnail==12.7.0
60+
soupsieve==2.1
61+
sqlparse==0.4.1
62+
text-unidecode==1.3
63+
toml==0.10.2
64+
tzlocal==2.1
65+
urllib3==1.26.2
66+
uvicorn==0.13.2
4967
uvloop==0.14.0
50-
wcwidth==0.1.8
68+
wcwidth==0.2.5
5169
websockets==8.1
52-
wrapt==1.11.2
53-
yapf==0.29.0
70+
wrapt==1.12.1
71+
yapf==0.30.0

django/docker/django/requirements/01.txt

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)