Browse Source

Merge branch 'master' into jhprod

master
Jarmil 2 years ago
parent
commit
94ac8ae873
  1. 17
      .gitlab-ci.yml
  2. 14
      Dockerfile
  3. 0
      deploy/nginx-sample/nalodeni.sample.conf
  4. 0
      deploy/nginx/.gitignore
  5. 0
      deploy/nginx/.keep
  6. 46
      docker-compose.sample.yml
  7. 4
      docker-entrypoint.sh
  8. 9
      install.sh
  9. 0
      keycloak_oidc/__init__.py
  10. 0
      keycloak_oidc/auth.py
  11. 0
      keycloak_oidc/exceptions.py
  12. 0
      keycloak_oidc/middleware.py
  13. 0
      keycloak_oidc/urls.py
  14. 0
      keycloak_oidc/views.py
  15. 0
      main/__init__.py
  16. 0
      main/settings.py
  17. 0
      main/settings_global.py
  18. 0
      main/settings_local.distrib.py
  19. 0
      main/templates/base.html
  20. 0
      main/urls.py
  21. 0
      main/wsgi.py
  22. 0
      manage.py
  23. 0
      nalodeni/__init__.py
  24. 0
      nalodeni/auth.py
  25. 0
      nalodeni/fixtures/nalodeni_counties.json
  26. 0
      nalodeni/fixtures/nalodeni_interestregion.json
  27. 0
      nalodeni/fixtures/nalodeni_interestregion.src.yaml
  28. 0
      nalodeni/fixtures/nalodeni_skills.json
  29. 0
      nalodeni/fixtures/nalodeni_skills.src.yaml
  30. 0
      nalodeni/fixtures/nalodeni_topics.json
  31. 0
      nalodeni/fixtures/nalodeni_topics.src.yaml
  32. 2
      nalodeni/forms.py
  33. 0
      nalodeni/migrations/0001_initial.py
  34. 0
      nalodeni/migrations/0002_remove_appuser_postcode.py
  35. 0
      nalodeni/migrations/0003_appuser_district.py
  36. 0
      nalodeni/migrations/0004_appuser_postcode.py
  37. 0
      nalodeni/migrations/0005_appuser_emailtoken.py
  38. 0
      nalodeni/migrations/0006_auto_20180312_0112.py
  39. 0
      nalodeni/migrations/0007_auto_20180312_0213.py
  40. 0
      nalodeni/migrations/0008_appuser_city.py
  41. 0
      nalodeni/migrations/0009_auto_20180323_1145.py
  42. 0
      nalodeni/migrations/0010_auto_20180323_1214.py
  43. 0
      nalodeni/migrations/0011_auto_20180323_1312.py
  44. 0
      nalodeni/migrations/0012_auto_20180325_1851.py
  45. 0
      nalodeni/migrations/0013_auto_20180325_2109.py
  46. 0
      nalodeni/migrations/0014_auto_20180325_2110.py
  47. 0
      nalodeni/migrations/0015_auto_20180325_2326.py
  48. 0
      nalodeni/migrations/0016_appuser_interestedin.py
  49. 0
      nalodeni/migrations/0017_auto_20180410_1144.py
  50. 0
      nalodeni/migrations/0018_auto_20180410_1547.py
  51. 0
      nalodeni/migrations/0019_auto_20180617_1104.py
  52. 0
      nalodeni/migrations/0020_auto_20180617_1146.py
  53. 0
      nalodeni/migrations/0021_auto_20180617_1310.py
  54. 0
      nalodeni/migrations/0022_appuser_email_contact_token.py
  55. 0
      nalodeni/migrations/0023_appuser_ts_for_ldap_sync.py
  56. 0
      nalodeni/migrations/0024_appregemail_data_consent.py
  57. 0
      nalodeni/migrations/0025_appregemail_dc_stamp.py
  58. 0
      nalodeni/migrations/0026_appuser_dc_stamp.py
  59. 0
      nalodeni/migrations/0027_auto_20180625_0314.py
  60. 0
      nalodeni/migrations/0028_auto_20180707_1508.py
  61. 0
      nalodeni/migrations/0029_appuser_createdstamp.py
  62. 0
      nalodeni/migrations/0030_appregemail_createdstamp.py
  63. 0
      nalodeni/migrations/0031_auto_20180815_0639.py
  64. 0
      nalodeni/migrations/0032_auto_20180818_1728.py
  65. 0
      nalodeni/migrations/0033_auto_20180818_1729.py
  66. 0
      nalodeni/migrations/0034_auto_20180818_1730.py
  67. 0
      nalodeni/migrations/0035_newsletter_is_del.py
  68. 0
      nalodeni/migrations/0036_newsletter_kind.py
  69. 0
      nalodeni/migrations/0037_auto_20180818_1934.py
  70. 0
      nalodeni/migrations/0038_newsmsg_is_del.py
  71. 0
      nalodeni/migrations/0039_auto_20180819_0221.py
  72. 0
      nalodeni/migrations/0040_auto_20180819_0222.py
  73. 0
      nalodeni/migrations/0041_auto_20180819_0254.py
  74. 0
      nalodeni/migrations/0042_auto_20180819_0255.py
  75. 0
      nalodeni/migrations/0043_auto_20180819_0257.py
  76. 0
      nalodeni/migrations/0044_auto_20180819_0847.py
  77. 0
      nalodeni/migrations/0045_auto_20180819_0848.py
  78. 0
      nalodeni/migrations/0046_auto_20180819_0900.py
  79. 0
      nalodeni/migrations/0047_newsletter_recipients.py
  80. 0
      nalodeni/migrations/0048_auto_20180819_1025.py
  81. 0
      nalodeni/migrations/0049_auto_20181123_1607.py
  82. 0
      nalodeni/migrations/0050_auto_20190220_2358.py
  83. 0
      nalodeni/migrations/0051_auto_20190221_0035.py
  84. 0
      nalodeni/migrations/0052_auto_20190303_1151.py
  85. 0
      nalodeni/migrations/0053_auto_20190303_1207.py
  86. 0
      nalodeni/migrations/0054_auto_20190412_1852.py
  87. 0
      nalodeni/migrations/0055_auto_20191113_0942.py
  88. 0
      nalodeni/migrations/0056_appuser_county.py
  89. 0
      nalodeni/migrations/0057_auto_20191113_1114.py
  90. 18
      nalodeni/migrations/0058_appuser_dc_undo_stamp.py
  91. 0
      nalodeni/migrations/__init__.py
  92. 0
      nalodeni/migrations/does-not-work/0002_auto_20180228_1631.py
  93. 0
      nalodeni/migrations/works/0002_remove_appuser_postcode.py
  94. 0
      nalodeni/migrations/works/0003_appuser_district.py
  95. 0
      nalodeni/migrations/works/0004_appuser_postcode.py
  96. 4
      nalodeni/models.py
  97. 0
      nalodeni/news.py
  98. 0
      nalodeni/people.py
  99. 0
      nalodeni/static/css/main.css
  100. 0
      nalodeni/static/css/main_local.css

