Giter Site home page Giter Site logo

gh-polls's Introduction

No longer maintained

This software is no longer being maintainted and should not be chosen for new projects. See this issue for more information

Apex Serverless Architecture

Apex lets you build, deploy, and manage AWS Lambda functions with ease. With Apex you can use languages that are not natively supported by AWS Lambda through the use of a Node.js shim injected into the build. A variety of workflow related tooling is provided for testing functions, rolling back deploys, viewing metrics, tailing logs, hooking into the build system and more.

This project is designed for event-driven pipelines as it does not abstract away FaaS (functions as a service). If you are building web applications, APIs, or sites, consider using Apex Up, which provides a more out-of-the-box experience for these use-cases.

Installation

On macOS, Linux, or OpenBSD run the following:

curl https://raw.githubusercontent.com/apex/apex/master/install.sh | sh

Note that you may need to run the sudo version below, or alternatively chown /usr/local:

curl https://raw.githubusercontent.com/apex/apex/master/install.sh | sudo sh

On Windows download binary.

After downloading, rename binary file 'apex.exe', then add to PATH.

If already installed, upgrade with:

apex upgrade

Runtimes

Currently supports:

  • Node.js
  • Golang
  • Python
  • Ruby
  • Java
  • Rust
  • Clojure

Example projects for all supported runtimes can be found in _examples directory.

Features

  • Supports languages Lambda does not natively support via shim
  • Binary install (install apex quickly for continuous deployment in CI etc)
  • Hook support for running commands (transpile code, lint, dependency management, etc)
  • Batteries included but optional (opt-in to higher level abstractions)
  • Environment variable population via command-line, file, or inline config
  • Idempotent deployments (checksums skip already-deployed code)
  • Multiple environments via project.ENV.json and function.ENV.json files
  • Configuration inheritance and overrides
  • Command-line function invocation with JSON streams
  • Command & function name autocompletion
  • Function name globbing (ex: apex deploy api_*)
  • Transparently generates a zip for your deploy
  • Project bootstrapping with optional Terraform support
  • Function metrics and cost analysis
  • Ignore deploying files with .apexignore
  • Function rollback support
  • Tail function logs
  • Concurrency for quick deploys
  • Dry-run to preview changes
  • VPC support
  • Multiple region support
  • Lambda@Edge support

Sponsors

Does your company use Apex? Help keep the project bug-free and feature rich by sponsoring the project.

Backers

Love our work and community? Become a backer.

Example

Apex projects are made up of a project.json configuration file, and zero or more Lambda functions defined in the "functions" directory. Here's an example file structure:

project.json
functions
├── bar
│   ├── function.json
│   └── index.js
└── foo
    ├── function.json
    └── index.js

The project.json file defines project level configuration that applies to all functions, and defines dependencies. For this simple example the following will do:

{
  "name": "example",
  "description": "Example project"
}

Each function uses a function.json configuration file to define function-specific properties such as the runtime, amount of memory allocated, and timeout. This file is completely optional, as you can specify defaults in your project.json file. For example:

{
  "name": "bar",
  "description": "Node.js example function",
  "runtime": "nodejs4.3",
  "memory": 128,
  "timeout": 5,
  "role": "arn:aws:iam::293503197324:role/lambda"
}

Now the directory structure for your project would be:

project.json
functions
├── bar
│   └── index.js
└── foo
    └── index.js

Finally the source for the functions themselves look like this in Node.js:

console.log('start bar')
exports.handle = function(e, ctx) {
  ctx.succeed({ hello: e.name })
}

Apex operates at the project level, but many commands allow you to specify specific functions. For example you may deploy the entire project with a single command:

$ apex deploy

Or whitelist functions to deploy:

$ apex deploy foo bar

Invoke it!

$ echo '{ "name": "Tobi" }' | apex invoke bar
{ "hello": "Tobi" }

See the Documentation for more information.

Links


