feat: update to v3.0-beta with new features and improvements
- Updated versioning across multiple components and documentation to v3.0-beta. - Introduced new Docker Compose configurations for S3-compatible storage and MinIO support. - Enhanced the documentation with new guides for API usage, architecture, and user management. - Improved localization and user experience in the frontend with updated UI components and styles. - Removed outdated Docker configurations and files to streamline the setup process. - Added new utilities for key generation and improved error handling in various components. - Updated license to reflect the new Kyantech-Permissive License.
@@ -66,6 +66,11 @@ temp-chunks/
|
||||
apps/server/uploads/
|
||||
apps/server/temp-chunks/
|
||||
|
||||
# Static files
|
||||
apps/server/prisma/*.db
|
||||
apps/server/.env
|
||||
apps/web/.env
|
||||
|
||||
# OS generated files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
|
||||
37
LICENSE
@@ -1,22 +1,37 @@
|
||||
BSD 2-Clause License
|
||||
Kyantech-Permissive License (Based on BSD 2-Clause)
|
||||
|
||||
Copyright (c) 2025, Daniel Luiz Alves (danielalves96)
|
||||
Copyright (c) 2025, Daniel Luiz Alves (danielalves96) - Kyantech Solutions
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
modification, are permitted for any purpose — private, commercial,
|
||||
educational, governmental — **fully free and unrestricted**, provided
|
||||
that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions, and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. **If this software (or derivative works) is used in any public-facing
|
||||
interface** — such as websites, apps, dashboards, admin panels, or
|
||||
similar — a **simple credit** must appear in the footer or similar
|
||||
location. The credit text should read:
|
||||
|
||||
> “Powered by Kyantech Solutions · https://kyantech.com.br”
|
||||
|
||||
This credit must be reasonably visible but **must not interfere** with
|
||||
your UI, branding, or user experience. You may style it to match your
|
||||
own design and choose its size, placement, or color.
|
||||
|
||||
---
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
---
|
||||
title: 📦 S3 Providers
|
||||
---
|
||||
|
||||
S3 Providers Configuration Guide
|
||||
|
||||
This application now supports any S3-compatible provider. Below are the configurations for the main providers:
|
||||
|
||||
## Environment Variables
|
||||
|
||||
The following environment variables must be configured:
|
||||
|
||||
- `S3_ENDPOINT`: S3 provider endpoint
|
||||
- `S3_PORT`: Port (optional, default based on protocol)
|
||||
- `S3_USE_SSL`: "true" or "false"
|
||||
- `S3_ACCESS_KEY`: Access key
|
||||
- `S3_SECRET_KEY`: Secret key
|
||||
- `S3_REGION`: Region
|
||||
- `S3_BUCKET_NAME`: Bucket name
|
||||
- `S3_FORCE_PATH_STYLE`: "true" or "false" (optional, default "false")
|
||||
|
||||
## Provider Configurations
|
||||
> This is only examples of how to configure the environment variables, use your own real values for each provider.
|
||||
|
||||
### 1. MinIO (Local/Self-hosted)
|
||||
```bash
|
||||
S3_ENDPOINT=localhost
|
||||
S3_PORT=9000
|
||||
S3_USE_SSL=false
|
||||
S3_ACCESS_KEY=your-access-key
|
||||
S3_SECRET_KEY=your-secret-key
|
||||
S3_REGION=us-east-1
|
||||
S3_BUCKET_NAME=your-bucket-name
|
||||
S3_FORCE_PATH_STYLE=true
|
||||
```
|
||||
|
||||
### 2. Amazon S3
|
||||
```bash
|
||||
S3_ENDPOINT=s3.amazonaws.com
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-access-key
|
||||
S3_SECRET_KEY=your-secret-key
|
||||
S3_REGION=us-east-1
|
||||
S3_BUCKET_NAME=your-bucket-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
### 3. Google Cloud Storage
|
||||
```bash
|
||||
S3_ENDPOINT=storage.googleapis.com
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-access-key
|
||||
S3_SECRET_KEY=your-secret-key
|
||||
S3_REGION=us-central1
|
||||
S3_BUCKET_NAME=your-bucket-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
### 4. Azure Blob Storage (with S3 API)
|
||||
```bash
|
||||
S3_ENDPOINT=your-account.blob.core.windows.net
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-access-key
|
||||
S3_SECRET_KEY=your-secret-key
|
||||
S3_REGION=eastus
|
||||
S3_BUCKET_NAME=your-container-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
### 5. Backblaze B2
|
||||
```bash
|
||||
S3_ENDPOINT=s3.us-west-002.backblazeb2.com
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-key-id
|
||||
S3_SECRET_KEY=your-application-key
|
||||
S3_REGION=us-west-002
|
||||
S3_BUCKET_NAME=your-bucket-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
### 6. DigitalOcean Spaces
|
||||
```bash
|
||||
S3_ENDPOINT=nyc3.digitaloceanspaces.com
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-access-key
|
||||
S3_SECRET_KEY=your-secret-key
|
||||
S3_REGION=nyc3
|
||||
S3_BUCKET_NAME=your-space-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
### 7. Wasabi
|
||||
```bash
|
||||
S3_ENDPOINT=s3.wasabisys.com
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-access-key
|
||||
S3_SECRET_KEY=your-secret-key
|
||||
S3_REGION=us-east-1
|
||||
S3_BUCKET_NAME=your-bucket-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
## Important Notes
|
||||
|
||||
1. **S3_FORCE_PATH_STYLE**: Should be `true` for MinIO and some other self-hosted providers. For cloud providers like AWS S3, it should be `false`.
|
||||
|
||||
2. **Endpoint**: For AWS S3, you can use `s3.amazonaws.com` or the region-specific endpoint like `s3.us-east-1.amazonaws.com`.
|
||||
|
||||
3. **Region**: Make sure to use the correct region for each provider.
|
||||
|
||||
4. **Credentials**: Credentials vary by provider:
|
||||
- AWS S3: Access Key ID and Secret Access Key
|
||||
- Google Cloud: HMAC keys
|
||||
- Azure: Access keys (when using S3 API)
|
||||
- Backblaze: Key ID and Application Key
|
||||
@@ -1,63 +0,0 @@
|
||||
---
|
||||
title: Architecture of Palmr.
|
||||
icon: ServerCog
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Understanding the architecture of Palmr. is crucial for both deploying and scaling the application. Below is a diagram illustrating the main components:
|
||||
|
||||

|
||||
|
||||
## Technologies Used
|
||||
|
||||
Each component in the Palmr. architecture plays a vital role in ensuring reliability, performance, and scalability. The stack is built with simplicity, performance, and flexibility in mind, everything is self-hosted, developer-friendly, and designed to scale without adding unnecessary complexity.
|
||||
|
||||
|
||||
### PostgreSQL
|
||||
Palmr. uses **PostgreSQL** as the primary database solution. It's a powerful, open-source relational database that’s trusted by developers around the world. PostgreSQL is fully ACID-compliant, which means it handles transactions safely and reliably. It’s perfect for storing structured data like user accounts, file metadata, transfer logs, and anything else that requires consistency. With advanced features like full-text search, custom data types (like JSONB), and strong indexing capabilities, PostgreSQL gives us the tools to scale efficiently without giving up query performance or flexibility.
|
||||
|
||||
- Provides reliable and secure data storage, ensuring consistency and high performance for all database operations.
|
||||
- Powerful indexing, query optimization, and support for complex data types.
|
||||
- Ideal for handling large amounts of metadata and transactional data in a predictable and scalable way.
|
||||
|
||||
|
||||
### Next.js 15 + React + TypeScript
|
||||
The frontend of Palmr. is built using **Next.js 15**, along with **React** and **TypeScript**, forming a modern stack that’s easy to maintain and super fast for end users. Next.js 15 brings server components, server actions, and a new app router system that makes rendering dynamic content incredibly efficient. This allows us to load only what’s needed, when it’s needed which makes the app feel snappy even under load. React provides a clean, component-based structure that makes it easy to break the UI into reusable pieces, and TypeScript helps prevent bugs before they even happen by enforcing static typing and better code navigation. Whether it's SSR, static pages, or dynamic user interactions, this trio handles it all seamlessly.
|
||||
|
||||
- **React** enables the creation of a dynamic and responsive user interface with a component-based architecture.
|
||||
- **TypeScript** adds static typing, enhancing code quality and reducing runtime errors.
|
||||
- **Next.js 15** handles routing, server-side rendering, and server components for performance at scale.
|
||||
|
||||
|
||||
### MinIO
|
||||
Palmr. uses **MinIO** for object storage. MinIO is a lightweight, high-performance, S3-compatible storage solution that makes file handling simple and scalable. Every file uploaded to Palmr. Whether it's a personal file transfer or a shared asset is stored in MinIO. It’s built to handle huge amounts of data and can be deployed locally, on-premise, or in the cloud. Because it speaks the same API as Amazon S3, integrating with it is straightforward and familiar to most developers. And since it’s self-hosted, we have full control over performance, redundancy, and security.
|
||||
|
||||
- Supports high-throughput file storage and retrieval.
|
||||
- Ensures data integrity and redundancy.
|
||||
- Compatible with AWS S3 APIs, making integration seamless.
|
||||
|
||||
|
||||
### Fastify
|
||||
The backend of Palmr. is powered by **Fastify**, a super-fast Node.js web framework optimized for performance and low overhead. It’s designed to handle lots of concurrent requests with minimal resource usage, which is key for scalable backend services. Fastify also has a built-in schema validation system that ensures all incoming data is properly validated before reaching business logic, which helps prevent bugs and security issues. It follows a plugin-based architecture, making it easy to keep route handlers, services, and middlewares cleanly separated and easy to extend as the project grows.
|
||||
|
||||
- Provides fast request handling with a lightweight core.
|
||||
- Built-in schema-based validation for secure and reliable API handling.
|
||||
- Supports plugin-based architecture for easy extensibility.
|
||||
|
||||
|
||||
### How It Works
|
||||
1. **Frontend** — React + TypeScript + Next.js 15 handle the user interface and user interactions.
|
||||
2. **Backend** — Fastify processes requests and communicates with the database and storage layers.
|
||||
3. **Database** — PostgreSQL stores metadata and transactional data.
|
||||
4. **Object Storage** — MinIO stores the actual files and ensures scalable, high-performance storage.
|
||||
|
||||
|
||||
### Useful Links
|
||||
- [PostgreSQL Documentation](https://www.postgresql.org/docs/)
|
||||
- [Next.js Documentation](https://nextjs.org/docs)
|
||||
- [React Documentation](https://react.dev/)
|
||||
- [TypeScript Handbook](https://www.typescriptlang.org/docs/)
|
||||
- [MinIO Documentation](https://min.io/docs/minio/container/index.html)
|
||||
- [Fastify Documentation](https://fastify.dev/docs/latest/)
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
---
|
||||
title: Welcome to Palmr.
|
||||
icon: TreePalm
|
||||
---
|
||||
|
||||
import { Ban, Star, Shield, Palette, Users, Zap } from 'lucide-react';
|
||||
|
||||

|
||||
|
||||
**Palmr.** is a powerful and **flexible open-source alternative** to popular file transfer services like **WeTransfer**, **SendGB**, **Send Anywhere** and **Files.fm**. The key advantage of Palmr. is that you can **host it on your own infrastructure**, such as a **dedicated server** or **VPS**, giving you full control over your files and data security without relying on third-party services or worrying about artificial limits or high fees.
|
||||
|
||||
## **Why Choose Palmr.?**
|
||||
|
||||
### No Artificial Limits
|
||||
|
||||
Unlike traditional file transfer services that impose arbitrary restrictions, Palmr. takes a fundamentally different approach by removing all artificial constraints on file sizes and quantities. The only practical limitation you'll encounter is the **available storage** space on your server or VPS infrastructure. This means that as long as you have adequate storage capacity in your hosting environment, you have complete freedom to transfer files of any size and in any quantity. There are no premium tiers to unlock additional features, no intrusive advertisements to navigate around, and absolutely no hidden charges or unexpected fees that might surprise you later. This unrestricted approach ensures that your file transfer capabilities are determined solely by your infrastructure choices rather than arbitrary service limitations.
|
||||
|
||||
### Open Source and Free
|
||||
|
||||
Palmr. is completely **open source** and free to use, which means there are no licensing fees, subscription costs, or hidden charges associated with implementing and maintaining the software. This commitment to open source principles ensures complete transparency and freedom in how you utilize the platform. You can:
|
||||
|
||||
- Deploy it on any infrastructure of your choice (VPS, dedicated server, Docker, cloud platforms, or other hosting environments), giving you complete flexibility in your hosting decisions.
|
||||
- Review and audit the entire codebase to ensure security and integrity, allowing you to verify that the software meets your organization's security standards and compliance requirements.
|
||||
- Contribute improvements or custom features to enhance the platform's functionality, participating in the collaborative development process that makes open source software so powerful.
|
||||
- Adapt it for different use cases as needed, whether you're using it for personal file sharing, business operations, or specialized applications that require custom modifications.
|
||||
|
||||
### Security and Privacy Under Your Control
|
||||
|
||||
When you host Palmr. on your infrastructure, you maintain **full control over your data** through end-to-end management of the storage and transfer process. By keeping files within your own hosting environment, you eliminate security vulnerabilities that could arise from third-party handling. Your files never get stored or processed by external services, ensuring complete **privacy** and **confidentiality** of transferred information. This allows you to implement security protocols and compliance measures that match your specific requirements.
|
||||
|
||||
By eliminating third-party involvement, you gain peace of mind knowing that the files are never handled by external providers. This guarantees that you retain full control over data handling and processing, reinforcing the confidentiality of sensitive information throughout its lifecycle.
|
||||
|
||||
With Palmr., your security and privacy are entirely in your hands, making it a powerful and reliable solution for organizations that require full control over their data, whether for internal use or for compliance with regulations.
|
||||
|
||||
### Highly Customizable
|
||||
|
||||
Palmr. offers extensive customization options that allow you to tailor every aspect of the platform to perfectly align with your brand identity and create an optimal user experience that matches your specific requirements:
|
||||
|
||||
- Add your own **logo** to maintain consistent branding across your file-sharing platform and establish a professional, unified presence.
|
||||
- Set a **custom app name** that reflects your organization's identity and helps users instantly recognize your branded file-sharing solution.
|
||||
- Configure an **SMTP server** for email notifications, enabling seamless communication with users about file transfers, updates, and system alerts.
|
||||
- Customize text throughout the interface to create a unique user experience that resonates with your audience and maintains your brand voice.
|
||||
|
||||
### Complete User and Admin Management
|
||||
|
||||
Palmr. provides a comprehensive and sophisticated user and admin management system that puts you in complete control of your file-sharing environment:
|
||||
|
||||
- Create and manage multiple **administrators** to ensure proper oversight and delegation of responsibilities.
|
||||
- Add unlimited **users** to accommodate teams of any size, from small workgroups to large enterprises.
|
||||
- Control who can view, upload, and manage files with granular permission settings that allow you to implement precise access controls.
|
||||
- Easily monitor storage usage through analytics and reporting tools that help you optimize resource allocation.
|
||||
|
||||
### Fast, Lightweight, and Scalable
|
||||
|
||||
Palmr. demonstrates exceptional technical capabilities through its streamlined and expandable architecture, engineered to deliver optimal operational efficiency. The system effectively processes substantial file transfers and manages high-volume user activity while consistently maintaining superior transfer rates. The platform's contemporary infrastructure automatically adjusts to accommodate increased utilization, facilitating uninterrupted functionality as operational requirements expand. Through advanced resource allocation and refined programming, the system delivers a highly responsive user experience that accommodates organizational growth while maintaining consistent performance standards and operational stability.
|
||||
@@ -1,152 +0,0 @@
|
||||
---
|
||||
title: Quick Start (Docker Compose)
|
||||
icon: "Rocket"
|
||||
---
|
||||
|
||||
Welcome to the quickest and easiest way to get <span className="font-bold" >Palmr.</span> up and running! Whether you're new to <span className="font-bold italic">self-hosting</span> or a seasoned pro, you'll be amazed at how simple it is to deploy your own secure <span className="font-bold italic">file sharing solution</span>.
|
||||
|
||||
In just a few minutes, you'll have a powerful, user-friendly <span className="font-bold italic">file sharing platform</span> running on your <span className="font-bold italic">server</span> or <span className="font-bold italic">VPS</span>. We've designed this quick start guide to get you operational with minimal effort, using the built-in <span className="font-bold italic">file storage system</span> - perfect for most use cases!
|
||||
|
||||
While Palmr. offers advanced installation options (like <span className="font-bold italic">manual installation</span> or using <span className="font-bold italic">Amazon S3-compatible external storage</span>), this guide focuses on the fastest path to success using <span className="font-bold italic">Docker Compose</span>. For those interested in more advanced setups, we have dedicated sections in our documentation covering these alternative installation methods.
|
||||
|
||||
## Overview
|
||||
|
||||
Installation via Docker Compose is the simplest way to run the project across different environments. For it to run correctly, we need two main tools installed in our environment:
|
||||
|
||||
- Docker ([https://docs.docker.com](https://docs.docker.com/))
|
||||
- Docker Compose ([https://docs.docker.com/compose](https://docs.docker.com/compose/))
|
||||
|
||||
> _It's worth emphasizing that Palmr. was fully developed in a MacOS environment and extensively tested on Linux servers. Therefore, we can guarantee the best system performance in these environments. Windows and other environments have not been tested yet, and potential bugs may occur during execution. However, remember that we are still in a beta version of Palmr., and errors or bugs can occur in any operating system. If you identify any issues, we appreciate your help in notifying us through our GitHub [issues page](https://github.com/kyantech/Palmr/issues)._
|
||||
|
||||
## Docker Compose File
|
||||
|
||||
Having installed [Docker](https://docs.docker.com/) and [Docker Compose](https://docs.docker.com/compose/) in our environment, we can proceed with the simple installation using these tools.
|
||||
|
||||
In the root folder of our project, we can find some different composes files, we gonna use the `docker-compose-file-system.yaml` file, which is the only file needed to run the project via Docker and Docker Compose using the file system as storage. This is because the pre-built images are already in our [DockerHub](https://hub.docker.com/repositories/kyantech) and are only referenced in the `docker-compose-file-system.yaml`
|
||||
|
||||
Any changes needed for execution can be made directly in our `docker-compose-file-system.yaml` or via environment variables, which we will show later in this tutorial.
|
||||
|
||||
Next, let's look at the content of our `docker-compose-file-system.yaml`.
|
||||
|
||||
## Docker Compose Content
|
||||
|
||||
Below is the complete content of our `docker-compose-file-system.yaml` that can be copied directly from here or from our official repository ([Docker Compose](https://github.com/kyantech/Palmr/blob/main/docker-compose-file-system.yaml)).
|
||||
|
||||
```yaml
|
||||
services:
|
||||
palmr:
|
||||
image: kyantech/palmr:latest # Make sure to use the correct version (latest) of the image
|
||||
container_name: palmr-application
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: "service_healthy"
|
||||
environment:
|
||||
- ENABLE_S3=false # Set to 'false' to use local filesystem storage instead of S3/MinIO or true to use S3/MinIO in this case we are using filesystem storage
|
||||
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-change-this-key-in-production-min-32-chars} # Required for filesystem encryption (min 32 chars) CHANGE THIS KEY IN PRODUCTION
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgresRootPassword}@postgres:${DB_EXTERNAL_PORT:-5432}/${POSTGRES_DB:-palmr_db}?schema=public # Database URL with configurable credentials through env vars
|
||||
- FRONTEND_URL=http://palmr:${APP_EXTERNAL_PORT:-5487} # Frontend URL - Make sure to use the correct frontend URL, depends on where the frontend is running, its prepared for localhost, but you can change it to your frontend URL if needed
|
||||
- API_BASE_URL=http://palmr:${API_EXTERNAL_PORT:-3333} # Using Docker service name for internal communication
|
||||
- MAX_FILESIZE=${MAX_FILESIZE:-1073741824} # Max Filesize for upload - Declared in Bytes. Default is 1GB. can be changed by admin in the frontend.
|
||||
ports:
|
||||
- "${API_EXTERNAL_PORT:-3333}:3333" # Server port (default: 3333) can be overridden by env var
|
||||
- "${APP_EXTERNAL_PORT:-5487}:5487" # Web port (default: 5487) can be overridden by env var
|
||||
volumes:
|
||||
- palmr_uploads:/app/server/uploads # Uploads folder for the application
|
||||
- palmr_temp_chunks:/app/server/temp-chunks # Temp chunks folder for the application
|
||||
networks:
|
||||
- palmr-network # Network for the application to communicate with the database
|
||||
restart: unless-stopped # Restart the container unless it is stopped
|
||||
healthcheck:
|
||||
test: [
|
||||
"CMD",
|
||||
"sh",
|
||||
"-c",
|
||||
"wget --no-verbose --tries=1 --spider http://palmr:3333/health && wget --no-verbose --tries=1 --spider http://palmr:5487",
|
||||
] # Healthcheck for the application
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 120s
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine # You can use any postgres version you prefer, but remember that some versions might not be compatible
|
||||
container_name: palmr-database
|
||||
environment:
|
||||
- POSTGRES_USER=${POSTGRES_USER:-postgres} # PostgreSQL username (default: postgres) can be overridden by env var
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgresRootPassword} # PostgreSQL password (default: postgresRootPassword) can be overridden by env var
|
||||
- POSTGRES_DB=${POSTGRES_DB:-palmr_db} # PostgreSQL database name (default: palmr_db) can be overridden by env var
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data # PostgreSQL data volume for the application
|
||||
ports:
|
||||
- "${DB_EXTERNAL_PORT:-5432}:5432" # PostgreSQL port (default: 5432) can be overridden by env var
|
||||
networks:
|
||||
- palmr-network # Network for the application to communicate with the database
|
||||
restart: unless-stopped # Restart the container unless it is stopped
|
||||
healthcheck:
|
||||
test: [
|
||||
"CMD",
|
||||
"pg_isready",
|
||||
"-U",
|
||||
"${POSTGRES_USER:-postgres}",
|
||||
"-d",
|
||||
"${POSTGRES_DB:-palmr_db}",
|
||||
] # Healthcheck for the database
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 6
|
||||
start_period: 30s
|
||||
|
||||
volumes:
|
||||
postgres_data: # PostgreSQL data volume for the application referenced in the postgres service
|
||||
palmr_uploads: # Uploads folder for the application referenced in the palmr service
|
||||
palmr_temp_chunks: # Temp chunks folder for the application referenced in the palmr service
|
||||
|
||||
networks:
|
||||
palmr-network:
|
||||
driver: bridge
|
||||
```
|
||||
|
||||
Notice that the `docker-compose-file-system.yaml` has several comments that help you configure your own compose to meet your environment's needs. Let's give an overview of some changes we can make.
|
||||
|
||||
---
|
||||
|
||||
### ⚙️ Services Overview
|
||||
|
||||
Palmr. consists of two main services for filesystem storage setup, each with specific responsibilities. Below, we present a detailed view of each component:
|
||||
|
||||
| **Service** | **Image** | **Exposed Ports** | **Main Features** |
|
||||
| ------------------- | ---------------------------------------------------------------------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| palmr | [kyantech/palmr:latest](https://hub.docker.com/repository/docker/kyantech/palmr/general) | **3333** (API)<br/>**5487** (Web) | • Combined backend API and frontend service<br/>• Uses local filesystem storage<br/>• Depends on PostgreSQL database<br/>• Has healthcheck to ensure availability |
|
||||
| postgres (Database) | [postgres:16-alpine](https://hub.docker.com/_/postgres) | **5432** | • PostgreSQL database<br/>• Stores metadata and user data<br/>• Persistent volume for data<br/>• Alpine Linux based for smaller size |
|
||||
|
||||
---
|
||||
|
||||
### 🛠️ Available Environment Variables
|
||||
|
||||
The table below shows all environment variables that can be set for the filesystem storage setup
|
||||
|
||||
| **Variable** | **Default Value** | **Description** |
|
||||
| ------------------- | ------------------------------------------ | ------------------------------------------------------------ |
|
||||
| `ENABLE_S3` | false | Set to 'false' for filesystem storage or 'true' for S3/MinIO |
|
||||
| `ENCRYPTION_KEY` | change-this-key-in-production-min-32-chars | Required for filesystem encryption (minimum 32 characters) |
|
||||
| `API_EXTERNAL_PORT` | 3333 | Exposed port on host for API |
|
||||
| `APP_EXTERNAL_PORT` | 5487 | Exposed port on host for frontend |
|
||||
| `DB_EXTERNAL_PORT` | 5432 | Exposed port on host for PostgreSQL |
|
||||
| `POSTGRES_USER` | postgres | PostgreSQL username |
|
||||
| `POSTGRES_PASSWORD` | postgresRootPassword | PostgreSQL password |
|
||||
| `POSTGRES_DB` | palmr_db | PostgreSQL database name |
|
||||
| `MAX_FILESIZE` | 1073741824 | Max Uploadsize per file. Unit in Bytes (1GB default) |
|
||||
|
||||
> _All these variables can be configured through a .env file in the project root or defined directly in the environment where docker-compose will be executed. The ENCRYPTION_KEY is critical for filesystem storage security and MUST be changed in production environments._
|
||||
|
||||
---
|
||||
|
||||
#### 🗂️ Persistent Volumes
|
||||
|
||||
- **postgres_data**: Stores PostgreSQL database files
|
||||
- **palmr_uploads**: Stores uploaded files in the filesystem
|
||||
- **palmr_temp_chunks**: Stores temporary file chunks during upload process
|
||||
|
||||
#### 🌐 Network Configuration
|
||||
|
||||
- **palmr-network**: Bridge network for inter-service communication between Palmr. and PostgreSQL
|
||||
232
apps/docs/content/docs/3.0-beta/api.mdx
Normal file
@@ -0,0 +1,232 @@
|
||||
---
|
||||
title: API Endpoints
|
||||
icon: Plug
|
||||
---
|
||||
|
||||
Palmr. provides a comprehensive, well-documented, and fully typed REST API designed for maximum developer productivity and seamless integration. Whether you're building custom applications, automating workflows, or integrating with third-party services, our API offers the flexibility and reliability you need.
|
||||
|
||||
> **Overview:** The API is built with Fastify + Zod + TypeScript, ensuring type safety, schema validation, and excellent performance for all operations.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Exposing the API port
|
||||
|
||||
To access the API endpoints, you need to expose port **3333** in your Docker configuration. This port is where the Palmr. API server runs.
|
||||
|
||||
**Using Docker Compose:**
|
||||
|
||||
```yaml
|
||||
services:
|
||||
palmr:
|
||||
image: kyantech/palmr:latest
|
||||
ports:
|
||||
- "5487:5487" # Web interface
|
||||
- "3333:3333" # API port (required for API access)
|
||||
# ... other configuration
|
||||
```
|
||||
|
||||
**Using Docker run command:**
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name palmr \
|
||||
-e ENABLE_S3=false \
|
||||
-e ENCRYPTION_KEY=change-this-key-in-production-min-32-chars \
|
||||
-p 5487:5487 \
|
||||
-p 3333:3333 \
|
||||
-v palmr_data:/app/server \
|
||||
--restart unless-stopped \
|
||||
kyantech/palmr:latest
|
||||
```
|
||||
|
||||
> **Note:** Port 3333 exposure is optional if you only need the web interface. However, it's required for direct API access, custom integrations, and accessing the interactive documentation.
|
||||
|
||||
## Accessing the API documentation
|
||||
|
||||
The API documentation is available through interactive interfaces that allow you to explore, test, and validate all available endpoints directly in your browser.
|
||||
|
||||
### Documentation endpoints
|
||||
|
||||
**Local development:**
|
||||
|
||||
- Scalar documentation: `http://localhost:3333/docs`
|
||||
- Swagger documentation: `http://localhost:3333/swagger`
|
||||
|
||||
**Production environment:**
|
||||
|
||||
- Scalar documentation: `{your_domain}:3333/docs`
|
||||
- Swagger documentation: `{your_domain}:3333/swagger`
|
||||
|
||||
> **Important:** We don't provide an online version of the API documentation because endpoints and functionality may vary between different versions of Palmr. Always access the documentation from your specific deployment to ensure accuracy.
|
||||
|
||||
## Interactive documentation with Scalar
|
||||
|
||||
Our primary API documentation is powered by **Scalar**, a modern documentation platform that provides an exceptional developer experience.
|
||||
|
||||

|
||||
|
||||
### Why Scalar?
|
||||
|
||||
- **Interactive testing** - Test endpoints directly in the documentation
|
||||
- **Real-time validation** - Immediate feedback on request/response formats
|
||||
- **Modern interface** - Clean, intuitive design optimized for developer productivity
|
||||
- **Type-safe integration** - Full TypeScript support with automatic type inference
|
||||
- **Schema visualization** - Clear representation of request and response structures
|
||||
|
||||
### Key features
|
||||
|
||||
- **Comprehensive endpoint coverage** - All API endpoints documented with examples
|
||||
- **Authentication testing** - Built-in support for JWT token authentication
|
||||
- **Request builders** - Interactive forms for constructing API requests
|
||||
- **Response visualization** - Formatted display of API responses with syntax highlighting
|
||||
- **Code generation** - Generate client code in multiple programming languages
|
||||
|
||||
## Alternative Swagger documentation
|
||||
|
||||
For developers who prefer Swagger or need compatibility with existing tools, we also provide a Swagger-based documentation interface.
|
||||
|
||||

|
||||
|
||||
### When to use Swagger
|
||||
|
||||
- **Legacy tool compatibility** - Integration with existing Swagger-based workflows
|
||||
- **Team preferences** - When your team is more familiar with Swagger interface
|
||||
- **OpenAPI specification** - Direct access to OpenAPI spec for code generation
|
||||
- **Third-party integrations** - Tools that specifically require Swagger format
|
||||
|
||||
Both documentation formats provide identical endpoint coverage and functionality, ensuring you can choose the interface that best fits your development workflow.
|
||||
|
||||
## API capabilities
|
||||
|
||||
The Palmr. API provides comprehensive access to all platform features:
|
||||
|
||||
### File operations
|
||||
|
||||
- **Upload files** - Single and batch file uploads with progress tracking
|
||||
- **Download files** - Secure file retrieval with access control
|
||||
- **File management** - Rename, delete, and organize files
|
||||
- **Metadata access** - Retrieve file information and properties
|
||||
|
||||
### Share management
|
||||
|
||||
- **Create shares** - Generate public links for file sharing
|
||||
- **Configure access** - Set passwords, expiration dates, and view limits
|
||||
- **Track usage** - Monitor share views and download statistics
|
||||
- **Manage recipients** - Add and remove share recipients
|
||||
|
||||
### User operations
|
||||
|
||||
- **Authentication** - Login, logout, and session management
|
||||
- **Profile management** - Update user information and preferences
|
||||
- **User administration** - Create and manage user accounts (admin only)
|
||||
|
||||
### System integration
|
||||
|
||||
- **Health checks** - Monitor system status and availability
|
||||
- **Configuration** - Access and modify system settings
|
||||
- **Storage operations** - Manage filesystem and S3 storage options
|
||||
|
||||
## Authentication
|
||||
|
||||
The API uses **HTTP-only cookies** for secure authentication. After logging in through the web interface or API, authentication is automatically handled via secure cookies:
|
||||
|
||||
```bash
|
||||
# Login to establish authenticated session
|
||||
POST /auth/login
|
||||
{
|
||||
"email": "user@example.com",
|
||||
"password": "your-password"
|
||||
}
|
||||
|
||||
# Subsequent requests automatically include authentication cookies
|
||||
# No Authorization header needed - cookies are sent automatically
|
||||
GET /api/files
|
||||
```
|
||||
|
||||
### How authentication works
|
||||
|
||||
1. **Login** - Use the `/auth/login` endpoint with your credentials
|
||||
2. **Cookie storage** - The server sets HTTP-only cookies containing JWT tokens
|
||||
3. **Automatic authentication** - All subsequent API requests include these cookies automatically
|
||||
4. **Session management** - Cookies handle session persistence and expiration
|
||||
|
||||
### Security features
|
||||
|
||||
- **HTTP-only cookies** - Tokens stored securely in HTTP-only cookies, preventing XSS attacks
|
||||
- **Secure transmission** - Cookies marked as secure and same-site for enhanced protection
|
||||
- **Token expiration** - Automatic session timeout for security
|
||||
- **Role-based access** - Different permissions for users and administrators
|
||||
- **Request validation** - All inputs validated using Zod schemas
|
||||
|
||||
## Getting started with the API
|
||||
|
||||
### 1. Expose the API port
|
||||
|
||||
Ensure port 3333 is exposed in your Docker configuration to access the API endpoints.
|
||||
|
||||
### 2. Access the documentation
|
||||
|
||||
Visit your Palmr. instance at `:3333/docs` to explore the interactive API documentation.
|
||||
|
||||
### 3. Authenticate
|
||||
|
||||
Use the login endpoint to establish an authenticated session. Authentication cookies will be automatically set and included in subsequent requests.
|
||||
|
||||
### 4. Test endpoints
|
||||
|
||||
Use the interactive documentation to test API endpoints and understand request/response formats.
|
||||
|
||||
### 5. Build your integration
|
||||
|
||||
Implement your custom application using the API endpoints that match your requirements.
|
||||
|
||||
## Integration examples
|
||||
|
||||
The API enables powerful integrations and automation:
|
||||
|
||||
**Workflow automation:**
|
||||
|
||||
- Automatically upload files from CI/CD pipelines
|
||||
- Create shares for build artifacts and reports
|
||||
- Integrate with project management tools
|
||||
|
||||
**Custom applications:**
|
||||
|
||||
- Build mobile apps with native file management
|
||||
- Create specialized interfaces for specific use cases
|
||||
- Develop backup and sync solutions
|
||||
|
||||
**Business integrations:**
|
||||
|
||||
- Connect with existing document management systems
|
||||
- Automate file sharing workflows
|
||||
- Integrate with CRM and ERP systems
|
||||
|
||||
## Best practices
|
||||
|
||||
### Performance optimization
|
||||
|
||||
- **Use appropriate HTTP methods** - GET for retrieval, POST for creation, etc.
|
||||
- **Implement pagination** - Handle large datasets efficiently
|
||||
- **Cache responses** - Store frequently accessed data locally
|
||||
- **Batch operations** - Group multiple operations when possible
|
||||
|
||||
### Error handling
|
||||
|
||||
- **Check status codes** - Handle different HTTP response codes appropriately
|
||||
- **Parse error messages** - Use detailed error information for debugging
|
||||
- **Implement retries** - Handle temporary failures gracefully
|
||||
- **Log API interactions** - Maintain audit trails for troubleshooting
|
||||
|
||||
### Security considerations
|
||||
|
||||
- **Use HTTPS** - Always encrypt API communications to protect authentication cookies
|
||||
- **Secure cookies** - Authentication handled automatically via HTTP-only cookies
|
||||
- **Validate inputs** - Sanitize data before sending to API
|
||||
- **Monitor usage** - Track API calls for unusual activity
|
||||
|
||||
## Useful links
|
||||
|
||||
- [Scalar Official Website](https://scalar.com/) - Learn more about our primary documentation platform
|
||||
- [Swagger Official Website](https://swagger.io/) - Information about the alternative documentation format
|
||||
- [JWT.io](https://jwt.io/) - Understanding JSON Web Tokens for authentication
|
||||
136
apps/docs/content/docs/3.0-beta/architecture.mdx
Normal file
@@ -0,0 +1,136 @@
|
||||
---
|
||||
title: Architecture of Palmr.
|
||||
icon: ServerCog
|
||||
---
|
||||
|
||||
import { ZoomableImage } from "@/components/ui/zoomable-image";
|
||||
|
||||
## Overview
|
||||
|
||||
Understanding the architecture of Palmr. is crucial for both deploying and scaling the application. The platform is designed with simplicity and flexibility in mind, offering a streamlined setup that can grow with your needs.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/architecture/architecture.png"
|
||||
alt="Palmr. Architecture"
|
||||
/>
|
||||
|
||||
## Technologies used
|
||||
|
||||
Each component in the Palmr. architecture plays a vital role in ensuring reliability, performance, and scalability. The stack is built with simplicity, performance, and flexibility in mind - everything is self-hosted, developer-friendly, and designed to scale without adding unnecessary complexity.
|
||||
|
||||
### SQLite + Prisma ORM
|
||||
|
||||
Palmr. uses **SQLite** as the primary database solution combined with **Prisma ORM** for type-safe database operations. SQLite is a lightweight, serverless database that's perfect for getting started quickly while still being powerful enough for production use. SQLite is fully ACID-compliant, which means it handles transactions safely and reliably. Prisma provides a modern database toolkit that generates a type-safe client, handles migrations, and offers an intuitive query API. Together, they create a powerful combination that eliminates database administration complexity while providing excellent developer experience.
|
||||
|
||||
- Provides reliable and secure data storage with zero configuration required
|
||||
- **Prisma ORM** offers type-safe queries and automatic TypeScript integration
|
||||
- Lightweight and fast, perfect for both development and production environments
|
||||
- Fully ACID-compliant with excellent performance for metadata and transactional data
|
||||
- Self-contained with no external dependencies or server processes needed
|
||||
- Easy database migrations and schema management through Prisma
|
||||
|
||||
### Next.js 15 + React + TypeScript
|
||||
|
||||
The frontend of Palmr. is built using **Next.js 15**, along with **React** and **TypeScript**, forming a modern stack that's easy to maintain and super fast for end users. Next.js 15 brings server components, server actions, and a new app router system that makes rendering dynamic content incredibly efficient. This allows us to load only what's needed, when it's needed - which makes the app feel snappy even under load. React provides a clean, component-based structure that makes it easy to break the UI into reusable pieces, and TypeScript helps prevent bugs before they even happen by enforcing static typing and better code navigation.
|
||||
|
||||
- **React** enables the creation of a dynamic and responsive user interface with a component-based architecture
|
||||
- **TypeScript** adds static typing, enhancing code quality and reducing runtime errors
|
||||
- **Next.js 15** handles routing, server-side rendering, and server components for performance at scale
|
||||
|
||||
### Filesystem storage
|
||||
|
||||
Palmr. uses **filesystem storage** as the default storage solution, keeping things simple and efficient. Files are organized in a structured directory layout on the local filesystem, making it easy to understand, backup, and manage. This approach eliminates external dependencies and provides excellent performance for most use cases. The system also supports **S3-compatible object storage** as an optional alternative for users who need cloud storage or additional scalability features.
|
||||
|
||||
- Simple and reliable file storage with organized directory structure
|
||||
- No external dependencies required for basic operation
|
||||
- Excellent performance for local file operations
|
||||
- Optional S3-compatible storage support for cloud deployments and scalability
|
||||
|
||||
### Fastify + Zod + TypeScript
|
||||
|
||||
The backend of Palmr. is powered by **Fastify**, **Zod**, and **TypeScript**, creating a robust and type-safe API layer. Fastify is a super-fast Node.js web framework optimized for performance and low overhead, designed to handle lots of concurrent requests with minimal resource usage. Zod provides runtime type validation and schema definition, ensuring all incoming data is properly validated before reaching business logic. TypeScript adds compile-time type safety throughout the entire backend codebase. This combination creates a highly reliable and maintainable backend that prevents bugs and security issues while maintaining excellent performance.
|
||||
|
||||
- **Fastify** provides fast request handling with a lightweight core
|
||||
- **Zod** enables runtime schema validation and type inference
|
||||
- **TypeScript** ensures type safety across the entire backend codebase
|
||||
- Built-in schema-based validation for secure and reliable API handling
|
||||
- Supports plugin-based architecture for easy extensibility
|
||||
- Optimized for high performance with minimal resource usage
|
||||
|
||||
## How it works
|
||||
|
||||
The Palmr. architecture follows a clean separation of concerns, making it easy to understand and maintain:
|
||||
|
||||
1. **Frontend** — React + TypeScript + Next.js 15 handle the user interface and user interactions
|
||||
2. **Backend** — Fastify + Zod + TypeScript process requests with full type safety and validation
|
||||
3. **Database** — SQLite + Prisma ORM store and manage data with type-safe operations
|
||||
4. **File Storage** — Filesystem storage handles file operations with optional S3-compatible support
|
||||
|
||||
## API integration and extensibility
|
||||
|
||||
One of Palmr.'s key strengths is its **open API architecture**, designed to integrate seamlessly with existing workflows and third-party services. The API can be exposed publicly, allowing for powerful integrations and custom development opportunities.
|
||||
|
||||
### Open API endpoints
|
||||
|
||||
Palmr. provides comprehensive REST API endpoints that can be integrated with various services and platforms:
|
||||
|
||||
**Popular integration possibilities:**
|
||||
|
||||
- **Zapier** - Automate file sharing workflows and connect with 5,000+ apps
|
||||
- **Microsoft Power Automate** - Create automated workflows within Microsoft ecosystem
|
||||
- **IFTTT** - Simple automation for personal and business use cases
|
||||
- **n8n** - Self-hosted workflow automation for advanced users
|
||||
- **GitHub Actions** - Integrate file sharing into CI/CD pipelines
|
||||
- **Slack/Discord Bots** - Share files directly from chat platforms
|
||||
- **Mobile Apps** - Build custom mobile applications using the API
|
||||
- **Desktop Applications** - Create native desktop clients for specific use cases
|
||||
|
||||
### Custom development opportunities
|
||||
|
||||
The open API architecture enables developers to:
|
||||
|
||||
- **Build custom clients** - Create specialized interfaces for specific industries or use cases
|
||||
- **Develop integrations** - Connect Palmr. with existing business systems and workflows
|
||||
- **Create automation scripts** - Automate repetitive file management tasks
|
||||
- **Build mobile apps** - Develop native iOS/Android applications
|
||||
- **Integrate with CMS** - Connect content management systems for seamless file handling
|
||||
- **Create backup solutions** - Build automated backup and sync tools
|
||||
|
||||
### API benefits
|
||||
|
||||
- **RESTful design** - Standard HTTP methods and status codes for easy integration
|
||||
- **Comprehensive documentation** - Complete API reference with examples and use cases
|
||||
- **Authentication support** - Secure API access with JWT token-based authentication
|
||||
- **Schema validation** - Built-in request/response validation using Zod schemas
|
||||
- **Type safety** - Full TypeScript support for reliable integrations
|
||||
- **Bulk operations** - Efficient handling of multiple files and batch operations
|
||||
|
||||
This open architecture makes Palmr. not just a file-sharing platform, but a **file management ecosystem** that can adapt to any workflow or business requirement. Whether you're a developer looking to integrate file sharing into your application or a business wanting to automate file workflows, Palmr.'s API provides the flexibility and power you need.
|
||||
|
||||
## Storage flexibility
|
||||
|
||||
Palmr. is designed to be flexible in how you handle file storage:
|
||||
|
||||
**Default setup (Filesystem):**
|
||||
|
||||
- Files stored directly on the local filesystem
|
||||
- Simple directory structure for easy management
|
||||
- Perfect for single-server deployments and development
|
||||
- No additional configuration required
|
||||
|
||||
**Optional S3-compatible storage:**
|
||||
|
||||
- Enable S3 storage by setting `ENABLE_S3=true`, look at [S3 Providers](/docs/3.0-beta/s3-providers) for more information.
|
||||
- Compatible with AWS S3, MinIO, and other S3-compatible services
|
||||
- Ideal for cloud deployments and distributed setups
|
||||
- Provides additional scalability and redundancy options
|
||||
|
||||
## Useful links
|
||||
|
||||
- [SQLite Documentation](https://www.sqlite.org/docs.html)
|
||||
- [Prisma Documentation](https://www.prisma.io/docs)
|
||||
- [Next.js Documentation](https://nextjs.org/docs)
|
||||
- [React Documentation](https://react.dev/)
|
||||
- [TypeScript Handbook](https://www.typescriptlang.org/docs/)
|
||||
- [Fastify Documentation](https://fastify.dev/docs/latest/)
|
||||
- [Zod Documentation](https://zod.dev/)
|
||||
142
apps/docs/content/docs/3.0-beta/github-architecture.mdx
Normal file
@@ -0,0 +1,142 @@
|
||||
---
|
||||
title: GitHub Architecture
|
||||
icon: Github
|
||||
---
|
||||
|
||||
import { File, Folder, Files } from "fumadocs-ui/components/files";
|
||||
|
||||
This guide provides a comprehensive overview of Palmr.'s GitHub repository structure, explaining how the different components are organized in the codebase. Understanding this architecture will help you navigate the repository, contribute effectively, and understand how the project is structured.
|
||||
|
||||
> **Overview:** Palmr. uses a monorepo architecture with clear separation between frontend, backend, and documentation components.
|
||||
|
||||
## Project structure
|
||||
|
||||
<Files>
|
||||
<Folder name="apps" defaultOpen>
|
||||
<Folder name="docs">
|
||||
<File name="all documentation files" />
|
||||
</Folder>
|
||||
<Folder name="server">
|
||||
<File name="all backend files" />
|
||||
</Folder>
|
||||
<Folder name="web">
|
||||
<File name="all frontend files" />
|
||||
</Folder>
|
||||
</Folder>
|
||||
<File name="other project files" />
|
||||
</Files>
|
||||
|
||||
## Core components
|
||||
|
||||
### Frontend application (apps/web)
|
||||
|
||||
**Technology stack:**
|
||||
|
||||
- Next.js 15 (App Router)
|
||||
- React 18
|
||||
- TypeScript
|
||||
- TailwindCSS
|
||||
- shadcn/ui components
|
||||
- next-intl for internationalization
|
||||
|
||||
Palmr.'s frontend is built with **Next.js 15**, using the App Router and Server Components for performance, scalability, and flexibility. The structure is modular and feature-based, keeping things easy to evolve as the product grows. UI logic runs on **React 18**, and **TypeScript** adds type safety that prevents a lot of silent bugs. Styles are handled with **TailwindCSS**, letting us build clean, responsive interfaces quickly. For components, we rely on **shadcn/ui**, a headless component library built with Radix UI and Tailwind, it's fast, accessible, and fully customizable.
|
||||
|
||||
Internationalization is handled by **next-intl**, which integrates perfectly with Next.js routing. It supports locale-aware routes, per-page translation loading, and plural rules, all without any extra client-side bloat. It's flexible, lightweight, and great for apps with multilingual audiences.
|
||||
|
||||
The frontend is organized with:
|
||||
|
||||
- A **components-based architecture** for modular UI
|
||||
- **Custom hooks** to isolate logic and side effects
|
||||
- A **route protection system** using session cookies and middleware
|
||||
- A **file management interface** integrated with the backend
|
||||
- A **reusable modal system** used for file actions, confirmations, and more
|
||||
- **Dynamic, locale-aware routing** using next-intl
|
||||
|
||||
### Backend service (apps/server)
|
||||
|
||||
**Technology stack:**
|
||||
|
||||
- Fastify
|
||||
- SQLite
|
||||
- Filesystem storage (with S3-compatible object storage support)
|
||||
- Prisma ORM
|
||||
|
||||
The backend is built on **Fastify**, a blazing-fast web framework for Node.js. It's lightweight, modular, and optimized for high performance. Every route is validated using JSON schema, which helps keep the API consistent and secure. Auth flows are built using JWTs stored in HTTP-only cookies, and everything from file uploads to token-based sharing goes through this layer.
|
||||
|
||||
Data is stored in **SQLite**, which handles user info, file metadata, session tokens, and more. For file storage, the system uses **filesystem storage** by default, keeping files organized in the local file system. The architecture also supports **S3-compatible object storage** as an alternative storage option for scalability. We use **Prisma** as our ORM to simplify database access, it gives us type-safe queries and easy-to-read code.
|
||||
|
||||
Key features include:
|
||||
|
||||
- **Authentication/authorization** with JWT + cookie sessions
|
||||
- **File management logic** including uploads, deletes, and renames
|
||||
- **Storage operations** to handle file organization, usage tracking, and cleanup
|
||||
- A **share system** that generates tokenized public file links
|
||||
- Schema-based request validation for all endpoints
|
||||
- Prisma models that keep the database logic predictable and type-safe
|
||||
|
||||
### Documentation (apps/docs)
|
||||
|
||||
**Technology stack:**
|
||||
|
||||
- Fumadocs
|
||||
- MDX (Markdown + JSX)
|
||||
- React-based components
|
||||
|
||||
The docs are built using **Fumadocs**, a modern documentation system built on top of Next.js. It uses **MDX**, so you can mix Markdown with interactive React components, perfect for developer tools and open-source projects. Pages are fast, versionable, and easy to customize. The goal is to keep the documentation as close to the codebase as possible, using shared components where needed and reusing UI patterns directly from the app.
|
||||
|
||||
It supports sidebar navigation, keyboard shortcuts, dark mode, and even interactive demos or UI previews. The file tree you see above, for example, is powered by a real React component from the docs.
|
||||
|
||||
- Built with **Fumadocs**, powered by Next.js
|
||||
- Supports **MDX** and full React component embedding
|
||||
- Ideal for technical docs and live code samples
|
||||
- Styled using the same Tailwind setup from the main app
|
||||
|
||||
### Infrastructure
|
||||
|
||||
Palmr. is fully containerized using **Docker**, which means every service: frontend, backend, database, storage, runs in its own isolated environment. With `docker-compose`, the whole stack spins up locally with a single command. It's also easy to deploy to services like Fly.io, Render, or your own VPS.
|
||||
|
||||
Volumes are used to persist data locally, and containers are networked together so that all services can talk to each other securely.
|
||||
|
||||
- **Docker-first architecture** with all services containerized
|
||||
- Configurable through `.env` and compose overrides
|
||||
- Local volumes and named networks
|
||||
- Easy to deploy and scale on any container-compatible infra
|
||||
|
||||
## Key features
|
||||
|
||||
### File management
|
||||
|
||||
Files are at the heart of Palmr. Users can upload files via the frontend, and they're stored directly in the filesystem. The backend handles metadata (name, size, type, ownership), and also handles deletion, renaming, and public sharing. Every file operation is tracked, and all actions can be scoped per user.
|
||||
|
||||
- Upload/download with instant feedback
|
||||
- File previews, type validation, and size limits
|
||||
- Token-based sharing system
|
||||
- Disk usage tracking by user
|
||||
|
||||
### User system
|
||||
|
||||
Authentication is done through secure JWTs, stored in HTTP-only cookies for safety. Signup and login flows are simple and fast, and user info is kept in sync across the frontend and backend.
|
||||
|
||||
- Cookie-based session management
|
||||
- Role support and future admin access
|
||||
- Profile updates and password reset flows
|
||||
- Logged-in user state handled via custom hooks
|
||||
|
||||
### Storage system
|
||||
|
||||
The system uses **filesystem storage** for all file operations by default. It's simple, fast, and reliable for most use cases. The architecture also supports **S3-compatible object storage** as an alternative for users who need cloud storage or additional scalability. The backend tracks usage, handles cleanup of orphaned files, and ensures that every file on disk has a matching database record.
|
||||
|
||||
- Filesystem-based storage with organized directory structure
|
||||
- Optional S3-compatible object storage support
|
||||
- Upload validation and automatic cleanup
|
||||
- Usage tracking and quotas (per user or global)
|
||||
- Secure access to stored files with proper permissions
|
||||
|
||||
### Internationalization
|
||||
|
||||
Palmr. supports multiple languages using **next-intl**, which is deeply integrated into the routing system. It loads only the necessary translations per route, supports nested namespaces, and makes it easy to keep things organized even at scale.
|
||||
|
||||
- Per-locale localstorage (`en-US`, `pt-BR`, etc.)
|
||||
- Translation loading by namespace/page
|
||||
- Full pluralization and formatting support
|
||||
- Easy translation management via JSON files
|
||||
50
apps/docs/content/docs/3.0-beta/index.mdx
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
title: Welcome to Palmr.
|
||||
icon: TreePalm
|
||||
---
|
||||
|
||||
import { Ban, Star, Shield, Palette, Users, Zap } from "lucide-react";
|
||||
|
||||

|
||||
|
||||
**Palmr.** is your go-to **open-source alternative** for file sharing, standing tall against services like **WeTransfer**, **SendGB**, **Send Anywhere**, and **Files.fm**. What sets Palmr. apart? You get to **host it on your own infrastructure** be it a **dedicated server** or **VPS** putting you in the driver’s seat for data security and file control. No more third-party dependencies or worrying about pesky limits and steep fees!
|
||||
|
||||
## Why Palmr. Rocks?
|
||||
|
||||
### No limits, seriously
|
||||
|
||||
Forget about arbitrary caps on file sizes or numbers. With Palmr., the only limit is your **server’s storage space**. Got the capacity? Then transfer files of any size or quantity without a hitch. No premium plans to unlock, no annoying ads to dodge, and definitely no hidden fees sneaking up on you. Your file sharing freedom is tied to your infrastructure, not artificial restrictions.
|
||||
|
||||
### Open source & totally free
|
||||
|
||||
Palmr. is 100% **open source** and free no licenses, subscriptions, or surprise costs. This transparency means you’ve got full control over how you use it. Here’s what that looks like:
|
||||
|
||||
- Deploy anywhere **VPS**, **dedicated server**, **Docker**, or any cloud platform you fancy.
|
||||
- Peek under the hood by reviewing the **codebase** to ensure it’s secure and meets your standards.
|
||||
- Pitch in with **improvements** or custom features to make Palmr. even better.
|
||||
- Tweak it for any use case, from personal sharing to business needs or niche applications.
|
||||
|
||||
### Your data, your rules
|
||||
|
||||
Host Palmr. on your own setup and keep **full control over your data**. By managing storage and transfers yourself, you cut out third-party risks. Your files stay in your environment no external services touching or storing them ensuring top-notch **privacy** and **confidentiality**. Set up security measures that fit your needs, and rest easy knowing no one else is in the loop. Palmr. hands you the reins for ultimate peace of mind, perfect for organizations needing strict data control or regulatory compliance.
|
||||
|
||||
### Make it yours
|
||||
|
||||
Palmr. is a canvas for customization, letting you shape every detail to match your **brand** and **user experience**:
|
||||
|
||||
- Slap on your **logo** for consistent branding across the platform.
|
||||
- Pick a **custom app name** that screams your identity.
|
||||
- Hook up an **SMTP server** for seamless email notifications about transfers or updates.
|
||||
- Rewrite **interface text** to vibe with your audience and keep your brand’s voice.
|
||||
|
||||
### Manage users like a pro
|
||||
|
||||
Take charge of your file-sharing world with Palmr.’s robust **user and admin management** system:
|
||||
|
||||
- Set up multiple **admins** to share the load and keep things running smoothly.
|
||||
- Add as many **users** as you need, from small crews to huge teams.
|
||||
- Keep tabs on **storage usage** with handy analytics for smarter resource planning.
|
||||
|
||||
### Lightning fast & feather light
|
||||
|
||||
Palmr. is built for speed with a sleek, scalable design that handles big file transfers and busy user loads without breaking a sweat. It keeps transfer speeds high and adapts to growing demands effortlessly. Thanks to smart resource use and polished code, you get a snappy experience that scales with your needs while staying rock-solid and stable.
|
||||
251
apps/docs/content/docs/3.0-beta/manual-installation.mdx
Normal file
@@ -0,0 +1,251 @@
|
||||
---
|
||||
title: Manual Installation
|
||||
icon: Cog
|
||||
---
|
||||
|
||||
Hey there! Looking to run **Palmr.** your way, with complete control over every piece of the stack? This manual installation guide is for you. No Docker, no pre-built containers just the raw source code to tweak, customize, and deploy as you see fit.
|
||||
|
||||
> **Prefer a quicker setup?** If this hands-on approach feels like overkill, check out our [**Quick Start (Docker)**](/docs/3.0-beta/quick-start) guide for a fast, containerized deployment. This manual path is tailored for developers who want to dive deep, modify the codebase, or integrate custom services.
|
||||
|
||||
Here's what you'll do at a glance:
|
||||
|
||||
1. **Clone** the repository to get the code.
|
||||
2. **Configure** `.env` files for backend and frontend.
|
||||
3. **Install** JavaScript dependencies using `pnpm`.
|
||||
4. **Generate** the Prisma client and run database migrations.
|
||||
5. **Seed** the database with initial Palmr. data.
|
||||
6. **Build & start** the backend (Fastify API).
|
||||
7. **Build & serve** the frontend (Next.js app).
|
||||
|
||||
We've broken down each step below feel free to jump to the section you're working on!
|
||||
|
||||
## Before you start
|
||||
|
||||
Let's make sure your environment is ready to roll. Check that you've got these tools installed and set up on your system:
|
||||
|
||||
- <span style={{ color: "#16a34a" }}>Node.js</span> *(Powers our JavaScript/TypeScript
|
||||
apps)*
|
||||
- <span style={{ color: "#16a34a" }}>pnpm</span> *(Our go-to package manager)*
|
||||
- <span style={{ color: "#16a34a" }}>Git</span> *(For cloning and managing the repo)*
|
||||
|
||||
⚠️ **Heads Up on Package Managers**: Palmr. was built and tested with `pnpm`. While you _could_ try `npm`, `yarn`, or `bun`, we strongly recommend sticking with `pnpm` to avoid compatibility headaches.
|
||||
|
||||
---
|
||||
|
||||
### System requirements
|
||||
|
||||
- **Operating System**: MacOS or Linux (recommended for best results)
|
||||
- Windows works but hasn't been thoroughly tested.
|
||||
- **Memory**: At least 4GB RAM is suggested.
|
||||
- **Storage**: Depends on how much file storage you'll need.
|
||||
- **CPU**: 2+ cores for smooth performance.
|
||||
|
||||
---
|
||||
|
||||
## Let's Get Palmr. Running
|
||||
|
||||
### Step 1: Clone the repository
|
||||
|
||||
First things first, grab a local copy of the Palmr. codebase. Run this command to clone the official repo:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/kyantech/Palmr.git
|
||||
```
|
||||
|
||||
Once it's done, you'll have a new directory with the project structure. Inside, the `apps` folder holds the key pieces: `docs`, `server`, and `web`. For this guide, we're focusing on `server` (our Fastify backend) and `web` (our Next.js frontend).
|
||||
|
||||
---
|
||||
|
||||
### Step 2: Set up the backend
|
||||
|
||||
Let's get the backend up and running. Start by navigating to the server directory:
|
||||
|
||||
```bash
|
||||
cd ./apps/server
|
||||
```
|
||||
|
||||
#### Configure environment variables
|
||||
|
||||
Before anything else, we need to set up the environment variables Palmr. relies on. We've included a handy template file called `.env.example` to get you started. Create your own `.env` file with this command:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
This copies the template into a new `.env` file with all the necessary settings. Open it up if you need to tweak anything specific to your setup.
|
||||
|
||||
#### Install dependencies
|
||||
|
||||
Next, let's install the backend dependencies. With Node.js and `pnpm` ready, run:
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
|
||||
This pulls in everything needed for the backend, including Prisma, our database ORM.
|
||||
|
||||
#### Generate Prisma client
|
||||
|
||||
Now, generate the Prisma client tailored for Palmr. with:
|
||||
|
||||
```bash
|
||||
pnpm dlx prisma generate
|
||||
```
|
||||
|
||||
This sets up the interface for smooth database interactions.
|
||||
|
||||
#### Deploy Prisma migrations
|
||||
|
||||
With the client ready, apply the database schema using:
|
||||
|
||||
```bash
|
||||
pnpm dlx prisma migrate deploy
|
||||
```
|
||||
|
||||
This ensures your database structure is set up with all the required migrations.
|
||||
|
||||
#### Seed the database
|
||||
|
||||
Let's populate the database with some initial data. Run the seeding script:
|
||||
|
||||
```bash
|
||||
pnpm db:seed
|
||||
```
|
||||
|
||||
This adds the baseline data Palmr. needs to function properly.
|
||||
|
||||
#### Build and run the backend
|
||||
|
||||
Finally, build the backend app:
|
||||
|
||||
```bash
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
Once the build is complete, start the service:
|
||||
|
||||
```bash
|
||||
pnpm start
|
||||
```
|
||||
|
||||
To confirm everything's working, check out the API documentation at:
|
||||
|
||||
```bash
|
||||
http://localhost:3333/docs
|
||||
```
|
||||
|
||||
This page lists all available API endpoints and how to use them.
|
||||
|
||||
---
|
||||
|
||||
### Step 3: Set up the frontend
|
||||
|
||||
With the backend humming, let's tackle the frontend setup.
|
||||
|
||||
#### Navigate to the Frontend Directory
|
||||
|
||||
If you're in the `server` folder, move to `web` with:
|
||||
|
||||
```bash
|
||||
cd ../web
|
||||
```
|
||||
|
||||
Or, from the repo root, use:
|
||||
|
||||
```bash
|
||||
cd apps/web
|
||||
```
|
||||
|
||||
#### Configure environment variables
|
||||
|
||||
Just like the backend, set up the frontend environment variables:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
This creates a `.env` file with the necessary configurations for the frontend.
|
||||
|
||||
#### Install dependencies
|
||||
|
||||
Install all the frontend dependencies:
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
|
||||
#### Build and run the frontend
|
||||
|
||||
Build the production version of the frontend:
|
||||
|
||||
```bash
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
Once that's done, serve it up:
|
||||
|
||||
```bash
|
||||
pnpm serve
|
||||
```
|
||||
|
||||
Now, open your browser and head to:
|
||||
|
||||
```bash
|
||||
http://localhost:3000
|
||||
```
|
||||
|
||||
You should see the full Palmr. application ready to go!
|
||||
|
||||
---
|
||||
|
||||
## Quick notes
|
||||
|
||||
This guide sets up Palmr. using the local file system for storage. Want to use an S3-compatible object storage instead? You can configure that in the `.env` file. Check the Palmr. documentation for details on setting up S3 storage just update the environment variables, then build and run as shown here.
|
||||
|
||||
---
|
||||
|
||||
## Command cheat sheet
|
||||
|
||||
Here's a quick reference for all the commands we've covered perfect for copy-pasting once you're familiar with the steps:
|
||||
|
||||
```bash
|
||||
# --- Backend (Fastify API) ---
|
||||
cd apps/server
|
||||
pnpm install
|
||||
pnpm dlx prisma generate
|
||||
pnpm dlx prisma migrate deploy
|
||||
pnpm db:seed
|
||||
pnpm run build
|
||||
pnpm start
|
||||
|
||||
# --- Frontend (Next.js) ---
|
||||
cd apps/web
|
||||
pnpm install
|
||||
pnpm run build
|
||||
pnpm serve
|
||||
```
|
||||
|
||||
> **Tip**: Keep this handy in your clipboard for your first setup run.
|
||||
|
||||
---
|
||||
|
||||
## What's next?
|
||||
|
||||
Palmr. is now up and running locally . Here are some suggested next steps:
|
||||
|
||||
- **Manage Users**: Dive into the [Users Management](/docs/3.0-beta/manage-users) guide.
|
||||
- **Switch to Object Storage**: Update `.env` variables to use an S3-compatible bucket (see Quick Notes above).
|
||||
- **Secure Your Instance**: Put Palmr. behind a reverse proxy like **Nginx** or **Caddy** and enable HTTPS.
|
||||
- **Learn the Internals**: Explore how everything connects in the [Architecture](/docs/3.0-beta/architecture) overview.
|
||||
|
||||
Jump into whichever area fits your needs our docs are designed for exploration in any order.
|
||||
|
||||
## Wrapping up
|
||||
|
||||
Congrats! You've successfully set up a production-ready instance of Palmr. through this detailed manual process. From cloning the repo to deploying the app, you've tackled every step like a pro.
|
||||
|
||||
## Helpful resources
|
||||
|
||||
- [Node.js Documentation](https://nodejs.org/en/docs/)
|
||||
- [pnpm Documentation](https://pnpm.io/)
|
||||
- [Prisma Documentation](https://www.prisma.io/docs/)
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title": "v2.1-beta",
|
||||
"title": "v3.0-beta",
|
||||
"description": "Latest version",
|
||||
"root": true,
|
||||
"icon": "Sparkles",
|
||||
@@ -8,16 +8,20 @@
|
||||
"index",
|
||||
"quick-start",
|
||||
"installation",
|
||||
"api",
|
||||
"manual-installation",
|
||||
"screenshots",
|
||||
"s3-providers",
|
||||
"---How to use Palmr.---",
|
||||
"manage-users",
|
||||
"upload",
|
||||
"generate-share",
|
||||
"configuring-smtp",
|
||||
"available-languages",
|
||||
"password-reset-without-smtp",
|
||||
"---Developers---",
|
||||
"architecture",
|
||||
"github-architecture",
|
||||
"api",
|
||||
"contribute",
|
||||
"open-an-issue",
|
||||
"---Sponsor this project---",
|
||||
181
apps/docs/content/docs/3.0-beta/password-reset-without-smtp.mdx
Normal file
@@ -0,0 +1,181 @@
|
||||
---
|
||||
title: Password Reset Without SMTP
|
||||
icon: Lock
|
||||
---
|
||||
|
||||
This guide provides detailed instructions on how to reset a user password directly inside the Docker container for Palmr, without requiring SMTP configuration. This method is particularly useful for administrators who do not have email services set up or need to regain access to accounts in emergency situations.
|
||||
|
||||
## When and why to use this method
|
||||
|
||||
Resetting a password without SMTP is an alternative approach for specific scenarios where the standard email-based reset is not feasible. Consider using this method if:
|
||||
|
||||
- An admin user is locked out and cannot access their email for a password reset.
|
||||
- SMTP services are not configured or are experiencing issues.
|
||||
- You need to perform emergency system recovery and restore access quickly.
|
||||
- You are setting up an initial environment and need to configure accounts.
|
||||
- You are conducting controlled testing in a development setup.
|
||||
|
||||
> **Warning:** This process bypasses the normal email-based password reset mechanism, which could pose a security risk if not handled properly. Use this method only when necessary, ensure it is performed by trusted administrators, and always document the reason for the reset.
|
||||
|
||||
## How the password reset works
|
||||
|
||||
Palmr provides a CLI script that allows administrators to reset passwords directly within the Docker container. This script is designed to maintain security by enforcing interactive confirmation at every step, validating input data, and securely encrypting the new password using bcrypt with 10 salt rounds (consistent with the system's security standards). The script does not send email notifications, log invalid login attempts, or alter other user settings—it focuses solely on password reset.
|
||||
|
||||
## Step-by-step instructions
|
||||
|
||||
Follow these steps to reset a user password using the provided script. Ensure you have access to the Docker container before proceeding.
|
||||
|
||||
### 1. List Docker containers and identify the correct one
|
||||
|
||||
Before accessing the Palmr container, you need to identify its name or ID. Open a terminal on your host machine and list all running Docker containers by running the following command:
|
||||
|
||||
```bash
|
||||
docker ps
|
||||
```
|
||||
|
||||
This command will display a list of active containers, including their names, IDs, images, and other details. Look for the container running the Palmr application. If you used a specific name when setting up the container (e.g., `palmr-app`), it will appear under the `NAMES` column. If no name was specified, note the `CONTAINER ID` (a short string of characters) for the container associated with the Palmr image (likely something like `palmr` or a custom image name).
|
||||
|
||||
> **Note:** If you don't see the Palmr container, ensure it is running. You can start it using `docker start <container_name_or_id>` if it's stopped. If you're unsure about the setup, refer to the Palmr installation guide.
|
||||
|
||||
### 2. Access the Docker container
|
||||
|
||||
Once you've identified the correct container, access it by running the following command:
|
||||
|
||||
```bash
|
||||
docker exec -it <container_name_or_id> /bin/sh
|
||||
```
|
||||
|
||||
Replace `<container_name_or_id>` with the name or ID of your Palmr container. This command opens an interactive shell session inside the container, allowing you to execute commands directly.
|
||||
|
||||
### 3. Navigate to the server directory
|
||||
|
||||
Once inside the container, navigate to the server directory where the reset script is located:
|
||||
|
||||
```bash
|
||||
cd /app/server
|
||||
```
|
||||
|
||||
This directory contains the necessary scripts and configurations for managing Palmr's backend operations.
|
||||
|
||||
### 4. Run the password reset script
|
||||
|
||||
Execute the password reset script to start the interactive process:
|
||||
|
||||
```bash
|
||||
./reset-password.sh
|
||||
```
|
||||
|
||||
The script will prompt you to enter the email address of the user whose password you wish to reset. It will then display the user's information for verification, ask for confirmation to proceed, and request a new password (minimum 8 characters) which must be entered twice to ensure accuracy. Each step requires explicit confirmation to prevent accidental changes.
|
||||
|
||||
> **Note:** If you need to see a list of all users in the system before proceeding, you can run `./reset-password.sh --list`. For additional help, use `./reset-password.sh --help`.
|
||||
|
||||
### Example session
|
||||
|
||||
Below is an example of how the interactive session might look when running the script:
|
||||
|
||||
```
|
||||
$ ./reset-password.sh
|
||||
|
||||
Palmr Password Reset Tool
|
||||
===============================
|
||||
This script allows you to reset a user's password directly from the Docker terminal.
|
||||
WARNING: This bypasses normal security checks. Use only when necessary!
|
||||
|
||||
Enter user email: user@example.com
|
||||
|
||||
User found:
|
||||
Name: John Smith
|
||||
Username: john.smith
|
||||
Email: user@example.com
|
||||
Status: Active
|
||||
Admin: No
|
||||
|
||||
Do you want to reset the password for this user? (y/n): y
|
||||
|
||||
Enter new password requirements:
|
||||
- Minimum 8 characters
|
||||
|
||||
Enter new password: ********
|
||||
Confirm new password: ********
|
||||
|
||||
Hashing password...
|
||||
Updating password in database...
|
||||
Cleaning up existing password reset tokens...
|
||||
|
||||
Password reset successful!
|
||||
User: John Smith (user@example.com)
|
||||
The user can now login with the new password.
|
||||
|
||||
Security Note: The password has been encrypted using bcrypt with 10 salt rounds.
|
||||
```
|
||||
|
||||
## Troubleshooting common issues
|
||||
|
||||
If you encounter issues while running the script, refer to the following solutions to resolve common problems:
|
||||
|
||||
- **Error: "tsx is not available"**
|
||||
This error indicates missing dependencies. The script will attempt to install them automatically, but if it fails, manually install them by running:
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
# or
|
||||
npm install
|
||||
```
|
||||
|
||||
- **Error: "Prisma client not found"**
|
||||
This error occurs if the Prisma client is not generated. The script should handle this automatically, but if it fails, generate it manually with:
|
||||
|
||||
```bash
|
||||
npx prisma generate
|
||||
```
|
||||
|
||||
- **Error: "Database connection failed"**
|
||||
If the script cannot connect to the database, check the following:
|
||||
|
||||
- Ensure the database service is running within the container.
|
||||
- Confirm that the `prisma/palmr.db` file exists and has the correct permissions.
|
||||
- Verify that the container has access to the database volume.
|
||||
|
||||
- **Error: "Script must be run from server directory"**
|
||||
This error appears if you are not in the correct directory. Navigate to the server directory with:
|
||||
|
||||
```bash
|
||||
cd /app/server
|
||||
```
|
||||
|
||||
- **Error: "User not found"**
|
||||
If the email provided does not match any user, double-check the email address. You can list all users to find the correct one by running:
|
||||
|
||||
```bash
|
||||
./reset-password.sh --list
|
||||
```
|
||||
|
||||
Ensure the user exists in the system before attempting the reset.
|
||||
|
||||
- **Error: "Password does not meet requirements"**
|
||||
The new password must be at least 8 characters long. Ensure it meets this requirement and re-enter it carefully, confirming it matches the second entry.
|
||||
|
||||
- **Error: "Confirmation does not match"**
|
||||
If the two password entries do not match, the script will prompt you to try again. Ensure both entries are identical.
|
||||
|
||||
- **General Script Failure or Unexpected Behavior**
|
||||
If the script fails for an unknown reason, check the error message for details. Ensure your Palmr installation is up to date, and consider restarting the container if there are transient issues. If problems persist, consult the Palmr documentation or community for additional support.
|
||||
|
||||
## Security and best practices
|
||||
|
||||
To maintain the integrity and security of your Palmr instance while using this password reset method, adhere to the following guidelines:
|
||||
|
||||
- **Interactive Confirmation:** The script enforces interactive mode, requiring explicit confirmation at each step to prevent unauthorized or accidental resets. There are no shortcuts or automated options.
|
||||
- **Access Restriction:** Only administrators with direct access to the Docker container can use this script, ensuring that unauthorized users cannot reset passwords.
|
||||
- **Password Encryption:** New passwords are encrypted using bcrypt with 10 salt rounds, matching Palmr's standard security practices.
|
||||
- **Documentation and Notification:** Always document the date, time, and reason for performing a password reset. Notify the affected user through alternative means (if possible) to inform them of the change.
|
||||
- **Backup Recommendation:** Before using this script in a production environment, consider backing up your database to prevent data loss in case of an error.
|
||||
- **Post-Reset Actions:** After resetting a password, verify that the user can log in successfully and check system logs for any unusual activity related to the reset.
|
||||
- **Limit Usage:** Use this method sparingly and only in situations where SMTP-based reset is not an option. It is not intended for routine password management.
|
||||
- **Secure Environment:** Ensure that access to the Docker container and host machine is secured with strong passwords, restricted permissions, and, if possible, two-factor authentication to prevent unauthorized access to administrative tools.
|
||||
|
||||
> **Tip:** Treat this method as a last resort. Whenever possible, configure SMTP to enable the standard email-based password reset process, which provides an additional layer of security and user verification.
|
||||
|
||||
## Security philosophy
|
||||
|
||||
This script is built with a strong focus on security, prioritizing mandatory interactivity, multiple confirmations, and strict input validation. There are no "quick modes" or bypass options—every password reset requires careful and deliberate action from the administrator to ensure accountability and minimize risks.
|
||||
164
apps/docs/content/docs/3.0-beta/quick-start.mdx
Normal file
@@ -0,0 +1,164 @@
|
||||
---
|
||||
title: Quick Start (Docker)
|
||||
icon: "Rocket"
|
||||
---
|
||||
|
||||
Hey there! Welcome to the fastest way to launch <span className="font-bold">Palmr.</span>, your very own secure <span className="font-bold italic">file sharing solution</span>. Whether you're a first-timer to <span className="font-bold italic">self-hosting</span> or a tech wizard, we've made this process incredibly straightforward. In just a few minutes, you'll have a sleek, user-friendly <span className="font-bold italic">file sharing platform</span> running on your <span className="font-bold italic">server</span> or <span className="font-bold italic">VPS</span>.
|
||||
|
||||
This guide is all about speed and simplicity, using our built-in <span className="font-bold italic">file storage system</span> ideal for most users. While Palmr. supports advanced setups like <span className="font-bold italic">manual installation</span> or <span className="font-bold italic">Amazon S3-compatible external storage</span>, we're focusing on the easiest path with <span className="font-bold italic">Docker Compose</span>. Curious about other options? Check out the dedicated sections in our docs for those advanced configurations.
|
||||
|
||||
Let's dive in and get Palmr. up and running!
|
||||
|
||||
## What you'll need
|
||||
|
||||
To get started, you only need two tools installed on your system. Don't worry, they're easy to set up:
|
||||
|
||||
- **Docker** ([https://docs.docker.com](https://docs.docker.com/)) - This will run Palmr. in a container.
|
||||
- **Docker Compose** ([https://docs.docker.com/compose](https://docs.docker.com/compose/)) - This helps manage the setup with a simple configuration file.
|
||||
|
||||
> **Note**: Palmr. was developed on **MacOS** and thoroughly tested on **Linux servers**, ensuring top-notch performance on these platforms. We haven't tested on **Windows** or other environments yet, so there might be some hiccups. Since we're still in **beta**, bugs can pop up anywhere. If you spot an issue, we'd love your help please report it on our GitHub [issues page](https://github.com/kyantech/Palmr/issues).
|
||||
|
||||
## Setting up with Docker Compose
|
||||
|
||||
Docker Compose is the simplest way to deploy Palmr. across different environments. Once you've got Docker and Docker Compose installed, you're ready to roll with our streamlined setup.
|
||||
|
||||
In the root folder of the Palmr. project, you'll find a few compose files. For this guide, we're using `docker-compose.yaml` the only file you need to run Palmr. with file system storage. No need to build anything yourself; our pre-built images are hosted on [DockerHub](https://hub.docker.com/repositories/kyantech) and referenced in this file.
|
||||
|
||||
You can tweak settings directly in `docker-compose.yaml` or use environment variables (more on that later). Let's take a closer look at what's inside this file.
|
||||
|
||||
## Exploring the docker-compose.yaml file
|
||||
|
||||
Here's the full content of our `docker-compose.yaml`. Feel free to copy it from here or grab it from our official repository ([Docker Compose](https://github.com/kyantech/Palmr/blob/main/docker-compose.yaml)).
|
||||
|
||||
```yaml
|
||||
services:
|
||||
palmr:
|
||||
image: kyantech/palmr:latest
|
||||
container_name: palmr
|
||||
environment:
|
||||
- ENABLE_S3=false
|
||||
- ENCRYPTION_KEY=change-this-key-in-production-min-32-chars # CHANGE THIS KEY FOR SECURITY
|
||||
ports:
|
||||
- "5487:5487" # Web port
|
||||
- "3333:3333" # API port (OPTIONAL EXPOSED - ONLY IF YOU WANT TO ACCESS THE API DIRECTLY, IF YOU DONT WANT TO EXPOSE THE API, JUST REMOVE THIS LINE )
|
||||
volumes:
|
||||
- palmr_data:/app/server # Volume for the application data
|
||||
restart: unless-stopped # Restart the container unless it is stopped
|
||||
|
||||
volumes:
|
||||
palmr_data:
|
||||
```
|
||||
|
||||
We've added helpful comments in the file to guide you through customization. Let's break down what you can adjust to fit your setup.
|
||||
|
||||
---
|
||||
|
||||
### Understanding the services
|
||||
|
||||
Palmr. runs as a single service in this filesystem storage setup. Here's a quick overview:
|
||||
|
||||
| **Service** | **Image** | **Exposed Ports** | **Main Features** |
|
||||
| ----------- | ---------------------------------------------------------------------------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
||||
| palmr | [kyantech/palmr:latest](https://hub.docker.com/repository/docker/kyantech/palmr/general) | **3333** (API)<br/>**5487** (Web) | • Combined backend API and frontend service<br/>• Uses local filesystem storage<br/>• Has healthcheck to ensure availability |
|
||||
|
||||
---
|
||||
|
||||
### Customizing with environment variables
|
||||
|
||||
You can fine-tune Palmr. using environment variables. Here's what's available for the filesystem storage setup:
|
||||
|
||||
| **Variable** | **Default Value** | **Description** |
|
||||
| ---------------- | ------------------------------------------ | ------------------------------------------------------------ |
|
||||
| `ENABLE_S3` | false | Set to 'false' for filesystem storage or 'true' for S3/MinIO |
|
||||
| `ENCRYPTION_KEY` | change-this-key-in-production-min-32-chars | Required for filesystem encryption (minimum 32 characters) |
|
||||
|
||||
> **Important**: These variables can be set in a `.env` file at the project root or directly in your environment when running Docker Compose. The `ENCRYPTION_KEY` is crucial for securing your filesystem storage **always change it** to a unique, secure value in production. you can generate a secure key using the [KeyGenerator](/docs/3.0-beta/quick-start#generating-a-secure-encryption-key) tool.
|
||||
|
||||
---
|
||||
|
||||
### Managing persistent data
|
||||
|
||||
To ensure your data sticks around even if the container restarts, we use a persistent volume:
|
||||
|
||||
| **Volume** | **Description** |
|
||||
| ------------ | ------------------------------------- |
|
||||
| `palmr_data` | Stores all the data of Palmr. service |
|
||||
|
||||
---
|
||||
|
||||
## Launching Palmr.
|
||||
|
||||
With your `docker-compose.yaml` ready, it's time to start Palmr.! Run this command to launch everything in the background:
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
This runs Palmr. in **detached mode**, meaning it operates silently in the background without flooding your terminal with logs.
|
||||
|
||||
Now, open your browser and visit:
|
||||
|
||||
```bash
|
||||
http://localhost:5487
|
||||
```
|
||||
|
||||
If you're on a server, replace `localhost` with your server's IP:
|
||||
|
||||
```bash
|
||||
http://[YOUR_SERVER_IP]:5487
|
||||
```
|
||||
|
||||
For example, if your server IP is `192.168.1.10`, the URL would be `http://192.168.1.10:5487`. Remember, this is just an example use your actual server IP.
|
||||
|
||||
> **Pro Tip**: For full functionality and security, configure your server with **HTTPS** by setting up a valid SSL certificate.
|
||||
|
||||
---
|
||||
|
||||
## Keeping Palmr. up to date
|
||||
|
||||
Want the latest features and fixes? Updating Palmr. is a breeze. Run these commands to pull the newest version from DockerHub and restart the service:
|
||||
|
||||
```bash
|
||||
docker-compose pull
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
That's it! You're now running the latest version of Palmr.
|
||||
|
||||
---
|
||||
|
||||
## Running with Docker (without Compose)
|
||||
|
||||
Prefer to skip Docker Compose and use plain Docker? No problem! Use this command to start Palmr. directly:
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name palmr \
|
||||
-e ENABLE_S3=false \
|
||||
-e ENCRYPTION_KEY=change-this-key-in-production-min-32-chars \
|
||||
-p 5487:5487 \
|
||||
-p 3333:3333 \
|
||||
-v palmr_data:/app/server \
|
||||
--restart unless-stopped \
|
||||
kyantech/palmr:latest
|
||||
```
|
||||
|
||||
This also runs in detached mode, so it's hands-off. Access Palmr. at the same URLs mentioned earlier.
|
||||
|
||||
> **Critical Reminder**: Whichever method you choose, **change the `ENCRYPTION_KEY`** to a secure, unique value. This key encrypts your files on the filesystem if you lose it, your files become inaccessible.
|
||||
|
||||
---
|
||||
|
||||
## Generating a Secure Encryption Key
|
||||
|
||||
Need a strong key for `ENCRYPTION_KEY`? Use our handy Password Generator Tool below to create one:
|
||||
|
||||
<KeyGenerator />
|
||||
|
||||
---
|
||||
|
||||
## You're all set!
|
||||
|
||||
Congratulations! You've just deployed your own secure file sharing solution with Palmr. in record time. We're thrilled to have you on board and hope you love using this powerful tool as much as we loved building it.
|
||||
|
||||
Got questions or ideas? Dive into the rest of our documentation or reach out via our GitHub [issues page](https://github.com/kyantech/Palmr/issues). Happy sharing!
|
||||
247
apps/docs/content/docs/3.0-beta/s3-providers.mdx
Normal file
@@ -0,0 +1,247 @@
|
||||
---
|
||||
title: S3 Providers
|
||||
icon: Package
|
||||
---
|
||||
|
||||
This guide provides comprehensive configuration instructions for integrating Palmr. with various S3-compatible storage providers. Whether you're using cloud services like AWS S3 or self-hosted solutions like MinIO, this guide will help you set up reliable object storage for your files.
|
||||
|
||||
> **Overview:** Palmr. supports any S3-compatible storage provider, giving you flexibility to choose the solution that best fits your needs and budget.
|
||||
|
||||
## When to use S3-compatible storage
|
||||
|
||||
Consider using S3-compatible storage when you need:
|
||||
|
||||
- **Cloud storage** for distributed deployments
|
||||
- **Scalability** beyond local filesystem limitations
|
||||
- **Redundancy** and backup capabilities
|
||||
- **CDN integration** for faster file delivery
|
||||
- **Multi-region** file distribution
|
||||
|
||||
## Environment variables
|
||||
|
||||
To enable S3-compatible storage, set `ENABLE_S3=true` and configure the following environment variables:
|
||||
|
||||
| Variable | Description | Required | Default |
|
||||
| --------------------- | ----------------------------- | -------- | ----------------- |
|
||||
| `S3_ENDPOINT` | S3 provider endpoint URL | Yes | - |
|
||||
| `S3_PORT` | Connection port | No | Based on protocol |
|
||||
| `S3_USE_SSL` | Enable SSL/TLS encryption | Yes | `true` |
|
||||
| `S3_ACCESS_KEY` | Access key for authentication | Yes | - |
|
||||
| `S3_SECRET_KEY` | Secret key for authentication | Yes | - |
|
||||
| `S3_REGION` | Storage region | Yes | - |
|
||||
| `S3_BUCKET_NAME` | Bucket/container name | Yes | - |
|
||||
| `S3_FORCE_PATH_STYLE` | Use path-style URLs | No | `false` |
|
||||
|
||||
## Provider configurations
|
||||
|
||||
Below are tested configurations for popular S3-compatible providers. Replace the example values with your actual credentials and settings.
|
||||
|
||||
> **Security Note:** Never commit real credentials to version control. Use environment files or secure secret management systems.
|
||||
|
||||
### AWS S3
|
||||
|
||||
Amazon S3 is the original S3 service, offering global availability and extensive features.
|
||||
|
||||
```bash
|
||||
ENABLE_S3=true
|
||||
S3_ENDPOINT=s3.amazonaws.com
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-access-key-id
|
||||
S3_SECRET_KEY=your-secret-access-key
|
||||
S3_REGION=us-east-1
|
||||
S3_BUCKET_NAME=your-bucket-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
**Getting credentials:**
|
||||
|
||||
1. Go to AWS IAM Console
|
||||
2. Create a new user with S3 permissions
|
||||
3. Generate access keys for programmatic access
|
||||
|
||||
### MinIO (Self-hosted)
|
||||
|
||||
MinIO is perfect for self-hosted deployments and development environments.
|
||||
|
||||
```bash
|
||||
ENABLE_S3=true
|
||||
S3_ENDPOINT=localhost
|
||||
S3_PORT=9000
|
||||
S3_USE_SSL=false
|
||||
S3_ACCESS_KEY=your-minio-access-key
|
||||
S3_SECRET_KEY=your-minio-secret-key
|
||||
S3_REGION=us-east-1
|
||||
S3_BUCKET_NAME=your-bucket-name
|
||||
S3_FORCE_PATH_STYLE=true
|
||||
```
|
||||
|
||||
**Setup notes:**
|
||||
|
||||
- Use `S3_FORCE_PATH_STYLE=true` for MinIO
|
||||
- Default MinIO port is 9000
|
||||
- SSL can be disabled for local development
|
||||
|
||||
### Google Cloud Storage
|
||||
|
||||
Google Cloud Storage offers competitive pricing and global infrastructure.
|
||||
|
||||
```bash
|
||||
ENABLE_S3=true
|
||||
S3_ENDPOINT=storage.googleapis.com
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-hmac-access-id
|
||||
S3_SECRET_KEY=your-hmac-secret
|
||||
S3_REGION=us-central1
|
||||
S3_BUCKET_NAME=your-bucket-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
**Getting credentials:**
|
||||
|
||||
1. Enable Cloud Storage API in Google Cloud Console
|
||||
2. Create HMAC keys for S3 compatibility
|
||||
3. Use the generated access ID and secret
|
||||
|
||||
### DigitalOcean Spaces
|
||||
|
||||
DigitalOcean Spaces provides simple, scalable object storage.
|
||||
|
||||
```bash
|
||||
ENABLE_S3=true
|
||||
S3_ENDPOINT=nyc3.digitaloceanspaces.com
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-spaces-access-key
|
||||
S3_SECRET_KEY=your-spaces-secret-key
|
||||
S3_REGION=nyc3
|
||||
S3_BUCKET_NAME=your-space-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
**Available regions:**
|
||||
|
||||
- `nyc3` (New York)
|
||||
- `ams3` (Amsterdam)
|
||||
- `sgp1` (Singapore)
|
||||
- `fra1` (Frankfurt)
|
||||
|
||||
### Backblaze B2
|
||||
|
||||
Backblaze B2 offers cost-effective storage with S3-compatible API.
|
||||
|
||||
```bash
|
||||
ENABLE_S3=true
|
||||
S3_ENDPOINT=s3.us-west-002.backblazeb2.com
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-key-id
|
||||
S3_SECRET_KEY=your-application-key
|
||||
S3_REGION=us-west-002
|
||||
S3_BUCKET_NAME=your-bucket-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
**Cost advantage:**
|
||||
|
||||
- Significantly lower storage costs
|
||||
- Free egress to Cloudflare CDN
|
||||
- Pay-as-you-go pricing model
|
||||
|
||||
### Wasabi
|
||||
|
||||
Wasabi provides hot cloud storage with predictable pricing.
|
||||
|
||||
```bash
|
||||
ENABLE_S3=true
|
||||
S3_ENDPOINT=s3.wasabisys.com
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-access-key
|
||||
S3_SECRET_KEY=your-secret-key
|
||||
S3_REGION=us-east-1
|
||||
S3_BUCKET_NAME=your-bucket-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
**Benefits:**
|
||||
|
||||
- No egress fees
|
||||
- Fast performance
|
||||
- Simple pricing structure
|
||||
|
||||
### Azure Blob Storage
|
||||
|
||||
Azure Blob Storage with S3-compatible API for Microsoft ecosystem integration.
|
||||
|
||||
```bash
|
||||
ENABLE_S3=true
|
||||
S3_ENDPOINT=your-account.blob.core.windows.net
|
||||
S3_USE_SSL=true
|
||||
S3_ACCESS_KEY=your-access-key
|
||||
S3_SECRET_KEY=your-secret-key
|
||||
S3_REGION=eastus
|
||||
S3_BUCKET_NAME=your-container-name
|
||||
S3_FORCE_PATH_STYLE=false
|
||||
```
|
||||
|
||||
**Setup requirements:**
|
||||
|
||||
- Enable S3-compatible API in Azure
|
||||
- Use container name as bucket name
|
||||
- Configure appropriate access policies
|
||||
|
||||
## Configuration best practices
|
||||
|
||||
### Security considerations
|
||||
|
||||
- **Use IAM policies** to limit access to specific buckets and operations
|
||||
- **Enable encryption** at rest and in transit
|
||||
- **Rotate credentials** regularly
|
||||
- **Monitor access logs** for unusual activity
|
||||
- **Use HTTPS** for all connections (`S3_USE_SSL=true`)
|
||||
|
||||
### Performance optimization
|
||||
|
||||
- **Choose regions** close to your users or server location
|
||||
- **Configure CDN** for faster file delivery
|
||||
- **Use appropriate bucket policies** for public file access
|
||||
- **Monitor bandwidth** usage and costs
|
||||
|
||||
### Troubleshooting common issues
|
||||
|
||||
**Connection errors:**
|
||||
|
||||
- Verify endpoint URL and port settings
|
||||
- Check firewall and network connectivity
|
||||
- Ensure SSL/TLS settings match provider requirements
|
||||
|
||||
**Authentication failures:**
|
||||
|
||||
- Confirm access key and secret key are correct
|
||||
- Verify IAM permissions for bucket operations
|
||||
- Check if credentials have expired
|
||||
|
||||
**Bucket access issues:**
|
||||
|
||||
- Ensure bucket exists and is accessible
|
||||
- Verify region settings match bucket location
|
||||
- Check bucket policies and ACL settings
|
||||
|
||||
## Testing your configuration
|
||||
|
||||
After configuring your S3 provider, test the connection by:
|
||||
|
||||
1. **Upload a test file** through the Palmr. interface
|
||||
2. **Verify file appears** in your S3 bucket
|
||||
3. **Download the file** to confirm retrieval works
|
||||
4. **Check file permissions** and access controls
|
||||
|
||||
> **Tip:** Start with a development bucket to test your configuration before using production storage.
|
||||
|
||||
## Switching between providers
|
||||
|
||||
To switch from filesystem to S3 storage or between S3 providers:
|
||||
|
||||
1. **Backup existing files** if switching from filesystem storage
|
||||
2. **Update environment variables** with new provider settings
|
||||
3. **Restart the Palmr. container** to apply changes
|
||||
4. **Test file operations** to ensure everything works correctly
|
||||
|
||||
Remember that existing files won't be automatically migrated when switching storage providers.
|
||||
141
apps/docs/content/docs/3.0-beta/screenshots.mdx
Normal file
@@ -0,0 +1,141 @@
|
||||
---
|
||||
title: Screenshots
|
||||
icon: Image
|
||||
---
|
||||
|
||||
import { ZoomableImage } from "@/components/ui/zoomable-image";
|
||||
|
||||
## Screenshots
|
||||
|
||||
Here you can find a collection of screenshots showcasing various features and interfaces of the Palmr. web application. These images provide a visual overview of the user experience, highlighting key functionalities such as file sharing, user management, and settings configuration. Explore the screenshots below to get a better understanding of how Palmr works and what to expect from the platform.
|
||||
|
||||
> **Note:** All screenshots shown are taken in dark mode, but Palmr. also offers a light mode theme for users who prefer brighter interfaces.
|
||||
|
||||
### Authentication & Access
|
||||
|
||||
#### Home page
|
||||
|
||||
The main landing page where users can access the platform and learn about Palmr.'s features.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/home.png"
|
||||
alt="Home Page - Main landing page of Palmr"
|
||||
/>
|
||||
|
||||
#### Login page
|
||||
|
||||
Secure authentication interface where users enter their credentials to access their Palmr account.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/login.png"
|
||||
alt="Login Page - User authentication interface"
|
||||
/>
|
||||
|
||||
#### Forgot password
|
||||
|
||||
Password recovery interface that allows users to reset their passwords when they can't access their accounts.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/forgot-password.png"
|
||||
alt="Forgot Password - Password recovery interface"
|
||||
/>
|
||||
|
||||
### Main Application Interface
|
||||
|
||||
#### Dashboard
|
||||
|
||||
The central hub after login, providing an overview of recent activity, quick actions, and system status.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/dashboard.png"
|
||||
alt="Dashboard - Main application hub with overview and quick actions"
|
||||
/>
|
||||
|
||||
### File Management
|
||||
|
||||
#### Files list view
|
||||
|
||||
Comprehensive file browser displaying all uploaded files in a detailed list format with metadata, actions, and sorting options.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/files-list.png"
|
||||
alt="Files List View - Detailed file browser with metadata and actions"
|
||||
/>
|
||||
|
||||
#### Files card view
|
||||
|
||||
Alternative file browser layout showing files as visual cards, perfect for quick browsing and visual file identification.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/files-card.png"
|
||||
alt="Files Card View - Visual card-based file browser layout"
|
||||
/>
|
||||
|
||||
#### Receive files
|
||||
|
||||
File upload interface where users can drag and drop or select files to upload to their Palmr storage.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/receive-files.png"
|
||||
alt="Receive Files - File upload interface with drag and drop functionality"
|
||||
/>
|
||||
|
||||
### Sharing & Collaboration
|
||||
|
||||
#### Shares page
|
||||
|
||||
Management interface for all shared files and folders, showing share status, permissions, and access controls.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/shares.png"
|
||||
alt="Shares Page - Share management with permissions and access controls"
|
||||
/>
|
||||
|
||||
### User & System Management
|
||||
|
||||
#### User management
|
||||
|
||||
Administrative interface for managing user accounts, permissions, roles, and system access controls.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/user-management.png"
|
||||
alt="User Management - Administrative interface for user accounts and permissions"
|
||||
/>
|
||||
|
||||
#### Profile settings
|
||||
|
||||
Personal account management where users can update their profile information, preferences, and account settings.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/profile.png"
|
||||
alt="Profile Settings - Personal account management and preferences"
|
||||
/>
|
||||
|
||||
#### System settings
|
||||
|
||||
Comprehensive system configuration interface for administrators to manage platform settings, integrations, and system behavior.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/settings.png"
|
||||
alt="System Settings - Administrative configuration interface"
|
||||
/>
|
||||
|
||||
### Reverse share page themes
|
||||
|
||||
#### WeTransfer theme
|
||||
|
||||
Special sharing interface with WeTransfer-inspired design, providing a familiar experience for file sharing with custom theming.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/wetransfer.png"
|
||||
alt="WeTransfer Theme - WeTransfer-inspired sharing interface with custom theming"
|
||||
/>
|
||||
|
||||
#### Default reverse theme
|
||||
|
||||
Alternative dark theme interface showing Palmr's theming capabilities and customization options for different user preferences.
|
||||
|
||||
<ZoomableImage
|
||||
src="/assets/v3/screenshots/default-reverse.png"
|
||||
alt="Default Reverse Theme - Dark theme interface showcasing customization options"
|
||||
/>
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"pages": [
|
||||
"2.1-beta",
|
||||
"3.0-beta",
|
||||
"2.0.0-beta",
|
||||
"1.1.7-beta"
|
||||
]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "palmr-docs",
|
||||
"version": "2.1-beta",
|
||||
"version": "v3.0-beta",
|
||||
"description": "Docs for Palmr",
|
||||
"private": true,
|
||||
"author": "Daniel Luiz Alves <daniel@kyantech.com.br>",
|
||||
|
||||
BIN
apps/docs/public/assets/v3/architecture/architecture.png
Normal file
|
After Width: | Height: | Size: 171 KiB |
BIN
apps/docs/public/assets/v3/screenshots/dashboard.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
apps/docs/public/assets/v3/screenshots/default-reverse.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
apps/docs/public/assets/v3/screenshots/files-card.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
apps/docs/public/assets/v3/screenshots/files-list.png
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
apps/docs/public/assets/v3/screenshots/forgot-password.png
Normal file
|
After Width: | Height: | Size: 844 KiB |
BIN
apps/docs/public/assets/v3/screenshots/home.png
Normal file
|
After Width: | Height: | Size: 480 KiB |
BIN
apps/docs/public/assets/v3/screenshots/login.png
Normal file
|
After Width: | Height: | Size: 822 KiB |
BIN
apps/docs/public/assets/v3/screenshots/profile.png
Normal file
|
After Width: | Height: | Size: 129 KiB |
BIN
apps/docs/public/assets/v3/screenshots/receive-files.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
BIN
apps/docs/public/assets/v3/screenshots/settings.png
Normal file
|
After Width: | Height: | Size: 105 KiB |
BIN
apps/docs/public/assets/v3/screenshots/shares.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
apps/docs/public/assets/v3/screenshots/user-management.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
BIN
apps/docs/public/assets/v3/screenshots/wetransfer.png
Normal file
|
After Width: | Height: | Size: 3.3 MiB |
@@ -61,7 +61,7 @@ const images = [
|
||||
"https://res.cloudinary.com/technical-intelligence/image/upload/v1745546005/Palmr./profile_mizwvg.png",
|
||||
];
|
||||
|
||||
const docsLink = "/docs/2.0.0-beta";
|
||||
const docsLink = "/docs/3.0-beta";
|
||||
|
||||
export default function HomePage() {
|
||||
return (
|
||||
@@ -89,7 +89,7 @@ function Hero() {
|
||||
<h1 className="mb-8 text-6xl font-bold">
|
||||
Palmr.{" "}
|
||||
<span className="text-[13px] font-light text-muted-foreground/50 font-mono">
|
||||
v2.1-beta
|
||||
v3.0-beta
|
||||
</span>
|
||||
</h1>
|
||||
<h1 className="hidden text-4xl font-medium max-w-[600px] md:block mb-4">
|
||||
|
||||
19
apps/docs/src/app/api/generate-key/route.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { execSync } from "child_process";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const key = execSync(
|
||||
"openssl rand -base64 48 | tr -dc 'A-Za-z0-9' | head -c 64"
|
||||
)
|
||||
.toString()
|
||||
.trim();
|
||||
return NextResponse.json({ key });
|
||||
} catch (error) {
|
||||
console.error("Failed to generate key:", error);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to generate key" },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,8 @@ export const { GET } = createFromSource(source, (page) => {
|
||||
url: page.url,
|
||||
id: page.url,
|
||||
structuredData: page.data.structuredData,
|
||||
tag: page.url.startsWith("/docs/2.1-beta")
|
||||
? "v2.1-beta"
|
||||
tag: page.url.startsWith("/docs/3.0-beta")
|
||||
? "v3.0-beta"
|
||||
: page.url.startsWith("/docs/2.0.0-beta")
|
||||
? "v2.0.0-beta"
|
||||
: "v1.1.7-beta",
|
||||
|
||||
@@ -28,7 +28,7 @@ export default function Layout({ children }: { children: ReactNode }) {
|
||||
<RootProvider
|
||||
search={{
|
||||
options: {
|
||||
defaultTag: "2.1-beta",
|
||||
defaultTag: "3.0-beta",
|
||||
tags: [
|
||||
{
|
||||
name: "v1.1.7 Beta",
|
||||
@@ -39,8 +39,8 @@ export default function Layout({ children }: { children: ReactNode }) {
|
||||
value: "2.0.0-beta",
|
||||
},
|
||||
{
|
||||
name: "v2.1 Beta ✨",
|
||||
value: "2.1-beta",
|
||||
name: "v3.0 Beta ✨",
|
||||
value: "3.0-beta",
|
||||
props: {
|
||||
style: {
|
||||
border: "1px solid rgba(0,165,80,0.2)",
|
||||
|
||||
89
apps/docs/src/components/KeyGenerator.tsx
Normal file
@@ -0,0 +1,89 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { Copy, X } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Toast } from "@/components/ui/toast";
|
||||
|
||||
export function KeyGenerator() {
|
||||
const [key, setKey] = useState("");
|
||||
const [showToast, setShowToast] = useState(false);
|
||||
|
||||
const generateKey = async () => {
|
||||
try {
|
||||
const response = await fetch("/api/generate-key");
|
||||
const data = await response.json();
|
||||
setKey(data.key);
|
||||
} catch (error) {
|
||||
console.error("Failed to generate key:", error);
|
||||
}
|
||||
};
|
||||
|
||||
const copyToClipboard = async () => {
|
||||
if (key) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(key);
|
||||
setShowToast(true);
|
||||
} catch (error) {
|
||||
console.error("Failed to copy:", error);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="my-4 space-y-4">
|
||||
<div className="flex gap-2">
|
||||
<Button onClick={generateKey}>Generate new key</Button>
|
||||
{key && (
|
||||
<Button
|
||||
onClick={() => setKey("")}
|
||||
className="!border-red-200 !text-red-600 hover:!bg-red-50 dark:!border-red-800/50 dark:!text-red-400 dark:hover:!bg-red-950/50"
|
||||
>
|
||||
<X className="h-4 w-4 mr-1" />
|
||||
Clear
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="relative">
|
||||
<code className="block w-full p-3 bg-gray-100 dark:bg-black/80 rounded-md font-mono text-sm min-h-[2.5rem] border border-gray-200 dark:border-gray-700">
|
||||
{key ? (
|
||||
<>
|
||||
<span className="select-none text-gray-500 dark:text-gray-400">
|
||||
ENCRYPTION_KEY=
|
||||
</span>
|
||||
<span className="text-green-900 dark:text-green-600">{key}</span>
|
||||
</>
|
||||
) : (
|
||||
<span className="text-gray-500 dark:text-gray-400">
|
||||
Click the button above to generate a new encryption key
|
||||
</span>
|
||||
)}
|
||||
</code>
|
||||
{key && (
|
||||
<button
|
||||
onClick={copyToClipboard}
|
||||
className="absolute right-2 top-1/2 -translate-y-1/2 p-1.5 rounded-md hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors cursor-pointer"
|
||||
title="Copy to clipboard"
|
||||
>
|
||||
<Copy className="h-4 w-4 text-gray-600 dark:text-gray-400" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{key && (
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400">
|
||||
Copy the key and paste it into your <code>docker-compose.yml</code>{" "}
|
||||
file.
|
||||
</p>
|
||||
)}
|
||||
|
||||
{showToast && (
|
||||
<Toast
|
||||
message="Key copied to clipboard!"
|
||||
onClose={() => setShowToast(false)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
34
apps/docs/src/components/ui/button.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { ButtonHTMLAttributes, forwardRef } from "react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
({ className, children, ...props }, ref) => {
|
||||
return (
|
||||
<button
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"inline-flex items-center justify-center rounded-md px-4 py-2",
|
||||
"text-base font-medium transition-all duration-200 cursor-pointer",
|
||||
"text-gray-700 dark:text-gray-200",
|
||||
"border border-gray-300 dark:border-gray-600",
|
||||
"hover:border-gray-400 dark:hover:border-gray-500",
|
||||
"hover:bg-gray-50 dark:hover:bg-gray-800/50",
|
||||
"hover:shadow-sm",
|
||||
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400",
|
||||
"dark:focus-visible:ring-gray-500 focus-visible:ring-offset-2",
|
||||
"disabled:pointer-events-none disabled:opacity-50",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
Button.displayName = "Button";
|
||||
31
apps/docs/src/components/ui/toast.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
import { CheckCircle } from "lucide-react";
|
||||
|
||||
interface ToastProps {
|
||||
message: string;
|
||||
duration?: number;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export function Toast({ message, duration = 2000, onClose }: ToastProps) {
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
onClose();
|
||||
}, duration);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}, [duration, onClose]);
|
||||
|
||||
return createPortal(
|
||||
<div className="fixed bottom-4 right-4 z-50 animate-in fade-in slide-in-from-bottom-4">
|
||||
<div className="flex items-center gap-2 bg-white dark:bg-black/80 text-black dark:text-white px-4 py-2 rounded-md shadow-lg border border-gray-200 dark:border-gray-700">
|
||||
<CheckCircle className="h-5 w-5 text-green-400" />
|
||||
<p className="text-sm font-medium">{message}</p>
|
||||
</div>
|
||||
</div>,
|
||||
document.body
|
||||
);
|
||||
}
|
||||
95
apps/docs/src/components/ui/zoomable-image.tsx
Normal file
@@ -0,0 +1,95 @@
|
||||
"use client";
|
||||
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { X, ZoomIn } from "lucide-react";
|
||||
|
||||
interface ZoomableImageProps {
|
||||
src: string;
|
||||
alt: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const ZoomableImage: React.FC<ZoomableImageProps> = ({
|
||||
src,
|
||||
alt,
|
||||
className,
|
||||
}) => {
|
||||
const [isZoomed, setIsZoomed] = useState(false);
|
||||
|
||||
const handleImageClick = () => {
|
||||
setIsZoomed(true);
|
||||
};
|
||||
|
||||
const handleCloseZoom = () => {
|
||||
setIsZoomed(false);
|
||||
};
|
||||
|
||||
const handleBackdropClick = (e: React.MouseEvent) => {
|
||||
if (e.target === e.currentTarget) {
|
||||
setIsZoomed(false);
|
||||
}
|
||||
};
|
||||
|
||||
// Handle ESC key press
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
if (event.key === "Escape" && isZoomed) {
|
||||
setIsZoomed(false);
|
||||
}
|
||||
};
|
||||
|
||||
if (isZoomed) {
|
||||
document.addEventListener("keydown", handleKeyDown);
|
||||
}
|
||||
|
||||
return () => {
|
||||
document.removeEventListener("keydown", handleKeyDown);
|
||||
};
|
||||
}, [isZoomed]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Thumbnail Image */}
|
||||
<div className="relative group cursor-pointer" onClick={handleImageClick}>
|
||||
<img
|
||||
src={src}
|
||||
alt={alt}
|
||||
className={cn(
|
||||
"w-full h-auto rounded-lg border border-gray-200 dark:border-gray-700 shadow-sm transition-all duration-300 hover:shadow-md hover:border-gray-300 dark:hover:border-gray-600",
|
||||
className
|
||||
)}
|
||||
/>
|
||||
{/* Zoom Icon Overlay */}
|
||||
<div className="absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-all duration-300 rounded-lg flex items-center justify-center">
|
||||
<ZoomIn className="w-8 h-8 text-white opacity-0 group-hover:opacity-100 transition-opacity duration-300 drop-shadow-lg" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Zoomed Modal */}
|
||||
{isZoomed && (
|
||||
<div
|
||||
className="fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"
|
||||
onClick={handleBackdropClick}
|
||||
>
|
||||
{/* Close Button */}
|
||||
<button
|
||||
onClick={handleCloseZoom}
|
||||
className="absolute top-4 right-4 z-10 p-2 bg-white/10 hover:bg-white/20 rounded-full transition-colors duration-200"
|
||||
aria-label="Close zoom"
|
||||
>
|
||||
<X className="w-6 h-6 text-white" />
|
||||
</button>
|
||||
|
||||
{/* Zoomed Image */}
|
||||
<img
|
||||
src={src}
|
||||
alt={alt}
|
||||
className="max-w-[90vw] max-h-[90vh] w-auto h-auto object-contain rounded-lg border border-gray-300 dark:border-gray-600 shadow-2xl"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -1,2 +1,2 @@
|
||||
export const LATEST_VERSION_PATH = "/docs/2.1-beta";
|
||||
export const LATEST_VERSION = "v2.1-beta";
|
||||
export const LATEST_VERSION_PATH = "/docs/3.0-beta";
|
||||
export const LATEST_VERSION = "v3.0-beta";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { clsx, type ClassValue } from "clsx"
|
||||
import { twMerge } from "tailwind-merge"
|
||||
import { type ClassValue, clsx } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
||||
import type { MDXComponents } from 'mdx/types';
|
||||
import defaultMdxComponents from "fumadocs-ui/mdx";
|
||||
import type { MDXComponents } from "mdx/types";
|
||||
import { KeyGenerator } from "@/components/KeyGenerator";
|
||||
|
||||
// use this function to get MDX components, you will need it for rendering MDX
|
||||
export function getMDXComponents(components?: MDXComponents): MDXComponents {
|
||||
return {
|
||||
...defaultMdxComponents,
|
||||
KeyGenerator,
|
||||
...components,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
# 🔐 Palmr Password Reset Guide
|
||||
|
||||
Este guia explica como resetar senhas de usuários diretamente no container Docker, sem necessidade de configuração SMTP.
|
||||
|
||||
## 📋 Visão Geral
|
||||
|
||||
O sistema Palmr possui uma funcionalidade de reset de senha que normalmente depende de configurações SMTP para enviar emails. Este script CLI permite que administradores com acesso ao terminal do Docker resetem senhas de usuários de forma **interativa e segura**, respeitando todas as regras de segurança e encriptação do sistema.
|
||||
|
||||
## 🚀 Como Usar
|
||||
|
||||
### Script Shell Interativo (Única Opção)
|
||||
|
||||
1. **Acesse o container Docker:**
|
||||
```bash
|
||||
docker exec -it <container_name> /bin/sh
|
||||
```
|
||||
|
||||
2. **Navegue para o diretório do servidor:**
|
||||
```bash
|
||||
cd /app/server
|
||||
```
|
||||
|
||||
3. **Execute o script de reset:**
|
||||
```bash
|
||||
./reset-password.sh
|
||||
```
|
||||
|
||||
## 📚 Comandos Disponíveis
|
||||
|
||||
### Reset de Senha Interativo
|
||||
```bash
|
||||
./reset-password.sh
|
||||
```
|
||||
|
||||
### Listar Usuários do Sistema
|
||||
```bash
|
||||
./reset-password.sh --list
|
||||
```
|
||||
|
||||
### Ajuda
|
||||
```bash
|
||||
./reset-password.sh --help
|
||||
```
|
||||
|
||||
## 🔒 Segurança
|
||||
|
||||
### O que o script faz:
|
||||
- ✅ **Modo interativo obrigatório** - Todas as ações requerem confirmação
|
||||
- ✅ **Encriptação bcrypt** com salt rounds 10 (idêntico ao sistema)
|
||||
- ✅ **Validação rigorosa** de formato de email e regras de senha
|
||||
- ✅ **Confirmação dupla** da nova senha antes de aplicar
|
||||
- ✅ **Limpeza automática** de tokens de reset existentes
|
||||
- ✅ **Logs detalhados** de todas as operações
|
||||
- ✅ **Verificação de usuário** com exibição completa dos dados
|
||||
|
||||
### O que o script NÃO faz:
|
||||
- ❌ Não permite operações sem confirmação
|
||||
- ❌ Não bypassa autenticação (requer acesso ao container)
|
||||
- ❌ Não registra tentativas de login inválidas
|
||||
- ❌ Não envia notificações por email
|
||||
- ❌ Não altera outras configurações do usuário
|
||||
|
||||
## 📖 Fluxo de Uso
|
||||
|
||||
1. **Iniciar o script** - Execute `./reset-password.sh`
|
||||
2. **Inserir email** - Digite o email do usuário que terá a senha resetada
|
||||
3. **Verificar usuário** - O sistema mostra informações completas do usuário
|
||||
4. **Confirmar ação** - Confirme explicitamente se deseja prosseguir
|
||||
5. **Nova senha** - Digite a nova senha (mínimo 8 caracteres)
|
||||
6. **Confirmar senha** - Digite novamente para confirmar
|
||||
7. **Sucesso** - Senha atualizada com confirmação detalhada
|
||||
|
||||
## 🔧 Exemplo de Uso
|
||||
|
||||
```bash
|
||||
$ ./reset-password.sh
|
||||
|
||||
🔐 Palmr Password Reset Tool
|
||||
===============================
|
||||
This script allows you to reset a user's password directly from the Docker terminal.
|
||||
⚠️ WARNING: This bypasses normal security checks. Use only when necessary!
|
||||
|
||||
Enter user email: user@example.com
|
||||
|
||||
✅ User found:
|
||||
Name: João Silva
|
||||
Username: joao.silva
|
||||
Email: user@example.com
|
||||
Status: Active
|
||||
Admin: No
|
||||
|
||||
Do you want to reset the password for this user? (y/n): y
|
||||
|
||||
🔑 Enter new password requirements:
|
||||
- Minimum 8 characters
|
||||
|
||||
Enter new password: ********
|
||||
Confirm new password: ********
|
||||
|
||||
🔄 Hashing password...
|
||||
💾 Updating password in database...
|
||||
🧹 Cleaning up existing password reset tokens...
|
||||
|
||||
✅ Password reset successful!
|
||||
User: João Silva (user@example.com)
|
||||
The user can now login with the new password.
|
||||
|
||||
🔐 Security Note: The password has been encrypted using bcrypt with salt rounds of 10.
|
||||
```
|
||||
|
||||
## ⚠️ Importante
|
||||
|
||||
### Segurança Aprimorada
|
||||
- **Modo interativo obrigatório** - Não há atalhos ou comandos diretos
|
||||
- **Múltiplas confirmações** - Cada etapa requer confirmação explícita
|
||||
- **Acesso restrito** - Funciona apenas com acesso ao terminal do container
|
||||
- **Validação completa** - Todos os dados são verificados antes da execução
|
||||
- **Backup recomendado** - Considere fazer backup do banco antes de usar em produção
|
||||
|
||||
### Procedimentos Recomendados
|
||||
- **Documente o uso** - Registre quando e por que a senha foi resetada
|
||||
- **Notifique o usuário** - Informe ao usuário sobre a alteração por outros meios
|
||||
- **Verifique o resultado** - Confirme que o usuário consegue fazer login
|
||||
- **Monitore logs** - Verifique logs do sistema após o reset
|
||||
|
||||
## 🛠️ Solução de Problemas
|
||||
|
||||
### Erro: "tsx is not available"
|
||||
```bash
|
||||
# O script instalará automaticamente as dependências
|
||||
# Se falhar, instale manualmente:
|
||||
pnpm install
|
||||
# ou
|
||||
npm install
|
||||
```
|
||||
|
||||
### Erro: "Prisma client not found"
|
||||
```bash
|
||||
# O script gerará automaticamente o cliente Prisma
|
||||
# Se falhar, execute manualmente:
|
||||
npx prisma generate
|
||||
```
|
||||
|
||||
### Erro: "Database connection failed"
|
||||
- Verifique se o banco de dados está rodando
|
||||
- Confirme se o arquivo `prisma/palmr.db` existe e tem permissões corretas
|
||||
- Verifique se o container tem acesso ao volume do banco
|
||||
|
||||
### Erro: "Script must be run from server directory"
|
||||
```bash
|
||||
# Certifique-se de estar no diretório correto:
|
||||
cd /app/server
|
||||
```
|
||||
|
||||
### Erro: "User not found"
|
||||
- Verifique se o email está correto
|
||||
- Use `./reset-password.sh --list` para ver todos os usuários
|
||||
- Confirme se o usuário existe no sistema
|
||||
|
||||
## 🔍 Logs e Auditoria
|
||||
|
||||
O script gera logs detalhados de todas as ações:
|
||||
- **Identificação do usuário** encontrado
|
||||
- **Confirmações** de cada etapa
|
||||
- **Operações no banco** realizadas
|
||||
- **Resultado final** da operação
|
||||
|
||||
Para auditoria completa, considere:
|
||||
- Documentar data/hora da execução
|
||||
- Registrar quem executou o script
|
||||
- Manter histórico das alterações
|
||||
- Verificar logs do sistema após o reset
|
||||
|
||||
## 🎯 Quando Usar
|
||||
|
||||
### Situações Apropriadas:
|
||||
- ✅ **Usuário admin bloqueado** sem acesso ao email
|
||||
- ✅ **SMTP não configurado** ou com problemas
|
||||
- ✅ **Recuperação de emergência** do sistema
|
||||
- ✅ **Configuração inicial** do ambiente
|
||||
- ✅ **Testes controlados** em desenvolvimento
|
||||
|
||||
### Precauções:
|
||||
- ⚠️ **Use apenas quando necessário** - Bypassa controles normais
|
||||
- ⚠️ **Ambiente controlado** - Certifique-se do contexto de uso
|
||||
- ⚠️ **Comunicação clara** - Informe equipe e usuário afetado
|
||||
- ⚠️ **Documentação** - Registre o motivo e procedimento
|
||||
|
||||
---
|
||||
|
||||
**🔐 Filosofia de Segurança:** Este script prioriza segurança através de interatividade obrigatória, múltiplas confirmações e validações rigorosas. Não há atalhos ou modos "rápidos" - cada reset requer atenção e confirmação deliberada do administrador.
|
||||
@@ -1,22 +0,0 @@
|
||||
services:
|
||||
postgres:
|
||||
image: bitnami/postgresql:17.2.0
|
||||
container_name: palmr-postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
- POSTGRESQL_USERNAME=palmr
|
||||
- POSTGRESQL_PASSWORD=palmr123
|
||||
- POSTGRESQL_DATABASE=palmr
|
||||
volumes:
|
||||
- postgres_data:/bitnami/postgresql
|
||||
restart: "unless-stopped"
|
||||
healthcheck:
|
||||
test: ["CMD", "pg_isready", "-U", "palmr"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
minio_data:
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "palmr-api",
|
||||
"version": "2.1-beta",
|
||||
"version": "3.0-beta",
|
||||
"description": "API for Palmr",
|
||||
"private": true,
|
||||
"author": "Daniel Luiz Alves <daniel@kyantech.com.br>",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "palmr-frontend",
|
||||
"version": "2.1-beta",
|
||||
"version": "3.0-beta",
|
||||
"description": "Frontend for Palmr",
|
||||
"private": true,
|
||||
"author": "Daniel Luiz Alves <daniel@kyantech.com.br>",
|
||||
@@ -11,7 +11,7 @@
|
||||
"react",
|
||||
"typescript"
|
||||
],
|
||||
"license": "BSD-2-Clause",
|
||||
"license": "BSD-2-Clause Copyright 2023 Kyantech",
|
||||
"packageManager": "pnpm@10.6.0",
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 3.6 MiB |
|
Before Width: | Height: | Size: 210 KiB After Width: | Height: | Size: 1.1 MiB |
@@ -50,7 +50,7 @@ export function HomeContent({ isLoading }: HomeContentProps) {
|
||||
<div className="container mx-auto max-w-7xl px-6 flex-grow">
|
||||
<BackgroundLights />
|
||||
<section className="relative flex flex-col items-center justify-center gap-6 m-auto h-full">
|
||||
<HomeHeader title="🌴 Palmr." />
|
||||
<HomeHeader title="Palmr." />
|
||||
<motion.div
|
||||
{...fadeInAnimation}
|
||||
className="w-full text-lg lg:text-xl text-default-600 mt-4 text-center whitespace-normal"
|
||||
|
||||
@@ -2,6 +2,7 @@ import { motion } from "framer-motion";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
import { HomeHeaderProps } from "../types";
|
||||
import { Palmtree } from "lucide-react";
|
||||
|
||||
const fadeInUpAnimation = {
|
||||
animate: { opacity: 1, y: 0 },
|
||||
@@ -27,8 +28,8 @@ export function HomeHeader({ title }: HomeHeaderProps) {
|
||||
return (
|
||||
<motion.div {...fadeInUpAnimation} className="inline-block max-w-xl text-center justify-center">
|
||||
<div className="flex flex-col gap-8">
|
||||
<motion.span {...titleAnimation} className="text-4xl lg:text-6xl font-extrabold tracking-tight">
|
||||
{title}
|
||||
<motion.span {...titleAnimation} className="text-4xl lg:text-6xl font-extrabold tracking-tight flex mx-auto items-end gap-3">
|
||||
<Palmtree className="h-18 w-18" /> {title}
|
||||
</motion.span>
|
||||
<div className="flex flex-col gap-2">
|
||||
<motion.span
|
||||
|
||||
@@ -166,7 +166,7 @@ export function DefaultLayout({
|
||||
<p>• {t("reverseShares.upload.layout.maxFileSize", { size: reverseShare.maxFileSize })}</p>
|
||||
)}
|
||||
{reverseShare?.allowedFileTypes && (
|
||||
<p>• {t("allowedTypes", { types: reverseShare.allowedFileTypes })}</p>
|
||||
<p>• {t("reverseShares.upload.layout.allowedTypes", { types: reverseShare.allowedFileTypes })}</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,7 @@ export default function ForgotPasswordPage() {
|
||||
<div className="relative z-10 w-full max-w-md space-y-4 px-4 py-12">
|
||||
<motion.div
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
className="rounded-2xl border border-default-200 bg-black/20 p-8"
|
||||
className="rounded-2xl border border-default-200 bg-background/30 p-8"
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
>
|
||||
<ForgotPasswordHeader />
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
}
|
||||
|
||||
:root {
|
||||
--radius: 0.75rem;
|
||||
--background: oklch(0.985 0 0);
|
||||
--radius: 0.5rem;
|
||||
--background: oklch(0.9911 0 0);
|
||||
--foreground: oklch(0.141 0.005 285.823);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.141 0.005 285.823);
|
||||
@@ -79,9 +79,9 @@
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0 0 0);
|
||||
--background: oklch(0.15 0 0);
|
||||
--foreground: oklch(0.985 0 0);
|
||||
--card: oklch(0.21 0.006 285.885);
|
||||
--card: oklch(0.2046 0 0);
|
||||
--card-foreground: oklch(0.985 0 0);
|
||||
--popover: oklch(0.21 0.006 285.885);
|
||||
--popover-foreground: oklch(0.985 0 0);
|
||||
@@ -93,7 +93,7 @@
|
||||
--muted-foreground: oklch(0.705 0.015 286.067);
|
||||
--accent: oklch(0.274 0.006 286.033);
|
||||
--accent-foreground: oklch(0.985 0 0);
|
||||
--destructive: oklch(0.704 0.191 22.216);
|
||||
--destructive: oklch(0.5523 0.1927 32.7272);
|
||||
--border: oklch(1 0 0 / 15%);
|
||||
--input: oklch(1 0 0 / 15%);
|
||||
--ring: oklch(0.527 0.154 150.069);
|
||||
|
||||
@@ -31,7 +31,7 @@ export default function LoginPage() {
|
||||
<div className="relative flex h-full w-full items-center justify-center">
|
||||
<motion.div
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
className="flex w-full max-w-sm flex-col gap-4 rounded-lg bg-background/80 backdrop-blur-md px-8 pb-10 pt-6 shadow-lg"
|
||||
className="flex w-full max-w-sm flex-col gap-4 rounded-lg bg-background/60 backdrop-blur-md px-8 pb-10 pt-6 shadow-lg border"
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
transition={{ duration: 0.5 }}
|
||||
>
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
services:
|
||||
palmr:
|
||||
image: kyantech/palmr:latest # Make sure to use the correct version (latest) of the image
|
||||
container_name: palmr-application
|
||||
environment:
|
||||
# Storage Configuration
|
||||
- ENABLE_S3=false # Set to 'false' to use local filesystem storage instead of S3/MinIO or true to use S3/MinIO in this case we are using filesystem storage
|
||||
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-change-this-key-in-production-min-32-chars} # Required for filesystem encryption (min 32 chars)
|
||||
|
||||
# Server environment variables
|
||||
- FRONTEND_URL=http://palmr:${APP_EXTERNAL_PORT:-5487} # Frontend URL - Make sure to use the correct frontend URL, depends on where the frontend is running, its prepared for localhost, but you can change it to your frontend URL if needed
|
||||
- API_BASE_URL=http://palmr:${API_EXTERNAL_PORT:-3333} # Using Docker service name for internal communication
|
||||
- MAX_FILESIZE=${MAX_FILESIZE:-1073741824} # Max Filesize for upload - Declared in Bytes. Default is 1GB. can be changed by admin in the frontend.
|
||||
ports:
|
||||
- "${API_EXTERNAL_PORT:-3333}:3333" # Server port (default: 3333) can be overridden by env var
|
||||
- "${APP_EXTERNAL_PORT:-5487}:5487" # Web port (default: 5487) can be overridden by env var
|
||||
volumes:
|
||||
- palmr_uploads:/app/server/uploads # Uploads folder for the application
|
||||
- palmr_temp_chunks:/app/server/temp-chunks # Temp chunks folder for the application
|
||||
- palmr_database:/app/server/prisma # SQLite database folder
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [
|
||||
"CMD",
|
||||
"sh",
|
||||
"-c",
|
||||
"wget --no-verbose --tries=1 --spider http://palmr:${API_EXTERNAL_PORT:-3333}/health && wget --no-verbose --tries=1 --spider http://palmr:${APP_EXTERNAL_PORT:-5487}",
|
||||
] # Healthcheck for the application
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s # Reduced start period since we don't need to wait for PostgreSQL
|
||||
|
||||
volumes:
|
||||
palmr_uploads:
|
||||
palmr_temp_chunks:
|
||||
palmr_database: # Volume for SQLite database persistence
|
||||
23
docker-compose-minio.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
services:
|
||||
palmr:
|
||||
image: kyantech/palmr:latest
|
||||
container_name: palmr
|
||||
environment:
|
||||
# MinIO Configuration (only used when ENABLE_S3=true)
|
||||
- ENABLE_S3=true # Set to true to use S3 storage
|
||||
- S3_ENDPOINT=${S3_ENDPOINT} # S3 endpoint (you have to set this to the s3 endpoint of the s3 server) CHANGE THIS TO YOUR S3 ENDPOINT
|
||||
- S3_USE_SSL=${S3_USE_SSL:-true} # Use ssl for the s3 server always true for s3
|
||||
- S3_ACCESS_KEY=${S3_ACCESS_KEY} # S3 access key (you have to generate this key in s3 server)
|
||||
- S3_SECRET_KEY=${S3_SECRET_KEY} # S3 secret key (you have to generate this key in s3 server)
|
||||
- S3_REGION=${S3_REGION:-us-east-1} # S3 region (us-east-1 is the default region) but it depends on your s3 server region
|
||||
- S3_BUCKET_NAME=${S3_BUCKET_NAME:-palmr-files} # Bucket name for the S3 storage (here we are using palmr-files as the bucket name to understand that this is the bucket for palmr)
|
||||
- S3_FORCE_PATH_STYLE=true # For MinIO compatibility we have to set this to true
|
||||
ports:
|
||||
- "5487:5487" # Web port
|
||||
- "3333:3333" # API port (OPTIONAL EXPOSED - ONLY IF YOU WANT TO ACCESS THE API DIRECTLY)
|
||||
volumes:
|
||||
- palmr_data:/app/server # Volume for the application data
|
||||
restart: unless-stopped # Restart the container unless it is stopped
|
||||
|
||||
volumes:
|
||||
palmr_data:
|
||||
@@ -1,77 +0,0 @@
|
||||
services:
|
||||
palmr:
|
||||
image: kyantech/palmr:latest # Make sure to use the correct version (latest) of the image
|
||||
container_name: palmr-application
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: "service_healthy"
|
||||
environment:
|
||||
# S3/MinIO Configuration (only used when ENABLE_S3=true)
|
||||
- ENABLE_S3=true # Set to 'false' to use local filesystem storage instead of S3/MinIO or true to use S3/MinIO in this case we are using filesystem storage
|
||||
- S3_ENDPOINT=${S3_ENDPOINT:-localhost} # S3/MinIO minio server ip or 'localhost' if you are running minio in local machine (don't use the dns name of the minio server use the ip address)
|
||||
- S3_PORT=${S3_PORT:-9000} # S3/MinIO minio server port
|
||||
- S3_USE_SSL=${S3_USE_SSL:-false} # S3/MinIO minio server use ssl false if you are running minio in local machine
|
||||
- S3_ACCESS_KEY=${S3_ACCESS_KEY} # S3/MinIO minio server access key (you have to generate this key in minio server)
|
||||
- S3_SECRET_KEY=${S3_SECRET_KEY} # S3/MinIO minio server secret key (you have to generate this key in minio server)
|
||||
- S3_REGION=${S3_REGION:-us-east-1} # S3/MinIO minio server region (us-east-1 is the default region) but it depends on your minio server region
|
||||
- S3_BUCKET_NAME=${S3_BUCKET_NAME:-palmr-files} # Bucket name for the S3/MinIO storage (here we are using palmr-files as the bucket name to understand that this is the bucket for palmr)
|
||||
- S3_FORCE_PATH_STYLE=${S3_FORCE_PATH_STYLE:-true} # For minio compatibility we have to set this to true
|
||||
|
||||
# Server environment variables
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgresRootPassword}@postgres:${DB_EXTERNAL_PORT:-5432}/${POSTGRES_DB:-palmr_db}?schema=public # Database URL with configurable credentials through env vars
|
||||
- FRONTEND_URL=http://palmr:${APP_EXTERNAL_PORT:-5487} # Frontend URL - Make sure to use the correct frontend URL, depends on where the frontend is running, its prepared for localhost, but you can change it to your frontend URL if needed
|
||||
- API_BASE_URL=http://palmr:${API_EXTERNAL_PORT:-3333} # Using Docker service name for internal communication
|
||||
- MAX_FILESIZE=${MAX_FILESIZE:-1073741824} # Max Filesize for upload - Declared in Bytes. Default is 1GiB. can be changed by admin in the frontend.
|
||||
|
||||
ports:
|
||||
- "${API_EXTERNAL_PORT:-3333}:3333" # Server port (default: 3333) can be overridden by env var
|
||||
- "${APP_EXTERNAL_PORT:-5487}:5487" # Web port (default: 5487) can be overridden by env var
|
||||
networks:
|
||||
- palmr-network # Network for the application to communicate with the database
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [
|
||||
"CMD",
|
||||
"sh",
|
||||
"-c",
|
||||
"wget --no-verbose --tries=1 --spider http://palmr:${API_EXTERNAL_PORT:-3333}/health && wget --no-verbose --tries=1 --spider http://palmr:5487",
|
||||
] # Healthcheck for the application
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 120s
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine # You can use any postgres version you prefer, but remember that some versions might not be compatible
|
||||
container_name: palmr-database
|
||||
environment:
|
||||
- POSTGRES_USER=${POSTGRES_USER:-postgres} # PostgreSQL username (default: postgres) can be overridden by env var
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgresRootPassword} # PostgreSQL password (default: postgresRootPassword) can be overridden by env var
|
||||
- POSTGRES_DB=${POSTGRES_DB:-palmr_db} # PostgreSQL database name (default: palmr_db) can be overridden by env var
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data # PostgreSQL data volume for the application
|
||||
ports:
|
||||
- "${DB_EXTERNAL_PORT:-5432}:5432" # PostgreSQL port (default: 5432) can be overridden by env var
|
||||
networks:
|
||||
- palmr-network # Network for the application to communicate with the database
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [
|
||||
"CMD",
|
||||
"pg_isready",
|
||||
"-U",
|
||||
"${POSTGRES_USER:-postgres}",
|
||||
"-d",
|
||||
"${POSTGRES_DB:-palmr_db}",
|
||||
] # Healthcheck for the database
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 6
|
||||
start_period: 30s
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
networks:
|
||||
palmr-network:
|
||||
driver: bridge
|
||||
@@ -1,10 +1,7 @@
|
||||
services:
|
||||
palmr:
|
||||
image: kyantech/palmr:latest # Make sure to use the correct version (latest) of the image
|
||||
container_name: palmr-application
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: "service_healthy"
|
||||
image: kyantech/palmr:latest
|
||||
container_name: palmr
|
||||
environment:
|
||||
# S3 Configuration (only used when ENABLE_S3=true)
|
||||
- ENABLE_S3=true # Set to true to use S3 storage
|
||||
@@ -14,62 +11,13 @@ services:
|
||||
- S3_SECRET_KEY=${S3_SECRET_KEY} # S3 secret key (you have to generate this key in s3 server)
|
||||
- S3_REGION=${S3_REGION:-us-east-1} # S3 region (us-east-1 is the default region) but it depends on your s3 server region
|
||||
- S3_BUCKET_NAME=${S3_BUCKET_NAME:-palmr-files} # Bucket name for the S3 storage (here we are using palmr-files as the bucket name to understand that this is the bucket for palmr)
|
||||
- S3_FORCE_PATH_STYLE=${S3_FORCE_PATH_STYLE:-false} # For S3 compatibility we have to set this to false
|
||||
|
||||
# Server environment variables
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgresRootPassword}@postgres:${DB_EXTERNAL_PORT:-5432}/${POSTGRES_DB:-palmr_db}?schema=public # Database URL with configurable credentials through env vars
|
||||
- FRONTEND_URL=http://palmr:${APP_EXTERNAL_PORT:-5487} # Frontend URL - Make sure to use the correct frontend URL, depends on where the frontend is running, its prepared for localhost, but you can change it to your frontend URL if needed
|
||||
- API_BASE_URL=http://palmr:${API_EXTERNAL_PORT:-3333} # Using Docker service name for internal communication
|
||||
- MAX_FILESIZE=${MAX_FILESIZE:-1073741824} # Max Filesize for upload - Declared in Bytes. Default is 1GB. can be changed by admin in the frontend.
|
||||
- S3_FORCE_PATH_STYLE=false # For S3 compatibility we have to set this to false
|
||||
ports:
|
||||
- "${API_EXTERNAL_PORT:-3333}:3333" # Server port (default: 3333) can be overridden by env var
|
||||
- "${APP_EXTERNAL_PORT:-5487}:5487" # Web port (default: 5487) can be overridden by env var
|
||||
networks:
|
||||
- palmr-network # Network for the application to communicate with the database
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [
|
||||
"CMD",
|
||||
"sh",
|
||||
"-c",
|
||||
"wget --no-verbose --tries=1 --spider http://palmr:3333/health && wget --no-verbose --tries=1 --spider http://palmr:5487",
|
||||
] # Healthcheck for the application
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 120s
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine # You can use any postgres version you prefer, but remember that some versions might not be compatible
|
||||
container_name: palmr-database
|
||||
environment:
|
||||
- POSTGRES_USER=${POSTGRES_USER:-postgres} # PostgreSQL username (default: postgres) can be overridden by env var
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgresRootPassword} # PostgreSQL password (default: postgresRootPassword) can be overridden by env var
|
||||
- POSTGRES_DB=${POSTGRES_DB:-palmr_db} # PostgreSQL database name (default: palmr_db) can be overridden by env var
|
||||
- "5487:5487" # Web port
|
||||
- "3333:3333" # API port (OPTIONAL EXPOSED - ONLY IF YOU WANT TO ACCESS THE API DIRECTLY)
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data # PostgreSQL data volume for the application
|
||||
ports:
|
||||
- "${DB_EXTERNAL_PORT:-5432}:5432" # PostgreSQL port (default: 5432) can be overridden by env var
|
||||
networks:
|
||||
- palmr-network # Network for the application to communicate with the database
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [
|
||||
"CMD",
|
||||
"pg_isready",
|
||||
"-U",
|
||||
"${POSTGRES_USER:-postgres}",
|
||||
"-d",
|
||||
"${POSTGRES_DB:-palmr_db}",
|
||||
] # Healthcheck for the database
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 6
|
||||
start_period: 30s
|
||||
- palmr_data:/app/server # Volume for the application data
|
||||
restart: unless-stopped # Restart the container unless it is stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
networks:
|
||||
palmr-network:
|
||||
driver: bridge
|
||||
palmr_data:
|
||||
|
||||
16
docker-compose.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
services:
|
||||
palmr:
|
||||
image: kyantech/palmr:latest
|
||||
container_name: palmr
|
||||
environment:
|
||||
- ENABLE_S3=false
|
||||
- ENCRYPTION_KEY=change-this-key-in-production-min-32-chars # CHANGE THIS KEY FOR SECURITY
|
||||
ports:
|
||||
- "5487:5487" # Web port
|
||||
- "3333:3333" # API port (OPTIONAL EXPOSED - ONLY IF YOU WANT TO ACCESS THE API DIRECTLY)
|
||||
volumes:
|
||||
- palmr_data:/app/server # Volume for the application data
|
||||
restart: unless-stopped # Restart the container unless it is stopped
|
||||
|
||||
volumes:
|
||||
palmr_data:
|
||||