Add config description
This commit is contained in:
34
README.md
34
README.md
@@ -0,0 +1,34 @@
|
||||
Конфигурация сервиса:
|
||||
сервис конфигурируется с помощью файла конфигурации src/config.py
|
||||
```
|
||||
ret_path - url с обратным адресом для информирования о выполнении операции
|
||||
self_bnd - идентификатор текущего банка данных
|
||||
|
||||
pg_host - параметры подключения к БД postgres с конфигурацией
|
||||
pg_port
|
||||
pg_dbname
|
||||
pg_username
|
||||
pg_password
|
||||
|
||||
oodb_host - параметры подключения к БД ООБД и схема с НПД
|
||||
oodb_port
|
||||
oodb_dbname
|
||||
oodb_username
|
||||
oodb_passwd
|
||||
oodb_schema
|
||||
|
||||
rabbit_conn - строка соединения с rabbitmq
|
||||
rabbit_queue - входящая очередь с информацией о коммитах
|
||||
rabbit_incoming_queue - очередь с пакетами репликации от xmlrpcserver
|
||||
rabbit_out_exchange - исходящий канал с пакетами в xmlrpcserver
|
||||
|
||||
s3_endpoint - параметры соединения с S3
|
||||
s3_key_id
|
||||
s3_access_key
|
||||
s3_bucket - бакет с данными НПД
|
||||
s3_bucket_itv - бакет для обмена с xmlrpcserver
|
||||
|
||||
gql_url - url с gql сервисом
|
||||
gql_download - шаблон получения файлов через gql, в строке должен быть указан параметр {key}, содержащий ключ объекта
|
||||
gql_schema - схема с НПД
|
||||
```
|
||||
@@ -92,8 +92,8 @@ def send_response(params, files, url):
|
||||
files_s3 = []
|
||||
for file in files:
|
||||
fn = uuid4().hex
|
||||
upload_file(file['url'], fn, Config.s3_bucket)
|
||||
file['url'] = {'name': fn, 'bucket': Config.s3_bucket}
|
||||
upload_file(file['url'], fn, Config.s3_bucket_itv)
|
||||
file['url'] = {'name': fn, 'bucket': Config.s3_bucket_itv}
|
||||
files_s3.append(file)
|
||||
data = {
|
||||
'params': params,
|
||||
@@ -262,7 +262,7 @@ def put_object(params, files, url):
|
||||
key = uuid4().hex
|
||||
fileVal.fileName = variantToString(item.relative_to(dir.name))
|
||||
fileVal.key = variantToString(key)
|
||||
fileVal.bucket = variantToString(Config.oodb_bucket)
|
||||
fileVal.bucket = variantToString(Config.s3_bucket)
|
||||
res &= feature.addAttribute('c1000', variantFromFileValue(fileVal))
|
||||
upload_file(str(item), key, Config.s3_bucket)
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ class Config:
|
||||
oodb_username: str = 'postgres'
|
||||
oodb_passwd: str = 'Root12345678'
|
||||
oodb_schema: str = 'documents_src'
|
||||
oodb_bucket: str = 'files'
|
||||
|
||||
rabbit_conn: str = 'amqp://user:password@10.10.8.83:31005/%2f'
|
||||
rabbit_queue: str = 'ipd'
|
||||
@@ -25,7 +24,8 @@ class Config:
|
||||
s3_endpoint: str = 'http://10.10.8.83:31006'
|
||||
s3_key_id: str = 's57'
|
||||
s3_access_key: str = 'd9MMinLF3U8TLSj'
|
||||
s3_bucket: str = 'itv'
|
||||
s3_bucket: str = 'files'
|
||||
s3_bucket_itv: str = 'itv'
|
||||
|
||||
gql_url: str = 'https://gql.ivazh.ru/graphql'
|
||||
gql_download: str = 'https://gql.ivazh.ru/item/{key}'
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"filestorage": {
|
||||
"type": "s3",
|
||||
"endpoint": "http://10.10.8.83:31006",
|
||||
"key_id": "s57",
|
||||
"access_key": "d9MMinLF3U8TLSj",
|
||||
"download_path": "/tmp"
|
||||
},
|
||||
"file_code": "c1000",
|
||||
"name_code": "c122",
|
||||
"use_version": true
|
||||
}
|
||||
@@ -1,167 +0,0 @@
|
||||
{
|
||||
"databases": {
|
||||
"oodb_git": {
|
||||
"host": "10.10.8.83",
|
||||
"port": 32100,
|
||||
"database": "db",
|
||||
"user": "postgres",
|
||||
"password": "Root12345678"
|
||||
}
|
||||
},
|
||||
"workspaces": {
|
||||
"documents_src": {
|
||||
"type": "documents",
|
||||
"group": "src",
|
||||
"database": "oodb_git",
|
||||
"schema": "documents_src",
|
||||
"alias": "Документы исходная"
|
||||
},
|
||||
"documents_standard": {
|
||||
"type": "documents",
|
||||
"group": "order",
|
||||
"database": "oodb_git",
|
||||
"schema": "documents_standard",
|
||||
"alias": "Документы эталон"
|
||||
},
|
||||
"documents_standard_pub": {
|
||||
"type": "documents",
|
||||
"group": "order",
|
||||
"database": "oodb_git",
|
||||
"schema": "documents_standard",
|
||||
"alias": "Документы публичная"
|
||||
},
|
||||
"ood": {
|
||||
"type": "npd",
|
||||
"group": "src",
|
||||
"database": "oodb_git",
|
||||
"schema": "ood",
|
||||
"alias": "ООБД исходные НПД",
|
||||
"map_service": "VUE_APP_GISAIS_URL:/styles/ood/style.json"
|
||||
},
|
||||
"oodb": {
|
||||
"type": "oodb",
|
||||
"group": "order",
|
||||
"database": "oodb_git",
|
||||
"schema": "kartap",
|
||||
"alias": "ООДБ эталон",
|
||||
"map_service": "VUE_APP_GISAIS_URL:/styles/oodb/style.json"
|
||||
},
|
||||
"oodb_standard": {
|
||||
"type": "oodb",
|
||||
"group": "forming_standard",
|
||||
"database": "oodb_git",
|
||||
"schema": "kartap",
|
||||
"alias": "ООДБ эталон",
|
||||
"map_service": "VUE_APP_GISAIS_URL:/styles/oodb/style.json"
|
||||
},
|
||||
"oodb_working": {
|
||||
"type": "oodb",
|
||||
"group": "forming_work",
|
||||
"database": "oodb_git",
|
||||
"schema": "kartap",
|
||||
"alias": "ООДБ рабочая",
|
||||
"map_service": "VUE_APP_GISAIS_URL:/styles/oodb_tech/style.json"
|
||||
},
|
||||
"oodb_pub": {
|
||||
"type": "oodb",
|
||||
"group": "order",
|
||||
"database": "oodb_git",
|
||||
"schema": "kartap",
|
||||
"alias": "ООБД публичная",
|
||||
"map_service": "VUE_APP_GISAIS_URL:/styles/oodb/style.json"
|
||||
},
|
||||
"regions": {
|
||||
"type": "regions",
|
||||
"database": "oodb_git",
|
||||
"schema": "regions_hard",
|
||||
"alias": "Регионы",
|
||||
"map_service": "VUE_APP_GISAIS_URL_GK:/styles/regions/style.json"
|
||||
},
|
||||
"regions_contour": {
|
||||
"type": "regions",
|
||||
"database": "oodb_git",
|
||||
"schema": "regions_hard",
|
||||
"alias": "Регионы",
|
||||
"map_service": "VUE_APP_GISAIS_URL_GK:/styles/regions_contour/style.json"
|
||||
},
|
||||
"npd_9": {
|
||||
"type": "npd",
|
||||
"database": "oodb_git",
|
||||
"schema": "npd_9",
|
||||
"alias": "НПД 9.0"
|
||||
},
|
||||
"npd": {
|
||||
"type": "npd",
|
||||
"database": "oodb_git",
|
||||
"schema": "initial",
|
||||
"alias": "НПД 9.0"
|
||||
},
|
||||
"npd_831": {
|
||||
"type": "npd",
|
||||
"group": "order",
|
||||
"database": "oodb_git",
|
||||
"schema": "npd_831",
|
||||
"alias": "НПД 8.31"
|
||||
},
|
||||
"updater_test": {
|
||||
"type": "npd",
|
||||
"group": "order",
|
||||
"database": "oodb_git",
|
||||
"schema": "npd_831_test",
|
||||
"alias": "НПД 8.31 публичная"
|
||||
},
|
||||
"lukoil": {
|
||||
"type": "oodb",
|
||||
"database": "oodb_git",
|
||||
"schema": "lukoil",
|
||||
"alias": "ЛУКОЙЛ",
|
||||
"map_service": "VUE_APP_GISAIS_URL_GK:/styles/lukoil/style.json"
|
||||
},
|
||||
"geocover": {
|
||||
"type": "ecpz",
|
||||
"group": "order",
|
||||
"database": "oodb_git",
|
||||
"schema": "coverage",
|
||||
"alias": "ЕЦПЗ"
|
||||
},
|
||||
"geocover_test": {
|
||||
"type": "ecpz",
|
||||
"database": "oodb_git",
|
||||
"schema": "coverage",
|
||||
"alias": "ЕЦПЗ тест"
|
||||
},
|
||||
"gcmr": {
|
||||
"type": "gcmr",
|
||||
"group": "order",
|
||||
"database": "oodb_git",
|
||||
"schema": "gcmr",
|
||||
"alias": "ГЦМР"
|
||||
},
|
||||
"orders": {
|
||||
"type": "system",
|
||||
"database": "oodb_git",
|
||||
"schema": "orders",
|
||||
"alias": "Заказы"
|
||||
},
|
||||
"ilo": {
|
||||
"type": "system",
|
||||
"database": "oodb_git",
|
||||
"schema": "ilo",
|
||||
"alias": "ИЛО"
|
||||
},
|
||||
"raz_sgok": {
|
||||
"type": "raz_sgok",
|
||||
"database": "razsgok",
|
||||
"schema": "razsgok",
|
||||
"alias": "СГОК",
|
||||
"map_service": "VUE_APP_GISAIS_URL_GK:/styles/raz_sgok/style.json"
|
||||
},
|
||||
"raz_vtu": {
|
||||
"type": "raz_vtu",
|
||||
"database": "razvtu",
|
||||
"schema": "razvtu",
|
||||
"alias": "ВТУ",
|
||||
"map_service": "VUE_APP_GISAIS_URL_GK:/styles/raz_vtu/style.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user