fixed setup

This commit is contained in:
root 2025-01-12 14:49:00 +01:00
parent 16e988bd39
commit 1915487f50

View file

@ -28,32 +28,6 @@ def main():
else:
print('[-] Invalid instance name in ~/.darknet_participant_url:', instance)
return False
instancepath=rootpath+'www/participants/'+instance
templatepath=rootpath+'templates/'
verifiedcsvfile=instancepath+'/verified.csv'
unverifiedcsvfile=instancepath+'/unverified.csv'
blcsvfile=instancepath+'/blacklist.csv'
secsvfile=instancepath+'/sensitive.csv'
webpcsvfile=instancepath+'/webring-participants.csv'
# check if instancepath exists, if not then create the directory
if not os.path.exists(instancepath):
os.makedirs(instancepath)
# check if all the required csv files exist in it, otherwise copy them from the templates directory
# NOTE : the templates files are EMPTY by default, this is because i want each peer to manually review lists of links, and links themselves manually, this is to avoid allowing malicious links to slip through without intentional edits from the peer themselves.
for i in ['verified.csv','unverified.csv','blacklist.csv','sensitive.csv','webring-participants.csv']:
filepath=instancepath+'/'+i
if not os.path.isfile(filepath):
# copy templates/ FILE.CSV to instancepath/ FILE.CSV
src=templatepath+i
shutil.copyfile(src, filepath)
# now that they exist, get vdf and uvdf and the rest
vdf = pd.read_csv(verifiedcsvfile)
uvdf = pd.read_csv(unverifiedcsvfile)
bldf = pd.read_csv(blcsvfile)
sedf = pd.read_csv(secsvfile)
webpdf = pd.read_csv(webpcsvfile)
print("[+] file exists, your Webring URL is", instance)
isitvalid = "y"
else:
print("[+] Instance Path doesn't exist yet")
# and ask for the instance URL domain
@ -81,6 +55,34 @@ def main():
print(f.read())
print("[+] Initial Setup Completed!")
myinstance = instance
instancepath=rootpath+'www/participants/'+instance
templatepath=rootpath+'templates/'
verifiedcsvfile=instancepath+'/verified.csv'
unverifiedcsvfile=instancepath+'/unverified.csv'
blcsvfile=instancepath+'/blacklist.csv'
secsvfile=instancepath+'/sensitive.csv'
webpcsvfile=instancepath+'/webring-participants.csv'
# check if instancepath exists, if not then create the directory
if not os.path.exists(instancepath):
os.makedirs(instancepath)
# check if all the required csv files exist in it, otherwise copy them from the templates directory
# NOTE : the templates files are EMPTY by default, this is because i want each peer to manually review lists of links, and links themselves manually, this is to avoid allowing malicious links to slip through without intentional edits from the peer themselves.
for i in ['verified.csv','unverified.csv','blacklist.csv','sensitive.csv','webring-participants.csv']:
filepath=instancepath+'/'+i
if not os.path.isfile(filepath):
# copy templates/ FILE.CSV to instancepath/ FILE.CSV
src=templatepath+i
shutil.copyfile(src, filepath)
# now that they exist, get vdf and uvdf and the rest
vdf = pd.read_csv(verifiedcsvfile)
uvdf = pd.read_csv(unverifiedcsvfile)
bldf = pd.read_csv(blcsvfile)
sedf = pd.read_csv(secsvfile)
webpdf = pd.read_csv(webpcsvfile)
print("[+] file exists, your Webring URL is", instance)
isitvalid = "y"
while True:
print("""