Merge branch 'master' into jhprod

This commit is contained in:
Jarmil 2019-11-15 14:17:40 +01:00
commit 94ac8ae873
217 changed files with 133 additions and 56 deletions

17
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,17 @@
image: docker:19.03.1
variables:
DOCKER_TLS_CERTDIR: "/certs"
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
services:
- docker:19.03.1-dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build:
stage: build
script:
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG

View File

@ -15,18 +15,18 @@ RUN virtualenv -p python3 venv
#RUN bash -c 'source /venv/bin/activate; pip install -r pip-requirements.txt'
RUN bash -c 'source /venv/bin/activate; pip install Django==2.0.3 psycopg2==2.7.4 django-statici18n==1.7.0 django-auth-oidc==0.4.5 pyjwkest==1.4.0 bleach==2.1.4 django-anymail==3.0 html2text==2018.1.9'
ADD . /nalodeni/src/
ADD . /nalodeni/
#RUN bash -c 'touch /nalodeni/src/main/settings_local.py' # this file needs to exist
#RUN bash -c 'touch /nalodeni/main/settings_local.py' # this file needs to exist
#RUN adduser --disabled-login --quiet --gecos nalodeni nalodeni
#RUN chown -R nalodeni:nalodeni /nalodeni/
#RUN chmod u+x /nalodeni/src/docker-entrypoint.sh
#RUN chmod u+x /nalodeni/docker-entrypoint.sh
RUN bash -c 'adduser --disabled-login --quiet --gecos nalodeni nalodeni && \
chmod -R o+r /nalodeni/ && \
chown -R nalodeni:nalodeni /nalodeni/src/static_files && \
chmod o+x /nalodeni/src/docker-entrypoint.sh && \
touch /nalodeni/src/main/settings_local.py '
chown -R nalodeni:nalodeni /nalodeni/static_files && \
chmod o+x /nalodeni/docker-entrypoint.sh && \
touch /nalodeni/main/settings_local.py '
USER nalodeni
ENTRYPOINT /nalodeni/src/docker-entrypoint.sh
ENTRYPOINT /nalodeni/docker-entrypoint.sh

46
docker-compose.sample.yml Normal file
View File

@ -0,0 +1,46 @@
version: '3.4'
services:
nginx:
image: nginx:latest
container_name: nalodeni-nginx
ports:
- "80:8001"
volumes:
- ./deploy/nginx:/etc/nginx/conf.d
- nalodeni_static:/static_nalodeni
depends_on:
- nalodeni
nalodeni:
image: docker-registry.pirati.cz/to/nalodeni.pirati.cz:master
container_name: nalodeni
volumes:
- nalodeni_static:/nalodeni/static_files
ports:
- "8000"
environment:
- NALODENI_DEBUG=b-off
- NALODENI_DEBUG_LOCAL=b-off
- NALODENI_BASE_SUBDOMAIN=s-nalodeni.
- NALODENI_BASE_DOMAIN=s-pirati.cz
- NALODENI_APP_REG_LIMIT_HARD=s-10000
- NALODENI_APP_REG_LIMIT_SOFT=s-50
- NALODENI_HTTP_PROTOCOL=s-https
- NALODENI_EMAIL_HOST=s-mailgate.pirati.cz
- NALODENI_EMAIL_HOST_USER=s-nalodeni@pirati.cz
- NALODENI_EMAIL_HOST_PASSWORD=s-XXXXXXXXXXXXXXXXX
- NALODENI_EMAIL_PORT=s-587
- NALODENI_EMAIL_USE_TLS=b-on
- NALODENI_TOKEN_VALID_SEC=s-604800
- NALODENI_PSQL_USER=s-nalodeni
- NALODENI_PSQL_HOST=s-10.42.0.11
- NALODENI_PSQL_DBNAME=s-nalodeni
- NALODENI_PSQL_PASSWORD=s-XXXXXXXXXXXXXXXXXXXXX
- NALODENI_AUTH_AVAIL_IDP=a-pirati,facebook,twitter,google
- NALODENI_AUTH_CLIENT_ID=s-pirati-nalodeni
- NALODENI_AUTH_SERVER=s-https://auth.pirati.cz/auth/realms/pirati/
- NALODENI_AUTH_CLIENT_SECRET=s-XXXXXXXXXXXXXXXXXXXX
volumes:
nalodeni_static:

View File

@ -4,13 +4,13 @@ trap "echo TRAPed signal" HUP INT QUIT KILL TERM
source /venv/bin/activate
cd /nalodeni/src
cd /nalodeni
python manage.py migrate
python manage.py collectstatic --noinput
python manage.py loaddata nalodeni_interestregion nalodeni_topics nalodeni_skills
python manage.py loaddata nalodeni_interestregion nalodeni_topics nalodeni_skills nalodeni_counties
PYTHONIOENCODING=utf-8 python manage.py runserver 0.0.0.0:8000

View File

@ -1,9 +1,9 @@
virtualenv -p python3.5 venv
source ./venv/bin/activate
source venv/bin/activate
pip install --upgrade pip
pip install -r src/pip-requirements.txt
pip install -r pip-requirements.txt
##
# Keycloak SSO
@ -29,8 +29,7 @@ SQL
##
# App Setup
##
./src/manage.py makemigrations nalodeni
./src/manage.py migrate
./manage.py makemigrations nalodeni
./manage.py migrate

View File

@ -61,7 +61,7 @@ class AppUserSsoForm(ModelForm):
class Meta:
model = models.AppUser
fields = ['city', 'postcode', 'district', 'kind',
'email', 'email_contact', 'email_contact_active', 'dc_stamp']
'email', 'email_contact', 'email_contact_active', 'dc_stamp' ]
def clean_postcode(self):
data = self.cleaned_data['postcode']

View File

@ -0,0 +1,18 @@
# Generated by Django 2.0.3 on 2019-11-13 16:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nalodeni', '0057_auto_20191113_1114'),
]
operations = [
migrations.AddField(
model_name='appuser',
name='dc_undo_stamp',
field=models.DateTimeField(blank=True, default=None, null=True, verbose_name='Datum odvolání souhlasu se zprac.os.údajů'),
),
]

View File

@ -185,7 +185,11 @@ class AppUser(AbstractUser, DataAudited):
ts_for_ldap_sync = DateTimeField(_('Timestamp pro LDAP synchronizaci'),
default=datetime.datetime.now, blank=True, null=True)
# datum udeleni a odvolani souhlasu se zpracovanim osobnich udaju
# logika: je-li dc_stamp=Null, souhlas neni udelen.
# pole dc_undo_stamp ma pouze informacni vyznam, kdy k odvolani souhlasu doslo
dc_stamp = DateTimeField(_('Data consent timestamp'), default=None, blank=True, null=True)
dc_undo_stamp = DateTimeField(_('Datum odvolání souhlasu se zprac.os.údajů'), default=None, blank=True, null=True)
# dotaznik pro uzivatele
userform = ForeignKey('UserForm', on_delete=CASCADE, verbose_name=_('dotazník'),

Some files were not shown because too many files have changed in this diff Show More