1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00
invoiceninja/docs/configure.rst

150 lines
6.1 KiB
ReStructuredText
Raw Normal View History

2017-01-26 16:19:44 +01:00
Configure
=========
2017-01-26 19:08:48 +01:00
Review the `.env.example <https://github.com/invoiceninja/invoiceninja/blob/master/.env.example>`_ file to see additional settings.
2017-01-26 16:19:44 +01:00
Recurring invoices and reminder emails
""""""""""""""""""""""""""""""""""""""
2017-12-10 13:08:49 +01:00
Create a cron to call the ``ninja:send-invoices`` and ``ninja:send-reminders`` commands **once daily**.
2017-01-26 16:19:44 +01:00
2017-01-26 16:37:35 +01:00
.. code-block:: shell
2017-01-26 16:19:44 +01:00
2017-12-10 13:08:49 +01:00
0 8 * * * /usr/local/bin/php /path/to/ninja/artisan ninja:send-invoices
2017-01-26 16:37:35 +01:00
0 8 * * * /usr/local/bin/php /path/to/ninja/artisan ninja:send-reminders
2017-01-26 16:19:44 +01:00
2017-02-02 13:14:32 +01:00
Email Queues
""""""""""""
2017-02-02 13:24:27 +01:00
When sending an email in the app the default behavior is to wait for the response, you can use queues to improve the perceived performance. To enable the feature add ``QUEUE_DRIVER=database`` or ``QUEUE_DRIVER=redis`` to the .env file.
2017-02-02 13:14:32 +01:00
2017-02-19 13:09:10 +01:00
.. Note:: You can process the jobs by running ``php artisan queue:listen`` or ``php artisan queue:work --daemon``.
2017-02-02 13:14:32 +01:00
2017-01-26 16:19:44 +01:00
Postmark bounce and open notifications
""""""""""""""""""""""""""""""""""""""
Include the following two setting in the .env file, the rest of the email settings can be commented out.
2017-01-26 16:37:35 +01:00
.. code-block:: shell
2017-01-26 16:19:44 +01:00
2017-01-26 16:37:35 +01:00
POSTMARK_API_TOKEN=
MAIL_FROM_ADDRESS=
2017-01-26 16:19:44 +01:00
In your Postmark account settings make sure Open tracking is enabled and enter the following values under Settings > Outbound.
- Bounce webhook: https://invoices.example.com/hook/email_bounced
- Open webhook: https://invoices.example.com/hook/email_opened
Social/One-Click Login
""""""""""""""""""""""
Create an application in either Google, Facebook, GitHub or LinkedIn and then set the client id, secret and redirect URL in the .env file. For example:
2017-01-26 16:37:35 +01:00
.. code-block:: shell
2017-01-26 16:19:44 +01:00
2017-01-26 16:37:35 +01:00
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
2017-12-31 10:08:46 +01:00
GOOGLE_OAUTH_REDIRECT=http://ninja.test/auth/google
2017-01-26 16:19:44 +01:00
PhantomJS
"""""""""
2017-05-23 21:00:40 +02:00
There are two methods to attach PDFs to emails sent by background processes: phantomjscloud.com or local PhantomJS install.
2017-01-26 16:19:44 +01:00
2017-05-23 21:00:40 +02:00
To use phantomjscloud.com check for the following line in the .env file.
2017-01-26 16:37:35 +01:00
2017-05-23 21:00:40 +02:00
.. code-block:: shell
2017-01-26 16:19:44 +01:00
2017-05-23 21:00:40 +02:00
PHANTOMJS_CLOUD_KEY='a-demo-key-with-low-quota-per-ip-address'
2017-02-20 20:20:14 +01:00
2017-05-23 21:00:40 +02:00
To use a local PhantomJS install add ``PHANTOMJS_BIN_PATH=/usr/local/bin/phantomjs``.
2017-02-19 13:09:10 +01:00
2017-05-23 21:00:40 +02:00
Troubleshooting
---------------
2017-03-27 10:43:47 +02:00
2017-05-30 12:04:57 +02:00
- Check storage/logs/laravel-error.log for relevant errors.
2017-05-23 21:00:40 +02:00
- To determine the path you can run ``which phantomjs`` from the command line.
- We suggest using PhantomJS version >= 2.1.1, users have reported seeing 'Error: 0' with older versions.
2017-12-07 08:10:55 +01:00
- You can use `this script <https://raw.githubusercontent.com/invoiceninja/invoiceninja/develop/resources/test.pjs>`_ to test from the command line, change ``__YOUR_LINK_HERE__`` to the link in the error and then run ``phantomjs test.pjs``.
2018-02-13 20:59:10 +01:00
- You may need to add an entry in the /etc/hosts file to resolve the domain name.
2017-05-23 21:00:40 +02:00
- If you require contacts to enter a password to see their invoice you'll need to set a random value for ``PHANTOMJS_SECRET``.
2017-07-31 11:55:51 +02:00
- If you're using a proxy and/or self-signed certificate `this comment <https://github.com/invoiceninja/dockerfiles/issues/39#issuecomment-282489039>`_ may help.
2017-08-01 10:26:40 +02:00
- If you're using a custom design try using a standard one, if the PDF is outside the printable area it can fail.
2017-02-19 13:09:10 +01:00
2017-01-26 16:19:44 +01:00
Custom Fonts
""""""""""""
2017-03-14 16:45:36 +01:00
Follow these steps to add custom ttf fonts: ie, `Google fonts <https://www.google.com/get/noto/>`_
2017-01-26 16:19:44 +01:00
- Create a new folder in ``public/fonts/invoice-fonts/`` and copy over the ttf files
- Run ``grunt dump_dir``
- Add the font to ``database/seeds/FontsSeeder.php``
- Run ``php artisan db:seed --class=FontsSeeder``
- Clear the cache by adding ``?clear_cache=true`` to the end of the URL
2017-03-07 14:19:20 +01:00
Omnipay
"""""""
2017-11-24 09:57:42 +01:00
We use `Omnipay <https://github.com/thephpleague/omnipay#payment-gateways>`_ to support our payment gateway integrations.
2017-03-07 14:19:20 +01:00
2017-11-24 09:57:42 +01:00
Follow these steps to add a custom driver.
2017-03-07 14:19:20 +01:00
2017-11-24 09:57:42 +01:00
- Run ``composer require <package_name>``
2017-03-07 14:19:20 +01:00
- Add a row to the gateways table. ``name`` is used in the gateway select, ``provider`` needs to match the Omnipay driver name
- Clear the cache by adding ``?clear_cache=true`` to the end of the URL
.. NOTE:: Most drivers also require `code changes <https://github.com/invoiceninja/invoiceninja/tree/master/app/Ninja/PaymentDrivers>`_ to work correctly.
2017-12-01 08:46:15 +01:00
Security
""""""""
To require a password to update the app add ``UPDATE_SECRET=random_value`` to the .env file and then use /update?secret=random_value to update.
2017-12-26 15:42:46 +01:00
By default the app clears the session when the browser is closed and automatically logs the user out after 8 hours. This can be modified by setting ``REMEMBER_ME_ENABLED`` and ``AUTO_LOGOUT_SECONDS`` in the .env file.
2017-12-01 08:46:15 +01:00
2017-12-26 15:42:46 +01:00
To include a secret when notifying subscriptions add ``SUBSCRIPTION_SECRET=random_value`` to the .env file.
2017-12-01 08:46:15 +01:00
2017-01-26 16:19:44 +01:00
Google Map
""""""""""
2017-05-22 11:45:07 +02:00
You need to create a `Google Maps API <https://developers.google.com/maps/documentation/javascript/get-api-key>`_ key for the Javascript, Geocoding and Embed APIs and then add ``GOOGLE_MAPS_API_KEY=your_key`` to the .env file.
2017-01-26 16:19:44 +01:00
You can disable the feature by adding ``GOOGLE_MAPS_ENABLED=false`` to the .env file.
2017-04-19 22:27:10 +02:00
Voice Commands
""""""""""""""
2017-04-19 22:36:27 +02:00
Supporting voice commands requires creating a `LUIS.ai <https://www.luis.ai/home/index>`_ app, once the app is created you can import this `model file <https://download.invoiceninja.com/luis.json>`_.
2017-04-19 22:27:10 +02:00
You'll also need to set the following values in the .env file.
.. code-block:: shell
SPEECH_ENABLED=true
MSBOT_LUIS_APP_ID=...
MSBOT_LUIS_SUBSCRIPTION_KEY=...
2017-10-18 13:01:53 +02:00
Lock Invoices
"""""""""""""
Adding ``LOCK_SENT_INVOICES=true`` to the .env file will prevent changing an invoice once it has been sent.
2017-01-26 16:19:44 +01:00
Using a Proxy
"""""""""""""
If you need to set a list of trusted proxies you can add a TRUSTED_PROXIES value in the .env file. ie,
2017-01-26 16:37:35 +01:00
.. code-block:: shell
TRUSTED_PROXIES='10.0.0.0/8,172.16.0.0/12,192.168.0.0/16'
2017-01-26 16:19:44 +01:00
2017-01-26 16:19:44 +01:00
Customizations
""""""""""""""
Our `developer guide <https://www.invoiceninja.com/knowledgebase/developer-guide/>`_ has more details about our applications codebase.
You can add currencies and date/time formats by adding records to their respective tables in the database. This data is cached, to clear it load any page with ``?clear_cache=true`` added to the end of the URL.
The JavaScript and CSS files are compiled to built files, you can recompile them by running bower install and then ``gulp``.