Skip to content

Commit

Permalink
Change freepbx custom module path
Browse files Browse the repository at this point in the history
  • Loading branch information
Stell0 committed Jan 20, 2025
1 parent efd3563 commit 3b00bfa
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
2 changes: 1 addition & 1 deletion freepbx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Its filename must be the name of the module .tar.gz. For instance, for installin

```
runagent -m nethvoiceX
curl -L https://github.com/Stell0/apicall-freepbx/archive/refs/heads/main.tar.gz -o ../freepbx_custom_modules/apicall.tar.gz
curl -L https://github.com/Stell0/apicall-freepbx/archive/refs/heads/main.tar.gz -o ./freepbx_custom_modules/apicall.tar.gz
systemctl --user restart freepbx
```
The module will be reinstalled into container again at every restart of container
Expand Down
5 changes: 4 additions & 1 deletion imageroot/actions/create-module/05setenvs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ agent.set_env('NETHCTI_TLS_PORT', port_list[23])
agent.set_env('ASTERISK_SIP_PORT', port_list[24])
agent.set_env('ASTERISK_SIPS_PORT', port_list[25])
agent.set_env('ASTERISK_IAX_PORT', port_list[26])
agent.set_env('ASTERISK_RECORDING_SFTP_PORT', port_list[27])


# Set root password for MariaDB
# MARIADB_ROOT_PASSWORD written to passwords.env
Expand Down Expand Up @@ -160,7 +162,8 @@ passwords = {
"PHONEBOOK_LDAP_PASS": gen_password(),
"REPORTS_PASSWORD": gen_password(),
"REPORTS_API_KEY": gen_password(),
"REPORTS_SECRET": gen_password()
"REPORTS_SECRET": gen_password(),
"ASTERISK_RECORDING_SFTP_PASSWORD": gen_password()
}

agent.write_envfile("passwords.env", passwords)
3 changes: 2 additions & 1 deletion imageroot/actions/create-module/90firewall
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ agent.add_public_service(os.environ['MODULE_ID'], [
os.environ['JANUS_RTPSTART']+"-"+os.environ['JANUS_RTPEND']+"/udp", # Janus
os.environ['ASTERISK_IAX_PORT']+"/udp", # Asterisk
os.environ['PHONEBOOK_LDAP_PORT']+"/tcp", # Phonebook LDAPS
])
os.environ['ASTERISK_RECORDING_SFTP_PORT']+"/tcp", # Asterisk recordings SFTP
])

# Ignore exit code
File renamed without changes.
2 changes: 1 addition & 1 deletion imageroot/systemd/user/freepbx.service
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ExecStart=/usr/bin/podman run \
--volume=astdb:/var/lib/asterisk/db:z \
--volume=phonebookcsv:/var/lib/nethvoice/phonebook/uploads/:z \
--volume=/dev/log:/dev/log \
--volume=../freepbx_custom_modules:/freepbx_custom_modules:z \
--volume=./freepbx_custom_modules:/freepbx_custom_modules:z \
--env-file=%S/state/passwords.env \
--env=NETHVOICE* \
--env=ASTERISK_* \
Expand Down
32 changes: 32 additions & 0 deletions imageroot/systemd/user/sftpgo.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[Unit]
Description=Podman sftpgo.service
After=nginx.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
EnvironmentFile=%S/state/environment
WorkingDirectory=%S/state
Restart=always
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/sftpgo.pid %t/sftpgo.ctr-id
ExecStart=/usr/bin/podman run --conmon-pidfile %t/sftpgo.pid \
--cidfile %t/sftpgo.ctr-id --cgroups=no-conmon \
--replace \
--detach \
--name sftpgo \
--volume moh:/srv/sftpgo/data:z \
--volume sftpgo_config:/var/lib/sftpgo:Z \
--volume %S/state/sftpgo.conf.d/admin.json:/etc/sftpgo/admin.json:Z \
--env SFTPGO_LOADDATA_FROM=/etc/sftpgo/admin.json \
--env SFTPGO_HTTPD__WEB_ROOT=${TRAEFIK_PATH}\
--env-file=%S/state/passwords.env \
--user 0:0 \
${SFTPGO_IMAGE}
ExecStartPost=/usr/bin/bash -c "while [[ $(curl --request GET --url http://localhost:${SFTPGO_TCP_PORT}/healthz --header 'Accept: text/plain; charset=utf-8') != ok ]]; do sleep 3 ; done"
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/sftpgo.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/sftpgo.ctr-id
PIDFile=%t/sftpgo.pid
Type=forking

[Install]
WantedBy=default.target

0 comments on commit 3b00bfa

Please sign in to comment.