Build Status Slack Status GoDoc OpenCollective OpenCollective

gh-polls's People

Contributors

bukinoshita avatar evenchange4 avatar franciscop avatar matteofigus avatar tj 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gh-polls's Issues

POST to create a new poll fails with official domain

This issue is related to evenchange4/gh-polls-bot#11 .
Thanks for PR! I have tried new official API but it cannot work. 🙀

Success (Origin)

$ curl --request POST \
  --url https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll \
  --header 'content-type: application/json' \
  --data '{"options":["123"]}'

{
  "id": "01BY5HCZDXADRSJA593S2K8TQG"
}

Fail case

$ curl --request POST \
  --url https://api.gh-polls.com/poll \
  --header 'content-type: application/json' \
  --data '{"options":["123"]}'

Malformed request body.

It's possible to fool it with Tor

I think IP is not really enough when it is a few lines to use Tor to influence the results.

I just added 10 points in 1 minute to option C.

Not that I have a solution to it...

Add docker support

Hi,

Could you add a Dockerfile and docker-compose.yml file to this project ?

Thank you

Social cards

totally not going to bother with this :D but it would be kind of cool to link to a poll and have it show the results on Twitter etc since it only allows you 4 choices

Expired cert, and polls no longer working on Github issues

Hi there, thanks for gh-polls!

It looks like the gh-polls cert has expired a week or so ago and security warnings are shown to the user:

image

I'm not sure if this is a separate issue or not, but it also looks like the polls aren't currently showing up on Github. In the Chrome network tab I see 404 errors for the code snippet that was generated from gh-polls:


I've verified the error in different browsers and with different computers on different networks as well

I'm not sure if there's any other information I can add to the issue template, but let me know if I've missed anything @tj 🏆

Poll Expiration

I personally don't have a use case for this, but it might be nice to be able to set an expiration date/time for certain polls.

Clean things up

refactor a few things, move command stuff into a client pkg, maybe change it so options can be added dynamically via the url more easily instead of pre-filling 0's but I'm not too familiar with Dynamo's capabilities there.

UTF-8 support

I was able to create a poll with non-ASCII characters, but when trying to vote I get:

"Bad Request • Please try your request again or contact support."

It would be great if gh-polls could support UTF-8.

Thanks!

Errors you may encounter when upgrading the library github.com/oklog/ulid

(The purpose of this report is to alert apex/gh-polls to the possible problems when apex/gh-polls try to upgrade the following dependencies)

An error will happen when upgrading library oklog/ulid:

github.com/oklog/ulid

-Latest Version: v2.0.2 (Latest commit be3bccf on 9 May 2019)
-Where did you use it:
https://github.com/apex/gh-polls/search?q=github.com%2Foklog%2Fulid&unscoped_q=github.com%2Foklog%2Fulid
-Detail:

github.com/oklog/ulid/go.mod

module github.com/oklog/ulid/v2
require github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30

github.com/oklog/ulid/ulid_test.go

package ulid_test
import (
	"github.com/oklog/ulid/v2"
	…
)

This problem was introduced since oklog/ulid v2.0.2 . Now you used version v0.3.0. If you try to upgrade oklog/ulid to version v2.0.2 and above, you will get an error--- no package exists at "github.com/oklog/ulid/v2"

I investigated the libraries' (oklog/ulid >= v2.0.2) release information and found the root cause of this issue is that----

  1. These dependencies all added Go modules in the recent versions.

  2. They all comply with the specification of "Releasing Modules for v2 or higher" available in the Modules documentation. Quoting the specification:

