Skip to content

Commit cc3a68d

Browse files
Merge pull request #2078 from nextcloud/feature/nc32
Support Nextcloud 32
2 parents c3bbd3b + fdcd06a commit cc3a68d

File tree

7 files changed

+112
-63
lines changed

7 files changed

+112
-63
lines changed

bin/ncp/CONFIG/nc-init.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ EOF
171171
# we handle this ourselves
172172
ncc app:disable updatenotification
173173

174+
# Not supported in Nextcloudpi without manual setup
175+
ncc app:disable app_api
176+
174177
# ncp-previewgenerator
175178
local ncver
176179
ncver="$(ncc status 2>/dev/null | grep "version:" | awk '{ print $3 }')"

etc/ncp-config.d/nc-nextcloud.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
"id": "VER",
1111
"name": "Version",
12-
"value": "31.0.2"
12+
"value": "32.0.1"
1313
},
1414
{
1515
"id": "MAXFILESIZE",

etc/ncp.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"nextcloud_version": "31.0.2",
2+
"nextcloud_version": "32.0.1",
33
"php_version": "8.3",
44
"release": "bookworm"
55
}

ncp-app/appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<category>tools</category>
1313
<bugs>https://github.com/nextcloud/nextcloudpi/issues</bugs>
1414
<dependencies>
15-
<nextcloud min-version="22" max-version="31"/>
15+
<nextcloud min-version="22" max-version="32"/>
1616
</dependencies>
1717
<navigations>
1818
<navigation>

ncp-previewgenerator/ncp-previewgenerator-nc21/appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The first time you install this app, before using a cron job, you properly want
2525
</types>
2626
<dependencies>
2727
<php min-version="7.2"/>
28-
<nextcloud min-version="20" max-version="31" />
28+
<nextcloud min-version="20" max-version="32" />
2929
</dependencies>
3030

3131
<commands>

tests/nextcloud_tests.py

