opensipscli 0.3.5__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opensipscli-0.4.1/.github/workflows/docker-push-image.yml +38 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/.github/workflows/docker-readme.yml +2 -2
- {opensipscli-0.3.5 → opensipscli-0.4.1}/.github/workflows/pypi.yml +5 -5
- {opensipscli-0.3.5 → opensipscli-0.4.1}/PKG-INFO +6 -7
- {opensipscli-0.3.5 → opensipscli-0.4.1}/README.md +2 -2
- {opensipscli-0.3.5 → opensipscli-0.4.1}/bin/opensips-cli +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docker/Dockerfile +2 -2
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docs/INSTALLATION.md +9 -10
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docs/modules/database.md +19 -3
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docs/modules/user.md +2 -2
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/__init__.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/args.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/cli.py +10 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/comm.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/config.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/db.py +78 -76
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/defaults.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/libs/__init__.py +1 -1
- opensipscli-0.4.1/opensipscli/libs/sqlalchemy_utils.py +166 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/logger.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/main.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/module.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/modules/__init__.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/modules/database.py +79 -4
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/modules/diagnose.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/modules/instance.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/modules/mi.py +12 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/modules/tls.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/modules/trace.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/modules/trap.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/modules/user.py +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/opensipscli/version.py +2 -2
- {opensipscli-0.3.5 → opensipscli-0.4.1}/packaging/debian/changelog +12 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/packaging/debian/control +2 -2
- {opensipscli-0.3.5 → opensipscli-0.4.1}/packaging/debian/rules +1 -1
- {opensipscli-0.3.5 → opensipscli-0.4.1}/packaging/redhat_fedora/opensips-cli.spec +10 -7
- {opensipscli-0.3.5 → opensipscli-0.4.1}/pyproject.toml +2 -3
- {opensipscli-0.3.5 → opensipscli-0.4.1}/setup.py +3 -4
- opensipscli-0.3.5/.github/workflows/docker-push-image.yml +0 -26
- opensipscli-0.3.5/opensipscli/libs/sqlalchemy_utils.py +0 -244
- {opensipscli-0.3.5 → opensipscli-0.4.1}/.gitignore +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/LICENSE +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/SECURITY.md +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docker/Makefile +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docker/docker.md +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docker/run.sh +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docs/modules/diagnose.md +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docs/modules/instance.md +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docs/modules/mi.md +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docs/modules/tls.md +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docs/modules/trace.md +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/docs/modules/trap.md +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/etc/default.cfg +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/packaging/debian/.gitignore +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/packaging/debian/compat +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/packaging/debian/copyright +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/packaging/debian/source/format +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/packaging/debian/watch +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/setup.cfg +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/test/alltests.py +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/test/test-database.sh +0 -0
- {opensipscli-0.3.5 → opensipscli-0.4.1}/test/test.sh +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Push OpenSIPS CLI Images in Docker Hub
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
repository_dispatch:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v6
|
|
14
|
+
|
|
15
|
+
- name: Set up Docker Buildx
|
|
16
|
+
uses: docker/setup-buildx-action@v4
|
|
17
|
+
|
|
18
|
+
- name: Log in to Docker Hub
|
|
19
|
+
uses: docker/login-action@v4
|
|
20
|
+
with:
|
|
21
|
+
username: ${{ secrets.DOCKER_USERNAME }}
|
|
22
|
+
password: ${{ secrets.DOCKER_TOKEN }}
|
|
23
|
+
|
|
24
|
+
- name: Log in to GitHub Container Registry
|
|
25
|
+
uses: docker/login-action@v4
|
|
26
|
+
with:
|
|
27
|
+
registry: ghcr.io
|
|
28
|
+
username: ${{ github.repository_owner }}
|
|
29
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
30
|
+
|
|
31
|
+
- name: Build and push Docker image
|
|
32
|
+
uses: docker/build-push-action@v7
|
|
33
|
+
with:
|
|
34
|
+
context: ./docker/
|
|
35
|
+
push: true
|
|
36
|
+
tags: |
|
|
37
|
+
opensips/opensips-cli:latest
|
|
38
|
+
ghcr.io/opensips/opensips-cli:latest
|
|
@@ -12,11 +12,11 @@ jobs:
|
|
|
12
12
|
dockerHubDescription:
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
- name: Docker Hub Description
|
|
19
|
-
uses: peter-evans/dockerhub-description@
|
|
19
|
+
uses: peter-evans/dockerhub-description@v5
|
|
20
20
|
with:
|
|
21
21
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
22
22
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
@@ -9,9 +9,9 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v6
|
|
13
13
|
- name: Set up Python
|
|
14
|
-
uses: actions/setup-python@
|
|
14
|
+
uses: actions/setup-python@v6
|
|
15
15
|
with:
|
|
16
16
|
python-version: "3.x"
|
|
17
17
|
- name: Install pypa/build
|
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
- name: Build a binary wheel and a source tarball
|
|
24
24
|
run: python3 -m build
|
|
25
25
|
- name: Store the distribution packages
|
|
26
|
-
uses: actions/upload-artifact@
|
|
26
|
+
uses: actions/upload-artifact@v7
|
|
27
27
|
with:
|
|
28
28
|
name: python-package-distributions
|
|
29
29
|
path: dist/
|
|
@@ -43,7 +43,7 @@ jobs:
|
|
|
43
43
|
|
|
44
44
|
steps:
|
|
45
45
|
- name: Download all the dists
|
|
46
|
-
uses: actions/download-artifact@
|
|
46
|
+
uses: actions/download-artifact@v8
|
|
47
47
|
with:
|
|
48
48
|
name: python-package-distributions
|
|
49
49
|
path: dist/
|
|
@@ -64,7 +64,7 @@ jobs:
|
|
|
64
64
|
|
|
65
65
|
steps:
|
|
66
66
|
- name: Download all the dists
|
|
67
|
-
uses: actions/download-artifact@
|
|
67
|
+
uses: actions/download-artifact@v8
|
|
68
68
|
with:
|
|
69
69
|
name: python-package-distributions
|
|
70
70
|
path: dist/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: opensipscli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: OpenSIPS Command Line Interface
|
|
5
5
|
Project-URL: Homepage, https://github.com/OpenSIPS/opensips-cli
|
|
6
6
|
Project-URL: Source, https://github.com/OpenSIPS/opensips-cli
|
|
@@ -14,10 +14,9 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
16
|
Requires-Python: >=3.8
|
|
17
|
-
Requires-Dist: mysqlclient<1.4.0rc1
|
|
18
17
|
Requires-Dist: opensips
|
|
19
|
-
Requires-Dist:
|
|
20
|
-
Requires-Dist: sqlalchemy
|
|
18
|
+
Requires-Dist: pymysql
|
|
19
|
+
Requires-Dist: sqlalchemy>=1.3.2
|
|
21
20
|
Description-Content-Type: text/markdown
|
|
22
21
|
|
|
23
22
|
# OpenSIPS CLI (Command Line Interface)
|
|
@@ -92,7 +91,7 @@ The OpenSIPSCLI object can receive a set of arguments/modifiers through the
|
|
|
92
91
|
```
|
|
93
92
|
from opensipscli import args
|
|
94
93
|
...
|
|
95
|
-
args = OpenSIPSCLIArgs(debug=True)
|
|
94
|
+
args = args.OpenSIPSCLIArgs(debug=True)
|
|
96
95
|
opensipscli = cli.OpenSIPSCLI(args)
|
|
97
96
|
...
|
|
98
97
|
```
|
|
@@ -100,7 +99,7 @@ opensipscli = cli.OpenSIPSCLI(args)
|
|
|
100
99
|
Custom settings can be provided through the arguments, i.e.:
|
|
101
100
|
```
|
|
102
101
|
# run commands over http
|
|
103
|
-
args = OpenSIPSCLIArgs(communication_type = "http",
|
|
102
|
+
args = args.OpenSIPSCLIArgs(communication_type = "http",
|
|
104
103
|
url="http://127.0.0.1:8080/mi")
|
|
105
104
|
...
|
|
106
105
|
```
|
|
@@ -70,7 +70,7 @@ The OpenSIPSCLI object can receive a set of arguments/modifiers through the
|
|
|
70
70
|
```
|
|
71
71
|
from opensipscli import args
|
|
72
72
|
...
|
|
73
|
-
args = OpenSIPSCLIArgs(debug=True)
|
|
73
|
+
args = args.OpenSIPSCLIArgs(debug=True)
|
|
74
74
|
opensipscli = cli.OpenSIPSCLI(args)
|
|
75
75
|
...
|
|
76
76
|
```
|
|
@@ -78,7 +78,7 @@ opensipscli = cli.OpenSIPSCLI(args)
|
|
|
78
78
|
Custom settings can be provided through the arguments, i.e.:
|
|
79
79
|
```
|
|
80
80
|
# run commands over http
|
|
81
|
-
args = OpenSIPSCLIArgs(communication_type = "http",
|
|
81
|
+
args = args.OpenSIPSCLIArgs(communication_type = "http",
|
|
82
82
|
url="http://127.0.0.1:8080/mi")
|
|
83
83
|
...
|
|
84
84
|
```
|
|
@@ -8,7 +8,7 @@ ENV DEBIAN_FRONTEND noninteractive
|
|
|
8
8
|
|
|
9
9
|
#install basic components
|
|
10
10
|
RUN apt-get -y update -qq && \
|
|
11
|
-
apt-get -y install git
|
|
11
|
+
apt-get -y install git
|
|
12
12
|
|
|
13
13
|
#add keyserver, repository
|
|
14
14
|
RUN git clone https://github.com/OpenSIPS/opensips-cli.git /usr/src/opensips-cli && \
|
|
@@ -16,7 +16,7 @@ RUN git clone https://github.com/OpenSIPS/opensips-cli.git /usr/src/opensips-cli
|
|
|
16
16
|
python3 -m pip install . && \
|
|
17
17
|
cd / && rm -rf /usr/src/opensips-cli
|
|
18
18
|
|
|
19
|
-
RUN apt-get purge -y git
|
|
19
|
+
RUN apt-get purge -y git && \
|
|
20
20
|
apt-get autoremove -y && \
|
|
21
21
|
apt-get clean
|
|
22
22
|
|
|
@@ -17,8 +17,8 @@ to your system using the instructions provided, then install the
|
|
|
17
17
|
|
|
18
18
|
Supported Operating Systems (at the time of writing):
|
|
19
19
|
|
|
20
|
-
* Debian
|
|
21
|
-
* Ubuntu
|
|
20
|
+
* Debian 10-12
|
|
21
|
+
* Ubuntu 18.04, 20.04, 22.04, 24.04
|
|
22
22
|
|
|
23
23
|
### RPM packages (.rpm)
|
|
24
24
|
|
|
@@ -56,27 +56,26 @@ will vary on every supported operating system.
|
|
|
56
56
|
|
|
57
57
|
```
|
|
58
58
|
# required OS packages
|
|
59
|
-
sudo apt install python3 python3-pip python3-
|
|
60
|
-
python3-mysqldb python3-sqlalchemy python3-sqlalchemy-utils \
|
|
59
|
+
sudo apt install python3 python3-pip python3-pymysql python3-sqlalchemy \
|
|
61
60
|
python3-openssl
|
|
62
61
|
|
|
63
62
|
# alternatively, you can build the requirements from source
|
|
64
|
-
sudo pip3 install
|
|
63
|
+
sudo pip3 install PyMySQL sqlalchemy pyOpenSSL
|
|
65
64
|
```
|
|
66
65
|
|
|
67
66
|
#### Red Hat / CentOS
|
|
68
67
|
|
|
69
68
|
```
|
|
70
69
|
# required CentOS 7 packages
|
|
71
|
-
sudo yum install python36 python36-pip python36-
|
|
72
|
-
python36-
|
|
70
|
+
sudo yum install python36 python36-pip python36-PyMySQL \
|
|
71
|
+
python36-sqlalchemy python36-pyOpenSSL
|
|
73
72
|
|
|
74
73
|
# required CentOS 8 packages
|
|
75
|
-
sudo yum install python3 python3-pip python3-
|
|
76
|
-
python3-
|
|
74
|
+
sudo yum install python3 python3-pip python3-PyMySQL \
|
|
75
|
+
python3-sqlalchemy python3-pyOpenSSL
|
|
77
76
|
|
|
78
77
|
# alternatively, you can build the requirements from source
|
|
79
|
-
sudo pip3 install
|
|
78
|
+
sudo pip3 install PyMySQL sqlalchemy pyOpenSSL
|
|
80
79
|
```
|
|
81
80
|
|
|
82
81
|
### Download, Build & Install
|
|
@@ -14,7 +14,10 @@ which database to delete.
|
|
|
14
14
|
parameter the name of the module, as specified in the OpenSIPS scripts
|
|
15
15
|
hierarchy.
|
|
16
16
|
* `migrate` - copy and convert an OpenSIPS database into its next OpenSIPS
|
|
17
|
-
release equivalent
|
|
17
|
+
release equivalent
|
|
18
|
+
* `pi` - creates a `pi_http` framework from the framework shipped with
|
|
19
|
+
OpenSIPS, using the configured database URL and modules. An optional output
|
|
20
|
+
path may be provided.
|
|
18
21
|
|
|
19
22
|
## Configuration
|
|
20
23
|
|
|
@@ -90,6 +93,17 @@ opensips-cli -x database add rtpproxy
|
|
|
90
93
|
```
|
|
91
94
|
The command above will create the `rtpproxy_sockets` table.
|
|
92
95
|
|
|
96
|
+
To create a provisioning framework for the configured modules, run:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
opensips-cli -x database pi /etc/opensips/pi_framework.xml
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The command reuses the framework shipped in the OpenSIPS `pi_http` scripts,
|
|
103
|
+
including its module-specific columns, validations, and commands. When
|
|
104
|
+
`database_modules` is not `ALL`, entries for other modules are removed from
|
|
105
|
+
the generated file.
|
|
106
|
+
|
|
93
107
|
A drop command will prompt the user whether they really want to drop the
|
|
94
108
|
database or not:
|
|
95
109
|
|
|
@@ -132,8 +146,10 @@ opensips-cli -o database_schema_path=~/src/opensips-3.1/scripts \
|
|
|
132
146
|
|
|
133
147
|
## Dependencies
|
|
134
148
|
|
|
135
|
-
* [sqlalchemy
|
|
136
|
-
|
|
149
|
+
* [sqlalchemy](https://www.sqlalchemy.org/) - used to abstract the SQL
|
|
150
|
+
database regardless of the backend used
|
|
151
|
+
* [PyMySQL](https://github.com/PyMySQL/PyMySQL) - pure-Python MySQL/MariaDB
|
|
152
|
+
driver used by SQLAlchemy when connecting to MySQL backends
|
|
137
153
|
|
|
138
154
|
## Limitations
|
|
139
155
|
|
|
@@ -53,8 +53,8 @@ opensips-cli -x user delete username@domain.com
|
|
|
53
53
|
|
|
54
54
|
## Dependencies
|
|
55
55
|
|
|
56
|
-
* [sqlalchemy
|
|
57
|
-
|
|
56
|
+
* [sqlalchemy](https://www.sqlalchemy.org/) - used to abstract the database
|
|
57
|
+
manipulation, regardless of the backend used
|
|
58
58
|
|
|
59
59
|
## Limitations
|
|
60
60
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
2
|
##
|
|
3
3
|
## This file is part of OpenSIPS CLI
|
|
4
4
|
## (see https://github.com/OpenSIPS/opensips-cli).
|
|
@@ -195,6 +195,7 @@ class OpenSIPSCLI(cmd.Cmd, object):
|
|
|
195
195
|
"""
|
|
196
196
|
preload a history file
|
|
197
197
|
"""
|
|
198
|
+
self.configure_completion_delims()
|
|
198
199
|
history_file = cfg.get('history_file')
|
|
199
200
|
logger.debug("using history file {}".format(history_file))
|
|
200
201
|
try:
|
|
@@ -210,6 +211,14 @@ class OpenSIPSCLI(cmd.Cmd, object):
|
|
|
210
211
|
if not self.registered_atexit:
|
|
211
212
|
atexit.register(self.history_write)
|
|
212
213
|
|
|
214
|
+
def configure_completion_delims(self):
|
|
215
|
+
"""
|
|
216
|
+
keep ':' inside tokens for command completion (e.g. "mi evi:")
|
|
217
|
+
"""
|
|
218
|
+
delims = readline.get_completer_delims()
|
|
219
|
+
if ':' in delims:
|
|
220
|
+
readline.set_completer_delims(delims.replace(':', ''))
|
|
221
|
+
|
|
213
222
|
def postcmd(self, stop, line):
|
|
214
223
|
"""
|
|
215
224
|
post command after switching instance
|