Copy misc/config.sample.yaml
as misc/config.yaml
and then edit it.
asteroid-data-dir: misc #When initializing the asteroid default data directory, it will generate three directories: 'repository', 'backup', and 'isolation'."
watch-interval: 10 #Watch every 10 seconds
site-list:
- site-name: site1 #sitename cannot be duplicated
site-dir: D:\site1 #Specify the site directory to watch
include-ext: ['.php','.asp'] #Specify the file extensions to watch. Leave [] to watch all files
exclude-dir: #Ignore watch directories. Leave [] to watch all directories
- D:\site1\exclude1
- D:\site1\exclude2
- site-name: site2
site-dir: D:\site2
include-ext: ['.php','.config'] #Watch file with the extensions *.php and *.config. Leave [] to watch all files
exclude-dir:
- D:\site2\exclude1
- D:\site2\exclude2
telegram:
api-url: https://api.telegram.org
token: 123:xxxxx
chat-id: -123
enable: true
email:
host: smtp.exmail.qq.com
port: 465
username: [email protected]
password: 123456
enable: true
email-to:
- [email protected]
- [email protected]
- Move the
asteroid.exe
file and themisc
directory to the parent level ofD:\site1
, such asD:
(assumingD:\site1
is the desired directory). - Open a terminal window, such as Command Prompt (cmd) or PowerShell.
all
can be replace as the specify site name, such as site1
.
asteroid.exe --act init --site all
asteroid.exe --act watch --site all
asteroid.exe --act uninstall --site all
Reset will reinitialize all data
asteroid.exe --act reset
In windows, you can use NSSM to install asteroid
as system service.
Please initialize the data first ! (Refer to
How to run
>Init data
)
For example, asteroid was placed on D drive. Install a service as follows.
nssm install asteroid "D:\asteroid.exe" "--act watch" "--site all"
Please run the program after it has been initialized.
Start service.
nssm start asteroid
While the service is running,you can check logs in the logs/{date}.log
to ensure the service is actually running.
Start,stop,restart,remove the service.
nssm stop asteroid
nssm restart asteroid
nssm remove asteroid confirm
cd build/linux/
chmod +x *.sh
Please refer to the configuration of Windows OS.
Please initialize the data first ! (Refer to
How to run
>Init data
)
./install.sh
./uninstall.sh