Sin descripción

mathias.riechsteiner 1816c2859e feat: assign static IP addresses to Docker containers for consistent networking hace 1 año
docs 6906e47936 Restructure Keycloak roles and groups with realm prefixes hace 1 año
src 1816c2859e feat: assign static IP addresses to Docker containers for consistent networking hace 1 año
.gitignore 822d2f577b Add persistent volumes for Keycloak and configuration improvements for Nextcloud and SSL hace 1 año
README.md 25b61a19be Add Keycloak integration, SSL setup script, and NGINX reverse proxy hace 1 año
TODO.md cd2c5c1b8b Initial setup of AutoMate project with Paperless-ngx, Docker Compose, and project documentation hace 1 año
tmp.yml 1816c2859e feat: assign static IP addresses to Docker containers for consistent networking hace 1 año

README.md

AutoMate Project

Overview

AutoMate is a one-person IT automation project designed to streamline and automate administrative tasks. This project aims to minimize manual work for tasks such as document processing, task management, billing, and reporting through open-source, on-premise tools.

Project Structure

  • docs/: Documentation for setup, usage, and maintenance.
  • src/: Main codebase, including Docker configuration and automation scripts.
    • configs/: Configuration files for different services.
    • configs/nginx: Configuration files for the NGINX reverse proxy.
    • docker/: Docker Compose configuration files.
    • scripts/: Custom scripts (e.g., for installation, SSL certificate generation).
  • data/: Persistent data storage (e.g., databases).
  • logs/: Application logs.

Environment Variables

Create a .env file in the project root with the following placeholders (to be replaced with actual values):

# Paperless-ngx Configuration
PAPERLESS_DB_USER=myuser
PAPERLESS_DB_PASSWORD=randomGeneratedPassword
PAPERLESS_SECRET_KEY=randomGeneratedSecret

# Nextcloud Configuration
NEXTCLOUD_ADMIN_USER=admin
NEXTCLOUD_ADMIN_PASSWORD=randomGeneratedPassword

# Database Configuration for Nextcloud
MYSQL_ROOT_PASSWORD=randomGeneratedPassword
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud
MYSQL_PASSWORD=randomGeneratedPassword

# Kimai Database Configuration
KIMAI_DB_DATABASE=kimai
KIMAI_DB_USER=kimai_user
KIMAI_DB_PASSWORD=randomGeneratedPassword
KIMAI_DB_ROOT_PASSWORD=randomGeneratedPassword

# Kimai Admin User Configuration
KIMAI_ADMIN_USER=kiami_admin_user  
KIMAI_ADMIN_PASSWORD=randomGeneratedPassword
KIMAI_ADMIN_EMAIL=kiami@admin.email

# Keycloak Configuration
KEYCLOAK_ADMIN_USER=admin
KEYCLOAK_ADMIN_PASSWORD=randomGeneratedPassword
KEYCLOAK_DB=keycloak
KEYCLOAK_DB_USERNAME=keycloak_user
KEYCLOAK_DB_PASSWORD=randomGeneratedPassword

# N8N Configuration
N8N_USER=n8n_user
N8N_PASSWORD=randomGeneratedPassword

Installation

Step 1: Install Docker

To install Docker on a new system, you can use the provided installation script. Run the following commands in the src/scripts directory:

cd ~/AutoMate/src/scripts
./install_docker.sh

This script will install Docker and add the current user to the Docker group. Note: You will need to log out and log back in for the group permissions to take effect.

Step 2: Docker Compose Setup

  1. Navigate to the Docker Config Directory:

    cd ~/AutoMate/src/docker
    
  2. Start Docker Compose:

Use Docker Compose to start all configured services.

   docker-compose up -d
  1. Check Status:

To confirm that all services are running, use:

   docker-compose ps

SSL Certificate Setup

The project includes a script to generate self-signed SSL certificates for local development.

  1. Run the SSL Generation Script:

    cd ~/AutoMate/src/scripts
    ./generate_ssl_certificate.sh -d "mrx8086.com" -o "../configs/certs" -t 365 -p "yourPfxPassword"
    
  2. Generated Files:

    • .crt and .key files for NGINX in configs/certs.
    • .pfx file for importing into Windows to prevent SSL errors.

NGINX Reverse Proxy

NGINX is used as a reverse proxy to route traffic to different services via subdomains (e.g., auth.mrx8086.com for Keycloak).

Configuration

The NGINX configuration is stored in src/configs/nginx/nginx.conf. It is set up to handle:

  • Keycloak at auth.mrx8086.com
  • Nextcloud at cloud.mrx8086.com
  • Paperless at docs.mrx8086.com
  • Kimai at time.mrx8086.com
  • n8n at automate.mrx8086.com

Make sure to add these subdomains to your hosts file for local testing.

Creating an Admin User for Paperless-ngx

After starting the Paperless-ngx service for the first time, you need to create a superuser (admin) account to access the interface. Follow these steps:

  1. Run the following command in your project directory to enter the Paperless-ngx container:

    docker-compose exec paperless python3 manage.py createsuperuser
    
  2. Provide the Required Information:

    • Enter a username for the admin account.
    • Provide an email address.
    • Set a password.
  3. Log In to Paperless-ngx:

    • Open your web browser and go to http://docs.mrx8086.com.
    • Use the username and password you just created to log in as the admin.

Setting Up Kimai (Time Tracking)

  1. Access Kimai:
    • Open your web browser and go to http://time.mrx8086.com.
    • Log in with the KIMAI_ADMIN_USER and KIMAI_ADMIN_PASSWORD values you set in .env.

Keycloak Setup

  1. Run Keycloak:

    • Start Keycloak by running docker-compose up -d keycloak.
    • Access the Keycloak admin console at http://auth.mrx8086.com with the credentials set in .env.
  2. Create a Realm and Clients:

    • Create a new realm for centralized user management.
    • Set up clients for Nextcloud, Kimai, and Paperless if they support it.
  3. Connecting Applications:

    • Configure Nextcloud, Kimai, and other tools to authenticate via Keycloak by setting them as clients in Keycloak.
    • Follow Keycloak documentation for setting up clients with OpenID Connect.

Accessing Services

Each service can be accessed using the following URLs:

Contributing

Please ensure any modifications are tested locally before pushing changes to the repository. All environment variables should be stored in .env and sensitive information should not be committed to the repository. ```