17
.gitlab-ci.yml

@ -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

14
src/Dockerfile → Dockerfile

@ -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

0
src/deploy/nginx-sample/nalodeni.sample.conf → deploy/nginx-sample/nalodeni.sample.conf

0
src/deploy/nginx/.gitignore → deploy/nginx/.gitignore

0
src/deploy/nginx/.keep → deploy/nginx/.keep

46
docker-compose.sample.yml

@ -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:

4
src/docker-entrypoint.sh → docker-entrypoint.sh

@ -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

9
install.sh

@ -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

0
src/keycloak_oidc/__init__.py → keycloak_oidc/__init__.py

0
src/keycloak_oidc/auth.py → keycloak_oidc/auth.py

0
src/keycloak_oidc/exceptions.py → keycloak_oidc/exceptions.py

0
src/keycloak_oidc/middleware.py → keycloak_oidc/middleware.py

0
src/keycloak_oidc/urls.py → keycloak_oidc/urls.py

0
src/keycloak_oidc/views.py → keycloak_oidc/views.py

0
src/main/__init__.py → main/__init__.py

0
src/main/settings.py → main/settings.py

0
src/main/settings_global.py → main/settings_global.py

0
src/main/settings_local.distrib.py → main/settings_local.distrib.py

0
src/main/templates/base.html → main/templates/base.html

0
src/main/urls.py → main/urls.py

0
src/main/wsgi.py → main/wsgi.py

0
src/manage.py → manage.py

0
src/nalodeni/__init__.py → nalodeni/__init__.py

0
src/nalodeni/auth.py → nalodeni/auth.py

0
src/nalodeni/fixtures/nalodeni_counties.json → nalodeni/fixtures/nalodeni_counties.json

0
src/nalodeni/fixtures/nalodeni_interestregion.json → nalodeni/fixtures/nalodeni_interestregion.json

0
src/nalodeni/fixtures/nalodeni_interestregion.src.yaml → nalodeni/fixtures/nalodeni_interestregion.src.yaml

0
src/nalodeni/fixtures/nalodeni_skills.json → nalodeni/fixtures/nalodeni_skills.json

