Skip to content

Nextcloud - nach Federation Verbindung extrem langsam

Verschoben Nextcloud
  • Man sollte auch vor dem Testen immer die komplette Anleitung lesen 🙂

    Was war passiert?

    Ich wollte eine lokale Nextcloud Installation mit meiner Nextcloud im Netz verbinden. Also, einen Federation Link erstellt (lokal), den auf meiner Nextcloud im Netz akzeptiert und Boom. Danach war Schluss mit lustig 😞

    Die Installation im Netz war extrem langsam - unbenutzbar. Ok, was man kaputt macht muss man auch wieder reparieren. Mir fiel dann ziemlich schnell ein, das die lokale Adresse keine gute Idee war. Ok, aber irgendwo muss die ja drin stehen? Die muss weg! Irgendwo in der MariaDB muss die ja drin stehen. Ich habe dann einen guten Link gefunden.

    mysql -u root -p
    Enter password: 
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is xxxxxxxx
    Server version: xxx
    
    Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | nextcloud          |
    | performance_schema |
    +--------------------+
    3 rows in set (0.01 sec)
    
    MariaDB [(none)]> USE nextcloud;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    MariaDB [nextcloud]> SHOW Tables;
    +--------------------------------+
    | Tables_in_nextcloud            |
    +--------------------------------+
    | oc_accounts                    |
    | oc_activity                    |
    | oc_activity_mq                 |
    | oc_addressbookchanges          |
    | oc_addressbooks                |
    | oc_appconfig                   |
    | oc_authtoken                   |
    | oc_bruteforce_attempts         |
    | oc_calendar_invitations        |
    | oc_calendar_resources          |
    | oc_calendar_rooms              |
    | oc_calendarchanges             |
    | oc_calendarobjects             |
    | oc_calendarobjects_props       |
    | oc_calendars                   |
    | oc_calendarsubscriptions       |
    | oc_cards                       |
    | oc_cards_properties            |
    | oc_comments                    |
    | oc_comments_read_markers       |
    | oc_credentials                 |
    | oc_dav_shares                  |
    | oc_directlink                  |
    | oc_e2e_encryption_lock         |
    | oc_federated_reshares          |
    | oc_file_locks                  |
    | oc_filecache                   |
    | oc_files_trash                 |
    | oc_flow_checks                 |
    | oc_flow_operations             |
    | oc_group_admin                 |
    | oc_group_user                  |
    | oc_groups                      |
    | oc_jobs                        |
    | oc_migrations                  |
    | oc_mimetypes                   |
    | oc_mounts                      |
    | oc_notifications               |
    | oc_notifications_pushtokens    |
    | oc_oauth2_access_tokens        |
    | oc_oauth2_clients              |
    | oc_preferences                 |
    | oc_privatedata                 |
    | oc_properties                  |
    | oc_richdocuments_member        |
    | oc_richdocuments_wopi          |
    | oc_schedulingobjects           |
    | oc_share                       |
    | oc_share_external              |
    | oc_storages                    |
    | oc_systemtag                   |
    | oc_systemtag_group             |
    | oc_systemtag_object_mapping    |
    | oc_talk_guests                 |
    | oc_talk_participants           |
    | oc_talk_rooms                  |
    | oc_talk_signaling              |
    | oc_trusted_servers             |
    | oc_twofactor_backupcodes       |
    | oc_twofactor_providers         |
    | oc_twofactor_totp_secrets      |
    | oc_twofactor_u2f_registrations |
    | oc_twofactor_yubikey           |
    | oc_users                       |
    | oc_vcategory                   |
    | oc_vcategory_to_object         |
    | oc_whats_new                   |
    +--------------------------------+
    67 rows in set (0.00 sec)
    
    MariaDB [nextcloud]> SHOW FIELDS from oc_share_external;
    +-----------------+---------------+------+-----+---------+----------------+
    | Field           | Type          | Null | Key | Default | Extra          |
    +-----------------+---------------+------+-----+---------+----------------+
    | id              | int(11)       | NO   | PRI | NULL    | auto_increment |
    | remote          | varchar(512)  | NO   |     | NULL    |                |
    | remote_id       | int(11)       | NO   |     | -1      |                |
    | share_token     | varchar(64)   | NO   |     | NULL    |                |
    | password        | varchar(64)   | YES  |     | NULL    |                |
    | name            | varchar(64)   | NO   |     | NULL    |                |
    | owner           | varchar(64)   | NO   |     | NULL    |                |
    | user            | varchar(64)   | NO   | MUL | NULL    |                |
    | mountpoint      | varchar(4000) | NO   |     | NULL    |                |
    | mountpoint_hash | varchar(32)   | NO   |     | NULL    |                |
    | accepted        | int(11)       | NO   |     | 0       |                |
    | parent          | int(11)       | YES  |     | -1      |                |
    | share_type      | int(11)       | YES  |     | NULL    |                |
    +-----------------+---------------+------+-----+---------+----------------+
    13 rows in set (0.00 sec)
    
    MariaDB [nextcloud]> SELECT * FROM oc_share_external;
    +----+---------------------+-----------+-----------------+----------+------------------+-------+-------+----------------------+----------------------------------+----------+--------+------------+
    | id | remote              | remote_id | share_token     | password | name             | owner | user  | mountpoint           | mountpoint_hash                  | accepted | parent | share_type |
    +----+---------------------+-----------+-----------------+----------+------------------+-------+-------+----------------------+----------------------------------+----------+--------+------------+
    |  1 | http://192.168.5.4/ |         1 | xxxxxxxRwYrxEH |          | /Test Federation | frank | Frank | /Test Federation (2) | xxxxxxxxxxxxxxxxxx5751f9bb504ae |        1 |     -1 |          0 |
    +----+---------------------+-----------+-----------------+----------+------------------+-------+-------+----------------------+----------------------------------+----------+--------+------------+
    1 row in set (0.00 sec)
    
    MariaDB [nextcloud]> DELETE FROM oc_share_external WHERE id = 1;
    Query OK, 1 row affected (0.06 sec)
    
    MariaDB [nextcloud]> SELECT * FROM oc_share_external;
    Empty set (0.00 sec)
    
    MariaDB [nextcloud]> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)
    
    MariaDB [nextcloud]> 
    

    Danach ging die Installation wieder wie immer 🙂

    Keine schöne Sache, das Nextcloud das nicht von alleine erkennt das es keine Verbindung zu diesem Link aufbauen kann und sich dann tot rödelt. Echt mal was richtig Blödes!!

    Auch wenn ich zu doof war, die Anleitung bis zum Ende zu lesen 🙂 Aber, man weiß sich ja zu helfen. Puuuuuh!

    Your Nextcloud server creates the share link from the URL that you used to log into the server, so make sure that you log into your server using a URL that is accessible to your users. For example, if you log in via its LAN IP address, such as http://192.168.10.50, then your share URL will be something like http://192.168.10.50/nextcloud/index.php/s/jWfCfTVztGlWTJe, which is not accessible outside of your LAN. This also applies to using the server name; for access outside of your LAN you need to use a fully-qualified domain name such as http://myserver.example.com, rather than http://myserver.

    Quelle: https://docs.nextcloud.com/server/15/admin_manual/configuration_files/federated_cloud_sharing_configuration.html

  • Nextcloud - Update auf 28.0.2

    Nextcloud
    2
    0 Stimmen
    2 Beiträge
    109 Aufrufe
    FrankMF

    Für den, der sich alle Änderungen ansehen möchten -> https://github.com/nextcloud/server/releases

  • 0 Stimmen
    1 Beiträge
    117 Aufrufe
    Niemand hat geantwortet
  • 0 Stimmen
    1 Beiträge
    215 Aufrufe
    Niemand hat geantwortet
  • Nextcloud API Zugriff

    Nextcloud
    4
    0 Stimmen
    4 Beiträge
    186 Aufrufe
    FrankMF

    Ok, es gab noch ein Problem und zwar '/'. Habe das Script jetzt nochmal umgebaut, jetzt bin ich soweit zufrieden. Die Textdatei ist auf meine Bedürfnisse angepasst worden

    1.2.01 1.2.01.1 Text1.1 1.2.01.2 Text1.2 1.2.02 1.2.02.1 Text2.1/Testing 1.2.02.2 Text2.2

    1.2.01 und 1.2.02 erzeugt dann einen Ordner, der Rest sind dann Unterordner.

    """ Tool to create folders using the Nextcloud API """ ############################################### # Imports ############################################### import subprocess from pathlib import Path ############################################### # Constant ############################################### # Get home directory from user USERHOME = str(Path.home()) NCPATH = 'https://DOMAIN/remote.php/dav/files/Frank/Python_Script/' USERNAME = 'USER' PASSWORD = 'PASSWORD' ############################################### # Function to crate folder with nextcloud api ############################################### def read_textobject(): # read folders to create from textfile with open(f'{USERHOME}/Textdatei.txt', 'r') as obj: # create object for line in obj: line_split = line.split(' ') elements = line_split[0].split('.') try: if elements[3]: main_folder = 0 # replace whitespaces with %20, and / with _ and remove linefeed (\n) path = Path((line.replace(' ', '%20').replace('/', '_')).rstrip('\n')) except IndexError: print("Element is main folder") main_folder = 1 # replace whitespaces with %20, and / with _ and remove linefeed (\n) main = Path((line.replace(' ', '%20').replace('/', '_')).rstrip('\n')) else: print("Element is not a main folder") ############################################### # Create directory ############################################### if main_folder == 1: # Main folder try: args = ['curl', '-u', f'{USERNAME}:{PASSWORD}', f'{NCPATH}{main}', '-X', 'MKCOL'] result = subprocess.run(args, check=True, capture_output=True, text=True) except subprocess.CalledProcessError as error: print(result.stderr) else: if result.stdout: print(result.stdout) else: print('Directory created successful') else: # Not a main folder try: args = ['curl', '-u', f'{USERNAME}:{PASSWORD}', f'{NCPATH}{main}/{path}', '-X', 'MKCOL'] result = subprocess.run(args, check=True, capture_output=True, text=True) except subprocess.CalledProcessError as error: print(result.stderr) else: if result.stdout: print(result.stdout) else: print('Directory created successful') else: print(result.stdout) obj.close() if __name__ == '__main__': read_textobject()
  • 0 Stimmen
    2 Beiträge
    204 Aufrufe
    FrankMF

    Die Apps sind jetzt für 23.0.0. aktualisiert.

    0107b034-2b45-477d-b059-a79d8c9fec73-grafik.png

  • Restic & Rclone & Nextcloud

    Linux
    3
    0 Stimmen
    3 Beiträge
    688 Aufrufe
    FrankMF

    Hier mal eine Ausgabe vom ersten Durchgang

    root@frank-MS-7C37:~# restic --password-file /root/passwd -r rclone:Nextcloud:HOME_UBUNTU backup --files-from /root/includes.txt repository 99xxxxa0 opened successfully, password is correct created new cache in /root/.cache/restic rclone: 2020/05/08 17:47:57 ERROR : locks: error listing: directory not found rclone: 2020/05/08 17:47:58 ERROR : index: error listing: directory not found rclone: 2020/05/08 17:47:58 ERROR : snapshots: error listing: directory not found Files: 3503 new, 0 changed, 0 unmodified Dirs: 2 new, 0 changed, 0 unmodified Added to the repo: 16.872 GiB processed 3503 files, 21.134 GiB in 1:02:56 snapshot fdxxxxec saved

    Der erste Durchgang hat also etwa eine Stunde benötigt. Durch die Deduplikation der Daten, ist der Vorgang beim zweiten Durchgang viel schneller weil nur neue oder geänderte Daten gesichert werden. Und außerdem sind alle Daten AES-256 verschlüsselt. Also perfekt zur Ablage in irgendeiner Cloud 😉

    root@frank-MS-7C37:~# restic --password-file /root/passwd -r rclone:Nextcloud:HOME_UBUNTU backup --files-from /root/includes.txt repository 99xxxxa0 opened successfully, password is correct Files: 57 new, 41 changed, 3449 unmodified Dirs: 0 new, 2 changed, 0 unmodified Added to the repo: 22.941 MiB processed 3547 files, 21.137 GiB in 0:13 snapshot c6xxxxe4 saved

    Wie ihr seht, hat der zweite Durchgang nur ein paar neue und geänderte Daten gesichert. Der Rest ist ja schon vorhanden. Und das kann man dann auch problemlos täglich, wöchentlich oder was auch immer mal eben schnell durchführen.

    Eines meiner absoluten Lieblingstool 🙂

  • Nextcloud 16.0.5 -> 17.0.0

    Nextcloud
    1
    0 Stimmen
    1 Beiträge
    221 Aufrufe
    Niemand hat geantwortet
  • Nextcloud - Redis Cache

    Nextcloud
    1
    0 Stimmen
    1 Beiträge
    389 Aufrufe
    Niemand hat geantwortet