34 Commits

Author SHA1 Message Date
Scott Idem
3a14925540 General updates. Enabled CHOW. 2024-02-13 16:32:38 -05:00
Scott Idem
3c7fb0afdb Adding in ImageMagick and ffmpeg related tools 2023-11-10 17:29:03 -05:00
Scott Idem
c897f4b439 Getting rid of possible host names in Nginx conf 2023-10-20 14:05:03 -04:00
Scott Idem
040fdfe2ae General config clean up. 2023-10-19 19:15:14 -04:00
Scott Idem
a4f578b400 General config clean up. 2023-10-19 19:04:16 -04:00
Scott Idem
b17420e584 General config clean up. 2023-10-19 18:58:11 -04:00
Scott Idem
14e046b77c Work to get Flask updated. General config clean up. 2023-10-19 12:05:21 -04:00
Scott Idem
92baaccb48 Clean up and upgrades related to Python requirements, Flask, and FastAPI. 2023-09-12 15:41:09 -04:00
Scott Idem
42b6e8ed08 Updating Python requirements file 2023-09-08 17:08:45 -04:00
Scott Idem
8bf5b49552 Now with more .env vars! 2023-09-08 15:24:48 -04:00
Scott Idem
e8e7fc2383 More work on configs and env 2023-09-08 14:45:02 -04:00
Scott Idem
9262e9987e More work on configs and env 2023-09-08 14:23:08 -04:00
Scott Idem
be1bb21b7e Better configs with environment vars 2023-09-08 14:01:00 -04:00
Scott Idem
cccf9fd24f Updates to make Docker Compose better 2023-09-08 13:13:01 -04:00
Scott Idem
7679a62cf1 General improvements. 2023-07-12 15:39:45 -04:00
Scott Idem
630bd1a61e Now with variable key and max body size 2023-06-13 17:50:31 -04:00
Scott Idem
3a5024a2d0 Now with variable names for containers 2023-06-13 17:26:00 -04:00
Scott Idem
37c346efd7 Less configs to worry about 2023-06-13 17:11:35 -04:00
Scott Idem
37af3019c6 One less file to change hopefully 2023-06-13 16:25:08 -04:00
Scott Idem
5b65bd5a1f More clean up of Docker config related files 2023-06-13 16:09:42 -04:00
Scott Idem
8969dfb33a Clean up to go live 2023-06-13 15:20:01 -04:00
Scott Idem
2d545a2a66 Work towards new API version 5 2023-06-07 19:29:54 -04:00
cc54f95cd8 Minor update to documentation 2023-05-17 18:35:43 -04:00
34f1ab89c2 Updates from Asus and BGH event. 2023-04-28 15:50:14 -04:00
3e6c8db324 General clean up 2023-04-16 22:54:27 -04:00
Scott Idem
7bdfe41aa1 Unknown 2023-04-16 19:45:11 -04:00
Scott Idem
70db400290 General updates and clean up. 2023-04-04 20:12:06 -04:00
Scott Idem
26c8b5121b The Docker Compose seems to be working correctly now... 2023-02-24 19:04:43 -05:00
Scott Idem
6cc7f33f6f Still working on Docker Compose 2023-02-24 18:09:00 -05:00
Scott Idem
f85a97001c Still working on Docker Compose 2023-02-24 17:02:44 -05:00
Scott Idem
733db642eb Still working on Docker Compose 2023-02-24 16:51:05 -05:00
Scott Idem
e7a2f2313c Still working on Docker Compose 2023-02-24 16:47:04 -05:00
Scott Idem
f6a00b0145 Still working on Docker Compose 2023-02-24 16:46:58 -05:00
Scott Idem
56fb54a38e Work on nginx and server names 2023-02-24 14:21:54 -05:00
30 changed files with 1364 additions and 474 deletions

View File

@@ -1,23 +1,54 @@
# One Sky IT's Aether Framework and System # One Sky IT's Aether Framework and System
CONTAINER_WEB=ae_web_default
CONTAINER_AE_API=ae_api_default
CONTAINER_AE_APP=ae_app_default
CONTAINER_PHP7=ae_php7_default
CONTAINER_REDIS=ae_redis_default
OSIT_ENV=development OSIT_ENV=development
# OSIT_ENV=production # OSIT_ENV=production
# OSIT_ENV=testing # OSIT_ENV=testing
AE_LOG_LVL=warning # Python loglevel: warning, info, debug, etc
OSIT_WEB_HTTP_PORT=8080 OSIT_WEB_HTTP_PORT=8080
OSIT_WEB_HTTPS_PORT=4443 OSIT_WEB_HTTPS_PORT=4443
# Max body size is for nginx gunicorn apps (AE app and AE API)
OSIT_WEB_MAX_BODY_SIZE=5120M
# For now this extra host variable is important for the AE Flask app to connect to the AE FastAPI API. # For now this extra host variable is important for the AE Flask app to connect to the AE FastAPI API.
DOCKER_AE_APP_EXTRA_HOST=dev-api.oneskyit.com:192.168.32.20 DOCKER_AE_SERVER_EXTRA_HOST=example.oneskyit.com:192.168.32.20
DOCKER_AE_APP_SERVER_EXTRA_HOST=example-app.oneskyit.com:192.168.32.20
DOCKER_AE_API_SERVER_EXTRA_HOST=example-api.oneskyit.com:192.168.32.20
DOCKER_AE_API_V5_SERVER_EXTRA_HOST=example-api-v5.oneskyit.com:192.168.32.20
DOCKER_AE_APP_EXTRA_HOST=example-api.oneskyit.com:192.168.32.20 # This should be a static(ish) IP. It may need to be externally routable? prod-api.oneskyit.com:104.237.143.4
DOCKER_AE_APP_EXTRA_HOST_V5=example-api-v5.oneskyit.com:192.168.32.20
# This is the server name for nginx for each of these sites.
# Only one server name per server_name in nginx with envsubst!!! A bug???
DOCKER_AE_API_SERVER_NAME=example-api.oneskyit.com
DOCKER_AE_API_V5_SERVER_NAME=example-api-v5.oneskyit.com
DOCKER_AE_APP_SERVER_NAME=example-app.oneskyit.com
DOCKER_PHPMYADMIN_SERVER_NAME=example-phpmyadmin.oneskyit.com
DOCKER_OSIT_SERVER_NAME=example.oneskyit.com
# This needs to be updated for each client's subdomain.
# This is *not* currently working with the nginx Docker Compose. It uses envsubst with a template conf file.
OSIT_NGINX_SERVER_NAMES=flask_gunicorn.localhost,demo.localhost,example.localhost,example.oneskyit.com,example-app.oneskyit.com,example-connect.oneskyit.com,*.example-connect.oneskyit.com,example-demo.oneskyit.com,*.example-demo.oneskyit.com
# Aether general shared config options # Aether general shared config options
# For general shared config options like API access and use, database access and use, Redis, and SMTP # For general shared config options like API access and use, database access and use, Redis, and SMTP
# home development, live testing, live production, onsite development, onsite testing, onsite production??? # home development, live testing, live production, onsite development, onsite testing, onsite production???
AE_CFG_ID=0 AE_CFG_ID=0
AE_SERVER=example.oneskyit.com
## Aether API access and use ## Aether API access and use
AE_API_PROTOCOL=https AE_API_PROTOCOL=https
AE_API_SERVER=dev-api.oneskyit.com AE_API_SERVER=example-api.oneskyit.com
AE_API_SERVER_INTERNAL=example-api.oneskyit.com
AE_API_PORT=443 AE_API_PORT=443
AE_API_PATH= AE_API_PATH=
AE_API_SECRET_KEY=the-secret-api-key AE_API_SECRET_KEY=the-secret-api-key
@@ -26,9 +57,22 @@ AE_API_SECRET_KEY=the-secret-api-key
AE_DB_SERVER=linode.oneskyit.com AE_DB_SERVER=linode.oneskyit.com
AE_DB_PORT=3306 AE_DB_PORT=3306
AE_DB_NAME=aether_dev AE_DB_NAME=aether_dev
# AE_DB_USERNAME=osit_aether AE_DB_USERNAME=osit_aether
AE_DB_PASSWORD="the password with $$ escape" AE_DB_PASSWORD="the password with $$ escape"
# wait_timeout (MariaDB) is how long to keep an idle DB connection
AE_DB_WAIT_TIMEOUT=1800 # Not yet used!
# connection_timeout (MariaDB) is how long to try and create a new DB connection; bad handshake
AE_DB_CONNECTION_TIMEOUT=15
# pool_recycle (SQLAlchemy) is how long to keep using a particular connection that has passed a certain age
AE_DB_POOL_RECYCLE=1800
AE_DB_V5_SERVER=linode.oneskyit.com
AE_DB_V5_PORT=3306
AE_DB_V5_NAME=aether_v5_dev
AE_DB_V5_USERNAME=ae_v5
AE_DB_V5_PASSWORD=""
## Aether Redis access and use ## Aether Redis access and use
AE_REDIS_SERVER=redis AE_REDIS_SERVER=redis
AE_REDIS_PORT=6379 AE_REDIS_PORT=6379
@@ -40,15 +84,24 @@ AE_SMTP_USERNAME=send_mail
# AE_SMTP_PASSWORD="not currently used" # AE_SMTP_PASSWORD="not currently used"
# Gunicorn workers and threads:
# https://docs.gunicorn.org/en/stable/design.html#how-many-workers
# Aether API specific config options (FastAPI) # Aether API specific config options (FastAPI)
# AE_API_CFG_ID=0 # NOT CURRENTLY NEED OR USED # AE_API_CFG_ID=0 # NOT CURRENTLY NEED OR USED
AE_API_ENV=development AE_API_ENV=development
AE_API_DIR=/srv/aether_api AE_API_DIR=/srv/aether_api
AE_API_LOG_PATH="/logs/aether_api.log" AE_API_LOG_PATH="/logs/aether_api.log"
AE_API_WORKERS=1 AE_API_V5_LOG_PATH="/logs/aether_api_v5.log"
AE_API_THREADS=1 AE_API_GUNICORN_PORT=5065
AE_API_GUNICORN_TIMEOUT=2100 # (default=30; should be much higher)
AE_API_GUNICORN_GRACEFUL_TIMEOUT=30 # (default=30)
AE_API_GUNICORN_KEEPALIVE=30 # (default=2)
AE_API_GUNICORN_WORKERS=2 # (default=2)
AE_API_GUNICORN_THREADS=2 # (default=2)
AE_API_RELOAD=False AE_API_RELOAD=False
AE_API_JWT_KEY="ABC123 22 CHARS" # 22 characters; super secret Aether JWT signing key
AE_API_ORIGINS_REGEX="(https://.*\.oneskyit\.com)|(https://.*\.oneskyit\.com:4443)|(https://.*\.oneskyit\.com:8443)" # default allows for some sane domains related to https://.*\.oneskyit\.com with some common extra ports
# Aether app specific config (Flask with Svelte) # Aether app specific config (Flask with Svelte)
AE_APP_CFG_ID=0 AE_APP_CFG_ID=0
@@ -58,6 +111,14 @@ AE_APP_UX_MODE=default
# AE_APP_UX_MODE=native # AE_APP_UX_MODE=native
AE_APP_DIR=/srv/aether_app AE_APP_DIR=/srv/aether_app
AE_APP_LOG_PATH="/logs/aether_app.log" AE_APP_LOG_PATH="/logs/aether_app.log"
AE_APP_WORKERS=1 AE_APP_GUNICORN_PORT=5055
AE_APP_THREADS=1 AE_APP_GUNICORN_TIMEOUT=1200 # (default=30; should be higher)
AE_APP_GUNICORN_GRACEFUL_TIMEOUT=20 # (default=30)
AE_APP_GUNICORN_KEEPALIVE=30 # (default=2)
AE_APP_GUNICORN_WORKERS=2 # (default=2)
AE_APP_GUNICORN_THREADS=1 # (default=1)
AE_APP_RELOAD=True AE_APP_RELOAD=True
# Generate a new key with: # python -c 'import os; print(os.urandom(16))'
AE_APP_CACHE_SECRET_KEY="$\x93\x12\xb4R\x80R\xb5\xe50\xa0k\xc8#RN"
AE_APP_SESSION_LIFETIME=86400 # How long the browser cookies last in seconds (default=86400)
AE_APP_CACHE_TIMEOUT=5 # How long the Flask app caching last in seconds (default=5)

View File