0
src/nalodeni/fixtures/nalodeni_skills.src.yaml → nalodeni/fixtures/nalodeni_skills.src.yaml

0
src/nalodeni/fixtures/nalodeni_topics.json → nalodeni/fixtures/nalodeni_topics.json

0
src/nalodeni/fixtures/nalodeni_topics.src.yaml → nalodeni/fixtures/nalodeni_topics.src.yaml

2
src/nalodeni/forms.py → nalodeni/forms.py

@ -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']

0
src/nalodeni/migrations/0001_initial.py → nalodeni/migrations/0001_initial.py

0
src/nalodeni/migrations/0002_remove_appuser_postcode.py → nalodeni/migrations/0002_remove_appuser_postcode.py

0
src/nalodeni/migrations/0003_appuser_district.py → nalodeni/migrations/0003_appuser_district.py

0
src/nalodeni/migrations/0004_appuser_postcode.py → nalodeni/migrations/0004_appuser_postcode.py

0
src/nalodeni/migrations/0005_appuser_emailtoken.py → nalodeni/migrations/0005_appuser_emailtoken.py

0
src/nalodeni/migrations/0006_auto_20180312_0112.py → nalodeni/migrations/0006_auto_20180312_0112.py

0
src/nalodeni/migrations/0007_auto_20180312_0213.py → nalodeni/migrations/0007_auto_20180312_0213.py

0
src/nalodeni/migrations/0008_appuser_city.py → nalodeni/migrations/0008_appuser_city.py

0
src/nalodeni/migrations/0009_auto_20180323_1145.py → nalodeni/migrations/0009_auto_20180323_1145.py

0
src/nalodeni/migrations/0010_auto_20180323_1214.py → nalodeni/migrations/0010_auto_20180323_1214.py

0
src/nalodeni/migrations/0011_auto_20180323_1312.py → nalodeni/migrations/0011_auto_20180323_1312.py

0
src/nalodeni/migrations/0012_auto_20180325_1851.py → nalodeni/migrations/0012_auto_20180325_1851.py

0
src/nalodeni/migrations/0013_auto_20180325_2109.py → nalodeni/migrations/0013_auto_20180325_2109.py

0
src/nalodeni/migrations/0014_auto_20180325_2110.py → nalodeni/migrations/0014_auto_20180325_2110.py

0
src/nalodeni/migrations/0015_auto_20180325_2326.py → nalodeni/migrations/0015_auto_20180325_2326.py

0
src/nalodeni/migrations/0016_appuser_interestedin.py → nalodeni/migrations/0016_appuser_interestedin.py

0
src/nalodeni/migrations/0017_auto_20180410_1144.py → nalodeni/migrations/0017_auto_20180410_1144.py

0
src/nalodeni/migrations/0018_auto_20180410_1547.py → nalodeni/migrations/0018_auto_20180410_1547.py

0
src/nalodeni/migrations/0019_auto_20180617_1104.py → nalodeni/migrations/0019_auto_20180617_1104.py

0
src/nalodeni/migrations/0020_auto_20180617_1146.py → nalodeni/migrations/0020_auto_20180617_1146.py

0
src/nalodeni/migrations/0021_auto_20180617_1310.py → nalodeni/migrations/0021_auto_20180617_1310.py

0
src/nalodeni/migrations/0022_appuser_email_contact_token.py → nalodeni/migrations/0022_appuser_email_contact_token.py

0
src/nalodeni/migrations/0023_appuser_ts_for_ldap_sync.py → nalodeni/migrations/0023_appuser_ts_for_ldap_sync.py

0
src/nalodeni/migrations/0024_appregemail_data_consent.py → nalodeni/migrations/0024_appregemail_data_consent.py

0
src/nalodeni/migrations/0025_appregemail_dc_stamp.py → nalodeni/migrations/0025_appregemail_dc_stamp.py

0
src/nalodeni/migrations/0026_appuser_dc_stamp.py → nalodeni/migrations/0026_appuser_dc_stamp.py

0
src/nalodeni/migrations/0027_auto_20180625_0314.py → nalodeni/migrations/0027_auto_20180625_0314.py

0
src/nalodeni/migrations/0028_auto_20180707_1508.py → nalodeni/migrations/0028_auto_20180707_1508.py

0
src/nalodeni/migrations/0029_appuser_createdstamp.py → nalodeni/migrations/0029_appuser_createdstamp.py

0
src/nalodeni/migrations/0030_appregemail_createdstamp.py → nalodeni/migrations/0030_appregemail_createdstamp.py

0
src/nalodeni/migrations/0031_auto_20180815_0639.py → nalodeni/migrations/0031_auto_20180815_0639.py

