Skip to content

Commit 32e1be0

Browse files
committed
review address
Signed-off-by: Sagar <sagargurung1001@gmail.com>
1 parent 00f3d76 commit 32e1be0

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ For the manual installation of `OpenProject` as an external application of `Next
55

66
### 1. Install `app_api` application
77

8-
Assuming you’re in the apps folder of Nextcloud with command git:
8+
Assuming you’re in the apps folder directory:
99

1010
- Clone
1111
```bash
12-
git clone https://github.com/cloud-py-api/app_api.git
12+
git clone https://github.com/nextcloud/app_api.git
1313
```
1414
- build
1515
```bash
1616
cd app_api
1717
npm ci && npm run dev
1818
```
1919
- Enable the `app_api`
20-
2120
```bash
2221
# Assuming you’re in nextcloud server root directory
2322
sudo -u www-data php occ a:e app_api
@@ -26,7 +25,7 @@ Assuming you’re in the apps folder of Nextcloud with command git:
2625
### 2. Register deploy daemons (In Nextcloud)
2726

2827
- Navigate to `Administration Settings > AppAPI`
29-
- Click register daemons
28+
- Click `Register Daemon`
3029
- Select `Manual Install` for Daemon configuration template
3130
- Put `manual_install` for name and display name
3231
- Deployment method as `manual-install`
@@ -40,24 +39,22 @@ After the setup, run `OpenProject` locally with the given command line.
4039
>NOTE: while running the below bash command line for `NC_SUB_FOLDER` put the sub folder path if you are running nextcloud in a sub folder else do remove it.
4140

4241
```bash
43-
OPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_USER=apiadmin \
44-
OPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_PASSWORD=apiadmin \
42+
# the reason to set relative path with NC_SUB_FOLDER is it makes easy to change when there is redirection url in response
4543
OPENPROJECT_RAILS__RELATIVE__URL__ROOT=/<NC_SUB_FOLDER>/index.php/apps/app_api/proxy/openproject-nextcloud-app \
46-
OPENPROJECT_2FA_DISABLED=false \
4744
foreman start -f Procfile.dev
4845
```
4946

5047
### 4. Configure and Run External `openproject-nextcloud-app` application
51-
Assuming you’re in the apps folder of Nextcloud with command git:
48+
Assuming you’re in the apps folder directory:
5249

5350
- Clone
5451
```bash
5552
git clone https://github.com/JankariTech/openproject-nextcloud-app.git
5653
```
5754
- Configure script before running external app
5855
```bash
59-
cd openproject-nextcloud-app
60-
cp ex_app_run_script.sh.example ex_app_run_script.sh
56+
cd openproject-nextcloud-app
57+
cp ex_app_run_script.sh.example ex_app_run_script.sh
6158
```
6259
Once you have copied the script to run the external application, configure the following environments
6360

@@ -73,6 +70,12 @@ Assuming you’re in the apps folder of Nextcloud with command git:
7370
- OP_BACKEND_URL is the url in which `OpenProject` is up and running
7471
- NEXTCLOUD_URL the url in which `Nextcloud` is up and running
7572

73+
- Install required Python packages to run external application `openproject-nextcloud-app`
74+
```bash
75+
# Make sure that you have python3 installed in your local system
76+
python3 -m pip install -r requirements.txt
77+
```
78+
7679
- Run external application with the script
7780
```bash
7881
bash ex_app_run_script.sh

lib/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async def proxy_request_to_server(request: Request, path: str):
113113
headers=headers,
114114
)
115115
else:
116-
# for getting oauth token the content-type 'application/x-www-form-urlencoded' sems to be required
116+
# for getting oauth token the content-type 'application/x-www-form-urlencoded' seems to be required
117117
if request.method == 'POST' and "/oauth/token" in url:
118118
headers.update({'content-type': 'application/x-www-form-urlencoded'})
119119
response = await client.request(
@@ -132,10 +132,10 @@ async def proxy_request_to_server(request: Request, path: str):
132132
response.headers["location"] = redirect_url
133133
response.status_code = 200
134134
elif "oauth/authorize" in url:
135-
response.headers["location"] = response.headers["location"]
135+
return response
136136
elif "apps/oauth2/authorize" in response.headers["location"]:
137-
response.headers["location"] = response.headers["location"]
138137
response.status_code = 200
138+
return response
139139
else:
140140
headers["content-length"] = "0"
141141
response = await handle_redirects(

0 commit comments

Comments
 (0)