Skip to content

Commit

Permalink
0.3.6
Browse files Browse the repository at this point in the history
## 0.3.6 [14-09-2023][Beta]:
 - Make connections work better with proxies for hiphp-cli only.
 - Fix command line errors on Windows.
 - Solve errors on Windows related to TK.
 - Make downloads in the DST feature work correctly.
 - Make it easier to browse files in DST on Windows.
 - Make DST icons look and work better on Windows.
 - Make the DST feature look and work better.
 - Add new commands (--y,--proxies).
 - Improve messages to help users understand better.
 - Bug fixes & performance improvements.
  • Loading branch information
yasserbdj96 committed Sep 14, 2023
1 parent edf10b3 commit 0f170e4
Show file tree
Hide file tree
Showing 23 changed files with 397 additions and 130 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
13 changes: 10 additions & 3 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
## 0.3.6 [03-09-2023][Beta]:
- Fix errors in the Windows os.
- Revise assistance messages.
## 0.3.6 [14-09-2023][Beta]:
- Make connections work better with proxies for hiphp-cli only.
- Fix command line errors on Windows.
- Solve errors on Windows related to TK.
- Make downloads in the DST feature work correctly.
- Make it easier to browse files in DST on Windows.
- Make DST icons look and work better on Windows.
- Make the DST feature look and work better.
- Add new commands (--y,--proxies).
- Improve messages to help users understand better.
- Bug fixes & performance improvements.

## 0.3.5 [12-06-2023][Latest Release]:
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# docker build -t hiphp:latest .
# Run as CLI:
# docker run -e KEY="<KEY>" -e URL="<URL>" -i -t hiphp:latest
# Run as CLI with PROXIES:
# docker run -e KEY="<KEY>" -e URL="<URL>" -e PROXIES="<FILE_PATH/{'http/https':'IP:port'}>" -i -t hiphp:latest
# Run as GUI:
# docker run --rm -p 127.0.0.1:8080:8080 -e DOCKER=True -e DST=True -i -t hiphp:latest

Expand All @@ -23,6 +25,8 @@
# docker build -t docker.io/yasserbdj96/hiphp:latest .
# Run as CLI:
# docker run -e KEY="<KEY>" -e URL="<URL>" -i -t docker.io/yasserbdj96/hiphp:latest
# Run as CLI with PROXIES:
# docker run -e KEY="<KEY>" -e URL="<URL>" -e PROXIES="<FILE_PATH/{'http/https':'IP:port'}>" -i -t docker.io/yasserbdj96/hiphp:latest
# Run as GUI:
# docker run --rm -p 127.0.0.1:8080:8080 -e DOCKER=True -e DST=True -i -t docker.io/yasserbdj96/hiphp:latest

Expand All @@ -31,6 +35,8 @@
# docker build -t ghcr.io/yasserbdj96/hiphp:latest .
# Run as CLI:
# docker run -e KEY="<KEY>" -e URL="<URL>" -i -t ghcr.io/yasserbdj96/hiphp:latest
# Run as CLI with PROXIES:
# docker run -e KEY="<KEY>" -e URL="<URL>" -e PROXIES="<FILE_PATH/{'http/https':'IP:port'}>" -i -t ghcr.io/yasserbdj96/hiphp:latest
# Run as GUI:
# docker run --rm -p 127.0.0.1:8080:8080 -e DOCKER=True -e DST=True -i -t ghcr.io/yasserbdj96/hiphp:latest

Expand Down
30 changes: 27 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ ifeq ($(detected_OS),Linux)#Darwin for Mac OS X
pipforos = $(PIP) install -r ./hiphp-linux/requirements-linux.txt
endif

# The rest of your Makefile remains unchanged

clean:
rm -rf hiphp/__pycache__
rm -rf $(VENV)

mrproper: clean
rm -rf *.log

#
ifeq ($(filter-out $(MAKECMDGOALS),run),)
ARGUMENTS := $(filter-out $@,$(MAKECMDGOALS))
Expand All @@ -48,6 +57,11 @@ ifeq ($(strip $(KEY)),)
KEY := $(shell echo $(ARGUMENTS) | sed -n 's/.*\(--KEY\)[= ]\+\([^ ]\+\).*/\2/p')
endif

PROXIES := $(shell echo $(ARGUMENTS) | sed -n 's/.*\(--proxies\)[= ]\+\([^ ]\+\).*/\2/p')
ifeq ($(strip $(PROXIES)),)
PROXIES := $(shell echo $(ARGUMENTS) | sed -n 's/.*\(--PROXIES\)[= ]\+\([^ ]\+\).*/\2/p')
endif

