Onlyoffice or WOPI protocol - ms-office

I'm looking for a MS Office editor API for my web app to enable users to upload/create word or excel documents, edit them and save them online. I found Onlyoffice and WOPI protocol can provide this but I'm not sure which one works better or easier to develop. I appreciate if you can share your experience.

I'd recommend you use Docker version Community Server to provide the service. Your web app can open webview with url point to the Community Server.
git clone https://github.com/ONLYOFFICE/Docker-CommunityServer.git
Edit docker-compose.workspace.yml and remove all mail stuff if you don't need mails like me.
# Start
docker-compose -f docker-compose.workspace.yml up -d
# Open browser to localhost
# Stop
docker-compose -f docker-compose.workspace.yml down
# Stop and delete volume data
docker-compose -f docker-compose.workspace.yml down -v

Related

Web application no longer restarts automatically on Azure WebApps on TOMCAT server : HTTP 404

My applications were working properly on Azure, but after a Microsoft Docker update, they don't all restart automatically.
I have an HTTP 404:
My analysis :
This application was deployed with Microsoft tools
az webapp deploy ...
in log : /home/DeploymentLogStream/ xxx.log
the application is deployed correctly and it is present on file system
...
"Clean deploying to /home/site/wwwroot/webapps/wholesale"}
"Generating deployment script."}
"Using cached version of deployment script (command: 'azure -y --no-dot
"Running deployment command..."}
"Command: \"/home/site/deployments/tools/deploy.sh\""}
"Handling Basic Web Site deployment."}
....
"Requesting site restart"}
"Requesting site restart. Attempt #1"}
"Successfully requested a restart. Attempt #1"}
"Deployment successful. deployer = OneDeploy deploymentPath = OneDeploy
In Docker Log file I see an update of Microsoft image :
675db21ca06b Extracting 133B / 133B
675db21ca06b Extracting 133B / 133B
675db21ca06b Pull complete
Digest: sha256:932deb9018db39b74249774b4206906424f3fea09b791e9318c43316dc695aff
Status: Downloaded newer image for mcr.microsoft.com/azure-app-service/tomcat:8.5-jre8_220406005815
Pull Image successful, Time taken: 1 Minutes and 11 Seconds
Starting container for site
docker run -d -p 8871:80 --name ..
Container ... initialized successfully and is ready to serve requests.
But in Tomcat log File I only see the default ROOT module and not my Web application.
and indeed my app is not copy from /home/site/wwwroot/webapps/wholesale to /usr/local/tomcat/webapps/wholesale
/usr/local/tomcat/webapps
Redeployment does not change the problem.
Multiple restarts solve the problem but without understanding why.
The workaround is to manually copy the directory from /home to /usr, but next update will remove it.
Someone has an idea to solve the problem ?
Apologies for the inconvenience with this issue and delayed response here.
Users using the auto-update version of Tomcat on Linux that deploy multiple applications in the webapps directory may see their apps return 404.
You may manually change the version to respective working version:
Tomcat 8.5: 8.5.72
Tomcat 9.0: 9.0.54
Tomcat 10.0: 10.0.12
You may also check Azure Service Health history, notification info.
Kindly let us know how it goes.

Docker Document Server "Download Failed"

I'm trying to test OnlyOffice locally. I'd like to open .docx files on my website.
I was quite confused, but I think I dont need Community Server for this, right?
The Document Server looks fine. Even when I set the volumes.. For now, lets use this:
sudo docker run -i -t -d -p 80:80 --restart=always onlyoffice/documentserver
The Document Server runs fine. When I open http://localhost I see "The Document Server is running..."
Then I tried to follow the Node.js example instructions
https://api.onlyoffice.com/editors/example/nodejs
The server is running fine. I did changed the config/default.json to have
{
"server": {
...
"siteUrl": "http://localhost"
}
}
The Node.js example also runs fine
But when I create a file... these errors appears:
This error means that Document Server doesn't have access to the storage and the Document editing service cannot upload the file for editing.
The link to the file specified in the document.url should be accessible from the document editing service. (from inside the container)
Both errors are describe here

Golang app on Heroku htaccess basic auth

Is possible use htaccess on golang application running in heroku??
I had read this link but the solution doesn't work for me (also, the command htpasswd is not recognized in the heroku bash, but I made the htpasswd file usin this tool).
Thank you.
A Go web application is a server so no need to use Apache httpd server, especially on Heroku that has crystal clear deployment instructions for Go :
https://devcenter.heroku.com/categories/go
Follow these instruction closely and you'll find out there is no need for Apache.
htaccess and htpasswd are related to Apache httpd server, they are Apache configuration files.
Finally, Go standard library gives you all the tools you need to implement basic auth yourself :
https://golang.org/pkg/net/http/#Request.BasicAuth

Can't open localhost in Microsoft Edge (Project Spartan) in Windows 10 preview

