Skip to content

Commit 3f81187

Browse files
authored
Merge pull request #1 from haiphamhoang/v5
Upgrade to version 5.2.7
2 parents 3c51238 + f1fbb28 commit 3f81187

File tree

9 files changed

+260
-103
lines changed

9 files changed

+260
-103
lines changed

.env

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
# system settings
3+
TIME_ZONE='Europe/Berlin'
4+
5+
# seatable server url
6+
SEATABLE_SERVER_HOSTNAME=localhost
7+
SEATABLE_SERVER_PROTOCOL='http'
8+
9+
# initial web admin
10+
SEATABLE_ADMIN_EMAIL=dev@localhost.xyz
11+
SEATABLE_ADMIN_PASSWORD=adminpassword
12+
13+
# database
14+
SEATABLE_MYSQL_ROOT_PASSWORD=abcrootpassword

.github/workflows/docker-build-publish.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,26 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@v4
4242

4343
# Install the cosign tool except on PR
4444
# https://github.com/sigstore/cosign-installer
4545
- name: Install cosign
4646
if: github.event_name != 'pull_request'
47-
uses: sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 #v2.6.0
47+
uses: sigstore/cosign-installer@v3.5.0
4848
with:
49-
cosign-release: 'v1.13.1'
49+
cosign-release: 'v2.2.4'
5050

5151

5252
# Workaround: https://github.com/docker/build-push-action/issues/461
5353
- name: Setup Docker buildx
54-
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
54+
uses: docker/setup-buildx-action@v3
5555

5656
# Login against a Docker registry except on PR
5757
# https://github.com/docker/login-action
5858
- name: Log into registry ${{ env.REGISTRY }}
5959
if: github.event_name != 'pull_request'
60-
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
60+
uses: docker/login-action@v3
6161
with:
6262
registry: ${{ env.REGISTRY }}
6363
username: ${{ github.actor }}
@@ -67,18 +67,18 @@ jobs:
6767
# https://github.com/docker/metadata-action
6868
- name: Extract Docker metadata
6969
id: meta
70-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
70+
uses: docker/metadata-action@v5
7171
with:
7272
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7373
tags: |
7474
type=raw,value=${{ github.event.inputs.seatable_version }}
7575
type=raw,value=latest
7676
77-
# Build and push Docker image with Buildx (don't push on PR)
77+
# Build and push Docker image with Buildx
7878
# https://github.com/docker/build-push-action
7979
- name: Build and push Docker image
8080
id: build-and-push
81-
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
81+
uses: docker/build-push-action@v5
8282
with:
8383
context: .
8484
build-args: |
@@ -98,7 +98,9 @@ jobs:
9898
- name: Sign the published Docker image
9999
if: ${{ github.event_name != 'pull_request' }}
100100
env:
101-
COSIGN_EXPERIMENTAL: "true"
101+
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
102+
TAGS: ${{ steps.meta.outputs.tags }}
103+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
102104
# This step uses the identity token to provision an ephemeral certificate
103105
# against the sigstore community Fulcio instance.
104-
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
106+
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
test/
1+
seatable-license.txt

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ FROM seatable/seatable-enterprise:${SEATABLE_VERSION}
33

44
# Maintainer
55
LABEL maintainer="HaiPhamHoang" \
6-
version="1.0.0" \
76
seatable_version="${SEATABLE_VERSION}" \
87
description="Seatable with some custom config." \
98
url="https://github.com/haiphamhoang/seatable-enterprise-docker"

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
# docker-seatable
22

3-
## Env
3+
## Addition Enviroments
44

55
- REDIS_HOST: `string`
6-
- MEMCACHED_HOST: `string`
7-
- SEATABLE_SERVER_URL_FORCE_HTTPS: `bool`
86
- it's useful when use with reverse proxy like traefik.
97
- DB_ROOT_PASSWD_FILE: `filepath`
108

119

1210

1311

14-
# Dev
12+
# Develop
1513

