diff --git a/CHANGELOG.md b/CHANGELOG.md index 175a01d..83ccacd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# Changelog + +## [1.0.7] - 2025-04-22 +### Added +- Customizable application title and description through environment variables +- New build arguments in Dockerfile: VITE_APP_TITLE and VITE_APP_DESCRIPTION +- Support for title and description customization in docker-compose configuration + ### [1.0.6] * `cmd/server/main.go`: Added rate limiting to POST requests. * `ui/src/pages/Create.vue`: Added error handling for 429 responses. @@ -6,7 +14,7 @@ UI Enhancements: * `ui/index.html`: Added a link to the Animate.css library for animation effects. -* [`ui/src/App.vue`: Integrated animation classes into various elements, including the header logo, buttons, and alerts. +* [`ui/src/App.vue`: Integrated animation classes into various elements, including the header logo, buttons, and alerts. Password Management Enhancements: * `ui/src/pages/Create.vue`: Added functionality to toggle password visibility and generate random passwords, along with corresponding tooltips and animations. @@ -14,7 +22,7 @@ Password Management Enhancements: * `ui/src/pages/Error404.vue`: Redesigned the 404 error page with a more user-friendly card layout, including an icon, message, and a button to navigate back home. Other Enhancements: -* `ui/src/pages/Create.vue`, `ui/src/pages/View.vue`: Applied animation classes to various elements to provide a more dynamic user experience. +* `ui/src/pages/Create.vue`, `ui/src/pages/View.vue`: Applied animation classes to various elements to provide a more dynamic user experience. ### [1.0.4] - Reworked CD pipelines to follow semver tagging @@ -54,4 +62,3 @@ Other Enhancements: - Improved project documentation and added sections for installation, configuration, and deployment. --- - diff --git a/Dockerfile b/Dockerfile index add5d41..eeb9919 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,17 +19,22 @@ RUN if [ "$DEBUG" = "true" ]; then \ fi # Stage 2: Build the Vue.js Frontend -FROM node:18-alpine AS frontend-builder +FROM node:23-alpine AS frontend-builder WORKDIR /app -COPY ui/package.json ui/package-lock.json ./ +COPY ui/package.json ui/package-lock.json ./ RUN npm install --legacy-peer-deps -# Add build argument for the API URL and versioning +# Add build arguments for customization ARG VITE_API_URL="/api" +ARG VITE_APP_TITLE="GopherDrop" +ARG VITE_APP_DESCRIPTION="Secure one-time secret and file sharing" + ENV VITE_API_URL=${VITE_API_URL} +ENV VITE_APP_TITLE=${VITE_APP_TITLE} +ENV VITE_APP_DESCRIPTION=${VITE_APP_DESCRIPTION} -COPY ui ./ +COPY ui ./ RUN npm run build # Stage 3: Combine Backend and Frontend into a Single Image diff --git a/Makefile b/Makefile index 3227cd9..fd0dd2b 100644 --- a/Makefile +++ b/Makefile @@ -2,29 +2,29 @@ # Default build (production) build: - docker-compose build + docker compose build # Build in debug mode build-debug: - docker-compose build --build-arg DEBUG=true --build-arg GIN_MODE=debug + docker compose build --build-arg DEBUG=true --build-arg GIN_MODE=debug up: - docker-compose up -d + docker compose up -d down: - docker-compose down + docker compose down logs: - docker-compose logs -f app + docker compose logs -f app dbshell: - docker-compose exec db psql -U $(DB_USER) -d $(DB_NAME) + docker compose exec db psql -U $(DB_USER) -d $(DB_NAME) start-db: - docker-compose up -d db + docker compose up -d db stop-db: - docker-compose stop db + docker compose stop db test: go test ./... -v diff --git a/Readme.md b/Readme.md index 901a9e2..5303707 100644 --- a/Readme.md +++ b/Readme.md @@ -18,27 +18,27 @@ GopherDrop is a secure, self-hostable REST API and UI for sharing encrypted one- ## 📋 **Table of Contents** -1. [Features](#-features) -2. [Installation](#-installation) -3. [Build and Run](#-build-and-run) -4. [Configuration](#-configuration) -5. [Endpoints](#-endpoints) -6. [Docker Deployment](#-docker-deployment) -7. [Contributing](#-contributing) -8. [License](#-license) -9. [Community and Support](#-community-and-support) +1. [Features](#-features) +2. [Installation](#-installation) +3. [Build and Run](#-build-and-run) +4. [Configuration](#-configuration) +5. [Endpoints](#-endpoints) +6. [Docker Deployment](#-docker-deployment) +7. [Contributing](#-contributing) +8. [License](#-license) +9. [Community and Support](#-community-and-support) --- ## 🌟 **Features** -- **Send Text or Files**: Share sensitive information securely. -- **Password Protection**: Encrypt your secrets with a password. -- **One-Time Retrieval**: Automatically delete secrets after a single access. -- **Expiration Settings**: Define how long a secret remains available. -- **Responsive UI**: Built with Vue.js and Vuetify for a modern user experience. -- **Dockerized Deployment**: Simple setup with Docker and Docker Compose. -- **Production and Debug Modes**: Easily switch between production and debug builds. +- **Send Text or Files**: Share sensitive information securely. +- **Password Protection**: Encrypt your secrets with a password. +- **One-Time Retrieval**: Automatically delete secrets after a single access. +- **Expiration Settings**: Define how long a secret remains available. +- **Responsive UI**: Built with Vue.js and Vuetify for a modern user experience. +- **Dockerized Deployment**: Simple setup with Docker and Docker Compose. +- **Production and Debug Modes**: Easily switch between production and debug builds. --- @@ -55,8 +55,8 @@ GopherDrop is a secure, self-hostable REST API and UI for sharing encrypted one- ### **Prerequisites** -- **Docker**: [Install Docker](https://docs.docker.com/get-docker/) -- **Docker Compose**: [Install Docker Compose](https://docs.docker.com/compose/install/) +- **Docker**: [Install Docker](https://docs.docker.com/get-docker/) +- **Docker Compose**: [Install Docker Compose](https://docs.docker.com/compose/install/) ### **Clone the Repository** @@ -129,6 +129,17 @@ MAX_FILE_SIZE=10485760 | `STORAGE_PATH` | Path for storing uploaded files | `/app/storage` | | `MAX_FILE_SIZE` | Maximum file size in bytes | `10485760` (10 MB) | +### **Build Arguments** + +| Argument | Description | Default Value | +|----------------------|--------------------------------------|----------------------------------------------| +| `VITE_API_URL` | API endpoint URL | `/api` | +| `VITE_APP_TITLE` | Custom application title | `GopherDrop` | +| `VITE_APP_DESCRIPTION` | Custom application description | `Secure one-time secret and file sharing` | +| `DEBUG` | Enable debug mode | `false` | +| `GIN_MODE` | Gin framework mode | `release` | +| `VERSION` | Application version | `-` | + --- ## 🖥️ **Endpoints** @@ -146,10 +157,10 @@ MAX_FILE_SIZE=10485760 ## 🤝 **Contributing** -1. Fork the repository. -2. Create a new branch: `git checkout -b my-feature-branch` -3. Make your changes and add tests. -4. Submit a pull request. +1. Fork the repository. +2. Create a new branch: `git checkout -b my-feature-branch` +3. Make your changes and add tests. +4. Submit a pull request. --- @@ -161,5 +172,5 @@ GopherDrop is licensed under the [MIT License](LICENSE). ## 💬 **Community and Support** -- **Issues**: [GitHub Issues](https://github.com/kek-Sec/gopherdrop/issues) -- **Discussions**: [GitHub Discussions](https://github.com/kek-Sec/gopherdrop/discussions) +- **Issues**: [GitHub Issues](https://github.com/kek-Sec/gopherdrop/issues) +- **Discussions**: [GitHub Discussions](https://github.com/kek-Sec/gopherdrop/discussions) diff --git a/docker-compose.yaml b/docker-compose.yaml index 627d75d..23aaf2d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -17,11 +17,13 @@ services: - gopherdrop app: - build: + build: context: . dockerfile: Dockerfile args: - VITE_API_URL=/api + - VITE_APP_TITLE=TEST + - VITE_APP_DESCRIPTION=TEST_DESCR container_name: gopherdrop_app environment: DB_HOST: db diff --git a/ui/index.html b/ui/index.html index c130ba8..525e128 100644 --- a/ui/index.html +++ b/ui/index.html @@ -4,11 +4,11 @@ + /> - + @@ -16,12 +16,12 @@ - - + + - GopherDrop + __TITLE__ diff --git a/ui/vite.config.js b/ui/vite.config.js index 9df229e..07826d2 100644 --- a/ui/vite.config.js +++ b/ui/vite.config.js @@ -2,6 +2,26 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import vuetify from 'vite-plugin-vuetify' +// Create HTML plugin instance with template parameters +const htmlPlugin = () => { + return { + name: 'html-transform', + transformIndexHtml(html) { + return html.replace( + /__TITLE__/g, + process.env.VITE_APP_TITLE || 'GopherDrop' + ).replace( + /__DESCRIPTION__/g, + process.env.VITE_APP_DESCRIPTION || 'Secure one-time secret and file sharing' + ) + } + } +} + export default defineConfig({ - plugins: [vue(), vuetify()], + plugins: [vue(), vuetify(), htmlPlugin()], + define: { + 'process.env.VITE_APP_TITLE': JSON.stringify(process.env.VITE_APP_TITLE || 'GopherDrop'), + 'process.env.VITE_APP_DESCRIPTION': JSON.stringify(process.env.VITE_APP_DESCRIPTION || 'Secure one-time secret and file sharing') + } }) diff --git a/version.yaml b/version.yaml index b26062f..fa7d36d 100644 --- a/version.yaml +++ b/version.yaml @@ -1,2 +1,2 @@ #Application version following https://semver.org/ -version: 1.0.6 \ No newline at end of file +version: 1.0.7 \ No newline at end of file