{"id":46102877,"url":"https://github.com/imperzer0/webserver","last_synced_at":"2026-03-01T20:04:18.878Z","repository":{"id":64685139,"uuid":"575008792","full_name":"imperzer0/webserver","owner":"imperzer0","description":"Lightweight c++ web server for linux (available in docker container)","archived":false,"fork":false,"pushed_at":"2025-07-21T12:08:33.000Z","size":306,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-21T13:14:02.853Z","etag":null,"topics":["fineftp","ftp","ftp-server","http","http-server","https","https-server","mongoose","web-server","webserver"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imperzer0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2022-12-06T14:54:40.000Z","updated_at":"2025-07-21T12:08:32.000Z","dependencies_parsed_at":"2025-05-29T14:10:21.471Z","dependency_job_id":null,"html_url":"https://github.com/imperzer0/webserver","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/imperzer0/webserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imperzer0%2Fwebserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imperzer0%2Fwebserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imperzer0%2Fwebserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imperzer0%2Fwebserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imperzer0","download_url":"https://codeload.github.com/imperzer0/webserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imperzer0%2Fwebserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29983122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["fineftp","ftp","ftp-server","http","http-server","https","https-server","mongoose","web-server","webserver"],"created_at":"2026-03-01T20:04:18.318Z","updated_at":"2026-03-01T20:04:18.874Z","avatar_url":"https://github.com/imperzer0.png","language":"C++","readme":"# webserver\n\nLightweight c++ web server for linux with ftp (available in docker container)\n\n## Installation\n\n#### Archlinux\n\nUse [PKGBUILD](archpackage/PKGBUILD) to make and install the package\n\n```bash\ncd archpackage;\nmakepkg -sif\n```\n\n#### Debian\n\nUse [makepkg.sh](debpackage/makepkg.sh) to build and install the package\n\n```bash\ncd debpackage;\nbash makepkg.sh -i\n```\n\n#### Docker\n\n```bash\ndocker build -t webserver . \u0026\u0026 docker image prune -f \u0026\u0026 docker compose up\n```\n\n## Setup email\n\n1. Create google account with new email.\n2. Go to your new account's settings.\n3. Go to `Security` tab.\n4. Enable 2-step verification.\n5. After that you should see entry called `App passwords`, that's what we need: go there.\n6. Tap on `Select app` field.\n7. Choose entry `Other (custom name)` from dropdown menu.\n8. Call it somehow. For example: `smtp_webserver`.\n9. Press button called `Generate`.\n10. Here you should see the key that looks like this `wlgf hdfr jwsr ydrg`.\n11. Copy it.\n12. Then go to command prompt and enter [commands below](#Deploy), replacing `\u003caccount\u003e` with your gmail account name\n    and `\u003cauth_key\u003e` with the key, you just copied.\n\n## Deploy\n\n### Linux\n\nFirst you need to generate ssl certificates (only once)\n\n```bash\nsudo mkdir -p /srv/certs/\ncd /srv/certs/\necho -e \"CASUBJ=\\\"/C=UA/ST=Ukraine/L=Zakarpattia/O=dima/CN=CAwebserver\\\";\\n\\\n         CRTSUBJ=\\\"/C=UA/ST=Ukraine/L=Zakarpattia/O=dima/CN=CRTwebserver\\\";\\n\\\n         # Generate CA (Certificate Authority)\\n\\\n         openssl ecparam -genkey -name prime256v1 -out ca.key;\\n\\\n         openssl req -new -x509 -days 365 -key ca.key -out ca.pem -subj \\$CASUBJ;\\n\\\n         # Generate server certificate\\n\\\n         openssl ecparam -genkey -name prime256v1 -out key.pem;\\n\\\n         openssl req -new -key key.pem -out csr.pem -subj \\$CRTSUBJ;\\n\\\n         # Sign the public key\\n\\\n         openssl x509 -req -days 365 -in csr.pem -CA ca.pem -CAkey ca.key -set_serial 01 -out cert.pem;\" \\\n  \u003egenerator.bash \u0026\u0026 chmod +x generator.bash \u0026\u0026 bash generator.bash\n```\n\nThen, in order to run the server, navigate to the website's home directory and run commands.\nReplace `\u003caccount\u003e@gmail.com` with your email address and `\u003cauth_key\u003e` with [the key](#Setup-email) you just generated.\n\n```bash\nsudo mkdir -p /srv/webserver/\ncd /srv/webserver/\nwebserver --tls /srv/certs/ --email=\"\u003caccount\u003e@gmail.com\" --email-password=\"\u003cauth_key\u003e\"\n```\n\n### Docker\n\nOpen up terminal (in `website` directory) and run commands\n\n```bash\ndocker volume create webserver_certificates\ndocker volume create webserver_data\ndocker volume create webserver_etc\ndocker run --network=host -v webserver_certificates:/srv/certs \\\n           -v webserver_data:/srv/webserver \\\n           -v webserver_etc:/etc --name webserver -it webserver \\\n           --email=\"\u003caccount\u003e@gmail.com\" --email-password=\"\u003cauth_key\u003e\"\n```\n\n## Modification\n\n`webserver` is a flexible application.\u003cbr/\u003e\nIf you want to implement custom functionality - go to `config.cpp`.\u003cbr/\u003e\nFollow the guidelines in the comments to configure it properly.\u003cbr/\u003e\nThen you have to recompile and reinstall the application.\n\n# Security tips\n\nTo protect your server from hackers:\n\n1. Create a user for the webserver and use native linux protections to prevent users\n   from accessing non-server files and directories\n2. Avoid allowing users to create symlinks. They can escape their sandbox root directory\n   and potentially get into other user's directory\n3. Make sure that other services that have access to this server's directories won't\n   execute or process in a way that could compromise the security of the machine\n   files that users can create and modify\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimperzer0%2Fwebserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimperzer0%2Fwebserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimperzer0%2Fwebserver/lists"}