From f2db8c25c2440bc931994686466c99f823bbf560 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Tue, 1 May 2012 08:06:48 +0200 Subject: [PATCH] New stuff --- frontend/classes/class.container.php | 17 ++-- frontend/cron.15.php | 14 +++ frontend/images/errorhandler_error.png | Bin 0 -> 4340 bytes frontend/images/errorhandler_info.png | Bin 0 -> 4403 bytes frontend/images/errorhandler_success.png | Bin 0 -> 4447 bytes frontend/images/errorhandler_warning.png | Bin 0 -> 4567 bytes frontend/includes/include.base.php | 1 + frontend/includes/include.config.php | 18 ++++ frontend/js/cvm.js | 2 +- frontend/module.home.php | 17 ++++ frontend/module.vps.overview.php | 43 ++++++++++ frontend/module.vps.php | 46 ++++++++++ frontend/rewrite.php | 45 ++++++++++ frontend/submodule.restart.php | 39 +++++++++ frontend/submodule.start.php | 38 +++++++++ frontend/submodule.stop.php | 38 +++++++++ frontend/templates/error.vps.notfound.tpl | 1 + frontend/templates/errorhandler.error.tpl | 4 + frontend/templates/errorhandler.info.tpl | 4 + frontend/templates/errorhandler.success.tpl | 4 + frontend/templates/errorhandler.warning.tpl | 4 + frontend/templates/main.tpl | 6 +- frontend/templates/main.vps.tpl | 14 +++ frontend/templates/status.running.tpl | 1 + frontend/templates/status.stopped.tpl | 1 + frontend/templates/status.suspended.tpl | 1 + frontend/templates/status.unknown.tpl | 1 + frontend/templates/vps.overview.tpl | 89 ++++++++++++++++++++ sshd/id_rsa.sshd | 27 ++++++ sshd/id_rsa.sshd.pub | 1 + sshd/sshd.py | 39 +++++++++ 31 files changed, 499 insertions(+), 16 deletions(-) create mode 100644 frontend/cron.15.php create mode 100644 frontend/images/errorhandler_error.png create mode 100644 frontend/images/errorhandler_info.png create mode 100644 frontend/images/errorhandler_success.png create mode 100644 frontend/images/errorhandler_warning.png create mode 100644 frontend/includes/include.config.php create mode 100644 frontend/module.home.php create mode 100644 frontend/module.vps.overview.php create mode 100644 frontend/module.vps.php create mode 100644 frontend/rewrite.php create mode 100644 frontend/submodule.restart.php create mode 100644 frontend/submodule.start.php create mode 100644 frontend/submodule.stop.php create mode 100644 frontend/templates/error.vps.notfound.tpl create mode 100644 frontend/templates/errorhandler.error.tpl create mode 100644 frontend/templates/errorhandler.info.tpl create mode 100644 frontend/templates/errorhandler.success.tpl create mode 100644 frontend/templates/errorhandler.warning.tpl create mode 100644 frontend/templates/main.vps.tpl create mode 100644 frontend/templates/status.running.tpl create mode 100644 frontend/templates/status.stopped.tpl create mode 100644 frontend/templates/status.suspended.tpl create mode 100644 frontend/templates/status.unknown.tpl create mode 100644 frontend/templates/vps.overview.tpl create mode 100644 sshd/id_rsa.sshd create mode 100644 sshd/id_rsa.sshd.pub create mode 100644 sshd/sshd.py diff --git a/frontend/classes/class.container.php b/frontend/classes/class.container.php index 064db48..dd1268a 100644 --- a/frontend/classes/class.container.php +++ b/frontend/classes/class.container.php @@ -63,8 +63,8 @@ class Container extends CPHPDatabaseRecordClass case "sBandwidthUsed": return $this->GetBandwidthUsed(); break; - case "sStatus": - return (int)$this->GetStatus(); + case "sCurrentStatus": + return (int)$this->GetCurrentStatus(); break; case "sStatusText": return $this->GetStatusText(); @@ -80,7 +80,7 @@ class Container extends CPHPDatabaseRecordClass return ($this->sOutgoingTrafficUsed + $this->IncomingTrafficUsed) / (1024 * 1024); } - public function GetStatus() + public function GetCurrentStatus() { $command = "vzctl status {$this->sInternalId}"; @@ -103,15 +103,8 @@ class Container extends CPHPDatabaseRecordClass public function GetStatusText() { - if(isset($this->sStatus)) - { - $status = $this->sStatus; - } - else - { - $status = $this->GetStatus(); - } - + $status = $this->sCurrentStatus; + if($status == CVM_STATUS_STARTED) { return "running"; diff --git a/frontend/cron.15.php b/frontend/cron.15.php new file mode 100644 index 0000000..195025c --- /dev/null +++ b/frontend/cron.15.php @@ -0,0 +1,14 @@ + diff --git a/frontend/images/errorhandler_error.png b/frontend/images/errorhandler_error.png new file mode 100644 index 0000000000000000000000000000000000000000..296415e2f6c565b38c2bfa0edd53f0b11ffa5cf3 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Dkg*tkE{DqJgOjd28C4oCm727yAnc8e z=x~@b{rwE2)2Hi=V=LYZ{+7wSrnYTsx)Zed1$Q>LIhKB zI2@FkWg)_0?$|b;T)xczW@b)*bocICZ*1DcngIavqq}$i^s?_eW9QBt+xzgt9DMw7 z8aHfMoFugG2ZvNC;mR~uDA4`YS6mqyV%l|2p3P?eT-s{?=KuiUY&QGPs1R4bcbwNQ z4GuoDy|uM*`<5;Ia?>WPNQAIy;(8u=$6+j!;pW5yH>alNrakZSMce+Qp!N4_x*OIZ z1vo&qp!MzZv$OvI&hO0UcWfOU-O+3qTS7uu5<&`!MXmF*zCSTuEMEW5!oqc67Ptds iOM29*SF`&`{~rK=WQCuj>qPGW0000;(@ literal 0 HcmV?d00001 diff --git a/frontend/images/errorhandler_info.png b/frontend/images/errorhandler_info.png new file mode 100644 index 0000000000000000000000000000000000000000..83de6545870d0e0af384f39f59b6a05c7277a3b9 GIT binary patch literal 4403 zcmV-35zOw1P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWno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1NM=I;}K=q-V^Ov_L4 z#zN;vKtp{4mwJ01p8_zI1I_8`JGc=Ud}9cVEt0{H3w&67_l)J+e;MHH;P?yxlc8ZU zG-N|VHZa@>4L2e~F0y!WL2ovUanf}F&6PQ@)Kdw(NDxE@FSf+S5*Y|hVO5c_lpoyJ zax=?(-jw|-ZmRf&UoFV%G{DkI0PZK*h|ySMLc^>rf)o{cE8e7-|IiU29ZA*-%D3Va zfWXJ190?XoynrU9!rrX_NF`8?Bq(?)s07d-MY$EKx~8ytF^3oC!=uFftJf0cN}|ae zK!0T+Y7erbIIciD0;L5~GB1e=d-KYxf?mfJ1ldu5_DTSUb0dA|ghD4IQcI)~2st<1 zw8}Z;rd+QR5}i=wM*08_SBBu=X#W+K#6C_kQOJ63kqebEvN1yGS!1sg5+|u3_8INJ z0&uX>1F^Ms&v55S+@!=!DYPq)S|B7hQMU7+)F#wS`xoBFhWQzCQVX;za8n95DH-WH zMR^&nJd9qwdcKp`%aTYb+_Xl!g>Y25_3)3MVdc`rGXR|U>9@G&&YEf0Yl(IxZd#K_ zDPk|n$hk8Bug=vE1lGj6dfJY(uH3dAsWegw0xu>GEvBr{JbQF_?u?fLDFw+?l%nPSjT>1fWL~)3s#2KGbFu9>105asnclr)Z|(m@aiQ_20RX_*Tl@bg z6RG3grf0v?d-BBB>XtQDFK%2$&5|WJ$s|&1OcW7%9@(KGMtd%E?Q+j#n7Q)a#E}DU z7(ah`L3hJhh5>wF-1zz7Yw!N<_rN=oP3xM58dfyvMRzm^?WB>)!Nj4B!dx^l))(|$ t?8tTes{@z-Mu7369y9ON>~@a-4FG!UaA7!CkSG8E002ovPDHLkV1k>#P7nY9 literal 0 HcmV?d00001 diff --git a/frontend/images/errorhandler_success.png b/frontend/images/errorhandler_success.png new file mode 100644 index 0000000000000000000000000000000000000000..743ef89c3a48cb65d51f0efb7305be9f2beba401 GIT binary patch literal 4447 zcmV-l5uomgP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(v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txb+M79w{IBWa47+8t=-#lI!!_;lFG#s z5+y`gNq={A!!2bOPOQVN7{ zZri04cuJD=Tq-@6d@kfn+aSQpH#!XiW9*L9(M~+!GTTc~RCvs)@JK3!7uSSvxS>no;7LJJ zDP~o8%&G9GbQP&%9rUNOua;|2%e7?NTiY*rj^osCdh9_wrAVlVLKG4h9q*JDGiAFJ zj)OC0%@fL{LMeoGIGj31Yx|`GH)>4FHl-i`>GHGY=a!L?eEpWXrOd5Pl5{-+9T6Ih zHU?vh?YR>ZkfJEPClyi%Mn?0zf256`p3H&f*M^^6{i}O!t1A}GuMO|X|494kq2}!m zEt}8!RrgbsteBios=$Qh@*y8JcW~;{+72gzmJz%-wpu)THeaMsS-}pl{$ax zr=Rye{`G}(XDwcMH}k$Sn`FX8DM1t&@`aG};20g#*;BDvlRdU002ovPDHLkV1oU?Xz2g| literal 0 HcmV?d00001 diff --git a/frontend/images/errorhandler_warning.png b/frontend/images/errorhandler_warning.png new file mode 100644 index 0000000000000000000000000000000000000000..1c6b8eb0fb39720842be86b0343adfdcbf929982 GIT binary patch literal 4567 zcmV;|5h(77P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNn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z{Kb1yhy3h~%b)dTq=6!k^|SfWw|{=>$3V@#{at&uZZzB1SI<6@w3XusB_d;)LTp7h z=iRAu*PM@!9l7v649)>lK(;JLub8GE_VxUK0{}V|?Uw7&oV002ovPDHLkV1mX9 By~_Xq literal 0 HcmV?d00001 diff --git a/frontend/includes/include.base.php b/frontend/includes/include.base.php index 576bb16..133ed35 100644 --- a/frontend/includes/include.base.php +++ b/frontend/includes/include.base.php @@ -15,6 +15,7 @@ if(!isset($_CVM)) { die("Unauthorized."); } $_CPHP = true; require("cphp/base.php"); +require("include.config.php"); require("include.exceptions.php"); require("include.constants.php"); require("include.parsing.php"); diff --git a/frontend/includes/include.config.php b/frontend/includes/include.config.php new file mode 100644 index 0000000..a991646 --- /dev/null +++ b/frontend/includes/include.config.php @@ -0,0 +1,18 @@ + diff --git a/frontend/js/cvm.js b/frontend/js/cvm.js index be19542..b0758b9 100644 --- a/frontend/js/cvm.js +++ b/frontend/js/cvm.js @@ -10,7 +10,7 @@ $(function(){ return false; }); - $(this).children('.button-icon').addClass('running')[0].src = "images/loading.gif"; + $(this).children('.button-icon').addClass('running')[0].src = "/images/loading.gif"; command_running = true; } }); diff --git a/frontend/module.home.php b/frontend/module.home.php new file mode 100644 index 0000000..a933ade --- /dev/null +++ b/frontend/module.home.php @@ -0,0 +1,17 @@ + diff --git a/frontend/module.vps.overview.php b/frontend/module.vps.overview.php new file mode 100644 index 0000000..832ff48 --- /dev/null +++ b/frontend/module.vps.overview.php @@ -0,0 +1,43 @@ +uParameters[2])) +{ + if($router->uParameters[2] == "start") + { + require("submodule.start.php"); + } + elseif($router->uParameters[2] == "stop") + { + require("submodule.stop.php"); + } + elseif($router->uParameters[2] == "restart") + { + require("submodule.restart.php"); + } +} + +$sPageContents = Templater::InlineRender("vps.overview", $locale->strings, array( + 'id' => $sContainer->sId, + 'server-location' => $sContainer->sNode->sPhysicalLocation, + 'operating-system' => $sContainer->sTemplate->sName, + 'guaranteed-ram' => "{$sContainer->sGuaranteedRam}MB", + 'burstable-ram' => "{$sContainer->sBurstableRam}MB", + 'disk-space' => "{$sContainer->sDiskSpace}MB", + 'total-traffic-limit' => "{$sContainer->sTotalTrafficLimit} bytes", + 'bandwidth-limit' => "100mbit", + 'status' => Templater::InlineRender("status.{$sContainer->sStatusText}", $locale->strings) +)); +?> diff --git a/frontend/module.vps.php b/frontend/module.vps.php new file mode 100644 index 0000000..e0737f1 --- /dev/null +++ b/frontend/module.vps.php @@ -0,0 +1,46 @@ +uParameters[1]); + + $sError = ""; + $sPageContents = ""; + + $router = new CPHPRouter(); + + $router->routes = array( + 0 => array( + '^/([0-9]+)/?$' => "module.vps.overview.php", + '^/([0-9]+)/(start)/?$' => "module.vps.overview.php", + '^/([0-9]+)/(stop)/?$' => "module.vps.overview.php", + '^/([0-9]+)/(restart)/?$' => "module.vps.overview.php" + ) + ); + + $router->RouteRequest(); + + $sMainContents = Templater::InlineRender("main.vps", $locale->strings, array( + 'error' => $sError, + 'contents' => $sPageContents, + 'id' => $sContainer->sId + )); +} +catch(NotFoundException $e) +{ + $sMainContents = Templater::InlineRender("error.vps.notfound"); +} +?> diff --git a/frontend/rewrite.php b/frontend/rewrite.php new file mode 100644 index 0000000..ef84085 --- /dev/null +++ b/frontend/rewrite.php @@ -0,0 +1,45 @@ +routes = array( + 0 => array( + '^/?$' => "module.home.php", + '^/login/?$' => "module.login.php", + '^/logout/?$' => "module.logout.php", + '^/([0-9]+)(/.*)?$' => "module.vps.php" + ) +); + +$mainrouter->RouteRequest(); + +echo(Templater::InlineRender("main", $locale->strings, array( + 'title' => $sPageTitle, + 'main' => $sMainContents +))); + +?> diff --git a/frontend/submodule.restart.php b/frontend/submodule.restart.php new file mode 100644 index 0000000..e6e38b9 --- /dev/null +++ b/frontend/submodule.restart.php @@ -0,0 +1,39 @@ +Stop(); + } + catch(ContainerStopException $e) + { + // we can make this silently fail, as the only important thing is that it starts again + } + + $sContainer->Start(); + $sContainer->sCurrentStatus = CVM_STATUS_STARTED; + + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container restarted", "Your container was successfully restarted."); + $sError .= $err->Render(); +} +catch(ContainerStartException $e) +{ + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container failed to start", "Your container could not be started. If this error persists, please file a support ticket."); + $sError .= $err->Render(); +} + +?> diff --git a/frontend/submodule.start.php b/frontend/submodule.start.php new file mode 100644 index 0000000..3989b9a --- /dev/null +++ b/frontend/submodule.start.php @@ -0,0 +1,38 @@ +sCurrentStatus != CVM_STATUS_STARTED) +{ + try + { + $sContainer->Start(); + $sContainer->sCurrentStatus = CVM_STATUS_STARTED; + + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container started", "Your container was successfully started."); + $sError .= $err->Render(); + } + catch(ContainerStartException $e) + { + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container failed to start", "Your container could not be started. If this error persists, please file a support ticket."); + $sError .= $err->Render(); + } +} +else +{ + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container can't be started", "Your container cannot be started because it is already running."); + $sError .= $err->Render(); +} + +?> diff --git a/frontend/submodule.stop.php b/frontend/submodule.stop.php new file mode 100644 index 0000000..c651401 --- /dev/null +++ b/frontend/submodule.stop.php @@ -0,0 +1,38 @@ +sCurrentStatus != CVM_STATUS_STOPPED) +{ + try + { + $sContainer->Stop(); + $sContainer->sCurrentStatus = CVM_STATUS_STOPPED; + + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container stopped", "Your container was successfully stopped."); + $sError .= $err->Render(); + } + catch(ContainerStartException $e) + { + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container failed to stop", "Your container could not be stopped. If this error persists, please file a support ticket."); + $sError .= $err->Render(); + } +} +else +{ + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container can't be stopped", "Your container cannot be stopped because it is not running."); + $sError .= $err->Render(); +} + +?> diff --git a/frontend/templates/error.vps.notfound.tpl b/frontend/templates/error.vps.notfound.tpl new file mode 100644 index 0000000..9bd0a88 --- /dev/null +++ b/frontend/templates/error.vps.notfound.tpl @@ -0,0 +1 @@ +The specified VPS was not found. diff --git a/frontend/templates/errorhandler.error.tpl b/frontend/templates/errorhandler.error.tpl new file mode 100644 index 0000000..1cb4e71 --- /dev/null +++ b/frontend/templates/errorhandler.error.tpl @@ -0,0 +1,4 @@ +
+
<%?title>
+
<%?message>
+
diff --git a/frontend/templates/errorhandler.info.tpl b/frontend/templates/errorhandler.info.tpl new file mode 100644 index 0000000..9155c80 --- /dev/null +++ b/frontend/templates/errorhandler.info.tpl @@ -0,0 +1,4 @@ +
+
<%?title>
+
<%?message>
+
diff --git a/frontend/templates/errorhandler.success.tpl b/frontend/templates/errorhandler.success.tpl new file mode 100644 index 0000000..57313b5 --- /dev/null +++ b/frontend/templates/errorhandler.success.tpl @@ -0,0 +1,4 @@ +
+
<%?title>
+
<%?message>
+
diff --git a/frontend/templates/errorhandler.warning.tpl b/frontend/templates/errorhandler.warning.tpl new file mode 100644 index 0000000..b39e8e6 --- /dev/null +++ b/frontend/templates/errorhandler.warning.tpl @@ -0,0 +1,4 @@ +
+
<%?title>
+
<%?message>
+
diff --git a/frontend/templates/main.tpl b/frontend/templates/main.tpl index 2d981e5..36d1e5f 100644 --- a/frontend/templates/main.tpl +++ b/frontend/templates/main.tpl @@ -3,14 +3,14 @@ CVM - + - +
- +
You are logged in as joepie91.
diff --git a/frontend/templates/main.vps.tpl b/frontend/templates/main.vps.tpl new file mode 100644 index 0000000..cb48891 --- /dev/null +++ b/frontend/templates/main.vps.tpl @@ -0,0 +1,14 @@ + + +<%?error> + +<%?contents> diff --git a/frontend/templates/status.running.tpl b/frontend/templates/status.running.tpl new file mode 100644 index 0000000..94b952c --- /dev/null +++ b/frontend/templates/status.running.tpl @@ -0,0 +1 @@ +Running diff --git a/frontend/templates/status.stopped.tpl b/frontend/templates/status.stopped.tpl new file mode 100644 index 0000000..0080ca8 --- /dev/null +++ b/frontend/templates/status.stopped.tpl @@ -0,0 +1 @@ +Stopped diff --git a/frontend/templates/status.suspended.tpl b/frontend/templates/status.suspended.tpl new file mode 100644 index 0000000..f686718 --- /dev/null +++ b/frontend/templates/status.suspended.tpl @@ -0,0 +1 @@ +Suspended diff --git a/frontend/templates/status.unknown.tpl b/frontend/templates/status.unknown.tpl new file mode 100644 index 0000000..105cd63 --- /dev/null +++ b/frontend/templates/status.unknown.tpl @@ -0,0 +1 @@ +Unknown diff --git a/frontend/templates/vps.overview.tpl b/frontend/templates/vps.overview.tpl new file mode 100644 index 0000000..e8512cc --- /dev/null +++ b/frontend/templates/vps.overview.tpl @@ -0,0 +1,89 @@ +

Overview

+ + +
+
+

Disk space

+
+
+
55/100GB
+
+
+
+

RAM

+
+
+
241/1024MB
+
+
+
+

Traffic

+
+
+
80/1000GB
+
+
+
+
+ + + +
+

VPS configuration

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Status<%?status>
Server location<%?server-location>
Operating system<%?operating-system>
IPv4 Addresses98.142.213.226, 204.12.235.84
IPv6 Addresses2607:f7a0:1:1::24:6
Guaranteed RAM<%?guaranteed-ram>
Burstable RAM<%?burstable-ram>
Disk space<%?disk-space>
Traffic<%?total-traffic-limit>
Bandwidth<%?bandwidth-limit>
+
diff --git a/sshd/id_rsa.sshd b/sshd/id_rsa.sshd new file mode 100644 index 0000000..108adb0 --- /dev/null +++ b/sshd/id_rsa.sshd @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAzVGn22oP7Na8NYNuLlnqApMPzldYt3TQMGXvb3B1nBjU3Eha +VYKvl2HHQdH7tIAkk9WUXTO4d24Z+YKGdCgNgJIlF6iMswZBqBCHgyhWobeJxAzg +2tQbKyDyPoYpR5TDVOkAwDwL6auIlKgOPsmmde+zIovvUa0xE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AoGAY8A/dKI5cqnkZr6EXZlNCSnIoVVKb9Pkckem +mSsSAYlbpWpcI+cYLh9i7fG7EE8oVbyC+G8HKL4LbhjjA6dwWIg/tOwcyJMLDPWj +207P1fIhyWeiyN62BGUPoi2kuolPt5qB9XHL88jS1onFZduFqNSKAVCTV9TbaJll +jawJajkCgYBUvb0DkrKNW3pmlp3ALXMc1I2+Etp5mf/ihdjqquvLLasXo7IHBWS2 +P0o2wOthj2B8OINlCMaVI1/C4RPFbLiTp5wyEmay60n/+GUA+bZLlUFl7yVsZWOl +i9nW021Q/VsE39kvcIX+HcCWWog5vCB4XMF4czsDMgTkRX+gxtIUjQ== +-----END RSA PRIVATE KEY----- diff --git a/sshd/id_rsa.sshd.pub b/sshd/id_rsa.sshd.pub new file mode 100644 index 0000000..c5e8a52 --- /dev/null +++ b/sshd/id_rsa.sshd.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNUafbag/s1rw1g24uWeoCkw/OV1i3dNAwZe9vcHWcGNTcSFpVgq+XYcdB0fu0gCST1ZRdM7h3bhn5goZ0KA2AkiUXqIyzBkGoEIeDKFaht4nEDODa1BsrIPI+hilHlMNU6QDAPAvpq4iUqA4+yaZ177Mii+9RrTEQoQAPewXKQoCpcdaLUJH9/K98aKJ1KB82g0Cm8m2E/08izfD9vbW+PweZnaF2jpYgX2Zkr6yeOJaIaqfEHCEH2aPN9aeeDFUsBIPDUP1ptIRWdfWkathJZ6xwuMqnlB83fEq/r0SINlSRDPR1Uo5KrXltuEB2e1AjY27crs1uQmxPekTfek+p occupy@edge13.mydomain.internal diff --git a/sshd/sshd.py b/sshd/sshd.py new file mode 100644 index 0000000..49fa7e4 --- /dev/null +++ b/sshd/sshd.py @@ -0,0 +1,39 @@ +from twisted.cred.portal import Portal +from twisted.conch.ssh.factory import SSHFactory +from twisted.internet import reactor +from twisted.conch.ssh.keys import Key +from twisted.conch.interfaces import IConchUser +from twisted.conch.avatar import ConchUser +from twisted.cred.checkers import AllowAnonymousAccess + +with open('id_rsa.sshd') as privateBlobFile: + privateBlob = privateBlobFile.read() + privateKey = Key.fromString(data=privateBlob) + +with open('id_rsa.sshd.pub') as publicBlobFile: + publicBlob = publicBlobFile.read() + publicKey = Key.fromString(data=publicBlob) + +class StandardRealm(object): + def requestAvatar(self, avatarId, mind, *interfaces): + return IConchUser, ConchUser(), nothing + +class CVMChecker: + implements(ICredentialsChecker) + credentialInterfaces = ICVMUser, + + def requestAvatarId(self, credentials): + return defer.succeed("hai") + +class ICVMUser(ICredentials): + pass + +factory = SSHFactory() +factory.privateKeys = {'ssh-rsa': privateKey} +factory.publicKeys = {'ssh-rsa': publicKey} +factory.portal = Portal(StandardRealm()) + +factory.portal.registerChecker(CVMChecker()) + +reactor.listenTCP(2022, factory) +reactor.run()