{"id":20208256,"url":"https://github.com/cubiclesoft/license-server-demo","last_synced_at":"2025-04-10T12:55:38.316Z","repository":{"id":145129300,"uuid":"247290692","full_name":"cubiclesoft/license-server-demo","owner":"cubiclesoft","description":"A complete Stripe + PHP License Server integration + product support center + demo app ready to adjust and deploy.  Get back to writing software in minutes.","archived":false,"fork":false,"pushed_at":"2023-03-07T14:43:29.000Z","size":7163,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T11:44:39.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/cubiclesoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license-server-demo.cubiclesoft.com/public_html/404.php","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":"2020-03-14T14:22:01.000Z","updated_at":"2025-02-21T03:54:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"03811d03-43e3-4e20-9876-2ef2c04ea4ce","html_url":"https://github.com/cubiclesoft/license-server-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Flicense-server-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Flicense-server-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Flicense-server-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Flicense-server-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cubiclesoft","download_url":"https://codeload.github.com/cubiclesoft/license-server-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248221993,"owners_count":21067681,"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","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":[],"created_at":"2024-11-14T05:34:49.720Z","updated_at":"2025-04-10T12:55:38.307Z","avatar_url":"https://github.com/cubiclesoft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"License Server Demo\n===================\n\nA complete Stripe + PHP License Server integration + product support center + demo app ready to adjust and deploy.  Get back to writing software in minutes.\n\nTry it out here:  https://license-server-demo.cubiclesoft.com/\n\n[![Donate](https://cubiclesoft.com/res/donate-shield.png)](https://cubiclesoft.com/donate/) [![Discord](https://img.shields.io/discord/777282089980526602?label=chat\u0026logo=discord)](https://cubiclesoft.com/product-support/github/)\n\nFeatures\n--------\n\n* Boilerplate, ready-made [website](https://license-server-demo.cubiclesoft.com/) + [Demo App](https://github.com/cubiclesoft/license-server-demo/tree/master/support/demo-app) with working [PHP-based Software License Server](https://github.com/cubiclesoft/php-license-server) integration.\n* Simple configuration.  Takes just a few minutes on most VPS hosts running Nginx.\n* Has a liberal open source license.  MIT or LGPL, your choice.  (NOTE:  The demo _binaries_ have a separate EULA.)\n* Designed for relatively painless integration into your project.\n* Sits on GitHub for all of that pull request and issue tracker goodness to easily submit changes and ideas respectively.\n\nGetting Started\n---------------\n\nFirst, install the [PHP-based Software License Server](https://github.com/cubiclesoft/php-license-server) on a server and set up your first product and version.\n\nNext, download or clone this repository and upload the contents of the `license-server-demo.cubiclesoft.com/public_html` directory to the same server.  Note that this software assumes it will be hosted at the root of a domain or subdomain.\n\nNext, [create a Stripe account](https://stripe.com/).  Test keys work fine for testing purposes.\n\nEdit `base.php` on the server and make relevant adjustments.\n\nIn the same directory as `base.php`, create a file called `secrets.php` and fill in the bits of required information:\n\n```php\n\u003c?php\n\t// Stripe keys.\n\t$stripe_publickey = \"pk_...\";\n\t$stripe_secretkey = \"sk_...\";\n\n\t// Generate a secret key:  https://www.random.org/integers/?num=20\u0026min=0\u0026max=255\u0026col=10\u0026base=16\u0026format=plain\u0026rnd=new\n\t$buy_form_secretkey = \"...\";\n\n\t// Discord integration for the live chat option in the product support center.\n\t// Get a webhook URL and Discord Bot token by following the directions here:  https://github.com/cubiclesoft/php-discord-sdk\n\t$discord_webhook = false;\n\t$discord_bottoken = \"...\";\n\t$discord_channelid = \"...\";\n```\n\nAdjust the web server configuration to have unknown paths in the `/product-support/` path map to `/product-support/api.php` and let the server handle delivering content from `protected_html`.  Here are the expanded rules for [Nginx](https://nginx.org/) that `license-server-demo.cubiclesoft.com` uses:\n\n```\nserver {\n\tlisten 80;\n\tlisten [::]:80;\n\tlisten 443 ssl;\n\tlisten [::]:443 ssl;\n\tserver_name license-server-demo.cubiclesoft.com;\n\troot /var/www/license-server-demo.cubiclesoft.com/public_html;\n\n\tssl_certificate\t      /etc/letsencrypt/live/license-server-demo.cubiclesoft.com/fullchain.pem;\n\tssl_certificate_key   /etc/letsencrypt/live/license-server-demo.cubiclesoft.com/privkey.pem;\n\n\tssl_stapling on;\n\tssl_stapling_verify on;\n\n\tlocation = /favicon.ico {\n\t\tlog_not_found off;\n\t\taccess_log off;\n\t}\n\n\tlocation = /robots.txt {\n\t\tallow all;\n\t\tlog_not_found off;\n\t\taccess_log off;\n\t}\n\n\tlocation ~ /\\. {\n\t\tdeny all;\n\t\taccess_log off;\n\t\tlog_not_found off;\n\t}\n\n\tlocation ^~ /.well-known/ {\n\t\tallow all;\n\t}\n\n\n\t# Map product support center API paths.\n\tlocation /product-support/ {\n\t\ttry_files $uri $uri/ /product-support/api.php$is_args$args;\n\t}\n\n\t# Internal redirect to download files.\n\tlocation /protected/ {\n\t\tinternal;\n\t\talias /var/www/license-server-demo.cubiclesoft.com/protected_html/;\n\t}\n\n\t# Map 404 errors to 404.php.\n\terror_page 404 /404.php;\n\n\tlocation / {\n\t\ttry_files $uri $uri/ =404;\n\t}\n\n\n\t# Pass .php files onto a php-fpm/php-fcgi server.\n\tlocation ~ \\.php$ {\n\t\ttry_files $uri =404;\n\n\t\tfastcgi_split_path_info ^(.+\\.php)(/.+)$;\n\t\tinclude fastcgi_params;\n\t\tfastcgi_index index.php;\n\t\tfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n\t\tfastcgi_pass php;\n\t}\n}\n```\n\nSimilar configurations can be set up for Apache and other web servers (e.g IIS).\n\nFinally, create a `downloads` directory structure similar to:\n\n```\n/var/www/yourwebsite.com/protected_html/downloads/v1/\n```\n\nOnce ready, upload your binaries and an [info.json](https://github.com/cubiclesoft/license-server-demo/blob/master/license-server-demo.cubiclesoft.com/protected_html/downloads/v1/info.json) file containing information about the binaries.  The [Demo App](https://github.com/cubiclesoft/license-server-demo/tree/master/support/demo-app) has a tool in `proc/publish.php` that generates an appropriate JSON file for [PHP App Server](https://github.com/cubiclesoft/php-app-server) based applications.\n\nNote that this is just one possible implementation of an integration between a purchasing system and software licensing management.  The aim of this project is to be as simple as possible so that the software can be readily customized while also supporting the most important aspects of the purchasing lifecycle that both users and accountants expect.  As a software developer, you probably just want to get back to working on your software product.\n\nMore Information\n----------------\n\n* [PHP-based Software License Server](https://github.com/cubiclesoft/php-license-server) - High performance software licensing server.\n* [PHP App Server](https://github.com/cubiclesoft/php-app-server) - Build native applications for Windows, Mac OSX, and Linux with PHP, HTML, CSS, and Javascript.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubiclesoft%2Flicense-server-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcubiclesoft%2Flicense-server-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubiclesoft%2Flicense-server-demo/lists"}