Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev branch: Inversion Latitude Longitude #144 #150

Closed
wants to merge 95 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
96ab607
merge pulls requests
ClemsP May 10, 2021
9816d4d
Update dependencies OpenRepairPlatform
LucienD May 10, 2021
f7238c9
add id in stock create success message
ClemsP May 11, 2021
1afb51e
add immited fiels in reccurent events form
ClemsP May 11, 2021
0a7811b
flake8 and black project
LucienD May 11, 2021
b5198a8
fix datetime form error
ClemsP May 11, 2021
aff5f0a
add publish infos on event template
ClemsP May 11, 2021
1441c9e
Merge remote-tracking branch 'origin/fix/duplicate_user' into dev_branch
ClemsP May 11, 2021
e926c3b
WIP: repare test
LucienD May 12, 2021
4c9bf42
Fixed current test
LucienD May 17, 2021
b5527cc
display publish date
ClemsP May 17, 2021
7fd5d80
Clean assets
ClemsP May 21, 2021
c1367b8
clean assets
ClemsP May 21, 2021
8eab285
delete useless templates
ClemsP May 21, 2021
5dc46fb
clean assets, ass bootstrap 5 and arrange events_list template
ClemsP May 25, 2021
7c7ac2a
Update event usage
LucienD May 25, 2021
c1c4f84
bootstrap changes
ClemsP May 25, 2021
94f26db
add migrations
LucienD May 25, 2021
d579996
coverage tests - fix js autocomplete user
LucienD May 26, 2021
7621719
Generic method to send mail - Add DJANGO_FROM_EMAIL global variable i…
LucienD May 27, 2021
fb0cb62
Add command to remove inactive user two weeks after - Add this comman…
LucienD May 27, 2021
b55a093
Add ical view to get file ics with events sorted by organization
LucienD May 27, 2021
5d86a9c
Templating
ClemsP May 28, 2021
4cd8faf
Merge branch 'update_app_dependencies' of https://github.com/AtelierS…
ClemsP May 28, 2021
9115aa3
Add ics detail event
LucienD May 28, 2021
64d49f0
Add event admin view
LucienD May 28, 2021
c7edf0a
Merge remote-tracking branch 'origin/update_app_dependencies' into de…
ClemsP May 28, 2021
10e5126
delete feed.html
ClemsP May 28, 2021
1aa87e1
Merge remote-tracking branch 'origin/event_to_ical_by_orga' into dev_…
ClemsP May 28, 2021
5be497f
Merge remote-tracking branch 'origin/cron_command_delete_inactive_use…
ClemsP May 28, 2021
01df7b9
Merge remote-tracking branch 'origin/generic_send_mail' into dev_branch
ClemsP May 28, 2021
2a546df
merge fix
ClemsP May 28, 2021
1b672f9
clean
ClemsP May 28, 2021
16e987a
Fix merge - Add view to send invitation
LucienD May 28, 2021
482317b
sass changes
ClemsP Jun 6, 2021
3fd4ea9
templating event app
ClemsP Jun 19, 2021
0d26376
templating
ClemsP Jun 20, 2021
a40869e
change python docker version
ClemsP Jun 29, 2021
db64aa0
Merge branch 'dev_branch' of https://github.com/AtelierSoude/OpenRepa…
ClemsP Jun 29, 2021
9e48323
settings
ClemsP Jun 29, 2021
8f8c9fe
fix django assets version
ClemsP Jul 2, 2021
9bb92b7
Optimisation debug template and prefetch
LucienD Jul 5, 2021
f1343da
limit queries
ClemsP Jul 13, 2021
84f8bb0
debugs
ClemsP Sep 8, 2021
286265a
Merge remote-tracking branch 'origin/fix_publish' into prod_debug
ClemsP Sep 8, 2021
33d9801
fix
ClemsP Sep 8, 2021
0857747
fixes
ClemsP Sep 8, 2021
955e08f
Merge remote-tracking branch 'origin/fix_publish' into prod_debug
ClemsP Sep 8, 2021
a5da82f
fix event publish
ClemsP Sep 8, 2021
92e4cec
add migration
ClemsP Sep 8, 2021
07cf087
Merge remote-tracking branch 'origin/fix_publish' into prod_debug
ClemsP Sep 8, 2021
481edef
fix merge
ClemsP Sep 8, 2021
5dc706e
fix publication
ClemsP Sep 8, 2021
a28aff7
comment cron
ClemsP Dec 7, 2021
d2734cb
undo .env
ClemsP Dec 7, 2021
fb7e85b
change gitignore
ClemsP Dec 7, 2021
eef07cb
delete .env
ClemsP Dec 7, 2021
0610075
Fix bug membership on fees :
LucienD Dec 10, 2021
538093a
Fix open API to users
LucienD Dec 11, 2021
dedf620
Fix timezone on ical views and fix test events
LucienD Dec 12, 2021
29c7072
correct reference fee template
ClemsP Dec 12, 2021
ee3a2bc
fix computed payment
LucienD Dec 12, 2021
f65827c
Merge pull request #135 from AtelierSoude/feature/membership_no_updat…
ClemsP Dec 12, 2021
bd6d029
Merge pull request #137 from AtelierSoude/fix/timezone_ical
ClemsP Dec 12, 2021
5fc9c11
Merge branch 'dev_branch' of https://github.com/AtelierSoude/OpenRepa…
ClemsP Dec 12, 2021
b0e331b
Change permissions to All manager orga
LucienD Dec 12, 2021
67d6c2e
Merge pull request #136 from AtelierSoude/fix/api_user
ClemsP Dec 12, 2021
298b662
fix events templates
ClemsP Dec 12, 2021
8be76ca
correct copytoclipboard event ical
ClemsP Dec 12, 2021
27c5986
use Membership insteed of CustomUser in MemberTable view
ClemsP Dec 12, 2021
6692269
template event list
ClemsP Dec 12, 2021
42f5334
Merge pull request #138 from AtelierSoude/fix/templates
ClemsP Dec 12, 2021
188e791
Fix bug fees and add script to fix old data
LucienD Dec 15, 2021
a77c787
Fix templatetags Fees on user
LucienD Dec 15, 2021
dda301d
Fix bug fee linked to user and add button fee in user detail view
LucienD Dec 17, 2021
ef6bcb0
Merge pull request #140 from AtelierSoude/feature/add_fee_member_page
LucienD Dec 17, 2021
bc7929b
Update Dockerfile
LucienD Dec 17, 2021
19480d2
Fix sass
LucienD Dec 17, 2021
8bb8f08
fix sass
LucienD Dec 17, 2021
933a5bf
fix sass
LucienD Dec 17, 2021
bbbdf06
fix scss
LucienD Dec 19, 2021
9a57eff
update bootstrap add delete bootstrapcustom assets
ClemsP Jan 7, 2022
8fb6d93
Add location in Open repair platform
LucienD Jan 7, 2022
c916462
add jquery npm
ClemsP Jan 7, 2022
1884d54
update dockerfile
ClemsP Jan 7, 2022
5afb46e
Merge branch 'fix/css' into dev_branch
ClemsP Jan 7, 2022
8a19d3e
spelling mistake
ClemsP Jan 7, 2022
93a8199
add docker without let's encrypt
ClemsP Jan 15, 2022
29bfc46
Merge branch 'dev_branch' into feature/location
ClemsP Jan 15, 2022
ee9e14e
Merge pull request #141 from AtelierSoude/feature/location
ClemsP Jan 15, 2022
f3f86b3
merge localization
ClemsP Jan 15, 2022
b0b6127
add postgis docker support
ClemsP Jan 15, 2022
ce65b10
change gonnette to monnaie locale
ClemsP Jan 15, 2022
00f826f
css updates
ClemsP Jan 17, 2022
4964c9e
css change
ClemsP Jan 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@ celerybeat-schedule
*.sage.py

