""" Django settings for ccvpn project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os from django.core.validators import RegexValidator BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '@4+zlzju0(wymvatr%8uguuc-aeap8yaz$269ftloqhd&vm%c4' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'django_countries', 'django_lcore', 'django_celery_results', 'django_celery_beat', 'lambdainst', 'payments', 'tickets', 'downloads', 'kb', 'constance', 'constance.backends.database', 'tinymce', ) MIDDLEWARE = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.common.BrokenLinkEmailsMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.middleware.locale.LocaleMiddleware', 'lambdainst.middleware.ReferrerMiddleware', 'lambdainst.middleware.CampaignMiddleware', ) ROOT_URLCONF = 'ccvpn.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ os.path.join(BASE_DIR, 'templates/'), ], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.template.context_processors.i18n', 'django.template.context_processors.static', 'django.template.context_processors.csrf', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'ccvpn.context_processors.some_settings', 'constance.context_processors.config', ], }, }, ] WSGI_APPLICATION = 'ccvpn.wsgi.application' LOGIN_URL = 'account:login' LOGOUT_URL = 'account:logout' LOGIN_REDIRECT_URL = 'account:index' LOGOUT_REDIRECT_URL = '/' PASSWORD_HASHERS = [ 'django.contrib.auth.hashers.PBKDF2PasswordHasher', 'ccvpn.passwords.LegacyPasswordHasher', ] # Database # https://docs.djangoproject.com/en/1.8/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Internationalization # https://docs.djangoproject.com/en/1.8/topics/i18n/ LANGUAGE_CODE = 'en' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True LANGUAGES = ( ('fr', "French"), ('en', "English"), ) LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale/'), ) # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.8/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), ) # Security X_FRAME_OPTIONS = 'SAMEORIGIN' SESSION_COOKIE_SECURE = False CSRF_COOKIE_SECURE = False CSRF_COOKIE_HTTPONLY = True SECURE_CONTENT_TYPE_NOSNIFF = True SECURE_BROWSER_XSS_FILTER = True SECURE_SSL_REDIRECT = False SECURE_HSTS_SECONDS = 3600 SECURE_HSTS_INCLUDE_SUBDOMAINS = True # Enable Discourse SSO DISCOURSE_SSO = False DISCOURSE_SECRET = '...' DISCOURSE_URL = 'https://forum.ccrypto.org/' # OpenVPN CA Certificate with open(BASE_DIR + '/ccvpn/ca.crt') as ca_file: OPENVPN_CA = ca_file.read() # HTML added before ADDITIONAL_HEADER_HTML = '' # HTML added before ADDITIONAL_HTML = '' # Template to load for the live chat thing SUPPORT_TEMPLATE = 'livechat_default.html' # Custom per cluster message displayed config page # 'cluster_name': "No P2P" LAMBDAINST_CLUSTER_MESSAGES = {} # Name used in ticket emails TICKETS_SITE_NAME = 'CCrypto VPN Support' # Full URL to the site root ROOT_URL = '' # Forwarded for header name, if any (None will use remote_addr) REAL_IP_HEADER_NAME = None # Celery defaults #CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler' CELERY_RESULT_BACKEND = 'django-db' CELERY_CACHE_BACKEND = 'django-cache' CELERY_BROKER_URL = 'redis://localhost/1' CELERY_TIMEZONE = 'UTC' # reCAPTCHA API details. If empty, no captcha is displayed. RECAPTCHA_API = 'https://www.google.com/recaptcha/api/siteverify' RECAPTCHA_SITE_KEY = '' RECAPTCHA_SECRET_KEY = '' HCAPTCHA_API = 'https://hcaptcha.com/siteverify' HCAPTCHA_SITE_KEY = '' HCAPTCHA_SECRET_KEY = '' # lcore API settings LCORE = dict( BASE_URL='https://core.test.lambdavpn.net/v1/', API_KEY='', API_SECRET='', INST_SECRET='', CACHE_TTL=600, TIMEOUT=5, # SOURCE_ADDR='', ) # VPN auth credentials and expiration time storage # - if 'core', password and expiration_date will be replicated to core and # auth will be done from there. # - if 'inst', both will be kept here and core should call the API here to # authenticate users. # 'core' is faster and doesn't depend on the instance's stability, 'inst' # lets you generate client_config dynamically. # /!\ don't use 'core' with unit tests for now. VPN_AUTH_STORAGE = 'inst' # Payment & Trial # Payment backends. See payments/backends.py for more infos. PAYMENTS_BACKENDS = { 'bitcoin': { 'enabled': False, 'url': 'http://test:test@127.0.0.1:18332/', # 'chain': '', # mainnet, testnet, regnet }, 'paypal': { 'enabled': False, 'test': True, # Sandbox # 'api_base': '', 'address': '', # PayPal address to send to # 'receiver': '', # PayPal primary address if different # 'currency': 'EUR', # 'header_image': '', 'api_username': '', 'api_password': '', 'api_sig': '', }, 'stripe': { 'enabled': False, 'secret_key': '', 'public_key': '', 'currency': 'EUR', # 'title': '', # 'header_image': '', }, 'coingate': { 'enabled': False, # 'sandbox': True, # 'api_base': '', 'api_token': '', 'currency': 'EUR', # 'title': '', }, 'coinpayments': { 'enabled': False, 'merchant_id': '', 'secret': '', 'currency': 'EUR', # 'api_base': '', # 'title': '', }, } PAYMENTS_CURRENCY = ('eur', '€') CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend' CONSTANCE_CONFIG = { 'MOTD': ('', "Public site message, displayed on homepage"), 'MOTD_USER': ('', "Message for users, displayed on account home"), 'MONTHLY_PRICE_EUR': (300, "Base subscription price per month (x0.01€)"), 'BTC_EUR_VALUE': (300000, "Current value of a bitcoin (x0.01€/btc)"), 'TRIAL_PERIOD_HOURS': (2, "Hours given for each trial period"), 'TRIAL_PERIOD_MAX': (84, "Maximum number of trial periods to give (84*2h=1w)"), 'NOTIFY_DAYS_BEFORE': ("3, 1", "When to send account expiration notifications. In number of days before, separated y commas", 'integer_list'), 'KB_MAX_TOP_ENTRIES': (10, "Maximum number of categories to show in the short list"), 'WIREGUARD': (False, "Enable WireGuard support"), 'WIREGUARD_MAX_PEERS': (10, "Maximum number of WireGuard peers registered per user.", int), 'WIREGUARD_PUBKEY': ("", "WireGuard server public key"), 'WIREGUARD_PSK': ("", "WireGuard pre-shared key (optional)"), 'WIREGUARD_DNS': ("10.128.0.1", "WireGuard DNS server IP address"), 'TRIAL_ON_SIGNUP': (6, "Hours of trial to give on signup"), } CONSTANCE_ADDITIONAL_FIELDS = { 'integer_list': ['django.forms.fields.CharField', { 'validators': [RegexValidator(r'^([0-9]+[ ,]+)*([0-9]+)?$')], }], } TINYMCE_DEFAULT_CONFIG = { 'selector': 'textarea', 'theme': 'modern', 'plugins': 'link image preview codesample table code lists paste', 'toolbar1': 'bold italic underline | alignleft aligncenter alignright alignjustify ' '| bullist numlist | outdent indent | table | link image | codesample | preview code', 'contextmenu': 'formats | link image', 'menubar': False, 'inline': False, 'statusbar': True, 'height': 360, 'width': 'auto', 'paste_as_text': True, 'browser_spellcheck': True, } VPN_DOMAIN = "204vpn.net" VPN_FULL_NAME = "CCrypto VPN" VPN_SHORT_NAME = "ccvpn" OPENVPN_CONFIG_HEADER = """\ # +----------------------------+ # | Cognitive Cryptography VPN | # | https://vpn.ccrypto.org/ | # +----------------------------+ """ RUN_ONLINE_TESTS = False DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' # Local settings try: from .local_settings import * # noqa except ImportError: pass