-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pi 5 setup script #71
Comments
I had the same issue! |
Hello! I do not know how to edit python files. could you add the updated script to your comment? |
No problem! Edit, I have changed the script, i missed a " ' "... setup.py: `#! /usr/bin/python3 Remote Wake/Sleep-On-LAN Server [SETUP SCRIPT]https://github.com/sciguy14/Remote-Wake-Sleep-On-LAN-Server(c) 2024 Blum Idea Labs, LLC.Author: Jeremy E. Blum (https://www.jeremyblum.com)License: GPL v3 (http://www.gnu.org/licenses/gpl.html)Import Librariesimport subprocess Exit Handlerdef signal_handler(sig, frame): Global Variablesscript_dir = pathlib.Path(file).parent.absolute() Colorsblack = lambda text: '\033[0;30m' + text + '\033[0m' Main Logicdef main():
Function for encapsulating parts of the setup process that can be skipped on script re-runhandle: short name for setup stepdescription: human-understandable setup setup namedot_file_skippable: If True, this step will be skipped if already completed in previous runReturns True if the setup step should be run, False if it was already previously completeddef run_step(handle, description, dot_file_skippable=True): Setup Step 1: Install Prequisite Softwaredef _01_install_prereqs():
Setup Step 2: The PHP server uses the built-in ping command to check if the remote machine is awake or not. Give all users on the pi permission to ping.def _02_ping_permissions(): Setup Step 3: Symlink Apache2 Webrootdef _03_symlink_webroot(): Setup Step 4: DDNS Configurationdef _04_setup_ddns():
Setup Step 5: Get Public IP - we'll need it for checking existing DDNS configs, or for configuring a new onedef _05_get_ip(): Setup Step 6: Confirm that the DNS update suceededdef _06_check_urls():
Setup Step 7: Check to see if port 80 and/or port 443 is currently serving RWSOLs to correctly display options for cert setupdef _07_server_check():
Setup Step 8: Certbot configdef _08_certbot_setup():
Alternate Setup Step 8: Self-Signed Cert Setupdef _08_selfcert_setup():
Alternate Setup Step 8: Unencrypted Config (We still copy over the 000-default file because it has some security improvements, but the 443 virtual host is ignored because ssl mod is disabled)def _08_unencrypted_setup():
Step 9: Make some configuration adjustments to the PHP/Apache installation to improve its securitydef _09_secure_php(): Step 10: Generate default config file for WOL page if one doesn't already existdef _10_prep_config_file():
Step 11: Help with editing of the config filedef _11_modify_config_file():
Prompt Function for Multiple Choice Questions.query: question string to be asked. e.g. "What is the best sandwich ingredient?"options: list of possible choices. e.g. ['bacon', 'lettuce', 'tomato']Returns the 1-indexed selection number (1 if you choose bacon), and the value as a tuple (bacon)def multi_choice(query, options):
Ensures the urls global list var is populated appropriatelydef fill_urls_var(): Prompt Function for entering multiple comma seperated, proper-format FQDNsquery: Request to be presented. e.g. Please enter one or more domain names, comma seperatedReturns a list of validated FQDNsdef enter_urls(query): Function for identifying a valid hostnamehttps://stackoverflow.com/a/2532344def is_valid_hostname(hostname): Function for determined the default routing IP address of this machine on the local networkhttps://stackoverflow.com/a/28950776def get_local_ip(): Function that copies relevant apache2 config files while creating timestamped backups of the originalReturns the path to the backup file that was createddef copy_config_with_backup(src, dst): Function that checks to see if RWSOLS is current servering on port 80 and/or 443, and whether or not there is already a signed cert.Returns a tuple with the following:* boolean: True if there is any accessible at port 80 (may or may not be RWSOLS)* boolean: True if RWSOLS is serving on Port 80* boolean: True if there is any accessible server at port 443 (may or may not be RWSOLS)* boolean: True if RWSOLS is serving on Port 443 (regardless of cert type)* boolean: True if RWSOLS is serving on Port 443 with a valid, signed cert (False if self-signed cert, or if not found on 443)def rwsols_serving_status():
Executeif name == "main": |
Have you gotten the permissions to work? once i visit the site it gives me the error :Forbidden |
I ended up removing the symlink Remote-Wake-Sleep-On-LAN-Server/www/html -> /var/www/ and moved the data from the first folder to the /var/www/. See v2 documentation as a startingpoint. |
can I have help pls not working on pi 4 with rasbian 64bit lite. #! /usr/bin/python3 Remote Wake/Sleep-On-LAN Server [SETUP SCRIPT]https://github.com/sciguy14/Remote-Wake-Sleep-On-LAN-Server(c) 2024 Blum Idea Labs, LLC.Author: Jeremy E. Blum (https://www.jeremyblum.com)License: GPL v3 (http://www.gnu.org/licenses/gpl.html)Import Librariesimport subprocess Exit Handlerdef signal_handler(sig, frame): Global Variablesscript_dir = pathlib.Path(file).parent.absolute() Colorsblack = lambda text: '\033[0;30m' + text + '\033[0m' Main Logicdef main():
Function for encapsulating parts of the setup process that can be skipped on script re-runhandle: short name for setup stepdescription: human-understandable setup setup namedot_file_skippable: If True, this step will be skipped if already completed in previous runReturns True if the setup step should be run, False if it was already previously completeddef run_step(handle, description, dot_file_skippable=True): Setup Step 1: Install Prequisite Softwaredef _01_install_prereqs():
Setup Step 2: The PHP server uses the built-in ping command to check if the remote machine is awake or not. Give all users on the pi permission to ping.def _02_ping_permissions(): Setup Step 3: Symlink Apache2 Webrootdef _03_symlink_webroot(): Setup Step 4: DDNS Configurationdef _04_setup_ddns():
Setup Step 5: Get Public IP - we'll need it for checking existing DDNS configs, or for configuring a new onedef _05_get_ip(): Setup Step 6: Confirm that the DNS update suceededdef _06_check_urls():
Setup Step 7: Check to see if port 80 and/or port 443 is currently serving RWSOLs to correctly display options for cert setupdef _07_server_check():
Setup Step 8: Certbot configdef _08_certbot_setup():
Alternate Setup Step 8: Self-Signed Cert Setupdef _08_selfcert_setup():
Alternate Setup Step 8: Unencrypted Config (We still copy over the 000-default file because it has some security improvements, but the 443 virtual host is ignored because ssl mod is disabled)def _08_unencrypted_setup():
Step 9: Make some configuration adjustments to the PHP/Apache installation to improve its securitydef _09_secure_php(): Step 10: Generate default config file for WOL page if one doesn't already existdef _10_prep_config_file():
Step 11: Help with editing of the config filedef _11_modify_config_file():
Prompt Function for Multiple Choice Questions.query: question string to be asked. e.g. "What is the best sandwich ingredient?"options: list of possible choices. e.g. ['bacon', 'lettuce', 'tomato']Returns the 1-indexed selection number (1 if you choose bacon), and the value as a tuple (bacon)def multi_choice(query, options):
Ensures the urls global list var is populated appropriatelydef fill_urls_var(): Prompt Function for entering multiple comma seperated, proper-format FQDNsquery: Request to be presented. e.g. Please enter one or more domain names, comma seperatedReturns a list of validated FQDNsdef enter_urls(query): Function for identifying a valid hostnamehttps://stackoverflow.com/a/2532344def is_valid_hostname(hostname): Function for determined the default routing IP address of this machine on the local networkhttps://stackoverflow.com/a/28950776def get_local_ip(): Function that copies relevant apache2 config files while creating timestamped backups of the originalReturns the path to the backup file that was createddef copy_config_with_backup(src, dst): Function that checks to see if RWSOLS is current servering on port 80 and/or 443, and whether or not there is already a signed cert.Returns a tuple with the following:* boolean: True if there is any accessible at port 80 (may or may not be RWSOLS)* boolean: True if RWSOLS is serving on Port 80* boolean: True if there is any accessible server at port 443 (may or may not be RWSOLS)* boolean: True if RWSOLS is serving on Port 443 (regardless of cert type)* boolean: True if RWSOLS is serving on Port 443 with a valid, signed cert (False if self-signed cert, or if not found on 443)def rwsols_serving_status():
Executeif name == "main": I get this error when installing using help form a comment on this thread form user viggeSandberg. |
@lukee12zakk
|
I went through the script and fixed what was going wrong with this error. Fixing setup.py improper handling of process output Be advised that this still resulted in a 403 Forbidden error when trying to reach the web server. I simply deleted the symlink created at /var/www and copied the contents of $HOME/RWSOL/www to /var/www instead, and then it worked great. |
Hello!
I saw that you updated the code with version detection, however I am still having some problems.
Have you tested the setup script on a pi 5?
I have specifically a pi 5 8gb model. I've tested the install of the newest release on both normal 64bit bookworm and the "lite" version suggested in the installation guide. If it is to any help i have my wifi region set to sweden(se) and same for locale settings.
Here's the install feedback:
Running: Install Prequisite Software
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
Hit:4 http://archive.raspberrypi.com/debian bookworm InRelease
Reading package lists... Done
/bin/sh: 1: Syntax error: Unterminated quoted string
Error installing prerequisite software.
Script Exiting due to failure in 'Install Prequisite Software' setup step.
My user is the default pi with default password.
The text was updated successfully, but these errors were encountered: