-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/armada-ths/ais into ferra…
…n/f/redisign-register-armada-nu
- Loading branch information
Showing
10 changed files
with
193 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,15 +12,6 @@ jobs: | |
with: | ||
options: "--check" | ||
src: "." | ||
validate_title: | ||
name: Title should have valid prefix | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: Slashgear/[email protected] | ||
with: | ||
regexp: "^(feat|fix|chore|refactor|doc|pipeline): .*$" | ||
helpMessage: "Example: 'feat: example of title'" | ||
check_pull_requests: | ||
name: Require one linked issue | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,8 @@ | |
"journal", | ||
"markupfield", | ||
"testpage", | ||
"kth_login", | ||
"raven.contrib.django.raven_compat", | ||
) | ||
|
||
MIDDLEWARE = [ | ||
|
@@ -76,6 +78,17 @@ | |
|
||
AUTHENTICATION_BACKENDS = ("django.contrib.auth.backends.ModelBackend",) | ||
|
||
DATABASES = { | ||
"default": { | ||
"ENGINE": "django.contrib.gis.db.backends.postgis", | ||
"NAME": os.environ.get("DB_NAME", "ais_dev"), | ||
"USER": os.environ.get("DB_USER", "ais_dev"), | ||
"PASSWORD": os.environ.get("DB_PASSWORD", "ais_dev"), | ||
"HOST": os.environ.get("DB_HOST", "127.0.0.1"), | ||
"PORT": os.environ.get("DB_PORT", "5432"), | ||
} | ||
} | ||
|
||
TEMPLATES = [ | ||
{ | ||
"BACKEND": "django.template.backends.django.DjangoTemplates", | ||
|
@@ -119,3 +132,38 @@ | |
USE_L10N = False | ||
DATE_FORMAT = "M j, Y" | ||
DATETIME_FORMAT = "M j, Y, H:i" | ||
|
||
# Email settings | ||
EMAIL_USE_TLS = True | ||
EMAIL_HOST = "smtp.gmail.com" | ||
EMAIL_PORT = 587 | ||
DEFAULT_FROM_EMAIL = "[email protected]" | ||
DEFAULT_TO_EMAIL = "[email protected]" | ||
EMAIL_HOST_USER = "[email protected]" | ||
EMAIL_HOST_PASSWORD = os.environ.get("DUMMY", "dummy") | ||
# EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | ||
|
||
SALES_HOOK_URL = ( | ||
"https://hooks.slack.com/services/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" | ||
) | ||
RECRUITMENT_HOOK_URL = ( | ||
"https://hooks.slack.com/services/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" | ||
) | ||
|
||
# This is for AUTHLIB package for interacting with KTH OpenID Connect | ||
# APPLICATION_ID is given from the 'secrets.py' file. | ||
# CLIENT_SECRET is given from the 'secrets.py' file. | ||
AUTHLIB_OAUTH_CLIENTS = { | ||
"kth": { | ||
"client_id": os.environ.get("APPLICATION_ID"), | ||
"client_secret": os.environ.get("CLIENT_SECRET"), | ||
"api_base_url": "https://login.ug.kth.se/adfs/oauth2/", | ||
} | ||
} | ||
LOGOUT_REDIRECT_URL = "/" | ||
|
||
USE_X_FORWARDED_HOST = True | ||
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") | ||
|
||
# STATICFILES_STORAGE = 'storages.backends.s3boto3.S3StaticStorage' | ||
AWS_STORAGE_BUCKET_NAME = "armada-ais-files" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
and is generally easier to work with. | ||
""" | ||
|
||
import os | ||
from ais.common.settings import * | ||
|
||
# Debug mode gives us helpful error messages when a server error | ||
|
@@ -17,69 +16,16 @@ | |
ALLOWED_HOSTS = ["*"] | ||
CORS_ORIGIN_ALLOW_ALL = True | ||
|
||
# Email settings | ||
EMAIL_USE_TLS = True | ||
EMAIL_HOST = "smtp.gmail.com" | ||
EMAIL_PORT = 587 | ||
DEFAULT_FROM_EMAIL = "[email protected]" | ||
DEFAULT_TO_EMAIL = "[email protected]" | ||
EMAIL_HOST_USER = "[email protected]" | ||
EMAIL_HOST_PASSWORD = os.environ.get("DUMMY", "dummy") | ||
# EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | ||
|
||
ROOT_URLCONF = "ais.local.urls" | ||
|
||
# Use KTH OpenID Connect for authentication | ||
INSTALLED_APPS += ( | ||
"kth_login", | ||
"raven.contrib.django.raven_compat", | ||
) | ||
|
||
# Stripe test keys | ||
STRIPE_SECRET = "sk_test_l4sPsGIoc2f8sD5N4D2fZkBY" | ||
STRIPE_PUBLISHABLE = "pk_test_IzgUj9oJhednbt4EIf78esBE" | ||
|
||
# We don't need performance here so use SQLite for ease of setup. | ||
DATABASES = { | ||
"default": { | ||
"ENGINE": "django.contrib.gis.db.backends.postgis", | ||
"NAME": os.environ.get("DB_NAME", "ais_dev"), | ||
"USER": os.environ.get("DB_USER", "ais_dev"), | ||
"PASSWORD": os.environ.get("DB_PASSWORD", "ais_dev"), | ||
"HOST": os.environ.get("DB_HOST", "127.0.0.1"), | ||
"PORT": os.environ.get("DB_PORT", "5432"), | ||
} | ||
} | ||
|
||
SALES_HOOK_URL = ( | ||
"https://hooks.slack.com/services/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" | ||
) | ||
RECRUITMENT_HOOK_URL = ( | ||
"https://hooks.slack.com/services/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" | ||
) | ||
|
||
# Always use the same secret key so we can resume sessions after | ||
# restarting the server. Again, this is a serious security flaw | ||
# if used in production! | ||
SECRET_KEY = "..............¯\_(ツ)_/¯..............." | ||
|
||
|
||
# This is for AUTHLIB package for interacting with KTH OpenID Connect | ||
# APPLICATION_ID is given from the 'secrets.py' file. | ||
# CLIENT_SECRET is given from the 'secrets.py' file. | ||
AUTHLIB_OAUTH_CLIENTS = { | ||
"kth": { | ||
"client_id": os.environ.get("APPLICATION_ID"), | ||
"client_secret": os.environ.get("CLIENT_SECRET"), | ||
"api_base_url": "https://login.ug.kth.se/adfs/oauth2/", | ||
} | ||
} | ||
LOGOUT_REDIRECT_URL = "/" | ||
|
||
USE_X_FORWARDED_HOST = True | ||
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") | ||
|
||
# DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" | ||
|
||
# STATICFILES_STORAGE = 'storages.backends.s3boto3.S3StaticStorage' | ||
AWS_STORAGE_BUCKET_NAME = "armada-ais-files" | ||
# todo: Remove after setting production environment in production (2023) | ||
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,102 +8,25 @@ | |
from ais.common.settings import * | ||
|
||
SECRET_KEY = os.environ.get("SECRET_KEY") | ||
# This is important so other people can't set their own domains | ||
# to point to AIS (which would be a security concern). | ||
ALLOWED_HOSTS = [".armada.nu", "localhost", "armada.nu"] | ||
|
||
ALLOWED_HOSTS = ["*"] | ||
CORS_ALLOWED_ORIGINS = [ | ||
"https://armada.nu", | ||
"https://www.armada.nu", | ||
"http://armada.nu", | ||
"http://www.armada.nu", | ||
"http://localhost:8000", | ||
] | ||
|
||
DEBUG = False | ||
|
||
# The URL scheme is slightly different in a production environment | ||
# since we need to accomodate the KTH OpenID Connect integration. | ||
ROOT_URLCONF = "ais.production.urls" | ||
|
||
# Use KTH OpenID Connect for authentication | ||
INSTALLED_APPS += ( | ||
"kth_login", | ||
"raven.contrib.django.raven_compat", | ||
) | ||
|
||
# Use a full-fledged database instead of SQLite. | ||
DATABASES = { | ||
"default": { | ||
"ENGINE": "django.contrib.gis.db.backends.postgis", | ||
"NAME": os.environ.get("DB_NAME", "ais_dev"), | ||
"USER": os.environ.get("DB_USERNAME", "ais_dev"), | ||
"PASSWORD": os.environ.get("DB_PASSWORD", "ais_dev"), | ||
"HOST": os.environ.get("DB_HOST", "127.0.0.1"), | ||
"PORT": os.environ.get("DB_PORT", "5432"), | ||
} | ||
} | ||
|
||
# SENTRY | ||
RAVEN_CONFIG = { | ||
"dsn": "https://%s:%[email protected]/%s" | ||
% ( | ||
os.environ.get("SENTRY_USERNAME"), | ||
os.environ.get("SENTRY_PASSWORD"), | ||
os.environ.get("SENTRY_APPID"), | ||
), | ||
"processors": ("raven.processors.Processor",), | ||
} | ||
|
||
CACHES = {"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}} | ||
|
||
LOGGING = { | ||
"version": 1, | ||
"disable_existing_loggers": True, | ||
"formatters": { | ||
"verbose": { | ||
"format": "%(levelname)s %(asctime)s %(module)s " | ||
"%(process)d %(thread)d %(message)s" | ||
}, | ||
}, | ||
"handlers": { | ||
"sentry": { | ||
"level": "ERROR", # To capture more than ERROR, change to WARNING, INFO, etc. | ||
"class": "raven.contrib.django.raven_compat.handlers.SentryHandler", | ||
"tags": {"custom-tag": "x"}, | ||
}, | ||
"console": { | ||
"level": "DEBUG", | ||
"class": "logging.StreamHandler", | ||
"formatter": "verbose", | ||
}, | ||
}, | ||
"loggers": { | ||
"root": { | ||
"level": "WARNING", | ||
"handlers": ["sentry"], | ||
}, | ||
"django.db.backends": { | ||
"level": "ERROR", | ||
"handlers": ["console"], | ||
"propagate": False, | ||
}, | ||
"raven": { | ||
"level": "DEBUG", | ||
"handlers": ["console"], | ||
"propagate": False, | ||
}, | ||
"sentry.errors": { | ||
"level": "DEBUG", | ||
"handlers": ["console"], | ||
"propagate": False, | ||
}, | ||
}, | ||
} | ||
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" | ||
|
||
# The system sends out system-related emails to these addresses. | ||
ADMINS = MANAGERS = (("System", "[email protected]"),) | ||
|
||
# This is for AUTHLIB package for interacting with KTH OpenID Connect | ||
# APPLICATION_ID is given from the 'secrets.py' file. | ||
# CLIENT_SECRET is given from the 'secrets.py' file. | ||
AUTHLIB_OAUTH_CLIENTS = { | ||
"kth": { | ||
"client_id": os.environ.get("APPLICATION_ID"), | ||
"client_secret": os.environ.get("CLIENT_SECRET"), | ||
"api_base_url": "https://login.ug.kth.se/adfs/oauth2/", | ||
} | ||
} | ||
LOGOUT_REDIRECT_URL = "/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.