...
 
Commits (20)
......@@ -13,15 +13,57 @@ For more information, please see the [Indienet project planning documentation at
1. `npm install`
2. `npm run dev`
To specify a port (e.g., two run two separate instances when testing federation), use:
By default, your local instance will run on localhost port 5000.
To specify a different port (e.g., to run two separate instances when testing federation), use:
`npm run dev -- --port 7999`
## Production
Not ready for production use.
Not ready for production use. See deployment and deployment server setup instructions, below, for testing deployment during development.
## Deployment server setup
For testing deployment, we currently use [Dokku](http://dokku.viewdocs.io/dokku/) on an OpenStack-based VPS at [CloudScale](https://cloudscale.ch) running Ubuntu 16.04. This will remain the supported method for people with technical knowledge to install Indie Site.
1. Install [Dokku](http://dokku.viewdocs.io/dokku/) on your own server running Ubuntu 16.04 and set up your DNS with A (and AAAA for IPv6) records pointing to your domain for _your.domain_ and _www.your.domain_.
2. Create the app on your server (at the domain root):
```bash
dokku apps:create your.domain
```
3. Set up persistent storage:
```bash
sudo mkdir -p /var/lib/dokku/data/storage/indie
sudo chown 32767:32767 /var/lib/dokku/data/storage/indie
dokku storage:mount /var/lib/dokku/data/storage/indie:/app/.indie
```
This will set up a folder to mirror the `/app/.indie` directory that Indie Site expects for storing persistent files in and looks for via `path.join(os.homedir(), '.indie')`.
3. Clone this repository and set up a deployment Git remote endpoint on _your local working copy_:
```bash
git remote add deploy dokku@your.domain:your.domain
```
4. Push to deploy:
```bash
git push deploy master
```
5. Set up TLS via the [Dokku Let’s Encrypt plugin](https://github.com/dokku/dokku-letsencrypt):
```bash
sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
dokku config:set --no-restart your.domain DOKKU_LETSENCRYPT_EMAIL=your@email.tld
dokku letsencrypt your.domain
```
(In production, the port is set either via the PORT environment variable or will fall back to the value in the _config/production.json_ from the Feathers configuration.)
That’s it! You should be up and running with your own instance of Indie Site.
## Configuration
......
......@@ -3,7 +3,7 @@
"name": "Aral Balkan",
"bio": "Cyborg Rights Activist",
"profileImage": "/profile-image.jpg",
"backgroundImage": false,
"backgroundImage": "/laurakalbag_2018-Mar-30.jpg",
"backgroundColour": "#0062B1",
"privateKey": "encrypted private key",
"publicKey": "public key",
......
......@@ -144,6 +144,7 @@ export default {
align-items: center;
color: white;
background-size: cover;
background-position: 50% 50%;
/* Position relatively so contained items align to this container. */
position: relative;
......@@ -173,6 +174,8 @@ export default {
/* Same max-width as on main in default.vue. */
max-width: 45rem;
/* so text doesn’t bump against edges of viewport */
padding: 0 0.5rem;
}
.profile-bio {
......@@ -182,9 +185,13 @@ export default {
/* Same max-width as on main in default.vue. */
max-width: 45rem;
/* so text doesn’t bump against edges of viewport */
padding: 0 0.5rem;
}
.profile-image {
background-size: cover;
box-sizing: content-box;
/* Make image circular with a white border. */
border: 0.175rem solid white;
border-radius: 50%;
......
......@@ -47,13 +47,45 @@ export default {
</script>
<style>
@font-face {
font-family: 'Lato';
src: url('~/assets/fonts/Lato-Bold.eot'); /* IE9 Compat Modes */
src: url('~/assets/fonts/Lato-Bold.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('~/assets/fonts/Lato-Bold.woff2') format('woff2'), /* Modern Browsers */
url('~/assets/fonts/Lato-Bold.woff') format('woff'), /* Modern Browsers */
url('~/assets/fonts/Lato-Bold.ttf') format('truetype');
font-style: normal;
font-weight: bold;
text-rendering: optimizeLegibility;
}
@font-face {
font-family: 'Lato';
src: url('~/assets/fonts/Lato-Regular.eot'); /* IE9 Compat Modes */
src: url('~/assets/fonts/Lato-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('~/assets/fonts/Lato-Regular.woff2') format('woff2'), /* Modern Browsers */
url('~/assets/fonts/Lato-Regular.woff') format('woff'), /* Modern Browsers */
url('~/assets/fonts/Lato-Regular.ttf') format('truetype');
font-style: normal;
font-weight: normal;
text-rendering: optimizeLegibility;
}
html, body {
min-width: 18rem;
}
html {
font-size: 1rem;
/* Remove font smoothing. */
-moz-osx-font-smoothing: auto;
-webkit-font-smoothing: auto;
}
body {
font-family: 'Lato', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
line-height: 1.5rem;
line-height: 1.2rem;
/* Remove browsers’ default padding on body. */
margin: 0;
......
......@@ -21,8 +21,6 @@
<script>
import 'font-awesome/css/font-awesome.min.css'
import indieHeader from '~/components/indieHeader'
import contentTypeFilter from '~/components/contentTypeFilter'
import textComposer from '~/components/textComposer'
......@@ -57,14 +55,14 @@ export default {
// Mock posts
posts: [
{
id: 1,
content: "<h2>Later post</h2><p>So is this!</p>"
},
{
id: 0,
content: "<h2>Earliest post</h2><p>This is a great post.</p>"
}
// {
// id: 1,
// content: "<h2>Later post</h2><p>So is this!</p>"
// },
// {
// id: 0,
// content: "<h2>Earliest post</h2><p>This is a great post.</p>"
// }
]
}
},
......
import Vue from 'vue'
import Buefy from 'buefy'
import 'buefy/lib/buefy.css'
import 'font-awesome/css/font-awesome.min.css'
Vue.use(Buefy, {
defaultIconPack: 'fa'
})
Vue.use(Buefy)
<?xml version="1.0" encoding="UTF-8"?>
<svg width="640px" height="640px" viewBox="0 0 640 640" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="background: #009DE0;">
<!-- Generator: Sketch 49.1 (51147) - http://www.bohemiancoding.com/sketch -->
<title>hallo.gent-square</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="hallo.gent-square" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="hallo.gent-logo,-outlines" transform="translate(69.000000, 199.000000)" fill="#FFFFFF">
<path d="M154.2832,261.561067 C159.061867,261.561067 162.645867,265.264533 162.645867,269.804267 C162.645867,274.463467 159.061867,278.166933 154.2832,278.166933 C149.624,278.166933 146.04,274.463467 146.04,269.804267 C146.04,265.264533 149.624,261.561067 154.2832,261.561067 Z M226.441067,206.725867 L229.666667,216.6416 C224.410133,218.314133 218.4368,218.553067 211.2688,218.553067 C218.675733,221.898133 222.3792,227.154667 222.3792,234.442133 C222.3792,246.866667 213.4192,255.826667 198.3664,255.826667 C195.4992,255.826667 192.9904,255.468267 190.362133,254.632 C188.570133,255.946133 187.256,258.216 187.256,260.485867 C187.256,263.353067 189.048,265.622933 195.4992,265.622933 L205.5344,265.622933 C218.4368,265.622933 227.0384,273.029867 227.0384,283.065067 C227.0384,295.250667 217.0032,302.179733 197.530133,302.179733 C176.981867,302.179733 170.530667,295.848 170.530667,283.065067 L180.4464,283.065067 C180.4464,290.233067 183.672,293.578133 197.530133,293.578133 C211.149333,293.578133 215.928,290.1136 215.928,283.781867 C215.928,277.808533 211.149333,274.821867 203.264533,274.821867 L193.3488,274.821867 C182.118933,274.821867 177.101333,269.206933 177.101333,262.8752 C177.101333,258.813333 179.490667,254.751467 184.0304,251.7648 C176.742933,247.941867 173.397867,242.4464 173.397867,234.322667 C173.397867,221.420267 183.791467,212.3408 197.6496,212.3408 C213.299733,212.6992 219.034133,210.070933 226.441067,206.725867 Z M197.6496,220.2256 C189.167467,220.2256 184.627733,226.079467 184.627733,234.322667 C184.627733,242.685333 189.286933,248.5392 197.888533,248.5392 C206.490133,248.5392 211.149333,243.282667 211.149333,234.2032 C211.149333,225.004267 206.6096,220.2256 197.6496,220.2256 Z M286.652267,243.402133 C286.652267,245.552533 286.5328,247.583467 286.413333,249.017067 L246.272533,249.017067 C247.347733,263.592 254.157333,269.206933 263.2368,269.206933 C269.449067,269.206933 274.108267,267.5344 279.603733,263.711467 L284.3824,270.282133 C278.170133,275.180267 271.1216,278.166933 262.400533,278.166933 C244.838933,278.166933 234.5648,265.861867 234.5648,245.910933 C234.5648,226.3184 244.480533,212.3408 260.728,212.3408 C277.692267,212.3408 286.652267,224.168 286.652267,243.402133 Z M275.7808,240.893333 L275.7808,240.176533 C275.7808,227.871467 270.882667,221.061867 260.966933,221.061867 C252.604267,221.061867 247.1088,226.915733 246.272533,240.893333 L275.7808,240.893333 Z M333.8416,212.3408 C345.429867,212.3408 352.12,219.628267 352.12,231.574933 L352.12,276.733333 L341.129067,276.733333 L341.129067,233.128 C341.129067,223.690133 337.306133,220.9424 331.213333,220.9424 C324.1648,220.9424 319.386133,225.362667 315.2048,232.0528 L315.2048,276.733333 L304.213867,276.733333 L304.213867,213.7744 L313.651733,213.7744 L314.607467,223.0928 C318.908267,216.6416 325.5984,212.3408 333.8416,212.3408 Z M401.818133,266.578667 L405.999467,273.866133 C401.818133,276.733333 397.2784,278.166933 391.9024,278.166933 C381.269867,278.166933 374.938133,271.954667 374.938133,260.246933 L374.938133,222.256533 L363.9472,222.256533 L363.9472,213.7744 L374.938133,213.7744 L374.938133,199.557867 L385.929067,198.243733 L385.929067,213.7744 L400.8624,213.7744 L399.667733,222.256533 L385.929067,222.256533 L385.929067,259.769067 C385.929067,266.1008 387.96,269.087467 393.455467,269.087467 C396.2032,269.087467 398.712,268.2512 401.818133,266.578667 Z" id=".gent"></path>
<path d="M70.2213333,50.472 C91.8106667,50.472 104.952,64.552 104.952,88.0186667 L104.952,178.6 L71.6293333,178.6 L71.6293333,93.6506667 C71.6293333,79.336 66.232,75.3466667 58.0186667,75.3466667 C48.632,75.3466667 40.888,81.6826667 34.0826667,92.4773333 L34.0826667,178.6 L0.76,178.6 L0.76,4.712 L34.0826667,1.192 L34.0826667,68.3066667 C43.9386667,56.808 55.2026667,50.472 70.2213333,50.472 Z M231.672,144.104 C231.672,154.194667 234.722667,157.714667 240.824,159.826667 L233.784,181.885333 C219.704,180.712 210.317333,176.018667 205.154667,163.581333 C196.237333,177.192 182.626667,182.354667 167.842667,182.354667 C142.968,182.354667 127.48,166.397333 127.48,143.869333 C127.48,116.648 147.896,101.864 184.738667,101.864 L199.053333,101.864 L199.053333,95.7626667 C199.053333,80.2746667 192.482667,75.3466667 176.76,75.3466667 C168.546667,75.3466667 156.578667,77.6933333 143.906667,81.9173333 L136.397333,59.624 C151.885333,53.5226667 168.312,50.472 182.392,50.472 C216.888,50.472 231.672,65.7253333 231.672,93.8853333 L231.672,144.104 Z M176.994667,158.418667 C186.616,158.418667 193.890667,153.490667 199.053333,144.573333 L199.053333,120.872 L188.024,120.872 C169.954667,120.872 161.037333,127.442667 161.037333,141.053333 C161.037333,152.082667 166.669333,158.418667 176.994667,158.418667 Z M293.624,182.354667 C273.442667,182.354667 261.474667,170.152 261.474667,148.562667 L261.474667,4.712 L294.797333,0.957333333 L294.797333,147.624 C294.797333,153.021333 296.909333,155.837333 301.602667,155.837333 C304.184,155.837333 306.296,155.368 308.173333,154.429333 L314.978667,178.130667 C309.581333,180.477333 302.072,182.354667 293.624,182.354667 Z M363.085333,182.354667 C342.904,182.354667 330.936,170.152 330.936,148.562667 L330.936,4.712 L364.258667,0.957333333 L364.258667,147.624 C364.258667,153.021333 366.370667,155.837333 371.064,155.837333 C373.645333,155.837333 375.757333,155.368 377.634667,154.429333 L384.44,178.130667 C379.042667,180.477333 371.533333,182.354667 363.085333,182.354667 Z M452.728,50.472 C489.805333,50.472 512.098667,75.112 512.098667,116.413333 C512.098667,155.837333 489.805333,182.354667 452.493333,182.354667 C415.416,182.354667 392.888,157.714667 392.888,116.413333 C392.888,76.7546667 415.181333,50.472 452.728,50.472 Z M452.728,75.3466667 C436.066667,75.3466667 427.618667,88.0186667 427.618667,116.413333 C427.618667,145.042667 436.066667,157.48 452.493333,157.48 C468.92,157.48 477.368,144.808 477.368,116.413333 C477.368,87.784 468.92,75.3466667 452.728,75.3466667 Z" id="hallo"></path>
<path d="M389.042801,203.536078 C393.513339,200.89921 394.86597,200.024495 395.101279,199.892574 C398.451039,198.014618 401.550705,195.611474 404.285162,192.733226 C411.561422,185.074344 415.656334,174.681222 415.452126,163.832393 C415.465023,174.676923 419.557785,185.070045 426.836195,192.728927 C429.602426,195.64062 432.742403,198.066413 436.136832,199.954102 C436.358203,200.077209 438.550028,201.438881 439.352583,201.974913 C440.155138,202.510945 384.572263,206.172947 389.042801,203.536078 Z" id="Stad-Gent-“Accolade”;-speech-bubble-pointer-Copy" transform="translate(414.074020, 184.156735) rotate(-146.000000) translate(-414.074020, -184.156735) "></path>
</g>
</g>
</svg>
\ No newline at end of file
......@@ -28,7 +28,7 @@ if (process.browser) {
_app.configure(primus(clientSideWebSocketViaPrimus))
} else {
// Configure for server-side use.
const serverSideRestViaAxios = rest('http://localhost:3030').axios(axios)
const serverSideRestViaAxios = rest('http://0.0.0.0:5000').axios(axios)
_app.configure(serverSideRestViaAxios)
}
export const app = _app
......
This diff is collapsed.
......@@ -64,7 +64,6 @@
},
"devDependencies": {
"eslint": "^4.18.2",
"font-awesome": "^4.7.0",
"log-suppress": "^1.0.3",
"mocha": "^4.0.1",
"nodemon": "^1.17.1",
......
{
"host": "localhost",
"host": "0.0.0.0",
"instance-configuration-directory": "instance-configuration",
"port": 3030,
"port": 5000,
"public": "../public/",
"paginate": {
"default": 10,
......
{
"host": "indiepub-app.feathersjs.com",
"port": "PORT"
"host": "available.gent",
"port": "80"
}
......@@ -56,14 +56,27 @@ function setOwnerKeys (app, ownerKeys = null) {
}
function globals (app) {
console.log('PATHS')
console.log(`os.homedir(): ${os.homedir()}`)
const dataDirectoryPath = path.join(os.homedir(), '.indie', 'site')
console.log(`dataDirectoryPath: ${dataDirectoryPath}`)
const serverSecretFilePath = path.join(dataDirectoryPath, 'server-secret.json')
const ownerKeysFilePath = path.join(dataDirectoryPath, 'owner-keys.json')
const ownerSettingsFilePath = path.join(dataDirectoryPath, 'owner-settings.json')
// Ensure that the data directory path exists as other parts of the application
// will rely on it being there.
fs.ensureDirSync(dataDirectoryPath)
try {
fs.ensureDirSync(dataDirectoryPath)
} catch (error) {
const message = `Could not ensure directory for ${dataDirectoryPath}: ${error}`
console.log(message)
throw new Error(message)
}
app.set('dataDirectoryPath', dataDirectoryPath)
app.set('serverSecretFilePath', serverSecretFilePath)
......
......@@ -23,9 +23,10 @@ function startFeathersServer () {
})
}
// On first run of the server only, create a server secret. This
// If it doesn’t already exist, create a server secret. This
// server secret is used to sign the JSON Web Tokens that we use
// for stateless authentication.
// for stateless authentication. (This should only happen on first run of
// an instance unless the server secret is manually deleted on the server.)
async function createAndPersitServerSecretIfItDoesntAlreadyExist () {
if (!app.get('serverSecretFileExists')) {
//
......@@ -34,6 +35,9 @@ async function createAndPersitServerSecretIfItDoesntAlreadyExist () {
//
logger.info('Server secret does not exist, creating this one time.')
// Sodium’s initialisation is asynchronous. Wait for it complete before using it.
await sodium.ready
// Create a server secret as the owner of the site is registering. This is
// the secret that we will use to sign JSON Web Tokens (JWTs).
const serverSecret = sodium.randombytes_buf(sodium.crypto_pwhash_SALTBYTES)
......@@ -46,6 +50,7 @@ async function createAndPersitServerSecretIfItDoesntAlreadyExist () {
// running under.
await fs.writeJson(app.get('serverSecretFilePath'), serverSecretObject)
} catch (error) {
logger.error(error)
throw new Error('Could not persist the server secret.', error)
}
......