
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
This is a Node.js sample application for the https://developers.google.com/photos.
This sample shows how to connect an app with Google Photos through OAuth 2.0 and display a user's photos and albums in an "online photo frame".
This app is built using https://expressjs.com/ and Material Design Lite.
Create an environtment file photo-frame.env with the following options:
CLIENT_ID=xxxxxxx.apps.googleusercontent.com CLIENT_SECRET=xxxxxxx
Then run an update with:
docker-compose pull docker-compose up -d
To change image alignment of a specific photo, put in into the Google Photos description as json with CSS settings like {"photoFrame":{"vertical":"bottom"}}, {"photoFrame":{"horizontal":"left"}} or activate blurred backdrop for portrait or panorama photos with {"photoFrame":{"size":"contain"}}.
Possible fields are:
{ "photoFrame": { "vertical": "bottom", "horizontal": "left", "size": "contain" } }
This web app is an online photo frame that allows users to load photos from a search, an album or the library and then show these images in a full screen slideshow.
!Screenshot of photo frame !Screenshot of login screen
Before you can run this sample, you must set up a Google Developers project and configure authentication credentials. Follow the https://developers.google.com/photos/library/guides/get-started to complete these steps:
http://127.0.0.1 and the authorized redirect URL to http://127.0.0.1:8080/auth/google/callback if you are running the app locally.Client ID and Client secret to the file config.js, replacing the placeholder values:// The OAuth client ID from the Google Developers console. config.oAuthClientID = 'ADD YOUR CLIENT ID'; // The OAuth client secret from the Google Developers console. config.oAuthclientSecret = 'ADD YOUR CLIENT SECRET';
You are now ready to run the sample:
REST/PhotoFrame.npm install,node app.js.By default, the app will listen on port 8080. Open a web browser and navigate to [***] to access the app.
Make sure that you have configured the Client ID and the Client secret in the configuration file config.js.
Also check that the URLs configured for these credentials match how you access the server. By default this is configured for 127.0.0.1 (localhost) on port 8080.
You can also start the app with additional debug logging by setting the DEBUG environment variable to true. For example:
DEBUG=TRUE node app.js
The app is built using the https://expressjs.com/ framework and the ejs templating system.
First, the user has to log in via OAuth 2.0 and authorize the https://www.googleapis.com/auth/photoslibrary.readonly scope. (See the file config.js.)
Once authenticated, photos are loaded into the photo frame via search or from an album.
The app is split into the backend (app.js) and the front end (static/...). The photo frame preview screen make AJAX requests to the backend to load a list of selected photos. Likewise, the album screen makes an AJAX request to the backend to load the list of albums that are owned by the user. The backend returns media items or albums directly from the Library API that are parsed and rendered in the browser.
The search screen (/search) is loaded from a template file located at views/pages/search.ejs that contains the search form.
When this form is submitted, the POST request is received in app.js in the handler app.post('/loadFromSearch', ...). The values sent in the form are used to prepare a [filter] object that is then submitted to the Google Photos Library API /search endpoint in libraryApiSearch(authToken, parameters).
The call to the API in libraryApiSearch(authToken, parameters) shows how to handle the nextPageToken to retrieve multiple pages of search results.
The album screen (/album) is loaded from a template file located at views/pages/album.ejs. When this screen is loaded, the browser makes a request to /getAlbums that is received by the server app.js in the handler app.get('/getAlbums', ...).
The method libraryApiGetAlbums(authToken) is called to load the albums from the API. This method shows to handle the nextPageToken to retrieve a complete list of all albums owned by the user.
The retrieved [albums] are returned and displayed through the file static/js/album.js. Here the album objects are parsed and the title, cover photo and number of items are rendered on screen.
When an album is selected, the handler app.post('/loadFromAlbum', ...) receives the id of the album that was picked. Here, a search parameter is constructed and passed to libraryApiSearch(authToken, parameters) to load the images.
Photos are displayed on the photo frame page of this app. The template file is located at views/pages/frame.ejs. When this page is loaded, a request is made to app.get('/getQueue', ...) to the server app.js.
This handler returns a list of the mediaItems the user has loaded into the frame through search or from an album. They are rendered for display by the browser through the file static/js/frame.js. Here the caption is constructed from the description and other media metadata. A thumbnail, scaled based on the original height and width, is used to render a preview initially while the image at full resolution is being loaded.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务