Compare commits
14 commits
8773/add-c
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
338ff38bbb | ||
|
66f3989c23 | ||
|
a21b4d6e3f | ||
d739a4a50e | |||
|
138fd519b7 | ||
|
8179ca4d22 | ||
|
c0333212aa | ||
4861bee9d3 | |||
5ce283318a | |||
79e96715b2 | |||
|
47d5c63e3b | ||
|
d26f2b0f69 | ||
7c2c3de1f6 | |||
|
1d48dfb93b |
14 changed files with 61 additions and 20 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
@ -0,0 +1 @@
|
|||
.git
|
18
Dockerfile
Normal file
18
Dockerfile
Normal 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 ./ .
|
6
Makefile
6
Makefile
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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']
|
||||
|
||||
|
||||
|
|
|
@ -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']],
|
||||
|
|
|
@ -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/?$"
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
21
release.sh
Executable 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}
|
|
@ -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
|
||||
|
|
|
@ -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/>
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue