Skip to content

Commit 11d33ce

Browse files
committed
Merge branch 'main' into stage
2 parents 08f0aac + 2b0102b commit 11d33ce

26 files changed

Lines changed: 2714 additions & 961 deletions

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ENV=development
2-
NC_VERSION=31
2+
NC_VERSION=33
33
APP_URL=localhost
44
API_URL=https://hejbit.local
55

.github/workflows/staging.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
uses: appleboy/ssh-action@master
1818
with:
1919
host: ${{ vars.STAGING_SERVER_HOST }}
20-
username: deploy
20+
username: ${{ vars.STAGING_SERVER_USER }}
2121
key: ${{ secrets.STAGING_SSH_PRIVATE_KEY }}
22+
proxy_host: ${{ vars.STAGING_PROXY_HOST }}
23+
proxy_username: ${{ vars.STAGING_PROXY_USER }}
24+
proxy_key: ${{ secrets.STAGING_PROXY_SSH_PRIVATE_KEY }}
2225
script: bash deploy

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ js/nextcloud-swarm-plugin*.*
1111

1212
# IDE
1313
.idea
14+
.history
1415

1516
# OS
1617
.DS_Store

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This plugin integrates [Swarm](https://www.ethswarm.org/) (a decentralized, bloc
2121

2222
Before using the plugin, ensure you have the following:
2323

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

appinfo/info.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This plugin integrates [Swarm](https://www.ethswarm.org/) (a decentralized, bloc
2626
2727
Before using the plugin, ensure you have the following:
2828
29-
- An active Nextcloud instance (version 31 or 32)
29+
- An active Nextcloud instance (version 32 or 33)
3030
- A valid Access Key and URL to activate the service
3131
- [Get Your Free Trial for the Nextcloud Swarm Plugin](https://app.hejbit.com)
3232
@@ -89,7 +89,7 @@ Experience the future of data storage with 5GB of free, decentralized storage on
8989
This program is licensed under the AGPLv3 or later.
9090
9191
]]></description>
92-
<version>0.6.0</version>
92+
<version>1.0.3</version>
9393
<licence>agpl</licence>
9494
<author>MetaProvide</author>
9595
<namespace>Files_External_Ethswarm</namespace>
@@ -104,7 +104,7 @@ This program is licensed under the AGPLv3 or later.
104104
<repository type="git">https://github.com/MetaProvide/nextcloud-swarm-plugin.git</repository>
105105
<screenshot>https://raw.githubusercontent.com/MetaProvide/nextcloud-swarm-plugin/main/assets/images/swarm_Files.png</screenshot>
106106
<dependencies>
107-
<nextcloud min-version="31" max-version="32"/>
107+
<nextcloud min-version="32" max-version="33"/>
108108
</dependencies>
109109
<settings>
110110
<admin>OCA\Files_External_Ethswarm\Settings\Admin</admin>

cli/staging/deploy.sh

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ action() {
6464

6565
deploy() {
6666
local version=$1
67-
cd hejbit-"$version" || failed "hejbit-$version not found"
67+
cd "/opt/hejbit/hejbit-$version" || failed "$version" "/opt/hejbit/hejbit-$version not found"
6868

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

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

88+
setup_node() {
89+
command -v npm > /dev/null 2>&1 && return 0
90+
91+
export NVM_DIR="$HOME/.nvm"
92+
if [ -s "$NVM_DIR/nvm.sh" ]; then
93+
. "$NVM_DIR/nvm.sh"
94+
95+
NODE_20_VERSION=$(nvm version 20 2> /dev/null)
96+
if [ "$NODE_20_VERSION" != "N/A" ]; then
97+
nvm use --silent "$NODE_20_VERSION" > /dev/null 2>&1 || return 1
98+
else
99+
nvm use --silent default > /dev/null 2>&1 || return 1
100+
fi
101+
fi
102+
103+
command -v npm > /dev/null 2>&1 || return 1
104+
}
105+
88106
build_app() {
89107
result=$(npm install 2>&1)
90108
status=$?
@@ -114,24 +132,19 @@ nextcloud_upgrade() {
114132
}
115133

116134
cd /opt/hejbit || log_error "/opt/hejbit not found"
135+
136+
if ! setup_node; then
137+
log_error "npm not found for user $(whoami)"
138+
log_error "install node/npm or configure nvm default"
139+
exit 1
140+
fi
141+
117142
log_note "deploying hejbit to staging"
118143
log_gap
119144

120-
DEPLOYMENT=()
121145
TIMESTAMP=$(date +%s)
122-
for version in {30..32}; do
123-
deploy "$version" &
124-
DEPLOYMENT+=($!)
125-
done
126-
127-
statuses=0
128-
for pid in "${DEPLOYMENT[@]}"; do
129-
wait "$pid"
130-
statuses+=$?
146+
for version in {32..33}; do
147+
deploy "$version"
131148
done
132149

133-
if [ $statuses -ne 0 ]; then
134-
log_error "failed to deploy hejbit to staging"
135-
exit 1
136-
fi
137150
log_success "deployed hejbit to staging"

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/app.css

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
.hejbit-overlay {
2-
position: absolute;
3-
top: 30px;
4-
left: 75px;
5-
width: 16px;
6-
height: 16px;
7-
pointer-events: none;
8-
}
9-
10-
.hejbit-overlay-32 {
112
position: absolute;
123
top: 23px;
134
left: 60px;
@@ -21,11 +12,6 @@
2112
height: 16px;
2213
}
2314

24-
.hejbit-overlay-32 svg {
25-
width: 16px;
26-
height: 16px;
27-
}
28-
2915

3016
.hejbit-archive svg {
3117
filter: grayscale(100%);

docker-compose.yml

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# 127.0.0.1 adminer.hejbit.local
77
# 127.0.0.1 features.hejbit.local
88

9+
services:
10+
911
services:
1012
web:
1113
build: ./docker/web
@@ -76,7 +78,6 @@ services:
7678

7779
redis:
7880
image: redis:alpine
79-
command: redis-server --requirepass secret
8081
# ports:
8182
# - '6379:6379'
8283
restart: unless-stopped
@@ -98,42 +99,13 @@ services:
9899
volumes:
99100
- nc-db:/var/lib/postgresql/data
100101
healthcheck:
101-
test:
102-
[
103-
"CMD",
104-
"pg_isready",
105-
"-q",
106-
"-d",
107-
"${POSTGRES_DB}",
108-
"-U",
109-
"${POSTGRES_USER}",
110-
]
102+
test: [ "CMD", "pg_isready", "-q", "-d", "${POSTGRES_DB}", "-U", "${POSTGRES_USER}" ]
111103
start_period: 3s
112104
timeout: 5s
113105
interval: 30s
114106
networks:
115107
- backend
116108

117-
adminer: # visit https://adminer.hejbit.local/?pgsql=postgres&username=swarmbox&db=swarmbox
118-
image: adminer:latest
119-
restart: unless-stopped
120-
# ports:
121-
# - '8080:8080'
122-
networks:
123-
- backend
124-
- proxy
125-
126-
depends_on:
127-
postgres:
128-
condition: service_healthy
129-
proxy:
130-
condition: service_healthy
131-
labels:
132-
caddy: adminer.hejbit.local
133-
caddy.reverse_proxy: "{{upstreams 8080}}"
134-
environment:
135-
ADMINER_DEFAULT_SERVER: postgres
136-
137109
rsync:
138110
build:
139111
context: ./docker/rsync
@@ -151,26 +123,50 @@ services:
151123
networks:
152124
- backend
153125

126+
adminer:
127+
profiles:
128+
- development
129+
# visit https://adminer.hejbit.local/?pgsql=postgres&username=swarmbox&db=swarmbox
130+
image: adminer:latest
131+
restart: unless-stopped
132+
# ports:
133+
# - '8080:8080'
134+
networks:
135+
- backend
136+
- proxy
137+
depends_on:
138+
postgres:
139+
condition: service_healthy
140+
proxy:
141+
condition: service_healthy
142+
labels:
143+
caddy: adminer.hejbit.local
144+
caddy.reverse_proxy: '{{upstreams 8080}}'
145+
environment:
146+
ADMINER_DEFAULT_SERVER: postgres
147+
154148
flagd:
149+
profiles:
150+
- feature
155151
image: ghcr.io/open-feature/flagd:latest
156152
restart: unless-stopped
157-
command: "start --uri file:/etc/flagd/hejbit.flagd.json --cors-origin *"
153+
command: 'start --uri file:/etc/flagd/hejbit.flagd.json --cors-origin *'
158154
# ports:
159155
# - '8013:8013'
160156
volumes:
161-
- "./docker/flagd/hejbit.flagd.json:/etc/flagd/hejbit.flagd.json"
157+
- './docker/flagd/hejbit.flagd.json:/etc/flagd/hejbit.flagd.json'
162158
networks:
163159
- proxy
164160
labels:
165161
caddy: features.hejbit.local
166-
caddy.reverse_proxy: "{{upstreams 8013}}"
162+
caddy.reverse_proxy: '{{upstreams 8013}}'
167163
depends_on:
168164
proxy:
169165
condition: service_healthy
170-
profiles:
171-
- feature
172166

173167
onlyoffice:
168+
profiles:
169+
- onlyoffice
174170
image: onlyoffice/documentserver
175171
environment:
176172
JWT_ENABLED: true
@@ -191,12 +187,10 @@ services:
191187
- proxy
192188
labels:
193189
caddy: onlyoffice.local
194-
caddy.reverse_proxy: "{{upstreams 80}}"
190+
caddy.reverse_proxy: '{{upstreams 80}}'
195191
depends_on:
196192
proxy:
197193
condition: service_healthy
198-
profiles:
199-
- onlyoffice
200194

201195
proxy:
202196
image: lucaslorentz/caddy-docker-proxy:alpine
@@ -235,6 +229,7 @@ volumes:
235229
onlyoffice_lib:
236230
onlyoffice_logs:
237231

232+
238233
networks:
239234
frontend:
240235
backend:

lib/Auth/AccessKey.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@
2828
/**
2929
* Basic Http Authentication.
3030
*/
31-
class AccessKey extends AuthMechanism {
31+
class AccessKey extends AuthMechanism
32+
{
3233
/** @const string */
3334
public const SCHEME = 'access_key';
3435

35-
public function __construct(IL10N $l) {
36+
public function __construct(IL10N $l)
37+
{
3638
$this
3739
->setIdentifier('access:key')
3840
->setScheme(self::SCHEME)
@@ -44,4 +46,4 @@ public function __construct(IL10N $l) {
4446
])
4547
;
4648
}
47-
}
49+
}

0 commit comments

Comments
 (0)