From 99a0d5f484e910098de57764fb65e40e8183ca81 Mon Sep 17 00:00:00 2001 From: Kevin Puertas Ruiz Date: Tue, 19 Nov 2019 09:38:03 +0100 Subject: [PATCH] Change to mkdocs documentation --- .gitignore | 3 +- README.MD | 52 +------------- doc/how_works.md | 15 ---- doc/naming_limits.md | 3 - .../example_cooks/install_exefile.yaml | 0 .../example_cooks/install_msioptions.yaml | 0 .../example_cooks/install_paintnet.yaml | 0 .../example_cooks/install_simplemsi.yaml | 0 .../example_cooks/remove_program.yaml | 0 {doc => docs}/file_hierarchy.md | 0 {doc => docs}/howto_writecook.md | 1 + docs/index.md | 69 +++++++++++++++++++ docs/quick_start.md | 17 +++++ mkdocs.yml | 7 ++ 14 files changed, 97 insertions(+), 70 deletions(-) delete mode 100644 doc/how_works.md delete mode 100644 doc/naming_limits.md rename {doc => docs}/example_cooks/install_exefile.yaml (100%) rename {doc => docs}/example_cooks/install_msioptions.yaml (100%) rename {doc => docs}/example_cooks/install_paintnet.yaml (100%) rename {doc => docs}/example_cooks/install_simplemsi.yaml (100%) rename {doc => docs}/example_cooks/remove_program.yaml (100%) rename {doc => docs}/file_hierarchy.md (100%) rename {doc => docs}/howto_writecook.md (98%) create mode 100644 docs/index.md create mode 100644 docs/quick_start.md create mode 100644 mkdocs.yml diff --git a/.gitignore b/.gitignore index 0cb6c82..07ebf02 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ __pycache__/ **/__pycache__/ .vscode/ cooks/*.yaml -control/ \ No newline at end of file +control/ +site/ \ No newline at end of file diff --git a/README.MD b/README.MD index 5b76d59..016f301 100644 --- a/README.MD +++ b/README.MD @@ -11,54 +11,4 @@ I'm using this program in the company I work with 12 computers with Windows 8.1/ It's not error proof, then, I don't have any responsability if something crashes, but you can open a Issue and will see it -# Roadmap - -- Complete translation English and Spanish -- Somewhat more security in API 1 -- Stabilize all -- I created a simple GUI in EasyGUI to be easy used, but if I have time, maybe will do a webUI more dynamic and visually better (Without needing to install php/apache/nginx, using python) -- Support Linux clients - -# Requirements - -## Server -For server you can use Linux or Windows, and in theory any environment that can run Python 3 can work as server -- Python3 with: - - Falcon - - Waitress-serve - - Yaml - Python3 deps can be installed it using pip install command (pip install waitress falcon pyyaml) -- For controlling the program, you have to start control.pyw using Python3. It doesn't need to be started in server, but it has to be in that folder (Or with configpcm.ini file). - It uses easygui of python3 (pip install easygui) - -## Clients -- Windows: - - Windows 7 SP1 absolute minimal, but its only officially tested in 8.1 and 10, Windows 7 is being old now. - - It needs Powershell 5.0+ (Not PWCore versions), lower versions doesnt guaranteed to work, not tested. In Windows 7 and 8.1, you have to update Powershell. (With Powershell 3.0/4.0, some commands like Get-Package doesn't work) - You can update from here: https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell?view=powershell-6#upgrading-existing-windows-powershell (Download link: https://www.microsoft.com/en-us/download/details.aspx?id=54616) - -- Linux: - - Not supported yet, but when Windows be stable, I will try to do it in some way - -- Clients may have to be queried by DNS requests. If you don't have a domain (Samba or Windows AD), you may have to have a DNS server with local machines - -# Instalation. Example installing Server and using a GPO of Active Directory/Task Schedule to make it work in clients -- Copy this folder to a folder in your server -- Install dependencies -- Open sysopt.py file and change values if needed -- Start the server: Start api.py using loadserver.bat (Windows) o loadserver.sh (Linux) file. You can do in systemd way, or a cron, or in a terminal of windows server,... -- Go to "client" folder and copy "configpcm_example.ini" to "configpcm.ini" and change their values to yours. Change lang value for having client gui translated to your lang. Here you will see: - - server=X -> Its where server app is running and port by default is :3333. You can change in loadserver file. You can use an IP like 192.168.1.200:3333. - - resources=\\XX -> UNC/Path where software are. When you write cooks, you will do come "REPOTOLOCAL|somefile.msi", well, this folder is where it will copy files. It has be readable by clients. -- For clients to work, they have to run "client\client.ps1" every 30 mins/1 hour or so, I did using Active Directory and a Task Scheduled GPO (Copying client.ps1 and configpcm.ini files from Client to SysVol\DomainName\Scripts\) - - User: SYSTEM (Or NT\SYSTEM) - - Command: powershell.exe - - Args: -executionpolicy bypass -windowstyle hidden -noninteractive -nologo -file "\\SERVER\SysVol\DOMAINNAME\scripts\client.ps1" - - Note: client.ps1 has to have controlpcm.ini file with it and has to be readable and executable by clients -- If you don't have Active Directory, you can do the Task Scheduled task in every computer without problems, and using another Shared folder, it will work right. - -- For use of param "-startup 1" for cooks that has to be run without users, you will have to create a Task Scheduled GPO when workstation startsup/powers off with param -startup 1, like: - - Args: -executionpolicy bypass -windowstyle hidden -noninteractive -nologo -file "\\SERVER\SysVol\DOMAINNAME\scripts\client.ps1" -startup 1 - -- Start control.pyw to setup password and start adding computers, groups and cooks. You can use doc/example_cooks for examples. If anyone wants, I will setup a git repo for cooks. \ No newline at end of file +Please open docs/index.md to read the rest diff --git a/doc/how_works.md b/doc/how_works.md deleted file mode 100644 index 3895bf1..0000000 --- a/doc/how_works.md +++ /dev/null @@ -1,15 +0,0 @@ -# Very-Fast instructions -You have to create a cook. In "Examples" you have Cook Examples, copy one to cooks and edit (See howto_writecook) - -Then, you have to create a group using the control.ps1 GUI. -In groups is where you assign computers and cooks - -Cooks and computers has to be assigned to groups - -Cooks -> Group - -Computers -> Group - -You can have more than 1 cook in a group - -You can call the groups equal to cooks and assign this cook to the group and you have a 1<->1 \ No newline at end of file diff --git a/doc/naming_limits.md b/doc/naming_limits.md deleted file mode 100644 index 3f6a36a..0000000 --- a/doc/naming_limits.md +++ /dev/null @@ -1,3 +0,0 @@ -Cooks and groups have to be only alfanumeric caracters (a..Z and 0..9) and "-","_" and must end with .yaml - -Do not use simbols or chars like / + $... \ No newline at end of file diff --git a/doc/example_cooks/install_exefile.yaml b/docs/example_cooks/install_exefile.yaml similarity index 100% rename from doc/example_cooks/install_exefile.yaml rename to docs/example_cooks/install_exefile.yaml diff --git a/doc/example_cooks/install_msioptions.yaml b/docs/example_cooks/install_msioptions.yaml similarity index 100% rename from doc/example_cooks/install_msioptions.yaml rename to docs/example_cooks/install_msioptions.yaml diff --git a/doc/example_cooks/install_paintnet.yaml b/docs/example_cooks/install_paintnet.yaml similarity index 100% rename from doc/example_cooks/install_paintnet.yaml rename to docs/example_cooks/install_paintnet.yaml diff --git a/doc/example_cooks/install_simplemsi.yaml b/docs/example_cooks/install_simplemsi.yaml similarity index 100% rename from doc/example_cooks/install_simplemsi.yaml rename to docs/example_cooks/install_simplemsi.yaml diff --git a/doc/example_cooks/remove_program.yaml b/docs/example_cooks/remove_program.yaml similarity index 100% rename from doc/example_cooks/remove_program.yaml rename to docs/example_cooks/remove_program.yaml diff --git a/doc/file_hierarchy.md b/docs/file_hierarchy.md similarity index 100% rename from doc/file_hierarchy.md rename to docs/file_hierarchy.md diff --git a/doc/howto_writecook.md b/docs/howto_writecook.md similarity index 98% rename from doc/howto_writecook.md rename to docs/howto_writecook.md index ab71333..dfe74e4 100644 --- a/doc/howto_writecook.md +++ b/docs/howto_writecook.md @@ -53,6 +53,7 @@ Note: Cooks start in directory $env:temp (%TEMP%) from SYSTEM user. - *DOWNLOAD: It seems to be a limit in PowerShell Invoke-WebRequest that limits this downloads to some like 128MB Inside of a Cook, you can use a simple IF query: + | OS | COMMAND | Runs if when: | |----- |----------------- |--------------------------------------------------------------------------------- | | W/L | IFSOFTWAREINST | When program is installed. | diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..2aa9361 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,69 @@ +# What is "Powerful Computer Manager"? +Powerful Computer Manager is the super-simple-but-powerful program to automatizate tasks in groups of computers (In a Active Directory site, or not) in a unattended way. +It inteed to be a simple SSMS alternative, that inventarizes computers and install/remove software in it, tweak system of run arbitrary commands. + +You only have to write simple _cooks_ that are small yaml text files, create groups of computers and assign _cooks_ to this groups, and will be run in the destination computers + + +# Disclaimer + +I'm using this program in the company I work with 12 computers with Windows 8.1/10 with various software (MSI,EXE,...) and tweaking services, and it works right + +It's not error proof, then, I don't have any responsability if something crashes, but you can open a Issue and will see it + +# Roadmap + +- Complete translation English and Spanish +- Somewhat more security in API 1 +- Stabilize all +- I created a simple GUI in EasyGUI to be easy used, but if I have time, maybe will do a webUI more dynamic and visually better (Without needing to install php/apache/nginx, using python) +- Support Linux clients + +# Requirements + +## Server +For server you can use Linux or Windows, and in theory any environment that can run Python 3 can work as server +- Python3 with: + - Falcon + - Waitress-serve + - Yaml + Python3 deps can be installed it using pip install command (pip install waitress falcon pyyaml) +- For controlling the program, you have to start control.pyw using Python3. It doesn't need to be started in server, but it has to be in that folder (Or with configpcm.ini file). + It uses easygui of python3 (pip install easygui) + +## Clients +- Windows: + - Windows 7 SP1 absolute minimal, but its only officially tested in 8.1 and 10, Windows 7 is being old now. + - It needs Powershell 5.0+ (Not PWCore versions), lower versions doesnt guaranteed to work, not tested. In Windows 7 and 8.1, you have to update Powershell. (With Powershell 3.0/4.0, some commands like Get-Package doesn't work) + You can update from here: https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell?view=powershell-6#upgrading-existing-windows-powershell (Download link: https://www.microsoft.com/en-us/download/details.aspx?id=54616) + +- Linux: + - Not supported yet, but when Windows be stable, I will try to do it in some way + +- Clients may have to be queried by DNS requests. If you don't have a domain (Samba or Windows AD), you may have to have a DNS server with local machines + +# Instalation + +## Server +- Copy this folder to a folder in your server +- Install dependencies +- Open sysopt.py file and change values if needed +- Start the server: Start api.py using loadserver.bat (Windows) o loadserver.sh (Linux) file. You can do in systemd way, or a cron, or in a terminal of windows server,... + +## Client. Example using GPO and Task Schedule +- Go to "client" folder and copy "configpcm_example.ini" to "configpcm.ini" and change their values to yours. Change lang value for having client gui translated to your lang. Here you will see: + - server=X -> Its where server app is running and port by default is :3333. You can change in loadserver file. You can use an IP like 192.168.1.200:3333. + - resources=\\XX -> UNC/Path where software are. When you write cooks, you will do come "REPOTOLOCAL|somefile.msi", well, this folder is where it will copy files. It has be readable by clients. +- For clients to work, they have to run "client\client.ps1" every 30 mins/1 hour or so, I did using Active Directory and a Task Scheduled GPO (Copying client.ps1 and configpcm.ini files from Client to SysVol\DomainName\Scripts\) + - User: SYSTEM (Or NT\SYSTEM) + - Command: powershell.exe + - Args: -executionpolicy bypass -windowstyle hidden -noninteractive -nologo -file "\\SERVER\SysVol\DOMAINNAME\scripts\client.ps1" + + Note: client.ps1 has to have controlpcm.ini file with it and has to be readable and executable by clients +- If you don't have Active Directory, you can do the Task Scheduled task in every computer without problems, and using another Shared folder, it will work right. + +- For use of param "-startup 1" for cooks that has to be run without users, you will have to create a Task Scheduled GPO when workstation startsup/powers off with param -startup 1, like: + - Args: -executionpolicy bypass -windowstyle hidden -noninteractive -nologo -file "\\SERVER\SysVol\DOMAINNAME\scripts\client.ps1" -startup 1 + +## Control app +- Start control.pyw to setup password and start adding computers, groups and cooks. You can use docs/example_cooks for examples. If anyone wants, I will setup a git repo for cooks. \ No newline at end of file diff --git a/docs/quick_start.md b/docs/quick_start.md new file mode 100644 index 0000000..c143587 --- /dev/null +++ b/docs/quick_start.md @@ -0,0 +1,17 @@ +# Quick Start instructions + +For be able to use this, after reading the installation section: + +You have to create a cook. In "Examples" you have Cook Examples, copy one to cooks and edit (See howto_writecook) + +Then, you have to create a group using the control.pyw GUI. + +Computers can be into "Groups", and "Groups" can have "Cooks" + +Cooks -> Group + +Computers -> Group + +You can have more than 1 cook in a group + +Maybe in a simple organization, you can assign cook to group with same name, and computers to groups that need this cook \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..4f1b4bb --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,7 @@ +site_name: Powerful Computer Manager +nav: + - Home: index.md + - Quick Start: quick_start.md + - How to write a cook: howto_writecook.md + - Hierarchy: file_hierarchy.md +theme: readthedocs \ No newline at end of file