Merge pull request #187 from NicolasConstant/fix_docker

PR 0.18.2
This commit is contained in:
Nicolas Constant 2019-11-02 01:58:41 -04:00 committed by GitHub
commit 7f82edf7be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 103 additions and 7 deletions

View File

@ -1,4 +1,7 @@
.git
.gitignore
.travis.yml
appveyor.yml
.vscode
node_modules
dist

View File

@ -12,7 +12,8 @@ FROM alpine:latest
RUN apk add --update --no-cache lighttpd
ADD lighttpd.conf /etc/lighttpd/lighttpd.conf
COPY --from=build /build/dist /app
COPY --from=build /build/dist /app/sengi
COPY --from=build /build/assets/docker_init /app
EXPOSE 80

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,29 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="main.css">
<link rel="shortcut icon" type="image/png" href="favicon.png">
<title>Sengi Launcher</title>
</head>
<body>
<div class="launcher-wrapper">
<div class="launcher">
<a href="#" class="button" title="launch sengi in popup"
onClick="window.open('/sengi/'+'?qt='+ (new Date()).getTime(),'Sengi','toolbar=no,location=no,status=no,menubar=no,scrollbars=no, resizable=yes,width=377,height=800'); return false;">
<span class="download-button__web--label">Launch Sengi Popup</span>
</a><br />
<a href="/sengi/" class="button" title="launch sengi">
<span class="download-button__web--label">Open Sengi</span>
</a><br />
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,45 @@
*, *::after, *::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
font-size: 62.5%;
background-color: #141824;
font-family: Verdana, Geneva, sans-serif;
}
body {
box-sizing: border-box;
overflow: hidden;
}
.launcher-wrapper{
display: flex;
align-items: center;
justify-content: center;
}
.launcher {
height: 15rem;
width: 30rem;
margin: 35vh auto;
}
.button {
background-color: #090b10;
display: block;
width: 30rem;
padding: 1.5rem 2rem 1.75rem 2rem;
color: white;
border-radius: 3px;
font-size: 1.8rem;
font-weight: lighter;
text-decoration: none;
transition: all .2s;
}
.button:hover {
background-color: #1e2433;
}

View File

@ -10,3 +10,5 @@ server.modules = (
include "mime-types.conf"
server.pid-file = "/run/lighttpd.pid"
index-file.names = ( "index.html", "index.htm" )
#url.rewrite-once = ( "^sengi/(.*)" => "/sengi/index.html" )
server.error-handler-404 = "/sengi/index.html"

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "sengi",
"version": "0.16.2",
"version": "0.18.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "sengi",
"version": "0.18.1",
"version": "0.18.2",
"license": "AGPL-3.0-or-later",
"main": "main-electron.js",
"description": "A multi-account desktop client for Mastodon and Pleroma",

View File

@ -14,6 +14,7 @@ import { StreamsState } from '../../states/streams.state';
import { NavigationService } from '../../services/navigation.service';
import { NotificationService } from '../../services/notification.service';
import { MastodonService } from '../../services/mastodon.service';
import { AuthService } from '../../services/auth.service';
describe('CreateStatusComponent', () => {
@ -35,7 +36,7 @@ describe('CreateStatusComponent', () => {
StreamsState
]),
],
providers: [NavigationService, NotificationService, MastodonService],
providers: [NavigationService, NotificationService, MastodonService, AuthService],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
}).compileComponents();
}));

View File

@ -101,7 +101,7 @@ export class AddNewAccountComponent implements OnInit {
if (instanceApps.length !== 0) {
return Promise.resolve(instanceApps[0].app);
} else {
const redirect_uri = this.getLocalHostname() + '/register';
const redirect_uri = this.getLocalHostname();
return this.authService.createNewApplication(instance, 'Sengi', redirect_uri, 'read write follow', 'https://nicolasconstant.github.io/sengi/')
.then((appData: AppData) => {
return this.saveNewApp(instance, appData)
@ -132,8 +132,12 @@ export class AddNewAccountComponent implements OnInit {
}
private getLocalHostname(): string {
let localHostname = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
return localHostname;
let href = window.location.href;
if(href.includes('/home')){
return href.split('/home')[0];
} else {
return location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
}
}
private saveNewApp(instance: string, app: AppData): Promise<any> {

View File

@ -1,4 +1,5 @@
import { Component, OnInit, OnDestroy, QueryList, ViewChildren, ElementRef } from "@angular/core";
import { ActivatedRoute, Router } from '@angular/router';
import { Observable, Subscription } from "rxjs";
import { Select } from "@ngxs/store";
import scrollIntoView from "smooth-scroll-into-view-if-needed";
@ -19,10 +20,20 @@ export class StreamsMainDisplayComponent implements OnInit, OnDestroy {
private columnSelectedSub: Subscription;
constructor(
private readonly router: Router,
private readonly activatedRoute: ActivatedRoute,
private readonly navigationService: NavigationService) {
}
ngOnInit() {
this.activatedRoute.queryParams.subscribe(params => {
const code = params['code'];
if (code) {
this.router.navigate(['/register'], { queryParams: { code: code} });
return;
}
});
this.columnSelectedSub = this.navigationService.columnSelectedSubject.subscribe((columnIndex: number) => {
this.focusOnColumn(columnIndex);
});