OC Basisdokumentation & Entwicklung
Fundamentals https://doc.owncloud.org/server/10.0/developer_manual/app/fundamentals/
Advanced Concepts https://doc.owncloud.org/server/10.0/developer_manual/app/advanced/
Testing Tarballs: https://download.owncloud.org/community/testing/
config.php Parameter: https://doc.owncloud.org/server/10.0/admin_manual/configuration/server/config_sample_php_parameters.html
occ Kommandos: https://doc.owncloud.com/server/admin_manual/configuration/server/occ_command.html
Installation von Kommandzeile
sudo -u www-data php occ maintenance:install --database "mysql" --database-name "owncloud2"
--database-user "ocadmin" --database-pass "xxxxxxxxxxxxxxx" --admin-user "admin"
--admin-pass "xxxxxxxxxxxx" --data-dir /mnt/data/ocdata2
Update & Maintenance
Maintenance Mode aktivieren (global)
sudo -u www-data php occ maintenance:mode --on
single user mode, Login nur für User der Admingruppe:
sudo -u www-data php occ maintenance:singleuser --on
Upgrade starten
sudo -u www-data php occ upgrade
Danach Maintenance Mode wieder aus
sudo -u www-data php occ maintenance:mode –-off
oder
sudo -u www-data php occ maintenance:singleuser -–off
Configreport nach portal.owncloud.com senden
sudo -u www-data php occ configreport:generate | curl -XPOST --fail -H "Content-Type: application/json" -d @- https://portal.owncloud.com/apps/customer_portal/api/account/configreports/KG1c47dYat
Code integrity check
sudo -u www-data php occ integrity:check-core
sudo -u www-data php occ integrity:check-app $appid
Code integrity check global abschalten:
Disable globally with ‚integrity.check.disabled‘ ⇒ true, in config.php
Logging
Loglevel to start logging at. Valid values are: 0 = Debug, 1 = Info, 2 = Warning, 3 = Error, and 4 = Fatal. The default value is Warning.
Code Signing
App Kommandos
app
app:check-code check code to be compliant
app:disable disable an app
app:enable enable an app
app:getpath Get an absolute path to the app directory
(added in 9.0)
app:list List all available apps
User Kommandos
Neuen User anlegen (displayname = voller Name, uid = Login)
sudo -u www-data php occ user:add --display-name 'Herr test1' --email 'support@netzwissen.de' --group 'User' test1
The user "test1" was created successfully
Display name set to "Herr test1"
Email address set to "support@netzwissen.de"
User "test1" added to group "User"
Passwort als Umgebungsvariable übergeben (z.B. für Masseneintrag) - Achtung, geht nur als root
''export OC_PASS=newpassword ''''su -s /bin/sh www-data -c
'php occ user:add –password-from-env –display-name="Fred Jones" –group="users" fred' ''
''The user "fred" was created successfully
Display name set to "Fred Jones" User "fred" added to group "users" ''
Passwort Reset
über cli
sudo -u www-data php occ user:resetpassword
über Mail
root@www:/var/www/owncloud# sudo -u www-data php occ user:resetpassword --send-email test1
The password reset link is: https://www.netzwissen.de/owncloud/index.php/lostpassword/reset/form/QgBwq9JIZJbdhXf7NLq7L/test1
über Link
sudo -u www-data php occ user:resetpassword --output-link test1
User-E-Mail ändern
php occ user:modify someusername email someone@example.com
root@app3:/var/www/owncloud# sudo -u www-data php occ user:modify herre email ngehring@steuerberaterherre.de
The email address of herre updated to ngehring@steuerberaterherre.de
Letzten Login zeigen
sudo -u www-data php occ user:lastseen schreiber-esslingen@t-online.de
Inaktive User suchen
365 Tage
root@www:/var/www/owncloud# sudo -u www-data php occ user:inactive 365
User löschen
sudo -u www-data php occ user:delete
User temporär abschalten
user:disable [uid]
Einfacher Report über alle User
sudo -u www-data php occ user:report
Rescan aller Daten
sudo -u www-data php console.php files:scan –all
Dateien löschen, scannen, verschieben (bulk)
trashbin:cleanup Remove deleted files
files
files:cleanup cleanup filecache
files:scan rescan filesystem
files:transfer-ownership All files and folders are moved to another
user - shares are moved as well. (Added in 9.0)
Datentransfer von User A nach User B:
Dateien landen beim neuen User in einem separatend transferred-.. Ordner
Verschlüsselung
user encryption ist deprecated!!!
sudo -u www-data php occ app:enable encryption
sudo -u www-data php occ encryption:enable
sudo -u www-data php occ encryption:status
Verschlüsselung & Sharing
Bei aktiver Verschlüsselung sollte immer über den Namen geshared werden, siehe https://doc.owncloud.org/server/master/user_manual/files/encrypting_files.html Erst danach sollte ein Gruppen Share gesetzt werden, der Namens-Share kann dann wieder weg.
Datenbankschema
ownCloud Metrics
https://www.netzwissen.de/owncloud/ocs/v1.php/apps/metrics/api/v1/metrics
als jsom
curl -H „OC-MetricsApiKey: eK5oAz9efUmSg@cpS&F4“ „https://www.netzwissen.de/owncloud/ocs/v1.php/apps/metrics/api/v1/metrics?users=true&files=true&shares=true"a=true&userData=true&format=json“
OIDC
https://doc.owncloud.com/server/admin_manual/configuration/user/oidc/
Client ID erzeugen (php)
<php
$bytes = random_bytes(32);
var_dump(bin2hex($bytes));
?>
Owncloud OCIS (owncloud infinite scale)
Docs
*General Docs: https://doc.owncloud.com/ocis/next
*Development Rules: The Twelve Factor App https://12factor.net/
*Binary Setup: https://doc.owncloud.com/ocis/next/deployment/binary/binary-setup.html
*Container Setup: https://doc.owncloud.com/ocis/next/deployment/container/orchestration/orchestration.html
*Bare Metal with Systemd https://doc.owncloud.com/ocis/next/depl-examples/bare-metal.html
*OIDC Example (Keycloak) https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_keycloak
*Environment variables https://doc.owncloud.com/ocis/next/deployment/services/env-vars-special-scope.html
*WOPI/Collabora https://doc.owncloud.com/ocis/next/deployment/wopi/wopi.html
Initialisation
„ocis init“ creates yaml. For the admin user, use the same credentias as in the realm of the IDP
root@ocis:/etc# sudo -u ocis ocis init --admin-password=xxxxxxxxx --insecure=false --config-path=/etc/ocis --
=========================================
generated OCIS Config
=========================================
configpath : /etc/ocis/ocis.yaml
user : admin
password : xxxxxxxxxxx
-------------------------------
Basic data structures and config prepared for haproxy
sudo -u ocis OCIS_INSECURE=false OCIS_CONFIG_DIR=/etc/ocis PROXY_HTTP_ADDR=10.10.10.23:9200 \
PROXY_TLS=false OCIS_URL=https://ocis.netzwissen.de OCIS_BASE_DATA_PATH=/mnt/data/ocis \
OCIS_LOG_LEVEL=debug OCIS_LOG_FILE=/var/log/ocis/ocis.log ocis server
Version info
ocis version
List running services
ocis list
+--------------------+
| SERVICE |
+--------------------+
| app-provider |
| app-registry |
| auth-basic |
| auth-machine |
| eventhistory |
| frontend |
| gateway |
| graph |
| groups |
| idm |
| idp |
| invitations |
| nats |
| notifications |
| ocdav |
| ocs |
| postprocessing |
| proxy |
| search |
| settings |
| sharing |
| storage-publiclink |
| storage-shares |
| storage-system |
| storage-users |
| store |
| thumbnails |
| userlog |
| users |
| web |
| webdav |
| webfinger |
+--------------------+