forked from github/plane
fix: self hosted instance (#2795)
* dev: update create bucket script * dev: update patch endpoint for instance configuration * dev: add google client secret and default values for ADMIN_EMAIL and LICENSE_ENGINE_BASE_URL
This commit is contained in:
parent
779ef2a4aa
commit
9db6312081
@ -15,6 +15,6 @@ if [ "$ENABLE_REGISTRATION" != "0" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the default bucket
|
# Create the default bucket
|
||||||
python bin/bucket_script.py
|
python manage.py create_bucket
|
||||||
|
|
||||||
exec gunicorn -w $GUNICORN_WORKERS -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:8000 --max-requests 1200 --max-requests-jitter 1000 --access-logfile -
|
exec gunicorn -w $GUNICORN_WORKERS -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:8000 --max-requests 1200 --max-requests-jitter 1000 --access-logfile -
|
||||||
|
@ -230,13 +230,18 @@ class InstanceConfigurationEndpoint(BaseAPIView):
|
|||||||
return Response(serializer.data, status=status.HTTP_200_OK)
|
return Response(serializer.data, status=status.HTTP_200_OK)
|
||||||
|
|
||||||
def patch(self, request):
|
def patch(self, request):
|
||||||
key = request.data.get("key", False)
|
configurations = InstanceConfiguration.objects.filter(key__in=request.data.keys())
|
||||||
if not key:
|
|
||||||
return Response(
|
bulk_configurations = []
|
||||||
{"error": "Key is required"}, status=status.HTTP_400_BAD_REQUEST
|
for configuration in configurations:
|
||||||
)
|
configuration.value = request.data.get(configuration.key, configuration.value)
|
||||||
configuration = InstanceConfiguration.objects.get(key=key)
|
bulk_configurations.append(configuration)
|
||||||
configuration.value = request.data.get("value")
|
|
||||||
configuration.save()
|
InstanceConfiguration.objects.bulk_update(
|
||||||
serializer = InstanceConfigurationSerializer(configuration)
|
bulk_configurations,
|
||||||
|
["value"],
|
||||||
|
batch_size=100
|
||||||
|
)
|
||||||
|
|
||||||
|
serializer = InstanceConfigurationSerializer(configurations, many=True)
|
||||||
return Response(serializer.data, status=status.HTTP_200_OK)
|
return Response(serializer.data, status=status.HTTP_200_OK)
|
||||||
|
@ -15,6 +15,7 @@ class Command(BaseCommand):
|
|||||||
config_keys = {
|
config_keys = {
|
||||||
# Authentication Settings
|
# Authentication Settings
|
||||||
"GOOGLE_CLIENT_ID": os.environ.get("GOOGLE_CLIENT_ID"),
|
"GOOGLE_CLIENT_ID": os.environ.get("GOOGLE_CLIENT_ID"),
|
||||||
|
"GOOGLE_CLIENT_SECRET": os.environ.get("GOOGLE_CLIENT_SECRET"),
|
||||||
"GITHUB_CLIENT_ID": os.environ.get("GITHUB_CLIENT_ID"),
|
"GITHUB_CLIENT_ID": os.environ.get("GITHUB_CLIENT_ID"),
|
||||||
"GITHUB_CLIENT_SECRET": os.environ.get("GITHUB_CLIENT_SECRET"),
|
"GITHUB_CLIENT_SECRET": os.environ.get("GITHUB_CLIENT_SECRET"),
|
||||||
"ENABLE_SIGNUP": os.environ.get("ENABLE_SIGNUP", "1"),
|
"ENABLE_SIGNUP": os.environ.get("ENABLE_SIGNUP", "1"),
|
||||||
|
@ -13,6 +13,8 @@ x-app-env : &app-env
|
|||||||
- DOCKERIZED=${DOCKERIZED:-1} # deprecated
|
- DOCKERIZED=${DOCKERIZED:-1} # deprecated
|
||||||
- CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-""}
|
- CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-""}
|
||||||
- SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT:-"production"}
|
- SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT:-"production"}
|
||||||
|
- ADMIN_EMAIL=${ADMIN_EMAIL:-""}
|
||||||
|
- LICENSE_ENGINE_BASE_URL=${LICENSE_ENGINE_BASE_URL:-""}
|
||||||
# Gunicorn Workers
|
# Gunicorn Workers
|
||||||
- GUNICORN_WORKERS=${GUNICORN_WORKERS:-2}
|
- GUNICORN_WORKERS=${GUNICORN_WORKERS:-2}
|
||||||
#DB SETTINGS
|
#DB SETTINGS
|
||||||
|
@ -64,3 +64,9 @@ FILE_SIZE_LIMIT=5242880
|
|||||||
|
|
||||||
# Gunicorn Workers
|
# Gunicorn Workers
|
||||||
GUNICORN_WORKERS=2
|
GUNICORN_WORKERS=2
|
||||||
|
|
||||||
|
# Admin Email
|
||||||
|
ADMIN_EMAIL=""
|
||||||
|
|
||||||
|
# License Engine url
|
||||||
|
LICENSE_ENGINE_BASE_URL=""
|
Loading…
Reference in New Issue
Block a user