{"id":49508744,"url":"https://github.com/kopoze/kpz","last_synced_at":"2026-05-01T18:01:05.995Z","repository":{"id":195063929,"uuid":"691127855","full_name":"kopoze/kpz","owner":"kopoze","description":"DevOps CLI toolikts made with Go.","archived":false,"fork":false,"pushed_at":"2023-10-16T14:11:42.000Z","size":77,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-10-11T14:03:55.351Z","etag":null,"topics":["cli","devops","go","hacktoberfest","nginx","toolkit"],"latest_commit_sha":null,"homepage":"","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/kopoze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-13T14:54:07.000Z","updated_at":"2025-07-21T17:03:33.000Z","dependencies_parsed_at":"2023-09-23T18:55:51.825Z","dependency_job_id":"2f78a905-764a-473c-8a3e-e83e046b61a5","html_url":"https://github.com/kopoze/kpz","commit_stats":null,"previous_names":["kopoze/kpz"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kopoze/kpz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopoze%2Fkpz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopoze%2Fkpz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopoze%2Fkpz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopoze%2Fkpz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kopoze","download_url":"https://codeload.github.com/kopoze/kpz/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopoze%2Fkpz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32507094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["cli","devops","go","hacktoberfest","nginx","toolkit"],"created_at":"2026-05-01T18:00:48.750Z","updated_at":"2026-05-01T18:01:05.987Z","avatar_url":"https://github.com/kopoze.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kopoze\n\nDevOps toolikts made with go.\n\n**Note:** The project is still in active development so there will be a lot of bug. And all step here was only tested on Ubuntu 20.04.\n\n## Requirements\n\n- PostresSQL\n- Nginx or Apache2\n- Mkcert\n\n## Install\n\n### For local use\n\nFor local use, this cli is to simplify subdomain-port mapping with https of your local project.\n\n#### Get the app\n\nTo get this app, go to the [release page](https://github.com/kopoze/kpz/releases/) and choose the version according to your architecture.\n\nNext, move it inside your `/usr/local/bin/` folder.\n\n```sh\ncd /Download/\nwget -c https://github.com/kopoze/kpz/releases/download/{tag}/{filename}\nmv ./kpz /urs/local/bin/\n```\n\nOr you can clone this repo and manually compile this project on your computer.\n\n```sh\ngit clone https://github.com/kopoze/kpz\ncd kpz\ngo get -d -v ./...\nmake\n```\n\nYou will find the `.deb` inside the `build` folder.\n\nYou then can install you `.deb` with:\n\n```sh\nsudo dpkg -i kpz-*.deb\n```\n\n### Init configuration\n\nTo set up default config, run the following command first:\n\n```sh\nsudo kpz configure\n```\n\nConfiguration file can be found under `/etc/kopoze/kopoze.toml`. You can modify it depends on your local configuration.\n\n#### Generate certificate for local https\n\nGenerate certificate for a wildcard subdomain.\n\n```sh\nmkcert *.project.mg\n```\n\nThe domain value need to match the value you set inside your config file under `kopoze.domain`.\n\nTo install and configure Mkcert, you can read more [here](https://www.howtoforge.com/how-to-create-locally-trusted-ssl-certificates-with-mkcert-on-ubuntu/).\n\n#### Configure nginx\n\nNow create subdomain configuration under `/etc/nginx/sites-availble/sub.project.mg` with the following value.\n\n```conf\nserver {\n    server_name *.project.mg;\n\n    location / {\n    proxy_pass http://localhost:8080;\n    proxy_pass_header Set-Cookie;\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    proxy_set_header X-Forwarded-Proto $scheme;\n    proxy_set_header X-Forwarded-Host $host;\n    proxy_set_header Cookie $http_cookie;\n\n    proxy_cookie_path / /;\n    client_max_body_size 5m;\n    }\n\n\n    listen 443 ssl; # managed by Certbot\n    ssl_certificate /etc/letsencrypt/live/_wildcard.project.mg/_wildcard.project.mg.pem; # managed by Certbot\n    ssl_certificate_key /etc/letsencrypt/live/_wildcard.project.mg/_wildcard.project.mg-key.pem; # managed by Certbot\n    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot\n    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot\n\n}\nserver {\n    if ($host = *.project.mg) {\n        return 301 https://$host$request_uri;\n    } # managed by Certbot\n\n    server_name *.project.mg;\n    listen 80;\n    return 404; # managed by Certbot\n}\n```\n\nDon't forget to change the value of `ssl_certificate` and `ssl_certificate_key` with the path of the generated certificate with `mkcert` earlier.\n\nNote that the port used inside your config is the port that will be used when starting our script with `kpz serve`.\n\nAt the end, validate your configuration with `sudo nginx -t` and if everything is ok, restart your nginx server with `sudo systemctl restart nginx`.\n\n#### Configure Apache2\n\nIf you prefere using apache, here is a configuration you can use:\n\n```conf\n\u003cVirtualHost *:443\u003e\n    ServerName project.mg\n    ServerAlias *.project.mg\n\n    SSLEngine on\n    ProxyPreserveHost On\n    SSLCertificateFile /etc/letsencrypt/live/_wildcard.project.mg/_wildcard.project.mg.pem\n    SSLCertificateKeyFile /etc/letsencrypt/live/_wildcard.project.mg/_wildcard.project.mg-key.pem\n\n    ProxyPass / http://localhost:8080/\n    ProxyPassReverse / http://localhost:8080/\n\u003c/VirtualHost\u003e\n```\n\nDon't forget to enable these following module:\n\n```sh\nsudo a2enmod proxy\nsudo a2enmod proxy_http\nsudo a2enmod ssl\n```\n\nEnable your config with:\n\n```sh\nsudo a2ensite project.mg.conf\n```\n\nAnd finally, restart your apache2 with:\n\n```sh\nsudo service apache2 restart\n```\n\n#### PostgreSQL configuration\n\nTo configure your database, edit the config file inside `/etc/kopoze/kopoze.toml` and put your custom value. Default value for database configuration is:\n\n```toml\n[database]\nengine = 'postgresql'\nhost = 'localhost'\npassword = 'root'\nport = '5432'\nuser = 'root'\nname = 'kopoze'\n```\n\n#### Run the program\n\nNow you can run the cli with\n\n```sh\nsudo kpz serve\n```\n\nNote that in local mode, to update existing hosts, you must run this app in sudo mode.\n\n#### Add your app\n\nYou can use the existing API under `http://locahost:8080/cli/apps/` or add directly your entry inside PostresSQL.\n\nHere is the JSON format to create app:\n\n```http\nPOST http://localhost:8080/cli/apps/\nContent-Type: application/json\n\n{\n    \"name\": \"App1\",\n    \"subdomain\": \"app1\",\n    \"port\": 9000\n}\n```\n\nThanks to [txeh](https://github.com/txn2/txeh), you can manually add subdomains with:\n\n```sh\nsudo kpz subdomain add [sub1] [sub2] [sub3]\n```\n\nAnd remove them whith:\n\n```sh\nsudo kpz subdomain remove [sub1] [sub2] [sub3]\n```\n\n## Limitation\n\nFor know, accessing Django admin with this tool need specific configuration on Django side because `sessionId` cookies is not set. Still can't figure out the way out.\n\n## Author\n\n\u0026copy; [Kopoze](https://t.me/hantsaniala3) 2023\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopoze%2Fkpz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkopoze%2Fkpz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopoze%2Fkpz/lists"}