Skip to content

Commit

Permalink
Merge pull request #561 from coders4help/release/4.0.0
Browse files Browse the repository at this point in the history
Release 4.0.0
  • Loading branch information
pitpalme authored Apr 4, 2022
2 parents 8a44645 + 6e26ec1 commit 11347ee
Show file tree
Hide file tree
Showing 395 changed files with 43,642 additions and 8,402 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git
.idea
.tx
.env
*.yml
.*ignore
*.log

**/*.pyc
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ indent_size = 4

[**.{yml,yaml}]
indent_size = 2

[**.sh]
indent_size = 4
trim_trailing_whitespace = true
19 changes: 19 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
DJANGO_SETTINGS_MODULE=volunteer_planner.settings.production

DATABASE_ENGINE=django.db.backends.postgresql_psycopg2
DATABASE_NAME=volunteer_planner
DATABASE_USER=vp
DATABASE_PW=volunteer_planner

ALLOWED_HOSTS=localhost
SECRET_KEY=

ADMIN_EMAIL=
SENDER_EMAIL=
FROM_EMAIL=
SERVER_EMAIL=
CONTACT_EMAIL=

EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend
SMTP_HOST=localhost
SMTP_PORT=8025
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
per-file-ignores =
volunteer_planner/settings/*.py: F401, F403, F405,

max-line-length = 88
5 changes: 5 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# To permanently auto-ignore the revs in this file during `git blame`:
# $ git config blame.ignoreRevsFile .git-blame-ignore-revs

# initial re-formatting with black
d7a57193f9e8c9cd4c6ed00d2f1e960ef5a5042c
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Idea / Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your idea or feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/requirements" # Location of package manifests
schedule:
interval: "daily"
136 changes: 136 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Check & Test

on:
push:
branches:
- develop
- main
- master
- release/*
pull_request:

jobs:
check-migrations:
name: Check Migrations
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: volunteer_planner.settings.tests
steps:
# Checkout the GitHub repo
- uses: actions/checkout@v2

# Install Python 3.9.6
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9.6"
cache: "pip"
cache-dependency-path: 'requirements/base.txt'

# Pip install project dependencies
- name: Install python packages with pip
run: |
python -m pip install --upgrade pip
pip install -r requirements/base.txt
# Check for missing Django migrations
- name: Check for missing Django migrations
run: python manage.py makemigrations --check

check-messages:
name: Check Translations
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: volunteer_planner.settings.tests
steps:
# Checkout the GitHub repo
- uses: actions/checkout@v2

# Install Python 3.9.6
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9.6"
cache: "pip"
cache-dependency-path: 'requirements/base.txt'

# apt install system dependencies
- name: Install apt packages
run: |
sudo apt install -y gettext
# Pip install project dependencies
- name: Install python packages with pip
run: |
python -m pip install --upgrade pip
pip install -r requirements/base.txt
# makemessages
- name: Run Django management command `makemessages`
run: ./scripts/makemessages.sh --all

# checkdiffs
- name: Check for uncommitted changes (in .po files)
run: ./scripts/checkdiffs.sh

# Check for fuzzy translations in .po files
- name: Check for fuzzy translations in .po files
run: ./scripts/checkfuzzy.sh

# compilemessages
- name: Run Django management command `compilemessages`
run: ./scripts/compilemessages.sh

black:
name: Check Code Style (black)
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: volunteer_planner.settings.tests
steps:
# Checkout the GitHub repo
- uses: actions/checkout@v2

# Run black
- uses: psf/black@stable
with:
options: "--check --target-version py39"

flake8:
runs-on: ubuntu-latest
name: Lint with flake8
steps:
- name: Check out source repository
uses: actions/checkout@v2
- name: flake8 Lint
uses: py-actions/flake8@v2

pytest:
name: Unit Tests
needs:
- check-migrations
- check-messages
# Run on a Ubuntu VM
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: volunteer_planner.settings.tests
steps:
# Checkout the GitHub repo
- uses: actions/checkout@v2

# Install Python 3.9.6
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9.6"
cache: "pip"
cache-dependency-path: 'requirements/base.txt'

# Pip install project dependencies
- name: Install python packages with pip
run: |
python -m pip install --upgrade pip
pip install -r requirements/tests.txt
# Run pytest
- name: Test with pytest
run: pytest -vv
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ db.sqlite3
/.coverage
*.log
.cache
fabfile.py
/var
.env
.ash_history
.python_history
.venv
.python-version
2 changes: 1 addition & 1 deletion .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ host = https://www.transifex.com

[volunteer-planner.django]
file_filter = locale/<lang>/LC_MESSAGES/django.po
minimum_perc = 0
source_file = locale/en/LC_MESSAGES/django.po
source_lang = en
type = PO

4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ All notable changes to this project will be documented in this file.
- [UI] Display a warning when joining overlapping shifts #395
- [UI] shift managers can see the e-mail address of approved and pending facility members to contact them
- enhancements to the excel document that is sent to shift managers
- Some javascript files from different CDN are now included in Volunteer Planner distribution.
- Some javascript files from different CDN are now included in Volunteer Planner distribution.
- [development] .editorconfig (PEP8 style)
- [development] new docstrings to source code
- [development] support for Docker containers for the test/development environment
Expand All @@ -38,7 +38,7 @@ All notable changes to this project will be documented in this file.

### Changed
- [UI] better alignment of page
- [UI] Additional information - if shifts span over midnight there is need of additional information to differentiate between shifts that start today and shifts that started yesterday. In these cases the date is shown in the field where the time is shown.
- [UI] Additional information - if shifts span over midnight there is need of additional information to differentiate between shifts that start today and shifts that started yesterday. In these cases the date is shown in the field where the time is shown.
- fixed issue 360: From field of emails is now DEFAULT_FROM_EMAIL and not anymore the fake from email of the shift manager.
- All used CSS and Javascript files are delivered by Volunteer Planner (instead of using some CDNs)
- text of HTTP 500 error was shortened.
Expand Down
60 changes: 50 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,61 @@
FROM python:2.7-alpine
ENV PYTHONUNBUFFERED=1 user=vp vpbasedir=/opt/vpcode/
#FROM python:3.6-alpine3.7
FROM alpine:3.14
ARG vpbasedir=/opt/vp/
ARG DJANGO_SETTINGS_MODULE=volunteer_planner.settings.production
ARG SECRET_KEY=local
ARG DATABASE_ENGINE=django.db.backends.postgresql
ARG BETA=""
ARG django_static_root=${vpbasedir}/static

ENV PYTHONUNBUFFERED=1 user=vp
ENV STATIC_ROOT=${django_static_root}

WORKDIR ${vpbasedir}

RUN addgroup -g 1000 ${user} && \
adduser -G vp -u 1000 -D -h ${vpbasedir} ${user} && \
chown ${user}:${user} ${vpbasedir}
adduser -G ${user} -u 1000 -D -h ${vpbasedir} ${user} && \
chown ${user}:${user} ${vpbasedir} && \
mkdir -p /run/vp ${STATIC_ROOT} && \
chown -R vp:vp /run/vp ${vpbasedir} ${STATIC_ROOT}

ADD requirements/*.txt ${vpbasedir}
ADD ./requirements ${vpbasedir}/requirements

RUN apk update && apk add musl-dev mariadb mariadb-client-libs mariadb-libs mariadb-dev postgresql postgresql-dev gcc && \
pip install -r dev_mysql.txt -r dev_postgres.txt && \
apk del --purge gcc mariadb-dev mariadb musl-dev && \
/bin/rm -rf /var/cache/apk/*
RUN apk update && \
apk add --virtual .build-deps \
gcc \
jpeg-dev \
musl-dev \
postgresql-dev \
python3-dev \
zlib-dev \
&& \
apk add \
gettext \
gettext-lang \
jpeg \
jq \
git \
postgresql \
libffi-dev \
py3-pip \
uwsgi \
uwsgi-cache \
uwsgi-http \
uwsgi-python3 \
&& \
pip3 install --upgrade --quiet pip setuptools uwsgitop && \
pip3 install -r requirements/postgres.txt ${BETA:+-r requirements/dev.txt} && \
apk del --purge .build-deps && \
/bin/rm -rf /var/cache/apk/* /root/.cache

ADD django-entrypoint.sh /
RUN chmod 0755 /django-entrypoint.sh

USER ${user}
CMD ["/bin/sh"]
ADD --chown=1000:1000 ./ ${vpbasedir}
RUN python3 manage.py compilemessages --use-fuzzy --no-color --traceback && \
echo "Translations compiled" && \
python3 manage.py collectstatic --clear --no-input --traceback --verbosity 0 && \
echo "Static files collected"

ENTRYPOINT [ "/django-entrypoint.sh" ]
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
[![Build Status](https://travis-ci.org/coders4help/volunteer_planner.svg?branch=master)](https://travis-ci.org/coders4help/volunteer_planner)

# volunteer-planner.org
# Volunteer Planner

Volunteer Planner is a platform to schedule shifts of volunteers. Volunteers register at the platform and choose shifts.
The admin of the website can easily add new organizations, places and shifts. The software has a location based
hierarchy (country / region / area / city) and has a hierarchy of organizations (organizations, facilities, tasks and
workplaces) - it can be used for a variety of purposes.

## Status
The project is currently running at https://volunteer-planner.org/.
This code has been used from 2015 to 2018 and since March 2022 at volunteer-planner.org.

## Work in progress
There are some feature requests to be implemented in the future.
The software currently needs a centralized administration of the shifts, but it is one of the main goals of the current
development to empower organizations to schedule shifts for their facilities on their own.

If you are interested to join the development team, just make pull requests or come to a meeting in Berlin/Germany:
http://www.meetup.com/de/coders4help/
If you are interested to contribute, join the [developer Slack channel](https://join.slack.com/t/coders4help/shared_invite/zt-1520v8cef-DytzxhO~ubmTrX0CdVcpxQ) or create a feature or fix pull request directly.

## System context
**User**: The volunteers and administrators just need a (modern) web browser to use the volunteer-planner application.
Expand Down Expand Up @@ -89,7 +86,7 @@ If you have questions concerning our workflow please read the

#### 2.1. Create a virtual env

Please refer to the canonical [virtualenv guide](http://docs.python-guide.org/en/latest/dev/virtualenvs/) for installation. We suggest you create a virtualenv named vp - so you can easily switch to your environment via
Please refer to the canonical [virtualenv guide](http://docs.python-guide.org/en/latest/dev/virtualenvs/) for installation. We suggest you create a virtualenv named vp - so you can easily switch to your environment via

workon vp

Expand Down
Loading

0 comments on commit 11347ee

Please sign in to comment.