- Flask-driven REST API
- Runs on Python 3.11
Copyright 2018-2024 Svenska Litteratursällskapet i Finland, r.f.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
For full license text, see
LICENSE
file. -
Installation details:
- Create config files from _example files in
config
folder- Note that environment variables may be used in the YAML files if desired, they are parsed during startup.
- Ensure volume paths in
docker-compose.yml
point at the correct host and container folders - Add SSH private key contents to
ssh_key
file. - run
docker-compose build
in root folder containingDockerfile
anddocker-compose.yml
- Create config files from _example files in
-
Running in Production
- Add SSH private key contents to
ssh_key
file. - Start api using
docker-compose up -d
- Please note that the default port is 8000, this can be changed in
docker-compose.yml
- API can then be accessed at http://127.0.0.1:8000
- Add SSH private key contents to
-
Manually testing the API without Docker, using a python virtualenv (not recommended)
source /path/to/virtualenv/bin/activate
or/path/to/virtualenv/Scripts/activate_this.bat
on Windowspip install --upgrade -e .
export FLASK_APP=/path/to/sls_api
orset FLASK_APP=/path/to/sls_api
on Windowsexport FLASK_DEBUG=1
orset FLASK_DEBUG=1
on Windows to activate DEBUG mode- By using the user
test@test.com
with the passwordtest
, access to all projects in granted in DEBUG mode flask run
- note that this uses port 5000 by default
- Enables JWT-based authentication towards protected endpoints
- Provides registration, login, and token refresh for users
- Endpoints used for the SLS Generic Digital Edition platform
- Port of older PHP apis:
- Needs connection details for database servers and paths to folders for XML, HTML, and XSL files
- configs/digital_editions.yml
- See digital_editions_example.yml for specifics
- If API needs pull/push access to private git repositories (defined in
configs/digital_editions.yml
)- Mount SSH keys and/or ssh_config files in
/home/uwsgi/.ssh/
inside the container
- Mount SSH keys and/or ssh_config files in