Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download without Docker #70

Closed
mattipunkt opened this issue Aug 18, 2020 · 2 comments
Closed

Download without Docker #70

mattipunkt opened this issue Aug 18, 2020 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@mattipunkt
Copy link

Can this software be downloaded without Docker?

@viktorstrate
Copy link
Member

Yes, but you would have to build it your self.
I haven't written proper documentation on this yet, but below I've written the necessary steps to do so :)

  1. Clone the repository
  2. Build the web UI
    Run: cd ./ui && npm install && npm run build
  3. Copy the built web UI to the api directory:
    Run: cp ./ui/dist ./api/ui
  4. Build the back-end
    Run: cd ./api && go build -v -o photoview .
  5. Set config environment variables in .env file
    5.1. Copy ./api/example.env to ./api/.env
    5.2 Change the following variables:
    • MYSQL_URL to point to your mysql server
    • API_LISTEN_PORT to the port you want the server to run on
    • Comment outAPI_ENDPOINT and UI_ENDPOINT they will not be used
    • Set SERVE_UI=1
    • Uncomment PUBLIC_ENDPOINT and set it to the public url from which the server will be accessed, if it's only for your local network, set this to http://<the local ip of your server>:<the port specified in API_LISTEN_PORT>/
    • Set DEVELOPMENT=0 to improve performance and security.
  6. Start the server
    Run: cd ./api && ./photoview
    (you might have to give the binary executable permissions by running chmod +x ./api/photoview)

Please note that I haven't tested the steps above but they are highly based on the steps in the Dockerfile.
Feel free to ask if you have any questions. I hope to simplify this procedure in the future (this could easily be automated with a shell script)

The original source files are not used to run the server, only the following files:

  • ./api/photoview the actual server binary
  • ./api/database/migrations/ the files used to configure the database
  • ./api/ui/ all the built web ui files (step 3)

@viktorstrate viktorstrate added the documentation Improvements or additions to documentation label Aug 19, 2020
@DevilsDesigns
Copy link

DevilsDesigns commented Feb 2, 2021

i have a question on 5.2 instructions. Where will i find my mysql_url as i get this error upon running
2021/02/02 11:16:40 WARN: Could not ping database: Environment variable PHOTOVIEW_MYSQL_URL missing, exiting. Will retry after 5 seconds
i have most definetly setup mysql database and user and checked to make sure its all there. my .env

PHOTOVIEW_DATABASE_DRIVER=mysql
PHOTOVIEW_MYSQL_URL=photoview:password@tcp(localhost)/photoview

# Specifies the connection string for the postgres database, if PHOTOVIEW_DATABASE_DRIVER is set to 'postgres'
# See https://www.postgresql.org/docs/current/libpq-ssl.html for possible ssl modes
# PHOTOVIEW_POSTGRES_URL=postgres://user:password@host:port/dbname?sslmode=(disable|allow|...)

# Specifies the filepath for the sqlite database, if PHOTOVIEW_DATABASE_DRIVER is set to 'sqlite'
# PHOTOVIEW_SQLITE_PATH=photoview.db

PHOTOVIEW_LISTEN_IP=localhost
PHOTOVIEW_LISTEN_PORT=4001

# The url from which the server can be accessed publicly
#PHOTOVIEW_API_ENDPOINT=http://localhost:4001/
#PHOTOVIEW_UI_ENDPOINT=http://localhost:1234/

# Path where media should be cached, defaults to ./media_cache
# PHOTOVIEW_MEDIA_CACHE=./media_cache

# Set to 1 for the server to also serve the built static ui files
PHOTOVIEW_SERVE_UI=1
# When PHOTOVIEW_SERVE_UI is 1, PHOTOVIEW_PUBLIC_ENDPOINT is used instead of PHOTOVIEW_API_ENDPOINT and PHOTOVIEW_UI_ENDPOINT
PHOTOVIEW_PUBLIC_ENDPOINT=http://localhost:4001/

# Enter a valid mapbox token, to enable maps feature
# A token can be created for free at https://mapbox.com
#MAPBOX_TOKEN=<insert mapbox token here>

# Set to 1 to set server in development mode, this enables graphql playground
# Remove this if running in production
PHOTOVIEW_DEVELOPMENT_MODE=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants