{"id":18593984,"url":"https://github.com/prophetru/reddot","last_synced_at":"2026-05-15T08:34:08.770Z","repository":{"id":238844044,"uuid":"797737049","full_name":"ProphetRu/Reddot","owner":"ProphetRu","description":"Reddot - is not a commercial educational project","archived":false,"fork":false,"pushed_at":"2024-05-08T13:16:04.000Z","size":990,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T17:14:05.149Z","etag":null,"topics":["cmake","cms","config","cpp","doxygen","factory","filter","gtest","http","https","mysql","openssl","otus","poco","prototype","server","session","singleton","strategy"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProphetRu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2024-05-08T12:21:18.000Z","updated_at":"2024-05-13T08:55:02.000Z","dependencies_parsed_at":"2024-05-08T13:45:07.152Z","dependency_job_id":null,"html_url":"https://github.com/ProphetRu/Reddot","commit_stats":null,"previous_names":["prophetru/reddot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ProphetRu/Reddot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProphetRu%2FReddot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProphetRu%2FReddot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProphetRu%2FReddot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProphetRu%2FReddot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProphetRu","download_url":"https://codeload.github.com/ProphetRu/Reddot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProphetRu%2FReddot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33059511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"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":["cmake","cms","config","cpp","doxygen","factory","filter","gtest","http","https","mysql","openssl","otus","poco","prototype","server","session","singleton","strategy"],"created_at":"2024-11-07T01:14:14.866Z","updated_at":"2026-05-15T08:34:08.726Z","avatar_url":"https://github.com/ProphetRu.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reddot\n**Reddot** - is not a commercial educational project with:\n* [cmake](https://github.com/Kitware/CMake)\n* [googletest](https://github.com/google/googletest)\n* [boost program-options](https://github.com/boostorg/program_options)\n* [openssl](https://github.com/openssl/openssl)\n* [libmysql](https://github.com/LuaDist/libmysql)\n* [poco (netssl, mysql)](https://github.com/pocoproject/poco)\n* [doxygen](https://github.com/doxygen/doxygen)\n\n\n## Description\n**Reddot** - is a web server and website with CMS on it.\nFeatures:\n* User registrations;\n* User login;\n* User logout;\n* Deleting an account by the user;\n* Writing posts;\n* Editing posts;\n* Deleting posts;\n\nEach user can view posts of other users, but can only manage their own account and their posts.\n\nThe project implemented:\n* Thread-safe logger with different logging levels;\n* Support configuration from file;\n* Calculation of hashes;\n* Working with the file system;\n* Server supporting HTTP protocol and secure connection using HTTPS. A certificate has been generated and signed;\n* A database and tables were created in the MySQL. The tables are filled with initial data;\n* Working with the MySQL forming queries, obtaining results, error handling;\n* Web pages written using HTML and CSS, placed placeholders;\n* CMS responsible for query parsing, business logic, and generation and delivery of content (web pages);\n* Support for user sessions;\n* Filters for web security and protection against web attacks;\n\nThe project uses design patterns: `Singleton`, `Factory`, `Prototype`, `Strategy`.\n\n\n## Demo\nIndex page for guest:\n\n![1 index guest](https://raw.githubusercontent.com/ProphetRu/Reddot/master/images/1%20index%20guest.jpg)\n\nRegistration page:\n\n![2 registration](https://raw.githubusercontent.com/ProphetRu/Reddot/master/images/2%20registration.jpg)\n\nLogin page:\n\n![3 login](https://raw.githubusercontent.com/ProphetRu/Reddot/master/images/3%20login.jpg)\n\nIndex page for user:\n\n![4 index user](https://raw.githubusercontent.com/ProphetRu/Reddot/master/images/4%20index%20user.jpg)\n\nAccount page:\n\n![5 account](https://raw.githubusercontent.com/ProphetRu/Reddot/master/images/5%20account.jpg)\n\nPost creation page:\n\n![6 post create](https://raw.githubusercontent.com/ProphetRu/Reddot/master/images/6%20post%20create.jpg)\n\nPost view page:\n\n![7 post view](https://raw.githubusercontent.com/ProphetRu/Reddot/master/images/7%20post%20view.jpg)\n\nPost editing page:\n\n![8 post edit](https://raw.githubusercontent.com/ProphetRu/Reddot/master/images/8%20post%20edit.jpg)\n\n\n## Creating and init MySQL\n### 1. Gain access to MySQL\nStopping a service:\n```shell\nsudo service mysql stop\n```\n\nCreate a file: \n```shell\n/home/\u003cusername\u003e/mysql-init\n```\n\nWrite in a file: \n```shell\nALTER USER 'root'@'127.0.0.1' IDENTIFIED BY '\u003cNewPassword\u003e';\n```\n\nUse a file to init MySQL: \n```shell\nsudo mysqld --init-file=/home/\u003cusername\u003e/mysql-init \u0026\n```\n\nStarting a service: \n```shell\nsudo service mysql start\n```\n\nLogin into MySQL:\n```shell\nsudo mysql -u root -p\n```\n\n### 2. Creating a user MySQL\nExecute queries in MySQL:\n```sql\nCREATE USER 'reddot'@'%' IDENTIFIED BY 'reddot';\nGRANT ALL PRIVILEGES ON reddot.* TO 'reddot'@'%';\nFLUSH PRIVILEGES;\n```\n\n### 3. Creating database and tables\nExecute queries in MySQL:\n```sql\nCREATE DATABASE IF NOT EXISTS reddot;\nUSE reddot;\nCREATE TABLE roles (id INT AUTO_INCREMENT PRIMARY KEY, description VARCHAR(32));\nCREATE TABLE users (login VARCHAR(64) PRIMARY KEY, password VARCHAR(64), role_id INT, FOREIGN KEY (role_id) REFERENCES roles(id));\nCREATE TABLE posts (id INT AUTO_INCREMENT PRIMARY KEY, login VARCHAR(64), caption VARCHAR(255), body TEXT, FOREIGN KEY (login) REFERENCES users(login));\n```\n\n### 4. Filling tables with initial data\nExecute  queries in MySQL:\n```sql\nINSERT INTO roles (description) VALUES ('Administrator');\nINSERT INTO roles (description) VALUES ('User');\nINSERT INTO users (login, password, role_id) VALUES ('admin', MD5('admin'), 1);\nINSERT INTO posts (login, caption, body) VALUES ('admin', 'Welcome post', 'Welcome to Reddot!');\n```\n\n### 5. Allowing remote connections to the MySQL\nStopping a service:\n```shell\nsudo service mysql stop\n```\n\nIn the settings file, comment out the \"bind\" line:\n```shell\nsudo nano /etc/mysql/mariadb.conf.d/50-server.cnf\n```\n\nAdd firewall rule:\n```shell\nsudo iptables -A INPUT -p tcp --dport 3306 -j ACCEPT\n```\n\nStarting a service: \n```shell\nsudo service mysql start\n```\n\n\n## Build project local\n**Important**: the resources folder must be in the same directory where the executable file is located.\n\n### Build for Linux\nUpdating and installing dependencies:\n```shell\nsudo apt-get update \u0026\u0026 sudo apt install g++ cmake build-essential libgtest-dev libboost-program-options-dev libssl-dev ca-certificates libpoco-dev libpoconetssl80 libmysqlclient-dev -y\n```\n\nGenerate cmake files:\n```shell\ncd Reddot\nmkdir build \u0026\u0026 cd build\ncmake ..\n```\n\nBuild debug:\n```shell\ncmake --build .\n```\n\nBuild release:\n```shell\ncmake --build . --config Release\n```\n\nBuild deb-package:\n```shell\ncmake --build . --target package\n```\n\n### Build for Windows\nInstalling dependencies:\n```shell\nvcpkg install gtest boost-program-options openssl libmysql poco poco[netssl] --recurse poco[mysql] --recurse poco:x64-windows-release\nvcpkg integrate install\n```\n\nGenerate cmake files:\n```shell\ncd Reddot\nmkdir build \u0026\u0026 cd build\ncmake .. -DCMAKE_TOOLCHAIN_FILE=\"path/to/vcpkg/scripts/buildsystems/vcpkg.cmake\"\n```\n\nBuild debug:\n```shell\ncmake --build . \n```\n\nBuild release:\n```shell\ncmake --build . --config Release\n```\n\n\n## Configure\nSet parameters in config file `config.ini`:\n* **web_root_path** - path to web-pages;\n* **server_port** - port for server;\n* **db_login** - login to MySQL;\n* **db_password** - password to MySQL;\n* **db_server** - host MySQL;\n* **db_port** - port MySQL;\n* **db_name** - database name to MySQL;\n\n\n## Testing\nStarting unit-tests:\n```shell\nctest\n```\n\n\n## Starting\nStarting the server\n```shell\nRelease\u003eReddot.exe\n\n[08-05-2024 12:46:20] (Info) Server is running\n[08-05-2024 12:46:20] (Info) Init config\n[08-05-2024 12:46:20] (Info) Init CMS\n[08-05-2024 12:46:20] (Info) Init DB connection\nWARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.\n[08-05-2024 12:46:20] (Info) Init Server\n[08-05-2024 12:46:20] (Info) Key file   : resources/cert/reddot.key\n[08-05-2024 12:46:20] (Info) Cert file  : resources/cert/reddot.crt\n[08-05-2024 12:46:20] (Info) Port       : 4444\n[08-05-2024 12:46:20] (Info) Max queued : 100\n[08-05-2024 12:46:20] (Info) Max threads: 20\n[08-05-2024 12:46:20] (Info) Waiting connections...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprophetru%2Freddot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprophetru%2Freddot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprophetru%2Freddot/lists"}