Skip to content

Commit

Permalink
更换IP
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryJi529 committed Jun 4, 2023
1 parent 2296a71 commit 63f8379
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 37 deletions.
48 changes: 22 additions & 26 deletions Morningstar/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@

"""一系列安全措施"""
# NOTE: 检测方法: python3 manage.py check --settings=Morningstar.settings.production --deploy
X_FRAME_OPTIONS = 'SAMEORIGIN' # NOTE: 这是用来支持同源的iframe 一般用'DENY'
X_FRAME_OPTIONS = "SAMEORIGIN" # NOTE: 这是用来支持同源的iframe 一般用'DENY'
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True


SECRET_KEY = os.environ['DJANGO_SECRET_KEY']
MYSQL_ROOT_PASSWORD = os.environ['MYSQL_ROOT_PASSWORD']
REDIS_PASSWORD = os.environ['REDIS_PASSWORD']
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]
MYSQL_ROOT_PASSWORD = os.environ["MYSQL_ROOT_PASSWORD"]
REDIS_PASSWORD = os.environ["REDIS_PASSWORD"]
DEBUG = False
ALLOWED_HOSTS = ['morningstar369.com', '43.154.147.176']
CSRF_TRUSTED_ORIGINS = ['https://morningstar369.com']
ALLOWED_HOSTS = ["morningstar369.com", "43.154.26.218"]
CSRF_TRUSTED_ORIGINS = ["https://morningstar369.com"]


"""邮件"""
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"

# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'djangodb',
'USER': 'root',
'PASSWORD': MYSQL_ROOT_PASSWORD,
'HOST': 'db1',
'PORT': '3306',
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
'charset': 'utf8mb4',
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "djangodb",
"USER": "root",
"PASSWORD": MYSQL_ROOT_PASSWORD,
"HOST": "db1",
"PORT": "3306",
"OPTIONS": {
"init_command": "SET sql_mode='STRICT_TRANS_TABLES'",
"charset": "utf8mb4",
},
}
}
Expand All @@ -44,18 +44,15 @@
"LOCATION": "redis://redis:6379",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
"CONNECTION_POOL_KWARGS": {
"max_connections": 1000,
"encoding": 'utf-8'
},
"PASSWORD": REDIS_PASSWORD
}
"CONNECTION_POOL_KWARGS": {"max_connections": 1000, "encoding": "utf-8"},
"PASSWORD": REDIS_PASSWORD,
},
}
}

"""RECAPTCHA-V2"""
RECAPTCHA_PUBLIC_KEY = os.environ['RECAPTCHA_PUBLIC_KEY']
RECAPTCHA_PRIVATE_KEY = os.environ['RECAPTCHA_PRIVATE_KEY']
RECAPTCHA_PUBLIC_KEY = os.environ["RECAPTCHA_PUBLIC_KEY"]
RECAPTCHA_PRIVATE_KEY = os.environ["RECAPTCHA_PRIVATE_KEY"]

"""维护中站点列表"""
MAINTENANCE_URL_LIST = [
Expand All @@ -69,4 +66,3 @@
CORS_ALLOWED_ORIGINS = [
"https://morningstar369.com",
]

2 changes: 1 addition & 1 deletion scripts/deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ services:
FTP_PASS: 1234asdw
PASV_MIN_PORT: 21100
PASV_MAX_PORT: 21110
PASV_ADDRESS: 43.154.147.176
PASV_ADDRESS: 43.154.26.218
tty: true
restart: always
volumes:
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy/nginx/conf/main.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
upstream django {
server 43.154.147.176:6000;
server 43.154.26.218:6000;
}

server {
Expand Down
18 changes: 9 additions & 9 deletions scripts/deploy/nginx/conf/others.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ default upgrade;
}

upstream beancount {
server 43.154.147.176:6001;
server 43.154.26.218:6001;
}
upstream code {
server 43.154.147.176:5299;
server 43.154.26.218:5299;
}
upstream frps {
server 43.154.147.176:7500;
server 43.154.26.218:7500;
}
# upstream gitea {
# server 43.154.147.176:6004;
# server 43.154.26.218:6004;
# }
upstream matomo.morningstar369.com {
server 43.154.147.176:6003;
server 43.154.26.218:6003;
}
upstream portainer {
server 43.154.147.176:6007;
server 43.154.26.218:6007;
}
# upstream rsshub {
# server 43.154.147.176:6008;
# server 43.154.26.218:6008;
# }
# upstream send.morningstar369.com {
# server 43.154.147.176:6009;
# server 43.154.26.218:6009;
# }
upstream ssh {
server 43.154.147.176:6010;
server 43.154.26.218:6010;
}

server {
Expand Down

0 comments on commit 63f8379

Please sign in to comment.