Ir al contenido

DOC-03: Deployment, Security, and Commissioning

Tactical procedure and security best practices for local permission provisioning, immutable secret generation, and controlled startup of the Redmine stack.

0views

1. Permission Management (Critical Step in Linux)

Sección titulada «1. Gestión de Permisos (Paso Crítico en Linux)»

Unlike other file systems in testing environments, volumes mounted within containers in corporate Linux environments require strict ownership and permission assignment to ensure security. The Redmine internal engine executes its threads under an isolated system user with the identifier (UID/GID) 999.

If we omit the ownership change on the Ubuntu host, the application will start, but it will fail immediately when attempting to write attachments, compile custom stylesheets, or dump log traces, causing silent exceptions in the database.

Before initializing the infrastructure, execute the permission sanitization command from the working directory in the host terminal:

Ventana de terminal
cd ~/redmine
# Saneamiento recursivo de carpetas expuestas al contenedor
sudo chown -R 999:999 files themes plugins mysql_data config

[!WARNING] Access Security: Under no circumstances should you assign global permissive permissions like chmod -R 777 to these folders in enterprise environments. This would open serious vulnerability vectors for remote file injection if any Redmine plugin were to have security breaches.


Redmine stores session tokens in an encrypted manner in client cookies using the declarative key SECRET_KEY_BASE. To prevent session hijacking or malicious interception in the browser, this key must be high-entropy and kept completely immutable and secret.

If in the future you need to regenerate the key due to a periodic cybersecurity audit, execute the secure cryptographic randomness command:

Ventana de terminal
openssl rand -hex 64

Copy the resulting alphanumeric block and immediately update the SECRET_KEY_BASE variable in your docker-compose.yml file before the stack restart.


To compile, structure, and spin up isolated network dependencies and persistence containers in daemon mode (background):

Ventana de terminal
cd ~/redmine
docker compose up -d

Docker Compose will automatically create the virtual networks, mount the configured volumes, and wait for the MySQL database engine to be ready to initialize the Redmine SQL structure.


Ensure the correct startup of services using tactical debugging commands:

Ventana de terminal
docker compose ps

Success Criterion: Both containers (redmine and redmine_db) must show the status Up or healthy.

To analytically monitor the database initialization process and the internal table migration executed by Rails:

Ventana de terminal
docker compose logs -f redmine

Expected Output: Look for the active socket logs at the end of the flow: Listening on 0.0.0.0:3000 (which is externally mapped to the corporate secure port 5588).


  • Frequent Causes:
    • Missing owner permissions in the host's shared directories (omission of the chown command).
    • Syntax indentation errors in the docker-compose.yml YAML file.
  • Solution: Stop the engine (docker compose down), verify detailed socket error logs via docker compose logs, and rerun the permission correction with chown -R 999:999.
  • Frequent Cause:
    • The name assigned to the REDMINE_DB_MYSQL variable does not exactly match the service name declaration in the Compose file.
  • Solution: Open the orchestration file and ensure both blocks share the unified DNS identifier: redmine_db.

  • ✓ Correct File Ownership: All mounted directories configured with UID/GID 999 to prevent write exceptions.
  • ✓ Robust Session Secrets: SECRET_KEY_BASE variable generated with OpenSSL and isolated from public environments.
  • ✓ Active Network Sockets: Secure mapping on port 5588 responding correctly with Rails log redirection.
  • ✓ Coupled Orchestration: Main application service prevented from immediate startup via depends_on directive until successful MySQL initialization.