diff --git a/CHANGELOG.md b/CHANGELOG.md index 41d3bb85..1dfc9425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Adjust in store files * Fixed the problem when do not save contacts when receive messages * Changed owner of the jid for instanceName +* Create .env for installation in docker # 1.1.3 (2023-07-06 11:43) diff --git a/Docker/.env b/Docker/.env new file mode 100644 index 00000000..f786d341 --- /dev/null +++ b/Docker/.env @@ -0,0 +1,87 @@ +CORS_ORIGIN='*' # Or separate by commas - ex.: 'yourdomain1.com, yourdomain2.com' +CORS_METHODS='POST,GET,PUT,DELETE' +CORS_CREDENTIALS=true + +# Determine the logs to be displayed +LOG_LEVEL='ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS' +LOG_COLOR=true +LOG_BAILEYS=error + +# Determine how long the instance should be deleted from memory in case of no connection. +# Default time: 5 minutes +# If you don't even want an expiration, enter the value false +DEL_INSTANCE=false + +# Temporary data storage +STORE_MESSAGES=true +STORE_MESSAGE_UP=true +STORE_CONTACTS=true +STORE_CHATS=true +CLEAN_STORE_CLEANING_INTERVAL=7200 # seconds === 2h +CLEAN_STORE_MESSAGES=true +CLEAN_STORE_MESSAGE_UP=true +CLEAN_STORE_CONTACTS=true +CLEAN_STORE_CHATS=true + +# Permanent data storage +DATABASE_ENABLED=false +DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true +DATABASE_CONNECTION_DB_PREFIX_NAME=evolution + +DATABASE_SAVE_DATA_INSTANCE=true +DATABASE_SAVE_DATA_OLD_MESSAGE=false +DATABASE_SAVE_DATA_NEW_MESSAGE=true +DATABASE_SAVE_MESSAGE_UPDATE=true +DATABASE_SAVE_DATA_CONTACTS=true +DATABASE_SAVE_DATA_CHATS=true + +REDIS_ENABLED=false +REDIS_URI=redis://redis:6379/1 +REDIS_PREFIX_KEY=evolution + +# Webhook Settings +## Define a global webhook that will listen for enabled events from all instances +WEBHOOK_GLOBAL_URL= +WEBHOOK_GLOBAL_ENABLED=false +# With this option activated, you work with a url per webhook event, respecting the global url and the name of each event +WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false +## Set the events you want to hear +WEBHOOK_EVENTS_APPLICATION_STARTUP=false +WEBHOOK_EVENTS_QRCODE_UPDATED=true +WEBHOOK_EVENTS_MESSAGES_SET=true +WEBHOOK_EVENTS_MESSAGES_UPSERT=true +WEBHOOK_EVENTS_MESSAGES_UPDATE=true +WEBHOOK_EVENTS_CONTACTS_SET=true +WEBHOOK_EVENTS_CONTACTS_UPSERT=true +WEBHOOK_EVENTS_CONTACTS_UPDATE=true +WEBHOOK_EVENTS_PRESENCE_UPDATE=true +WEBHOOK_EVENTS_CHATS_SET=true +WEBHOOK_EVENTS_CHATS_UPSERT=true +WEBHOOK_EVENTS_CHATS_UPDATE=true +WEBHOOK_EVENTS_CHATS_DELETE=true +WEBHOOK_EVENTS_GROUPS_UPSERT=true +WEBHOOK_EVENTS_GROUPS_UPDATE=true +WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true +WEBHOOK_EVENTS_CONNECTION_UPDATE=true +# This event fires every time a new token is requested via the refresh route +WEBHOOK_EVENTS_NEW_JWT_TOKEN=true + +CONFIG_SESSION_PHONE_CLIENT=Evolution API +CONFIG_SESSION_PHONE_NAME=chrome # chrome | firefox | edge | opera | safari + +# Set qrcode display limit +QRCODE_LIMIT=30 + +# Defines an authentication type for the api +AUTHENTICATION_TYPE='apikey' # jwt or 'apikey' +## Define a global apikey to access all instances. +### OBS: This key must be inserted in the request header to create an instance. +AUTHENTICATION_API_KEY='B6D711FCDE4D4FD5936544120E713976' +AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true +## Set the secret key to encrypt and decrypt your token and its expiration time +AUTHENTICATION_JWT_EXPIRIN_IN=0 # seconds - 3600s ===1h | zero (0) - never expires +AUTHENTICATION_JWT_SECRET='L0YWtjb2w554WFqPG' + +AUTHENTICATION_INSTANCE_MODE=server +AUTHENTICATION_INSTANCE_NAME=evolution +AUTHENTICATION_INSTANCE_WEBHOOK_URL= \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index ad6921e5..839f830b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -13,84 +13,8 @@ services: volumes: - evolution_instances:/evolution/instances - evolution_store:/evolution/store - environment: - - LOG_LEVEL=ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS - - LOG_BAILEYS=error - # Determine how long the instance should be deleted from memory in case of no connection. - # Default time: 5 minutes - # If you don't even want an expiration, enter the value false - - DEL_INSTANCE=false # 5 or false - # Temporary data storage - - STORE_MESSAGES=true - - STORE_MESSAGE_UP=true - - STORE_CONTACTS=true - - STORE_CHATS=true - - CLEAN_STORE_CLEANING_INTERVAL=7200 # seconds === 2h - - CLEAN_STORE_MESSAGES=true - - CLEAN_STORE_MESSAGE_UP=true - - CLEAN_STORE_CONTACTS=true - - CLEAN_STORE_CHATS=true - # Permanent data storage - - DATABASE_ENABLED=false - - DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true - - DATABASE_CONNECTION_DB_PREFIX_NAME=evolution - # Choose the data you want to save in the application's database or store - - DATABASE_SAVE_DATA_INSTANCE=true - - DATABASE_SAVE_DATA_OLD_MESSAGE=false - - DATABASE_SAVE_DATA_NEW_MESSAGE=true - - DATABASE_SAVE_MESSAGE_UPDATE=true - - DATABASE_SAVE_DATA_CONTACTS=true - - DATABASE_SAVE_DATA_CHATS=true - - REDIS_ENABLED=true - - REDIS_URI=redis://redis:6379/1 - - REDIS_PREFIX_KEY=evolution - # Webhook Settings - # Define a global webhook that will listen for enabled events from all instances - - WEBHOOK_GLOBAL_URL= - - WEBHOOK_GLOBAL_ENABLED=false - # With this option activated, you work with a url per webhook event, respecting the global url and the name of each event - - WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false - # Automatically maps webhook paths - # Set the events you want to hear - - WEBHOOK_EVENTS_APPLICATION_STARTUP=false - - WEBHOOK_EVENTS_QRCODE_UPDATED=true - - WEBHOOK_EVENTS_MESSAGES_SET=true - - WEBHOOK_EVENTS_MESSAGES_UPSERT=true - - WEBHOOK_EVENTS_MESSAGES_UPDATE=true - - WEBHOOK_EVENTS_CONTACTS_SET=true - - WEBHOOK_EVENTS_CONTACTS_UPSERT=true - - WEBHOOK_EVENTS_CONTACTS_UPDATE=true - - WEBHOOK_EVENTS_PRESENCE_UPDATE=true - - WEBHOOK_EVENTS_CHATS_SET=true - - WEBHOOK_EVENTS_CHATS_UPSERT=true - - WEBHOOK_EVENTS_CHATS_UPDATE=true - - WEBHOOK_EVENTS_CHATS_DELETE=true - - WEBHOOK_EVENTS_GROUPS_UPSERT=true - - WEBHOOK_EVENTS_GROUPS_UPDATE=true - - WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true - - WEBHOOK_EVENTS_CONNECTION_UPDATE=true - # This event fires every time a new token is requested via the refresh route - - WEBHOOK_EVENTS_NEW_JWT_TOKEN=true - # Name that will be displayed on smartphone connection - - CONFIG_SESSION_PHONE_CLIENT=Evolution API - - CONFIG_SESSION_PHONE_NAME=chrome # chrome | firefox | edge | opera | safari - # Set qrcode display limit - - QRCODE_LIMIT=30 - # Defines an authentication type for the api - - AUTHENTICATION_TYPE=apikey # jwt or apikey - # Define a global apikey to access all instances - # OBS: This key must be inserted in the request header to create an instance. - - AUTHENTICATION_API_KEY=B6D711FCDE4D4FD5936544120E713976 - # Expose the api key on return from fetch instances - - AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true - # Set the secret key to encrypt and decrypt your token and its expiration time. - - AUTHENTICATION_JWT_EXPIRIN_IN=0 # seconds - 3600s === 1h | zero (0) - never expires - # Set the instance name and webhook url to create an instance in init the application - # With this option activated, you work with a url per webhook event, respecting the local url and the name of each event - - AUTHENTICATION_INSTANCE_MODE=server # container or server - # if you are using container mode, set the container name and the webhook url to default instance - - AUTHENTICATION_INSTANCE_NAME=evolution - - AUTHENTICATION_INSTANCE_WEBHOOK_URL= + env_file: + - ./Docker/.env command: ['node', './dist/src/main.js'] networks: - evolution-net