mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2025-06-08 04:25:25 +00:00
Provide reference Systemd unit file. Resolves #72
This commit is contained in:
parent
2f9fe05a76
commit
805a34c9d6
@ -67,13 +67,17 @@ This is the recommended way for Windows users.
|
||||
|
||||
### From source code
|
||||
|
||||
This is the recommended way for MacOS users and for developers.
|
||||
This is the recommended way for macOS users and for developers.
|
||||
* Install [NodeJS](https://nodejs.org/)
|
||||
* Clone this repository and open a shell in that path
|
||||
* Run `npm install` command to install FlareSolverr dependencies
|
||||
* Run `npm run build` command to compile TypeScript code
|
||||
* Run `npm start` command to start FlareSolverr
|
||||
|
||||
### Systemd service
|
||||
|
||||
We provide an example Systemd unit file `flaresolverr.service` as reference. You have to modify the file to suit your needs: paths, user and environment variables.
|
||||
|
||||
## Usage
|
||||
|
||||
Example request:
|
||||
|
@ -40,7 +40,7 @@ const version = 'v' + require('./package.json').version;
|
||||
// generate executables
|
||||
console.log('Generating executables...')
|
||||
if (fs.existsSync('bin')) {
|
||||
fs.rmdirSync('bin', { recursive: true })
|
||||
fs.rmSync('bin', { recursive: true })
|
||||
}
|
||||
execSync('pkg -t node14-win-x64,node14-linux-x64 --out-path bin .')
|
||||
// execSync('pkg -t node14-win-x64,node14-mac-x64,node14-linux-x64 --out-path bin .')
|
||||
@ -76,6 +76,9 @@ const version = 'v' + require('./package.json').version;
|
||||
archive.file('LICENSE', { name: 'flaresolverr/' + os.fsLicenseName })
|
||||
archive.file('bin/' + os.fsExec, { name: 'flaresolverr/' + os.fsZipExec })
|
||||
archive.directory('bin/puppeteer/' + os.platform + '-' + os.version + '/' + os.chromeFolder, 'flaresolverr/chrome')
|
||||
if (os.platform === 'linux') {
|
||||
archive.file('flaresolverr.service', { name: 'flaresolverr/flaresolverr.service' })
|
||||
}
|
||||
|
||||
await archive.finalize()
|
||||
}
|
||||
|
19
flaresolverr.service
Normal file
19
flaresolverr.service
Normal file
@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=FlareSolverr
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
SyslogIdentifier=flaresolverr
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
Type=simple
|
||||
User=flaresolverr
|
||||
Group=flaresolverr
|
||||
Environment="LOG_LEVEL=info"
|
||||
Environment="CAPTCHA_SOLVER=none"
|
||||
WorkingDirectory=/opt/flaresolverr
|
||||
ExecStart=/opt/flaresolverr/flaresolverr
|
||||
TimeoutStopSec=30
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
x
Reference in New Issue
Block a user