Skip to content

Commit b941d34

Browse files
committed
Annotate scripts
1 parent 36ca010 commit b941d34

File tree

1 file changed

+53
-9
lines changed

1 file changed

+53
-9
lines changed

docs/admin/CLI.md

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Helpers
33
---
44
ApisCP provides a variety of command-line helpers that allow you to interact with your accounts. For example, you may want to put the panel in [headless mode](https://github.com/apisnetworks/apnscp-playbooks#toggling-headless-mode), which disables web-based access, automate account management, or even too run a command as another site.
55

6-
All helpers live under `/usr/local/apnscp/bin`. All commands except for `cpcmd` must be run as root. `sudo su -` is a quick way to become root if you aren't already.
6+
All helpers live under `{{ $themeConfig.APNSCP_ROOT }}/bin`. All commands except for `cpcmd` must be run as root. `sudo su -` is a quick way to become root if you aren't already.
77

88
::: tip
99
*Domain binaries: AddDomain, EditDomain, DeleteDomain, ActivateDomain, and SuspendDomain are covered in [Plans.md](Plans.md). ImportDomain and ExportDomain are covered in [Migrations.md](Migrations.md). This document covers other helpers.
@@ -156,39 +156,83 @@ get_site_id example.com
156156
```
157157

158158
## Scripts
159-
All ApisCP scripts are available under `{{ $themeConfig.APNSCP_ROOT }}/bin/scripts`. All scripts make use of the apnscp CLI framework and require invocation with `apnscp_php` to operate.
159+
All ApisCP scripts are available under `{{ $themeConfig.APNSCP_ROOT }}/bin/scripts`. All scripts make use of the ApisCP CLI framework and require invocation with `apnscp_php` to operate.
160160

161-
### change_dns.php
161+
### backup_dbs.php
162+
163+
Perform bulk database backups. This can be manually invoked before a [system backup](./Backups#triggering-database-backups) to ensure a fresh export of databases.
164+
165+
### ban_spam.sh
162166

163-
Bulk change DNS for an account.
167+
Blocks any IP addresses with more than 100 open connections to a server.
164168

165169
### changelogparser.php
166170

167-
Summarize apnscp changes.
171+
Summarize ApisCP changes from `git log`.
172+
173+
### change_dns.php
174+
175+
Bulk change DNS for an account. IPs may be changed for a single domain by specifying `-d DOMAIN` or for all accounts for which DNS is enabled by specifying `--all`.
176+
177+
```bash
178+
cd /usr/local/apnscp/bin/scripts
179+
# Reduce TTL for all domains to 15 seconds
180+
./change_dns.php --all --ttl=15
181+
182+
# For all IPs that match "site:ip-address" change the IP to 45.12.23.4
183+
./change_dns.php -d site1 --new=45.12.23.4
184+
# Command above is equivalent to...
185+
./change_dns.php -d site1 --old="$(cpcmd -d site1 site:ip-address)"--new=45.12.23.4
186+
187+
# Change IP address for all sites that match old IP address 1.2.3.4. If changed, set a TTL value of 2 hours
188+
./change_dns.php --all --old=1.2.3.4 --new=3.4.5.6 --ttl=7200
189+
```
190+
191+
This is a simpler version of [bulk DNS](./DNS.md#bulk-record-management) boilerplate.
192+
193+
### mapCheck.php
194+
195+
[Map](./Maps) helper.
196+
197+
### metricscron.php
198+
199+
[Metrics](./Metrics) compression/rollover helper.
200+
201+
### platformScrub.php
202+
203+
Wrapper for monthly invocation of [upcp -sb](../UPGRADING#upcp-update-helper).
168204

169205
### reissueAllCertificates.php
170206

171207
Perform a bulk reissue of all certificates. See [SSL.md](SSL.md) for further information.
172208

209+
### storagelog.sh
210+
211+
Periodic storage logging.
212+
173213
### transfersite.php
174214

175215
Migrate an ApisCP site between servers. See [Migrations](Migrations - server.md) for further information.
176216

217+
### uidCheck.php
218+
219+
Similar to mapCheck.php, scans a system for inconsistencies in UID/GID attached to accounts.
220+
177221
### yum-post.php
178222

179-
Synchronize a system back into FST.
223+
[Synchronize packages](./Filesystem#filesystem-template) into FST.
180224

181225
## Build scripts
182226

183227
### build/php/php.config
184228

185-
Build PHP for apnscp. To run, change into PHP source directory, then run:
229+
Build PHP for ApisCP. To run, change into PHP source directory, then run:
186230

187231
`{{ $themeConfig.APNSCP_ROOT }}/build/php/php.config`
188232

189-
PHP will be built with apnscp module requirements.
233+
PHP will be built with ApisCP module requirements.
190234

191235
### build/httpd/apxs
192-
General utility apxs wrapper to build modules specifically for apnscp. Installed modules will be placed under `sys/httpd/private/modules`. Unless the module conflicts with global Apache instance, modules can be used from `sys/httpd/modules`, which is a symlink to `/usr/lib64/httpd/modules`.
236+
General utility apxs wrapper to build modules specifically for ApisCP. Installed modules will be placed under `sys/httpd/private/modules`. Unless the module conflicts with global Apache instance, modules can be used from `sys/httpd/modules`, which is a symlink to `/usr/lib64/httpd/modules`.
193237

194238

0 commit comments

Comments
 (0)