1614
## Upgrade
1715
### Checking new script
1816
1. Run container with new seatable/seatable-enterprise:latest version, using default [docker-compose.yml](https://manual.seatable.io/docker/Enterprise-Edition/Deploy%20SeaTable-EE%20with%20Docker/#downloading-and-modifying-docker-composeyml)
19-
2. copy file at `/templates/`
17+
18+
2. Run `docker-compose up -d` to start the container
19+
20+
3. copy file at `/templates/`
21+
```
22+
docker cp seatable-server:/templates test/templates
2023
```
21-
docker cp CONTAINER:/templates test/templates
24+
25+
## Test Dockerfile
26+
2227
```
28+
docker compose up --build
29+
```

docker-compose.override.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
seatable-server:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
args:
7+
SEATABLE_VERSION: ${SEATABLE_VERSION:-5.2.7}

docker-compose.yml

Lines changed: 92 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,100 @@
1-
version: '3.9'
2-
services:
3-
db:
4-
image: mariadb:10.5
5-
container_name: seatable-mysql
6-
environment:
7-
- MYSQL_ROOT_PASSWORD=hellopassword
8-
- MYSQL_LOG_CONSOLE=true
9-
#volumes:
10-
#- /opt/seatable/mysql-data:/var/lib/mysql # Volume of MySQL (directory for persistent storage) and mount point in container -- can be changed (not advised)
11-
networks:
12-
- seatable-net
131

14-
memcached:
15-
image: memcached:1.5.6
16-
container_name: seatable-memcached
17-
entrypoint: memcached -m 256
18-
networks:
19-
- seatable-net
2+
networks:
3+
frontend-net:
4+
name: frontend-net
5+
backend-seatable-net:
6+
name: backend-seatable-net
207

21-
redis:
22-
image: redis:5.0.7
23-
container_name: seatable-redis
24-
networks:
25-
- seatable-net
268

27-
seatable:
28-
#image: seatable/seatable-enterprise:latest
29-
build:
30-
context: .
31-
args:
32-
SEATABLE_VERSION: '3.1.13'
33-
container_name: seatable
34-
ports:
35-
- "80:80" # HTTP port on the Docker host and the port in the container -- must be changed if port 80 is already in use on Docker host
36-
# - "443:443" # HTTPS port on the Docker host and the port in the container -- must be changed if port 443 is already in use on Docker host
9+
services:
10+
seatable-server:
11+
image: ${SEATABLE_IMAGE:-seatable/seatable-enterprise:5.2.7}
12+
container_name: seatable-server
3713
volumes:
38-
- /opt/seatable/seatable-data:/shared # Volume of SeaTable (directory for persistent storage) and mount point in container -- can be changed (not advised)
14+
- type: bind
15+
source: "./seatable-license.txt"
16+
target: "/shared/seatable/seatable-license.txt"
17+
read_only: ${SEATABLE_LICENSE_FORCE_READ_ONLY:-false}
18+
ports:
19+
- "80:80"
3920
environment:
40-
- DB_HOST=seatable-mysql
41-
#- DB_ROOT_PASSWD=hellopassword # Root password of MySQL -- must be changed to the value set above
42-
- DB_ROOT_PASSWD_FILE=/run/secrets/shared_mysql_root_password
43-
- REDIS_HOST=seatable-redis
44-
- MEMCACHED_HOST=seatable-memcached
45-
- SEATABLE_SERVER_URL_FORCE_HTTPS=True
46-
- SEATABLE_SERVER_LETSENCRYPT=False # Decision on whether or not to use Let's Encrypt for HTTPS, default is False -- must be changed to True if a Let's Encrypt SSL certificate is to be used
47-
- SEATABLE_SERVER_HOSTNAME=seatable.example.com # Host name -- must be changed
48-
- TIME_ZONE=Etc/UTC # Optional, default is UTC. Example: Europe/Berlin. Choices can be found here: http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
21+
- DB_HOST=mariadb
22+
- DB_ROOT_PASSWD=${SEATABLE_MYSQL_ROOT_PASSWORD:?Variable is not set or empty}
23+
- SEATABLE_SERVER_HOSTNAME=${SEATABLE_SERVER_HOSTNAME:?Variable is not set or empty}
24+
- SEATABLE_SERVER_PROTOCOL=${SEATABLE_SERVER_PROTOCOL:-https}
25+
- SEATABLE_ADMIN_EMAIL=${SEATABLE_ADMIN_EMAIL:?Variable is not set or empty}
26+
- SEATABLE_ADMIN_PASSWORD=${SEATABLE_ADMIN_PASSWORD:?Variable is not set or empty}
27+
- TIME_ZONE=${TIME_ZONE}
28+
- PYTHON_SCHEDULER_URL=${PYTHON_SCHEDULER_URL:-http://python-scheduler}
29+
- PYTHON_SCHEDULER_AUTH_TOKEN=${PYTHON_SCHEDULER_AUTH_TOKEN:-}
30+
- REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
31+
- SEATABLE_EMAIL_USE_TLS=${SEATABLE_EMAIL_USE_TLS:-}
32+
- SEATABLE_EMAIL_HOST=${SEATABLE_EMAIL_HOST:-}
33+
- SEATABLE_EMAIL_HOST_USER=${SEATABLE_EMAIL_HOST_USER:-}
34+
- SEATABLE_EMAIL_HOST_PASSWORD=${SEATABLE_EMAIL_HOST_PASSWORD:-}
35+
- SEATABLE_EMAIL_PORT=${SEATABLE_EMAIL_PORT:-}
36+
- SEATABLE_DEFAULT_FROM_EMAIL=${SEATABLE_DEFAULT_FROM_EMAIL:-}
37+
- SEATABLE_SERVER_EMAIL=${SEATABLE_SERVER_EMAIL:-}
38+
- SEATABLE_SHOW_TEMPLATES_LINK=${SEATABLE_SHOW_TEMPLATES_LINK:-}
39+
- SEATABLE_TEMPLATE_BASE_API_TOKEN=${SEATABLE_TEMPLATE_BASE_API_TOKEN:-}
40+
- SEATABLE_TEMPLATE_TABLE_NAME=${SEATABLE_TEMPLATE_TABLE_NAME:-}
41+
- SEATABLE_ENABLE_CREATE_BASE_FROM_TEMPLATE=${SEATABLE_ENABLE_CREATE_BASE_FROM_TEMPLATE:-}
42+
- SEATABLE_HELP_LINK=${SEATABLE_HELP_LINK:-https://docs.seatable.io}
43+
- SEATABLE_LOG_LEVEL=${SEATABLE_LOG_LEVEL:-INFO}
44+
45+
4946
depends_on:
50-
- db
51-
- memcached
52-
- redis
47+
mariadb:
48+
condition: service_healthy
49+
redis:
50+
condition: service_healthy
5351
networks:
54-
- seatable-net
52+
- frontend-net
53+
- backend-seatable-net
54+
# healthcheck specifically for dtable-web
55+
healthcheck:
56+
test: ["CMD-SHELL", "curl --fail http://localhost:8000 || exit 1"]
57+
interval: 20s
58+
retries: 3
59+
start_period: 30s
60+
timeout: 10s
5561

56-
networks:
57-
seatable-net:
62+
mariadb:
63+
image: ${SEATABLE_DB_IMAGE:-mariadb:11.4.3-noble}
64+
restart: unless-stopped
65+
container_name: mariadb
66+
environment:
67+
- MYSQL_ROOT_PASSWORD=${SEATABLE_MYSQL_ROOT_PASSWORD:?Variable is not set or empty}
68+
- MYSQL_LOG_CONSOLE=true
69+
- MARIADB_AUTO_UPGRADE=1
70+
- TZ=${TIME_ZONE}
71+
networks:
72+
- backend-seatable-net
73+
healthcheck:
74+
test:
75+
[
76+
"CMD",
77+
"/usr/local/bin/healthcheck.sh",
78+
"--connect",
79+
"--mariadbupgrade",
80+
"--innodb_initialized",
81+
]
82+
interval: 20s
83+
retries: 3
84+
start_period: 30s
85+
timeout: 10s
86+
# On older database containers without healthcheck users present you might need to create them manually,
87+
# otherwise the container stays unhealthy.
88+
# more info at https://admin.seatable.io/upgrade/extra-upgrade-notice/
89+
90+
redis:
91+
image: ${SEATABLE_REDIS_IMAGE:-redis:7.2.7-bookworm}
92+
restart: unless-stopped
93+
container_name: redis
94+
networks:
95+
- backend-seatable-net
96+
healthcheck:
97+
test: ["CMD", "redis-cli", "ping"]
98+
interval: 20s
99+
retries: 3
100+
timeout: 5s

templates/enterpoint.sh

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ function log() {
88
}
99

1010

11-
# load env function
12-
function load_env() {
13-
log "Load custom env"
11+
# load additional DB_ROOT_PASSWD_FILE variables
12+
function load_additional_filepath_env() {
13+
log "Load additional filepath env"
1414
env_var="DB_ROOT_PASSWD"
1515
file_env_var="${env_var}_FILE"
1616
if [[ -n "${!file_env_var:-}" ]]; then
1717
if [[ -r "${!file_env_var:-}" ]]; then
18-
export "ok=abcd"
1918
export "${env_var}=$(< "${!file_env_var}")"
2019
unset "${file_env_var}"
2120
else
@@ -24,11 +23,15 @@ function load_env() {
2423
fi
2524
}
2625

26+
is_first_start=0
2727
# init config
2828
if [ "`ls -A /opt/seatable/conf`" = "" ]; then
2929
log "Start init"
30-
load_env
31-
30+
31+
is_first_start=1
32+
33+
load_additional_filepath_env
34+
3235
/templates/seatable.sh init-sql &>> /opt/seatable/logs/init.log
3336

3437
/templates/seatable.sh init &>> /opt/seatable/logs/init.log
@@ -90,6 +93,11 @@ if [[ -f /shared/ssl/renew_cert ]]; then
9093
fi
9194

9295

96+
# update truststore
97+
log "Updating CA certificates..."
98+
update-ca-certificates --verbose &>> /opt/seatable/logs/init.log
99+
100+
93101
# logrotate
94102
if [[ -f /var/spool/cron/crontabs/root ]]; then
95103
cat /templates/logrotate-conf/logrotate-cron >> /var/spool/cron/crontabs/root
@@ -100,8 +108,35 @@ else
100108
fi
101109

102110

111+
# auto start
112+
if [[ $SEATABLE_START_MODE = "cluster" ]] || [[ -f /opt/seatable/conf/seatable-controller.conf ]] ;then
113+
# cluster mode
114+
log "Start cluster server"
115+
/templates/seatable.sh start
116+
117+
else
118+
# auto upgrade sql
119+
/templates/seatable.sh python-env /templates/upgrade_sql.py &>> /opt/seatable/logs/init.log
120+
sleep 5
121+
122+
# auto start
123+
log "Start server"
124+
/templates/seatable.sh start
125+
126+
# init superuser
127+
if [[ ${is_first_start} -eq 1 ]]; then
128+
sleep 5
129+
log "Auto create superuser"
130+
/templates/seatable.sh auto-create-superuser ${is_first_start} &>> /opt/seatable/logs/init.log &
131+
fi
132+
133+
fi
134+
135+
log "For more startup information, please check the /opt/seatable/logs/init.log"
136+
137+
103138
#
104-
log "This is an idle script (infinite loop) to keep container running."
139+
log "This is an idle script (infinite loop) to keep the container running."
105140

106141
function cleanup() {
107142
kill -s SIGTERM $!

0 commit comments

Comments
 (0)