-
Notifications
You must be signed in to change notification settings - Fork 11
Configuration
Ilmar Türk edited this page Dec 13, 2024
·
4 revisions
Citizen OS API configuration guidelines
We use Sequelize, see the documentation here - https://sequelize.org/docs/v6/getting-started/ Code that initiates the DB connection - https://github.com/citizenos/citizenos-api/blob/master/db/models/index.js
Example configuration for URL based configuration:
"db": {
"url": "postgres://citizenos:citizenos@localhost:5432/citizenos"
}
Example configuration for peer authentication (unix domain socket):
"db": {
"url": null,
"options": {
"host": "/var/run/postgresql",
"database": "citizenos",
"dialectOptions": {
"ssl": false
}
}
}
File upload is used for uploading files where necessary. Eg. include attachments to topics or add user profile or group image. Example configuration for file upload:
"storage": {
"type": "local",
"allowedFileTypes": ["txt", "pdf", "doc", "docx", "ddoc", "bdoc", "odf", "odt", "jpg", "jpeg", "img", "png"],
"maxFileSize": 50000,
"baseFolder": "/path/to/folder/in/file/system/",
"baseURL": "https://myhost.site.com/imagefolder/"
}
"storage": {
"type": "s3",
"accessKeyId": "myAccessKeyId",
"secretAccessKey": "myAccessKeySecret",
"region": "myRegion",
"bucket": "myBucket",
"allowedFileTypes": ["txt", "pdf", "doc", "docx", "ddoc", "bdoc", "odf", "odt", "jpg", "jpeg", "img", "png"],
"maxFileSize": 50000
}