summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-03-15 13:44:26 +0100
committerRemi Collet <remi@php.net>2024-03-15 13:44:26 +0100
commit2be4f79496ec05bc5143a28e3389c058154f9aaa (patch)
tree5a0a48713b154865ea8c37e66e58c569fc471be2
initial package
-rw-r--r--.gitignore10
-rw-r--r--Makefile7
-rw-r--r--PHPINFO4
-rw-r--r--REFLECTION19
-rw-r--r--encryption.php68
-rw-r--r--message.eml174
-rw-r--r--php-bolt.spec125
7 files changed, 407 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..24c42c7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
+clog
+package-*.xml
+*.tgz
+*.zip
+*.tar.bz2
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..fa44abb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,7 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../common/Makefile
+
+refl:
+ php -n -d extension=bolt.so --re bolt > REFLECTION
+ php -n -d extension=bolt.so --ri bolt > PHPINFO
diff --git a/PHPINFO b/PHPINFO
new file mode 100644
index 0000000..97c2573
--- /dev/null
+++ b/PHPINFO
@@ -0,0 +1,4 @@
+
+bolt
+
+bolt support => enabled
diff --git a/REFLECTION b/REFLECTION
new file mode 100644
index 0000000..7082c38
--- /dev/null
+++ b/REFLECTION
@@ -0,0 +1,19 @@
+Extension [ <persistent> extension #17 bolt version 0.1.3 ] {
+
+ - Functions {
+ Function [ <internal:bolt> function bolt_encrypt ] {
+
+ - Parameters [0] {
+ }
+ - Return [ void ]
+ }
+ Function [ <internal:bolt> function bolt_decrypt ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <optional> string $str = "" ]
+ }
+ - Return [ string ]
+ }
+ }
+}
+
diff --git a/encryption.php b/encryption.php
new file mode 100644
index 0000000..be9d18b
--- /dev/null
+++ b/encryption.php
@@ -0,0 +1,68 @@
+<?php
+
+/**
+ * src : source folder
+ * encrypted : Output folder
+ */
+
+$src = 'src/noti';
+$php_blot_key = "kyc7fh";
+
+
+/**
+ * No need to edit following code
+ */
+
+$excludes = array('vendor');
+
+foreach($excludes as $key => $file){
+ $excludes[ $key ] = $src.'/'.$file;
+}
+
+$rec = new RecursiveIteratorIterator(new RecursiveDirectoryIterator( $src ));
+$require_funcs = array('include_once', 'include', 'require', 'require_once');
+
+
+foreach ($rec as $file) {
+
+ if ($file->isDir()) {
+ $newDir = str_replace( 'src', 'encrypted', $file->getPath() );
+ if( !is_dir( $newDir ) ) mkdir( $newDir );
+ continue;
+ };
+
+ $filePath = $file->getPathname();
+
+ if( pathinfo($filePath, PATHINFO_EXTENSION) != 'php' ||
+ in_array( $filePath, $excludes ) ) {
+ $newFile = str_replace('src', 'encrypted', $filePath );
+ copy( $filePath, $newFile );
+ continue;
+ }
+
+ $contents = file_get_contents( $filePath );
+ $preppand = '<?php bolt_decrypt( __FILE__ , PHP_BOLT_KEY); return 0;
+ ##!!!##';
+ $re = '/\<\?php/m';
+ preg_match($re, $contents, $matches );
+ if(!empty($matches[0]) ){
+ $contents = preg_replace( $re, '', $contents );
+ ##!!!##';
+ }
+ /*$cipher = bolt_encrypt( "?> ".$contents, $php_blot_key );*/
+ $cipher = bolt_encrypt( $contents, $php_blot_key );
+ $newFile = str_replace('src', 'encrypted', $filePath );
+ $fp = fopen( $newFile, 'w');
+ fwrite($fp, $preppand.$cipher);
+ fclose($fp);
+
+ unset( $cipher );
+ unset( $contents );
+}
+
+$out_str = substr_replace($src, '', 0, 4);
+$file_location = __DIR__."/encrypted/".$out_str;
+echo "Successfully Encrypted... Please check in <b>" .$file_location."</a></b> folder.";
+
+
+
diff --git a/message.eml b/message.eml
new file mode 100644
index 0000000..6e23799
--- /dev/null
+++ b/message.eml
@@ -0,0 +1,174 @@
+X-Account-Key: account24
+X-UIDL: 1466360393.57367
+X-Mozilla-Status: 0013
+X-Mozilla-Status2: 00000000
+X-Mozilla-Keys:
+Return-Path: <srs0=69xb=kv=gmail.com=arshidkv12@redirect.mail.gandi.net>
+Received: from opme11d1d03aub.bagnolet.francetelecom.fr ([10.79.3.106])
+ by opme11d1b58aub.bagnolet.francetelecom.fr with LMTP
+ id oIsTKqft82XmIQAA1a2c2A:T9892:P1:P1
+ (envelope-from <srs0=69xb=kv=gmail.com=arshidkv12@redirect.mail.gandi.net>); Fri, 15 Mar 2024 12:21:44 +0100
+Received: from opme11ppr03aub.idf.fr.intraorange ([10.79.3.106])
+ by opme11d1d03aub.bagnolet.francetelecom.fr with LMTP
+ id oIsTKqft82XmIQAA1a2c2A:T9892:P1
+ (envelope-from <srs0=69xb=kv=gmail.com=arshidkv12@redirect.mail.gandi.net>)
+ for <MELOFR-200-iAFSQGTAj8/EVcwCa4QkTyRlgjYh0l4vvak7Pwppptw=>; Fri, 15 Mar 2024 12:21:44 +0100
+Received: from opmta1mti26nd1 ([10.79.3.106])
+ by opme11ppr03aub.idf.fr.intraorange with LMTP
+ id oIsTKqft82XmIQAA1a2c2A:T9892
+ (envelope-from <srs0=69xb=kv=gmail.com=arshidkv12@redirect.mail.gandi.net>)
+ for <collet_remi@orange.fr>; Fri, 15 Mar 2024 12:21:44 +0100
+Received: from redirect.mail.gandi.net ([217.70.178.230])
+ by smtp.orange.fr with ESMTPS
+ id l5dArRyUGGoqZl5dAr7GMr; Fri, 15 Mar 2024 12:21:44 +0100
+X-bcc: collet_remi@orange.fr
+X-ME-bounce-domain: orange.fr
+X-ME-engine: default
+X-me-spamcause: (0)(0000)gggruggvucftvghtrhhoucdtuddrgedvledrjeelgddviecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfogfdpggftiffpkfenuceurghilhhouhhtmecuhedttdenucenucfjughrpeggfhgjhfffkffuvfgtsegrtderredttdejnecuhfhrohhmpefouhhhrghmmhgvugcutehrshhhihguucfmggcuoegrrhhshhhiughkvhduvdesghhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepfefgkeeltdejfedvgedutdevgfduleeghfeguedtledugeeigfdvhfetkefhffeknecuffhomhgrihhnpehrvghmihhrvghpohdrnhgvthdpphhhphgsohhlthdrtghomhenucfkphepvddujedrjedtrddujeekrddvfedtpddviedtjeemfheksgdtmeegkeeigeemvddtmeemudduvdgsnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheprhgvughirhgvtghtrdhmrghilhdrghgrnhguihdrnhgvthdpihhnvghtpedvudejrdejtddrudejkedrvdeftddpmhgrihhlfhhrohhmpehsrhhstdepieelgigspehkvhepghhmrghilhdrtghomheprghrshhhihgukhhvuddvsehrvgguihhrvggtthdrmhgrihhlrdhgrghnughirdhnvghtpdhnsggprhgtphhtthhopedupdhrtghpthhtoheptgholhhlvghtpghrvghmihesohhrrghnghgvrdhfrh
+X-me-spamlevel: not-spam
+ARC-Seal: i=1; a=rsa-sha256; d=orange.fr; s=t20230301; t=1710501704; cv=none;
+ b=HnYTqcblo4u4XX4LfjV/tisc1/1hDMjU9IbPrOTsWcdLZ/gI9a43NfAVm0wSvICHxPSVuYPsWUrGeQhUy/qGuS7N9ZRnpo2YJA5szKKTW1HHcxi3Tha5ty2teMpWd+4Lf5UCyNyBcRZhvCY/wiiD6uc4ZxmmA+EUycyctI09AsgtqP8b5RlQphq40I09FWCILylvrK9DlWc4B242X+QX+GSRFyG0nMxI8UzZAFgO/HcDbI9bpFWrZKuqriNuI41gA32s4hAw00rq1S7qe9/Eaq85FZ2jUZxxurFi2uh9L3MWRXQXN7bATCs0dDPXw6cGkHTeO8ItDdRmG99y9/Vgaw==
+ARC-Message-Signature: i=1; a=rsa-sha256; d=orange.fr; s=t20230301;
+ t=1710501704; c=relaxed/simple;
+ bh=Thj1Lp+Sj/kno6Z8cgZLVfeLJjFPKPnKqDHqQBMnfGA=; h=From:Subject:To;
+ b=tBw34Q/xdFzo6aGNS6OyZxvSaIajyGGng7P42XTy2julZWCS4OD8msooIz155bGAwzqrKLwgBAKVJSunjuOnJ4wcL9y6R1ao8MMoVw2D9UJSE0nW96o4/7jALd6S7ND8BaiLr03qJIcFsRjnhW7ZyhiZHM3TLHy4rnHGoB9rhlaNRR0PMNO1DpjHbHcVKKQ1zpxvtO/gqW48hHnaWYSRxFkmBMkcGuRUftXhIbso+Oe98r2i4jKWn4nvSktaUpVDS1/ck2D7/0gzxM4hudd+i7TQVg9NZjrSFIe3mTDSXNIHBf/fYCoCYVvKMhwtjDpAIAPIi76q8Y0NbZy8zrTmjg==
+ARC-Authentication-Results: i=1; opmta1mti26nd1; spf=pass (opmta1mti26nd1: domain of srs0=69xb=kv=gmail.com=arshidkv12@redirect.mail.gandi.net designates 217.70.178.230 as permited sender) smtp.mailfrom=srs0=69xb=kv=gmail.com=arshidkv12@redirect.mail.gandi.net;
+ arc=none;
+ dkim=pass header.d=gmail.com header.b=EeyNa4u9;
+ dmarc=pass header.from=gmail.com
+X-ME-Helo: redirect.mail.gandi.net
+X-ME-IP: 217.70.178.230
+Authentication-Results: opmta1mti26nd1;
+ arc=none;
+ dkim=pass header.d=gmail.com header.b=EeyNa4u9
+X-ME-Entity: ofr
+Received: from spool.mail.gandi.net (spool1.mail.gandi.net [217.70.178.210])
+ by relay10.mail.gandi.net (Postfix) with ESMTPS id 918D1240003
+ for <collet_remi@orange.fr>; Fri, 15 Mar 2024 11:21:44 +0000 (UTC)
+Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b])
+ by spool.mail.gandi.net (Postfix) with ESMTPS id 9CE039417AA
+ for <remi@famillecollet.com>; Fri, 15 Mar 2024 11:21:43 +0000 (UTC)
+Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-60a5a11b59dso21690787b3.0
+ for <remi@famillecollet.com>; Fri, 15 Mar 2024 04:21:43 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+ d=gmail.com; s=20230601; t=1710501702; x=1711106502; darn=famillecollet.com;
+ h=to:subject:message-id:date:from:in-reply-to:references:mime-version
+ :from:to:cc:subject:date:message-id:reply-to;
+ bh=Thj1Lp+Sj/kno6Z8cgZLVfeLJjFPKPnKqDHqQBMnfGA=;
+ b=EeyNa4u9cr6jdOu+Blqt+dxw461viZmtWmJEXi26ifkJ7iflCwPB3mRY+tXH0J/rmA
+ x4DnLzXL+UcxG2OsbWsLyPHQ4nmlOUNHnFlQQlUFm5No3ni76dJEEaLrrq7RWbkO3Pmc
+ XKWMJsZr/OupLfZ7pv7PHvOVcrOjyhn77ShSwr6vmR1KlsGAQPisqoO9u5YagAYLvMN8
+ i58piu4DFG1EbxRDos/htMoV+y7efTKHdL7P3ElYIi1CLU8dUQQn+x4ke3wPVMOq8z5I
+ dln6vJnYt1vr2hqY8g2O1phsS4o/QR2cnBf7q6ITs+7OnDCrvm3O1tJN7XveeNzQIpe8
+ 6o5A==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+ d=1e100.net; s=20230601; t=1710501702; x=1711106502;
+ h=to:subject:message-id:date:from:in-reply-to:references:mime-version
+ :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
+ bh=Thj1Lp+Sj/kno6Z8cgZLVfeLJjFPKPnKqDHqQBMnfGA=;
+ b=RuSzbGW7UGbXqkpQ9aqiYWxkjTY4xMf4ZOVCUn+qFdAjo2isynKksJxVn6xXTfRDYp
+ MHRUo1uumeaNAfV6DWbPjEdlJZbTw8bDMn9qeTcJDJ67Gt1egABdFppw31QOBUuUzkZw
+ hE61Aa05zntbc0w7KyRaieO1rjJMAq7PceW4a30HJqEJ5vzQQubE6DPAIduaKiEkFnd5
+ TuSakxAQlyHMDrrfSzjLKFRza1RIqyETL6II0T7a4tpsQb+S0yvUl+CZLJUMyF0e+XLz
+ ivFSSagcSABaNfn4Ynv0HwENWeRNOjoJxYXahgCogUy3NMIJJtsCJ8oUHKnzAnblq2WY
+ xqSA==
+X-Gm-Message-State: AOJu0YxfG/Eh5F/+CbzTdXukBGk74EbtzR+lOt1dIxms9EeNkuFholWv
+ G8DEwx9p076pHl5lg5RRfHNl22CO4jetbYoTGRXzKHQcIeVeCpOPMdGLjifsrCzxhsEDf4myxb9
+ Ly8Wrbt26P9xaF1h8ELSGxIvBi3qUs3Gq
+X-Google-Smtp-Source: AGHT+IFbDhMEtV1AwDETpOlungsMFijxA33U4dWMVu6x/3/QgnBMGSrGXSNiPaGkHBO9QTcoi/SGOkfOj4+c5u/lFfQ=
+X-Received: by 2002:a5b:b85:0:b0:dc6:7e7b:4797 with SMTP id
+ l5-20020a5b0b85000000b00dc67e7b4797mr1939334ybq.4.1710501702229; Fri, 15 Mar
+ 2024 04:21:42 -0700 (PDT)
+MIME-Version: 1.0
+References: <rL6cj7RxlJBXYjU1nvKCnniys1rQ0WRlTE9vM7szU@phpbolt.com>
+In-Reply-To: <rL6cj7RxlJBXYjU1nvKCnniys1rQ0WRlTE9vM7szU@phpbolt.com>
+From: Muhammed Arshid KV <arshidkv12@gmail.com>
+Date: Fri, 15 Mar 2024 16:51:30 +0530
+Message-ID: <CAO3bawnh+zaVOtKBOoRSQbv7F6sSmSffrjXJ1qsdjw5rizheTQ@mail.gmail.com>
+Subject: Re: phpBolt "Extension License"
+To: remi@famillecollet.com
+Content-Type: multipart/alternative; boundary="0000000000005967a40613b1363a"
+Authentication-Results: spool.mail.gandi.net;
+ dmarc=pass (policy=none) header.from=gmail.com;
+ spf=pass (spool.mail.gandi.net: domain of arshidkv12@gmail.com designates 2607:f8b0:4864:20::112b as permitted sender) smtp.mailfrom=arshidkv12@gmail.com
+
+--0000000000005967a40613b1363a
+Content-Type: text/plain; charset="UTF-8"
+Content-Transfer-Encoding: quoted-printable
+
+You can redistribute.
+
+On Fri, 15 Mar 2024, 12:58=E2=80=AFpm phpBolt, <support@phpbolt.com> wrote:
+
+> From: Remi Collet <remi@famillecollet.com>
+> Subject: Extension License
+>
+> Message Body:
+> Hi,
+>
+> I'm the RPM repository maintainer of https://rpms.remirepo.net/
+> commonly used by RHEL/CentOS/Alma/Rocky/Fedora users
+> for alternative PHP streams (more versions, more extensions)
+>
+> Some user ask me to provide bolt extension as RPM
+>
+> BTW there is no license file, so no way to understand if this extension
+> can be redistributed.
+>
+> I also don't see any way to monitor new version, and having to fill a for=
+m
+> for each download or to check for new version is real pain.
+>
+> Please clarify License, and tell me is you are interested in such
+> redistribution.
+>
+> Remi
+>
+> --
+> This e-mail was sent from a contact form on phpBolt (https://phpbolt.com)
+>
+>
+
+--0000000000005967a40613b1363a
+Content-Type: text/html; charset="UTF-8"
+Content-Transfer-Encoding: quoted-printable
+
+<div dir=3D"auto"><div>You can redistribute.=C2=A0<br><br><div class=3D"gma=
+il_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, 15 Mar 2024, 12:58=
+=E2=80=AFpm phpBolt, &lt;<a href=3D"mailto:support@phpbolt.com">support@php=
+bolt.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
+"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Remi =
+Collet &lt;<a href=3D"mailto:remi@famillecollet.com" target=3D"_blank" rel=
+=3D"noreferrer">remi@famillecollet.com</a>&gt;<br>
+Subject: Extension License<br>
+<br>
+Message Body:<br>
+Hi,<br>
+<br>
+I&#39;m the RPM repository maintainer of <a href=3D"https://rpms.remirepo.n=
+et/" rel=3D"noreferrer noreferrer" target=3D"_blank">https://rpms.remirepo.=
+net/</a><br>
+commonly used by RHEL/CentOS/Alma/Rocky/Fedora users<br>
+for alternative PHP streams (more versions, more extensions)<br>
+<br>
+Some user ask me to provide bolt extension as RPM<br>
+<br>
+BTW there is no license file, so no way to understand if this extension<br>
+can be redistributed.<br>
+<br>
+I also don&#39;t see any way to monitor new version, and having to fill a f=
+orm for each download or to check for new version is real pain.<br>
+<br>
+Please clarify License, and tell me is you are interested in such redistrib=
+ution.<br>
+<br>
+Remi<br>
+<br>
+-- <br>
+This e-mail was sent from a contact form on phpBolt (<a href=3D"https://php=
+bolt.com" rel=3D"noreferrer noreferrer" target=3D"_blank">https://phpbolt.c=
+om</a>)<br>
+<br>
+</blockquote></div></div></div>
+
+--0000000000005967a40613b1363a--
diff --git a/php-bolt.spec b/php-bolt.spec
new file mode 100644
index 0000000..ef93303
--- /dev/null
+++ b/php-bolt.spec
@@ -0,0 +1,125 @@
+# remirepo spec file for php-bolt
+#
+# Copyright (c) 2024 Remi Collet
+# License: CC-BY-SA-4.0
+# http://creativecommons.org/licenses/by-sa/4.0/
+#
+# Please, preserve the changelog entries
+#
+%{?scl:%scl_package php-bolt}
+
+%global extname bolt
+%global debug_package %{nil}
+%global __debug_install_post /bin/true
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+%global _build_id_links none
+%endif
+%global with_zts 0
+%global ininame 40-%{extname}.ini
+
+Name: %{?scl_prefix}php-bolt
+Summary: Protect PHP Source Code
+Version: 1.0.4
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+License: Distribuable
+
+URL: https://phpbolt.com/
+# see https://phpbolt.com/download-phpbolt/
+Source0: https://phpbolt.com/wp-content/uploads/2023/03/phpBolt-extension-%{version}.zip
+Source1: https://raw.githubusercontent.com/arshidkv12/phpBolt/master/encryption.php
+# Message from upstream: "You can redistribute"
+Source2: message.eml
+
+ExclusiveArch: x86_64
+BuildRequires: %{?scl_prefix}php-devel >= 7.0
+BuildRequires: %{?scl_prefix}php-devel < 8.3
+
+# ABI check
+Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
+Requires: %{?scl_prefix}php(api) = %{php_core_api}
+
+
+
+%description
+Protect PHP Source Code
+
+* Encrypt and decrypt php source code.
+* Ensure only licensed people are using.
+* Free for small and medium companies.
+* Encode and run PHP files.
+* Ioncube alternative (free)
+
+Encode php source code from your php server. No need any additianal installation.
+
+Package built for PHP %(%{__php} -n -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}.
+
+
+%prep
+%setup -q -c
+
+cp %{SOURCE1} .
+cp %{SOURCE2} .
+
+cat << 'EOF' | tee %{ininame}
+; Enable "%{SUMMARY}" extension module
+zend_extension = %{extname}.so
+EOF
+
+
+%build
+: Nothing to build as tarball provides binaries
+
+
+%install
+: configuration file
+install -D -m 644 %{ininame} %{buildroot}%{php_inidir}/%{ininame}
+
+: PHP extension
+ver=$(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')
+cd phpBolt-extension-%{version}/linux*64/*$ver
+
+if [ -f %{extname}.so ]; then
+
+ install -D -pm 755 %{extname}.so %{buildroot}%{php_extdir}/%{extname}.so
+
+else
+ : Module for PHP $ver not provided
+ exit 1
+fi
+
+
+%check
+: simple NTS module load test
+%{__php} --no-php-ini \
+ --define extension=%{buildroot}%{php_extdir}/%{extname}.so \
+ --ri %{extname}
+
+%{__php} --no-php-ini \
+ --define extension=%{buildroot}%{php_extdir}/%{extname}.so \
+ --modules | grep -E '^[Bb]olt$'
+
+%if %{with_zts}
+: simple ZTS module load test
+%{__ztsphp} --no-php-ini \
+ --define extension=%{buildroot}%{php_ztsextdir}/%{extname}.so \
+ --modules | grep -E '^[Bb]olt$'
+%endif
+
+
+%files
+%{!?_licensedir:%global license %%doc}
+%license message.eml
+%doc encryption.php
+
+%config(noreplace) %{php_inidir}/%{ininame}
+%{php_extdir}/%{extname}.so
+
+%if %{with_zts}
+%config(noreplace) %{php_ztsinidir}/%{ininame}
+%{php_ztsextdir}/%{extname}.so
+%endif
+
+
+%changelog
+* Fri Mar 15 2024 Remi Collet <remi@remirepo.net> - 1.0.4-1
+- initial package