|
| 1 | +--- |
| 2 | +title: Remote Installation |
| 3 | +description: Setting up your FOSSBilling development environment as a remote installation. |
| 4 | +--- |
| 5 | + |
| 6 | +import { Callout } from 'nextra-theme-docs' |
| 7 | +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' |
| 8 | +import { faCircleInfo } from '@fortawesome/free-solid-svg-icons' |
| 9 | + |
| 10 | + |
| 11 | +# Remote Installation |
| 12 | + |
| 13 | +## Requirements |
| 14 | + |
| 15 | +You will need: |
| 16 | + |
| 17 | +1. Your own forked FOSSBilling repository already cloned on your development workstation. |
| 18 | +2. A remote hosting service meeting the appropriate system requirements. Installation instructions and options are available [here](http://localhost:3000/docs/getting-started). |
| 19 | + |
| 20 | +<Callout type="info" emoji={<FontAwesomeIcon icon={faCircleInfo} />}> |
| 21 | + For the purposes of developer workflow, ignore the sections regarding downloading and uploading FOSSBilling files. This workflow guide replaces that process. |
| 22 | +</Callout> |
| 23 | + |
| 24 | +## General Workflow |
| 25 | + |
| 26 | +1. Modify relevant files via your locally cloned repository. |
| 27 | +2. Use a File Sync method to sync your modified files into your remote installation. |
| 28 | +3. Visit your remote installation to test and debug. |
| 29 | +4. Refer back to [Developer Workflow](/docs/contribution-handbook/developer-workflow) for submitting commits and pull requests. |
| 30 | + |
| 31 | +## File Sync Methods |
| 32 | + |
| 33 | +You can use any of these methods to sync files into your remote installation. Use the method that works best for you. |
| 34 | + |
| 35 | +All methods involve copying the `src/` folder from your local repository into the public folder for your remote installation, refered to as `www`. All examples assume you are working from the project root directory. |
| 36 | + |
| 37 | + |
| 38 | +### Command Line: rsync |
| 39 | + |
| 40 | +Utilize [rsync](https://linux.die.net/man/1/rsync) via command line to sync only files that have changed. |
| 41 | + |
| 42 | +``` |
| 43 | +rsync -ahP src/ user@domainorip:/path/to/www |
| 44 | +``` |
| 45 | + |
| 46 | +Add the `-I` flag to force sync all files regardless of changes: |
| 47 | + |
| 48 | +``` |
| 49 | +rsync -ahPI src/ user@domainorip:/path/to/www |
| 50 | +``` |
| 51 | + |
| 52 | +To skip uploading the `src/install` folder, use the `--exclude` flag: |
| 53 | + |
| 54 | +``` |
| 55 | +rsync -ahPI --exclude 'src/install' src/ user@domainorip:/path/to/www |
| 56 | +``` |
| 57 | + |
| 58 | +Use [explain shell](https://explainshell.com/explain?cmd=rsync+-ahPI+--exclude+%27src%2Finstall%27+src%2F+user%40domainorip%3A%2Fpath%2Fto%2Fwww) for an interactive description. |
| 59 | + |
| 60 | +### FTP / SFTP GUI |
| 61 | + |
| 62 | +Use a FTP/SFTP client with a GUI such as [FileZilla](https://filezilla-project.org/download.php). |
| 63 | + |
| 64 | +Once connected, simply drag and drop your updates into your remote `www` folder. |
| 65 | + |
| 66 | +### Visual Studio Code |
| 67 | + |
| 68 | +Use the inline terminal to run your required sync commands or scripts. This allows you to edit and deploy all from one area. |
| 69 | + |
| 70 | +For a more interactive but still inline solution, consider an extension like [SFTP](https://marketplace.visualstudio.com/items?itemName=Natizyskunk.sftp) to help automatically sync your code on each change. |
| 71 | + |
| 72 | +## Install Folder Handling |
| 73 | + |
| 74 | +Syncing in your local repository into an existing FOSSBilling installation will cause the `src/install/` folder to reappear. An error will be thrown in FOSSBilling requesting you to delete the `install` folder. |
| 75 | + |
| 76 | +You have a few options to work around this. Pick one of the following: |
| 77 | + |
| 78 | +1. Skip uploading the `src/install` folder when you upload your latest files. |
| 79 | +2. Manually delete your remote `www/install` folder each time after uploading. |
| 80 | +3. Set `'debug' => true,` in your `config.php`. This will bypass the restriction and allow you to access FOSSBilling without deleting the `www/install` folder. You will still be shown warnings inside the UI to delete the folder, but the UI will be functional. |
0 commit comments