Skip to content

Configuration Settings (.env)

Patrick Trumpis edited this page Mar 7, 2025 · 6 revisions

Configuration Overview

This article will explain the configuration options of your .env file.

Important Changes in v3.2

Since version 3.2 and higher, the application configuration is located in the config.yml file.
In the future, please only use the config.yml file for application configuration values and the .env file for server and hosting configuration values.

Backwards compatibility

For backwards compatibility reasons, application configuration values will continue to be read from the .env file if any have been configured there and these values are missing or commented out in the config.yml file. Values from the config.yml file always take precedence over values from the .env file.

This backwards compatibility is available from version 3.2 to version 4.0 and will be deactivated thereafter.


Configuration Options

Docker Options

Usually you shouldn't touch these options (don't ask me for help if you change them).

They are useful if you are running other applications/servers and you need to change default ports for compatibility.

MYSQL_USER

A user name for your local MySQL Server.

root by default.

MYSQL_ROOT_PASSWORD

Root password for your local MySQL Server.

123456 by default.

MYSQL_DATABASE

Name of the Snap Camera Server database.

snapcamera by default.

MYSQL_LOCAL_PORT

Local port of your local MySQL Server.

3306 by default.

ADMINER_DESIGN

Allows you to change the default design of your database manager (Adminer).

Try dracula for a dark design.

You can find different designs at:
https://github.com/vrana/adminer/tree/master/designs

ADMINER_LOCAL_PORT

Local port of your Adminer database manager.

8080 by default.

APP_LOCAL_PORT

Local port of your Node.js application server.

5645 by default.

NGINX_WWW_ROOT

nginx web root directory inside your docker container.

/var/www/snapcamera by default.

NGINX_LOCAL_PORT

Local port of your nginx web server.

80 by default.


Advanced Options

You should not touch these options if you are using the default configuration instructions with docker compose.
They are commented out because Docker automatically manages these options for you in the docker-compose.yml file.

These values are intended for custom hosting solutions and represent the equivalent of Docker configuration.

DB_HOST

IP or Hostname of the database (MySQL) server.

localhost by default.

DB_PORT

Port of the database (MySQL) server. 3306 by default.

DB_NAME

Name of the database (MySQL) server.

snapcamera by default.

DB_USER

Username of the database (MySQL) server.

root by default.

DB_PASS

Password of the database (MySQL) server.

123456 by default.

PORT

Port of the Node.js application server.
This is the actual Snap Camera Server.

5645 by default.

STORAGE_SERVER

Full URL of the storage emulation server that will serve all the lens and image files.
This is done by the nginx web server.

http://studio-app.snapchat.com:80 by default.

STORAGE_PATH

Local server base path to store all lens and image files.
The storage server will serve all files from this location.

/var/lib/snapcamera by default.

IMPORT_DIR

Directory for importing cached lenses and custom uploads.
The content of this directory will be available through the storage server URL.
(e.g. http://studio-app.snapchat.com:80/import/)

import by default.

MEDIA_DIR

Directory with default media files.
The content of this directory will be available through the storage server URL.
(e.g. http://studio-app.snapchat.com:80/snap-camera-media/)

snap-camera-media by default.

MEDIA_DIR_ALT

Directory with alternative default media files.
The content of this directory will be available through the storage server URL.
(e.g. http://studio-app.snapchat.com:80/snap-camera-media-alt/)

snap-camera-media-alt by default.


Default .env file >= v3.2

###########################
# Docker Configuration
###########################
MYSQL_USER=root
MYSQL_ROOT_PASSWORD=123456
MYSQL_DATABASE=snapcamera
MYSQL_LOCAL_PORT=3306
MYSQL_DOCKER_PORT=3306

#https://github.com/vrana/adminer/tree/master/designs
ADMINER_DESIGN=
ADMINER_LOCAL_PORT=8080
ADMINER_DOCKER_PORT=8080

APP_LOCAL_PORT=5645
APP_DOCKER_PORT=5645

NGINX_WWW_ROOT=/var/www/snapcamera
NGINX_LOCAL_PORT=80
NGINX_DOCKER_PORT=80

##############################################################
# Changes below this line are not required and not recommended
# Docker Compose will auto set everything correctly
# These values are meant for standalone usage without Docker
# Running inside a virtual machine for example
##############################################################

# values will be set by Docker if you run docker compose
#DB_HOST=localhost
#DB_PORT=3306
#DB_NAME=snapcamera
#DB_USER=root
#DB_PASS=123456
#PORT=5645
#STORAGE_SERVER=http://studio-app.snapchat.com:80
#STORAGE_PATH=/var/lib/snapcamera
#IMPORT_DIR=import
#MEDIA_DIR=snap-camera-media
#MEDIA_DIR_ALT=snap-camera-media-alt

Default .env file <= v3.1

###########################
# Application Configuration
###########################

# relay source for missing lenses, leave blank to disable
RELAY_SERVER=https://snapchatreverse.jaku.tv

# relay connection timeout in milliseconds
RELAY_TIMEOUT=6000

# https://github.com/ptrumpis/snap-camera-signature-patch
# web source unlocks all lenses even those created after January 25, 2023
# it requires a patched binary with disabled signature checks
ENABLE_WEB_SOURCE=TRUE

# https://github.com/ptrumpis/snap-lens-cache-import
# enable import of cached application lenses through special api
# if you run a public server, you should set this to FALSE
# otherwise anyone can upload files to your server
ENABLE_CACHE_IMPORT=TRUE

# mirrors and downloads all your search results
# comes with increased disk space usage
# but helps to back up lenses in case they disappear
MIRROR_SEARCH_RESULTS=FALSE

# ignore alternative media download
# turning it on has no downside and saves alot of disk space
# IGNORE_ALT_MEDIA takes precedence over IGNORE_IMG_SEQUENCE
IGNORE_ALT_MEDIA=TRUE
IGNORE_IMG_SEQUENCE=TRUE

###########################
# Docker Configuration
###########################
MYSQL_USER=root
MYSQL_ROOT_PASSWORD=123456
MYSQL_DATABASE=snapcamera
MYSQL_LOCAL_PORT=3306
MYSQL_DOCKER_PORT=3306

#https://github.com/vrana/adminer/tree/master/designs
ADMINER_DESIGN=
ADMINER_LOCAL_PORT=8080
ADMINER_DOCKER_PORT=8080

APP_LOCAL_PORT=5645
APP_DOCKER_PORT=5645

NGINX_WWW_ROOT=/var/www/snapcamera
NGINX_LOCAL_PORT=80
NGINX_DOCKER_PORT=80

##############################################################
# Changes below this line are not required and not recommended
# Docker Compose will auto set everything correctly
# These values are meant for standalone usage without Docker
# Running inside a virtual machine for example
##############################################################

# values will be set by Docker if you run docker compose
#DB_HOST=localhost
#DB_PORT=3306
#DB_NAME=snapcamera
#DB_USER=root
#DB_PASS=123456
#PORT=5645
#STORAGE_SERVER=http://studio-app.snapchat.com:80
#STORAGE_PATH=/var/lib/snapcamera
#IMPORT_DIR=import
#MEDIA_DIR=snap-camera-media
#MEDIA_DIR_ALT=snap-camera-media-alt