-
Notifications
You must be signed in to change notification settings - Fork 2
Installation
mauricelambert edited this page Dec 9, 2022
·
15 revisions
Install WebScripts - Youtube video
This package require:
- python3
- python3 Standard Library
Optional on Windows:
- pywin32 (to centralize logs in Event Viewer)
python3 -m pip install WebScripts
python3 -m pip install WebScripts --install-option "--admin-password=<your password>" --install-option "--owner=www-data" --install-option "--directory=<directory>"
# OR
python3 -m pip install WebScripts --install-option "-p<your password>" --install-option "-owww-data" --install-option "--d<directory>"
python3 -m pip install WebScripts --install-option "--admin-password=<your password>" --install-option "--owner=WebScripts" --install-option "--directory=<directory>"
# OR
python3 -m pip install WebScripts --install-option "-p<your password>" --install-option "-oWebScripts" --install-option "--d<directory>"
python -m pip install WebScripts
python -m pip install WebScripts --install-option "--admin-password=<your password>" --install-option "--directory=<directory>"
# OR
python -m pip install WebScripts --install-option "-p<your password>" --install-option "--d<directory>"
To centralize logs in Event Viewer.
python -m pip install pywin32
-
--admin-password=
or-p
: The administrator password (password of the default account named Admin) -
--owner=
or-o
: Owner of installation files (used on UNIX systems only), to change the owner and permissions run the command with privileges -
--json-only
or-j
: Delete INI configuration files (used with the--no-hardening/-n
argument only) -
--no-hardening
or-n
: Does not harden the installation of WebScripts not recommended
- Backup data files:
<WebScripts env>/lib/python3.*/site-packages/WebScripts/data
- This is not recommended, but if you have modified the library configuration files, back them up:
<WebScripts env>/lib/python3.9/site-packages/WebScripts/config/**/*.{json,ini}
- This is not recommended, but if you have modified the library static files, back them up:
<WebScripts env>/lib/python3.9/site-packages/WebScripts/static
- Upgrade WebScripts:
python3 -m pip install --upgrade WebScripts
- Restore files
- Restart the server
#!/usr/bin/env bash
# Little bash script to upgrade your WebScripts Server.
# Assume you run this script in the environment directory.
set -e
if [ "$(id -u)" -ne 0 ]; then
echo "Error: you must be root to launch this script"
exit 1
fi
echo "Active WebScripts environment..."
dir1=$(pwd)
source ./bin/activate
cd lib/python3.*/site-packages/WebScripts
dir2=$(pwd)
echo "Move data files..."
mkdir -p /tmp/WebScripts/
mv -f data /tmp/WebScripts/
# Uncomment following lines to backup configuration files
# echo "Move configuration files..."
# mv -f config /tmp/WebScripts/
# Uncomment following lines to backup static files
# echo "Move static files..."
# mv -f static /tmp/WebScripts/
cd ..
python3 -m pip install --upgrade --force-reinstall WebScripts
cd "${dir2}"
echo "Restore data files..."
rm -rf data
mv -f /tmp/WebScripts/data ./
# Uncomment following lines to restore configuration files
# echo "Move configuration files..."
# [[ -e config.bak ]] && rm -rf config.bak
# [[ -e config ]] && mv config config.bak
# mv -f /tmp/WebScripts/config ./
# Uncomment following lines to restore static files
# echo "Move static files..."
# [[ -e static.bak ]] && rm -rf static.bak
# [[ -e static ]] && mv static static.bak
# mv -f /tmp/WebScripts/static ./
# systemctl restart httpd # restart server Apache/WSGI/WebScripts on RedHat
# systemctl restart apache # restart server Apache/WSGI/WebScripts on Debian
echo "Upgrade is done ! Please restart your WebScripts server."
exit 0
git clone https://github.com/mauricelambert/WebScripts.git # Get the code
cd WebScripts # Change the current directory
python3.8 WebScripts/scripts/to_3.8/to_3.8.py # Execute the script for python3.8 compatibility
python3.8 setup38.py install -p "<your password>" -o "owner" # Install it
python3.8 -m WebScripts38 # Use WebScripts38
# Launch this commands line:
# - git clone https://github.com/mauricelambert/WebScripts.git
# - cd WebScripts
# - python3.8 WebScripts/scripts/to_3.8/to_3.8.py
# - python3.8 setup38.py install
# And use the package:
import WebScripts38
WebScripts38.main()
You can now start the server with this simple command:
WebScripts
- Install without
--admin-password=
option: to log in for the first time, use theAdmin
account (username:Admin
, password:Admin
). I recommend changing the password immediately. TheAdmin
account is restricted on127.0.*,192.168.*,172.16.*,10.*
by default. - Install with
--admin-password=
option: to log in for the first time, use theAdmin
account (username:Admin
).
Create a directory named logs
to launch the WebScripts Server. If logs
directory does not exists or is not a directory, the WebScripts Server will try to create it.
mkdir logs
Licensed under the GPL, version 3.