Skip to content

Commit

Permalink
0.3.4
Browse files Browse the repository at this point in the history
 - Now you can easily build a .deb file for Debian installations.
 - Bug fixes & performance improvements.

Signed-off-by: Boudjada Yasser <by.root96@gmail.com>
  • Loading branch information
yasserbdj96 authored Jun 11, 2023
1 parent dd8abab commit a514d3f
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 10 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 0.3.3 [03-06-2023][Latest Release]:
## 0.3.4 [011-06-2023][Latest Release]:
- Now you can easily build a .deb file for Debian installations.
- Bug fixes & performance improvements.

## 0.3.3 [03-06-2023]:
- Remove unused code/packages.
- Enhance the code for improved stability.
- Update the commands in the input for the "hiphp-cli".
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# docker run --rm -p 127.0.0.1:8080:8080 -e DOCKER=True -e DST=True -i -t ghcr.io/yasserbdj96/hiphp:latest

#START{
FROM python:3.12.0b2
FROM python:3.11.3

# start install google-chrome:
# Download the Chrome Driver
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Security is a top priority for HIPHP, with regular updates ensuring compatibilit
- [Python Package Installation](#Python-Package-Installation)
- [Ubuntu/Nethunter Installation](#Ubuntu-Nethunter-Installation)
- [Termux Installation](#Termux-Installation)
- [Debian Build and Installation](#Debian-Build-and-Installation)
- [Run without installation](#Run-without-installation)
- [Run with hiphp-cli](#Run-with-hiphp-cli)
- [Help for hiphp-cli](#help-for-hiphp-cli)
Expand Down Expand Up @@ -326,6 +327,26 @@ Security is a top priority for HIPHP, with regular updates ensuring compatibilit
❯ bash install.sh -tu
```

<br>
<h4>Debian Build and Installation:</h4>

```bash
# Download hiphp from github:
❯ git clone https://github.com/yasserbdj96/hiphp.git
# OR
# Download hiphp from gitlab:
❯ git clone https://gitlab.com/yasserbdj96/hiphp.git

# Go to downloaded folder:
cd hiphp

# build .deb file:
❯ bash build_deb.sh

# Install:
❯ sudo dpkg -i hiphp-<VERSION>.deb
```

<br>
<h2>Run without installation:</h2>
<h4>Run with hiphp-cli:</h4>
Expand Down
72 changes: 72 additions & 0 deletions build_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/sh

appname="hiphp" # Replace with your app name
file_path="version.txt"
version=$(head -n 1 "$file_path")

script_path=$(dirname "$(readlink -f "$0")")

#version="2.0" # Replace with your app version

# Create a temporary directory to build the .deb package
tmp_dir="$(mktemp -d)"
deb_dir="$tmp_dir/$appname-$version"
mkdir -p "$deb_dir/DEBIAN"
mkdir -p "$deb_dir/usr/share/$appname"
mkdir -p "$deb_dir/usr/share/applications"
mkdir -p "$deb_dir/usr/local/bin"
mkdir -p "$deb_dir/usr/share/hiphp/hiphp/"
mkdir -p "$deb_dir/usr/share/hiphp/hiphp-desktop/"
mkdir -p "$deb_dir/usr/share/hiphp/hiphp-tk/"
mkdir -p "$deb_dir/usr/share/hiphp/hiphp-linux/"
mkdir -p "$deb_dir/usr/share/hiphp/install/"

# Copy necessary files and folders to the .deb package directory
cp -r ./hiphp/* "$deb_dir/usr/share/hiphp/hiphp/"
cp -r ./hiphp-desktop/* "$deb_dir/usr/share/hiphp/hiphp-desktop/"
cp -r ./hiphp-tk/* "$deb_dir/usr/share/hiphp/hiphp-tk/"
cp ./hiphp-linux/requirements-linux.txt "$deb_dir/usr/share/hiphp/hiphp-linux/"
cp ./main.py "$deb_dir/usr/share/hiphp/main.py"
cp -r ./install/* "$deb_dir/usr/share/hiphp/install/"
cp ./requirements.txt "$deb_dir/usr/share/hiphp/requirements.txt"

# Generate the control file for the .deb package
control_file="$deb_dir/DEBIAN/control"
echo "Package: $appname" > "$control_file"
echo "Version: $version" >> "$control_file"
echo "Architecture: all" >> "$control_file"
echo "Maintainer: Your Name <your@email.com>" >> "$control_file"
echo "Description: Your application description" >> "$control_file"

# Add post-installation script to install dependencies and perform additional operations
postinst_file="$deb_dir/DEBIAN/postinst"
echo "#!/bin/sh" > "$postinst_file"
echo "set -e" >> "$postinst_file"
echo "" >> "$postinst_file"
echo "mkdir -p /usr/share/$appname" >> "$postinst_file"
echo "# Perform additional operations" >> "$postinst_file"
echo "cp /usr/share/$appname/install/hiphp.desktop /usr/share/applications/$appname.desktop" >> "$postinst_file"
echo "cp /usr/share/$appname/install/hiphp.sh /usr/local/bin/$appname" >> "$postinst_file"
echo "cp /usr/share/$appname/main.py /usr/share/$appname/hiphp.py" >> "$postinst_file"
echo "cp /usr/share/$appname/install/$appname.png /usr/share/$appname/$appname.png" >> "$postinst_file"
echo "" >> "$postinst_file"
echo "# Install dependencies" >> "$postinst_file"
echo "pip install -r /usr/share/$appname/requirements.txt" >> "$postinst_file"
echo "pip install -r /usr/share/$appname/hiphp-linux/requirements-linux.txt" >> "$postinst_file"
echo "" >> "$postinst_file"
echo "exit 0" >> "$postinst_file"

# Make post-installation script executable
chmod +x "$postinst_file"

# Build the .deb package
cd "$tmp_dir"
deb_file="$appname-$version.deb"
dpkg-deb --build "$appname-$version"

cp "$appname-$version.deb" "$script_path"

# Clean up temporary files and directories
rm -rf "$tmp_dir"

echo "The .deb package has been created: $deb_file"
12 changes: 8 additions & 4 deletions hiphp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,15 +435,16 @@ def check_hiphp_in(url):
from_path = "."

out_path = hiphp.download(self, dirx, "")

editor(out_path)

hiphp.run(self, f"unlink('{dirx}');")

if from_path == "":
hiphp.upload(self, out_path)
else:
hiphp.upload(self, out_path, from_path + self.DS)

os.remove(out_path)

#os.system('cls' if os.name == 'nt' else 'clear')
Expand Down Expand Up @@ -589,7 +590,10 @@ def upload(self,path_to_upluad,to=""):
if to[0:2]!="."+self.DS:
p="."+self.DS
hiphp.run(self,"if(!file_exists('"+p+to+"')){mkdir('"+p+to+"',0777,true);}")
hiphp.run(self,f'Fwrite(fopen("{p+to+os.path.basename(path_to_upluad)}","w+"),base64_decode("{encoded_string}"));')
else:
pass
hiphp.run(self,f'file_put_contents("{p+to+os.path.basename(path_to_upluad)}", base64_decode("{encoded_string}"), FILE_APPEND | LOCK_EX);')
#hiphp.run(self,f'Fwrite(fopen("{p+to+os.path.basename(path_to_upluad)}","w+"),base64_decode("{encoded_string}"));')
except:
self.color2.c(f"{emsg_5} '{path_to_upluad}'.",self.c_red)

Expand Down
3 changes: 1 addition & 2 deletions hiphp/hiphpeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Link to the source code of this file: https://github.com/maksimKorzh/edit
# This code has been modified by: yasserbdj96 (https://github.com/yasserbdj96)

#START{
#START{
def editor(stdscr):
import curses, traceback
Expand Down Expand Up @@ -69,9 +70,7 @@ def editor(stdscr):
for l in b: cont += ''.join([chr(c) for c in l]) + '\n'
with open(src, 'w') as f:
f.write(cont)
#print(f"The '{src}', was edited successfully.")
xxvo=False

curses.endwin()
#editor("vvvv.py")
#curses.wrapper(main)
Expand Down
2 changes: 1 addition & 1 deletion hiphp/hiphpversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# | | #

#START{
__version__="0.3.3"
__version__="0.3.4"
#}END.
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.3
0.3.4

0 comments on commit a514d3f

Please sign in to comment.