Skip to content

Commit

Permalink
some FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
zitelog committed Oct 31, 2024
1 parent c4c48ee commit d7def89
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 58 deletions.
5 changes: 3 additions & 2 deletions assets/config.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[fit_properties]
tag_name = 2.0.1
tag_name = v.2.0.1
check_connection_url = http://google.com
npcap_latest_version_url = https://api.github.com/repos/nmap/npcap/releases/latest
npcap_installer_url = https://npcap.com/dist/
pec_providers_url = https://www.agid.gov.it/it/piattaforme/posta-elettronica-certificata/elenco-gestori-pec
fit_latest_version_url = https://api.github.com/repos/fit-project/fit/releases/latest
fit_latest_version_url = https://api.github.com/repos/fit-project/fit/releases/latest

44 changes: 0 additions & 44 deletions pyinstaller/mac/fit.spec

This file was deleted.

65 changes: 65 additions & 0 deletions pyinstaller/pre_build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import subprocess
import re
from configparser import ConfigParser


def get_version_from_latest_git_tag():
try:
tag = subprocess.check_output(
["git", "describe", "--tags", "--abbrev=0"]
).strip()
return tag.decode("utf-8")
except subprocess.CalledProcessError:
return None


def get_version_from_pyproject():
try:
with open("pyproject.toml", "r") as file:
for line in file:
match = re.match(r'^\s*version\s*=\s*"(.*?)"\s*$', line)
if match:
return match.group(1)
return None
except FileNotFoundError:
return None


def get_version():
version = get_version_from_latest_git_tag()
if version is None:
version = get_version_from_pyproject()
return version


def update_version_in_pyproject_toml():
with open("pyproject.toml", "r") as file:
content = file.read()
new_content = re.sub(
r'version\s*=\s*"[0-9a-zA-Z.-]+"', f'version = "{VERSION}"', content
)

with open("pyproject.toml", "w") as file:
file.write(new_content)


def update_version_in_config_ini():
config = ConfigParser()
config.read("assets/config.ini")

if config.has_section("fit_properties"):
config.set("fit_properties", "tag_name", VERSION)

with open("assets/config.ini", "w") as configfile:
config.write(configfile)


def update_version():
update_version_in_pyproject_toml()
update_version_in_config_ini()


VERSION = get_version()

if VERSION is not None:
update_version()
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fit"
version = "2.0.1"
version = "v.2.0.1"
description = "FIT is a Python3 application for forensic acquisition of contents like web pages, emails, social media, etc. directly from the internet."
authors = ["Fit Project <[email protected]>"]
license = "GPL-3.0-only"
Expand Down
2 changes: 1 addition & 1 deletion view/case_form_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init_ui(self):
self.close_button.clicked.connect(self.close)

# SET VERSION
self.version.setText("v" + get_version())
self.version.setText(get_version())

# CANCEL BUTTON
self.cancel_button.clicked.connect(self.reject)
Expand Down
2 changes: 1 addition & 1 deletion view/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init_ui(self):
self.close_button.clicked.connect(self.close)

# SET VERSION
self.version.setText("v" + get_version())
self.version.setText(get_version())

# CANCEL BUTTON
self.cancel_button.clicked.connect(self.reject)
Expand Down
2 changes: 1 addition & 1 deletion view/scrapers/entire_website/entire_website.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init_ui(self):
self.status_message.setHidden(True)

# SET VERSION
self.version.setText("v" + get_version())
self.version.setText(get_version())

# LOAD FROM DOMAIN CHECKBOX
self.load_from_domain.clicked.connect(self.__switch_load_type)
Expand Down
2 changes: 1 addition & 1 deletion view/scrapers/instagram/instagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init_ui(self):
self.status_message.setHidden(True)

# SET VERSION
self.version.setText("v" + get_version())
self.version.setText(get_version())

# SERVER INPUT FIELDS
self.login_configuration_fields = self.login_configuration.findChildren(
Expand Down
2 changes: 1 addition & 1 deletion view/scrapers/mail/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init_ui(self):
self.status_message.setHidden(True)

# SET VERSION
self.version.setText("v" + get_version())
self.version.setText(get_version())
self.server_configuration_vlayout.addWidget(
ClickableLabelView(mail.TWO_FACTOR_AUTH_URL, mail.TWO_FACTOR_AUTH)
)
Expand Down
2 changes: 1 addition & 1 deletion view/scrapers/video/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init_ui(self):
self.status_message.setHidden(True)

# SET VERSION
self.version.setText("v" + get_version())
self.version.setText(get_version())

# PREVIEW CONTAINER
self.preview_container.setEnabled(False)
Expand Down
2 changes: 1 addition & 1 deletion view/scrapers/web/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init_ui(self):
self.status_message.setHidden(True)

# SET VERSION
self.version.setText("v" + get_version())
self.version.setText(get_version())

# SET NAVIGATION BUTTONS
self.back_button.clicked.connect(self.__back)
Expand Down
1 change: 1 addition & 0 deletions view/tasks/post/hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def start(self):
list().append
self.exclude_list.append("acquisition.hash")
self.exclude_list.append("acquisition.log")
self.exclude_list.append("acquisition_video.mp4")
for file in files:
if file not in self.exclude_list:
filename = os.path.join(self.folder, file)
Expand Down
2 changes: 1 addition & 1 deletion view/tasks/tasks_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init_ui(self):
self.close_button.clicked.connect(self.close)

# SET VERSION
self.version.setText("v" + get_version())
self.version.setText(get_version())

self.icon = QtGui.QIcon(
os.path.join(resolve_path("ui/icons"), "info-circle.png")
Expand Down
2 changes: 1 addition & 1 deletion view/verify_pdf_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init_ui(self):
self.close_button.clicked.connect(self.close)

# SET VERSION
self.version.setText("v" + get_version())
self.version.setText(get_version())

# PDF FILE BUTTON
self.pdf_file_button.clicked.connect(
Expand Down
2 changes: 1 addition & 1 deletion view/verify_pec.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init_ui(self):
self.close_button.clicked.connect(self.close)

# SET VERSION
self.version.setText("v" + get_version())
self.version.setText(get_version())

# EML FOLDER BUTTON
self.eml_folder_button.clicked.connect(self.__select_eml_file)
Expand Down
2 changes: 1 addition & 1 deletion view/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, parent=None):
self.back_button.hide()

# SET VERSION
self.version.setText("v" + get_version())
self.version.setText(get_version())

# PAGE1 CASE INFO FORM
self.form_manager = CaseFormManager(self.form)
Expand Down

0 comments on commit d7def89

Please sign in to comment.