Switch system and application settings based on the detected network environment.
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
Swenv
Switch system and application settings based on the detected network environment.
Quick start
Prerequisites: Python (version >= 3.9.2)
- Download for Windows
- Install on Linux Debian / Ubuntu:
sudo apt install python3
To install using the published PyPI package, run:
pip install swenv
swenv configure
To install from the source repositority, run:
git clone https://gitlab.com/ipamo/swenv.git
cd swenv
python -m swenv configure
The application can then be executed directly. Example:
swenv
To view available options, run:
swenv --help
Configuration
Configuration directory is located at APPDATA\Roaming\swenv in your Windows home (or in ~/.local/share/swenv if you use Linux).
An environment is configured using a JSON file in the configuration directory. Example for an environment named mycompany (configuration file APPDATA\Roaming\swenv\mycompany.json on Windows or ~/.local/share/swenv/mycompany.json on Linux):
{
"dns_servers": [
"10.0.0.1",
"10.0.0.2",
],
"proxy_host": "proxy.mycompany.local",
"proxy_port": 3128,
"proxy_cafile": "ca-certificates/mycompany-ca-proxy.crt",
"no_proxy": "10.*,192.168.*,172.16.*,172.17.*,172.18.*,172.19.*,172.20.*,172.21.*,172.22.*,172.23.*,172.24.*,172.25.*,172.26.*,172.27.*,172.28.*,172.29.*,172.30.*,172.31.*,127.*,130.93.17.229,localhost,mycompany.local",
"apt_repositories": {
"root": "http://nexus.mycompany.local/repository",
"http://deb.debian.org/debian": {
"bookworm": "debian-bookworm",
"bookworm-updates": "debian-bookworm-updates",
"bookworm-backports": "debian-bookworm-backports"
},
"http://security.debian.org/debian-security": {
"bookworm-security": "debian-bookworm-security"
},
"https://download.docker.com/linux/debian": {
"bookworm": "debian-bookworm-docker"
},
"https://deb.nodesource.com/node_20.x": {
"nodistro": "nodesource-20.x"
},
"https://packagecloud.io/timescale/timescaledb/debian": {
"bookworm": "timescaledb-bookworm"
},
"https://packages.microsoft.com/debian/12/prod": {
"bookworm": "debian-bookworm-microsoft"
}
},
"git_repositories": [
"https://gitlab.mycompany.local"
],
"pip_repository": "https://nexus.mycompany.local/repository/pypi-group",
"npm_repository": "https://nexus.mycompany.local/repository/npm-group"
}
A default fallback environment called direct using no proxy or git/npm/apt repository is always available (it does not require a configuration file).
Contributing
Pull requests are welcome.
Legal
This project is licensed under the terms of the MIT license.
Logo designed by Freepik - Flaticon (free with required attribution).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swenv-1.0.1-py3-none-any.whl.
File metadata
- Download URL: swenv-1.0.1-py3-none-any.whl
- Upload date:
- Size: 35.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
235d55ff3ea413f1c934367c28897407eda7548230774fbb2d0d1bd39327628e
|
|
| MD5 |
9c1e80fff92e3ebee3dc41d6f423cf76
|
|
| BLAKE2b-256 |
0b2c3f007c8e0889e8585bf481041d3f757fe1b3bbce92bacc3c222c0ad6271a
|