Lines changed: 97 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -181,66 +181,12 @@ def test_nextcloud(IP: str, nc_port: str, driver: WebDriver, skip_release_check:
181181

182182
test.new("settings config")
183183
wait = WebDriverWait(driver, 60 * wait_multiplier * 3)
184-
try:
185-
wait.until(VisibilityOfElementLocatedByAnyLocator([(By.CSS_SELECTOR, "#security-warning-state-ok"),
186-
(By.CSS_SELECTOR, "#security-warning-state-warning"),
187-
(By.CSS_SELECTOR, "#security-warning-state-error"),
188-
(By.CSS_SELECTOR, "#security-warning-state-failure")]))
189-
190-
element_ok = driver.find_element(By.ID, "security-warning-state-ok")
191-
element_warn = driver.find_element(By.ID, "security-warning-state-warning")
192-
193-
if element_warn.is_displayed():
194-
195-
warnings = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .warnings > li")
196-
for warning in warnings:
197-
if re.match(r'.*Server has no maintenance window start time configured.*', warning.text) \
198-
or re.match(r'.*Server has no maintenance window start time configured.*', warning.text):
199-
continue
200-
elif re.match(r'.*Could not check for JavaScript support.*', warning.text):
201-
continue
202-
# TODO: Solve redis error logs at the source
203-
elif re.match(r'.*\d+ errors? in the logs since.*', warning.text):
204-
continue
205-
else:
206-
raise ConfigTestFailure(f"WARN: {warning.text}")
207-
208-
if driver.find_element(By.CSS_SELECTOR, "#postsetupchecks > .errors").is_displayed():
209-
try:
210-
first_error = driver.find_element(By.CSS_SELECTOR, "#postsetupchecks > .errors > li")
211-
except NoSuchElementException:
212-
first_error = None
213-
raise ConfigTestFailure(f"ERROR: {first_error.text if first_error is not None else 'unexpected error'}")
214-
215-
infos = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .info > li")
216-
for info in infos:
217-
if re.match(r'.*Your installation has no default phone region set.*', info.text) \
218-
or re.match(r'The PHP module "imagick" is not enabled', info.text) \
219-
or re.match(r'The PHP module "imagick" in this instance has no SVG support.*', info.text) \
220-
or re.match(r'\d+ warning in the logs since.*', info.text):
221-
continue
222-
else:
223-
print(f'INFO: {info.text}')
224-
php_modules = info.find_elements(By.CSS_SELECTOR, "li")
225-
if len(php_modules) != 1:
226-
raise ConfigTestFailure(f"Could not find the list of php modules within the info message "
227-
f"'{infos[0].text}'")
228-
if php_modules[0].text != "imagick":
229-
raise ConfigTestFailure("The list of php_modules does not equal [imagick]")
230-
231-
elif not element_ok.is_displayed():
232-
errors = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .errors > li")
233-
for error in errors:
234-
print(f'ERROR: {error.text}')
235-
raise ConfigTestFailure("Neither the warnings nor the ok status is displayed "
236-
"(so there are probably errors or the page is broken)")
237-
238-
test.check(True)
184+
secwarn = driver.find_element(By.CSS_SELECTOR, "#security-warning.settings-section")
185+
if secwarn is None:
186+
settings_config_check_pre32(wait, test)
187+
else:
188+
settings_config_check(wait, test)
239189

240-
except Exception as e:
241-
242-
print(driver.find_element(By.CSS_SELECTOR, "#security-warning").get_attribute("innerHTML"))
243-
test.check(e)
244190

245191
close_first_run_wizard(driver, wait_multiplier)
246192

@@ -321,6 +267,98 @@ def test_nextcloud(IP: str, nc_port: str, driver: WebDriver, skip_release_check:
321267
except Exception as e:
322268
test.check(e)
323269

270+
def settings_config_check_warnings(warnings):
271+
for warning in warnings:
272+
if re.match(r'.*Server has no maintenance window start time configured.*', warning.text) \
273+
or re.match(r'.*Server has no maintenance window start time configured.*', warning.text):
274+
continue
275+
elif re.match(r'.*Could not check for JavaScript support.*', warning.text):
276+
continue
277+
# TODO: Solve redis error logs at the source
278+
elif re.match(r'.*\d+ errors? in the logs since.*', warning.text):
279+
continue
280+
else:
281+
raise ConfigTestFailure(f"WARN: {warning.text}")
282+
283+
def settings_config_check_infos(infos):
284+
for info in infos:
285+
if re.match(r'.*Your installation has no default phone region set.*', info.text) \
286+
or re.match(r'The PHP module "imagick" is not enabled', info.text) \
287+
or re.match(r'The PHP module "imagick" in this instance has no SVG support.*', info.text) \
288+
or re.match(r'\d+ warnings? in the logs since.*', info.text):
289+
continue
290+
else:
291+
print(f'INFO: {info.text}')
292+
php_modules = info.find_elements(By.CSS_SELECTOR, "li")
293+
if len(php_modules) != 1:
294+
raise ConfigTestFailure(f"Could not find the list of php modules within the info message "
295+
f"'{infos[0].text}'")
296+
if php_modules[0].text != "imagick":
297+
raise ConfigTestFailure("The list of php_modules does not equal [imagick]")
298+
299+
300+
def settings_config_check_errors(errors):
301+
if len(errors) == 0:
302+
return
303+
for error in errors:
304+
print(f'ERROR: {error.text}')
305+
raise ConfigTestFailure("Neither the warnings nor the ok status is displayed "
306+
"(so there are probably errors or the page is broken)")
307+
308+
309+
def settings_config_check(wait, test):
310+
try:
311+
wait.until_not(VisibilityOfElementLocatedByAnyLocator([(By.CSS_SELECTOR, "#security-warning .loading-icon")]))
312+
warnings = driver.find_elements(By.CSS_SELECTOR, "#security-warning li.settings-setup-checks-item--warning .settings-setup-checks-item__description")
313+
settings_config_check_warnings(warnings)
314+
infos = driver.find_elements(By.CSS_SELECTOR, "#security-warning li.settings-setup-checks-item--info .settings-setup-checks-item__description")
315+
settings_config_check_infos(infos)
316+
errors = driver.find_elements(By.CSS_SELECTOR, "#security-warning li.settings-setup-checks-item--error .settings-setup-checks-item__description")
317+
settings_config_check_errors(errors)
318+
319+
test.check(True)
320+
except Exception as e:
321+
print(driver.find_element(By.CSS_SELECTOR, "#security-warning").get_attribute("innerHTML"))
322+
test.check(e)
323+
324+
325+
def settings_config_check_pre32(wait, test):
326+
try:
327+
wait.until(VisibilityOfElementLocatedByAnyLocator([(By.CSS_SELECTOR, "#security-warning-state-ok"),
328+
(By.CSS_SELECTOR, "#security-warning-state-warning"),
329+
(By.CSS_SELECTOR, "#security-warning-state-error"),
330+
(By.CSS_SELECTOR, "#security-warning-state-failure")]))
331+
332+
element_ok = driver.find_element(By.ID, "security-warning-state-ok")
333+
element_warn = driver.find_element(By.ID, "security-warning-state-warning")
334+
335+
if element_warn.is_displayed():
336+
337+
warnings = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .warnings > li")
338+
settings_config_check_warnings(warnings)
339+
340+
if driver.find_element(By.CSS_SELECTOR, "#postsetupchecks > .errors").is_displayed():
341+
try:
342+
first_error = driver.find_element(By.CSS_SELECTOR, "#postsetupchecks > .errors > li")
343+
except NoSuchElementException:
344+
first_error = None
345+
raise ConfigTestFailure(f"ERROR: {first_error.text if first_error is not None else 'unexpected error'}")
346+
347+
infos = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .info > li")
348+
settings_config_check_infos(infos)
349+
350+
351+
elif not element_ok.is_displayed():
352+
errors = driver.find_elements(By.CSS_SELECTOR, "#postsetupchecks > .errors > li")
353+
settings_config_check_errors(errors)
354+
355+
test.check(True)
356+
357+
except Exception as e:
358+
359+
print(driver.find_element(By.CSS_SELECTOR, "#security-warning").get_attribute("innerHTML"))
360+
test.check(e)
361+
324362

325363
if __name__ == "__main__":
326364
signal.signal(signal.SIGINT, signal_handler)

updates/1.56.0.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
if ncc app_api:daemon:list | grep 'No registered daemon configs.' > /dev/null 2>&1
4+
then
5+
ncc app:disable app_api
6+
fi
7+
8+
exit 0

0 commit comments

Comments
 (0)