-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1044 from Integreat/enhancement/production-setup
Improve production setup
- Loading branch information
Showing
94 changed files
with
1,316 additions
and
1,221 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Include all non-python files in the integreat_cms directory | ||
graft integreat_cms | ||
|
||
# Exclude the static source files since we only need the compiled files in integreat_cms/static/dist | ||
prune integreat_cms/static/src | ||
|
||
# Exclude development settings | ||
exclude integreat_cms/core/*_settings.py | ||
|
||
# Exclude test data | ||
exclude integreat_cms/cms/fixtures/test_*.json | ||
|
||
# Exclude byte code cache files | ||
global-exclude *.py[co] | ||
global-exclude __pycache__ | ||
|
||
# Exclude existing log file | ||
exclude integreat_cms/integreat-cms.log | ||
|
||
# Exclude pyproject.toml | ||
exclude pyproject.toml | ||
|
||
# Exclude source of translation file | ||
exclude integreat_cms/locale/de/LC_MESSAGES/django.po |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# This script fixes the dependencies in setup.cfg according to the Pipenv lock file. | ||
|
||
# Import utility functions | ||
# shellcheck source=./dev-tools/_functions.sh | ||
source "$(dirname "${BASH_SOURCE[0]}")/_functions.sh" | ||
|
||
echo "Extracting dependency versions..." | print_info | ||
# Use pipenv to extract the exact dependency versions from the Pipfile.lock and remove all lines with start with a space, # or - | ||
DEPENDENCY_VERSIONS=$(pipenv lock -r | sed "/^[#-]/d") | ||
echo "${DEPENDENCY_VERSIONS}" | ||
|
||
# Use python to write the dependencies into the setup.cfg config file | ||
python3 << EOF | ||
import configparser | ||
setup_cfg = configparser.ConfigParser() | ||
setup_cfg.read("${BASE_DIR}/setup.cfg") | ||
setup_cfg["options"]["install_requires"] = """${DEPENDENCY_VERSIONS}""" | ||
with open("${BASE_DIR}/setup.cfg", "w") as setup_cfg_file: | ||
setup_cfg.write(setup_cfg_file) | ||
EOF | ||
echo -e "✔ Fixed dependency versions in setup.cfg" | print_success |
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
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# This is the configuration file for integreat-cms. | ||
# It should be located at "/etc/integreat-cms.ini". | ||
# If you want to place the file at a different location, pass the | ||
# absolute path via the environment variable "INTEGREAT_CMS_CONFIG". | ||
# All these settings can also be configured via environment variables | ||
# with the prefix "INTEGREAT_CMS_", e.g. "INTEGREAT_CMS_SECRET_KEY". | ||
# The sections are just for better readability, they can be renamed | ||
# or rearranged as desired. | ||
|
||
[base] | ||
# Whether to debug mode is enabled [optional, defaults to False] | ||
DEBUG = False | ||
# The timezone of the server [optional, defaults to "Europe/Berlin"] | ||
CURRENT_TIME_ZONE = Europe/Berlin | ||
|
||
[secrets] | ||
# The secret key for this installation [required] | ||
SECRET_KEY = <your-secret-key> | ||
# If you want to send push notification to your app users, set your firebase key here [optional, defaults to None] | ||
FCM_KEY = <your-firebase-key> | ||
|
||
[logging] | ||
# The path to your log file [optional, defaults to "integreat-cms.log" in the application directory] | ||
LOGFILE = /var/integreat-cms.log | ||
# Logging level of integreat-cms [optional, defaults to "INFO"] | ||
LOG_LEVEL = INFO | ||
# Logging level of all dependencies [optional, defaults to "WARN"] | ||
DEPS_LOG_LEVEL = WARN | ||
|
||
[urls] | ||
# The url to your installation [optional, defaults to "http://localhost:8000"] | ||
BASE_URL = https://cms.integreat-app.de | ||
# The url to the web app [optional, defaults to "https://integreat.app"] | ||
WEBAPP_URL = https://integreat.app | ||
# The url to the statistics server [optional, defaults to "https://statistics.integreat-app.de"] | ||
MATOMO_URL = https://statistics.integreat-app.de | ||
# The url to the blog website [optional, defaults to "https://integreat-app.de"] | ||
WEBSITE_URL = https://integreat-app.de | ||
# The url to the wiki [optional, defaults to "https://wiki.integreat-app.de"] | ||
WIKI_URL = https://wiki.integreat-app.de | ||
|
||
[static-files] | ||
# The directory for static files [required] | ||
STATIC_ROOT = /var/www/integreat-cms/static | ||
# The directory for media files [optional, defaults to "media" in the application directory] | ||
MEDIA_ROOT = /var/www/integreat-cms/media | ||
# The directory for xliff files [optional, defaults to "xliff" in the application directory] | ||
XLIFF_ROOT = /var/www/integreat-cms/xliff | ||
# Enable the possibility to upload legacy file formats [optional, defaults to False] | ||
LEGACY_FILE_UPLOAD = False | ||
|
||
[database] | ||
# Database name [optional, defaults to "integreat"] | ||
DB_NAME = <your-database> | ||
# Database username [optional, defaults to "integreat"] | ||
DB_USER = <your-username> | ||
# Database password [required] | ||
DB_PASSWORD = <your-password> | ||
# Database host [optional, defaults to "localhost"] | ||
DB_HOST = <database-host> | ||
# Database port [optional, defaults to 5432] | ||
DB_PORT = <port> | ||
|
||
[cache] | ||
# Whether redis database should be used for caching [optional, defaults to False] | ||
REDIS_CACHE = True | ||
# Set this if you want to connect to redis via socket [optional, defaults to None] | ||
REDIS_UNIX_SOCKET = /var/run/redis/redis-server.sock | ||
|
||
[email] | ||
# Sender email [optional, defaults to "keineantwort@integreat-app.de"] | ||
SERVER_EMAIL = <your-email-address> | ||
# SMTP server [optional, defaults to localhost] | ||
EMAIL_HOST = <your-smtp-server> | ||
# SMTP username [required] | ||
EMAIL_HOST_USER = <your-username> | ||
# SMTP password [required] | ||
EMAIL_HOST_PASSWORD = <your-password> | ||
# SMTP port [optional, defaults to 25] | ||
EMAIL_PORT = <your-port> | ||
|
||
[linkcheck] | ||
# Whether link check should be disabled [optional, defaults to False] | ||
LINKCHECK_DISABLE_LISTENERS = False | ||
|
||
[xliff] | ||
# Which XLIFF version to use for export [optional, defaults to "xliff-1.2"] | ||
XLIFF_EXPORT_VERSION = xliff-1.2 |
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.