Skip to content

updated "start.sh" with fix for "host" network mode #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>
<![CDATA[Simplest skeleton of the Nextcloud application written in python]]>
</description>
<version>3.0.0</version>
<version>3.0.1</version>
<licence>MIT</licence>
<author mail="[email protected]" homepage="https://github.com/bigcat88">Alexander Piskun</author>
<namespace>PyAppV2_skeleton</namespace>
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nc_py_api[app]>=0.19.0
nc_py_api[app]>=0.19.1
23 changes: 14 additions & 9 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

set -e

# Only create a config file if HP_SHARED_KEY is set.
Expand All @@ -19,11 +22,12 @@ transport.tls.serverName = "harp.nc"
metadatas.token = "$HP_SHARED_KEY"

[[proxies]]
name = "$APP_ID"
type = "tcp"
localIP = "127.0.0.1"
localPort = $APP_PORT
remotePort = $APP_PORT
type = "tcp"
name = "$APP_ID"
[proxies.plugin]
type = "unix_domain_socket"
unixPath = "/tmp/exapp.sock"
EOF
else
echo "Directory /certs/frp not found. Creating configuration without TLS certificates."
Expand All @@ -36,11 +40,12 @@ transport.tls.enable = false
metadatas.token = "$HP_SHARED_KEY"

[[proxies]]
name = "$APP_ID"
type = "tcp"
localIP = "127.0.0.1"
localPort = $APP_PORT
remotePort = $APP_PORT
type = "tcp"
name = "$APP_ID"
[proxies.plugin]
type = "unix_domain_socket"
unixPath = "/tmp/exapp.sock"
EOF
fi
else
Expand All @@ -53,6 +58,6 @@ if [ -f /frpc.toml ] && [ -n "$HP_SHARED_KEY" ]; then
frpc -c /frpc.toml &
fi

# Start the main Python application
# Start the main application (adjust it for your ExApp)
echo "Starting main application..."
exec python3 main.py