Compare commits

...

14 commits

Author SHA1 Message Date
Tomislav R
338ff38bbb Actual po 2022-05-16 11:37:30 +02:00
Tomislav R
66f3989c23 WIP removing ipv6onlyhosting.{net,ch} references 2022-05-16 11:08:14 +02:00
app@dynamicweb-production
a21b4d6e3f Change to dcl-orders for new vm 2022-03-23 10:46:12 +01:00
d739a4a50e Merge pull request 'Change admin email to dcl-orders for vm purchase' (#12) from change-email-address into master
Reviewed-on: ungleich-public/dynamicweb#12
2022-02-05 03:19:01 +00:00
PCoder
138fd519b7 Change admin email to dcl-orders for vm purchase 2022-02-05 08:30:58 +05:30
Nico Schottelius
8179ca4d22 Add support for docker build + docker release 2021-12-17 22:21:59 +01:00
Nico Schottelius
c0333212aa Begin updating for dockerisation 2021-12-17 22:02:20 +01:00
4861bee9d3 Merge branch 'master' into 'master'
Fix poland country code in eu_countries

See merge request ungleich-public/dynamicweb!749
2021-09-30 10:32:26 +02:00
5ce283318a Fix poland country code in eu_countries 2021-09-27 09:21:24 +02:00
79e96715b2 Merge branch 'issue/1/user-password-update' into 'master'
Issue/1/user password update

See merge request ungleich-public/dynamicweb!748
2021-08-30 15:20:27 +02:00
PCoder
47d5c63e3b Fix bad import 2021-08-30 18:38:58 +05:30
PCoder
d26f2b0f69 Normalize/convert ascii/ignore unicode characters for homeDirectory 2021-08-30 18:29:42 +05:30
7c2c3de1f6 Merge branch '9053/show-paid-invoices-only' into 'master'
Filter invoices by paid status

See merge request ungleich-public/dynamicweb!747
2021-03-29 03:59:48 +02:00
PCoder
1d48dfb93b Filter invoices by paid status 2021-03-29 07:23:58 +05:30
14 changed files with 61 additions and 20 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
.git

18
Dockerfile Normal file
View file

@ -0,0 +1,18 @@
FROM python:3.10.0-alpine3.15
WORKDIR /usr/src/app
RUN apk add --update --no-cache \
git \
build-base \
openldap-dev \
python3-dev \
libpq-dev \
&& rm -rf /var/cache/apk/*
# FIX https://github.com/python-ldap/python-ldap/issues/432
RUN echo 'INPUT ( libldap.so )' > /usr/lib/libldap_r.so
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY ./ .

View file

@ -14,6 +14,12 @@ help:
@echo ' make rsync_upload '
@echo ' make install_debian_packages '
buildimage:
docker build -t dynamicweb:$$(git describe) .
releaseimage: buildimage
./release.sh
collectstatic:
$(PY?) $(BASEDIR)/manage.py collectstatic

View file

@ -195,7 +195,7 @@ def handle_metadata_and_emails(order_id, vm_id, manager, user, specs,
email_data = {
'subject': settings.DCL_TEXT + " Order from %s" % context['email'],
'from_email': settings.DCL_SUPPORT_FROM_ADDRESS,
'to': ['info@ungleich.ch'],
'to': ['dcl-orders@ungleich.ch'],
'body': "\n".join(
["%s=%s" % (k, v) for (k, v) in context.items()]),
'reply_to': [context['email']],
@ -233,4 +233,4 @@ def handle_metadata_and_emails(order_id, vm_id, manager, user, specs,
logger.debug("New VM ID is {vm_id}".format(vm_id=vm_id))
if vm_id > 0:
get_or_create_vm_detail(custom_user, manager, vm_id)
get_or_create_vm_detail(custom_user, manager, vm_id)

View file

@ -20,7 +20,7 @@ logger = logging.getLogger(__name__)
eu_countries = ['at', 'be', 'bg', 'ch', 'cy', 'cz', 'hr', 'dk',
'ee', 'fi', 'fr', 'mc', 'de', 'gr', 'hu', 'ie', 'it',
'lv', 'lu', 'mt', 'nl', 'po', 'pt', 'ro','sk', 'si', 'es',
'lv', 'lu', 'mt', 'nl', 'pl', 'pt', 'ro','sk', 'si', 'es',
'se', 'gb']

View file

@ -1333,7 +1333,7 @@ def do_provisioning_generic(
'subject': (settings.DCL_TEXT +
" Payment received from %s" % context['email']),
'from_email': settings.DCL_SUPPORT_FROM_ADDRESS,
'to': ['info@ungleich.ch'],
'to': ['dcl-orders@ungleich.ch'],
'body': "\n".join(
["%s=%s" % (k, v) for (k, v) in context.items()]),
'reply_to': [context['email']],
@ -1507,7 +1507,7 @@ def do_provisioning(request, stripe_api_cus_id, card_details_response,
'subject': (settings.DCL_TEXT +
" Payment received from %s" % context['email']),
'from_email': settings.DCL_SUPPORT_FROM_ADDRESS,
'to': ['info@ungleich.ch'],
'to': ['dcl-orders@ungleich.ch'],
'body': "\n".join(
["%s=%s" % (k, v) for (k, v) in context.items()]),
'reply_to': [context['email']],

View file

@ -376,8 +376,6 @@ msgid ""
" digitalglarus.ch<br/>\n"
" hack4lgarus.ch<br/>\n"
" ipv6onlyhosting.com<br/>\n"
" ipv6onlyhosting.ch<br/>\n"
" ipv6onlyhosting.net<br/>\n"
" django-hosting.ch<br/>\n"
" rails-hosting.ch<br/>\n"
" node-hosting.ch<br/>\n"
@ -636,8 +634,8 @@ msgstr ""
"Internetangebot der ungleich glarus ag, welches unter den nachfolgenden "
"Domains erreichbar ist:<br/><br/>ungleich.ch<br/>datacenterlight.ch<br/"
">devuanhosting.com<br/>devuanhosting.ch<br/>digitalglarus.ch<br/>hack4lgarus."
"ch<br/>ipv6onlyhosting.com<br/>ipv6onlyhosting.ch<br/>ipv6onlyhosting.net<br/"
">django-hosting.ch<br/>rails-hosting.ch<br/>node-hosting.ch<br/>blog."
"ch<br/>ipv6onlyhosting.com<br/>django-hosting.ch<br/>rails-hosting.ch"
"<br/>node-hosting.ch<br/>blog."
"ungleich.ch<br/><br/>Der Datenschutzbeauftragte des Verantwortlichen ist:<br/"
"><br/>Sanghee Kim<br/>ungleich glarus ag<br/>Bahnhofstrasse 1<br/>8783 "
"Linthal (CH)<br/>E-Mail: <a href=\"mailto:sanghee.kim@ungleich.ch\">sanghee."
@ -838,3 +836,4 @@ msgstr ""
#~ msgid "index/?$"
#~ msgstr "index/?$"

View file

@ -631,8 +631,6 @@ GOOGLE_ANALYTICS_PROPERTY_IDS = {
'datacenterlight.ch': 'UA-62285904-8',
'devuanhosting.ch': 'UA-62285904-9',
'devuanhosting.com': 'UA-62285904-9',
'ipv6onlyhosting.ch': 'UA-62285904-10',
'ipv6onlyhosting.net': 'UA-62285904-10',
'ipv6onlyhosting.com': 'UA-62285904-10',
'comic.ungleich.ch': 'UA-62285904-13',
'127.0.0.1:8000': 'localhost',

View file

@ -28,9 +28,7 @@ ALLOWED_HOSTS = [
".devuanhosting.ch",
".devuanhosting.com",
".digitalezukunft.ch",
".ipv6onlyhosting.ch",
".ipv6onlyhosting.com",
".ipv6onlyhosting.net",
".digitalglarus.ch",
".hack4glarus.ch",
".xn--nglarus-n2a.ch"

View file

@ -1315,7 +1315,8 @@ class InvoiceListView(LoginRequiredMixin, TemplateView):
logger.debug("User does not exist")
cu = self.request.user
invs = stripe.Invoice.list(customer=cu.stripecustomer.stripe_id,
count=100)
count=100,
status='paid')
paginator = Paginator(invs.data, 10)
try:
invs_page = paginator.page(page)
@ -1910,7 +1911,7 @@ class VirtualMachineView(LoginRequiredMixin, View):
'subject': ("Deleted " if response['status']
else "ERROR deleting ") + admin_msg_sub,
'from_email': settings.DCL_SUPPORT_FROM_ADDRESS,
'to': ['info@ungleich.ch'],
'to': ['dcl-orders@ungleich.ch'],
'body': "\n".join(
["%s=%s" % (k, v) for (k, v) in admin_email_body.items()]),
}

21
release.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
# Nico Schottelius, 2021-12-17
current=$(git describe --dirty)
last_tag=$(git describe --tags --abbrev=0)
registry=harbor.ungleich.svc.p10.k8s.ooo/ungleich-public
image_url=$registry/dynamicweb:${current}
if echo $current | grep -q -e 'dirty$'; then
echo Refusing to release a dirty tree build
exit 1
fi
if [ "$current" != "$last_tag" ]; then
echo "Last tag ($last_tag) is not current version ($current)"
echo "Only release proper versions"
exit 1
fi
docker tag dynamicweb:${current} ${image_url}
docker push ${image_url}

View file

@ -25,7 +25,7 @@ django-compressor==2.0
django-debug-toolbar==1.4
python-dotenv==0.10.3
django-extensions==1.6.7
django-filer==1.2.0
django-filer==2.1.2
django-filter==0.13.0
django-formtools==1.0
django-guardian==1.4.4
@ -83,7 +83,7 @@ stripe==2.41.0
wheel==0.29.0
django-admin-honeypot==1.0.0
coverage==4.3.4
git+https://github.com/ungleich/python-oca.git#egg=python-oca
git+https://github.com/ungleich/python-oca.git#egg=oca
djangorestframework==3.6.3
flake8==3.3.0
python-memcached==1.58

View file

@ -134,8 +134,6 @@
digitalglarus.ch<br/>
hack4lgarus.ch<br/>
ipv6onlyhosting.com<br/>
ipv6onlyhosting.ch<br/>
ipv6onlyhosting.net<br/>
django-hosting.ch<br/>
rails-hosting.ch<br/>
node-hosting.ch<br/>

View file

@ -3,6 +3,7 @@ import hashlib
import random
import ldap3
import logging
import unicodedata
from django.conf import settings
@ -101,7 +102,7 @@ class LdapManager:
"uidNumber": [str(uidNumber)],
"gidNumber": [str(settings.LDAP_CUSTOMER_GROUP_ID)],
"loginShell": ["/bin/bash"],
"homeDirectory": ["/home/{}".format(user).encode("utf-8")],
"homeDirectory": ["/home/{}".format(unicodedata.normalize('NFKD', user).encode('ascii','ignore'))],
"mail": email.encode("utf-8"),
"userPassword": [self._ssha_password(
password.encode("utf-8")