Commit Graph

35 Commits

Author SHA1 Message Date
Chris Lu
9b6bbf7d45 Remove volumePreallocate option from docker containers (#8451)
Some filesystems, such as XFS, may over-allocate disk spaces when using
volume preallocation. Remove this option from the default docker entrypoint
scripts to allow volumes to use only the necessary disk space.

Fixes: https://github.com/seaweedfs/seaweedfs/issues/6465#issuecomment-3964174718

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-25 22:11:15 -08:00
Chris Lu
40cc0e04a6 docker: fix entrypoint chown guard; helm: add openshift-values.yaml (#8390)
* Enforce IAM for s3tables bucket creation

* Prefer IAM path when policies exist

* Ensure IAM enforcement honors default allow

* address comments

* Reused the precomputed principal when setting tableBucketMetadata.OwnerAccountID, avoiding the redundant getAccountID call.

* get identity

* fix

* dedup

* fix

* comments

* fix tests

* update iam config

* go fmt

* fix ports

* fix flags

* mini clean shutdown

* Revert "update iam config"

This reverts commit ca48fdbb0afa45657823d98657556c0bbf24f239.

Revert "mini clean shutdown"

This reverts commit 9e17f6baffd5dd7cc404d831d18dd618b9fe5049.

Revert "fix flags"

This reverts commit e9e7b29d2f77ee5cb82147d50621255410695ee3.

Revert "go fmt"

This reverts commit bd3241960b1d9484b7900190773b0ecb3f762c9a.

* test/s3tables: share single weed mini per test package via TestMain

Previously each top-level test function in the catalog and s3tables
package started and stopped its own weed mini instance. This caused
failures when a prior instance wasn't cleanly stopped before the next
one started (port conflicts, leaked global state).

Changes:
- catalog/iceberg_catalog_test.go: introduce TestMain that starts one
  shared TestEnvironment (external weed binary) before all tests and
  tears it down after. All individual test functions now use sharedEnv.
  Added randomSuffix() for unique resource names across tests.
- catalog/pyiceberg_test.go: updated to use sharedEnv instead of
  per-test environments.
- catalog/pyiceberg_test_helpers.go -> pyiceberg_test_helpers_test.go:
  renamed to a _test.go file so it can access TestEnvironment which is
  defined in a test file.
- table-buckets/setup.go: add package-level sharedCluster variable.
- table-buckets/s3tables_integration_test.go: introduce TestMain that
  starts one shared TestCluster before all tests. TestS3TablesIntegration
  now uses sharedCluster. Extract startMiniClusterInDir (no *testing.T)
  for TestMain use. TestS3TablesCreateBucketIAMPolicy keeps its own
  cluster (different IAM config). Remove miniClusterMutex (no longer
  needed). Fix Stop() to not panic when t is nil."

* delete

* parse

* default allow should work with anonymous

* fix port

* iceberg route

The failures are from Iceberg REST using the default bucket warehouse when no prefix is provided. Your tests create random buckets, so /v1/namespaces was looking in warehouse and failing. I updated the tests to use the prefixed Iceberg routes (/v1/{bucket}/...) via a small helper.

* test(s3tables): fix port conflicts and IAM ARN matching in integration tests

- Pass -master.dir explicitly to prevent filer store directory collision
  between shared cluster and per-test clusters running in the same process
- Pass -volume.port.public and -volume.publicUrl to prevent the global
  publicPort flag (mutated from 0 → concrete port by first cluster) from
  being reused by a second cluster, causing 'address already in use'
- Remove the flag-reset loop in Stop() that reset global flag values while
  other goroutines were reading them (race → panic)
- Fix IAM policy Resource ARN in TestS3TablesCreateBucketIAMPolicy to use
  wildcards (arn:aws:s3tables:*:*:bucket/<name>) because the handler
  generates ARNs with its own DefaultRegion (us-east-1) and principal name
  ('admin'), not the test constants testRegion/testAccountID

* docker: fix entrypoint chown guard; helm: add openshift-values.yaml

Fix a regression in entrypoint.sh where the DATA_UID/DATA_GID
ownership comparison was dropped, causing chown -R /data to run
unconditionally on every container start even when ownership was
already correct. Restore the guard so the recursive chown is
skipped when the seaweed user already owns /data — making startup
faster on subsequent runs and a no-op on OpenShift/PVC deployments
where fsGroup has already set correct ownership.

Add k8s/charts/seaweedfs/openshift-values.yaml: an example Helm
overrides file for deploying SeaweedFS on OpenShift (or any cluster
enforcing the Kubernetes restricted Pod Security Standard). Replaces
hostPath volumes with PVCs, sets runAsUser/fsGroup to 1000
(the seaweed user baked into the image), drops all capabilities,
disables privilege escalation, and enables RuntimeDefault seccomp —
satisfying OpenShift's default restricted SCC without needing a
custom SCC or root access.

Fixes #8381"
2026-02-20 00:35:42 -08:00
Chris Lu
caca3bf427 Enable FIPS 140-3 compliant crypto by default (#7590)
* Enable FIPS 140-3 compliant crypto by default

Addresses #6889

- Enable GOEXPERIMENT=systemcrypto by default in all Makefiles
- Enable GOEXPERIMENT=systemcrypto by default in all Dockerfiles
- Go 1.24+ has native FIPS 140-3 support via this setting
- Users can disable by setting GOEXPERIMENT= (empty)

Algorithms used (all FIPS approved):
- AES-256-GCM for data encryption
- AES-256-CTR for SSE-C
- HMAC-SHA256 for S3 signatures
- TLS 1.2/1.3 for transport encryption

* Fix: Remove invalid GOEXPERIMENT=systemcrypto

Go 1.24 uses GODEBUG=fips140=on at runtime, not GOEXPERIMENT at build time.

- Remove GOEXPERIMENT=systemcrypto from all Makefiles
- Remove GOEXPERIMENT=systemcrypto from all Dockerfiles

FIPS 140-3 mode can be enabled at runtime:
  GODEBUG=fips140=on ./weed server ...

* Add FIPS 140-3 support enabled by default

Addresses #6889

- FIPS 140-3 mode is ON by default in Docker containers
- Sets GODEBUG=fips140=on via entrypoint.sh
- To disable: docker run -e GODEBUG=fips140=off ...
2025-12-01 12:17:58 -08:00
Chris Lu
2a05af2e14 docker: fix /data ownership and permission (#7451)
* docker: fix /data ownership and permission

* chown if not owned by seaweed user

* fix github tests

* comments

* fix the unquoted variables in the case pattern matching

* Update docker/entrypoint.sh

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update docker/entrypoint.sh

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update entrypoint.sh

* Update entrypoint.sh

* Update docker/entrypoint.sh

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-11-08 01:10:33 -08:00
Kaiwalya Joshi
47d335cf8c feat: Send commands to weed shell from the docker image.
Add the ability to send commands to weed shell from the docker image.

Allows an operator to perform maintenance commands like so:
```
docker run \
  --rm \
  -e SHELL_FILER=localhost:8888 \
  -e SHELL_MASTER=localhost:9333 \
  chrislusf/seaweedfs:local \
  "shell" \
  "fs.configure -locationPrefix=/buckets/foo -volumeGrowthCount=3 -replication=002 -apply"
```
2022-06-01 15:47:10 -07:00
chrislu
22362f6495 avoid too many logs in tmp folder 2022-02-27 02:44:10 -08:00
chrislu
73e3e77904 deprecate all cronjob module related code
related to https://github.com/chrislusf/seaweedfs/issues/2483
2021-12-05 01:20:47 -08:00
Chris Lu
bf5b795717 fix outdated cron job scripts
fix https://github.com/chrislusf/seaweedfs/issues/1881
2021-03-09 16:49:05 -08:00
suika
e932262b07 Allow custom command arguments to override default values in docker
Depending on a setup, 1GB volume limit is not the preferable size.
As weed can process multiple arguements and the later argument is the one to be used,
it is relatively easy to override the arguments defined in the entrypoint.

The arguments passed to the script will be shifted and appended at the end of the command. Since the first argument will fall into specific case, the argument can be predefined and the whole argument array shifted. Allowing to do "volume/server/master/etc $ARGS $@"
2020-10-21 01:47:29 +02:00
user
d116432775 POSIX shell compatibility 2020-10-08 19:40:18 +09:00
Chris Lu
ab4c9ac221 allow optionally change volume max count 2020-05-22 10:37:04 -07:00
Chris Lu
1e64dbcb98 Revert "allow overwrite flags"
This reverts commit 232b0f0e
2020-05-22 10:30:46 -07:00
Chris Lu
232b0f0e6e allow overwrite flags 2020-05-21 22:19:09 -07:00
Chris Lu
5c5ddc740d docker: entrypoint skip ip address detection 2020-03-25 14:39:43 -07:00
Chris Lu
3775211962 optimize entrypoint for docker 2020-03-22 18:35:45 -07:00
Chris Lu
06ff984786 set master ip in docker compose yaml file
fix https://github.com/chrislusf/seaweedfs/issues/1118
2019-12-11 21:38:54 -08:00
Chris Lu
784141c5e6 adjust script parameter 2019-06-05 01:48:03 -07:00
Chris Lu
dd4ef58d99 skip setting ip address for filer
related to https://github.com/chrislusf/seaweedfs/issues/960
2019-05-14 23:35:39 -07:00
Chris Lu
89f97777d9 docker adjust cronjob schedule, add volume.balance job 2019-05-05 21:42:41 -07:00
Zicklag
3895c86812 Add cronjob Mode For The Docker Container
fixes #907
2019-04-09 13:22:46 -05:00
Chris Lu
43e9dc3cf2 docker: add the /data/filerdb folder 2019-03-15 00:54:01 -07:00
Chris Lu
4b444d58ee create filerdb folder 2018-12-27 15:30:41 -08:00
Chris Lu
13715fb851 adjust docker builds 2018-12-27 15:15:33 -08:00
Chris Lu
68028ee876 clean up 2018-12-27 15:13:58 -08:00
Chris Lu
f84eb801ff fix mkdir path 2018-12-27 14:41:00 -08:00
Chris Lu
c4b15a98c6 ensure folder /data/filerdb 2018-12-27 14:35:41 -08:00
Chris Lu
fe3805d1cb Revert "use /data for filer"
This reverts commit 469afddc80.
2018-12-27 14:29:34 -08:00
Chris Lu
469afddc80 use /data for filer 2018-12-27 14:28:28 -08:00
Chris Lu
3078cb96a9 docker filer default to /data/filerdb 2018-12-26 20:46:07 -08:00
Chris Lu
a508d56021 docker entry point fix for s3 2018-12-25 14:27:48 -08:00
Chris Lu
39bf274a83 WIP 2018-12-16 22:39:39 -08:00
Chris Lu
3e899bfc68 add s3 for docker 2018-12-16 15:40:52 -08:00
jenkins.ow
bc025d5305 add filer to docker-compose and entrypoint, build from local Dockerfile 2018-09-11 12:37:27 -07:00
Amin Cheloh
48a24559a3 Update entrypoint.sh
Running application becomes container's PID 1 allow to receives Unix signals
2016-10-12 16:47:56 +07:00
Jesper Zedlitz
1c36706306 Changed Dockerfile so it uses a special entrypoint script. All parameters are passed through to weed. Depending on the command the entrypoint.sh script adds parameters to link containers. 2016-09-08 09:19:06 +02:00