{"id":22753391,"url":"https://github.com/hsfzxjy/albu","last_synced_at":"2025-08-18T07:11:43.455Z","repository":{"id":71072398,"uuid":"288188290","full_name":"hsfzxjy/albu","owner":"hsfzxjy","description":"A semi-static mobile photo gallery hosted on Tencent COS \u0026 Serverless.","archived":false,"fork":false,"pushed_at":"2020-09-25T11:29:52.000Z","size":6471,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T05:34:50.509Z","etag":null,"topics":["cos-serverless","gallery-images","serverless","static-site-generator"],"latest_commit_sha":null,"homepage":"http://wcc.hsfzxjy.site","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hsfzxjy.png","metadata":{"files":{"readme":"README-en.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-17T13:31:05.000Z","updated_at":"2020-09-25T09:41:10.000Z","dependencies_parsed_at":"2023-04-08T22:51:02.883Z","dependency_job_id":null,"html_url":"https://github.com/hsfzxjy/albu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hsfzxjy/albu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsfzxjy%2Falbu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsfzxjy%2Falbu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsfzxjy%2Falbu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsfzxjy%2Falbu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hsfzxjy","download_url":"https://codeload.github.com/hsfzxjy/albu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsfzxjy%2Falbu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270957444,"owners_count":24675147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cos-serverless","gallery-images","serverless","static-site-generator"],"created_at":"2024-12-11T06:10:31.131Z","updated_at":"2025-08-18T07:11:43.427Z","avatar_url":"https://github.com/hsfzxjy.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# albu\n\n[中文](README.md) | English\n\nA semi-static mobile photo gallery hosted on Tencent COS \u0026 Serverless.\n\n[DEMO](demo/README.md)\n\n## Highlights\n\n + **Nearly cost-free**. **albu** is hosted on Tencent COS (as a static server for photos and web pages) and Serverless (as an authentication backend), saving a lot of money compared with traditional sites on VPS.\n + **Diary-like timeline**. Photos are organized and sorted by their creation time. Short sentences (**Remarks**) or phrases (**Milestones**) can be inserted between photos in memory of certain events or anniversaries.\n + **Powerful access control**. Photos, Remarks and Milestones might be public (viewed by anyone) or private (guarded by authentication).\n + **Customized sharing**. Instead of showing a full list of public photos, one can generate customized links to exhibit photos (Remarks and Milestones) falling in certain time periods.\n + **Highly optimized**. \n   + Pre-compress all photos to reduce bandwidth usage; \n   + Render visible items only to reduce memory usage;\n   + Chunkize Chiniese fonts according to frequency of characters, in order to reduce loading time of fonts.\n + **Wechat sharing support**. **albu** can be configured to display custom titles and thumbnails when sharing too Wechat friends / timeline.\n\n\n## Overview\n\nLike other static site generators, **albu** does most of the heavy work (photo compression, building web pages, etc.) locally, and then deploys generated contents onto cloud services.\n\n`tools/` contains some scripts to simplify workflow like selecting / compressing photos, uploading assets, chunkizing fonts etc.\n\n`web/` contains the source code of web pages. **albu** uses Vue.js as front-end framework.\n\n`auth/` contains the source code of an authentication backend, which runs on Tencent Serverless. The backend checks password (unlock gesture) sent from frontend, and responds with a token for authenticated user. The token is used for accessing private contents on COS. The backend also provides signing service for Wechat sharing functions.\n\n`assets/source/` contains the source photos that you would like to exhibit in the gallery. \n\n`assets/_generated/` contains the generated static assets that would be uploaded to COS. It is **NOT** recommended to edit any files under this directory manually.\n\n## Quick Start\n\nAssume that you have opened COS and Serveless services on Tencent Cloud.\n\n### Configuration\n\nCopy `config.example.json` to `config.json` in the root directory, and fill the blanks following the instructions below:\n\n + `tcloud` section contains the information of your Tencent cloud account.\n + `cos` section contains the meta information of your created COS bucket.\n + `secret` is the secret key for encrytion. You can use any random string here.\n + `passwords` contains user-defined unlock gestures for accessing private contents. The elements in it should be strings of `0...8`, representing the consecutive path of the gestures. Each circle is encoded as:\n   ```\n   0 1 2\n   3 4 5\n   6 7 8\n   ```\n + `web` contains some meta information of web pages:\n   + `web.authURL` is the URL of deployed auth backend. This should be filled later.\n   + `web.title` is the document title of web pages.\n + `wx` section (optional) contains the information of your Wechat developer account. This is used by Wechat sharing functions.\n\nAfter done, simply run `python3 setup.py` to dispatch configuration into sub-directories.\n\n### Install Dependencies\n\nYou should have both `Node.js \u003e= 10` and `Python \u003e= 3.6` installed.\n\nRun the following command to install global dependencies:\n\n```bash\n[sudo] python3 -m pip install -r requirements.txt\n[sudo] npm install -g serverless\n```\n\n### Prepare \u0026 Upload Photos\n\nSource photos are stored under `assets/source/`. You can either copy your photos or make symbol links into the directory.\n\n**albu** provides a simple photo selector to allow you conveniently select a subset from a long list of photos. Simply run `tools/selector.py --src \u003cglob\u003e`, where `\u003cglob\u003e` is a glob expression like `Photos/*.jpg`. In the pop-up window, you can press \u003ckbd\u003eA\u003c/kbd\u003e/\u003ckbd\u003eD\u003c/kbd\u003e to navigate forward / backward, and \u003ckbd\u003eSpace\u003c/kbd\u003e/\u003ckbd\u003eX\u003c/kbd\u003e to select / deselect a photo.\n\nAfter the source prepared, run `tools/proc.py` to pre-process the photos. The script compresses the photos and generates meta data for exhibiting. The generated assets are stored under `assets/_generated/`.\n\nWith these steps done, the assets are ready to be deployed. Simply run `tools/sync.py` to synchronize local and remote assets.\n\nIf photos are added or deleted in the future, just repeat the above pre-processing and synchronizing steps to finish deployment. **albu** transfers only modified assets between local and the cloud.\n\n### Deploy Authentication Backend\n\nSimply run the following commands for deployment:\n\n```bash\ncd auth/\nserverless deploy\n```\n\nAfter done, the console will print out a URL like `https://service-xxxxxxxx-1254463987.gz.apigw.tencentcs.com/release/`, which is the link to the backend. Please fill `web.authURL` in `config.json` with this URL.\n\n### Deploy Web Pages\n\nSimply run the folowing commands:\n\n```bash\ncd web/\nnpm install\nnpm run deploy\n```\n\nTo customize the Chinese font of Remarks and Milestones, simply place your font under `web/src/fonts/` and rename to `custom.ttf`. Run `tools/makefont.py` to chunkize the font and generate corresponding SCSS code.\n\nTo customize favico and Wechat sharing cover, simply overwrite `favico.png` and `wx_cover.png` under `web/public/`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsfzxjy%2Falbu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhsfzxjy%2Falbu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsfzxjy%2Falbu/lists"}