Skip to content
Snippets Groups Projects
Commit 9820a691 authored by syuilo's avatar syuilo
Browse files

well done

parent 7203c176
No related branches found
No related tags found
No related merge requests found
......@@ -31,8 +31,7 @@ and more! You can touch with your own eyes at https://misskey.xyz/.
2. `git clone git://github.com/syuilo/misskey.git`
3. `cd misskey`
4. `npm install`
5. `npm run config`
6. `npm run build`
5. `npm run build`
GLHF!
......@@ -92,6 +91,7 @@ If you want to run misskey in production mode, add `--env NODE_ENV=production` l
Note that `$(pwd)` is the working directory.
## Launch
(初回起動時はまず `npm run config` してください)
`sudo npm start`
## Debugging :bug:
......
......@@ -17,11 +17,13 @@ require('./common/tags');
"use strict";
const CONFIG = require('./common/scripts/config');
document.domain = CONFIG.host;
// Set global configration
riot.mixin({
CONFIG: CONFIG
CONFIG
});
// ↓ iOS待ちPolyfill (SEE: http://caniuse.com/#feat=fetch)
......
......@@ -2,6 +2,8 @@
* API Request
*/
const CONFIG = require('./config');
let spinner = null;
let pending = 0;
......
const url = new URL(location.href);
const isRoot = url.host.split('.')[0] == 'misskey';
const host = isRoot ? url.host : url.host.substring(url.host.indexOf('.') + 1, url.host.length);
const scheme = url.protocol;
const apiUrl = `${scheme}//api.${host}`;
const devUrl = `${scheme}//dev.${host}`;
const aboutUrl = `${scheme}//about.${host}`;
module.exports = {
host,
scheme,
apiUrl,
devUrl,
aboutUrl,
themeColor: '#f76d6c'
};
const ReconnectingWebSocket = require('reconnecting-websocket');
const riot = require('riot');
const CONFIG = require('./config');
class Connection {
constructor(me, otherparty) {
......
const CONFIG = require('./config');
module.exports = () => {
localStorage.removeItem('me');
document.cookie = `i=; domain=.${CONFIG.host}; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
......
const ReconnectingWebSocket = require('reconnecting-websocket');
const riot = require('riot');
const CONFIG = require('./config');
module.exports = me => {
let state = 'initializing';
......
const riot = require('riot');
const nyaize = require('nyaize').default;
const CONFIG = require('./config');
const escape = function(text) {
return text
......
......@@ -30,7 +30,7 @@
</label>
<label class="recaptcha">
<p class="caption"><i class="fa fa-toggle-on" if={ recaptchaed }></i><i class="fa fa-toggle-off" if={ !recaptchaed }></i>認証</p>
<div class="g-recaptcha" data-callback="onRecaptchaed" data-expired-callback="onRecaptchaExpired" data-sitekey={ CONFIG.recaptcha.siteKey }></div>
<div if={ recaptcha } class="g-recaptcha" data-callback="onRecaptchaed" data-expired-callback="onRecaptchaExpired" data-sitekey={ recaptcha.siteKey }></div>
</label>
<label class="agree-tou">
<input name="agree-tou" type="checkbox" autocomplete="off" required="required"/>
......@@ -193,10 +193,20 @@
};
this.on('mount', () => {
const head = document.getElementsByTagName('head')[0];
const script = document.createElement('script');
script.setAttribute('src', 'https://www.google.com/recaptcha/api.js');
head.appendChild(script);
fetch('/config.json').then(res => {
res.json().then(conf => {
this.update({
recaptcha: {
siteKey: conf.recaptcha.siteKey
}
});
const head = document.getElementsByTagName('head')[0];
const script = document.createElement('script');
script.setAttribute('src', 'https://www.google.com/recaptcha/api.js');
head.appendChild(script);
});
});
});
this.onChangeUsername = () => {
......
const riot = require('riot');
const CONFIG = require('../../common/scripts/config');
const dialog = require('./dialog');
const api = require('../../common/scripts/api');
......
const riot = require('riot');
const CONFIG = require('../../common/scripts/config');
const dialog = require('./dialog');
const api = require('../../common/scripts/api');
......
......@@ -51,6 +51,17 @@ app.get(/\/api:meta/, require('./meta'));
app.get(/\/api:url/, require('./service/url-preview'));
app.post(/\/api:rss/, require('./service/rss-proxy'));
/**
* Serve config
*/
app.get('/config.json', (req, res) => {
res.send({
recaptcha: {
siteKey: config.recaptcha.siteKey
}
});
});
/**
* Subdomain
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment