Giter Site home page Giter Site logo

meteorlxy / vssue Goto Github PK

View Code? Open in Web Editor NEW
760.0 10.0 103.0 8.33 MB

:mailbox: A Vue-powered Issue-based Comment Plugin

Home Page: https://vssue.js.org

License: MIT License

JavaScript 5.45% Vue 15.47% TypeScript 75.63% Stylus 3.46%
vue comment issue github gitlab bitbucket vuepress-plugin

vssue's Introduction

Vssue Logo

GitLab GitHub Bitbucket Gitee Gitea

Vssue

A Vue-powered Issue-based comment plugin

Documentation

📖 Live Demo and Docs here

Contributing

📜 Feel free to open issues following the issue templates if you have any problems or ideas.

❤️ Check the Developer Guide. Contributions welcome!

Contributors

💪 Thanks to all the developers who contribute to Vssue!

🖖 Thanks to @alolalo for inspiration of Logo design!

Sponsors & Backers

🙏 Thanks to all our sponsors and backers!

LICENSE

MIT © @meteorlxy & Contributors

vssue's People

Contributors

akanoa avatar eladcandroid avatar ilharp avatar meteorlxy avatar mrminfive avatar nupamore avatar ouvill avatar tgmti avatar yanhaijing avatar ycs77 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

vssue's Issues

[Question] If not "admin" or "owner" then cannot post comment

I use BitBucket with VSSUE.

I noticed something strange.

My settings (options):

owner: boss
repo: vssueboss
clientID: xxx

The only property I use is title, unique title ofcourse.

The BitBucket repo for VSSUE comments owned by admin/owner is public ofcourse.

  <script src="https://unpkg.com/vue/dist/vue.runtime.min.js"></script>
  <script src="https://unpkg.com/vssue/dist/vssue.bitbucket.min.js"></script>

OK, so I have many different pages (>200) with VSSUE.

If I (boss), as admin/owner logs in to make the first comment, then comments load (or "no comments yet, be the first to comment"), and I can write/post comment successfully.

If someone else (dummy), makes the first comment, then "failed to load comments", and dummy cannot post comment.

But dummy can post a second comment, AFTER boss, admin/owner, has posted the first comment. Then dummy is successful.

How to explain this behaviour and how to fix?

[Bug Report] Vuepress中使用控制台报错DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method.

在Vssue0.7.1之后,在我的vuepress主题使用,在文章页刷新或者第一次就访问的是文章页,控制台会报错,从而导致页面功能完全错乱。
DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method.
这似乎是一个ssr常见的错误,我在开发vuepress主题时经常遇到,我的经验是让报错的地方尽可能被预渲染到html中,在nuxt.js中也常有出现 issue,我测试到在0.7.1的版本不报错,之后的版本会出现这个问题。

这里有一个例子,部署在github page的是0.7.1版本,部署在gitee page下的是0.9.1版本,直接点击链接,或者点击进去后刷新一下,gitee的会在控制台报错,页面功能也会出现各种错乱,而github的则不会。

我的主题Vssue配置,正常使用的版本号"@vssue/api-github-v3": "0.7.3", "vssue": "0.7.1"

网址中的空格导致授权失败?

我在我的网站中测试过

失败授权跳转:https://gleehub.com/?error=redirect_uri_mismatch&error_description=The%20redirect_uri%20MUST%20match%20the%20registered%20callback%20URL%20for%20this%20application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=Vssue

我并不清楚实际引起这个错误的原因:https://gleehub.com/?error=redirect_uri_mismatch&error_description=The redirect_uri MUST match the registered callback URL for this application.&error_uri=https://developer.github.com/apps/managing-oauth-apps/troubleshooting-authorization-request-errors/#redirect-uri-mismatch&state=Vssue

我猜测这是空格或者中文或者其它字符引起的

这是我使用的版本

  • "@vssue/api-github-v3": "^1.0.3"
  • "@vssue/vuepress-plugin-vssue": "^1.0.3"

vuepress 中的使用:

<ClientOnly>
    <Vssue :title="$page.title" />
</ClientOnly>

issue 重复创建

2019-02-18_060457
2019-02-18_060538

地址

好像是页面刷新一次就创建一次,我正在开发vuepress的主题
2019-02-18_061655
2019-02-18_061732

究竟是什么问题?

自动跳到github登录页

网页会突然跳到github登录页,后退又跳击登录,这一点不是很友好,能不能点击才跳转?

