From 07f7d34cb59aa32bbb2c35b315a2e49e9f21a9bf Mon Sep 17 00:00:00 2001 From: nkls Date: Thu, 16 Sep 2021 08:18:12 +0200 Subject: [PATCH] changed base image of peer to pEp image in gitlab registry --- Dockerfile.peer | 3 +- src/.mix.cpp.swp | Bin 1024 -> 1024 bytes src/mix.cpp | 6 +-- src/mix.cpp.save | 133 ----------------------------------------------- 4 files changed, 5 insertions(+), 137 deletions(-) delete mode 100644 src/mix.cpp.save diff --git a/Dockerfile.peer b/Dockerfile.peer index 88fdf91..907a824 100644 --- a/Dockerfile.peer +++ b/Dockerfile.peer @@ -1,4 +1,5 @@ -FROM debian:buster-slim +FROM dockerreg.pep.security/nkls/pepdocker/peppythonadapter:latest +#FROM debian:buster-slim RUN apt update -y && apt upgrade -y RUN apt install -y git wget build-essential nano bison python3 linux-perf nmap iputils-ping diff --git a/src/.mix.cpp.swp b/src/.mix.cpp.swp index cd27322f1a4bb420da516571d742a4f6a637f01c..5e23ed8ee8c510e6f514496e19cb1c23724bb848 100644 GIT binary patch delta 22 dcmZqRXyBM2!4W3Fz>t@nQ#`RzWuwa;W&lNi2FU;b delta 22 dcmZqRXyBM2!ExayBST(xPVvM>m5nZYm;qUF2rU2r diff --git a/src/mix.cpp b/src/mix.cpp index 98e14eb..57c5b5b 100644 --- a/src/mix.cpp +++ b/src/mix.cpp @@ -118,9 +118,9 @@ class mix std::cout << "dht bootstrap nodes: " << p.get_str(lt::settings_pack::dht_bootstrap_nodes) << std::endl; // lt::dht_default_storage stor; - lt::dht mydht; - lt::entry e; - std::cout << e << std::endl; + bool peerexists; + lt::get_peers('276a9c09b87f0695ccc7936da5332d2d35957aff') + std::cout << peerexists << std::endl; // lt::add_torrent_params atp = lt::parse_magnet_uri("magnet:?xt=urn:btih:D540FC48EB12F2833163EED6421D449DD8F1CE1F&dn=Ubuntu%20desktop%2019.04%20(64bit)"); // atp.save_path="."; diff --git a/src/mix.cpp.save b/src/mix.cpp.save deleted file mode 100644 index e68cad3..0000000 --- a/src/mix.cpp.save +++ /dev/null @@ -1,133 +0,0 @@ -#include -#include -#include -#include -//#include -//#include -//#include -#include -#include -#include - -#include -#include -#include -//#include -//#include -//#include -//#include -//#include -//#include - - - - -namespace po=boost::program_options; - -class mix - { - public: - int id; - std::string name; - gpgme_data_t keydata; - gpgme_ctx_t context; - gpgme_error_t error; - gpgme_key_t key; - void init() - { - std::cout << "Mix starting..." << std::endl; - if(std::ifstream("mix.conf")) - { - std::cout << "Config file existing" << std::endl; - this->read_settings(); - std::cout << "name = " << name << std::endl; - std::cout << "id = " << id << std::endl; -// read_keys(); - start_peer(); - } - else - { - std::cout << "Config file does not exist. Exiting." << std::endl; - std::exit(1); - } -// std::cout << "Looking for keys" << std::endl; -// gpgme_check_version(NULL); -// gpgme_new(&context); -// create_keys(); - } - - void read_settings() - - { - po::options_description desc("Options"); - desc.add_options() ("name", po::value(&name), "name"); - desc.add_options() ("id", po::value(&id), "id"); - po::variables_map vm; - std::ifstream settings_file("mix.conf"); - vm = po::variables_map(); - po::store(po::parse_config_file(settings_file , desc), vm); - po::notify(vm); - } - - void read_keys() - { - gpgme_data_new_from_file(&keydata, "keys.gpg", 1); - gpgme_op_import(context, keydata); - gpgme_op_keylist_start (context, "mix", 0); - while(!error) - { - error = gpgme_op_keylist_next (context, &key); - if (error){break;} - std::cout << key->subkeys->keyid << std::endl; - if (key->uids && key->uids->name) - { - std::cout << key->uids->name << std::endl; - } - if (key->uids && key->uids->email) - { - std::cout << key->uids->email << std::endl; - } - } - } - void create_keys() - { - error=gpgme_op_createkey(context,"mix@pep.foundation",NULL,0,0,NULL,0); - if(error) - { - std::cout << "Error generating keys" << error << std::endl; - } - else - { - std::cout << "Keys generated successfully" << std::endl; - } - } - - void start_peer() - { - lt::settings_pack p; - p.set_int(lt::settings_pack::alert_mask,lt::alert_category::status | lt::alert_category::error); - lt::session ses(p); - lt::add_torrent_params atp = lt::parse_magnet_uri("magnet:?xt=urn:btih:D540FC48EB12F2833163EED6421D449DD8F1CE1F&dn=Ubuntu%20desktop%2019.04%20(64bit)%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A6969%2Fannounce&tr=udp%3A%2F%2F9.rarbg.to%3A2710%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2780%2Fannounce&tr=udp%3A%2F%2F9.rarbg.to%3A2730%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=http%3A%2F%2Fp4p.arenabg.com%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Ftracker.tiny-vps.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce"); - - - - -// lt::dht::dht_state dst; -// dst=ses.dht_state(); -// std::cout << ses.dht_state << std::endl; - - - -// std::vector alerts; ses.pop_alerts(&alerts); -// lt::alert a; - } - }; - - -int main() - { - mix mix1; - mix1.init(); - } - -