Skip to content

Commit

Permalink
Deploying to gh-pages from @ 0627c06 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
kkovaletp committed Jul 14, 2024
1 parent 85a3ab9 commit 19b64d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion en/docs/installation-manual/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
height: 100vh;
}</style><aside id="content-toc" class="w-48 sticky docs-toc order-3 flex-shrink-0"><span class="block uppercase text-gray-600 font-bold text-xs tracking-wider pt-0">Contents</span><nav class="toc"><ol><li><a href="#preparation">Preparation</a></li><li><a href="#download-and-build-photoview">Download and build Photoview</a><ol><li><a href="#build-the-web-user-interface">Build the Web user-interface</a></li><li><a href="#build-the-api-back-end">Build the API back-end</a></li><li><a href="#copy-needed-files">Copy needed files</a></li></ol></li><li><a href="#setup-database">Setup database</a></li><li><a href="#configure-photoview">Configure Photoview</a></li><li><a href="#install-optional-dependencies">Install optional dependencies</a><ol><li><a href="#raw-photo-support">RAW photo support</a></li><li><a href="#video-transcoding">Video transcoding</a></li><li><a href="#exif-parsing">Exif parsing</a></li></ol></li><li><a href="#post-installation">Post installation</a></li><li><a href="#updating">Updating</a></li></ol></nav></aside><main id="primary-content" class="mb-40 w-full px-14 py-14"><header class="flex justify-between items-center"><h1>Manual Setup</h1><div class="flex items-center"><a title="Edit on GitHub" class="text-gray-500 hover:text-primaryDark no-underline" href="https://github.com/photoview/photoview.github.io/edit/master/./src/en/docs/installation-manual.md"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-3"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg> </a><select class="ml-5" id="lg-switcher" onchange="changeLanguage()"><option class="lg-switcher-item" selected="selected" value="/en/docs/installation-manual/">English</option><option class="lg-switcher-item" value="/fr/docs/installation-manual/">Français</option></select><script>function changeLanguage() {
document.location.href=document.getElementById("lg-switcher").value;
}</script></div></header><p>This guide explains how to build, install and configure Photoview on a fresh installation of <code>Ubuntu 20.04 LTS</code> to run directly on the system without using Docker.</p><h2 id="preparation" tabindex="-1"><a class="header-anchor" href="#preparation" aria-label="Anchor"></a> Preparation</h2><p>Make sure you got the necessary tools and libraries in order to build and run Photoview.</p><pre class="language-shell"><code class="language-shell"><span class="token comment"># Make sure your computer is up to date</span><br>$ <span class="token function">sudo</span> <span class="token function">apt</span> update<br>$ <span class="token function">sudo</span> <span class="token function">apt</span> upgrade<br><br><span class="token comment"># Install tools used in this guide</span><br>$ <span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> <span class="token function">git</span> <span class="token function">curl</span> <span class="token function">wget</span><br><br><span class="token comment"># Install necessary repositories</span><br>$ <span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> software-properties-common<br>$ <span class="token function">sudo</span> add-apt-repository ppa:strukturag/libheif<br>$ <span class="token function">sudo</span> add-apt-repository ppa:strukturag/libde265<br><br><span class="token comment"># Install dependencies required to build and run Photoview</span><br>$ <span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg-turbo8-dev build-essential <span class="token punctuation">\</span><br> libdlib19 libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg-dev libheif-dev pkg-config gpg</code></pre><p>Install Golang by following the instructions for Linux from their <a href="https://golang.org/doc/install">Download and install Go</a> page, the steps should be something like the following.</p><pre class="language-shell"><code class="language-shell"><span class="token comment"># Download Go</span><br>$ <span class="token function">wget</span> https://golang.org/dl/go1.16.linux-amd64.tar.gz<br><br><span class="token comment"># Install Go</span><br>$ <span class="token function">sudo</span> <span class="token function">tar</span> -C /usr/local -xzf go1.16.linux-amd64.tar.gz<br>$ <span class="token function">rm</span> go1.16.linux-amd64.tar.gz<br><br><span class="token comment"># Add Go to the path of your user</span><br>$ <span class="token builtin class-name">echo</span> <span class="token string">'export PATH=$PATH:/usr/local/go/bin'</span> <span class="token operator">>></span> <span class="token string">"<span class="token environment constant">$HOME</span>/.bashrc"</span> <span class="token operator">&amp;&amp;</span> <span class="token builtin class-name">source</span> <span class="token string">"<span class="token environment constant">$HOME</span>/.bashrc"</span><br><br><span class="token comment"># Verify that go is now installed</span><br>$ go version<br><span class="token comment"># Expected output: go version go1.16 linux/amd64</span></code></pre><p>Now install Node 16 and NPM if you've not done so already (it installs npm automatically)</p><pre class="language-shell"><code class="language-shell">$ <span class="token function">curl</span> -fsSL https://deb.nodesource.com/setup_16.x <span class="token operator">|</span> <span class="token function">sudo</span> -E <span class="token function">bash</span> -<br>$ <span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> nodejs</code></pre><h2 id="download-and-build-photoview" tabindex="-1"><a class="header-anchor" href="#download-and-build-photoview" aria-label="Anchor"></a> Download and build Photoview</h2><p>Navigate to <a href="https://github.com/photoview/photoview/releases">Photoview Releases</a> and download the source code for the latest version, extract it and open the extracted directory in the terminal.</p><pre class="language-shell"><code class="language-shell">$ <span class="token builtin class-name">cd</span> /opt<br>$ <span class="token function">git</span> clone https://github.com/photoview/photoview.git<br>$ <span class="token builtin class-name">cd</span> photoview/</code></pre><h3 id="build-the-web-user-interface" tabindex="-1"><a class="header-anchor" href="#build-the-web-user-interface" aria-label="Anchor"></a> Build the Web user-interface</h3><pre class="language-shell"><code class="language-shell">$ <span class="token builtin class-name">cd</span> ui/<br>$ <span class="token function">npm</span> <span class="token function">install</span><br>$ <span class="token function">npm</span> run build</code></pre><p>This builds the UI source code and saves it in the <code>ui/build/</code> directory.</p><h3 id="build-the-api-back-end" tabindex="-1"><a class="header-anchor" href="#build-the-api-back-end" aria-label="Anchor"></a> Build the API back-end</h3><pre class="language-shell"><code class="language-shell">$ <span class="token builtin class-name">cd</span> api/<br>$ go build -v -o photoview <span class="token builtin class-name">.</span></code></pre><p>This builds the server executable to <code>api/photoview</code>.</p><h3 id="copy-needed-files" tabindex="-1"><a class="header-anchor" href="#copy-needed-files" aria-label="Anchor"></a> Copy needed files</h3><p>Make a new directory and move the needed files to it.</p><pre class="language-shell"><code class="language-shell">$ <span class="token builtin class-name">cd</span> /opt/photoview<br>$ <span class="token function">mkdir</span> app<br>$ <span class="token function">cp</span> -r ui/build/ app/ui/<br>$ <span class="token function">cp</span> api/photoview app/photoview<br>$ <span class="token function">cp</span> -r api/data/ app/data/</code></pre><h2 id="setup-database" tabindex="-1"><a class="header-anchor" href="#setup-database" aria-label="Anchor"></a> Setup database</h2><blockquote><p>It's highly recommended to configure a full database, but Sqlite is also supported though it might be substantially slower on big media libraries. If you decide to use Sqlite, you can skip this step.</p></blockquote><p>If you don't already have a database you can configure one by following this guide on <a href="https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04">installing MySQL on Ubuntu 20.04</a>.</p><p>If you've not done already, configure a new database and user to use with Photoview.</p><pre class="language-shell"><code class="language-shell">$ <span class="token function">sudo</span> mysql<br><span class="token comment"># Create new user named 'photoview'</span><br>mysql<span class="token operator">></span> CREATE <span class="token environment constant">USER</span> <span class="token string">'photoview'</span>@<span class="token string">'localhost'</span> IDENTIFIED BY <span class="token string">'Photo_Secret#12345'</span><span class="token punctuation">;</span><br><span class="token comment"># Create new database named 'photoview'</span><br>mysql<span class="token operator">></span> CREATE DATABASE photoview<span class="token punctuation">;</span><br><span class="token comment"># Grant user full access to the newly created database</span><br>mysql<span class="token operator">></span> GRANT ALL PRIVILEGES ON photoview.* TO <span class="token string">'photoview'</span>@<span class="token string">'localhost'</span><span class="token punctuation">;</span></code></pre><p>This will create a new user <code>photoview</code> with the password <code>Photo_Secret#12345</code> and a new database named <code>photoview</code>.</p><p>When you're done you should have a running MySQL database with a new user identified by a username and password and an empty database.</p><h2 id="configure-photoview" tabindex="-1"><a class="header-anchor" href="#configure-photoview" aria-label="Anchor"></a> Configure Photoview</h2><p>Photoview is configured through environment variables. It will also load environment variables from a <code>.env</code> file. We will use that to configure Photoview.</p><p>Copy the <code>api/example.env</code> file to the output directory, and name it <code>.env</code>.</p><pre class="language-shell"><code class="language-shell">$ <span class="token function">cp</span> api/example.env app/.env</code></pre><p>To configure the database to use our MySQL database, edit <code>PHOTOVIEW_MYSQL_URL</code> to match our database configuration. Replace <code>user</code>, <code>password</code> and <code>dbname</code>.</p><pre><code>PHOTOVIEW_DATABASE_DRIVER=mysql
}</script></div></header><p>This guide explains how to build, install and configure Photoview on a fresh installation of <code>Ubuntu 20.04 LTS</code> to run directly on the system without using Docker.</p><blockquote><p>NOTE: Here is the <a href="https://smyck.net/2023/04/25/how-to-install-photoview-on-freebsd/">blog post</a> with the step-by-step guide to install Photoview on FreeBSD.</p></blockquote><h2 id="preparation" tabindex="-1"><a class="header-anchor" href="#preparation" aria-label="Anchor"></a> Preparation</h2><p>Make sure you got the necessary tools and libraries in order to build and run Photoview.</p><pre class="language-shell"><code class="language-shell"><span class="token comment"># Make sure your computer is up to date</span><br>$ <span class="token function">sudo</span> <span class="token function">apt</span> update<br>$ <span class="token function">sudo</span> <span class="token function">apt</span> upgrade<br><br><span class="token comment"># Install tools used in this guide</span><br>$ <span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> <span class="token function">git</span> <span class="token function">curl</span> <span class="token function">wget</span><br><br><span class="token comment"># Install necessary repositories</span><br>$ <span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> software-properties-common<br>$ <span class="token function">sudo</span> add-apt-repository ppa:strukturag/libheif<br>$ <span class="token function">sudo</span> add-apt-repository ppa:strukturag/libde265<br><br><span class="token comment"># Install dependencies required to build and run Photoview</span><br>$ <span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg-turbo8-dev build-essential <span class="token punctuation">\</span><br> libdlib19 libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg-dev libheif-dev pkg-config gpg</code></pre><p>Install Golang by following the instructions for Linux from their <a href="https://golang.org/doc/install">Download and install Go</a> page, the steps should be something like the following.</p><pre class="language-shell"><code class="language-shell"><span class="token comment"># Download Go</span><br>$ <span class="token function">wget</span> https://golang.org/dl/go1.16.linux-amd64.tar.gz<br><br><span class="token comment"># Install Go</span><br>$ <span class="token function">sudo</span> <span class="token function">tar</span> -C /usr/local -xzf go1.16.linux-amd64.tar.gz<br>$ <span class="token function">rm</span> go1.16.linux-amd64.tar.gz<br><br><span class="token comment"># Add Go to the path of your user</span><br>$ <span class="token builtin class-name">echo</span> <span class="token string">'export PATH=$PATH:/usr/local/go/bin'</span> <span class="token operator">>></span> <span class="token string">"<span class="token environment constant">$HOME</span>/.bashrc"</span> <span class="token operator">&amp;&amp;</span> <span class="token builtin class-name">source</span> <span class="token string">"<span class="token environment constant">$HOME</span>/.bashrc"</span><br><br><span class="token comment"># Verify that go is now installed</span><br>$ go version<br><span class="token comment"># Expected output: go version go1.16 linux/amd64</span></code></pre><p>Now install Node 16 and NPM if you've not done so already (it installs npm automatically)</p><pre class="language-shell"><code class="language-shell">$ <span class="token function">curl</span> -fsSL https://deb.nodesource.com/setup_16.x <span class="token operator">|</span> <span class="token function">sudo</span> -E <span class="token function">bash</span> -<br>$ <span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> nodejs</code></pre><h2 id="download-and-build-photoview" tabindex="-1"><a class="header-anchor" href="#download-and-build-photoview" aria-label="Anchor"></a> Download and build Photoview</h2><p>Navigate to <a href="https://github.com/photoview/photoview/releases">Photoview Releases</a> and download the source code for the latest version, extract it and open the extracted directory in the terminal.</p><pre class="language-shell"><code class="language-shell">$ <span class="token builtin class-name">cd</span> /opt<br>$ <span class="token function">git</span> clone https://github.com/photoview/photoview.git<br>$ <span class="token builtin class-name">cd</span> photoview/</code></pre><h3 id="build-the-web-user-interface" tabindex="-1"><a class="header-anchor" href="#build-the-web-user-interface" aria-label="Anchor"></a> Build the Web user-interface</h3><pre class="language-shell"><code class="language-shell">$ <span class="token builtin class-name">cd</span> ui/<br>$ <span class="token function">npm</span> <span class="token function">install</span><br>$ <span class="token function">npm</span> run build</code></pre><p>This builds the UI source code and saves it in the <code>ui/build/</code> directory.</p><h3 id="build-the-api-back-end" tabindex="-1"><a class="header-anchor" href="#build-the-api-back-end" aria-label="Anchor"></a> Build the API back-end</h3><pre class="language-shell"><code class="language-shell">$ <span class="token builtin class-name">cd</span> api/<br>$ go build -v -o photoview <span class="token builtin class-name">.</span></code></pre><p>This builds the server executable to <code>api/photoview</code>.</p><h3 id="copy-needed-files" tabindex="-1"><a class="header-anchor" href="#copy-needed-files" aria-label="Anchor"></a> Copy needed files</h3><p>Make a new directory and move the needed files to it.</p><pre class="language-shell"><code class="language-shell">$ <span class="token builtin class-name">cd</span> /opt/photoview<br>$ <span class="token function">mkdir</span> app<br>$ <span class="token function">cp</span> -r ui/build/ app/ui/<br>$ <span class="token function">cp</span> api/photoview app/photoview<br>$ <span class="token function">cp</span> -r api/data/ app/data/</code></pre><h2 id="setup-database" tabindex="-1"><a class="header-anchor" href="#setup-database" aria-label="Anchor"></a> Setup database</h2><blockquote><p>It's highly recommended to configure a full database, but Sqlite is also supported though it might be substantially slower on big media libraries. If you decide to use Sqlite, you can skip this step.</p></blockquote><p>If you don't already have a database you can configure one by following this guide on <a href="https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04">installing MySQL on Ubuntu 20.04</a>.</p><p>If you've not done already, configure a new database and user to use with Photoview.</p><pre class="language-shell"><code class="language-shell">$ <span class="token function">sudo</span> mysql<br><span class="token comment"># Create new user named 'photoview'</span><br>mysql<span class="token operator">></span> CREATE <span class="token environment constant">USER</span> <span class="token string">'photoview'</span>@<span class="token string">'localhost'</span> IDENTIFIED BY <span class="token string">'Photo_Secret#12345'</span><span class="token punctuation">;</span><br><span class="token comment"># Create new database named 'photoview'</span><br>mysql<span class="token operator">></span> CREATE DATABASE photoview<span class="token punctuation">;</span><br><span class="token comment"># Grant user full access to the newly created database</span><br>mysql<span class="token operator">></span> GRANT ALL PRIVILEGES ON photoview.* TO <span class="token string">'photoview'</span>@<span class="token string">'localhost'</span><span class="token punctuation">;</span></code></pre><p>This will create a new user <code>photoview</code> with the password <code>Photo_Secret#12345</code> and a new database named <code>photoview</code>.</p><p>When you're done you should have a running MySQL database with a new user identified by a username and password and an empty database.</p><h2 id="configure-photoview" tabindex="-1"><a class="header-anchor" href="#configure-photoview" aria-label="Anchor"></a> Configure Photoview</h2><p>Photoview is configured through environment variables. It will also load environment variables from a <code>.env</code> file. We will use that to configure Photoview.</p><p>Copy the <code>api/example.env</code> file to the output directory, and name it <code>.env</code>.</p><pre class="language-shell"><code class="language-shell">$ <span class="token function">cp</span> api/example.env app/.env</code></pre><p>To configure the database to use our MySQL database, edit <code>PHOTOVIEW_MYSQL_URL</code> to match our database configuration. Replace <code>user</code>, <code>password</code> and <code>dbname</code>.</p><pre><code>PHOTOVIEW_DATABASE_DRIVER=mysql
PHOTOVIEW_MYSQL_URL=user:password@tcp(localhost)/dbname

PHOTOVIEW_SERVE_UI=1
Expand Down
2 changes: 1 addition & 1 deletion search-data.json

Large diffs are not rendered by default.

0 comments on commit 19b64d7

Please sign in to comment.