Permalink
Browse files

cyberghost hardcoded domains

  • Loading branch information...
hypatia2 committed Nov 20, 2015
1 parent 3031f92 commit f24b8b063e48d4b2e8a279af463c01efad8d8f58
Showing with 31 additions and 7 deletions.
  1. +28 −4 fruho/add_cyberghost.tcl
  2. +3 −3 fruho/add_from_file.tcl
@@ -7,8 +7,8 @@ namespace eval ::cyberghost {
variable dispname CyberGhost
# input entries - resettable/modifiable variables
variable newprofilename ""
variable username 4478671_8Tp4DJYrvg
variable password 85hSeYF8hb
variable username 4478671_Mjz3msabMw
variable password PGexN8u3kV
}
@@ -81,11 +81,35 @@ proc ::cyberghost::ImportClicked {tab name} {
variable newprofilename
variable username
variable password
set newprofileid [name2id $newprofilename]
if {$username ne "" && $password ne ""} {
dict-set-trim ::model::Profiles [name2id $newprofilename] cache_custom_auth_user $username
dict-set-trim ::model::Profiles [name2id $newprofilename] cache_custom_auth_pass $password
dict-set-trim ::model::Profiles $newprofileid cache_custom_auth_user $username
dict-set-trim ::model::Profiles $newprofileid cache_custom_auth_pass $password
}
::from_file::ImportClicked $tab $name
set plans [dict-pop $::model::Profiles $newprofileid plans {}]
lassign $plans planid plan
set slist [dict-pop $plan slist {}]
set sitem [lindex $slist 0]
set ovses [dict-pop $sitem ovses {}]
set ovs [lindex $ovses 0]
set proto [dict-pop $ovs proto {}]
set port [dict-pop $ovs port {}]
if {$slist ne "" && $proto ne "" && $port ne "" && $planid ne ""} {
set endpoints {}
foreach sitem $slist {
lappend endpoints [list [dict-pop $sitem ip {}] $proto $port]
}
# hardcoded cyberghost hosts
set hosts {1-au.cg-dialup.net 1-at.cg-dialup.net 1-be.cg-dialup.net 1-ca.cg-dialup.net 4-cz.cg-dialup.net 1-dk.cg-dialup.net 1-fi.cg-dialup.net 1-fr.cg-dialup.net 1-de.cg-dialup.net 4-de.cg-dialup.net 1-hk.cg-dialup.net 1-hu.cg-dialup.net 1-is.cg-dialup.net 1-ie.cg-dialup.net 1-il.cg-dialup.net 1-it.cg-dialup.net 1-jp.cg-dialup.net 1-lt.cg-dialup.net 1-lu.cg-dialup.net 1-mx.cg-dialup.net 5-nl.cg-dialup.net 1-no.cg-dialup.net 1-pl.cg-dialup.net 1-ro.cg-dialup.net 4-ro.cg-dialup.net 1-sg.cg-dialup.net 1-es.cg-dialup.net 1-se.cg-dialup.net 1-ch.cg-dialup.net 9-ch.cg-dialup.net 1-ua.cg-dialup.net 1-gb.cg-dialup.net}
foreach host $hosts {
lappend endpoints [list $host $proto $port]
}
set newslist [from_file::create-slist $endpoints]
dict set ::model::Profiles $newprofileid plans $planid slist $newslist
}
} on error {e1 e2} {
puts stderr [log $e1 $e2]
}
@@ -109,12 +109,12 @@ proc ::from_file::ImportClicked {tab name} {
}
set plan [dict create name $newprofilename timelimit [dict create start 0 period month nop 1000000] trafficlimit [dict create used 0 quota 1000000000] slist $slist]
dict set ::model::Profiles $profileid plans [dict create plainid $plan]
dict set ::model::Profiles $profileid plans [dict create planid_1 $plan]
dict set ::model::Profiles $profileid profilename $newprofilename
dict set ::model::Profiles $profileid provider $name
go update-bulk-sitem $profileid
# Delay in resolving server list domains - allow for completing the slist by appenders like in add_cyberghost
after 1000 go update-bulk-sitem $profileid
# when repainting tabset select the newly created tab
set ::model::selected_profile [name2id $newprofilename]

0 comments on commit f24b8b0

Please sign in to comment.