mirror of
https://github.com/chuot/rdio-scanner.git
synced 2026-08-14 08:53:03 -06:00
Version 6.0.5
This commit is contained in:
parent
b76567ec19
commit
07ca33f2a4
11
.containerignore
Normal file
11
.containerignore
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
client/.angular/cache
|
||||
client/node_modules
|
||||
server/*.db
|
||||
server/*.crt
|
||||
server/*.json
|
||||
server/*.key
|
||||
server/*.ini
|
||||
server/*.sqlite
|
||||
server/__debug_bin
|
||||
server/autocert
|
||||
server/server
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
The backend server has been completely rewritten in GO language. Therefore, all the subpackages used in v5 had to be replaced with new ones. These new subpackages do not necessarily have the same functionality as those of v5.
|
||||
|
||||
- No more polling mode for _dirwatch_, which in a way is a good thing as polling was disastrous for CPU consumption. The alternative is to install a local instance and use the downstream feature to feed your main instance.
|
||||
- Due to the polling situation, the Docker version of Rdio Scanner is no longer offered. Since it is now so easy to install v6 on various platforms, that was a no-brainer.
|
||||
- Due to the polling situation, the Docker version of Rdio Scanner doesn't have the dirwatch feature.
|
||||
- Default database name changed from _database.sqlite_ to _rdio-scanner.db_. You will need to rename your database file with the new name if you want to convert it. Otherwise, a new database will be created.
|
||||
|
||||
_v6.0.1_
|
||||
|
|
@ -44,6 +44,12 @@ _v6.0.4_
|
|||
- Support files (certs, db, ini) are now created in the same folder as the executable, if the folder is writable, or under a `Rdio Scanner` folder in the user's home folder.
|
||||
- Some code refactoring.
|
||||
|
||||
_v6.0.5_
|
||||
|
||||
- Force mime type to `application/javascript` for `.js` extensions. (see https://github.com/golang/go/issues/32350).
|
||||
- New `-base_dir` option to specify the directory where all data will be written.
|
||||
- New Docker container with disabled dirwatch.
|
||||
|
||||
## Version 5.2
|
||||
|
||||
- Change to how the server reports version.
|
||||
|
|
|
|||
17
COMPILING.md
17
COMPILING.md
|
|
@ -12,6 +12,7 @@ Your os distribution may have all of the following prerequisites available in it
|
|||
- latest version of Go ([here](https://go.dev/dl/))
|
||||
- latest version of Pandoc with pandoc-pdf ([here](https://pandoc.org/installing.html))
|
||||
- latest version of Info-Zip ([here](http://infozip.sourceforge.net/))
|
||||
- latest version of podman ([here](https://podman.io/)), only for building containers
|
||||
|
||||
## Compile the app
|
||||
|
||||
|
|
@ -23,13 +24,13 @@ Clone the official repository on your computer and start the build process.
|
|||
|
||||
When finished, you will find the precompiled versions for various platforms in the `dist` folder.
|
||||
|
||||
rdio-scanner-darwin-amd64-v6.0.4.zip
|
||||
rdio-scanner-darwin-arm64-v6.0.4.zip
|
||||
rdio-scanner-freebsd-amd64-v6.0.4.zip
|
||||
rdio-scanner-linux-386-v6.0.4.zip
|
||||
rdio-scanner-linux-amd64-v6.0.4.zip
|
||||
rdio-scanner-linux-arm64-v6.0.4.zip
|
||||
rdio-scanner-linux-arm-v6.0.4.zip
|
||||
rdio-scanner-windows-amd64-v6.0.4.zip
|
||||
rdio-scanner-darwin-amd64-v6.0.5.zip
|
||||
rdio-scanner-darwin-arm64-v6.0.5.zip
|
||||
rdio-scanner-freebsd-amd64-v6.0.5.zip
|
||||
rdio-scanner-linux-386-v6.0.5.zip
|
||||
rdio-scanner-linux-amd64-v6.0.5.zip
|
||||
rdio-scanner-linux-arm64-v6.0.5.zip
|
||||
rdio-scanner-linux-arm-v6.0.5.zip
|
||||
rdio-scanner-windows-amd64-v6.0.5.zip
|
||||
|
||||
**Happy Rdio scanning !**
|
||||
17
Containerfile
Normal file
17
Containerfile
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
FROM docker.io/alpine:latest
|
||||
LABEL maintainer="Chrystian Huot <chrystian.huot@saubeo.solutions>"
|
||||
WORKDIR /app
|
||||
ENV DOCKER=1
|
||||
COPY dist/linux-amd64/rdio-scanner.pdf .
|
||||
COPY server/. server/.
|
||||
RUN mkdir -p /app/data && \
|
||||
apk --no-cache --no-progress --virtual .build add go && \
|
||||
cd server && \
|
||||
go build -o ../rdio-scanner && \
|
||||
cd .. && \
|
||||
rm -fr server && \
|
||||
apk del .build && \
|
||||
apk --no-cache --no-progress add ffmpeg tzdata
|
||||
VOLUME [ "/app/data" ]
|
||||
EXPOSE 3000
|
||||
ENTRYPOINT [ "./rdio-scanner", "-base_dir", "/app/data" ]
|
||||
11
Makefile
11
Makefile
|
|
@ -16,17 +16,17 @@
|
|||
################################################################################
|
||||
|
||||
app := rdio-scanner
|
||||
date := 2021/12/08
|
||||
ver := 6.0.4
|
||||
date := 2021/12/09
|
||||
ver := 6.0.5
|
||||
|
||||
client := $(wildcard client/*.json client/*.ts)
|
||||
server := $(wildcard server/*.go)
|
||||
|
||||
build = @cd server && GOOS=$(1) GOARCH=$(2) go build -o ../dist/$(1)-$(2)/$(3)
|
||||
pandoc = @test -d dist/$(1)-$(2) || mkdir -p dist/$(1)-$(2) && pandoc -f markdown -o dist/$(1)-$(2)/$(3) --resource-path docs:docs/platforms $(4) docs/webapp.md CHANGELOG.md
|
||||
zip = @cd dist/$(1)-$(2) && zip -q ../$(app)-$(1)-$(2)-v$(ver).zip * && cd .. && rm -fr $(1)-$(2)
|
||||
zip = @cd dist/$(1)-$(2) && zip -q ../$(app)-$(1)-$(2)-v$(ver).zip * && cd ..
|
||||
|
||||
.PHONY: all clean dist sed
|
||||
.PHONY: all clean container dist sed
|
||||
.PHONY: darwin darwin-amd64 darwin-arm64
|
||||
.PHONY: freebsd freebsd-amd64
|
||||
.PHONY: linux linux-386 linux-amd64 linux-arm linux-arm64
|
||||
|
|
@ -37,6 +37,9 @@ all: clean dist
|
|||
clean:
|
||||
@rm -fr client/node_modules dist server/webapp
|
||||
|
||||
container: webapp linux-amd64
|
||||
@podman build --platform linux/amd64 --tag rdio-scanner:latest-beta .
|
||||
|
||||
dist: darwin freebsd linux windows
|
||||
|
||||
sed:
|
||||
|
|
|
|||
2770
client/package-lock.json
generated
2770
client/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,25 +1,25 @@
|
|||
{
|
||||
"author": "Chrystian Huot <chrystian.huot@saubeo.solutions>",
|
||||
"dependencies": {
|
||||
"@angular/animations": "^13.0.3",
|
||||
"@angular/cdk": "^13.0.3",
|
||||
"@angular/common": "~13.0.3",
|
||||
"@angular/compiler": "~13.0.3",
|
||||
"@angular/core": "~13.0.3",
|
||||
"@angular/forms": "~13.0.3",
|
||||
"@angular/material": "^13.0.3",
|
||||
"@angular/platform-browser": "~13.0.3",
|
||||
"@angular/platform-browser-dynamic": "~13.0.3",
|
||||
"@angular/router": "^13.0.3",
|
||||
"@angular/service-worker": "^13.0.3",
|
||||
"@angular/animations": "^13.1.0",
|
||||
"@angular/cdk": "^13.1.0",
|
||||
"@angular/common": "~13.1.0",
|
||||
"@angular/compiler": "~13.1.0",
|
||||
"@angular/core": "~13.1.0",
|
||||
"@angular/forms": "~13.1.0",
|
||||
"@angular/material": "^13.1.0",
|
||||
"@angular/platform-browser": "~13.1.0",
|
||||
"@angular/platform-browser-dynamic": "~13.1.0",
|
||||
"@angular/router": "^13.1.0",
|
||||
"@angular/service-worker": "^13.1.0",
|
||||
"rxjs": "~7.4.0",
|
||||
"tslib": "^2.3.1",
|
||||
"zone.js": "~0.11.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~13.0.4",
|
||||
"@angular/cli": "^13.0.4",
|
||||
"@angular/compiler-cli": "~13.0.3",
|
||||
"@angular-devkit/build-angular": "~13.1.0",
|
||||
"@angular/cli": "^13.1.0",
|
||||
"@angular/compiler-cli": "~13.1.0",
|
||||
"@types/node": "~16.11.12",
|
||||
"@typescript-eslint/eslint-plugin": "^5.6.0",
|
||||
"@typescript-eslint/parser": "^5.6.0",
|
||||
|
|
@ -39,5 +39,5 @@
|
|||
"build": "ng build --base-href ./ --configuration production",
|
||||
"start": "ng serve"
|
||||
},
|
||||
"version": "6.0.4"
|
||||
"version": "6.0.5"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ export interface ApiKey {
|
|||
|
||||
export interface DirWatch {
|
||||
_id?: string;
|
||||
// delay?: number;
|
||||
deleteAfter?: boolean;
|
||||
directory?: string;
|
||||
disabled?: boolean;
|
||||
|
|
@ -64,7 +63,6 @@ export interface DirWatch {
|
|||
systemId?: number;
|
||||
talkgroupId?: number;
|
||||
type?: string;
|
||||
// usePolling?: boolean;
|
||||
}
|
||||
|
||||
export interface Downstream {
|
||||
|
|
@ -170,6 +168,7 @@ export interface Config {
|
|||
export interface AdminEvent {
|
||||
authenticated?: boolean;
|
||||
config?: Config;
|
||||
docker?: boolean;
|
||||
passwordNeedChange?: boolean;
|
||||
}
|
||||
|
||||
|
|
@ -191,12 +190,18 @@ export class RdioScannerAdminService implements OnDestroy {
|
|||
return !!this.token;
|
||||
}
|
||||
|
||||
get docker() {
|
||||
return this._docker;
|
||||
}
|
||||
|
||||
get passwordNeedChange() {
|
||||
return this._passwordNeedChange;
|
||||
}
|
||||
|
||||
private configWebSocket: WebSocket | undefined;
|
||||
|
||||
private _docker = false;
|
||||
|
||||
private _passwordNeedChange = false;
|
||||
|
||||
private get token(): string {
|
||||
|
|
@ -246,12 +251,19 @@ export class RdioScannerAdminService implements OnDestroy {
|
|||
try {
|
||||
const res = await firstValueFrom(this.ngHttpClient.get<{
|
||||
config: Config;
|
||||
docker: boolean;
|
||||
passwordNeedChange: boolean;
|
||||
}>(
|
||||
this.getUrl(url.config),
|
||||
{ headers: this.getHeaders(), responseType: 'json' },
|
||||
));
|
||||
|
||||
if (res.docker !== this._docker) {
|
||||
this._docker = res.docker;
|
||||
|
||||
this.event.emit({ docker: this.docker })
|
||||
}
|
||||
|
||||
if (res.passwordNeedChange !== this._passwordNeedChange) {
|
||||
this._passwordNeedChange = res.passwordNeedChange;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
</mat-expansion-panel-header>
|
||||
<rdio-scanner-admin-api-keys #apiKeyComponent [form]="apiKeys"></rdio-scanner-admin-api-keys>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel (afterCollapse)="dirWatchComponent.closeAll()">
|
||||
<mat-expansion-panel *ngIf="!docker" (afterCollapse)="dirWatchComponent.closeAll()">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<mat-icon>folder</mat-icon>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ import { AdminEvent, RdioScannerAdminService, Config } from '../admin.service';
|
|||
templateUrl: './config.component.html',
|
||||
})
|
||||
export class RdioScannerAdminConfigComponent implements OnDestroy, OnInit {
|
||||
docker: boolean = false;
|
||||
|
||||
form: FormGroup | undefined;
|
||||
|
||||
get access(): FormArray {
|
||||
|
|
@ -80,6 +82,10 @@ export class RdioScannerAdminConfigComponent implements OnDestroy, OnInit {
|
|||
this.reset();
|
||||
}
|
||||
}
|
||||
|
||||
if ('docker' in event) {
|
||||
this.docker = event.docker!;
|
||||
}
|
||||
});
|
||||
|
||||
@ViewChildren(MatExpansionPanel) private panels: QueryList<MatExpansionPanel> | undefined;
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ ALWAYS DOWNLOAD THE LATEST VERSION OF [RDIO SCANNER](https://github.com/chuot/rd
|
|||
rdio@macos ~ % mkdir rdio-scanner
|
||||
rdio@macos ~ % cd rdio-scanner
|
||||
rdio@macos rdio-scanner % unzip \
|
||||
> ~/Downloads/rdio-scanner-darwin-arm64-v6.0.4.zip
|
||||
Archive: /Users/rdio/Downloads/rdio-scanner-darwin-arm64-v6.0.4.zip
|
||||
> ~/Downloads/rdio-scanner-darwin-arm64-v6.0.5.zip
|
||||
Archive: /Users/rdio/Downloads/rdio-scanner-darwin-arm64-v6.0.5.zip
|
||||
inflating: rdio-scanner
|
||||
inflating: rdio-scanner.pdf
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ ALWAYS DOWNLOAD THE LATEST VERSION OF [RDIO SCANNER](https://github.com/chuot/rd
|
|||
|
||||
rdio@macos rdio-scanner % ./rdio-scanner
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 08:38:06 server started
|
||||
2021/12/08 08:38:06 main interface at http://macos.local:3000
|
||||
|
|
@ -76,7 +76,7 @@ Here we want our [Rdio Scanner](https://guthub.com/chuot/rdio-scanner) instance
|
|||
|
||||
rdio@macos rdio-scanner % ./rdio-scanner --listen :80
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 08:48:03 server started
|
||||
2021/12/08 08:48:03 main interface at http://macos.local
|
||||
|
|
@ -107,7 +107,7 @@ Now we use the self-signed server certificate to run our instance.
|
|||
> -ssl_key_file server.key \
|
||||
> -ssl_listen :443
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 08:50:58 server started
|
||||
2021/12/08 08:50:58 main interface at http://macos.local
|
||||
|
|
@ -139,7 +139,7 @@ Then simply run [Rdio Scanner](https://github.com/chuot/rdio-scanner) without an
|
|||
|
||||
rdio@macos rdio-scanner % ./rdio-scanner
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 08:54:08 server started
|
||||
2021/12/08 08:54:08 main interface at http://macos.local
|
||||
|
|
@ -166,41 +166,43 @@ To get the whole list of arguments you can pass to [Rdio Scanner](https://github
|
|||
rdio@macos rdio-scanner % ./rdio-scanner -h
|
||||
Usage of ./rdio-scanner:
|
||||
-admin_password string
|
||||
change admin password
|
||||
change admin password
|
||||
-base_dir string
|
||||
base directory where all data will be written
|
||||
-config string
|
||||
Server config file (default "rdio-scanner.ini")
|
||||
server config file (default "rdio-scanner.ini")
|
||||
-config_save
|
||||
save configuration to rdio-scanner.ini
|
||||
save configuration to rdio-scanner.ini
|
||||
-db_file string
|
||||
sqlite database file (default "rdio-scanner.db")
|
||||
sqlite database file (default "rdio-scanner.db")
|
||||
-db_host string
|
||||
database host ip or hostname (default "localhost")
|
||||
database host ip or hostname (default "localhost")
|
||||
-db_name string
|
||||
database name
|
||||
database name
|
||||
-db_pass string
|
||||
database password
|
||||
database password
|
||||
-db_port uint
|
||||
database host port (default 3306)
|
||||
database host port (default 3306)
|
||||
-db_type string
|
||||
database type, one of sqlite, mariadb, mysql (default "sqlite")
|
||||
database type, one of sqlite, mariadb, mysql (default "sqlite")
|
||||
-db_user string
|
||||
database user name
|
||||
database user name
|
||||
-listen string
|
||||
listening address (default ":3000")
|
||||
listening address (default ":3000")
|
||||
-service string
|
||||
service command, one of start, stop, restart, install, uninstall
|
||||
service command, one of start, stop, restart, install, uninstall
|
||||
-ssl_auto_cert string
|
||||
Domain name for Let's Encrypt automatic certificate
|
||||
domain name for Let's Encrypt automatic certificate
|
||||
-ssl_cert_file string
|
||||
ssl PEM formated certificate
|
||||
ssl PEM formated certificate
|
||||
-ssl_create
|
||||
create self-signed certificates
|
||||
create self-signed certificates
|
||||
-ssl_key_file string
|
||||
ssl PEM formated key
|
||||
ssl PEM formated key
|
||||
-ssl_listen string
|
||||
listening address for ssl
|
||||
listening address for ssl
|
||||
-version
|
||||
show application version
|
||||
show application version
|
||||
rdio@macos rdio-scanner %
|
||||
|
||||
\pagebreak{}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ ALWAYS DOWNLOAD THE LATEST VERSION OF [RDIO SCANNER](https://github.com/chuot/rd
|
|||
rdio@pc-freebsd:~ $ mkdir rdio-scanner
|
||||
rdio@pc-freebsd:~ $ cd rdio-scanner
|
||||
rdio@pc-freebsd:~/rdio-scanner $ unzip \
|
||||
> ~/rdio-scanner-freebsd-amd64-v6.0.4.zip
|
||||
Archive: ../rdio-scanner-freebsd-amd64-v6.0.4.zip
|
||||
> ~/rdio-scanner-freebsd-amd64-v6.0.5.zip
|
||||
Archive: ../rdio-scanner-freebsd-amd64-v6.0.5.zip
|
||||
extracting: rdio-scanner
|
||||
extracting: rdio-scanner.pdf
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ ALWAYS DOWNLOAD THE LATEST VERSION OF [RDIO SCANNER](https://github.com/chuot/rd
|
|||
|
||||
rdio@pc-freebsd:~/rdio-scanner $ ./rdio-scanner
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 08:16:36 server started
|
||||
2021/12/08 08:16:36 main interface at http://pc-freebsd:3000
|
||||
|
|
@ -80,7 +80,7 @@ Here we want our [Rdio Scanner](https://guthub.com/chuot/rdio-scanner) instance
|
|||
Password:
|
||||
root@pc-freebsd:/home/rdio/rdio-scanner # ./rdio-scanner -listen :80
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 08:19:38 server started
|
||||
2021/12/08 08:19:38 main interface at http://pc-freebsd
|
||||
|
|
@ -113,7 +113,7 @@ Now we use the self-signed server certificate to run our instance.
|
|||
> -ssl_key_file server.key \
|
||||
> -ssl_listen :443
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 10:34:29 server started
|
||||
2021/12/08 10:34:29 main interface at http://pc-freebsd
|
||||
|
|
@ -147,7 +147,7 @@ Then simply run [Rdio Scanner](https://github.com/chuot/rdio-scanner) without an
|
|||
Password:
|
||||
root@pc-freebsd:/home/rdio/rdio-scanner # ./rdio-scanner
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 10:38:28 server started
|
||||
2021/12/08 10:38:29 main interface at http://pc-freebsd
|
||||
|
|
@ -177,41 +177,43 @@ To get the whole list of arguments you can pass to [Rdio Scanner](https://github
|
|||
rdio@pc-freebsd:~/rdio-scanner $ ./rdio-scanner -h
|
||||
Usage of ./rdio-scanner:
|
||||
-admin_password string
|
||||
change admin password
|
||||
change admin password
|
||||
-base_dir string
|
||||
base directory where all data will be written
|
||||
-config string
|
||||
Server config file (default "rdio-scanner.ini")
|
||||
server config file (default "rdio-scanner.ini")
|
||||
-config_save
|
||||
save configuration to rdio-scanner.ini
|
||||
save configuration to rdio-scanner.ini
|
||||
-db_file string
|
||||
sqlite database file (default "rdio-scanner.db")
|
||||
sqlite database file (default "rdio-scanner.db")
|
||||
-db_host string
|
||||
database host ip or hostname (default "localhost")
|
||||
database host ip or hostname (default "localhost")
|
||||
-db_name string
|
||||
database name
|
||||
database name
|
||||
-db_pass string
|
||||
database password
|
||||
database password
|
||||
-db_port uint
|
||||
database host port (default 3306)
|
||||
database host port (default 3306)
|
||||
-db_type string
|
||||
database type, one of sqlite, mariadb, mysql (default "sqlite")
|
||||
database type, one of sqlite, mariadb, mysql (default "sqlite")
|
||||
-db_user string
|
||||
database user name
|
||||
database user name
|
||||
-listen string
|
||||
listening address (default ":3000")
|
||||
listening address (default ":3000")
|
||||
-service string
|
||||
service command, one of start, stop, restart, install, uninstall
|
||||
service command, one of start, stop, restart, install, uninstall
|
||||
-ssl_auto_cert string
|
||||
Domain name for Let's Encrypt automatic certificate
|
||||
domain name for Let's Encrypt automatic certificate
|
||||
-ssl_cert_file string
|
||||
ssl PEM formated certificate
|
||||
ssl PEM formated certificate
|
||||
-ssl_create
|
||||
create self-signed certificates
|
||||
create self-signed certificates
|
||||
-ssl_key_file string
|
||||
ssl PEM formated key
|
||||
ssl PEM formated key
|
||||
-ssl_listen string
|
||||
listening address for ssl
|
||||
listening address for ssl
|
||||
-version
|
||||
show application version
|
||||
show application version
|
||||
rdio@pc-freebsd:~/rdio-scanner $
|
||||
|
||||
\pagebreak{}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ ALWAYS DOWNLOAD THE LATEST VERSION OF [RDIO SCANNER](https://github.com/chuot/rd
|
|||
[rdio@pc-linux ~]$ mkdir rdio-scanner
|
||||
[rdio@pc-linux ~]$ cd rdio-scanner
|
||||
[rdio@pc-linux rdio-scanner]$ unzip \
|
||||
> ~/Downloads/rdio-scanner-linux-amd64-v6.0.4.zip
|
||||
Archive: /home/rdio/Downloads/rdio-scanner-linux-amd64-v6.0.4.zip
|
||||
> ~/Downloads/rdio-scanner-linux-amd64-v6.0.5.zip
|
||||
Archive: /home/rdio/Downloads/rdio-scanner-linux-amd64-v6.0.5.zip
|
||||
inflating: rdio-scanner
|
||||
inflating: rdio-scanner.pdf
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ ALWAYS DOWNLOAD THE LATEST VERSION OF [RDIO SCANNER](https://github.com/chuot/rd
|
|||
|
||||
[rdio@pc-linux rdio-scanner]$ ./rdio-scanner
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 09:11:48 server started
|
||||
2021/12/08 09:11:48 main interface at http://pc-linux:3000
|
||||
|
|
@ -77,7 +77,7 @@ Here we want our [Rdio Scanner](https://guthub.com/chuot/rdio-scanner) instance
|
|||
[rdio@pc-linux rdio-scanner]$ sudo ./rdio-scanner -listen :80
|
||||
[sudo] password for rdio:
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 09:14:00 server started
|
||||
2021/12/08 09:14:00 main interface at http://pc-linux
|
||||
|
|
@ -109,7 +109,7 @@ Now we use the self-signed server certificate to run our instance.
|
|||
> -ssl_listen :443
|
||||
[sudo] password for rdio:
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 09:16:47 server started
|
||||
2021/12/08 09:16:47 main interface at http://pc-linux
|
||||
|
|
@ -142,7 +142,7 @@ Then simply run [Rdio Scanner](https://github.com/chuot/rdio-scanner) without an
|
|||
[rdio@pc-linux rdio-scanner]$ sudo ./rdio-scanner
|
||||
[sudo] Mot de passe de rdio :
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 09:20:40 server started
|
||||
2021/12/08 09:20:40 main interface at http://pc-linux
|
||||
|
|
@ -169,9 +169,11 @@ To get the whole list of arguments you can pass to [Rdio Scanner](https://github
|
|||
[rdio@pc-linux rdio-scanner]$ ./rdio-scanner -h
|
||||
Usage of ./rdio-scanner:
|
||||
-admin_password string
|
||||
change admin password
|
||||
change admin password
|
||||
-base_dir string
|
||||
base directory where all data will be written
|
||||
-config string
|
||||
Server config file (default "rdio-scanner.ini")
|
||||
server config file (default "rdio-scanner.ini")
|
||||
-config_save
|
||||
save configuration to rdio-scanner.ini
|
||||
-db_file string
|
||||
|
|
@ -193,7 +195,7 @@ To get the whole list of arguments you can pass to [Rdio Scanner](https://github
|
|||
-service string
|
||||
service command, one of start, stop, restart, install, uninstall
|
||||
-ssl_auto_cert string
|
||||
Domain name for Let's Encrypt automatic certificate
|
||||
domain name for Let's Encrypt automatic certificate
|
||||
-ssl_cert_file string
|
||||
ssl PEM formated certificate
|
||||
-ssl_create
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ ALWAYS DOWNLOAD THE LATEST VERSION OF [RDIO SCANNER](https://github.com/chuot/rd
|
|||
C:\Users\rdio> cd rdio-scanner
|
||||
|
||||
C:\Users\rdio\rdio-scanner> tar -xvf ^
|
||||
..\downloads\rdio-scanner-windows-amd64-v6.0.4.zip
|
||||
..\downloads\rdio-scanner-windows-amd64-v6.0.5.zip
|
||||
x rdio-scanner.exe
|
||||
x rdio-scanner.pdf
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ ALWAYS DOWNLOAD THE LATEST VERSION OF [RDIO SCANNER](https://github.com/chuot/rd
|
|||
|
||||
C:\Users\rdio\rdio-scanner>rdio-scanner
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 13:48:48 server started
|
||||
2021/12/08 13:48:48 main interface at http://pc-windows:3000
|
||||
|
|
@ -77,7 +77,7 @@ Here we want our [Rdio Scanner](https://guthub.com/chuot/rdio-scanner) instance
|
|||
|
||||
C:\Users\rdio\rdio-scanner>rdio-scanner -listen :80
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 10:53:31 server started
|
||||
2021/12/08 10:53:31 main interface at http://pc-windows
|
||||
|
|
@ -108,7 +108,7 @@ Now we use the self-signed server certificate to run our instance.
|
|||
-ssl_key_file server.key ^
|
||||
-ssl_listen :443
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 11:05:43 server started
|
||||
2021/12/08 11:05:43 main interface at http://pc-windows
|
||||
|
|
@ -140,7 +140,7 @@ Then simply run [Rdio Scanner](https://github.com/chuot/rdio-scanner) without an
|
|||
|
||||
C:\Users\rdio\rdio-scanner>rdio-scanner
|
||||
|
||||
Rdio Scanner v6.0.4
|
||||
Rdio Scanner v6.0.5
|
||||
----------------------------------
|
||||
2021/12/08 11:11:28 server started
|
||||
2021/12/08 11:11:28 main interface at http://pc-windows
|
||||
|
|
@ -169,8 +169,10 @@ To get the whole list of arguments you can pass to [Rdio Scanner](https://github
|
|||
Usage of rdio-scanner:
|
||||
-admin_password string
|
||||
change admin password
|
||||
-base_dir string
|
||||
base directory where all data will be written
|
||||
-config string
|
||||
Server config file (default "rdio-scanner.ini")
|
||||
server config file (default "rdio-scanner.ini")
|
||||
-config_save
|
||||
save configuration to rdio-scanner.ini
|
||||
-db_file string
|
||||
|
|
@ -192,7 +194,7 @@ To get the whole list of arguments you can pass to [Rdio Scanner](https://github
|
|||
-service string
|
||||
service command, one of start, stop, restart, install, uninstall
|
||||
-ssl_auto_cert string
|
||||
Domain name for Let's Encrypt automatic certificate
|
||||
domain name for Let's Encrypt automatic certificate
|
||||
-ssl_cert_file string
|
||||
ssl PEM formated certificate
|
||||
-ssl_create
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
|
@ -528,8 +529,10 @@ func (admin *Admin) PasswordHandler(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
func (admin *Admin) SendConfig(w http.ResponseWriter) {
|
||||
_, docker := os.LookupEnv("DOCKER")
|
||||
if b, err := json.Marshal(map[string]interface{}{
|
||||
"config": admin.GetConfig(),
|
||||
"docker": docker,
|
||||
"passwordNeedChange": admin.Controller.Options.adminPasswordNeedChange,
|
||||
}); err == nil {
|
||||
w.Write(b)
|
||||
|
|
|
|||
|
|
@ -73,22 +73,6 @@ func NewConfig() *Config {
|
|||
version = flag.Bool("version", false, "show application version")
|
||||
)
|
||||
|
||||
flag.StringVar(&config.DbFile, "db_file", defaultDbFile, "sqlite database file")
|
||||
flag.StringVar(&config.DbHost, "db_host", defaultDbHost, "database host ip or hostname")
|
||||
flag.StringVar(&config.DbName, "db_name", "", "database name")
|
||||
flag.StringVar(&config.DbPassword, "db_pass", "", "database password")
|
||||
flag.UintVar(&config.DbPort, "db_port", defaultDbPort, "database host port")
|
||||
flag.StringVar(&config.DbType, "db_type", defaultDbType, fmt.Sprintf("database type, one of %s, %s, %s", DbTypeSqlite, DbTypeMariadb, DbTypeMysql))
|
||||
flag.StringVar(&config.DbUsername, "db_user", "", "database user name")
|
||||
flag.StringVar(&config.ConfigFile, "config", defaultConfigFile, "Server config file")
|
||||
flag.StringVar(&config.Listen, "listen", defaultListen, "listening address")
|
||||
flag.StringVar(&config.SslAutoCert, "ssl_auto_cert", "", "Domain name for Let's Encrypt automatic certificate")
|
||||
flag.StringVar(&config.SslCertFile, "ssl_cert_file", "", "ssl PEM formated certificate")
|
||||
flag.StringVar(&config.SslKeyFile, "ssl_key_file", "", "ssl PEM formated key")
|
||||
flag.StringVar(&config.SslListen, "ssl_listen", "", "listening address for ssl")
|
||||
flag.StringVar(&config.newAdminPassword, "admin_password", "", "change admin password")
|
||||
flag.Parse()
|
||||
|
||||
if exe, err := os.Executable(); err == nil {
|
||||
if !regexp.MustCompile(`go-build[0-9]+`).Match([]byte(exe)) {
|
||||
config.BaseDir = filepath.Dir(exe)
|
||||
|
|
@ -103,6 +87,23 @@ func NewConfig() *Config {
|
|||
}
|
||||
}
|
||||
|
||||
flag.StringVar(&config.BaseDir, "base_dir", config.BaseDir, "base directory where all data will be written")
|
||||
flag.StringVar(&config.DbFile, "db_file", defaultDbFile, "sqlite database file")
|
||||
flag.StringVar(&config.DbHost, "db_host", defaultDbHost, "database host ip or hostname")
|
||||
flag.StringVar(&config.DbName, "db_name", "", "database name")
|
||||
flag.StringVar(&config.DbPassword, "db_pass", "", "database password")
|
||||
flag.UintVar(&config.DbPort, "db_port", defaultDbPort, "database host port")
|
||||
flag.StringVar(&config.DbType, "db_type", defaultDbType, fmt.Sprintf("database type, one of %s, %s, %s", DbTypeSqlite, DbTypeMariadb, DbTypeMysql))
|
||||
flag.StringVar(&config.DbUsername, "db_user", "", "database user name")
|
||||
flag.StringVar(&config.ConfigFile, "config", defaultConfigFile, "server config file")
|
||||
flag.StringVar(&config.Listen, "listen", defaultListen, "listening address")
|
||||
flag.StringVar(&config.SslAutoCert, "ssl_auto_cert", "", "domain name for Let's Encrypt automatic certificate")
|
||||
flag.StringVar(&config.SslCertFile, "ssl_cert_file", "", "ssl PEM formated certificate")
|
||||
flag.StringVar(&config.SslKeyFile, "ssl_key_file", "", "ssl PEM formated key")
|
||||
flag.StringVar(&config.SslListen, "ssl_listen", "", "listening address for ssl")
|
||||
flag.StringVar(&config.newAdminPassword, "admin_password", "", "change admin password")
|
||||
flag.Parse()
|
||||
|
||||
if !config.isBaseDirWritable() {
|
||||
log.Fatalf("no write permissions in %s", config.BaseDir)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ require (
|
|||
github.com/google/uuid v1.3.0
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/kardianos/service v1.2.0
|
||||
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e
|
||||
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b
|
||||
gopkg.in/ini.v1 v1.66.2
|
||||
modernc.org/sqlite v1.14.2
|
||||
)
|
||||
|
|
@ -21,15 +21,15 @@ require (
|
|||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
|
||||
github.com/stretchr/testify v1.7.0 // indirect
|
||||
golang.org/x/mod v0.5.1 // indirect
|
||||
golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b // indirect
|
||||
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect
|
||||
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
|
||||
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/tools v0.1.8 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||
lukechampine.com/uint128 v1.1.1 // indirect
|
||||
modernc.org/cc/v3 v3.35.18 // indirect
|
||||
modernc.org/ccgo/v3 v3.12.87 // indirect
|
||||
modernc.org/libc v1.11.89 // indirect
|
||||
modernc.org/ccgo/v3 v3.12.88 // indirect
|
||||
modernc.org/libc v1.11.90 // indirect
|
||||
modernc.org/mathutil v1.4.1 // indirect
|
||||
modernc.org/memory v1.0.5 // indirect
|
||||
modernc.org/opt v0.1.1 // indirect
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
|
|||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e h1:MUP6MR3rJ7Gk9LEia0LP2ytiH6MuCfs7qYz+47jGdD8=
|
||||
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b h1:QAqMVf3pSa6eeTsuklijukjXBlj7Es2QQplab+/RbQ4=
|
||||
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
|
||||
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
|
||||
|
|
@ -47,8 +47,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
|
|||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b h1:MWaHNqZy3KTpuTMAGvv+Kw+ylsEpmyJZizz1dqxnu28=
|
||||
golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY=
|
||||
golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
|
@ -65,8 +65,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||
golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E=
|
||||
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk=
|
||||
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
|
|
@ -142,8 +142,8 @@ modernc.org/ccgo/v3 v3.12.81/go.mod h1:p2A1duHoBBg1mFtYvnhAnQyI6vL0uw5PGYLSIgF6r
|
|||
modernc.org/ccgo/v3 v3.12.82/go.mod h1:ApbflUfa5BKadjHynCficldU1ghjen84tuM5jRynB7w=
|
||||
modernc.org/ccgo/v3 v3.12.84/go.mod h1:ApbflUfa5BKadjHynCficldU1ghjen84tuM5jRynB7w=
|
||||
modernc.org/ccgo/v3 v3.12.86/go.mod h1:dN7S26DLTgVSni1PVA3KxxHTcykyDurf3OgUzNqTSrU=
|
||||
modernc.org/ccgo/v3 v3.12.87 h1:d8IVZadjkPWICHmMWEaPAL37zBrZ7rE7/+Plegf0cyw=
|
||||
modernc.org/ccgo/v3 v3.12.87/go.mod h1:55tmwIw8bqNbqYCZ2DIXGqB1I0goRe6tq2qHqr1FaQU=
|
||||
modernc.org/ccgo/v3 v3.12.88 h1:4CULh7Y1zIU2yvCgU2iDANAwikAmrI65upXkE/Ai/lI=
|
||||
modernc.org/ccgo/v3 v3.12.88/go.mod h1:0MFzUHIuSIthpVZyMWiFYMwjiFnhrN5MkvBrUwON+ZM=
|
||||
modernc.org/ccorpus v1.11.1 h1:K0qPfpVG1MJh5BYazccnmhywH4zHuOgJXgbjzyp6dWA=
|
||||
modernc.org/ccorpus v1.11.1/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ=
|
||||
modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM=
|
||||
|
|
@ -184,8 +184,8 @@ modernc.org/libc v1.11.82/go.mod h1:NF+Ek1BOl2jeC7lw3a7Jj5PWyHPwWD4aq3wVKxqV1fI=
|
|||
modernc.org/libc v1.11.86/go.mod h1:ePuYgoQLmvxdNT06RpGnaDKJmDNEkV7ZPKI2jnsvZoE=
|
||||
modernc.org/libc v1.11.87/go.mod h1:Qvd5iXTeLhI5PS0XSyqMY99282y+3euapQFxM7jYnpY=
|
||||
modernc.org/libc v1.11.88/go.mod h1:h3oIVe8dxmTcchcFuCcJ4nAWaoiwzKCdv82MM0oiIdQ=
|
||||
modernc.org/libc v1.11.89 h1:41X0GhYT3+0WbXvsOMDguwnmfY6692gXkSlOuSaO9jc=
|
||||
modernc.org/libc v1.11.89/go.mod h1:ynK5sbjsU77AP+nn61+k+wxUGRx9rOFcIqWYYMaDZ4c=
|
||||
modernc.org/libc v1.11.90 h1:iBtBAI7GR0tljqnaa7rtCkql2xZNYLG9Nq53oTYipwE=
|
||||
modernc.org/libc v1.11.90/go.mod h1:ynK5sbjsU77AP+nn61+k+wxUGRx9rOFcIqWYYMaDZ4c=
|
||||
modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
|
||||
modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
|
||||
modernc.org/mathutil v1.4.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
|
||||
|
|
|
|||
|
|
@ -146,7 +146,14 @@ func main() {
|
|||
}
|
||||
|
||||
if b, err := webapp.ReadFile(path.Join("webapp", url)); err == nil {
|
||||
w.Header().Set("Content-Type", mime.TypeByExtension(path.Ext(url)))
|
||||
var t string
|
||||
switch path.Ext(url) {
|
||||
case ".js":
|
||||
t = "text/javascript" // see https://github.com/golang/go/issues/32350
|
||||
default:
|
||||
t = mime.TypeByExtension(path.Ext(url))
|
||||
}
|
||||
w.Header().Set("Content-Type", t)
|
||||
w.Write(b)
|
||||
|
||||
} else if url[:len(url)-1] != "/" {
|
||||
|
|
|
|||
|
|
@ -15,4 +15,4 @@
|
|||
|
||||
package main
|
||||
|
||||
const Version = "6.0.4"
|
||||
const Version = "6.0.5"
|
||||
|
|
|
|||
Loading…
Reference in a new issue