Skip to content

Commit fcdb847

Browse files
committed
feat: initial scaffold for it-stack-nextcloud (Module 06)
Adds complete 6-lab structure: - 6 Docker Compose environments (standalone -> production) - 6 lab test scripts (06-01 through 06-06) - Architecture, Deployment, Troubleshooting docs - 6 lab guide docs - Module manifest: it-stack-nextcloud.yml - Makefile, Dockerfile, GitHub Actions CI/Release
1 parent 222d6fd commit fcdb847

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1618
-0
lines changed

.env.example

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# it-stack-nextcloud — Example environment variables
2+
# Copy to .env and fill in values
3+
4+
# Database
5+
DB_HOST=lab-db1
6+
DB_PORT=5432
7+
DB_NAME=nextcloud_db
8+
DB_USER=nextcloud_user
9+
DB_PASSWORD=CHANGE_ME
10+
11+
# Redis
12+
REDIS_HOST=lab-db1
13+
REDIS_PORT=6379
14+
15+
# Keycloak SSO
16+
KEYCLOAK_URL=https://lab-id1:8443
17+
KEYCLOAK_REALM=it-stack
18+
KEYCLOAK_CLIENT_ID=nextcloud
19+
KEYCLOAK_CLIENT_SECRET=CHANGE_ME
20+
21+
# Logging
22+
GRAYLOG_HOST=lab-proxy1
23+
GRAYLOG_PORT=12201

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Validate docker-compose files
16+
run: |
17+
for f in docker/docker-compose.*.yml; do
18+
echo "Validating \..."
19+
docker compose -f "\" config -q
20+
done
21+
- name: Lint shell scripts
22+
run: |
23+
sudo apt-get install -y shellcheck
24+
shellcheck tests/labs/*.sh docker/entrypoint.sh
25+
26+
test-lab-01:
27+
name: Lab 01 — Standalone
28+
runs-on: ubuntu-latest
29+
needs: lint
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Run Lab 01
33+
run: bash tests/labs/test-lab-06-01.sh
34+
35+
security-scan:
36+
name: Security Scan
37+
runs-on: ubuntu-latest
38+
needs: lint
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Run Trivy on Dockerfile
42+
uses: aquasecurity/trivy-action@master
43+
with:
44+
scan-type: config
45+
scan-ref: .

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*.*.*']
6+
7+
jobs:
8+
build-and-push:
9+
name: Build and Push Docker Image
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Log in to GHCR
17+
uses: docker/login-action@v3
18+
with:
19+
registry: ghcr.io
20+
username: ${{ github.actor }}
21+
password: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Extract metadata
23+
id: meta
24+
uses: docker/metadata-action@v5
25+
with:
26+
images: ghcr.io/it-stack-dev/it-stack-nextcloud
27+
- name: Build and push
28+
uses: docker/build-push-action@v5
29+
with:
30+
context: .
31+
push: true
32+
tags: ${{ steps.meta.outputs.tags }}
33+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Secrets
2+
.env
3+
.env.*
4+
!.env.example
5+
configs/secrets/
6+
*.key
7+
*.pem
8+
*.crt
9+
10+
# Docker volumes
11+
data/
12+
volumes/
13+
14+
# Terraform
15+
.terraform/
16+
*.tfstate
17+
18+
# Ansible
19+
*.retry

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog — IT-Stack NEXTCLOUD
2+
3+
All notable changes to this module are documented here.
4+
Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5+
Versioning: [SemVer](https://semver.org/spec/v2.0.0.html)
6+
7+
## [Unreleased]
8+
9+
### Added
10+
- Initial module scaffold with 6-lab structure
11+
- Docker Compose files for all 6 lab environments
12+
- Lab test scripts (06-01 through 06-06)
13+
- Architecture, deployment, and troubleshooting documentation
14+
- GitHub Actions CI/CD workflows
15+
- Module manifest: it-stack-nextcloud.yml
16+
17+
## [0.1.0] — 2026-02-27
18+
19+
- Initial repository scaffold

CODE_OF_CONDUCT.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Code of Conduct
2+
3+
This project follows the Contributor Covenant Code of Conduct.
4+
See the organization-level policy:
5+
https://github.com/it-stack-dev/.github/blob/main/CODE_OF_CONDUCT.md
6+
7+
## Enforcement
8+
9+
Violations may be reported to: **conduct@it-stack.lab**

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Contributing to IT-Stack NEXTCLOUD
2+
3+
Thank you for contributing to this module!
4+
5+
Please read the organization-level contribution guidelines first:
6+
https://github.com/it-stack-dev/.github/blob/main/CONTRIBUTING.md
7+
8+
## Module-Specific Notes
9+
10+
- This is **Module 06** in the IT-Stack platform
11+
- All changes must preserve the 6-lab testing progression
12+
- Lab 06-01 (Standalone) must always work without external dependencies
13+
- Test with make test-lab-01 before submitting a PR
14+
15+
## Development Setup
16+
17+
```bash
18+
git clone https://github.com/it-stack-dev/it-stack-nextcloud.git
19+
cd it-stack-nextcloud
20+
make install
21+
make test
22+
```
23+
24+
## Submitting Changes
25+
26+
1. Branch from develop: git checkout -b feature/your-feature develop
27+
2. Make your changes
28+
3. Run make test-lab-01 to verify standalone still works
29+
4. Open a PR targeting develop

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Dockerfile — IT-Stack NEXTCLOUD wrapper
2+
# Module 06 | Category: collaboration | Phase: 2
3+
# Base image: nextcloud:28-apache
4+
5+
FROM nextcloud:28-apache
6+
7+
# Labels
8+
LABEL org.opencontainers.image.title="it-stack-nextcloud" \
9+
org.opencontainers.image.description="Nextcloud file sync, calendar, and office suite" \
10+
org.opencontainers.image.vendor="it-stack-dev" \
11+
org.opencontainers.image.licenses="Apache-2.0" \
12+
org.opencontainers.image.source="https://github.com/it-stack-dev/it-stack-nextcloud"
13+
14+
# Copy custom configuration and scripts
15+
COPY src/ /opt/it-stack/nextcloud/
16+
COPY docker/entrypoint.sh /entrypoint.sh
17+
RUN chmod +x /entrypoint.sh
18+
19+
# Health check
20+
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
21+
CMD curl -f http://localhost/health || exit 1
22+
23+
ENTRYPOINT ["/entrypoint.sh"]

LICENSE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Apache License
2+
Version 2.0, January 2004
3+
http://www.apache.org/licenses/
4+
5+
Copyright 2026 it-stack-dev contributors
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.

Makefile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Makefile — IT-Stack NEXTCLOUD (Module 06)
2+
.PHONY: help build install test test-lab-01 test-lab-02 test-lab-03 \
3+
test-lab-04 test-lab-05 test-lab-06 deploy clean lint
4+
5+
COMPOSE_STANDALONE = docker/docker-compose.standalone.yml
6+
COMPOSE_LAN = docker/docker-compose.lan.yml
7+
COMPOSE_ADVANCED = docker/docker-compose.advanced.yml
8+
COMPOSE_SSO = docker/docker-compose.sso.yml
9+
COMPOSE_INTEGRATION= docker/docker-compose.integration.yml
10+
COMPOSE_PRODUCTION = docker/docker-compose.production.yml
11+
12+
help: ## Show this help
13+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
14+
15+
build: ## Build Docker image
16+
docker build -t it-stack/nextcloud:latest .
17+
18+
install: ## Start standalone (Lab 01) environment
19+
docker compose -f $$(COMPOSE_STANDALONE) up -d
20+
@echo "Waiting for nextcloud to be ready..."
21+
@sleep 10
22+
@docker compose -f $$(COMPOSE_STANDALONE) ps
23+
24+
test: test-lab-01 ## Run default test (Lab 01)
25+
26+
test-lab-01: ## Lab 01 — Standalone
27+
@bash tests/labs/test-lab-06-01.sh
28+
29+
test-lab-02: ## Lab 02 — External Dependencies
30+
@bash tests/labs/test-lab-06-02.sh
31+
32+
test-lab-03: ## Lab 03 — Advanced Features
33+
@bash tests/labs/test-lab-06-03.sh
34+
35+
test-lab-04: ## Lab 04 — SSO Integration
36+
@bash tests/labs/test-lab-06-04.sh
37+
38+
test-lab-05: ## Lab 05 — Advanced Integration
39+
@bash tests/labs/test-lab-06-05.sh
40+
41+
test-lab-06: ## Lab 06 — Production Deployment
42+
@bash tests/labs/test-lab-06-06.sh
43+
44+
deploy: ## Deploy to target server (lab-app1)
45+
ansible-playbook -i ansible/inventory.yml ansible/playbooks/deploy-nextcloud.yml
46+
47+
clean: ## Stop and remove all containers and volumes
48+
docker compose -f $$(COMPOSE_STANDALONE) down -v --remove-orphans
49+
docker compose -f $$(COMPOSE_LAN) down -v --remove-orphans 2>/dev/null || true
50+
docker compose -f $$(COMPOSE_ADVANCED) down -v --remove-orphans 2>/dev/null || true
51+
52+
lint: ## Lint docker-compose and shell scripts
53+
docker compose -f $$(COMPOSE_STANDALONE) config -q
54+
@for f in tests/labs/*.sh; do shellcheck $$f; done

0 commit comments

Comments
 (0)