Coder Social home page Coder Social logo

aunefyren / poenskelisten Goto Github PK

View Code? Open in Web Editor NEW
109.0 5.0 6.0 3.98 MB

A self-hosted application for sharing wishlists and collaborating on gifts and presents.

Go 47.48% HTML 12.24% CSS 3.57% JavaScript 36.53% Dockerfile 0.18%
api application go self-hosting website wishlists docker planning presents christmas

poenskelisten's Introduction

Hi there 👋

Aune's Github stats

Cloud-services masters graduate. Loves network infrastructure, open source, Docker, APIs, web-programming, statistics & penetration testing.

Feel free to get in touch! ✉️

poenskelisten's People

Contributors

aunefyren avatar dependabot[bot] avatar schklom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

poenskelisten's Issues

wish as satisfied

It will be very convenient and nice enhancement, if we can check mark a wish as satisfied.
it will make our future selves, very happy :)

Additional fields for items (wish's)

Would be great to have a value field with a currency prefix set by the server.

An image would be great also, something that could auto pick the image from the given link would be great, but even just a basic image upload or image URL option would be great.

poenskelisten-app isnt running in portainer

Hi there,

Just put the docker-compose into portainer and ran it. Made a few config changes due to possible confliction with other things im running. Let me know if my changes have created these issues below since it doesnt seem to be running properly.

version: '3.3'
services:

  db:
    image: mysql:5.7
    container_name: poenskelisten-db
    restart: unless-stopped
    environment:

      # The table name you chose
      MYSQL_DATABASE: 'ponske'

      # User, so you don't have to use root 
      MYSQL_USER: 'myuser'

      # Please switch this password
      MYSQL_PASSWORD: 'hvWQget%PhFx#EyS3s$T2#f#LBrg96zn' 

      # Password for root access, change this too
      MYSQL_ROOT_PASSWORD: 'uDrVWf^bK4J7pUeGeqiGX6RQduZK97Nb' 

    networks:
      - db
    expose:
      - '3306'

    # Where our DB data will be persisted
    volumes:
      - ./db/:/var/lib/mysql/ # Location of DB data

  poenskelisten:
    container_name: poenskelisten-app
    image: aunefyren/poenskelisten:latest
    restart: unless-stopped
    networks:
      - db
    depends_on:
      - db

    # Where our Pønskeliste files are
    volumes:
      - ./data/:/app/files/

    ports:
      - '8081:8081'
    environment:

      # Generate an unused invite code on startup
      # Remove this value to avoid continuous code-generation
      generateinvite: true

      # The container will only respect these ENV if they are empty in the config.json
      # Useful for first setup
      port: 8081
      timezone: Europe/Oslo
      dbip: db
      dbport: 3306
      dbname: ponske
      dbusername: myuser
      dbpassword: mystrongpassword
      disablesmtp: false
      smtphost: smtphost
      smtpport: 25
      smtpusername: myusername
      smtppassword: mypassword

  phpmyadmin:
    image: phpmyadmin:latest
    restart: unless-stopped
    environment:

      - PMA_ARBITRARY=1

      # DB table
      - PMA_HOST:ponske 

      # Root password
      - MYSQL_ROOT_PASSWORD:root 

      # Timezone
      - TZ=Europe/Oslo 

    container_name: poenskelisten-phpmyadmin
    ports:
      - 80:80
    depends_on:
      - db
    networks:
      - db

networks:
  db:
    external: false

Getting this from the poenskelisten-app:
2023/01/25 15:55:49 /app/database/client.go:25
[error] failed to initialize database, got error Error 1045: Access denied for user 'myuser'@'172.21.0.4' (using password: YES)
Failed to connect to database. Error: Error 1045: Access denied for user 'myuser'@'172.21.0.4' (using password: YES)

from the poenskelisten-db:

2023-01-25T14:51:04.614954Z 2 [Note] Access denied for user 'myuser'@'172.21.0.4' (using password: YES)
2023-01-25T14:51:06.709508Z 3 [Note] Access denied for user 'myuser'@'172.21.0.4' (using password: YES)
2023-01-25T14:51:10.394697Z 4 [Note] Access denied for user 'myuser'@'172.21.0.4' (using password: YES)
2023-01-25T14:51:17.301688Z 5 [Note] Access denied for user 'myuser'@'172.21.0.4' (using password: YES)
2023-01-25T14:51:30.555322Z 6 [Note] Access denied for user 'myuser'@'172.21.0.4' (using password: YES)
2023-01-25T14:51:56.721395Z 7 [Note] Access denied for user 'myuser'@'172.21.0.4' (using password: YES)
2023-01-25T14:52:48.426242Z 8 [Note] Access denied for user 'myuser'@'172.21.0.4' (using password: YES)
2023-01-25T14:53:48.932810Z 9 [Note] Access denied for user 'myuser'@'172.21.0.4' (using password: YES)
2023-01-25T14:54:49.415521Z 10 [Note] Access denied for user 'myuser'@'172.21.0.4' (using password: YES)
2023-01-25T14:55:49.928654Z 11 [Note] Access denied for user 'myuser'@'172.21.0.4' (using password: YES)

from the poenskelisten-phpmyadmin:

[Wed Jan 25 15:51:02.945669 2023] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.3. Set the 'ServerName' directive globally to suppress this message
[Wed Jan 25 15:51:04.944167 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/8.0.27 configured -- resuming normal operations
[Wed Jan 25 15:51:04.944429 2023] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

Thanks,

Can't claim items on public lists

It would be useful to have a setting in the config to allow items to be claimed in public lists, possibly with a large warning shown to any user that enables it for their list.

What are the reasons this was not initially allowed? I can see some security implications if a bad actor was able to guess the URL of a shared list.

From a useability standpoint maybe it would be more difficult to un-claim items if it was done by accident? I feel like this could either be accepted as a small flaw, or something could be done like Spliit where the user without an account can set who they are by name.

Shrink Docker Image

I stumbled across this and don't want to go to the trouble of forking, so here's how you can update your Dockerfile to massively shrink its size.

  • Separation of the building from the application means users are not downloading the Go modules and compiled files
  • Using the slim image for the runtime makes it, well, slimmer
FROM golang:1.20.4-bullseye as builder

ARG TARGETARCH
ARG TARGETOS

WORKDIR /app

COPY . .

RUN GO111MODULE=on CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build

FROM debian:bullseye-slim as runtime

LABEL org.opencontainers.image.source=https://github.com/aunefyren/poenskelisten

ENV port=8080
ENV timezone=Europe/Oslo
ENV dbip=localhost
ENV dbport=3306
ENV dbname=poenskelisten
ENV dbusername=root
ENV dbpassword=root
ENV generateinvite=false
ENV disablesmtp=false
ENV smtphost=smtp.gmail.com
ENV smtpport=25
ENV [email protected]
ENV smtppassword=password123

WORKDIR /app

COPY --from=builder /app/poenskelisten .

ENTRYPOINT /app/poenskelisten -port ${port} -timezone ${timezone} -generateinvite ${generateinvite}-dbip ${dbip}-dbport ${dbport} -dbname ${dbname} -dbusername ${dbusername} -dbpassword ${dbpassword} -disablesmtp ${disablesmtp} -smtphost ${smtphost} -smtpport ${smtpport} -smtpusername ${smtpusername} -smtppassword ${smtppassword}

If the .sql file is needed or some of the other folders, just copy those alone into the final layer.

No images on public wishlist

I can not seem to get images to show on publicly shared wishlists. I do not seem to have any errors. It shows fine when logged in.
Hope you can help.

Possibility to delete accounts

Hi,

as Tietel already described, it would be very useful to be able to delete inactive accounts as an admin or your own as a member in order to get a better overview of the database and the accounts in the admin panel. This would also include a possible view of the past days of the last activity.

Greetings Kochi1316

Privacy Question

Poenskelisten is awesome.
it solves a problem of mine.
I adjust my todos with my wishes.
Thanks for making and maintaining it.
just a small question, how will be a data that send to you as developer look like?
I want to see which sorts of data will be shared with you publicly :D
Thanks

Feature Request: Support for 3rd party login

I'm currently hosting this and using it with my friends/family. However it would be great if we could use our existing LDAP (Or whatever else people are self hosting, AD etc.) users to login with their existing accounts. For other sites I am hosting they either have built in LDAP support (which seems complex) or accept a a simple auth header like X-AUTH-USERNAME, and trust that the login page/reverse proxy sitting in front of the application correctly and legitimately fills this in.

Let me know if you need any other info!

Support more DB's

Its in the FAQ, but regardless; Maybe support sqlite &&/|| postgres?

Docker repository in private mode ?

Hello,

When I want to deploy the Docker image, I have this message :

aunefyren/poenskelisten:latest Unable to find image 'true:latest' locally docker: Error response from daemon: pull access denied for true, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

The repository seem to be in private mode.
Is it normal ?

Thank you.

ARM support

Hi,
I just saw the project. it seems very promising.
Thanks for adding value to the world with this piece of code.
Just a question, I may self host the project on Raspberry pi (ARMx64 chip).
I just need to use mariadb instead of mysql right?
I think rest will work!

Can't log in after new 1st user created

Hello and first of all Merry Christmas!

I am very happy about the publication of the wish list so that I can host it myself.
The installation was wonderfully easy using Docker compose.
I was able to create a new user with the invitecode without any problems, but I can no longer log in with the new user.

The log shows the following:
2023/12/25 07:38:09 Configuration file loaded.
2023/12/25 07:38:09 Flags parsed.
2023/12/25 08:38:09 Timezone set.
2023/12/25 08:38:09 Private key set.
2023/12/25 08:38:09 Connecting to database...
2023/12/25 08:38:09 Attempting to connect to mysql database.
2023/12/25 08:38:09 Database Migration Completed!
2023/12/25 08:38:09 Database connected.
2023/12/25 08:38:09 Generated new invite code. Code: SZH5O9S8DFTK0GCU
2023/12/25 08:38:09 Router initialized.
2023/12/25 08:42:07 Failed to get user by e-mail. Error: Failed to find correct user in DB.
2023/12/25 08:44:05 No other users found. New user is set to admin.
root@333486b98e4c:/app#

The SMTP function is deactivated because I don't have a mail server available at the moment.
I log in with my e-mail address and password and return to the login screen
How can i solve this problem?

Greetings

Front end sign in not using the new API endpoint

          > 

Based on your provided information, it seems your front end is not using the newest code. Could it be cached in the browser perhaps? You could try to delete cookies/browser history or do a force-refresh (CTRL + F5).

The /api/open/token/register endpoint is from a previous version.

Thanks for the response. It appears that my issue is unrelated to that of the original author, in that case - would you prefer if I open a new issue for it? Clearing cache etc. wasn't effective - I received the same error after completely removing the Docker image and pulling it again, and attempting to log in using a browser I've never previously used.

Originally posted by @hyperbrentilate in #17 (comment)

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.