mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
Rename local_settings.py symlink to prod_settings.py.
This commit is contained in:
@@ -58,9 +58,9 @@ In a production environment, we have:
|
|||||||
middleware, etc.), as well as default values for the settings the
|
middleware, etc.), as well as default values for the settings the
|
||||||
user would set in `/etc/zulip/settings.py` (you can look at the
|
user would set in `/etc/zulip/settings.py` (you can look at the
|
||||||
`DEFAULT_SETTINGS` dictionary to easily review the settings
|
`DEFAULT_SETTINGS` dictionary to easily review the settings
|
||||||
available). `zproject/settings.py` has a line `from local_settings
|
available). `zproject/settings.py` has a line `from prod_settings
|
||||||
import *`, which has the effect of importing
|
import *`, which has the effect of importing
|
||||||
`/etc/zulip/settings.py`.
|
`/etc/zulip/settings.py` in a prod environment (via a symlink).
|
||||||
|
|
||||||
In a development environment, we have `zproject/settings.py`, and
|
In a development environment, we have `zproject/settings.py`, and
|
||||||
additionally:
|
additionally:
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ fi
|
|||||||
if [ "$has_appserver" = 0 ]; then
|
if [ "$has_appserver" = 0 ]; then
|
||||||
/root/zulip/scripts/setup/generate_secrets.py
|
/root/zulip/scripts/setup/generate_secrets.py
|
||||||
cp -a /root/zulip/zproject/local_settings_template.py /etc/zulip/settings.py
|
cp -a /root/zulip/zproject/local_settings_template.py /etc/zulip/settings.py
|
||||||
ln -nsf /etc/zulip/settings.py /root/zulip/zproject/local_settings.py
|
ln -nsf /etc/zulip/settings.py /root/zulip/zproject/prod_settings.py
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restart camo since generate_secrets.py likely replaced its secret key
|
# Restart camo since generate_secrets.py likely replaced its secret key
|
||||||
@@ -104,7 +104,7 @@ if [ "$has_appserver" = 0 ]; then
|
|||||||
ln -nsf /home/zulip/deployments/next /root/zulip
|
ln -nsf /home/zulip/deployments/next /root/zulip
|
||||||
ln -nsf "$deploy_path" /home/zulip/deployments/next
|
ln -nsf "$deploy_path" /home/zulip/deployments/next
|
||||||
ln -nsf "$deploy_path" /home/zulip/deployments/current
|
ln -nsf "$deploy_path" /home/zulip/deployments/current
|
||||||
ln -nsf /etc/zulip/settings.py "$deploy_path"/zproject/local_settings.py
|
ln -nsf /etc/zulip/settings.py "$deploy_path"/zproject/prod_settings.py
|
||||||
mkdir -p "$deploy_path"/prod-static/serve
|
mkdir -p "$deploy_path"/prod-static/serve
|
||||||
cp -rT "$deploy_path"/prod-static/serve /home/zulip/prod-static
|
cp -rT "$deploy_path"/prod-static/serve /home/zulip/prod-static
|
||||||
chown -R zulip:zulip /home/zulip /var/log/zulip /etc/zulip/settings.py
|
chown -R zulip:zulip /home/zulip /var/log/zulip /etc/zulip/settings.py
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ subprocess.check_call(["tar", "-xf", tarball_path, "-C", extract_path])
|
|||||||
subprocess.check_call(["mv", glob.glob(os.path.join(extract_path, "zulip-server-*"))[0], deploy_path])
|
subprocess.check_call(["mv", glob.glob(os.path.join(extract_path, "zulip-server-*"))[0], deploy_path])
|
||||||
subprocess.check_call(["rmdir", extract_path])
|
subprocess.check_call(["rmdir", extract_path])
|
||||||
subprocess.check_call(["ln", "-nsf", "/etc/zulip/settings.py",
|
subprocess.check_call(["ln", "-nsf", "/etc/zulip/settings.py",
|
||||||
os.path.join(deploy_path, "zproject/local_settings.py")])
|
os.path.join(deploy_path, "zproject/prod_settings.py")])
|
||||||
subprocess.check_call(["ln", '-nsf', deploy_path, os.path.join(DEPLOYMENTS_DIR, "next")])
|
subprocess.check_call(["ln", '-nsf', deploy_path, os.path.join(DEPLOYMENTS_DIR, "next")])
|
||||||
|
|
||||||
print(deploy_path)
|
print(deploy_path)
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ try:
|
|||||||
|
|
||||||
os.chdir(deploy_path)
|
os.chdir(deploy_path)
|
||||||
|
|
||||||
|
if ZULIP_COM:
|
||||||
|
# Install the zulip.com settings (local_settings.py) as prod_settings.py
|
||||||
|
subprocess.check_call(["ln", "-nsf", os.path.join(deploy_path, "zproject/local_settings.py"),
|
||||||
|
os.path.join(deploy_path, "zproject/prod_settings.py")])
|
||||||
|
|
||||||
subprocess.check_call(["sudo", os.path.join(deploy_path, "scripts", "lib", "create-production-venv"),
|
subprocess.check_call(["sudo", os.path.join(deploy_path, "scripts", "lib", "create-production-venv"),
|
||||||
os.path.join(deploy_path, "zulip-venv")])
|
os.path.join(deploy_path, "zulip-venv")])
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ class Command(BaseCommand):
|
|||||||
if (not settings.EMAIL_GATEWAY_BOT or not settings.EMAIL_GATEWAY_LOGIN or
|
if (not settings.EMAIL_GATEWAY_BOT or not settings.EMAIL_GATEWAY_LOGIN or
|
||||||
not settings.EMAIL_GATEWAY_PASSWORD or not settings.EMAIL_GATEWAY_IMAP_SERVER or
|
not settings.EMAIL_GATEWAY_PASSWORD or not settings.EMAIL_GATEWAY_IMAP_SERVER or
|
||||||
not settings.EMAIL_GATEWAY_IMAP_PORT or not settings.EMAIL_GATEWAY_IMAP_FOLDER):
|
not settings.EMAIL_GATEWAY_IMAP_PORT or not settings.EMAIL_GATEWAY_IMAP_FOLDER):
|
||||||
print("Please configure the Email Mirror Gateway in your local_settings.py, "
|
print("Please configure the Email Mirror Gateway in /etc/zulip/, "
|
||||||
"or specify $ORIGINAL_RECIPIENT if piping a single mail.")
|
"or specify $ORIGINAL_RECIPIENT if piping a single mail.")
|
||||||
exit(1)
|
exit(1)
|
||||||
reactor.callLater(0, main)
|
reactor.callLater(0, main)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
# For the Dev VM environment, we use the same settings as the
|
# For the Dev VM environment, we use the same settings as the
|
||||||
# sample local_settings.py file, with a few exceptions.
|
# sample prod_settings.py file, with a few exceptions.
|
||||||
from .local_settings_template import *
|
from .local_settings_template import *
|
||||||
|
|
||||||
LOCAL_UPLOADS_DIR = 'var/uploads'
|
LOCAL_UPLOADS_DIR = 'var/uploads'
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ from __future__ import absolute_import
|
|||||||
#
|
#
|
||||||
# * settings.py contains non-site-specific and settings configuration
|
# * settings.py contains non-site-specific and settings configuration
|
||||||
# for the Zulip Django app.
|
# for the Zulip Django app.
|
||||||
# * settings.py imports local_settings.py, and any site-specific configuration
|
# * settings.py imports prod_settings.py, and any site-specific configuration
|
||||||
# belongs there. The template for local_settings.py is local_settings_template.py
|
# belongs there. The template for prod_settings.py is local_settings_template.py
|
||||||
#
|
#
|
||||||
# See http://zulip.readthedocs.io/en/latest/settings.html for more information
|
# See http://zulip.readthedocs.io/en/latest/settings.html for more information
|
||||||
#
|
#
|
||||||
@@ -79,10 +79,10 @@ TEST_SUITE = False
|
|||||||
# The new user tutorial is enabled by default, but disabled for client tests.
|
# The new user tutorial is enabled by default, but disabled for client tests.
|
||||||
TUTORIAL_ENABLED = True
|
TUTORIAL_ENABLED = True
|
||||||
|
|
||||||
# Import variables like secrets from the local_settings file
|
# Import variables like secrets from the prod_settings file
|
||||||
# Import local_settings after determining the deployment/machine type
|
# Import prod_settings after determining the deployment/machine type
|
||||||
if PRODUCTION:
|
if PRODUCTION:
|
||||||
from .local_settings import *
|
from .prod_settings import *
|
||||||
else:
|
else:
|
||||||
from .dev_settings import *
|
from .dev_settings import *
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ else:
|
|||||||
# DEFAULT VALUES FOR SETTINGS
|
# DEFAULT VALUES FOR SETTINGS
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
# For any settings that are not defined in local_settings.py,
|
# For any settings that are not defined in prod_settings.py,
|
||||||
# we want to initialize them to sane default
|
# we want to initialize them to sane default
|
||||||
DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
|
DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
|
||||||
'TWITTER_CONSUMER_SECRET': '',
|
'TWITTER_CONSUMER_SECRET': '',
|
||||||
|
|||||||
Reference in New Issue
Block a user