Skip to content
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 .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ENV=development
NC_VERSION=31
NC_VERSION=33
APP_URL=localhost
API_URL=https://hejbit.local

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
uses: appleboy/ssh-action@master
with:
host: ${{ vars.STAGING_SERVER_HOST }}
username: deploy
username: ${{ vars.STAGING_SERVER_USER }}
key: ${{ secrets.STAGING_SSH_PRIVATE_KEY }}
proxy_host: ${{ vars.STAGING_PROXY_HOST }}
proxy_username: ${{ vars.STAGING_PROXY_USER }}
proxy_key: ${{ secrets.STAGING_PROXY_SSH_PRIVATE_KEY }}
script: bash deploy
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ js/nextcloud-swarm-plugin*.*

# IDE
.idea
.history

# OS
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This plugin integrates [Swarm](https://www.ethswarm.org/) (a decentralized, bloc

Before using the plugin, ensure you have the following:

- An active Nextcloud instance (version 31 or 32)
- An active Nextcloud instance (version 32 or 33)
- A valid Access Key and URL to activate the service
- [Get Your Free Trial for the Nextcloud Swarm Plugin](https://app.hejbit.com)

Expand Down
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This plugin integrates [Swarm](https://www.ethswarm.org/) (a decentralized, bloc

Before using the plugin, ensure you have the following:

- An active Nextcloud instance (version 31 or 32)
- An active Nextcloud instance (version 32 or 33)
- A valid Access Key and URL to activate the service
- [Get Your Free Trial for the Nextcloud Swarm Plugin](https://app.hejbit.com)

Expand Down Expand Up @@ -104,7 +104,7 @@ This program is licensed under the AGPLv3 or later.
<repository type="git">https://github.com/MetaProvide/nextcloud-swarm-plugin.git</repository>
<screenshot>https://raw.githubusercontent.com/MetaProvide/nextcloud-swarm-plugin/main/assets/images/swarm_Files.png</screenshot>
<dependencies>
<nextcloud min-version="31" max-version="32"/>
<nextcloud min-version="32" max-version="33"/>
</dependencies>
<settings>
<admin>OCA\Files_External_Ethswarm\Settings\Admin</admin>
Expand Down
43 changes: 28 additions & 15 deletions cli/staging/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ action() {

deploy() {
local version=$1
cd hejbit-"$version" || failed "hejbit-$version not found"
cd "/opt/hejbit/hejbit-$version" || failed "$version" "/opt/hejbit/hejbit-$version not found"

buffer "$(log_note "deploying hejbit-$version")"

Expand All @@ -85,6 +85,24 @@ sync_code() {
git pull 2>&1 || return 1
}

setup_node() {
command -v npm > /dev/null 2>&1 && return 0

export NVM_DIR="$HOME/.nvm"
if [ -s "$NVM_DIR/nvm.sh" ]; then
. "$NVM_DIR/nvm.sh"

NODE_20_VERSION=$(nvm version 20 2> /dev/null)
if [ "$NODE_20_VERSION" != "N/A" ]; then
nvm use --silent "$NODE_20_VERSION" > /dev/null 2>&1 || return 1
else
nvm use --silent default > /dev/null 2>&1 || return 1
fi
fi

command -v npm > /dev/null 2>&1 || return 1
}

build_app() {
result=$(npm install 2>&1)
status=$?
Expand Down Expand Up @@ -114,24 +132,19 @@ nextcloud_upgrade() {
}

cd /opt/hejbit || log_error "/opt/hejbit not found"

if ! setup_node; then
log_error "npm not found for user $(whoami)"
log_error "install node/npm or configure nvm default"
exit 1
fi

log_note "deploying hejbit to staging"
log_gap

DEPLOYMENT=()
TIMESTAMP=$(date +%s)
for version in {30..32}; do
deploy "$version" &
DEPLOYMENT+=($!)
done

statuses=0
for pid in "${DEPLOYMENT[@]}"; do
wait "$pid"
statuses+=$?
for version in {32..33}; do
deploy "$version"
done

if [ $statuses -ne 0 ]; then
log_error "failed to deploy hejbit to staging"
exit 1
fi
log_success "deployed hejbit to staging"
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions css/app.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
.hejbit-overlay {
position: absolute;
top: 30px;
left: 75px;
width: 16px;
height: 16px;
pointer-events: none;
}

.hejbit-overlay-32 {
position: absolute;
top: 23px;
left: 60px;
Expand All @@ -21,11 +12,6 @@
height: 16px;
}

.hejbit-overlay-32 svg {
width: 16px;
height: 16px;
}


.hejbit-archive svg {
filter: grayscale(100%);
Expand Down
49 changes: 26 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,34 @@ services:
networks:
- backend

adminer: # visit https://adminer.hejbit.local/?pgsql=postgres&username=swarmbox&db=swarmbox
rsync:
build:
context: ./docker/rsync
dockerfile: Dockerfile
restart: unless-stopped
cpu_shares: 512
mem_limit: 256m
volumes:
- nc-app:/app:ro
- ./dev-environment/nextcloud_source:/source
environment:
- RSYNC_CRONTAB=crontab
depends_on:
- nextcloud
networks:
- backend

adminer:
profiles:
- development
# visit https://adminer.hejbit.local/?pgsql=postgres&username=swarmbox&db=swarmbox
image: adminer:latest
restart: unless-stopped
# ports:
# - '8080:8080'
networks:
- backend
- proxy

depends_on:
postgres:
condition: service_healthy
Expand All @@ -125,24 +144,9 @@ services:
environment:
ADMINER_DEFAULT_SERVER: postgres

rsync:
build:
context: ./docker/rsync
dockerfile: Dockerfile
restart: unless-stopped
cpu_shares: 512
mem_limit: 256m
volumes:
- nc-app:/app:ro
- ./dev-environment/nextcloud_source:/source
environment:
- RSYNC_CRONTAB=crontab
depends_on:
- nextcloud
networks:
- backend

flagd:
profiles:
- feature
image: ghcr.io/open-feature/flagd:latest
restart: unless-stopped
command: 'start --uri file:/etc/flagd/hejbit.flagd.json --cors-origin *'
Expand All @@ -158,10 +162,10 @@ services:
depends_on:
proxy:
condition: service_healthy
profiles:
- feature

onlyoffice:
profiles:
- onlyoffice
image: onlyoffice/documentserver
environment:
JWT_ENABLED: true
Expand All @@ -186,8 +190,6 @@ services:
depends_on:
proxy:
condition: service_healthy
profiles:
- onlyoffice

proxy:
image: lucaslorentz/caddy-docker-proxy:alpine
Expand Down Expand Up @@ -220,6 +222,7 @@ volumes:
onlyoffice_lib:
onlyoffice_logs:


networks:
frontend:
backend:
Expand Down
3 changes: 1 addition & 2 deletions lib/Storage/BeeSwarm.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use OC;
use OC\Files\Cache\Cache;
use OC\Files\Storage\Common;
use OC_Helper;
use OCA\Files_External_Ethswarm\AppInfo\Application;
use OCA\Files_External_Ethswarm\Db\SwarmFile;
use OCA\Files_External_Ethswarm\Db\SwarmFileMapper;
Expand Down Expand Up @@ -515,7 +514,7 @@ protected function createTempFile($stream): string {
$extension = '';
$tmpFile = $this->tempManager->getTemporaryFile($extension);
$target = fopen($tmpFile, 'w');
OC_Helper::streamCopy($stream, $target);
stream_copy_to_stream($stream, $target);
fclose($target);

return $tmpFile;
Expand Down
Loading