net-misc/aliyundrive-webdav: add env file

This commit is contained in:
123485k 2023-03-18 16:04:25 +08:00 committed by 梁永祥
parent de356c812e
commit df52f2ac08
3 changed files with 62 additions and 2 deletions

View File

@ -290,7 +290,13 @@ CRATES="
zip-0.6.4
"
inherit cargo systemd
inherit cargo systemd readme.gentoo-r1
DOC_CONTENTS="After install, please copy
/etc/aliyundrive-webdav/aliyundrive-webdav.env.example
to /etc/aliyundrive-webdav/aliyundrive-webdav.env
to set REFRESH_TOKEN, WEBDAV_AUTH_USER, WEBDAV_AUTH_PASSWORD etc.
You can change ALIYUNDRIVE_WEBDAV_FLAGS to add more flags for aliyundrive-webdav"
DESCRIPTION="WebDAV server for AliyunDrive"
# Double check the homepage as the cargo_metadata crate
@ -316,5 +322,12 @@ QA_FLAGS_IGNORED="usr/bin/${PN}"
src_install()
{
cargo_src_install
systemd_newunit systemd.service aliyundrive-webdav.service
systemd_dounit "${FILESDIR}/${PN}.service"
insinto "/etc/${PN}"
doins "${FILESDIR}/${PN}.env.example"
readme.gentoo_create_doc
}
pkg_postinst() {
elog "${DOC_CONTENTS}"
}

View File

@ -0,0 +1,34 @@
#### aliyundrive-webdav env file
## HOST: Listen host [default: 0.0.0.0]
#HOST=0.0.0.0
## PORT: Listen port [default: 8080]
#PORT=8080
## CLIENT_ID: Aliyun drive client_id
#CLIENT_ID=
## CLIENT_SECRET: Aliyun drive client_secret
#CLIENT_SECRET=
## REFRESH_TOKEN: Aliyun drive refresh token
#REFRESH_TOKEN=
## WEBDAV_AUTH_USER: WebDAV authentication username
#WEBDAV_AUTH_USER=
## WEBDAV_AUTH_PASSWORD: WebDAV authentication password
#WEBDAV_AUTH_PASSWORD=
## TLS_CERT: TLS certificate file path
#TLS_CERT=
## TLS_KEY: TLS private key file path
#TLS_KEY=
## WEBDAV_STRIP_PREFIX: Prefix to be stripped off when handling request
#WEBDAV_STRIP_PREFIX=
## ALIYUNDRIVE_WEBDAV_FLAGS: Allow users to override command-line options
#ALIYUNDRIVE_WEBDAV_FLAGS=

View File

@ -0,0 +1,13 @@
[Unit]
Description=AliyunDrive WebDAV
After=network.target
[Service]
EnvironmentFile=/etc/aliyundrive-webdav/aliyundrive-webdav.env
Type=simple
ExecStart=/usr/bin/aliyundrive-webdav --auto-index -w /var/aliyundrive-webdav $ALIYUNDRIVE_WEBDAV_FLAGS
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target