source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/config_reload.rb
Ruby
mit
185
staging
565
require 'osctld/commands/logged' module OsCtld class Commands::Container::ConfigReload < Commands::Logged handle :ct_cfg_reload def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) manipulate(ct) do error!('the c...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/send_now.rb
Ruby
mit
185
staging
1,466
require 'osctld/commands/base' module OsCtld class Commands::Container::SendNow < Commands::Base handle :ct_send_now def execute ct = DB::Containers.find(opts[:id], opts[:pool]) error!('container not found') unless ct manipulate(ct) do progress(type: :step, title: 'Sending config'...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/cat.rb
Ruby
mit
185
staging
1,267
require 'osctld/commands/base' module OsCtld class Commands::Container::Cat < Commands::Base handle :ct_cat def execute ct = DB::Containers.find(opts[:id], opts[:pool]) error!('container not found') unless ct error!('container not running') if !ct.running? || ct.init_pid.nil? # Ensu...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/start.rb
Ruby
mit
185
staging
8,880
require 'osctld/commands/logged' module OsCtld class Commands::Container::Start < Commands::Logged handle :ct_start include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include Utils::Container include Utils::SwitchUser def find ct = DB::Containers.find(opts[:id], opts[:po...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/mount_register.rb
Ruby
mit
185
staging
846
require 'osctld/commands/logged' module OsCtld class Commands::Container::MountRegister < Commands::Logged handle :ct_mount_register def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) lock(ct) do mnt = Mount::E...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/recover_cleanup.rb
Ruby
mit
185
staging
1,021
require 'json' require 'osctld/commands/base' module OsCtld class Commands::Container::RecoverCleanup < Commands::Base handle :ct_recover_cleanup include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('c...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/mount_list.rb
Ruby
mit
185
staging
341
require 'osctld/commands/base' module OsCtld class Commands::Container::MountList < Commands::Base handle :ct_mount_list def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct ct.inclusively do ok(ct.mounts.map(&:export)) e...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/console.rb
Ruby
mit
185
staging
698
require 'osctld/commands/base' require 'base64' module OsCtld class Commands::Container::Console < Commands::Base handle :ct_console include OsCtl::Lib::Utils::Log include Utils::SwitchUser def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/set_image_config.rb
Ruby
mit
185
staging
1,792
require 'osctld/commands/logged' module OsCtld class Commands::Container::SetImageConfig < Commands::Logged handle :ct_set_image_config include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include Utils::Container def find ct = DB::Containers.find(opts[:id], opts[:pool]) ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/mount_deactivate.rb
Ruby
mit
185
staging
534
require 'osctld/commands/logged' module OsCtld class Commands::Container::MountDeactivate < Commands::Logged handle :ct_mount_deactivate def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) manipulate(ct) do erro...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/runscript.rb
Ruby
mit
185
staging
916
require 'osctld/commands/base' module OsCtld class Commands::Container::Runscript < Commands::Base handle :ct_runscript include OsCtl::Lib::Utils::Log include Utils::SwitchUser def execute ct = DB::Containers.find(opts[:id], opts[:pool]) error!('container not found') unless ct err...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/find_by_ugid.rb
Ruby
mit
185
staging
1,310
require 'osctld/commands/base' module OsCtld class Commands::Container::FindByUgid < Commands::Base handle :ct_find_by_ugid def execute uids = check_ids!(opts.fetch(:uids, [])) gids = check_ids!(opts.fetch(:gids, [])) by_uid = {} by_gid = {} DB::Containers.each do |ct| ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/import.rb
Ruby
mit
185
staging
3,739
require 'osctld/commands/logged' module OsCtld class Commands::Container::Import < Commands::Logged handle :ct_import def find DB::Pools.get_or_default(opts[:pool]) || error!('pool not found') end def execute(pool) error!('the pool is disabled') unless pool.active? if opts[:map_m...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/send_rootfs.rb
Ruby
mit
185
staging
2,991
require 'osctld/commands/base' module OsCtld class Commands::Container::SendRootfs < Commands::Base handle :ct_send_rootfs include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include OsCtl::Lib::Utils::Send def execute ct = DB::Containers.find(opts[:id], opts[:pool]) er...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/map_mode.rb
Ruby
mit
185
staging
1,965
require 'osctld/commands/logged' module OsCtld class Commands::Container::MapMode < Commands::Logged handle :ct_map_mode include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/export.rb
Ruby
mit
185
staging
1,166
require 'osctld/commands/logged' module OsCtld class Commands::Container::Export < Commands::Logged handle :ct_export def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) manipulate(ct) do File.open(opts[:file], ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/create_empty.rb
Ruby
mit
185
staging
2,530
require 'osctld/commands/logged' module OsCtld class Commands::Container::CreateEmpty < Commands::Logged handle :ct_create_empty def find pool = DB::Pools.get_or_default(opts[:pool]) error!('pool not found') unless pool if DB::Containers.find(opts[:id], pool) error!("container #{p...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/mount_create.rb
Ruby
mit
185
staging
699
require 'osctld/commands/logged' module OsCtld class Commands::Container::MountCreate < Commands::Logged handle :ct_mount_create def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) manipulate(ct) do mnt = Mount:...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/mount_delete.rb
Ruby
mit
185
staging
476
require 'osctld/commands/logged' module OsCtld class Commands::Container::MountDelete < Commands::Logged handle :ct_mount_delete def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) manipulate(ct) do ct.mounts.de...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/copy.rb
Ruby
mit
185
staging
4,035
require 'osctld/commands/logged' module OsCtld class Commands::Container::Copy < Commands::Logged handle :ct_copy include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end d...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/device_unset_inherit.rb
Ruby
mit
185
staging
415
require 'osctld/commands/logged' module OsCtld class Commands::Container::DeviceUnsetInherit < Commands::Logged handle :ct_device_unset_inherit include OsCtl::Lib::Utils::Log include Utils::Devices def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not fou...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/prlimit_list.rb
Ruby
mit
185
staging
453
require 'osctld/commands/base' module OsCtld class Commands::Container::PrLimitList < Commands::Base handle :ct_prlimit_list def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct ret = {} ct.prlimits.each do |name, limit| ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/device_promote.rb
Ruby
mit
185
staging
398
require 'osctld/commands/logged' module OsCtld class Commands::Container::DevicePromote < Commands::Logged handle :ct_device_promote include OsCtl::Lib::Utils::Log include Utils::Devices def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') en...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/mount_activate.rb
Ruby
mit
185
staging
581
require 'osctld/commands/logged' module OsCtld class Commands::Container::MountActivate < Commands::Logged handle :ct_mount_activate def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) manipulate(ct) do error!('...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/device_list.rb
Ruby
mit
185
staging
387
require 'osctld/commands/base' module OsCtld class Commands::Container::DeviceList < Commands::Base handle :ct_device_list include OsCtl::Lib::Utils::Log include Utils::Devices def execute ct = DB::Containers.find(opts[:id], opts[:pool]) error!('container not found') unless ct ct...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/mount_clear.rb
Ruby
mit
185
staging
466
require 'osctld/commands/logged' module OsCtld class Commands::Container::MountClear < Commands::Logged handle :ct_mount_clear def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) manipulate(ct) do ct.mounts.clea...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/reinstall.rb
Ruby
mit
185
staging
2,717
require 'osctld/commands/logged' module OsCtld class Commands::Container::Reinstall < Commands::Logged handle :ct_reinstall include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include Utils::Container def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/unfreeze.rb
Ruby
mit
185
staging
473
require 'osctld/commands/base' module OsCtld class Commands::Container::Unfreeze < Commands::Base handle :ct_unfreeze def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct manipulate(ct) do if %i[thawed starting running stopping...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/device_inherit.rb
Ruby
mit
185
staging
398
require 'osctld/commands/logged' module OsCtld class Commands::Container::DeviceInherit < Commands::Logged handle :ct_device_inherit include OsCtl::Lib::Utils::Log include Utils::Devices def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') en...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/device_delete.rb
Ruby
mit
185
staging
685
require 'osctld/commands/logged' module OsCtld class Commands::Container::DeviceDelete < Commands::Logged handle :ct_device_delete include OsCtl::Lib::Utils::Log include Utils::Devices def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/su.rb
Ruby
mit
185
staging
400
require 'osctld/commands/base' module OsCtld class Commands::Container::Su < Commands::Base handle :ct_su include OsCtl::Lib::Utils::Log include Utils::SwitchUser def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct ok(ct_atta...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/send_cancel.rb
Ruby
mit
185
staging
1,305
require 'osctld/commands/base' require 'open3' module OsCtld class Commands::Container::SendCancel < Commands::Base handle :ct_send_cancel include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include OsCtl::Lib::Utils::Send def execute ct = DB::Containers.find(opts[:id], opts[...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/show.rb
Ruby
mit
185
staging
466
require 'osctld/commands/base' module OsCtld class Commands::Container::Show < Commands::Base handle :ct_show include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include Utils::SwitchUser def execute ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('contain...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/passwd.rb
Ruby
mit
185
staging
564
require 'osctld/commands/base' module OsCtld class Commands::Container::Passwd < Commands::Base handle :ct_passwd def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct manipulate(ct) do ret = DistConfig.run( ct.get_run...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/prlimit_set.rb
Ruby
mit
185
staging
1,143
require 'osctld/commands/logged' module OsCtld class Commands::Container::PrLimitSet < Commands::Logged handle :ct_prlimit_set LIMITS = %w[ as core cpu data fsize memlock msgqueue nice nofile nproc rss rtprio rttime sigpendi...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/device_add.rb
Ruby
mit
185
staging
386
require 'osctld/commands/logged' module OsCtld class Commands::Container::DeviceAdd < Commands::Logged handle :ct_device_add include OsCtl::Lib::Utils::Log include Utils::Devices def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end d...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/stop.rb
Ruby
mit
185
staging
3,302
require 'osctld/commands/logged' module OsCtld class Commands::Container::Stop < Commands::Logged handle :ct_stop include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include Utils::Container include Utils::SwitchUser def find ct = DB::Containers.find(opts[:id], opts[:pool...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/mount_dataset.rb
Ruby
mit
185
staging
982
require 'osctld/commands/logged' module OsCtld class Commands::Container::MountDataset < Commands::Logged handle :ct_mount_dataset def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) manipulate(ct) do ds = OsCtl...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/send_state.rb
Ruby
mit
185
staging
3,479
require 'osctld/commands/base' require 'open3' module OsCtld class Commands::Container::SendState < Commands::Base handle :ct_send_state include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include OsCtl::Lib::Utils::Send def execute ct = DB::Containers.find(opts[:id], opts[:p...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/boot.rb
Ruby
mit
185
staging
3,805
require 'osctld/commands/logged' require 'securerandom' module OsCtld class Commands::Container::Boot < Commands::Logged handle :ct_boot include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include Utils::Container def find ct = DB::Containers.find(opts[:id], opts[:pool]) ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/mount.rb
Ruby
mit
185
staging
312
require 'osctld/commands/base' module OsCtld class Commands::Container::Mount < Commands::Base handle :ct_mount def execute ct = DB::Containers.find(opts[:id], opts[:pool]) error!('container not found') unless ct manipulate(ct) { ct.mount(force: true) } ok end end end
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/device_set_inherit.rb
Ruby
mit
185
staging
409
require 'osctld/commands/logged' module OsCtld class Commands::Container::DeviceSetInherit < Commands::Logged handle :ct_device_set_inherit include OsCtl::Lib::Utils::Log include Utils::Devices def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found')...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/send_cleanup.rb
Ruby
mit
185
staging
942
require 'osctld/commands/base' module OsCtld class Commands::Container::SendCleanup < Commands::Base handle :ct_send_cleanup include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System def execute ct = DB::Containers.find(opts[:id], opts[:pool]) error!('container not found') unless...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/restart.rb
Ruby
mit
185
staging
1,079
require 'osctld/commands/logged' module OsCtld class Commands::Container::Restart < Commands::Logged handle :ct_restart include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include Utils::SwitchUser def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/exec.rb
Ruby
mit
185
staging
857
require 'osctld/commands/base' module OsCtld class Commands::Container::Exec < Commands::Base handle :ct_exec include OsCtl::Lib::Utils::Log include Utils::SwitchUser def execute ct = DB::Containers.find(opts[:id], opts[:pool]) error!('container not found') unless ct error!('conta...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/chgrp.rb
Ruby
mit
185
staging
2,073
require 'osctld/commands/logged' require 'fileutils' module OsCtld class Commands::Container::Chgrp < Commands::Logged handle :ct_chgrp include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/device_chmod.rb
Ruby
mit
185
staging
392
require 'osctld/commands/logged' module OsCtld class Commands::Container::DeviceChmod < Commands::Logged handle :ct_device_chmod include OsCtl::Lib::Utils::Log include Utils::Devices def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/create.rb
Ruby
mit
185
staging
1,517
require 'osctld/commands/logged' module OsCtld class Commands::Container::Create < Commands::Logged handle :ct_create include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include Utils::Container def find pool = DB::Pools.get_or_default(opts[:pool]) error!('pool not foun...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/delete.rb
Ruby
mit
185
staging
2,725
require 'osctld/commands/logged' module OsCtld class Commands::Container::Delete < Commands::Logged handle :ct_delete include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include Utils::SwitchUser def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('co...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/attach.rb
Ruby
mit
185
staging
2,130
require 'osctld/commands/base' module OsCtld class Commands::Container::Attach < Commands::Base handle :ct_attach include OsCtl::Lib::Utils::Log include Utils::SwitchUser Shell = Struct.new(:type, :executable) def execute ct = DB::Containers.find(opts[:id], opts[:pool]) error!('con...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/cgparam_unset.rb
Ruby
mit
185
staging
381
require 'osctld/commands/logged' module OsCtld class Commands::Container::CGParamUnset < Commands::Logged handle :ct_cgparam_unset include Utils::CGroupParams def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) unse...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/send_config.rb
Ruby
mit
185
staging
2,951
require 'osctld/commands/base' require 'tempfile' module OsCtld class Commands::Container::SendConfig < Commands::Base handle :ct_send_config include OsCtl::Lib::Utils::Send def execute ct = DB::Containers.find(opts[:id], opts[:pool]) error!('container not found') unless ct from_snap...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/prlimit_unset.rb
Ruby
mit
185
staging
342
require 'osctld/commands/logged' module OsCtld class Commands::Container::PrLimitUnset < Commands::Logged handle :ct_prlimit_unset def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) ct.prlimits.unset(opts[:name]) ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/cgparam_apply.rb
Ruby
mit
185
staging
567
require 'osctld/commands/base' module OsCtld class Commands::Container::CGParamApply < Commands::Base handle :ct_cgparam_apply include OsCtl::Lib::Utils::Log include Utils::CGroupParams def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unle...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/set.rb
Ruby
mit
185
staging
792
require 'osctld/commands/logged' module OsCtld class Commands::Container::Set < Commands::Logged handle :ct_set def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) manipulate(ct) do changes = {} %i[ ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/send_sync.rb
Ruby
mit
185
staging
2,138
require 'osctld/commands/base' module OsCtld class Commands::Container::SendSync < Commands::Base handle :ct_send_sync include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include OsCtl::Lib::Utils::Send def execute ct = DB::Containers.find(opts[:id], opts[:pool]) error!...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/device_replace.rb
Ruby
mit
185
staging
398
require 'osctld/commands/logged' module OsCtld class Commands::Container::DeviceReplace < Commands::Logged handle :ct_device_replace include OsCtl::Lib::Utils::Log include Utils::Devices def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') en...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/cgparam_list.rb
Ruby
mit
185
staging
322
require 'osctld/commands/base' module OsCtld class Commands::Container::CGParamList < Commands::Base handle :ct_cgparam_list include Utils::CGroupParams def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct list(ct) end end en...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/assets.rb
Ruby
mit
185
staging
330
require 'osctld/commands/base' module OsCtld class Commands::Container::Assets < Commands::Base handle :ct_assets include Utils::Assets def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct ok(list_and_validate_assets(ct)) end ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/cgparam_replace.rb
Ruby
mit
185
staging
367
require 'osctld/commands/base' module OsCtld class Commands::Container::CGParamReplace < Commands::Base handle :ct_cgparam_replace include OsCtl::Lib::Utils::Log include Utils::CGroupParams def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/reconfigure.rb
Ruby
mit
185
staging
351
require 'osctld/commands/base' module OsCtld class Commands::Container::Reconfigure < Commands::Base handle :ct_reconfigure def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct manipulate(ct) do ct.lxc_config.configure ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/chown.rb
Ruby
mit
185
staging
2,583
require 'osctld/commands/logged' require 'fileutils' module OsCtld class Commands::Container::Chown < Commands::Logged handle :ct_chown include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/recover_state.rb
Ruby
mit
185
staging
400
require 'osctld/commands/base' module OsCtld class Commands::Container::RecoverState < Commands::Base handle :ct_recover_state def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct manipulate(ct) do recovery = Container::Recover...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/freeze.rb
Ruby
mit
185
staging
450
require 'osctld/commands/base' module OsCtld class Commands::Container::Freeze < Commands::Base handle :ct_freeze def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct manipulate(ct) do if %i[freezing frozen stopped].include?(ct...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/move.rb
Ruby
mit
185
staging
845
require 'osctld/commands/logged' module OsCtld class Commands::Container::Move < Commands::Logged handle :ct_move def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) state = ct.exclusively { ct.state } manipulate...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/config_replace.rb
Ruby
mit
185
staging
583
require 'osctld/commands/logged' module OsCtld class Commands::Container::ConfigReplace < Commands::Logged handle :ct_cfg_replace def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end def execute(ct) manipulate(ct) do error!('the...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/list.rb
Ruby
mit
185
staging
1,857
require 'osctld/commands/base' module OsCtld class Commands::Container::List < Commands::Base handle :ct_list include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System include Utils::SwitchUser def execute ret = [] hostname_reader = ExecutionPlan.new DB::Containers.eac...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/cgparam_set.rb
Ruby
mit
185
staging
399
require 'osctld/commands/logged' module OsCtld class Commands::Container::CGParamSet < Commands::Logged handle :ct_cgparam_set include OsCtl::Lib::Utils::Log include Utils::CGroupParams def find ct = DB::Containers.find(opts[:id], opts[:pool]) ct || error!('container not found') end ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/container/wall.rb
Ruby
mit
185
staging
701
require 'osctld/commands/base' module OsCtld class Commands::Container::Wall < Commands::Base handle :ct_wall include OsCtl::Lib::Utils::Log def execute plan = ExecutionPlan.new DB::Containers.each_by_ids(opts[:ids], opts[:pool]) do |ct| plan << ct end plan.run do |ct|...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/cpu_scheduler/enable.rb
Ruby
mit
185
staging
205
require 'osctld/commands/base' module OsCtld class Commands::CpuScheduler::Enable < Commands::Base handle :cpu_scheduler_enable def execute CpuScheduler.enable ok end end end
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/cpu_scheduler/package_enable.rb
Ruby
mit
185
staging
331
require 'osctld/commands/base' module OsCtld class Commands::CpuScheduler::PackageEnable < Commands::Base handle :cpu_scheduler_package_enable def execute if CpuScheduler.enable_package(opts[:package]) ok else error("package #{opts[:package].inspect} not found") end end...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/cpu_scheduler/package_disable.rb
Ruby
mit
185
staging
334
require 'osctld/commands/base' module OsCtld class Commands::CpuScheduler::PackageDisable < Commands::Base handle :cpu_scheduler_package_disable def execute if CpuScheduler.disable_package(opts[:package]) ok else error("package #{opts[:package].inspect} not found") end ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/cpu_scheduler/upkeep.rb
Ruby
mit
185
staging
205
require 'osctld/commands/base' module OsCtld class Commands::CpuScheduler::Upkeep < Commands::Base handle :cpu_scheduler_upkeep def execute CpuScheduler.upkeep ok end end end
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/cpu_scheduler/disable.rb
Ruby
mit
185
staging
208
require 'osctld/commands/base' module OsCtld class Commands::CpuScheduler::Disable < Commands::Base handle :cpu_scheduler_disable def execute CpuScheduler.disable ok end end end
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/cpu_scheduler/package_list.rb
Ruby
mit
185
staging
220
require 'osctld/commands/base' module OsCtld class Commands::CpuScheduler::PackageList < Commands::Base handle :cpu_scheduler_package_list def execute ok(CpuScheduler.export_packages) end end end
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/cpu_scheduler/status.rb
Ruby
mit
185
staging
207
require 'osctld/commands/base' module OsCtld class Commands::CpuScheduler::Status < Commands::Base handle :cpu_scheduler_status def execute ok(CpuScheduler.export_status) end end end
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/idmap_list.rb
Ruby
mit
185
staging
631
require 'osctld/commands/base' module OsCtld class Commands::User::IdMapList < Commands::Base handle :user_idmap_list def execute u = DB::Users.find(opts[:name], opts[:pool]) return error('user not found') unless u maps = [] maps << [:uid, u.uid_map] if opts[:uid] maps << [:gi...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/list.rb
Ruby
mit
185
staging
719
require 'osctld/commands/base' module OsCtld class Commands::User::List < Commands::Base handle :user_list def execute ret = [] DB::Users.each_by_ids(opts[:names], opts[:pool]) do |u| next if opts.has_key?(:registered) && u.registered? != opts[:registered] ret << { po...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/unregister.rb
Ruby
mit
185
staging
988
require 'osctld/commands/base' module OsCtld class Commands::User::Unregister < Commands::Base handle :user_unregister def execute if opts[:all] DB::Users.get do |users| users.each do |u| next if opts[:pool] && u.pool.name != opts[:pool] next unless u.register...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/unset.rb
Ruby
mit
185
staging
516
require 'osctld/commands/logged' module OsCtld class Commands::User::Unset < Commands::Logged handle :user_unset def find u = DB::Users.find(opts[:name], opts[:pool]) u || error!('user not found') end def execute(user) manipulate(user) do changes = {} opts.each do...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/lxc_usernet.rb
Ruby
mit
185
staging
1,527
require 'osctld/commands/base' module OsCtld class Commands::User::LxcUsernet < Commands::Base handle :user_lxc_usernet LXC_USERNET = '/etc/lxc/lxc-usernet'.freeze @@mutex = Mutex.new def execute @@mutex.synchronize do generate end ok end protected def gene...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/register.rb
Ruby
mit
185
staging
1,008
require 'osctld/commands/base' module OsCtld class Commands::User::Register < Commands::Base handle :user_register def execute if opts[:all] DB::Users.get do |users| users.each do |u| next if opts[:pool] && u.pool.name != opts[:pool] next if u.registered? ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/subugids.rb
Ruby
mit
185
staging
690
require 'osctld/commands/base' module OsCtld class Commands::User::SubUGIds < Commands::Base handle :user_subugids @@mutex = Mutex.new def execute @@mutex.synchronize do generate end ok end protected def generate DB::Users.get do |users| %w[u g].ea...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/create.rb
Ruby
mit
185
staging
5,132
require 'osctld/commands/logged' require 'fileutils' module OsCtld class Commands::User::Create < Commands::Logged handle :user_create include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System def find pool = DB::Pools.get_or_default(opts[:pool]) error!('pool not found') unless ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/delete.rb
Ruby
mit
185
staging
1,008
require 'osctld/commands/logged' module OsCtld class Commands::User::Delete < Commands::Logged handle :user_delete include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System def find u = DB::Users.find(opts[:name], opts[:pool]) u || error!('user not found') end def execut...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/show.rb
Ruby
mit
185
staging
605
require 'osctld/commands/base' module OsCtld class Commands::User::Show < Commands::Base handle :user_show def execute u = DB::Users.find(opts[:name], opts[:pool]) return error('user not found') unless u ok({ pool: u.pool.name, name: u.name, username: u.sysusername...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/setup.rb
Ruby
mit
185
staging
745
require 'osctld/commands/base' require 'fileutils' module OsCtld class Commands::User::Setup < Commands::Base handle :user_setup include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System def execute u = opts[:user] manipulate(u) do if Dir.exist?(u.userdir) File...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/assets.rb
Ruby
mit
185
staging
316
require 'osctld/commands/base' module OsCtld class Commands::User::Assets < Commands::Base handle :user_assets include Utils::Assets def execute u = DB::Users.find(opts[:name], opts[:pool]) return error('user not found') unless u ok(list_and_validate_assets(u)) end end end
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/user/set.rb
Ruby
mit
185
staging
510
require 'osctld/commands/logged' module OsCtld class Commands::User::Set < Commands::Logged handle :user_set def find u = DB::Users.find(opts[:name], opts[:pool]) u || error!('user not found') end def execute(user) manipulate(user) do changes = {} opts.each do |k,...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/send/key_gen.rb
Ruby
mit
185
staging
1,185
require 'osctld/commands/logged' require 'socket' module OsCtld class Commands::Send::KeyGen < Commands::Logged handle :send_key_gen include OsCtl::Lib::Utils::Log include OsCtl::Lib::Utils::System def find pool = if opts[:pool] DB::Pools.find(opts[:pool]) else ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/send/key_path.rb
Ruby
mit
185
staging
502
require 'osctld/commands/base' module OsCtld class Commands::Send::KeyPath < Commands::Base handle :send_key_path def execute pool = if opts[:pool] DB::Pools.find(opts[:pool]) else DB::Pools.get_or_default(nil) end error!('pool not found'...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/dataset/list.rb
Ruby
mit
185
staging
373
require 'osctld/commands/base' module OsCtld class Commands::Dataset::List < Commands::Base handle :ct_dataset_list def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct ct.inclusively do ok(ct.dataset.list(properties: opts[:pro...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/dataset/delete.rb
Ruby
mit
185
staging
2,609
require 'osctld/commands/base' module OsCtld class Commands::Dataset::Delete < Commands::Base handle :ct_dataset_delete include OsCtl::Lib::Utils::Log include Utils::SwitchUser def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/dataset/create.rb
Ruby
mit
185
staging
2,246
require 'osctld/commands/base' module OsCtld class Commands::Dataset::Create < Commands::Base handle :ct_dataset_create def execute ct = DB::Containers.find(opts[:id], opts[:pool]) return error('container not found') unless ct manipulate(ct) do wanted_ds = OsCtl::Lib::Zfs::Dataset...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/history/list.rb
Ruby
mit
185
staging
697
require 'osctld/commands/base' module OsCtld class Commands::History::List < Commands::Base handle :history_list def execute ok(merge(pools.map { |p| [p, History.read(p)] })) end protected def pools if opts[:pools] opts[:pools].map do |name| DB::Pools.find(name) |...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/self/status.rb
Ruby
mit
185
staging
269
require 'osctld/commands/base' module OsCtld class Commands::Self::Status < Commands::Base handle :self_status def execute d = Daemon.get ok({ started_at: d.started_at.to_i, initialized: d.initialized }) end end end
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/self/health_check.rb
Ruby
mit
185
staging
2,314
require 'osctld/commands/base' module OsCtld class Commands::Self::HealthCheck < Commands::Base handle :self_healthcheck def execute validator = Assets::Validator.new # Collect all assets daemon_assets = Daemon.get.assets validator.add_assets(daemon_assets) pool_entity_assets...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/self/activate.rb
Ruby
mit
185
staging
400
require 'osctld/commands/base' module OsCtld class Commands::Self::Activate < Commands::Base handle :self_activate include OsCtl::Lib::Utils::Log include Utils::SwitchUser def execute if opts[:system] progress('Regenerating system files') call_cmd(Commands::User::SubUGIds) ...
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/self/assets.rb
Ruby
mit
185
staging
227
require 'osctld/commands/base' module OsCtld class Commands::Self::Assets < Commands::Base handle :self_assets include Utils::Assets def execute ok(list_and_validate_assets(Daemon.get)) end end end
github
vpsfreecz/vpsadminos
https://github.com/vpsfreecz/vpsadminos
osctld/lib/osctld/commands/self/abort_shutdown.rb
Ruby
mit
185
staging
209
require 'osctld/commands/base' module OsCtld class Commands::Self::AbortShutdown < Commands::Base handle :self_abort_shutdown def execute Daemon.get.abort_shutdown ok end end end