0
src/nalodeni/migrations/0032_auto_20180818_1728.py → nalodeni/migrations/0032_auto_20180818_1728.py

0
src/nalodeni/migrations/0033_auto_20180818_1729.py → nalodeni/migrations/0033_auto_20180818_1729.py

0
src/nalodeni/migrations/0034_auto_20180818_1730.py → nalodeni/migrations/0034_auto_20180818_1730.py

0
src/nalodeni/migrations/0035_newsletter_is_del.py → nalodeni/migrations/0035_newsletter_is_del.py

0
src/nalodeni/migrations/0036_newsletter_kind.py → nalodeni/migrations/0036_newsletter_kind.py

0
src/nalodeni/migrations/0037_auto_20180818_1934.py → nalodeni/migrations/0037_auto_20180818_1934.py

0
src/nalodeni/migrations/0038_newsmsg_is_del.py → nalodeni/migrations/0038_newsmsg_is_del.py

0
src/nalodeni/migrations/0039_auto_20180819_0221.py → nalodeni/migrations/0039_auto_20180819_0221.py

0
src/nalodeni/migrations/0040_auto_20180819_0222.py → nalodeni/migrations/0040_auto_20180819_0222.py

0
src/nalodeni/migrations/0041_auto_20180819_0254.py → nalodeni/migrations/0041_auto_20180819_0254.py

0
src/nalodeni/migrations/0042_auto_20180819_0255.py → nalodeni/migrations/0042_auto_20180819_0255.py

0
src/nalodeni/migrations/0043_auto_20180819_0257.py → nalodeni/migrations/0043_auto_20180819_0257.py

0
src/nalodeni/migrations/0044_auto_20180819_0847.py → nalodeni/migrations/0044_auto_20180819_0847.py

0
src/nalodeni/migrations/0045_auto_20180819_0848.py → nalodeni/migrations/0045_auto_20180819_0848.py

0
src/nalodeni/migrations/0046_auto_20180819_0900.py → nalodeni/migrations/0046_auto_20180819_0900.py

0
src/nalodeni/migrations/0047_newsletter_recipients.py → nalodeni/migrations/0047_newsletter_recipients.py

0
src/nalodeni/migrations/0048_auto_20180819_1025.py → nalodeni/migrations/0048_auto_20180819_1025.py

0
src/nalodeni/migrations/0049_auto_20181123_1607.py → nalodeni/migrations/0049_auto_20181123_1607.py

0
src/nalodeni/migrations/0050_auto_20190220_2358.py → nalodeni/migrations/0050_auto_20190220_2358.py

0
src/nalodeni/migrations/0051_auto_20190221_0035.py → nalodeni/migrations/0051_auto_20190221_0035.py

0
src/nalodeni/migrations/0052_auto_20190303_1151.py → nalodeni/migrations/0052_auto_20190303_1151.py

0
src/nalodeni/migrations/0053_auto_20190303_1207.py → nalodeni/migrations/0053_auto_20190303_1207.py

0
src/nalodeni/migrations/0054_auto_20190412_1852.py → nalodeni/migrations/0054_auto_20190412_1852.py

0
src/nalodeni/migrations/0055_auto_20191113_0942.py → nalodeni/migrations/0055_auto_20191113_0942.py

0
src/nalodeni/migrations/0056_appuser_county.py → nalodeni/migrations/0056_appuser_county.py

0
src/nalodeni/migrations/0057_auto_20191113_1114.py → nalodeni/migrations/0057_auto_20191113_1114.py

18
nalodeni/migrations/0058_appuser_dc_undo_stamp.py

@ -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ů'),
),
]

0
src/nalodeni/migrations/__init__.py → nalodeni/migrations/__init__.py

0
src/nalodeni/migrations/does-not-work/0002_auto_20180228_1631.py → nalodeni/migrations/does-not-work/0002_auto_20180228_1631.py

0
src/nalodeni/migrations/works/0002_remove_appuser_postcode.py → nalodeni/migrations/works/0002_remove_appuser_postcode.py

0
src/nalodeni/migrations/works/0003_appuser_district.py → nalodeni/migrations/works/0003_appuser_district.py

0
src/nalodeni/migrations/works/0004_appuser_postcode.py → nalodeni/migrations/works/0004_appuser_postcode.py

4
src/nalodeni/models.py → nalodeni/models.py

@ -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'),

0
src/nalodeni/news.py → nalodeni/news.py

0
src/nalodeni/people.py → nalodeni/people.py

0
src/nalodeni/static/css/main.css → nalodeni/static/css/main.css

0
src/nalodeni/static/css/main_local.css → nalodeni/static/css/main_local.css

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

Loading…
Cancel
Save