### Example Bookmark Manager Commands Source: https://github.com/go-shiori/shiori/wiki/Frequently-Asked-Question Conceptual command-line interface examples for adding and searching bookmarks as described in the project's inspiration. ```bash $ bookmark add http://... ``` ```bash $ bookmark search "..." ``` -------------------------------- ### Install project dependencies Source: https://github.com/go-shiori/shiori/blob/master/webapp/README.md Run this command to install all required project dependencies using Bun. ```sh bun install ``` -------------------------------- ### Install Shiori from Source Source: https://github.com/go-shiori/shiori/wiki/Installation Download and install the Shiori package using Go modules. Requires Go version 1.14.1 or higher. ```bash go get -u -v github.com/go-shiori/shiori ``` -------------------------------- ### Preview documentation Source: https://github.com/go-shiori/shiori/blob/master/docs/Contribute.md Starts a local server to preview MkDocs documentation changes. ```bash mkdocs serve ``` -------------------------------- ### Start development server Source: https://github.com/go-shiori/shiori/blob/master/webapp/README.md Launches the development server with hot-reload capabilities. ```sh bun dev ``` -------------------------------- ### Run development server Source: https://github.com/go-shiori/shiori/blob/master/docs/Contribute.md Starts the local development server using default settings. ```bash make run-server ``` -------------------------------- ### Enable and start Shiori service Source: https://github.com/go-shiori/shiori/wiki/Frequently-Asked-Question Command to enable and immediately start the systemd service. ```sh systemctl enable --now shiori ``` -------------------------------- ### Add bookmark via CLI Source: https://github.com/go-shiori/shiori/blob/master/docs/CLI.md Examples of adding bookmarks using different flags for tags and custom titles. ```bash shiori add https://example.com ``` ```bash shiori add https://example.com -t "example-1,example-2" ``` ```bash shiori add https://example.com --title "example example" ``` -------------------------------- ### Run server with Docker Source: https://github.com/go-shiori/shiori/blob/master/docs/Contribute.md Starts the Shiori server using Docker Compose with hot-reload enabled. ```bash docker compose up shiori ``` -------------------------------- ### Run Shiori Docker Container Source: https://github.com/go-shiori/shiori/wiki/Usage Starts a Shiori container with a bound data directory for persistence. ```bash docker run -d --rm --name shiori -p 8080:8080 -v $(pwd):/srv/shiori radhifadlillah/shiori ``` -------------------------------- ### Setup Termux URL opener Source: https://github.com/go-shiori/shiori/blob/master/docs/Usage.md Commands to create the directory and file structure for the Termux URL sharing integration. ```bash mkdir -p ~/bin touch ~/bin/termux-url-opener chmod +x ~/bin/termux-url-opener nano ~/bin/termux-url-opener ``` -------------------------------- ### Default Web Interface Credentials Source: https://github.com/go-shiori/shiori/wiki/Usage Initial login credentials for a new Shiori installation. ```text username: shiori password: gopher ``` -------------------------------- ### Execute Wallabag to Shiori Import Script Source: https://github.com/go-shiori/shiori/wiki/Usage Downloads, makes executable, and runs the migration script. Requires jq to be installed on the system. ```sh curl -sSOL https://gist.githubusercontent.com/Aerex/01499c66f6b36a5d997f97ca1b0ab5b1/raw/bf793515540278fc675c7769be74a77ca8a41e62/wallabag2shiori' chmod +x wallabag2shiori ./wallbag2shiori 'path/to/to/wallabag_export_json_file' ``` -------------------------------- ### Cross-compile Shiori for Windows Source: https://github.com/go-shiori/shiori/wiki/Frequently-Asked-Question Commands to install dependencies and build Shiori for Windows architectures on Linux. ```sh $ sudo apt-get install gcc-mingw-w64 ``` ```sh # For Windows 64-bit GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 go build -o shiori-windows-amd64.exe # For Windows 32-bit GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc CGO_ENABLED=1 go build -o shiori-windows-386.exe ``` -------------------------------- ### Run server with Nginx reverse proxy Source: https://github.com/go-shiori/shiori/blob/master/docs/Contribute.md Starts Shiori and Nginx services for testing custom webroot configurations. ```yaml SHIORI_HTTP_ROOT_PATH: /shiori/ ``` ```bash docker compose up shiori nginx ``` -------------------------------- ### Compile frontend styles Source: https://github.com/go-shiori/shiori/blob/master/docs/Contribute.md Compiles LESS files into CSS for frontend changes. Requires bun to be installed. ```bash make styles ``` -------------------------------- ### Get tags list Source: https://github.com/go-shiori/shiori/wiki/API Retrieves all tags with their associated IDs and bookmark counts. ```json [ { "id": 1, "name": "Cool", "nBookmarks": 1 }, { "id": 2, "name": "Interesting", "nBookmarks": 1 } ``` -------------------------------- ### GET /api/bookmarks Source: https://github.com/go-shiori/shiori/wiki/API Retrieves the last 30 bookmarks. ```APIDOC ## GET /api/bookmarks ### Description Gets the last 30 bookmarks (last page). ### Method GET ### Endpoint /api/bookmarks ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session ID ### Response #### Success Response (200) - **bookmarks** (array) - List of bookmarks - **maxPage** (integer) - Total number of pages - **page** (integer) - Current page number ``` -------------------------------- ### Get Bookmarks Response Source: https://github.com/go-shiori/shiori/wiki/API The structure of the response when fetching the last 30 bookmarks. ```json { "bookmarks": [ { "id": 825, "url": "https://interesting_cool_article.com", "title": "Cool Interesting Article", "excerpt": "An interesting and cool article indeed!", "author": "", "public": 0, "modified": "2020-12-06 00:00:00", "imageURL": "", "hasContent": true, "hasArchive": true, "tags": [ { "id": 7, "name": "TAG" } ], "createArchive": false }, ], "maxPage": 19, "page": 1 } ``` -------------------------------- ### Lint source code Source: https://github.com/go-shiori/shiori/blob/master/docs/Contribute.md Runs code linting checks. Requires golangci-lint and swag to be installed. ```bash make lint ``` -------------------------------- ### GET /api/accounts Source: https://github.com/go-shiori/shiori/wiki/API Retrieves a list of all user accounts, including their IDs, usernames, and owner status. ```APIDOC ## GET /api/accounts ### Description Gets the list of all user accounts, their IDs, and whether or not they are owners. ### Method GET ### Endpoint /api/accounts ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session identifier. ### Response #### Success Response (200) - **id** (integer) - Account ID - **username** (string) - Username - **owner** (boolean) - Whether the user is an owner #### Response Example [ { "id": 1, "username": "shiori", "owner": true } ] ``` -------------------------------- ### Update API documentation Source: https://github.com/go-shiori/shiori/blob/master/docs/Contribute.md Generates Swagger documentation for REST API endpoints. Requires the swag tool to be installed. ```bash make swagger ``` -------------------------------- ### Configure Nginx Reverse Proxy Source: https://github.com/go-shiori/shiori/blob/master/docs/Configuration.md Example Nginx location block for serving Shiori behind a reverse proxy with a webroot path. ```nginx location /shiori/ { proxy_pass http://localhost:8080/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } ``` -------------------------------- ### GET /api/tags Source: https://github.com/go-shiori/shiori/wiki/API Retrieves a list of all tags, including their IDs and the count of bookmarks associated with each tag. ```APIDOC ## GET /api/tags ### Description Gets the list of tags, their IDs and the number of entries that have those tags. ### Method GET ### Endpoint /api/tags ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session identifier. ### Response #### Success Response (200) - **id** (integer) - Tag ID - **name** (string) - Tag name - **nBookmarks** (integer) - Number of bookmarks with this tag #### Response Example [ { "id": 1, "name": "Cool", "nBookmarks": 1 }, { "id": 2, "name": "Interesting", "nBookmarks": 1 } ] ``` -------------------------------- ### Initialize Shiori Vue Application Source: https://github.com/go-shiori/shiori/blob/master/internal/view/index.html Sets up the main Vue instance with necessary components, mixins, and global event bus. ```javascript import basePage from "./assets/js/page/base.js"; import LoginComponent from "./assets/js/component/login.js"; import pageHome from "./assets/js/page/home.js"; import pageSetting from "./assets/js/page/setting.js"; import customDialog from "./assets/js/component/dialog.js"; import EventBus from "./assets/js/component/eventBus.js"; Vue.prototype.$bus = EventBus; var app = new Vue({ el: '#app', mixins: [basePage], components: { pageHome, pageSetting, customDialog, 'login-view': LoginComponent }, data: { isLoggedIn: null, loginRequired: false, version: "$$.Version$$", activePage: "page-home", sidebarItems: [{ title: "Home", icon: "fa-home", page: "page-home", }, { title: "Settings", icon: "fa-cog", page: "page-setting", }], }, methods: { switchPage(page) { var pageName = page.replace("page-", ""), state = { activePage: page }, url = new Url; if (page === 'page-home' && this.activePage === 'page-home') { Vue.prototype.$bus.$emit('clearHomePage', {}); } url.hash = pageName; this.activePage = page; history.pushState(state, page, url); }, logout() { this.showDialog({ title: "Log Out", content: "Are you sure you want to log out ?", mainText: "Yes", secondText: "No", mainClick: () => { this.dialog.loading = true; fetch(new URL("api/v1/auth/logout", document.baseURI), { method: "post" }).then(response => { if (!response.ok) throw response; return response; }).then(() => { localStorage.removeItem("shiori-account"); localStorage.removeItem("shiori-token"); document.cookie = `session-id=; Path=${new URL(document.baseURI).pathname}; Expires=Thu, 01 Jan 1970 00:00:00 GMT;`; document.cookie = `token=; Path=${new URL(document.baseURI).pathname}; Expires=Thu, 01 Jan 1970 00:00:00 GMT;`; this.isLoggedIn = false; this.loginRequired = true; this.dialog.loading = false; this.dialog.visible = false; }).catch(err => { this.dialog.loading = false; this.getErrorMessage(err).then(msg => { this.showErrorDialog(msg); }) }); } }); }, saveSetting(opts) { this.appOptions = opts; this.themeSwitch(opts.Theme) }, loadSetting() { var opts = JSON.parse(localStorage.getItem("shiori-account")) || {}, ShowId = (typeof opts.config.ShowId === "boolean") ? opts.config.ShowId : false, ListMode = (typeof opts.config.ListMode === "boolean") ? opts.config.ListMode : false, HideThumbnail = (typeof opts.config.HideThumbnail === "boolean") ? opts.config.HideThumbnail : false, HideExcerpt = (typeof opts.config.HideExcerpt === "boolean") ? opts.config.HideExcerpt : false, Theme = (typeof opts.config.Theme === "string" && opts.config.Theme !== "") ? opts.config.Theme : "follow", KeepMetadata = (typeof opts.config.KeepMetadata === "boolean") ? opts.config.KeepMetadata : false, UseArchive = (typeof opts.config.UseArchive === "boolean") ? opts.config.UseArchive : false, CreateEbook = (typeof opts.config.CreateEbook === "boolean") ? opts.config.CreateEbook : false, MakePublic = (typeof opts.config.MakePublic === "boolean") ? opts.config.MakePublic : false; this.appOptions = { ShowId: ShowId, ListMode: ListMode, HideThumbnail: HideThumbnail, HideExcerpt: HideExcerpt, Theme: Theme, KeepMetadata: KeepMetadata, UseArchive: UseArchive, CreateEbook: CreateEbook, MakePublic: MakePublic, }; this.themeSwitch(Theme) }, loadAccount() { var account = JSON.parse(localStorage.getItem("shiori-account")) || {}, id = (typeof account.id === "number") ? account.id : 0, username = (typeof account.username === "string") ? account.username : "", owner = (typeof account.owner === "boolean") ? account.owner : false; this.activeAccount = { id: id, username: username, owner: owner, }; }, onLoginSuccess() { this.loadAccount(); this.loadSetting(); this.isLoggedIn = true; }, async validateSession() { const token = localStorage.getItem("shiori-token"); const account = localStorage.getItem("shiori-account"); try { const response = await fetch(new URL("api/v1/auth/me", document.baseURI), { headers: { "Authorization": `Bearer ${token}` } }); if (!response.ok) { throw new Error('Invalid session'); } const responseJSON = await response.json(); localStorage.setItem( "shiori-account", JSON.stringify(responseJSON.message), ); return true; } catch (err) { // Clear invalid session data localStorage.removeItem("shiori-account"); localStorage.removeItem("shiori-token"); document.cookie = `session-id=; Path=${new URL(document.baseURI).pathname}; Expires=Thu, 01 Jan 1970 00:00:00 GMT;`; document.cookie = `token=; Path=${new URL(document.baseURI).pathname}; Expires=Thu, 01 Jan 1970 00:00:00 GMT;`; return false; } }, async checkLoginStatus() { const isValid = await this.validateSession(); this.isLoggedIn = isValid; if (isValid) { this.loadSetting(); this.loadAccount(); } else { this.loginRequired = true; } } }, async mounted() { await this.checkLoginStatus(); if (this.isLoggedIn) { this.loadSetting(); this.loadAccount(); } // Prepare history state watcher var stateWatcher = (e) => { var state = e.state || {}; this.activePage = state.activePage || ``` -------------------------------- ### Initialize Linux data directory and service Source: https://github.com/go-shiori/shiori/blob/master/docs/faq.md Commands to prepare the storage directory and activate the systemd service. ```bash install -d /srv/machines/shiori ``` ```bash systemctl enable --now shiori ``` -------------------------------- ### View Shiori add command help Source: https://github.com/go-shiori/shiori/blob/master/docs/CLI.md Displays the help menu for the add command, listing all available flags and usage patterns. ```bash shiori add --help ``` -------------------------------- ### View CLI Help Source: https://github.com/go-shiori/shiori/wiki/Usage Displays the available subcommands and flags for the Shiori CLI. ```text Simple command-line bookmark manager built with Go Usage: shiori [command] Available Commands: add Bookmark the specified URL check Find bookmarked sites that no longer exists on the internet delete Delete the saved bookmarks export Export bookmarks into HTML file in Netscape Bookmark format help Help about any command import Import bookmarks from HTML file in Netscape Bookmark format open Open the saved bookmarks pocket Import bookmarks from Pocket's exported HTML file print Print the saved bookmarks serve Serve web interface for managing bookmarks update Update the saved bookmarks Flags: -h, --help help for shiori --portable run shiori in portable mode Use "shiori [command] --help" for more information about a command. ``` -------------------------------- ### Create an account Source: https://github.com/go-shiori/shiori/wiki/API Registers a new user account with a username, password, and owner flag. ```json { "username": "shiori2", "password": "gopher", "owner": false } ``` -------------------------------- ### Configure PostgreSQL Database URL Source: https://github.com/go-shiori/shiori/blob/master/docs/Configuration.md Set the SHIORI_DATABASE_URL environment variable to connect to a PostgreSQL instance. ```bash SHIORI_DATABASE_URL="postgres://pqgotest:password@hostname/database?sslmode=verify-full" ``` -------------------------------- ### Configure systemd service for Shiori Source: https://github.com/go-shiori/shiori/wiki/Frequently-Asked-Question Service unit configurations for running Shiori on startup. Choose the variant matching your deployment method (Docker, portable binary, or secure system service). ```ini [Unit] Description=Shiori container After=docker.service [Service] Restart=always ExecStartPre=-/usr/bin/docker rm shiori-1 ExecStart=/usr/bin/docker run \ --rm \ --name shiori-1 \ -p 8080:8080 \ -v /srv/machines/shiori:/srv/shiori \ radhifadlillah/shiori ExecStop=/usr/bin/docker stop -t 2 shiori-1 [Install] WantedBy=multi-user.target ``` ```ini [Unit] Description=Shiori service [Service] ExecStart=/home/user/go/bin/shiori serve --portable Restart=always [Install] WantedBy=multi-user.target ``` ```ini [Unit] Description=shiori service Requires=network-online.target After=network-online.target [Service] Type=simple ExecStart=/usr/bin/shiori serve Restart=always User=shiori Group=shiori Environment="SHIORI_DIR=/var/lib/shiori" DynamicUser=true PrivateUsers=true ProtectHome=true ProtectKernelLogs=true RestrictAddressFamilies=AF_INET AF_INET6 StateDirectory=shiori SystemCallErrorNumber=EPERM SystemCallFilter=@system-service SystemCallFilter=~@chown SystemCallFilter=~@keyring SystemCallFilter=~@memlock SystemCallFilter=~@setuid DeviceAllow= CapabilityBoundingSet= LockPersonality=true MemoryDenyWriteExecute=true NoNewPrivileges=true PrivateDevices=true PrivateTmp=true ProtectControlGroups=true ProtectKernelTunables=true ProtectSystem=full ProtectClock=true ProtectKernelModules=true ProtectProc=noaccess ProtectHostname=true ProcSubset=pid RestrictNamespaces=true RestrictRealtime=true RestrictSUIDSGID=true SystemCallArchitectures=native SystemCallFilter=~@clock SystemCallFilter=~@debug SystemCallFilter=~@module SystemCallFilter=~@mount SystemCallFilter=~@raw-io SystemCallFilter=~@reboot SystemCallFilter=~@privileged SystemCallFilter=~@resources SystemCallFilter=~@cpu-emulation SystemCallFilter=~@obsolete UMask=0077 [Install] WantedBy=multi-user.target ``` -------------------------------- ### Run test suite Source: https://github.com/go-shiori/shiori/blob/master/docs/Contribute.md Commands and environment variables for running unit tests with database dependencies. ```bash docker-compose up -d mariadb mysql postgres ``` ```text SHIORI_TEST_PG_URL=postgres://shiori:shiori@127.0.0.1:5432/shiori?sslmode=disable SHIORI_TEST_MYSQL_URL=shiori:shiori@tcp(127.0.0.1:3306)/shiori SHIORI_TEST_MARIADB_URL=shiori:shiori@tcp(127.0.0.1:3307)/shiori ``` ```bash make unittest ``` -------------------------------- ### Build Shiori Docker Image Source: https://github.com/go-shiori/shiori/wiki/Installation Build a custom Docker image locally using the provided Dockerfile. ```bash docker build -t shiori . ``` -------------------------------- ### Build for production Source: https://github.com/go-shiori/shiori/blob/master/webapp/README.md Performs type-checking, compilation, and minification for production deployment. ```sh bun run build ``` -------------------------------- ### Configure MySQL Database URL Source: https://github.com/go-shiori/shiori/blob/master/docs/Configuration.md Set the SHIORI_DATABASE_URL environment variable to connect to a MySQL instance. ```bash SHIORI_DATABASE_URL="mysql://username:password@(hostname:port)/database?charset=utf8mb4" ``` -------------------------------- ### Run unit tests Source: https://github.com/go-shiori/shiori/blob/master/webapp/README.md Executes the project's unit test suite using Vitest. ```sh bun test:unit ``` -------------------------------- ### Prepare Shiori data directory Source: https://github.com/go-shiori/shiori/wiki/Frequently-Asked-Question Create the required directory for Shiori data when using Docker. ```sh install -d /srv/machines/shiori ``` -------------------------------- ### Execute Pocket Import Script Source: https://github.com/go-shiori/shiori/wiki/Usage Commands to download, set permissions for, and execute the Pocket import script. ```sh wget 'https://gist.githubusercontent.com/dchakro/fa43b0e89f884826d3bd60f51e48b078/raw/pocket2shiori.sh' chmod +x pocket2shiori.sh pocket2shiori.sh 'path_to_your/pocket_export.html' ``` -------------------------------- ### Configure Shiori as a macOS LaunchAgent Source: https://github.com/go-shiori/shiori/blob/master/docs/faq.md Plist configuration for running Shiori automatically on macOS login. ```xml Label local.app.shiori EnvironmentVariables SHIORI_HTTP_SECRET_KEY somerandomvalue123489 ProgramArguments /absolute/path/to/shiori/binary server --storage-directory /absolute/path/to/shiori/storage/directory RunAtLoad ServiceDescription Shiori Bookmarking Service ``` -------------------------------- ### Initialize View and Navigation State Source: https://github.com/go-shiori/shiori/blob/master/internal/view/index.html Sets up the popstate event listener for navigation and determines the initial active page based on the URL hash. ```javascript "page-home"; } window.addEventListener('popstate', stateWatcher); this.$once('hook:beforeDestroy', function () { window.removeEventListener('popstate', stateWatcher); }) // Set initial active page var initialPage = (new Url).hash || "home"; if (initialPage === "home" || initialPage === "setting") { this.activePage = `page-${initialPage}`; } else { history.replaceState(null, "page-home", "/#home"); } } }) ``` -------------------------------- ### Initialize Vue component for bookmark content Source: https://github.com/go-shiori/shiori/blob/master/internal/view/content.html Initializes the Vue instance for the content scene, handling bookmark metadata, date formatting, and local storage settings. ```javascript // Create initial variable import basePage from "./assets/js/page/base.js"; new Vue({ el: '#content-scene', mixins: [basePage], data: { created: "$$.Book.CreatedAt$$" }, methods: { createdModifiedTime() { const strCreatedTime = "$$.Book.CreatedAt$$".replace(" ", "T") + ("$$.Book.CreatedAt$$".endsWith("Z") ? "" : "Z"); const strModifiedTime = "$$.Book.ModifiedAt$$".replace(" ", "T") + ("$$.Book.ModifiedAt$$".endsWith("Z") ? "" : "Z"); const createdDate = new Date(strCreatedTime); const modifiedDate = new Date(strModifiedTime); if (createdDate.toDateString() === modifiedDate.toDateString()) { return `Added ${createdDate.getDate()} ${createdDate.toLocaleString('default', { month: 'long' })} ${createdDate.getFullYear()}`; } else { return `Added ${createdDate.getDate()} ${createdDate.toLocaleString('default', { month: 'long' })} ${createdDate.getFullYear()} | Last Modified ${modifiedDate.getDate()} ${modifiedDate.toLocaleString('default', {month: 'long'})} ${modifiedDate.getFullYear()}`; } }, loadSetting() { var opts = JSON.parse(localStorage.getItem("shiori-account")) || {}, ShowId = (typeof opts.config.ShowId === "boolean") ? opts.config.ShowId : false, ListMode = (typeof opts.config.ListMode === "boolean") ? opts.config.ListMode : false, Theme = (typeof opts.config.Theme === "string" && opts.config.Theme !== "") ? opts.config.Theme : "follow", UseArchive = (typeof opts.config.UseArchive === "boolean") ? opts.config.UseArchive : false, CreateEbook = (typeof opts.config.CreateEbook === "boolean") ? opts.config.CreateEbook : false; this.appOptions = { ShowId: ShowId, ListMode: ListMode, Theme: Theme, UseArchive: UseArchive, CreateEbook: CreateEbook, }; this.themeSwitch(Theme) } }, mounted() { this.loadSetting(); document.querySelectorAll("#content a").forEach(elem => { elem.setAttribute("target", "_blank"); elem.setAttribute("rel", "noopener noreferrer"); }); } }); ``` -------------------------------- ### Add Bookmark Response Source: https://github.com/go-shiori/shiori/wiki/API The response returned after successfully adding a bookmark. ```json { "id": 827, "url": "https://interesting_cool_article.com", "title": "TITLE", "excerpt": "EXCERPT", "author": "AUTHOR", "public": 1, "modified": "DATE", "html": "HTML", "imageURL": "/bookmark/827/thumb", "hasContent": false, "hasArchive": true, "tags": [ { "name": "Interesting" }, { "name": "Cool" } ], "createArchive": true } ``` -------------------------------- ### Lint project files Source: https://github.com/go-shiori/shiori/blob/master/webapp/README.md Runs ESLint to check for code quality and style issues. ```sh bun lint ``` -------------------------------- ### Import Wallabag entries via shell script Source: https://github.com/go-shiori/shiori/blob/master/docs/Usage.md Commands to download, permit execution, and run the Wallabag import script. ```sh curl -sSOL https://gist.githubusercontent.com/Aerex/01499c66f6b36a5d997f97ca1b0ab5b1/raw/bf793515540278fc675c7769be74a77ca8a41e62/wallabag2shiori' chmod +x wallabag2shiori ./wallabag2shiori 'path/to/to/wallabag_export_json_file' ``` -------------------------------- ### Pull Shiori Docker Image Source: https://github.com/go-shiori/shiori/wiki/Installation Download the latest automated build of Shiori from Docker Hub. ```bash docker pull radhifadlillah/shiori ``` -------------------------------- ### Add Shiori to PATH on Linux or MacOS Source: https://github.com/go-shiori/shiori/wiki/Installation Add the directory containing the Shiori binary to your system PATH in your profile configuration file. ```bash export PATH=$PATH:/path/to/shiori ``` -------------------------------- ### Deploy Shiori with Kubernetes Deployment Manifest Source: https://github.com/go-shiori/shiori/blob/master/docs/Installation.md Defines the deployment configuration for Shiori, including volume mounts for data persistence and temporary storage for ebook generation. ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: shiori labels: app: shiori spec: replicas: 1 selector: matchLabels: app: shiori template: metadata: labels: app: shiori spec: volumes: - name: app hostPath: path: /path/to/data/dir - name: tmp emptyDir: medium: Memory containers: - name: shiori image: ghcr.io/go-shiori/shiori:latest command: ["/usr/bin/shiori", "serve"] imagePullPolicy: Always ports: - containerPort: 8080 env: - name: SHIORI_DIR value: /srv/shiori volumeMounts: - mountPath: /srv/shiori name: app - mountPath: /tmp name: tmp ``` -------------------------------- ### Add Bookmark Request and Response Source: https://github.com/go-shiori/shiori/blob/master/docs/API.md Payload for adding a new bookmark and the corresponding server response. Note that title and excerpt are automatically fetched by the server. ```json { "url": "https://interesting_cool_article.com", "createArchive": true, "public": 1, "tags": [{"name": "Interesting"}, {"name": "Cool"}], "title": "Cool Interesting Article", "excerpt": "An interesting and cool article indeed!" } ``` ```json { "id": 827, "url": "https://interesting_cool_article.com", "title": "TITLE", "excerpt": "EXCERPT", "author": "AUTHOR", "public": 1, "modified": "DATE", "html": "HTML", "imageURL": "/bookmark/827/thumb", "hasContent": false, "hasArchive": true, "tags": [ { "name": "Interesting" }, { "name": "Cool" } ], "createArchive": true } ``` -------------------------------- ### POST /api/login Source: https://github.com/go-shiori/shiori/wiki/API Logs in to the system to obtain a session ID. ```APIDOC ## POST /api/login ### Description Logs in using your username and password to obtain a session ID for subsequent requests. ### Method POST ### Endpoint /api/login ### Request Body - **username** (string) - Required - The account username - **password** (string) - Required - The account password - **remember** (integer) - Optional - Remember session flag - **owner** (boolean) - Optional - Owner status ### Request Example { "username": "shiori", "password": "gopher", "remember": 1, "owner": true } ### Response #### Success Response (200) - **session** (string) - The session ID - **account** (object) - Account details #### Response Example { "session": "YOUR_SESSION_ID", "account": { "id": 1, "username": "shiori", "owner": true } } ``` -------------------------------- ### Pull Shiori Docker image Source: https://github.com/go-shiori/shiori/blob/master/docs/Installation.md Download the latest automated build of Shiori from the GitHub Container Registry. ```bash docker pull ghcr.io/go-shiori/shiori ``` -------------------------------- ### POST /api/accounts Source: https://github.com/go-shiori/shiori/wiki/API Creates a new user account. ```APIDOC ## POST /api/accounts ### Description Creates a new user. ### Method POST ### Endpoint /api/accounts ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session identifier. #### Request Body - **username** (string) - Required - The username for the new account. - **password** (string) - Required - The password for the new account. - **owner** (boolean) - Required - Whether the user is an owner. ### Request Example { "username": "shiori2", "password": "gopher", "owner": false } ``` -------------------------------- ### Log in Response Source: https://github.com/go-shiori/shiori/wiki/API The JSON response containing the session ID and account details. ```json { "session": "YOUR_SESSION_ID", "account": { "id": 1, "username": "shiori", "owner": true } } ``` -------------------------------- ### Access Shiori Container Console Source: https://github.com/go-shiori/shiori/wiki/Usage Opens an interactive shell session inside the running Shiori container. ```bash docker exec -it shiori sh ``` -------------------------------- ### POST /api/bookmarks Source: https://github.com/go-shiori/shiori/wiki/API Adds a new bookmark. ```APIDOC ## POST /api/bookmarks ### Description Add a bookmark. Shiori automatically fetches the title and excerpt. ### Method POST ### Endpoint /api/bookmarks ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session ID ### Request Body - **url** (string) - Required - URL to bookmark - **createArchive** (boolean) - Optional - Whether to create an archive - **public** (integer) - Optional - Public visibility flag - **tags** (array) - Optional - List of tags in format [{"name": "tagname"}] ### Request Example { "url": "https://interesting_cool_article.com", "createArchive": true, "public": 1, "tags": [{"name": "Interesting"}, {"name": "Cool"}] } ``` -------------------------------- ### Expose Shiori with Kubernetes Service Source: https://github.com/go-shiori/shiori/blob/master/docs/Installation.md Configures a LoadBalancer service to route traffic to the Shiori deployment on port 8080. ```yaml apiVersion: v1 kind: Service metadata: name: shiori spec: type: LoadBalancer selector: app: shiori ports: - port: 8080 targetPort: 8080 ``` -------------------------------- ### List accounts Source: https://github.com/go-shiori/shiori/wiki/API Retrieves a list of all user accounts including ownership status. ```json [ { "id": 1, "username": "shiori", "owner": true } ] ``` -------------------------------- ### Termux URL opener script Source: https://github.com/go-shiori/shiori/blob/master/docs/Usage.md The script content to handle incoming shared URLs and authenticate with the Shiori API. ```bash #!/bin/bash # shiori settings Shiori_URL="http://127.0.0.1:8080" Username="shiori" Password="gopher" token=$(curl -s -X POST -H "Content-Type: application/json" -d '{"username": "'"$Username"'" , "password": "'"$Password"'", "remember": true}' $Shiori_URL/api/v1/auth/login | grep -oP '(?<="token":")[^"]*') curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d '{ "url": "'"$1"'", "createArchive": false, "public": 1, "tags": [], "title": "", "excerpt": "" }' $Shiori_URL/api/bookmarks exit ``` -------------------------------- ### Refresh Profile Configuration Source: https://github.com/go-shiori/shiori/wiki/Installation Apply changes to your profile file immediately without restarting the terminal session. ```bash source $HOME/.bash_profile or source $HOME/.profile ``` -------------------------------- ### Cleanup Import Files Source: https://github.com/go-shiori/shiori/wiki/Usage Command to remove the temporary script and export file after the import process is finished. ```sh rm pocket2shiori.sh 'path_to_your/pocket_export.html' ``` -------------------------------- ### Route Traffic with Kubernetes Ingress Source: https://github.com/go-shiori/shiori/blob/master/docs/Installation.md Sets up an NGINX ingress rule to route external traffic to the Shiori service. ```yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: shiori spec: ingressClassName: nginx rules: - http: paths: - path: / pathType: Prefix backend: service: name: shiori port: number: 8080 ``` -------------------------------- ### Add Bookmark Request Body Source: https://github.com/go-shiori/shiori/wiki/API Payload for adding a new bookmark. Note that tags must be provided as a list of objects. ```json { "url": "https://interesting_cool_article.com", "createArchive": true, "public": 1, "tags": [{"name": "Interesting"}, {"name": "Cool"}], "title": "Cool Interesting Article", "excerpt": "An interesting and cool article indeed!" } ``` -------------------------------- ### Stop Shiori Container Source: https://github.com/go-shiori/shiori/wiki/Usage Terminates the running Shiori container. ```bash docker stop shiori ``` -------------------------------- ### PUT /api/bookmarks Source: https://github.com/go-shiori/shiori/wiki/API Modifies an existing bookmark. ```APIDOC ## PUT /api/bookmarks ### Description Modifies a bookmark by ID. ### Method PUT ### Endpoint /api/bookmarks ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session ID ### Request Body - **id** (integer) - Required - The ID of the bookmark to modify ``` -------------------------------- ### Log in to Shiori Source: https://github.com/go-shiori/shiori/blob/master/docs/API.md Authenticates a user to obtain a session ID required for subsequent API requests. ```json { "username": "shiori", "password": "gopher", "remember": true, "owner": true } ``` ```json { "session": "YOUR_SESSION_ID", "account": { "id": 1, "username": "shiori", "owner": true } } ``` -------------------------------- ### POST /api/logout Source: https://github.com/go-shiori/shiori/wiki/API Logs out of the current session. ```APIDOC ## POST /api/logout ### Description Logs out of a session ID. ### Method POST ### Endpoint /api/logout ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session ID to invalidate ``` -------------------------------- ### Log in Request Body Source: https://github.com/go-shiori/shiori/wiki/API Payload required to authenticate and obtain a session ID. ```json { "username": "shiori", "password": "gopher", "remember": 1, "owner": true } ``` -------------------------------- ### Edit an account Source: https://github.com/go-shiori/shiori/wiki/API Updates an existing account's password or owner status. ```json { "username": "shiori", "oldPassword": "gopher", "newPassword": "gopher", "owner": true } ``` -------------------------------- ### Delete accounts Source: https://github.com/go-shiori/shiori/wiki/API Removes a list of users by their usernames. ```json ["shiori", "shiori2"] ``` -------------------------------- ### PUT /api/accounts Source: https://github.com/go-shiori/shiori/wiki/API Updates an existing account's password or owner status. ```APIDOC ## PUT /api/accounts ### Description Changes an account's password or owner status. ### Method PUT ### Endpoint /api/accounts ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session identifier. #### Request Body - **username** (string) - Required - The username of the account to edit. - **oldPassword** (string) - Required - The current password. - **newPassword** (string) - Required - The new password. - **owner** (boolean) - Required - The new owner status. ### Request Example { "username": "shiori", "oldPassword": "gopher", "newPassword": "gopher", "owner": true } ``` -------------------------------- ### Edit Bookmark Request Body Source: https://github.com/go-shiori/shiori/wiki/API Payload for modifying an existing bookmark by ID. ```json { "id": 3, "url": "https://interesting_cool_article.com", "title": "Cool Interesting Article", "excerpt": "An interesting and cool article indeed!", "author": "AUTHOR", "public": 1, "modified": "2019-09-22 00:00:00", "imageURL": "/bookmark/3/thumb", "hasContent": false, "hasArchive": false, "tags": [], "createArchive": false } ``` -------------------------------- ### Rename a tag Source: https://github.com/go-shiori/shiori/wiki/API Updates the name of an existing tag using its ID. ```json { "id": 1, "name": "TAG_NEW_NAME" } ``` -------------------------------- ### Delete Bookmark Request Body Source: https://github.com/go-shiori/shiori/wiki/API Payload containing a list of bookmark IDs to be deleted. ```json [1, 2, 3] ``` -------------------------------- ### PUT /api/tag Source: https://github.com/go-shiori/shiori/wiki/API Renames an existing tag identified by its ID. ```APIDOC ## PUT /api/tag ### Description Renames a tag, provided its ID. ### Method PUT ### Endpoint /api/tag ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session identifier. #### Request Body - **id** (integer) - Required - The ID of the tag to rename. - **name** (string) - Required - The new name for the tag. ### Request Example { "id": 1, "name": "TAG_NEW_NAME" } ``` -------------------------------- ### PUT /api/tags Source: https://github.com/go-shiori/shiori/blob/master/docs/API.md Renames an existing tag identified by its ID. ```APIDOC ## PUT /api/tags ### Description Renames a tag, provided its ID. ### Method PUT ### Endpoint /api/tags ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session identifier for authentication. #### Request Body - **id** (integer) - Required - The ID of the tag to rename. - **name** (string) - Required - The new name for the tag. ### Request Example { "id": 1, "name": "TAG_NEW_NAME" } ``` -------------------------------- ### DEL /api/accounts Source: https://github.com/go-shiori/shiori/wiki/API Deletes a list of user accounts. ```APIDOC ## DEL /api/accounts ### Description Deletes a list of users. ### Method DEL ### Endpoint /api/accounts ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session identifier. #### Request Body - **usernames** (array) - Required - A list of usernames to delete. ### Request Example ["shiori", "shiori2"] ``` -------------------------------- ### DEL /api/bookmarks Source: https://github.com/go-shiori/shiori/wiki/API Deletes a list of bookmarks. ```APIDOC ## DEL /api/bookmarks ### Description Deletes a list of bookmarks by their IDs. ### Method DEL ### Endpoint /api/bookmarks ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session ID ### Request Body - **ids** (array) - Required - List of bookmark IDs to delete ``` -------------------------------- ### POST /api/logout Source: https://github.com/go-shiori/shiori/blob/master/docs/API.md Invalidates the current session ID. ```APIDOC ## POST /api/logout ### Description Logs out the current user by invalidating the session ID provided in the header. ### Method POST ### Endpoint /api/logout ### Parameters #### Headers - **X-Session-Id** (string) - Required - The session ID to invalidate ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.