Request header field accept is not allowed by Access-Control-Allow-Headers in preflight response.[Question]

Environment

  • Vssue Version: [ v1.2.1]
  • Platform: [GitHub]
  • OS: [Windows 10]
  • Browser: [ chrome 74]

What's your question?

what should I do for this

Access to XMLHttpRequest at 'https://api.github.com/repos/chenweigao/vueblog/issues/14/comments?page=1&per_page=10&timestamp=1574152218174' from origin 'https://www.weigao.cc' has been blocked by CORS policy: Request header field accept is not allowed by Access-Control-Allow-Headers in preflight response.

CORS problem?

this is my site: https://weigao.cc

thank you very much~!

[Feature Request] 一键手动创建 issue.

能否像 gitalk 那样,当我把 autoCreateIssue 设置为 false 的时候,出现的不是加载错误,而是创建 issue 的按钮

这样,是由于,不希望它自动创建一些重复/奇怪的issue,但又不想每次都到 github 中手动创建.

(目前只是在本地测试使用,如果非本地的情况下有了的话就算了...

Add support for enterprise platform like GitHub Enterprise

Hello,

I think it will be a great feature if we can use Vssue in our entreprise Platforms.

Look at your GitHub API for example, in it's constructor, the API endpoint is hardcoded (https://github.com/meteorlxy/vssue/blob/master/packages/%40vssue/api-github-v3/src/index.ts#L39).
A oiding this and just using public GitHub API as default one will let's some users as me to integrate Vssue with other GitHub server deployment like it's the case for GitHub Enterprise.

If you want, I can make a pull request for these feature.

在使用过程中出现两个疑问

我是使用gitee作为测试的,在使用过程中出现两个疑问:

  1. gitee第三方应用的回调地址,是不接受通配符的,那么博客的评论页该怎么设置回调地址?
  2. 授权成功后回调带有code,在跳转页面后,url上的code是有可能消失的,这时vssue有把code保存下来吗?我使用的时候,在跳转页面后需要重新登录授权

Add support for Gitea

Gitea is an alternative to GitLab that's lightweight enough to be run on something like a Raspberry Pi. The API should have everything required to add support for it to Vssue.

This would allow anyone to self-host their comments with way lower resource requirements, or use a non-profit hosting service like codeberg.org.

i18n: pt-BR support

Hello,

following this, in lunch I Started add pt-BR support.

basicaly it´s only this?
master...tgmti:ptBRSupport

If it´s ok, next i´ll start the docs change.

what you think is better? push all on finish, or create two sepparate PR´s?

[Bug Report] Vssue breaks when there are too many issues for Vssue

post 页面指定 vssue-id => 不自动重复创建
post 页面使用 vssue-title => 重复创建
post 页面未指定 vssue 选项 => 重复创建

版本

  "dependencies": {
    "vuepress": "^1.0.0-alpha.44",
    "vuepress-theme-meteorlxy": "^1.0.0-alpha.31"
  }

可能还是这个问题还是版本太旧? #12

Newbie: Use npm vssue with HEXO blog

Sorry for newbie question.

I have HEXO blog... https://hexo.io/

I installed npm i vssue --save in my hexo node_modules.

I installed npm install @vssue/api-bitbucket-v2 in my hexo node_modules.

In my article.ejs I added:

<template>
  <Vssue
    :title="title"
    :options="options"
  />
</template>

 <script>
import { VssueComponent } from 'vssue'
import BitbucketV2 from '@vssue/api-bitbucket-v2'
import 'vssue/dist/vssue.css'

export default {
  name: 'VssueDemo',

  components: {
    'Vssue': VssueComponent,
  },

  data () {
    return {
      title: '<%= config.vssue.title %>',
      options: {
        api: BitbucketV2,
        owner: '<%= config.vssue.owner %>',
        repo: '<%= config.vssue.repo %>',
        clientId: '<%= config.vssue.clientId %>',
        clientSecret: '<%= config.vssue.clientSecret %>',
      },
    }
  },
}
</script>

But not working. How to solve?
I do not see vssue comment box, nothing, all empty.

[Bug Report] when issue not create, user input a message and submit

Describe the bug

A clear and concise description of what the bug is.

Steps To Reproduce

when issue not create, user input a message and submit
message will get clear, and no any error notice tell user,
message can't submit because issue not create and he not a one of admins

  1. go a page with vssue and issue not create
  2. auth by a not admins
  3. type message and submit
  4. message textarea got clear and no any error notice

Screenshots

If applicable, add screenshots to help explain your problem.

Expected behavior

A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • Vssue Version: [e.g. v0.8.2]
  • Platform: [e.g. GitHub, GitLab, Bitbucket, GitLab CE 11.7.0]
  • OS: [e.g. Windows 10, iOS, Android]
  • Browser: [e.g. chrome 74]

Additional context

Add any other context about the problem here.

[Bug Report] 一些小问题

Describe the bug

1. 在我的Jekyll博客网站里,输入一个内容并发送,会发送两个。修改.2019.9.30

  1. 我使用的是Vue完整,然后我不能使用对应完整版的script,只能用这里提供的script,是文档的问题还是我弄错了?

Steps To Reproduce

1. 在我的博客里打开一篇文章
2. 看页尾,输入评论并发表
3. 发送两个
修改.2019.9.30

  1. 我在vssue.html编辑了对应的完整版使用的script,发现不能用,现在正使用这个网页提供的script

Screenshots

文章
IMG_20190626_222121

Environment (please complete the following information):

  • Vssue Version: [Unpkg / Latest]
  • Platform: [GitHub]
  • OS: [Android]
  • Browser: [chrome]

Vssue "browser" version automatically tries to log in to GitHub

Describe the bug

The "in-browser" Getting Started section here: https://vssue.js.org/guide/getting-started.html#in-browser

I've chosen:

  • vue (runtime only)
  • Vssue Github build
  • uses <script> render function for vue runtime build

Expected behavior

I would expect the client would have to log into github only when they want to, not automatically.

Environment (please complete the following information):

  • Vssue Version: Latest as of April 25, 2019
  • Platform: GitHub
  • OS: Mac os X 10.13.6
  • Browser: Safari 12.1, Firefox 66.0.3 (chrome's github login is super-sticky, can't seem to fully log out to test there)

Additional context

I have left this running at http://level3.rest

[Question] VSSUE immediately triggers Gitlab login for page view

I use VSSUE and Gitlab.

  <script src="https://unpkg.com/vue/dist/vue.runtime.min.js"></script>
  <script src="https://unpkg.com/vssue/dist/vssue.gitlab.min.js"></script>

I copy/pasted each URL of my site in Gitlab URL redirect.

When I visit any page on my site, immediately the Gitlab login window shows upon URL load.
How to make Gitlab login screen appear only when user clicks the "post a comment box"?

Request minimal github access

What problem does the feature solve?

When a user "Logs in to Github" to set a comment, they are presented with a scary access request that wants all of their data, including access to all their organizations. This is unnecessary and excessive.

Proposed solution

Is there a subset of information that can be asked for? My readers are complaining that they don't want to give me so much access just to leave a comment.

Alternative solutions

Here is the list of github scopes: https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes

Additional context

image

一个关于在 vuepress 中使用的问题

按照文档使用方法安装,评论无法加载,控制台报错如下:

vue.runtime.esm.js?2b0e:619 [Vue warn]: Unknown custom element: <Vssue> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <VE179ddd6> at docs/README.md
       <Content>
         <Home> at node_modules/@vuepress/theme-default/components/Home.vue
           <Layout> at node_modules/@vuepress/theme-default/layouts/Layout.vue
             <GlobalLayout> at node_modules/@vuepress/core/lib/client/components/GlobalLayout.vue
               <Root>

是否是我使用的方法错误?以下是我的安装过程与环境:

// 安装依赖
$ yarn add -D vssue
$ yarn add -D @vssue/vuepress-plugin-vssue
$ yarn add -D @vssue/api-github-v3

// package.json
"devDependencies": {
  "@vssue/api-github-v3": "^0.10.0",
  "@vssue/vuepress-plugin-vssue": "^0.10.0",
  "vssue": "^0.10.0",
  "vuepress": "^1.0.0-alpha.48"
}

// config.js
plugins: [
    {
        "@vssue/vuepress-plugin-vssue": {
            platform: 'github',
            owner: 'cnguu',
            repo: 'blog-vssue',
            clientId: 'sorry',
            lientSecret: 'sorry',
        }
    }
]

// README.md
<Vssue title="Vssue Demo" />

[Question] 最近又出现了issue重复创建

我的是静态博客,之前搭建的时候也有这个问题,后来配置了一下,就好了,但是最近的又出现了这个问题。不知道为什么,大概是半个月前出现这个问题的,可以看到半个月之前的没有这个问题。

以下是我的vssue配置源码

<div id="vssue"></div>
<!-- 或: Vue 完整版 (runtime + compiler) -->
<script src="https://unpkg.com/vue/dist/vue.min.js"></script>
<!-- Vssue Github 版  -->
<script src="https://unpkg.com/vssue/dist/vssue.github.min.js"></script>
<!-- 或:对于 Vue 完整版,可以使用模板(template) -->
<script>
new Vue({
  el: '#vssue',

  data: {
    title: function(){ return document.getElementsByClassName("title")[0].innerText},
    labels: [location.pathname],
    options: {
      owner: 'suveng',
      repo: 'blog',
      clientId: '***',
      clientSecret: '***',
    },
  },

  template: `<vssue :title="title" :options="options"></vssue>`,
})
</script>

Something about the clientSecret of GitHub

What is the issue?

Currently, if we are using GitHub, we have to hard-code clientSecret in our js/html files, which has potential risks.

There are already some discussions about that:

In brief, hard-coding clientSecret will cause some security concerns.

Does it really matter?

Yes but no.

Impersonate you website?

Attackers may copy your clientId and clientSecret, but the platform will check the redirect_uri as well.

That means that, attackers can't mislead users to their fake sites with your clientId (unless something like DNS hijacking, which might be another story), so they can't get user's code on their sites with your clientSecret.

In addition, it's more convenient for "attackers" to create a new OAuth App than copy yours, and the target of the "attackers" is the platform but not your website.

From another perspective, your website is "static" and have nothing worth to be attacked...

So you don't need to worry about that.

Impersonate you OAuth App?

Github: OAuth Authorizations API - for example, if attackers get your client secret, they can revoke a grant of an user, so the user have to authorize your app again when he try to login on your website next time. It's possible if someone is aiming at your website, but it might not be so critical.

In brief, it does have security concerns, but not critical. This is why gitment and gitalk didn't fix that.

Plans of enhancement

But it's still an issue.

Currently:

  • clientSecret is only used for getting access_token
  • The API endpoint for getting access_token does not support CORS, so we have to use proxy for now

To completely solve this issue, you can use a private proxy to get access_token, and store your clientSecret in the proxy, rather than in your client code.

An existing project is https://github.com/prose/gatekeeper, which can be deployed on Heroku/Azure by yourself easily. But it's not compatible with our current proxy option

So Vssue is planning to:

[Feature Request] allow notice message from api

What problem does the feature solve?

allow notice message from api

for example, if api request fail, and we can return message form api class to vssue, then vssue can notice user

async postComment({
		accessToken,
		issueId,
		content,
	}: {
		accessToken: VssueAPI.AccessToken
		issueId: string | number
		content: string
	}): Promise<VssueAPI.Comment>
	{
		const { data } = await this.$http.post(`repos/${this.owner}/${this.repo}/issues/${issueId}/comments`, {
			body: content,
		}, {
			//...
		})
.catch(e => {

				if (e && e.response && e.response.data)
				{
					setTimeout(() => {
						window.alert(e.response.data.message);
					}, 100);
				}

				return Promise.reject(e)
			})

Proposed solution

Describe what you want to happen, and the solution you'd like.

async postComment({
		accessToken,
		issueId,
		content,
	}: {
		accessToken: VssueAPI.AccessToken
		issueId: string | number
		content: string
	}): Promise<VssueAPI.Comment>
	{
		const { data } = await this.$http.post(`repos/${this.owner}/${this.repo}/issues/${issueId}/comments`, {
			body: content,
		}, {
			//...
		})
.catch(e => {

				if (e && e.response && e.response.data)
				{
					// by api choose, if didn't set vssueNotice , then like current vssue do
					e.vssueNotice = e.response.data.message
				}

				return Promise.reject(e)
			})

then

if vssue see api is fail and has vssueNotice, will show this message to user

Alternative solutions

Any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

New logo for VsSue

Hi peoples!

My name is Guus, and I created a fancy logo for vssue! 🖖

I like to keep things simple; the logo is created out of one shape, five colors, and fully vector for any post-processing in code.

Full HD


Feel free to comment! It's a work in progress 👍🏻

todo

  • create clean svg export
  • create svg animation
  • create READ.me explaining process
  • create pull request (need help there!)

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.