Skip to content

Commit

Permalink
Merge pull request #51 from sebastienbarbier/develop
Browse files Browse the repository at this point in the history
Release v.1.1.0
  • Loading branch information
sebastienbarbier committed Dec 13, 2022
2 parents 02e0b51 + ed5c249 commit 35370f2
Show file tree
Hide file tree
Showing 12 changed files with 124 additions and 69 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ docker-compose.yml
.editorconfig
.travis.yml
.dockerignore
*.db
35 changes: 35 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Django CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main", "develop" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.9]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Migrate
run: |
python manage.py migrate
- name: Run Tests
env: # Set the secret as an input
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
python manage.py test --settings seven23.settings_tests
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ apps
.clever.json
.DS_Store
logfile
seven23_server.sublime-workspace
seven23_server.sublime-workspace
*.db
*.sqlite
*.sqlite3
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
See for sample https://raw.githubusercontent.com/favoloso/conventional-changelog-emoji/master/CHANGELOG.md
-->

## [1.1.0] - 2022-12-13
### ✨ Feature
- Allow **SQLite** for data storage ([#49](https://github.com/sebastienbarbier/seven23_server/issues/49))
### 🔒 Security
- Update dependencies ([#52](https://github.com/sebastienbarbier/seven23_server/issues/52))
### 🐛 Bug Fixes
- Fix broken password/reset/confirm API ([#60](https://github.com/sebastienbarbier/seven23_server/issues/60))
### 🏗 Chore
- Migrate **Continous Integration** from travis-ci to **Github actions** ([#40](https://github.com/sebastienbarbier/seven23_server/issues/40))
- Run within **Docker** ([#48](https://github.com/sebastienbarbier/seven23_server/issues/48))

## [1.0.1] - 2022-04-07
### 🔒 Security
- **Django** Security update ([#46](https://github.com/sebastienbarbier/seven23_server/issues/46))
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM python:3.9-alpine
WORKDIR /app
RUN mkdir /app/collectstatic

RUN adduser -D seven23
RUN adduser --disabled-password seven23
RUN chown seven23:seven23 /app /app/collectstatic
VOLUME /app/collectstatic

Expand All @@ -12,6 +12,7 @@ COPY --chown=seven23 . .
RUN \
apk add --no-cache postgresql-libs libstdc++ tzdata && \
apk add --no-cache --virtual .build-deps alpine-sdk postgresql-dev && \
apk --update add build-base jpeg-dev zlib-dev libffi-dev && \
python -m pip install --upgrade pip --no-cache-dir && \
python -m pip install -r requirements.txt --no-cache-dir && \
apk --purge del .build-deps
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Seven23 server

[![Documentation Status](https://readthedocs.org/projects/seven23-server/badge/?version=latest)](https://seven23-server.readthedocs.io/en/latest/?badge=latest) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/sebastienbarbier/seven23_server/blob/main/LICENSE)
[![Build action badge](https://github.com/sebastienbarbier/seven23_server/actions/workflows/django.yml/badge.svg?branch=main)](https://github.com/sebastienbarbier/seven23_server/actions/) [![Documentation Status](https://readthedocs.org/projects/seven23-server/badge/?version=latest)](https://seven23-server.readthedocs.io/en/latest/?badge=latest) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/sebastienbarbier/seven23_server/blob/main/LICENSE)


Fully manual budget app to track your expenses. Completely opensource, with privacy by design.
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

# General information about the project.
project = u'Seven23 server'
copyright = u'2019, Sébastien BARBIER'
copyright = u'2022, Sébastien BARBIER'
author = u'Sébastien BARBIER'

# The version info for the project you're documenting, acts as replacement for
Expand Down
102 changes: 51 additions & 51 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
asgiref==3.5.0
boto3==1.20.43
botocore==1.23.43
certifi==2021.10.8
cffi==1.15.0
chardet==3.0.4
charset-normalizer==2.0.10
asgiref==3.5.2
boto3==1.26.27
botocore==1.29.27
certifi==2022.12.7
cffi==1.15.1
chardet==5.1.0
charset-normalizer==2.0.12
colorclass==2.2.2
coreapi==2.3.3
coreschema==0.0.4
cryptography==36.0.1
cryptography==38.0.4
defusedxml==0.7.1
dj-database-url==0.5.0
dj-rest-auth==2.2.2
Django==4.0.6
django-allauth==0.47.0
dj-database-url==1.1.0
dj-rest-auth==2.2.5
Django==4.0.7
django-allauth==0.51.0
django-appconf==1.0.5
django-colorfield==0.6.3
django-compressor==3.1
django-cors-headers==3.11.0
django-colorfield==0.8.0
django-compressor==4.1
django-cors-headers==3.13.0
django-filter==21.1
django-grappelli==3.0.2
django-js-asset==1.2.2
django-mptt==0.13.4
django-grappelli==3.0.4
django-js-asset==2.0.0
django-mptt==0.14.0
django-reset-migrations==0.4.0
django-sass-processor==1.1
django-storages==1.12.3
djangorestframework==3.13.1
django-sass-processor==1.2.2
django-storages==1.13.1
djangorestframework==3.14.0
djangorestframework-bulk==0.2.1
docopt==0.6.2
docutils==0.18.1
drf-writable-nested==0.6.3
drf-yasg==1.20.0
docutils==0.19
drf-writable-nested==0.7.0
drf-yasg==1.21.4
gunicorn==20.1.0
idna==3.3
idna==3.4
inflection==0.5.1
itypes==1.2.0
Jinja2==3.0.3
jmespath==0.10.0
libsass==0.21.0
markdown2==2.4.2
MarkupSafe==2.0.1
oauthlib==3.1.1
Jinja2==3.1.2
jmespath==1.0.1
libsass==0.22.0
markdown2==2.4.6
MarkupSafe==2.1.1
oauthlib==3.2.2
openapi-codec==1.3.2
packaging==21.3
Pillow==9.0.1
pip-review==1.1.1
packaging==22.0
Pillow==9.3.0
pip-review==1.3.0
pip-upgrader==1.4.15
psycopg2==2.9.3
psycopg2-binary==2.9.3
psycopg2==2.9.5
psycopg2-binary==2.9.5
pycparser==2.21
PyJWT==2.3.0
pyparsing==3.0.7
PyJWT==2.6.0
pyparsing==3.0.9
python-dateutil==2.8.2
python-dotenv==0.19.2
python-dotenv==0.21.0
python3-openid==3.2.0
pytz==2021.3
pytz==2022.6
PyYAML==6.0
rcssmin==1.1.0
requests==2.27.1
requests-oauthlib==1.3.0
requests==2.28.1
requests-oauthlib==1.3.1
rjsmin==1.2.0
ruamel.yaml==0.17.20
ruamel.yaml.clib==0.2.6
s3transfer==0.5.0
sentry-sdk==1.5.4
simplejson==3.17.6
ruamel.yaml==0.17.21
ruamel.yaml.clib==0.2.7
s3transfer==0.6.0
sentry-sdk==1.11.1
simplejson==3.18.0
six==1.16.0
sqlparse==0.4.2
stripe==2.65.0
sqlparse==0.4.3
stripe==5.0.0
terminaltables==3.1.10
uritemplate==4.1.1
urllib3==1.26.8
whitenoise==5.3.0
urllib3==1.26.13
whitenoise==6.2.0
13 changes: 10 additions & 3 deletions seven23/models/rest_auth/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.contrib.auth import get_user_model, authenticate
from django.conf import settings
from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm
from django.contrib.auth.tokens import default_token_generator
# from django.contrib.auth.tokens import default_token_generator
from django.utils.http import urlsafe_base64_decode as uid_decoder
from django.utils.translation import gettext_lazy as _
from django.utils.encoding import force_str
Expand All @@ -11,6 +11,8 @@
from rest_framework.exceptions import ValidationError
from allauth.account.models import EmailAddress

from allauth.account.forms import default_token_generator

try:
from allauth.account import app_settings as allauth_settings
from allauth.utils import (email_address_exists,
Expand All @@ -32,6 +34,9 @@

from drf_writable_nested import WritableNestedModelSerializer

from allauth.account.utils import user_pk_to_url_str

from django.utils.http import base36_to_int, int_to_base36, urlencode

class UserSerializer(WritableNestedModelSerializer):
"""
Expand Down Expand Up @@ -84,15 +89,17 @@ def validate_email(self, value):

def save(self):
request = self.context.get('request')

user = UserModel.objects.get(email=self.initial_data['email'])
self.initial_data['username'] = user.username
self.initial_data['uidb36'] = int_to_base36(user.pk)

# Set some values to trigger the send_email method.
opts = {
'use_https': request.is_secure(),
'from_email': getattr(settings, 'DEFAULT_FROM_EMAIL'),
'request': request,
'extra_email_context': self.initial_data
'extra_email_context': self.initial_data,
'token_generator': default_token_generator,
}

opts.update(self.get_email_options())
Expand Down
7 changes: 7 additions & 0 deletions seven23/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@
DATABASES = {}
if DATABASE_URL:
DATABASES['default'] = dj_database_url.parse(DATABASE_URL, conn_max_age=600)
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3'
}
}

STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
Expand Down
2 changes: 1 addition & 1 deletion seven23/templates/registration/password_reset_email.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Hi,

Someone asked for password reset for email {{ email }}. Follow the link below:
{{ origin }}/resetpassword?uid={{ uid }}&token={{ token }}&u={{ username }}
{{ origin }}/resetpassword?uid={{ uidb36 }}&token={{ token }}&u={{ username }}

Thanks

0 comments on commit 35370f2

Please sign in to comment.