This page will include everything you need to know to configure yaas to your liking

🚧

Important Notice

Basic configuration is required for yaas to function correctly.

1. Configure Authority

yaas support user-configurable authorization, currently these authorization method is avaliable

Authority TypeDescriptionSupport
nonenone is system built-in for no authorization. Not recommended to set this as global authorization methodnative support
localBasic API key and user role authorizationnative support
rejectused for authorization fail-safe, but can be used as wellnative support

in the ./src/config folder, you can find the file config.js, there is a object defined as auth looks like this:

auth: {
        type: 'local',
        keys: {
            c9cba3d805ff526866d27b5504005766: {
                roles: [
                    'bucket:list',
                    'bucket:upload',
                    'file:list',
                    'file:get',
                    'version:list'
                ]
            }
        },
        overwrites: {
            'file:get': 'none',
            'version:list': 'none',
            'file:list': 'none',
            'bucket:list': 'none',
            'generator:lorem': 'none',
            'generator:json': 'none',
            'generator:xml': 'none'
        }
    }
KeyTypeDescription
typestringthe authority type which will be set globally.
keysobjectfor local authorization, this will include all the API keys in this object as key and their roles as a string array
keys.rolesarrayall the roles authorized for this key
overwritesobjectused when you want to overwrite a role so it uses a totally different authentication method

The example above set the global authentication level to local and only one API keys is defined c9cba3d805ff526866d27b5504005766, this API keys have access to all the roles in yaas. In addition, file:get and version:list roles have overwrite authentication method none means these action will be allowed without authentication.

🚧

Important Notice

Please do not set yaas to use none as global authentication method. Instead, use local and overwrite the ones you want to set public to none

2. Configure port

in the ./src/config folder, you can find the file config.js, there is a part ob the file defined as server looks like this:

server: {
        port:       3939,
        port_ssl:   33939
}
//	port can also be set from environment variables
PORT_SSL = 39393
PORT = 3939
property namedescriptiondefault
portthe port number for HTTP server3939
port_sslthe port number for HTTPS server39393

Please change port to the port you want your server to listen to for HTTP and HTTPS

3. Configure file save path

in the ./src/config folder, you can find the file config.js, there is a storage object defined after server

storage: {
            dest: 'storage/',
            processed: 'processed/',
            database:   'db/',
            relative: true
}
// File path can also be set from environment variable
DATABASE_PATH = db/
DEST_PATH = dest/
PROCESSES_PATH = processes/
PATH_RELATIVE = true
property namedescriptiondefault
destthe folder to store all the uploaded filesstorage/
processedthe folder to store all the processed filesprocessed/
databasethe folder to store the databasedb/
relativeis the file path specified relative?true

🚧

Important Notice

Please don't use one folder for all the paths, I have separated them for a reason.

4. Configure Redis

yaas use redis as a quick storage for managing background jobs. Currently, redis is not optional and is a requirement to run yaas.

redis: {
        port: 6379,
        host: '127.0.0.1'
}
//	Redis server informaion
REDIS_PORT_6379_TCP_ADDR = 127.0.0.1
REDIS_PORT_6379_TCP_PORT = 6379