{"id":20050236,"url":"https://github.com/watzon/0x45","last_synced_at":"2025-09-02T04:40:09.814Z","repository":{"id":262536660,"uuid":"886976207","full_name":"watzon/0x45","owner":"watzon","description":"🚀 Modern, high-performance file sharing and URL shortening service with S3 support, rate limiting, and API keys. Built with Go and inspired by 0x0.st 📤","archived":false,"fork":false,"pushed_at":"2025-03-04T18:46:02.000Z","size":1348,"stargazers_count":72,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-20T09:06:11.563Z","etag":null,"topics":["0x0","api","docker","file-sharing","file-upload","go","gofiber","golang","high-performance","microservice","paste","pastebin","pastebin-service","rate-limiting","rest-api","s3-compatible","s3-storage","self-hosted","url-shortener","web-service"],"latest_commit_sha":null,"homepage":"https://0x45.st","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/watzon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"watzon","patreon":"watzon","open_collective":null,"ko_fi":"watzon","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-11-12T00:26:08.000Z","updated_at":"2025-05-01T06:45:56.000Z","dependencies_parsed_at":"2025-04-09T16:13:56.628Z","dependency_job_id":"15d9bff4-0845-4590-a79f-e5c05fb09712","html_url":"https://github.com/watzon/0x45","commit_stats":null,"previous_names":["watzon/0x45"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/watzon/0x45","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watzon%2F0x45","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watzon%2F0x45/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watzon%2F0x45/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watzon%2F0x45/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watzon","download_url":"https://codeload.github.com/watzon/0x45/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watzon%2F0x45/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273233243,"owners_count":25068725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["0x0","api","docker","file-sharing","file-upload","go","gofiber","golang","high-performance","microservice","paste","pastebin","pastebin-service","rate-limiting","rest-api","s3-compatible","s3-storage","self-hosted","url-shortener","web-service"],"created_at":"2024-11-13T11:55:50.698Z","updated_at":"2025-09-02T04:40:09.699Z","avatar_url":"https://github.com/watzon.png","language":"Go","readme":"# Paste69\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/watzon/0x45/blob/main/public/images/0x45-og.png?raw=true\" alt=\"0x45\"\u003e\n\u003c/div\u003e\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/watzon/0x45)](https://goreportcard.com/report/github.com/watzon/0x45)\n[![Docker Image Version](https://ghcr-badge.egpl.dev/watzon/0x45/latest_tag?trim=major\u0026label=latest+image\u0026ignore=sha256*)](https://github.com/watzon/0x45/pkgs/container/0x45)\n[![GoDoc](https://godoc.org/github.com/watzon/0x45?status.svg)](https://godoc.org/github.com/watzon/0x45)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA modern, Go-based pastebin service inspired by 0x0.st.\n\n## Features\n\n- File uploads and URL shortening\n- Multiple storage providers (local and S3)\n- Simple and clean API\n- Docker support\n- Configurable through environment variables\n- Rate limiting\n- Analytics\n- OG image support for text pastes\n\n## Installation\n\n### Prerequisites\n\n- Go 1.21+\n- The desire to live dangerously\n\n### Local Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/watzon/0x45.git\ncd 0x45\n\n# Install dependencies\ngo mod download\n\n# Configure settings\nvim config.yaml\n\n# Start the server (migrations will be run automatically)\ngo run cmd/server/main.go\n```\n\nAlternatively for speedier local development, you can install the [air](https://github.com/cosmtrek/air) package and run:\n\n```bash\nair\n```\n\n### Docker\n\nBuild and run locally:\n\n```bash\ndocker build -v ./uploads:/app/uploads --tag 0x45 ./docker\ndocker run -d -p 3000:3000 0x45\n```\n\nOr use the pre-built image:\n\n```bash\ndocker pull ghcr.io/watzon/0x45:main\ndocker run -d -p 3000:3000 ghcr.io/watzon/0x45:main\n```\n\n## Configuration\n\nConfiguration is done through the `config.yaml` file. See the [example config](config.yaml) for more information on the available options. When running in a docker container it might be more convenient to set the environment variables instead, here is a list of available options:\n\n### Debugging\nSet the `0X_LOG_LEVEL` environment variable to `debug` to get more verbose logging.\n\n| Environment Variable | Description | Default |\n| -------------------- | ----------- | ------- |\n| 0X_LOG_LEVEL         | Log level   | info    |\n\n### Database Configuration\nControls the database connection settings.\n\n| Environment Variable | Description                              | Default    |\n| -------------------- | ---------------------------------------- | ---------- |\n| 0X_DATABASE_DRIVER   | Database driver to use (sqlite/postgres) | sqlite     |\n| 0X_DATABASE_HOST     | Database host                            | localhost  |\n| 0X_DATABASE_PORT     | Database port                            | 5432       |\n| 0X_DATABASE_USER     | Database username                        | \"\"         |\n| 0X_DATABASE_PASSWORD | Database password                        | \"\"         |\n| 0X_DATABASE_NAME     | Database name                            | paste69.db |\n| 0X_DATABASE_SSLMODE  | SSL mode for postgres                    | disable    |\n\n### Storage Configuration\nConfigure one or more storage backends for file storage. Multiple backends can be configured using numbered environment variables (0-9).\n\n| Environment Variable     | Description                                 | Default   |\n| ------------------------ | ------------------------------------------- | --------- |\n| 0X_STORAGE_0_NAME        | First storage backend name                  | local     |\n| 0X_STORAGE_0_TYPE        | First storage type (local/s3)               | local     |\n| 0X_STORAGE_0_DEFAULT     | First storage is default                    | true      |\n| 0X_STORAGE_0_PATH        | First local storage path                    | ./uploads |\n| 0X_STORAGE_0_S3_BUCKET   | First S3 bucket name                        | \"\"        |\n| 0X_STORAGE_0_S3_REGION   | First S3 region                             | \"\"        |\n| 0X_STORAGE_0_S3_KEY      | First S3 access key                         | \"\"        |\n| 0X_STORAGE_0_S3_SECRET   | First S3 secret key                         | \"\"        |\n| 0X_STORAGE_0_S3_ENDPOINT | First S3 endpoint                           | \"\"        |\n| 0X_STORAGE_1_NAME        | Second storage backend name                 | \"\"        |\n| ...                      | (and so on for STORAGE_1 through STORAGE_9) |           |\n\n### Server Configuration\nCore server settings and behavior.\n\n| Environment Variable          | Description                  | Default  |\n| ----------------------------- | ---------------------------- | -------- |\n| 0X_SERVER_ADDRESS             | Server listen address        | :3000    |\n| 0X_SERVER_BASE_URL            | Base URL for the server      | \"\"       |\n| 0X_SERVER_MAX_UPLOAD_SIZE     | Maximum upload size in bytes | 5242880  |\n| 0X_SERVER_DEFAULT_UPLOAD_SIZE | Default upload size in bytes | 5242880  |\n| 0X_SERVER_API_UPLOAD_SIZE     | API upload size in bytes     | 5242880  |\n| 0X_SERVER_PREFORK             | Enable prefork mode          | false    |\n| 0X_SERVER_SERVER_HEADER       | Server header value          | Paste69  |\n| 0X_SERVER_APP_NAME            | Application name             | Paste69  |\n| 0X_SERVER_CORS_ORIGINS        | CORS allowed origins         | []       |\n| 0X_SERVER_VIEWS_DIRECTORY     | Directory for view templates | ./views  |\n| 0X_SERVER_PUBLIC_DIRECTORY    | Directory for public files   | ./public |\n\n### Cleanup Configuration\nSettings for automatic content cleanup.\n\n| Environment Variable       | Description                 | Default |\n| -------------------------- | --------------------------- | ------- |\n| 0X_SERVER_CLEANUP_ENABLED  | Enable automatic cleanup    | true    |\n| 0X_SERVER_CLEANUP_INTERVAL | Cleanup interval in seconds | 3600    |\n| 0X_SERVER_CLEANUP_MAX_AGE  | Maximum age for content     | 168h    |\n\n### Rate Limiting Configuration\nControls rate limiting behavior.\n\n| Environment Variable                     | Description                 | Default |\n| ---------------------------------------- | --------------------------- | ------- |\n| 0X_SERVER_RATE_LIMIT_GLOBAL_ENABLED      | Enable global rate limiting | true    |\n| 0X_SERVER_RATE_LIMIT_GLOBAL_RATE         | Global requests per second  | 100.0   |\n| 0X_SERVER_RATE_LIMIT_GLOBAL_BURST        | Global burst size           | 50      |\n| 0X_SERVER_RATE_LIMIT_PER_IP_ENABLED      | Enable per-IP rate limiting | true    |\n| 0X_SERVER_RATE_LIMIT_PER_IP_RATE         | Per-IP requests per second  | 1.0     |\n| 0X_SERVER_RATE_LIMIT_PER_IP_BURST        | Per-IP burst size           | 5       |\n| 0X_SERVER_RATE_LIMIT_USE_REDIS           | Use Redis for rate limiting | false   |\n| 0X_SERVER_RATE_LIMIT_IP_CLEANUP_INTERVAL | IP cleanup interval         | 1h      |\n\n### SMTP Configuration\nEmail sending configuration.\n\n| Environment Variable | Description               | Default |\n| -------------------- | ------------------------- | ------- |\n| 0X_SMTP_ENABLED      | Enable SMTP functionality | false   |\n| 0X_SMTP_HOST         | SMTP server host          | \"\"      |\n| 0X_SMTP_PORT         | SMTP server port          | 587     |\n| 0X_SMTP_USERNAME     | SMTP username             | \"\"      |\n| 0X_SMTP_PASSWORD     | SMTP password             | \"\"      |\n| 0X_SMTP_FROM         | From email address        | \"\"      |\n| 0X_SMTP_FROM_NAME    | From name                 | Paste69 |\n| 0X_SMTP_STARTTLS     | Use STARTTLS              | true    |\n\n### Redis Configuration\nRedis connection settings.\n\n| Environment Variable | Description           | Default        |\n| -------------------- | --------------------- | -------------- |\n| 0X_REDIS_ENABLED     | Enable Redis          | false          |\n| 0X_REDIS_ADDRESS     | Redis server address  | localhost:6379 |\n| 0X_REDIS_PASSWORD    | Redis password        | \"\"             |\n| 0X_REDIS_DB          | Redis database number | 0              |\n\n### Retention Configuration\nContent retention policy settings.\n\n| Environment Variable          | Description                        | Default |\n| ----------------------------- | ---------------------------------- | ------- |\n| 0X_RETENTION_NO_KEY_MIN_AGE   | Minimum retention days without key | 7.0     |\n| 0X_RETENTION_NO_KEY_MAX_AGE   | Maximum retention days without key | 128.0   |\n| 0X_RETENTION_WITH_KEY_MIN_AGE | Minimum retention days with key    | 30.0    |\n| 0X_RETENTION_WITH_KEY_MAX_AGE | Maximum retention days with key    | 730.0   |\n| 0X_RETENTION_POINTS           | Number of retention curve points   | 50      |\n\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -am 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. \n","funding_links":["https://github.com/sponsors/watzon","https://patreon.com/watzon","https://ko-fi.com/watzon"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatzon%2F0x45","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatzon%2F0x45","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatzon%2F0x45/lists"}