# dotenv
deployment/django/django.env
openrepairplatform/.env
deployment/postgres/postgres.env
deployment/nginx/nginx.env
.env
deployment/.env

# virtualenv
.venv
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"restructuredtext.confPath": "",
"python.pythonPath": "/Users/clementpoudret/env/ateliersoude/bin/python"
"python.pythonPath": "/Users/clementpoudret/env/ateliersoude/bin/python",
"git.ignoreLimitWarning": true
}
11 changes: 0 additions & 11 deletions deployment/build.sh

This file was deleted.

4 changes: 0 additions & 4 deletions deployment/checklist.txt

This file was deleted.

10 changes: 6 additions & 4 deletions deployment/django/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM debian:buster
FROM python:3.9-slim-buster

RUN apt update && apt upgrade -y && apt install -y --force-yes python3-pip libpq-dev locales locales-all cron make ruby ruby-dev
RUN gem install sass
RUN apt update && apt upgrade -y && apt install -y --force-yes python3-pip libpq-dev locales locales-all cron make nodejs npm sassc binutils libproj-dev gdal-bin
RUN pip3 install uwsgi
RUN ln /usr/bin/sassc /usr/bin/sass

COPY requirements.txt /
RUN pip3 install -r /requirements.txt && rm /requirements.txt
Expand All @@ -25,10 +25,12 @@ COPY deployment/django/start.sh /
COPY openrepairplatform ./openrepairplatform
COPY deployment/django/openrepairplatform.cron /etc/cron.d/openrepairplatform