ifeq ($(filter --TK,$(ARGUMENTS)),--TK)
ifeq ($(strip $(URL)$(KEY)),)
RUN = $(PYTHON) main.py --TK
Expand All @@ -67,8 +81,18 @@ else ifeq ($(filter --DST,$(ARGUMENTS)),--DST)
else
ifeq ($(strip $(URL)$(KEY)),)
$(error URL and KEY are both empty)
else ifeq ($(filter --Y,$(ARGUMENTS)),--Y)
# ifeq ($(strip $(PROXIES)),)
RUN = $(PYTHON) main.py --KEY=$(KEY) --URL=$(URL) --Y
# else
# RUN = $(PYTHON) main.py --KEY=$(KEY) --URL=$(URL) --Y PROXIES=$(PROXIES)
# endif
else
# ifeq ($(strip $(PROXIES)),)
RUN = $(PYTHON) main.py --KEY=$(KEY) --URL=$(URL)
# else
# RUN = $(PYTHON) main.py --KEY=$(KEY) --URL=$(URL) PROXIES="$(PROXIES)"
# endif
endif
endif

Expand All @@ -80,7 +104,7 @@ $(VENV)/bin/activate: requirements.txt
$(PIP) install -r ./requirements.txt
$(pipforos)

clean:
rm -rf hiphp/__pycache__
rm -rf $(VENV)
#clean:
# rm -rf hiphp/__pycache__
# rm -rf $(VENV)
#}END.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Security is a top priority for HIPHP, with regular updates ensuring compatibilit
<h2>How do you use this version of the project?</h2>
[] Command Line Interface (CLI).<br>
[] Graphical User Interface (GUI).<br>
[] Web Application.<br>
[] Python Package.<br>
[] Script.<br>
[] Docker Container.
Expand Down Expand Up @@ -170,6 +171,9 @@ Security is a top priority for HIPHP, with regular updates ensuring compatibilit
# Run as CLI:
❯ docker run -e KEY="<KEY*>" -e URL="<URL*>" -i -t hiphp:latest

# Run as CLI with PROXIES:
❯ docker run -e KEY="<KEY>" -e URL="<URL>" -e PROXIES="<FILE_PATH/{'http/https':'IP:port'}>" -i -t hiphp:latest

# Run as GUI:
❯ docker run --rm -p 127.0.0.1:8080:8080 -e DOCKER=True -e DST=True -i -t hiphp:latest
# Open your web browser and navigate to http://127.0.0.1:8080 to see the default landing page.
Expand All @@ -194,6 +198,9 @@ Security is a top priority for HIPHP, with regular updates ensuring compatibilit
# Run as CLI:
❯ docker run -e KEY="<KEY*>" -e URL="<URL*>" -i -t docker.io/yasserbdj96/hiphp:latest

# Run as CLI with PROXIES:
❯ docker run -e KEY="<KEY>" -e URL="<URL>" -e PROXIES="<FILE_PATH/{'http/https':'IP:port'}>" -i -t docker.io/yasserbdj96/hiphp:latest

# Run as GUI:
❯ docker run --rm -p 127.0.0.1:8080:8080 -e DOCKER=True -e DST=True -i -t docker.io/yasserbdj96/hiphp:latest
# Open your web browser and navigate to http://127.0.0.1:8080 to see the default landing page.
Expand All @@ -218,6 +225,9 @@ Security is a top priority for HIPHP, with regular updates ensuring compatibilit
# Run as CLI:
❯ docker run -e KEY="<KEY*>" -e URL="<URL*>" -i -t ghcr.io/yasserbdj96/hiphp:latest

# Run as CLI with PROXIES:
❯ docker run -e KEY="<KEY>" -e URL="<URL>" -e PROXIES="<FILE_PATH/{'http/https':'IP:port'}>" -i -t ghcr.io/yasserbdj96/hiphp:latest

# Run as GUI:
❯ docker run --rm -p 127.0.0.1:8080:8080 -e DOCKER=True -e DST=True -i -t ghcr.io/yasserbdj96/hiphp:latest
# Open your web browser and navigate to http://127.0.0.1:8080 to see the default landing page.
Expand Down Expand Up @@ -377,14 +387,14 @@ Security is a top priority for HIPHP, with regular updates ensuring compatibilit

# For linux:
cd hiphp-linux
❯ bash hiphp-cli.sh --KEY="<KEY*>" --URL="<URL*>"
❯ bash hiphp-cli.sh --KEY="<KEY*>" --URL="<URL*>" --PROXIES="<FILE_PATH/{'http/https':'IP:port'}>" --Y

