소스 검색

Initial setup of AutoMate project with Paperless-ngx, Docker Compose, and project documentation

mathias.riechsteiner 1 년 전
커밋
cd2c5c1b8b
8개의 변경된 파일153개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      .gitignore
  2. 90 0
      README.md
  3. 10 0
      TODO.md
  4. 0 0
      docs/setup.md
  5. 0 0
      docs/troubleshooting.md
  6. 0 0
      docs/usage.md
  7. 23 0
      src/docker/docker-compose.yml
  8. 27 0
      src/scripts/install_docker.sh

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+data/
+logs/
+.env

+ 90 - 0
README.md

@@ -0,0 +1,90 @@
+# 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.
+  - **src/docker/**: Docker Compose configuration files and individual Dockerfile(s).
+  - **src/scripts/**: Custom scripts (e.g., for installation or automation).
+  - **src/configs/**: Configuration files for different services.
+- **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):
+
+'''bash
+DB_USER=myuser
+DB_PASSWORD=randomGeneratedPassword
+NEXTCLOUD_ADMIN_USER=admin
+NEXTCLOUD_ADMIN_PASSWORD=randomAdminPassword
+'''
+
+## 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:
+
+'''bash
+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**:
+
+   '''bash
+   cd ~/AutoMate/src/docker
+   '''
+
+2. **Start Docker Compose**:
+
+   Use Docker Compose to start all configured services.
+
+   '''bash
+   docker-compose up -d
+   '''
+
+3. **Check Status**:
+
+   To confirm that all services are running, use:
+
+   '''bash
+   docker-compose ps
+   '''
+
+
+## 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://localhost:8000`.
+   - Use the username and password you just created to log in as the admin.
+
+This setup step is necessary only for the first-time setup or if you need to create additional admin users.
+
+
+
+

+ 10 - 0
TODO.md

@@ -0,0 +1,10 @@
+# AutoMate TODO List
+
+## Future Enhancements
+- [ ] Set up Bitwarden for secure credential management and integrate with CLI
+- [ ] Automate `.env` population from Bitwarden
+- [ ] Document Bitwarden setup and usage in `docs/security.md`
+
+## Current Tasks
+- [ ] Configure Docker Compose for core services (e.g., Paperless, Nextcloud)
+- [ ] Write initial setup guide in README.md

+ 0 - 0
docs/setup.md


+ 0 - 0
docs/troubleshooting.md


+ 0 - 0
docs/usage.md


+ 23 - 0
src/docker/docker-compose.yml

@@ -0,0 +1,23 @@
+version: '3.8'
+
+services:
+  paperless:
+    image: paperlessngx/paperless-ngx
+    container_name: paperless
+    ports:
+      - "8000:8000"
+    volumes:
+      - ../data/paperless:/usr/src/paperless/data
+    environment:
+      - PAPERLESS_REDIS=redis://redis:6379
+      - PAPERLESS_SECRET_KEY=random_key_placeholder
+      - PAPERLESS_DB_PASSWORD=${DB_PASSWORD}  # Placeholder, pulls from .env
+    depends_on:
+      - redis
+
+  redis:
+    image: redis:alpine
+    container_name: redis
+    expose:
+      - "6379"
+    # No ports needed, Redis will only be accessible within Docker Compose network

+ 27 - 0
src/scripts/install_docker.sh

@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# Update your package list
+sudo apt update
+
+# Install prerequisites
+sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
+
+# Add Docker’s official GPG key
+curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
+
+# Add the Docker repository
+echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+
+# Update package list again to include Docker repo
+sudo apt update
+
+# Install Docker
+sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose
+
+# Start Docker service
+sudo service docker start
+
+# Add user to the Docker group
+sudo usermod -aG docker $USER
+
+echo "Docker installation completed. Please log out and log back in for the Docker group changes to take effect."