{"id":15149945,"url":"https://github.com/obaskly/anonymouschat","last_synced_at":"2026-01-19T09:01:33.021Z","repository":{"id":189236456,"uuid":"680311187","full_name":"obaskly/AnonymousChat","owner":"obaskly","description":"Secure Anonymous Chat","archived":false,"fork":false,"pushed_at":"2023-08-19T18:05:25.000Z","size":107,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T05:42:57.410Z","etag":null,"topics":["chat","cryptography","end-to-end-encryption","flask","python","rsa"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obaskly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-08-18T21:49:49.000Z","updated_at":"2024-02-09T02:59:30.000Z","dependencies_parsed_at":"2023-08-18T22:58:18.010Z","dependency_job_id":"90281850-af89-4f61-b312-1996262e8bce","html_url":"https://github.com/obaskly/AnonymousChat","commit_stats":null,"previous_names":["obaskly/anonymouschat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/obaskly/AnonymousChat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaskly%2FAnonymousChat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaskly%2FAnonymousChat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaskly%2FAnonymousChat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaskly%2FAnonymousChat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obaskly","download_url":"https://codeload.github.com/obaskly/AnonymousChat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaskly%2FAnonymousChat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28565001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["chat","cryptography","end-to-end-encryption","flask","python","rsa"],"created_at":"2024-09-26T14:01:37.100Z","updated_at":"2026-01-19T09:01:33.006Z","avatar_url":"https://github.com/obaskly.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anonymous Chat 💬🚀\n\nA modern chat application built with Flask.\n\n## Features 🌟\n1. **User Authentication \u0026 Sessions**: Uses Flask-Login and Flask-Session for seamless user authentication and session management.\n2. **Database Integration**: Integrated with SQLAlchemy for efficient database operations.\n3. **Form Handling**: Utilizes Flask-WTF for form creation, handling, and validation.\n4. **Rate Limiting**: Implements Flask-Limiter for limiting request rates and ensuring application reliability.\n5. **Password Security**: Uses Bcrypt for password hashing, ensuring user data security.\n6. **End-to-End Encryption**: Employs the cryptography library for encrypting and decrypting messages, ensuring privacy.\n7. **Task Scheduling**: Uses APScheduler for periodic task execution.\n8. **Redis Integration**: Implements Redis as a session store for better performance and scalability.\n\n## Setup \u0026 Usage 💼\n\n### Dependencies 📦\nMake sure to install the following dependencies:\n\n```\npip install flask flask-sqlalchemy flask-login flask-wtf flask-limiter flask-bcrypt flask-session cryptography apscheduler redis email-validator WTForms pymysql\n```\n\n### Database Setup (MySQL) 🗃️\n\n1. **Installing MySQL**:\n    - **Windows**: Download the [MySQL Installer](https://dev.mysql.com/downloads/installer/) and follow the prompts.\n    - **MacOS**: Use Homebrew: `brew install mysql`\n    - **Linux (Ubuntu)**:\n        ```bash\n        sudo apt update\n        sudo apt install mysql-server\n        ```\n\n2. **Starting MySQL**:\n    - **Windows**: Use the MySQL Notifier icon or services panel.\n    - **MacOS**: `mysql.server start`\n    - **Linux**: `sudo systemctl start mysql`\n\n3. **Securing MySQL**:\n    After installing, it's crucial to secure your MySQL installation:\n    ```bash\n    sudo mysql_secure_installation\n    ```\n\n4. **Connecting to MySQL**:\n    Use the following command to interact with MySQL:\n    ```bash\n    mysql -u root -p\n    ```\n    And enter your password\n\n5. **Creating a New Database \u0026 User**:\n   Create a new database:\n   ```sql\n   CREATE DATABASE anonymouschatdb;\n   ```\n   By default, MySQL will have a 'root' user. But we will create a new user:\n    ```sql\n    CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';\n    GRANT ALL PRIVILEGES ON anonymouschatdb.* TO 'username'@'localhost';\n    FLUSH PRIVILEGES;\n    exit;\n    ```\n\n6. **Setting up the MySQL URI as an Environmental Variable**:\n\n\tFor security reasons, it's recommended to store sensitive data like database URIs as environmental variables rather than hardcoding them into your application.\n\t\n\t1. **Windows**:\n\t    ```bash\n\t    setx DATABASE_URI \"mysql+pymysql://[USERNAME]:[PASSWORD]@[HOST]/[DATABASE_NAME]\"\n\t    ```\n\t\n\t2. **MacOS and Linux**:\n\t    ```bash\n\t    echo 'export DATABASE_URI=\"mysql+pymysql://[USERNAME]:[PASSWORD]@[HOST]/[DATABASE_NAME]\"' \u003e\u003e ~/.bash_profile\n       source ~/.bash_profile\n\t    ```\n\t\n\tReplace `[USERNAME]`, `[PASSWORD]`, `[HOST]`, and `[DATABASE_NAME]` with your actual database credentials.\n\n### Redis Setup 🎈\n1. **Download and Install Redis**:\n    - **Windows**: \n        1. Install using pip: `pip install redis`\n        2. Download and install from [Redis Windows Release](https://github.com/microsoftarchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.msi)\n    - **MacOS**: Use Homebrew: `brew install redis`\n    - **Linux (Ubuntu)**:\n        ```bash\n        sudo apt update\n        sudo apt install redis-server\n        ```\n\n2. **Start the Redis Server**:\n    - MacOS, Linux, or WSL on Windows: Use the `redis-server` command.\n\n3. **Verify Redis is Running**:\n    - Use the `redis-cli` tool and type: `redis-cli ping`. If the server is running, it should respond with `PONG`.\n\n4. **Secure Your Redis Server**:\n    - Go to the Redis configuration file. Sometimes you might have two configuration files, edit both.\n        - Uncomment the line: `bind 127.0.0.1`\n    - **Set a Password and Disable Dangerous Commands**:\n        - In the configuration file(s), add:\n\n        ```\n        requirepass \"YOUR_STRONG_PASSWORD_HERE\"\n        rename-command CONFIG \"\"\n        rename-command FLUSHALL \"\"\n        rename-command DEL \"\"\n        rename-command FLUSHDB \"\"\n        ```\n\n        - Save the password as an environmental variable:\n            - Windows: `setx REDIS_PASSWORD \"YOUR_PASSWORD_HERE\"`\n            - Linux: `export REDIS_PASSWORD=\"YOUR_PASSWORD_HERE\"`\n        - Restart your Redis server.\n\n\n## Setting up Nginx and Gunicorn for Flask 🚀\n\nFlask applications can be served using a combination of Nginx and Gunicorn. Nginx acts as a reverse proxy, directing web traffic to backend applications served by Gunicorn.\n\n### Prerequisites 🔍\n- Basic knowledge of the command line.\n\n### Linux Setup 🐧\n\n#### Installing Nginx 💻\n1. Update your package lists:\n    ```bash\n    sudo apt update\n    ```\n2. Install Nginx:\n    ```bash\n    sudo apt install nginx\n    ```\n\n#### Installing Gunicorn 🦄\n1. Ensure you have `pip` installed:\n    ```bash\n    sudo apt install python3-pip\n    ```\n2. Install Gunicorn:\n    ```bash\n    pip3 install gunicorn\n    ```\n\n#### Configuring Nginx for Flask 🛠️\n1. Create a new Nginx configuration for your Flask app:\n    ```bash\n    sudo nano /etc/nginx/sites-available/myflaskapp\n    ```\n\n2. Add the following to the configuration file, adjusting the server_name and proxy_pass as needed:\n    ```nginx\n    server {\n        listen 80;\n        server_name yourdomain.com www.yourdomain.com;\n\n        location / {\n            proxy_pass http://127.0.0.1:5000;\n            proxy_set_header Host $host;\n            proxy_set_header X-Real-IP $remote_addr;\n            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        }\n    }\n    ```\n\n3. Create a symbolic link to the `sites-enabled` directory:\n    ```bash\n    sudo ln -s /etc/nginx/sites-available/myflaskapp /etc/nginx/sites-enabled\n    ```\n\n4. Test Nginx configuration:\n    ```bash\n    sudo nginx -t\n    ```\n\n5. Reload Nginx to apply changes:\n    ```bash\n    sudo systemctl reload nginx\n    ```\n\n#### Running the Flask App with Gunicorn 🚀\n1. Navigate to your Flask application directory.\n2. Run your app with Gunicorn:\n    ```bash\n    gunicorn main:app -b 127.0.0.1:5000\n    ```\n\n### Windows Setup (using WSL) 🪟\n\n#### Installing Windows Subsystem for Linux (WSL) 🖥️\n1. Open PowerShell as Administrator.\n2. Run the following command to enable the WSL feature:\n    ```bash\n    wsl --install\n    ```\n\n3. Reboot your computer if prompted.\n4. Install your preferred Linux distribution from the Microsoft Store (e.g., Ubuntu).\n\n#### Follow Linux Setup Inside WSL ⬆️\nOnce you have WSL and a Linux distribution installed, you can follow the [Linux Setup](#linux-setup) section above to set up Nginx and Gunicorn inside your WSL environment.\n\n---\n\nThat's it! 🎉 Your Flask application should now be accessible via your domain, served by Gunicorn, and proxied by Nginx.\n\n## Website live 🎥\n\nhttps://github.com/obaskly/AnonymousChat/assets/11092871/908a8466-1bc8-4996-abe5-0453a4aaa86e\n\n\n\n## Contribution 🤝\nFeel free to fork, improve, make pull requests or fill issues. I'll appreciate any help and feedback!\n\n## License 📜\nThis project is open-source and available under the MIT License.\n\n---\n**Happy Coding!** 💻🐍\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobaskly%2Fanonymouschat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobaskly%2Fanonymouschat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobaskly%2Fanonymouschat/lists"}