I installed Windows 10 preview and installed IIS.
Open "http://localhost" in Project Spartan can't connect.
IE has no problem. What's the problem?
So the issue is Spartan Edge doesn't have access to the loopback addresses, which is something that most Windows Store apps are blocked from accessing.
If you are using Windows 10 RTM or build 10166, this can be done by navigating to about:flags and checking "Allow localhost loopback":
Image courtesy of Ryan Joy and used with consent.
If you are using a previous build of Windows 10, the CheckNetIsolation tool can be used to add it to the LoopbackExempt list. Use this from an elevated command prompt:
CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"
Microsoft.MicrosoftEdge_8wekyb3d8bbwe is the identifier for the Edge app. It can be determined by using Get-AppxPackage in PowerShell and sifting through the results for the Spartan / Edge and using the PackageFamilyName.
As of Build 10158, the PackageFamilyName has changed from Microsoft.Windows.Spartan_cw5n1h2txyewy to Microsoft.MicrosoftEdge_8wekyb3d8bbwe.
Microsoft Edge runs with network isolation by default for security reasons. To enable loopback and debug your localhost server run the following command from an elevated shell if you have 10158 or newer:
CheckNetIsolation LoopbackExempt -a -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe
or
checknetisolation loopbackexempt -a -p=S-1-15-2-3624051433-2125758914-1423191267-1740899205-1073925389-3782572162-737981194
or this one if you have an older version
CheckNetIsolation LoopbackExempt -a -n=Microsoft.Windows.Spartan_cw5n1h2txyewy
In a future update, you’ll be able to enable localhost loopback support using about:flags.
For the latest build (10158), the following command did it for me:
CheckNetIsolation LoopbackExempt -a -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe
The trick is to use the Get-AppxPackage PowerShell command to find out the family name of Edge app as vcsjones mentioned.
As of Windows 10 Build 10166+ (available today via Windows Insider), localhost access is available by default in Microsoft Edge without running the CheckNetIsolation command listed in previous answers.
You can disable this access via "about:flags", if you wish to have an even more secure configuration.
Please follow to following steps:
1.
2.
Copy this code
CheckNetIsolation LoopbackExempt -a -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe
3.
**
Job Done!
Add subdomain to
C:\Windows\System32\drivers\etc\hosts
(Windows 10)
Navigate to C:\Windows\System32\drivers\etc
save hosts file copy for backup
open hosts file as administrator
delete or comment out any lines with 127.x.x.x or localhost...
restart pc.
Neither did the CheckNetIsolation LoopbackExempt -a -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe command nor manually enabling the "Allow localhost loopback" on Edge work for me.
What did work is the following:
Edit the C:\Windows\System32\drivers\etc\hosts file and add a mapping for a custom
hostname to 127.0.0.1 like 127.0.0.1 local.
Open Internet Options
and add http://local to the local intranet sites.

Docker 1.6 and Registy 2.0

Has anyone tried successfully the search command with Docker 1.6 and the new registry 2.0?
I've set mine up behind Nginx with SSL, and so far it is working fine. I can push and pull images without problems. But when I try to search for them all the following command give a 404 response:
curl -k -s -X GET https://username:password#my-docker-registry.com/v1/search
404 page not found
curl -k -s -X GET https://username:password#my-docker-registry.com/v2/search
404 page not found
root#ip-10-232-0-191:~# docker search username:password#my-docker-registry.com/hello-world
FATA[0000] Invalid repository name (admin:admin), only [a-z0-9-_.] are allowed
root#ip-10-232-0-191:~# docker search my-docker-registry.com/hello-world
FATA[0000] Error response from daemon: Unexpected status code 404
I wanted to ask if anyone has any ideas why and what is the correct way to use the Docker client to search the registry for images.
Looking at the API v2.0 documentation, do they simply not support a search function? Seems a bit strange to omit such functionality.
At least something works :)
root#ip-10-232-0-191:~# curl -k -s -X GET https://username:password#my-docker-registry.com/v2/hello-world/tags/list
{"name":"hello-world","tags":["latest"]}
To Date - the search api is lacking from registry v2.0.1 and this issue is under discussion here. I believe search api is intended to land in v2.1.
EDIT: /v2/catalog endpoint is available in distribution/registry:master
Before new registry api:
If you are using REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY you may list the contents of that directory
user#host:~# tree $REGISTRY_FS_ROOTDIR/docker/registry/v2/repositories -L 2
***/docker/registry/v2/repositories
└── repository1
└── image1
This may be useful to make a quick web ui you can call to do this or if you have ssh access to the host storing the repositories:
ssh -T user#host -p <port> tree $REGISTRY_FS_ROOTDIR/docker/registry/ -L 2
Do look at the compose example which deploys both v1 & v2 registry behind an nginx reverse proxy
The latest version of Docker Registry available from https://github.com/docker/distribution supports Catalog API. (v2/_catalog). This allows for capability to search repositories.
If interested, you can try docker image registry CLI I built to make it easy for using the search features in the new Docker Registry v2 distribution : (https://github.com/vivekjuneja/docker_registry_cli)
if you're on windows, here's a Powershell script to query the v2/_catalog from windows with basic http auth.
https://gist.github.com/so0k/b59382ea7fd959cf7040
FYI, to use this you have to docker pull distribution/registry:master instead of docker pull registry:2. the registry:2 image version is currently 2.0.1 which does not come with the catalog endpoint.

Resources