Class: AethernalAgent::Filebrowser
- Defined in:
- lib/aethernal_agent/plugins/filebrowser/filebrowser.rb
Constant Summary
Constants included from Systemd
Instance Attribute Summary
Attributes inherited from App
#container_settings, #global_options, #manifest, #plugin_path, #user
Attributes included from Errors
Instance Method Summary collapse
- #configure_app_user(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Filebrowser
constructor
A new instance of Filebrowser.
- #install_packages(options = {}) ⇒ Object
- #remove_app_user(options = {}) ⇒ Object
Methods inherited from App
#app_path, #create_return_args, #ensure_action_options, #extract, #icon_file, #icon_sha, #is_docker_install?, #is_local_install?, #sha_1_hash, #status, #uninstall_packages, #unzip
Methods included from Errors
Methods included from Utils
#apt_running?, #check_manifest, #container_domain, #current_xdg_runtime_dir, #docker_container_name, #get_current_uid, #get_global_config, #global_config_path, #port_is_free, #prepare_test_config, #print_system, #random_port, #random_string, #run_as, #run_command, #run_systemd_plain, #set_global_config, #systemd_text_for_service, #ubuntu_release, #wait_on_apt, #wait_on_file, #wait_on_port
Methods included from Systemd
#create_service_file, #get_systemd_status, #method_missing, #parse_systemd_status_text, #reload_systemd_config, #run_user_systemctl, #service_file_path
Methods included from Filesystem
#aethernal_agent_file, #aethernal_agent_folder, #copy, #directory, #file, #file_settings, #files_folder, #files_path, #home_folder_path, #meta_folder, #meta_path, #set_ownership, #set_permissions, #template_path, #templates_folder, #write_template
Methods included from Apt
#add_apt_ppa, #apt_package, #apt_update, included
Constructor Details
#initialize(options = {}) ⇒ Filebrowser
Returns a new instance of Filebrowser.
2 3 4 |
# File 'lib/aethernal_agent/plugins/filebrowser/filebrowser.rb', line 2 def initialize( = {}) super() end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AethernalAgent::Systemd
Instance Method Details
#configure_app_user(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/aethernal_agent/plugins/filebrowser/filebrowser.rb', line 17 def configure_app_user( = {}) self.install_packages() super() do |opts| run_as(self.user,"#{filebrowser_path} config init -d #{filebrowser_db_path}") run_as(self.user,"#{filebrowser_path} users add #{self.user} #{opts[:password]} --perm.admin -d #{filebrowser_db_path}") run_as(self.user,"#{filebrowser_path} config set -p #{opts[:port]} -a '[::]' -b '/filebrowser' -d #{filebrowser_db_path}") run_as(self.user,"#{filebrowser_path} rules add -r \"[\\\\\\/]\\..+\" -u #{self.user} -d #{filebrowser_db_path}") end end |
#install_packages(options = {}) ⇒ Object
6 7 8 9 |
# File 'lib/aethernal_agent/plugins/filebrowser/filebrowser.rb', line 6 def install_packages( = {}) super() file(filebrowser_path, chmod: 711, owner: self.user) end |
#remove_app_user(options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/aethernal_agent/plugins/filebrowser/filebrowser.rb', line 11 def remove_app_user( = {}) super() do |opts| directory(home_folder_path(".config/filebrowser"), action: :delete) end end |