Skip to content

NextCloud

넥스트클라우드는 파일 호스팅 서비스를 개발하고 사용하기 위한 클라이언트-서버 소프트웨어이다. 기업에서 사용할 수 있는 종합적인 지원 옵션을 제공한다. 자유-오픈 소스 소프트웨어이며 누구든지 자신들만의 사설 서버 장치를 설치하고 운용할 수 있다.

Backup & Restore

Maintenance mode

유지 관리 모드 (maintenance:mode는 로그인 한 사용자의 세션을 잠그고 데이터의 불일치를 방지하기 위해 새로운 로그인을 방지합니다. Ubuntu Linux에서 다음 예제와 같이 HTTP 사용자로 occ를 실행해야합니다.

$ sudo -u www-data php occ maintenance:mode --on

config/config.php를 편집하여 서버를이 모드로 전환 할 수도 있습니다.

Change "maintenance" => false to "maintenance" => true

유지보수가 완료되었다면 maintenance:mode를 끝내야 한다.

$ sudo -u www-data php occ maintenance:mode --off

Docker exec

docker의 exec명령으로 진입할 경우 다음과 같이 진입하면 된다.

docker exec -u www-data -it [CONTAINER_ID] /bin/bash

occ 명령 위치

(아마도 OwnCloud-Command 의 약자인듯?) /var/www/html/occ위치에 있다.

Manually file upload

수동으로 파일을 업로드 하고 싶을 경우 다음과 같이 진행하면 된다.

우선, /var/www/html/data/{사용자ID}/files 디렉토리에 파일을 올린다.

이후, 다음 명령으로 파일을 스캔해야 한다.

$ sudo -u www-data php occ files:scan --all

만약 docker를 사용중 이라면 다음과 같이 실행하면 된다.

$ docker exec -u www-data {컨테이너ID} php occ files:scan --all

결과 화면은 다음과 같다.

Starting scan for user 1 out of 3 (aaa)
Starting scan for user 2 out of 3 (public)
Starting scan for user 3 out of 3 (bbb)
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 387     | 10056 | 00:00:49     |
+---------+-------+--------------+

INFORMATION

이 방법은 FileLocked 에러가 발생되어 제거되지 않는 상황에서 수동으로 제거했을 경우도 유효하다

업그레이드 이후, 추가 마이그레이션 작업 및 보안 및 설치경고 해결

역방향 프록시 헤더 설정

역방향 프록시 헤더 설정이 올바르지 않거나 신뢰하는 프록시를 통해 Nextcloud에 접근하고 있을 수 있습니다. 만약 Nextcloud를 신뢰하는 프록시를 통해 접근하고 있지 않다면 이는 보안 문제이며 공격자가 Nextcloud에 보이는 IP 주소를 속이고 있을 수 있습니다. 자세한 내용은 [https://docs.nextcloud.com/server/20/admin_manual/configuration_server/reverse_proxy_configuration.html 문서]를 참고하십시오.

HSTS 활성화

"Strict-Transport-Security" HTTP 헤더가 "15552000"초 이상으로 설정되어 있지 않습니다. 보안 팁에서 제안하는 것처럼 HSTS를 활성화하는 것을 추천합니다.

Missing indices

occ db:add-missing-indices

The database is missing some primary keys

The database is missing some primary keys. Due to the fact that adding primary keys on big tables could take some time they were not added automatically. By running "occ db:add-missing-primary-keys" those missing primary keys could be added manually while the instance keeps running.

    Missing primary key on table "oc_federated_reshares".
    Missing primary key on table "oc_systemtag_object_mapping".
    Missing primary key on table "oc_comments_read_markers".
    Missing primary key on table "oc_collres_resources".
    Missing primary key on table "oc_collres_accesscache".
    Missing primary key on table "oc_filecache_extended".

위 경고는 다음 설명대로 명령을 친다.

occ db:add-missing-primary-keys

일부 데이터베이스 열이 Big Int로 변환되지 않았습니다

일부 데이터베이스 열이 Big Int로 변환되지 않았습니다. 큰 테이블의 열 형식을 변환하는 데 시간이 걸리기 때문에 자동으로 변환하지 않았습니다. 명령행에서 "occ db:convert-filecache-bigint" 명령을 실행하여 변경 사항을 직접 적용할 수 있습니다. 이 작업은 인스턴스를 오프라인으로 전환하고 실행해야 합니다. 더 많은 정보를 보려면 문서 페이지를 참조하십시오.

    federated_reshares.share_id
    share_external.id
    share_external.parent

위 경고는 다음 설명대로 명령을 친다.

occ db:convert-filecache-bigint

인스턴스의 파일 수에 따라 최대 몇 시간이 걸릴 수 있습니다!

Reverse proxy

traefik과 같은 Reverse proxy를 적용할 경우 웹 루트 경로가 잘못될 수 있다. config/config.php 파일을 수정하여 관련 설정을 고정시킬 수 있다.

  • overwritehost: 프록시의 호스트 이름을 설정합니다. 포트를 지정할 수도 있습니다.
  • overwriteprotocol: 프록시의 프로토콜을 설정합니다. httphttps 두 가지 옵션 중에서 선택할 수 있습니다 .
  • overwritewebroot: 프록시의 절대 웹 경로를 Nextcloud 폴더로 설정합니다.
  • overwritecondaddr: 원격 주소에 따라 값을 덮어 씁니다. 값은 프록시 IP 주소의 정규식 이어야합니다 . 이는 https 액세스에만 역방향 SSL 프록시를 사용하고 http 액세스에 자동 감지를 사용하려는 경우에 유용합니다.

값을 비워 두거나 매개 변수를 생략하면 자동 감지된다.

docker를 사용할 경우 아래 화경변수를 확인하면 된다:

  • OVERWRITEHOST (empty by default): Set the hostname of the proxy. Can also specify a port.
  • OVERWRITEPROTOCOL (empty by default): Set the protocol of the proxy, http or https.
  • OVERWRITEWEBROOT (empty by default): Set the absolute path of the proxy.
  • OVERWRITECONDADDR (empty by default): Regex to overwrite the values dependent on the remote address.

Traefik 1

Using docker tags:

traefik.frontend.redirect.permanent: 'true'
traefik.frontend.redirect.regex: https://(.*)/.well-known/(card|cal)dav
traefik.frontend.redirect.replacement: https://$$1/remote.php/dav/

NGINX

location /.well-known/carddav {
    return 301 $scheme://$host/remote.php/dav;
}

location /.well-known/caldav {
    return 301 $scheme://$host/remote.php/dav;
}

Onlyoffice install

$ cd apps/

Get the Nextcloud ONLYOFFICE integration app. There are several ways to do that:

  • Download the latest signed version from the official store for Nextcloud.
  • Or you can download the latest signed version from the application release page on GitHub.
  • Or you can clone the application source code and compile it yourself:
$ git clone https://github.com/ONLYOFFICE/onlyoffice-nextcloud.git onlyoffice

Change the owner to update the application right from Nextcloud web interface:

$ chown -R www-data:www-data onlyoffice

Secret key

Onlyoffice#NextCloud Secret key항목을 참조.

Configuring Nextcloud ONLYOFFICE integration app

Onlyoffice-nextcloud-public.jpg

주의해야 할 점으로 위의 그림과 같이, Public Web 에서 Document Server 접속이 가능해야 한다.

추가로 Document Server 앱을 설치하면 개별 서버를 준비하지 않아도 된다.

Onlyoffice 재설치 방법

다음 순서로 진행하면 된다.

  • Nextcloud web UI 에서 OnlyOffice 앱을 제거한다.
  • 서버의 <path to your NC>/apps 폴더 이동. docker 설치시 /var/www/html/apps 이다.
  • 플러그인 다운로드:
  • Unpack the archive:
    • sudo -u www-data tar xvf onlyoffice.tar.gz
  • 파일 권한 변경:
    • sudo -u www-data find ./onlyoffice -type d -exec chmod 0750 {} \;
    • sudo -u www-data find ./onlyoffice -type f -exec chmod 0640 {} \;
  • Nextcloud web UI 에서 OnlyOffice 앱을 활성화 한다.

Troubleshooting

로그인 직후, 첫 번째 파일 목록 화면에서 느려지는 현상 해결하기

  • Recommendations을 사용하지 않는다. 플러그인에서 사용하지 않거나, 로그인 직후 첫 번째 파일 목록 화면에서 좌하단 설정 아이콘 클릭 후, Show recommendations 체크박스를 해제한다.
  • 그리고 Show rich workspace 체크박스도 하제한다.

The "documentType" parameter for the config object is invalid

OnlyOffice 7.3.0업그레이드 직후 파일 선택시 다음과 같은 에러가 발생된다.

The "documentType" parameter for the config object is invalid. Please correct it.

그래서 7.1.2로 다운그레이드 하자. 위의 #Onlyoffice 재설치 방법 항목 참조.

See also

Favorite site