RUN cd openrepairplatform/static/ && npm i && cd -

RUN chmod 0644 /etc/cron.d/openrepairplatform
RUN cron
RUN useradd openrepairplatform

EXPOSE 8000

CMD /start.sh
CMD /start.sh
5 changes: 3 additions & 2 deletions deployment/django/openrepairplatform.cron
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
5 * * * * openrepairplatform cd /srv/app && LANG=fr_FR.UTF-8 EMAIL_PASSWORD={{EMAIL_PASSWORD}} SECRET_KEY={{SECRET_KEY}} DJANGO_SETTINGS_MODULE=openrepairplatform.settings.prod python3 manage.py publish_events > /tmp/log_publish_events 2>&1
0 16 * * * openrepairplatform cd /srv/app && LANG=fr_FR.UTF-8 EMAIL_PASSWORD={{EMAIL_PASSWORD}} SECRET_KEY={{SECRET_KEY}} DJANGO_SETTINGS_MODULE=openrepairplatform.settings.prod python3 manage.py notify_next_day_events https://dev.atelier-soude.fr > /tmp/log_publish_events 2>&1
* * * * * openrepairplatform cd /srv/app && LANG=fr_FR.UTF-8 EMAIL_PASSWORD={{EMAIL_PASSWORD}} SECRET_KEY={{SECRET_KEY}} DJANGO_SETTINGS_MODULE=openrepairplatform.settings.prod /usr/local/bin/python3 manage.py publish_events > /tmp/log_publish_events 2>&1
0 16 * * * openrepairplatform cd /srv/app && LANG=fr_FR.UTF-8 EMAIL_PASSWORD={{EMAIL_PASSWORD}} SECRET_KEY={{SECRET_KEY}} DJANGO_SETTINGS_MODULE=openrepairplatform.settings.prod /usr/local/bin/python3 manage.py notify_next_day_events https://reparons.org > /tmp/log_nextday_events 2>&1
# 0 22 * * * openrepairplatform cd /srv/app && LANG=fr_FR.UTF-8 EMAIL_PASSWORD={{EMAIL_PASSWORD}} SECRET_KEY={{SECRET_KEY}} DJANGO_SETTINGS_MODULE=openrepairplatform.settings.prod /usr/local/bin/python3 manage.py clean_inactive_users > /tmp/clean_users 2>&1
# empty line
1 change: 0 additions & 1 deletion deployment/django/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash

rm /start.sh
sed -i "s/{{SECRET_KEY}}/${SECRET_KEY}/" /etc/cron.d/openrepairplatform
sed -i "s/{{EMAIL_PASSWORD}}/${EMAIL_PASSWORD}/" /etc/cron.d/openrepairplatform
service cron start
Expand Down
49 changes: 49 additions & 0 deletions deployment/docker-compose-no-certificat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: '3'

services:
db:
image: postgis/postgis
container_name: postgres
env_file:
- ../openrepairplatform/.env
volumes:
- ./openrepairplatform_data/postgres_data:/var/lib/postgresql/data
networks:
- openrepairplatform-net

django:
build:
context: ../
dockerfile: deployment/django/Dockerfile
image: openrepairplatform_python
container_name: openrepairplatform_python
ports:
- "8000:8000"
env_file:
- ../openrepairplatform/.env
volumes:
- ./openrepairplatform_data/openrepairplatform_static:/srv/static
- ./openrepairplatform_data/openrepairplatform_media:/srv/media
depends_on:
- db
networks:
- openrepairplatform-net

nginx:
image: nginx
container_name: openrepairplatform_nginx
ports:
- "80:80"
env_file:
- ../openrepairplatform/.env
volumes:
- ./openrepairplatform_data/openrepairplatform_static:/srv/static:ro
- ./openrepairplatform_data/openrepairplatform_media:/srv/media:ro
- ./nginx/nginx-no-certificat.conf:/etc/nginx/conf.d/default.conf
networks:
- openrepairplatform-net
depends_on:
- django

networks:
openrepairplatform-net:
12 changes: 7 additions & 5 deletions deployment/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
db:
image: postgres:11
image: postgis/postgis
container_name: postgres
env_file:
- ../openrepairplatform/.env
Expand All @@ -13,8 +13,8 @@ services:

django:
build:
context: .
dockerfile: django
context: ../
dockerfile: deployment/django/Dockerfile
image: openrepairplatform_python
container_name: openrepairplatform_python
env_file:
Expand All @@ -29,8 +29,8 @@ services:

nginx:
build:
context: .
dockerfile: nginx
context: ../
dockerfile: deployment/nginx/Dockerfile
image: openrepairplatform_nginx
container_name: openrepairplatform_nginx
ports:
Expand All @@ -44,6 +44,8 @@ services:
- ./openrepairplatform_data/openrepairplatform_letsencrypt:/etc/letsencrypt/:rw
networks:
- openrepairplatform-net
depends_on:
- django

networks:
openrepairplatform-net:
Expand Down
8 changes: 5 additions & 3 deletions deployment/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

FROM debian:buster

RUN apt update -y && apt upgrade -y
RUN apt install -y nginx certbot

CMD sed -i "s/{{DOMAINE_NAME}}/${DOMAINE_NAME}/" /deployment/nginx/nginx.conf
CMD sed -i "s/{{DOMAINE_NAME}}/${DOMAINE_NAME}/g" /deployment/nginx/nginx.conf
COPY deployment/nginx/nginx.conf /etc/nginx/sites-enabled/default
COPY deployment/nginx/nginx-snippet.conf /etc/nginx/snippets/ssl-params.conf

Expand All @@ -12,6 +13,7 @@ RUN mkdir /var/www/letsencrypt/.well-known
RUN mkdir /var/www/letsencrypt/.well-known/acme-challenge

#command to run on first exec to generate diffie helman cert use to secure tls handshake
#CMD openssl dhparam -out /etc/ssl/certsdhparam.pem 4096
CMD openssl dhparam -out /etc/ssl/certsdhparam.pem 4096

CMD while :; do sleep 12h & wait ${!}; certbot renew; nginx -s reload; done & nginx -g "daemon off;"

CMD while :; do sleep 12h & wait ${!}; certbot renew; nginx -s reload; done & nginx -g "daemon off;"
33 changes: 33 additions & 0 deletions deployment/nginx/nginx-no-certificat.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
upstream openrepairplatform_uwsgi {
server openrepairplatform_python:8000;
}

server {
listen 80;
server_name ${DOMAINE_NAME};
location ~ /\. { deny all; access_log off; log_not_found off; }

access_log /dev/stdout;
error_log /dev/stderr;

location /static/ {
alias /srv/static/;
expires 100d;
add_header Cache-Control public;
access_log off;
}

location /media/ {
alias /srv/media/;
expires 100d;
add_header Cache-Control public;
access_log off;
}

location / {
uwsgi_pass openrepairplatform_uwsgi;
include uwsgi_params;

client_max_body_size 20m;
}
}
12 changes: 5 additions & 7 deletions deployment/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ server {
listen 80;
listen [::]:80 default_server;
server_tokens off; #hide nginx version (security best practice)
server_name {{DOMAINE_NAME}};
server_name ${DOMAINE_NAME};
add_header Strict-Transport-Security "max-age=31536000";

access_log /dev/stdout;
error_log /dev/stderr;


location ~ /\.well-known/acme-challenge {
allow all;
root /var/www/letsencrypt;
Expand All @@ -38,8 +36,8 @@ server {
access_log /dev/stdout;
error_log /dev/stderr;

ssl_certificate /etc/letsencrypt/live/{{DOMAINE_NAME}}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{DOMAINE_NAME}}/privkey.pem;
ssl_certificate /etc/letsencrypt/live/reparons.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/reparons.org/privkey.pem;

location /static/ {
alias /srv/static/;
Expand All @@ -61,4 +59,4 @@ server {

client_max_body_size 20m;
}
}
}
36 changes: 0 additions & 36 deletions deployment/run.sh

This file was deleted.

72 changes: 0 additions & 72 deletions docker-compose.yml

This file was deleted.

5 changes: 2 additions & 3 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import sys

if __name__ == "__main__":
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE", "openrepairplatform.settings.dev"
)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "openrepairplatform.settings.dev")
from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
6 changes: 3 additions & 3 deletions openrepairplatform/.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
POSTGRES_USER=CHANGE_ME
POSTGRES_PASSWORD=CHANGE_ME
POSTGRES_DB_NAME=CHANGE_ME
POSTGRES_DBNAME=CHANGE_ME

DJANGO_SETTINGS_MODULE=openrepairplatform.settings.dev
DJANGO_SETTINGS_MODULE=openrepairplatform.settings.prod
SECRET_KEY=CHANGE_ME

EMAIL_PASSWORD=CHANGE_ME
EMAIL_HOST_USER=CHANGE_ME
EMAIL_HOST=CHANGE_ME

DOMAIN_NAME=CHANGE_ME
DOMAIN_NAME=localhost
Loading