0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-27 22:59:51 -05:00
verdaccio/website/translated_docs/vi/auth.md
verdacciobot 4112587d72 New Crowdin translations (#908)
* New translations auth.md (Vietnamese)
docs(website): new translations

* New translations auth.md (Vietnamese)
docs(website): new translations

* New translations auth.md (Vietnamese)
docs(website): new translations

* New translations auth.md (Vietnamese)
docs(website): new translations

* New translations ansible.md (Vietnamese)
docs(website): new translations

* New translations auth.md (Vietnamese)
docs(website): new translations

* New translations auth.md (Vietnamese)
docs(website): new translations

* New translations auth.md (Vietnamese)
docs(website): new translations

* New translations ansible.md (Vietnamese)
docs(website): new translations

* New translations auth.md (Vietnamese)
docs(website): new translations

* New translations build.md (Vietnamese)
docs(website): new translations

* New translations build.md (Vietnamese)
docs(website): new translations

* New translations chef.md (Vietnamese)
docs(website): new translations

* New translations ci.md (Vietnamese)
docs(website): new translations

* New translations chef.md (Vietnamese)
docs(website): new translations

* New translations cli.md (Vietnamese)
docs(website): new translations

* New translations ci.md (Vietnamese)
docs(website): new translations

* New translations cli.md (Vietnamese)
docs(website): new translations

* New translations cli.md (Vietnamese)
docs(website): new translations

* New translations auth.md (Vietnamese)
docs(website): new translations

* New translations cli.md (Vietnamese)
docs(website): new translations

* New translations auth.md (Vietnamese)
docs(website): new translations
2018-08-09 20:53:31 +02:00

2.8 KiB

id title
yêu cầu xác thực Yêu cầu xác thực

Cài đặt yêu cầu xác thực có liên quan chặt chẽ đến plugin mà bạn đang sử dụng. Giới hạn truy cập gói cũng được kiểm soát thông qua quyền truy cập gói.

Quá trình xác thực của khách hàng được xử lý bởi chính công cụ npm. Bạn có thể đăng nhập vào ứng dụng bằng lệnh sau:

npm adduser --registry http://localhost:4873

npm sẽ lưu Token được Verdaccio trả về trong tệp cấu hình, tệp này sẽ được lưu trữ trong thư mục chính của bạn. Để biết thêm thông tin về cấu hình .npmrc, vui lòng xem tài liệu chính thức .

cat .npmrc
registry=http://localhost:5555/
//localhost:5555/:_authToken="secretVerdaccioToken"
//registry.npmjs.org/:_authToken=secretNpmjsToken

Gói phát hành ẩn danh

Bạn có thể chọn gói phát hành ẩn danh khi sử dụng verdaccio, để bật chế độ này lên bạn cần cài đặt phần quyền truy cập gói một cách chính xác.

Ví dụ:

  'my-company-*':
    access: $anonymous
    publish: $anonymous
    proxy: npmjs

Như đã giải thích từ phần issue #212 đến phần npm@5.3.0 và trong tất cả các phiên bản phụ ** bạn sẽ không được phép công khai các mã code của mình nếu không có một token nào**. Tuy nhiên đối với công cụ quản lý thư viện yarn thì không có yêu cầu này.

Tự động tạo ra tập tin htpasswd

Để đơn giản hóa quá trình cài đặt, verdaccio đã sử dụng plugin dựa vào tập tin htpasswd. Plugin ngoài đã được cài đặt mặc định trong phiên bản v3.0.x. V2.x trong package (gói) này vẫn là phiên bản tích hợp với plugin này.

auth:
  htpasswd:
    file: ./htpasswd
    # Maximum amount of users allowed to register, defaults to "+inf".
    # You can set this to -1 to disable registration.
    #max_users: 1000
Lớp Property Phương thức Yêu cầu Ví dụ Hỗ trợ Miêu tả
tập tin string ./htpasswd tất cả tập tin lưu trữ các thông tin đã được mã hóa
max_users số Không 1000 tất cả giới hạn người dùng

Trường hợp bạn không muốn người dùng đăng nhập, bạn cài đặt max_users: -1.