Fix hardcoded paths and complete Docker setup with documentation
Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
This commit is contained in:
92
DATA_STRUCTURE.md
Normal file
92
DATA_STRUCTURE.md
Normal file
@@ -0,0 +1,92 @@
|
||||
# Example Data Structure for Axia4
|
||||
|
||||
This directory contains example data files that demonstrate the structure needed for the Axia4 application.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
DATA/
|
||||
├── Usuarios.json # Main application users
|
||||
└── entreaulas/
|
||||
├── Usuarios/ # EntreAulas user files
|
||||
│ ├── user1.json
|
||||
│ └── user2.json
|
||||
└── Centros/ # Centro data
|
||||
├── centro1/
|
||||
│ └── Aularios/
|
||||
│ ├── aulario_abc123.json
|
||||
│ └── aulario_xyz456.json
|
||||
└── centro2/
|
||||
└── Aularios/
|
||||
└── aulario_def789.json
|
||||
```
|
||||
|
||||
## File Examples
|
||||
|
||||
### Main Users (DATA/Usuarios.json)
|
||||
|
||||
```json
|
||||
{
|
||||
"username1": {
|
||||
"password_hash": "$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi"
|
||||
},
|
||||
"username2": {
|
||||
"password_hash": "$2y$10$example_hash_here"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### EntreAulas User (DATA/entreaulas/Usuarios/username.json)
|
||||
|
||||
```json
|
||||
{
|
||||
"password_hash": "$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi",
|
||||
"display_name": "John Doe",
|
||||
"centro": "centro1",
|
||||
"aulas": [
|
||||
"aulario_abc123",
|
||||
"aulario_xyz456"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Aulario Configuration (DATA/entreaulas/Centros/{centro_id}/Aularios/{aulario_id}.json)
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Aulario Principal",
|
||||
"icon": "/static/logo-entreaulas.png"
|
||||
}
|
||||
```
|
||||
|
||||
## Generating Password Hashes
|
||||
|
||||
To create password hashes for your users, use one of these methods:
|
||||
|
||||
### Using Docker:
|
||||
|
||||
```bash
|
||||
docker exec -it axia4-app php -r "echo password_hash('your_password', PASSWORD_DEFAULT);"
|
||||
```
|
||||
|
||||
### Using PHP CLI directly:
|
||||
|
||||
```bash
|
||||
php -r "echo password_hash('your_password', PASSWORD_DEFAULT);"
|
||||
```
|
||||
|
||||
### Using a PHP script:
|
||||
|
||||
```php
|
||||
<?php
|
||||
echo password_hash('your_password', PASSWORD_DEFAULT);
|
||||
?>
|
||||
```
|
||||
|
||||
## Security Notes
|
||||
|
||||
- **NEVER** commit the actual DATA directory with real user credentials to version control
|
||||
- The DATA directory should only exist on your production/development servers
|
||||
- Use strong, unique passwords for all accounts
|
||||
- Regularly backup the DATA directory
|
||||
- Set appropriate file permissions (755 for directories, 644 for files)
|
||||
67
README.md
67
README.md
@@ -1 +1,68 @@
|
||||
# Axia4
|
||||
|
||||
Axia4 is a unified platform for EuskadiTech and Sketaria, providing various services including EntreAulas (connected classroom management system).
|
||||
|
||||
## Quick Start with Docker
|
||||
|
||||
The easiest way to run Axia4 is using Docker:
|
||||
|
||||
```bash
|
||||
# 1. Clone the repository
|
||||
git clone https://github.com/Axia4/Axia4.git
|
||||
cd Axia4
|
||||
|
||||
# 2. Create the data directory structure
|
||||
mkdir -p DATA/entreaulas/Usuarios
|
||||
mkdir -p DATA/entreaulas/Centros
|
||||
|
||||
# 3. Start the application
|
||||
docker compose up -d
|
||||
|
||||
# 4. Access the application
|
||||
# Open http://localhost:8080 in your browser
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
- **[Docker Setup Guide](DOCKER.md)** - Complete guide for running Axia4 with Docker
|
||||
- **[Data Structure](DATA_STRUCTURE.md)** - Information about the data directory structure and how to set up users
|
||||
|
||||
## Features
|
||||
|
||||
- **EntreAulas**: Management system for connected classrooms
|
||||
- **Aularios**: Centralized access to classroom resources
|
||||
- Integration with multiple external services
|
||||
|
||||
## Requirements
|
||||
|
||||
### Docker (Recommended)
|
||||
- Docker Engine 20.10+
|
||||
- Docker Compose V2
|
||||
|
||||
### Manual Installation
|
||||
- PHP 8.2+
|
||||
- Apache 2.4+
|
||||
- PHP GD extension
|
||||
|
||||
## Configuration
|
||||
|
||||
All application data is stored in the `/DATA` directory which is mounted from the host system. See [DATA_STRUCTURE.md](DATA_STRUCTURE.md) for details on how to set up your data files.
|
||||
|
||||
## Development
|
||||
|
||||
To enable live code updates during development, uncomment the volume mount in `docker-compose.yml`:
|
||||
|
||||
```yaml
|
||||
volumes:
|
||||
- ./DATA:/DATA
|
||||
- ./public_html:/var/www/html # Uncomment this line
|
||||
```
|
||||
|
||||
## Support
|
||||
|
||||
For issues and questions, please open an issue on GitHub.
|
||||
|
||||
## License
|
||||
|
||||
See LICENSE file for details.
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
axia4-web:
|
||||
build: .
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php require_once "/var/www/_autoreload.php";
|
||||
<?php require_once __DIR__ . "/../_autoreload.php";
|
||||
|
||||
if (!isset($APP_CODE)) {
|
||||
$APP_CODE = "ax4";
|
||||
@@ -143,8 +143,8 @@ if (!isset($APP_CODE)) {
|
||||
<input id="bmenub" type="checkbox" class="show" />
|
||||
<label for="bmenub" class="burger button">menú</label>
|
||||
<div class="menu">
|
||||
<?php if (file_exists("/var/www$APP_ROOT/__menu.php")) { ?>
|
||||
<?php require_once "/var/www$APP_ROOT/__menu.php"; ?>
|
||||
<?php if (file_exists(__DIR__ . "/..$APP_ROOT/__menu.php")) { ?>
|
||||
<?php require_once __DIR__ . "/..$APP_ROOT/__menu.php"; ?>
|
||||
<?php } ?>
|
||||
<?php if ($APP_CODE != "ax4") { ?>
|
||||
<a href="/" class="button pseudo" style="background: #9013FE; color: white;">Ax<sup>4</sup></a>
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
$APP_CODE = "entreaulas";
|
||||
$APP_NAME = "EntreAulas";
|
||||
$APP_TITLE = "EntreAulas";
|
||||
require_once "/var/www/_incl/pre-body.php";
|
||||
require_once __DIR__ . "/../../_incl/pre-body.php";
|
||||
|
||||
Reference in New Issue
Block a user