Changeset View
Changeset View
Standalone View
Standalone View
docs/dev-info.rst
Show All 16 Lines | |||||
-------- | -------- | ||||
swh-deposit uses a database to store the state of a deposit. The default | swh-deposit uses a database to store the state of a deposit. The default | ||||
db is expected to be called swh-deposit-dev. | db is expected to be called swh-deposit-dev. | ||||
To simplify the use, the following makefile targets can be used: | To simplify the use, the following makefile targets can be used: | ||||
schema | schema | ||||
~~~~~~ | ^^^^^^ | ||||
.. code:: shell | .. code:: shell | ||||
make db-create db-prepare db-migrate | make db-create db-prepare db-migrate | ||||
data | data | ||||
~~~~ | ^^^^ | ||||
Once the db is created, you need some data to be injected (request | Once the db is created, you need some data to be injected (request | ||||
types, client, collection, etc...): | types, client, collection, etc...): | ||||
.. code:: shell | .. code:: shell | ||||
make db-load-data db-load-private-data | make db-load-data db-load-private-data | ||||
Show All 19 Lines | .. code:: yaml | ||||
- model: deposit.depositclient | - model: deposit.depositclient | ||||
fields: | fields: | ||||
user_ptr_id: 1 | user_ptr_id: 1 | ||||
collections: | collections: | ||||
- 1 | - 1 | ||||
url: https://hal.inria.fr | url: https://hal.inria.fr | ||||
drop | drop | ||||
~~~~ | ^^^^ | ||||
For information, you can drop the db: | For information, you can drop the db: | ||||
.. code:: shell | .. code:: shell | ||||
make db-drop | make db-drop | ||||
Development-like environment | Development-like environment | ||||
---------------------------- | ---------------------------- | ||||
Development-like environment needs one configuration file to work | Development-like environment needs one configuration file to work | ||||
properly. | properly. | ||||
Configuration | Configuration | ||||
~~~~~~~~~~~~~ | ^^^^^^^^^^^^^ | ||||
**``{/etc/softwareheritage | ~/.config/swh | ~/.swh}``/deposit/server.yml**: | **``{/etc/softwareheritage | ~/.config/swh | ~/.swh}``/deposit/server.yml**: | ||||
.. code:: yaml | .. code:: yaml | ||||
# dev option for running the server locally | # dev option for running the server locally | ||||
host: 127.0.0.1 | host: 127.0.0.1 | ||||
port: 5006 | port: 5006 | ||||
# production | # production | ||||
authentication: | authentication: | ||||
activated: true | activated: true | ||||
white-list: | white-list: | ||||
GET: | GET: | ||||
- / | - / | ||||
# 20 Mib max size | # 20 Mib max size | ||||
max_upload_size: 20971520 | max_upload_size: 20971520 | ||||
Run | Run | ||||
~~~ | ^^^ | ||||
Run the local server, using the default configuration file: | Run the local server, using the default configuration file: | ||||
.. code:: shell | .. code:: shell | ||||
make run-dev | make run-dev | ||||
Production-like environment | Production-like environment | ||||
--------------------------- | --------------------------- | ||||
Production-like environment needs additional section in the | Production-like environment needs additional section in the | ||||
configuration file to work properly. | configuration file to work properly. | ||||
This is more close to what's actually running in production. | This is more close to what's actually running in production. | ||||
Configuration | Configuration | ||||
~~~~~~~~~~~~~ | ^^^^^^^^^^^^^ | ||||
This expects the same file describes in the previous chapter. Plus, an | This expects the same file describes in the previous chapter. Plus, an | ||||
additional private section file containing private information that is | additional private section file containing private information that is | ||||
not in the source code repository. | not in the source code repository. | ||||
**``{/etc/softwareheritage | ~/.config/swh | ~/.swh}``/deposit/private.yml**: | **``{/etc/softwareheritage | ~/.config/swh | ~/.swh}``/deposit/private.yml**: | ||||
.. code:: yaml | .. code:: yaml | ||||
Show All 12 Lines | secret_key: production-secret-key | ||||
db: | db: | ||||
name: swh-deposit-dev | name: swh-deposit-dev | ||||
host: db | host: db | ||||
port: 5467 | port: 5467 | ||||
user: user | user: user | ||||
password: user-password | password: user-password | ||||
Run | Run | ||||
~~~ | ^^^ | ||||
.. code:: shell | .. code:: shell | ||||
make run | make run | ||||
Note: This expects gunicorn3 package installed on the system | Note: This expects gunicorn3 package installed on the system | ||||
Tests | Tests | ||||
Show All 20 Lines |