chore: sync project files

This commit is contained in:
richjohnrambo
2026-08-11 10:29:38 +08:00
parent c9d6a6767f
commit 5aa7733515
310 changed files with 3323 additions and 36 deletions
View File
View File
View File
+38
View File
@@ -0,0 +1,38 @@
version: '3.8'
x-mongodb-tinode-env-vars: &mongodb-tinode-env-vars
"STORE_USE_ADAPTER": "mongodb"
services:
db:
image: mongo:4.2.3
container_name: mongodb
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
healthcheck:
test: ["CMD", "curl -f http://localhost:28017/ || exit 1"]
# Initializes MongoDb replicaset.
initdb:
image: mongo:4.2.3
container_name: initdb
depends_on:
- db
command: >
bash -c "echo 'Starting replica set initialize';
until mongo --host mongodb --eval 'print(\"waited for connection\")'; do sleep 2; done;
echo 'Connection finished';
echo 'Creating replica set';
echo \"rs.initiate({'_id': 'rs0', "members": [ {'_id': 0, 'host': 'mongodb:27017'} ]})\" | mongo --host mongodb"
tinode-0:
environment:
<< : *mongodb-tinode-env-vars
"WAIT_FOR": "mongodb:27017"
tinode-1:
environment:
<< : *mongodb-tinode-env-vars
tinode-2:
environment:
<< : *mongodb-tinode-env-vars
@@ -0,0 +1,24 @@
version: '3.8'
x-postgres-tinode-env-vars: &postgres-tinode-env-vars
"STORE_USE_ADAPTER": "postgres"
services:
db:
image: postgres:15.2
container_name: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
tinode-0:
environment:
<< : *postgres-tinode-env-vars
"WAIT_FOR": "postgres:5432"
tinode-1:
environment:
<< : *postgres-tinode-env-vars
tinode-2:
environment:
<< : *postgres-tinode-env-vars
@@ -0,0 +1,24 @@
version: '3.8'
x-rethinkdb-tinode-env-vars: &rethinkdb-tinode-env-vars
"STORE_USE_ADAPTER": "rethinkdb"
services:
db:
image: rethinkdb:2.4.2
container_name: rethinkdb
healthcheck:
test: ["CMD", "curl -f http://localhost:8080/ || exit 1"]
tinode-0:
environment:
<< : *rethinkdb-tinode-env-vars
"WAIT_FOR": "rethinkdb:8080"
tinode-1:
environment:
<< : *rethinkdb-tinode-env-vars
tinode-2:
environment:
<< : *rethinkdb-tinode-env-vars
+187
View File
@@ -0,0 +1,187 @@
# Reference configuration for a simple 3-node Tinode cluster.
# Includes:
# * Mysql database
# * 3 Tinode servers
# * 3 exporters
version: '3.8'
# Base Tinode template.
x-tinode:
&tinode-base
depends_on:
- db
image: tinode/tinode:latest
restart: always
x-exporter:
&exporter-base
image: tinode/exporter:latest
restart: always
x-tinode-env-vars: &tinode-env-vars
"STORE_USE_ADAPTER": "mysql"
"PPROF_URL": "/pprof"
# You can provide your own tinode config by setting EXT_CONFIG env var and binding your configuration file to
# "EXT_CONFIG": "/etc/tinode/tinode.conf"
"WAIT_FOR": "mysql:3306"
# Push notifications.
# Modify as appropriate.
# Tinode Push Gateway configuration.
"TNPG_PUSH_ENABLED": "false"
# "TNPG_USER": "<user name>"
# "TNPG_AUTH_TOKEN": "<token>"
# FCM specific server configuration.
"FCM_PUSH_ENABLED": "false"
# "FCM_CRED_FILE": "<path to FCM credentials file>"
# "FCM_INCLUDE_ANDROID_NOTIFICATION": false
#
# FCM Web client configuration.
"FCM_API_KEY": "AIzaSyD6X4ULR-RUsobvs1zZ2bHdJuPz39q2tbQ"
"FCM_APP_ID": "1:114126160546:web:aca6ea2981feb81fb44dfb"
"FCM_PROJECT_ID": "tinode-1000"
"FCM_SENDER_ID": 114126160546
"FCM_VAPID_KEY": "BOgQVPOMzIMXUpsYGpbVkZoEBc0ifKY_f2kSU5DNDGYI6i6CoKqqxDd7w7PJ3FaGRBgVGJffldETumOx831jl58"
"FCM_MEASUREMENT_ID": "G-WNJDQR34L3"
# iOS app universal links configuration.
# "IOS_UNIV_LINKS_APP_ID": "<ios universal links app id>"
# Video calls
"WEBRTC_ENABLED": "false"
# "ICE_SERVERS_FILE": "<path to ICE servers config>"
x-exporter-env-vars: &exporter-env-vars
"TINODE_ADDR": "http://tinode.host:18080/stats/expvar/"
# InfluxDB configation:
"SERVE_FOR": "influxdb"
"INFLUXDB_VERSION": 1.7
"INFLUXDB_ORGANIZATION": "<your organization>"
"INFLUXDB_PUSH_INTERVAL": 30
"INFLUXDB_PUSH_ADDRESS": "https://mon.tinode.co/intake"
"INFLUXDB_AUTH_TOKEN": "<auth token>"
# Prometheus configuration:
# "SERVE_FOR": "prometheus"
# "PROM_NAMESPACE": "tinode"
# "PROM_METRICS_PATH": "/metrics"
services:
db:
image: mysql:8.0
container_name: mysql
restart: always
# Use your own volume.
# volumes:
# - <mysql directory in your file system>:/var/lib/mysql
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 5s
retries: 10
security_opt:
- seccomp=unconfined
# Tinode servers.
tinode-0:
<< : *tinode-base
container_name: tinode-0
hostname: tinode-0
# You can mount your volumes as necessary:
# volumes:
# # E.g. external config (assuming EXT_CONFIG is set).
# - <path to your tinode.conf>:/etc/tinode/tinode.conf
# # Logs directory.
# - <path to your tinode-0 logs directory>:/var/log
ports:
- "6060:6060"
environment:
<< : *tinode-env-vars
"CLUSTER_SELF": "tinode-0"
"RESET_DB": ${RESET_DB:-false}
"UPGRADE_DB": ${UPGRADE_DB:-false}
tinode-1:
<< : *tinode-base
container_name: tinode-1
hostname: tinode-1
# You can mount your volumes as necessary:
# volumes:
# # E.g. external config (assuming EXT_CONFIG is set).
# - <path to your tinode.conf>:/etc/tinode/tinode.conf
# # Logs directory.
# - <path to your tinode-1 logs directory>:/var/log
ports:
- "6061:6060"
environment:
<< : *tinode-env-vars
"CLUSTER_SELF": "tinode-1"
# Wait for tinode-0, not the database since
# we let tinode-0 perform all database initialization and upgrade work.
"WAIT_FOR": "tinode-0:6060"
"NO_DB_INIT": "true"
tinode-2:
<< : *tinode-base
container_name: tinode-2
hostname: tinode-2
# You can mount your volumes as necessary:
# volumes:
# # E.g. external config (assuming EXT_CONFIG is set).
# - <path to your tinode.conf>:/etc/tinode/tinode.conf
# # Logs directory.
# - <path to your tinode-2 logs directory>:/var/log
ports:
- "6062:6060"
environment:
<< : *tinode-env-vars
"CLUSTER_SELF": "tinode-2"
# Wait for tinode-0, not the database since
# we let tinode-0 perform all database initialization and upgrade work.
"WAIT_FOR": "tinode-0:6060"
"NO_DB_INIT": "true"
# Monitoring.
# Exporters are paired with tinode instances.
exporter-0:
<< : *exporter-base
container_name: exporter-0
hostname: exporter-0
depends_on:
- tinode-0
ports:
- 6222:6222
links:
- tinode-0:tinode.host
environment:
<< : *exporter-env-vars
"INSTANCE": "tinode-0"
"WAIT_FOR": "tinode-0:6060"
exporter-1:
<< : *exporter-base
container_name: exporter-1
hostname: exporter-1
depends_on:
- tinode-1
ports:
- 6223:6222
links:
- tinode-1:tinode.host
environment:
<< : *exporter-env-vars
"INSTANCE": "tinode-1"
"WAIT_FOR": "tinode-1:6060"
exporter-2:
<< : *exporter-base
container_name: exporter-2
hostname: exporter-2
depends_on:
- tinode-2
ports:
- 6224:6222
links:
- tinode-2:tinode.host
environment:
<< : *exporter-env-vars
"INSTANCE": "tinode-2"
"WAIT_FOR": "tinode-2:6060"
@@ -0,0 +1,30 @@
version: '3.8'
x-mongodb-tinode-env-vars: &mongodb-tinode-env-vars
"STORE_USE_ADAPTER": "mongodb"
services:
db:
image: mongo:4.2.3
container_name: mongodb
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
healthcheck:
test: ["CMD", "curl -f http://localhost:28017/ || exit 1"]
# Initializes MongoDb replicaset.
initdb:
image: mongo:4.2.3
container_name: initdb
depends_on:
- db
command: >
bash -c "echo 'Starting replica set initialize';
until mongo --host mongodb --eval 'print(\"waited for connection\")'; do sleep 2; done;
echo 'Connection finished';
echo 'Creating replica set';
echo \"rs.initiate({'_id': 'rs0', "members": [ {'_id': 0, 'host': 'mongodb:27017'} ]})\" | mongo --host mongodb"
tinode-0:
environment:
<< : *mongodb-tinode-env-vars
"WAIT_FOR": "mongodb:27017"
@@ -0,0 +1,16 @@
version: '3.8'
x-postgres-tinode-env-vars: &postgres-tinode-env-vars
"STORE_USE_ADAPTER": "postgres"
services:
db:
image: postgres:15.2
container_name: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
tinode-0:
environment:
<< : *postgres-tinode-env-vars
"WAIT_FOR": "postgres:5432"
@@ -0,0 +1,16 @@
version: '3.8'
x-rethinkdb-tinode-env-vars: &rethinkdb-tinode-env-vars
"STORE_USE_ADAPTER": "rethinkdb"
services:
db:
image: rethinkdb:2.4.0
container_name: rethinkdb
healthcheck:
test: ["CMD", "curl -f http://localhost:8080/ || exit 1"]
tinode-0:
environment:
<< : *rethinkdb-tinode-env-vars
"WAIT_FOR": "rethinkdb:8080"
+111
View File
@@ -0,0 +1,111 @@
# Reference configuration for a simple Tinode server.
# Includes:
# * Mysql database
# * Tinode server
# * Tinode exporters
version: '3.8'
# Base Tinode template.
x-tinode:
&tinode-base
depends_on:
- db
image: tinode/tinode:latest
restart: always
x-tinode-env-vars: &tinode-env-vars
"STORE_USE_ADAPTER": "mysql"
"PPROF_URL": "/pprof"
# You can provide your own tinode config by setting EXT_CONFIG env var and binding your configuration file to
# "EXT_CONFIG": "/etc/tinode/tinode.conf"
"WAIT_FOR": "mysql:3306"
# Push notifications.
# Modify as appropriate.
# Tinode Push Gateway configuration.
"TNPG_PUSH_ENABLED": "false"
# "TNPG_USER": "<user name>"
# "TNPG_AUTH_TOKEN": "<token>"
# FCM specific server configuration.
"FCM_PUSH_ENABLED": "false"
# "FCM_CRED_FILE": "<path to FCM credentials file>"
# "FCM_INCLUDE_ANDROID_NOTIFICATION": false
#
# FCM Web client configuration.
"FCM_API_KEY": "AIzaSyD6X4ULR-RUsobvs1zZ2bHdJuPz39q2tbQ"
"FCM_APP_ID": "1:114126160546:web:aca6ea2981feb81fb44dfb"
"FCM_PROJECT_ID": "tinode-1000"
"FCM_SENDER_ID": 114126160546
"FCM_VAPID_KEY": "BOgQVPOMzIMXUpsYGpbVkZoEBc0ifKY_f2kSU5DNDGYI6i6CoKqqxDd7w7PJ3FaGRBgVGJffldETumOx831jl58"
"FCM_MEASUREMENT_ID": "G-WNJDQR34L3"
# iOS app universal links configuration.
# "IOS_UNIV_LINKS_APP_ID": "<ios universal links app id>"
# Video calls
"WEBRTC_ENABLED": "false"
# "ICE_SERVERS_FILE": "<path to ICE servers config>"
x-exporter-env-vars: &exporter-env-vars
"TINODE_ADDR": "http://tinode.host:6060/stats/expvar/"
# InfluxDB configation:
"SERVE_FOR": "influxdb"
"INFLUXDB_VERSION": 1.7
"INFLUXDB_ORGANIZATION": "<your organization>"
"INFLUXDB_PUSH_INTERVAL": 30
"INFLUXDB_PUSH_ADDRESS": "https://mon.tinode.co/intake"
"INFLUXDB_AUTH_TOKEN": "<auth token>"
# Prometheus configuration:
# "SERVE_FOR": "prometheus"
# "PROM_NAMESPACE": "tinode"
# "PROM_METRICS_PATH": "/metrics"
services:
db:
image: mysql:8.0
container_name: mysql
restart: always
# Use your own volume.
# volumes:
# - <mysql directory in your file system>:/var/lib/mysql
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 5s
retries: 10
security_opt:
- seccomp=unconfined
# Tinode.
tinode-0:
<< : *tinode-base
container_name: tinode-0
hostname: tinode-0
# You can mount your volumes as necessary:
# volumes:
# # E.g. external config (assuming EXT_CONFIG is set).
# - <path to your tinode.conf>:/etc/tinode/tinode.conf
# # Logs directory.
# - <path to your tinode-0 logs directory>:/var/log
ports:
- "6060:6060"
environment:
<< : *tinode-env-vars
"RESET_DB": ${RESET_DB:-false}
"UPGRADE_DB": ${UPGRADE_DB:-false}
# Monitoring.
# Exporters are paired with tinode instances.
exporter-0:
container_name: exporter-0
hostname: exporter-0
depends_on:
- tinode-0
image: tinode/exporter:latest
restart: always
ports:
- "6222:6222"
links:
- tinode-0:tinode.host
environment:
<< : *exporter-env-vars
"WAIT_FOR": "tinode-0:6060"
View File
View File
View File
View File
View File