Giter Site home page Giter Site logo

docker-polr's Issues

wait-for-it keeps spinning it's wheels

I think this is an issue of not understanding the install process for this, and I'm hoping you can help clarify if that's the case or not.

I've installed using the following CLI command (passwords redacted)

docker run -d
--name polr
--env DB_HOST='localhost'
--env DB_DATABASE='rdw_polr_docker'
--env DB_USERNAME='rdw_polr_docker'
--env DB_PASSWORD='dbPassword'
--env APP_ADDRESS='rdw.one'
--env ADMIN_USERNAME='heatheriac'
--env ADMIN_PASSWORD='password'
--publish 18180:8080
--restart always
ajanvier/polr`

but in my logs in Portainer, I just get the same three lines repeating over and over:

wait-for-it.sh: waiting 120 seconds for localhost:3306
wait-for-it.sh: timeout occurred after waiting 120 seconds for localhost:3306
wait-for-it.sh: strict mode, refusing to execute subprocess

It's like the database isn't spinning up, and I'm not sure if this means if there's some secondary container I'm supposed to be running or what

Inconsistent environment variable naming

Environment variables used by this docker image sometimes differ from what Polr actually uses (nameley ST_ vs SETTING_). Moreover the readme contains Polr specific names, which won't work once you set them. This is confusing, any particular reason to do it that way?

SETTING_SHORTEN_PERMISSION=${ST_SHORTEN_PERMISSION}

500 Error on /action/lookup instead of 404 when url_ending does not exist

Hi! Thank you for making this docker image - really appreciate it. I ran in to an issue when running a GET/POST on the action/lookup endpoint. When using the endpoint to confirm that a url_ending has been used, it works perfectly if the ending DOES exist in the database, however, if the link DOES NOT exist, then I receive a 500 error instead of a 404 Link does not exist as mentioned in the Polr source code here

I ran this test on the official demo site Polr has: demo.polr.me and this same API call returns a 404 (which is what I expect). Which leads me to believe it's an issue in this image, so I was wondering if anyone else had this problem?

I deployed on DigitalOcean with the following configuration setup using mysql in another container on same host:

DB_HOST=MYHOST
DB_DATABASE=link
DB_USERNAME=root
DB_PASSWORD=MYSECRETPASSWORD
APP_ADDRESS=link.encoreapp.co
ADMIN_USERNAME=root
ADMIN_PASSWORD=MYSECRETPASSWORD

Here's the GET error I receive:

2021-03-13T05:24:39.865756513Z 10.0.1.14 - - [13/Mar/2021:05:24:39 +0000] "GET /api/v2/action/lookup?url_ending=test&key=MYAPIKEY HTTP/1.0" 500 4558 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" "108.214.21.187" 0.081 0.080 . -

This 500 returns HTML and says: Whoops, looks like something went wrong. No other help message unfortunately.

Can anyone else replicate?

Class AdminSeeder does not exist

Got the newest version (with the braclet) but it still doesnt quite work :c

Error:
[ReflectionException]
Class AdminSeeder does not exist

Tables are being created but obviously not the "admin" user.

PHP <7.3 bug with MariaDB = 10.2.35, 10.3.26

The container currently does not run if a user is running the aforementioned versions of MariaDB.
It will result in the following error:

  [PDOException]
  SQLSTATE[HY000] General error: 1835 Malformed communication packet




  [PDOException]
  SQLSTATE[HY000] General error: 1835 Malformed communication packet


Updating...


  [ErrorException]
  get_headers(): php_network_getaddresses: getaddrinfo failed: Name does not resolve




  [PDOException]
  SQLSTATE[HY000] General error: 1835 Malformed communication packet

You can find more information regarding the bug here and here.

Looks like just rebuilding the container would force it to update to PHP 7.3 and resolve the issue, however, I noticed when attempting to do so that the container wouldn't start due to the wait-for-it.sh script with the following error(s):

timeout: unrecognized option: t
BusyBox v1.31.1 () multi-call binary.

Usage: timeout [-s SIG] SECS PROG ARGS

Runs PROG. Sends SIG to it if it is not gone in SECS seconds.
Default SIG: TERM.
wait-for-it.sh: timeout occurred after waiting 120 seconds for mariadb:3306
wait-for-it.sh: strict mode, refusing to execute subprocess
timeout: unrecognized option: t
BusyBox v1.31.1 () multi-call binary.

Usage: timeout [-s SIG] SECS PROG ARGS

Runs PROG. Sends SIG to it if it is not gone in SECS seconds.
Default SIG: TERM.
wait-for-it.sh: timeout occurred after waiting 120 seconds for mariadb:3306
wait-for-it.sh: strict mode, refusing to execute subprocess
timeout: unrecognized option: t
BusyBox v1.31.1 () multi-call binary.

Usage: timeout [-s SIG] SECS PROG ARGS

Runs PROG. Sends SIG to it if it is not gone in SECS seconds.
Default SIG: TERM.
wait-for-it.sh: timeout occurred after waiting 120 seconds for mariadb:3306
wait-for-it.sh: strict mode, refusing to execute subprocess

Updating to the latest wait-for-it.sh seems to resolve the issue, and doing so would result in another push to DockerHub which would in turn update PHP so I'll add a PR shortly to fix this.

Startup Error in Docker compose example

Hi there.

Sadly there is an error when you start up the docker compose example of yours.
When I want to startup the file the following error is thrown:

[ReflectionException]
Class AdminSeeder does not exist

And of course I can't login afterwards :-)

Cheers

Add wait-for-it.sh to check if database is already running.

The current Dockerfile startup procedure does expect that there is already a database running.
If you try to run docker-compose the service will fail as the initialization of the database takes longer then starting the polr container. Therefore the database does not get migrated with the correct tables if it is empty.
By using the wait-for-it.sh script to start /start.sh in the ENTRYPOINT, you could test if the port of the database is accessible.

I think running polr without a database is never possible? Therefore it should be always usful to check if the database is accessible.

Postgres support

Does this docker image support postgres?

docker logs show:

wait-for-it.sh: db:5432 is available after 0 seconds


  [PDOException]
  SQLSTATE[HY000] [2006] MySQL server has gone away



  [PDOException]
  PDO::__construct(): MySQL server has gone away

Polr not using APP_ADDRESS

Hello,
I don't know how active you are on GitHub but it seems like Polr is not using the env variable APP_ADDRESS properly.
Let's say I am running this behing a reverse proxy to give it a domain name, so I have to use APP_ADDRESS.
When I click on a button like "About", the app name button or even just login, it is redirecting me to my localhost.
If I go to sub.domain.tld/admin I'm in the regular admin panel, but if you get redirected after clicking the login button it sends you to 127.0.0.1:(whatever port)

Links in menu using 443

The links in the menu at the top right are using 443 (example.com:443/admin)

Setting the APP_PROTOCOL to http:// should fix this ?

I'm using the letsencrypt reverse proxy so I want the container to stay non-https and have the reverse proxy manage the security.

URL Shortening Doesn't Work On Install

Expected Behavior

You enter the URL, click shorten and it should give you the shortened link.

Current Behavior

A red error message appears in the top right corner, saying the link I am trying to shorten already appears to be already shortened. (tried many links from youtube, facebook, google, non work locally but they do in the demo)

Possible Solution

Unaware what could be causing this. Tried on 3 different droplets.

Steps to Reproduce (for bugs)

Tired docker run and tried docker compose

  1. Create docker-compose.yml File
  2. Enter Env Variables
  3. docker compose up

or

  1. Run docker command

Your Environment

Digital Ocean Droplets
Chrome: Latest
Safari: Latest
Server: Ubuntu 18.4
Server 2: Linux Alpine Latest
Server 3: LAMP on Ubuntu 18.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.