配置管理
环境变量
维格表是一个功能强大的自托管可视化数据库/低代码工具,可以通过UI和API轻松创建、管理和操作无限的应用程序和解决方案。
为了自定义维格表的行为并将其配置为适合特定用例,您可以使用环境变量。
环境变量是一种在运行时向程序或脚本传递信息的方法。
它们通常在程序或脚本之外设置,并可用于配置软件的各个方面。
环境变量经常用于存储配置设置,例如API密钥、连接字符串和其他敏感信息。
维格表使用许多环境变量来配置其行为。
以下是可用环境变量及其说明的表格:
backend-server 环境变量说明
| Category | Environment Variable Name | Description | Default Value |
|---|---|---|---|
| Server | API_DOCS_ENABLED | Whether enable openapi document, access address is localhost/api/v1/doc.html | false |
| Server | MAX_HTTP_HEADER_SIZE | Max size of http request header | 32KB |
| Server | MAX_FILE_SIZE | Max upload size of http request | 1GB |
| Server | MAX_REQUEST_SIZE | Max size of http request | 1GB |
| Server | SESSION_NAMESPACE | Http cookies namespace key in cache | apitable |
| Server | SESSION_TIMEOUT | Http cookies survival time | 30d |
| Server | DEFAULT_LOCALE | Default server locale, support en-US/zh-CN. After version 0.24.0, de-DE, es-ES, fr-FR, it-IT, ja-JP, ko-KR, ru-RU, zh-HK are supported | en-US |
| Server | SERVER_DOMAIN | Server access address for all services, usually the ip address deployed by gateway services (like nginx,openresty, et), eg. http(s)://apitable.com | http://127.0.0.1 |
| Server | ASSETS_LTD_URL | The variable is deprecated, use the new variable: ASSETS_URL. | http://127.0.0.1/assets |
| Server | ASSETS_URL | The url of assets storage server like minio/s3 et, eg. http(s)://xxx.com | http://127.0.0.1/assets |
| Server | ASSETS_LTD_BUCKET | The variable is deprecated, use the new variable: ASSETS_BUCKET. | assets |
| Server | ASSETS_BUCKET | Bucket name of assets storage. keep default value if not necessary | assets |
| Server | INFOFLOW_PERMISSIONS_ENABLED | It is used to enable the permission callback, after which the third-party system controls the user permission | true |
| Server | INFOFLOW_PERMISSIONS_SPACE_ID | Used to specify a space station callback permission | spaceIdA,spaceIdB |
| Server | CORS_ORIGINS | Allows access to the source address of the current site, thereby avoiding browser cross-domain restrictions. Supports configuring multiple domain names, such as: https://abc.com, https://vika.cn, https://*.vika.cn | * |
| Server | SPACE_STATISTICS_CACHE_HOURS | Support customizing cache for space statistics expiration time (in hours), with a default of 1 hour. | 1 |
| Server | SMS_ENABLED | Whether to enable sms | false |
| Server | SMS_LOCAL_TYPE | Domestic SMS operator service provider, currently only supports tencent | tencent |
| Server | SMS_TENCENT_APP_ID | Tencent Cloud SDK AppID | |
| Server | SMS_TENCENT_APP_KEY | Tencent Cloud App Key | |
| Server | SMS_TENCENT_SIGN | Tencent Cloud SMS signature | Cloud |
| Database | MYSQL_HOST | The host for the mysql database | 127.0.0.1 |
| Database | MYSQL_PORT | The port for the mysql database | 3306 |
| Database | MYSQL_DATABASE | The db schema for the mysql database | apitable |
| Database | MYSQL_USERNAME | The user name for the mysql database | apitable |
| Database | MYSQL_PASSWORD | The password for the mysql database | apitable@com |
| Redis Cache | REDIS_HOST | The host for redis cache | 127.0.0.1 |
| Redis Cache | REDIS_USERNAME | The username for redis cache | NULL |
| Redis Cache | REDIS_PASSWORD | The password for redis cache | NULL |
| Redis Cache | REDIS_PORT | The port for redis cache | 6379 |
| Redis Cache | REDIS_DB | The db index for redis cache | 0 |
| MQ | RABBITMQ_HOST | The host for rabbitmq server | 127.0.0.1 |
| MQ | RABBITMQ_PORT | The port for rabbitmq server | 5672 |
| MQ | RABBITMQ_USERNAME | The username for rabbitmq server | apitable |
| MQ | RABBITMQ_PASSWORD | The password for rabbitmq server | apitable@com |
| MQ | RABBITMQ_VHOST | The vhost path for rabbitmq server | / |
| EMAIL_PERSONAL | Email sign personal show in email | APITable | |
| MAIL_HOST | The host for smtp server | NULL | |
| MAIL_USERNAME | The username for smtp server, usually email address | NULL | |
| MAIL_PASSWORD | The password for smtp server, usually email password | NULL | |
| MAIL_PORT | The port for smtp server, 465 for production, 25 for development | 465 | |
| MAIL_SSL_ENABLE | Whether mail ssl enable | true | |
| Socket | SOCKET_URL | Connect to room server for collaborating working by this properties, set this value in cluster mode, eg. http://room-server | http://127.0.0.1 |
| Socket | SOCKET_RECONNECTION_ATTEMPTS | Set this value for attempting to reconnect socket times | 2 |
| Socket | SOCKET_RECONNECTION_DELAY | Time delay to attempt reconnect socket, unit is seconds | 1000 |
| Socket | SOCKET_TIMEOUT | Timeout to connect socket server, unit is seconds | 1000 |
| Storage | OSS_ENABLED | Whether to enable storage, usually opened for uploading attachment in datasheet | true |
| Storage | OSS_CLIENT_TYPE | Which client sdk type you want to use, aws s3 sdk is best, keep default value | aws |
| Storage | AWS_ACCESS_KEY | Access key of AWS S3 | NULL |
| Storage | AWS_ACCESS_SECRET | Access secret of AWS S3 | NULL |
| Storage | AWS_ENDPOINT | Endpoint of AWS S3 | NULL |
| Storage | AWS_REGION | Region of AWS S3 | NULL |
| Storage | QINIU_ACCESS_KEY | Access key of QINIU Cloud | NULL |
| Storage | QINIU_SECRET_KEY | Secret key of QINIU Cloud | NULL |
| Storage | QINIU_REGION | Region of QINIU Cloud | NULL |
| Storage | QINIU_DOWNLOAD_DOMAIN | Download domain of QINIU Cloud, optional | NULL |
| Storage | QINIU_UPLOAD_URL | Upload of QINIU Cloud, optional | NULL |
| Storage | QINIU_CALLBACK_URL | Callback url of QINIU Cloud, optional | NULL |
| Storage | QINIU_CALLBACK_BODY_TYPE | Callback body type of QINIU Cloud, optional | NULL |
| Storage | MINIO_ENDPOINT | Endpoint of MinIO | NULL |
| Storage | MINIO_ACCESS_KEY | Access key of MinIO | NULL |
| Storage | MINIO_SECRET_KEY | Secret key of MinIO | NULL |
| Report | SENTRY_DSN | Sentry organization DSN url, set this value to open sentry bug report | NULL |
| Report | ENV | Sentry env, it depend on your environment, eg. development/test/production | NULL |
| Connect | SOCKET_DOMAIN | The socket server address in cluster mode, eg. http://socket-server/socket | http://127.0.0.1/socket |
| Connect | NEST_GRPC_ADDRESS | The room server grpc service, eg. static://room-server | static://localhost |
| --- | --- | --- | --- |
| Auth | AUTH0_ENABLED | Whether enable auth0 connect, only for enterprise | false |
| Auth | AUTH0_CLIENT_ID | Auth0 tenant application client id, only for enterprise | NULL |
| Auth | AUTH0_CLIENT_SECRET | Auth0 tenant application client secret, only for enterprise | NULL |
| Auth | AUTH0_CLIENT_DOMAIN | Auth0 tenant client domain, only for enterprise | NULL |
| Auth | AUTH0_CLIENT_ISSUER_URI | Auth0 tenant client issuer url, only for enterprise | NULL |
| Auth | AUTH0_REDIRECT_URI | Auth0 tenant redirect uri, only for enterprise | NULL |
| Auth | AUTH0_DB_CONNECTION_ID | Auth0 tenant db connect id, only for enterprise | NULL |
| Auth | AUTH0_DB_CONNECTION_NAME | Auth0 tenant db connect name, only for enterprise | NULL |
| Auth | ONEACCESS_ENABLED | Whether enable oneaccess sso, only for enterprise | false |
| Auth | ONEACCESS_IAM_HOST | Oneaccess Iam server Host | http://127.0.0.1 |
| Auth | ONEACCESS_CLIENT_ID | Client application registration ID (provided by IAS). Reference document | |
| Auth | ONEACCESS_CLIENT_SECRET | Client application registration secret (provided by Oneaccess IAS) . Rerence document | |
| Auth | ONEACCESS_ENCRYPT_KEY | AES encryption key, default is 123456 | 123456 |
| EMBED | COOKIES_SECURE | cookies should be set to support HTTPS and true must be set for embedding cross-site login | false |
| EMBED | COOKIES_SAME_SITE | Same-origin policy should be enabled and and None must be set for embedding cross-site login | NULL |
| Server | OTEL_JAEGER_ENABLED | Enable tracking service (self-hosted) | false |
| Server | OTEL_JAEGER_ENDPOINT | jaeger endpoint address,such as http://127.0.0.1:14250 | |
| Server | OTEL_JAEGER_TRACE_ID_RATIO_BASED | Control the sampling rate, you can set 0 ~ 1 | 1 |
| Server | SEND_NOTIFICATION | Whether to send card notification messages when enterprise WeCom is integrated | true |
| Server | EXPORT_MAX_FILE_SIZE | Control the size of imported excel or csv files, the default is 20Mb | 20 |
init-db 环境变量说明
| Environment Variable Name | Description | Default Value | Require |
|---|---|---|---|
| DB_HOST | the host of mysql database | NULL | true |
| DB_PORT | the port of mysql database | NULL | true |
| DB_NAME | the db schema name of mysql database | NULL | true |
| DB_USERNAME | the username of mysql database | NULL | true |
| DB_PASSWORD | the password of mysql database | NULL | true |
| DATABASE_TABLE_PREFIX | table prefix | apitable_ | true |
| ACTION | liquibase run action | update | true |
room-server/fusion-server 环境变量说明
| Environment Variable Name | Description | Default Value |
|---|---|---|
| NODE_ENV | Environment variable (development) | development |
| PORT | - | 3333 |
| LOG_LEVEL | Logging level | debug、error |
| DATABASE_TABLE_PREFIX | - | apitable_ |
| MYSQL_CONNECTION_LIMIT | - | 20 |
| MYSQL_DATABASE | - | apitable |
| MYSQL_HOST | MySQL configuration | 127.0.0.1 |
| MYSQL_KEEP_CONNECTION_ALIVE | - | true |
| MYSQL_PASSWORD | - | apitable@com |
| MYSQL_PORT | - | 3306 |
| MYSQL_RETRY_DELAY | (in ms) | 300 |
| MYSQL_USERNAME | - | root |
| REDIS_DB | If not configured, default is 0 | 3 |
| REDIS_HOST | Redis configuration | 127.0.0.1 |
| REDIS_PASSWORD | - | apitable@com |
| REDIS_PORT | - | 6379 |
| SOCKET_GRPC_URL | SOCKET-server configuration | 0.0.0.0 |
| BACKEND_BASE_URL | Backend service address | http://localhost/api/v1/ |
| SERVER_MAX_FIELD_COUNT | - | 200 |
| SERVER_MAX_VIEW_COUNT | - | 30 |
| SERVER_RECORD_REMIND_RANGE | - | 90 |
| SERVER_TRANSFORM_LIMIT | - | 100000 |
| OSS_BUCKET | - | QNY1 |
| OSS_CACHE_TYPE | - | |
| OSS_HOST | OSS configuration | https://s1.vika.cn |
| OSS_MINIO | Minio | { "endPoint": "", "port": 9000, "useSSL": true, "accessKey": "", "secretKey": "" } |
| OSS_MINIO_BUCKET_CACHE | - | { "name": "api.cache" } |
| OSS_S3_BUCKET_CACHE | S3 | { "name": "api.cache", "region": "cn-northwest-1" } |
| ROBOT_OFFICIAL_SERVICE_SLUG | robot type value (apitable or vika) | apitable |
| ACTUATOR_DNS_URL | Health check configuration | http://health-check-monitor.vika.cn |
| ACTUATOR_HEAP_RATIO | - | 100 |
| ACTUATOR_RSS_RATIO | - | 90 |
| LIMIT_DURATION | - | 1 |
| LIMIT_POINTS | Current limit configuration | 5 |
| LIMIT_WHITE_LIST | - | { "test1": { "points": 5, "duration": 1}, "test2": {"points": 5, "duration": 1 } } |
| ENABLE_OTEL_JAEGER | Enable tracking service (self-hosted) | false |
| OTEL_JAEGER_ENDPOINT | - | |
| OTEL_JAEGER_TRACE_ID_RATIO_BASED | Interval value (0 to 1) | 0.1 |
| SENTRY_DSN | Sentry | https://14aceedcbea54ef8ac7ee4d70525f530@sentry.apitable.com/ |
| ENABLE_SOCKET | enable socket module for collaboration | |
| SHOW_ANONYMOUS | Block anonymous user avatars and nicknames in the upper right corner of the form | false |
| NODE_MAX_EMBED_LINK_COUNTS | 30 | The number of join links for a single table is online, and the default is 30 |
| SKIP_USAGE_VERIFICATION | When calling the Fusion API, do not count and verify the space station usage | true |
| ENABLE_SCHED | Used to activate the timed reminder notification for the "Date" field | true |
\n
Web Server 环境变量说明
| Category | Environment Variable Name | Description | Default Value |
|---|---|---|---|
| Limit | VIEW_NAME_MAX_COUNT | Maximum number of views NAME | 50 |
| Limit | MAXIMUM_VIEW_COUNT_PER_DATASHEET | Maximum number of of widgets | 30 |
| Limit | MAXIMUM_FIELD_COUNT_PER_DATASHEET | Maximum number of field | 200 |
| UI | FAVICON | favicon | NULL |
| UI | LOGIN_DEFAULT_ACCOUNT_TYPE | Default login method | |
| UI | LOGIN_DEFAULT_VERIFY_TYPE | 非启动时的登录页,仅用于配置邀请成员页面进入的登录页Supported login verification types, verification code login is identify_code_login, password login is password_login,支持的登录验证类型,验证码登录是 identify_code_login,密码登录是 password_login | password_login |
| UI | ACCOUNT_LOGOUT_VISIBLE | Allow login out | true |
| UI | ACCOUNT_RESET_PASSWORD_VISIBLE | Allow reset password | true |
| UI | ROBOT_DEFAULT_AVATAR | Robot default avatar | NULL |
| UI | INVITATION_CODE_VISIBLE | Invite code visible or not | false |
| UI | REGENERATE_API_TOKEN_VISIBLE | Recreate API Token Button visible or not | false |
| Theme | SYSTEM_CONFIGURATION_DEFAULT_THEME | Default theme | dark |
| Lang | SYSTEM_CONFIGURATION_DEFAULT_LANGUAGE | Defaut language | en_US |
| Storage | QNY1,QNY2,QNY3 | OSS bucket or storage url | assets |
| Sentry | SENTRY_CONFIG_DSN | Sentry DSN | NULL |
| Proxy | API_PROXY | Default http://backend-server:8081 | http://127.0.0.1 |
| Proxy | API_ROOM_SERVER | Default http://localhost | NULL |
| Proxy | API_BACKEND_SERVER | Default http://backend-server:8081 | NULL |
| Proxy | API_FUSION_SERVER | NULL | |
| Proxy | API_SOCKET_SERVER_ROOM | NULL | |
| Setting | NEXT_PUBLIC_ASSET_PREFIX | Public static folder path | "" |
| Setting | USE_CUSTOM_PUBLIC_FILES | NULL | |
| Setting | PUBLIC_URL | NULL | |
| Setting | LOGIN_ON_AUTHORIZATION_REDIRECT_TO_URL | Login redirect address, it is recommended to set /login?reference= to specify third-party login | NULL |
| Analytics | GOOGLE_ANALYTICS_ID | Google Analytics ID | NULL |
| Analytics | BAIDU_ANALYSE_ID | Baidu Analytics ID | NULL |
| Security | COOKIEBOT_ID | Cookiebot ID | Null |
init-appdata 环境变量说明
| Environment Variable Name | Description | Default Value | Require |
|---|---|---|---|
| MYSQL_HOST | the host of mysql database | 127.0.0.1 | true |
| MYSQL_PORT | the port of mysql database | 3306 | true |
| MYSQL_DATABASE | the db schema name of mysql database | apitable | true |
| MYSQL_USERNAME | the username of mysql database | root | true |
| MYSQL_PASSWORD | the password of mysql database | password | true |
| DATABASE_TABLE_PREFIX | table prefix | apitable_ | true |
| OSS_ENABLED | Whether to enable storage, usually opened for sync attachment | false | true |
| AWS_ACCESS_KEY | Access key of AWS S3 | apitable | true |
| AWS_ACCESS_SECRET | Access secret of AWS S3 | apitable@com | true |
| AWS_ENDPOINT | Endpoint of AWS S3 | http://minio | true |
| AWS_REGION | Region of AWS S3 | us-east-1 | true |
| BUCKET_POLICY | When specified bucket does not exist, it auto create bucket with this policy. | NULL | false |
| ASSETS_BUCKET | Bucket name of assets storage. keep default value if not necessary | assets | true |
| SKIP_TEMPLATE_CENTER_LOADER | 执行init-appdata时,跳过覆盖模板中心 | false | false |
| SKIP_TEMPLATE_CENTER_CONFIG_LOADER | 执行init-appdata时,跳过覆盖模板中心配置 | false | false |
| SKIP_WIDGET_CENTER_LOADER | 执行init-appdata时,跳过覆盖小程序中心 | false | false |
| SKIP_AUTOMATION_LOADER | 执行init-appdata时,跳过覆盖机器人 | false | false |
| SKIP_LAB_FEATURE_LOADER | 执行init-appdata时,跳过覆盖实验性功能 | false | false |
| SKIP_WIZARD_LOADER | 执行init-appdata时,跳过覆盖新手引导 | false | false |
总结
环境变量是配置维格表以适应您特定用例的强大方法。通过设置适当的环境变量,您可以自定义维格表的行为,并确保它与您现有的基础架构无缝配合工作。