# For Windows:
# Do not forget to modify the "config.ini" file or use the following command:
# > python -c "import sys; open('config.ini','w+').write('python_default_path='+sys.executable)"
# OR Run 'hiphp-win\config-configure.py'.
cd hiphp-win
❯ hiphp-cli.bat --KEY="<KEY*>" --URL="<URL*>"
❯ hiphp-cli.bat --KEY="<KEY*>" --URL="<URL*>" --PROXIES="<FILE_PATH/{'http/https':'IP:port'}>" --Y

```

Expand Down
33 changes: 30 additions & 3 deletions hiphp-desktop/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,48 +77,58 @@ def ls(key,url):
@eel.expose
def cat(key,url,path):
p1=hiphp(key,url,retu=True)
path = path.replace('\\', '\\\\')
#print(path)
return p1.run(php_cat(path))

#save:
@eel.expose
def save(key,url,path,content):
p1=hiphp(key,url,retu=True)
path = path.replace('\\', '\\\\')
return p1.run(php_save(path,content))

#delete:
@eel.expose
def delte(key,url,path):
p1=hiphp(key,url,retu=True)
path = path.replace('\\', '\\\\')
return p1.run(php_delte(path))

#info:
@eel.expose
def info(key,url,path):
p1=hiphp(key,url,retu=True)
path = path.replace('\\', '\\\\')
return p1.run(php_file_info(path))

#rename:
@eel.expose
def ren(key,url,path,newname):
p1=hiphp(key,url,retu=True)
path = path.replace('\\', '\\\\')
return p1.run(php_ren(path,newname))

#add:
@eel.expose
def add_new(key,url,path):
p1=hiphp(key,url,retu=True)
path = path.replace('\\', '\\\\')
print(path)
return p1.run(php_add(path))

#permissions:
@eel.expose
def new_permi(key,url,path,permi):
p1=hiphp(key,url,retu=True)
path = path.replace('\\', '\\\\')
return p1.run(php_permi(path,permi))

#down_from_path:
@eel.expose
def download_file(key,url,path):
p1=hiphp(key,url,retu=True)
path = path.replace('\\', '\\\\')
return p1.run(down_from_path(path))

#darkmode:
Expand All @@ -137,6 +147,22 @@ def darkmode():
f.truncate()
return how

#pwa:
@eel.expose
def pwa_check():
thispath=os.path.dirname(os.path.abspath(__file__))
with open(f'{thispath}/src/config.json', 'r+') as f:
data = json.load(f)
if data['PWA']=="True":
data['PWA']="False"
else:
data['PWA']="True"
how=data['PWA']
f.seek(0) # <--- should reset file position to the beginning.
json.dump(data, f, indent=4)
f.truncate()
return how

#iswork:
@eel.expose
def iswork():
Expand All @@ -149,15 +175,15 @@ def iswork():
parser.add_argument('--DOCKER', '--docker', dest='DOCKER', action='store_true', default=bool(os.getenv('DOCKER', False)), help='Enable Docker usage for the operation.')
parser.add_argument('--IPYNB', '--ipynb', dest='IPYNB', action='store_true', default=bool(os.getenv('IPYNB', False)), help='Enable Jupyter Notebook for the operation.')
parser.add_argument('--TOKEN', '--token', dest='TOKEN', type=str, default=os.getenv('TOKEN', ''), help='Specify the Ngrok token.')

#parser.add_argument('--PROXIES', '--proxies', dest='PROXIES', type=str, default=os.getenv('PROXIES', ''), help='')
# Parse the command-line arguments
args = parser.parse_args()

# Access the variables by their names
DOCKER=args.DOCKER
IPYNB=args.IPYNB
TOKEN=args.TOKEN

#PROXIES=args.PROXIES

if IPYNB:
host_ip="127.0.0.1"
Expand All @@ -178,7 +204,8 @@ def iswork():
if run_type=="docker":
import socket
ip_address = socket.gethostbyname(socket.gethostname())
print(f"Listening on {ip_address}:{host_port}")
print(f"Listening on : {ip_address}:{host_port}")
print("Forwarding : 127.0.0.1:8080")

#
#eel.start("index.html",host=host_ip,port=host_port,size=(1050,500))
Expand Down
3 changes: 2 additions & 1 deletion hiphp-desktop/src/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"Dark Mode": "True"
"Dark Mode": "True",
"PWA": "False"
}
3 changes: 3 additions & 0 deletions hiphp-desktop/src/include.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ function include(){
/**/
if(arguments[1]=="js"){
var fileref=document.createElement('script');
var js=arguments[0].split(".js")[0];
js=js.split("/");
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src",arguments[0]);
fileref.setAttribute("id",js[js.length-1]);
document.getElementsByTagName("head")[0].appendChild(fileref);
}else if(arguments[1]=="css"){
var fileref=document.createElement("link");
Expand Down
19 changes: 11 additions & 8 deletions hiphp-desktop/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<link rel="icon" href="./favicon.ico">
<link rel="apple-touch-icon" href="./favicon.ico">
<link rel="stylesheet" type="text/css" href="./font-awesome/font-awesome.min.css" />
<script src="./index.js" defer></script>
<!--script src="./index.js" defer></script-->
<link rel="manifest" href="./manifest.webmanifest">
<meta name="theme-color" content="#474b85" />
</head>
Expand All @@ -41,9 +41,9 @@
<spam style="float:right" class="pointer padding_11 w15 text_center" onclick="settings()"><i class="fa fa-cogs"></i></spam>
<spam style="float:right" class="pointer padding_11 w15 text_center" onclick="connect()"><i class="fa fa-undo"></i></spam>
<spam style="float:right" class="pointer padding_11 w15 text_center" onclick="alert('soon');"><i class="fa fa-terminal"></i></spam>
<spam style="float:right" class="pointer padding_11 w15 text_center" onclick="get_selected('delete')"><i class="fa fa-trash-o"></i></spam>
<spam id="delete" style="float:right" class="pointer padding_11 w15 text_center" onclick="get_selected('delete')"><i class="fa fa-trash-o"></i></spam>
<spam id="up" style="float:right" class="pointer padding_11 w15 text_center" onclick="alert('soon');"><i class="fa fa-upload"></i></spam>
<spam style="float:right" class="pointer padding_11 w15 text_center" onclick="get_selected('download')"><i class="fa fa-download"></i></spam>
<spam id="download" style="float:right" class="pointer padding_11 w15 text_center" onclick="get_selected('download')"><i class="fa fa-download"></i></spam>
<spam id="add" style="float:right" class="pointer padding_11 w15 text_center" onclick="add()"><i class="fa fa-plus"></i></spam>

<!--ls-->
Expand All @@ -70,10 +70,13 @@
<td><div class="tc"><input id="darkmode" type="checkbox" onclick="darkmode_check()" onchange="" /><span></span></div></td>
</tr>
<tr>
<td>Active PWA</td>
<td><div class="tc"><input id="a_pwa" type="checkbox" onclick="pwa_check()" /><span></span></div></td>
</tr>
<!--tr>
<td>Install PWA</td>
<!--div class="download_pwa"><button class="button">install</button></div-->
<td><div class="tc"><input type="checkbox" class="download_pwa"/><span></span></div></td>
</tr>
</tr-->
<!--tr>
<td>Option 2</td>
<td><div class="tc"><input type="checkbox" onclick="pwa_uninstall()"/><span></span></div></td>
Expand All @@ -94,8 +97,8 @@
</div>

<div class="form__group field">
<input type="password" class="form__field" placeholder="password" name="password" id='key' required />
<label for="password" class="form__label">Password</label>
<input type="password" class="form__field" placeholder="password" name="key" id='key' required />
<label for="key" class="form__label">Password</label>
</div>
</center>
<br>
Expand All @@ -107,7 +110,7 @@
</div>

<div id="notwork">
<button onclick="location.reload();" class="button"><i class="fa fa-refresh"></i> Refresh</button>
<button onclick="location.reload();" class="button"><i class="fa fa-refresh" style="margin-top: 10px;"></i> hiphp-DST is not running :(</button>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion hiphp-desktop/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if (download_pwa.length > 0){
let deferredPrompt;
const addBtn = document.querySelector('.download_pwa');
//addBtn.style.display = 'none';
addBtn.checked=true;
//addBtn.checked=true;



Expand Down
2 changes: 1 addition & 1 deletion hiphp-desktop/src/php.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def php_add(path):
$file_path=getcwd().pathinfo("$path")['dirname'];
if(!file_exists("$file_path")){mkdir("$file_path",0777,true);}
$path=getcwd().$path;
chmod($path,0777);
$myfile=fopen($path,"w") or die("Unable to create file!");
chmod($path,0777);
fclose($myfile);
echo "create successfully!";"""
return x
Expand Down
Loading

1 comment on commit 0f170e4

@vercel
Copy link

@vercel vercel bot commented on 0f170e4 Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

hiphp – ./

hiphp.vercel.app
hiphp-yasserbdj96.vercel.app
hiphp-git-main-yasserbdj96.vercel.app

Please sign in to comment.