@@ -25,25 +25,41 @@ sudo chown -R scott:scott /srv/env/test_aether/srv/mariadb/
cp /srv/env/test_aether/.env /srv/env/test_aether/.env.bak cp /srv/env/test_aether/.env /srv/env/test_aether/.env.bak
cp /srv/env/test_aether/.env.default /srv/env/test_aether/.env cp /srv/env/test_aether/.env.default /srv/env/test_aether/.env
``` ```
**/.env** **/.env [very basic example]**
```sh The AE_CFG_ID and AE_APP_CFG_ID can be something generic (dev, test, prod a, prod b) when using Docker Compose.
```cnf
# One Sky IT's Aether Framework and System # One Sky IT's Aether Framework and System
OSIT_ENV=development OSIT_ENV=development
# Aether general shared config options # Aether general shared config options
AE_CFG_ID=0
## Aether API access and use ## Aether API access and use
## Aether DB access and use ## Aether DB access and use
AE_DB_PASSWORD="the password with $$ escape"
## Aether Redis access and use ## Aether Redis access and use
## Aether SMTP access and use ## Aether SMTP access and use
# Aether API specific config options (FastAPI) # Aether API specific config options (FastAPI)
# Aether app specific config (Flask with Svelte) # Aether app specific config (Flask with Svelte)
AE_APP_CFG_ID=0
KEY="The Value" KEY="The Value"
``` ```
#### Part 4 - Still figuring things out...
Update /etc/hosts with something like this.
```cnf
127.0.0.1 dev-api.oneskyit.com dev-app.oneskyit.com
127.0.0.1 dev-demo.oneskyit.com dev-businessgroup.oneskyit.com dev-ishlt.oneskyit.com
```
* Nothing in aether_flask_gunicorn_conf.py needs to be changed?
* Nothing in aether_fastapi_gunicorn_conf.py needs to be changed?
* Nothing in aether_api_config.py needs to be changed?
* Nothing in aether_app_config.py needs to be changed?
## Manage Docker Compose Environment ## Manage Docker Compose Environment
```bash ```bash
@@ -52,8 +68,49 @@ docker restart ae_app_dev
docker restart ae_mariadb_dev docker restart ae_mariadb_dev
``` ```
## Clone Svelte App(s)
### One Sky IT NPM library
git clone https://scott_idem@bitbucket.org/oneskyit/one-sky-it-npm-library.git /srv/env/aether_npm_library
### Actual Svelte apps (note the branches)
Clone:
* git clone https://scott_idem@bitbucket.org/oneskyit/one-sky-it-app-svelte.git /srv/env/aether_xxx_yyy_svelte
* git clone https://scott_idem@bitbucket.org/oneskyit/one-sky-it-app-svelte.git ~/OSIT_dev/aether_xxx_yyy_svelte
Module groups:
* aether_app_core_svelte
* aether_app_mods_svelte
* aether_app_mod_events_svelte
Note:
Will need to change branches.
```bash
git branch --all
git switch ae_core_dev
git pull origin ae_core_dev
git switch ae_mods_dev
git pull origin ae_mods_dev
git switch ae_mod_events_dev
git pull origin ae_mod_events_dev
git branch --all
```
Also... don't forget to npm update before you npm run build or dev.
### Native Electron app
git clone https://scott_idem@bitbucket.org/oneskyit/one-sky-it-app-native.git /srv/env/aether_app_native
sdfasdfasd git clone https://scott_idem@bitbucket.org/oneskyit/one-sky-it-container-environment.git /srv/env/test_aether
--- ---
## More Notes ## More Notes

View File