A package that has migrated to Go Modules must include the major version in the import path to reference any v2+ modules. For example, Repo github.com/my/module migrated to Modules on version v3.x.y. Then this repo should declare its module path with MAJOR version suffix "/v3" (e.g., module github.com/my/module/v3), and its downstream project should use "github.com/my/module/v3/mypkg" to import this repo’s package.

  1. This "github.com/my/module/v3/mypkg" is not the physical path. So earlier versions of Go (including those that don't have minimal module awareness) plus all tooling (like dep, glide, govendor, etc) don't have minimal module awareness as of now and therefore don't handle import paths correctly See golang/dep#1962, golang/dep#2139.

Note: creating a new branch is not required. If instead you have been previously releasing on master and would prefer to tag v3.0.0 on master, that is a viable option. (However, be aware that introducing an incompatible API change in master can cause issues for non-modules users who issue a go get -u given the go tool is not aware of semver prior to Go 1.11 or when module mode is not enabled in Go 1.11+).
Pre-existing dependency management solutions such as dep currently can have problems consuming a v2+ module created in this way. See for example dep#1962.
https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher

Solution

1. Migrate to Go Modules.

Go Modules is the general trend of ecosystem, if you want a better upgrade package experience, migrating to Go Modules is a good choice.

Migrate to modules will be accompanied by the introduction of virtual paths(It was discussed above).

This "github.com/my/module/v3/mypkg" is not the physical path. So Go versions older than 1.9.7 and 1.10.3 plus all third-party dependency management tools (like dep, glide, govendor, etc) don't have minimal module awareness as of now and therefore don't handle import paths correctly.

Then the downstream projects might be negatively affected in their building if they are module-unaware (Go versions older than 1.9.7 and 1.10.3; Or use third-party dependency management tools, such as: Dep, glide, govendor…).

2. Maintaining v2+ libraries that use Go Modules in Vendor directories.

If apex/gh-polls want to keep using the dependency manage tools (like dep, glide, govendor, etc), and still want to upgrade the dependencies, can choose this fix strategy.
Manually download the dependencies into the vendor directory and do compatibility dispose(materialize the virtual path or delete the virtual part of the path). Avoid fetching the dependencies by virtual import paths. This may add some maintenance overhead compared to using modules.

As the import paths have different meanings between the projects adopting module repos and the non-module repos, materialize the virtual path is a better way to solve the issue, while ensuring compatibility with downstream module users. A textbook example provided by repo github.com/moby/moby is here:
https://github.com/moby/moby/blob/master/VENDORING.md
https://github.com/moby/moby/blob/master/vendor.conf
In the vendor directory, github.com/moby/moby adds the /vN subdirectory in the corresponding dependencies.
This will help more downstream module users to work well with your package.

3. Request upstream to do compatibility processing.

The oklog/ulid have 33 module-unaware users in github, such as: astromechza/gaze, stephane-martin/gotail, chambo-e/rigel…
https://github.com/search?q=oklog%2Fulid+filename%3Avendor.conf+filename%3Avendor.json+filename%3Aglide.toml+filename%3AGodep.toml+filename%3AGodep.json

Summary

You can make a choice when you meet this DM issues by balancing your own development schedules/mode against the affects on the downstream projects.

For this issue, Solution 1 can maximize your benefits and with minimal impacts to your downstream projects the ecosystem.

References

Do you plan to upgrade the libraries in near future?
Hope this issue report can help you ^_^
Thank you very much for your attention.

Best regards,
Kate

Restrict votes to GitHub users

Since the polls are meant for GitHub users, please add an option to restrict polls to GitHub users that are logged in. This in turn may solve the issue of disallowing multiple votes, if you maintain a list of GitHub users that have already voted.

Little react app

For building your pollssss. Maybe chuck it up on polls.apex.sh or something.

Persian/Arabic Support

Texts with langs like Persian and Arabic will be broken in SVG when we set letter-spacing. Current wrongly rendered content:

Correct:

image

I understand that this is an edge case and limited requirement. But maybe we can only do this when detecting such characters.

Redirect back

Something funky happening when redirecting back to referer, need to look into it, seems to rediect right back to /vote for whatever reason.

Polls is not found on system

After installing go and running go get github.com/tj/gh-polls/cmd/polls I received no errors and everything seemed fine. But running polls new something something something returns polls: command not found

Each user can vote on each option once

Contrary to what the readme says:

A single vote per IP is allowed for a given poll

It's actually one vote, per option, per poll. That is, a user can vote on each option in a poll once.

There is also an issue open to add that (already working) functionality: #9

I would expect polls to only allow one vote for the entire poll, and if multiple votes are allowed it should be opt in.

Slack support?

Yo!

Is it possible (or would it even make sense) to allow this to work in Slack channels?

I'm envisioning a pinned poll to gather input from team members.

Braces confuse web generator

I was trying to create poll using web interface and apparently brackets confuse something here. Test case, make the only option

None of the above (I'll comment why)

p1

and it rendered broken:

p2

Dont allow multiple votes

As is currently one person can vote perhaps endlessly for whatever options whatever amount of times skweing any results and rigging the poll results.

One example is Ive voted several times on any options on your readme poll and also found this issue while voting there.-> StylishThemes/GitHub-Dark#612

It makes no sense logically to allow the poll to be corrupted hat easily.

replace vote per IP with GitHub Reaction-based voting

An off-the-cuff idea.

Vote per IP is not reliable. Why not use GitHub reactions? It could work as follows (I haven't worked out all the kinks):

  1. Users creates an issue or new comment that will contain the poll, with temporary placeholder text.
  2. User copies the ID of the issue or comment (link behind the timestamp).
  3. User sets up a poll with options same as today, except up to two negative options can be specified with a prepended -. A -m option lets voters vote for more than one option. The issue/comment ID must also be passed in.
    $ polls new "apex/gh-polls/issues/32#issue-266896404" "Cats are cool" "Dogs are better" "Ferrets for the win" "-None of the above" "-This poll sucks"
    
  4. gh-polls assigns each option one of the GitHub reactions. The 👎 and 😕 are reserved for negative options.
  5. The user is provided with a single Markdown SVG image to paste into a comment. It contains an embedded server call. The server makes a callback to the GitHub API in realtime to count the reactions, and a graphic is returned (but with real bars of course):
    👍 Cats are cool       [========            ]
    😄 Dogs are better     [=======             ]
    ❤️ Ferrets for the win [=                   ]
    👎 None of the above   [=====               ]
    😕 This poll sucks     [=                   ]
    
    Enter a reaction to vote. Voters with more than one reaction will be ignored.
    
  6. Users vote simply by voting with a reaction.

The screen shown when clicking on voted option is cached by chrome and shown again on repeated click

Although I already voted, it still shows me "Thanks for voting!" screen.

Inspection of network requests shows that the page is being displayed straight from cache.

screen shot 2017-07-09 at 1 55 45 am

Possibly happens only in chrome, because chrome these days seems to aggresively cache all http2 cache.

(happens when clicking on the option I've chosen, as because for other options browser didn't have a chance of caching the response)

[enhancenment] Indicate current vote

Why not show a small badge below the voted option that already sent? People may forget what they already voted for or even they voted or not! Another bug: Voting same thing again not means Cheater :D (Also we may smoothly change voted option without any error)

JS implementation for Client

Hey! gh-polls is awesome 😍 However go implementation of Client makes install/usage harder for users. We may develop a js variant for client:

  • Easier setup and installation from npm
  • Can be integrated with CIs or Bots
  • Can also work in browser, we may develop Chrome extention opening Votes right from browser

@tj If i plan helping to develop such client, do you have any advices?

Issue with unencoded characters

Running polls new "HAHA % X" returns something as expected, except that the provided links give a 500 error (for both vote and image).

Here's an example of the mentioned command:

Notice that at the time of reporting, this shows a broken image.


It seems to be working just fine with spaces, though:

Ability to unvote

I voted on the wrong option by mistake, and it doesn't look like I can unvote.

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.