Skip to content

Commit 2562efd

Browse files
Ron-Zarbyteadmdly
authored andcommitted
#1583 remote installation dev workflow
1 parent a3a6eec commit 2562efd

File tree

4 files changed

+91
-11
lines changed

4 files changed

+91
-11
lines changed

pages/docs/contribution-handbook/developer-workflow.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import { faServer, faBoxOpen, faBolt, faRobot, faHand, faCircleInfo } from '@for
1212
# Developer Workflow
1313

1414
<Callout type="info" emoji={<FontAwesomeIcon icon={faCircleInfo} />}>
15-
This section is a work in progress. Some sections may be incomplete or missing. To contribute to this page, refer to [Issue #1583](https://github.com/FOSSBilling/FOSSBilling/issues/1583).
15+
This section is a work in progress. Some sections may be incomplete or missing. Feedback is appreciated.
1616
</Callout>
1717

18-
This guide will walk you through setting up your development environment and submitting your first pull request.
18+
This guide will walk you through setting up your development environment and submitting your first pull request.
1919

2020
## Prepare Code
2121

@@ -30,11 +30,8 @@ There are multiple ways to set up your environment. Choose the one that works be
3030
Proceed to the next section once your environment is configured.
3131

3232
<Cards>
33-
<Card icon={<FontAwesomeIcon icon={faDocker} size="xl" />} title="Docker" href="/docs/contribution-handbook/developer-workflow/docker"/>
34-
<Card icon={<FontAwesomeIcon icon={faWindows} size="xl" />} title="WSL" href="/docs/contribution-handbook/developer-workflow/wsl"/>
35-
<Card icon={<FontAwesomeIcon icon={faCpanel} size="xl" />} title="Shared (cPanel/Plesk)" href="/docs/contribution-handbook/developer-workflow/shared"/>
36-
<Card icon={<FontAwesomeIcon icon={faServer} size="xl" />} title="Linux &amp; Apache" href="/docs/contribution-handbook/developer-workflow/apache"/>
37-
<Card icon={<FontAwesomeIcon icon={faServer} size="xl" />} title="Linux &amp; NGINX" href="/docs/contribution-handbook/developer-workflow/nginx"/>
33+
<Card icon={<FontAwesomeIcon icon={faServer} size="xl" />} title="Remote Installation" href="/docs/contribution-handbook/developer-workflow/remote"/>
34+
<Card icon={<FontAwesomeIcon icon={faDocker} size="xl" />} title="Docker (Local)" href="/docs/contribution-handbook/developer-workflow/docker"/>
3835
</Cards>
3936

4037
## Modifying Code
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
"remote": "Remote Installation",
23
"docker": "Docker"
34
}

pages/docs/contribution-handbook/developer-workflow/docker.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@ import { faHand, faCircleInfo } from '@fortawesome/free-solid-svg-icons'
1010
# Docker
1111

1212
<Callout type="error" emoji={<FontAwesomeIcon icon={faHand} />}>
13-
This guide is for setting up a local development environment only. Some configurations are not ideal for production use. Do not expose this enviornment to the public unless you know what you are doing.
13+
This guide is for setting up a streamlined local development environment only. Some configurations are not ideal for production use. Do not expose this enviornment to the public unless you know what you are doing.
1414

15-
Some functionality may require remote external connections to be active, such as webhooks, payment notifications, or other cases where a third party needs to be able to reach FOSSBilling. This development environment will not allow you to develop or work with those features. If this is important to you, consider an alternate workflow, or change workflows later once you are more familiar with the codebase.
15+
Some functionality may require remote external connections to be active, such as webhooks, payment notifications, or other cases where a third party needs to be able to reach FOSSBilling. This development environment will not allow you to develop or work with those features.
16+
17+
If you need to create a publicly accessible environment, refer to [Remote Installation](/docs/contribution-handbook/developer-workflow/remote) instead.
1618
</Callout>
1719

1820
## Requirements
1921

2022
You will need:
2123

22-
1. [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed.
23-
2. Your own forked FOSSBilling repository already downloaded.
24+
1. Your own forked FOSSBilling repository already cloned on your development workstation.
25+
2. [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed.
2426

2527
## Docker Configs
2628

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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

Comments
 (0)