diff --git a/.env b/.env index b2575ab..125a8cd 100644 --- a/.env +++ b/.env @@ -1,12 +1,12 @@ -NEXTAUTH_URL=http://localhost:3000/api/v1/auth -NEXTAUTH_SECRET= +NEXTAUTH_URL=http://localhost:5000/api/v1/auth +NEXTAUTH_SECRET=tu_secreto_unico_generado -# Manual installation database settings -# Example: DATABASE_URL=postgresql://user:password@localhost:5432/linkwarden -DATABASE_URL=postgresql://user:password@postgres:5432/linkwarden - -# Docker installation database settings +POSTGRES_USER=postgres POSTGRES_PASSWORD=password +POSTGRES_DB=linkwarden + +# URL para conectar Linkwarden a PostgreSQL +DATABASE_URL=postgresql://postgres:password@postgres:5432/postgres # Additional Optional Settings PAGINATION_TAKE_COUNT= diff --git a/README.md b/README.md index e69de29..9b4f1be 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,67 @@ +# Linkwarden Personal Fork + +This is a personal fork of Linkwarden, a self-hosted bookmark manager to organize and archive links. This fork is customized for personal use with Docker. + +## Prerequisites + +- Docker +- Docker Compose + +## Setup + +1. Clone the repository: + ```sh + git clone https://github.com/yourusername/linkwarden.git + cd linkwarden + ``` + +2. Create a `.env` file in the root directory and configure the necessary environment variables. You can use the provided `.env` file as a reference. + +3. Start the services using Docker Compose: + ```sh + docker-compose -f linkwarden.yml up -d + ``` + +## Configuration + +### Environment Variables + +The `.env` file contains various configuration options. Below are some key variables: + +- `NEXTAUTH_URL`: The URL for NextAuth authentication. +- `NEXTAUTH_SECRET`: Secret for NextAuth. +- `DATABASE_URL`: Database connection URL. +- `POSTGRES_PASSWORD`: Password for the PostgreSQL database. +- `NEXT_PUBLIC_*`: Various public settings for different integrations. + +### Volumes + +- `./pgdata`: Stores PostgreSQL data. +- `./data`: Stores Linkwarden data. + +## Usage + +Access the Linkwarden application at `http://localhost:5000`. + +## Customization + +To customize the application, you can modify the source code and rebuild the Docker image: + +1. Uncomment the `build` line and comment the `image` line in `linkwarden.yml`: + ```yaml + # build: . # uncomment this line to build from source + image: ghcr.io/linkwarden/linkwarden:latest # comment this line to build from source + ``` + +2. Rebuild and restart the services: + ```sh + docker-compose -f linkwarden.yml up --build -d + ``` + +## Contributing + +This fork is intended for personal use. If you have any suggestions or improvements, feel free to fork and modify it. + +## License + +This project is licensed under the MIT License. \ No newline at end of file diff --git a/linkwarden.yml b/linkwarden.yml index 420f501..8a4dd86 100644 --- a/linkwarden.yml +++ b/linkwarden.yml @@ -1,15 +1,22 @@ version: "3.5" services: + postgres: image: postgres:16-alpine env_file: .env restart: always volumes: - ./pgdata:/var/lib/postgresql/data + environment: + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_DB=${POSTGRES_DB} + + linkwarden: env_file: .env environment: - - DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres + - DATABASE_URL=${DATABASE_URL} restart: always # build: . # uncomment this line to build from source image: ghcr.io/linkwarden/linkwarden:latest # comment this line to build from source