InvoicePlane

来自 ArchWiki

InvoicePlane 是一个自托管的开源应用程序,用于管理您的报价单、发票、客户和付款。

安装

安装 invoiceplaneAUR 软件包。

配置

数据库

以下是如何使用 MariaDB 为 Invoiceplane 设置名为 invoiceplane 的数据库,用户名为 invoiceplane,密码为 password 的示例

CREATE DATABASE invoiceplane;
GRANT ALL PRIVILEGES ON invoiceplane.* TO invoiceplane@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

Web 服务器

Apache

创建 Apache HTTP 服务器 配置文件

/etc/httpd/conf/extra/invoiceplane.conf
Alias /invoiceplane "/usr/share/webapps/invoiceplane"
<Directory "/usr/share/webapps/invoiceplane">
    DirectoryIndex index.php
    AllowOverride All
    Options FollowSymlinks
    Require all granted
</Directory>

并将其包含在 /etc/httpd/conf/httpd.conf

# InvoicePlane configuration
Include conf/extra/invoiceplane.conf

Lighttpd

在您的 Lighttpd 配置文件中为 invoiceplane 创建一个别名。

 alias.url = ( "/invoiceplane" => "/usr/share/webapps/invoiceplane/")

然后在 server.modules 部分启用 mod_aliasmod_fastcgimod_cgi

nginx

以下是一个示例配置,用于包含在 nginx.conf 中,用于带有 php-fpm 的子域名

/etc/nginx/sites-available/invoiceplane.conf
server {

listen 443 ssl http2;
listen [::]:443 ssl http2;

        add_header X-Frame-Options "SAMEORIGIN";

        root /usr/share/webapps/invoiceplane;
        index index.php;
                                                                                                       
        server_name invoice.''domain.tld'';

        client_body_timeout 60;

    location / {
        try_files $uri $uri/ /index.php?q=$uri&$args;       
    }

    location ~ \.php$ {
        fastcgi_param PHP_ADMIN_VALUE open_basedir=/tmp:/usr/share/webapps/invoiceplane:/dev/urandom:/usr/share/php;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
        client_max_body_size 100M;
    }
}

显式允许 php-fpm 访问 InvoicePlane 目录

自 7.4 版本以来,php-fpm 默认进行了安全加固,并撤销了对 /usr(和子目录)的读/写访问权限。 因此,也有必要显式授予对 /usr/share/webapps/invoiceplane 目录的权限。

php-fpm.service 创建一个 drop-in 文件

添加并使用以下内容保存它

/etc/systemd/system/php-fpm.service.d/override.conf
[Service]
ReadWritePaths = /usr/share/webapps/invoiceplane/ipconfig.php
ReadWritePaths = /usr/share/webapps/invoiceplane/uploads/
ReadWritePaths = /usr/share/webapps/invoiceplane/application/logs
ReadWritePaths = /usr/share/webapps/invoiceplane/vendor/mpdf/mpdf/tmp

之后,重启 php-fpm 服务并为 http 用户分配写入权限。

安装向导

数据库和 Web 服务器设置完成后,访问安装向导页面 http://your-invoiceplane-domain.com/index.php/setup 并按照说明进行操作。

本地化

如果您想选择英语以外的其他语言,请访问 翻译/本地化

参见