@@ -0,0 +1,37 @@
# FROM tiangolo/uvicorn-gunicorn-fastapi:latest
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11
LABEL maintainer="Scott Idem <scott.idem@oneskyit.com>"
WORKDIR /srv/aether_api
# RUN apt install poppler-utils
RUN apt-get update; \
apt-get install -y \
poppler-utils \
; \
rm -rf /var/lib/apt/lists/*;
# RUN set -ex; \
# \
# apt-get update; \
# apt-get install -y --no-install-recommends \
# poppler-utils \
# ; \
# rm -rf /var/lib/apt/lists/*;
RUN pdftoppm -h
COPY conf/aether_api_v5_fastapi_requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
# RUN pip freeze
# RUN mkdir /temp
RUN pip freeze > /requirements_current.txt
# COPY requirements_current.txt tmp/requirements_current.txt
# RUN pip freeze > /logs/requirements_current.txt
# COPY conf/aether_fastapi_requirements.txt /tmp/requirements.txt
CMD ["gunicorn", "--conf", "/conf/gunicorn_fastapi_conf.py"]

View File

@@ -1,11 +1,28 @@
FROM tiangolo/uvicorn-gunicorn-fastapi:latest # FROM tiangolo/uvicorn-gunicorn-fastapi:latest
# FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10 FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11
LABEL maintainer="Scott Idem <scott.idem@oneskyit.com>" LABEL maintainer="Scott Idem <scott.idem@oneskyit.com>"
WORKDIR /srv/aether_api WORKDIR /srv/aether_api
RUN apt-get update; \
apt-get install -y \
imagemagick ffmpeg \
; \
rm -rf /var/lib/apt/lists/*;
# RUN apt-get update; \
# apt-get install -y \
# poppler-utils \
# ; \
# rm -rf /var/lib/apt/lists/*;
# RUN pdftoppm -h
COPY conf/aether_fastapi_requirements.txt /tmp/requirements.txt COPY conf/aether_fastapi_requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt RUN pip install --no-cache-dir -r /tmp/requirements.txt
RUN pip freeze > /aether_fastapi_requirements_current.txt
RUN pip freeze > /tmp/aether_fastapi_requirements_current.txt
CMD ["gunicorn", "--conf", "/conf/gunicorn_fastapi_conf.py"] CMD ["gunicorn", "--conf", "/conf/gunicorn_fastapi_conf.py"]

View File

@@ -1,4 +1,5 @@
FROM python:3 # FROM python:latest
FROM python:3.11
LABEL maintainer="Scott Idem <scott.idem@oneskyit.com>" LABEL maintainer="Scott Idem <scott.idem@oneskyit.com>"
@@ -7,4 +8,7 @@ WORKDIR /srv/aether_app
COPY conf/aether_flask_requirements.txt /tmp/requirements.txt COPY conf/aether_flask_requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt RUN pip install --no-cache-dir -r /tmp/requirements.txt
RUN pip freeze > /aether_flask_requirements_current.txt
RUN pip freeze > /tmp/aether_flask_requirements_current.txt
CMD ["gunicorn", "--conf", "/conf/gunicorn_flask_conf.py"] CMD ["gunicorn", "--conf", "/conf/gunicorn_flask_conf.py"]

View File

@@ -12,6 +12,7 @@ class Settings(BaseSettings):
AETHER_CFG['id'] = os.getenv('AE_CFG_ID', None) AETHER_CFG['id'] = os.getenv('AE_CFG_ID', None)
# AETHER_CFG['api_id'] = os.getenv('AE_API_CFG_ID', None) # NOT CURRENTLY NEED OR USED # AETHER_CFG['api_id'] = os.getenv('AE_API_CFG_ID', None) # NOT CURRENTLY NEED OR USED
JWT_KEY = os.getenv('AE_API_JWT_KEY', '22 chars 00xXyYzZ99') # 22 characters; super secret Aether JWT signing key
# APP_NAME: str = "Aether API (FastAPI)" # APP_NAME: str = "Aether API (FastAPI)"
# SUPER_EMAIL: EmailStr = 'Aether.Super@oneskyit.com' # SUPER_EMAIL: EmailStr = 'Aether.Super@oneskyit.com'
@@ -26,6 +27,10 @@ class Settings(BaseSettings):
DB['password'] = os.getenv('AE_DB_PASSWORD', None) # DB['password'] = os.getenv('AE_DB_PASSWORD', None) #
SQLALCHEMY_DB_URI = 'mysql://'+DB['username']+':'+DB['password']+'@'+DB['server']+'/'+DB['name'] SQLALCHEMY_DB_URI = 'mysql://'+DB['username']+':'+DB['password']+'@'+DB['server']+'/'+DB['name']
# DB['wait_timeout'] = int(os.getenv('AE_DB_WAIT_TIMEOUT', 1800)) # Not used yet! default = 28800; Time (seconds) that the server waits for a connection to become active before closing it.
DB['connect_timeout'] = int(os.getenv('AE_DB_CONNECTION_TIMEOUT', 20)) # default = 10; Time (seconds) that the server waits for a connection to become active before closing it.
DB['pool_recycle'] = int(os.getenv('AE_DB_POOL_RECYCLE', 1800)) # default = ?; Related to SQLAlchemy
# Aether API log files paths # Aether API log files paths
LOG_PATH = {} LOG_PATH = {}
@@ -54,26 +59,26 @@ class Settings(BaseSettings):
# CORS Origins # CORS Origins
ORIGINS_REGEX = '(https://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com)|(https://.*\.oneskyit\.com:4443)|(http://.*\.oneskyit\.com:8080)|(http://.*\.oneskyit\.com:8181)|(https://.*\.oneskyit\.com:8443)|(http://.*\.oneskyit\.local)|(http://.*\.oneskyit\.local:5000)|(http://.*.localhost)|(http://.*.localhost:5000)|(http://.*.localhost:8181)' ORIGINS_REGEX = os.getenv('AE_API_ORIGINS_REGEX', '(https://.*\.oneskyit\.com)|(https://.*\.oneskyit\.com:4443)|(https://.*\.oneskyit\.com:8443)') # '(https://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com)|(https://.*\.oneskyit\.com:4443)|(http://.*\.oneskyit\.com:8080)|(http://.*\.oneskyit\.com:8181)|(https://.*\.oneskyit\.com:8443)|(http://.*\.oneskyit\.local)|(http://.*\.oneskyit\.local:5000)|(http://.*.localhost)|(http://.*.localhost:5000)|(http://.*.localhost:8181)'
# A reasonable, but fairly open example regular expression for the CORS origins: # A reasonable, but fairly open example regular expression for the CORS origins:
# '(https://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com:8181)|(https://.*\.oneskyit\.com:8443)|(http://.*\.oneskyit\.local)|(http://.*\.oneskyit\.local:5000)|(http://.*.localhost)|(http://.*.localhost:5000)|(http://.*.localhost:8181)' # '(https://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com:8181)|(https://.*\.oneskyit\.com:8443)|(http://.*\.oneskyit\.local)|(http://.*\.oneskyit\.local:5000)|(http://.*.localhost)|(http://.*.localhost:5000)|(http://.*.localhost:8181)'
ORIGINS = [ ORIGINS = [
'https://oneskyit.com', 'https://oneskyit.com',
# 'http://app-local.oneskyit.com', # 'http://app-local.oneskyit.com',
'http://192.168.32.20:3000', # 'http://192.168.32.20:3000',
'http://192.168.32.20:8080', # 'http://192.168.32.20:8080',
'http://localhost', # 'http://localhost',
'http://localhost:3000', # 'http://localhost:3000',
# 'http://localhost:5000', # 'http://localhost:5000',
'http://localhost:7800', # 'http://localhost:7800',
# 'http://localhost:8080', # 'http://localhost:8080',
# 'http://localhost:8888', # 'http://localhost:8888',
# 'http://fastapi.localhost', # 'http://fastapi.localhost',
'http://svelte.oneskyit.local:5555', # 'http://svelte.oneskyit.local:5555',
# 'http://connect.localhost:5000', # Using localhost # 'http://connect.localhost:5000', # Using localhost
@@ -85,20 +90,4 @@ class Settings(BaseSettings):
] ]
# HTTP Status Dict List
HTTP_STATUS_LI = {}
# HTTP_STATUS_LI[200] = { 'name': 'OK', 'message': 'The request has succeeded.' }
# HTTP_STATUS_LI[400] = { 'name': 'Bad Request', 'message': 'The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.' }
# HTTP_STATUS_LI[401] = { 'name': 'Unauthorized', 'message': 'The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser does not understand how to supply the credentials required.' }
# HTTP_STATUS_LI[402] = { 'name': '?Request Failed?', 'message': '??The parameters were valid but the request failed.??' }
# HTTP_STATUS_LI[403] = { 'name': 'Forbidden', 'message': 'The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.' }
# HTTP_STATUS_LI[404] = { 'name': 'Not Found', 'message': 'The requested resource does not exist.' }
# HTTP_STATUS_LI[409] = { 'name': 'Conflict', 'message': 'The request conflicts with another request (perhaps due to using the same idempotent key).' }
# HTTP_STATUS_LI[429] = { 'name': 'Too Many Requests', 'message': 'Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.' }
# HTTP_STATUS_LI[500] = { 'name': 'Internal Server Error', 'message': 'The server encountered an unexpected condition which prevented it from fulfilling the request.' }
# HTTP_STATUS_LI[501] = { 'name': 'Not Implemented', 'message': 'The server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.' }
# HTTP_STATUS_LI[502] = { 'name': 'Bad Gateway', 'message': 'The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.' }
# HTTP_STATUS_LI[503] = { 'name': 'Service Unavailable', 'message': 'The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.' }
# HTTP_STATUS_LI[504] = { 'name': 'Gateway Timeout', 'message': 'The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.' }
settings = Settings() settings = Settings()

View File

@@ -0,0 +1,105 @@
# Configuration file for this FastAPI app.
import os
from pydantic import AnyHttpUrl, BaseSettings, EmailStr, HttpUrl, PostgresDsn, validator
from typing import Any, Dict, List, Optional, Union
# ### ### #
class Settings(BaseSettings):
AETHER_CFG = {}
AETHER_CFG['id'] = os.getenv('AE_CFG_ID', None)
# AETHER_CFG['api_id'] = os.getenv('AE_API_CFG_ID', None) # NOT CURRENTLY NEED OR USED
JWT_KEY = 'EHmSXZFKfMEW65E8kxCKmQ' # 22 characters; super secret Aether JWT signing key
# APP_NAME: str = "Aether API (FastAPI)"
# SUPER_EMAIL: EmailStr = 'Aether.Super@oneskyit.com'
# Database Connection
DB = {}
DB['server'] = os.getenv('AE_DB_V5_SERVER', 'mariadb') # 'linode.oneskyit.com' # linode.oneskyit.com, vpn-linode linode.oneskyit.local
DB['port'] = os.getenv('AE_DB_V5_PORT', '3306') # default = 3306
DB['name'] = os.getenv('AE_DB_V5_NAME', None) # 'aether_dev' #onesky_ams_dev
DB['username'] = os.getenv('AE_DB_V5_USERNAME', None) # 'osit_aether' # 'onesky_aether'
DB['password'] = os.getenv('AE_DB_V5_PASSWORD', None) #
SQLALCHEMY_DB_URI = 'mysql://'+DB['username']+':'+DB['password']+'@'+DB['server']+'/'+DB['name']
# Aether API log files paths
LOG_PATH = {}
LOG_PATH['app'] = os.getenv('AE_API_V5_LOG_PATH', 'admin/log/app.log') # 'admin/log/app.log', '../../logs/aether_api.log'
# LOG_PATH['app_warning'] = '/logs/aether_api_warning.log' # 'admin/log/app_warning.log' '../../logs/aether_api_warning.log'
# Redis
REDIS = {}
REDIS['server'] = os.getenv('AE_REDIS_SERVER', 'redis') # 'localhost' 'redis'
REDIS['port'] = os.getenv('AE_REDIS_PORT', '6379') # '6379'
# Send SMTP Email
SMTP = {}
# server
# port
# username
# password
# Server Hosted File Paths
FILES_PATH = {}
# hosted_files_root
# hosted_tmp_root
# CORS Origins
ORIGINS_REGEX = '(https://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com)|(https://.*\.oneskyit\.com:4443)|(http://.*\.oneskyit\.com:8080)|(http://.*\.oneskyit\.com:8181)|(https://.*\.oneskyit\.com:8443)|(http://.*\.oneskyit\.local)|(http://.*\.oneskyit\.local:5000)|(http://.*.localhost)|(http://.*.localhost:5000)|(http://.*.localhost:8181)'
# A reasonable, but fairly open example regular expression for the CORS origins:
# '(https://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com:8181)|(https://.*\.oneskyit\.com:8443)|(http://.*\.oneskyit\.local)|(http://.*\.oneskyit\.local:5000)|(http://.*.localhost)|(http://.*.localhost:5000)|(http://.*.localhost:8181)'
ORIGINS = [
'https://oneskyit.com',
# 'http://app-local.oneskyit.com',
'http://192.168.32.20:3000',
'http://192.168.32.20:8080',
'http://localhost',
'http://localhost:3000',
# 'http://localhost:5000',
'http://localhost:7800',
# 'http://localhost:8080',
# 'http://localhost:8888',
# 'http://fastapi.localhost',
'http://svelte.oneskyit.local:5555',
# 'http://connect.localhost:5000', # Using localhost
# 'http://dev-svelte.oneskyit.local:5555',
# 'http://lci.internal:5000', # Using internal; just in case guess before LCI
# 'http://lci.oneskyit.internal:5000', # Using internal; just in case guess before LCI
# 'http://lci.oneskyit.internal', # Using internal; just in case guess before LCI
]
# HTTP Status Dict List
HTTP_STATUS_LI = {}
# HTTP_STATUS_LI[200] = { 'name': 'OK', 'message': 'The request has succeeded.' }
# HTTP_STATUS_LI[400] = { 'name': 'Bad Request', 'message': 'The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.' }
# HTTP_STATUS_LI[401] = { 'name': 'Unauthorized', 'message': 'The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser does not understand how to supply the credentials required.' }
# HTTP_STATUS_LI[402] = { 'name': '?Request Failed?', 'message': '??The parameters were valid but the request failed.??' }
# HTTP_STATUS_LI[403] = { 'name': 'Forbidden', 'message': 'The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.' }
# HTTP_STATUS_LI[404] = { 'name': 'Not Found', 'message': 'The requested resource does not exist.' }
# HTTP_STATUS_LI[409] = { 'name': 'Conflict', 'message': 'The request conflicts with another request (perhaps due to using the same idempotent key).' }
# HTTP_STATUS_LI[429] = { 'name': 'Too Many Requests', 'message': 'Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.' }
# HTTP_STATUS_LI[500] = { 'name': 'Internal Server Error', 'message': 'The server encountered an unexpected condition which prevented it from fulfilling the request.' }
# HTTP_STATUS_LI[501] = { 'name': 'Not Implemented', 'message': 'The server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.' }
# HTTP_STATUS_LI[502] = { 'name': 'Bad Gateway', 'message': 'The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.' }
# HTTP_STATUS_LI[503] = { 'name': 'Service Unavailable', 'message': 'The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.' }
# HTTP_STATUS_LI[504] = { 'name': 'Gateway Timeout', 'message': 'The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.' }
settings = Settings()

View File

@@ -0,0 +1,43 @@
import os
# Gunicorn config variables
loglevel = "debug"
accesslog = "/logs/gunicorn_access.log" # "-" # stdout
errorlog = "/logs/gunicorn_error.log" # "-" # stderr
# "logfile" does not seem to actually do anything
# logfile = "/logs/gunicorn.log" # "-" # stderr
bind = "0.0.0.0:5005"
# bind = "unix:/tmp/gunicorn.sock"
worker_tmp_dir = "/dev/shm"
chdir = "/srv/aether_api"
# home = /path/to/environment
wsgi_app = "app.main:app"
# module = "run_server"
# callable = "app"
# plugins = "python"
# default_proc_name = "app.main:app"
# Setting a long timeout since some FastAPI API requests may take a while
timeout = 2100 # default 30; 1200 is NOT enough; worker process silent then kill and restart
graceful_timeout = 10 # default 30; timeout after restart signal
keepalive = 2 # default 2; setting higher because behind load balancer (nginx)
# Reload does not work correctly with UvicornWorker
# https://github.com/benoitc/gunicorn/issues/2339
# Disable reload if using more than one thread
##### reload = True
# reload_engine = "poll"
worker_class = "uvicorn.workers.UvicornWorker" # default "sync"
# Works are processes, not threads
# workers = 9 # default 1; use 10ish for production; 2 to 4 times the number of cores
# threads = 1 # default 1; only affects Gthread worker type
workers = os.getenv('AE_API_WORKERS', 2)
threads = os.getenv('AE_API_THREADS', 2)
# umask = '007'

View File

@@ -0,0 +1,63 @@
# aioredis # BAD! Not maintained!
anyio
argon2-cffi
argon2-cffi-bindings
asgiref
async-timeout
certifi
cffi
charset-normalizer
click
Deprecated
dnspython
email-validator
et-xmlfile
fastapi
greenlet
gunicorn
h11
html2text
httpcore
httptools
httpx
idna
itsdangerous
Jinja2
MarkupSafe
mysqlclient
numpy
openpyxl
orjson
packaging
pandas
passlib
pdf2image
Pillow
pycparser
pydantic
PyJWT
pyparsing
python-dateutil
python-dotenv
python-multipart
pytz
PyYAML
qrcode
redis[hiredis]
requests
rfc3986
six
sniffio
SQLAlchemy==1.4.47 # 1.4.47 is the newest I am working with
starlette
stripe
typing_extensions
ujson
urllib3
uvicorn
uvloop
watchfiles
watchgod
websockets
wrapt
xlrd

View File

@@ -14,7 +14,7 @@ ENV = 'development' # None, 'backup', 'default', 'development', 'production', 't
DEBUG = True DEBUG = True
TESTING = True TESTING = True
SECRET_KEY = '\x08}\xe1q?\xb2\x16o9\xf1\x1d\xc7\xa8\xfb!\xff' # Generate a new key with: # python -c 'import os; print(os.urandom(16))' SECRET_KEY = os.getenv('AE_APP_CACHE_SECRET_KEY', None) # Generate a new key with: # python -c 'import os; print(os.urandom(16))'
# SESSION_COOKIE_NAME = 'session' # SESSION_COOKIE_NAME = 'session'
# SESSION_COOKIE_DOMAIN = '.onesky.com' # SESSION_COOKIE_DOMAIN = '.onesky.com'
@@ -31,19 +31,19 @@ SECRET_KEY = '\x08}\xe1q?\xb2\x16o9\xf1\x1d\xc7\xa8\xfb!\xff' # Generate a new k
# 7862400 is 91 days or 13 weeks (.25 year) # 7862400 is 91 days or 13 weeks (.25 year)
# 31536000 is 365 days # 31536000 is 365 days
# 33868800 is 9408 hours or 392 days # 33868800 is 9408 hours or 392 days
PERMANENT_SESSION_LIFETIME = 3600 PERMANENT_SESSION_LIFETIME = int(os.getenv('AE_APP_SESSION_LIFETIME', 86400))
SESSION_REFRESH_EACH_REQUEST = True SESSION_REFRESH_EACH_REQUEST = True
# Files and caching # Files and caching
# SERVER_NAME = '' # SERVER_NAME = ''
# UPLOAD_FOLDER = '' # UPLOAD_FOLDER = ''
MAX_CONTENT_LENGTH = 5120 * 1024 * 1024 # 5 GB # MAX_CONTENT_LENGTH = 5120 * 1024 * 1024 # 5 GB
SEND_FILE_MAX_AGE_DEFAULT = 3 # default 43200 (in seconds), 1800 = 30 minutes SEND_FILE_MAX_AGE_DEFAULT = 3 # default 43200 (in seconds), 1800 = 30 minutes
CACHE_TYPE = 'SimpleCache' CACHE_TYPE = 'SimpleCache'
CACHE_DEFAULT_TIMEOUT = 1 CACHE_DEFAULT_TIMEOUT = int(os.getenv('AE_APP_CACHE_TIMEOUT', 5))
JSONIFY_PRETTYPRINT_REGULAR = True JSONIFY_PRETTYPRINT_REGULAR = True
@@ -67,7 +67,7 @@ ISOLATION_LEVEL = 'READ COMMITTED'
AETHER_CFG = {} AETHER_CFG = {}
## General Aether configuration options ## General Aether configuration options
AETHER_CFG['id'] = 5 # Aether config ID AETHER_CFG['id'] = os.getenv('AE_CFG_ID', None) # Aether config ID
## Aether Flask app (not a specific browser client) configuration (pull from "cfg_flask" table) ## Aether Flask app (not a specific browser client) configuration (pull from "cfg_flask" table)
AETHER_CFG['app'] = {} AETHER_CFG['app'] = {}
@@ -81,7 +81,7 @@ AETHER_CFG['app']['ux_mode'] = None # In this case it is the same as mode. None,
AETHER_CFG['app']['theme'] = None # For future use or at least for 'light', 'dark', 'contrast' themes? AETHER_CFG['app']['theme'] = None # For future use or at least for 'light', 'dark', 'contrast' themes?
AETHER_CFG['app']['path_hosted_files_root']: str = None AETHER_CFG['app']['path_hosted_files_root']: str = None
AETHER_CFG['app']['path_hosted_tmp_root']: str = None AETHER_CFG['app']['path_hosted_tmp_root']: str = None
AETHER_CFG['app']['path_hosted_qr_images']: str = None # Will contain only QR code image files # AETHER_CFG['app']['path_hosted_qr_images']: str = None # Will contain only QR code image files; Use path_hosted_tmp_root instead
## Aether API for Flask app configuration (pull from "cfg_flask" table) ## Aether API for Flask app configuration (pull from "cfg_flask" table)
AETHER_CFG['api'] = {} AETHER_CFG['api'] = {}

View File

@@ -1,7 +1,7 @@
import os import os
# Gunicorn config variables # Gunicorn config variables
loglevel = "warning" loglevel = os.getenv('AE_LOG_LVL', 'warning')
accesslog = "/logs/gunicorn_access.log" # "-" # stdout accesslog = "/logs/gunicorn_access.log" # "-" # stdout
errorlog = "/logs/gunicorn_error.log" # "-" # stderr errorlog = "/logs/gunicorn_error.log" # "-" # stderr
@@ -22,14 +22,14 @@ wsgi_app = "app.main:app"
# default_proc_name = "app.main:app" # default_proc_name = "app.main:app"
# Setting a long timeout since some FastAPI API requests may take a while # Setting a long timeout since some FastAPI API requests may take a while
timeout = 1200 # default 30; worker process silent then kill and restart timeout = os.getenv('AE_API_GUNICORN_TIMEOUT', 2100) # default 30; 1200 is NOT enough; worker process silent then kill and restart
graceful_timeout = 20 # default 30; timeout after restart signal graceful_timeout = os.getenv('AE_API_GUNICORN_GRACEFUL_TIMEOUT', 20) # default 30; timeout after restart signal; tried 10 2023-07-11
keepalive = 300 # default 2; setting higher because behind load balancer (nginx) keepalive = os.getenv('AE_API_GUNICORN_KEEPALIVE', 30) # default 2; setting higher because behind load balancer (nginx); tried 10 2023-07-11
# Reload does not work correctly with UvicornWorker # Reload does not work correctly with UvicornWorker
# https://github.com/benoitc/gunicorn/issues/2339 # https://github.com/benoitc/gunicorn/issues/2339
# Disable reload if using more than one thread # Disable reload if using more than one thread
reload = True ##### reload = True
# reload_engine = "poll" # reload_engine = "poll"
@@ -37,7 +37,7 @@ worker_class = "uvicorn.workers.UvicornWorker" # default "sync"
# Works are processes, not threads # Works are processes, not threads
# workers = 9 # default 1; use 10ish for production; 2 to 4 times the number of cores # workers = 9 # default 1; use 10ish for production; 2 to 4 times the number of cores
# threads = 1 # default 1; only affects Gthread worker type # threads = 1 # default 1; only affects Gthread worker type
workers = os.getenv('AE_API_WORKERS', None) workers = os.getenv('AE_API_GUNICORN_WORKERS', 2)
threads = os.getenv('AE_API_THREADS', None) threads = os.getenv('AE_API_GUNICORN_THREADS', 2)
# umask = '007' # umask = '007'

View File

@@ -0,0 +1,63 @@
# aioredis # BAD! Not maintained!
anyio
argon2-cffi
argon2-cffi-bindings
asgiref
async-timeout
certifi
cffi
charset-normalizer
click
Deprecated
dnspython
email-validator
et-xmlfile
fastapi
greenlet
gunicorn
h11
html2text
httpcore
httptools
httpx
idna
itsdangerous
Jinja2
MarkupSafe
mysqlclient
numpy
openpyxl
orjson
packaging
pandas
passlib
pdf2image
Pillow
pycparser
pydantic
PyJWT
pyparsing
python-dateutil
python-dotenv
python-multipart
pytz
PyYAML
qrcode
redis[hiredis]
requests
rfc3986
six
sniffio
SQLAlchemy==1.4.47 # 1.4.47 is the newest I am working with
starlette
stripe
typing_extensions
ujson
urllib3
uvicorn
uvloop
watchfiles
watchgod
websockets
wrapt
xlrd

View File

@@ -1,61 +1,71 @@
anyio==3.6.2 # Updated manually 2023-09-12 with a lot of trial and error.
argon2-cffi==21.3.0 # A few are commented out even though they are actually used and required. Other packages already pull them in.
argon2-cffi-bindings==21.2.0 # SQLAlchemy needs to be upgraded to 2.x. There are issues with async IO or something related to that.
asgiref==3.5.2 # https://docs.sqlalchemy.org/en/14/changelog/migration_20.html
async-timeout==4.0.2
certifi==2022.9.24 # aioredis # BAD! Not maintained!
cffi==1.15.1 aiofiles
charset-normalizer==2.1.1 # anyio
click==8.1.3 argon2-cffi
Deprecated==1.2.13 argon2-cffi-bindings
dnspython==2.2.1 # asgiref
email-validator==1.3.0 async-timeout
et-xmlfile==1.1.0 baize # added 2023-08-17
fastapi==0.88.0 # certifi
greenlet==2.0.0 # cffi
gunicorn==20.1.0 charset-normalizer
h11==0.14.0 click
html2text==2020.1.16 Deprecated
httpcore==0.16.2 dnspython
httptools==0.5.0 email-validator
httpx==0.23.1 et-xmlfile
idna==3.4 fastapi>=0.88.0
itsdangerous==2.1.2 greenlet>=2.0.2
Jinja2==3.1.2 gunicorn>=20.1.0
MarkupSafe==2.1.1 h11
mysqlclient==2.1.1 html2text>=2020.1.16
numpy==1.23.4 httpcore
openpyxl==3.0.10 httptools
orjson==3.8.1 httpx
packaging==21.3 idna
pandas==1.5.2 itsdangerous
passlib==1.7.4 # Jinja2>=3.1.2
Pillow==9.3.0 MarkupSafe
pycparser==2.21 mysqlclient
pydantic==1.10.2 numpy>=1.25.2
PyJWT==2.6.0 openpyxl
pyparsing==3.0.9 orjson
python-dateutil==2.8.2 # packaging
python-dotenv==0.21.0 pandas>=2.1.0
python-multipart==0.0.5 passlib
pytz==2022.6 pdf2image>=1.16.3
PyYAML==6.0 Pillow>=10.0.0
qrcode==7.3.1 pycparser
redis==4.3.5 pydantic>=1.10.12
requests==2.28.1 PyJWT>=2.8.0
rfc3986==1.5.0 pyparsing
six==1.16.0 python-dateutil
sniffio==1.3.0 python-dotenv
SQLAlchemy==1.4.44 python-multipart
starlette==0.22.0 pytz
stripe==5.0.0 PyYAML>=6.0.1
typing_extensions==4.4.0 qrcode>=7.4.2
ujson==5.5.0 redis[hiredis] # redis==5.0.0 hiredis==2.2.3
urllib3==1.26.12 requests
uvicorn==0.18.3 rfc3986
uvloop==0.17.0 six
watchfiles==0.18.0 sniffio
watchgod==0.8.2 SQLAlchemy==1.4.49 # 1.4.47 is the newest (2.0.20) I am working with
websockets==10.4 starlette>=0.22.0
wrapt==1.14.1 stripe>=6.4.0
xlrd==2.0.1 typing_extensions
ujson
urllib3
uvicorn
uvloop
Wand
watchfiles
watchgod
websockets>=11.0.3
wrapt
xlrd

View File

@@ -0,0 +1,70 @@
# Updated manually 2023-09-12 with a lot of trial and error.
# A few are commented out even though they are actually used and required. Other packages already pull them in.
# SQLAlchemy needs to be upgraded to 2.x. There are issues with async IO or something related to that.
# https://docs.sqlalchemy.org/en/14/changelog/migration_20.html
# aioredis # BAD! Not maintained!
aiofiles
anyio
argon2-cffi
argon2-cffi-bindings
# asgiref
async-timeout
baize # added 2023-08-17
# certifi
# cffi
charset-normalizer
click
Deprecated
dnspython
email-validator
et-xmlfile
fastapi>=0.88.0
greenlet>=2.0.2
gunicorn>=20.1.0
h11
html2text>=2020.1.16
httpcore
httptools
httpx
idna
itsdangerous
# Jinja2>=3.1.2
MarkupSafe
mysqlclient
numpy>=1.25.2
openpyxl
orjson
# packaging
pandas>=2.1.0
passlib
pdf2image>=1.16.3
Pillow>=10.0.0
pycparser
pydantic>=1.10.12
PyJWT>=2.8.0
pyparsing
python-dateutil
python-dotenv
python-multipart
pytz
PyYAML>=6.0.1
qrcode>=7.4.2
redis[hiredis] # redis==5.0.0 hiredis==2.2.3
requests
rfc3986
six
sniffio
SQLAlchemy==1.4.49 # 1.4.47 is the newest (2.0.20) I am working with
starlette>=0.22.0
stripe>=6.4.0
typing_extensions
ujson
urllib3
uvicorn
uvloop
watchfiles
watchgod
websockets>=11.0.3
wrapt
xlrd

View File

@@ -1,7 +1,7 @@
import os import os
# Gunicorn config variables # Gunicorn config variables
loglevel = "debug" loglevel = os.getenv('AE_LOG_LVL', 'warning')
# accesslog = "/logs/gunicorn_access.log" # "-" # stdout # accesslog = "/logs/gunicorn_access.log" # "-" # stdout
errorlog = "/logs/gunicorn_error.log" # "-" # stderr errorlog = "/logs/gunicorn_error.log" # "-" # stderr
@@ -22,9 +22,9 @@ wsgi_app = "run_server:app"
# default_proc_name = "run_server:app" # default_proc_name = "run_server:app"
# Setting a longer timeout since some Flask app requests may take a while # Setting a longer timeout since some Flask app requests may take a while
timeout = 1200 # default 30; worker process silent then kill and restart timeout = os.getenv('AE_APP_GUNICORN_TIMEOUT', 1200) # default 30; worker process silent then kill and restart
graceful_timeout = 20 graceful_timeout = os.getenv('AE_APP_GUNICORN_GRACEFUL_TIMEOUT', 20)
keepalive = 300 # default 2; setting higher because behind load balancer (nginx) keepalive = os.getenv('AE_APP_GUNICORN_KEEPALIVE', 300) # default 2; setting higher because behind load balancer (nginx)
# Disable reload if using more than one thread # Disable reload if using more than one thread
reload = True reload = True
@@ -33,8 +33,8 @@ reload = True
# Works are processes, not threads # Works are processes, not threads
# workers = 9 # default 1; use 10ish for production; 2 to 4 times the number of cores # workers = 9 # default 1; use 10ish for production; 2 to 4 times the number of cores
# threads = 1 # default 1; only affects Gthread worker type # threads = 1 # default 1; only affects Gthread worker type
workers = os.getenv('AE_APP_WORKERS', None) workers = os.getenv('AE_APP_GUNICORN_WORKERS', 2)
threads = os.getenv('AE_APP_THREADS', None) threads = os.getenv('AE_APP_GUNICORN_THREADS', 2)
# umask = '007' # umask = '007'

View File

@@ -1,77 +1,41 @@
argon2-cffi==21.3.0 # Updated manually 2023-09-12 with a lot of trial and error.
# argon2-cffi-bindings==21.2.0 # A few are commented out even though they are actually used and required. Other packages already pull them in.
async-timeout==4.0.2
bidict==0.21.4 argon2-cffi>=23.1.0 # Must keep
Brotli==1.0.9 click>=8.1.7 # Must keep???
cachelib==0.9.0 Deprecated>=1.2.14
certifi==2021.10.8 # Flask 2.0.3 works; 2.1.3 works except for changes related to send_file and send_directory; 2.2.5 does not yet work
# cffi==1.15.0 Flask==2.1.3 # Must keep; 2.2.5 seems ok as of 2023-10-19 but needs more testing
charset-normalizer==2.0.9 Flask-Caching>=2.0.2
click==7.1.2 Flask-Cors>=4.0.0
cssselect2==0.4.1 Flask-MySQLdb>=1.0.1
# Cython==0.29.32 Flask-SocketIO>=5.3.6
Deprecated==1.2.13 Flask-SQLAlchemy>=2.5.1
# dnspython==2.1.0 gunicorn>=21.2.0
eventlet==0.33.2 html2text>=2020.1.16
Flask==1.1.4 # itsdangerous>=2.1.2
Flask-Caching==2.0.1 Jinja2>=3.1.2
Flask-Cors==3.0.10 # MarkupSafe>=2.1.3
Flask-MySQLdb==1.0.1 # mysqlclient>=2.2.0
Flask-SocketIO==5.3.2 numpy>=1.25.2
Flask-SQLAlchemy==2.5.1 pandas>=2.1.0
Flask-WeasyPrint==0.6 passlib>=1.7.4
fonttools==4.28.4 Pillow>=10.0.0
gevent==22.10.2 pydantic>=2.3.0
greenlet==2.0.1 python-dateutil>=2.8.2
gunicorn==20.1.0 python-engineio>=4.3.0
html2text==2020.1.16 python-socketio>=5.5.0
html5lib==1.1 pytz>=2023.3.post1
idna==3.3 qrcode>=7.4.2
itsdangerous==1.1.0 redis>=5.0.0
Jinja2==2.11.3 requests==2.28.1 # version 2.31.0 does not work?
MarkupSafe==2.0.1 # six>=1.16.0
mypy==0.930 SQLAlchemy>=2.0.20 # Must keep
mypy-extensions==0.4.3 stripe==5.0.0 # version 6.4.0 exists 2023-09-12
mysqlclient==2.1.0 types-pytz>=2023.3.0.1
numpy types-requests>=2.31.0.2
packaging==21.3 types-urllib3>=1.26.25.14
pandas==1.5.2 typing_extensions>=4.7.1
passlib==1.7.4 # urllib3>=1.26.16
Pillow==9.3.0 Werkzeug==2.3.7 # hold off on upgrading to 3.x versions; Werkzeug 2.3.7 works with Flask 2.1.3; 2.3.8 should be out late 2023
pycparser==2.21 xmltodict>=0.13.0 # Must keep
# pycrypto==2.6.1
# pycryptodome==3.16.0
pydantic==1.10.2
pydyf==0.1.2
pyparsing==3.0.9
pyphen==0.11.0
python-dateutil==2.8.2
python-engineio==4.3.0
python-socketio==5.5.0
pytz==2021.3
qrcode==7.3.1
redis==4.3.5
requests==2.28.1
# simple-crypt==4.1.7
six==1.16.0
SQLAlchemy==1.4.28
stripe==5.0.0
suds-py3==1.4.5.0
tinycss2==1.1.1
tomli==2.0.0
types-pytz==2022.1.2
types-requests==2.28.10
types-urllib3==1.26.24
typing_extensions==4.4.0
urllib3==1.26.7
uvicorn==0.18.3
# uWSGI==2.0.21
weasyprint==53.4
webencodings==0.5.1
Werkzeug==0.16.1
wrapt==1.13.3
xlrd==2.0.1
xmltodict==0.13.0
# zope.event==4.5.0
# zope.interface==5.4.0
# zopfli==0.1.9

View File

@@ -0,0 +1,40 @@
# Updated manually 2023-09-12 with a lot of trial and error.
# A few are commented out even though they are actually used and required. Other packages already pull them in.
argon2-cffi>=23.1.0 # Must keep
click>=8.1.7 # Must keep???
Deprecated>=1.2.14
Flask==2.0.3 # Must keep
Flask-Caching>=2.0.2
Flask-Cors>=4.0.0
Flask-MySQLdb>=1.0.1
Flask-SocketIO>=5.3.6
Flask-SQLAlchemy>=2.5.1
gunicorn>=21.2.0
html2text>=2020.1.16
# itsdangerous>=2.1.2
Jinja2>=3.1.2
# MarkupSafe>=2.1.3
# mysqlclient>=2.2.0
numpy>=1.25.2
pandas>=2.1.0
passlib>=1.7.4
Pillow>=10.0.0
pydantic>=2.3.0
python-dateutil>=2.8.2
python-engineio>=4.3.0
python-socketio>=5.5.0
pytz>=2023.3.post1
qrcode>=7.4.2
redis>=5.0.0
requests==2.28.1 # version 2.31.0 does not work?
# six>=1.16.0
SQLAlchemy>=2.0.20 # Must keep
stripe==5.0.0 # version 6.4.0 exists 2023-09-12
types-pytz>=2023.3.0.1
types-requests>=2.31.0.2
types-urllib3>=1.26.25.14
typing_extensions>=4.7.1
# urllib3>=1.26.16
Werkzeug>=2.3.7
xmltodict>=0.13.0 # Must keep

View File

@@ -2,3 +2,4 @@
* *
# Except for this file # Except for this file
!.gitignore !.gitignore
!README.md

15
conf/certs/README.md Normal file
View File

@@ -0,0 +1,15 @@
Create a links to the pem files
* ./conf/certs/oneskyit.com_fullchain.pem
* ./conf/certs/privkey.pem
* ./conf/certs/ssl-dhparams.pem
## Copy certs
### Copy Let's Encrypt
ssl-dhparams.pem should only need to be copied one time. The others need to be copied over after they expire.
Does the ownership or other permissions need to change?
```bash
sudo cp /etc/letsencrypt/live/oneskyit.com-0001/fullchain.pem /srv/env/test_aether/conf/certs/fullchain.pem
sudo cp /etc/letsencrypt/live/oneskyit.com-0001/privkey.pem /srv/env/test_aether/conf/certs/privkey.pem
sudo cp /etc/letsencrypt/ssl-dhparams.pem /srv/env/test_aether/conf/certs/ssl-dhparams.pem
# sudo chown -R scott:scott ~/srv/env/test_aether/certs/
```

View File

@@ -2,7 +2,8 @@ server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name phpmyadmin-oneskyit.localhost phpmyadmin.oneskyit.com dev-phpmyadmin.oneskyit.com test-phpmyadmin.oneskyit.com; server_name ${DOCKER_PHPMYADMIN_SERVER_NAME};
# server_name phpmyadmin-oneskyit.localhost phpmyadmin.oneskyit.com dev-phpmyadmin.oneskyit.com test-phpmyadmin.oneskyit.com;
access_log /logs/nginx/access_oneskyit_phpmyadmin.log; access_log /logs/nginx/access_oneskyit_phpmyadmin.log;
@@ -23,12 +24,19 @@ server {
server { server {
listen 443 ssl; listen 443 ssl;
listen [::]:443 ssl http2; listen [::]:443 ssl;
# server_name ${DOCKER_PHPMYADMIN_SERVER_NAME};
server_name phpmyadmin-oneskyit.localhost phpmyadmin.oneskyit.com dev-phpmyadmin.oneskyit.com test-phpmyadmin.oneskyit.com; server_name phpmyadmin-oneskyit.localhost phpmyadmin.oneskyit.com dev-phpmyadmin.oneskyit.com test-phpmyadmin.oneskyit.com;
access_log /logs/nginx/access_oneskyit_phpmyadmin.log; access_log /logs/nginx/access_oneskyit_phpmyadmin.log;
include /etc/nginx/options-ssl-nginx.conf;
ssl_certificate /etc/certs/fullchain.pem;
ssl_certificate_key /etc/certs/privkey.pem;
ssl_dhparam /etc/certs/ssl-dhparams.pem;
index index.php; index index.php;
location / { location / {

View File

@@ -0,0 +1,159 @@
server {
listen 80;
listen [::]:80;
server_name ${DOCKER_AE_API_V5_SERVER_NAME} v5-fastapi.localhost api-v5.localhost;
# server_name
# fastapi_gunicorn.localhost
# dev-api.localhost
# dev-api.oneskyit.com
# test-api.oneskyit.com
# ;
access_log /logs/nginx/access_fastapi_gunicorn.log;
error_log /logs/nginx/error_fastapi_gunicorn.log;
client_max_body_size ${OSIT_WEB_MAX_BODY_SIZE}; # 5120M; #4096M or 4G; 5120M or 5G;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
# This is needed for long running Python code. Default is 60 seconds
# Increased from 1200 to 1500 on 2022-04-17
# Increased from 1500 to 2000 on 2023-03-15
# Increased proxy read timeout to 2100 and decreased fastcgi options to 35s on 2023-03-16
fastcgi_connect_timeout 4s;
fastcgi_send_timeout 5s;
fastcgi_read_timeout 5s;
# proxy read timeout being too low will cause 504 Gateway Time-out on the client browser
proxy_read_timeout 2100s;
proxy_pass http://v5_fastapi_backend;
}
location /ws {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# proxy_read_timeout 600;
# proxy_headers_hash_max_size 1024;
proxy_pass http://v5_fastapi_backend;
access_log /logs/nginx/access_fastapi_gunicorn_ws.log;
error_log /logs/nginx/error_fastapi_gunicorn_ws.log;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name ${DOCKER_AE_API_V5_SERVER_NAME} v5-fastapi.localhost api-v5.localhost;
# server_name
# fastapi_gunicorn.localhost
# dev-api.localhost
# dev-api.oneskyit.com
# test-api.oneskyit.com
# ;
access_log /logs/nginx/access_fastapi_gunicorn.log;
error_log /logs/nginx/error_fastapi_gunicorn.log;
include /etc/nginx/options-ssl-nginx.conf;
ssl_certificate /etc/certs/fullchain.pem;
ssl_certificate_key /etc/certs/privkey.pem;
ssl_dhparam /etc/certs/ssl-dhparams.pem;
# include brotli.conf;
# include gzip.conf;
client_max_body_size ${OSIT_WEB_MAX_BODY_SIZE}; # 5120M; #4096M or 4G; 5120M or 5G;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
# This is needed for long running Python code. Default is 60 seconds
# Increased from 1200 to 1500 on 2022-04-17
# Increased from 1500 to 2000 on 2023-03-15
# Increased proxy read timeout to 2100 and decreased fastcgi options to 35s on 2023-03-16
fastcgi_connect_timeout 35s;
fastcgi_send_timeout 35s;
fastcgi_read_timeout 35s;
# proxy read timeout being too low will cause 504 Gateway Time-out on the client browser
proxy_read_timeout 2100s;
proxy_pass http://v5_fastapi_backend;
}
location /ws {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# proxy_read_timeout 600;
# proxy_headers_hash_max_size 1024;
proxy_pass http://v5_fastapi_backend;
access_log /logs/nginx/access_fastapi_gunicorn_ws.log;
error_log /logs/nginx/error_fastapi_gunicorn_ws.log;
}
}
upstream v5_fastapi_backend {
# sticky sessions
ip_hash;
# enable least connections balancing method
# least_conn;
# zone backend 64k; # Use NGINX Plus' shared memory
# server webserver1 weight=1;
# server webserver2 weight=4;
# larger number will recieve more requests
# Example of 20 vs 10: 20 will recieve twice as many requests as 10
server aether_api_v5_gunicorn:5005 weight=20 max_fails=3 fail_timeout=30s;
# server aether_api_gunicorn_bak:5005 weight=10 max_fails=1 fail_timeout=30s;
# maintain up to 20 idle connections to the group of upstream servers
# keepalive 20;
}

View File

@@ -3,16 +3,22 @@ server {
listen [::]:80; listen [::]:80;
server_name server_name
fastapi_gunicorn.localhost ${DOCKER_AE_API_SERVER_NAME}
dev-api.localhost fastapi.localhost
dev-api.oneskyit.com api.localhost
test-api.oneskyit.com
; ;
# server_name
# fastapi_gunicorn.localhost
# dev-api.localhost
# dev-api.oneskyit.com
# test-api.oneskyit.com
# ;
access_log /logs/nginx/access_fastapi_gunicorn.log; access_log /logs/nginx/access_fastapi_gunicorn.log;
error_log /logs/nginx/error_fastapi_gunicorn.log; error_log /logs/nginx/error_fastapi_gunicorn.log;
client_max_body_size 5120M; #4096M or 4G; 5120M or 5G; client_max_body_size ${OSIT_WEB_MAX_BODY_SIZE}; # 5120M; #4096M or 4G; 5120M or 5G;
location / { location / {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
@@ -25,27 +31,60 @@ server {
# This is needed for long running Python code. Default is 60 seconds # This is needed for long running Python code. Default is 60 seconds
# Increased from 1200 to 1500 on 2022-04-17 # Increased from 1200 to 1500 on 2022-04-17
fastcgi_connect_timeout 1500s; # Increased from 1500 to 2000 on 2023-03-15
fastcgi_send_timeout 1500s; # Increased proxy read timeout to 2100 and decreased fastcgi options to 35s on 2023-03-16
fastcgi_read_timeout 1500s; fastcgi_connect_timeout 4s;
proxy_read_timeout 1500s; fastcgi_send_timeout 5s;
fastcgi_read_timeout 5s;
# proxy read timeout being too low will cause 504 Gateway Time-out on the client browser
proxy_read_timeout 2100s;
proxy_pass http://fastapi_backend; proxy_pass http://fastapi_backend;
} }
location /ws {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# proxy_read_timeout 600;
# proxy_headers_hash_max_size 1024;
proxy_pass http://fastapi_backend;
access_log /logs/nginx/access_fastapi_gunicorn_ws.log;
error_log /logs/nginx/error_fastapi_gunicorn_ws.log;
}
} }
server { server {
listen 443 ssl; listen 443 ssl;
listen [::]:443 ssl http2; listen [::]:443 ssl;
server_name server_name
fastapi_gunicorn.localhost ${DOCKER_AE_API_SERVER_NAME}
dev-api.localhost fastapi.localhost
dev-api.oneskyit.com api.localhost
test-api.oneskyit.com
; ;
# server_name
# fastapi_gunicorn.localhost
# dev-api.localhost
# dev-api.oneskyit.com
# test-api.oneskyit.com
# ;
access_log /logs/nginx/access_fastapi_gunicorn.log; access_log /logs/nginx/access_fastapi_gunicorn.log;
error_log /logs/nginx/error_fastapi_gunicorn.log; error_log /logs/nginx/error_fastapi_gunicorn.log;
@@ -58,7 +97,7 @@ server {
# include brotli.conf; # include brotli.conf;
# include gzip.conf; # include gzip.conf;
client_max_body_size 5120M; #4096M or 4G; 5120M or 5G; client_max_body_size ${OSIT_WEB_MAX_BODY_SIZE}; # 5120M; #4096M or 4G; 5120M or 5G;
location / { location / {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
@@ -71,13 +110,40 @@ server {
# This is needed for long running Python code. Default is 60 seconds # This is needed for long running Python code. Default is 60 seconds
# Increased from 1200 to 1500 on 2022-04-17 # Increased from 1200 to 1500 on 2022-04-17
fastcgi_connect_timeout 1500s; # Increased from 1500 to 2000 on 2023-03-15
fastcgi_send_timeout 1500s; # Increased proxy read timeout to 2100 and decreased fastcgi options to 35s on 2023-03-16
fastcgi_read_timeout 1500s; fastcgi_connect_timeout 35s;
proxy_read_timeout 1500s; fastcgi_send_timeout 35s;
fastcgi_read_timeout 35s;
# proxy read timeout being too low will cause 504 Gateway Time-out on the client browser
proxy_read_timeout 2100s;
proxy_pass http://fastapi_backend; proxy_pass http://fastapi_backend;
} }
location /ws {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# proxy_read_timeout 600;
# proxy_headers_hash_max_size 1024;
proxy_pass http://fastapi_backend;
access_log /logs/nginx/access_fastapi_gunicorn_ws.log;
error_log /logs/nginx/error_fastapi_gunicorn_ws.log;
}
} }

View File

@@ -2,31 +2,49 @@ server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
# server_name
# ${NGINX_SERVER_NAMES}
# ;
server_name server_name
${DOCKER_AE_APP_SERVER_NAME}
flask_gunicorn.localhost demo.localhost dev.localhost flask_gunicorn.localhost demo.localhost dev.localhost
dev.oneskyit.com
dev-app.oneskyit.com dev-app.oneskyit.com
dev-connect.oneskyit.com *.dev-connect.oneskyit.com dev-connect.oneskyit.com *.dev-connect.oneskyit.com
dev-demo.oneskyit.com *.dev-demo.oneskyit.com dev-demo.oneskyit.com *.dev-demo.oneskyit.com
dev-aacc.oneskyit.com *.dev-aacc.oneskyit.com
dev-aapor.oneskyit.com *.dev-aapor.oneskyit.com dev-aapor.oneskyit.com *.dev-aapor.oneskyit.com
dev-businessgroup.oneskyt.com *.dev-businessgroup.oneskyt.com dev-businessgroup.oneskyit.com *.dev-businessgroup.oneskyit.com
dev-chow.oneskyit.com *.dev-chow.oneskyit.com
dev-cmsc.oneskyit.com *.dev-cmsc.oneskyit.com dev-cmsc.oneskyit.com *.dev-cmsc.oneskyit.com
dev-idaa.oneskyit.com *.dev-idaa.oneskyit.com dev-idaa.oneskyit.com *.dev-idaa.oneskyit.com
dev-ishlt.oneskyit.com *.dev-ishlt.oneskyit.com dev-ishlt.oneskyit.com *.dev-ishlt.oneskyit.com
dev-lci.oneskyit.com *.dev-lci.oneskyit.com
dev-ncsd.oneskyit.com *.dev-ncsd.oneskyit.com dev-ncsd.oneskyit.com *.dev-ncsd.oneskyit.com
dev-npa.oneskyit.com *.dev-npa.oneskyit.com dev-npa.oneskyit.com *.dev-npa.oneskyit.com
dev-rli.oneskyit.com *.dev-rli.oneskyit.com dev-rli.oneskyit.com *.dev-rli.oneskyit.com
sr-app.oneskyit.com
# sr-connect.oneskyit.com *.sr-connect.oneskyit.com
# sr-demo.oneskyit.com *.sr-demo.oneskyit.com
# sr-aacc.oneskyit.com *.sr-aacc.oneskyit.com
# sr-aapor.oneskyit.com *.sr-aapor.oneskyit.com
# sr-businessgroup.oneskyit.com *.sr-businessgroup.oneskyit.com
# sr-cmsc.oneskyit.com *.sr-cmsc.oneskyit.com
# sr-lci.oneskyit.com *.sr-lci.oneskyit.com
# sr-ncsd.oneskyit.com *.sr-ncsd.oneskyit.com
test-app.oneskyit.com test-app.oneskyit.com
# test-idaa.oneskyit.com *.test-idaa.oneskyit.com
# test-ishlt.oneskyit.com *.test-ishlt.oneskyit.com
; ;
access_log /logs/nginx/access_flask_gunicorn.log; access_log /logs/nginx/access_flask_gunicorn.log;
error_log /logs/nginx/error_flask_gunicorn.log; error_log /logs/nginx/error_flask_gunicorn.log;
client_max_body_size 5120M; #4096M or 4G; 5120M or 5G; client_max_body_size ${OSIT_WEB_MAX_BODY_SIZE}; # 5120M; #4096M or 4G; 5120M or 5G;
location / { location / {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
@@ -51,27 +69,46 @@ server {
server { server {
listen 443 ssl; listen 443 ssl;
listen [::]:443 ssl http2; listen [::]:443 ssl;
# The Docker nginx envsubst with templates does not work for multiple server names.
# server_name
# ${NGINX_SERVER_NAMES}
# ;
server_name server_name
${DOCKER_AE_APP_SERVER_NAME}
flask_gunicorn.localhost demo.localhost dev.localhost flask_gunicorn.localhost demo.localhost dev.localhost
dev.oneskyit.com
dev-app.oneskyit.com dev-app.oneskyit.com
dev-connect.oneskyit.com *.dev-connect.oneskyit.com dev-connect.oneskyit.com *.dev-connect.oneskyit.com
dev-demo.oneskyit.com *.dev-demo.oneskyit.com dev-demo.oneskyit.com *.dev-demo.oneskyit.com
dev-aacc.oneskyit.com *.dev-aacc.oneskyit.com
dev-aapor.oneskyit.com *.dev-aapor.oneskyit.com dev-aapor.oneskyit.com *.dev-aapor.oneskyit.com
dev-businessgroup.oneskyt.com *.dev-businessgroup.oneskyt.com dev-businessgroup.oneskyit.com *.dev-businessgroup.oneskyit.com
dev-chow.oneskyit.com *.dev-chow.oneskyit.com
dev-cmsc.oneskyit.com *.dev-cmsc.oneskyit.com dev-cmsc.oneskyit.com *.dev-cmsc.oneskyit.com
dev-idaa.oneskyit.com *.dev-idaa.oneskyit.com dev-idaa.oneskyit.com *.dev-idaa.oneskyit.com
dev-ishlt.oneskyit.com *.dev-ishlt.oneskyit.com dev-ishlt.oneskyit.com *.dev-ishlt.oneskyit.com
dev-lci.oneskyit.com *.dev-lci.oneskyit.com
dev-ncsd.oneskyit.com *.dev-ncsd.oneskyit.com dev-ncsd.oneskyit.com *.dev-ncsd.oneskyit.com
dev-npa.oneskyit.com *.dev-npa.oneskyit.com dev-npa.oneskyit.com *.dev-npa.oneskyit.com
dev-rli.oneskyit.com *.dev-rli.oneskyit.com dev-rli.oneskyit.com *.dev-rli.oneskyit.com
sr-app.oneskyit.com
# sr-connect.oneskyit.com *.sr-connect.oneskyit.com
# sr-demo.oneskyit.com *.sr-demo.oneskyit.com
# sr-aacc.oneskyit.com *.sr-aacc.oneskyit.com
# sr-aapor.oneskyit.com *.sr-aapor.oneskyit.com
# sr-businessgroup.oneskyit.com *.sr-businessgroup.oneskyit.com
# sr-cmsc.oneskyit.com *.sr-cmsc.oneskyit.com
# sr-lci.oneskyit.com *.sr-lci.oneskyit.com
# sr-ncsd.oneskyit.com *.sr-ncsd.oneskyit.com
test-app.oneskyit.com test-app.oneskyit.com
# test-idaa.oneskyit.com *.test-idaa.oneskyit.com
# test-ishlt.oneskyit.com *.test-ishlt.oneskyit.com
; ;
access_log /logs/nginx/access_flask_gunicorn.log; access_log /logs/nginx/access_flask_gunicorn.log;
@@ -86,7 +123,7 @@ server {
# include brotli.conf; # include brotli.conf;
# include gzip.conf; # include gzip.conf;
client_max_body_size 5120M; #4096M or 4G; 5120M or 5G; client_max_body_size ${OSIT_WEB_MAX_BODY_SIZE}; # 5120M; #4096M or 4G; 5120M or 5G;
location / { location / {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;

View File

@@ -1,150 +1,100 @@
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name oneskyit.localhost;
access_log /logs/nginx/access_oneskyit.log; server_name dev-docker.oneskyit.com test-docker.oneskyit.com prod-docker.oneskyit.com ${DOCKER_OSIT_SERVER_NAME};
# server_name oneskyit.localhost;
# Do not overflow the SSL send buffer (causes extra round trips) access_log /logs/nginx/access_oneskyit.log;
#ssl_buffer_size 8k;
root /srv/oneskyit_site; # Do not overflow the SSL send buffer (causes extra round trips)
#ssl_buffer_size 8k;
index index.php index.html;
# index index.html index.htm index.php;
# include php.conf;
# include brotli.conf;
# include gzip.conf;
# include expires.conf;
# These two locations remove .html and .php from filenames.
location / {
try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
}
location ~ \.php$ {
root /srv/oneskyit_site; root /srv/oneskyit_site;
index index.php index.html;
# index index.html index.htm index.php; # index index.html index.htm index.php;
try_files $uri =404; # include php.conf;
# try_files $uri $document_root$fastcgi_script_name =404; # include brotli.conf;
# include gzip.conf;
# include expires.conf;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php7:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
# location ~ \.php$ {
# try_files $uri =404;
# }
}
# # Redirect http to https
# server {
# listen 80;
# listen [::]:80;
# server_name oneskyit.com;
# return 301 https://oneskyit.com$request_uri;
# }
#
# #upstream oneskyit {
# #least_conn;
# # ip_hash;
# #server localhost:8889;
# #server localhost:8889;
# #}
#
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name docker.oneskyit.com;
access_log /logs/nginx/access_oneskyit.log;
error_log /logs/nginx/error_oneskyit.log;
# Do not overflow the SSL send buffer (causes extra round trips)
#ssl_buffer_size 8k;
include /etc/nginx/options-ssl-nginx.conf;
ssl_certificate /etc/certs/fullchain.pem;
ssl_certificate_key /etc/certs/privkey.pem;
ssl_dhparam /etc/certs/ssl-dhparams.pem;
root /srv/oneskyit_site;
index index.php index.html;
#
# root /srv/http/oneskyit.com/;
# index index.php index.html;
#
# include php.conf;
# include brotli.conf;
# include gzip.conf;
# include expires.conf;
#
# These two locations remove .html and .php from filenames. # These two locations remove .html and .php from filenames.
location / { location / {
try_files $uri $uri/ $uri.html $uri.php$is_args$query_string; try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
} }
location ~ \.php$ { location ~ \.php$ {
root /srv/oneskyit_site; root /srv/oneskyit_site;
# index index.html index.htm index.php; # index index.html index.htm index.php;
try_files $uri =404; try_files $uri =404;
# try_files $uri $document_root$fastcgi_script_name =404; # try_files $uri $document_root$fastcgi_script_name =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php7:9000; fastcgi_pass php7:9000;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
} }
} }
# location ~ \.php$ {
# try_files $uri =404; server {
# } listen 443 ssl;
# listen [::]:443 ssl;
# #location / {
# # include uwsgi_params; # server_name docker.oneskyit.com ${DOCKER_OSIT_SERVER_NAME};
# # #uwsgi_pass oneskyit; server_name docker.oneskyit.com dev-docker.oneskyit.com test-docker.oneskyit.com prod-docker.oneskyit.com ${DOCKER_OSIT_SERVER_NAME};
# # proxy_pass http://oneskyit; # server_name docker.oneskyit.com dev.oneskyit.com test.oneskyit.com prod.oneskyit.com;
# # #uwsgi_pass uwsgi://oneskyit.com:8889; # server_name docker.oneskyit.com;
# #
# # #proxy_pass http://apptest; access_log /logs/nginx/access_oneskyit.log;
# # #uwsgi_pass uwsgi://oneskyit.com:8890; error_log /logs/nginx/error_oneskyit.log;
# # #uwsgi_pass uwsgi://oneskyit.com:8889;
# #} # Do not overflow the SSL send buffer (causes extra round trips)
# #ssl_buffer_size 8k;
# ssl_certificate /etc/letsencrypt/live/oneskyit.com/fullchain.pem; # managed by Certbot
# #ssl_certificate /etc/letsencrypt/live/oneskyit.com-0001/fullchain.pem; # managed by Certbot include /etc/nginx/options-ssl-nginx.conf;
# ssl_certificate_key /etc/letsencrypt/live/oneskyit.com/privkey.pem; # managed by Certbot
# #ssl_certificate_key /etc/letsencrypt/live/oneskyit.com-0001/privkey.pem; # managed by Certbot ssl_certificate /etc/certs/fullchain.pem;
# include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_certificate_key /etc/certs/privkey.pem;
# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot ssl_dhparam /etc/certs/ssl-dhparams.pem;
#
# #ssl_session_cache shared:SSL:5m; # was 1m (1 MB) root /srv/oneskyit_site;
# #ssl_session_timeout 1h; # was 5m (5 minutes)
# index index.php index.html;
# ssl_buffer_size 8k;
# #
# # root /srv/http/oneskyit.com/;
# if ($scheme != "https"){ # index index.php index.html;
# return 301 https://$host$request_uri; #
# } # managed by Certbot # include php.conf;
# # include brotli.conf;
# } # include gzip.conf;
# include expires.conf;
#
# These two locations remove .html and .php from filenames.
location / {
try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
}
location ~ \.php$ {
root /srv/oneskyit_site;
# index index.html index.htm index.php;
try_files $uri =404;
# try_files $uri $document_root$fastcgi_script_name =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php7:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}

View File

@@ -1,60 +1,114 @@
server { server {
listen 80; listen 80 default_server;
server_name docker.localhost docker.oneskyit.com; server_name _;
return 301 https://$host$request_uri;
}
# server {
# listen 80;
# server_name _;
#
# access_log /logs/nginx/access_docker.log;
# error_log /logs/nginx/error_docker.log;
#
# root /srv/html_php;
#
# index index.html index.htm index.php;
#
# # location / {
# # # root /usr/share/nginx/html;
# # index index.html index.htm;
# # }
#
# location ~ \.php$ {
# index index.html index.htm index.php;
#
# try_files $uri =404;
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_pass php7:9000;
# fastcgi_index index.php;
# include fastcgi_params;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_param PATH_INFO $fastcgi_path_info;
# }
#
# #error_page 404 /404.html;
#
# # redirect server error pages to the static page /50x.html
# #
# # error_page 500 502 503 504 /50x.html;
# # location = /50x.html {
# # root /usr/share/nginx/html;
# # }
#
# # proxy the PHP scripts to Apache listening on 127.0.0.1:80
# #
# #location ~ \.php$ {
# # proxy_pass http://127.0.0.1;
# #}
#
# # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
# #
# #location ~ \.php$ {
# # root html;
# # fastcgi_pass 127.0.0.1:9000;
# # fastcgi_index index.php;
# # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# # include fastcgi_params;
# #}
#
# # deny access to .htaccess files, if Apache's document root
# # concurs with nginx's one
# #
# #location ~ /\.ht {
# # deny all;
# #}
# }
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name _;
access_log /logs/nginx/access_docker.log;
error_log /logs/nginx/error_docker.log; error_log /logs/nginx/error_docker.log;
access_log /logs/nginx/access_docker.log;
root /srv/html_php; # Do not overflow the SSL send buffer (causes extra round trips)
# ssl_buffer_size 8k;
index index.html index.htm index.php; include /etc/nginx/options-ssl-nginx.conf;
# location / { ssl_certificate /etc/certs/fullchain.pem;
# # root /usr/share/nginx/html; ssl_certificate_key /etc/certs/privkey.pem;
# index index.html index.htm; ssl_dhparam /etc/certs/ssl-dhparams.pem;
# }
location ~ \.php$ { location / {
index index.html index.htm index.php; return 404;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php7:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
} }
#error_page 404 /404.html; # root /srv/html_php;
#
# redirect server error pages to the static page /50x.html # index index.php index.html;
# #
# error_page 500 502 503 504 /50x.html; # # These two locations remove .html and .php from filenames.
# location = /50x.html { # location / {
# root /usr/share/nginx/html; # try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
# } # }
#
# proxy the PHP scripts to Apache listening on 127.0.0.1:80 # location ~ \.php$ {
# # root /srv/html_php;
#location ~ \.php$ { #
# proxy_pass http://127.0.0.1; # # index index.html index.htm index.php;
#} #
# try_files $uri =404;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # # try_files $uri $document_root$fastcgi_script_name =404;
# #
#location ~ \.php$ { # fastcgi_split_path_info ^(.+\.php)(/.+)$;
# root html; # fastcgi_pass php7:9000;
# fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php;
# fastcgi_index index.php; # include fastcgi_params;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# include fastcgi_params; # fastcgi_param PATH_INFO $fastcgi_path_info;
#} # }
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} }

View File

@@ -3,7 +3,7 @@ version: "3.9"
services: services:
web: web:
restart: unless-stopped restart: unless-stopped
container_name: ae_web_dev container_name: ${CONTAINER_WEB}
build: build:
# context: ./builds # context: ./builds
context: ./ context: ./
@@ -11,8 +11,13 @@ services:
env_file: env_file:
- ./.env - ./.env
environment: environment:
# This does not seem to work (yet???) # NOTE: This does not seem to work with nginx yet???
- AE_DOMAIN_LIST:'dev-aapor.oneskyit.com dev-businessgroup.oneskyt.com dev-cmsc.oneskyit.com dev-idaa.oneskyit.com dev-ishlt.oneskyit.com dev-ncsd.oneskyit.com dev-npa.oneskyit.com dev-rli.oneskyit.com' # NOTE: Use the template directory and .template extension for the .conf files.
# - NGINX_SERVER_NAMES="dev-demo.oneskyit.com dev-example.oneskyit.com"
# - NGINX_SERVER_NAMES="dev-idaa.oneskyit.com dev-ishlt.oneskyit.com"
# - AE_DOMAIN_LIST:'dev-aapor.oneskyit.com dev-businessgroup.oneskyt.com dev-cmsc.oneskyit.com dev-idaa.oneskyit.com dev-ishlt.oneskyit.com dev-ncsd.oneskyit.com dev-npa.oneskyit.com dev-rli.oneskyit.com'
# - NGINX_SERVER_NAMES="flask_gunicorn.localhost demo.localhost dev.localhost dev.oneskyit.com dev-app.oneskyit.com dev-connect.oneskyit.com *.dev-connect.oneskyit.com dev-demo.oneskyit.com *.dev-demo.oneskyit.com dev-aapor.oneskyit.com *.dev-aapor.oneskyit.com dev-businessgroup.oneskyt.com *.dev-businessgroup.oneskyt.com dev-cmsc.oneskyit.com *.dev-cmsc.oneskyit.com dev-idaa.oneskyit.com *.dev-idaa.oneskyit.com dev-ishlt.oneskyit.com *.dev-ishlt.oneskyit.com dev-ncsd.oneskyit.com *.dev-ncsd.oneskyit.com dev-npa.oneskyit.com *.dev-npa.oneskyit.com dev-rli.oneskyit.com *.dev-rli.oneskyit.com test-app.oneskyit.com"
- NGINX_SERVER_NAMES="flask_gunicorn.localhost demo.localhost dev.localhost dev.oneskyit.com dev-app.oneskyit.com dev-connect.oneskyit.com dev-demo.oneskyit.com dev-aacc.oneskyit.com dev-aapor.oneskyit.com dev-businessgroup.oneskyt.com dev-chow.oneskyit.com dev-cmsc.oneskyit.com dev-idaa.oneskyit.com dev-ishlt.oneskyit.com dev-lci.oneskyit.com dev-ncsd.oneskyit.com dev-npa.oneskyit.com dev-rli.oneskyit.com test-app.oneskyit.com"
ports: ports:
- "${OSIT_WEB_HTTP_PORT}:80" - "${OSIT_WEB_HTTP_PORT}:80"
- "${OSIT_WEB_HTTPS_PORT}:443" - "${OSIT_WEB_HTTPS_PORT}:443"
@@ -36,29 +41,34 @@ services:
# - ./srv/nextcloud/config:/var/www/html/config # - ./srv/nextcloud/config:/var/www/html/config
# - ./srv/nextcloud/data:/var/www/html/data # - ./srv/nextcloud/data:/var/www/html/data
# - ./conf/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./conf/nginx/options-ssl-nginx.conf:/etc/nginx/options-ssl-nginx.conf - ./conf/nginx/options-ssl-nginx.conf:/etc/nginx/options-ssl-nginx.conf
- ./conf/nginx/site.conf:/etc/nginx/conf.d/site.conf # - ./conf/nginx/other.conf:/etc/nginx/conf.d/other.conf
- ./conf/nginx/site.conf:/etc/nginx/conf.d/0_site.conf
# - ./conf/nginx/site-enabled_aether-phpmyadmin.conf:/etc/nginx/conf.d/site-enabled_aether-phpmyadmin.conf
# - ./conf/nginx/site-enabled_aether-mailman2.conf:/etc/nginx/conf.d/site-enabled_aether-mailman2.conf # - ./conf/nginx/site-enabled_aether-mailman2.conf:/etc/nginx/conf.d/site-enabled_aether-mailman2.conf
# - ./conf/nginx/site-enabled_aether-nextcloud.conf:/etc/nginx/conf.d/site-enabled_aether-nextcloud.conf # - ./conf/nginx/site-enabled_aether-nextcloud.conf:/etc/nginx/conf.d/site-enabled_aether-nextcloud.conf
# - ./conf/nginx/site-enabled_aether-phpmyadmin.conf:/etc/nginx/templates/site-enabled_aether-phpmyadmin.conf.template
- ./conf/nginx/site-enabled_oneskyit.conf:/etc/nginx/conf.d/site-enabled_oneskyit.conf # - ./conf/nginx/site-enabled_oneskyit.conf:/etc/nginx/conf.d/site-enabled_oneskyit.conf
- ./conf/nginx/site-enabled_oneskyit.conf:/etc/nginx/templates/site-enabled_oneskyit.conf.template
- ./conf/nginx/site-enabled_aether_fastapi_gunicorn.conf:/etc/nginx/conf.d/site-enabled_aether_fastapi_gunicorn.conf - ./conf/nginx/site-enabled_aether_fastapi_gunicorn.conf:/etc/nginx/templates/site-enabled_aether_fastapi_gunicorn.conf.template
# - ./conf/nginx/site-enabled_aether_fastapi_2_gunicorn.conf:/etc/nginx/conf.d/site-enabled_aether_fastapi_2_gunicorn.conf # - ./conf/nginx/site-enabled_aether_api_v5_fastapi_gunicorn.conf:/etc/nginx/templates/site-enabled_aether_api_v5_fastapi_gunicorn.conf.template
- ./conf/nginx/site-enabled_aether_flask_gunicorn.conf:/etc/nginx/conf.d/site-enabled_aether_flask_gunicorn.conf - ./conf/nginx/site-enabled_aether_flask_gunicorn.conf:/etc/nginx/templates/site-enabled_aether_flask_gunicorn.conf.template
- ./conf/certs/fullchain.pem:/etc/certs/fullchain.pem - ./conf/certs/oneskyit.com_fullchain.pem:/etc/certs/fullchain.pem
- ./conf/certs/privkey.pem:/etc/certs/privkey.pem - ./conf/certs/oneskyit.com_privkey.pem:/etc/certs/privkey.pem
- ./conf/certs/ssl-dhparams.pem:/etc/certs/ssl-dhparams.pem - ./conf/certs/ssl-dhparams.pem:/etc/certs/ssl-dhparams.pem
- ./logs/web:/logs - ./logs/web:/logs
# volumes_from: # volumes_from:
# - nextcloud25 # - nextcloud25
depends_on: depends_on:
- php7 # - php7
- aether_api_gunicorn - aether_api_gunicorn
# - aether_api_v5_gunicorn
- aether_app_gunicorn - aether_app_gunicorn
# links: # links:
# # - nextcloud25 # # - nextcloud25
@@ -128,7 +138,7 @@ services:
# # - local-net # # - local-net
php7: php7:
restart: always restart: always
container_name: ae_php7_dev container_name: ${CONTAINER_PHP7}
# image: php:fpm # image: php:fpm
build: build:
context: ./ context: ./
@@ -146,46 +156,46 @@ services:
# networks: # networks:
# - local-net # - local-net
phpmyadmin: # phpmyadmin:
image: phpmyadmin # image: phpmyadmin
container_name: ae_phpmyadmin # container_name: ae_phpmyadmin
restart: unless-stopped # restart: unless-stopped
depends_on: # depends_on:
- mariadb # - mariadb
ports: # ports:
- 8888:80 # - 8888:80
env_file: # env_file:
- ./.env # - ./.env
environment: # environment:
- PMA_ARBITRARY=1 # - PMA_ARBITRARY=1
- UPLOAD_LIMIT=1G # - UPLOAD_LIMIT=1G
mariadb: # mariadb:
container_name: ae_mariadb_dev # container_name: ae_mariadb_dev
# image: mariadb/server:latest # # image: mariadb/server:latest
image: mariadb:10.9 # image: mariadb:10.9
# image: mariadb:10.6 # # image: mariadb:10.6
restart: always # restart: unless-stopped
# env_file: # # env_file:
# - ./.env # # - ./.env
# - filename.env # # - filename.env
ports: # # ports:
- "3307:3306" # # - "3307:3306"
volumes: # volumes:
- ./srv/mariadb:/var/lib/mysql # - ./srv/mariadb:/var/lib/mysql
# - ./conf/mariadb/password_reset.sql:/docker-entrypoint-initdb.d/init.sql:ro # # - ./conf/mariadb/password_reset.sql:/docker-entrypoint-initdb.d/init.sql:ro
# - ./conf/mariadb/password_reset.sql:/password_reset.sql:z # # - ./conf/mariadb/password_reset.sql:/password_reset.sql:z
# - ./srv/mariadb_ln:/var/lib/mysql # # - ./srv/mariadb_ln:/var/lib/mysql
# - ./conf/mariadb/my.cnf:/etc/my.cnf # # - ./conf/mariadb/my.cnf:/etc/my.cnf
# environment: # environment:
# - MARIADB_ROOT_PASSWORD=$$1sky.Adapting.7e2 # - MARIADB_ROOT_PASSWORD=$$1sky.Adapting.7e2
# - MARIADB_ROOT_PASSWORD=CentauriStar123 # # - MARIADB_ROOT_PASSWORD=CentauriStar123
# - MARIADB_DATABASE: 'my_env_db' # # - MARIADB_DATABASE: 'my_env_db'
# - MYSQL_ROOT_PASSWORD=$$1sky.Adapting.7e2 # # - MYSQL_ROOT_PASSWORD=$$1sky.Adapting.7e2
# - MYSQL_ROOT_PASSWORD=CentauriStar123 # # - MYSQL_ROOT_PASSWORD=CentauriStar123
# - MYSQL_PASSWORD=MyPassword # # - MYSQL_PASSWORD=MyPassword
# - MYSQL_DATABASE=nextcloud # # - MYSQL_DATABASE=nextcloud
# - MYSQL_USER=nextcloud # # - MYSQL_USER=nextcloud
# nextcloud25: # nextcloud25:
# container_name: ae_nextcloud25_dev # container_name: ae_nextcloud25_dev
@@ -214,16 +224,17 @@ services:
# - NEXTCLOUD_TRUSTED_DOMAINS=oneskyit.com # - NEXTCLOUD_TRUSTED_DOMAINS=oneskyit.com
redis: redis:
container_name: ae_redis_dev restart: always
container_name: ${CONTAINER_REDIS}
image: redis image: redis
ports: ports:
# host to image # host to image
# default port is 6379 # default port is 6379
- "6389:6379" - "${AE_REDIS_PORT}:6379"
aether_api_gunicorn: aether_api_gunicorn:
restart: always restart: always
container_name: ae_api_dev container_name: ${CONTAINER_AE_API}
build: build:
# context: ./builds # context: ./builds
context: ./ context: ./
@@ -231,13 +242,14 @@ services:
env_file: env_file:
- ./.env - ./.env
ports: ports:
- "5065:5005" - "${AE_API_GUNICORN_PORT}:5005"
# expose: # expose:
# - 5005 # - 5005
# networks: # networks:
# - local-net # - local-net
volumes: volumes:
- ./conf/aether_fastapi_gunicorn_conf.py:/conf/gunicorn_fastapi_conf.py - ./conf/aether_fastapi_gunicorn_conf.py:/conf/gunicorn_fastapi_conf.py
- ./conf/aether_fastapi_requirements_current.txt:/requirements_current.txt
- ./conf/aether_api_config.py:/srv/aether_api/app/config.py - ./conf/aether_api_config.py:/srv/aether_api/app/config.py
- ./logs/ae_api:/logs - ./logs/ae_api:/logs
@@ -255,6 +267,11 @@ services:
- ./srv/aether_api_ln:/srv/aether_api - ./srv/aether_api_ln:/srv/aether_api
- ./srv/hosted_files_ln:/srv/hosted_files - ./srv/hosted_files_ln:/srv/hosted_files
- ./srv/hosted_tmp_ln:/srv/hosted_tmp - ./srv/hosted_tmp_ln:/srv/hosted_tmp
# - ./tmp/ae_api:/tmp
- ./temp/ae_api:/temp
# - ./temp/ae_api/aether_fastapi_requirements_current.txt:/temp/requirements_current.txt
# links: # links:
# - redis # - redis
depends_on: depends_on:
@@ -262,9 +279,42 @@ services:
stdin_open: true # docker run -i stdin_open: true # docker run -i
tty: true # docker run -t tty: true # docker run -t
# aether_api_v5_gunicorn:
# restart: always
# container_name: ae_api_v5_dev
# build:
# # context: ./builds
# context: ./
# dockerfile: aether_api_v5_fastapi_gunicorn.Dockerfile
# env_file:
# - ./.env
# ports:
# - "5067:5005"
# volumes:
# - ./conf/aether_api_v5_fastapi_gunicorn_conf.py:/conf/gunicorn_fastapi_conf.py
# - ./conf/aether_api_v5_fastapi_requirements_current.txt:/conf/requirements_current.txt
# - ./conf/aether_api_v5_fastapi_config.py:/srv/aether_api/app/config.py
#
# - ./logs/ae_api_v5:/logs
#
# - ./srv/aether_api_v5_ln:/srv/aether_api
# - ./srv/hosted_files_ln:/srv/hosted_files
# - ./srv/hosted_tmp_ln:/srv/hosted_tmp
#
# # - ./tmp/ae_api:/tmp
#
# - ./temp/ae_api:/temp
# # - ./temp/ae_api/aether_fastapi_requirements_current.txt:/temp/requirements_current.txt
# # links:
# # - redis
# depends_on:
# - redis
# stdin_open: true # docker run -i
# tty: true # docker run -t
aether_app_gunicorn: aether_app_gunicorn:
restart: always restart: always
container_name: ae_app_dev container_name: ${CONTAINER_AE_APP}
build: build:
# context: ./builds # context: ./builds
context: ./ context: ./
@@ -273,16 +323,18 @@ services:
env_file: env_file:
- ./.env - ./.env
ports: ports:
- "5055:5005" - "${AE_APP_GUNICORN_PORT}:5005"
# expose: # expose:
# - 5005 # - 5005
# networks: # networks:
# - local-net # - local-net
extra_hosts: extra_hosts:
# - dev-api.oneskyit.com:192.168.32.20 # - dev-api.oneskyit.com:192.168.32.20
- "${DOCKER_AE_APP_EXTRA_HOST}" - "${DOCKER_AE_API_SERVER_EXTRA_HOST}"
- "${DOCKER_AE_API_V5_SERVER_EXTRA_HOST}"
volumes: volumes:
- ./conf/aether_flask_gunicorn_conf.py:/conf/gunicorn_flask_conf.py - ./conf/aether_flask_gunicorn_conf.py:/conf/gunicorn_flask_conf.py
- ./conf/aether_flask_requirements_current.txt:/requirements_current.txt
- ./conf/aether_app_config.py:/srv/aether_app/flask_config_v2.py - ./conf/aether_app_config.py:/srv/aether_app/flask_config_v2.py
- ./logs/ae_app:/logs - ./logs/ae_app:/logs
# - ./logs/aether_flask_gunicorn_access.log:/logs/gunicorn_access.log # - ./logs/aether_flask_gunicorn_access.log:/logs/gunicorn_access.log
@@ -292,6 +344,8 @@ services:
- ./srv/aether_app_ln:/srv/aether_app - ./srv/aether_app_ln:/srv/aether_app
- ./srv/hosted_files_ln:/srv/hosted_files - ./srv/hosted_files_ln:/srv/hosted_files
- ./srv/hosted_tmp_ln:/srv/hosted_tmp - ./srv/hosted_tmp_ln:/srv/hosted_tmp
- ./tmp/ae_app:/tmp
depends_on: depends_on:
- aether_api_gunicorn - aether_api_gunicorn
stdin_open: true # docker run -i stdin_open: true # docker run -i
@@ -300,3 +354,7 @@ services:
# networks: # networks:
# local-net: # local-net:
# driver: bridge # driver: bridge
# volumes:
# ./tmp/ae_app:
# external: true

4
logs/ae_api_v5/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except for this file
!.gitignore

View File

@@ -7,6 +7,14 @@ Create links to the actual directories as needed
* ./srv/oneskyit_site * ./srv/oneskyit_site
* ./srv/static_files * ./srv/static_files
git clone https://scott_idem@bitbucket.org/oneskyit/one-sky-it-api-fastapi.git /srv/http/aether_api_fastapi/
git pull origin development
git clone https://scott_idem@bitbucket.org/oneskyit/one-sky-it-app.git /srv/http/aether_app/
git pull origin development
git status
## Create links examples ## Create links examples
### Flask App ### Flask App
```bash ```bash
@@ -25,6 +33,9 @@ ln -s ~/OSIT_dev/aether_api_fastapi ~/OSIT_dev/aether_container_env/srv/aether_a
ln -s /mnt/data/speaker_ready/hosted_tmp /srv/env/test_aether/srv/hosted_tmp_ln ln -s /mnt/data/speaker_ready/hosted_tmp /srv/env/test_aether/srv/hosted_tmp_ln
ln -s /mnt/data_drive/srv/data/osit_app/hosted_tmp /home/scott/OSIT_dev/aether_container_env/srv/hosted_tmp_ln ln -s /mnt/data_drive/srv/data/osit_app/hosted_tmp /home/scott/OSIT_dev/aether_container_env/srv/hosted_tmp_ln
ln -s /mnt/data_drive/srv/data/osit_app/hosted_tmp_dev /home/scott/OSIT_dev/aether_container_env/srv/hosted_tmp_ln ln -s /mnt/data_drive/srv/data/osit_app/hosted_tmp_dev /home/scott/OSIT_dev/aether_container_env/srv/hosted_tmp_ln
# scott-laptop-main:
ln -s /data/OSIT/hosted_tmp /home/scott/OSIT_dev/aether_container_env/srv/hosted_tmp_ln
``` ```
### Hosted (hashed) files ### Hosted (hashed) files
@@ -32,6 +43,9 @@ ln -s /mnt/data_drive/srv/data/osit_app/hosted_tmp_dev /home/scott/OSIT_dev/aeth
ln -s /mnt/data/speaker_ready/hosted_files /srv/env/test_aether/srv/hosted_files_ln ln -s /mnt/data/speaker_ready/hosted_files /srv/env/test_aether/srv/hosted_files_ln
ln -s /mnt/data_drive/srv/data/osit_app/hosted_files /home/scott/OSIT_dev/aether_container_env/srv/hosted_files_ln ln -s /mnt/data_drive/srv/data/osit_app/hosted_files /home/scott/OSIT_dev/aether_container_env/srv/hosted_files_ln
ln -s /mnt/data_drive/srv/data/osit_app/hosted_files_dev /home/scott/OSIT_dev/aether_container_env/srv/hosted_files_ln ln -s /mnt/data_drive/srv/data/osit_app/hosted_files_dev /home/scott/OSIT_dev/aether_container_env/srv/hosted_files_ln
# scott-laptop-main:
ln -s /data/OSIT/hosted_files /home/scott/OSIT_dev/aether_container_env/srv/hosted_files_ln
``` ```
### MariaDB ### MariaDB

1
srv/aether_api_v5_ln Symbolic link
View File

@@ -0,0 +1 @@
/home/scott/OSIT_dev/aether_api_v5_fastapi