-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48a9ef6
commit e1572b8
Showing
18 changed files
with
198 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
api: gunicorn -c api/gunicorn_config.py wsgi_api | ||
file_server: gunicorn -c file_server/gunicorn_config.py wsgi_file_server |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import os | ||
|
||
from api.settings import HOST, PORT, WORKERS, TIMEOUT | ||
|
||
bind = '{}:{}'.format(HOST, PORT) | ||
workers = WORKERS | ||
|
||
accesslog = '-' | ||
access_log_format = '%(m)s %(U)s status=%(s)s time=%(T)ss size=%(B)sb' | ||
|
||
reload = 'SAMS_RELOAD' in os.environ | ||
|
||
timeout = TIMEOUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8; -*- | ||
# | ||
# This file is part of SAMS. | ||
# | ||
# Copyright 2020 Sourcefabric z.u. and contributors. | ||
# | ||
# For the full copyright and license information, please see the | ||
# AUTHORS and LICENSE files distributed with this source code, or | ||
# at https://www.sourcefabric.org/superdesk/license | ||
|
||
version: 1 | ||
disable_existing_loggers: True | ||
formatters: | ||
simple: | ||
format: '%(asctime)s level=%(levelname)s pid=%(process)d function=%(name)s:%(module)s:%(funcName)s %(message)s' | ||
handlers: | ||
console: | ||
class: logging.StreamHandler | ||
stream : ext://sys.stdout | ||
formatter: simple | ||
loggers: | ||
sams: | ||
handlers: [console] | ||
level: DEBUG | ||
propagate: no | ||
werkzeug: | ||
handlers: [console] | ||
level: DEBUG | ||
propagate: no | ||
superdesk: | ||
handlers: [console] | ||
level: DEBUG | ||
propagate: no | ||
root: | ||
handlers: [console] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import multiprocessing | ||
from os import path | ||
from pathlib import Path | ||
|
||
from sams.default_settings import env | ||
|
||
ABS_PATH = str(Path(__file__).resolve().parent) | ||
|
||
#: hostname the API runs on | ||
HOST = env('SAMS_API_HOST', 'localhost') | ||
|
||
#: port the API runs on | ||
PORT = int(env('SAMS_API_PORT', '5700')) | ||
|
||
#: full url for this API | ||
SERVER_URL = env('SAMS_API_URL', f'http://{HOST}:{PORT}') | ||
|
||
#: Gunicorn workers/timeout | ||
WORKERS = int(env('SAMS_API_WORKERS', env('WEB_CONCURRENCY', multiprocessing.cpu_count() + 1))) | ||
TIMEOUT = int(env('SAMS_API_TIMEOUT', env('WEB_TIMEOUT', 30))) | ||
|
||
#: Type of authentication to use | ||
SAMS_AUTH_TYPE = 'sams.auth.public' | ||
|
||
#: Location of the log file | ||
LOG_CONFIG_FILE = path.join(ABS_PATH, 'logging_config.yml') | ||
|
||
#: Maximum upload size of an Asset | ||
MAX_ASSET_SIZE = int(env('SAMS_MAX_ASSET_SIZE', '0')) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import os | ||
|
||
from file_server.settings import HOST, PORT, WORKERS, TIMEOUT | ||
|
||
bind = '{}:{}'.format(HOST, PORT) | ||
workers = WORKERS | ||
|
||
accesslog = '-' | ||
access_log_format = '%(m)s %(U)s status=%(s)s time=%(T)ss size=%(B)sb' | ||
|
||
reload = 'SAMS_RELOAD' in os.environ | ||
|
||
timeout = TIMEOUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8; -*- | ||
# | ||
# This file is part of SAMS. | ||
# | ||
# Copyright 2020 Sourcefabric z.u. and contributors. | ||
# | ||
# For the full copyright and license information, please see the | ||
# AUTHORS and LICENSE files distributed with this source code, or | ||
# at https://www.sourcefabric.org/superdesk/license | ||
|
||
version: 1 | ||
disable_existing_loggers: True | ||
formatters: | ||
simple: | ||
format: '%(asctime)s level=%(levelname)s pid=%(process)d function=%(name)s:%(module)s:%(funcName)s %(message)s' | ||
handlers: | ||
console: | ||
class: logging.StreamHandler | ||
stream : ext://sys.stdout | ||
formatter: simple | ||
loggers: | ||
sams: | ||
handlers: [console] | ||
level: DEBUG | ||
propagate: no | ||
werkzeug: | ||
handlers: [console] | ||
level: DEBUG | ||
propagate: no | ||
superdesk: | ||
handlers: [console] | ||
level: DEBUG | ||
propagate: no | ||
root: | ||
handlers: [console] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import multiprocessing | ||
from os import path | ||
from pathlib import Path | ||
|
||
from sams.default_settings import env | ||
|
||
ABS_PATH = str(Path(__file__).resolve().parent) | ||
|
||
#: hostname the FileServer runs on | ||
HOST = env('SAMS_PUBLIC_HOST', '0.0.0.0') | ||
|
||
#: port the FileServer runs on | ||
PORT = int(env('SAMS_PUBLIC_PORT', '5750')) | ||
|
||
#: full url for the FileServer | ||
SERVER_URL = env('SAMS_API_URL', f'http://{HOST}:{PORT}') | ||
|
||
#: Gunicorn workers/timeout | ||
WORKERS = int(env('SAMS_PUBLIC_WORKERS', env('WEB_CONCURRENCY', multiprocessing.cpu_count() + 1))) | ||
TIMEOUT = int(env('SAMS_PUBLIC_TIMEOUT', env('WEB_TIMEOUT', 30))) | ||
|
||
#: Type of authentication to use | ||
SAMS_AUTH_TYPE = 'sams.auth.basic' | ||
CLIENT_API_KEYS = env('SAMS_PUBLIC_API_KEYS') # Comma separated list of API Keys | ||
|
||
#: Location of the log file | ||
LOG_CONFIG_FILE = path.join(ABS_PATH, 'logging_config.yml') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
gunicorn>=20.0.4,<20.1 | ||
honcho==1.0.1 | ||
sams-server>=0.2.2,<0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from sams.default_settings import env | ||
|
||
# Common settings across both apps | ||
|
||
#: full mongodb connection uri | ||
MONGO_URI = env('SAMS_MONGO_URI', 'mongodb://localhost/sams') | ||
|
||
#: elastic url | ||
ELASTICSEARCH_URL = env('SAMS_ELASTICSEARCH_URL', 'http://localhost:9200') | ||
|
||
#: elastic index name | ||
ELASTICSEARCH_INDEX = env('SAMS_ELASTICSEARCH_INDEX', 'sams') | ||
|
||
#: Public URL used in `api` HATEOAS responses for downloading from the `file_server` | ||
SAMS_PUBLIC_URL = env('SAMS_PUBLIC_URL', 'http://localhost:5750') | ||
|
||
# Configure the StorageDestinations | ||
STORAGE_DESTINATION_1 = 'MongoGridFS,files,mongodb://localhost/sams_files' | ||
STORAGE_DESTINATION_2 = 'MongoGridFS,media,mongodb://localhost/sams_media' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from sams.apps.api.app import get_app | ||
from api import settings | ||
|
||
application = get_app(__name__, config=settings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from sams.apps.file_server.app import get_app | ||
from api import settings | ||
|
||
application = get_app(__name__, config=settings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,5 @@ | |
|
||
from .client import SamsClient # noqa | ||
|
||
__version__ = '0.2.2' | ||
__version__ = '0.2.3' | ||
__all__ = 'SamsClient' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters